isaacscript-common 15.4.3 → 15.4.4
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 +3 -0
- package/dist/isaacscript-common.lua +68 -27
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts +1 -0
- package/dist/src/classes/features/other/PickupIndexCreation.d.ts.map +1 -1
- package/dist/src/classes/features/other/PickupIndexCreation.lua +33 -26
- package/dist/src/core/constants.d.ts +2 -0
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.lua +2 -0
- package/package.json +2 -2
- package/src/classes/features/other/PickupIndexCreation.ts +11 -4
- package/src/core/constants.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -3725,6 +3725,8 @@ export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
|
3725
3725
|
* The random items that appear when the player has TMTRAINER are generated on the fly as they are
|
|
3726
3726
|
* encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
|
|
3727
3727
|
* second TMTRAINER item subtracts one from that, and so on.
|
|
3728
|
+
*
|
|
3729
|
+
* This is equal to 4294967295.
|
|
3728
3730
|
*/
|
|
3729
3731
|
export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: CollectibleType;
|
|
3730
3732
|
|
|
@@ -11316,6 +11318,7 @@ export declare type PickupIndex = int & {
|
|
|
11316
11318
|
declare class PickupIndexCreation extends Feature {
|
|
11317
11319
|
private roomHistory;
|
|
11318
11320
|
private postPickupInit;
|
|
11321
|
+
private trySetPickupIndex;
|
|
11319
11322
|
private postEntityRemovePickup;
|
|
11320
11323
|
private checkDespawningFromPlayerLeavingRoom;
|
|
11321
11324
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 15.4.
|
|
3
|
+
isaacscript-common 15.4.4
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -13409,6 +13409,8 @@ ____exports.SeedEffect.SUPER_HOT = 77
|
|
|
13409
13409
|
____exports.SeedEffect[____exports.SeedEffect.SUPER_HOT] = "SUPER_HOT"
|
|
13410
13410
|
____exports.SeedEffect.RETRO_VISION = 78
|
|
13411
13411
|
____exports.SeedEffect[____exports.SeedEffect.RETRO_VISION] = "RETRO_VISION"
|
|
13412
|
+
____exports.SeedEffect.G_FUEL = 79
|
|
13413
|
+
____exports.SeedEffect[____exports.SeedEffect.G_FUEL] = "G_FUEL"
|
|
13412
13414
|
return ____exports
|
|
13413
13415
|
end,
|
|
13414
13416
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.SkinColor"] = function(...)
|
|
@@ -14862,6 +14864,38 @@ ____exports.SoundEffect.BEAST_GROWL = 815
|
|
|
14862
14864
|
____exports.SoundEffect[____exports.SoundEffect.BEAST_GROWL] = "BEAST_GROWL"
|
|
14863
14865
|
____exports.SoundEffect.BEAST_GRUMBLE = 816
|
|
14864
14866
|
____exports.SoundEffect[____exports.SoundEffect.BEAST_GRUMBLE] = "BEAST_GRUMBLE"
|
|
14867
|
+
____exports.SoundEffect.ULTRA_FAMINE_SHOOT = 817
|
|
14868
|
+
____exports.SoundEffect[____exports.SoundEffect.ULTRA_FAMINE_SHOOT] = "ULTRA_FAMINE_SHOOT"
|
|
14869
|
+
____exports.SoundEffect.G_FUEL_1 = 818
|
|
14870
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_1] = "G_FUEL_1"
|
|
14871
|
+
____exports.SoundEffect.G_FUEL_2 = 819
|
|
14872
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_2] = "G_FUEL_2"
|
|
14873
|
+
____exports.SoundEffect.G_FUEL_3 = 820
|
|
14874
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_3] = "G_FUEL_3"
|
|
14875
|
+
____exports.SoundEffect.G_FUEL_4 = 821
|
|
14876
|
+
____exports.SoundEffect[____exports.SoundEffect.G_FUEL_4] = "G_FUEL_4"
|
|
14877
|
+
____exports.SoundEffect.EXPLOSION_SMALL = 822
|
|
14878
|
+
____exports.SoundEffect[____exports.SoundEffect.EXPLOSION_SMALL] = "EXPLOSION_SMALL"
|
|
14879
|
+
____exports.SoundEffect.EXPLOSION_BIG = 823
|
|
14880
|
+
____exports.SoundEffect[____exports.SoundEffect.EXPLOSION_BIG] = "EXPLOSION_BIG"
|
|
14881
|
+
____exports.SoundEffect.GUN_SHOT_MEDIUM = 824
|
|
14882
|
+
____exports.SoundEffect[____exports.SoundEffect.GUN_SHOT_MEDIUM] = "GUN_SHOT_MEDIUM"
|
|
14883
|
+
____exports.SoundEffect.GUN_SHOT_SMALL = 825
|
|
14884
|
+
____exports.SoundEffect[____exports.SoundEffect.GUN_SHOT_SMALL] = "GUN_SHOT_SMALL"
|
|
14885
|
+
____exports.SoundEffect.GUN_SHOT_LARGE = 826
|
|
14886
|
+
____exports.SoundEffect[____exports.SoundEffect.GUN_SHOT_LARGE] = "GUN_SHOT_LARGE"
|
|
14887
|
+
____exports.SoundEffect.GUN_SHOT_SPREAD = 827
|
|
14888
|
+
____exports.SoundEffect[____exports.SoundEffect.GUN_SHOT_SPREAD] = "GUN_SHOT_SPREAD"
|
|
14889
|
+
____exports.SoundEffect.AIR_HORN = 828
|
|
14890
|
+
____exports.SoundEffect[____exports.SoundEffect.AIR_HORN] = "AIR_HORN"
|
|
14891
|
+
____exports.SoundEffect.ITEM_EXPLOSION = 829
|
|
14892
|
+
____exports.SoundEffect[____exports.SoundEffect.ITEM_EXPLOSION] = "ITEM_EXPLOSION"
|
|
14893
|
+
____exports.SoundEffect.GUN_SHOT_MINI = 830
|
|
14894
|
+
____exports.SoundEffect[____exports.SoundEffect.GUN_SHOT_MINI] = "GUN_SHOT_MINI"
|
|
14895
|
+
____exports.SoundEffect.BULLET_RICOCHET = 831
|
|
14896
|
+
____exports.SoundEffect[____exports.SoundEffect.BULLET_RICOCHET] = "BULLET_RICOCHET"
|
|
14897
|
+
____exports.SoundEffect.ROCKET_LAUNCHER = 832
|
|
14898
|
+
____exports.SoundEffect[____exports.SoundEffect.ROCKET_LAUNCHER] = "ROCKET_LAUNCHER"
|
|
14865
14899
|
return ____exports
|
|
14866
14900
|
end,
|
|
14867
14901
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.StageID"] = function(...)
|
|
@@ -33850,19 +33884,7 @@ function PickupIndexCreation.prototype.____constructor(self, roomHistory)
|
|
|
33850
33884
|
room = {pickupIndexes = __TS__New(Map)}
|
|
33851
33885
|
}
|
|
33852
33886
|
self.postPickupInit = function(____, pickup)
|
|
33853
|
-
|
|
33854
|
-
if self.v.room.pickupIndexes:has(ptrHash) then
|
|
33855
|
-
return
|
|
33856
|
-
end
|
|
33857
|
-
local room = game:GetRoom()
|
|
33858
|
-
local isFirstVisit = room:IsFirstVisit()
|
|
33859
|
-
local roomFrameCount = room:GetFrameCount()
|
|
33860
|
-
if not isFirstVisit and roomFrameCount <= 0 then
|
|
33861
|
-
return
|
|
33862
|
-
end
|
|
33863
|
-
local ____self_v_run_0, ____pickupCounter_1 = self.v.run, "pickupCounter"
|
|
33864
|
-
____self_v_run_0[____pickupCounter_1] = ____self_v_run_0[____pickupCounter_1] + 1
|
|
33865
|
-
self.v.room.pickupIndexes:set(ptrHash, self.v.run.pickupCounter)
|
|
33887
|
+
self:trySetPickupIndex(pickup)
|
|
33866
33888
|
end
|
|
33867
33889
|
self.postEntityRemovePickup = function(____, entity)
|
|
33868
33890
|
self:checkDespawningFromPlayerLeavingRoom(entity)
|
|
@@ -33881,8 +33903,8 @@ function PickupIndexCreation.prototype.____constructor(self, roomHistory)
|
|
|
33881
33903
|
pickupIndex = self:getPostAscentPickupIndex(pickup)
|
|
33882
33904
|
end
|
|
33883
33905
|
if pickupIndex == nil then
|
|
33884
|
-
local
|
|
33885
|
-
|
|
33906
|
+
local ____self_v_run_0, ____pickupCounter_1 = self.v.run, "pickupCounter"
|
|
33907
|
+
____self_v_run_0[____pickupCounter_1] = ____self_v_run_0[____pickupCounter_1] + 1
|
|
33886
33908
|
pickupIndex = self.v.run.pickupCounter
|
|
33887
33909
|
end
|
|
33888
33910
|
local ptrHash = GetPtrHash(pickup)
|
|
@@ -33894,6 +33916,21 @@ function PickupIndexCreation.prototype.____constructor(self, roomHistory)
|
|
|
33894
33916
|
self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, {self.postNewRoomReordered}}}
|
|
33895
33917
|
self.roomHistory = roomHistory
|
|
33896
33918
|
end
|
|
33919
|
+
function PickupIndexCreation.prototype.trySetPickupIndex(self, pickup)
|
|
33920
|
+
local ptrHash = GetPtrHash(pickup)
|
|
33921
|
+
if self.v.room.pickupIndexes:has(ptrHash) then
|
|
33922
|
+
return
|
|
33923
|
+
end
|
|
33924
|
+
local room = game:GetRoom()
|
|
33925
|
+
local isFirstVisit = room:IsFirstVisit()
|
|
33926
|
+
local roomFrameCount = room:GetFrameCount()
|
|
33927
|
+
if not isFirstVisit and roomFrameCount <= 0 then
|
|
33928
|
+
return
|
|
33929
|
+
end
|
|
33930
|
+
local ____self_v_run_2, ____pickupCounter_3 = self.v.run, "pickupCounter"
|
|
33931
|
+
____self_v_run_2[____pickupCounter_3] = ____self_v_run_2[____pickupCounter_3] + 1
|
|
33932
|
+
self.v.room.pickupIndexes:set(ptrHash, self.v.run.pickupCounter)
|
|
33933
|
+
end
|
|
33897
33934
|
function PickupIndexCreation.prototype.checkDespawningFromPlayerLeavingRoom(self, entity)
|
|
33898
33935
|
local ptrHash = GetPtrHash(entity)
|
|
33899
33936
|
local pickupIndex = self.v.room.pickupIndexes:get(ptrHash)
|
|
@@ -33920,16 +33957,16 @@ function PickupIndexCreation.prototype.trackDespawningPickupMetadata(self, entit
|
|
|
33920
33957
|
local room = game:GetRoom()
|
|
33921
33958
|
local roomType = room:GetType()
|
|
33922
33959
|
repeat
|
|
33923
|
-
local
|
|
33924
|
-
local
|
|
33925
|
-
if
|
|
33960
|
+
local ____switch21 = roomType
|
|
33961
|
+
local ____cond21 = ____switch21 == RoomType.TREASURE
|
|
33962
|
+
if ____cond21 then
|
|
33926
33963
|
do
|
|
33927
33964
|
self.v.run.pickupDataTreasureRooms:set(pickupIndex, pickupDescription)
|
|
33928
33965
|
break
|
|
33929
33966
|
end
|
|
33930
33967
|
end
|
|
33931
|
-
|
|
33932
|
-
if
|
|
33968
|
+
____cond21 = ____cond21 or ____switch21 == RoomType.BOSS
|
|
33969
|
+
if ____cond21 then
|
|
33933
33970
|
do
|
|
33934
33971
|
self.v.run.pickupDataBossRooms:set(pickupIndex, pickupDescription)
|
|
33935
33972
|
break
|
|
@@ -33949,15 +33986,15 @@ function PickupIndexCreation.prototype.getPostAscentPickupIndex(self, pickup)
|
|
|
33949
33986
|
local room = game:GetRoom()
|
|
33950
33987
|
local roomType = room:GetType()
|
|
33951
33988
|
repeat
|
|
33952
|
-
local
|
|
33953
|
-
local
|
|
33954
|
-
if
|
|
33989
|
+
local ____switch27 = roomType
|
|
33990
|
+
local ____cond27 = ____switch27 == RoomType.TREASURE
|
|
33991
|
+
if ____cond27 then
|
|
33955
33992
|
do
|
|
33956
33993
|
return getStoredPickupIndex(nil, pickup, self.v.run.pickupDataTreasureRooms)
|
|
33957
33994
|
end
|
|
33958
33995
|
end
|
|
33959
|
-
|
|
33960
|
-
if
|
|
33996
|
+
____cond27 = ____cond27 or ____switch27 == RoomType.BOSS
|
|
33997
|
+
if ____cond27 then
|
|
33961
33998
|
do
|
|
33962
33999
|
return getStoredPickupIndex(nil, pickup, self.v.run.pickupDataBossRooms)
|
|
33963
34000
|
end
|
|
@@ -33971,10 +34008,14 @@ function PickupIndexCreation.prototype.getPostAscentPickupIndex(self, pickup)
|
|
|
33971
34008
|
end
|
|
33972
34009
|
function PickupIndexCreation.prototype.getPickupIndex(self, pickup)
|
|
33973
34010
|
local ptrHash = GetPtrHash(pickup)
|
|
34011
|
+
local pickupIndexInitial = self.v.room.pickupIndexes:get(ptrHash)
|
|
34012
|
+
if pickupIndexInitial == nil then
|
|
34013
|
+
self:trySetPickupIndex(pickup)
|
|
34014
|
+
end
|
|
33974
34015
|
local pickupIndex = self.v.room.pickupIndexes:get(ptrHash)
|
|
33975
34016
|
if pickupIndex == nil then
|
|
33976
34017
|
local entityID = getEntityID(nil, pickup)
|
|
33977
|
-
error(
|
|
34018
|
+
error("Failed to generate a new pickup index for pickup: " .. entityID)
|
|
33978
34019
|
end
|
|
33979
34020
|
return pickupIndex
|
|
33980
34021
|
end
|
|
@@ -4,6 +4,7 @@ import { Feature } from "../../private/Feature";
|
|
|
4
4
|
export declare class PickupIndexCreation extends Feature {
|
|
5
5
|
private roomHistory;
|
|
6
6
|
private postPickupInit;
|
|
7
|
+
private trySetPickupIndex;
|
|
7
8
|
private postEntityRemovePickup;
|
|
8
9
|
private checkDespawningFromPlayerLeavingRoom;
|
|
9
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickupIndexCreation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PickupIndexCreation.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,mBAAoB,SAAQ,OAAO;IAsB9C,OAAO,CAAC,WAAW,CAAc;IAwBjC,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"PickupIndexCreation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PickupIndexCreation.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,mBAAoB,SAAQ,OAAO;IAsB9C,OAAO,CAAC,WAAW,CAAc;IAwBjC,OAAO,CAAC,cAAc,CAEpB;IAEF,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,sBAAsB,CAE5B;IAEF,OAAO,CAAC,oCAAoC;IAc5C;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAkDrC,OAAO,CAAC,oBAAoB,CA6B1B;IAEF,OAAO,CAAC,wBAAwB;IAyBhC;;;;;;;;;;;;;;;OAeG;IAEI,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;CAezD"}
|
|
@@ -62,19 +62,7 @@ function PickupIndexCreation.prototype.____constructor(self, roomHistory)
|
|
|
62
62
|
room = {pickupIndexes = __TS__New(Map)}
|
|
63
63
|
}
|
|
64
64
|
self.postPickupInit = function(____, pickup)
|
|
65
|
-
|
|
66
|
-
if self.v.room.pickupIndexes:has(ptrHash) then
|
|
67
|
-
return
|
|
68
|
-
end
|
|
69
|
-
local room = game:GetRoom()
|
|
70
|
-
local isFirstVisit = room:IsFirstVisit()
|
|
71
|
-
local roomFrameCount = room:GetFrameCount()
|
|
72
|
-
if not isFirstVisit and roomFrameCount <= 0 then
|
|
73
|
-
return
|
|
74
|
-
end
|
|
75
|
-
local ____self_v_run_0, ____pickupCounter_1 = self.v.run, "pickupCounter"
|
|
76
|
-
____self_v_run_0[____pickupCounter_1] = ____self_v_run_0[____pickupCounter_1] + 1
|
|
77
|
-
self.v.room.pickupIndexes:set(ptrHash, self.v.run.pickupCounter)
|
|
65
|
+
self:trySetPickupIndex(pickup)
|
|
78
66
|
end
|
|
79
67
|
self.postEntityRemovePickup = function(____, entity)
|
|
80
68
|
self:checkDespawningFromPlayerLeavingRoom(entity)
|
|
@@ -93,8 +81,8 @@ function PickupIndexCreation.prototype.____constructor(self, roomHistory)
|
|
|
93
81
|
pickupIndex = self:getPostAscentPickupIndex(pickup)
|
|
94
82
|
end
|
|
95
83
|
if pickupIndex == nil then
|
|
96
|
-
local
|
|
97
|
-
|
|
84
|
+
local ____self_v_run_0, ____pickupCounter_1 = self.v.run, "pickupCounter"
|
|
85
|
+
____self_v_run_0[____pickupCounter_1] = ____self_v_run_0[____pickupCounter_1] + 1
|
|
98
86
|
pickupIndex = self.v.run.pickupCounter
|
|
99
87
|
end
|
|
100
88
|
local ptrHash = GetPtrHash(pickup)
|
|
@@ -106,6 +94,21 @@ function PickupIndexCreation.prototype.____constructor(self, roomHistory)
|
|
|
106
94
|
self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, {self.postNewRoomReordered}}}
|
|
107
95
|
self.roomHistory = roomHistory
|
|
108
96
|
end
|
|
97
|
+
function PickupIndexCreation.prototype.trySetPickupIndex(self, pickup)
|
|
98
|
+
local ptrHash = GetPtrHash(pickup)
|
|
99
|
+
if self.v.room.pickupIndexes:has(ptrHash) then
|
|
100
|
+
return
|
|
101
|
+
end
|
|
102
|
+
local room = game:GetRoom()
|
|
103
|
+
local isFirstVisit = room:IsFirstVisit()
|
|
104
|
+
local roomFrameCount = room:GetFrameCount()
|
|
105
|
+
if not isFirstVisit and roomFrameCount <= 0 then
|
|
106
|
+
return
|
|
107
|
+
end
|
|
108
|
+
local ____self_v_run_2, ____pickupCounter_3 = self.v.run, "pickupCounter"
|
|
109
|
+
____self_v_run_2[____pickupCounter_3] = ____self_v_run_2[____pickupCounter_3] + 1
|
|
110
|
+
self.v.room.pickupIndexes:set(ptrHash, self.v.run.pickupCounter)
|
|
111
|
+
end
|
|
109
112
|
function PickupIndexCreation.prototype.checkDespawningFromPlayerLeavingRoom(self, entity)
|
|
110
113
|
local ptrHash = GetPtrHash(entity)
|
|
111
114
|
local pickupIndex = self.v.room.pickupIndexes:get(ptrHash)
|
|
@@ -132,16 +135,16 @@ function PickupIndexCreation.prototype.trackDespawningPickupMetadata(self, entit
|
|
|
132
135
|
local room = game:GetRoom()
|
|
133
136
|
local roomType = room:GetType()
|
|
134
137
|
repeat
|
|
135
|
-
local
|
|
136
|
-
local
|
|
137
|
-
if
|
|
138
|
+
local ____switch21 = roomType
|
|
139
|
+
local ____cond21 = ____switch21 == RoomType.TREASURE
|
|
140
|
+
if ____cond21 then
|
|
138
141
|
do
|
|
139
142
|
self.v.run.pickupDataTreasureRooms:set(pickupIndex, pickupDescription)
|
|
140
143
|
break
|
|
141
144
|
end
|
|
142
145
|
end
|
|
143
|
-
|
|
144
|
-
if
|
|
146
|
+
____cond21 = ____cond21 or ____switch21 == RoomType.BOSS
|
|
147
|
+
if ____cond21 then
|
|
145
148
|
do
|
|
146
149
|
self.v.run.pickupDataBossRooms:set(pickupIndex, pickupDescription)
|
|
147
150
|
break
|
|
@@ -161,15 +164,15 @@ function PickupIndexCreation.prototype.getPostAscentPickupIndex(self, pickup)
|
|
|
161
164
|
local room = game:GetRoom()
|
|
162
165
|
local roomType = room:GetType()
|
|
163
166
|
repeat
|
|
164
|
-
local
|
|
165
|
-
local
|
|
166
|
-
if
|
|
167
|
+
local ____switch27 = roomType
|
|
168
|
+
local ____cond27 = ____switch27 == RoomType.TREASURE
|
|
169
|
+
if ____cond27 then
|
|
167
170
|
do
|
|
168
171
|
return getStoredPickupIndex(nil, pickup, self.v.run.pickupDataTreasureRooms)
|
|
169
172
|
end
|
|
170
173
|
end
|
|
171
|
-
|
|
172
|
-
if
|
|
174
|
+
____cond27 = ____cond27 or ____switch27 == RoomType.BOSS
|
|
175
|
+
if ____cond27 then
|
|
173
176
|
do
|
|
174
177
|
return getStoredPickupIndex(nil, pickup, self.v.run.pickupDataBossRooms)
|
|
175
178
|
end
|
|
@@ -183,10 +186,14 @@ function PickupIndexCreation.prototype.getPostAscentPickupIndex(self, pickup)
|
|
|
183
186
|
end
|
|
184
187
|
function PickupIndexCreation.prototype.getPickupIndex(self, pickup)
|
|
185
188
|
local ptrHash = GetPtrHash(pickup)
|
|
189
|
+
local pickupIndexInitial = self.v.room.pickupIndexes:get(ptrHash)
|
|
190
|
+
if pickupIndexInitial == nil then
|
|
191
|
+
self:trySetPickupIndex(pickup)
|
|
192
|
+
end
|
|
186
193
|
local pickupIndex = self.v.room.pickupIndexes:get(ptrHash)
|
|
187
194
|
if pickupIndex == nil then
|
|
188
195
|
local entityID = getEntityID(nil, pickup)
|
|
189
|
-
error(
|
|
196
|
+
error("Failed to generate a new pickup index for pickup: " .. entityID)
|
|
190
197
|
end
|
|
191
198
|
return pickupIndex
|
|
192
199
|
end
|
|
@@ -44,6 +44,8 @@ export declare const EMPTY_PNG_PATH = "gfx/none.png";
|
|
|
44
44
|
* The random items that appear when the player has TMTRAINER are generated on the fly as they are
|
|
45
45
|
* encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
|
|
46
46
|
* second TMTRAINER item subtracts one from that, and so on.
|
|
47
|
+
*
|
|
48
|
+
* This is equal to 4294967295.
|
|
47
49
|
*/
|
|
48
50
|
export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: import("isaac-typescript-definitions").CollectibleType;
|
|
49
51
|
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAMtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C
|
|
1
|
+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fly as they are
|
|
43
43
|
-- encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
|
|
44
44
|
-- second TMTRAINER item subtracts one from that, and so on.
|
|
45
|
+
--
|
|
46
|
+
-- This is equal to 4294967295.
|
|
45
47
|
____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = asCollectibleType(nil, (1 << 32) - 1)
|
|
46
48
|
--- Game frames are what is returned by the `Game.GetFrameCount` method.
|
|
47
49
|
____exports.GAME_FRAMES_PER_SECOND = 30
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "15.4.
|
|
3
|
+
"version": "15.4.4",
|
|
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.0
|
|
25
|
+
"isaac-typescript-definitions": "^9.3.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -69,6 +69,10 @@ export class PickupIndexCreation extends Feature {
|
|
|
69
69
|
|
|
70
70
|
// ModCallback.POST_PICKUP_INIT (34)
|
|
71
71
|
private postPickupInit = (pickup: EntityPickup) => {
|
|
72
|
+
this.trySetPickupIndex(pickup);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
private trySetPickupIndex(pickup: EntityPickup): void {
|
|
72
76
|
const ptrHash = GetPtrHash(pickup);
|
|
73
77
|
|
|
74
78
|
// In certain situations, pickups can be morphed, and this should not incur a new pickup
|
|
@@ -88,7 +92,7 @@ export class PickupIndexCreation extends Feature {
|
|
|
88
92
|
|
|
89
93
|
this.v.run.pickupCounter++;
|
|
90
94
|
this.v.room.pickupIndexes.set(ptrHash, this.v.run.pickupCounter);
|
|
91
|
-
}
|
|
95
|
+
}
|
|
92
96
|
|
|
93
97
|
// ModCallback.POST_ENTITY_REMOVE (67)
|
|
94
98
|
// EntityType.PICKUP (5)
|
|
@@ -239,12 +243,15 @@ export class PickupIndexCreation extends Feature {
|
|
|
239
243
|
@Exported
|
|
240
244
|
public getPickupIndex(pickup: EntityPickup): PickupIndex {
|
|
241
245
|
const ptrHash = GetPtrHash(pickup);
|
|
246
|
+
const pickupIndexInitial = this.v.room.pickupIndexes.get(ptrHash);
|
|
247
|
+
if (pickupIndexInitial === undefined) {
|
|
248
|
+
this.trySetPickupIndex(pickup);
|
|
249
|
+
}
|
|
250
|
+
|
|
242
251
|
const pickupIndex = this.v.room.pickupIndexes.get(ptrHash);
|
|
243
252
|
if (pickupIndex === undefined) {
|
|
244
253
|
const entityID = getEntityID(pickup);
|
|
245
|
-
error(
|
|
246
|
-
`Failed to get a pickup index for entity ${entityID} with hash: ${ptrHash}`,
|
|
247
|
-
);
|
|
254
|
+
error(`Failed to generate a new pickup index for pickup: ${entityID}`);
|
|
248
255
|
}
|
|
249
256
|
|
|
250
257
|
return pickupIndex;
|
package/src/core/constants.ts
CHANGED
|
@@ -65,6 +65,8 @@ export const EMPTY_PNG_PATH = "gfx/none.png";
|
|
|
65
65
|
* The random items that appear when the player has TMTRAINER are generated on the fly as they are
|
|
66
66
|
* encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
|
|
67
67
|
* second TMTRAINER item subtracts one from that, and so on.
|
|
68
|
+
*
|
|
69
|
+
* This is equal to 4294967295.
|
|
68
70
|
*/
|
|
69
71
|
|
|
70
72
|
export const FIRST_GLITCHED_COLLECTIBLE_TYPE = asCollectibleType((1 << 32) - 1);
|