isaacscript-common 87.3.0 → 87.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cachedEnumValues.d.ts +15 -3
- package/dist/cachedEnumValues.d.ts.map +1 -1
- package/dist/core/constants.d.ts +5 -1
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/functions/string.d.ts +1 -1
- package/dist/functions/string.js +1 -1
- package/dist/functions/string.lua +1 -1
- package/dist/functions/utils.d.ts +11 -0
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.js +20 -1
- package/dist/functions/utils.lua +16 -0
- package/dist/index.rollup.d.ts +18 -2
- package/dist/isaacscript-common.lua +152 -1444
- package/dist/lualib_bundle.lua +39 -4
- package/dist/maps/defaultPlayerStatMap.d.ts +5 -1
- package/dist/maps/defaultPlayerStatMap.d.ts.map +1 -1
- package/dist/objects/doorSlotToDoorSlotFlag.d.ts +45 -9
- package/dist/objects/doorSlotToDoorSlotFlag.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +2 -2
- package/src/functions/string.ts +1 -1
- package/src/functions/utils.ts +29 -0
|
@@ -5,14 +5,26 @@ import { PlayerStat } from "./enums/PlayerStat";
|
|
|
5
5
|
import { SerializationBrand } from "./enums/private/SerializationBrand";
|
|
6
6
|
export declare const ACTIVE_SLOT_VALUES: readonly ActiveSlot[];
|
|
7
7
|
export declare const BOSS_ID_VALUES: readonly BossID[];
|
|
8
|
-
export declare const CACHE_FLAG_VALUES: readonly
|
|
8
|
+
export declare const CACHE_FLAG_VALUES: readonly (number & {
|
|
9
|
+
readonly __bitFlagBrand: symbol;
|
|
10
|
+
} & {
|
|
11
|
+
readonly __cacheFlagBrand: symbol;
|
|
12
|
+
})[];
|
|
9
13
|
export declare const CONTROLLER_INDEX_VALUES: readonly ControllerIndex[];
|
|
10
|
-
export declare const DOOR_SLOT_FLAG_VALUES: readonly
|
|
14
|
+
export declare const DOOR_SLOT_FLAG_VALUES: readonly (number & {
|
|
15
|
+
readonly __bitFlagBrand: symbol;
|
|
16
|
+
} & {
|
|
17
|
+
readonly __doorSlotFlagBrand: symbol;
|
|
18
|
+
})[];
|
|
11
19
|
export declare const DOOR_SLOT_VALUES: readonly DoorSlot[];
|
|
12
20
|
export declare const GRID_ENTITY_TYPE_VALUES: readonly GridEntityType[];
|
|
13
21
|
export declare const GRID_ENTITY_XML_TYPE_VALUES: readonly GridEntityXMLType[];
|
|
14
22
|
export declare const MOD_CALLBACK_CUSTOM_VALUES: readonly ModCallbackCustom[];
|
|
15
|
-
export declare const ITEM_CONFIG_TAG_VALUES: readonly
|
|
23
|
+
export declare const ITEM_CONFIG_TAG_VALUES: readonly (number & {
|
|
24
|
+
readonly __bitFlagBrand: symbol;
|
|
25
|
+
} & {
|
|
26
|
+
readonly __itemConfigTagBrand: symbol;
|
|
27
|
+
})[];
|
|
16
28
|
export declare const ITEM_CONFIG_CARD_TYPE_VALUES: readonly ItemConfigCardType[];
|
|
17
29
|
export declare const ITEM_POOL_TYPE_VALUES: readonly ItemPoolType[];
|
|
18
30
|
export declare const KEYBOARD_VALUES: readonly Keyboard[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cachedEnumValues.d.ts","sourceRoot":"","sources":["../src/cachedEnumValues.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,MAAM,EAEN,eAAe,EACf,QAAQ,EAER,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAElB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EACX,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE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M,kBAAkB,uBAA4B,CAAC;AAE5D,eAAO,MAAM,iBAAiB,sBAA2B,CAAC;AAE1D,eAAO,MAAM,kBAAkB,uBAA4B,CAAC;AAE5D,eAAO,MAAM,uBAAuB,2BAAgC,CAAC;AAErE,eAAO,MAAM,iBAAiB,sBAA2B,CAAC;AAE1D,eAAO,MAAM,YAAY,uBAA4B,CAAC;AAEtD,eAAO,MAAM,0BAA0B,+BAAoC,CAAC;AAE5E,eAAO,MAAM,mBAAmB,wBAA6B,CAAC;AAE9D,eAAO,MAAM,kBAAkB,uBAA4B,CAAC;AAE5D,eAAO,MAAM,mBAAmB,wBAA6B,CAAC"}
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -5,7 +5,11 @@ import { CollectibleType, Dimension, ItemPoolType, PickupVariant, PlayerType } f
|
|
|
5
5
|
* - `DisplayFlag.SHADOW` (1 << 1)
|
|
6
6
|
* - `DisplayFlag.SHOW_ICON` (1 << 2)
|
|
7
7
|
*/
|
|
8
|
-
export declare const ALL_DISPLAY_FLAGS: BitFlags<
|
|
8
|
+
export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
|
|
9
|
+
readonly __bitFlagBrand: symbol;
|
|
10
|
+
} & {
|
|
11
|
+
readonly __displayFlagBrand: symbol;
|
|
12
|
+
}>;
|
|
9
13
|
/**
|
|
10
14
|
* The distance of the laser when Azazel does not have any range up items yet. For more info, see
|
|
11
15
|
* the documentation for the `getAzazelBrimstoneDistance` function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EAET,YAAY,EACZ,aAAa,EACb,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAatC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,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AAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAS,CAAC;AAEvE,4CAA4C;AAC5C,eAAO,MAAM,8BAA8B,QAA4B,CAAC;AAExE,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,KAAkB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,SAAS,kBAA0B,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kBAA0B,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,iBAA4B,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAgC,CAAC"}
|
|
@@ -73,7 +73,7 @@ export declare function getPartialMatch(searchText: string, array: readonly stri
|
|
|
73
73
|
* Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
74
74
|
* undefined if the submitted string was not a proper Semantic Version string.
|
|
75
75
|
*
|
|
76
|
-
* https://semver.org/
|
|
76
|
+
* @see https://semver.org/
|
|
77
77
|
*/
|
|
78
78
|
export declare function parseSemanticVersion(versionString: string): {
|
|
79
79
|
majorVersion: int;
|
package/dist/functions/string.js
CHANGED
|
@@ -113,7 +113,7 @@ exports.getPartialMatch = getPartialMatch;
|
|
|
113
113
|
* Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
114
114
|
* undefined if the submitted string was not a proper Semantic Version string.
|
|
115
115
|
*
|
|
116
|
-
* https://semver.org/
|
|
116
|
+
* @see https://semver.org/
|
|
117
117
|
*/
|
|
118
118
|
function parseSemanticVersion(versionString) {
|
|
119
119
|
const [majorVersionString, minorVersionString, patchVersionString] = string.match(versionString, "(%d+).(%d+).(%d+)");
|
|
@@ -118,7 +118,7 @@ end
|
|
|
118
118
|
--- Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
119
119
|
-- undefined if the submitted string was not a proper Semantic Version string.
|
|
120
120
|
--
|
|
121
|
-
-- https://semver.org/
|
|
121
|
+
-- @see https ://semver.org/
|
|
122
122
|
function ____exports.parseSemanticVersion(self, versionString)
|
|
123
123
|
local majorVersionString, minorVersionString, patchVersionString = string.match(versionString, "(%d+).(%d+).(%d+)")
|
|
124
124
|
if majorVersionString == nil or minorVersionString == nil or patchVersionString == nil then
|
|
@@ -97,6 +97,17 @@ export declare function isMultiplayer(): boolean;
|
|
|
97
97
|
* https://bindingofisaacrebirth.fandom.com/wiki/V1.06.J818#Lua_Changes
|
|
98
98
|
*/
|
|
99
99
|
export declare function isRepentance(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Helper function to check if the player is using REPENTOGON, an exe-hack which expands the modding
|
|
102
|
+
* API.
|
|
103
|
+
*
|
|
104
|
+
* Although REPENTOGON has a `REPENTOGON` global to check if it's present, it is not safe to use as
|
|
105
|
+
* it can be overwritten by other mods.
|
|
106
|
+
*
|
|
107
|
+
* Specifically, this function checks for the `Sprite.Continue` method:
|
|
108
|
+
* https://repentogon.com/Sprite.html#continue
|
|
109
|
+
*/
|
|
110
|
+
export declare function isRepentogon(): boolean;
|
|
100
111
|
/**
|
|
101
112
|
* Helper function to repeat code N times. This is faster to type and cleaner than using a for loop.
|
|
102
113
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/functions/utils.ts"],"names":[],"mappings":";AAIA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EACR,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GAC7B,CAAC,MAAM,CAAC,GACR;IACE,iFAAiF;CAClF,GACJ,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAIx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AAY,IAAI,OAAO,CAiBtC;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAiBtC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAI7D;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAAG"}
|
package/dist/functions/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.todo = exports.repeat = exports.isRepentance = exports.isMultiplayer = exports.inRange = exports.iRange = exports.getTraversalDescription = exports.eRange = exports.assertNotNull = exports.assertDefined = void 0;
|
|
3
|
+
exports.todo = exports.repeat = exports.isRepentogon = exports.isRepentance = exports.isMultiplayer = exports.inRange = exports.iRange = exports.getTraversalDescription = exports.eRange = exports.assertNotNull = exports.assertDefined = void 0;
|
|
4
4
|
const ReadonlySet_1 = require("../types/ReadonlySet");
|
|
5
5
|
const playerIndex_1 = require("./playerIndex");
|
|
6
6
|
const types_1 = require("./types");
|
|
@@ -149,6 +149,25 @@ function isRepentance() {
|
|
|
149
149
|
return (0, types_1.isFunction)(getAnimation);
|
|
150
150
|
}
|
|
151
151
|
exports.isRepentance = isRepentance;
|
|
152
|
+
/**
|
|
153
|
+
* Helper function to check if the player is using REPENTOGON, an exe-hack which expands the modding
|
|
154
|
+
* API.
|
|
155
|
+
*
|
|
156
|
+
* Although REPENTOGON has a `REPENTOGON` global to check if it's present, it is not safe to use as
|
|
157
|
+
* it can be overwritten by other mods.
|
|
158
|
+
*
|
|
159
|
+
* Specifically, this function checks for the `Sprite.Continue` method:
|
|
160
|
+
* https://repentogon.com/Sprite.html#continue
|
|
161
|
+
*/
|
|
162
|
+
function isRepentogon() {
|
|
163
|
+
const metatable = getmetatable(Sprite);
|
|
164
|
+
assertDefined(metatable, "Failed to get the metatable of the Sprite global table.");
|
|
165
|
+
const classTable = metatable.get("__class");
|
|
166
|
+
assertDefined(classTable, 'Failed to get the "__class" key of the Sprite metatable.');
|
|
167
|
+
const getAnimation = classTable.get("Continue");
|
|
168
|
+
return (0, types_1.isFunction)(getAnimation);
|
|
169
|
+
}
|
|
170
|
+
exports.isRepentogon = isRepentogon;
|
|
152
171
|
/**
|
|
153
172
|
* Helper function to repeat code N times. This is faster to type and cleaner than using a for loop.
|
|
154
173
|
*
|
package/dist/functions/utils.lua
CHANGED
|
@@ -148,6 +148,22 @@ function ____exports.isRepentance(self)
|
|
|
148
148
|
local getAnimation = classTable.GetAnimation
|
|
149
149
|
return isFunction(nil, getAnimation)
|
|
150
150
|
end
|
|
151
|
+
--- Helper function to check if the player is using REPENTOGON, an exe-hack which expands the modding
|
|
152
|
+
-- API.
|
|
153
|
+
--
|
|
154
|
+
-- Although REPENTOGON has a `REPENTOGON` global to check if it's present, it is not safe to use as
|
|
155
|
+
-- it can be overwritten by other mods.
|
|
156
|
+
--
|
|
157
|
+
-- Specifically, this function checks for the `Sprite.Continue` method:
|
|
158
|
+
-- https://repentogon.com/Sprite.html#continue
|
|
159
|
+
function ____exports.isRepentogon(self)
|
|
160
|
+
local metatable = getmetatable(Sprite)
|
|
161
|
+
____exports.assertDefined(nil, metatable, "Failed to get the metatable of the Sprite global table.")
|
|
162
|
+
local classTable = metatable.__class
|
|
163
|
+
____exports.assertDefined(nil, classTable, "Failed to get the \"__class\" key of the Sprite metatable.")
|
|
164
|
+
local getAnimation = classTable.Continue
|
|
165
|
+
return isFunction(nil, getAnimation)
|
|
166
|
+
end
|
|
151
167
|
--- Helper function to repeat code N times. This is faster to type and cleaner than using a for loop.
|
|
152
168
|
--
|
|
153
169
|
-- For example:
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -947,7 +947,11 @@ export declare function addTrinketCostume(player: EntityPlayer, trinketType: Tri
|
|
|
947
947
|
* - `DisplayFlag.SHADOW` (1 << 1)
|
|
948
948
|
* - `DisplayFlag.SHOW_ICON` (1 << 2)
|
|
949
949
|
*/
|
|
950
|
-
export declare const ALL_DISPLAY_FLAGS: BitFlags<
|
|
950
|
+
export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
|
|
951
|
+
readonly __bitFlagBrand: symbol;
|
|
952
|
+
} & {
|
|
953
|
+
readonly __displayFlagBrand: symbol;
|
|
954
|
+
}>;
|
|
951
955
|
|
|
952
956
|
/** Helper type to create a new tuple containing all but the first element of another tuple. */
|
|
953
957
|
export declare type AllButFirst<T extends unknown[]> = T extends [
|
|
@@ -10054,6 +10058,18 @@ export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
|
|
|
10054
10058
|
*/
|
|
10055
10059
|
export declare function isRepentanceStage(stageType: StageType): boolean;
|
|
10056
10060
|
|
|
10061
|
+
/**
|
|
10062
|
+
* Helper function to check if the player is using REPENTOGON, an exe-hack which expands the modding
|
|
10063
|
+
* API.
|
|
10064
|
+
*
|
|
10065
|
+
* Although REPENTOGON has a `REPENTOGON` global to check if it's present, it is not safe to use as
|
|
10066
|
+
* it can be overwritten by other mods.
|
|
10067
|
+
*
|
|
10068
|
+
* Specifically, this function checks for the `Sprite.Continue` method:
|
|
10069
|
+
* https://repentogon.com/Sprite.html#continue
|
|
10070
|
+
*/
|
|
10071
|
+
export declare function isRepentogon(): boolean;
|
|
10072
|
+
|
|
10057
10073
|
/** Returns true for card types that have `ItemConfigCardType.TAROT_REVERSE`. */
|
|
10058
10074
|
export declare function isReverseTarotCard(cardType: CardType): boolean;
|
|
10059
10075
|
|
|
@@ -15363,7 +15379,7 @@ export declare function parseIntSafe(string: string): int | undefined;
|
|
|
15363
15379
|
* Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
15364
15380
|
* undefined if the submitted string was not a proper Semantic Version string.
|
|
15365
15381
|
*
|
|
15366
|
-
* https://semver.org/
|
|
15382
|
+
* @see https://semver.org/
|
|
15367
15383
|
*/
|
|
15368
15384
|
export declare function parseSemanticVersion(versionString: string): {
|
|
15369
15385
|
majorVersion: int;
|