isaacscript-common 39.4.6 → 39.5.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.
@@ -8840,6 +8840,12 @@ export declare function isLRoomShape(roomShape: RoomShape): boolean;
8840
8840
  */
8841
8841
  export declare function isLuaDebugEnabled(): boolean;
8842
8842
 
8843
+ /**
8844
+ * Helper function to check if the provided character is one of the characters that are selectable
8845
+ * from the main menu (and have achievements related to completing the various bosses and so on).
8846
+ */
8847
+ export declare function isMainCharacter(character: PlayerType): boolean;
8848
+
8843
8849
  /**
8844
8850
  * Helper function to check if the provided door is the one that leads to the Mega Satan Boss Room.
8845
8851
  * (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.)
@@ -13940,6 +13946,9 @@ export declare function onRepentanceStage(): boolean;
13940
13946
  * Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
13941
13947
  * pressing tab on the character selection screen). When the player resets the game on a set seed,
13942
13948
  * the game will not switch to a different seed.
13949
+ *
13950
+ * Under the hood, this checks if the current challenge is `Challenge.NULL` and the
13951
+ * `Seeds.IsCustomRun` method.
13943
13952
  */
13944
13953
  export declare function onSetSeed(): boolean;
13945
13954
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 39.4.6
3
+ isaacscript-common 39.5.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -19297,7 +19297,7 @@ end
19297
19297
  function ____exports.isVanillaCharacter(self, character)
19298
19298
  return character <= LAST_VANILLA_CHARACTER
19299
19299
  end
