isaacscript-common 6.11.0 → 6.12.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/postFlip.lua +2 -2
- package/dist/callbacks/postGridEntityCustomRender.d.ts +2 -0
- package/dist/callbacks/postGridEntityCustomRender.d.ts.map +1 -0
- package/dist/callbacks/postGridEntityCustomRender.lua +36 -0
- package/dist/callbacks/postGridEntityCustomUpdate.d.ts +2 -0
- package/dist/callbacks/postGridEntityCustomUpdate.d.ts.map +1 -0
- package/dist/callbacks/postGridEntityCustomUpdate.lua +36 -0
- package/dist/callbacks/postNewRoomEarly.lua +2 -2
- package/dist/callbacks/postPickupInitFirst.lua +1 -20
- 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/reorderedCallbacks.d.ts +5 -5
- package/dist/callbacks/reorderedCallbacks.d.ts.map +1 -1
- package/dist/callbacks/reorderedCallbacks.lua +5 -5
- package/dist/callbacks/subscriptions/postFirstFlip.d.ts +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.lua +2 -2
- package/dist/callbacks/subscriptions/postFlip.d.ts +1 -1
- package/dist/callbacks/subscriptions/postFlip.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postFlip.lua +2 -2
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.lua +29 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.lua +29 -0
- 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/constants.d.ts +1 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.lua +0 -7
- package/dist/constantsFirstLast.d.ts +5 -1
- package/dist/constantsFirstLast.d.ts.map +1 -1
- package/dist/constantsFirstLast.lua +6 -0
- package/dist/enums/ModCallbackCustom.d.ts +106 -81
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +63 -59
- package/dist/enums/private/StageTravelState.d.ts +9 -0
- package/dist/enums/private/StageTravelState.d.ts.map +1 -0
- package/dist/enums/private/StageTravelState.lua +15 -0
- package/dist/enums/private/TrapdoorAnimation.d.ts +6 -0
- package/dist/enums/private/TrapdoorAnimation.d.ts.map +1 -0
- package/dist/enums/private/TrapdoorAnimation.lua +6 -0
- package/dist/features/customGridEntity.d.ts +17 -5
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +86 -17
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +0 -13
- package/dist/features/customStage/init.d.ts.map +1 -1
- package/dist/features/customStage/init.lua +24 -2
- 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 -12
- 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/blackSprite.d.ts +2 -0
- package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -0
- package/dist/features/customTrapdoor/blackSprite.lua +19 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts +15 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -0
- package/dist/features/customTrapdoor/customTrapdoorConstants.lua +16 -0
- package/dist/features/customTrapdoor/exports.d.ts +29 -0
- package/dist/features/customTrapdoor/exports.d.ts.map +1 -0
- package/dist/features/customTrapdoor/exports.lua +93 -0
- package/dist/features/customTrapdoor/init.d.ts +3 -0
- package/dist/features/customTrapdoor/init.d.ts.map +1 -0
- package/dist/features/customTrapdoor/init.lua +174 -0
- package/dist/features/customTrapdoor/openClose.d.ts +5 -0
- package/dist/features/customTrapdoor/openClose.d.ts.map +1 -0
- package/dist/features/customTrapdoor/openClose.lua +60 -0
- package/dist/features/customTrapdoor/touched.d.ts +4 -0
- package/dist/features/customTrapdoor/touched.d.ts.map +1 -0
- package/dist/features/customTrapdoor/touched.lua +159 -0
- package/dist/features/customTrapdoor/v.d.ts +18 -0
- package/dist/features/customTrapdoor/v.d.ts.map +1 -0
- package/dist/features/customTrapdoor/v.lua +17 -0
- package/dist/features/deployJSONRoom.d.ts +2 -2
- package/dist/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/features/deployJSONRoom.lua +3 -3
- package/dist/features/extraConsoleCommands/init.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/init.lua +3 -1
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +6 -6
- package/dist/features/pause.d.ts +1 -1
- package/dist/features/pause.d.ts.map +1 -1
- package/dist/features/pause.lua +87 -8
- package/dist/features/persistentEntities.d.ts.map +1 -1
- package/dist/features/persistentEntities.lua +7 -7
- package/dist/features/pickupIndex.d.ts +19 -0
- package/dist/features/pickupIndex.d.ts.map +1 -0
- package/dist/features/pickupIndex.lua +197 -0
- package/dist/features/roomHistory.d.ts +24 -0
- package/dist/features/roomHistory.d.ts.map +1 -0
- package/dist/features/roomHistory.lua +89 -0
- package/dist/features/taintedLazarusPlayers.d.ts.map +1 -1
- package/dist/features/taintedLazarusPlayers.lua +13 -21
- 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/collectibles.d.ts +26 -13
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/collectibles.lua +26 -13
- package/dist/functions/entities.d.ts +3 -3
- package/dist/functions/entities.d.ts.map +1 -1
- package/dist/functions/entities.lua +8 -3
- package/dist/functions/gridEntities.d.ts +2 -2
- package/dist/functions/gridEntities.lua +2 -2
- package/dist/functions/isaacAPIClass.d.ts +64 -0
- package/dist/functions/isaacAPIClass.d.ts.map +1 -1
- package/dist/functions/isaacAPIClass.lua +84 -1
- package/dist/functions/log.lua +3 -3
- package/dist/functions/pickupVariants.d.ts +2 -2
- package/dist/functions/pickupVariants.d.ts.map +1 -1
- package/dist/functions/pickupVariants.lua +2 -2
- package/dist/functions/playerCenter.lua +2 -2
- package/dist/functions/playerIndex.d.ts +11 -5
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +19 -26
- package/dist/functions/players.lua +4 -4
- package/dist/functions/revive.lua +2 -2
- package/dist/functions/roomData.d.ts +3 -2
- package/dist/functions/roomData.d.ts.map +1 -1
- package/dist/functions/roomData.lua +3 -2
- package/dist/functions/rooms.d.ts +6 -6
- package/dist/functions/rooms.lua +6 -6
- package/dist/functions/stage.d.ts +1 -0
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +4 -0
- package/dist/functions/table.d.ts +1 -1
- package/dist/functions/table.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +33 -2
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +11 -2
- package/dist/initFeatures.d.ts +1 -2
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +16 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts +6 -2
- package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/interfaces/CustomGridEntityData.d.ts +6 -2
- package/dist/interfaces/CustomGridEntityData.d.ts.map +1 -1
- package/dist/interfaces/RoomDescription.d.ts +14 -0
- package/dist/interfaces/RoomDescription.d.ts.map +1 -0
- package/dist/interfaces/RoomDescription.lua +2 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +7 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.lua +2 -0
- package/dist/lib/jsonLua.lua +2 -0
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +9 -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/types/CollectibleIndex.d.ts +1 -1
- package/dist/types/PickupIndex.d.ts +17 -0
- package/dist/types/PickupIndex.d.ts.map +1 -0
- package/dist/types/PickupIndex.lua +2 -0
- package/dist/types/PlayerIndex.d.ts +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 +6 -5
- package/src/callbacks/postGridEntity.ts +5 -5
- package/src/callbacks/postGridEntityCustomRender.ts +44 -0
- package/src/callbacks/postGridEntityCustomUpdate.ts +44 -0
- package/src/callbacks/postNewRoomEarly.ts +2 -2
- package/src/callbacks/postPickupInitFirst.ts +1 -32
- 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} +12 -32
- package/src/callbacks/postSlotInitUpdate.ts +5 -2
- package/src/callbacks/postSlotRender.ts +2 -2
- package/src/callbacks/reorderedCallbacks.ts +10 -9
- package/src/callbacks/subscriptions/postFirstFlip.ts +6 -3
- package/src/callbacks/subscriptions/postFlip.ts +6 -3
- package/src/callbacks/subscriptions/postGridEntityCustomRender.ts +41 -0
- package/src/callbacks/subscriptions/postGridEntityCustomUpdate.ts +41 -0
- package/src/callbacks/subscriptions/{postPlayerInitReordered.ts → postPlayerInitFirst.ts} +6 -6
- package/src/constants.ts +1 -9
- package/src/constantsFirstLast.ts +16 -0
- package/src/enums/ModCallbackCustom.ts +52 -25
- package/src/enums/private/StageTravelState.ts +8 -0
- package/src/enums/private/TrapdoorAnimation.ts +5 -0
- package/src/features/customGridEntity.ts +118 -12
- package/src/features/customStage/exports.ts +3 -22
- package/src/features/customStage/init.ts +30 -1
- package/src/features/customStage/streakText.ts +13 -5
- package/src/features/customStage/versusScreen.ts +20 -12
- package/src/features/customTrapdoor/blackSprite.ts +16 -0
- package/src/features/customTrapdoor/customTrapdoorConstants.ts +23 -0
- package/src/features/customTrapdoor/exports.ts +99 -0
- package/src/features/customTrapdoor/init.ts +217 -0
- package/src/features/customTrapdoor/openClose.ts +103 -0
- package/src/features/customTrapdoor/touched.ts +195 -0
- package/src/features/customTrapdoor/v.ts +26 -0
- package/src/features/deployJSONRoom.ts +10 -5
- package/src/features/extraConsoleCommands/init.ts +5 -2
- package/src/features/extraConsoleCommands/listCommands.ts +6 -8
- package/src/features/pause.ts +97 -7
- package/src/features/persistentEntities.ts +9 -8
- package/src/features/pickupIndex.ts +257 -0
- package/src/features/playerInventory.ts +2 -2
- package/src/features/roomHistory.ts +113 -0
- package/src/features/saveDataManager/main.ts +3 -3
- package/src/features/taintedLazarusPlayers.ts +37 -36
- package/src/functions/{character.ts → characters.ts} +13 -0
- package/src/functions/collectibles.ts +26 -13
- package/src/functions/deepCopy.ts +2 -2
- package/src/functions/entities.ts +7 -4
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/isaacAPIClass.ts +106 -1
- package/src/functions/pickupVariants.ts +2 -2
- package/src/functions/playerCenter.ts +2 -2
- package/src/functions/playerIndex.ts +26 -23
- package/src/functions/players.ts +1 -1
- package/src/functions/revive.ts +1 -1
- package/src/functions/rng.ts +1 -1
- package/src/functions/roomData.ts +3 -2
- package/src/functions/rooms.ts +6 -6
- package/src/functions/stage.ts +10 -1
- package/src/functions/table.ts +2 -2
- package/src/index.ts +9 -2
- package/src/initCustomCallbacks.ts +7 -1
- package/src/initFeatures.ts +13 -2
- package/src/interfaces/AddCallbackParameterCustom.ts +6 -2
- package/src/interfaces/CustomGridEntityData.ts +7 -2
- package/src/interfaces/RoomDescription.ts +19 -0
- package/src/interfaces/private/CustomTrapdoorDescription.ts +7 -0
- package/src/lib/jsonLua.lua +2 -0
- package/src/objects/callbackRegisterFunctions.ts +8 -3
- package/src/objects/characterDamageMultipliers.ts +49 -0
- package/src/types/CollectibleIndex.ts +1 -1
- package/src/types/PickupIndex.ts +15 -0
- package/src/types/PlayerIndex.ts +1 -1
- package/src/upgradeMod.ts +4 -4
- 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,197 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local postPickupInit, postEntityRemovePickup, checkDespawningFromPlayerLeavingRoom, trackDespawningPickupMetadata, postNewRoomReordered, getStoredPickupIndex, getPostAscentPickupIndex, v
|
|
7
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
9
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
10
|
+
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
11
|
+
local ____cachedClasses = require("cachedClasses")
|
|
12
|
+
local game = ____cachedClasses.game
|
|
13
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
14
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
15
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
16
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
17
|
+
local ____featuresInitialized = require("featuresInitialized")
|
|
18
|
+
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
19
|
+
local ____entities = require("functions.entities")
|
|
20
|
+
local getEntityID = ____entities.getEntityID
|
|
21
|
+
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
22
|
+
local getPickups = ____entitiesSpecific.getPickups
|
|
23
|
+
local ____roomData = require("functions.roomData")
|
|
24
|
+
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
25
|
+
local ____stage = require("functions.stage")
|
|
26
|
+
local onAscent = ____stage.onAscent
|
|
27
|
+
local ____vector = require("functions.vector")
|
|
28
|
+
local vectorEquals = ____vector.vectorEquals
|
|
29
|
+
local ____roomHistory = require("features.roomHistory")
|
|
30
|
+
local getLatestRoomDescription = ____roomHistory.getLatestRoomDescription
|
|
31
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
32
|
+
local saveDataManager = ____exports.saveDataManager
|
|
33
|
+
function postPickupInit(self, pickup)
|
|
34
|
+
local ptrHash = GetPtrHash(pickup)
|
|
35
|
+
if v.room.pickupIndexes:has(ptrHash) then
|
|
36
|
+
return
|
|
37
|
+
end
|
|
38
|
+
local room = game:GetRoom()
|
|
39
|
+
local isFirstVisit = room:IsFirstVisit()
|
|
40
|
+
local roomFrameCount = room:GetFrameCount()
|
|
41
|
+
if not isFirstVisit and roomFrameCount <= 0 then
|
|
42
|
+
return
|
|
43
|
+
end
|
|
44
|
+
local ____v_run_0, ____pickupCounter_1 = v.run, "pickupCounter"
|
|
45
|
+
____v_run_0[____pickupCounter_1] = ____v_run_0[____pickupCounter_1] + 1
|
|
46
|
+
v.room.pickupIndexes:set(ptrHash, v.run.pickupCounter)
|
|
47
|
+
v.run.currentRoomListIndex = getRoomListIndex(nil)
|
|
48
|
+
end
|
|
49
|
+
function postEntityRemovePickup(self, entity)
|
|
50
|
+
checkDespawningFromPlayerLeavingRoom(nil, entity)
|
|
51
|
+
end
|
|
52
|
+
function checkDespawningFromPlayerLeavingRoom(self, entity)
|
|
53
|
+
local ptrHash = GetPtrHash(entity)
|
|
54
|
+
local pickupIndex = v.room.pickupIndexes:get(ptrHash)
|
|
55
|
+
if pickupIndex == nil then
|
|
56
|
+
return
|
|
57
|
+
end
|
|
58
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
59
|
+
if roomListIndex == v.run.currentRoomListIndex then
|
|
60
|
+
return
|
|
61
|
+
end
|
|
62
|
+
trackDespawningPickupMetadata(nil, entity, pickupIndex)
|
|
63
|
+
end
|
|
64
|
+
function trackDespawningPickupMetadata(self, entity, pickupIndex)
|
|
65
|
+
local previousRoomDescription = getLatestRoomDescription(nil)
|
|
66
|
+
local previousRoomListIndex = previousRoomDescription.roomListIndex
|
|
67
|
+
local pickupDescriptions = v.level.pickupData:getAndSetDefault(previousRoomListIndex)
|
|
68
|
+
local pickupDescription = {position = entity.Position, initSeed = entity.InitSeed}
|
|
69
|
+
pickupDescriptions:set(pickupIndex, pickupDescription)
|
|
70
|
+
if onAscent(nil) then
|
|
71
|
+
return
|
|
72
|
+
end
|
|
73
|
+
local room = game:GetRoom()
|
|
74
|
+
local roomType = room:GetType()
|
|
75
|
+
repeat
|
|
76
|
+
local ____switch13 = roomType
|
|
77
|
+
local ____cond13 = ____switch13 == RoomType.TREASURE
|
|
78
|
+
if ____cond13 then
|
|
79
|
+
do
|
|
80
|
+
v.run.pickupDataTreasureRooms:set(pickupIndex, pickupDescription)
|
|
81
|
+
break
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
____cond13 = ____cond13 or ____switch13 == RoomType.BOSS
|
|
85
|
+
if ____cond13 then
|
|
86
|
+
do
|
|
87
|
+
v.run.pickupDataBossRooms:set(pickupIndex, pickupDescription)
|
|
88
|
+
break
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
do
|
|
92
|
+
do
|
|
93
|
+
break
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
until true
|
|
97
|
+
end
|
|
98
|
+
function postNewRoomReordered(self)
|
|
99
|
+
local room = game:GetRoom()
|
|
100
|
+
local isFirstVisit = room:IsFirstVisit()
|
|
101
|
+
if isFirstVisit then
|
|
102
|
+
return
|
|
103
|
+
end
|
|
104
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
105
|
+
local pickupDescriptions = v.level.pickupData:getAndSetDefault(roomListIndex)
|
|
106
|
+
for ____, pickup in ipairs(getPickups(nil)) do
|
|
107
|
+
local pickupIndex = getStoredPickupIndex(nil, pickup, pickupDescriptions)
|
|
108
|
+
if pickupIndex == nil then
|
|
109
|
+
pickupIndex = getPostAscentPickupIndex(nil, pickup)
|
|
110
|
+
end
|
|
111
|
+
if pickupIndex == nil then
|
|
112
|
+
local entityID = getEntityID(nil, pickup)
|
|
113
|
+
error("Failed to find a pickup index corresponding to existing pickup: " .. entityID)
|
|
114
|
+
end
|
|
115
|
+
local ptrHash = GetPtrHash(pickup)
|
|
116
|
+
v.room.pickupIndexes:set(ptrHash, pickupIndex)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
function getStoredPickupIndex(self, pickup, pickupDescriptions)
|
|
120
|
+
for ____, ____value in __TS__Iterator(pickupDescriptions:entries()) do
|
|
121
|
+
local pickupIndex = ____value[1]
|
|
122
|
+
local pickupDescription = ____value[2]
|
|
123
|
+
if vectorEquals(nil, pickupDescription.position, pickup.Position) and pickupDescription.initSeed == pickup.InitSeed then
|
|
124
|
+
return pickupIndex
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
return nil
|
|
128
|
+
end
|
|
129
|
+
function getPostAscentPickupIndex(self, pickup)
|
|
130
|
+
if not onAscent(nil) then
|
|
131
|
+
return nil
|
|
132
|
+
end
|
|
133
|
+
local room = game:GetRoom()
|
|
134
|
+
local roomType = room:GetType()
|
|
135
|
+
repeat
|
|
136
|
+
local ____switch29 = roomType
|
|
137
|
+
local ____cond29 = ____switch29 == RoomType.TREASURE
|
|
138
|
+
if ____cond29 then
|
|
139
|
+
do
|
|
140
|
+
return getStoredPickupIndex(nil, pickup, v.run.pickupDataTreasureRooms)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
____cond29 = ____cond29 or ____switch29 == RoomType.BOSS
|
|
144
|
+
if ____cond29 then
|
|
145
|
+
do
|
|
146
|
+
return getStoredPickupIndex(nil, pickup, v.run.pickupDataBossRooms)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
do
|
|
150
|
+
do
|
|
151
|
+
return nil
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
until true
|
|
155
|
+
end
|
|
156
|
+
local FEATURE_NAME = "pickupIndex"
|
|
157
|
+
v = {
|
|
158
|
+
run = {
|
|
159
|
+
pickupCounter = 0,
|
|
160
|
+
currentRoomListIndex = 0,
|
|
161
|
+
pickupDataTreasureRooms = __TS__New(Map),
|
|
162
|
+
pickupDataBossRooms = __TS__New(Map)
|
|
163
|
+
},
|
|
164
|
+
level = {pickupData = __TS__New(
|
|
165
|
+
DefaultMap,
|
|
166
|
+
function() return __TS__New(Map) end
|
|
167
|
+
)},
|
|
168
|
+
room = {pickupIndexes = __TS__New(Map)}
|
|
169
|
+
}
|
|
170
|
+
function ____exports.pickupIndexInit(self, mod)
|
|
171
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
172
|
+
mod:AddCallback(ModCallback.POST_PICKUP_INIT, postPickupInit)
|
|
173
|
+
mod:AddCallback(ModCallback.POST_ENTITY_REMOVE, postEntityRemovePickup, EntityType.PICKUP)
|
|
174
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
175
|
+
end
|
|
176
|
+
--- Mods often have to track variables relating to a pickups. Finding an index for these kinds of
|
|
177
|
+
-- data structures is difficult, since pickups are respawned every time a player re-enters a room,
|
|
178
|
+
-- so the `PtrHash` will change.
|
|
179
|
+
--
|
|
180
|
+
-- Use this function to get a unique index for a pickup to use in these data structures.
|
|
181
|
+
--
|
|
182
|
+
-- Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the
|
|
183
|
+
-- current run. For example, the first pickup spawned will have an index of 1, the second one will
|
|
184
|
+
-- have an index of 2, and so on.
|
|
185
|
+
--
|
|
186
|
+
-- Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod.
|
|
187
|
+
function ____exports.getPickupIndex(self, pickup)
|
|
188
|
+
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
189
|
+
local ptrHash = GetPtrHash(pickup)
|
|
190
|
+
local pickupIndex = v.room.pickupIndexes:get(ptrHash)
|
|
191
|
+
if pickupIndex == nil then
|
|
192
|
+
local entityID = getEntityID(nil, pickup)
|
|
193
|
+
error((("Failed to get a pickup index for entity " .. entityID) .. " with hash: ") .. tostring(ptrHash))
|
|
194
|
+
end
|
|
195
|
+
return pickupIndex
|
|
196
|
+
end
|
|
197
|
+
return ____exports
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RoomDescription } from "../interfaces/RoomDescription";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get information about all of the rooms that a player has visited thus far on
|
|
4
|
+
* this run.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getRoomHistory(): readonly RoomDescription[];
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to get information about the room that was previously visited.
|
|
9
|
+
*
|
|
10
|
+
* In the special case of only one room having been visited thus far (i.e. the starting room of the
|
|
11
|
+
* run), the starting room will be returned.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPreviousRoomDescription(): RoomDescription;
|
|
14
|
+
/**
|
|
15
|
+
* Helper function to get information about the most recent room that is stored in the room history
|
|
16
|
+
* array.
|
|
17
|
+
*
|
|
18
|
+
* This is useful in the `POST_ENTITY_REMOVE` callback, since if an entity is despawning due to a
|
|
19
|
+
* player having left the room, the current room will have changed already, but the `POST_NEW_ROOM`
|
|
20
|
+
* callback will not have fired yet, and there will not be an entry in the room history array for
|
|
21
|
+
* the current room.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getLatestRoomDescription(): RoomDescription;
|
|
24
|
+
//# sourceMappingURL=roomHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomHistory.d.ts","sourceRoot":"","sources":["../../src/features/roomHistory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAiDhE;;;GAGG;AACH,wBAAgB,cAAc,IAAI,SAAS,eAAe,EAAE,CAG3D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,eAAe,CAe5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,eAAe,CAS1D"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local postNewRoomEarly, v
|
|
3
|
+
local ____cachedClasses = require("cachedClasses")
|
|
4
|
+
local game = ____cachedClasses.game
|
|
5
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
6
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
7
|
+
local ____featuresInitialized = require("featuresInitialized")
|
|
8
|
+
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
9
|
+
local ____array = require("functions.array")
|
|
10
|
+
local getLastElement = ____array.getLastElement
|
|
11
|
+
local ____roomData = require("functions.roomData")
|
|
12
|
+
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
13
|
+
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
14
|
+
local getRoomName = ____roomData.getRoomName
|
|
15
|
+
local getRoomStageID = ____roomData.getRoomStageID
|
|
16
|
+
local getRoomSubType = ____roomData.getRoomSubType
|
|
17
|
+
local getRoomVariant = ____roomData.getRoomVariant
|
|
18
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
19
|
+
local saveDataManager = ____exports.saveDataManager
|
|
20
|
+
function postNewRoomEarly(self)
|
|
21
|
+
local level = game:GetLevel()
|
|
22
|
+
local stage = level:GetStage()
|
|
23
|
+
local stageType = level:GetStageType()
|
|
24
|
+
local room = game:GetRoom()
|
|
25
|
+
local roomType = room:GetType()
|
|
26
|
+
local stageID = getRoomStageID(nil)
|
|
27
|
+
local roomVariant = getRoomVariant(nil)
|
|
28
|
+
local roomSubType = getRoomSubType(nil)
|
|
29
|
+
local roomName = getRoomName(nil)
|
|
30
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
31
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
32
|
+
local roomDescription = {
|
|
33
|
+
stage = stage,
|
|
34
|
+
stageType = stageType,
|
|
35
|
+
stageID = stageID,
|
|
36
|
+
roomType = roomType,
|
|
37
|
+
roomVariant = roomVariant,
|
|
38
|
+
roomSubType = roomSubType,
|
|
39
|
+
roomName = roomName,
|
|
40
|
+
roomGridIndex = roomGridIndex,
|
|
41
|
+
roomListIndex = roomListIndex
|
|
42
|
+
}
|
|
43
|
+
local ____v_run_roomHistory_0 = v.run.roomHistory
|
|
44
|
+
____v_run_roomHistory_0[#____v_run_roomHistory_0 + 1] = roomDescription
|
|
45
|
+
end
|
|
46
|
+
local FEATURE_NAME = "roomHistory"
|
|
47
|
+
v = {run = {roomHistory = {}}}
|
|
48
|
+
---
|
|
49
|
+
-- @internal
|
|
50
|
+
function ____exports.roomHistoryInit(self, mod)
|
|
51
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
52
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_EARLY, postNewRoomEarly)
|
|
53
|
+
end
|
|
54
|
+
--- Helper function to get information about all of the rooms that a player has visited thus far on
|
|
55
|
+
-- this run.
|
|
56
|
+
function ____exports.getRoomHistory(self)
|
|
57
|
+
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
58
|
+
return v.run.roomHistory
|
|
59
|
+
end
|
|
60
|
+
--- Helper function to get information about the room that was previously visited.
|
|
61
|
+
--
|
|
62
|
+
-- In the special case of only one room having been visited thus far (i.e. the starting room of the
|
|
63
|
+
-- run), the starting room will be returned.
|
|
64
|
+
function ____exports.getPreviousRoomDescription(self)
|
|
65
|
+
local previousRoomDescription = v.run.roomHistory[#v.run.roomHistory - 2 + 1]
|
|
66
|
+
if previousRoomDescription ~= nil then
|
|
67
|
+
return previousRoomDescription
|
|
68
|
+
end
|
|
69
|
+
local startingRoomDescription = v.run.roomHistory[1]
|
|
70
|
+
if startingRoomDescription ~= nil then
|
|
71
|
+
return startingRoomDescription
|
|
72
|
+
end
|
|
73
|
+
error("Failed to find a room description for any rooms thus far on this run.")
|
|
74
|
+
end
|
|
75
|
+
--- Helper function to get information about the most recent room that is stored in the room history
|
|
76
|
+
-- array.
|
|
77
|
+
--
|
|
78
|
+
-- This is useful in the `POST_ENTITY_REMOVE` callback, since if an entity is despawning due to a
|
|
79
|
+
-- player having left the room, the current room will have changed already, but the `POST_NEW_ROOM`
|
|
80
|
+
-- callback will not have fired yet, and there will not be an entry in the room history array for
|
|
81
|
+
-- the current room.
|
|
82
|
+
function ____exports.getLatestRoomDescription(self)
|
|
83
|
+
local latestRoomDescription = getLastElement(nil, v.run.roomHistory)
|
|
84
|
+
if latestRoomDescription == nil then
|
|
85
|
+
error("Failed to get the latest room description since the room history array was empty.")
|
|
86
|
+
end
|
|
87
|
+
return latestRoomDescription
|
|
88
|
+
end
|
|
89
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taintedLazarusPlayers.d.ts","sourceRoot":"","sources":["../../src/features/taintedLazarusPlayers.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"taintedLazarusPlayers.d.ts","sourceRoot":"","sources":["../../src/features/taintedLazarusPlayers.ts"],"names":[],"mappings":";AA+FA;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,GACnB,YAAY,GAAG,SAAS,CAK1B"}
|
|
@@ -8,17 +8,18 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
|
8
8
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
9
9
|
local ____featuresInitialized = require("featuresInitialized")
|
|
10
10
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
11
|
+
local ____log = require("functions.log")
|
|
12
|
+
local logError = ____log.logError
|
|
11
13
|
local ____exports = require("features.saveDataManager.exports")
|
|
12
14
|
local saveDataManager = ____exports.saveDataManager
|
|
13
15
|
function postPlayerInit(self, player)
|
|
14
|
-
local entityPtr = EntityPtr(player)
|
|
15
16
|
local character = player:GetPlayerType()
|
|
16
17
|
if character == PlayerType.LAZARUS_B then
|
|
17
18
|
local ____v_run_queuedTaintedLazarus_0 = v.run.queuedTaintedLazarus
|
|
18
|
-
____v_run_queuedTaintedLazarus_0[#____v_run_queuedTaintedLazarus_0 + 1] =
|
|
19
|
+
____v_run_queuedTaintedLazarus_0[#____v_run_queuedTaintedLazarus_0 + 1] = player
|
|
19
20
|
elseif character == PlayerType.LAZARUS_2_B then
|
|
20
21
|
local ____v_run_queuedDeadTaintedLazarus_1 = v.run.queuedDeadTaintedLazarus
|
|
21
|
-
____v_run_queuedDeadTaintedLazarus_1[#____v_run_queuedDeadTaintedLazarus_1 + 1] =
|
|
22
|
+
____v_run_queuedDeadTaintedLazarus_1[#____v_run_queuedDeadTaintedLazarus_1 + 1] = player
|
|
22
23
|
else
|
|
23
24
|
return
|
|
24
25
|
end
|
|
@@ -28,20 +29,19 @@ function checkDequeue(self)
|
|
|
28
29
|
if #v.run.queuedTaintedLazarus == 0 or #v.run.queuedDeadTaintedLazarus == 0 then
|
|
29
30
|
return
|
|
30
31
|
end
|
|
31
|
-
local
|
|
32
|
-
local
|
|
33
|
-
if taintedLazarusPtr == nil or deadTaintedLazarusPtr == nil then
|
|
34
|
-
return
|
|
35
|
-
end
|
|
36
|
-
local taintedLazarus = taintedLazarusPtr.Ref
|
|
37
|
-
local deadTaintedLazarus = deadTaintedLazarusPtr.Ref
|
|
32
|
+
local taintedLazarus = table.remove(v.run.queuedTaintedLazarus, 1)
|
|
33
|
+
local deadTaintedLazarus = table.remove(v.run.queuedDeadTaintedLazarus, 1)
|
|
38
34
|
if taintedLazarus == nil or deadTaintedLazarus == nil then
|
|
39
35
|
return
|
|
40
36
|
end
|
|
41
37
|
local taintedLazarusPtrHash = GetPtrHash(taintedLazarus)
|
|
42
38
|
local deadTaintedLazarusPtrHash = GetPtrHash(deadTaintedLazarus)
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
if taintedLazarusPtrHash == deadTaintedLazarusPtrHash then
|
|
40
|
+
logError("Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
|
|
41
|
+
return
|
|
42
|
+
end
|
|
43
|
+
v.run.subPlayerMap:set(taintedLazarusPtrHash, deadTaintedLazarus)
|
|
44
|
+
v.run.subPlayerMap:set(deadTaintedLazarusPtrHash, taintedLazarus)
|
|
45
45
|
end
|
|
46
46
|
local FEATURE_NAME = "taintedLazarusPlayers"
|
|
47
47
|
v = {run = {
|
|
@@ -72,14 +72,6 @@ end
|
|
|
72
72
|
function ____exports.getTaintedLazarusSubPlayer(self, player)
|
|
73
73
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
74
74
|
local ptrHash = GetPtrHash(player)
|
|
75
|
-
|
|
76
|
-
if entityPtr == nil then
|
|
77
|
-
return nil
|
|
78
|
-
end
|
|
79
|
-
local entity = entityPtr.Ref
|
|
80
|
-
if entity == nil then
|
|
81
|
-
return nil
|
|
82
|
-
end
|
|
83
|
-
return entity:ToPlayer()
|
|
75
|
+
return v.run.subPlayerMap:get(ptrHash)
|
|
84
76
|
end
|
|
85
77
|
return ____exports
|
|
@@ -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).
|
|
@@ -24,38 +24,51 @@ export declare function getCollectibleDevilHeartPrice(collectibleType: Collectib
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function getCollectibleGfxFilename(collectibleType: CollectibleType): string;
|
|
26
26
|
/**
|
|
27
|
-
* Mods
|
|
28
|
-
* data structures is difficult, since collectibles are respawned every time a player re-enters a
|
|
29
|
-
* room, so the `PtrHash` will change.
|
|
30
|
-
*
|
|
27
|
+
* Mods may have to keep track of data relating to a collectible. Finding an index for these kinds
|
|
28
|
+
* of data structures is difficult, since collectibles are respawned every time a player re-enters a
|
|
29
|
+
* room (like all other pickups), so the `PtrHash` will change.
|
|
30
|
+
*
|
|
31
|
+
* Use this function to get a unique index for a collectible to use in these data structures.
|
|
32
|
+
*
|
|
33
|
+
* If your mod is upgraded, then you should use the `getPickupIndex` function instead, as it is more
|
|
34
|
+
* general purpose and less prone to error (but relies on stateful tracking of pickups as the run
|
|
35
|
+
* progresses).
|
|
36
|
+
*
|
|
37
|
+
* Collectibles are a special case of pickups: they cannot be pushed around. (They actually can be
|
|
38
|
+
* pushed, but usually will stay on the same grid index.) Thus, it is possible to generate a
|
|
39
|
+
* somewhat reliable non-stateful index for collectibles. We use a 4-tuple of the room list index,
|
|
40
|
+
* the grid index of the collectible in the room, the collectible's `SubType`, and the collectible's
|
|
41
|
+
* `InitSeed`.
|
|
31
42
|
*
|
|
32
43
|
* Collectibles that are shifted by Tainted Isaac's mechanic will have unique collectible indexes
|
|
33
|
-
* because the SubType is different. (The collectible entities share the same InitSeed
|
|
44
|
+
* because the `SubType` is different. (The collectible entities share the same `InitSeed` and
|
|
45
|
+
* `PtrHash`.)
|
|
34
46
|
*
|
|
35
47
|
* Collectibles that are rolled (with e.g. a D6) will have unique collectible indexes because the
|
|
36
|
-
* SubType and InitSeed are different. If you want to track collectibles independently of any
|
|
48
|
+
* `SubType` and `InitSeed` are different. If you want to track collectibles independently of any
|
|
37
49
|
* rerolls, then you can use the `PtrHash` as an index instead. (The `PtrHash` will not persist
|
|
38
50
|
* between rooms, however.)
|
|
39
51
|
*
|
|
40
52
|
* Note that:
|
|
41
53
|
* - The grid index is a necessary part of the collectible index because Diplopia and Crooked Penny
|
|
42
|
-
* can cause two or more collectibles with the same SubType and InitSeed to exist in the same
|
|
54
|
+
* can cause two or more collectibles with the same `SubType` and `InitSeed` to exist in the same
|
|
43
55
|
* room.
|
|
44
56
|
* - This index will fail in the case where the player uses Diplopia or a successful Crooked Penny
|
|
45
57
|
* seven or more times in the same room, since that will cause two or more collectibles with the
|
|
46
|
-
* same grid index, SubType
|
|
47
|
-
*
|
|
48
|
-
*
|
|
58
|
+
* same grid index, `SubType`, and `InitSeed` to exist. (More than seven is required in non-1x1
|
|
59
|
+
* rooms.)
|
|
60
|
+
* - The `SubType` is a necessary part of the collectible index because Tainted Isaac will
|
|
61
|
+
* continuously cause collectibles to morph into new sub-types with the same `InitSeed`.
|
|
49
62
|
* - Using a collectible's position as part of the index is problematic, since players can push a
|
|
50
63
|
* pedestal. (Even using the grid index does not solve this problem, since it is possible in
|
|
51
64
|
* certain cases for collectibles to be spawned at a position that is not aligned with the grid,
|
|
52
65
|
* and the pedestal pushed to an adjacent tile, but this case should be extremely rare.)
|
|
53
66
|
* - Mega Chests spawn two collectibles on the exact same position. However, both of them will have
|
|
54
|
-
* different
|
|
67
|
+
* a different `InitSeed`, so this is not a problem for this indexing scheme.
|
|
55
68
|
* - The indexing scheme used is different for collectibles that are inside of a Treasure Room or
|
|
56
69
|
* Boss Room, in order to handle the case of the player seeing the same collectible again in a
|
|
57
|
-
* post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, SubType
|
|
58
|
-
* and InitSeed is used in this case. (Using the room list index or the room grid index is not
|
|
70
|
+
* post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, `SubType`,
|
|
71
|
+
* and `InitSeed` is used in this case. (Using the room list index or the room grid index is not
|
|
59
72
|
* suitable for this purpose, since both of these values can change in the post-Ascent rooms.)
|
|
60
73
|
* Even though Treasure Rooms and Boss Rooms are grouped together in this scheme, there probably
|
|
61
74
|
* will not be collectibles with the same grid index, SubType, and InitSeed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAkBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAyB7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,eAAe,GAC/B,GAAG,CAYL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAyBb;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAOR;AAED
|
|
1
|
+
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"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"}
|
|
@@ -182,38 +182,51 @@ function ____exports.getCollectibleGfxFilename(self, collectibleType)
|
|
|
182
182
|
end
|
|
183
183
|
return itemConfigItem.GfxFileName
|
|
184
184
|
end
|
|
185
|
-
--- Mods
|
|
186
|
-
-- data structures is difficult, since collectibles are respawned every time a player re-enters a
|
|
187
|
-
-- room, so the `PtrHash` will change.
|
|
188
|
-
--
|
|
185
|
+
--- Mods may have to keep track of data relating to a collectible. Finding an index for these kinds
|
|
186
|
+
-- of data structures is difficult, since collectibles are respawned every time a player re-enters a
|
|
187
|
+
-- room (like all other pickups), so the `PtrHash` will change.
|
|
188
|
+
--
|
|
189
|
+
-- Use this function to get a unique index for a collectible to use in these data structures.
|
|
190
|
+
--
|
|
191
|
+
-- If your mod is upgraded, then you should use the `getPickupIndex` function instead, as it is more
|
|
192
|
+
-- general purpose and less prone to error (but relies on stateful tracking of pickups as the run
|
|
193
|
+
-- progresses).
|
|
194
|
+
--
|
|
195
|
+
-- Collectibles are a special case of pickups: they cannot be pushed around. (They actually can be
|
|
196
|
+
-- pushed, but usually will stay on the same grid index.) Thus, it is possible to generate a
|
|
197
|
+
-- somewhat reliable non-stateful index for collectibles. We use a 4-tuple of the room list index,
|
|
198
|
+
-- the grid index of the collectible in the room, the collectible's `SubType`, and the collectible's
|
|
199
|
+
-- `InitSeed`.
|
|
189
200
|
--
|
|
190
201
|
-- Collectibles that are shifted by Tainted Isaac's mechanic will have unique collectible indexes
|
|
191
|
-
-- because the SubType is different. (The collectible entities share the same InitSeed
|
|
202
|
+
-- because the `SubType` is different. (The collectible entities share the same `InitSeed` and
|
|
203
|
+
-- `PtrHash`.)
|
|
192
204
|
--
|
|
193
205
|
-- Collectibles that are rolled (with e.g. a D6) will have unique collectible indexes because the
|
|
194
|
-
-- SubType and InitSeed are different. If you want to track collectibles independently of any
|
|
206
|
+
-- `SubType` and `InitSeed` are different. If you want to track collectibles independently of any
|
|
195
207
|
-- rerolls, then you can use the `PtrHash` as an index instead. (The `PtrHash` will not persist
|
|
196
208
|
-- between rooms, however.)
|
|
197
209
|
--
|
|
198
210
|
-- Note that:
|
|
199
211
|
-- - The grid index is a necessary part of the collectible index because Diplopia and Crooked Penny
|
|
200
|
-
-- can cause two or more collectibles with the same SubType and InitSeed to exist in the same
|
|
212
|
+
-- can cause two or more collectibles with the same `SubType` and `InitSeed` to exist in the same
|
|
201
213
|
-- room.
|
|
202
214
|
-- - This index will fail in the case where the player uses Diplopia or a successful Crooked Penny
|
|
203
215
|
-- seven or more times in the same room, since that will cause two or more collectibles with the
|
|
204
|
-
-- same grid index, SubType
|
|
205
|
-
--
|
|
206
|
-
--
|
|
216
|
+
-- same grid index, `SubType`, and `InitSeed` to exist. (More than seven is required in non-1x1
|
|
217
|
+
-- rooms.)
|
|
218
|
+
-- - The `SubType` is a necessary part of the collectible index because Tainted Isaac will
|
|
219
|
+
-- continuously cause collectibles to morph into new sub-types with the same `InitSeed`.
|
|
207
220
|
-- - Using a collectible's position as part of the index is problematic, since players can push a
|
|
208
221
|
-- pedestal. (Even using the grid index does not solve this problem, since it is possible in
|
|
209
222
|
-- certain cases for collectibles to be spawned at a position that is not aligned with the grid,
|
|
210
223
|
-- and the pedestal pushed to an adjacent tile, but this case should be extremely rare.)
|
|
211
224
|
-- - Mega Chests spawn two collectibles on the exact same position. However, both of them will have
|
|
212
|
-
-- different
|
|
225
|
+
-- a different `InitSeed`, so this is not a problem for this indexing scheme.
|
|
213
226
|
-- - The indexing scheme used is different for collectibles that are inside of a Treasure Room or
|
|
214
227
|
-- Boss Room, in order to handle the case of the player seeing the same collectible again in a
|
|
215
|
-
-- post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, SubType
|
|
216
|
-
-- and InitSeed is used in this case. (Using the room list index or the room grid index is not
|
|
228
|
+
-- post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, `SubType`,
|
|
229
|
+
-- and `InitSeed` is used in this case. (Using the room list index or the room grid index is not
|
|
217
230
|
-- suitable for this purpose, since both of these values can change in the post-Ascent rooms.)
|
|
218
231
|
-- Even though Treasure Rooms and Boss Rooms are grouped together in this scheme, there probably
|
|
219
232
|
-- will not be collectibles with the same grid index, SubType, and InitSeed.
|
|
@@ -65,10 +65,10 @@ export declare function getClosestEntityTo<T extends AnyEntity>(referenceEntity:
|
|
|
65
65
|
export declare function getEntities(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): Entity[];
|
|
66
66
|
/**
|
|
67
67
|
* Helper function to get all the fields on an entity. For example, this is useful for comparing it
|
|
68
|
-
* to another entity later.
|
|
68
|
+
* to another entity later. (One option is to use the `logTableDifferences` function for this.)
|
|
69
69
|
*
|
|
70
|
-
* This function will only get fields that are equal to booleans, numbers, or strings,
|
|
71
|
-
* other types is non-trivial.
|
|
70
|
+
* This function will only get fields that are equal to booleans, numbers, or strings, or Vectors,
|
|
71
|
+
* as comparing other types is non-trivial.
|
|
72
72
|
*/
|
|
73
73
|
export declare function getEntityFields(entity: Entity): LuaMap<string, boolean | number | string>;
|
|
74
74
|
/** Helper function to return a string containing the entity's type, variant, and sub-type. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/functions/entities.ts"],"names":[],"mappings":"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"}
|
|
@@ -20,6 +20,9 @@ local isRNG = ____rng.isRNG
|
|
|
20
20
|
local newRNG = ____rng.newRNG
|
|
21
21
|
local ____types = require("functions.types")
|
|
22
22
|
local isPrimitive = ____types.isPrimitive
|
|
23
|
+
local ____vector = require("functions.vector")
|
|
24
|
+
local isVector = ____vector.isVector
|
|
25
|
+
local vectorToString = ____vector.vectorToString
|
|
23
26
|
function setPrimitiveEntityFields(self, entity, metatable, entityFields)
|
|
24
27
|
local propGetTable = metatable.__propget
|
|
25
28
|
if propGetTable == nil then
|
|
@@ -30,6 +33,8 @@ function setPrimitiveEntityFields(self, entity, metatable, entityFields)
|
|
|
30
33
|
local value = entity[indexKey]
|
|
31
34
|
if isPrimitive(nil, value) then
|
|
32
35
|
entityFields[indexKey] = value
|
|
36
|
+
elseif isVector(nil, value) then
|
|
37
|
+
entityFields[indexKey] = vectorToString(nil, value)
|
|
33
38
|
end
|
|
34
39
|
end
|
|
35
40
|
end
|
|
@@ -180,10 +185,10 @@ function ____exports.getEntities(self, entityType, variant, subType, ignoreFrien
|
|
|
180
185
|
return Isaac.FindByType(entityType, variant, subType, ignoreFriendly)
|
|
181
186
|
end
|
|
182
187
|
--- Helper function to get all the fields on an entity. For example, this is useful for comparing it
|
|
183
|
-
-- to another entity later.
|
|
188
|
+
-- to another entity later. (One option is to use the `logTableDifferences` function for this.)
|
|
184
189
|
--
|
|
185
|
-
-- This function will only get fields that are equal to booleans, numbers, or strings,
|
|
186
|
-
-- other types is non-trivial.
|
|
190
|
+
-- This function will only get fields that are equal to booleans, numbers, or strings, or Vectors,
|
|
191
|
+
-- as comparing other types is non-trivial.
|
|
187
192
|
function ____exports.getEntityFields(self, entity)
|
|
188
193
|
local entityFields = {}
|
|
189
194
|
local metatable = getmetatable(entity)
|