isaacscript-common 1.2.48 → 1.2.49

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.
@@ -29,7 +29,7 @@ function postPEffectUpdateReordered(self, player)
29
29
  end
30
30
  if character ~= storedCharacter then
31
31
  v.run.characterMap:set(playerIndex, character)
32
- postPlayerChangeTypeFire(nil, player, character)
32
+ postPlayerChangeTypeFire(nil, player, storedCharacter, character)
33
33
  end
34
34
  end
35
35
  v = {run = {characterMap = __TS__New(Map)}}
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare type PostPlayerChangeTypeCallbackType = (player: EntityPlayer, character: PlayerType) => void;
2
+ export declare type PostPlayerChangeTypeCallbackType = (player: EntityPlayer, oldCharacter: PlayerType | int, newCharacter: PlayerType | int) => void;
@@ -9,10 +9,10 @@ end
9
9
  function ____exports.postPlayerChangeTypeRegister(self, callback)
10
10
  __TS__ArrayPush(subscriptions, {callback})
11
11
  end
12
- function ____exports.postPlayerChangeTypeFire(self, player, character)
12
+ function ____exports.postPlayerChangeTypeFire(self, player, oldCharacter, newCharacter)
13
13
  for ____, ____value in ipairs(subscriptions) do
14
14
  local callback = ____value[1]
15
- callback(nil, player, character)
15
+ callback(nil, player, oldCharacter, newCharacter)
16
16
  end
17
17
  end
18
18
  return ____exports
@@ -25,26 +25,26 @@ export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boo
25
25
  * This function is variadic, meaning that you can supply as many characters as you want to check
26
26
  * for. Returns true if any of the characters supplied are present.
27
27
  */
28
- export declare function anyPlayerIs(...matchingCharacters: PlayerType[]): boolean;
28
+ export declare function anyPlayerIs(...matchingCharacters: Array<PlayerType | int>): boolean;
29
29
  /**
30
30
  * Helper function to determine if the provided character can have red heart containers. Returns
31
31
  * true for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
32
32
  * even though coin containers are not technically the same as red heart containers. Returns false
33
33
  * for characters like Blue Baby. Returns false for The Lost and Tainted Lost.
34
34
  */
35
- export declare function characterCanHaveRedHearts(character: PlayerType): boolean;
35
+ export declare function characterCanHaveRedHearts(character: PlayerType | int): boolean;
36
36
  /**
37
37
  * Helper function to determine if the provided character can have soul hearts. Returns true for
38
38
  * characters like Isaac, Magdalene, or Cain. Returns false for characters like Bethany. Returns
39
39
  * false for The Lost and Tainted Lost.
40
40
  */
41
- export declare function characterCanHaveSoulHearts(character: PlayerType): boolean;
41
+ export declare function characterCanHaveSoulHearts(character: PlayerType | int): boolean;
42
42
  /**
43
43
  * Normally, characters get a red heart container upon reaching a new floor with an eternal heart,
44
44
  * but some characters grant a black heart instead. Returns true for Dark Judas and Tainted Judas.
45
45
  * Otherwise, returns false.
46
46
  */
47
- export declare function characterGetsBlackHeartFromEternalHeart(character: PlayerType): boolean;
47
+ export declare function characterGetsBlackHeartFromEternalHeart(character: PlayerType | int): boolean;
48
48
  /**
49
49
  * Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
50
50
  * `EntityPlayer` object or a tear height stat.
@@ -86,7 +86,7 @@ export declare function getPlayerAvailableHeartSlots(player: EntityPlayer): int;
86
86
  * but with Keeper it is 3, with Tainted Keeper it is 2. Does not account for Birthright or Mother's
87
87
  * Kiss; use the `getPlayerMaxHeartContainers()` function for that.
88
88
  */
89
- export declare function getCharacterMaxHeartContainers(character: PlayerType): int;
89
+ export declare function getCharacterMaxHeartContainers(character: PlayerType | int): int;
90
90
  /** Helper function to get an array containing the characters of all of the current players. */
91
91
  export declare function getCharacters(): number[];
92
92
  /**
@@ -170,7 +170,7 @@ export declare function getPlayers(performExclusions?: boolean): EntityPlayer[];
170
170
  * This function is variadic, meaning that you can supply as many characters as you want to check
171
171
  * for. Returns true if any of the characters supplied are present.
172
172
  */
173
- export declare function getPlayersOfType(...characters: PlayerType[]): EntityPlayer[];
173
+ export declare function getPlayersOfType(...characters: Array<PlayerType | int>): EntityPlayer[];
174
174
  /**
175
175
  * Helper function to return the active charge and the battery charge combined. This is useful
176
176
  * because you are not able to set the battery charge directly.
@@ -203,7 +203,7 @@ export declare function isBethany(player: EntityPlayer): boolean;
203
203
  */
204
204
  export declare function isChildPlayer(player: EntityPlayer): boolean;
205
205
  /** Uses the player's current health and character to determine if incoming damage will be fatal. */
206
- export declare function isDamageToPlayerFatal(player: EntityPlayer, damageAmount: int, damageSource: EntityRef, lastDamageFrame: int | undefined): boolean;
206
+ export declare function isDamageToPlayerFatal(player: EntityPlayer, damageAmount: int, damageSource: EntityRef, lastDamageFrame?: int): boolean;
207
207
  export declare function isFirstPlayer(player: EntityPlayer): boolean;
208
208
  /**
209
209
  * Helper function for detecting when a player is Jacob or Esau. This will only match the
@@ -63,7 +63,7 @@ export interface CallbackParametersCustom {
63
63
  ];
64
64
  [ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED]: [
65
65
  callback: PostPEffectUpdateReorderedCallbackType,
66
- character?: PlayerType
66
+ character?: PlayerType | int
67
67
  ];
68
68
  [ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED]: [
69
69
  callback: PostPlayerUpdateReorderedCallbackType,
@@ -115,7 +115,7 @@ export interface CallbackParametersCustom {
115
115
  ];
116
116
  [ModCallbacksCustom.MC_POST_NPC_INIT_LATE]: [
117
117
  callback: PostNPCInitLateCallbackType,
118
- entityType?: EntityType
118
+ entityType?: EntityType | int
119
119
  ];
120
120
  [ModCallbacksCustom.MC_POST_EFFECT_INIT_LATE]: [
121
121
  callback: PostEffectInitLateCallbackType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.48",
3
+ "version": "1.2.49",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",