isaacscript-common 29.5.1 → 29.5.2

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.
Files changed (27) hide show
  1. package/dist/index.rollup.d.ts +9 -5
  2. package/dist/isaacscript-common.lua +44 -14
  3. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts +1 -1
  4. package/dist/src/classes/features/callbackLogic/EsauJrDetection.d.ts.map +1 -1
  5. package/dist/src/classes/features/callbackLogic/EsauJrDetection.lua +2 -2
  6. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts +1 -1
  7. package/dist/src/classes/features/callbackLogic/FlipDetection.d.ts.map +1 -1
  8. package/dist/src/classes/features/callbackLogic/FlipDetection.lua +2 -2
  9. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts +1 -1
  10. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.d.ts.map +1 -1
  11. package/dist/src/classes/features/callbackLogic/GameReorderedCallbacks.lua +2 -2
  12. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +1 -1
  13. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -1
  14. package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.lua +2 -2
  15. package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts +3 -1
  16. package/dist/src/classes/features/other/PreventCollectibleRotation.d.ts.map +1 -1
  17. package/dist/src/classes/features/other/PreventCollectibleRotation.lua +35 -5
  18. package/dist/src/functions/utils.d.ts +2 -0
  19. package/dist/src/functions/utils.d.ts.map +1 -1
  20. package/dist/src/functions/utils.lua +2 -0
  21. package/package.json +1 -1
  22. package/src/classes/features/callbackLogic/EsauJrDetection.ts +2 -2
  23. package/src/classes/features/callbackLogic/FlipDetection.ts +2 -2
  24. package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +2 -2
  25. package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +2 -2
  26. package/src/classes/features/other/PreventCollectibleRotation.ts +53 -2
  27. package/src/functions/utils.ts +2 -0
@@ -3875,7 +3875,7 @@ declare class EsauJrDetection extends Feature {
3875
3875
  private postFirstEsauJr;
3876
3876
  constructor(postEsauJr: PostEsauJr, postFirstEsauJr: PostFirstEsauJr);
3877
3877
  private postUpdate;
3878
- private useItemEsauJr;
3878
+ private postUseItemEsauJr;
3879
3879
  }
3880
3880
 
3881
3881
  /**
@@ -4110,7 +4110,7 @@ declare class FlipDetection extends Feature {
4110
4110
  private postFlip;
4111
4111
  private postFirstFlip;
4112
4112
  constructor(postFlip: PostFlip, postFirstFlip: PostFirstFlip);
4113
- private useItemFlip;
4113
+ private postUseItemFlip;
4114
4114
  }
4115
4115
 
4116
4116
  declare class FlyingDetection extends Feature {
@@ -4204,7 +4204,7 @@ declare class GameReorderedCallbacks extends Feature {
4204
4204
  private postNewLevelReordered;
4205
4205
  private postNewRoomReordered;
4206
4206
  private postGameStartedReorderedLast;
4207
- private useItemGlowingHourGlass;
4207
+ private postUseItemGlowingHourGlass;
4208
4208
  private postGameStarted;
4209
4209
  private postNewLevel;
4210
4210
  private postNewRoom;
@@ -13177,7 +13177,7 @@ declare class PlayerCollectibleDetection extends Feature {
13177
13177
  * rerolled.
13178
13178
  */
13179
13179
  private updateCollectibleMapAndFire;
13180
- private useItemD4;
13180
+ private postUseItemD4;
13181
13181
  /** We need to handle the case of Tainted Eden taking damage. */
13182
13182
  private entityTakeDmgPlayer;
13183
13183
  /**
@@ -13533,11 +13533,13 @@ declare class PreventChildEntities extends Feature {
13533
13533
 
13534
13534
  declare class PreventCollectibleRotation extends Feature {
13535
13535
  private pickupIndexCreation;
13536
+ private preUseItem;
13536
13537
  /**
13537
13538
  * Soul of Isaac causes items to flip. We assume that the player deliberately wants to roll a
13538
13539
  * quest item, so we delete all tracked items in the current room.
13539
13540
  */
13540
- private useCardSoulOfIsaac;
13541
+ private postUseCardSoulOfIsaac;
13542
+ private postDiceRoomActivated;
13541
13543
  private postPickupChanged;
13542
13544
  /**
13543
13545
  * Helper function to prevent a collectible from being affected by Tainted Isaac's rotation
@@ -16354,6 +16356,8 @@ export declare const TIME_GAME_OPENED: number;
16354
16356
  * useful as a means to prevent unused variables.)
16355
16357
  *
16356
16358
  * This function does not actually do anything. (It is an "empty" function.)
16359
+ *
16360
+ * @allowEmptyVariadic
16357
16361
  */
16358
16362
  export declare function todo(...args: unknown[]): void;
