isaacscript-common 15.4.5 → 15.5.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/index.d.ts +4 -3
- package/dist/isaacscript-common.lua +71 -27
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +1 -0
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +12 -0
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +18 -0
- package/dist/src/classes/features/other/SaveDataManager.d.ts +2 -2
- package/dist/src/classes/features/other/saveDataManager/glowingHourGlass.lua +1 -1
- package/dist/src/functions/rooms.d.ts +1 -1
- package/dist/src/functions/rooms.lua +1 -1
- package/dist/src/maps/collectibleTypeToNameMap.lua +1 -1
- package/package.json +2 -2
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +2 -2
- package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +31 -0
- package/src/classes/features/other/ModdedElementSets.ts +22 -0
- package/src/classes/features/other/SaveDataManager.ts +4 -4
- package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +4 -4
- package/src/functions/rooms.ts +1 -1
- package/src/maps/collectibleTypeToNameMap.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6817,7 +6817,7 @@ export declare function includes<T>(array: T[], element: T): boolean;
|
|
|
6817
6817
|
export declare function inCrawlSpace(): boolean;
|
|
6818
6818
|
|
|
6819
6819
|
/**
|
|
6820
|
-
* Helper function to detect if the current room is one of the
|
|
6820
|
+
* Helper function to detect if the current room is one of the rooms in the Death Certificate area.
|
|
6821
6821
|
*/
|
|
6822
6822
|
export declare function inDeathCertificateArea(): boolean;
|
|
6823
6823
|
|
|
@@ -11407,6 +11407,7 @@ declare class PlayerCollectibleDetection extends Feature {
|
|
|
11407
11407
|
*/
|
|
11408
11408
|
private checkActiveItemsChanged;
|
|
11409
11409
|
private entityTakeDmgPlayer;
|
|
11410
|
+
private postItemPickup;
|
|
11410
11411
|
}
|
|
11411
11412
|
|
|
11412
11413
|
export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
|
|
@@ -12885,9 +12886,9 @@ declare class SaveDataManager extends Feature {
|
|
|
12885
12886
|
* saved to disk on game exit. (For example, if they contain functions or other non-serializable
|
|
12886
12887
|
* data.) For these cases, set the second argument to `false`.
|
|
12887
12888
|
*
|
|
12888
|
-
* Note that when the player uses Glowing
|
|
12889
|
+
* Note that when the player uses Glowing Hourglass, the save data manager will automatically
|
|
12889
12890
|
* restore any variables on a "run" or "level" object with a backup that was created when the room
|
|
12890
|
-
* was entered. Thus, you should not have to explicitly program support for Glowing
|
|
12891
|
+
* was entered. Thus, you should not have to explicitly program support for Glowing Hourglass
|
|
12891
12892
|
* into your mod features that use the save data manager. If this is undesired for your specific
|
|
12892
12893
|
* use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
|
|
12893
12894
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 15.
|
|
3
|
+
isaacscript-common 15.5.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -11199,7 +11199,19 @@ local TearFlagInternal = {
|
|
|
11199
11199
|
CARD_DROP_DEATH = getTearFlag(nil, 79),
|
|
11200
11200
|
RUNE_DROP_DEATH = getTearFlag(nil, 80),
|
|
11201
11201
|
TELEPORT = getTearFlag(nil, 81),
|
|
11202
|
-
|
|
11202
|
+
TEAR_DECELERATE = getTearFlag(nil, 82),
|
|
11203
|
+
TEAR_ACCELERATE = getTearFlag(nil, 83),
|
|
11204
|
+
BOUNCE_WALLS_ONLY = getTearFlag(nil, 104),
|
|
11205
|
+
NO_GRID_DAMAGE = getTearFlag(nil, 105),
|
|
11206
|
+
BACKSTAB = getTearFlag(nil, 106),
|
|
11207
|
+
FETUS_SWORD = getTearFlag(nil, 107),
|
|
11208
|
+
FETUS_BONE = getTearFlag(nil, 108),
|
|
11209
|
+
FETUS_KNIFE = getTearFlag(nil, 109),
|
|
11210
|
+
FETUS_TECH_X = getTearFlag(nil, 110),
|
|
11211
|
+
FETUS_TECH = getTearFlag(nil, 111),
|
|
11212
|
+
FETUS_BRIMSTONE = getTearFlag(nil, 112),
|
|
11213
|
+
FETUS_BOMBER = getTearFlag(nil, 113),
|
|
11214
|
+
FETUS = getTearFlag(nil, 114),
|
|
11203
11215
|
REROLL_ROCK_WISP = getTearFlag(nil, 115),
|
|
11204
11216
|
MOM_STOMP_WISP = getTearFlag(nil, 116),
|
|
11205
11217
|
ENEMY_TO_WISP = getTearFlag(nil, 117),
|
|
@@ -12263,6 +12275,8 @@ ____exports.ModCallback.PRE_SPAWN_CLEAN_AWARD = 70
|
|
|
12263
12275
|
____exports.ModCallback[____exports.ModCallback.PRE_SPAWN_CLEAN_AWARD] = "PRE_SPAWN_CLEAN_AWARD"
|
|
12264
12276
|
____exports.ModCallback.PRE_ROOM_ENTITY_SPAWN = 71
|
|
12265
12277
|
____exports.ModCallback[____exports.ModCallback.PRE_ROOM_ENTITY_SPAWN] = "PRE_ROOM_ENTITY_SPAWN"
|
|
12278
|
+
____exports.ModCallback.PRE_ENTITY_DEVOLVE = 72
|
|
12279
|
+
____exports.ModCallback[____exports.ModCallback.PRE_ENTITY_DEVOLVE] = "PRE_ENTITY_DEVOLVE"
|
|
12266
12280
|
return ____exports
|
|
12267
12281
|
end,
|
|
12268
12282
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.Mouse"] = function(...)
|
|
@@ -14865,8 +14879,8 @@ ____exports.SoundEffect.BEAST_GROWL = 815
|
|
|
14865
14879
|
____exports.SoundEffect[____exports.SoundEffect.BEAST_GROWL] = "BEAST_GROWL"
|
|
14866
14880
|
____exports.SoundEffect.BEAST_GRUMBLE = 816
|
|
14867
14881
|
____exports.SoundEffect[____exports.SoundEffect.BEAST_GRUMBLE] = "BEAST_GRUMBLE"
|
|
14868
|
-
____exports.SoundEffect.
|
|
14869
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14882
|
+
____exports.SoundEffect.FAMINE_GRUNT = 817
|
|
14883
|
+
____exports.SoundEffect[____exports.SoundEffect.FAMINE_GRUNT] = "FAMINE_GRUNT"
|
|
14870
14884
|
____exports.SoundEffect.G_FUEL_1 = 818
|
|
14871
14885
|
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_1] = "G_FUEL_1"
|
|
14872
14886
|
____exports.SoundEffect.G_FUEL_2 = 819
|
|
@@ -14875,28 +14889,28 @@ ____exports.SoundEffect.G_FUEL_3 = 820
|
|
|
14875
14889
|
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_3] = "G_FUEL_3"
|
|
14876
14890
|
____exports.SoundEffect.G_FUEL_4 = 821
|
|
14877
14891
|
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_4] = "G_FUEL_4"
|
|
14878
|
-
____exports.SoundEffect.
|
|
14879
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14880
|
-
____exports.SoundEffect.
|
|
14881
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14882
|
-
____exports.SoundEffect.
|
|
14883
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14884
|
-
____exports.SoundEffect.
|
|
14885
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14886
|
-
____exports.SoundEffect.
|
|
14887
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14888
|
-
____exports.SoundEffect.
|
|
14889
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14890
|
-
____exports.SoundEffect.
|
|
14891
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14892
|
-
____exports.SoundEffect.
|
|
14893
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14894
|
-
____exports.SoundEffect.
|
|
14895
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14896
|
-
____exports.SoundEffect.
|
|
14897
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14898
|
-
____exports.SoundEffect.
|
|
14899
|
-
____exports.SoundEffect[____exports.SoundEffect.
|
|
14892
|
+
____exports.SoundEffect.G_FUEL_EXPLOSION_SMALL = 822
|
|
14893
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_EXPLOSION_SMALL] = "G_FUEL_EXPLOSION_SMALL"
|
|
14894
|
+
____exports.SoundEffect.G_FUEL_EXPLOSION_BIG = 823
|
|
14895
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_EXPLOSION_BIG] = "G_FUEL_EXPLOSION_BIG"
|
|
14896
|
+
____exports.SoundEffect.G_FUEL_GUNSHOT_MEDIUM = 824
|
|
14897
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_GUNSHOT_MEDIUM] = "G_FUEL_GUNSHOT_MEDIUM"
|
|
14898
|
+
____exports.SoundEffect.G_FUEL_GUNSHOT_SMALL = 825
|
|
14899
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_GUNSHOT_SMALL] = "G_FUEL_GUNSHOT_SMALL"
|
|
14900
|
+
____exports.SoundEffect.G_FUEL_GUNSHOT_LARGE = 826
|
|
14901
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_GUNSHOT_LARGE] = "G_FUEL_GUNSHOT_LARGE"
|
|
14902
|
+
____exports.SoundEffect.G_FUEL_GUNSHOT_SPREAD = 827
|
|
14903
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_GUNSHOT_SPREAD] = "G_FUEL_GUNSHOT_SPREAD"
|
|
14904
|
+
____exports.SoundEffect.G_FUEL_AIR_HORN = 828
|
|
14905
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_AIR_HORN] = "G_FUEL_AIR_HORN"
|
|
14906
|
+
____exports.SoundEffect.G_FUEL_ITEM_APPEAR = 829
|
|
14907
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_ITEM_APPEAR] = "G_FUEL_ITEM_APPEAR"
|
|
14908
|
+
____exports.SoundEffect.G_FUEL_GUNSHOT_MINI = 830
|
|
14909
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_GUNSHOT_MINI] = "G_FUEL_GUNSHOT_MINI"
|
|
14910
|
+
____exports.SoundEffect.G_FUEL_BULLET_RICOCHET = 831
|
|
14911
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_BULLET_RICOCHET] = "G_FUEL_BULLET_RICOCHET"
|
|
14912
|
+
____exports.SoundEffect.G_FUEL_ROCKET_LAUNCHER = 832
|
|
14913
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_ROCKET_LAUNCHER] = "G_FUEL_ROCKET_LAUNCHER"
|
|
14900
14914
|
return ____exports
|
|
14901
14915
|
end,
|
|
14902
14916
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.StageID"] = function(...)
|
|
@@ -18737,7 +18751,7 @@ ____exports.COLLECTIBLE_TYPE_TO_NAME_MAP = __TS__New(Map, {
|
|
|
18737
18751
|
{419, "Teleport 2.0"},
|
|
18738
18752
|
{420, "Black Powder"},
|
|
18739
18753
|
{421, "Kidney Bean"},
|
|
18740
|
-
{422, "Glowing
|
|
18754
|
+
{422, "Glowing Hourglass"},
|
|
18741
18755
|
{423, "Circle of Protection"},
|
|
18742
18756
|
{424, "Sack Head"},
|
|
18743
18757
|
{425, "Night Light"},
|
|
@@ -32111,6 +32125,8 @@ local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
|
32111
32125
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
32112
32126
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
32113
32127
|
local itemConfig = ____cachedClasses.itemConfig
|
|
32128
|
+
local ____constants = require("src.core.constants")
|
|
32129
|
+
local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
|
|
32114
32130
|
local ____decorators = require("src.decorators")
|
|
32115
32131
|
local Exported = ____decorators.Exported
|
|
32116
32132
|
local ____ISCFeature = require("src.enums.ISCFeature")
|
|
@@ -32435,6 +32451,22 @@ function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
|
|
|
32435
32451
|
collectibleMap:set(collectibleType, numCollectibles)
|
|
32436
32452
|
end
|
|
32437
32453
|
end
|
|
32454
|
+
if player:HasCollectible(CollectibleType.TMTRAINER) then
|
|
32455
|
+
local collectibleType = FIRST_GLITCHED_COLLECTIBLE_TYPE
|
|
32456
|
+
local itemConfigItem
|
|
32457
|
+
repeat
|
|
32458
|
+
do
|
|
32459
|
+
itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
32460
|
+
if itemConfigItem ~= nil then
|
|
32461
|
+
local hasCollectibles = player:HasCollectible(collectibleType, true)
|
|
32462
|
+
if hasCollectibles then
|
|
32463
|
+
collectibleMap:set(collectibleType, 1)
|
|
32464
|
+
end
|
|
32465
|
+
end
|
|
32466
|
+
collectibleType = collectibleType - 1
|
|
32467
|
+
end
|
|
32468
|
+
until not (itemConfigItem ~= nil)
|
|
32469
|
+
end
|
|
32438
32470
|
return collectibleMap
|
|
32439
32471
|
end
|
|
32440
32472
|
function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, player, cacheFlag)
|
|
@@ -32593,10 +32625,13 @@ local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
|
32593
32625
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
32594
32626
|
local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
|
|
32595
32627
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
32628
|
+
local ItemType = ____isaac_2Dtypescript_2Ddefinitions.ItemType
|
|
32596
32629
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
32597
32630
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
32598
32631
|
local ____ISCFeature = require("src.enums.ISCFeature")
|
|
32599
32632
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
32633
|
+
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
32634
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
32600
32635
|
local ____array = require("src.functions.array")
|
|
32601
32636
|
local arrayEquals = ____array.arrayEquals
|
|
32602
32637
|
local ____enums = require("src.functions.enums")
|
|
@@ -32669,8 +32704,17 @@ function PlayerCollectibleDetection.prototype.____constructor(self, postPlayerCo
|
|
|
32669
32704
|
end)
|
|
32670
32705
|
return nil
|
|
32671
32706
|
end
|
|
32707
|
+
self.postItemPickup = function(____, player, pickingUpItem)
|
|
32708
|
+
if pickingUpItem.itemType == ItemType.TRINKET or pickingUpItem.itemType == ItemType.NULL then
|
|
32709
|
+
return
|
|
32710
|
+
end
|
|
32711
|
+
local newCollectibleCount = player:GetCollectibleCount()
|
|
32712
|
+
mapSetPlayer(nil, self.v.run.playersCollectibleCount, player, newCollectibleCount)
|
|
32713
|
+
self:updateCollectibleMapAndFire(player, 1)
|
|
32714
|
+
end
|
|
32672
32715
|
self.featuresUsed = {ISCFeature.MODDED_ELEMENT_SETS, ISCFeature.RUN_IN_N_FRAMES}
|
|
32673
32716
|
self.callbacksUsed = {{ModCallback.POST_USE_ITEM, {self.useItemD4, CollectibleType.D4}}, {ModCallback.POST_PEFFECT_UPDATE, {self.postPEffectUpdate}}, {ModCallback.ENTITY_TAKE_DMG, {self.entityTakeDmgPlayer, EntityType.PLAYER}}}
|
|
32717
|
+
self.customCallbacksUsed = {{ModCallbackCustom.POST_ITEM_PICKUP, {self.postItemPickup}}}
|
|
32674
32718
|
self.postPlayerCollectibleAdded = postPlayerCollectibleAdded
|
|
32675
32719
|
self.postPlayerCollectibleRemoved = postPlayerCollectibleRemoved
|
|
32676
32720
|
self.moddedElementSets = moddedElementSets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerCollectibleDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/PlayerCollectibleDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,
|
|
1
|
+
{"version":3,"file":"PlayerCollectibleDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/PlayerCollectibleDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAMhB,MAAM,8BAA8B,CAAC;AAatC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAa,0BAA2B,SAAQ,OAAO;IACrC,CAAC;;;;;;MAYf;IAEF,OAAO,CAAC,0BAA0B,CAA6B;IAC/D,OAAO,CAAC,4BAA4B,CAA+B;IACnE,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,YAAY,CAAe;gBAGjC,0BAA0B,EAAE,0BAA0B,EACtD,4BAA4B,EAAE,4BAA4B,EAC1D,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY;IA4B5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,2BAA2B;IA0CnC,OAAO,CAAC,SAAS,CAqBf;IAGF,OAAO,CAAC,iBAAiB,CAqBvB;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,uBAAuB;IAmC/B,OAAO,CAAC,mBAAmB,CAgCzB;IAKF,OAAO,CAAC,cAAc,CAmBpB;CACH"}
|
|
@@ -16,10 +16,13 @@ local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
|
16
16
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
17
17
|
local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
|
|
18
18
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
19
|
+
local ItemType = ____isaac_2Dtypescript_2Ddefinitions.ItemType
|
|
19
20
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
20
21
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
21
22
|
local ____ISCFeature = require("src.enums.ISCFeature")
|
|
22
23
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
24
|
+
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
25
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
23
26
|
local ____array = require("src.functions.array")
|
|
24
27
|
local arrayEquals = ____array.arrayEquals
|
|
25
28
|
local ____enums = require("src.functions.enums")
|
|
@@ -92,8 +95,17 @@ function PlayerCollectibleDetection.prototype.____constructor(self, postPlayerCo
|
|
|
92
95
|
end)
|
|
93
96
|
return nil
|
|
94
97
|
end
|
|
98
|
+
self.postItemPickup = function(____, player, pickingUpItem)
|
|
99
|
+
if pickingUpItem.itemType == ItemType.TRINKET or pickingUpItem.itemType == ItemType.NULL then
|
|
100
|
+
return
|
|
101
|
+
end
|
|
102
|
+
local newCollectibleCount = player:GetCollectibleCount()
|
|
103
|
+
mapSetPlayer(nil, self.v.run.playersCollectibleCount, player, newCollectibleCount)
|
|
104
|
+
self:updateCollectibleMapAndFire(player, 1)
|
|
105
|
+
end
|
|
95
106
|
self.featuresUsed = {ISCFeature.MODDED_ELEMENT_SETS, ISCFeature.RUN_IN_N_FRAMES}
|
|
96
107
|
self.callbacksUsed = {{ModCallback.POST_USE_ITEM, {self.useItemD4, CollectibleType.D4}}, {ModCallback.POST_PEFFECT_UPDATE, {self.postPEffectUpdate}}, {ModCallback.ENTITY_TAKE_DMG, {self.entityTakeDmgPlayer, EntityType.PLAYER}}}
|
|
108
|
+
self.customCallbacksUsed = {{ModCallbackCustom.POST_ITEM_PICKUP, {self.postItemPickup}}}
|
|
97
109
|
self.postPlayerCollectibleAdded = postPlayerCollectibleAdded
|
|
98
110
|
self.postPlayerCollectibleRemoved = postPlayerCollectibleRemoved
|
|
99
111
|
self.moddedElementSets = moddedElementSets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModdedElementSets.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ModdedElementSets.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA2BtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA4BhD,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAC,wBAAwB,CAAyB;IACzD,OAAO,CAAC,sBAAsB,CAA8B;IAE5D,OAAO,CAAC,4BAA4B,CAAyB;IAC7D,OAAO,CAAC,0BAA0B,CAA8B;IAEhE,OAAO,CAAC,2BAA2B,CAAyB;IAC5D,OAAO,CAAC,yBAAyB,CAA8B;IAE/D,OAAO,CAAC,oBAAoB,CAAqB;IACjD,OAAO,CAAC,kBAAkB,CAA0B;IAEpD,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,sBAAsB,CAA0B;IAExD,OAAO,CAAC,uBAAuB,CAAqB;IACpD,OAAO,CAAC,qBAAqB,CAA0B;IAEvD,OAAO,CAAC,wBAAwB,CAG5B;IAEJ,OAAO,CAAC,8BAA8B,CAGlC;IAEJ,OAAO,CAAC,0BAA0B,CAA0C;IAE5E,OAAO,CAAC,yBAAyB,CAA8B;IAC/D,OAAO,CAAC,kCAAkC,CAA8B;IACxE,OAAO,CAAC,qBAAqB,CAA0B;IAEvD,OAAO,CAAC,6BAA6B,CAA8B;IACnE,OAAO,CAAC,8BAA8B,CAA8B;IAEpE,OAAO,CAAC,sBAAsB,CAAyB;IAWvD,OAAO,CAAC,+BAA+B;IAgBvC,OAAO,CAAC,8BAA8B;IA2BtC,OAAO,CAAC,2BAA2B;IAgBnC,OAAO,CAAC,0BAA0B;IA2BlC,OAAO,CAAC,gCAAgC;IA8BxC,OAAO,CAAC,sCAAsC;IAkB9C,OAAO,CAAC,kCAAkC;IAkB1C,OAAO,CAAC,iCAAiC;IAgCzC,OAAO,CAAC,6BAA6B;IAoBrC,OAAO,CAAC,+BAA+B;IAuBvC;;;;;;;;;;;;OAYG;IAEI,mBAAmB,IAAI,SAAS,eAAe,EAAE;IAKxD;;;;;;;;;;;;OAYG;IAEI,iBAAiB,IAAI,WAAW,CAAC,eAAe,CAAC;IAKxD;;;;;;;;;;;OAWG;IAEI,gCAAgC,CACrC,UAAU,EAAE,UAAU,GACrB,WAAW,CAAC,eAAe,CAAC;IAW/B;;;;;;;;;OASG;IAEI,4BAA4B,CACjC,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,eAAe,CAAC;IAW/B;;;;;;;;;;;OAWG;IAEI,sBAAsB,CAC3B,aAAa,EAAE,aAAa,GAC3B,WAAW,CAAC,eAAe,CAAC;IAa/B;;;;;OAKG;IAEI,yBAAyB,IAAI,WAAW,CAAC,eAAe,CAAC;IAKhE;;;;;OAKG;IAEI,0BAA0B,IAAI,WAAW,CAAC,eAAe,CAAC;IAKjE;;;;;;;;;;;OAWG;IAEI,qBAAqB,CAC1B,qBAAqB,EAAE,OAAO,GAC7B,WAAW,CAAC,eAAe,CAAC;IAQ/B;;;;;OAKG;IAEI,iBAAiB,IAAI,WAAW,CAAC,WAAW,CAAC;IAMpD;;;;;;;;;;;OAWG;IAEI,yBAAyB,IAAI,SAAS,eAAe,EAAE;IAK9D;;;;;;;;;;;OAWG;IAEI,uBAAuB,IAAI,WAAW,CAAC,eAAe,CAAC;IAK9D;;;;;;;;;;OAUG;IAEI,qBAAqB,IAAI,SAAS,WAAW,EAAE;IAKtD;;;;;;;;;;OAUG;IAEI,mBAAmB,IAAI,WAAW,CAAC,WAAW,CAAC;IAKtD;;;;;;;OAOG;IAEI,uBAAuB,CAC5B,MAAM,EAAE,YAAY,GACnB,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC;IAoC5B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IAEI,kCAAkC,CACvC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,eAAe,EAAE;IAkBpB;;;;OAIG;IAEI,4BAA4B,CACjC,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,aAAa,GAC3B,eAAe,EAAE;IAepB;;;;OAIG;IAEI,sCAAsC,CAC3C,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,eAAe,EAAE;IAkBpB;;;;;;;;OAQG;IAEI,8BAA8B,CACnC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC;IAcxB;;;;OAIG;IAEI,8BAA8B,CACnC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe;IASlB;;;;OAIG;IAEI,+BAA+B,CACpC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe;IASlB;;;;;;;;;;OAUG;IAEI,eAAe,IAAI,SAAS,WAAW,EAAE;IAKhD;;;;;;;;;;OAUG;IAEI,aAAa,IAAI,WAAW,CAAC,WAAW,CAAC;IAKhD;;;;;;;;OAQG;IAEI,wBAAwB,CAC7B,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,WAAW,CAAC;IAW3B;;;;;;;OAOG;IAEI,0BAA0B,IAAI,SAAS,eAAe,EAAE;IAK/D;;;;;;;OAOG;IAEI,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC;IAK/D;;;;;;;OAOG;IAEI,sBAAsB,IAAI,SAAS,WAAW,EAAE;IAKvD;;;;;;;OAOG;IAEI,oBAAoB,IAAI,WAAW,CAAC,WAAW,CAAC;CAIxD"}
|
|
@@ -15,6 +15,8 @@ local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
|
15
15
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
16
16
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
17
17
|
local itemConfig = ____cachedClasses.itemConfig
|
|
18
|
+
local ____constants = require("src.core.constants")
|
|
19
|
+
local FIRST_GLITCHED_COLLECTIBLE_TYPE = ____constants.FIRST_GLITCHED_COLLECTIBLE_TYPE
|
|
18
20
|
local ____decorators = require("src.decorators")
|
|
19
21
|
local Exported = ____decorators.Exported
|
|
20
22
|
local ____ISCFeature = require("src.enums.ISCFeature")
|
|
@@ -339,6 +341,22 @@ function ModdedElementSets.prototype.getPlayerCollectibleMap(self, player)
|
|
|
339
341
|
collectibleMap:set(collectibleType, numCollectibles)
|
|
340
342
|
end
|
|
341
343
|
end
|
|
344
|
+
if player:HasCollectible(CollectibleType.TMTRAINER) then
|
|
345
|
+
local collectibleType = FIRST_GLITCHED_COLLECTIBLE_TYPE
|
|
346
|
+
local itemConfigItem
|
|
347
|
+
repeat
|
|
348
|
+
do
|
|
349
|
+
itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
350
|
+
if itemConfigItem ~= nil then
|
|
351
|
+
local hasCollectibles = player:HasCollectible(collectibleType, true)
|
|
352
|
+
if hasCollectibles then
|
|
353
|
+
collectibleMap:set(collectibleType, 1)
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
collectibleType = collectibleType - 1
|
|
357
|
+
end
|
|
358
|
+
until not (itemConfigItem ~= nil)
|
|
359
|
+
end
|
|
342
360
|
return collectibleMap
|
|
343
361
|
end
|
|
344
362
|
function ModdedElementSets.prototype.getPlayerCollectiblesWithCacheFlag(self, player, cacheFlag)
|
|
@@ -121,9 +121,9 @@ export declare class SaveDataManager extends Feature {
|
|
|
121
121
|
* saved to disk on game exit. (For example, if they contain functions or other non-serializable
|
|
122
122
|
* data.) For these cases, set the second argument to `false`.
|
|
123
123
|
*
|
|
124
|
-
* Note that when the player uses Glowing
|
|
124
|
+
* Note that when the player uses Glowing Hourglass, the save data manager will automatically
|
|
125
125
|
* restore any variables on a "run" or "level" object with a backup that was created when the room
|
|
126
|
-
* was entered. Thus, you should not have to explicitly program support for Glowing
|
|
126
|
+
* was entered. Thus, you should not have to explicitly program support for Glowing Hourglass
|
|
127
127
|
* into your mod features that use the save data manager. If this is undesired for your specific
|
|
128
128
|
* use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
|
|
129
129
|
*
|
|
@@ -11,7 +11,7 @@ local ____table = require("src.functions.table")
|
|
|
11
11
|
local iterateTableInOrder = ____table.iterateTableInOrder
|
|
12
12
|
local ____constants = require("src.classes.features.other.saveDataManager.constants")
|
|
13
13
|
local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
|
|
14
|
-
--- When the Glowing
|
|
14
|
+
--- When the Glowing Hourglass is used, certain save data keys will automatically be restored to a
|
|
15
15
|
-- backup.
|
|
16
16
|
local GLOWING_HOUR_GLASS_BACKUP_KEYS = {SaveDataKey.RUN, SaveDataKey.LEVEL}
|
|
17
17
|
local IGNORE_GLOWING_HOUR_GLASS_KEY = "__ignoreGlowingHourGlass"
|
|
@@ -113,7 +113,7 @@ export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
|
113
113
|
*/
|
|
114
114
|
export declare function inCrawlSpace(): boolean;
|
|
115
115
|
/**
|
|
116
|
-
* Helper function to detect if the current room is one of the
|
|
116
|
+
* Helper function to detect if the current room is one of the rooms in the Death Certificate area.
|
|
117
117
|
*/
|
|
118
118
|
export declare function inDeathCertificateArea(): boolean;
|
|
119
119
|
/**
|
|
@@ -277,7 +277,7 @@ function ____exports.inCrawlSpace(self)
|
|
|
277
277
|
local roomSubType = getRoomSubType(nil)
|
|
278
278
|
return roomType == RoomType.DUNGEON and roomSubType == asNumber(nil, DungeonSubType.NORMAL)
|
|
279
279
|
end
|
|
280
|
-
--- Helper function to detect if the current room is one of the
|
|
280
|
+
--- Helper function to detect if the current room is one of the rooms in the Death Certificate area.
|
|
281
281
|
function ____exports.inDeathCertificateArea(self)
|
|
282
282
|
local roomStageID = getRoomStageID(nil)
|
|
283
283
|
local roomSubType = getRoomSubType(nil)
|
|
@@ -427,7 +427,7 @@ ____exports.COLLECTIBLE_TYPE_TO_NAME_MAP = __TS__New(Map, {
|
|
|
427
427
|
{419, "Teleport 2.0"},
|
|
428
428
|
{420, "Black Powder"},
|
|
429
429
|
{421, "Kidney Bean"},
|
|
430
|
-
{422, "Glowing
|
|
430
|
+
{422, "Glowing Hourglass"},
|
|
431
431
|
{423, "Circle of Protection"},
|
|
432
432
|
{424, "Sack Head"},
|
|
433
433
|
{425, "Night Light"},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.5.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/src/index",
|
|
23
23
|
"types": "dist/src/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^9.
|
|
25
|
+
"isaac-typescript-definitions": "^9.5.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -67,7 +67,7 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
67
67
|
// ModCallback.POST_USE_ITEM (3)
|
|
68
68
|
// CollectibleType.GLOWING_HOUR_GLASS (422)
|
|
69
69
|
private useItemGlowingHourGlass = (): boolean | undefined => {
|
|
70
|
-
// If Glowing
|
|
70
|
+
// If Glowing Hourglass is used on the first room of a floor, it will send the player to the
|
|
71
71
|
// previous floor without triggering the `POST_NEW_LEVEL` callback. Manually check for this.
|
|
72
72
|
this.usedGlowingHourGlass = true;
|
|
73
73
|
|
|
@@ -109,7 +109,7 @@ export class GameReorderedCallbacks extends Feature {
|
|
|
109
109
|
this.usedGlowingHourGlass = false;
|
|
110
110
|
|
|
111
111
|
if (this.currentStage !== stage || this.currentStageType !== stageType) {
|
|
112
|
-
// The player has used the Glowing
|
|
112
|
+
// The player has used the Glowing Hourglass to take them to the previous floor (which does
|
|
113
113
|
// not trigger the `POST_NEW_LEVEL` callback). Emulate what happens in the `POST_NEW_LEVEL`
|
|
114
114
|
// callback.
|
|
115
115
|
this.recordCurrentStage();
|
|
@@ -3,10 +3,12 @@ import {
|
|
|
3
3
|
CollectibleType,
|
|
4
4
|
DamageFlag,
|
|
5
5
|
EntityType,
|
|
6
|
+
ItemType,
|
|
6
7
|
ModCallback,
|
|
7
8
|
PlayerType,
|
|
8
9
|
} from "isaac-typescript-definitions";
|
|
9
10
|
import { ISCFeature } from "../../../enums/ISCFeature";
|
|
11
|
+
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
10
12
|
import { arrayEquals } from "../../../functions/array";
|
|
11
13
|
import { getEnumValues } from "../../../functions/enums";
|
|
12
14
|
import { hasFlag } from "../../../functions/flag";
|
|
@@ -16,6 +18,7 @@ import {
|
|
|
16
18
|
} from "../../../functions/playerDataStructures";
|
|
17
19
|
import { getPlayerFromPtr } from "../../../functions/players";
|
|
18
20
|
import { repeat } from "../../../functions/utils";
|
|
21
|
+
import { PickingUpItem } from "../../../types/PickingUpItem";
|
|
19
22
|
import { PlayerIndex } from "../../../types/PlayerIndex";
|
|
20
23
|
import { PostPlayerCollectibleAdded } from "../../callbacks/PostPlayerCollectibleAdded";
|
|
21
24
|
import { PostPlayerCollectibleRemoved } from "../../callbacks/PostPlayerCollectibleRemoved";
|
|
@@ -66,6 +69,10 @@ export class PlayerCollectibleDetection extends Feature {
|
|
|
66
69
|
], // 11
|
|
67
70
|
];
|
|
68
71
|
|
|
72
|
+
this.customCallbacksUsed = [
|
|
73
|
+
[ModCallbackCustom.POST_ITEM_PICKUP, [this.postItemPickup]],
|
|
74
|
+
];
|
|
75
|
+
|
|
69
76
|
this.postPlayerCollectibleAdded = postPlayerCollectibleAdded;
|
|
70
77
|
this.postPlayerCollectibleRemoved = postPlayerCollectibleRemoved;
|
|
71
78
|
this.moddedElementSets = moddedElementSets;
|
|
@@ -250,4 +257,28 @@ export class PlayerCollectibleDetection extends Feature {
|
|
|
250
257
|
|
|
251
258
|
return undefined;
|
|
252
259
|
};
|
|
260
|
+
|
|
261
|
+
// ModCallbackCustom.POST_ITEM_PICKUP
|
|
262
|
+
// We need to handle TMTRAINER collectibles, since they do not cause the player's collectible
|
|
263
|
+
// count to change.
|
|
264
|
+
private postItemPickup = (
|
|
265
|
+
player: EntityPlayer,
|
|
266
|
+
pickingUpItem: PickingUpItem,
|
|
267
|
+
) => {
|
|
268
|
+
if (
|
|
269
|
+
pickingUpItem.itemType === ItemType.TRINKET ||
|
|
270
|
+
pickingUpItem.itemType === ItemType.NULL
|
|
271
|
+
) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const newCollectibleCount = player.GetCollectibleCount();
|
|
276
|
+
mapSetPlayer(
|
|
277
|
+
this.v.run.playersCollectibleCount,
|
|
278
|
+
player,
|
|
279
|
+
newCollectibleCount,
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
this.updateCollectibleMapAndFire(player, 1);
|
|
283
|
+
};
|
|
253
284
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
TrinketType,
|
|
7
7
|
} from "isaac-typescript-definitions";
|
|
8
8
|
import { itemConfig } from "../../../core/cachedClasses";
|
|
9
|
+
import { FIRST_GLITCHED_COLLECTIBLE_TYPE } from "../../../core/constants";
|
|
9
10
|
import { Exported } from "../../../decorators";
|
|
10
11
|
import { ISCFeature } from "../../../enums/ISCFeature";
|
|
11
12
|
import {
|
|
@@ -603,6 +604,27 @@ export class ModdedElementSets extends Feature {
|
|
|
603
604
|
}
|
|
604
605
|
}
|
|
605
606
|
|
|
607
|
+
// If the player has TMTRAINER, they might also have glitched items.
|
|
608
|
+
if (player.HasCollectible(CollectibleType.TMTRAINER)) {
|
|
609
|
+
let collectibleType = FIRST_GLITCHED_COLLECTIBLE_TYPE;
|
|
610
|
+
let itemConfigItem: Readonly<ItemConfigItem> | undefined;
|
|
611
|
+
do {
|
|
612
|
+
itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
613
|
+
|
|
614
|
+
if (itemConfigItem !== undefined) {
|
|
615
|
+
// The `EntityPlayer.GetCollectibleNum` method is bugged with TMTrainer items and will
|
|
616
|
+
// always return 0. To work around this, we simply assume that if the player has the
|
|
617
|
+
// collectible, then they have one copy of the item.
|
|
618
|
+
const hasCollectibles = player.HasCollectible(collectibleType, true);
|
|
619
|
+
if (hasCollectibles) {
|
|
620
|
+
collectibleMap.set(collectibleType, 1);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
collectibleType--; // eslint-disable-line isaacscript/strict-enums
|
|
625
|
+
} while (itemConfigItem !== undefined);
|
|
626
|
+
}
|
|
627
|
+
|
|
606
628
|
return collectibleMap;
|
|
607
629
|
}
|
|
608
630
|
|
|
@@ -126,7 +126,7 @@ export class SaveDataManager extends Feature {
|
|
|
126
126
|
}
|
|
127
127
|
this.loadedDataOnThisRun = true;
|
|
128
128
|
|
|
129
|
-
// Handle the race-condition of using the Glowing
|
|
129
|
+
// Handle the race-condition of using the Glowing Hourglass and then resetting the run.
|
|
130
130
|
this.restoreGlowingHourGlassDataOnNextRoom = false;
|
|
131
131
|
|
|
132
132
|
// We want to unconditionally load save data on every new run since there might be persistent
|
|
@@ -182,7 +182,7 @@ export class SaveDataManager extends Feature {
|
|
|
182
182
|
SaveDataKey.ROOM,
|
|
183
183
|
);
|
|
184
184
|
|
|
185
|
-
// Handle the Glowing
|
|
185
|
+
// Handle the Glowing Hourglass.
|
|
186
186
|
if (this.restoreGlowingHourGlassDataOnNextRoom) {
|
|
187
187
|
this.restoreGlowingHourGlassDataOnNextRoom = false;
|
|
188
188
|
restoreGlowingHourGlassBackup(
|
|
@@ -277,9 +277,9 @@ export class SaveDataManager extends Feature {
|
|
|
277
277
|
* saved to disk on game exit. (For example, if they contain functions or other non-serializable
|
|
278
278
|
* data.) For these cases, set the second argument to `false`.
|
|
279
279
|
*
|
|
280
|
-
* Note that when the player uses Glowing
|
|
280
|
+
* Note that when the player uses Glowing Hourglass, the save data manager will automatically
|
|
281
281
|
* restore any variables on a "run" or "level" object with a backup that was created when the room
|
|
282
|
-
* was entered. Thus, you should not have to explicitly program support for Glowing
|
|
282
|
+
* was entered. Thus, you should not have to explicitly program support for Glowing Hourglass
|
|
283
283
|
* into your mod features that use the save data manager. If this is undesired for your specific
|
|
284
284
|
* use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
|
|
285
285
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// The save data manager has a feature where certain variables will automatically be rolled back
|
|
2
|
-
// when the Glowing
|
|
2
|
+
// when the Glowing Hourglass is used.
|
|
3
3
|
|
|
4
4
|
import { SaveDataKey } from "../../../../enums/SaveDataKey";
|
|
5
5
|
import { SerializationType } from "../../../../enums/SerializationType";
|
|
@@ -11,7 +11,7 @@ import { AnyClass } from "../../../../types/AnyClass";
|
|
|
11
11
|
import { SAVE_DATA_MANAGER_DEBUG } from "./constants";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* When the Glowing
|
|
14
|
+
* When the Glowing Hourglass is used, certain save data keys will automatically be restored to a
|
|
15
15
|
* backup.
|
|
16
16
|
*/
|
|
17
17
|
const GLOWING_HOUR_GLASS_BACKUP_KEYS: readonly SaveDataKey[] = [
|
|
@@ -29,7 +29,7 @@ export function makeGlowingHourGlassBackup(
|
|
|
29
29
|
iterateTableInOrder(
|
|
30
30
|
saveDataMap,
|
|
31
31
|
(subscriberName, saveData) => {
|
|
32
|
-
// We make the Glowing
|
|
32
|
+
// We make the Glowing Hourglass backup using `SerializationType.SERIALIZE`, which means that
|
|
33
33
|
// we cannot operate on unserializable data, such as functions. Save data that utilizes
|
|
34
34
|
// unserializable data will typically be marked using a conditional function that evaluates to
|
|
35
35
|
// false, so we skip all save data that matches this criteria.
|
|
@@ -86,7 +86,7 @@ export function restoreGlowingHourGlassBackup(
|
|
|
86
86
|
iterateTableInOrder(
|
|
87
87
|
saveDataMap,
|
|
88
88
|
(subscriberName, saveData) => {
|
|
89
|
-
// We make the Glowing
|
|
89
|
+
// We make the Glowing Hourglass backup using `SerializationType.SERIALIZE`, which means that
|
|
90
90
|
// we cannot operate on unserializable data, such as functions. Save data that utilizes
|
|
91
91
|
// unserializable data will typically be marked using a conditional function that evaluates to
|
|
92
92
|
// false, so we skip all save data that matches this criteria.
|
package/src/functions/rooms.ts
CHANGED
|
@@ -338,7 +338,7 @@ export function inCrawlSpace(): boolean {
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
|
-
* Helper function to detect if the current room is one of the
|
|
341
|
+
* Helper function to detect if the current room is one of the rooms in the Death Certificate area.
|
|
342
342
|
*/
|
|
343
343
|
export function inDeathCertificateArea(): boolean {
|
|
344
344
|
const roomStageID = getRoomStageID();
|
|
@@ -433,7 +433,7 @@ export const COLLECTIBLE_TYPE_TO_NAME_MAP: ReadonlyMap<
|
|
|
433
433
|
[419, "Teleport 2.0"],
|
|
434
434
|
[420, "Black Powder"],
|
|
435
435
|
[421, "Kidney Bean"],
|
|
436
|
-
[422, "Glowing
|
|
436
|
+
[422, "Glowing Hourglass"],
|
|
437
437
|
[423, "Circle of Protection"],
|
|
438
438
|
[424, "Sack Head"],
|
|
439
439
|
[425, "Night Light"],
|