isaacscript-common 6.23.0 → 7.1.1
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/callbacks/postPlayerChangeHealth.lua +8 -1
- package/dist/callbacks/postPlayerChangeStat.d.ts +3 -0
- package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -0
- package/dist/callbacks/postPlayerChangeStat.lua +88 -0
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +2 -2
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +9 -2
- package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts +12 -0
- package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postPlayerChangeStat.lua +35 -0
- package/dist/classes/DefaultMap.d.ts +3 -3
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/classes/DefaultMap.lua +37 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.lua +1 -1
- package/dist/enums/ModCallbackCustom.d.ts +70 -39
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +37 -35
- package/dist/enums/StatType.d.ts +28 -0
- package/dist/enums/StatType.d.ts.map +1 -0
- package/dist/enums/StatType.lua +28 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.lua +8 -0
- package/dist/enums/private/CopyableIsaacAPIClassType.d.ts +5 -1
- package/dist/enums/private/CopyableIsaacAPIClassType.d.ts.map +1 -1
- package/dist/enums/private/CopyableIsaacAPIClassType.lua +3 -1
- package/dist/enums/private/SerializationBrand.d.ts +1 -0
- package/dist/enums/private/SerializationBrand.d.ts.map +1 -1
- package/dist/enums/private/SerializationBrand.lua +1 -0
- package/dist/features/customStage/versusScreen.lua +2 -2
- package/dist/features/disableInputs.d.ts +1 -1
- package/dist/features/disableInputs.d.ts.map +1 -1
- package/dist/features/runInNFrames.lua +1 -6
- package/dist/features/runNextRoom.lua +1 -6
- package/dist/features/saveDataManager/exports.d.ts +1 -1
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/merge.d.ts +1 -0
- package/dist/features/saveDataManager/merge.d.ts.map +1 -1
- package/dist/features/saveDataManager/merge.lua +1 -0
- package/dist/functions/bitSet128.d.ts +25 -0
- package/dist/functions/bitSet128.d.ts.map +1 -0
- package/dist/functions/bitSet128.lua +71 -0
- package/dist/functions/collectibles.d.ts +2 -2
- package/dist/functions/collectibles.lua +2 -2
- package/dist/functions/color.d.ts +1 -1
- package/dist/functions/color.d.ts.map +1 -1
- package/dist/functions/color.lua +2 -2
- package/dist/functions/deepCopy.d.ts +1 -0
- package/dist/functions/deepCopy.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +2 -1
- package/dist/functions/familiars.d.ts +4 -4
- package/dist/functions/familiars.lua +4 -4
- package/dist/functions/flag.d.ts +1 -1
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/index.d.ts +2 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.lua +16 -0
- package/dist/functions/jsonRoom.lua +4 -4
- package/dist/functions/kColor.d.ts +1 -1
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/kColor.lua +2 -2
- package/dist/functions/log.lua +1 -1
- package/dist/functions/npcs.d.ts +2 -2
- package/dist/functions/npcs.lua +2 -2
- package/dist/functions/playerIndex.d.ts +1 -1
- package/dist/functions/playerIndex.lua +1 -1
- package/dist/functions/playerStats.d.ts +6 -0
- package/dist/functions/playerStats.d.ts.map +1 -0
- package/dist/functions/playerStats.lua +21 -0
- package/dist/functions/players.d.ts +1 -1
- package/dist/functions/players.lua +1 -1
- package/dist/functions/rng.d.ts +1 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/rng.lua +2 -2
- package/dist/functions/roomTransition.d.ts +1 -1
- package/dist/functions/roomTransition.lua +1 -1
- package/dist/functions/rooms.d.ts +1 -1
- package/dist/functions/rooms.lua +1 -1
- package/dist/functions/sprites.d.ts +3 -3
- package/dist/functions/sprites.lua +3 -3
- package/dist/functions/tears.d.ts +5 -4
- package/dist/functions/tears.d.ts.map +1 -1
- package/dist/functions/tears.lua +5 -4
- package/dist/functions/utils.d.ts +4 -1
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.lua +4 -1
- package/dist/functions/vector.d.ts +1 -1
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/functions/vector.lua +2 -2
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +3 -0
- package/dist/interfaces/SaveData.d.ts +17 -10
- package/dist/interfaces/SaveData.d.ts.map +1 -1
- package/dist/interfaces/SaveData.lua +66 -0
- package/dist/interfaces/StatTypeType.d.ts +17 -0
- package/dist/interfaces/StatTypeType.d.ts.map +1 -0
- package/dist/interfaces/StatTypeType.lua +4 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/private/AddCallbackParameterCustom.d.ts +2 -0
- package/dist/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +3 -0
- package/dist/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
- package/dist/objects/isaacAPIClassTypeToBrand.lua +7 -1
- package/dist/objects/isaacAPIClassTypeToFunctions.d.ts.map +1 -1
- package/dist/objects/isaacAPIClassTypeToFunctions.lua +12 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/postPlayerChangeHealth.ts +7 -1
- package/src/callbacks/postPlayerChangeStat.ts +110 -0
- package/src/callbacks/subscriptions/postPlayerChangeHealth.ts +5 -1
- package/src/callbacks/subscriptions/postPlayerChangeStat.ts +55 -0
- package/src/classes/DefaultMap.ts +36 -7
- package/src/core/constants.ts +1 -1
- package/src/enums/ModCallbackCustom.ts +36 -4
- package/src/enums/StatType.ts +47 -0
- package/src/enums/index.ts +1 -0
- package/src/enums/indexTypeDoc.ts +1 -0
- package/src/enums/private/CopyableIsaacAPIClassType.ts +5 -1
- package/src/enums/private/SerializationBrand.ts +1 -0
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/disableInputs.ts +3 -9
- package/src/features/runInNFrames.ts +1 -1
- package/src/features/runNextRoom.ts +1 -1
- package/src/features/saveDataManager/exports.ts +1 -1
- package/src/features/saveDataManager/merge.ts +1 -0
- package/src/functions/bitSet128.ts +96 -0
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/color.ts +3 -2
- package/src/functions/deepCopy.ts +2 -1
- package/src/functions/familiars.ts +4 -4
- package/src/functions/flag.ts +1 -1
- package/src/functions/index.ts +2 -0
- package/src/functions/indexTypeDoc.ts +2 -0
- package/src/functions/jsonRoom.ts +4 -4
- package/src/functions/kColor.ts +2 -2
- package/src/functions/log.ts +1 -1
- package/src/functions/npcs.ts +2 -2
- package/src/functions/playerIndex.ts +1 -1
- package/src/functions/playerStats.ts +25 -0
- package/src/functions/players.ts +1 -1
- package/src/functions/rng.ts +2 -2
- package/src/functions/roomTransition.ts +1 -1
- package/src/functions/rooms.ts +1 -1
- package/src/functions/sprites.ts +3 -3
- package/src/functions/tears.ts +5 -4
- package/src/functions/utils.ts +5 -1
- package/src/functions/vector.ts +2 -2
- package/src/initCustomCallbacks.ts +2 -0
- package/src/interfaces/SaveData.ts +224 -26
- package/src/interfaces/StatTypeType.ts +17 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/indexTypeDoc.ts +1 -0
- package/src/interfaces/private/AddCallbackParameterCustom.ts +2 -0
- package/src/objects/callbackRegisterFunctions.ts +2 -0
- package/src/objects/isaacAPIClassTypeToBrand.ts +1 -0
- package/src/objects/isaacAPIClassTypeToFunctions.ts +12 -0
- package/src/types/index.ts +0 -1
- package/src/types/indexTypeDoc.ts +0 -1
- package/dist/types/AnyClass.d.ts +0 -2
- package/dist/types/AnyClass.d.ts.map +0 -1
- package/dist/types/AnyClass.lua +0 -2
- package/src/types/AnyClass.ts +0 -1
|
@@ -39,7 +39,7 @@ export declare function enableAllInputsExceptFor(key: string, blacklist: Set<But
|
|
|
39
39
|
* that multiple mod features can work in tandem.
|
|
40
40
|
* @param whitelist A set of ButtonActions to allow.
|
|
41
41
|
*/
|
|
42
|
-
export declare function disableAllInputsExceptFor(key: string, whitelist: Set<ButtonAction>): void;
|
|
42
|
+
export declare function disableAllInputsExceptFor(key: string, whitelist: Set<ButtonAction> | ReadonlySet<ButtonAction>): void;
|
|
43
43
|
/**
|
|
44
44
|
* Helper function to disable only the inputs used for moving the character (or moving the cursor in
|
|
45
45
|
* the UI). This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disableInputs.d.ts","sourceRoot":"","sources":["../../src/features/disableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"disableInputs.d.ts","sourceRoot":"","sources":["../../src/features/disableInputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAiBtC,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAoBhD;AA+CD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,GACvD,IAAI,CAKN;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGvD"}
|
|
@@ -60,12 +60,7 @@ end
|
|
|
60
60
|
local FEATURE_NAME = "runInNFrames"
|
|
61
61
|
v = {run = {queuedGameFunctionTuples = {}, queuedRenderFunctionTuples = {}, intervalGameFunctionTuples = {}, intervalRenderFunctionTuples = {}}}
|
|
62
62
|
function ____exports.runInNFramesInit(self, mod)
|
|
63
|
-
saveDataManager(
|
|
64
|
-
nil,
|
|
65
|
-
FEATURE_NAME,
|
|
66
|
-
v,
|
|
67
|
-
function() return false end
|
|
68
|
-
)
|
|
63
|
+
saveDataManager(nil, FEATURE_NAME, v, false)
|
|
69
64
|
mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
|
|
70
65
|
mod:AddCallback(ModCallback.POST_RENDER, postRender)
|
|
71
66
|
end
|
|
@@ -17,12 +17,7 @@ end
|
|
|
17
17
|
local FEATURE_NAME = "runNextRoom"
|
|
18
18
|
v = {run = {queuedFunctions = {}}}
|
|
19
19
|
function ____exports.runNextRoomInit(self, mod)
|
|
20
|
-
saveDataManager(
|
|
21
|
-
nil,
|
|
22
|
-
FEATURE_NAME,
|
|
23
|
-
v,
|
|
24
|
-
function() return false end
|
|
25
|
-
)
|
|
20
|
+
saveDataManager(nil, FEATURE_NAME, v, false)
|
|
26
21
|
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
27
22
|
end
|
|
28
23
|
--- Supply a function to run on the next `POST_NEW_ROOM` callback.
|
|
@@ -92,7 +92,7 @@ import { SaveData } from "../../interfaces/SaveData";
|
|
|
92
92
|
export declare function saveDataManager<Persistent, Run, Level>(key: string, // This is the overload for the standard case with serializable data.
|
|
93
93
|
v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
|
|
94
94
|
export declare function saveDataManager(key: string, // This is the overload for the case when saving data is disabled.
|
|
95
|
-
v: SaveData
|
|
95
|
+
v: SaveData, conditionalFunc: false): void;
|
|
96
96
|
/**
|
|
97
97
|
* The save data manager will automatically load variables from disk at the appropriate times (i.e.
|
|
98
98
|
* when a new run is started). Use this function to explicitly force the save data manager to load
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EACpD,GAAG,EAAE,MAAM,EAAE,qEAAqE;AAClF,CAAC,EAAE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,EACnC,eAAe,CAAC,EAAE,MAAM,OAAO,GAC9B,IAAI,CAAC;AACR,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EAAE,kEAAkE;AAC/E,CAAC,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EACpD,GAAG,EAAE,MAAM,EAAE,qEAAqE;AAClF,CAAC,EAAE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,EACnC,eAAe,CAAC,EAAE,MAAM,OAAO,GAC9B,IAAI,CAAC;AACR,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EAAE,kEAAkE;AAC/E,CAAC,EAAE,QAAQ,EACX,eAAe,EAAE,KAAK,GACrB,IAAI,CAAC;AA+CR;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAQD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAK/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GACrB,IAAI,CAiBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/merge.ts"],"names":[],"mappings":";AAgBA
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/merge.ts"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CACnB,SAAS,EACL,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAC1B,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,GACvB,GAAG,CAAC,SAAS,CAAC,EAClB,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACpC,oBAAoB,EAAE,MAAM,GAC3B,IAAI,CA2BN"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
+
export declare type SerializedBitSet128 = LuaMap<string, unknown> & {
|
|
4
|
+
readonly __serializedBitSet128Brand: symbol;
|
|
5
|
+
};
|
|
6
|
+
/** Helper function to copy a `BitSet128` Isaac API class. */
|
|
7
|
+
export declare function copyBitSet128(bitSet128: BitSet128): BitSet128;
|
|
8
|
+
/**
|
|
9
|
+
* Helper function to convert a `SerializedBitSet128` object to a normal `BitSet128` object. (This
|
|
10
|
+
* is used by the save data manager when reading data from the "save#.dat" file.)
|
|
11
|
+
*/
|
|
12
|
+
export declare function deserializeBitSet128(bitSet128: SerializedBitSet128): BitSet128;
|
|
13
|
+
/** Helper function to check if something is an instantiated `BitSet128` object. */
|
|
14
|
+
export declare function isBitSet128(object: unknown): object is BitSet128;
|
|
15
|
+
/**
|
|
16
|
+
* Used to determine is the given table is a serialized `BitSet128` object created by the save data
|
|
17
|
+
* manager and/or the `deepCopy` function.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isSerializedBitSet128(object: unknown): object is SerializedBitSet128;
|
|
20
|
+
/**
|
|
21
|
+
* Helper function to convert a `BitSet128` object to a `SerializedBitSet128` object. (This is used
|
|
22
|
+
* by the save data manager when writing data from the "save#.dat" file.)
|
|
23
|
+
*/
|
|
24
|
+
export declare function serializeBitSet128(bitSet128: BitSet128): SerializedBitSet128;
|
|
25
|
+
//# sourceMappingURL=bitSet128.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitSet128.d.ts","sourceRoot":"","sources":["../../src/functions/bitSet128.ts"],"names":[],"mappings":";;AAKA,oBAAY,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1D,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;CAC7C,CAAC;AAKF,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAW7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,mBAAmB,GAC7B,SAAS,CAyBX;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,SAAS,CAEhE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,mBAAmB,CAQ/B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAW5E"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local OBJECT_NAME
|
|
3
|
+
local ____SerializationBrand = require("enums.private.SerializationBrand")
|
|
4
|
+
local SerializationBrand = ____SerializationBrand.SerializationBrand
|
|
5
|
+
local ____isaacAPIClass = require("functions.isaacAPIClass")
|
|
6
|
+
local isIsaacAPIClassOfType = ____isaacAPIClass.isIsaacAPIClassOfType
|
|
7
|
+
local ____table = require("functions.table")
|
|
8
|
+
local copyValuesToTable = ____table.copyValuesToTable
|
|
9
|
+
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
10
|
+
local tableHasKeys = ____table.tableHasKeys
|
|
11
|
+
local ____types = require("functions.types")
|
|
12
|
+
local isTable = ____types.isTable
|
|
13
|
+
--- Helper function to check if something is an instantiated `BitSet128` object.
|
|
14
|
+
function ____exports.isBitSet128(self, object)
|
|
15
|
+
return isIsaacAPIClassOfType(nil, object, OBJECT_NAME)
|
|
16
|
+
end
|
|
17
|
+
OBJECT_NAME = "BitSet128"
|
|
18
|
+
local KEYS = {"l", "h"}
|
|
19
|
+
--- Helper function to copy a `BitSet128` Isaac API class.
|
|
20
|
+
function ____exports.copyBitSet128(self, bitSet128)
|
|
21
|
+
if not ____exports.isBitSet128(nil, bitSet128) then
|
|
22
|
+
error(((("Failed to copy a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
23
|
+
end
|
|
24
|
+
local lowBits = bitSet128.l
|
|
25
|
+
local highBits = bitSet128.h
|
|
26
|
+
return BitSet128(lowBits, highBits)
|
|
27
|
+
end
|
|
28
|
+
--- Helper function to convert a `SerializedBitSet128` object to a normal `BitSet128` object. (This
|
|
29
|
+
-- is used by the save data manager when reading data from the "save#.dat" file.)
|
|
30
|
+
function ____exports.deserializeBitSet128(self, bitSet128)
|
|
31
|
+
if not isTable(nil, bitSet128) then
|
|
32
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object was not a Lua table.")
|
|
33
|
+
end
|
|
34
|
+
local l, h = table.unpack(getNumbersFromTable(
|
|
35
|
+
nil,
|
|
36
|
+
bitSet128,
|
|
37
|
+
OBJECT_NAME,
|
|
38
|
+
table.unpack(KEYS)
|
|
39
|
+
))
|
|
40
|
+
if l == nil then
|
|
41
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: l")
|
|
42
|
+
end
|
|
43
|
+
if h == nil then
|
|
44
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: h")
|
|
45
|
+
end
|
|
46
|
+
return BitSet128(l, h)
|
|
47
|
+
end
|
|
48
|
+
--- Used to determine is the given table is a serialized `BitSet128` object created by the save data
|
|
49
|
+
-- manager and/or the `deepCopy` function.
|
|
50
|
+
function ____exports.isSerializedBitSet128(self, object)
|
|
51
|
+
if not isTable(nil, object) then
|
|
52
|
+
return false
|
|
53
|
+
end
|
|
54
|
+
return tableHasKeys(
|
|
55
|
+
nil,
|
|
56
|
+
object,
|
|
57
|
+
table.unpack(KEYS)
|
|
58
|
+
) and object[SerializationBrand.BIT_SET_128] ~= nil
|
|
59
|
+
end
|
|
60
|
+
--- Helper function to convert a `BitSet128` object to a `SerializedBitSet128` object. (This is used
|
|
61
|
+
-- by the save data manager when writing data from the "save#.dat" file.)
|
|
62
|
+
function ____exports.serializeBitSet128(self, bitSet128)
|
|
63
|
+
if not ____exports.isBitSet128(nil, bitSet128) then
|
|
64
|
+
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
65
|
+
end
|
|
66
|
+
local bitSet128Table = {}
|
|
67
|
+
copyValuesToTable(nil, bitSet128, KEYS, bitSet128Table)
|
|
68
|
+
bitSet128Table[SerializationBrand.BIT_SET_128] = ""
|
|
69
|
+
return bitSet128Table
|
|
70
|
+
end
|
|
71
|
+
return ____exports
|
|
@@ -218,8 +218,8 @@ export declare function setCollectibleGlitched(collectible: EntityPickup): void;
|
|
|
218
218
|
*/
|
|
219
219
|
export declare function setCollectibleSprite(collectible: EntityPickup, pngPath: string | undefined): void;
|
|
220
220
|
/**
|
|
221
|
-
* Helper function to change the collectible on a pedestal. Simply updating the `SubType`
|
|
222
|
-
*
|
|
221
|
+
* Helper function to change the collectible on a pedestal. Simply updating the `SubType` field is
|
|
222
|
+
* not sufficient because the sprite will not change.
|
|
223
223
|
*/
|
|
224
224
|
export declare function setCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType): void;
|
|
225
225
|
/**
|
|
@@ -84,8 +84,8 @@ function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
|
84
84
|
sprite:LoadGraphics()
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
|
-
--- Helper function to change the collectible on a pedestal. Simply updating the `SubType`
|
|
88
|
-
--
|
|
87
|
+
--- Helper function to change the collectible on a pedestal. Simply updating the `SubType` field is
|
|
88
|
+
-- not sufficient because the sprite will not change.
|
|
89
89
|
function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
|
|
90
90
|
if not isCollectible(nil, collectible) then
|
|
91
91
|
local entityID = getEntityID(nil, collectible)
|
|
@@ -21,7 +21,7 @@ export declare function deserializeColor(color: SerializedColor): Color;
|
|
|
21
21
|
* @param alpha Optional. The alpha value to use. Default is 1.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Color;
|
|
24
|
-
/** Helper function to check if something is an instantiated Color object. */
|
|
24
|
+
/** Helper function to check if something is an instantiated `Color` object. */
|
|
25
25
|
export declare function isColor(object: unknown): object is Color;
|
|
26
26
|
/**
|
|
27
27
|
* Used to determine is the given table is a serialized `Color` object created by the save data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/functions/color.ts"],"names":[],"mappings":";;;;AAOA,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;CACzC,CAAC;AAKF,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAEjE;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAgB7C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CA8B9D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,KAAK,CAQP;AAED
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/functions/color.ts"],"names":[],"mappings":";;;;AAOA,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;CACzC,CAAC;AAKF,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAEjE;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAgB7C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CA8B9D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,KAAK,CAQP;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,KAAK,CAExD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,eAAe,CAM5E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAW5D"}
|
package/dist/functions/color.lua
CHANGED
|
@@ -17,10 +17,11 @@ local getNumbersFromTable = ____table.getNumbersFromTable
|
|
|
17
17
|
local tableHasKeys = ____table.tableHasKeys
|
|
18
18
|
local ____types = require("functions.types")
|
|
19
19
|
local isTable = ____types.isTable
|
|
20
|
-
--- Helper function to check if something is an instantiated Color object.
|
|
20
|
+
--- Helper function to check if something is an instantiated `Color` object.
|
|
21
21
|
function ____exports.isColor(self, object)
|
|
22
22
|
return isIsaacAPIClassOfType(nil, object, OBJECT_NAME)
|
|
23
23
|
end
|
|
24
|
+
OBJECT_NAME = "Color"
|
|
24
25
|
local KEYS = {
|
|
25
26
|
"R",
|
|
26
27
|
"G",
|
|
@@ -30,7 +31,6 @@ local KEYS = {
|
|
|
30
31
|
"GO",
|
|
31
32
|
"BO"
|
|
32
33
|
}
|
|
33
|
-
OBJECT_NAME = "Color"
|
|
34
34
|
function ____exports.colorEquals(self, color1, color2)
|
|
35
35
|
return isaacAPIClassEquals(nil, color1, color2, KEYS)
|
|
36
36
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA6B/D
|
|
1
|
+
{"version":3,"file":"deepCopy.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA6B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,OAAO,EACd,iBAAiB,oBAAyB,EAC1C,oBAAoB,SAAK,EACzB,SAAS,UAAQ,GAChB,OAAO,CAkDT"}
|
|
@@ -56,6 +56,7 @@ local twoDimensionalSort = ____utils.twoDimensionalSort
|
|
|
56
56
|
-- - TSTL `Set`
|
|
57
57
|
-- - TSTL classes
|
|
58
58
|
-- - `DefaultMap`
|
|
59
|
+
-- - Isaac `BitSet128` objects
|
|
59
60
|
-- - Isaac `Color` objects
|
|
60
61
|
-- - Isaac `KColor` objects
|
|
61
62
|
-- - Isaac `RNG` objects
|
|
@@ -210,7 +211,7 @@ function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescri
|
|
|
210
211
|
local constructorArg = ____isDefaultMap_result_0
|
|
211
212
|
if serializationType == SerializationType.SERIALIZE and not isPrimitive(nil, constructorArg) then
|
|
212
213
|
if insideMap then
|
|
213
|
-
error("Failed to deep copy a DefaultMap because it was instantiated with a factory function and was also inside of
|
|
214
|
+
error("Failed to deep copy a DefaultMap because it was instantiated with a factory function and was also inside of an array, map, or set. For more information, see: https://isaacscript.github.io/main/gotchas#failed-to-deep-copy-a-defaultmap")
|
|
214
215
|
else
|
|
215
216
|
return deepCopyMap(
|
|
216
217
|
nil,
|
|
@@ -7,8 +7,8 @@ import { CollectibleType, FamiliarVariant } from "isaac-typescript-definitions";
|
|
|
7
7
|
* specify an incorrect RNG object. (The vanilla method is bugged in that it does not increment the
|
|
8
8
|
* RNG object; see the documentation of the method for more details.)
|
|
9
9
|
*
|
|
10
|
-
* This function is meant to be called in the
|
|
11
|
-
* to `CacheFlag.FAMILIARS`).
|
|
10
|
+
* This function is meant to be called in the `EVALUATE_CACHE` callback (when the cache flag is
|
|
11
|
+
* equal to `CacheFlag.FAMILIARS`).
|
|
12
12
|
*
|
|
13
13
|
* Note that this function is only meant to be used in special circumstances where the familiar
|
|
14
14
|
* count is completely custom and does not correspond to the amount of collectibles. For the general
|
|
@@ -36,8 +36,8 @@ export declare function checkFamiliar(player: EntityPlayer, collectibleType: Col
|
|
|
36
36
|
* Use this helper function instead of invoking the `EntityPlayer.CheckFamiliar` method directly so
|
|
37
37
|
* that the target count is handled automatically.
|
|
38
38
|
*
|
|
39
|
-
* This function is meant to be called in the
|
|
40
|
-
* to `CacheFlag.FAMILIARS`).
|
|
39
|
+
* This function is meant to be called in the `EVALUATE_CACHE` callback (when the cache flag is
|
|
40
|
+
* equal to `CacheFlag.FAMILIARS`).
|
|
41
41
|
*
|
|
42
42
|
* Use this function when the amount of familiars should be equal to the amount of associated
|
|
43
43
|
* collectibles that the player has (plus any extras from having used Box of Friends or Monster
|
|
@@ -14,8 +14,8 @@ local getFamiliars = ____entitiesSpecific.getFamiliars
|
|
|
14
14
|
-- specify an incorrect RNG object. (The vanilla method is bugged in that it does not increment the
|
|
15
15
|
-- RNG object; see the documentation of the method for more details.)
|
|
16
16
|
--
|
|
17
|
-
-- This function is meant to be called in the
|
|
18
|
-
-- to `CacheFlag.FAMILIARS`).
|
|
17
|
+
-- This function is meant to be called in the `EVALUATE_CACHE` callback (when the cache flag is
|
|
18
|
+
-- equal to `CacheFlag.FAMILIARS`).
|
|
19
19
|
--
|
|
20
20
|
-- Note that this function is only meant to be used in special circumstances where the familiar
|
|
21
21
|
-- count is completely custom and does not correspond to the amount of collectibles. For the general
|
|
@@ -50,8 +50,8 @@ end
|
|
|
50
50
|
-- Use this helper function instead of invoking the `EntityPlayer.CheckFamiliar` method directly so
|
|
51
51
|
-- that the target count is handled automatically.
|
|
52
52
|
--
|
|
53
|
-
-- This function is meant to be called in the
|
|
54
|
-
-- to `CacheFlag.FAMILIARS`).
|
|
53
|
+
-- This function is meant to be called in the `EVALUATE_CACHE` callback (when the cache flag is
|
|
54
|
+
-- equal to `CacheFlag.FAMILIARS`).
|
|
55
55
|
--
|
|
56
56
|
-- Use this function when the amount of familiars should be equal to the amount of associated
|
|
57
57
|
-- collectibles that the player has (plus any extras from having used Box of Friends or Monster
|
package/dist/functions/flag.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare function addFlag<T extends BitFlag | BitFlag128>(flags: T | BitFl
|
|
|
29
29
|
* Helper function for casting a flag enum value to a `BitFlags` object.
|
|
30
30
|
*
|
|
31
31
|
* This is useful because the compiler will prevent you from assigning a specific flag to a
|
|
32
|
-
* `BitFlags`
|
|
32
|
+
* `BitFlags` field. (It does this to ensure type safety, since `BitFlags` can represent a zero
|
|
33
33
|
* value or a composition of N flags.)
|
|
34
34
|
*
|
|
35
35
|
* For example:
|
package/dist/functions/flag.lua
CHANGED
|
@@ -35,7 +35,7 @@ end
|
|
|
35
35
|
--- Helper function for casting a flag enum value to a `BitFlags` object.
|
|
36
36
|
--
|
|
37
37
|
-- This is useful because the compiler will prevent you from assigning a specific flag to a
|
|
38
|
-
-- `BitFlags`
|
|
38
|
+
-- `BitFlags` field. (It does this to ensure type safety, since `BitFlags` can represent a zero
|
|
39
39
|
-- value or a composition of N flags.)
|
|
40
40
|
--
|
|
41
41
|
-- For example:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./ambush";
|
|
2
2
|
export * from "./array";
|
|
3
3
|
export * from "./benchmark";
|
|
4
|
+
export * from "./bitSet128";
|
|
4
5
|
export * from "./bitwise";
|
|
5
6
|
export * from "./bombs";
|
|
6
7
|
export * from "./bosses";
|
|
@@ -61,6 +62,7 @@ export * from "./playerDataStructures";
|
|
|
61
62
|
export * from "./playerHealth";
|
|
62
63
|
export * from "./playerIndex";
|
|
63
64
|
export * from "./players";
|
|
65
|
+
export * from "./playerStats";
|
|
64
66
|
export * from "./pocketItems";
|
|
65
67
|
export * from "./positionVelocity";
|
|
66
68
|
export * from "./pressurePlate";
|
|
@@ -1 +1 @@
|
|
|
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CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
package/dist/functions/index.lua
CHANGED
|
@@ -23,6 +23,14 @@ do
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
|
+
do
|
|
27
|
+
local ____export = require("functions.bitSet128")
|
|
28
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
29
|
+
if ____exportKey ~= "default" then
|
|
30
|
+
____exports[____exportKey] = ____exportValue
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
26
34
|
do
|
|
27
35
|
local ____export = require("functions.bitwise")
|
|
28
36
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -503,6 +511,14 @@ do
|
|
|
503
511
|
end
|
|
504
512
|
end
|
|
505
513
|
end
|
|
514
|
+
do
|
|
515
|
+
local ____export = require("functions.playerStats")
|
|
516
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
517
|
+
if ____exportKey ~= "default" then
|
|
518
|
+
____exports[____exportKey] = ____exportValue
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
end
|
|
506
522
|
do
|
|
507
523
|
local ____export = require("functions.pocketItems")
|
|
508
524
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -52,7 +52,7 @@ function ____exports.getJSONRoomDoorSlotFlags(self, jsonRoom)
|
|
|
52
52
|
local roomShapeString = jsonRoom["$"].shape
|
|
53
53
|
local roomShapeNumber = tonumber(roomShapeString)
|
|
54
54
|
if roomShapeNumber == nil then
|
|
55
|
-
error("Failed to parse the \"shape\"
|
|
55
|
+
error("Failed to parse the \"shape\" field of a JSON room: " .. roomShapeString)
|
|
56
56
|
end
|
|
57
57
|
local roomShape = roomShapeNumber
|
|
58
58
|
local doorSlotFlags = DoorSlotFlagZero
|
|
@@ -60,7 +60,7 @@ function ____exports.getJSONRoomDoorSlotFlags(self, jsonRoom)
|
|
|
60
60
|
do
|
|
61
61
|
local existsString = door["$"].exists
|
|
62
62
|
if existsString ~= "True" and existsString ~= "False" then
|
|
63
|
-
error("Failed to parse the \"exists\"
|
|
63
|
+
error("Failed to parse the \"exists\" field of a JSON room door: " .. existsString)
|
|
64
64
|
end
|
|
65
65
|
if existsString == "False" then
|
|
66
66
|
goto __continue4
|
|
@@ -68,12 +68,12 @@ function ____exports.getJSONRoomDoorSlotFlags(self, jsonRoom)
|
|
|
68
68
|
local xString = door["$"].x
|
|
69
69
|
local x = tonumber(xString)
|
|
70
70
|
if x == nil then
|
|
71
|
-
error("Failed to parse the \"x\"
|
|
71
|
+
error("Failed to parse the \"x\" field of a JSON room door: " .. xString)
|
|
72
72
|
end
|
|
73
73
|
local yString = door["$"].y
|
|
74
74
|
local y = tonumber(yString)
|
|
75
75
|
if y == nil then
|
|
76
|
-
error("Failed to parse the \"y\"
|
|
76
|
+
error("Failed to parse the \"y\" field of a JSON room door: " .. yString)
|
|
77
77
|
end
|
|
78
78
|
local doorSlot = getRoomShapeDoorSlot(nil, roomShape, x, y)
|
|
79
79
|
if doorSlot == nil then
|
|
@@ -20,7 +20,7 @@ export declare function deserializeKColor(kColor: SerializedKColor): KColor;
|
|
|
20
20
|
* @param alpha Optional. The alpha value to use. Default is 1.
|
|
21
21
|
*/
|
|
22
22
|
export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): KColor;
|
|
23
|
-
/** Helper function to check if something is an instantiated KColor object. */
|
|
23
|
+
/** Helper function to check if something is an instantiated `KColor` object. */
|
|
24
24
|
export declare function isKColor(object: unknown): object is KColor;
|
|
25
25
|
/**
|
|
26
26
|
* Used to determine is the given table is a serialized `KColor` object created by the save data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kColor.d.ts","sourceRoot":"","sources":["../../src/functions/kColor.ts"],"names":[],"mappings":";;;;AAOA,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmClE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,MAAM,CAQR;AAED,
|
|
1
|
+
{"version":3,"file":"kColor.d.ts","sourceRoot":"","sources":["../../src/functions/kColor.ts"],"names":[],"mappings":";;;;AAOA,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC;AAKF,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmClE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,KAAK,SAAI,GACR,MAAM,CAQR;AAED,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,gBAAgB,CAQ5B;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAWhE"}
|
|
@@ -17,12 +17,12 @@ local getNumbersFromTable = ____table.getNumbersFromTable
|
|
|
17
17
|
local tableHasKeys = ____table.tableHasKeys
|
|
18
18
|
local ____types = require("functions.types")
|
|
19
19
|
local isTable = ____types.isTable
|
|
20
|
-
--- Helper function to check if something is an instantiated KColor object.
|
|
20
|
+
--- Helper function to check if something is an instantiated `KColor` object.
|
|
21
21
|
function ____exports.isKColor(self, object)
|
|
22
22
|
return isIsaacAPIClassOfType(nil, object, OBJECT_NAME)
|
|
23
23
|
end
|
|
24
|
-
local KEYS = {"Red", "Green", "Blue", "Alpha"}
|
|
25
24
|
OBJECT_NAME = "KColor"
|
|
25
|
+
local KEYS = {"Red", "Green", "Blue", "Alpha"}
|
|
26
26
|
--- Helper function to copy a `KColor` Isaac API class.
|
|
27
27
|
function ____exports.copyKColor(self, kColor)
|
|
28
28
|
if not ____exports.isKColor(nil, kColor) then
|
package/dist/functions/log.lua
CHANGED
|
@@ -369,7 +369,7 @@ end
|
|
|
369
369
|
--- Helper function to enumerate all of the properties of a "userdata" object (i.e. an object from
|
|
370
370
|
-- the Isaac API).
|
|
371
371
|
function ____exports.logUserdata(userdata)
|
|
372
|
-
if isUserdata(nil, userdata) then
|
|
372
|
+
if not isUserdata(nil, userdata) then
|
|
373
373
|
____exports.log("Userdata: [not userdata]")
|
|
374
374
|
return
|
|
375
375
|
end
|
package/dist/functions/npcs.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export declare function isAliveExceptionNPC(npc: EntityNPC): boolean;
|
|
|
24
24
|
* that is spawned when the boss does the multi-stomp attack.
|
|
25
25
|
*
|
|
26
26
|
* When this attack occurs, four extra copies of Daddy Long Legs will be spawned with the same
|
|
27
|
-
* entity type, variant, and sub-type. The `Entity.Parent`
|
|
28
|
-
*
|
|
27
|
+
* entity type, variant, and sub-type. The `Entity.Parent` field will be undefined in this case, so
|
|
28
|
+
* the way to tell them apart is to check for a non-undefined `Entity.SpawnerEntity` field.
|
|
29
29
|
*/
|
|
30
30
|
export declare function isDaddyLongLegsChildStompEntity(npc: EntityNPC): boolean;
|
|
31
31
|
/**
|
package/dist/functions/npcs.lua
CHANGED
|
@@ -50,8 +50,8 @@ end
|
|
|
50
50
|
-- that is spawned when the boss does the multi-stomp attack.
|
|
51
51
|
--
|
|
52
52
|
-- When this attack occurs, four extra copies of Daddy Long Legs will be spawned with the same
|
|
53
|
-
-- entity type, variant, and sub-type. The `Entity.Parent`
|
|
54
|
-
--
|
|
53
|
+
-- entity type, variant, and sub-type. The `Entity.Parent` field will be undefined in this case, so
|
|
54
|
+
-- the way to tell them apart is to check for a non-undefined `Entity.SpawnerEntity` field.
|
|
55
55
|
function ____exports.isDaddyLongLegsChildStompEntity(self, npc)
|
|
56
56
|
return npc.Type == EntityType.DADDY_LONG_LEGS and npc.SpawnerEntity ~= nil
|
|
57
57
|
end
|
|
@@ -78,7 +78,7 @@ export declare function getPlayers(performCharacterExclusions?: boolean): Entity
|
|
|
78
78
|
export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPlayer | undefined;
|
|
79
79
|
/**
|
|
80
80
|
* Helper function to detect if a particular player is a "child" player, meaning that they have a
|
|
81
|
-
* non-undefined `EntityPlayer.Parent`
|
|
81
|
+
* non-undefined `EntityPlayer.Parent` field. (For example, the Strawman Keeper.)
|
|
82
82
|
*/
|
|
83
83
|
export declare function isChildPlayer(player: EntityPlayer): boolean;
|
|
84
84
|
//# sourceMappingURL=playerIndex.d.ts.map
|
|
@@ -125,7 +125,7 @@ function ____exports.getSubPlayerParent(self, subPlayer)
|
|
|
125
125
|
)
|
|
126
126
|
end
|
|
127
127
|
--- Helper function to detect if a particular player is a "child" player, meaning that they have a
|
|
128
|
-
-- non-undefined `EntityPlayer.Parent`
|
|
128
|
+
-- non-undefined `EntityPlayer.Parent` field. (For example, the Strawman Keeper.)
|
|
129
129
|
function ____exports.isChildPlayer(self, player)
|
|
130
130
|
return player.Parent ~= nil
|
|
131
131
|
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { StatType } from "../enums/StatType";
|
|
3
|
+
import { StatTypeType } from "../interfaces/StatTypeType";
|
|
4
|
+
/** Helper function to get the stat for a player corresponding to the `StatType`. */
|
|
5
|
+
export declare function getPlayerStat<T extends StatType>(player: EntityPlayer, statType: T): StatTypeType[T];
|
|
6
|
+
//# sourceMappingURL=playerStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playerStats.d.ts","sourceRoot":"","sources":["../../src/functions/playerStats.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,CAAC,SAAS,QAAQ,EAC9C,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,CAAC,GACV,YAAY,CAAC,CAAC,CAAC,CAiBjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____StatType = require("enums.StatType")
|
|
3
|
+
local StatType = ____StatType.StatType
|
|
4
|
+
--- Helper function to get the stat for a player corresponding to the `StatType`.
|
|
5
|
+
function ____exports.getPlayerStat(self, player, statType)
|
|
6
|
+
return ({
|
|
7
|
+
[StatType.DAMAGE] = player.Damage,
|
|
8
|
+
[StatType.FIRE_DELAY] = player.MaxFireDelay,
|
|
9
|
+
[StatType.SHOT_SPEED] = player.ShotSpeed,
|
|
10
|
+
[StatType.TEAR_HEIGHT] = player.TearHeight,
|
|
11
|
+
[StatType.TEAR_RANGE] = player.TearRange,
|
|
12
|
+
[StatType.TEAR_FALLING_ACCELERATION] = player.TearFallingAcceleration,
|
|
13
|
+
[StatType.TEAR_FALLING_SPEED] = player.TearFallingSpeed,
|
|
14
|
+
[StatType.MOVE_SPEED] = player.MoveSpeed,
|
|
15
|
+
[StatType.TEAR_FLAG] = player.TearFlags,
|
|
16
|
+
[StatType.TEAR_COLOR] = player.TearColor,
|
|
17
|
+
[StatType.FLYING] = player.CanFly,
|
|
18
|
+
[StatType.LUCK] = player.Luck
|
|
19
|
+
})[statType]
|
|
20
|
+
end
|
|
21
|
+
return ____exports
|
|
@@ -3,7 +3,7 @@ import { HealthType } from "../enums/HealthType";
|
|
|
3
3
|
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to add a stat to a player based on the `CacheFlag` provided. Call this function
|
|
6
|
-
* from the
|
|
6
|
+
* from the `EVALUATE_CACHE` callback.
|
|
7
7
|
*
|
|
8
8
|
* Note that for `CacheFlag.FIRE_DELAY`, the "amount" argument will be interpreted as the tear stat
|
|
9
9
|
* to add (and not the amount to mutate `EntityPlayer.MaxFireDelay` by).
|
|
@@ -142,7 +142,7 @@ function ____exports.addCollectibleCostume(self, player, collectibleType)
|
|
|
142
142
|
player:AddCostume(itemConfigItem, false)
|
|
143
143
|
end
|
|
144
144
|
--- Helper function to add a stat to a player based on the `CacheFlag` provided. Call this function
|
|
145
|
-
-- from the
|
|
145
|
+
-- from the `EVALUATE_CACHE` callback.
|
|
146
146
|
--
|
|
147
147
|
-- Note that for `CacheFlag.FIRE_DELAY`, the "amount" argument will be interpreted as the tear stat
|
|
148
148
|
-- to add (and not the amount to mutate `EntityPlayer.MaxFireDelay` by).
|
package/dist/functions/rng.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function deserializeRNG(rng: SerializedRNG): RNG;
|
|
|
17
17
|
* the game.
|
|
18
18
|
*/
|
|
19
19
|
export declare function getRandomSeed(): Seed;
|
|
20
|
-
/** Helper function to check if something is an instantiated RNG object. */
|
|
20
|
+
/** Helper function to check if something is an instantiated `RNG` object. */
|
|
21
21
|
export declare function isRNG(object: unknown): object is RNG;
|
|
22
22
|
/**
|
|
23
23
|
* Used to determine is the given table is a serialized `RNG` object created by the save data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../src/functions/rng.ts"],"names":[],"mappings":";;;AAMA,oBAAY,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACpD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,CAAC;AAYF,wDAAwD;AACxD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CASrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,GAAG,CAatD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED,
|
|
1
|
+
{"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../src/functions/rng.ts"],"names":[],"mappings":";;;AAMA,oBAAY,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACpD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,CAAC;AAYF,wDAAwD;AACxD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CASrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,GAAG,CAatD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED,6EAA6E;AAC7E,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,GAAG,CAEpD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAMxE;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,OAAkB,GAAG,GAAG,CAIlD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAEvD;AAED;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