16359
16363
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 29.5.1
3
+ isaacscript-common 29.5.2
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -34244,13 +34244,13 @@ function EsauJrDetection.prototype.____constructor(self, postEsauJr, postFirstEs
34244
34244
  end
34245
34245
  self.postEsauJr:fire(player)
34246
34246
  end
34247
- self.useItemEsauJr = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
34247
+ self.postUseItemEsauJr = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
34248
34248
  local gameFrameCount = game:GetFrameCount()
34249
34249
  v.run.usedEsauJrFrame = gameFrameCount + 1
34250
34250
  v.run.usedEsauJrControllerIndex = player.ControllerIndex
34251
34251
  return nil
34252
34252
  end
34253
- self.callbacksUsed = {{ModCallback.POST_UPDATE, self.postUpdate}, {ModCallback.POST_USE_ITEM, self.useItemEsauJr, {CollectibleType.ESAU_JR}}}
34253
+ self.callbacksUsed = {{ModCallback.POST_UPDATE, self.postUpdate}, {ModCallback.POST_USE_ITEM, self.postUseItemEsauJr, {CollectibleType.ESAU_JR}}}
34254
34254
  self.postEsauJr = postEsauJr
34255
34255
  self.postFirstEsauJr = postFirstEsauJr
34256
34256
  end
@@ -34296,7 +34296,7 @@ __TS__ClassExtends(FlipDetection, Feature)
34296
34296
  function FlipDetection.prototype.____constructor(self, postFlip, postFirstFlip)
34297
34297
  Feature.prototype.____constructor(self)
34298
34298
  self.v = v
34299
- self.useItemFlip = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
34299
+ self.postUseItemFlip = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
34300
34300
  if not isTaintedLazarus(nil, player) then
34301
34301
  return nil
34302
34302
  end
@@ -34311,7 +34311,7 @@ function FlipDetection.prototype.____constructor(self, postFlip, postFirstFlip)
34311
34311
  self.postFlip:fire(newLazarus, player)
34312
34312
  return nil
34313
34313
  end
34314
- self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.useItemFlip, {CollectibleType.FLIP}}}
34314
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItemFlip, {CollectibleType.FLIP}}}
34315
34315
  self.postFlip = postFlip
34316
34316
  self.postFirstFlip = postFirstFlip
34317
34317
  end
@@ -34343,7 +34343,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
34343
34343
  self.usedGlowingHourGlass = false
34344
34344
  self.forceNewLevel = false
34345
34345
  self.forceNewRoom = false
34346
- self.useItemGlowingHourGlass = function()
34346
+ self.postUseItemGlowingHourGlass = function()
34347
34347
  self.usedGlowingHourGlass = true
34348
34348
  return nil
34349
34349
  end
@@ -34396,7 +34396,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
34396
34396
  self.forceNewRoom = false
34397
34397
  self.postNewRoomReordered:fire(roomType)
34398
34398
  end
34399
- self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.useItemGlowingHourGlass, {CollectibleType.GLOWING_HOUR_GLASS}}, {ModCallback.POST_GAME_STARTED, self.postGameStarted}, {ModCallback.POST_NEW_LEVEL, self.postNewLevel}, {ModCallback.POST_NEW_ROOM, self.postNewRoom}}
34399
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItemGlowingHourGlass, {CollectibleType.GLOWING_HOUR_GLASS}}, {ModCallback.POST_GAME_STARTED, self.postGameStarted}, {ModCallback.POST_NEW_LEVEL, self.postNewLevel}, {ModCallback.POST_NEW_ROOM, self.postNewRoom}}
34400
34400
  self.postGameStartedReordered = postGameStartedReordered
34401
34401
  self.postNewLevelReordered = postNewLevelReordered
34402
34402
  self.postNewRoomReordered = postNewRoomReordered
@@ -38120,7 +38120,7 @@ __TS__ClassExtends(PlayerCollectibleDetection, Feature)
38120
38120
  function PlayerCollectibleDetection.prototype.____constructor(self, postPlayerCollectibleAdded, postPlayerCollectibleRemoved, moddedElementSets, runInNFrames)
38121
38121
  Feature.prototype.____constructor(self)
38122
38122
  self.v = v
38123
- self.useItemD4 = function(____, _collectibleType, _rng, player)
38123
+ self.postUseItemD4 = function(____, _collectibleType, _rng, player)
38124
38124
  self:updateCollectibleMapAndFire(player, nil)
38125
38125
  return nil
38126
38126
  end
@@ -38163,7 +38163,7 @@ function PlayerCollectibleDetection.prototype.____constructor(self, postPlayerCo
38163
38163
  end
38164
38164
  end
38165
38165
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_SETS, ISCFeature.RUN_IN_N_FRAMES}
38166
- self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.useItemD4, {CollectibleType.D4}}}
38166
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItemD4, {CollectibleType.D4}}}
38167
38167
  self.customCallbacksUsed = {{ModCallbackCustom.ENTITY_TAKE_DMG_PLAYER, self.entityTakeDmgPlayer}, {ModCallbackCustom.POST_ITEM_PICKUP, self.postItemPickup}, {ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}}
38168
38168
  self.postPlayerCollectibleAdded = postPlayerCollectibleAdded
38169
38169
  self.postPlayerCollectibleRemoved = postPlayerCollectibleRemoved
@@ -46107,17 +46107,21 @@ return ____exports
46107
46107
  end,
46108
46108
  ["src.classes.features.other.PreventCollectibleRotation"] = function(...)
46109
46109
  local ____lualib = require("lualib_bundle")
46110
- local Map = ____lualib.Map
46111
46110
  local __TS__New = ____lualib.__TS__New
46111
+ local Map = ____lualib.Map
46112
46112
  local __TS__Class = ____lualib.__TS__Class
46113
46113
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
46114
46114
  local __TS__Decorate = ____lualib.__TS__Decorate
46115
46115
  local ____exports = {}
46116
+ local markRollFrame, v
46116
46117
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
46117
46118
  local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
46118
46119
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
46120
+ local DiceFloorSubType = ____isaac_2Dtypescript_2Ddefinitions.DiceFloorSubType
46119
46121
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
46120
46122
  local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
46123
+ local ____cachedClasses = require("src.core.cachedClasses")
46124
+ local game = ____cachedClasses.game
46121
46125
  local ____decorators = require("src.decorators")
46122
46126
  local Exported = ____decorators.Exported
46123
46127
  local ____ISCFeature = require("src.enums.ISCFeature")