19300
- local FLYING_CHARACTERS = __TS__New(ReadonlySet, {
19300
+ local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, {
19301
19301
  PlayerType.AZAZEL,
19302
19302
  PlayerType.LOST,
19303
19303
  PlayerType.SOUL,
@@ -19305,6 +19305,42 @@ local FLYING_CHARACTERS = __TS__New(ReadonlySet, {
19305
19305
  PlayerType.JACOB_2_B,
19306
19306
  PlayerType.SOUL_B
19307
19307
  })
19308
+ local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, {
19309
+ PlayerType.ISAAC,
19310
+ PlayerType.MAGDALENE,
19311
+ PlayerType.CAIN,
19312
+ PlayerType.JUDAS,
19313
+ PlayerType.BLUE_BABY,
19314
+ PlayerType.EVE,
19315
+ PlayerType.SAMSON,
19316
+ PlayerType.AZAZEL,
19317
+ PlayerType.LAZARUS,
19318
+ PlayerType.EDEN,
19319
+ PlayerType.LOST,
19320
+ PlayerType.LILITH,
19321
+ PlayerType.KEEPER,
19322
+ PlayerType.APOLLYON,
19323
+ PlayerType.FORGOTTEN,
19324
+ PlayerType.BETHANY,
19325
+ PlayerType.JACOB,
19326
+ PlayerType.ISAAC_B,
19327
+ PlayerType.MAGDALENE_B,
19328
+ PlayerType.CAIN_B,
19329
+ PlayerType.JUDAS_B,
19330
+ PlayerType.BLUE_BABY_B,
19331
+ PlayerType.EVE_B,
19332
+ PlayerType.SAMSON_B,
19333
+ PlayerType.AZAZEL_B,
19334
+ PlayerType.LAZARUS_B,
19335
+ PlayerType.EDEN_B,
19336
+ PlayerType.LOST_B,
19337
+ PlayerType.LILITH_B,
19338
+ PlayerType.KEEPER_B,
19339
+ PlayerType.APOLLYON_B,
19340
+ PlayerType.FORGOTTEN_B,
19341
+ PlayerType.BETHANY_B,
19342
+ PlayerType.JACOB_B
19343
+ })
19308
19344
  function ____exports.characterCanHaveRedHearts(self, character)
19309
19345
  return not CHARACTERS_WITH_NO_RED_HEARTS_SET:has(character)
19310
19346
  end
@@ -19364,7 +19400,10 @@ function ____exports.getCharacterStartingCollectibles(self, character)
19364
19400
  end
19365
19401
  function ____exports.isFlyingCharacter(self, player)
19366
19402
  local character = player:GetPlayerType()
19367
- return FLYING_CHARACTERS:has(character)
19403
+ return FLYING_CHARACTERS_SET:has(character)
19404
+ end
19405
+ function ____exports.isMainCharacter(self, character)
19406
+ return MAIN_CHARACTERS_SET:has(character)
19368
19407
  end
19369
19408
  return ____exports
19370
19409
  end,
@@ -55,6 +55,11 @@ export declare function getCharacterName(character: PlayerType): string;
55
55
  */
56
56
  export declare function getCharacterStartingCollectibles(character: PlayerType): readonly CollectibleType[];
57
57
  export declare function isFlyingCharacter(player: EntityPlayer): boolean;
58
+ /**
59
+ * Helper function to check if the provided character is one of the characters that are selectable
60
+ * from the main menu (and have achievements related to completing the various bosses and so on).
61
+ */
62
+ export declare function isMainCharacter(character: PlayerType): boolean;
58
63
  export declare function isModdedCharacter(character: PlayerType): boolean;
59
64
  export declare function isVanillaCharacter(character: PlayerType): boolean;
60
65
  //# sourceMappingURL=characters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAsB1D;;;;;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,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,GAA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ED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,UAAU,GACpB,SAAS,eAAe,EAAE,CAE5B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG/D;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"}
@@ -31,7 +31,7 @@ end
31
31
  function ____exports.isVanillaCharacter(self, character)
32
32
  return character <= LAST_VANILLA_CHARACTER
33
33
  end
34
- local FLYING_CHARACTERS = __TS__New(ReadonlySet, {
34
+ local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, {
35
35
  PlayerType.AZAZEL,
36
36
  PlayerType.LOST,
37
37
  PlayerType.SOUL,
@@ -39,6 +39,42 @@ local FLYING_CHARACTERS = __TS__New(ReadonlySet, {
39
39
  PlayerType.JACOB_2_B,
40
40
  PlayerType.SOUL_B
41
41
  })
42
+ local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, {
43
+ PlayerType.ISAAC,
44
+ PlayerType.MAGDALENE,
45
+ PlayerType.CAIN,
46
+ PlayerType.JUDAS,
47
+ PlayerType.BLUE_BABY,
48
+ PlayerType.EVE,
49
+ PlayerType.SAMSON,
50
+ PlayerType.AZAZEL,
51
+ PlayerType.LAZARUS,
52
+ PlayerType.EDEN,
53
+ PlayerType.LOST,
54
+ PlayerType.LILITH,
55
+ PlayerType.KEEPER,
56
+ PlayerType.APOLLYON,
57
+ PlayerType.FORGOTTEN,
58
+ PlayerType.BETHANY,
59
+ PlayerType.JACOB,
60
+ PlayerType.ISAAC_B,
61
+ PlayerType.MAGDALENE_B,
62
+ PlayerType.CAIN_B,
63
+ PlayerType.JUDAS_B,
64
+ PlayerType.BLUE_BABY_B,
65
+ PlayerType.EVE_B,
66
+ PlayerType.SAMSON_B,
67
+ PlayerType.AZAZEL_B,
68
+ PlayerType.LAZARUS_B,
69
+ PlayerType.EDEN_B,
70
+ PlayerType.LOST_B,
71
+ PlayerType.LILITH_B,
72
+ PlayerType.KEEPER_B,
73
+ PlayerType.APOLLYON_B,
74
+ PlayerType.FORGOTTEN_B,
75
+ PlayerType.BETHANY_B,
76
+ PlayerType.JACOB_B
77
+ })
42
78
  --- Helper function to determine if the given character can have red heart containers. Returns true
43
79
  -- for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
44
80
  -- though coin containers are not technically the same as red heart containers. Returns false for
@@ -126,6 +162,11 @@ function ____exports.getCharacterStartingCollectibles(self, character)
126
162
  end
127
163
  function ____exports.isFlyingCharacter(self, player)
128
164
  local character = player:GetPlayerType()
129
- return FLYING_CHARACTERS:has(character)
165
+ return FLYING_CHARACTERS_SET:has(character)
166
+ end
167
+ --- Helper function to check if the provided character is one of the characters that are selectable
168
+ -- from the main menu (and have achievements related to completing the various bosses and so on).
169
+ function ____exports.isMainCharacter(self, character)
170
+ return MAIN_CHARACTERS_SET:has(character)
130
171
  end
131
172
  return ____exports
@@ -13,6 +13,9 @@ export declare function isGreedMode(): boolean;
13
13
  * Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
14
14
  * pressing tab on the character selection screen). When the player resets the game on a set seed,
15
15
  * the game will not switch to a different seed.
16
+ *
17
+ * Under the hood, this checks if the current challenge is `Challenge.NULL` and the
18
+ * `Seeds.IsCustomRun` method.
16
19
  */
17
20
  export declare function onSetSeed(): boolean;
18
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa/D;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa/D;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
@@ -31,6 +31,9 @@ end
31
31
  --- Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
32
32
  -- pressing tab on the character selection screen). When the player resets the game on a set seed,
33
33
  -- the game will not switch to a different seed.
34
+ --
35
+ -- Under the hood, this checks if the current challenge is `Challenge.NULL` and the
36
+ -- `Seeds.IsCustomRun` method.
34
37
  function ____exports.onSetSeed(self)
35
38
  local seeds = game:GetSeeds()
36
39
  local customRun = seeds:IsCustomRun()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "39.4.6",
3
+ "version": "39.5.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -12,7 +12,7 @@ import { CHARACTERS_WITH_NO_SOUL_HEARTS_SET } from "../sets/charactersWithNoSoul
12
12
  import { LOST_STYLE_CHARACTERS_SET } from "../sets/lostStyleCharactersSet";
13
13
  import { ReadonlySet } from "../types/ReadonlySet";
14
14
 
15
- const FLYING_CHARACTERS = new ReadonlySet<PlayerType>([
15
+ const FLYING_CHARACTERS_SET = new ReadonlySet<PlayerType>([
16
16
  PlayerType.AZAZEL, // 7
17
17
  PlayerType.LOST, // 10
18
18
  PlayerType.SOUL, // 17
@@ -21,6 +21,43 @@ const FLYING_CHARACTERS = new ReadonlySet<PlayerType>([
21
21
  PlayerType.SOUL_B, // 40
22
22
  ]);
23
23
 
24
+ const MAIN_CHARACTERS_SET = new ReadonlySet<PlayerType>([
25
+ PlayerType.ISAAC, // 0
26
+ PlayerType.MAGDALENE, // 1
27
+ PlayerType.CAIN, // 2
28
+ PlayerType.JUDAS, // 3
29
+ PlayerType.BLUE_BABY, // 4
30
+ PlayerType.EVE, // 5
31
+ PlayerType.SAMSON, // 6
32
+ PlayerType.AZAZEL, // 7
33
+ PlayerType.LAZARUS, // 8
34
+ PlayerType.EDEN, // 9
35
+ PlayerType.LOST, // 10
36
+ PlayerType.LILITH, // 13
37
+ PlayerType.KEEPER, // 14
38
+ PlayerType.APOLLYON, // 15
39
+ PlayerType.FORGOTTEN, // 16
40
+ PlayerType.BETHANY, // 18
41
+ PlayerType.JACOB, // 19
42
+ PlayerType.ISAAC_B, // 21
43
+ PlayerType.MAGDALENE_B, // 22
44
+ PlayerType.CAIN_B, // 23
45
+ PlayerType.JUDAS_B, // 24
46
+ PlayerType.BLUE_BABY_B, // 25
47
+ PlayerType.EVE_B, // 26
48
+ PlayerType.SAMSON_B, // 27
49
+ PlayerType.AZAZEL_B, // 28
50
+ PlayerType.LAZARUS_B, // 29
51
+ PlayerType.EDEN_B, // 30
52
+ PlayerType.LOST_B, // 31
53
+ PlayerType.LILITH_B, // 32
54
+ PlayerType.KEEPER_B, // 33
55
+ PlayerType.APOLLYON_B, // 34
56
+ PlayerType.FORGOTTEN_B, // 35
57
+ PlayerType.BETHANY_B, // 36
58
+ PlayerType.JACOB_B, // 37
59
+ ]);
60
+
24
61
  /**
25
62
  * Helper function to determine if the given character can have red heart containers. Returns true
26
63
  * for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
@@ -150,7 +187,15 @@ export function getCharacterStartingCollectibles(
150
187
 
151
188
  export function isFlyingCharacter(player: EntityPlayer): boolean {
152
189
  const character = player.GetPlayerType();
153
- return FLYING_CHARACTERS.has(character);
190
+ return FLYING_CHARACTERS_SET.has(character);
191
+ }
192
+
193
+ /**
194
+ * Helper function to check if the provided character is one of the characters that are selectable
195
+ * from the main menu (and have achievements related to completing the various bosses and so on).
196
+ */
197
+ export function isMainCharacter(character: PlayerType): boolean {
198
+ return MAIN_CHARACTERS_SET.has(character);
154
199
  }
155
200
 
156
201
  export function isModdedCharacter(character: PlayerType): boolean {
@@ -42,6 +42,9 @@ export function isGreedMode(): boolean {
42
42
  * Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
43
43
  * pressing tab on the character selection screen). When the player resets the game on a set seed,
44
44
  * the game will not switch to a different seed.
45
+ *
46
+ * Under the hood, this checks if the current challenge is `Challenge.NULL` and the
47
+ * `Seeds.IsCustomRun` method.
45
48
  */
46
49
  export function onSetSeed(): boolean {
47
50
  const seeds = game.GetSeeds();