isaacscript-common 7.1.1 → 7.2.2
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/itemPickup.d.ts.map +1 -1
- package/dist/callbacks/itemPickup.lua +3 -1
- package/dist/callbacks/postCustomDoorEnter.d.ts.map +1 -1
- package/dist/callbacks/postCustomDoorEnter.lua +14 -11
- package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -1
- package/dist/callbacks/postDiceRoomActivated.lua +5 -4
- package/dist/callbacks/postItemDischarged.lua +2 -1
- package/dist/callbacks/postSlotDestroyed.lua +3 -3
- package/dist/classes/DefaultMap.d.ts +5 -5
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.lua +3 -1
- package/dist/core/constantsFirstLast.d.ts +2 -0
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +36 -9
- package/dist/enums/AmbushType.d.ts +1 -0
- package/dist/enums/AmbushType.d.ts.map +1 -1
- package/dist/enums/AmbushType.lua +1 -0
- package/dist/enums/CornerType.d.ts +1 -0
- package/dist/enums/CornerType.d.ts.map +1 -1
- package/dist/enums/CornerType.lua +1 -0
- package/dist/enums/PocketItemType.d.ts +1 -0
- package/dist/enums/PocketItemType.d.ts.map +1 -1
- package/dist/enums/PocketItemType.lua +1 -0
- package/dist/enums/RockAltType.d.ts +1 -0
- package/dist/enums/RockAltType.d.ts.map +1 -1
- package/dist/enums/RockAltType.lua +1 -0
- package/dist/enums/SaveDataKey.d.ts +11 -0
- package/dist/enums/SaveDataKey.d.ts.map +1 -0
- package/dist/enums/{private/SaveDataKey.lua → SaveDataKey.lua} +2 -0
- package/dist/enums/SerializationType.d.ts +1 -0
- package/dist/enums/SerializationType.d.ts.map +1 -1
- package/dist/enums/SerializationType.lua +1 -0
- package/dist/enums/SlotDestructionType.d.ts +1 -0
- package/dist/enums/SlotDestructionType.d.ts.map +1 -1
- package/dist/enums/SlotDestructionType.lua +1 -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/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +3 -1
- package/dist/features/customStage/backdrop.d.ts +1 -1
- package/dist/features/customStage/backdrop.d.ts.map +1 -1
- package/dist/features/customStage/backdrop.lua +5 -3
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
- package/dist/features/customStage/customStageGridEntities.lua +3 -1
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +3 -1
- package/dist/features/customStage/init.lua +2 -2
- package/dist/features/customStage/shadows.d.ts.map +1 -1
- package/dist/features/customStage/shadows.lua +2 -1
- package/dist/features/deployJSONRoom.lua +13 -10
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +8 -2
- package/dist/features/saveDataManager/exports.d.ts +2 -1
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.d.ts +1 -1
- package/dist/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/functions/bitSet128.d.ts.map +1 -1
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.lua +3 -1
- package/dist/functions/cacheFlag.d.ts +23 -1
- package/dist/functions/cacheFlag.d.ts.map +1 -1
- package/dist/functions/cacheFlag.lua +78 -0
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +2 -1
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +3 -1
- package/dist/functions/entities.lua +2 -1
- package/dist/functions/flying.lua +2 -2
- package/dist/functions/gridEntities.lua +2 -1
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/functions/gridEntitiesSpecific.lua +5 -3
- package/dist/functions/index.d.ts +0 -1
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.lua +0 -8
- package/dist/functions/input.d.ts +5 -2
- package/dist/functions/input.d.ts.map +1 -1
- package/dist/functions/input.lua +11 -3
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/levelGrid.d.ts.map +1 -1
- package/dist/functions/levelGrid.lua +3 -1
- package/dist/functions/nextStage.d.ts.map +1 -1
- package/dist/functions/nextStage.lua +7 -5
- package/dist/functions/npcs.d.ts.map +1 -1
- package/dist/functions/npcs.lua +4 -2
- package/dist/functions/pills.d.ts.map +1 -1
- package/dist/functions/pills.lua +9 -3
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +2 -1
- package/dist/functions/players.d.ts +1 -1
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +13 -15
- package/dist/functions/pocketItems.d.ts.map +1 -1
- package/dist/functions/pocketItems.lua +3 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/rng.lua +3 -0
- package/dist/functions/rockAlt.d.ts.map +1 -1
- package/dist/functions/rockAlt.lua +11 -20
- package/dist/functions/rooms.d.ts +4 -4
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +18 -16
- package/dist/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +8 -2
- package/dist/functions/trinkets.d.ts.map +1 -1
- package/dist/functions/trinkets.lua +4 -2
- package/dist/functions/types.d.ts +64 -0
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/types.lua +63 -0
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/interfaces/ChargeBarSprites.d.ts +1 -1
- package/dist/interfaces/Corner.d.ts +5 -0
- package/dist/interfaces/Corner.d.ts.map +1 -1
- package/dist/interfaces/CustomStageLua.d.ts +57 -0
- package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
- package/dist/interfaces/GridEntityCustomData.d.ts +6 -0
- package/dist/interfaces/GridEntityCustomData.d.ts.map +1 -1
- package/dist/interfaces/JSONRoomsFile.d.ts +7 -3
- package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
- package/dist/interfaces/PlayerHealth.d.ts +1 -1
- package/dist/interfaces/PlayerHealth.d.ts.map +1 -1
- package/dist/interfaces/PocketItemDescription.d.ts +1 -1
- package/dist/interfaces/PocketItemDescription.d.ts.map +1 -1
- package/dist/interfaces/RoomDescription.d.ts +1 -1
- package/dist/interfaces/RoomDescription.d.ts.map +1 -1
- package/dist/interfaces/StatTypeType.d.ts +4 -0
- package/dist/interfaces/StatTypeType.d.ts.map +1 -1
- package/dist/interfaces/TrinketSituation.d.ts +1 -1
- package/dist/interfaces/TrinketSituation.d.ts.map +1 -1
- package/dist/maps/keyboardToString.d.ts +4 -0
- package/dist/maps/keyboardToString.d.ts.map +1 -0
- package/dist/maps/keyboardToString.lua +73 -0
- package/dist/types/AnyEntity.d.ts +5 -0
- package/dist/types/AnyEntity.d.ts.map +1 -1
- package/dist/types/AnyGridEntity.d.ts +5 -0
- package/dist/types/AnyGridEntity.d.ts.map +1 -1
- package/dist/types/CollectibleIndex.d.ts +4 -3
- package/dist/types/CollectibleIndex.d.ts.map +1 -1
- package/dist/types/Immutable.d.ts +3 -1
- package/dist/types/Immutable.d.ts.map +1 -1
- package/dist/types/PickupIndex.d.ts +4 -2
- package/dist/types/PickupIndex.d.ts.map +1 -1
- package/dist/types/PlayerIndex.d.ts +3 -2
- package/dist/types/PlayerIndex.d.ts.map +1 -1
- package/dist/types/SerializedIsaacAPIClass.d.ts +6 -0
- package/dist/types/SerializedIsaacAPIClass.d.ts.map +1 -1
- package/dist/types/TSTLClass.d.ts +5 -0
- package/dist/types/TSTLClass.d.ts.map +1 -1
- package/dist/types/TrapdoorDestination.d.ts +3 -0
- package/dist/types/TrapdoorDestination.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/itemPickup.ts +5 -2
- package/src/callbacks/postCustomDoorEnter.ts +18 -11
- package/src/callbacks/postDiceRoomActivated.ts +7 -12
- package/src/callbacks/postItemDischarged.ts +3 -1
- package/src/callbacks/postSlotDestroyed.ts +3 -2
- package/src/callbacks/reorderedCallbacks.ts +2 -2
- package/src/classes/DefaultMap.ts +8 -8
- package/src/core/constants.ts +3 -3
- package/src/core/constantsFirstLast.ts +29 -14
- package/src/enums/AmbushType.ts +1 -0
- package/src/enums/CornerType.ts +1 -0
- package/src/enums/PocketItemType.ts +1 -0
- package/src/enums/RockAltType.ts +1 -0
- package/src/enums/SaveDataKey.ts +10 -0
- package/src/enums/SerializationType.ts +1 -0
- package/src/enums/SlotDestructionType.ts +1 -0
- package/src/enums/index.ts +1 -0
- package/src/enums/indexTypeDoc.ts +1 -0
- package/src/features/customGridEntity.ts +2 -1
- package/src/features/customStage/backdrop.ts +5 -3
- package/src/features/customStage/customStageGridEntities.ts +2 -1
- package/src/features/customStage/exports.ts +5 -4
- package/src/features/customStage/init.ts +2 -2
- package/src/features/customStage/shadows.ts +2 -1
- package/src/features/deployJSONRoom.ts +14 -19
- package/src/features/extraConsoleCommands/listCommands.ts +3 -2
- package/src/features/fastReset.ts +1 -1
- package/src/features/indexTypeDoc.ts +2 -1
- package/src/features/saveDataManager/exports.ts +4 -4
- package/src/features/saveDataManager/main.ts +1 -1
- package/src/features/saveDataManager/save.ts +1 -1
- package/src/functions/bitSet128.ts +1 -5
- package/src/functions/bosses.ts +2 -1
- package/src/functions/cacheFlag.ts +90 -1
- package/src/functions/cards.ts +3 -3
- package/src/functions/collectibles.ts +2 -8
- package/src/functions/color.ts +1 -1
- package/src/functions/deepCopy.ts +2 -2
- package/src/functions/dimensions.ts +1 -1
- package/src/functions/doors.ts +2 -2
- package/src/functions/entities.ts +2 -2
- package/src/functions/flying.ts +1 -1
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridEntitiesSpecific.ts +4 -3
- package/src/functions/index.ts +0 -1
- package/src/functions/indexTypeDoc.ts +0 -1
- package/src/functions/input.ts +17 -4
- package/src/functions/jsonHelpers.ts +1 -1
- package/src/functions/kColor.ts +1 -5
- package/src/functions/levelGrid.ts +3 -2
- package/src/functions/nextStage.ts +6 -5
- package/src/functions/npcs.ts +3 -2
- package/src/functions/pills.ts +11 -9
- package/src/functions/playerIndex.ts +3 -1
- package/src/functions/players.ts +5 -6
- package/src/functions/pocketItems.ts +4 -4
- package/src/functions/rng.ts +8 -5
- package/src/functions/rockAlt.ts +28 -13
- package/src/functions/rooms.ts +27 -26
- package/src/functions/spawnCollectible.ts +1 -2
- package/src/functions/stage.ts +3 -2
- package/src/functions/trinkets.ts +6 -5
- package/src/functions/types.ts +100 -0
- package/src/functions/vector.ts +1 -5
- package/src/interfaces/ChargeBarSprites.ts +1 -1
- package/src/interfaces/Corner.ts +5 -0
- package/src/interfaces/CustomStageLua.ts +66 -0
- package/src/interfaces/GridEntityCustomData.ts +6 -0
- package/src/interfaces/JSONRoomsFile.ts +7 -3
- package/src/interfaces/PlayerHealth.ts +1 -1
- package/src/interfaces/PocketItemDescription.ts +1 -1
- package/src/interfaces/RoomDescription.ts +1 -1
- package/src/interfaces/StatTypeType.ts +4 -0
- package/src/interfaces/TrinketSituation.ts +1 -1
- package/src/maps/keyboardToString.ts +77 -0
- package/src/types/AnyEntity.ts +5 -0
- package/src/types/AnyGridEntity.ts +5 -0
- package/src/types/CollectibleIndex.ts +4 -3
- package/src/types/Immutable.ts +3 -1
- package/src/types/PickupIndex.ts +4 -2
- package/src/types/PlayerIndex.ts +3 -2
- package/src/types/SerializedIsaacAPIClass.ts +6 -0
- package/src/types/TSTLClass.ts +5 -0
- package/src/types/TrapdoorDestination.ts +3 -0
- package/dist/enums/private/SaveDataKey.d.ts +0 -7
- package/dist/enums/private/SaveDataKey.d.ts.map +0 -1
- package/dist/functions/collectibleCacheFlag.d.ts +0 -24
- package/dist/functions/collectibleCacheFlag.d.ts.map +0 -1
- package/dist/functions/collectibleCacheFlag.lua +0 -80
- package/src/enums/private/SaveDataKey.ts +0 -6
- package/src/functions/collectibleCacheFlag.ts +0 -90
package/dist/functions/index.lua
CHANGED
|
@@ -103,14 +103,6 @@ do
|
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
|
-
do
|
|
107
|
-
local ____export = require("functions.collectibleCacheFlag")
|
|
108
|
-
for ____exportKey, ____exportValue in pairs(____export) do
|
|
109
|
-
if ____exportKey ~= "default" then
|
|
110
|
-
____exports[____exportKey] = ____exportValue
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
106
|
do
|
|
115
107
|
local ____export = require("functions.collectibles")
|
|
116
108
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonAction, Controller, Keyboard } from "isaac-typescript-definitions";
|
|
2
2
|
/** Helper function to get the enum name for the specified `Controller` value. */
|
|
3
|
-
export declare function controllerToString(controller: Controller): string;
|
|
3
|
+
export declare function controllerToString(controller: Controller): string | undefined;
|
|
4
4
|
export declare function getMoveActions(): Set<ButtonAction>;
|
|
5
5
|
export declare function getShootActions(): Set<ButtonAction>;
|
|
6
6
|
/** Iterates over all inputs to determine if a particular button is pressed (i.e. held down). */
|
|
@@ -29,5 +29,8 @@ export declare function isMoveActionTriggeredOnAnyInput(): boolean;
|
|
|
29
29
|
export declare function isShootAction(buttonAction: ButtonAction): boolean;
|
|
30
30
|
export declare function isShootActionPressedOnAnyInput(): boolean;
|
|
31
31
|
export declare function isShootActionTriggeredOnAnyInput(): boolean;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Helper function to get the string that would be typed if someone pressed the corresponding key.
|
|
34
|
+
*/
|
|
35
|
+
export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
|
|
33
36
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAuCtC,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAO7E;AAED,wBAAgB,cAAc,IAAI,GAAG,CAAC,YAAY,CAAC,CAElD;AAED,wBAAgB,eAAe,IAAI,GAAG,CAAC,YAAY,CAAC,CAEnD;AAED,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAK7E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,GACzB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEhE;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAIzD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAIxD;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
|
package/dist/functions/input.lua
CHANGED
|
@@ -8,6 +8,8 @@ local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
|
8
8
|
local Controller = ____isaac_2Dtypescript_2Ddefinitions.Controller
|
|
9
9
|
local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
10
10
|
local Keyboard = ____isaac_2Dtypescript_2Ddefinitions.Keyboard
|
|
11
|
+
local ____keyboardToString = require("maps.keyboardToString")
|
|
12
|
+
local KEYBOARD_TO_STRING = ____keyboardToString.KEYBOARD_TO_STRING
|
|
11
13
|
local ____enums = require("functions.enums")
|
|
12
14
|
local getEnumValues = ____enums.getEnumValues
|
|
13
15
|
local ____set = require("functions.set")
|
|
@@ -32,7 +34,7 @@ local SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
|
|
|
32
34
|
function ____exports.controllerToString(self, controller)
|
|
33
35
|
local key = Controller[controller]
|
|
34
36
|
if key == nil then
|
|
35
|
-
return
|
|
37
|
+
return nil
|
|
36
38
|
end
|
|
37
39
|
return trimPrefix(nil, key, "BUTTON_")
|
|
38
40
|
end
|
|
@@ -109,7 +111,13 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
|
109
111
|
function(____, shootAction) return ____exports.isActionTriggeredOnAnyInput(nil, shootAction) end
|
|
110
112
|
)
|
|
111
113
|
end
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
+
--- Helper function to get the string that would be typed if someone pressed the corresponding key.
|
|
115
|
+
function ____exports.keyboardToString(self, keyboard, uppercase)
|
|
116
|
+
local tuple = KEYBOARD_TO_STRING:get(keyboard)
|
|
117
|
+
if tuple == nil then
|
|
118
|
+
return nil
|
|
119
|
+
end
|
|
120
|
+
local lowercaseCharacter, uppercaseCharacter = table.unpack(tuple)
|
|
121
|
+
return uppercase and uppercaseCharacter or lowercaseCharacter
|
|
114
122
|
end
|
|
115
123
|
return ____exports
|
|
@@ -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,
|
|
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,CA+BlE;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../src/functions/level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,CACjD,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAEpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAapB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAUtD;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAGT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,IAAI,GAAG,GAAG,SAAS,CA6CzC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAKtE"}
|
|
@@ -43,6 +43,8 @@ local getRooms = ____rooms.getRooms
|
|
|
43
43
|
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
44
44
|
local ____roomShape = require("functions.roomShape")
|
|
45
45
|
local getGridIndexDelta = ____roomShape.getGridIndexDelta
|
|
46
|
+
local ____types = require("functions.types")
|
|
47
|
+
local asNumber = ____types.asNumber
|
|
46
48
|
--- Helper function to get the room grid indexes that are adjacent to a given room grid index.
|
|
47
49
|
--
|
|
48
50
|
-- Adjacent room grid indexes that are outside of the grid will not be included in the returned
|
|
@@ -113,7 +115,7 @@ function ____exports.getNewRoomCandidatesForLevel(self)
|
|
|
113
115
|
local rooms = getRoomsInsideGrid(nil)
|
|
114
116
|
local normalRooms = __TS__ArrayFilter(
|
|
115
117
|
rooms,
|
|
116
|
-
function(____, room) return room.Data ~= nil and room.Data.Type == RoomType.DEFAULT and room.Data.Subtype ~= DownpourRoomSubType.MIRROR and room.Data.Subtype ~= MinesRoomSubType.MINESHAFT_ENTRANCE end
|
|
118
|
+
function(____, room) return room.Data ~= nil and room.Data.Type == RoomType.DEFAULT and room.Data.Subtype ~= asNumber(nil, DownpourRoomSubType.MIRROR) and room.Data.Subtype ~= asNumber(nil, MinesRoomSubType.MINESHAFT_ENTRANCE) end
|
|
117
119
|
)
|
|
118
120
|
local newRoomCandidates = {}
|
|
119
121
|
for ____, room in ipairs(normalRooms) do
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextStage.d.ts","sourceRoot":"","sources":["../../src/functions/nextStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"nextStage.d.ts","sourceRoot":"","sources":["../../src/functions/nextStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAYtC;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,UAAU,CAwFzC;AA+HD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,UAAQ,GAAG,SAAS,CAiF3D"}
|
|
@@ -17,9 +17,11 @@ local ____stage = require("functions.stage")
|
|
|
17
17
|
local calculateStageType = ____stage.calculateStageType
|
|
18
18
|
local calculateStageTypeRepentance = ____stage.calculateStageTypeRepentance
|
|
19
19
|
local onRepentanceStage = ____stage.onRepentanceStage
|
|
20
|
+
local ____types = require("functions.types")
|
|
21
|
+
local asNumber = ____types.asNumber
|
|
20
22
|
function getNextStageBackwardsPath(self, stage, repentanceStage)
|
|
21
23
|
if not areFeaturesInitialized(nil) then
|
|
22
|
-
return stage - 1
|
|
24
|
+
return asNumber(nil, stage) - 1
|
|
23
25
|
end
|
|
24
26
|
local visitedDownpour1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE)
|
|
25
27
|
local visitedDross1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE_B)
|
|
@@ -77,7 +79,7 @@ function getNextStageBackwardsPath(self, stage, repentanceStage)
|
|
|
77
79
|
end
|
|
78
80
|
return LevelStage.DEPTHS_1
|
|
79
81
|
end
|
|
80
|
-
return stage - 1
|
|
82
|
+
return asNumber(nil, stage) - 1
|
|
81
83
|
end
|
|
82
84
|
function getStageTypeBackwardsPath(self, stage, nextStage, repentanceStage)
|
|
83
85
|
local visitedDownpour1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE)
|
|
@@ -164,7 +166,7 @@ function ____exports.getNextStage(self)
|
|
|
164
166
|
if ____cond4 then
|
|
165
167
|
do
|
|
166
168
|
if repentanceStage then
|
|
167
|
-
return stage + 1
|
|
169
|
+
return asNumber(nil, stage) + 1
|
|
168
170
|
end
|
|
169
171
|
if stage == LevelStage.DEPTHS_2 then
|
|
170
172
|
return LevelStage.DEPTHS_2
|
|
@@ -194,7 +196,7 @@ function ____exports.getNextStage(self)
|
|
|
194
196
|
if stage == LevelStage.THE_VOID then
|
|
195
197
|
return LevelStage.THE_VOID
|
|
196
198
|
end
|
|
197
|
-
return stage + 1
|
|
199
|
+
return asNumber(nil, stage) + 1
|
|
198
200
|
end
|
|
199
201
|
--- Helper function to get the stage type that a trapdoor or heaven door would take the player to,
|
|
200
202
|
-- based on the current stage, room, and game state flags.
|
|
@@ -216,7 +218,7 @@ function ____exports.getNextStageType(self, upwards)
|
|
|
216
218
|
if backwardsPath then
|
|
217
219
|
return getStageTypeBackwardsPath(nil, stage, nextStage, repentanceStage)
|
|
218
220
|
end
|
|
219
|
-
if roomGridIndex == GridRoom.SECRET_EXIT then
|
|
221
|
+
if roomGridIndex == asNumber(nil, GridRoom.SECRET_EXIT) then
|
|
220
222
|
return calculateStageTypeRepentance(nil, nextStage)
|
|
221
223
|
end
|
|
222
224
|
if repentanceStage and (stage == LevelStage.BASEMENT_1 or stage == LevelStage.CAVES_1 or stage == LevelStage.DEPTHS_1 or stage == LevelStage.WOMB_1) then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EASX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EASX,MAAM,8BAA8B,CAAC;AAgCtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CA4B3D;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAIvE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAO3D"}
|
package/dist/functions/npcs.lua
CHANGED
|
@@ -24,6 +24,8 @@ local ____constants = require("core.constants")
|
|
|
24
24
|
local EGGY_STATE_FRAME_OF_FINAL_SPIDER = ____constants.EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
25
25
|
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
26
26
|
local getNPCs = ____entitiesSpecific.getNPCs
|
|
27
|
+
local ____types = require("functions.types")
|
|
28
|
+
local asNumber = ____types.asNumber
|
|
27
29
|
--- Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
28
30
|
-- not actually keep the doors closed (like Death's scythes).
|
|
29
31
|
function ____exports.isAliveExceptionNPC(self, npc)
|
|
@@ -59,14 +61,14 @@ end
|
|
|
59
61
|
-- dead by the game. Instead, when Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and
|
|
60
62
|
-- spawn 14 Swarm Spiders while their StateFrame ticks upwards.
|
|
61
63
|
function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
|
|
62
|
-
return npc.Type == EntityType.HOPPER and npc.Variant == HopperVariant.EGGY and npc.State == NpcState.SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
64
|
+
return npc.Type == EntityType.HOPPER and npc.Variant == asNumber(nil, HopperVariant.EGGY) and npc.State == NpcState.SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
63
65
|
end
|
|
64
66
|
--- Helper function to detect the custom death state of a Rag Man Ragling. When Rag Man Raglings die,
|
|
65
67
|
-- they turn into a patch on the ground and can be revived by Rag Man at a later time. This causes
|
|
66
68
|
-- them to show up as an "alive" enemy, so they should usually be filtered out of lists of alive
|
|
67
69
|
-- enemies.
|
|
68
70
|
function ____exports.isRaglingDeathPatch(self, npc)
|
|
69
|
-
return npc.Type == EntityType.RAGLING and npc.Variant == RaglingVariant.RAG_MANS_RAGLING and npc.State == NpcState.SPECIAL
|
|
71
|
+
return npc.Type == EntityType.RAGLING and npc.Variant == asNumber(nil, RaglingVariant.RAG_MANS_RAGLING) and npc.State == NpcState.SPECIAL
|
|
70
72
|
end
|
|
71
73
|
NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
72
74
|
Set,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,SAAS,EACT,UAAU,EACX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,SAAS,EACT,UAAU,EACX,MAAM,8BAA8B,CAAC;AAuCtC;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAI9C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CAEhD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGxE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAEjE;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,IAAI,SAAS,EAAE,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,EAAE,CAMnD;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAM3E;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,IAAI,SAAS,EAAE,CAEjD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,GACrB,yBAAyB,CAS3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAgBhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,GACrB,wBAAwB,CAS1B;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,IAAI,UAAU,EAAE,CAEpD;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEzD"}
|
package/dist/functions/pills.lua
CHANGED
|
@@ -29,6 +29,9 @@ local DEFAULT_PILL_EFFECT_TYPE = ____pillEffectTypes.DEFAULT_PILL_EFFECT_TYPE
|
|
|
29
29
|
local PILL_EFFECT_TYPES = ____pillEffectTypes.PILL_EFFECT_TYPES
|
|
30
30
|
local ____enums = require("functions.enums")
|
|
31
31
|
local getEnumValues = ____enums.getEnumValues
|
|
32
|
+
local ____types = require("functions.types")
|
|
33
|
+
local asNumber = ____types.asNumber
|
|
34
|
+
local asPillColor = ____types.asPillColor
|
|
32
35
|
local ____utils = require("functions.utils")
|
|
33
36
|
local irange = ____utils.irange
|
|
34
37
|
--- Add this to a `PillColor` to get the corresponding giant pill color.
|
|
@@ -59,7 +62,7 @@ end
|
|
|
59
62
|
-- For example, passing `PillColor.BLUE_BLUE` would result in 2049, which is the value that
|
|
60
63
|
-- corresponds to the horse pill color for blue/blue.
|
|
61
64
|
function ____exports.getHorsePillColor(self, pillColor)
|
|
62
|
-
return pillColor + HORSE_PILL_ADJUSTMENT
|
|
65
|
+
return asNumber(nil, pillColor) + HORSE_PILL_ADJUSTMENT
|
|
63
66
|
end
|
|
64
67
|
--- Helper function to get an array with every non-gold horse pill color.
|
|
65
68
|
function ____exports.getHorsePillColors(self)
|
|
@@ -80,7 +83,10 @@ end
|
|
|
80
83
|
--
|
|
81
84
|
-- If called with a non-horse pill color, this function will return back the same color.
|
|
82
85
|
function ____exports.getNormalPillColorFromHorse(self, pillColor)
|
|
83
|
-
local normalPillColor =
|
|
86
|
+
local normalPillColor = asPillColor(
|
|
87
|
+
nil,
|
|
88
|
+
asNumber(nil, pillColor) - HORSE_PILL_ADJUSTMENT
|
|
89
|
+
)
|
|
84
90
|
return normalPillColor > PillColor.NULL and normalPillColor or pillColor
|
|
85
91
|
end
|
|
86
92
|
--- Helper function to get an array with every non-gold and non-horse pill color.
|
|
@@ -139,6 +145,6 @@ function ____exports.getVanillaPillEffects(self)
|
|
|
139
145
|
return irange(nil, FIRST_PILL_EFFECT, LAST_VANILLA_PILL_EFFECT)
|
|
140
146
|
end
|
|
141
147
|
function ____exports.isHorsePill(self, pillColor)
|
|
142
|
-
return pillColor > HORSE_PILL_ADJUSTMENT
|
|
148
|
+
return asNumber(nil, pillColor) > HORSE_PILL_ADJUSTMENT
|
|
143
149
|
end
|
|
144
150
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerIndex.d.ts","sourceRoot":"","sources":["../../src/functions/playerIndex.ts"],"names":[],"mappings":";;;AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASnD;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAU9C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,EAAE,CAMpE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,GACvB,YAAY,GAAG,SAAS,CAG1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,6BAA6B,UAAQ,GACpC,WAAW,
|
|
1
|
+
{"version":3,"file":"playerIndex.d.ts","sourceRoot":"","sources":["../../src/functions/playerIndex.ts"],"names":[],"mappings":";;;AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASnD;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAU9C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,EAAE,CAMpE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,GACvB,YAAY,GAAG,SAAS,CAG1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,6BAA6B,UAAQ,GACpC,WAAW,CA8Bb;AAiBD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,GACzB,GAAG,GAAG,SAAS,CAajB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,0BAA0B,UAAQ,GAAG,YAAY,EAAE,CAS7E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,eAAe,GACzB,YAAY,GAAG,SAAS,CAa1B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE3D"}
|
|
@@ -63,7 +63,8 @@ function ____exports.getPlayerIndex(self, player, differentiateForgottenAndSoul)
|
|
|
63
63
|
local playerToUse = player
|
|
64
64
|
local isSubPlayer = player:IsSubPlayer()
|
|
65
65
|
if isSubPlayer then
|
|
66
|
-
local
|
|
66
|
+
local subPlayer = player
|
|
67
|
+
local playerParent = ____exports.getSubPlayerParent(nil, subPlayer)
|
|
67
68
|
if playerParent ~= nil then
|
|
68
69
|
playerToUse = playerParent
|
|
69
70
|
end
|
|
@@ -73,7 +73,7 @@ export declare function getActiveItemSlot(player: EntityPlayer, collectibleType:
|
|
|
73
73
|
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
74
74
|
* `EntityPlayer` object or a tear height stat.
|
|
75
75
|
*
|
|
76
|
-
* The formula for calculating it is: 32 - 2.5 *
|
|
76
|
+
* The formula for calculating it is: 32 - 2.5 * tearHeight
|
|
77
77
|
*/
|
|
78
78
|
export declare function getAzazelBrimstoneDistance(playerOrTearHeight: EntityPlayer | float): float;
|
|
79
79
|
/** Helper function to get an array containing the characters of all of the current players. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAyBjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CA4CN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzE;AAED;;;GAGG;AAC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,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -46,6 +46,8 @@ local getPlayerIndexVanilla = ____playerIndex.getPlayerIndexVanilla
|
|
|
46
46
|
local getPlayers = ____playerIndex.getPlayers
|
|
47
47
|
local ____tears = require("functions.tears")
|
|
48
48
|
local addTearsStat = ____tears.addTearsStat
|
|
49
|
+
local ____types = require("functions.types")
|
|
50
|
+
local isNumber = ____types.isNumber
|
|
49
51
|
local ____utils = require("functions.utils")
|
|
50
52
|
local ____repeat = ____utils["repeat"]
|
|
51
53
|
--- Helper function to get an array containing the characters of all of the current players.
|
|
@@ -295,13 +297,9 @@ end
|
|
|
295
297
|
--- Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
296
298
|
-- `EntityPlayer` object or a tear height stat.
|
|
297
299
|
--
|
|
298
|
-
-- The formula for calculating it is: 32 - 2.5 *
|
|
300
|
+
-- The formula for calculating it is: 32 - 2.5 * tearHeight
|
|
299
301
|
function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
|
|
300
|
-
local tearHeight =
|
|
301
|
-
if tearHeight == nil then
|
|
302
|
-
local player = playerOrTearHeight
|
|
303
|
-
tearHeight = player.TearHeight
|
|
304
|
-
end
|
|
302
|
+
local tearHeight = isNumber(nil, playerOrTearHeight) and playerOrTearHeight or playerOrTearHeight.TearHeight
|
|
305
303
|
return 32 - 2.5 * tearHeight
|
|
306
304
|
end
|
|
307
305
|
function ____exports.getClosestPlayer(self, position)
|
|
@@ -743,9 +741,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
743
741
|
itemPool:RemoveCollectible(collectibleType)
|
|
744
742
|
end
|
|
745
743
|
repeat
|
|
746
|
-
local
|
|
747
|
-
local
|
|
748
|
-
if
|
|
744
|
+
local ____switch122 = activeSlot
|
|
745
|
+
local ____cond122 = ____switch122 == ActiveSlot.PRIMARY
|
|
746
|
+
if ____cond122 then
|
|
749
747
|
do
|
|
750
748
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
751
749
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -754,8 +752,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
754
752
|
break
|
|
755
753
|
end
|
|
756
754
|
end
|
|
757
|
-
|
|
758
|
-
if
|
|
755
|
+
____cond122 = ____cond122 or ____switch122 == ActiveSlot.SECONDARY
|
|
756
|
+
if ____cond122 then
|
|
759
757
|
do
|
|
760
758
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
761
759
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -770,16 +768,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
770
768
|
break
|
|
771
769
|
end
|
|
772
770
|
end
|
|
773
|
-
|
|
774
|
-
if
|
|
771
|
+
____cond122 = ____cond122 or ____switch122 == ActiveSlot.POCKET
|
|
772
|
+
if ____cond122 then
|
|
775
773
|
do
|
|
776
774
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
777
775
|
player:SetActiveCharge(charge, activeSlot)
|
|
778
776
|
break
|
|
779
777
|
end
|
|
780
778
|
end
|
|
781
|
-
|
|
782
|
-
if
|
|
779
|
+
____cond122 = ____cond122 or ____switch122 == ActiveSlot.POCKET_SINGLE_USE
|
|
780
|
+
if ____cond122 then
|
|
783
781
|
do
|
|
784
782
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
785
783
|
break
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pocketItems.d.ts","sourceRoot":"","sources":["../../src/functions/pocketItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"pocketItems.d.ts","sourceRoot":"","sources":["../../src/functions/pocketItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAK5E;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,GACnB,cAAc,GAAG,SAAS,CAS5B;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,GACnB,qBAAqB,GAAG,SAAS,CAOnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,qBAAqB,EAAE,CA+D5E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASnE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAQzE"}
|
|
@@ -15,6 +15,8 @@ local ____enums = require("functions.enums")
|
|
|
15
15
|
local getEnumValues = ____enums.getEnumValues
|
|
16
16
|
local ____players = require("functions.players")
|
|
17
17
|
local isCharacter = ____players.isCharacter
|
|
18
|
+
local ____types = require("functions.types")
|
|
19
|
+
local asNumber = ____types.asNumber
|
|
18
20
|
--- Use this helper function as a workaround for the `EntityPlayer.GetPocketItem` method not working
|
|
19
21
|
-- correctly.
|
|
20
22
|
--
|
|
@@ -51,7 +53,7 @@ function ____exports.getPocketItems(self, player)
|
|
|
51
53
|
else
|
|
52
54
|
pocketItems[#pocketItems + 1] = {slot = slot, type = PocketItemType.EMPTY, subType = 0}
|
|
53
55
|
end
|
|
54
|
-
if slot + 1 == maxPocketItems then
|
|
56
|
+
if asNumber(nil, slot) + 1 == maxPocketItems then
|
|
55
57
|
break
|
|
56
58
|
end
|
|
57
59
|
end
|
|
@@ -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,
|
|
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,CAgBtD;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;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAYpD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAoBjE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAK1D;AAED,4FAA4F;AAC5F,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CASlD"}
|
package/dist/functions/rng.lua
CHANGED
|
@@ -67,6 +67,9 @@ function ____exports.deserializeRNG(self, rng)
|
|
|
67
67
|
OBJECT_NAME,
|
|
68
68
|
table.unpack(KEYS)
|
|
69
69
|
))
|
|
70
|
+
if seed == nil then
|
|
71
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: seed")
|
|
72
|
+
end
|
|
70
73
|
return ____exports.newRNG(nil, seed)
|
|
71
74
|
end
|
|
72
75
|
--- Used to determine is the given table is a serialized `RNG` object created by the save data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rockAlt.d.ts","sourceRoot":"","sources":["../../src/functions/rockAlt.ts"],"names":[],"mappings":";;;AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"rockAlt.d.ts","sourceRoot":"","sources":["../../src/functions/rockAlt.ts"],"names":[],"mappings":";;;AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAuCnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,OAAO,CA4BT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucketDownpour, spawnRockAltRewardBucketDross, ROCK_ALT_CHANCES, COIN_VELOCITY_MULTIPLIER, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
|
|
2
|
+
local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucketDownpour, spawnRockAltRewardBucketDross, ROCK_ALT_CHANCES, COIN_VELOCITY_MULTIPLIER, FIND_FREE_INITIAL_STEP, FART_RADIUS, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
4
|
local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
|
|
5
5
|
local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
|
|
@@ -45,6 +45,7 @@ local ____repeat = ____utils["repeat"]
|
|
|
45
45
|
local ____vector = require("functions.vector")
|
|
46
46
|
local getRandomVector = ____vector.getRandomVector
|
|
47
47
|
function spawnRockAltRewardUrn(self, position, rng)
|
|
48
|
+
local room = game:GetRoom()
|
|
48
49
|
local chance = getRandom(nil, rng)
|
|
49
50
|
local totalChance = 0
|
|
50
51
|
totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
|
|
@@ -88,14 +89,11 @@ function spawnRockAltRewardUrn(self, position, rng)
|
|
|
88
89
|
end
|
|
89
90
|
local numEnemiesChance = getRandom(nil, rng)
|
|
90
91
|
local numEnemies = numEnemiesChance < 0.5 and 1 or 2
|
|
91
|
-
local length = DISTANCE_OF_GRID_TILE * 3
|
|
92
92
|
____repeat(
|
|
93
93
|
nil,
|
|
94
94
|
numEnemies,
|
|
95
95
|
function()
|
|
96
|
-
local
|
|
97
|
-
local offset = randomVector * length
|
|
98
|
-
local targetPos = position + offset
|
|
96
|
+
local targetPos = room:FindFreePickupSpawnPosition(position, FIND_FREE_INITIAL_STEP)
|
|
99
97
|
EntityNPC.ThrowSpider(
|
|
100
98
|
position,
|
|
101
99
|
nil,
|
|
@@ -156,13 +154,8 @@ function spawnRockAltRewardMushroom(self, position, rng)
|
|
|
156
154
|
end
|
|
157
155
|
return false
|
|
158
156
|
end
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
EffectVariant.FART,
|
|
162
|
-
0,
|
|
163
|
-
position,
|
|
164
|
-
rng
|
|
165
|
-
)
|
|
157
|
+
game:Fart(position)
|
|
158
|
+
game:ButterBeanFart(position, FART_RADIUS, nil)
|
|
166
159
|
return true
|
|
167
160
|
end
|
|
168
161
|
function spawnRockAltRewardSkull(self, position, rng)
|
|
@@ -266,6 +259,7 @@ function spawnRockAltRewardPolyp(self, position, rng)
|
|
|
266
259
|
return true
|
|
267
260
|
end
|
|
268
261
|
function spawnRockAltRewardBucketDownpour(self, position, rng)
|
|
262
|
+
local room = game:GetRoom()
|
|
269
263
|
local chance = getRandom(nil, rng)
|
|
270
264
|
local totalChance = 0
|
|
271
265
|
totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
|
|
@@ -311,14 +305,11 @@ function spawnRockAltRewardBucketDownpour(self, position, rng)
|
|
|
311
305
|
local entityType = enemiesChance < 0.5 and EntityType.SPIDER or EntityType.SMALL_LEECH
|
|
312
306
|
local numEnemiesChance = getRandom(nil, rng)
|
|
313
307
|
local numEnemies = numEnemiesChance < 0.5 and 1 or 2
|
|
314
|
-
local jumpDistance = DISTANCE_OF_GRID_TILE * 3
|
|
315
308
|
____repeat(
|
|
316
309
|
nil,
|
|
317
310
|
numEnemies,
|
|
318
311
|
function()
|
|
319
|
-
local
|
|
320
|
-
local offset = randomVector * jumpDistance
|
|
321
|
-
local targetPos = position + offset
|
|
312
|
+
local targetPos = room:FindFreePickupSpawnPosition(position, FIND_FREE_INITIAL_STEP)
|
|
322
313
|
local spider = EntityNPC.ThrowSpider(
|
|
323
314
|
position,
|
|
324
315
|
nil,
|
|
@@ -334,6 +325,7 @@ function spawnRockAltRewardBucketDownpour(self, position, rng)
|
|
|
334
325
|
return true
|
|
335
326
|
end
|
|
336
327
|
function spawnRockAltRewardBucketDross(self, position, rng)
|
|
328
|
+
local room = game:GetRoom()
|
|
337
329
|
local chance = getRandom(nil, rng)
|
|
338
330
|
local totalChance = 0
|
|
339
331
|
totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
|
|
@@ -379,14 +371,11 @@ function spawnRockAltRewardBucketDross(self, position, rng)
|
|
|
379
371
|
local entityType = enemiesChance < 0.5 and EntityType.DRIP or EntityType.SMALL_LEECH
|
|
380
372
|
local numEnemiesChance = getRandom(nil, rng)
|
|
381
373
|
local numEnemies = numEnemiesChance < 0.5 and 1 or 2
|
|
382
|
-
local jumpDistance = DISTANCE_OF_GRID_TILE * 3
|
|
383
374
|
____repeat(
|
|
384
375
|
nil,
|
|
385
376
|
numEnemies,
|
|
386
377
|
function()
|
|
387
|
-
local
|
|
388
|
-
local offset = randomVector * jumpDistance
|
|
389
|
-
local targetPos = position + offset
|
|
378
|
+
local targetPos = room:FindFreePickupSpawnPosition(position, FIND_FREE_INITIAL_STEP)
|
|
390
379
|
local spider = EntityNPC.ThrowSpider(
|
|
391
380
|
position,
|
|
392
381
|
nil,
|
|
@@ -401,6 +390,8 @@ function spawnRockAltRewardBucketDross(self, position, rng)
|
|
|
401
390
|
end
|
|
402
391
|
ROCK_ALT_CHANCES = {NOTHING = 0.68, BASIC_DROP = 0.0967, TRINKET = 0.025, COLLECTIBLE = 0.005}
|
|
403
392
|
COIN_VELOCITY_MULTIPLIER = 2
|
|
393
|
+
FIND_FREE_INITIAL_STEP = 70
|
|
394
|
+
FART_RADIUS = DISTANCE_OF_GRID_TILE * 3
|
|
404
395
|
POLYP_PROJECTILE_SPEED = 10
|
|
405
396
|
POLYP_NUM_PROJECTILES = 6
|
|
406
397
|
--- Helper function to get the alternate rock type (i.e. urn, mushroom, etc.) that the current room
|
|
@@ -113,14 +113,14 @@ export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
|
113
113
|
*/
|
|
114
114
|
export declare function inCrawlSpace(): boolean;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* with the Death Certificate area.
|
|
116
|
+
* Helper function to detect if the current room is one of the room in the Death Certificate area.
|
|
118
117
|
*/
|
|
119
118
|
export declare function inDeathCertificateArea(): boolean;
|
|
120
119
|
/**
|
|
121
120
|
* Helper function to detect if the current room is a Treasure Room created when entering with a
|
|
122
|
-
* Devil's Crown trinket.
|
|
123
|
-
*
|
|
121
|
+
* Devil's Crown trinket.
|
|
122
|
+
*
|
|
123
|
+
* Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`.
|
|
124
124
|
*/
|
|
125
125
|
export declare function inDevilsCrownTreasureRoom(): boolean;
|
|
126
126
|
export declare function inDoubleTrouble(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAKT,YAAY,EACZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAKT,YAAY,EACZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAkCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAA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