isaacscript-common 3.1.1 → 3.4.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/callbacks/customRevive.lua +3 -3
- package/callbacks/postGridEntity.lua +5 -3
- package/callbacks/postHolyMantleRemoved.lua +2 -2
- package/callbacks/postPlayerCollectible.d.ts +1 -0
- package/callbacks/postPlayerCollectible.lua +95 -0
- package/callbacks/postRoomClearChanged.lua +5 -3
- package/callbacks/postSlotInitUpdate.lua +5 -3
- package/callbacks/subscriptions/postPlayerCollectibleAdded.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerCollectibleAdded.lua +34 -0
- package/callbacks/subscriptions/postPlayerCollectibleRemoved.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerCollectibleRemoved.lua +34 -0
- package/classes/DefaultMap.d.ts +1 -2
- package/classes/DefaultMap.lua +1 -4
- package/constants.d.ts +5 -0
- package/constants.lua +5 -0
- package/enums/ModCallbackCustom.d.ts +427 -177
- package/enums/ModCallbackCustom.lua +36 -32
- package/features/deployJSONRoom.lua +5 -4
- package/features/extraConsoleCommands/listCommands.lua +1 -0
- package/features/persistentEntities.d.ts +28 -0
- package/features/persistentEntities.lua +150 -0
- package/features/playerInventory.d.ts +1 -10
- package/features/playerInventory.lua +23 -60
- package/functions/array.d.ts +3 -3
- package/functions/array.lua +3 -3
- package/functions/collectibleSet.d.ts +3 -3
- package/functions/collectibleSet.lua +3 -5
- package/functions/color.d.ts +2 -16
- package/functions/color.lua +0 -9
- package/functions/entity.d.ts +10 -0
- package/functions/entity.lua +29 -0
- package/functions/log.lua +2 -2
- package/functions/pills.d.ts +10 -0
- package/functions/pills.lua +16 -0
- package/functions/roomData.d.ts +5 -5
- package/functions/roomData.lua +7 -7
- package/functions/rooms.d.ts +1 -4
- package/functions/rooms.lua +19 -25
- package/functions/saveFile.d.ts +15 -0
- package/functions/saveFile.lua +105 -0
- package/index.d.ts +3 -1
- package/index.lua +15 -2
- package/initCustomCallbacks.lua +3 -0
- package/initFeatures.lua +3 -0
- package/interfaces/AddCallbackParameterCustom.d.ts +4 -0
- package/maps/PHDPillConversions.d.ts +2 -0
- package/maps/PHDPillConversions.lua +25 -0
- package/maps/falsePHDPillConversions.d.ts +2 -0
- package/maps/falsePHDPillConversions.lua +39 -0
- package/objects/callbackRegisterFunctions.lua +6 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local hasSubscriptions, postRender,
|
|
2
|
+
local hasSubscriptions, postRender, postNewRoomReordered, postPEffectUpdateReordered, checkWaitingForItemAnimation, postPlayerFatalDamage, preBerserkDeath, playerIsAboutToDie, logStateChanged, DEBUG, CustomReviveState, v
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
4
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
5
5
|
local FamiliarVariant = ____isaac_2Dtypescript_2Ddefinitions.FamiliarVariant
|
|
@@ -41,7 +41,7 @@ function postRender(self)
|
|
|
41
41
|
end
|
|
42
42
|
sfxManager:Stop(SoundEffect.ONE_UP)
|
|
43
43
|
end
|
|
44
|
-
function
|
|
44
|
+
function postNewRoomReordered(self)
|
|
45
45
|
if v.run.state ~= CustomReviveState.WAITING_FOR_ROOM_TRANSITION then
|
|
46
46
|
return
|
|
47
47
|
end
|
|
@@ -139,7 +139,7 @@ v = {run = {state = CustomReviveState.DISABLED, revivalType = nil, dyingPlayerIn
|
|
|
139
139
|
function ____exports.customReviveCallbacksInit(self, mod)
|
|
140
140
|
saveDataManager(nil, "customRevive", v, hasSubscriptions)
|
|
141
141
|
mod:AddCallback(ModCallback.POST_RENDER, postRender)
|
|
142
|
-
mod:
|
|
142
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
143
143
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
|
|
144
144
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PLAYER_FATAL_DAMAGE, postPlayerFatalDamage)
|
|
145
145
|
mod:AddCallbackCustom(ModCallbackCustom.PRE_BERSERK_DEATH, preBerserkDeath)
|
|
@@ -3,9 +3,11 @@ local Map = ____lualib.Map
|
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
5
|
local ____exports = {}
|
|
6
|
-
local hasSubscriptions, postUpdate, checkGridEntitiesRemoved, checkGridEntityStateChanged, checkNewGridEntity, updateTupleInMap,
|
|
6
|
+
local hasSubscriptions, postUpdate, checkGridEntitiesRemoved, checkGridEntityStateChanged, checkNewGridEntity, updateTupleInMap, postNewRoomReordered, v
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
9
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
10
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
9
11
|
local ____exports = require("features.saveDataManager.exports")
|
|
10
12
|
local saveDataManager = ____exports.saveDataManager
|
|
11
13
|
local ____gridEntity = require("functions.gridEntity")
|
|
@@ -85,7 +87,7 @@ function updateTupleInMap(self, gridEntity)
|
|
|
85
87
|
local newTuple = {gridEntityType, gridEntityVariant, gridEntity.State}
|
|
86
88
|
v.room.initializedGridEntities:set(gridIndex, newTuple)
|
|
87
89
|
end
|
|
88
|
-
function
|
|
90
|
+
function postNewRoomReordered(self)
|
|
89
91
|
if not hasSubscriptions(nil) then
|
|
90
92
|
return
|
|
91
93
|
end
|
|
@@ -102,6 +104,6 @@ v = {room = {initializedGridEntities = __TS__New(Map)}}
|
|
|
102
104
|
function ____exports.postGridEntityCallbacksInit(self, mod)
|
|
103
105
|
saveDataManager(nil, "postGridEntity", v, hasSubscriptions)
|
|
104
106
|
mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
|
|
105
|
-
mod:
|
|
107
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
106
108
|
end
|
|
107
109
|
return ____exports
|
|
@@ -12,7 +12,7 @@ local ____exports = require("features.saveDataManager.exports")
|
|
|
12
12
|
local saveDataManager = ____exports.saveDataManager
|
|
13
13
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
14
14
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
15
|
-
local
|
|
15
|
+
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
16
16
|
local ____postHolyMantleRemoved = require("callbacks.subscriptions.postHolyMantleRemoved")
|
|
17
17
|
local postHolyMantleRemovedFire = ____postHolyMantleRemoved.postHolyMantleRemovedFire
|
|
18
18
|
local postHolyMantleRemovedHasSubscriptions = ____postHolyMantleRemoved.postHolyMantleRemovedHasSubscriptions
|
|
@@ -26,7 +26,7 @@ function postPEffectUpdateReordered(self, player)
|
|
|
26
26
|
local effects = player:GetEffects()
|
|
27
27
|
local newNumHolyMantles = effects:GetCollectibleEffectNum(CollectibleType.HOLY_MANTLE)
|
|
28
28
|
local oldNumHolyMantles = defaultMapGetPlayer(nil, v.run.playersHolyMantleMap, player)
|
|
29
|
-
|
|
29
|
+
mapSetPlayer(nil, v.run.playersHolyMantleMap, player, newNumHolyMantles)
|
|
30
30
|
if newNumHolyMantles < oldNumHolyMantles then
|
|
31
31
|
postHolyMantleRemovedFire(nil, player, oldNumHolyMantles, newNumHolyMantles)
|
|
32
32
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__Spread = ____lualib.__TS__Spread
|
|
5
|
+
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
6
|
+
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
7
|
+
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
8
|
+
local ____exports = {}
|
|
9
|
+
local hasSubscriptions, postPEffectUpdate, collectibleCountChanged, v
|
|
10
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
11
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
12
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
13
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
14
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
15
|
+
local saveDataManager = ____exports.saveDataManager
|
|
16
|
+
local ____player = require("functions.player")
|
|
17
|
+
local getPlayerCollectibleMap = ____player.getPlayerCollectibleMap
|
|
18
|
+
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
19
|
+
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
20
|
+
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
21
|
+
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
22
|
+
local ____utils = require("functions.utils")
|
|
23
|
+
local ____repeat = ____utils["repeat"]
|
|
24
|
+
local ____postPlayerCollectibleAdded = require("callbacks.subscriptions.postPlayerCollectibleAdded")
|
|
25
|
+
local postPlayerCollectibleAddedFire = ____postPlayerCollectibleAdded.postPlayerCollectibleAddedFire
|
|
26
|
+
local postPlayerCollectibleAddedHasSubscriptions = ____postPlayerCollectibleAdded.postPlayerCollectibleAddedHasSubscriptions
|
|
27
|
+
local ____postPlayerCollectibleRemoved = require("callbacks.subscriptions.postPlayerCollectibleRemoved")
|
|
28
|
+
local postPlayerCollectibleRemovedFire = ____postPlayerCollectibleRemoved.postPlayerCollectibleRemovedFire
|
|
29
|
+
local postPlayerCollectibleRemovedHasSubscriptions = ____postPlayerCollectibleRemoved.postPlayerCollectibleRemovedHasSubscriptions
|
|
30
|
+
function hasSubscriptions(self)
|
|
31
|
+
return postPlayerCollectibleAddedHasSubscriptions(nil) or postPlayerCollectibleRemovedHasSubscriptions(nil)
|
|
32
|
+
end
|
|
33
|
+
function postPEffectUpdate(self, player)
|
|
34
|
+
if not hasSubscriptions(nil) then
|
|
35
|
+
return
|
|
36
|
+
end
|
|
37
|
+
local oldCollectibleCount = mapGetPlayer(nil, v.run.playersCollectibleCount, player)
|
|
38
|
+
local newCollectibleCount = player:GetCollectibleCount()
|
|
39
|
+
mapSetPlayer(nil, v.run.playersCollectibleCount, player, newCollectibleCount)
|
|
40
|
+
if oldCollectibleCount == nil then
|
|
41
|
+
return
|
|
42
|
+
end
|
|
43
|
+
local difference = newCollectibleCount - oldCollectibleCount
|
|
44
|
+
if difference > 0 then
|
|
45
|
+
collectibleCountChanged(nil, player, difference, true)
|
|
46
|
+
elseif difference < 0 then
|
|
47
|
+
collectibleCountChanged(nil, player, difference * -1, false)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
function collectibleCountChanged(self, player, numCollectiblesChanged, increased)
|
|
51
|
+
local oldCollectibleMap = defaultMapGetPlayer(nil, v.run.playersCollectibleMap, player, player)
|
|
52
|
+
local newCollectibleMap = getPlayerCollectibleMap(nil, player)
|
|
53
|
+
mapSetPlayer(nil, v.run.playersCollectibleMap, player, newCollectibleMap)
|
|
54
|
+
local ____array_0 = __TS__SparseArrayNew(__TS__Spread(oldCollectibleMap:keys()))
|
|
55
|
+
__TS__SparseArrayPush(
|
|
56
|
+
____array_0,
|
|
57
|
+
__TS__Spread(newCollectibleMap:keys())
|
|
58
|
+
)
|
|
59
|
+
local collectibleTypes = {__TS__SparseArraySpread(____array_0)}
|
|
60
|
+
local numFired = 0
|
|
61
|
+
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
62
|
+
local oldNum = oldCollectibleMap:get(collectibleType) or 0
|
|
63
|
+
local newNum = newCollectibleMap:get(collectibleType) or 0
|
|
64
|
+
local difference = math.abs(newNum - oldNum)
|
|
65
|
+
____repeat(
|
|
66
|
+
nil,
|
|
67
|
+
difference,
|
|
68
|
+
function()
|
|
69
|
+
if increased then
|
|
70
|
+
postPlayerCollectibleAddedFire(nil, player, collectibleType)
|
|
71
|
+
else
|
|
72
|
+
postPlayerCollectibleRemovedFire(nil, player, collectibleType)
|
|
73
|
+
end
|
|
74
|
+
numFired = numFired + 1
|
|
75
|
+
end
|
|
76
|
+
)
|
|
77
|
+
if numFired == numCollectiblesChanged then
|
|
78
|
+
return
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
v = {run = {
|
|
83
|
+
playersCollectibleCount = __TS__New(Map),
|
|
84
|
+
playersCollectibleMap = __TS__New(
|
|
85
|
+
DefaultMap,
|
|
86
|
+
function(____, player) return getPlayerCollectibleMap(nil, player) end
|
|
87
|
+
)
|
|
88
|
+
}}
|
|
89
|
+
---
|
|
90
|
+
-- @internal
|
|
91
|
+
function ____exports.postPlayerCollectibleCallbackInit(self, mod)
|
|
92
|
+
saveDataManager(nil, "postPlayerCollectible", v, hasSubscriptions)
|
|
93
|
+
mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
94
|
+
end
|
|
95
|
+
return ____exports
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local hasSubscriptions, postUpdate,
|
|
2
|
+
local hasSubscriptions, postUpdate, postNewRoomReordered, v
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
4
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
5
5
|
local ____cachedClasses = require("cachedClasses")
|
|
6
6
|
local game = ____cachedClasses.game
|
|
7
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
8
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
7
9
|
local ____exports = require("features.saveDataManager.exports")
|
|
8
10
|
local saveDataManager = ____exports.saveDataManager
|
|
9
11
|
local ____postRoomClearChanged = require("callbacks.subscriptions.postRoomClearChanged")
|
|
@@ -23,7 +25,7 @@ function postUpdate(self)
|
|
|
23
25
|
postRoomClearChangedFire(nil, roomClear)
|
|
24
26
|
end
|
|
25
27
|
end
|
|
26
|
-
function
|
|
28
|
+
function postNewRoomReordered(self)
|
|
27
29
|
if not hasSubscriptions(nil) then
|
|
28
30
|
return
|
|
29
31
|
end
|
|
@@ -37,6 +39,6 @@ v = {room = {cleared = false}}
|
|
|
37
39
|
function ____exports.postRoomClearChangedCallbackInit(self, mod)
|
|
38
40
|
saveDataManager(nil, "postRoomClearChanged", v, hasSubscriptions)
|
|
39
41
|
mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
|
|
40
|
-
mod:
|
|
42
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
41
43
|
end
|
|
42
44
|
return ____exports
|
|
@@ -2,9 +2,11 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local hasSubscriptions, postUpdate,
|
|
5
|
+
local hasSubscriptions, postUpdate, postNewRoomReordered, checkNewEntity, v
|
|
6
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
7
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
8
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
9
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
8
10
|
local ____exports = require("features.saveDataManager.exports")
|
|
9
11
|
local saveDataManager = ____exports.saveDataManager
|
|
10
12
|
local ____entitySpecific = require("functions.entitySpecific")
|
|
@@ -27,7 +29,7 @@ function postUpdate(self)
|
|
|
27
29
|
postSlotUpdateFire(nil, slot)
|
|
28
30
|
end
|
|
29
31
|
end
|
|
30
|
-
function
|
|
32
|
+
function postNewRoomReordered(self)
|
|
31
33
|
if not hasSubscriptions(nil) then
|
|
32
34
|
return
|
|
33
35
|
end
|
|
@@ -48,6 +50,6 @@ v = {room = {initializedSlots = __TS__New(Set)}}
|
|
|
48
50
|
function ____exports.postSlotInitUpdateCallbacksInit(self, mod)
|
|
49
51
|
saveDataManager(nil, "postSlotInitUpdate", v, hasSubscriptions)
|
|
50
52
|
mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
|
|
51
|
-
mod:
|
|
53
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
52
54
|
end
|
|
53
55
|
return ____exports
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CollectibleType, PlayerType, PlayerVariant } from "isaac-typescript-definitions";
|
|
2
|
+
export declare type PostPlayerCollectibleAddedRegisterParameters = [
|
|
3
|
+
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
|
|
4
|
+
playerVariant?: PlayerVariant,
|
|
5
|
+
character?: PlayerType
|
|
6
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local subscriptions = {}
|
|
3
|
+
---
|
|
4
|
+
-- @internal
|
|
5
|
+
function ____exports.postPlayerCollectibleAddedHasSubscriptions(self)
|
|
6
|
+
return #subscriptions > 0
|
|
7
|
+
end
|
|
8
|
+
---
|
|
9
|
+
-- @internal
|
|
10
|
+
function ____exports.postPlayerCollectibleAddedRegister(self, ...)
|
|
11
|
+
local args = {...}
|
|
12
|
+
subscriptions[#subscriptions + 1] = args
|
|
13
|
+
end
|
|
14
|
+
---
|
|
15
|
+
-- @internal
|
|
16
|
+
function ____exports.postPlayerCollectibleAddedFire(self, player, collectibleType)
|
|
17
|
+
local character = player:GetPlayerType()
|
|
18
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
19
|
+
local callback = ____value[1]
|
|
20
|
+
local playerVariant = ____value[2]
|
|
21
|
+
local callbackCharacter = ____value[3]
|
|
22
|
+
do
|
|
23
|
+
if playerVariant ~= nil and playerVariant ~= player.Variant then
|
|
24
|
+
goto __continue5
|
|
25
|
+
end
|
|
26
|
+
if callbackCharacter ~= nil and callbackCharacter ~= character then
|
|
27
|
+
goto __continue5
|
|
28
|
+
end
|
|
29
|
+
callback(nil, player, collectibleType)
|
|
30
|
+
end
|
|
31
|
+
::__continue5::
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
return ____exports
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CollectibleType, PlayerType, PlayerVariant } from "isaac-typescript-definitions";
|
|
2
|
+
export declare type PostPlayerCollectibleRemovedRegisterParameters = [
|
|
3
|
+
callback: (player: EntityPlayer, collectibleType: CollectibleType) => void,
|
|
4
|
+
playerVariant?: PlayerVariant,
|
|
5
|
+
character?: PlayerType
|
|
6
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local subscriptions = {}
|
|
3
|
+
---
|
|
4
|
+
-- @internal
|
|
5
|
+
function ____exports.postPlayerCollectibleRemovedHasSubscriptions(self)
|
|
6
|
+
return #subscriptions > 0
|
|
7
|
+
end
|
|
8
|
+
---
|
|
9
|
+
-- @internal
|
|
10
|
+
function ____exports.postPlayerCollectibleRemovedRegister(self, ...)
|
|
11
|
+
local args = {...}
|
|
12
|
+
subscriptions[#subscriptions + 1] = args
|
|
13
|
+
end
|
|
14
|
+
---
|
|
15
|
+
-- @internal
|
|
16
|
+
function ____exports.postPlayerCollectibleRemovedFire(self, player, collectibleType)
|
|
17
|
+
local character = player:GetPlayerType()
|
|
18
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
19
|
+
local callback = ____value[1]
|
|
20
|
+
local playerVariant = ____value[2]
|
|
21
|
+
local callbackCharacter = ____value[3]
|
|
22
|
+
do
|
|
23
|
+
if playerVariant ~= nil and playerVariant ~= player.Variant then
|
|
24
|
+
goto __continue5
|
|
25
|
+
end
|
|
26
|
+
if callbackCharacter ~= nil and callbackCharacter ~= character then
|
|
27
|
+
goto __continue5
|
|
28
|
+
end
|
|
29
|
+
callback(nil, player, collectibleType)
|
|
30
|
+
end
|
|
31
|
+
::__continue5::
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
return ____exports
|
package/classes/DefaultMap.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs:
|
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
48
|
* // Initializes a new empty DefaultMap with a default value of a new empty array.
|
|
49
|
-
* const factoryFunction = () => []
|
|
49
|
+
* const factoryFunction = () => [];
|
|
50
50
|
* const defaultMapWithArray = new DefaultMap<string, string[]>(factoryFunction);
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
@@ -96,7 +96,6 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
|
|
|
96
96
|
* it will set a default value for the provided key, and then return the default value.
|
|
97
97
|
*/
|
|
98
98
|
getAndSetDefault(key: Key, ...extraArgs: Args): Value;
|
|
99
|
-
getWithoutDefault(key: Key): Value | undefined;
|
|
100
99
|
/**
|
|
101
100
|
* Returns the default value to be used for a new key. (If a factory function was provided during
|
|
102
101
|
* instantiation, this will execute the factory function.)
|
package/classes/DefaultMap.lua
CHANGED
|
@@ -46,7 +46,7 @@ local ____exports = {}
|
|
|
46
46
|
--
|
|
47
47
|
-- ```ts
|
|
48
48
|
-- // Initializes a new empty DefaultMap with a default value of a new empty array.
|
|
49
|
-
-- const factoryFunction = () => []
|
|
49
|
+
-- const factoryFunction = () => [];
|
|
50
50
|
-- const defaultMapWithArray = new DefaultMap<string, string[]>(factoryFunction);
|
|
51
51
|
-- ```
|
|
52
52
|
--
|
|
@@ -111,9 +111,6 @@ function DefaultMap.prototype.getAndSetDefault(self, key, ...)
|
|
|
111
111
|
self:set(key, defaultValue)
|
|
112
112
|
return defaultValue
|
|
113
113
|
end
|
|
114
|
-
function DefaultMap.prototype.getWithoutDefault(self, key)
|
|
115
|
-
return Map.prototype.get(self, key)
|
|
116
|
-
end
|
|
117
114
|
function DefaultMap.prototype.getDefaultValue(self, ...)
|
|
118
115
|
if self.defaultValue ~= nil then
|
|
119
116
|
return self.defaultValue
|
package/constants.d.ts
CHANGED
|
@@ -82,6 +82,11 @@ export declare const LAST_STAGE: LevelStage;
|
|
|
82
82
|
/** Corresponds to the maximum value for `EntityPlayer.SamsonBerserkCharge`. */
|
|
83
83
|
export declare const MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000;
|
|
84
84
|
export declare const NUM_DIMENSIONS: number;
|
|
85
|
+
/**
|
|
86
|
+
* The pill pool for each run is comprised of one effect for each unique pill color (minus gold and
|
|
87
|
+
* horse pills.)
|
|
88
|
+
*/
|
|
89
|
+
export declare const NUM_PILLS_IN_POOL: number;
|
|
85
90
|
export declare const SECOND_IN_MILLISECONDS = 1000;
|
|
86
91
|
export declare const MINUTE_IN_MILLISECONDS: number;
|
|
87
92
|
export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
|
package/constants.lua
CHANGED
|
@@ -5,6 +5,8 @@ local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
|
5
5
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
6
6
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
7
7
|
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
8
|
+
local ____constantsFirstLast = require("constantsFirstLast")
|
|
9
|
+
local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
|
|
8
10
|
local ____enums = require("functions.enums")
|
|
9
11
|
local getEnumLength = ____enums.getEnumLength
|
|
10
12
|
local getLastEnumValue = ____enums.getLastEnumValue
|
|
@@ -69,6 +71,9 @@ ____exports.LAST_STAGE = getLastEnumValue(nil, LevelStage)
|
|
|
69
71
|
--- Corresponds to the maximum value for `EntityPlayer.SamsonBerserkCharge`.
|
|
70
72
|
____exports.MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000
|
|
71
73
|
____exports.NUM_DIMENSIONS = getEnumLength(nil, Dimension) - 1
|
|
74
|
+
--- The pill pool for each run is comprised of one effect for each unique pill color (minus gold and
|
|
75
|
+
-- horse pills.)
|
|
76
|
+
____exports.NUM_PILLS_IN_POOL = NUM_NORMAL_PILL_COLORS
|
|
72
77
|
____exports.SECOND_IN_MILLISECONDS = 1000
|
|
73
78
|
____exports.MINUTE_IN_MILLISECONDS = 60 * ____exports.SECOND_IN_MILLISECONDS
|
|
74
79
|
____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
|