isaacscript-common 83.4.0 → 83.4.1

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 +1 @@
1
- {"version":3,"file":"PostPlayerFatalDamage.d.ts","sourceRoot":"","sources":["../../../src/classes/callbacks/PostPlayerFatalDamage.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;YANf,6DAA6D;;;MAMzC;;IAetB,UAAmB,UAAU,0BAAoB;IAEjD;;;OAGG;IAGH,OAAO,CAAC,QAAQ,CAAC,eAAe,CA8B9B;IAGF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAyClC;CACH"}
1
+ {"version":3,"file":"PostPlayerFatalDamage.d.ts","sourceRoot":"","sources":["../../../src/classes/callbacks/PostPlayerFatalDamage.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAYlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;YANf,6DAA6D;;;MAMzC;;IAetB,UAAmB,UAAU,0BAAoB;IAEjD;;;OAGG;IAGH,OAAO,CAAC,QAAQ,CAAC,eAAe,CA8B9B;IAGF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CA+ClC;CACH"}
@@ -7,12 +7,15 @@ local ____exports = {}
7
7
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
8
  local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
9
9
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
10
+ local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
10
11
  local DamageFlagZero = ____isaac_2Dtypescript_2Ddefinitions.DamageFlagZero
11
12
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
12
13
  local ____cachedClasses = require("core.cachedClasses")
13
14
  local game = ____cachedClasses.game
14
15
  local ____ModCallbackCustom = require("enums.ModCallbackCustom")
15
16
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
17
+ local ____flag = require("functions.flag")
18
+ local hasFlag = ____flag.hasFlag
16
19
  local ____playerDataStructures = require("functions.playerDataStructures")
17
20
  local mapGetPlayer = ____playerDataStructures.mapGetPlayer
18
21
  local mapSetPlayer = ____playerDataStructures.mapSetPlayer
@@ -62,6 +65,9 @@ function PostPlayerFatalDamage.prototype.____constructor(self)
62
65
  local gameFrameCount = game:GetFrameCount()
63
66
  local lastDamageGameFrame = mapGetPlayer(nil, v.run.playersLastDamageGameFrame, player)
64
67
  mapSetPlayer(nil, v.run.playersLastDamageGameFrame, player, gameFrameCount)
68
+ if hasFlag(nil, damageFlags, DamageFlag.NO_KILL) then
69
+ return nil
70
+ end
65
71
  if willPlayerRevive(nil, player) then
66
72
  return nil
67
73
  end
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 83.3.0
3
+ isaacscript-common 83.4.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -37042,12 +37042,15 @@ local ____exports = {}
37042
37042
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
37043
37043
  local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
37044
37044
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
37045
+ local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
37045
37046
  local DamageFlagZero = ____isaac_2Dtypescript_2Ddefinitions.DamageFlagZero
37046
37047
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
37047
37048
  local ____cachedClasses = require("core.cachedClasses")
37048
37049
  local game = ____cachedClasses.game
37049
37050
  local ____ModCallbackCustom = require("enums.ModCallbackCustom")
37050
37051
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
37052
+ local ____flag = require("functions.flag")
37053
+ local hasFlag = ____flag.hasFlag
37051
37054
  local ____playerDataStructures = require("functions.playerDataStructures")
37052
37055
  local mapGetPlayer = ____playerDataStructures.mapGetPlayer
37053
37056
  local mapSetPlayer = ____playerDataStructures.mapSetPlayer
@@ -37097,6 +37100,9 @@ function PostPlayerFatalDamage.prototype.____constructor(self)
37097
37100
  local gameFrameCount = game:GetFrameCount()
37098
37101
  local lastDamageGameFrame = mapGetPlayer(nil, v.run.playersLastDamageGameFrame, player)
37099
37102
  mapSetPlayer(nil, v.run.playersLastDamageGameFrame, player, gameFrameCount)
37103
+ if hasFlag(nil, damageFlags, DamageFlag.NO_KILL) then
37104
+ return nil
37105
+ end
37100
37106
  if willPlayerRevive(nil, player) then
37101
37107
  return nil
37102
37108
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "83.4.0",
3
+ "version": "83.4.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,16 +1,14 @@
1
- import type {
2
- ActiveSlot,
3
- DamageFlag,
4
- UseFlag,
5
- } from "isaac-typescript-definitions";
1
+ import type { ActiveSlot, UseFlag } from "isaac-typescript-definitions";
6
2
  import {
7
3
  BossID,
8
4
  CollectibleType,
5
+ DamageFlag,
9
6
  DamageFlagZero,
10
7
  ModCallback,
11
8
  } from "isaac-typescript-definitions";
12
9
  import { game } from "../../core/cachedClasses";
13
10
  import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
11
+ import { hasFlag } from "../../functions/flag";
14
12
  import {
15
13
  mapGetPlayer,
16
14
  mapSetPlayer,
@@ -109,6 +107,12 @@ export class PostPlayerFatalDamage extends CustomCallback<ModCallbackCustom.POST
109
107
  );
110
108
  mapSetPlayer(v.run.playersLastDamageGameFrame, player, gameFrameCount);
111
109
 
110
+ // If the damage has the damage flag of `DamageFlag.NO_KILL` (1 << 0), this will not be fatal
111
+ // damage. (This is present on things like the Bad Trip pill.)
112
+ if (hasFlag(damageFlags, DamageFlag.NO_KILL)) {
113
+ return undefined;
114
+ }
115
+
112
116
  // If the player has a revival item such as Dead Cat, this will not be fatal damage.
113
117
  if (willPlayerRevive(player)) {
114
118
  return undefined;