isaacscript-common 21.6.4 → 21.6.5

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.
@@ -1864,7 +1864,7 @@ declare class CustomRevive extends Feature {
1864
1864
  private runInNFrames;
1865
1865
  constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive, runInNFrames: RunInNFrames);
1866
1866
  private postRender;
1867
- private postFamiliarInit;
1867
+ private postFamiliarInitOneUp;
1868
1868
  private postNewRoomReordered;
1869
1869
  private postPEffectUpdateReordered;
1870
1870
  private checkWaitingForItemAnimation;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 21.6.4
3
+ isaacscript-common 21.6.5
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -30162,6 +30162,9 @@ function PostPlayerFatalDamage.prototype.____constructor(self)
30162
30162
  if not inBossRoomOf(nil, BossID.SATAN) then
30163
30163
  return nil
30164
30164
  end
30165
+ if willPlayerRevive(nil, player) then
30166
+ return nil
30167
+ end
30165
30168
  local shouldSustainDeath = self:fire(
30166
30169
  player,
30167
30170
  0,
@@ -32691,13 +32694,11 @@ function CustomRevive.prototype.____constructor(self, preCustomRevive, postCusto
32691
32694
  end
32692
32695
  sfxManager:Stop(SoundEffect.ONE_UP)
32693
32696
  end
32694
- self.postFamiliarInit = function(____, familiar)
32697
+ self.postFamiliarInitOneUp = function(____, familiar)
32695
32698
  if self.v.run.state ~= CustomReviveState.WAITING_FOR_ROOM_TRANSITION then
32696
32699
  return
32697
32700
  end
32698
- if familiar.Variant == FamiliarVariant.ONE_UP then
32699
- familiar:Remove()
32700
- end
32701
+ familiar:Remove()
32701
32702
  end
32702
32703
  self.postNewRoomReordered = function()
32703
32704
  if self.v.run.state ~= CustomReviveState.WAITING_FOR_ROOM_TRANSITION then
@@ -32717,7 +32718,7 @@ function CustomRevive.prototype.____constructor(self, preCustomRevive, postCusto
32717
32718
  self:playerIsAboutToDie(player)
32718
32719
  end
32719
32720
  self.featuresUsed = {ISCFeature.RUN_IN_N_FRAMES}
32720
- self.callbacksUsed = {{ModCallback.POST_RENDER, self.postRender}, {ModCallback.POST_FAMILIAR_INIT, self.postFamiliarInit}}
32721
+ self.callbacksUsed = {{ModCallback.POST_RENDER, self.postRender}, {ModCallback.POST_FAMILIAR_INIT, self.postFamiliarInitOneUp, {FamiliarVariant.ONE_UP}}}
32721
32722
  self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, self.postNewRoomReordered}, {ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}, {ModCallbackCustom.POST_PLAYER_FATAL_DAMAGE, self.postPlayerFatalDamage}, {ModCallbackCustom.PRE_BERSERK_DEATH, self.preBerserkDeath}}
32722
32723
  self.preCustomRevive = preCustomRevive
32723
32724
  self.postCustomRevive = postCustomRevive
@@ -11,6 +11,10 @@ export declare class PostPlayerFatalDamage extends CustomCallback<ModCallbackCus
11
11
  };
12
12
  constructor();
13
13
  protected shouldFire: typeof shouldFirePlayer;
14
+ /**
15
+ * Using The Bible on Satan is one of the few ways to die without taking damage, so we need to
16
+ * handle this case.
17
+ */
14
18
  private preUseItemBible;
15
19
  private entityTakeDmgPlayer;
16
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PostPlayerFatalDamage.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPlayerFatalDamage.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;YAEb,oEAAoE;;;MAGtE;;IAeF,UAAmB,UAAU,0BAAoB;IAIjD,OAAO,CAAC,eAAe,CA4BrB;IAGF,OAAO,CAAC,mBAAmB,CAyCzB;CACH"}
1
+ {"version":3,"file":"PostPlayerFatalDamage.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPlayerFatalDamage.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;YAEb,oEAAoE;;;MAGtE;;IAeF,UAAmB,UAAU,0BAAoB;IAEjD;;;OAGG;IAGH,OAAO,CAAC,eAAe,CA8BrB;IAGF,OAAO,CAAC,mBAAmB,CAyCzB;CACH"}
@@ -39,6 +39,9 @@ function PostPlayerFatalDamage.prototype.____constructor(self)
39
39
  if not inBossRoomOf(nil, BossID.SATAN) then
40
40
  return nil
41
41
  end