@@ -46134,9 +46138,19 @@ local ____pickupVariants = require("src.functions.pickupVariants")
46134
46138
  local isCollectible = ____pickupVariants.isCollectible
46135
46139
  local ____types = require("src.functions.types")
46136
46140
  local asCollectibleType = ____types.asCollectibleType
46141
+ local ____ReadonlySet = require("src.types.ReadonlySet")
46142
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
46137
46143
  local ____Feature = require("src.classes.private.Feature")
46138
46144
  local Feature = ____Feature.Feature
46139
- local v = {run = {trackedCollectibles = __TS__New(Map)}}
46145
+ function markRollFrame(self)
46146
+ v.run.rollGameFrame = game:GetFrameCount()
46147
+ end
46148
+ local ROLL_COLLECTIBLE_TYPES = __TS__New(ReadonlySet, {CollectibleType.D6, CollectibleType.ETERNAL_D6, CollectibleType.SPINDOWN_DICE})
46149
+ local ROLL_FLOOR_DICE_FLOOR_SUB_TYPES = __TS__New(ReadonlySet, {DiceFloorSubType.FOUR_PIP, DiceFloorSubType.SIX_PIP})
46150
+ v = {run = {
46151
+ trackedCollectibles = __TS__New(Map),
46152
+ rollGameFrame = nil
46153
+ }}
46140
46154
  ____exports.PreventCollectibleRotation = __TS__Class()
46141
46155
  local PreventCollectibleRotation = ____exports.PreventCollectibleRotation
46142
46156
  PreventCollectibleRotation.name = "PreventCollectibleRotation"
@@ -46144,13 +46158,24 @@ __TS__ClassExtends(PreventCollectibleRotation, Feature)
46144
46158
  function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexCreation)
46145
46159
  Feature.prototype.____constructor(self)
46146
46160
  self.v = v
46147
- self.useCardSoulOfIsaac = function()
46161
+ self.preUseItem = function(____, collectibleType)
46162
+ if ROLL_COLLECTIBLE_TYPES:has(collectibleType) then
46163
+ markRollFrame(nil)
46164
+ end
46165
+ return nil
46166
+ end
46167
+ self.postUseCardSoulOfIsaac = function()
46148
46168
  local collectibles = getCollectibles(nil)
46149
46169
  for ____, collectible in ipairs(collectibles) do
46150
46170
  local pickupIndex = self.pickupIndexCreation:getPickupIndex(collectible)
46151
46171
  v.run.trackedCollectibles:delete(pickupIndex)
46152
46172
  end
46153
46173
  end
46174
+ self.postDiceRoomActivated = function(____, _player, diceFloorSubType)
46175
+ if ROLL_FLOOR_DICE_FLOOR_SUB_TYPES:has(diceFloorSubType) then
46176
+ v.run.trackedCollectibles:clear()
46177
+ end
46178
+ end
46154
46179
  self.postPickupChanged = function(____, pickup, oldVariant, _oldSubType, newVariant, newSubType)
46155
46180
  if oldVariant ~= PickupVariant.COLLECTIBLE or newVariant ~= PickupVariant.COLLECTIBLE then
46156
46181
  return
@@ -46163,13 +46188,18 @@ function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexC
46163
46188
  if trackedCollectibleType == nil then
46164
46189
  return
46165
46190
  end
46191
+ local gameFrameCount = game:GetFrameCount()
46192
+ if gameFrameCount == v.run.rollGameFrame then
46193
+ v.run.trackedCollectibles:delete(pickupIndex)
46194
+ return
46195
+ end
46166
46196
  if trackedCollectibleType ~= asCollectibleType(nil, newSubType) then
46167
46197
  setCollectibleSubType(nil, pickup, trackedCollectibleType)
46168
46198
  end
46169
46199
  end
46170
46200
  self.featuresUsed = {ISCFeature.PICKUP_INDEX_CREATION}
46171
- self.callbacksUsed = {{ModCallback.POST_USE_CARD, self.useCardSoulOfIsaac, {CardType.SOUL_ISAAC}}}
46172
- self.customCallbacksUsed = {{ModCallbackCustom.POST_PICKUP_CHANGED, self.postPickupChanged}}
46201
+ self.callbacksUsed = {{ModCallback.POST_USE_CARD, self.postUseCardSoulOfIsaac, {CardType.SOUL_ISAAC}}, {ModCallback.PRE_USE_ITEM, self.preUseItem}}
46202
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_DICE_ROOM_ACTIVATED, self.postDiceRoomActivated}, {ModCallbackCustom.POST_PICKUP_CHANGED, self.postPickupChanged}}
46173
46203
  self.pickupIndexCreation = pickupIndexCreation
46174
46204
  end
46175
46205
  function PreventCollectibleRotation.prototype.preventCollectibleRotation(self, collectible, collectibleType)
@@ -14,6 +14,6 @@ export declare class EsauJrDetection extends Feature {
14
14
  private postFirstEsauJr;
15
15
  constructor(postEsauJr: PostEsauJr, postFirstEsauJr: PostFirstEsauJr);
16
16
  private postUpdate;
17
- private useItemEsauJr;
17
+ private postUseItemEsauJr;
18
18
  }
19
19
  //# sourceMappingURL=EsauJrDetection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EsauJrDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/EsauJrDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAUhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1B,CAAC;;;;;;MAAK;IAEtB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe;IAoBpE,OAAO,CAAC,UAAU,CAiChB;IAIF,OAAO,CAAC,aAAa,CAenB;CACH"}
