isaacscript-common 6.6.3 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/customRevive.lua +4 -4
- package/dist/callbacks/postCursedTeleport.lua +2 -2
- package/dist/callbacks/postCustomDoorEnter.d.ts +1 -1
- package/dist/callbacks/postCustomDoorEnter.lua +6 -6
- package/dist/callbacks/postDiceRoomActivated.lua +2 -2
- package/dist/callbacks/postFlip.lua +3 -3
- package/dist/callbacks/postGridEntity.lua +3 -3
- package/dist/callbacks/postGridEntityCollision.lua +3 -3
- package/dist/callbacks/postGridEntityRender.lua +2 -2
- package/dist/callbacks/postNewRoomEarly.lua +5 -5
- package/dist/callbacks/postPickupCollect.lua +2 -2
- package/dist/callbacks/postPitRender.lua +2 -2
- package/dist/callbacks/postPitUpdate.lua +2 -2
- package/dist/callbacks/postPlayerCollectible.lua +2 -2
- package/dist/callbacks/postPoopRender.lua +2 -2
- package/dist/callbacks/postPoopUpdate.lua +2 -2
- package/dist/callbacks/postPressurePlateRender.lua +2 -2
- package/dist/callbacks/postPressurePlateUpdate.lua +2 -2
- package/dist/callbacks/postPurchase.lua +2 -2
- package/dist/callbacks/postRockRender.lua +2 -2
- package/dist/callbacks/postRockUpdate.lua +2 -2
- package/dist/callbacks/postSlotInitUpdate.lua +2 -2
- package/dist/callbacks/postSlotRender.lua +2 -2
- package/dist/callbacks/postSpikesRender.lua +2 -2
- package/dist/callbacks/postSpikesUpdate.lua +2 -2
- package/dist/callbacks/postTNTRender.lua +2 -2
- package/dist/callbacks/postTNTUpdate.lua +2 -2
- package/dist/callbacks/preBerserkDeath.lua +2 -2
- package/dist/callbacks/preNewLevel.lua +2 -2
- package/dist/callbacks/subscriptions/postDoorRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postDoorRender.lua +3 -3
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postDoorUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPitRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPitRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPitUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPoopRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPoopRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPoopUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPressurePlateRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +3 -3
- package/dist/enums/private/SerializationBrand.d.ts +0 -4
- package/dist/enums/private/SerializationBrand.d.ts.map +1 -1
- package/dist/features/characterStats.lua +2 -2
- package/dist/features/collectibleItemPoolType.lua +2 -2
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +5 -5
- package/dist/features/customStage/backdrop.lua +2 -2
- package/dist/features/customStage/{gridEntities.d.ts → customStageGridEntities.d.ts} +1 -1
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -0
- package/dist/features/customStage/{gridEntities.lua → customStageGridEntities.lua} +8 -8
- package/dist/features/customStage/{util.d.ts → customStageUtils.d.ts} +1 -1
- package/dist/features/customStage/customStageUtils.d.ts.map +1 -0
- package/dist/features/customStage/{util.lua → customStageUtils.lua} +0 -0
- package/dist/features/customStage/exports.lua +4 -4
- package/dist/features/customStage/init.lua +6 -6
- package/dist/features/customStage/shadows.lua +2 -2
- package/dist/features/customStage/versusScreen.lua +4 -4
- package/dist/features/debugDisplay/v.lua +4 -4
- package/dist/features/deployJSONRoom.lua +20 -20
- package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
- package/dist/features/pause.lua +2 -2
- package/dist/features/persistentEntities.lua +2 -2
- package/dist/features/preventCollectibleRotation.lua +2 -2
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/merge.lua +4 -3
- package/dist/features/sirenHelpers.lua +2 -2
- package/dist/functions/ambush.lua +5 -5
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/array.lua +1 -1
- package/dist/functions/{boss.d.ts → bosses.d.ts} +22 -4
- package/dist/functions/bosses.d.ts.map +1 -0
- package/dist/functions/{boss.lua → bosses.lua} +38 -13
- package/dist/functions/collectibleTag.lua +2 -2
- package/dist/functions/collectibles.lua +5 -5
- package/dist/functions/deepCopy.d.ts +8 -5
- package/dist/functions/deepCopy.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +142 -38
- package/dist/functions/deepCopyTests.d.ts +6 -1
- package/dist/functions/deepCopyTests.d.ts.map +1 -1
- package/dist/functions/deepCopyTests.lua +19 -16
- package/dist/functions/{entity.d.ts → entities.d.ts} +21 -19
- package/dist/functions/entities.d.ts.map +1 -0
- package/dist/functions/{entity.lua → entities.lua} +25 -20
- package/dist/functions/{entitySpecific.d.ts → entitiesSpecific.d.ts} +145 -68
- package/dist/functions/entitiesSpecific.d.ts.map +1 -0
- package/dist/functions/{entitySpecific.lua → entitiesSpecific.lua} +203 -65
- package/dist/functions/familiars.lua +2 -2
- package/dist/functions/{gridEntity.d.ts → gridEntities.d.ts} +48 -17
- package/dist/functions/gridEntities.d.ts.map +1 -0
- package/dist/functions/{gridEntity.lua → gridEntities.lua} +140 -90
- package/dist/functions/gridEntitiesSpecific.d.ts +141 -0
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -0
- package/dist/functions/gridEntitiesSpecific.lua +366 -0
- package/dist/functions/log.d.ts +1 -1
- package/dist/functions/log.d.ts.map +1 -1
- package/dist/functions/log.lua +16 -12
- package/dist/functions/mergeTests.d.ts +7 -1
- package/dist/functions/mergeTests.d.ts.map +1 -1
- package/dist/functions/mergeTests.lua +86 -7
- package/dist/functions/{npc.d.ts → npcs.d.ts} +24 -2
- package/dist/functions/npcs.d.ts.map +1 -0
- package/dist/functions/{npc.lua → npcs.lua} +44 -9
- package/dist/functions/pickups.d.ts +4 -119
- package/dist/functions/pickups.d.ts.map +1 -1
- package/dist/functions/pickups.lua +10 -439
- package/dist/functions/pickupsSpecific.d.ts +229 -0
- package/dist/functions/pickupsSpecific.d.ts.map +1 -0
- package/dist/functions/pickupsSpecific.lua +560 -0
- package/dist/functions/playerHealth.lua +6 -6
- package/dist/functions/{player.d.ts → players.d.ts} +1 -1
- package/dist/functions/players.d.ts.map +1 -0
- package/dist/functions/{player.lua → players.lua} +0 -0
- package/dist/functions/pocketItems.lua +2 -2
- package/dist/functions/positionVelocity.lua +6 -6
- package/dist/functions/pressurePlate.d.ts +10 -0
- package/dist/functions/pressurePlate.d.ts.map +1 -0
- package/dist/functions/pressurePlate.lua +29 -0
- package/dist/functions/revive.lua +7 -7
- package/dist/functions/rooms.lua +2 -2
- package/dist/functions/saveFile.lua +3 -3
- package/dist/functions/spawnCollectible.lua +4 -4
- package/dist/functions/{sprite.d.ts → sprites.d.ts} +1 -1
- package/dist/functions/sprites.d.ts.map +1 -0
- package/dist/functions/{sprite.lua → sprites.lua} +0 -0
- package/dist/functions/table.d.ts +1 -1
- package/dist/functions/table.lua +1 -1
- package/dist/functions/transformations.lua +2 -2
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.lua +6 -6
- package/dist/functions/utils.d.ts +7 -0
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.lua +35 -22
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +26 -10
- package/dist/types/AnyGridEntity.d.ts +10 -0
- package/dist/types/AnyGridEntity.d.ts.map +1 -0
- package/dist/types/AnyGridEntity.lua +2 -0
- package/package.json +2 -2
- package/src/callbacks/customRevive.ts +2 -2
- package/src/callbacks/postCursedTeleport.ts +2 -2
- package/src/callbacks/postCustomDoorEnter.ts +3 -3
- package/src/callbacks/postDiceRoomActivated.ts +1 -1
- package/src/callbacks/postFlip.ts +1 -1
- package/src/callbacks/postGridEntity.ts +1 -1
- package/src/callbacks/postGridEntityCollision.ts +1 -1
- package/src/callbacks/postGridEntityRender.ts +1 -1
- package/src/callbacks/postNewRoomEarly.ts +9 -3
- package/src/callbacks/postPickupCollect.ts +1 -1
- package/src/callbacks/postPitRender.ts +1 -1
- package/src/callbacks/postPitUpdate.ts +1 -1
- package/src/callbacks/postPlayerCollectible.ts +2 -2
- package/src/callbacks/postPoopRender.ts +1 -1
- package/src/callbacks/postPoopUpdate.ts +1 -1
- package/src/callbacks/postPressurePlateRender.ts +1 -1
- package/src/callbacks/postPressurePlateUpdate.ts +1 -1
- package/src/callbacks/postPurchase.ts +1 -1
- package/src/callbacks/postRockRender.ts +1 -1
- package/src/callbacks/postRockUpdate.ts +1 -1
- package/src/callbacks/postSacrifice.ts +1 -1
- package/src/callbacks/postSlotInitUpdate.ts +1 -1
- package/src/callbacks/postSlotRender.ts +1 -1
- package/src/callbacks/postSpikesRender.ts +1 -1
- package/src/callbacks/postSpikesUpdate.ts +1 -1
- package/src/callbacks/postTNTRender.ts +1 -1
- package/src/callbacks/postTNTUpdate.ts +1 -1
- package/src/callbacks/preBerserkDeath.ts +1 -1
- package/src/callbacks/preNewLevel.ts +1 -1
- package/src/callbacks/subscriptions/postDoorRender.ts +7 -5
- package/src/callbacks/subscriptions/postDoorUpdate.ts +7 -5
- package/src/callbacks/subscriptions/postPitRender.ts +6 -7
- package/src/callbacks/subscriptions/postPitUpdate.ts +6 -7
- package/src/callbacks/subscriptions/postPoopRender.ts +7 -5
- package/src/callbacks/subscriptions/postPoopUpdate.ts +7 -5
- package/src/callbacks/subscriptions/postPressurePlateRender.ts +7 -5
- package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +7 -5
- package/src/enums/private/SerializationBrand.ts +0 -4
- package/src/features/characterStats.ts +1 -1
- package/src/features/collectibleItemPoolType.ts +1 -1
- package/src/features/customGridEntity.ts +6 -3
- package/src/features/customStage/backdrop.ts +1 -1
- package/src/features/customStage/{gridEntities.ts → customStageGridEntities.ts} +3 -3
- package/src/features/customStage/{util.ts → customStageUtils.ts} +0 -0
- package/src/features/customStage/exports.ts +2 -2
- package/src/features/customStage/init.ts +1 -1
- package/src/features/customStage/shadows.ts +1 -1
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/debugDisplay/v.ts +2 -2
- package/src/features/deployJSONRoom.ts +11 -7
- package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -2
- package/src/features/extraConsoleCommands/listCommands.ts +13 -9
- package/src/features/pause.ts +1 -1
- package/src/features/persistentEntities.ts +2 -2
- package/src/features/preventCollectibleRotation.ts +1 -1
- package/src/features/saveDataManager/exports.ts +7 -4
- package/src/features/saveDataManager/merge.ts +3 -3
- package/src/features/sirenHelpers.ts +1 -1
- package/src/functions/ambush.ts +2 -2
- package/src/functions/array.ts +5 -2
- package/src/functions/bitwise.ts +2 -2
- package/src/functions/{boss.ts → bosses.ts} +29 -21
- package/src/functions/collectibleTag.ts +1 -1
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/deepCopy.ts +98 -19
- package/src/functions/deepCopyTests.ts +75 -19
- package/src/functions/{entity.ts → entities.ts} +23 -21
- package/src/functions/{entitySpecific.ts → entitiesSpecific.ts} +170 -99
- package/src/functions/familiars.ts +1 -1
- package/src/functions/{gridEntity.ts → gridEntities.ts} +110 -34
- package/src/functions/gridEntitiesSpecific.ts +490 -0
- package/src/functions/log.ts +19 -10
- package/src/functions/mergeTests.ts +152 -4
- package/src/functions/{npc.ts → npcs.ts} +42 -11
- package/src/functions/pickups.ts +8 -475
- package/src/functions/pickupsSpecific.ts +613 -0
- package/src/functions/playerHealth.ts +1 -1
- package/src/functions/{player.ts → players.ts} +0 -0
- package/src/functions/pocketItems.ts +1 -1
- package/src/functions/positionVelocity.ts +3 -3
- package/src/functions/pressurePlate.ts +29 -0
- package/src/functions/revive.ts +2 -2
- package/src/functions/rooms.ts +1 -1
- package/src/functions/saveFile.ts +1 -1
- package/src/functions/spawnCollectible.ts +2 -2
- package/src/functions/{sprite.ts → sprites.ts} +0 -0
- package/src/functions/table.ts +1 -1
- package/src/functions/transformations.ts +1 -1
- package/src/functions/trinketGive.ts +4 -4
- package/src/functions/trinkets.ts +3 -3
- package/src/functions/tstlClass.ts +1 -1
- package/src/functions/ui.ts +3 -3
- package/src/functions/utils.ts +32 -13
- package/src/index.ts +10 -8
- package/src/types/AnyGridEntity.ts +9 -0
- package/dist/features/customStage/gridEntities.d.ts.map +0 -1
- package/dist/features/customStage/util.d.ts.map +0 -1
- package/dist/functions/boss.d.ts.map +0 -1
- package/dist/functions/entity.d.ts.map +0 -1
- package/dist/functions/entitySpecific.d.ts.map +0 -1
- package/dist/functions/gridEntity.d.ts.map +0 -1
- package/dist/functions/gridEntitySpecific.d.ts +0 -29
- package/dist/functions/gridEntitySpecific.d.ts.map +0 -1
- package/dist/functions/gridEntitySpecific.lua +0 -114
- package/dist/functions/npc.d.ts.map +0 -1
- package/dist/functions/player.d.ts.map +0 -1
- package/dist/functions/sprite.d.ts.map +0 -1
- package/src/functions/gridEntitySpecific.ts +0 -143
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local DoorVariant = ____isaac_2Dtypescript_2Ddefinitions.DoorVariant
|
|
4
|
+
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
5
|
+
local PitVariant = ____isaac_2Dtypescript_2Ddefinitions.PitVariant
|
|
6
|
+
local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
|
|
7
|
+
local PressurePlateVariant = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateVariant
|
|
8
|
+
local RockVariant = ____isaac_2Dtypescript_2Ddefinitions.RockVariant
|
|
9
|
+
local ____gridEntities = require("functions.gridEntities")
|
|
10
|
+
local getGridEntities = ____gridEntities.getGridEntities
|
|
11
|
+
local removeGridEntities = ____gridEntities.removeGridEntities
|
|
12
|
+
local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
|
|
13
|
+
--- Helper function to spawn a `GridEntityType.DOOR` (16) with a specific variant.
|
|
14
|
+
function ____exports.spawnDoorWithVariant(self, doorVariant, gridIndexOrPosition)
|
|
15
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.DOOR, doorVariant, gridIndexOrPosition)
|
|
16
|
+
if gridEntity == nil then
|
|
17
|
+
return gridEntity
|
|
18
|
+
end
|
|
19
|
+
local door = gridEntity:ToDoor()
|
|
20
|
+
if door == nil then
|
|
21
|
+
error("Failed to spawn a door.")
|
|
22
|
+
end
|
|
23
|
+
return door
|
|
24
|
+
end
|
|
25
|
+
--- Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant.
|
|
26
|
+
function ____exports.spawnPitWithVariant(self, pitVariant, gridIndexOrPosition)
|
|
27
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.PIT, pitVariant, gridIndexOrPosition)
|
|
28
|
+
if gridEntity == nil then
|
|
29
|
+
return gridEntity
|
|
30
|
+
end
|
|
31
|
+
local pit = gridEntity:ToPit()
|
|
32
|
+
if pit == nil then
|
|
33
|
+
error("Failed to spawn a pit.")
|
|
34
|
+
end
|
|
35
|
+
return pit
|
|
36
|
+
end
|
|
37
|
+
--- Helper function to spawn a `GridEntityType.POOP` (14) with a specific variant.
|
|
38
|
+
function ____exports.spawnPoopWithVariant(self, poopVariant, gridIndexOrPosition)
|
|
39
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.POOP, poopVariant, gridIndexOrPosition)
|
|
40
|
+
if gridEntity == nil then
|
|
41
|
+
return gridEntity
|
|
42
|
+
end
|
|
43
|
+
local poop = gridEntity:ToPoop()
|
|
44
|
+
if poop == nil then
|
|
45
|
+
error("Failed to spawn a poop.")
|
|
46
|
+
end
|
|
47
|
+
return poop
|
|
48
|
+
end
|
|
49
|
+
--- Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20) with a specific variant.
|
|
50
|
+
function ____exports.spawnPressurePlateWithVariant(self, pressurePlateVariant, gridIndexOrPosition)
|
|
51
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.PRESSURE_PLATE, pressurePlateVariant, gridIndexOrPosition)
|
|
52
|
+
if gridEntity == nil then
|
|
53
|
+
return gridEntity
|
|
54
|
+
end
|
|
55
|
+
local pressurePlate = gridEntity:ToPressurePlate()
|
|
56
|
+
if pressurePlate == nil then
|
|
57
|
+
error("Failed to spawn a pressure plate.")
|
|
58
|
+
end
|
|
59
|
+
return pressurePlate
|
|
60
|
+
end
|
|
61
|
+
--- Helper function to spawn a `GridEntityType.ROCK` (2) with a specific variant.
|
|
62
|
+
function ____exports.spawnRockWithVariant(self, rockVariant, gridIndexOrPosition)
|
|
63
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.ROCK, rockVariant, gridIndexOrPosition)
|
|
64
|
+
if gridEntity == nil then
|
|
65
|
+
return gridEntity
|
|
66
|
+
end
|
|
67
|
+
local rock = gridEntity:ToRock()
|
|
68
|
+
if rock == nil then
|
|
69
|
+
error("Failed to spawn a rock.")
|
|
70
|
+
end
|
|
71
|
+
return rock
|
|
72
|
+
end
|
|
73
|
+
--- Helper function to spawn a `GridEntityType.SPIKES` (8) with a specific variant.
|
|
74
|
+
function ____exports.spawnSpikesWithVariant(self, variant, gridIndexOrPosition)
|
|
75
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.SPIKES, variant, gridIndexOrPosition)
|
|
76
|
+
if gridEntity == nil then
|
|
77
|
+
return gridEntity
|
|
78
|
+
end
|
|
79
|
+
local spikes = gridEntity:ToSpikes()
|
|
80
|
+
if spikes == nil then
|
|
81
|
+
error("Failed to spawn spikes.")
|
|
82
|
+
end
|
|
83
|
+
return spikes
|
|
84
|
+
end
|
|
85
|
+
--- Helper function to spawn a `GridEntityType.TNT` (12) with a specific variant.
|
|
86
|
+
function ____exports.spawnTNTWithVariant(self, variant, gridIndexOrPosition)
|
|
87
|
+
local gridEntity = spawnGridEntityWithVariant(nil, GridEntityType.TNT, variant, gridIndexOrPosition)
|
|
88
|
+
if gridEntity == nil then
|
|
89
|
+
return gridEntity
|
|
90
|
+
end
|
|
91
|
+
local tnt = gridEntity:ToTNT()
|
|
92
|
+
if tnt == nil then
|
|
93
|
+
error("Failed to spawn TNT.")
|
|
94
|
+
end
|
|
95
|
+
return tnt
|
|
96
|
+
end
|
|
97
|
+
--- Helper function to get all of the `GridEntityPit` in the room.
|
|
98
|
+
--
|
|
99
|
+
-- @param pitVariant Optional. If specified, will only get the pits that match the variant. Default
|
|
100
|
+
-- is -1, which matches every variant.
|
|
101
|
+
function ____exports.getPits(self, pitVariant)
|
|
102
|
+
if pitVariant == nil then
|
|
103
|
+
pitVariant = -1
|
|
104
|
+
end
|
|
105
|
+
local gridEntities = getGridEntities(nil)
|
|
106
|
+
local pits = {}
|
|
107
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
108
|
+
local pit = gridEntity:ToPit()
|
|
109
|
+
if pit ~= nil then
|
|
110
|
+
local gridEntityVariant = pit:GetVariant()
|
|
111
|
+
if pitVariant == -1 or pitVariant == gridEntityVariant then
|
|
112
|
+
pits[#pits + 1] = pit
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
return pits
|
|
117
|
+
end
|
|
118
|
+
--- Helper function to get all of the `GridEntityPoop` in the room.
|
|
119
|
+
--
|
|
120
|
+
-- @param poopVariant Optional. If specified, will only get the poops that match the variant.
|
|
121
|
+
-- Default is -1, which matches every variant.
|
|
122
|
+
function ____exports.getPoops(self, poopVariant)
|
|
123
|
+
if poopVariant == nil then
|
|
124
|
+
poopVariant = -1
|
|
125
|
+
end
|
|
126
|
+
local gridEntities = getGridEntities(nil)
|
|
127
|
+
local poops = {}
|
|
128
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
129
|
+
local poop = gridEntity:ToPoop()
|
|
130
|
+
if poop ~= nil then
|
|
131
|
+
local gridEntityVariant = poop:GetVariant()
|
|
132
|
+
if poopVariant == -1 or poopVariant == gridEntityVariant then
|
|
133
|
+
poops[#poops + 1] = poop
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
return poops
|
|
138
|
+
end
|
|
139
|
+
--- Helper function to get all of the `GridEntityPressurePlate` in the room.
|
|
140
|
+
--
|
|
141
|
+
-- @param pressurePlateVariant Optional. If specified, will only get the pressure plates that match
|
|
142
|
+
-- the variant. Default is -1, which matches every variant.
|
|
143
|
+
function ____exports.getPressurePlates(self, pressurePlateVariant)
|
|
144
|
+
if pressurePlateVariant == nil then
|
|
145
|
+
pressurePlateVariant = -1
|
|
146
|
+
end
|
|
147
|
+
local gridEntities = getGridEntities(nil)
|
|
148
|
+
local pressurePlates = {}
|
|
149
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
150
|
+
local pressurePlate = gridEntity:ToPressurePlate()
|
|
151
|
+
if pressurePlate ~= nil then
|
|
152
|
+
local gridEntityVariant = pressurePlate:GetVariant()
|
|
153
|
+
if pressurePlateVariant == -1 or pressurePlateVariant == gridEntityVariant then
|
|
154
|
+
pressurePlates[#pressurePlates + 1] = pressurePlate
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
return pressurePlates
|
|
159
|
+
end
|
|
160
|
+
--- Helper function to get all of the `GridEntityRock` in the room.
|
|
161
|
+
--
|
|
162
|
+
-- @param variant Optional. If specified, will only get the rocks that match the variant. Default is
|
|
163
|
+
-- -1, which matches every variant. Note that this is not the same thing as the
|
|
164
|
+
-- `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and other
|
|
165
|
+
-- types of grid entities can be the `GridEntityRock` class.
|
|
166
|
+
function ____exports.getRocks(self, variant)
|
|
167
|
+
if variant == nil then
|
|
168
|
+
variant = -1
|
|
169
|
+
end
|
|
170
|
+
local gridEntities = getGridEntities(nil)
|
|
171
|
+
local rocks = {}
|
|
172
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
173
|
+
local rock = gridEntity:ToRock()
|
|
174
|
+
if rock ~= nil then
|
|
175
|
+
local gridEntityVariant = rock:GetVariant()
|
|
176
|
+
if variant == -1 or variant == gridEntityVariant then
|
|
177
|
+
rocks[#rocks + 1] = rock
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
return rocks
|
|
182
|
+
end
|
|
183
|
+
--- Helper function to get all of the `GridEntitySpikes` in the room.
|
|
184
|
+
function ____exports.getSpikes(self, variant)
|
|
185
|
+
if variant == nil then
|
|
186
|
+
variant = -1
|
|
187
|
+
end
|
|
188
|
+
local gridEntities = getGridEntities(nil)
|
|
189
|
+
local spikes = {}
|
|
190
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
191
|
+
local spike = gridEntity:ToSpikes()
|
|
192
|
+
if spike ~= nil then
|
|
193
|
+
local gridEntityVariant = spike:GetVariant()
|
|
194
|
+
if variant == -1 or variant == gridEntityVariant then
|
|
195
|
+
spikes[#spikes + 1] = spike
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
return spikes
|
|
200
|
+
end
|
|
201
|
+
--- Helper function to get all of the `GridEntityTNT` in the room.
|
|
202
|
+
function ____exports.getTNT(self, variant)
|
|
203
|
+
if variant == nil then
|
|
204
|
+
variant = -1
|
|
205
|
+
end
|
|
206
|
+
local gridEntities = getGridEntities(nil)
|
|
207
|
+
local tntArray = {}
|
|
208
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
209
|
+
local tnt = gridEntity:ToTNT()
|
|
210
|
+
if tnt ~= nil then
|
|
211
|
+
local gridEntityVariant = tnt:GetVariant()
|
|
212
|
+
if variant == -1 or variant == gridEntityVariant then
|
|
213
|
+
tntArray[#tntArray + 1] = tnt
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
return tntArray
|
|
218
|
+
end
|
|
219
|
+
--- Helper function to remove all of the `GridEntityPit` in the room.
|
|
220
|
+
--
|
|
221
|
+
-- @param pitVariant Optional. If specified, will only remove the pits that match this variant.
|
|
222
|
+
-- Default is -1, which matches every variant.
|
|
223
|
+
-- @param updateRoom Optional. Whether or not to update the room after the pits are removed. Default
|
|
224
|
+
-- is false. For more information, see the description of the `removeGridEntities`
|
|
225
|
+
-- helper function.
|
|
226
|
+
-- @param cap Optional. If specified, will only remove the given amount of pits.
|
|
227
|
+
-- @returns The pits that were removed.
|
|
228
|
+
function ____exports.removeAllPits(self, pitVariant, updateRoom, cap)
|
|
229
|
+
if pitVariant == nil then
|
|
230
|
+
pitVariant = -1
|
|
231
|
+
end
|
|
232
|
+
if updateRoom == nil then
|
|
233
|
+
updateRoom = false
|
|
234
|
+
end
|
|
235
|
+
local pits = ____exports.getPits(nil, pitVariant)
|
|
236
|
+
return removeGridEntities(nil, pits, updateRoom, cap)
|
|
237
|
+
end
|
|
238
|
+
--- Helper function to remove all of the `GridEntityPoop` in the room.
|
|
239
|
+
--
|
|
240
|
+
-- Note that poops can either be an entity or a grid entity, depending on the situation. This
|
|
241
|
+
-- function will only remove the grid entity poops.
|
|
242
|
+
--
|
|
243
|
+
-- @param poopVariant Optional. If specified, will only remove the poops that match this variant.
|
|
244
|
+
-- Default is -1, which matches every variant.
|
|
245
|
+
-- @param updateRoom Optional. Whether or not to update the room after the poops are removed.
|
|
246
|
+
-- Default is false. For more information, see the description of the
|
|
247
|
+
-- `removeGridEntities` helper function.
|
|
248
|
+
-- @param cap Optional. If specified, will only remove the given amount of poops.
|
|
249
|
+
-- @returns The poops that were removed.
|
|
250
|
+
function ____exports.removeAllPoops(self, poopVariant, updateRoom, cap)
|
|
251
|
+
if poopVariant == nil then
|
|
252
|
+
poopVariant = -1
|
|
253
|
+
end
|
|
254
|
+
if updateRoom == nil then
|
|
255
|
+
updateRoom = false
|
|
256
|
+
end
|
|
257
|
+
local poops = ____exports.getPoops(nil, poopVariant)
|
|
258
|
+
return removeGridEntities(nil, poops, updateRoom, cap)
|
|
259
|
+
end
|
|
260
|
+
--- Helper function to remove all of the `GridEntityPressurePlate` in the room.
|
|
261
|
+
--
|
|
262
|
+
-- @param pressurePlateVariant Optional. If specified, will only remove the pressure plates that
|
|
263
|
+
-- match this variant. Default is -1, which matches every variant.
|
|
264
|
+
-- @param updateRoom Optional. Whether or not to update the room after the pressure plates are
|
|
265
|
+
-- removed. Default is false. For more information, see the description of the
|
|
266
|
+
-- `removeGridEntities` helper function.
|
|
267
|
+
-- @param cap Optional. If specified, will only remove the given amount of pressure plates.
|
|
268
|
+
-- @returns The pressure plates that were removed.
|
|
269
|
+
function ____exports.removeAllPressurePlates(self, pressurePlateVariant, updateRoom, cap)
|
|
270
|
+
if pressurePlateVariant == nil then
|
|
271
|
+
pressurePlateVariant = -1
|
|
272
|
+
end
|
|
273
|
+
if updateRoom == nil then
|
|
274
|
+
updateRoom = false
|
|
275
|
+
end
|
|
276
|
+
local pressurePlates = ____exports.getPressurePlates(nil, pressurePlateVariant)
|
|
277
|
+
return removeGridEntities(nil, pressurePlates, updateRoom, cap)
|
|
278
|
+
end
|
|
279
|
+
--- Helper function to remove all of the `GridEntityRock` in the room.
|
|
280
|
+
--
|
|
281
|
+
-- @param variant Optional. If specified, will only remove the rocks that match this variant.
|
|
282
|
+
-- Default is -1, which matches every variant. Note that this is not the same thing
|
|
283
|
+
-- as the `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and
|
|
284
|
+
-- other types of grid entities can be the `GridEntityRock` class.
|
|
285
|
+
-- @param updateRoom Optional. Whether or not to update the room after the rocks are removed.
|
|
286
|
+
-- Default is false. For more information, see the description of the
|
|
287
|
+
-- `removeGridEntities` helper function.
|
|
288
|
+
-- @param cap Optional. If specified, will only remove the given amount of rocks.
|
|
289
|
+
-- @returns The rocks that were removed.
|
|
290
|
+
function ____exports.removeAllRocks(self, variant, updateRoom, cap)
|
|
291
|
+
if variant == nil then
|
|
292
|
+
variant = -1
|
|
293
|
+
end
|
|
294
|
+
if updateRoom == nil then
|
|
295
|
+
updateRoom = false
|
|
296
|
+
end
|
|
297
|
+
local rocks = ____exports.getRocks(nil, variant)
|
|
298
|
+
return removeGridEntities(nil, rocks, updateRoom, cap)
|
|
299
|
+
end
|
|
300
|
+
--- Helper function to remove all of the `GridEntitySpikes` in the room.
|
|
301
|
+
--
|
|
302
|
+
-- @param variant Optional. If specified, will only remove the spikes that match this variant.
|
|
303
|
+
-- Default is -1, which matches every variant.
|
|
304
|
+
-- @param updateRoom Optional. Whether or not to update the room after the spikes are removed.
|
|
305
|
+
-- Default is false. For more information, see the description of the
|
|
306
|
+
-- `removeGridEntities` helper function.
|
|
307
|
+
-- @param cap Optional. If specified, will only remove the given amount of spikes.
|
|
308
|
+
-- @returns The spikes that were removed.
|
|
309
|
+
function ____exports.removeAllSpikes(self, variant, updateRoom, cap)
|
|
310
|
+
if variant == nil then
|
|
311
|
+
variant = -1
|
|
312
|
+
end
|
|
313
|
+
if updateRoom == nil then
|
|
314
|
+
updateRoom = false
|
|
315
|
+
end
|
|
316
|
+
local spikes = ____exports.getSpikes(nil, variant)
|
|
317
|
+
return removeGridEntities(nil, spikes, updateRoom, cap)
|
|
318
|
+
end
|
|
319
|
+
--- Helper function to remove all of the `GridEntityTNT` in the room.
|
|
320
|
+
--
|
|
321
|
+
-- @param variant Optional. If specified, will only remove the TNTs that match this variant. Default
|
|
322
|
+
-- is -1, which matches every variant.
|
|
323
|
+
-- @param updateRoom Optional. Whether or not to update the room after the TNTs are removed. Default
|
|
324
|
+
-- is false. For more information, see the description of the `removeGridEntities`
|
|
325
|
+
-- helper function.
|
|
326
|
+
-- @param cap Optional. If specified, will only remove the given amount of TNTs.
|
|
327
|
+
-- @returns The TNTs that were removed.
|
|
328
|
+
function ____exports.removeAllTNT(self, variant, updateRoom, cap)
|
|
329
|
+
if variant == nil then
|
|
330
|
+
variant = -1
|
|
331
|
+
end
|
|
332
|
+
if updateRoom == nil then
|
|
333
|
+
updateRoom = false
|
|
334
|
+
end
|
|
335
|
+
local tnt = ____exports.getTNT(nil, variant)
|
|
336
|
+
return removeGridEntities(nil, tnt, updateRoom, cap)
|
|
337
|
+
end
|
|
338
|
+
--- Helper function to spawn a `GridEntityType.DOOR` (16).
|
|
339
|
+
function ____exports.spawnDoor(self, gridIndexOrPosition)
|
|
340
|
+
return ____exports.spawnDoorWithVariant(nil, DoorVariant.UNSPECIFIED, gridIndexOrPosition)
|
|
341
|
+
end
|
|
342
|
+
--- Helper function to spawn a `GridEntityType.PIT` (7).
|
|
343
|
+
function ____exports.spawnPit(self, gridIndexOrPosition)
|
|
344
|
+
return ____exports.spawnPitWithVariant(nil, PitVariant.NORMAL, gridIndexOrPosition)
|
|
345
|
+
end
|
|
346
|
+
--- Helper function to spawn a `GridEntityType.POOP` (14).
|
|
347
|
+
function ____exports.spawnPoop(self, gridIndexOrPosition)
|
|
348
|
+
return ____exports.spawnPoopWithVariant(nil, PoopGridEntityVariant.NORMAL, gridIndexOrPosition)
|
|
349
|
+
end
|
|
350
|
+
--- Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20).
|
|
351
|
+
function ____exports.spawnPressurePlate(self, gridIndexOrPosition)
|
|
352
|
+
return ____exports.spawnPressurePlateWithVariant(nil, PressurePlateVariant.PRESSURE_PLATE, gridIndexOrPosition)
|
|
353
|
+
end
|
|
354
|
+
--- Helper function to spawn a `GridEntityType.ROCK` (2).
|
|
355
|
+
function ____exports.spawnRock(self, gridIndexOrPosition)
|
|
356
|
+
return ____exports.spawnRockWithVariant(nil, RockVariant.NORMAL, gridIndexOrPosition)
|
|
357
|
+
end
|
|
358
|
+
--- Helper function to spawn a `GridEntityType.SPIKES` (8).
|
|
359
|
+
function ____exports.spawnSpikes(self, gridIndexOrPosition)
|
|
360
|
+
return ____exports.spawnSpikesWithVariant(nil, 0, gridIndexOrPosition)
|
|
361
|
+
end
|
|
362
|
+
--- Helper function to spawn a `GridEntityType.TNT` (12).
|
|
363
|
+
function ____exports.spawnTNT(self, gridIndexOrPosition)
|
|
364
|
+
return ____exports.spawnTNTWithVariant(nil, 0, gridIndexOrPosition)
|
|
365
|
+
end
|
|
366
|
+
return ____exports
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export declare function logSounds(this: void): void;
|
|
|
64
64
|
* recursively call itself if it counters a table within a table.
|
|
65
65
|
*
|
|
66
66
|
* This function will only work on tables that have string keys (because it logs the keys in order,
|
|
67
|
-
* instead of randomly). It will throw a
|
|
67
|
+
* instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
68
68
|
*/
|
|
69
69
|
export declare function logTable(this: void, luaTable: unknown, parentTables?: number): void;
|
|
70
70
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/functions/log.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAEV,UAAU,EACV,UAAU,EAEV,cAAc,EAGd,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AA+BtC;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,GAA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EACV,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC,GAC3C,IAAI,CAUN;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAQ1C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,EACjB,YAAY,SAAI,GACf,IAAI,CAwCN;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,MAAM,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,IAAI,CA0BN;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACnC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACjC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAsB/D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CA8B5C"}
|
package/dist/functions/log.lua
CHANGED
|
@@ -28,22 +28,22 @@ local ____array = require("functions.array")
|
|
|
28
28
|
local arrayToString = ____array.arrayToString
|
|
29
29
|
local ____collectibles = require("functions.collectibles")
|
|
30
30
|
local getCollectibleName = ____collectibles.getCollectibleName
|
|
31
|
-
local
|
|
32
|
-
local getEntities =
|
|
33
|
-
local getEntityID =
|
|
31
|
+
local ____entities = require("functions.entities")
|
|
32
|
+
local getEntities = ____entities.getEntities
|
|
33
|
+
local getEntityID = ____entities.getEntityID
|
|
34
34
|
local ____enums = require("functions.enums")
|
|
35
35
|
local getEnumEntries = ____enums.getEnumEntries
|
|
36
36
|
local ____flag = require("functions.flag")
|
|
37
37
|
local hasFlag = ____flag.hasFlag
|
|
38
|
-
local
|
|
39
|
-
local getGridEntities =
|
|
38
|
+
local ____gridEntities = require("functions.gridEntities")
|
|
39
|
+
local getGridEntities = ____gridEntities.getGridEntities
|
|
40
40
|
local ____isaacAPIClass = require("functions.isaacAPIClass")
|
|
41
41
|
local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
|
|
42
|
-
local ____player = require("functions.player")
|
|
43
|
-
local getEffectsList = ____player.getEffectsList
|
|
44
|
-
local getPlayerName = ____player.getPlayerName
|
|
45
42
|
local ____playerHealth = require("functions.playerHealth")
|
|
46
43
|
local getPlayerHealth = ____playerHealth.getPlayerHealth
|
|
44
|
+
local ____players = require("functions.players")
|
|
45
|
+
local getEffectsList = ____players.getEffectsList
|
|
46
|
+
local getPlayerName = ____players.getPlayerName
|
|
47
47
|
local ____roomData = require("functions.roomData")
|
|
48
48
|
local getRoomData = ____roomData.getRoomData
|
|
49
49
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
@@ -464,7 +464,7 @@ end
|
|
|
464
464
|
-- recursively call itself if it counters a table within a table.
|
|
465
465
|
--
|
|
466
466
|
-- This function will only work on tables that have string keys (because it logs the keys in order,
|
|
467
|
-
-- instead of randomly). It will throw a
|
|
467
|
+
-- instead of randomly). It will throw a run-time error if it encounters a non-string key.
|
|
468
468
|
function ____exports.logTable(luaTable, parentTables)
|
|
469
469
|
if parentTables == nil then
|
|
470
470
|
parentTables = 0
|
|
@@ -478,7 +478,9 @@ function ____exports.logTable(luaTable, parentTables)
|
|
|
478
478
|
math.floor(numSpaces)
|
|
479
479
|
)
|
|
480
480
|
if not isTable(nil, luaTable) then
|
|
481
|
-
|
|
481
|
+
(function()
|
|
482
|
+
____exports.log(((indentation .. "n/a (encountered a variable of type \"") .. __TS__TypeOf(luaTable)) .. "\" instead of a table)")
|
|
483
|
+
end)(nil)
|
|
482
484
|
return
|
|
483
485
|
end
|
|
484
486
|
iterateTableInOrder(
|
|
@@ -494,8 +496,10 @@ function ____exports.logTable(luaTable, parentTables)
|
|
|
494
496
|
end
|
|
495
497
|
end
|
|
496
498
|
end
|
|
497
|
-
)
|
|
498
|
-
|
|
499
|
+
);
|
|
500
|
+
(function()
|
|
501
|
+
____exports.log((indentation .. "The size of the table was: ") .. tostring(#luaTable))
|
|
502
|
+
end)(nil)
|
|
499
503
|
end
|
|
500
504
|
--- Helper function to print out the differences between the entries of two tables. Note that this
|
|
501
505
|
-- will only do a shallow comparison.
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Run the suite of tests that prove that the "merge" helper function works properly. (This function
|
|
3
|
+
* is not exported but is used internally in the save data manager.)
|
|
4
|
+
*
|
|
5
|
+
* This function is only useful if you are troubleshooting the save data manager.
|
|
6
|
+
*/
|
|
7
|
+
export declare function runMergeTests(): void;
|
|
2
8
|
//# sourceMappingURL=mergeTests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTests.d.ts","sourceRoot":"","sources":["../../src/functions/mergeTests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mergeTests.d.ts","sourceRoot":"","sources":["../../src/functions/mergeTests.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAgBpC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
1
4
|
local ____exports = {}
|
|
2
|
-
local oldTableHasUpdatedValue, newTableHasSameValue, oldTableHasUpdatedValueFromNull, oldTableHasSerializedIsaacAPIClass,
|
|
5
|
+
local oldTableHasUpdatedValue, newTableHasSameValue, oldTableHasUpdatedValueFromNull, oldTableHasSerializedIsaacAPIClass, oldTableHasFilledChildTable, oldTableHasFilledMap, oldTableHasFilledDefaultMap, oldTableHasVector, oldTableHasVectorSerialized, oldTableHasRNG, oldTableHasRNGSerialized
|
|
6
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
7
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
3
8
|
local ____SerializationType = require("enums.SerializationType")
|
|
4
9
|
local SerializationType = ____SerializationType.SerializationType
|
|
5
10
|
local ____merge = require("features.saveDataManager.merge")
|
|
@@ -60,13 +65,13 @@ function oldTableHasSerializedIsaacAPIClass(self)
|
|
|
60
65
|
error("The \"isSerializedIsaacAPIClass\" function says that a serialized vector is not serialized.")
|
|
61
66
|
end
|
|
62
67
|
end
|
|
63
|
-
function
|
|
68
|
+
function oldTableHasFilledChildTable(self)
|
|
64
69
|
local key = "foo"
|
|
65
70
|
local newValue = "baz"
|
|
66
71
|
local oldTable = {foo = nil}
|
|
67
72
|
local foo = {bar = newValue}
|
|
68
73
|
local newTable = {foo = foo}
|
|
69
|
-
merge(nil, oldTable, newTable, "
|
|
74
|
+
merge(nil, oldTable, newTable, "oldTableHasFilledChildTable")
|
|
70
75
|
local oldTableValue = oldTable[key]
|
|
71
76
|
if oldTableValue == nil then
|
|
72
77
|
error(("The old table's key of \"" .. key) .. "\" was not filled.")
|
|
@@ -75,6 +80,74 @@ function oldTableHasFilledInterface(self)
|
|
|
75
80
|
error("The old table's key of \"bar\" was not filled.")
|
|
76
81
|
end
|
|
77
82
|
end
|
|
83
|
+
function oldTableHasFilledMap(self)
|
|
84
|
+
local v = {run = {myMap = __TS__New(Map)}}
|
|
85
|
+
local saveData = {run = {myMap = __TS__New(Map, {{"foo1", "bar1"}, {"foo2", "bar2"}, {"foo3", "bar3"}})}}
|
|
86
|
+
local serializedSaveData = deepCopy(nil, saveData, SerializationType.SERIALIZE)
|
|
87
|
+
merge(nil, v, serializedSaveData, "oldTableHasFilledMap")
|
|
88
|
+
local expectedSize = 3
|
|
89
|
+
if v.run.myMap.size ~= expectedSize then
|
|
90
|
+
error((("The size of the merged map was equal to " .. tostring(v.run.myMap.size)) .. ", but it should be equal to: ") .. tostring(expectedSize))
|
|
91
|
+
end
|
|
92
|
+
do
|
|
93
|
+
local key = "foo1"
|
|
94
|
+
local expectedValue = "bar1"
|
|
95
|
+
local value = v.run.myMap:get(key)
|
|
96
|
+
if value ~= expectedValue then
|
|
97
|
+
error((((("The old table's map key of \"" .. key) .. "\" was not equal to \"") .. expectedValue) .. "\" and was instead equal to: ") .. tostring(value))
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
do
|
|
101
|
+
local key = "foo2"
|
|
102
|
+
local expectedValue = "bar2"
|
|
103
|
+
local value = v.run.myMap:get(key)
|
|
104
|
+
if value ~= expectedValue then
|
|
105
|
+
error((((("The old table's map key of \"" .. key) .. "\" was not equal to \"") .. expectedValue) .. "\" and was instead equal to: ") .. tostring(value))
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
do
|
|
109
|
+
local key = "foo3"
|
|
110
|
+
local expectedValue = "bar3"
|
|
111
|
+
local value = v.run.myMap:get(key)
|
|
112
|
+
if value ~= expectedValue then
|
|
113
|
+
error((((("The old table's map key of \"" .. key) .. "\" was not equal to \"") .. expectedValue) .. "\" and was instead equal to: ") .. tostring(value))
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
function oldTableHasFilledDefaultMap(self)
|
|
118
|
+
local v = {run = {myDefaultMap = __TS__New(DefaultMap, "default")}}
|
|
119
|
+
local saveData = {run = {myDefaultMap = __TS__New(DefaultMap, "default", {{"foo1", "bar1"}, {"foo2", "bar2"}, {"foo3", "bar3"}})}}
|
|
120
|
+
local serializedSaveData = deepCopy(nil, saveData, SerializationType.SERIALIZE)
|
|
121
|
+
merge(nil, v, serializedSaveData, "oldTableHasFilledDefaultMap")
|
|
122
|
+
local expectedSize = 3
|
|
123
|
+
if v.run.myDefaultMap.size ~= expectedSize then
|
|
124
|
+
error((("The size of the merged default map was equal to " .. tostring(v.run.myDefaultMap.size)) .. ", but it should be equal to: ") .. tostring(expectedSize))
|
|
125
|
+
end
|
|
126
|
+
do
|
|
127
|
+
local key = "foo1"
|
|
128
|
+
local expectedValue = "bar1"
|
|
129
|
+
local value = v.run.myDefaultMap:get(key)
|
|
130
|
+
if value ~= expectedValue then
|
|
131
|
+
error((((("The old table's default map key of \"" .. key) .. "\" was not equal to \"") .. expectedValue) .. "\" and was instead equal to: ") .. tostring(value))
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
do
|
|
135
|
+
local key = "foo2"
|
|
136
|
+
local expectedValue = "bar2"
|
|
137
|
+
local value = v.run.myDefaultMap:get(key)
|
|
138
|
+
if value ~= expectedValue then
|
|
139
|
+
error((((("The old table's default map key of \"" .. key) .. "\" was not equal to \"") .. expectedValue) .. "\" and was instead equal to: ") .. tostring(value))
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
do
|
|
143
|
+
local key = "foo3"
|
|
144
|
+
local expectedValue = "bar3"
|
|
145
|
+
local value = v.run.myDefaultMap:get(key)
|
|
146
|
+
if value ~= expectedValue then
|
|
147
|
+
error((((("The old table's default map key of \"" .. key) .. "\" was not equal to \"") .. expectedValue) .. "\" and was instead equal to: ") .. tostring(value))
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
78
151
|
function oldTableHasVector(self)
|
|
79
152
|
log("Starting test: oldTableHasVector")
|
|
80
153
|
local key = "foo"
|
|
@@ -108,7 +181,7 @@ function oldTableHasVectorSerialized(self)
|
|
|
108
181
|
local oldTable = {foo = nil}
|
|
109
182
|
local foo = {bar = newValue}
|
|
110
183
|
local newTable = {foo = foo}
|
|
111
|
-
local newTableSerialized = deepCopy(nil, newTable, SerializationType.SERIALIZE)
|
|
184
|
+
local newTableSerialized = deepCopy(nil, newTable, SerializationType.SERIALIZE, "oldTableHasVectorSerialized")
|
|
112
185
|
merge(nil, oldTable, newTableSerialized, "oldTableHasVectorSerialized")
|
|
113
186
|
local oldTableValue = oldTable[key]
|
|
114
187
|
if oldTableValue == nil then
|
|
@@ -153,7 +226,7 @@ function oldTableHasRNGSerialized(self)
|
|
|
153
226
|
local oldTable = {foo = nil}
|
|
154
227
|
local foo = {bar = newValue}
|
|
155
228
|
local newTable = {foo = foo}
|
|
156
|
-
local newTableSerialized = deepCopy(nil, newTable, SerializationType.SERIALIZE)
|
|
229
|
+
local newTableSerialized = deepCopy(nil, newTable, SerializationType.SERIALIZE, "oldTableHasRNGSerialized")
|
|
157
230
|
merge(nil, oldTable, newTableSerialized, "oldTableHasRNGSerialized")
|
|
158
231
|
local oldTableValue = oldTable[key]
|
|
159
232
|
if oldTableValue == nil then
|
|
@@ -167,12 +240,18 @@ function oldTableHasRNGSerialized(self)
|
|
|
167
240
|
error("The old table's seed not match: " .. tostring(seed))
|
|
168
241
|
end
|
|
169
242
|
end
|
|
170
|
-
function
|
|
243
|
+
--- Run the suite of tests that prove that the "merge" helper function works properly. (This function
|
|
244
|
+
-- is not exported but is used internally in the save data manager.)
|
|
245
|
+
--
|
|
246
|
+
-- This function is only useful if you are troubleshooting the save data manager.
|
|
247
|
+
function ____exports.runMergeTests(self)
|
|
171
248
|
oldTableHasUpdatedValue(nil)
|
|
172
249
|
newTableHasSameValue(nil)
|
|
173
250
|
oldTableHasUpdatedValueFromNull(nil)
|
|
174
251
|
oldTableHasSerializedIsaacAPIClass(nil)
|
|
175
|
-
|
|
252
|
+
oldTableHasFilledChildTable(nil)
|
|
253
|
+
oldTableHasFilledMap(nil)
|
|
254
|
+
oldTableHasFilledDefaultMap(nil)
|
|
176
255
|
oldTableHasVector(nil)
|
|
177
256
|
oldTableHasVectorSerialized(nil)
|
|
178
257
|
oldTableHasRNG(nil)
|
|
@@ -18,8 +18,16 @@ export declare function fireProjectiles(npc: EntityNPC, position: Vector, veloci
|
|
|
18
18
|
*
|
|
19
19
|
* This function will not include NPCs on an internal blacklist, such as Death's scythes or Big Horn
|
|
20
20
|
* holes.
|
|
21
|
+
*
|
|
22
|
+
* @param entityType Optional. If specified, will only get the NPCs that match the type. Default is
|
|
23
|
+
* -1, which matches every type.
|
|
24
|
+
* @param variant Optional. If specified, will only get the NPCs that match the variant. Default is
|
|
25
|
+
* -1, which matches every variant.
|
|
26
|
+
* @param subType Optional. If specified, will only get the NPCs that match the sub-type. Default is
|
|
27
|
+
* -1, which matches every sub-type.
|
|
28
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
21
29
|
*/
|
|
22
|
-
export declare function getAliveNPCs(
|
|
30
|
+
export declare function getAliveNPCs(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): EntityNPC[];
|
|
23
31
|
/**
|
|
24
32
|
* Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
25
33
|
* not actually keep the doors closed (like Death's scythes).
|
|
@@ -38,4 +46,18 @@ export declare function isDyingEggyWithNoSpidersLeft(npc: EntityNPC): boolean;
|
|
|
38
46
|
* enemies.
|
|
39
47
|
*/
|
|
40
48
|
export declare function isRaglingDeathPatch(npc: EntityNPC): boolean;
|
|
41
|
-
|
|
49
|
+
/**
|
|
50
|
+
* The base game `EntityNPC.FireProjectiles` method does not return anything, which is a problem in
|
|
51
|
+
* situations where you need to work with the fired projectiles. This function invokes that method,
|
|
52
|
+
* and then returns the projectiles that were spawned.
|
|
53
|
+
*
|
|
54
|
+
* @param npc The EntityNPC firing projectiles.
|
|
55
|
+
* @param position The starting position of the projectiles.
|
|
56
|
+
* @param velocity The starting velocity of the projectiles.
|
|
57
|
+
* @param projectilesMode A ProjectilesMode enum value defining how to fire the projectiles.
|
|
58
|
+
* @param projectileParams A ProjectileParams object containing various parameters for the
|
|
59
|
+
* projectiles.
|
|
60
|
+
* @returns An array of EntityProjectiles containing all fired projectiles.
|
|
61
|
+
*/
|
|
62
|
+
export declare function npcFireProjectiles(npc: EntityNPC, position: Vector, velocity: Vector, projectilesMode: ProjectilesMode, projectileParams: ProjectileParams): EntityProjectile[];
|
|
63
|
+
//# sourceMappingURL=npcs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EAMV,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAgCtC;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,GAAE,eAAgD,EACjE,gBAAgB,GAAE,gBAAqC,GACtD,gBAAgB,EAAE,CAMpB;AAED;;;;;;;;;;;;;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,CAoB3D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAKpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAO3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,gBAAgB,EAAE,CAOpB"}
|