isaacscript-common 75.1.0 → 75.2.0

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.
@@ -31,7 +31,15 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
31
31
  * is considered to starts with the D6, but this is not the case on a brand new save file).
32
32
  */
33
33
  export declare function characterStartsWithActiveItem(character: PlayerType): boolean;
34
- /** Helper function to get the numerical damage multiplier for a character. */
34
+ /**
35
+ * Helper function to get the numerical damage multiplier for a character.
36
+ *
37
+ * @param character The character to get.
38
+ * @param hasWhoreOfBabylon Optional. Whether the character has the Whore of Babylon effect
39
+ * currently active. Defaults to false. This is necessary because Eve's
40
+ * damage multiplier changes from 0.75 to 1 when she has Whore of Babylon
41
+ * active.
42
+ */
35
43
  export declare function getCharacterDamageMultiplier(character: PlayerType, hasWhoreOfBabylon?: boolean): float;
36
44
  /**
37
45
  * - Most characters have a 56 frame death animation (i.e. the "Death" animation).
@@ -1 +1 @@
1
- {"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAqB1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAg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B,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAG3E;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,UAAU,GACpB,SAAS,eAAe,EAAE,CAE5B;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,UAAU,GACpB,WAAW,GAAG,SAAS,CAEzB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE9D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEjE"}
@@ -73,6 +73,12 @@ function ____exports.characterStartsWithActiveItem(self, character)
73
73
  return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET:has(character)
74
74
  end
75
75
  --- Helper function to get the numerical damage multiplier for a character.
76
+ --
77
+ -- @param character The character to get.
78
+ -- @param hasWhoreOfBabylon Optional. Whether the character has the Whore of Babylon effect
79
+ -- currently active. Defaults to false. This is necessary because Eve's
80
+ -- damage multiplier changes from 0.75 to 1 when she has Whore of Babylon
81
+ -- active.
76
82
  function ____exports.getCharacterDamageMultiplier(self, character, hasWhoreOfBabylon)
77
83
  if hasWhoreOfBabylon == nil then
78
84
  hasWhoreOfBabylon = false
@@ -1 +1 @@
1
- {"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAId,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAuBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAE,EAChE,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAQtE;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,GAC7C,IAAI,CAEN;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,WAAW,G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AC,SAAS,SAAS,EAAE,CAAC,EACxD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,IAAI,CAgCN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAkBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,IAAI,CAqBN;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACvC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACpC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
@@ -49,10 +49,11 @@ local ____itemPool = require("functions.itemPool")
49
49
  local getItemPoolName = ____itemPool.getItemPoolName
50
50
  local ____log = require("functions.log")
51
51
  local log = ____log.log
52
+ local ____playerEffects = require("functions.playerEffects")
53
+ local getEffectsList = ____playerEffects.getEffectsList
52
54
  local ____playerHealth = require("functions.playerHealth")
53
55
  local getPlayerHealth = ____playerHealth.getPlayerHealth
54
56
  local ____players = require("functions.players")
55
- local getEffectsList = ____players.getEffectsList
56
57
  local getPlayerName = ____players.getPlayerName
57
58
  local ____roomData = require("functions.roomData")
58
59
  local getRoomData = ____roomData.getRoomData
@@ -0,0 +1,21 @@
1
+ import type { CollectibleType, NullItemID, TrinketType } from "isaac-typescript-definitions";
2
+ /** Helper function to check to see if any player has a temporary collectible effect. */
3
+ export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
4
+ /** Helper function to check to see if any player has a temporary null effect. */
5
+ export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
6
+ /** Helper function to check to see if any player has a temporary trinket effect. */
7
+ export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
8
+ /**
9
+ * Helper function to get an array of temporary effects for a player. This is helpful so that you
10
+ * don't have to manually create an array from an `EffectsList` object.
11
+ */
12
+ export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
13
+ /**
14
+ * Helper function to check if a player should have Whore of Babylon active at their current health
15
+ * level.
16
+ *
17
+ * - For most characters, Whore of Babylon activates when the red hearts are at 1/2 or less.
18
+ * - For Eve, Whore of Babylon activates when the red hearts are at 1 or less.
19
+ */
20
+ export declare function shouldWhoreOfBabylonBeActive(player: EntityPlayer): boolean;
21
+ //# sourceMappingURL=playerEffects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playerEffects.d.ts","sourceRoot":"","sources":["../../src/functions/playerEffects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAKtC,wFAAwF;AACxF,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,GAC/B,OAAO,CAOT;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAOtE;AAED,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAO3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,EAAE,CAatE;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E"}
@@ -0,0 +1,71 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
3
+ local ____exports = {}
4
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
+ local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
6
+ local ____playerIndex = require("functions.playerIndex")
7
+ local getAllPlayers = ____playerIndex.getAllPlayers
8
+ local ____players = require("functions.players")
9
+ local isCharacter = ____players.isCharacter
10
+ --- Helper function to check to see if any player has a temporary collectible effect.
11
+ function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
12
+ local players = getAllPlayers(nil)
13
+ return __TS__ArraySome(
14
+ players,
15
+ function(____, player)
16
+ local effects = player:GetEffects()
17
+ return effects:HasCollectibleEffect(collectibleType)
18
+ end
19
+ )
20
+ end
21
+ --- Helper function to check to see if any player has a temporary null effect.
22
+ function ____exports.anyPlayerHasNullEffect(self, nullItemID)
23
+ local players = getAllPlayers(nil)
24
+ return __TS__ArraySome(
25
+ players,
26
+ function(____, player)
27
+ local effects = player:GetEffects()
28
+ return effects:HasNullEffect(nullItemID)
29
+ end
30
+ )
31
+ end
32
+ --- Helper function to check to see if any player has a temporary trinket effect.
33
+ function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
34
+ local players = getAllPlayers(nil)
35
+ return __TS__ArraySome(
36
+ players,
37
+ function(____, player)
38
+ local effects = player:GetEffects()
39
+ return effects:HasTrinketEffect(trinketType)
40
+ end
41
+ )
42
+ end
43
+ --- Helper function to get an array of temporary effects for a player. This is helpful so that you
44
+ -- don't have to manually create an array from an `EffectsList` object.
45
+ function ____exports.getEffectsList(self, player)
46
+ local effects = player:GetEffects()
47
+ local effectsList = effects:GetEffectsList()
48
+ local effectArray = {}
49
+ do
50
+ local i = 0
51
+ while i < effectsList.Size do
52
+ local effect = effectsList:Get(i)
53
+ if effect ~= nil then
54
+ effectArray[#effectArray + 1] = effect
55
+ end
56
+ i = i + 1
57
+ end
58
+ end
59
+ return effectArray
60
+ end
61
+ --- Helper function to check if a player should have Whore of Babylon active at their current health
62
+ -- level.
63
+ --
64
+ -- - For most characters, Whore of Babylon activates when the red hearts are at 1/2 or less.
65
+ -- - For Eve, Whore of Babylon activates when the red hearts are at 1 or less.
66
+ function ____exports.shouldWhoreOfBabylonBeActive(self, player)
67
+ local redHearts = player:GetHearts()
68
+ local threshold = isCharacter(nil, player, PlayerType.EVE) and 2 or 1
69
+ return redHearts <= threshold
70
+ end
71
+ return ____exports
@@ -1,11 +1,4 @@
1
- import type { TrinketType } from "isaac-typescript-definitions";
2
- import { CollectibleType, ControllerIndex, NullItemID, PlayerForm, PlayerType } from "isaac-typescript-definitions";
3
- /** Helper function to check to see if any player has a temporary collectible effect. */
4
- export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
5
- /** Helper function to check to see if any player has a temporary null effect. */
6
- export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
7
- /** Helper function to check to see if any player has a temporary trinket effect. */
8
- export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
1
+ import { ControllerIndex, PlayerForm, PlayerType } from "isaac-typescript-definitions";
9
2
  /**
10
3
  * Helper function to check to see if any player is holding up an item (from e.g. an active item
11
4
  * activation, a poop from IBS, etc.).
@@ -35,6 +28,9 @@ export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
35
28
  * If the player does not have an item currently queued, then this function will be a no-op.
36
29
  *
37
30
  * Returns whether an item was actually dequeued.
31
+ *
32
+ * Under the hood, this clones the `QueuedItemData`, since directly setting the `Item` field to
33
+ * `undefined` does not work for some reason.
38
34
  */
39
35
  export declare function dequeueItem(player: EntityPlayer): boolean;
40
36
  /**
@@ -52,11 +48,6 @@ export declare function getCharacters(): PlayerType[];
52
48
  * Keeper).
53
49
  */
54
50
  export declare function getClosestPlayer(position: Vector): EntityPlayer;
55
- /**
56
- * Helper function to get an array of temporary effects for a player. This is helpful so that you
57
- * don't have to manually create an array from an `EffectsList` object.
58
- */
59
- export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
60
51
  /**
61
52
  * Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer`
62
53
  * method.
@@ -1 +1 @@
1
- {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAEL,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAatC,wFAAwF;AACxF,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,GAC/B,OAAO,CAOT;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAOtE;AAED,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAO3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAKxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAWzD;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,YAAY,GAAG,KAAK,GACvC,KAAK,CAMP;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,IAAI,UAAU,EAAE,CAG5C;AAED;;;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a,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG3D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAGtD;AAED,+EAA+E;AAC/E,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAGpD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE/D;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMvD;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAM9D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN"}
@@ -47,39 +47,6 @@ function ____exports.isVanillaPlayer(self, player)
47
47
  local character = player:GetPlayerType()
48
48
  return isVanillaCharacter(nil, character)
49
49
  end
50
- --- Helper function to check to see if any player has a temporary collectible effect.
51
- function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
52
- local players = getAllPlayers(nil)
53
- return __TS__ArraySome(
54
- players,
55
- function(____, player)
56
- local effects = player:GetEffects()
57
- return effects:HasCollectibleEffect(collectibleType)
58
- end
59
- )
60
- end
61
- --- Helper function to check to see if any player has a temporary null effect.
62
- function ____exports.anyPlayerHasNullEffect(self, nullItemID)
63
- local players = getAllPlayers(nil)
64
- return __TS__ArraySome(
65
- players,
66
- function(____, player)
67
- local effects = player:GetEffects()
68
- return effects:HasNullEffect(nullItemID)
69
- end
70
- )
71
- end
72
- --- Helper function to check to see if any player has a temporary trinket effect.
73
- function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
74
- local players = getAllPlayers(nil)
75
- return __TS__ArraySome(
76
- players,
77
- function(____, player)
78
- local effects = player:GetEffects()
79
- return effects:HasTrinketEffect(trinketType)
80
- end
81
- )
82
- end
83
50
  --- Helper function to check to see if any player is holding up an item (from e.g. an active item
84
51
  -- activation, a poop from IBS, etc.).
85
52
  function ____exports.anyPlayerHoldingItem(self)
@@ -119,6 +86,9 @@ end
119
86
  -- If the player does not have an item currently queued, then this function will be a no-op.
120
87
  --
121
88
  -- Returns whether an item was actually dequeued.
89
+ --
90
+ -- Under the hood, this clones the `QueuedItemData`, since directly setting the `Item` field to
91
+ -- `undefined` does not work for some reason.
122
92
  function ____exports.dequeueItem(self, player)
123
93
  if player.QueuedItem.Item == nil then
124
94
  return false
@@ -152,24 +122,6 @@ function ____exports.getClosestPlayer(self, position)
152
122
  assertDefined(nil, closestPlayer, "Failed to find the closest player.")
153
123
  return closestPlayer
154
124
  end
155
- --- Helper function to get an array of temporary effects for a player. This is helpful so that you
156
- -- don't have to manually create an array from an `EffectsList` object.
157
- function ____exports.getEffectsList(self, player)
158
- local effects = player:GetEffects()
159
- local effectsList = effects:GetEffectsList()
160
- local effectArray = {}
161
- do
162
- local i = 0
163
- while i < effectsList.Size do
164
- local effect = effectsList:Get(i)
165
- if effect ~= nil then
166
- effectArray[#effectArray + 1] = effect
167
- end
168
- i = i + 1
169
- end
170
- end
171
- return effectArray
172
- end
173
125
  --- Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer`
174
126
  -- method.
175
127
  function ____exports.getFinalPlayer(self)
@@ -373,6 +325,7 @@ function ____exports.isEden(self, player)
373
325
  local character = player:GetPlayerType()
374
326
  return character == PlayerType.EDEN or character == PlayerType.EDEN_B
375
327
  end
328
+ --- Not exported since end-users should use the `isTainted` helper function directly.
376
329
  local function isTaintedModded(self, player)
377
330
  local character = player:GetPlayerType()
378
331
  local name = player:GetName()
@@ -54,7 +54,6 @@ import type { MinibossID } from 'isaac-typescript-definitions';
54
54
  import { ModCallback } from 'isaac-typescript-definitions';
55
55
  import type { Music } from 'isaac-typescript-definitions';
56
56
  import type { NPCState } from 'isaac-typescript-definitions';
57
- import { NullItemID } from 'isaac-typescript-definitions';
58
57
  import { PickupPrice } from 'isaac-typescript-definitions';
59
58
  import { PickupVariant } from 'isaac-typescript-definitions';
60
59
  import { PillColor } from 'isaac-typescript-definitions';
@@ -1023,12 +1022,6 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
1023
1022
  */
1024
1023
  export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
1025
1024
 
1026
- /** Helper function to check to see if any player has a temporary collectible effect. */
1027
- export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
1028
-
1029
- /** Helper function to check to see if any player has a temporary null effect. */
1030
- export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
1031
-
1032
1025
  /**
1033
1026
  * Helper function to check to see if any player has a particular trinket.
1034
1027
  *
@@ -1038,9 +1031,6 @@ export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
1038
1031
  */
1039
1032
  export declare function anyPlayerHasTrinket(trinketType: TrinketType, ignoreModifiers?: boolean): boolean;
1040
1033
 
1041
- /** Helper function to check to see if any player has a temporary trinket effect. */
1042
- export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
1043
-
1044
1034
  /**
1045
1035
  * Helper function to check to see if any player is holding up an item (from e.g. an active item
1046
1036
  * activation, a poop from IBS, etc.).
@@ -3637,6 +3627,9 @@ declare class DeployJSONRoom extends Feature {
3637
3627
  * If the player does not have an item currently queued, then this function will be a no-op.
3638
3628
  *
3639
3629
  * Returns whether an item was actually dequeued.
3630
+ *
3631
+ * Under the hood, this clones the `QueuedItemData`, since directly setting the `Item` field to
3632
+ * `undefined` does not work for some reason.
3640
3633
  */
3641
3634
  export declare function dequeueItem(player: EntityPlayer): boolean;
3642
3635
 
@@ -5097,7 +5090,15 @@ export declare function getChallengeName(challenge: Challenge): string;
5097
5090
  */
5098
5091
  export declare function getChallengeTrinketType(challenge: Challenge): TrinketType | undefined;
5099
5092
 
5100
- /** Helper function to get the numerical damage multiplier for a character. */
5093
+ /**
5094
+ * Helper function to get the numerical damage multiplier for a character.
5095
+ *
5096
+ * @param character The character to get.
5097
+ * @param hasWhoreOfBabylon Optional. Whether the character has the Whore of Babylon effect
5098
+ * currently active. Defaults to false. This is necessary because Eve's
5099
+ * damage multiplier changes from 0.75 to 1 when she has Whore of Babylon
5100
+ * active.
5101
+ */
5101
5102
  export declare function getCharacterDamageMultiplier(character: PlayerType, hasWhoreOfBabylon?: boolean): float;
5102
5103
 
5103
5104
  /**
@@ -5528,12 +5529,6 @@ export declare function getEffectiveStage(): LevelStage;
5528
5529
  */
5529
5530
  export declare function getEffects(effectVariant?: EffectVariant | -1, subType?: number): EntityEffect[];
5530
5531
 
5531
- /**
5532
- * Helper function to get an array of temporary effects for a player. This is helpful so that you
5533
- * don't have to manually create an array from an `EffectsList` object.
5534
- */
5535
- export declare function getEffectsList(player: EntityPlayer): TemporaryEffect[];
5536
-
5537
5532
  export declare function getElapsedGameFramesSince(gameFrameCount: int): int;
5538
5533
 
5539
5534
  export declare function getElapsedRenderFramesSince(renderFrameCount: int): int;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 75.0.0
3
+ isaacscript-common 75.1.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -21359,6 +21359,12 @@ function ____exports.characterStartsWithActiveItem(self, character)
21359
21359
  return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET:has(character)
21360
21360
  end
21361
21361
  --- Helper function to get the numerical damage multiplier for a character.
21362
+ --
21363
+ -- @param character The character to get.
21364
+ -- @param hasWhoreOfBabylon Optional. Whether the character has the Whore of Babylon effect
21365
+ -- currently active. Defaults to false. This is necessary because Eve's
21366
+ -- damage multiplier changes from 0.75 to 1 when she has Whore of Babylon
21367
+ -- active.
21362
21368
  function ____exports.getCharacterDamageMultiplier(self, character, hasWhoreOfBabylon)
21363
21369
  if hasWhoreOfBabylon == nil then
21364
21370
  hasWhoreOfBabylon = false
@@ -21487,39 +21493,6 @@ function ____exports.isVanillaPlayer(self, player)
21487
21493
  local character = player:GetPlayerType()
21488
21494
  return isVanillaCharacter(nil, character)
21489
21495
  end
21490
- --- Helper function to check to see if any player has a temporary collectible effect.
21491
- function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
21492
- local players = getAllPlayers(nil)
21493
- return __TS__ArraySome(
21494
- players,
21495
- function(____, player)
21496
- local effects = player:GetEffects()
21497
- return effects:HasCollectibleEffect(collectibleType)
21498
- end
21499
- )
21500
- end
21501
- --- Helper function to check to see if any player has a temporary null effect.
21502
- function ____exports.anyPlayerHasNullEffect(self, nullItemID)
21503
- local players = getAllPlayers(nil)
21504
- return __TS__ArraySome(
21505
- players,
21506
- function(____, player)
21507
- local effects = player:GetEffects()
21508
- return effects:HasNullEffect(nullItemID)
21509
- end
21510
- )
21511
- end
21512
- --- Helper function to check to see if any player has a temporary trinket effect.
21513
- function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
21514
- local players = getAllPlayers(nil)
21515
- return __TS__ArraySome(
21516
- players,
21517
- function(____, player)
21518
- local effects = player:GetEffects()
21519
- return effects:HasTrinketEffect(trinketType)
21520
- end
21521
- )
21522
- end
21523
21496
  --- Helper function to check to see if any player is holding up an item (from e.g. an active item
21524
21497
  -- activation, a poop from IBS, etc.).
21525
21498
  function ____exports.anyPlayerHoldingItem(self)
@@ -21559,6 +21532,9 @@ end
21559
21532
  -- If the player does not have an item currently queued, then this function will be a no-op.
21560
21533
  --
21561
21534
  -- Returns whether an item was actually dequeued.
21535
+ --
21536
+ -- Under the hood, this clones the `QueuedItemData`, since directly setting the `Item` field to
21537
+ -- `undefined` does not work for some reason.
21562
21538
  function ____exports.dequeueItem(self, player)
21563
21539
  if player.QueuedItem.Item == nil then
21564
21540
  return false
@@ -21592,24 +21568,6 @@ function ____exports.getClosestPlayer(self, position)
21592
21568
  assertDefined(nil, closestPlayer, "Failed to find the closest player.")
21593
21569
  return closestPlayer
21594
21570
  end
21595
- --- Helper function to get an array of temporary effects for a player. This is helpful so that you
21596
- -- don't have to manually create an array from an `EffectsList` object.
21597
- function ____exports.getEffectsList(self, player)
21598
- local effects = player:GetEffects()
21599
- local effectsList = effects:GetEffectsList()
21600
- local effectArray = {}
21601
- do
21602
- local i = 0
21603
- while i < effectsList.Size do
21604
- local effect = effectsList:Get(i)
21605
- if effect ~= nil then
21606
- effectArray[#effectArray + 1] = effect
21607
- end
21608
- i = i + 1
21609
- end
21610
- end
21611
- return effectArray
21612
- end
21613
21571
  --- Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer`
21614
21572
  -- method.
21615
21573
  function ____exports.getFinalPlayer(self)
@@ -21813,6 +21771,7 @@ function ____exports.isEden(self, player)
21813
21771
  local character = player:GetPlayerType()
21814
21772
  return character == PlayerType.EDEN or character == PlayerType.EDEN_B
21815
21773
  end
21774
+ --- Not exported since end-users should use the `isTainted` helper function directly.
21816
21775
  local function isTaintedModded(self, player)
21817
21776
  local character = player:GetPlayerType()
21818
21777
  local name = player:GetName()
@@ -57287,6 +57246,79 @@ function ____exports.removeTrinketFromPools(self, ...)
57287
57246
  itemPool:RemoveTrinket(trinketType)
57288
57247
  end
57289
57248
  end
57249
+ return ____exports
57250
+ end,
57251
+ ["functions.playerEffects"] = function(...)
57252
+ local ____lualib = require("lualib_bundle")
57253
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
57254
+ local ____exports = {}
57255
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
57256
+ local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
57257
+ local ____playerIndex = require("functions.playerIndex")
57258
+ local getAllPlayers = ____playerIndex.getAllPlayers
57259
+ local ____players = require("functions.players")
57260
+ local isCharacter = ____players.isCharacter
57261
+ --- Helper function to check to see if any player has a temporary collectible effect.
57262
+ function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
57263
+ local players = getAllPlayers(nil)
57264
+ return __TS__ArraySome(
57265
+ players,
57266
+ function(____, player)
57267
+ local effects = player:GetEffects()
57268
+ return effects:HasCollectibleEffect(collectibleType)
57269
+ end
57270
+ )
57271
+ end
57272
+ --- Helper function to check to see if any player has a temporary null effect.
57273
+ function ____exports.anyPlayerHasNullEffect(self, nullItemID)
57274
+ local players = getAllPlayers(nil)
57275
+ return __TS__ArraySome(
57276
+ players,
57277
+ function(____, player)
57278
+ local effects = player:GetEffects()
57279
+ return effects:HasNullEffect(nullItemID)
57280
+ end
57281
+ )
57282
+ end
57283
+ --- Helper function to check to see if any player has a temporary trinket effect.
57284
+ function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
57285
+ local players = getAllPlayers(nil)
57286
+ return __TS__ArraySome(
57287
+ players,
57288
+ function(____, player)
57289
+ local effects = player:GetEffects()
57290
+ return effects:HasTrinketEffect(trinketType)
57291
+ end
57292
+ )
57293
+ end
57294
+ --- Helper function to get an array of temporary effects for a player. This is helpful so that you
57295
+ -- don't have to manually create an array from an `EffectsList` object.
57296
+ function ____exports.getEffectsList(self, player)
57297
+ local effects = player:GetEffects()
57298
+ local effectsList = effects:GetEffectsList()
57299
+ local effectArray = {}
57300
+ do
57301
+ local i = 0
57302
+ while i < effectsList.Size do
57303
+ local effect = effectsList:Get(i)
57304
+ if effect ~= nil then
57305
+ effectArray[#effectArray + 1] = effect
57306
+ end
57307
+ i = i + 1
57308
+ end
57309
+ end
57310
+ return effectArray
57311
+ end
57312
+ --- Helper function to check if a player should have Whore of Babylon active at their current health
57313
+ -- level.
57314
+ --
57315
+ -- - For most characters, Whore of Babylon activates when the red hearts are at 1/2 or less.
57316
+ -- - For Eve, Whore of Babylon activates when the red hearts are at 1 or less.
57317
+ function ____exports.shouldWhoreOfBabylonBeActive(self, player)
57318
+ local redHearts = player:GetHearts()
57319
+ local threshold = isCharacter(nil, player, PlayerType.EVE) and 2 or 1
57320
+ return redHearts <= threshold
57321
+ end
57290
57322
  return ____exports
57291
57323
  end,
57292
57324
  ["functions.logMisc"] = function(...)
@@ -57341,10 +57373,11 @@ local ____itemPool = require("functions.itemPool")
57341
57373
  local getItemPoolName = ____itemPool.getItemPoolName
57342
57374
  local ____log = require("functions.log")
57343
57375
  local log = ____log.log
57376
+ local ____playerEffects = require("functions.playerEffects")
57377
+ local getEffectsList = ____playerEffects.getEffectsList
57344
57378
  local ____playerHealth = require("functions.playerHealth")
57345
57379
  local getPlayerHealth = ____playerHealth.getPlayerHealth
57346
57380
  local ____players = require("functions.players")
57347
- local getEffectsList = ____players.getEffectsList
57348
57381
  local getPlayerName = ____players.getPlayerName
57349
57382
  local ____roomData = require("functions.roomData")
57350
57383
  local getRoomData = ____roomData.getRoomData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "75.1.0",
3
+ "version": "75.2.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -71,7 +71,15 @@ export function characterStartsWithActiveItem(character: PlayerType): boolean {
71
71
  return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET.has(character);
72
72
  }
73
73
 
74
- /** Helper function to get the numerical damage multiplier for a character. */
74
+ /**
75
+ * Helper function to get the numerical damage multiplier for a character.
76
+ *
77
+ * @param character The character to get.
78
+ * @param hasWhoreOfBabylon Optional. Whether the character has the Whore of Babylon effect
79
+ * currently active. Defaults to false. This is necessary because Eve's
80
+ * damage multiplier changes from 0.75 to 1 when she has Whore of Babylon
81
+ * active.
82
+ */
75
83
  export function getCharacterDamageMultiplier(
76
84
  character: PlayerType,
77
85
  hasWhoreOfBabylon = false,
@@ -30,8 +30,9 @@ import { hasFlag } from "./flag";
30
30
  import { getIsaacAPIClassName } from "./isaacAPIClass";
31
31
  import { getItemPoolName } from "./itemPool";
32
32
  import { log } from "./log";
33
+ import { getEffectsList } from "./playerEffects";
33
34
  import { getPlayerHealth } from "./playerHealth";
34
- import { getEffectsList, getPlayerName } from "./players";
35
+ import { getPlayerName } from "./players";
35
36
  import { getRoomData, getRoomGridIndex, getRoomListIndex } from "./roomData";
36
37
  import { combineSets, getSortedSetValues } from "./set";
37
38
  import { iterateTableInOrder } from "./table";
@@ -0,0 +1,73 @@
1
+ import type {
2
+ CollectibleType,
3
+ NullItemID,
4
+ TrinketType,
5
+ } from "isaac-typescript-definitions";
6
+ import { PlayerType } from "isaac-typescript-definitions";
7
+ import { getAllPlayers } from "./playerIndex";
8
+ import { isCharacter } from "./players";
9
+
10
+ /** Helper function to check to see if any player has a temporary collectible effect. */
11
+ export function anyPlayerHasCollectibleEffect(
12
+ collectibleType: CollectibleType,
13
+ ): boolean {
14
+ const players = getAllPlayers();
15
+
16
+ return players.some((player) => {
17
+ const effects = player.GetEffects();
18
+ return effects.HasCollectibleEffect(collectibleType);
19
+ });
20
+ }
21
+
22
+ /** Helper function to check to see if any player has a temporary null effect. */
23
+ export function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean {
24
+ const players = getAllPlayers();
25
+
26
+ return players.some((player) => {
27
+ const effects = player.GetEffects();
28
+ return effects.HasNullEffect(nullItemID);
29
+ });
30
+ }
31
+
32
+ /** Helper function to check to see if any player has a temporary trinket effect. */
33
+ export function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean {
34
+ const players = getAllPlayers();
35
+
36
+ return players.some((player) => {
37
+ const effects = player.GetEffects();
38
+ return effects.HasTrinketEffect(trinketType);
39
+ });
40
+ }
41
+
42
+ /**
43
+ * Helper function to get an array of temporary effects for a player. This is helpful so that you
44
+ * don't have to manually create an array from an `EffectsList` object.
45
+ */
46
+ export function getEffectsList(player: EntityPlayer): TemporaryEffect[] {
47
+ const effects = player.GetEffects();
48
+ const effectsList = effects.GetEffectsList();
49
+
50
+ const effectArray: TemporaryEffect[] = [];
51
+ for (let i = 0; i < effectsList.Size; i++) {
52
+ const effect = effectsList.Get(i);
53
+ if (effect !== undefined) {
54
+ effectArray.push(effect);
55
+ }
56
+ }
57
+
58
+ return effectArray;
59
+ }
60
+
61
+ /**
62
+ * Helper function to check if a player should have Whore of Babylon active at their current health
63
+ * level.
64
+ *
65
+ * - For most characters, Whore of Babylon activates when the red hearts are at 1/2 or less.
66
+ * - For Eve, Whore of Babylon activates when the red hearts are at 1 or less.
67
+ */
68
+ export function shouldWhoreOfBabylonBeActive(player: EntityPlayer): boolean {
69
+ const redHearts = player.GetHearts();
70
+ const threshold = isCharacter(player, PlayerType.EVE) ? 2 : 1;
71
+
72
+ return redHearts <= threshold;
73
+ }
@@ -1,4 +1,3 @@
1
- import type { TrinketType } from "isaac-typescript-definitions";
2
1
  import {
3
2
  Challenge,
4
3
  CollectibleType,
@@ -20,38 +19,6 @@ import {
20
19
  import { isNumber } from "./types";
21
20
  import { assertDefined, repeat } from "./utils";
22
21
 
23
- /** Helper function to check to see if any player has a temporary collectible effect. */
24
- export function anyPlayerHasCollectibleEffect(
25
- collectibleType: CollectibleType,
26
- ): boolean {
27
- const players = getAllPlayers();
28
-
29
- return players.some((player) => {
30
- const effects = player.GetEffects();
31
- return effects.HasCollectibleEffect(collectibleType);
32
- });
33
- }
34
-
35
- /** Helper function to check to see if any player has a temporary null effect. */
36
- export function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean {
37
- const players = getAllPlayers();
38
-
39
- return players.some((player) => {
40
- const effects = player.GetEffects();
41
- return effects.HasNullEffect(nullItemID);
42
- });
43
- }
44
-
45
- /** Helper function to check to see if any player has a temporary trinket effect. */
46
- export function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean {
47
- const players = getAllPlayers();
48
-
49
- return players.some((player) => {
50
- const effects = player.GetEffects();
51
- return effects.HasTrinketEffect(trinketType);
52
- });
53
- }
54
-
55
22
  /**
56
23
  * Helper function to check to see if any player is holding up an item (from e.g. an active item
57
24
  * activation, a poop from IBS, etc.).
@@ -101,6 +68,9 @@ export function canPlayerCrushRocks(player: EntityPlayer): boolean {
101
68
  * If the player does not have an item currently queued, then this function will be a no-op.
102
69
  *
103
70
  * Returns whether an item was actually dequeued.
71
+ *
72
+ * Under the hood, this clones the `QueuedItemData`, since directly setting the `Item` field to
73
+ * `undefined` does not work for some reason.
104
74
  */
105
75
  export function dequeueItem(player: EntityPlayer): boolean {
106
76
  if (player.QueuedItem.Item === undefined) {
@@ -159,25 +129,6 @@ export function getClosestPlayer(position: Vector): EntityPlayer {
159
129
  return closestPlayer;
160
130
  }
161
131
 
162
- /**
163
- * Helper function to get an array of temporary effects for a player. This is helpful so that you
164
- * don't have to manually create an array from an `EffectsList` object.
165
- */
166
- export function getEffectsList(player: EntityPlayer): TemporaryEffect[] {
167
- const effects = player.GetEffects();
168
- const effectsList = effects.GetEffectsList();
169
-
170
- const effectArray: TemporaryEffect[] = [];
171
- for (let i = 0; i < effectsList.Size; i++) {
172
- const effect = effectsList.Get(i);
173
- if (effect !== undefined) {
174
- effectArray.push(effect);
175
- }
176
- }
177
-
178
- return effectArray;
179
- }
180
-
181
132
  /**
182
133
  * Helper function to return the player with the highest ID, according to the `Isaac.GetPlayer`
183
134
  * method.
@@ -457,6 +408,7 @@ export function isEden(player: EntityPlayer): boolean {
457
408
  return character === PlayerType.EDEN || character === PlayerType.EDEN_B;
458
409
  }
459
410
 
411
+ /** Not exported since end-users should use the `isTainted` helper function directly. */
460
412
  function isTaintedModded(player: EntityPlayer) {
461
413
  // This algorithm only works for modded characters because the `Isaac.GetPlayerTypeByName` method
462
414
  // is bugged.