1
+ {"version":3,"file":"EsauJrDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/EsauJrDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAUhD,qBAAa,eAAgB,SAAQ,OAAO;IAC1B,CAAC;;;;;;MAAK;IAEtB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe;IAoBpE,OAAO,CAAC,UAAU,CAiChB;IAIF,OAAO,CAAC,iBAAiB,CAevB;CACH"}
@@ -40,13 +40,13 @@ function EsauJrDetection.prototype.____constructor(self, postEsauJr, postFirstEs
40
40
  end
41
41
  self.postEsauJr:fire(player)
42
42
  end
43
- self.useItemEsauJr = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
43
+ self.postUseItemEsauJr = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
44
44
  local gameFrameCount = game:GetFrameCount()
45
45
  v.run.usedEsauJrFrame = gameFrameCount + 1
46
46
  v.run.usedEsauJrControllerIndex = player.ControllerIndex
47
47
  return nil
48
48
  end
49
- self.callbacksUsed = {{ModCallback.POST_UPDATE, self.postUpdate}, {ModCallback.POST_USE_ITEM, self.useItemEsauJr, {CollectibleType.ESAU_JR}}}
49
+ self.callbacksUsed = {{ModCallback.POST_UPDATE, self.postUpdate}, {ModCallback.POST_USE_ITEM, self.postUseItemEsauJr, {CollectibleType.ESAU_JR}}}
50
50
  self.postEsauJr = postEsauJr
51
51
  self.postFirstEsauJr = postFirstEsauJr
52
52
  end
@@ -11,6 +11,6 @@ export declare class FlipDetection extends Feature {
11
11
  private postFlip;
12
12
  private postFirstFlip;
13
13
  constructor(postFlip: PostFlip, postFirstFlip: PostFirstFlip);
14
- private useItemFlip;
14
+ private postUseItemFlip;
15
15
  }
16
16
  //# sourceMappingURL=FlipDetection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlipDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/FlipDetection.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,qBAAa,aAAc,SAAQ,OAAO;IACxB,CAAC;;YANf,2FAA2F;;;MAMvE;IAEtB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,aAAa,CAAgB;gBAEzB,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa;IAc5D,OAAO,CAAC,WAAW,CA2BjB;CACH"}
1
+ {"version":3,"file":"FlipDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/FlipDetection.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,qBAAa,aAAc,SAAQ,OAAO;IACxB,CAAC;;YANf,2FAA2F;;;MAMvE;IAEtB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,aAAa,CAAgB;gBAEzB,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa;IAc5D,OAAO,CAAC,eAAe,CA2BrB;CACH"}
@@ -37,7 +37,7 @@ __TS__ClassExtends(FlipDetection, Feature)
37
37
  function FlipDetection.prototype.____constructor(self, postFlip, postFirstFlip)
38
38
  Feature.prototype.____constructor(self)
39
39
  self.v = v
40
- self.useItemFlip = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
40
+ self.postUseItemFlip = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
41
41
  if not isTaintedLazarus(nil, player) then
42
42
  return nil
43
43
  end
@@ -52,7 +52,7 @@ function FlipDetection.prototype.____constructor(self, postFlip, postFirstFlip)
52
52
  self.postFlip:fire(newLazarus, player)
53
53
  return nil
54
54
  end
55
- self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.useItemFlip, {CollectibleType.FLIP}}}
55
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItemFlip, {CollectibleType.FLIP}}}
56
56
  self.postFlip = postFlip
57
57
  self.postFirstFlip = postFirstFlip
58
58
  end
@@ -25,7 +25,7 @@ export declare class GameReorderedCallbacks extends Feature {
25
25
  private postNewLevelReordered;
26
26
  private postNewRoomReordered;
27
27
  private postGameStartedReorderedLast;
28
- private useItemGlowingHourGlass;
28
+ private postUseItemGlowingHourGlass;
29
29
  private postGameStarted;
30
30
  private postNewLevel;
31
31
  private postNewRoom;
@@ -1 +1 @@
1
- {"version":3,"file":"GameReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/GameReorderedCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,wBAAwB,CAA2B;IAC3D,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,4BAA4B,CAA+B;IAwCnE,OAAO,CAAC,uBAAuB,CAM7B;IAGF,OAAO,CAAC,eAAe,CAYrB;IAGF,OAAO,CAAC,YAAY,CAiBlB;IAGF,OAAO,CAAC,WAAW,CAiCjB;IAEF,OAAO,CAAC,kBAAkB;IAS1B;;;;;;;;;;;;OAYG;IAEI,qBAAqB,IAAI,IAAI;IAIpC;;;;;;;;;;;;OAYG;IAEI,oBAAoB,IAAI,IAAI;IAInC;;;;;;;;;OASG;IAEI,0BAA0B,CAC/B,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,IAAI;CAIR"}
1
+ {"version":3,"file":"GameReorderedCallbacks.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/GameReorderedCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,wBAAwB,CAA2B;IAC3D,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,4BAA4B,CAA+B;IAwCnE,OAAO,CAAC,2BAA2B,CAMjC;IAGF,OAAO,CAAC,eAAe,CAYrB;IAGF,OAAO,CAAC,YAAY,CAiBlB;IAGF,OAAO,CAAC,WAAW,CAiCjB;IAEF,OAAO,CAAC,kBAAkB;IAS1B;;;;;;;;;;;;OAYG;IAEI,qBAAqB,IAAI,IAAI;IAIpC;;;;;;;;;;;;OAYG;IAEI,oBAAoB,IAAI,IAAI;IAInC;;;;;;;;;OASG;IAEI,0BAA0B,CAC/B,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,IAAI;CAIR"}
@@ -36,7 +36,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
36
36
  self.usedGlowingHourGlass = false
37
37
  self.forceNewLevel = false
38
38
  self.forceNewRoom = false
39
- self.useItemGlowingHourGlass = function()
39
+ self.postUseItemGlowingHourGlass = function()
40
40
  self.usedGlowingHourGlass = true
41
41
  return nil
42
42
  end
@@ -89,7 +89,7 @@ function GameReorderedCallbacks.prototype.____constructor(self, postGameStartedR
89
89
  self.forceNewRoom = false
90
90
  self.postNewRoomReordered:fire(roomType)
91
91
  end
92
- self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.useItemGlowingHourGlass, {CollectibleType.GLOWING_HOUR_GLASS}}, {ModCallback.POST_GAME_STARTED, self.postGameStarted}, {ModCallback.POST_NEW_LEVEL, self.postNewLevel}, {ModCallback.POST_NEW_ROOM, self.postNewRoom}}
92
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItemGlowingHourGlass, {CollectibleType.GLOWING_HOUR_GLASS}}, {ModCallback.POST_GAME_STARTED, self.postGameStarted}, {ModCallback.POST_NEW_LEVEL, self.postNewLevel}, {ModCallback.POST_NEW_ROOM, self.postNewRoom}}
93
93
  self.postGameStartedReordered = postGameStartedReordered
