isaacscript-common 1.0.583 → 1.0.584

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.
@@ -1,12 +1,12 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local hasSubscriptions, postRender, postNewRoom, postPEffectUpdateReordered, postPlayerFatalDamage, CustomReviveState, v
3
+ local hasSubscriptions, postRender, postNewRoom, postPEffectUpdateReordered, postPEffectUpdateReorderedWaitingForBerserkToEnd, postPEffectUpdateReorderedWaitingForItemAnimation, postPlayerFatalDamage, CustomReviveState, v
4
4
  local ____exports = require("features.saveDataManager.exports")
5
5
  local saveDataManager = ____exports.saveDataManager
6
6
  local ____collectibles = require("functions.collectibles")
7
7
  local removeCollectibleFromItemTracker = ____collectibles.removeCollectibleFromItemTracker
8
8
  local ____entity = require("functions.entity")
9
- local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
9
+ local removeAllFamiliars = ____entity.removeAllFamiliars
10
10
  local ____player = require("functions.player")
11
11
  local getPlayerIndex = ____player.getPlayerIndex
12
12
  local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
@@ -37,6 +37,29 @@ function postNewRoom(self)
37
37
  end
38
38
  end
39
39
  function postPEffectUpdateReordered(self, player)
40
+ postPEffectUpdateReorderedWaitingForBerserkToEnd(nil, player)
41
+ postPEffectUpdateReorderedWaitingForItemAnimation(nil, player)
42
+ end
43
+ function postPEffectUpdateReorderedWaitingForBerserkToEnd(self, player)
44
+ if v.run.state ~= CustomReviveState.WAITING_FOR_BERSERK_TO_END then
45
+ return
46
+ end
47
+ if v.run.dyingPlayerIndex == nil then
48
+ return
49
+ end
50
+ local playerIndex = getPlayerIndex(nil, player)
51
+ local effects = player:GetEffects()
52
+ if playerIndex ~= v.run.dyingPlayerIndex then
53
+ return
54
+ end
55
+ removeAllFamiliars(nil, FamiliarVariant.ONE_UP)
56
+ local isBerserk = effects:HasCollectibleEffect(CollectibleType.COLLECTIBLE_BERSERK)
57
+ if isBerserk then
58
+ return
59
+ end
60
+ v.run.state = CustomReviveState.CHANGING_ROOMS
61
+ end
62
+ function postPEffectUpdateReorderedWaitingForItemAnimation(self, player)
40
63
  if v.run.state ~= CustomReviveState.WAITING_FOR_ITEM_ANIMATION then
41
64
  return
42
65
  end
@@ -73,19 +96,24 @@ function postPlayerFatalDamage(self, player)
73
96
  if revivalType == nil then
74
97
  return
75
98
  end
76
- v.run.state = CustomReviveState.CHANGING_ROOMS
99
+ local effects = player:GetEffects()
100
+ local isBerserk = effects:HasCollectibleEffect(CollectibleType.COLLECTIBLE_BERSERK)
101
+ local newState = isBerserk and CustomReviveState.WAITING_FOR_BERSERK_TO_END or CustomReviveState.CHANGING_ROOMS
102
+ v.run.state = newState
77
103
  v.run.revivalType = revivalType
78
104
  v.run.dyingPlayerIndex = getPlayerIndex(nil, player)
79
105
  player:AddCollectible(CollectibleType.COLLECTIBLE_1UP, 0, false)
80
- removeAllMatchingEntities(nil, EntityType.ENTITY_FAMILIAR, FamiliarVariant.ONE_UP)
106
+ removeAllFamiliars(nil, FamiliarVariant.ONE_UP)
81
107
  removeCollectibleFromItemTracker(nil, CollectibleType.COLLECTIBLE_1UP)
82
108
  end
83
109
  CustomReviveState = CustomReviveState or ({})
84
110
  CustomReviveState.DISABLED = 0
85
111
  CustomReviveState[CustomReviveState.DISABLED] = "DISABLED"
86
- CustomReviveState.CHANGING_ROOMS = 1
112
+ CustomReviveState.WAITING_FOR_BERSERK_TO_END = 1
113
+ CustomReviveState[CustomReviveState.WAITING_FOR_BERSERK_TO_END] = "WAITING_FOR_BERSERK_TO_END"
114
+ CustomReviveState.CHANGING_ROOMS = 2
87
115
  CustomReviveState[CustomReviveState.CHANGING_ROOMS] = "CHANGING_ROOMS"
88
- CustomReviveState.WAITING_FOR_ITEM_ANIMATION = 2
116
+ CustomReviveState.WAITING_FOR_ITEM_ANIMATION = 3
89
117
  CustomReviveState[CustomReviveState.WAITING_FOR_ITEM_ANIMATION] = "WAITING_FOR_ITEM_ANIMATION"
90
118
  v = {run = {state = CustomReviveState.DISABLED, revivalType = nil, dyingPlayerIndex = nil}}
91
119
  function ____exports.customReviveCallbacksInit(self, mod)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.583",
3
+ "version": "1.0.584",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",