42
+ if willPlayerRevive(nil, player) then
43
+ return nil
44
+ end
42
45
  local shouldSustainDeath = self:fire(
43
46
  player,
44
47
  0,
@@ -25,7 +25,7 @@ export declare class CustomRevive extends Feature {
25
25
  private runInNFrames;
26
26
  constructor(preCustomRevive: PreCustomRevive, postCustomRevive: PostCustomRevive, runInNFrames: RunInNFrames);
27
27
  private postRender;
28
- private postFamiliarInit;
28
+ private postFamiliarInitOneUp;
29
29
  private postNewRoomReordered;
30
30
  private postPEffectUpdateReordered;
31
31
  private checkWaitingForItemAnimation;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomRevive.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/CustomRevive.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAA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K,iBAAiB;IACpB,QAAQ,IAAA;IAER;;;OAGG;IACH,2BAA2B,IAAA;IAE3B,0BAA0B,IAAA;CAC3B;AAED,qBAAa,YAAa,SAAQ,OAAO;IACvB,CAAC;;;;;;MAMf;IAEF,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAe;gBAGjC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY;IAkC5B,OAAO,CAAC,UAAU,CAQhB;IAIF,OAAO,CAAC,qBAAqB,CAM3B;IAGF,OAAO,CAAC,oBAAoB,CAO1B;IAGF,OAAO,CAAC,0BAA0B,CAEhC;IAEF,OAAO,CAAC,4BAA4B;IA6CpC,OAAO,CAAC,qBAAqB,CAK3B;IAGF,OAAO,CAAC,eAAe,CAErB;IAEF;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAmC1B,OAAO,CAAC,eAAe;CASxB"}
@@ -48,13 +48,11 @@ function CustomRevive.prototype.____constructor(self, preCustomRevive, postCusto
48
48
  end
49
49
  sfxManager:Stop(SoundEffect.ONE_UP)
50
50
  end
51
- self.postFamiliarInit = function(____, familiar)
51
+ self.postFamiliarInitOneUp = function(____, familiar)
52
52
  if self.v.run.state ~= CustomReviveState.WAITING_FOR_ROOM_TRANSITION then
53
53
  return
54
54
  end
55
- if familiar.Variant == FamiliarVariant.ONE_UP then
56
- familiar:Remove()
57
- end
55
+ familiar:Remove()
58
56
  end
59
57
  self.postNewRoomReordered = function()
60
58
  if self.v.run.state ~= CustomReviveState.WAITING_FOR_ROOM_TRANSITION then
@@ -74,7 +72,7 @@ function CustomRevive.prototype.____constructor(self, preCustomRevive, postCusto
74
72
  self:playerIsAboutToDie(player)
75
73
  end
76
74
  self.featuresUsed = {ISCFeature.RUN_IN_N_FRAMES}
77
- self.callbacksUsed = {{ModCallback.POST_RENDER, self.postRender}, {ModCallback.POST_FAMILIAR_INIT, self.postFamiliarInit}}
75
+ self.callbacksUsed = {{ModCallback.POST_RENDER, self.postRender}, {ModCallback.POST_FAMILIAR_INIT, self.postFamiliarInitOneUp, {FamiliarVariant.ONE_UP}}}
78
76
  self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, self.postNewRoomReordered}, {ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}, {ModCallbackCustom.POST_PLAYER_FATAL_DAMAGE, self.postPlayerFatalDamage}, {ModCallbackCustom.PRE_BERSERK_DEATH, self.preBerserkDeath}}
79
77
  self.preCustomRevive = preCustomRevive
80
78
  self.postCustomRevive = postCustomRevive
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "21.6.4",
3
+ "version": "21.6.5",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -46,6 +46,10 @@ export class PostPlayerFatalDamage extends CustomCallback<ModCallbackCustom.POST
46
46
 
47
47
  protected override shouldFire = shouldFirePlayer;
48
48
 
49
+ /**
50
+ * Using The Bible on Satan is one of the few ways to die without taking damage, so we need to
51
+ * handle this case.
52
+ */
49
53
  // ModCallback.PRE_USE_ITEM (23)
50
54
  // CollectibleType.BIBLE (33)
51
55
  private preUseItemBible = (
@@ -56,12 +60,14 @@ export class PostPlayerFatalDamage extends CustomCallback<ModCallbackCustom.POST
56
60
  _activeSlot: ActiveSlot,
57
61
  _customVarData: int,
58
62
  ): boolean | undefined => {
59
- // Using The Bible on Satan is one of the few ways to die without taking damage, so we need to
60
- // handle this case.
61
63
  if (!inBossRoomOf(BossID.SATAN)) {
62
64
  return undefined;
63
65
  }
64
66
 
67
+ if (willPlayerRevive(player)) {
68
+ return undefined;
69
+ }
70
+
65
71
  const shouldSustainDeath = this.fire(
66
72
  player,
67
73
  0,
@@ -63,7 +63,11 @@ export class CustomRevive extends Feature {
63
63
  [ModCallback.POST_RENDER, this.postRender],
64
64
 
65
65
  // 7
66
- [ModCallback.POST_FAMILIAR_INIT, this.postFamiliarInit],
66
+ [
67
+ ModCallback.POST_FAMILIAR_INIT,
68
+ this.postFamiliarInitOneUp,
69
+ [FamiliarVariant.ONE_UP],
70
+ ],
67
71
  ];
68
72
 
69
73
  this.customCallbacksUsed = [
@@ -93,14 +97,13 @@ export class CustomRevive extends Feature {
93
97
  };
94
98
 
95
99
  // ModCallback.POST_FAMILIAR_INIT (7)
96
- private postFamiliarInit = (familiar: EntityFamiliar): void => {
100
+ // FamiliarVariant.ONE_UP (41)
101
+ private postFamiliarInitOneUp = (familiar: EntityFamiliar): void => {
97
102
  if (this.v.run.state !== CustomReviveState.WAITING_FOR_ROOM_TRANSITION) {
98
103
  return;
99
104
  }
100
105
 
101
- if (familiar.Variant === FamiliarVariant.ONE_UP) {
102
- familiar.Remove();
103
- }
106
+ familiar.Remove();
104
107
  };
105
108
 
106
109
  // ModCallbackCustom.POST_NEW_ROOM_REORDERED