94
94
  self.postNewLevelReordered = postNewLevelReordered
95
95
  self.postNewRoomReordered = postNewRoomReordered
@@ -32,7 +32,7 @@ export declare class PlayerCollectibleDetection extends Feature {
32
32
  * rerolled.
33
33
  */
34
34
  private updateCollectibleMapAndFire;
35
- private useItemD4;
35
+ private postUseItemD4;
36
36
  /** We need to handle the case of Tainted Eden taking damage. */
37
37
  private entityTakeDmgPlayer;
38
38
  /**
@@ -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,EAKhB,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;AAgBrD,qBAAa,0BAA2B,SAAQ,OAAO;IACrC,CAAC;;;;;;MAAK;IAEtB,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;IA6B5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,2BAA2B;IA0CnC,OAAO,CAAC,SAAS,CAqBf;IAEF,gEAAgE;IAEhE,OAAO,CAAC,mBAAmB,CA2BzB;IAEF;;;OAGG;IAEH,OAAO,CAAC,cAAc,CAepB;IAGF,OAAO,CAAC,0BAA0B,CAiBhC;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,uBAAuB;CA+BhC"}
1
+ {"version":3,"file":"PlayerCollectibleDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/PlayerCollectibleDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAKhB,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;AAgBrD,qBAAa,0BAA2B,SAAQ,OAAO;IACrC,CAAC;;;;;;MAAK;IAEtB,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;IA6B5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,2BAA2B;IA0CnC,OAAO,CAAC,aAAa,CAqBnB;IAEF,gEAAgE;IAEhE,OAAO,CAAC,mBAAmB,CA2BzB;IAEF;;;OAGG;IAEH,OAAO,CAAC,cAAc,CAepB;IAGF,OAAO,CAAC,0BAA0B,CAiBhC;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,uBAAuB;CA+BhC"}
@@ -56,7 +56,7 @@ __TS__ClassExtends(PlayerCollectibleDetection, Feature)
56
56
  function PlayerCollectibleDetection.prototype.____constructor(self, postPlayerCollectibleAdded, postPlayerCollectibleRemoved, moddedElementSets, runInNFrames)
57
57
  Feature.prototype.____constructor(self)
58
58
  self.v = v
59
- self.useItemD4 = function(____, _collectibleType, _rng, player)
59
+ self.postUseItemD4 = function(____, _collectibleType, _rng, player)
60
60
  self:updateCollectibleMapAndFire(player, nil)
61
61
  return nil
62
62
  end
@@ -99,7 +99,7 @@ function PlayerCollectibleDetection.prototype.____constructor(self, postPlayerCo
99
99
  end
100
100
  end
101
101
  self.featuresUsed = {ISCFeature.MODDED_ELEMENT_SETS, ISCFeature.RUN_IN_N_FRAMES}
102
- self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.useItemD4, {CollectibleType.D4}}}
102
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItemD4, {CollectibleType.D4}}}
103
103
  self.customCallbacksUsed = {{ModCallbackCustom.ENTITY_TAKE_DMG_PLAYER, self.entityTakeDmgPlayer}, {ModCallbackCustom.POST_ITEM_PICKUP, self.postItemPickup}, {ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}}
104
104
  self.postPlayerCollectibleAdded = postPlayerCollectibleAdded
105
105
  self.postPlayerCollectibleRemoved = postPlayerCollectibleRemoved
@@ -2,11 +2,13 @@ import { CollectibleType } from "isaac-typescript-definitions";
2
2
  import { Feature } from "../../private/Feature";
3
3
  export declare class PreventCollectibleRotation extends Feature {
4
4
  private pickupIndexCreation;
5
+ private preUseItem;
5
6
  /**
6
7
  * Soul of Isaac causes items to flip. We assume that the player deliberately wants to roll a
7
8
  * quest item, so we delete all tracked items in the current room.
8
9
  */
9
- private useCardSoulOfIsaac;
10
+ private postUseCardSoulOfIsaac;
11
+ private postDiceRoomActivated;
10
12
  private postPickupChanged;
11
13
  /**
12
14
  * Helper function to prevent a collectible from being affected by Tainted Isaac's rotation
@@ -1 +1 @@
1
- {"version":3,"file":"PreventCollectibleRotation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PreventCollectibleRotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,qBAAa,0BAA2B,SAAQ,OAAO;IAIrD,OAAO,CAAC,mBAAmB,CAAsB;IAwBjD;;;OAGG;IAGH,OAAO,CAAC,kBAAkB,CAMxB;IAGF,OAAO,CAAC,iBAAiB,CA8BvB;IAEF;;;;;;;;;;;OAWG;IAEI,0BAA0B,CAC/B,WAAW,EAAE,YAAY,EACzB,eAAe,EAAE,eAAe,GAC/B,IAAI;CAiBR"}
1
+ {"version":3,"file":"PreventCollectibleRotation.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PreventCollectibleRotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAYtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAuBhD,qBAAa,0BAA2B,SAAQ,OAAO;IAIrD,OAAO,CAAC,mBAAmB,CAAsB;IA4BjD,OAAO,CAAC,UAAU,CAQhB;IAEF;;;OAGG;IAGH,OAAO,CAAC,sBAAsB,CAM5B;IAGF,OAAO,CAAC,qBAAqB,CAO3B;IAGF,OAAO,CAAC,iBAAiB,CAoCvB;IAEF;;;;;;;;;;;OAWG;IAEI,0BAA0B,CAC/B,WAAW,EAAE,YAAY,EACzB,eAAe,EAAE,eAAe,GAC/B,IAAI;CAiBR"}
@@ -1,15 +1,19 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local Map = ____lualib.Map
3
2
  local __TS__New = ____lualib.__TS__New
3
+ local Map = ____lualib.Map
4
4
  local __TS__Class = ____lualib.__TS__Class
5
5
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
6
6
  local __TS__Decorate = ____lualib.__TS__Decorate
7
7
  local ____exports = {}
8
+ local markRollFrame, v
8
9
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
10
  local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
10
11
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
12
+ local DiceFloorSubType = ____isaac_2Dtypescript_2Ddefinitions.DiceFloorSubType
11
13
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
12
14
  local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
15
+ local ____cachedClasses = require("src.core.cachedClasses")
16
+ local game = ____cachedClasses.game
13
17
  local ____decorators = require("src.decorators")
14
18
  local Exported = ____decorators.Exported
15
19
  local ____ISCFeature = require("src.enums.ISCFeature")
@@ -26,9 +30,19 @@ local ____pickupVariants = require("src.functions.pickupVariants")
26
30
  local isCollectible = ____pickupVariants.isCollectible
27
31
  local ____types = require("src.functions.types")
28
32
  local asCollectibleType = ____types.asCollectibleType
33
+ local ____ReadonlySet = require("src.types.ReadonlySet")
34
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
29
35
  local ____Feature = require("src.classes.private.Feature")
30
36
  local Feature = ____Feature.Feature
31
- local v = {run = {trackedCollectibles = __TS__New(Map)}}
37
+ function markRollFrame(self)
38
+ v.run.rollGameFrame = game:GetFrameCount()
39
+ end
40
+ local ROLL_COLLECTIBLE_TYPES = __TS__New(ReadonlySet, {CollectibleType.D6, CollectibleType.ETERNAL_D6, CollectibleType.SPINDOWN_DICE})
41
+ local ROLL_FLOOR_DICE_FLOOR_SUB_TYPES = __TS__New(ReadonlySet, {DiceFloorSubType.FOUR_PIP, DiceFloorSubType.SIX_PIP})
42
+ v = {run = {
43
+ trackedCollectibles = __TS__New(Map),
44
+ rollGameFrame = nil
45
+ }}
32
46
  ____exports.PreventCollectibleRotation = __TS__Class()
33
47
  local PreventCollectibleRotation = ____exports.PreventCollectibleRotation
34
48
  PreventCollectibleRotation.name = "PreventCollectibleRotation"
@@ -36,13 +50,24 @@ __TS__ClassExtends(PreventCollectibleRotation, Feature)
36
50
  function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexCreation)
37
51
  Feature.prototype.____constructor(self)
38
52
  self.v = v
39
- self.useCardSoulOfIsaac = function()
53
+ self.preUseItem = function(____, collectibleType)
54
+ if ROLL_COLLECTIBLE_TYPES:has(collectibleType) then
55
+ markRollFrame(nil)
56
+ end
57
+ return nil
58
+ end
59
+ self.postUseCardSoulOfIsaac = function()
40
60
  local collectibles = getCollectibles(nil)
41
61
  for ____, collectible in ipairs(collectibles) do
42
62
  local pickupIndex = self.pickupIndexCreation:getPickupIndex(collectible)
43
63
  v.run.trackedCollectibles:delete(pickupIndex)
44
64
  end
45
65
  end
66
+ self.postDiceRoomActivated = function(____, _player, diceFloorSubType)
67
+ if ROLL_FLOOR_DICE_FLOOR_SUB_TYPES:has(diceFloorSubType) then
68
+ v.run.trackedCollectibles:clear()
69
+ end
70
+ end
46
71
  self.postPickupChanged = function(____, pickup, oldVariant, _oldSubType, newVariant, newSubType)
47
72
  if oldVariant ~= PickupVariant.COLLECTIBLE or newVariant ~= PickupVariant.COLLECTIBLE then
48
73
  return
@@ -55,13 +80,18 @@ function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexC
55
80
  if trackedCollectibleType == nil then
56
81
  return
57
82
  end
83
+ local gameFrameCount = game:GetFrameCount()
84
+ if gameFrameCount == v.run.rollGameFrame then
85
+ v.run.trackedCollectibles:delete(pickupIndex)
86
+ return
87
+ end
58
88
  if trackedCollectibleType ~= asCollectibleType(nil, newSubType) then
59
89
  setCollectibleSubType(nil, pickup, trackedCollectibleType)
60
90
  end
61
91
  end
62
92
  self.featuresUsed = {ISCFeature.PICKUP_INDEX_CREATION}
63
- self.callbacksUsed = {{ModCallback.POST_USE_CARD, self.useCardSoulOfIsaac, {CardType.SOUL_ISAAC}}}
64
- self.customCallbacksUsed = {{ModCallbackCustom.POST_PICKUP_CHANGED, self.postPickupChanged}}
93
+ self.callbacksUsed = {{ModCallback.POST_USE_CARD, self.postUseCardSoulOfIsaac, {CardType.SOUL_ISAAC}}, {ModCallback.PRE_USE_ITEM, self.preUseItem}}
94
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_DICE_ROOM_ACTIVATED, self.postDiceRoomActivated}, {ModCallbackCustom.POST_PICKUP_CHANGED, self.postPickupChanged}}
65
95
  self.pickupIndexCreation = pickupIndexCreation
66
96
  end
67
97
  function PreventCollectibleRotation.prototype.preventCollectibleRotation(self, collectible, collectibleType)
@@ -103,6 +103,8 @@ export declare function repeat(n: int, func: (i: int) => void): void;
103
103
  * useful as a means to prevent unused variables.)
104
104
  *
105
105
  * This function does not actually do anything. (It is an "empty" function.)
106
+ *
107
+ * @allowEmptyVariadic
106
108
  */
107
109
  export declare function todo(...args: unknown[]): void;
108
110
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":";AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAWlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAQR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAOlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAMvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAetC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAI3D;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAG"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":";AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAWlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAQR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,GAAG,EAAE,CAOlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAMvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAI5C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAetC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAI3D;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAG"}
@@ -163,6 +163,8 @@ end
163
163
  -- useful as a means to prevent unused variables.)
