isaacscript-common 6.10.1 → 6.11.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/postPlayerFatalDamage.lua +1 -1
- package/dist/callbacks/postPlayerInitFirst.d.ts +2 -0
- package/dist/callbacks/postPlayerInitFirst.d.ts.map +1 -0
- package/dist/callbacks/postPlayerInitFirst.lua +42 -0
- package/dist/callbacks/postPlayerInitLate.lua +5 -5
- package/dist/callbacks/postPlayerReorderedCallbacks.d.ts +2 -0
- package/dist/callbacks/postPlayerReorderedCallbacks.d.ts.map +1 -0
- package/dist/callbacks/{postPlayerReordered.lua → postPlayerReorderedCallbacks.lua} +11 -37
- package/dist/callbacks/subscriptions/{postPlayerInitReordered.d.ts → postPlayerInitFirst.d.ts} +2 -2
- package/dist/callbacks/subscriptions/postPlayerInitFirst.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/{postPlayerInitReordered.lua → postPlayerInitFirst.lua} +3 -3
- package/dist/enums/ModCallbackCustom.d.ts +17 -15
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +3 -3
- package/dist/enums/private/StageTravelState.d.ts +4 -0
- package/dist/enums/private/StageTravelState.d.ts.map +1 -0
- package/dist/enums/private/StageTravelState.lua +5 -0
- package/dist/features/customGridEntity.d.ts +2 -2
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +14 -8
- package/dist/features/customStage/init.d.ts.map +1 -1
- package/dist/features/customStage/init.lua +8 -1
- package/dist/features/customStage/streakText.d.ts +6 -0
- package/dist/features/customStage/streakText.d.ts.map +1 -1
- package/dist/features/customStage/streakText.lua +16 -11
- package/dist/features/customStage/versusScreen.d.ts +6 -0
- package/dist/features/customStage/versusScreen.d.ts.map +1 -1
- package/dist/features/customStage/versusScreen.lua +10 -5
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts +10 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.lua +8 -0
- package/dist/features/customTrapdoor/exports.d.ts +37 -0
- package/dist/features/customTrapdoor/exports.d.ts.map +1 -0
- package/dist/features/customTrapdoor/exports.lua +127 -0
- package/dist/features/customTrapdoor/v.d.ts +4 -0
- package/dist/features/customTrapdoor/v.d.ts.map +1 -0
- package/dist/features/customTrapdoor/v.lua +15 -0
- package/dist/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/features/deployJSONRoom.lua +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +2 -2
- package/dist/functions/{character.d.ts → characters.d.ts} +3 -1
- package/dist/functions/characters.d.ts.map +1 -0
- package/dist/functions/{character.lua → characters.lua} +12 -0
- package/dist/functions/deepCopy.lua +20 -3
- package/dist/functions/deepCopyTests.d.ts.map +1 -1
- package/dist/functions/deepCopyTests.lua +55 -1
- package/dist/functions/jsonHelpers.d.ts +6 -0
- package/dist/functions/jsonHelpers.d.ts.map +1 -1
- package/dist/functions/jsonHelpers.lua +9 -3
- package/dist/functions/mergeTests.lua +0 -4
- package/dist/functions/playerIndex.d.ts +6 -2
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +4 -2
- package/dist/functions/players.lua +4 -4
- package/dist/functions/revive.lua +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +10 -2
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +5 -2
- package/dist/initFeatures.d.ts +1 -2
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +7 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts +2 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/interfaces/CustomGridEntityData.d.ts +1 -1
- package/dist/interfaces/CustomGridEntityData.d.ts.map +1 -1
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +4 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.lua +2 -0
- package/dist/lib/jsonLua.lua +390 -0
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +3 -3
- package/dist/objects/characterDamageMultipliers.d.ts +6 -0
- package/dist/objects/characterDamageMultipliers.d.ts.map +1 -0
- package/dist/objects/characterDamageMultipliers.lua +49 -0
- package/dist/upgradeMod.d.ts.map +1 -1
- package/dist/upgradeMod.lua +2 -4
- package/package.json +2 -2
- package/src/callbacks/customRevive.ts +3 -3
- package/src/callbacks/itemPickup.ts +3 -3
- package/src/callbacks/postAmbush.ts +3 -3
- package/src/callbacks/postEsauJr.ts +3 -3
- package/src/callbacks/postFlip.ts +3 -3
- package/src/callbacks/postGridEntity.ts +5 -5
- package/src/callbacks/postPlayerCollectible.ts +2 -2
- package/src/callbacks/postPlayerFatalDamage.ts +5 -0
- package/src/callbacks/postPlayerInitFirst.ts +57 -0
- package/src/callbacks/postPlayerInitLate.ts +9 -5
- package/src/callbacks/{postPlayerReordered.ts → postPlayerReorderedCallbacks.ts} +9 -29
- package/src/callbacks/postSlotInitUpdate.ts +5 -2
- package/src/callbacks/postSlotRender.ts +2 -2
- package/src/callbacks/reorderedCallbacks.ts +1 -1
- package/src/callbacks/subscriptions/{postPlayerInitReordered.ts → postPlayerInitFirst.ts} +6 -6
- package/src/enums/ModCallbackCustom.ts +17 -15
- package/src/enums/private/StageTravelState.ts +4 -0
- package/src/features/customGridEntity.ts +29 -6
- package/src/features/customStage/init.ts +10 -1
- package/src/features/customStage/streakText.ts +13 -4
- package/src/features/customStage/versusScreen.ts +20 -12
- package/src/features/customTrapdoor/customTrapdoorConstants.ts +13 -0
- package/src/features/customTrapdoor/exports.ts +168 -0
- package/src/features/customTrapdoor/v.ts +20 -0
- package/src/features/deployJSONRoom.ts +5 -0
- package/src/features/extraConsoleCommands/listCommands.ts +1 -1
- package/src/functions/{character.ts → characters.ts} +13 -0
- package/src/functions/deepCopy.ts +18 -1
- package/src/functions/deepCopyTests.ts +112 -0
- package/src/functions/jsonHelpers.ts +9 -3
- package/src/functions/mergeTests.ts +0 -8
- package/src/functions/playerIndex.ts +6 -2
- package/src/functions/players.ts +1 -1
- package/src/functions/revive.ts +1 -1
- package/src/index.ts +6 -2
- package/src/initCustomCallbacks.ts +3 -1
- package/src/initFeatures.ts +7 -2
- package/src/interfaces/AddCallbackParameterCustom.ts +2 -2
- package/src/interfaces/CustomGridEntityData.ts +1 -1
- package/src/interfaces/private/CustomTrapdoorDescription.ts +3 -0
- package/src/lib/jsonLua.d.ts +10 -0
- package/src/lib/jsonLua.lua +390 -0
- package/src/objects/callbackRegisterFunctions.ts +2 -3
- package/src/objects/characterDamageMultipliers.ts +49 -0
- package/src/upgradeMod.ts +2 -3
- package/dist/callbacks/postPlayerReordered.d.ts +0 -2
- package/dist/callbacks/postPlayerReordered.d.ts.map +0 -1
- package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts.map +0 -1
- package/dist/functions/character.d.ts.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
____exports.CUSTOM_TRAPDOOR_FEATURE_NAME = "customTrapdoor"
|
|
3
|
+
--- This also applies to crawl spaces. The value was determined through trial and error.
|
|
4
|
+
____exports.TRAPDOOR_OPEN_DISTANCE = 60
|
|
5
|
+
____exports.TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS = ____exports.TRAPDOOR_OPEN_DISTANCE * 2.5
|
|
6
|
+
____exports.TRAPDOOR_BOSS_REACTION_FRAMES = 30
|
|
7
|
+
____exports.GridEntityTypeCustom = {TRAPDOOR_CUSTOM = 1000}
|
|
8
|
+
return ____exports
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to spawn a trapdoor grid entity that will have one or more of the following
|
|
4
|
+
* attributes:
|
|
5
|
+
*
|
|
6
|
+
* - custom destination (or custom logic for after the player enters)
|
|
7
|
+
* - custom graphics
|
|
8
|
+
* - custom logic for opening/closing
|
|
9
|
+
* - TODO: animation
|
|
10
|
+
*
|
|
11
|
+
* You can use this function to take the player to your custom stage.
|
|
12
|
+
*
|
|
13
|
+
* Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
|
|
14
|
+
* respawned every time the player re-enters the room.
|
|
15
|
+
*
|
|
16
|
+
* @param gridIndexOrPosition The location in the room to spawn the trapdoor.
|
|
17
|
+
* @param _destination Used to specify where the player will go after jumping into the trapdoor. Can
|
|
18
|
+
* either be a tuple containing the stage and stage type, a string containing
|
|
19
|
+
* the name of a custom stage, or undefined. If undefined, nothing will happen
|
|
20
|
+
* after the player jumps in the trapdoor. (Use undefined to perform some custom
|
|
21
|
+
* behavior and/or handle the traveling part yourself.) You can also specify a
|
|
22
|
+
* function that returns one of these things. By default, the destination will
|
|
23
|
+
* be set to the next floor like that of a vanilla trapdoor.
|
|
24
|
+
* @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
|
|
25
|
+
* of "gfx/grid/door_11_trapdoor.anm2" will be used.
|
|
26
|
+
* @param _shouldOpenFunc Optional. If the trapdoor is currently closed, this function will run on
|
|
27
|
+
* every frame to determine if it should open. By default, a function that
|
|
28
|
+
* emulates a vanilla trapdoor will be used.
|
|
29
|
+
* @param _shouldCloseFunc Optional. If the trapdoor is currently open, this function will run on
|
|
30
|
+
* every frame to determine if it should close. By default, a function that
|
|
31
|
+
* emulates a vanilla trapdoor will be used.
|
|
32
|
+
* @param _spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. Can either be
|
|
33
|
+
* a boolean or a function returning a boolean. By default, a function that
|
|
34
|
+
* emulates a vanilla trapdoor will be used.
|
|
35
|
+
*/
|
|
36
|
+
export declare function spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, _destination?: [stage: LevelStage, stageType: StageType] | string | ((gridEntity: GridEntity) => [stage: LevelStage, stageType: StageType] | string | undefined), anm2Path?: string, _shouldOpenFunc?: (gridEntity: GridEntity) => boolean, _shouldCloseFunc?: (gridEntity: GridEntity) => boolean, _spawnOpen?: boolean | ((gridEntity: GridEntity) => boolean)): GridEntity;
|
|
37
|
+
//# sourceMappingURL=exports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAgBtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,YAAY,GACR,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GACzC,MAAM,GACN,CAAC,CACC,UAAU,EAAE,UAAU,KAEpB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GACzC,MAAM,GACN,SAAS,CAA0B,EAC3C,QAAQ,SAAmC,EAC3C,eAAe,GAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAA+B,EAC5E,gBAAgB,GAAE,CAChB,UAAU,EAAE,UAAU,KACnB,OAAgC,EACrC,UAAU,GACN,OAAO,GACP,CAAC,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAA8B,GACrE,UAAU,CAWZ"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local defaultDestinationFunc, defaultShouldOpenFunc, isPlayerCloseAfterBoss, shouldBeClosedFromStartingInRoomWithEnemies, defaultShouldCloseFunc, defaultShouldSpawnOpenFunc
|
|
3
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
|
+
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
5
|
+
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
6
|
+
local ____cachedClasses = require("cachedClasses")
|
|
7
|
+
local game = ____cachedClasses.game
|
|
8
|
+
local ____featuresInitialized = require("featuresInitialized")
|
|
9
|
+
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
10
|
+
local ____nextStage = require("functions.nextStage")
|
|
11
|
+
local getNextStage = ____nextStage.getNextStage
|
|
12
|
+
local getNextStageType = ____nextStage.getNextStageType
|
|
13
|
+
local ____positionVelocity = require("functions.positionVelocity")
|
|
14
|
+
local anyPlayerCloserThan = ____positionVelocity.anyPlayerCloserThan
|
|
15
|
+
local ____customGridEntity = require("features.customGridEntity")
|
|
16
|
+
local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
|
|
17
|
+
local ____roomClearFrame = require("features.roomClearFrame")
|
|
18
|
+
local getRoomClearGameFrame = ____roomClearFrame.getRoomClearGameFrame
|
|
19
|
+
local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
|
|
20
|
+
local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
|
|
21
|
+
local GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
|
|
22
|
+
local TRAPDOOR_BOSS_REACTION_FRAMES = ____customTrapdoorConstants.TRAPDOOR_BOSS_REACTION_FRAMES
|
|
23
|
+
local TRAPDOOR_OPEN_DISTANCE = ____customTrapdoorConstants.TRAPDOOR_OPEN_DISTANCE
|
|
24
|
+
local TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS = ____customTrapdoorConstants.TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS
|
|
25
|
+
local ____v = require("features.customTrapdoor.v")
|
|
26
|
+
local getCustomTrapdoorDescription = ____v.getCustomTrapdoorDescription
|
|
27
|
+
function defaultDestinationFunc(self)
|
|
28
|
+
local nextStage = getNextStage(nil)
|
|
29
|
+
local nextStageType = getNextStageType(nil)
|
|
30
|
+
return {nextStage, nextStageType}
|
|
31
|
+
end
|
|
32
|
+
function defaultShouldOpenFunc(self, gridEntity)
|
|
33
|
+
local trapdoorDescription = getCustomTrapdoorDescription(nil, gridEntity)
|
|
34
|
+
if trapdoorDescription == nil then
|
|
35
|
+
return false
|
|
36
|
+
end
|
|
37
|
+
local room = game:GetRoom()
|
|
38
|
+
local roomClear = room:IsClear()
|
|
39
|
+
return not anyPlayerCloserThan(nil, gridEntity.Position, TRAPDOOR_OPEN_DISTANCE) and not isPlayerCloseAfterBoss(nil, gridEntity.Position) and not shouldBeClosedFromStartingInRoomWithEnemies(nil, trapdoorDescription.firstSpawn, roomClear)
|
|
40
|
+
end
|
|
41
|
+
function isPlayerCloseAfterBoss(self, position)
|
|
42
|
+
local gameFrameCount = game:GetFrameCount()
|
|
43
|
+
local room = game:GetRoom()
|
|
44
|
+
local roomType = room:GetType()
|
|
45
|
+
local roomClearGameFrame = getRoomClearGameFrame(nil)
|
|
46
|
+
if roomType ~= RoomType.BOSS or roomClearGameFrame == nil or gameFrameCount >= roomClearGameFrame + TRAPDOOR_BOSS_REACTION_FRAMES then
|
|
47
|
+
return false
|
|
48
|
+
end
|
|
49
|
+
return anyPlayerCloserThan(nil, position, TRAPDOOR_OPEN_DISTANCE_AFTER_BOSS)
|
|
50
|
+
end
|
|
51
|
+
function shouldBeClosedFromStartingInRoomWithEnemies(self, firstSpawn, roomClear)
|
|
52
|
+
return firstSpawn and not roomClear
|
|
53
|
+
end
|
|
54
|
+
function defaultShouldCloseFunc(self)
|
|
55
|
+
return false
|
|
56
|
+
end
|
|
57
|
+
function defaultShouldSpawnOpenFunc(self, gridEntity)
|
|
58
|
+
local room = game:GetRoom()
|
|
59
|
+
local roomFrameCount = room:GetFrameCount()
|
|
60
|
+
local roomClear = room:IsClear()
|
|
61
|
+
if roomFrameCount > 0 then
|
|
62
|
+
return false
|
|
63
|
+
end
|
|
64
|
+
if not roomClear then
|
|
65
|
+
return false
|
|
66
|
+
end
|
|
67
|
+
return defaultShouldOpenFunc(nil, gridEntity)
|
|
68
|
+
end
|
|
69
|
+
--- Helper function to spawn a trapdoor grid entity that will have one or more of the following
|
|
70
|
+
-- attributes:
|
|
71
|
+
--
|
|
72
|
+
-- - custom destination (or custom logic for after the player enters)
|
|
73
|
+
-- - custom graphics
|
|
74
|
+
-- - custom logic for opening/closing
|
|
75
|
+
-- - TODO: animation
|
|
76
|
+
--
|
|
77
|
+
-- You can use this function to take the player to your custom stage.
|
|
78
|
+
--
|
|
79
|
+
-- Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
|
|
80
|
+
-- respawned every time the player re-enters the room.
|
|
81
|
+
--
|
|
82
|
+
-- @param gridIndexOrPosition The location in the room to spawn the trapdoor.
|
|
83
|
+
-- @param _destination Used to specify where the player will go after jumping into the trapdoor. Can
|
|
84
|
+
-- either be a tuple containing the stage and stage type, a string containing
|
|
85
|
+
-- the name of a custom stage, or undefined. If undefined, nothing will happen
|
|
86
|
+
-- after the player jumps in the trapdoor. (Use undefined to perform some custom
|
|
87
|
+
-- behavior and/or handle the traveling part yourself.) You can also specify a
|
|
88
|
+
-- function that returns one of these things. By default, the destination will
|
|
89
|
+
-- be set to the next floor like that of a vanilla trapdoor.
|
|
90
|
+
-- @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
|
|
91
|
+
-- of "gfx/grid/door_11_trapdoor.anm2" will be used.
|
|
92
|
+
-- @param _shouldOpenFunc Optional. If the trapdoor is currently closed, this function will run on
|
|
93
|
+
-- every frame to determine if it should open. By default, a function that
|
|
94
|
+
-- emulates a vanilla trapdoor will be used.
|
|
95
|
+
-- @param _shouldCloseFunc Optional. If the trapdoor is currently open, this function will run on
|
|
96
|
+
-- every frame to determine if it should close. By default, a function that
|
|
97
|
+
-- emulates a vanilla trapdoor will be used.
|
|
98
|
+
-- @param _spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. Can either be
|
|
99
|
+
-- a boolean or a function returning a boolean. By default, a function that
|
|
100
|
+
-- emulates a vanilla trapdoor will be used.
|
|
101
|
+
function ____exports.spawnCustomTrapdoor(self, gridIndexOrPosition, _destination, anm2Path, _shouldOpenFunc, _shouldCloseFunc, _spawnOpen)
|
|
102
|
+
if _destination == nil then
|
|
103
|
+
_destination = defaultDestinationFunc
|
|
104
|
+
end
|
|
105
|
+
if anm2Path == nil then
|
|
106
|
+
anm2Path = "gfx/grid/door_11_trapdoor.anm2"
|
|
107
|
+
end
|
|
108
|
+
if _shouldOpenFunc == nil then
|
|
109
|
+
_shouldOpenFunc = defaultShouldOpenFunc
|
|
110
|
+
end
|
|
111
|
+
if _shouldCloseFunc == nil then
|
|
112
|
+
_shouldCloseFunc = defaultShouldCloseFunc
|
|
113
|
+
end
|
|
114
|
+
if _spawnOpen == nil then
|
|
115
|
+
_spawnOpen = defaultShouldSpawnOpenFunc
|
|
116
|
+
end
|
|
117
|
+
errorIfFeaturesNotInitialized(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
|
|
118
|
+
return spawnCustomGridEntity(
|
|
119
|
+
nil,
|
|
120
|
+
GridEntityTypeCustom.TRAPDOOR_CUSTOM,
|
|
121
|
+
gridIndexOrPosition,
|
|
122
|
+
anm2Path,
|
|
123
|
+
"Closed",
|
|
124
|
+
GridCollisionClass.NONE
|
|
125
|
+
)
|
|
126
|
+
end
|
|
127
|
+
return ____exports
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
|
|
3
|
+
export declare function getCustomTrapdoorDescription(gridEntity: GridEntity): CustomTrapdoorDescription | undefined;
|
|
4
|
+
//# sourceMappingURL=v.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAa/F,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,UAAU,GACrB,yBAAyB,GAAG,SAAS,CAGvC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local ____StageTravelState = require("enums.private.StageTravelState")
|
|
6
|
+
local StageTravelState = ____StageTravelState.StageTravelState
|
|
7
|
+
local v = {
|
|
8
|
+
run = {state = StageTravelState.NONE},
|
|
9
|
+
room = {trapdoors = __TS__New(Map)}
|
|
10
|
+
}
|
|
11
|
+
function ____exports.getCustomTrapdoorDescription(self, gridEntity)
|
|
12
|
+
local gridIndex = gridEntity:GetGridIndex()
|
|
13
|
+
return v.room.trapdoors:get(gridIndex)
|
|
14
|
+
end
|
|
15
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAuDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAuKvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
|
|
@@ -66,7 +66,7 @@ local ____runInNFrames = require("features.runInNFrames")
|
|
|
66
66
|
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
67
67
|
local ____exports = require("features.saveDataManager.exports")
|
|
68
68
|
local saveDataManager = ____exports.saveDataManager
|
|
69
|
-
function preUseItemWeNeedToGoDeeper(self, _collectibleType, _rng, player)
|
|
69
|
+
function preUseItemWeNeedToGoDeeper(self, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
|
|
70
70
|
if v.room.manuallyUsingShovel then
|
|
71
71
|
return nil
|
|
72
72
|
end
|
|
@@ -36,8 +36,8 @@ local ____HealthType = require("enums.HealthType")
|
|
|
36
36
|
local HealthType = ____HealthType.HealthType
|
|
37
37
|
local ____cards = require("functions.cards")
|
|
38
38
|
local getCardName = ____cards.getCardName
|
|
39
|
-
local
|
|
40
|
-
local getCharacterName =
|
|
39
|
+
local ____characters = require("functions.characters")
|
|
40
|
+
local getCharacterName = ____characters.getCharacterName
|
|
41
41
|
local ____charge = require("functions.charge")
|
|
42
42
|
local addCharge = ____charge.addCharge
|
|
43
43
|
local ____collectibles = require("functions.collectibles")
|
|
@@ -30,6 +30,8 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
|
|
|
30
30
|
* is considered to starts with the D6, but this is not the case on a brand new save file).
|
|
31
31
|
*/
|
|
32
32
|
export declare function characterStartsWithActiveItem(character: PlayerType): boolean;
|
|
33
|
+
/** Helper function to get the numerical damage multiplier for a character. */
|
|
34
|
+
export declare function getCharacterDamageMultiplier(character: PlayerType, hasWhoreOfBabylon?: boolean): float;
|
|
33
35
|
/**
|
|
34
36
|
* - Most characters have a 56 frame death animation (i.e. the "Death" animation).
|
|
35
37
|
* - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
|
|
@@ -46,4 +48,4 @@ export declare function getCharacterMaxHeartContainers(character: PlayerType): i
|
|
|
46
48
|
export declare function getCharacterName(character: PlayerType): string;
|
|
47
49
|
export declare function isModdedCharacter(character: PlayerType): boolean;
|
|
48
50
|
export declare function isVanillaCharacter(character: PlayerType): boolean;
|
|
49
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=characters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAW1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEjE"}
|
|
@@ -3,6 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
3
3
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
4
4
|
local ____constantsFirstLast = require("constantsFirstLast")
|
|
5
5
|
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
6
|
+
local ____characterDamageMultipliers = require("objects.characterDamageMultipliers")
|
|
7
|
+
local CHARACTER_DAMAGE_MULTIPLIERS = ____characterDamageMultipliers.CHARACTER_DAMAGE_MULTIPLIERS
|
|
6
8
|
local ____characterNames = require("objects.characterNames")
|
|
7
9
|
local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
|
|
8
10
|
local ____charactersThatStartWithAnActiveItemSet = require("sets.charactersThatStartWithAnActiveItemSet")
|
|
@@ -54,6 +56,16 @@ end
|
|
|
54
56
|
function ____exports.characterStartsWithActiveItem(self, character)
|
|
55
57
|
return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET:has(character)
|
|
56
58
|
end
|
|
59
|
+
--- Helper function to get the numerical damage multiplier for a character.
|
|
60
|
+
function ____exports.getCharacterDamageMultiplier(self, character, hasWhoreOfBabylon)
|
|
61
|
+
if hasWhoreOfBabylon == nil then
|
|
62
|
+
hasWhoreOfBabylon = false
|
|
63
|
+
end
|
|
64
|
+
if character == PlayerType.EVE and hasWhoreOfBabylon then
|
|
65
|
+
return 1
|
|
66
|
+
end
|
|
67
|
+
return CHARACTER_DAMAGE_MULTIPLIERS[character]
|
|
68
|
+
end
|
|
57
69
|
--- - Most characters have a 56 frame death animation (i.e. the "Death" animation).
|
|
58
70
|
-- - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
|
|
59
71
|
-- - Tainted Forgotten have a 20 frame death animation (i.e. the "ForgottenDeath" animation).
|
|
@@ -452,6 +452,14 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
|
|
|
452
452
|
if SAVE_DATA_MANAGER_DEBUG then
|
|
453
453
|
__TS__ArraySort(entries, twoDimensionalSort)
|
|
454
454
|
end
|
|
455
|
+
local convertStringKeysToNumbers = serializationType == SerializationType.DESERIALIZE and __TS__ArraySome(
|
|
456
|
+
entries,
|
|
457
|
+
function(____, ____bindingPattern0)
|
|
458
|
+
local key
|
|
459
|
+
key = ____bindingPattern0[1]
|
|
460
|
+
return key == SerializationBrand.OBJECT_WITH_NUMBER_KEYS
|
|
461
|
+
end
|
|
462
|
+
)
|
|
455
463
|
local hasNumberKeys = __TS__ArraySome(
|
|
456
464
|
entries,
|
|
457
465
|
function(____, ____bindingPattern0)
|
|
@@ -467,7 +475,7 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
|
|
|
467
475
|
local value = ____value[2]
|
|
468
476
|
do
|
|
469
477
|
if isSerializationBrand(nil, key) then
|
|
470
|
-
goto
|
|
478
|
+
goto __continue87
|
|
471
479
|
end
|
|
472
480
|
traversalDescription = getTraversalDescription(nil, key, traversalDescription)
|
|
473
481
|
local newValue = ____exports.deepCopy(
|
|
@@ -477,10 +485,19 @@ function getCopiedEntries(self, object, serializationType, traversalDescription,
|
|
|
477
485
|
traversalDescription,
|
|
478
486
|
insideMap
|
|
479
487
|
)
|
|
480
|
-
local keyToUse =
|
|
488
|
+
local keyToUse = key
|
|
489
|
+
if convertStringKeysToNumbers then
|
|
490
|
+
local numberKey = tonumber(key)
|
|
491
|
+
if numberKey ~= nil then
|
|
492
|
+
keyToUse = numberKey
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
if convertNumberKeysToStrings then
|
|
496
|
+
keyToUse = tostring(key)
|
|
497
|
+
end
|
|
481
498
|
copiedEntries[#copiedEntries + 1] = {keyToUse, newValue}
|
|
482
499
|
end
|
|
483
|
-
::
|
|
500
|
+
::__continue87::
|
|
484
501
|
end
|
|
485
502
|
return {entries = copiedEntries, convertedNumberKeysToStrings = convertNumberKeysToStrings}
|
|
486
503
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepCopyTests.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopyTests.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"deepCopyTests.d.ts","sourceRoot":"","sources":["../../src/functions/deepCopyTests.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CA2BvC"}
|
|
@@ -4,7 +4,7 @@ local Map = ____lualib.Map
|
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local Set = ____lualib.Set
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local copiedObjectIsTable, copiedObjectHasKeyAndValueString, copiedTableHasKeyAndValueNumber, copiedTableDoesNotCoerceTypes, copiedObjectHasNoReferencesForPrimitivesForward, copiedObjectHasNoReferencesForPrimitivesBackward, copiedObjectHasNoReferencesForArray, copiedObjectHasChildObject, copiedMapIsMap, copiedMapHasValue, copiedSetIsSet, copiedSetHasValue, copiedMapHasChildMap, copiedDefaultMapHasChildDefaultMap, copiedDefaultMapHasBrand
|
|
7
|
+
local copiedObjectIsTable, copiedObjectHasKeyAndValueString, copiedTableHasKeyAndValueNumber, copiedTableDoesNotCoerceTypes, copiedObjectHasNoReferencesForPrimitivesForward, copiedObjectHasNoReferencesForPrimitivesBackward, copiedObjectHasNoReferencesForArray, copiedObjectHasChildObject, copiedMapIsMap, copiedMapHasValue, copiedSetIsSet, copiedSetHasValue, copiedMapHasChildMap, copiedDefaultMapHasChildDefaultMap, copiedDefaultMapHasBrand, copiedSerializedMapHasStringKey, copiedSerializedMapHasNumberKey, copiedSerializedDefaultMapHasStringKey, copiedSerializedDefaultMapHasNumberKey
|
|
8
8
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
9
9
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
10
10
|
local ____SerializationBrand = require("enums.private.SerializationBrand")
|
|
@@ -297,6 +297,56 @@ function copiedDefaultMapHasBrand(self)
|
|
|
297
297
|
error("The copied DefaultMap does not have the brand: " .. SerializationBrand.DEFAULT_MAP)
|
|
298
298
|
end
|
|
299
299
|
end
|
|
300
|
+
function copiedSerializedMapHasStringKey(self)
|
|
301
|
+
local mapKey = "123"
|
|
302
|
+
local mapValue = 456
|
|
303
|
+
local oldMap = __TS__New(Map)
|
|
304
|
+
oldMap:set(mapKey, mapValue)
|
|
305
|
+
local serializedOldMap = deepCopy(nil, oldMap, SerializationType.SERIALIZE, "copiedSerializedMapHasStringKey-serialize")
|
|
306
|
+
local newTable = deepCopy(nil, serializedOldMap, SerializationType.DESERIALIZE, "copiedSerializedMapHasStringKey-deserialize")
|
|
307
|
+
local newMap = newTable
|
|
308
|
+
if not newMap:has(mapKey) then
|
|
309
|
+
local keyType = type(mapKey)
|
|
310
|
+
error((("The copied Map did not have a key of: " .. mapKey) .. " with type ") .. keyType)
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
function copiedSerializedMapHasNumberKey(self)
|
|
314
|
+
local mapKey = 123
|
|
315
|
+
local mapValue = 456
|
|
316
|
+
local oldMap = __TS__New(Map)
|
|
317
|
+
oldMap:set(mapKey, mapValue)
|
|
318
|
+
local serializedOldMap = deepCopy(nil, oldMap, SerializationType.SERIALIZE, "copiedSerializedMapHasNumberKey-serialize")
|
|
319
|
+
local newTable = deepCopy(nil, serializedOldMap, SerializationType.DESERIALIZE, "copiedSerializedMapHasNumberKey-deserialize")
|
|
320
|
+
local newMap = newTable
|
|
321
|
+
if not newMap:has(mapKey) then
|
|
322
|
+
local keyType = type(mapKey)
|
|
323
|
+
error((("The copied Map did not have a key of: " .. tostring(mapKey)) .. " with type ") .. keyType)
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
function copiedSerializedDefaultMapHasStringKey(self)
|
|
327
|
+
local mapKey = "123"
|
|
328
|
+
local oldDefaultMap = __TS__New(DefaultMap, 456)
|
|
329
|
+
oldDefaultMap:getAndSetDefault(mapKey)
|
|
330
|
+
local serializedOldDefaultMap = deepCopy(nil, oldDefaultMap, SerializationType.SERIALIZE, "copiedSerializedDefaultMapHasStringKey-serialize")
|
|
331
|
+
local newTable = deepCopy(nil, serializedOldDefaultMap, SerializationType.DESERIALIZE, "copiedSerializedDefaultMapHasStringKey-deserialize")
|
|
332
|
+
local newDefaultMap = newTable
|
|
333
|
+
if not newDefaultMap:has(mapKey) then
|
|
334
|
+
local keyType = type(mapKey)
|
|
335
|
+
error((("The copied DefaultMap did not have a key of \"" .. mapKey) .. "\" with type: ") .. keyType)
|
|
336
|
+
end
|
|
337
|
+
end
|
|
338
|
+
function copiedSerializedDefaultMapHasNumberKey(self)
|
|
339
|
+
local mapKey = 123
|
|
340
|
+
local oldDefaultMap = __TS__New(DefaultMap, 456)
|
|
341
|
+
oldDefaultMap:getAndSetDefault(mapKey)
|
|
342
|
+
local serializedOldDefaultMap = deepCopy(nil, oldDefaultMap, SerializationType.SERIALIZE, "copiedSerializedDefaultMapHasNumberKey-serialize")
|
|
343
|
+
local newTable = deepCopy(nil, serializedOldDefaultMap, SerializationType.DESERIALIZE, "copiedSerializedDefaultMapHasNumberKey-deserialize")
|
|
344
|
+
local newDefaultMap = newTable
|
|
345
|
+
if not newDefaultMap:has(mapKey) then
|
|
346
|
+
local keyType = type(mapKey)
|
|
347
|
+
error((("The copied DefaultMap did not have a key of: " .. tostring(mapKey)) .. " with type ") .. keyType)
|
|
348
|
+
end
|
|
349
|
+
end
|
|
300
350
|
--- Run the suite of tests that prove that the "deepCopy" helper function works properly.
|
|
301
351
|
--
|
|
302
352
|
-- This function is only useful if you are troubleshooting the "deepCopy" function.
|
|
@@ -316,6 +366,10 @@ function ____exports.runDeepCopyTests(self)
|
|
|
316
366
|
copiedMapHasChildMap(nil)
|
|
317
367
|
copiedDefaultMapHasChildDefaultMap(nil)
|
|
318
368
|
copiedDefaultMapHasBrand(nil)
|
|
369
|
+
copiedSerializedMapHasStringKey(nil)
|
|
370
|
+
copiedSerializedMapHasNumberKey(nil)
|
|
371
|
+
copiedSerializedDefaultMapHasStringKey(nil)
|
|
372
|
+
copiedSerializedDefaultMapHasNumberKey(nil)
|
|
319
373
|
log("All deep copy tests passed!")
|
|
320
374
|
end
|
|
321
375
|
return ____exports
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* fails, it will return a blank Lua table instead of throwing an error. (This allows execution to
|
|
7
7
|
* continue in cases where users have no current save data or have manually removed their existing
|
|
8
8
|
* save data.)
|
|
9
|
+
*
|
|
10
|
+
* Under the hood, this uses a custom JSON parser that was measured to be 11.8 times faster than the
|
|
11
|
+
* vanilla JSON parser.
|
|
9
12
|
*/
|
|
10
13
|
export declare function jsonDecode(jsonString: string): LuaMap<AnyNotNil, unknown>;
|
|
11
14
|
/**
|
|
@@ -14,6 +17,9 @@ export declare function jsonDecode(jsonString: string): LuaMap<AnyNotNil, unknow
|
|
|
14
17
|
* In most cases, this function will be used for writing data to a "save#.dat" file. If encoding
|
|
15
18
|
* fails, it will throw an error to prevent writing a blank string or corrupted data to a user's
|
|
16
19
|
* "save#.dat" file.
|
|
20
|
+
*
|
|
21
|
+
* Under the hood, this uses a custom JSON parser that was measured to be 11.8 times faster than the
|
|
22
|
+
* vanilla JSON parser.
|
|
17
23
|
*/
|
|
18
24
|
export declare function jsonEncode(luaTable: unknown): string;
|
|
19
25
|
//# sourceMappingURL=jsonHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonHelpers.d.ts","sourceRoot":"","sources":["../../src/functions/jsonHelpers.ts"],"names":[],"mappings":";AAWA
|
|
1
|
+
{"version":3,"file":"jsonHelpers.d.ts","sourceRoot":"","sources":["../../src/functions/jsonHelpers.ts"],"names":[],"mappings":";AAWA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CASzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAOpD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local
|
|
2
|
+
local jsonLua = require("lib.jsonLua")
|
|
3
3
|
local ____log = require("functions.log")
|
|
4
4
|
local logError = ____log.logError
|
|
5
5
|
local function tryDecode(jsonString)
|
|
6
|
-
return
|
|
6
|
+
return jsonLua.decode(jsonString)
|
|
7
7
|
end
|
|
8
8
|
local function tryEncode(luaTable)
|
|
9
|
-
return
|
|
9
|
+
return jsonLua.encode(luaTable)
|
|
10
10
|
end
|
|
11
11
|
--- Converts a JSON string to a Lua table.
|
|
12
12
|
--
|
|
@@ -14,6 +14,9 @@ end
|
|
|
14
14
|
-- fails, it will return a blank Lua table instead of throwing an error. (This allows execution to
|
|
15
15
|
-- continue in cases where users have no current save data or have manually removed their existing
|
|
16
16
|
-- save data.)
|
|
17
|
+
--
|
|
18
|
+
-- Under the hood, this uses a custom JSON parser that was measured to be 11.8 times faster than the
|
|
19
|
+
-- vanilla JSON parser.
|
|
17
20
|
function ____exports.jsonDecode(self, jsonString)
|
|
18
21
|
local ok, luaTableOrErrMsg = pcall(tryDecode, jsonString)
|
|
19
22
|
if not ok then
|
|
@@ -27,6 +30,9 @@ end
|
|
|
27
30
|
-- In most cases, this function will be used for writing data to a "save#.dat" file. If encoding
|
|
28
31
|
-- fails, it will throw an error to prevent writing a blank string or corrupted data to a user's
|
|
29
32
|
-- "save#.dat" file.
|
|
33
|
+
--
|
|
34
|
+
-- Under the hood, this uses a custom JSON parser that was measured to be 11.8 times faster than the
|
|
35
|
+
-- vanilla JSON parser.
|
|
30
36
|
function ____exports.jsonEncode(self, luaTable)
|
|
31
37
|
local ok, jsonStringOrErrMsg = pcall(tryEncode, luaTable)
|
|
32
38
|
if not ok then
|
|
@@ -149,7 +149,6 @@ function oldTableHasFilledDefaultMap(self)
|
|
|
149
149
|
end
|
|
150
150
|
end
|
|
151
151
|
function oldTableHasVector(self)
|
|
152
|
-
log("Starting test: oldTableHasVector")
|
|
153
152
|
local key = "foo"
|
|
154
153
|
local x = 50
|
|
155
154
|
local y = 60
|
|
@@ -173,7 +172,6 @@ function oldTableHasVector(self)
|
|
|
173
172
|
end
|
|
174
173
|
end
|
|
175
174
|
function oldTableHasVectorSerialized(self)
|
|
176
|
-
log("Starting test: oldTableHasVectorSerialized")
|
|
177
175
|
local key = "foo"
|
|
178
176
|
local x = 50
|
|
179
177
|
local y = 60
|
|
@@ -198,7 +196,6 @@ function oldTableHasVectorSerialized(self)
|
|
|
198
196
|
end
|
|
199
197
|
end
|
|
200
198
|
function oldTableHasRNG(self)
|
|
201
|
-
log("Starting test: oldTableHasRNG")
|
|
202
199
|
local key = "foo"
|
|
203
200
|
local seed = 50
|
|
204
201
|
local newValue = newRNG(nil, seed)
|
|
@@ -219,7 +216,6 @@ function oldTableHasRNG(self)
|
|
|
219
216
|
end
|
|
220
217
|
end
|
|
221
218
|
function oldTableHasRNGSerialized(self)
|
|
222
|
-
log("Starting test: oldTableHasRNGSerialized")
|
|
223
219
|
local key = "foo"
|
|
224
220
|
local seed = 50
|
|
225
221
|
local newValue = newRNG(nil, seed)
|
|
@@ -10,6 +10,10 @@ import { PlayerIndex } from "../types/PlayerIndex";
|
|
|
10
10
|
* helper function instead to get a filtered list of players.
|
|
11
11
|
*/
|
|
12
12
|
export declare function getAllPlayers(): EntityPlayer[];
|
|
13
|
+
/**
|
|
14
|
+
* Helper function to get the corresponding `EntityPlayer` object that corresponds to a
|
|
15
|
+
* `PlayerIndex`.
|
|
16
|
+
*/
|
|
13
17
|
export declare function getPlayerFromIndex(playerIndex: PlayerIndex): EntityPlayer | undefined;
|
|
14
18
|
/**
|
|
15
19
|
* Mods often have to track variables relating to the player. In naive mods, information will only
|
|
@@ -71,8 +75,8 @@ export declare function getPlayers(performCharacterExclusions?: boolean): Entity
|
|
|
71
75
|
*/
|
|
72
76
|
export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPlayer | undefined;
|
|
73
77
|
/**
|
|
74
|
-
*
|
|
75
|
-
* example, the Strawman Keeper.)
|
|
78
|
+
* Helper function to detect if a particular player is a "child" player, meaning that they have a
|
|
79
|
+
* non-undefined `EntityPlayer.Parent` property. (For example, the Strawman Keeper.)
|
|
76
80
|
*/
|
|
77
81
|
export declare function isChildPlayer(player: EntityPlayer): boolean;
|
|
78
82
|
//# sourceMappingURL=playerIndex.d.ts.map
|
|
@@ -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,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,GACvB,YAAY,GAAG,SAAS,CAG1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,6BAA6B,UAAQ,GACpC,WAAW,CA4Bb;AA2BD;;;;;;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"}
|
|
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,kBAAkB,CAChC,WAAW,EAAE,WAAW,GACvB,YAAY,GAAG,SAAS,CAG1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,6BAA6B,UAAQ,GACpC,WAAW,CA4Bb;AA2BD;;;;;;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"}
|
|
@@ -143,13 +143,15 @@ function ____exports.getSubPlayerParent(self, subPlayer)
|
|
|
143
143
|
end
|
|
144
144
|
)
|
|
145
145
|
end
|
|
146
|
-
---
|
|
147
|
-
-- example, the Strawman Keeper.)
|
|
146
|
+
--- Helper function to detect if a particular player is a "child" player, meaning that they have a
|
|
147
|
+
-- non-undefined `EntityPlayer.Parent` property. (For example, the Strawman Keeper.)
|
|
148
148
|
function ____exports.isChildPlayer(self, player)
|
|
149
149
|
return player.Parent ~= nil
|
|
150
150
|
end
|
|
151
151
|
DEFAULT_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
|
|
152
152
|
EXCLUDED_CHARACTERS = __TS__New(Set, {PlayerType.ESAU, PlayerType.THE_SOUL_B})
|
|
153
|
+
--- Helper function to get the corresponding `EntityPlayer` object that corresponds to a
|
|
154
|
+
-- `PlayerIndex`.
|
|
153
155
|
function ____exports.getPlayerFromIndex(self, playerIndex)
|
|
154
156
|
local players = ____exports.getPlayers(nil)
|
|
155
157
|
return __TS__ArrayFind(
|
|
@@ -31,10 +31,10 @@ local ____bitwise = require("functions.bitwise")
|
|
|
31
31
|
local countSetBits = ____bitwise.countSetBits
|
|
32
32
|
local getKBitOfN = ____bitwise.getKBitOfN
|
|
33
33
|
local getNumBitsOfN = ____bitwise.getNumBitsOfN
|
|
34
|
-
local
|
|
35
|
-
local getCharacterMaxHeartContainers =
|
|
36
|
-
local getCharacterName =
|
|
37
|
-
local isVanillaCharacter =
|
|
34
|
+
local ____characters = require("functions.characters")
|
|
35
|
+
local getCharacterMaxHeartContainers = ____characters.getCharacterMaxHeartContainers
|
|
36
|
+
local getCharacterName = ____characters.getCharacterName
|
|
37
|
+
local isVanillaCharacter = ____characters.isVanillaCharacter
|
|
38
38
|
local ____collectibles = require("functions.collectibles")
|
|
39
39
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
40
40
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
@@ -10,8 +10,8 @@ local game = ____cachedClasses.game
|
|
|
10
10
|
local ____constants = require("constants")
|
|
11
11
|
local MAX_TAINTED_SAMSON_BERSERK_CHARGE = ____constants.MAX_TAINTED_SAMSON_BERSERK_CHARGE
|
|
12
12
|
local TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = ____constants.TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE
|
|
13
|
-
local
|
|
14
|
-
local getCharacterDeathAnimationName =
|
|
13
|
+
local ____characters = require("functions.characters")
|
|
14
|
+
local getCharacterDeathAnimationName = ____characters.getCharacterDeathAnimationName
|
|
15
15
|
local ____players = require("functions.players")
|
|
16
16
|
local getPlayerMaxHeartContainers = ____players.getPlayerMaxHeartContainers
|
|
17
17
|
local getPlayerNumHitsRemaining = ____players.getPlayerNumHitsRemaining
|
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,9 @@ export * from "./enums/SerializationType";
|
|
|
12
12
|
export { ConversionHeartSubType, registerCharacterHealthConversion, } from "./features/characterHealthConversion";
|
|
13
13
|
export { registerCharacterStats } from "./features/characterStats";
|
|
14
14
|
export { getCollectibleItemPoolType } from "./features/collectibleItemPoolType";
|
|
15
|
-
export { removeCustomGrid, spawnCustomGrid } from "./features/customGridEntity";
|
|
15
|
+
export { removeCustomGrid, spawnCustomGridEntity as spawnCustomGrid, } from "./features/customGridEntity";
|
|
16
16
|
export * from "./features/customStage/exports";
|
|
17
|
+
export * from "./features/customTrapdoor/exports";
|
|
17
18
|
export * from "./features/debugDisplay/exports";
|
|
18
19
|
export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/deployJSONRoom";
|
|
19
20
|
export { disableAllSound, enableAllSound } from "./features/disableAllSound";
|
|
@@ -42,7 +43,7 @@ export * from "./functions/bosses";
|
|
|
42
43
|
export * from "./functions/cacheFlag";
|
|
43
44
|
export * from "./functions/cards";
|
|
44
45
|
export * from "./functions/challenges";
|
|
45
|
-
export * from "./functions/
|
|
46
|
+
export * from "./functions/characters";
|
|
46
47
|
export * from "./functions/charge";
|
|
47
48
|
export * from "./functions/chargeBar";
|
|
48
49
|
export * from "./functions/collectibleCacheFlag";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,C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