isaacscript-common 6.11.1 → 6.13.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/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/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 +91 -68
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +62 -58
- package/dist/enums/private/StageTravelState.d.ts +6 -1
- package/dist/enums/private/StageTravelState.d.ts.map +1 -1
- package/dist/enums/private/StageTravelState.lua +10 -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/collectibleItemPoolType.d.ts +2 -2
- package/dist/features/collectibleItemPoolType.lua +2 -2
- package/dist/features/customGridEntity.d.ts +17 -5
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +78 -15
- 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 +16 -1
- package/dist/features/customStage/streakText.d.ts.map +1 -1
- package/dist/features/customStage/streakText.lua +0 -1
- 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 +8 -3
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -1
- package/dist/features/customTrapdoor/customTrapdoorConstants.lua +9 -1
- package/dist/features/customTrapdoor/exports.d.ts +11 -19
- package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
- package/dist/features/customTrapdoor/exports.lua +48 -82
- 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 +16 -2
- package/dist/features/customTrapdoor/v.d.ts.map +1 -1
- package/dist/features/customTrapdoor/v.lua +8 -6
- package/dist/features/deployJSONRoom.d.ts +2 -2
- package/dist/features/deployJSONRoom.lua +2 -2
- package/dist/features/extraConsoleCommands/init.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/init.lua +14 -15
- package/dist/features/extraConsoleCommands/listCommands.d.ts +15 -19
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +34 -42
- 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/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/map.d.ts +2 -0
- package/dist/functions/map.d.ts.map +1 -1
- package/dist/functions/map.lua +7 -0
- 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 +5 -3
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +15 -24
- 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/set.d.ts +2 -0
- package/dist/functions/set.d.ts.map +1 -1
- package/dist/functions/set.lua +6 -0
- 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 +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +23 -0
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +6 -0
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +9 -0
- package/dist/interfaces/AddCallbackParameterCustom.d.ts +4 -0
- package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/interfaces/CustomGridEntityData.d.ts +5 -1
- 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 +3 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +6 -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.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/postFlip.ts +3 -2
- 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 +3 -32
- package/src/callbacks/postPlayerReorderedCallbacks.ts +3 -3
- package/src/callbacks/reorderedCallbacks.ts +9 -8
- 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/constants.ts +1 -9
- package/src/constantsFirstLast.ts +16 -0
- package/src/enums/ModCallbackCustom.ts +35 -10
- package/src/enums/private/StageTravelState.ts +5 -1
- package/src/enums/private/TrapdoorAnimation.ts +5 -0
- package/src/features/collectibleItemPoolType.ts +3 -3
- package/src/features/customGridEntity.ts +93 -10
- package/src/features/customStage/exports.ts +3 -22
- package/src/features/customStage/init.ts +20 -0
- package/src/features/customStage/streakText.ts +0 -1
- package/src/features/customTrapdoor/blackSprite.ts +22 -0
- package/src/features/customTrapdoor/customTrapdoorConstants.ts +13 -3
- package/src/features/customTrapdoor/exports.ts +52 -121
- 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 +16 -10
- package/src/features/deployJSONRoom.ts +5 -5
- package/src/features/extraConsoleCommands/init.ts +22 -16
- package/src/features/extraConsoleCommands/listCommands.ts +38 -43
- 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/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/map.ts +10 -0
- package/src/functions/pickupVariants.ts +2 -2
- package/src/functions/playerCenter.ts +2 -2
- package/src/functions/playerIndex.ts +20 -21
- package/src/functions/rng.ts +1 -1
- package/src/functions/roomData.ts +3 -2
- package/src/functions/rooms.ts +6 -6
- package/src/functions/set.ts +7 -1
- package/src/functions/stage.ts +10 -1
- package/src/functions/table.ts +2 -2
- package/src/index.ts +3 -0
- package/src/initCustomCallbacks.ts +4 -0
- package/src/initFeatures.ts +6 -0
- package/src/interfaces/AddCallbackParameterCustom.ts +4 -0
- package/src/interfaces/CustomGridEntityData.ts +6 -1
- package/src/interfaces/RoomDescription.ts +19 -0
- package/src/interfaces/private/CustomTrapdoorDescription.ts +4 -0
- package/src/objects/callbackRegisterFunctions.ts +6 -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 +2 -1
|
@@ -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
|
|
@@ -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"],"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E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
|
|
@@ -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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U,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
|
|
@@ -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)
|
|
@@ -17,8 +17,8 @@ export declare function getAllGridIndexes(): int[];
|
|
|
17
17
|
* Gets the entities that have a hitbox that overlaps with any part of the square that the grid
|
|
18
18
|
* entity is on.
|
|
19
19
|
*
|
|
20
|
-
* Note that this function will not work properly in the
|
|
21
|
-
* have collision yet in that callback.
|
|
20
|
+
* Note that this function will not work properly in the `POST_NEW_ROOM` callback, since entities do
|
|
21
|
+
* not have collision yet in that callback.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): Entity[];
|
|
24
24
|
/**
|
|
@@ -200,8 +200,8 @@ end
|
|
|
200
200
|
--- Gets the entities that have a hitbox that overlaps with any part of the square that the grid
|
|
201
201
|
-- entity is on.
|
|
202
202
|
--
|
|
203
|
-
-- Note that this function will not work properly in the
|
|
204
|
-
-- have collision yet in that callback.
|
|
203
|
+
-- Note that this function will not work properly in the `POST_NEW_ROOM` callback, since entities do
|
|
204
|
+
-- not have collision yet in that callback.
|
|
205
205
|
function ____exports.getCollidingEntitiesWithGridEntity(self, gridEntity)
|
|
206
206
|
local gridEntityCollisionTopLeft = Vector(gridEntity.Position.X - DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y - DISTANCE_OF_GRID_TILE / 2)
|
|
207
207
|
local gridEntityCollisionBottomRight = Vector(gridEntity.Position.X + DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y + DISTANCE_OF_GRID_TILE / 2)
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
4
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
5
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
6
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
7
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
8
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
9
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
10
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
11
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
12
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
13
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
14
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
15
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
16
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
17
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
18
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
19
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
1
20
|
import { IsaacAPIClass } from "../types/private/IsaacAPIClass";
|
|
2
21
|
/**
|
|
3
22
|
* Helper function to get the name of a class from the Isaac API. This is contained within the
|
|
@@ -7,8 +26,27 @@ import { IsaacAPIClass } from "../types/private/IsaacAPIClass";
|
|
|
7
26
|
*
|
|
8
27
|
* Returns undefined if the object is not of type `userdata` or if the "__type" metatable key does
|
|
9
28
|
* not exist.
|
|
29
|
+
*
|
|
30
|
+
* In some cases, Isaac classes can be a read-only. If this is the case, the "__type" field will be
|
|
31
|
+
* prepended with "const ". This function will always strip this prefix, if it exists. For example,
|
|
32
|
+
* the class name returned for "const Vector" will be "Vector".
|
|
10
33
|
*/
|
|
11
34
|
export declare function getIsaacAPIClassName(object: unknown): string | undefined;
|
|
35
|
+
/** Helper function to detect if a variable is of type `EntityBomb`. */
|
|
36
|
+
export declare function isBomb(variable: unknown): variable is EntityBomb;
|
|
37
|
+
/** Helper function to detect if a variable is of type `GridEntityDoor`. */
|
|
38
|
+
export declare function isDoor(variable: unknown): variable is GridEntityDoor;
|
|
39
|
+
/** Helper function to detect if a variable is of type `EntityEffect`. */
|
|
40
|
+
export declare function isEffect(variable: unknown): variable is EntityEffect;
|
|
41
|
+
/**
|
|
42
|
+
* Helper function to detect if a variable is of type `Entity`. This will return false for child
|
|
43
|
+
* classes such as `EntityPlayer` or `EntityTear`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isEntity(variable: unknown): variable is Entity;
|
|
46
|
+
/** Helper function to detect if a variable is of type `EntityEffect`. */
|
|
47
|
+
export declare function isFamiliar(variable: unknown): variable is EntityFamiliar;
|
|
48
|
+
/** Helper function to detect if a variable is of type `GridEntity`. */
|
|
49
|
+
export declare function isGridEntity(variable: unknown): variable is GridEntity;
|
|
12
50
|
/**
|
|
13
51
|
* Helper function to check if something is an instantiated class from the Isaac API. (All classes
|
|
14
52
|
* from the Isaac API have a type of "userdata" in Lua with a metatable key of "__type" equal to the
|
|
@@ -16,6 +54,32 @@ export declare function getIsaacAPIClassName(object: unknown): string | undefine
|
|
|
16
54
|
*/
|
|
17
55
|
export declare function isIsaacAPIClass(object: unknown): object is IsaacAPIClass;
|
|
18
56
|
export declare function isIsaacAPIClassOfType(object: unknown, classType: string): boolean;
|
|
57
|
+
/** Helper function to detect if a variable is of type `EntityKnife`. */
|
|
58
|
+
export declare function isKnife(variable: unknown): variable is EntityKnife;
|
|
59
|
+
/** Helper function to detect if a variable is of type `EntityLaser`. */
|
|
60
|
+
export declare function isLaser(variable: unknown): variable is EntityLaser;
|
|
61
|
+
/** Helper function to detect if a variable is of type `EntityNPC`. */
|
|
62
|
+
export declare function isNPC(variable: unknown): variable is EntityNPC;
|
|
63
|
+
/** Helper function to detect if a variable is of type `EntityPickup`. */
|
|
64
|
+
export declare function isPickup(variable: unknown): variable is EntityPickup;
|
|
65
|
+
/** Helper function to detect if a variable is of type `GridEntityPit`. */
|
|
66
|
+
export declare function isPit(variable: unknown): variable is GridEntityPit;
|
|
67
|
+
/** Helper function to detect if a variable is of type `EntityPlayer`. */
|
|
68
|
+
export declare function isPlayer(variable: unknown): variable is EntityPlayer;
|
|
69
|
+
/** Helper function to detect if a variable is of type `GridEntityPoop`. */
|
|
70
|
+
export declare function isPoop(variable: unknown): variable is GridEntityPoop;
|
|
71
|
+
/** Helper function to detect if a variable is of type `GridEntityPressurePlate`. */
|
|
72
|
+
export declare function isPressurePlate(variable: unknown): variable is GridEntityPressurePlate;
|
|
73
|
+
/** Helper function to detect if a variable is of type `EntityProjectile`. */
|
|
74
|
+
export declare function isProjectile(variable: unknown): variable is EntityProjectile;
|
|
75
|
+
/** Helper function to detect if a variable is of type `GridEntityRock`. */
|
|
76
|
+
export declare function isRock(variable: unknown): variable is GridEntityRock;
|
|
77
|
+
/** Helper function to detect if a variable is of type `GridEntitySpikes`. */
|
|
78
|
+
export declare function isSpikes(variable: unknown): variable is GridEntitySpikes;
|
|
79
|
+
/** Helper function to detect if a variable is of type `GridEntityTNT`. */
|
|
80
|
+
export declare function isTNT(variable: unknown): variable is GridEntityTNT;
|
|
81
|
+
/** Helper function to detect if a variable is of type `EntityTear`. */
|
|
82
|
+
export declare function isTear(variable: unknown): variable is EntityTear;
|
|
19
83
|
/**
|
|
20
84
|
* Helper function to check if an instantiated Isaac API class is equal to another one of the same
|
|
21
85
|
* type. You must provide the list of keys to check for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/functions/isaacAPIClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"isaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/functions/isaacAPIClass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAkBxE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED,2EAA2E;AAC3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AAQ,IAAI,cAAc,CAEpE;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,uBAAuB,CAErC;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,gBAAgB,CAE5E;AAED,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,gBAAgB,CAExE;AAED,0EAA0E;AAC1E,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,aAAa,CAElE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAKT"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local ____string = require("functions.string")
|
|
5
|
+
local trimPrefix = ____string.trimPrefix
|
|
4
6
|
local ____types = require("functions.types")
|
|
5
7
|
local isString = ____types.isString
|
|
6
8
|
local isUserdata = ____types.isUserdata
|
|
@@ -11,6 +13,10 @@ local isUserdata = ____types.isUserdata
|
|
|
11
13
|
--
|
|
12
14
|
-- Returns undefined if the object is not of type `userdata` or if the "__type" metatable key does
|
|
13
15
|
-- not exist.
|
|
16
|
+
--
|
|
17
|
+
-- In some cases, Isaac classes can be a read-only. If this is the case, the "__type" field will be
|
|
18
|
+
-- prepended with "const ". This function will always strip this prefix, if it exists. For example,
|
|
19
|
+
-- the class name returned for "const Vector" will be "Vector".
|
|
14
20
|
function ____exports.getIsaacAPIClassName(self, object)
|
|
15
21
|
if not isUserdata(nil, object) then
|
|
16
22
|
return nil
|
|
@@ -23,7 +29,32 @@ function ____exports.getIsaacAPIClassName(self, object)
|
|
|
23
29
|
if not isString(nil, classType) then
|
|
24
30
|
return nil
|
|
25
31
|
end
|
|
26
|
-
return classType
|
|
32
|
+
return trimPrefix(nil, classType, "const ")
|
|
33
|
+
end
|
|
34
|
+
--- Helper function to detect if a variable is of type `EntityBomb`.
|
|
35
|
+
function ____exports.isBomb(self, variable)
|
|
36
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityBomb"
|
|
37
|
+
end
|
|
38
|
+
--- Helper function to detect if a variable is of type `GridEntityDoor`.
|
|
39
|
+
function ____exports.isDoor(self, variable)
|
|
40
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntityDoor"
|
|
41
|
+
end
|
|
42
|
+
--- Helper function to detect if a variable is of type `EntityEffect`.
|
|
43
|
+
function ____exports.isEffect(self, variable)
|
|
44
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityEffect"
|
|
45
|
+
end
|
|
46
|
+
--- Helper function to detect if a variable is of type `Entity`. This will return false for child
|
|
47
|
+
-- classes such as `EntityPlayer` or `EntityTear`.
|
|
48
|
+
function ____exports.isEntity(self, variable)
|
|
49
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "Entity"
|
|
50
|
+
end
|
|
51
|
+
--- Helper function to detect if a variable is of type `EntityEffect`.
|
|
52
|
+
function ____exports.isFamiliar(self, variable)
|
|
53
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityEffect"
|
|
54
|
+
end
|
|
55
|
+
--- Helper function to detect if a variable is of type `GridEntity`.
|
|
56
|
+
function ____exports.isGridEntity(self, variable)
|
|
57
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntity"
|
|
27
58
|
end
|
|
28
59
|
--- Helper function to check if something is an instantiated class from the Isaac API. (All classes
|
|
29
60
|
-- from the Isaac API have a type of "userdata" in Lua with a metatable key of "__type" equal to the
|
|
@@ -36,6 +67,58 @@ function ____exports.isIsaacAPIClassOfType(self, object, classType)
|
|
|
36
67
|
local isaacAPIClassType = ____exports.getIsaacAPIClassName(nil, object)
|
|
37
68
|
return isaacAPIClassType == classType or isaacAPIClassType == "const " .. classType
|
|
38
69
|
end
|
|
70
|
+
--- Helper function to detect if a variable is of type `EntityKnife`.
|
|
71
|
+
function ____exports.isKnife(self, variable)
|
|
72
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityKnife"
|
|
73
|
+
end
|
|
74
|
+
--- Helper function to detect if a variable is of type `EntityLaser`.
|
|
75
|
+
function ____exports.isLaser(self, variable)
|
|
76
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityLaser"
|
|
77
|
+
end
|
|
78
|
+
--- Helper function to detect if a variable is of type `EntityNPC`.
|
|
79
|
+
function ____exports.isNPC(self, variable)
|
|
80
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityNPC"
|
|
81
|
+
end
|
|
82
|
+
--- Helper function to detect if a variable is of type `EntityPickup`.
|
|
83
|
+
function ____exports.isPickup(self, variable)
|
|
84
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityPickup"
|
|
85
|
+
end
|
|
86
|
+
--- Helper function to detect if a variable is of type `GridEntityPit`.
|
|
87
|
+
function ____exports.isPit(self, variable)
|
|
88
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntityPit"
|
|
89
|
+
end
|
|
90
|
+
--- Helper function to detect if a variable is of type `EntityPlayer`.
|
|
91
|
+
function ____exports.isPlayer(self, variable)
|
|
92
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityPlayer"
|
|
93
|
+
end
|
|
94
|
+
--- Helper function to detect if a variable is of type `GridEntityPoop`.
|
|
95
|
+
function ____exports.isPoop(self, variable)
|
|
96
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntityPoop"
|
|
97
|
+
end
|
|
98
|
+
--- Helper function to detect if a variable is of type `GridEntityPressurePlate`.
|
|
99
|
+
function ____exports.isPressurePlate(self, variable)
|
|
100
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntityPressurePlate"
|
|
101
|
+
end
|
|
102
|
+
--- Helper function to detect if a variable is of type `EntityProjectile`.
|
|
103
|
+
function ____exports.isProjectile(self, variable)
|
|
104
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityProjectile"
|
|
105
|
+
end
|
|
106
|
+
--- Helper function to detect if a variable is of type `GridEntityRock`.
|
|
107
|
+
function ____exports.isRock(self, variable)
|
|
108
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntityRock"
|
|
109
|
+
end
|
|
110
|
+
--- Helper function to detect if a variable is of type `GridEntitySpikes`.
|
|
111
|
+
function ____exports.isSpikes(self, variable)
|
|
112
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntitySpikes"
|
|
113
|
+
end
|
|
114
|
+
--- Helper function to detect if a variable is of type `GridEntityTNT`.
|
|
115
|
+
function ____exports.isTNT(self, variable)
|
|
116
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "GridEntityTNT"
|
|
117
|
+
end
|
|
118
|
+
--- Helper function to detect if a variable is of type `EntityTear`.
|
|
119
|
+
function ____exports.isTear(self, variable)
|
|
120
|
+
return ____exports.getIsaacAPIClassName(nil, variable) == "EntityTear"
|
|
121
|
+
end
|
|
39
122
|
--- Helper function to check if an instantiated Isaac API class is equal to another one of the same
|
|
40
123
|
-- type. You must provide the list of keys to check for.
|
|
41
124
|
function ____exports.isaacAPIClassEquals(self, object1, object2, keys)
|
package/dist/functions/log.lua
CHANGED
|
@@ -550,14 +550,14 @@ function ____exports.logTableDifferences(table1, table2)
|
|
|
550
550
|
__TS__ArraySort(keys)
|
|
551
551
|
for ____, key in ipairs(keys) do
|
|
552
552
|
if not table1KeysSet:has(key) then
|
|
553
|
-
____exports.log(" Table 1 is missing key: " .. key)
|
|
553
|
+
____exports.log(" Table 1 is missing key: " .. tostring(key))
|
|
554
554
|
elseif not table2KeysSet:has(key) then
|
|
555
|
-
____exports.log(" Table 2 is missing key: " .. key)
|
|
555
|
+
____exports.log(" Table 2 is missing key: " .. tostring(key))
|
|
556
556
|
else
|
|
557
557
|
local value1 = table1[key]
|
|
558
558
|
local value2 = table2[key]
|
|
559
559
|
if value1 ~= value2 then
|
|
560
|
-
____exports.log((((((" " .. key) .. " --> \"") .. tostring(value1)) .. "\" versus \"") .. tostring(value2)) .. "\"")
|
|
560
|
+
____exports.log((((((" " .. tostring(key)) .. " --> \"") .. tostring(value1)) .. "\" versus \"") .. tostring(value2)) .. "\"")
|
|
561
561
|
end
|
|
562
562
|
end
|
|
563
563
|
end
|
package/dist/functions/map.d.ts
CHANGED
|
@@ -20,4 +20,6 @@ export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare function getMapPartialMatch<T>(searchText: string, map: ReadonlyMap<string, T>): [string, T] | undefined;
|
|
23
|
+
/** Helper function to sum every value in a map together. */
|
|
24
|
+
export declare function sumMap(map: Map<unknown, number> | ReadonlyMap<unknown, number>): number;
|
|
23
25
|
//# sourceMappingURL=map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/functions/map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/functions/map.ts"],"names":[],"mappings":"AAEA,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAO1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC1B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAuBzB;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CACpB,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GACvD,MAAM,CAGR"}
|