164
164
  --
165
165
  -- This function does not actually do anything. (It is an "empty" function.)
166
+ --
167
+ -- @allowEmptyVariadic
166
168
  function ____exports.todo(self, ...)
167
169
  end
168
170
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "29.5.1",
3
+ "version": "29.5.2",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -34,7 +34,7 @@ export class EsauJrDetection extends Feature {
34
34
  // 3
35
35
  [
36
36
  ModCallback.POST_USE_ITEM,
37
- this.useItemEsauJr,
37
+ this.postUseItemEsauJr,
38
38
  [CollectibleType.ESAU_JR],
39
39
  ],
40
40
  ];
@@ -81,7 +81,7 @@ export class EsauJrDetection extends Feature {
81
81
 
82
82
  // ModCallback.POST_USE_ITEM (3)
83
83
  // CollectibleType.ESAU_JR (703)
84
- private useItemEsauJr = (
84
+ private postUseItemEsauJr = (
85
85
  _collectibleType: CollectibleType,
86
86
  _rng: RNG,
87
87
  player: EntityPlayer,
@@ -27,7 +27,7 @@ export class FlipDetection extends Feature {
27
27
 
28
28
  this.callbacksUsed = [
29
29
  // 3
30
- [ModCallback.POST_USE_ITEM, this.useItemFlip, [CollectibleType.FLIP]],
30
+ [ModCallback.POST_USE_ITEM, this.postUseItemFlip, [CollectibleType.FLIP]],
31
31
  ];
32
32
 
33
33
  this.postFlip = postFlip;
@@ -36,7 +36,7 @@ export class FlipDetection extends Feature {
36
36
 
37
37
  // ModCallback.POST_USE_ITEM (3)
38
38
  // CollectibleType.FLIP (711)
39
- private useItemFlip = (
39
+ private postUseItemFlip = (
40
40
  _collectibleType: CollectibleType,
41
41
  _rng: RNG,
42
42
  player: EntityPlayer,
@@ -52,7 +52,7 @@ export class GameReorderedCallbacks extends Feature {
52
52
  // 3
53
53
  [
54
54
  ModCallback.POST_USE_ITEM,
55
- this.useItemGlowingHourGlass,
55
+ this.postUseItemGlowingHourGlass,
56
56
  [CollectibleType.GLOWING_HOUR_GLASS],
57
57
  ],
58
58
 
@@ -77,7 +77,7 @@ export class GameReorderedCallbacks extends Feature {
77
77
 
78
78
  // ModCallback.POST_USE_ITEM (3)
79
79
  // CollectibleType.GLOWING_HOUR_GLASS (422)
80
- private useItemGlowingHourGlass = (): boolean | undefined => {
80
+ private postUseItemGlowingHourGlass = (): boolean | undefined => {
81
81
  // If Glowing Hourglass is used on the first room of a floor, it will send the player to the
82
82
  // previous floor without triggering the `POST_NEW_LEVEL` callback. Manually check for this.
83
83
  this.usedGlowingHourGlass = true;
@@ -63,7 +63,7 @@ export class PlayerCollectibleDetection extends Feature {
63
63
 
64
64
  this.callbacksUsed = [
65
65
  // 3
66
- [ModCallback.POST_USE_ITEM, this.useItemD4, [CollectibleType.D4]],
66
+ [ModCallback.POST_USE_ITEM, this.postUseItemD4, [CollectibleType.D4]],
67
67
  ];
68
68
 
69
69
  this.customCallbacksUsed = [
@@ -135,7 +135,7 @@ export class PlayerCollectibleDetection extends Feature {
135
135
 
136
136
  // ModCallback.POST_USE_ITEM (3)
137
137
  // CollectibleType.D4 (284)
138
- private useItemD4 = (
138
+ private postUseItemD4 = (
139
139
  _collectibleType: CollectibleType,
140
140
  _rng: RNG,
141
141
  player: EntityPlayer,
@@ -1,9 +1,11 @@
1
1
  import {
2
2
  CardType,
3
3
  CollectibleType,
4
+ DiceFloorSubType,
4
5
  ModCallback,
5
6
  PickupVariant,
6
7
  } from "isaac-typescript-definitions";
8
+ import { game } from "../../../core/cachedClasses";
7
9
  import { Exported } from "../../../decorators";
8
10
  import { ISCFeature } from "../../../enums/ISCFeature";
9
11
  import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
@@ -13,12 +15,27 @@ import { getCollectibles } from "../../../functions/pickupsSpecific";
13
15
  import { isCollectible } from "../../../functions/pickupVariants";
14
16
  import { asCollectibleType } from "../../../functions/types";
15
17
  import { PickupIndex } from "../../../types/PickupIndex";
18
+ import { ReadonlySet } from "../../../types/ReadonlySet";
16
19
  import { Feature } from "../../private/Feature";
17
20
  import { PickupIndexCreation } from "./PickupIndexCreation";
18
21
 
22
+ const ROLL_COLLECTIBLE_TYPES = new ReadonlySet([
23
+ // The `PRE_USE_ITEM` D6 callback is fired for D6, D100, Dice Shard, 4-pip Dice Room, and 6-pip
24
+ // Dice Room.
25
+ CollectibleType.D6, // 105
26
+ CollectibleType.ETERNAL_D6, // 609
27
+ CollectibleType.SPINDOWN_DICE, // 723
28
+ ]);
29
+
30
+ const ROLL_FLOOR_DICE_FLOOR_SUB_TYPES = new ReadonlySet([
31
+ DiceFloorSubType.FOUR_PIP,
32
+ DiceFloorSubType.SIX_PIP,
33
+ ]);
34
+
19
35
  const v = {
20
36
  run: {
21
37
  trackedCollectibles: new Map<PickupIndex, CollectibleType>(),
38
+ rollGameFrame: null as int | null,
22
39
  },
23
40
  };
24
41
 
@@ -38,25 +55,39 @@ export class PreventCollectibleRotation extends Feature {
38
55
  // 5
39
56
  [
40
57
  ModCallback.POST_USE_CARD,
41
- this.useCardSoulOfIsaac,
58
+ this.postUseCardSoulOfIsaac,
42
59
  [CardType.SOUL_ISAAC],
43
60
  ],
61
+
62
+ // 23, 105
63
+ [ModCallback.PRE_USE_ITEM, this.preUseItem],
44
64
  ];
45
65
 
46
66
  this.customCallbacksUsed = [
67
+ [ModCallbackCustom.POST_DICE_ROOM_ACTIVATED, this.postDiceRoomActivated],
47
68
  [ModCallbackCustom.POST_PICKUP_CHANGED, this.postPickupChanged],
48
69
  ];
49
70
 
50
71
  this.pickupIndexCreation = pickupIndexCreation;
51
72
  }
52
73
 
74
+ private preUseItem = (
75
+ collectibleType: CollectibleType,
76
+ ): boolean | undefined => {
77
+ if (ROLL_COLLECTIBLE_TYPES.has(collectibleType)) {
78
+ markRollFrame();
79
+ }
80
+
81
+ return undefined;
82
+ };
83
+
53
84
  /**
54
85
  * Soul of Isaac causes items to flip. We assume that the player deliberately wants to roll a
55
86
  * quest item, so we delete all tracked items in the current room.
56
87
  */
57
88
  // ModCallback.POST_USE_CARD (5)
58
89
  // Card.SOUL_ISAAC (81)
59
- private useCardSoulOfIsaac = () => {
90
+ private postUseCardSoulOfIsaac = () => {
60
91
  const collectibles = getCollectibles();
61
92
  for (const collectible of collectibles) {
62
93
  const pickupIndex = this.pickupIndexCreation.getPickupIndex(collectible);
@@ -64,6 +95,16 @@ export class PreventCollectibleRotation extends Feature {
64
95
  }
65
96
  };
66
97
 
98
+ // ModCallbackCustom.POST_DICE_ROOM_ACTIVATED
99
+ private postDiceRoomActivated = (
100
+ _player: EntityPlayer,
101
+ diceFloorSubType: DiceFloorSubType,
102
+ ) => {
103
+ if (ROLL_FLOOR_DICE_FLOOR_SUB_TYPES.has(diceFloorSubType)) {
104
+ v.run.trackedCollectibles.clear();
105
+ }
106
+ };
107
+
67
108
  // ModCallbackCustom.POST_PICKUP_CHANGED
68
109
  private postPickupChanged = (
69
110
  pickup: EntityPickup,
@@ -91,6 +132,12 @@ export class PreventCollectibleRotation extends Feature {
91
132
  return;
92
133
  }
93
134
 
135
+ const gameFrameCount = game.GetFrameCount();
136
+ if (gameFrameCount === v.run.rollGameFrame) {
137
+ v.run.trackedCollectibles.delete(pickupIndex);
138
+ return;
139
+ }
140
+
94
141
  if (trackedCollectibleType !== asCollectibleType(newSubType)) {
95
142
  // This collectible has rotated, so restore it back to the way it was.
96
143
  setCollectibleSubType(pickup, trackedCollectibleType);
@@ -131,3 +178,7 @@ export class PreventCollectibleRotation extends Feature {
131
178
  }
132
179
  }
133
180
  }
181
+
182
+ function markRollFrame() {
183
+ v.run.rollGameFrame = game.GetFrameCount();
184
+ }
@@ -176,6 +176,8 @@ export function repeat(n: int, func: (i: int) => void): void {
176
176
  * useful as a means to prevent unused variables.)
177
177
  *
178
178
  * This function does not actually do anything. (It is an "empty" function.)
179
+ *
180
+ * @allowEmptyVariadic
179
181
  */
180
182
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
181
183
  export function todo(...args: unknown[]): void {}