isaacscript-common 47.4.0 → 47.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.
@@ -14033,9 +14033,9 @@ export declare function onFirstFloor(): boolean;
14033
14033
  export declare function onRepentanceStage(): boolean;
14034
14034
 
14035
14035
  /**
14036
- * Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
14037
- * pressing tab on the character selection screen). When the player resets the game on a set seed,
14038
- * the game will not switch to a different seed.
14036
+ * Helper function to check whether the player is playing on a set seed (i.e. that they entered in a
14037
+ * specific seed by pressing tab on the character selection screen). When the player resets the game
14038
+ * on a set seed, the game will not switch to a different seed.
14039
14039
  *
14040
14040
  * Under the hood, this checks if the current challenge is `Challenge.NULL` and the
14041
14041
  * `Seeds.IsCustomRun` method.
@@ -14115,6 +14115,12 @@ export declare function onStageWithShovelTrapdoors(): boolean;
14115
14115
  */
14116
14116
  export declare function onStageWithStoryBoss(): boolean;
14117
14117
 
14118
+ /**
14119
+ * Helper function to check whether the player is on a Victory Lap (i.e. they answered "yes" to the
14120
+ * popup that happens after defeating The Lamb).
14121
+ */
14122
+ export declare function onVictoryLap(): boolean;
14123
+
14118
14124
  /**
14119
14125
  * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been
14120
14126
  * discovered yet will not be opened.
@@ -16642,8 +16648,8 @@ export declare function setTrinketSprite(trinket: EntityPickup, pngPath: string
16642
16648
  /**
16643
16649
  * Helper function to change the run status to that of an unseeded run with a new random seed.
16644
16650
  *
16645
- * This is useful to revert the behavior where playing on a set and restarting the game will not
16646
- * take you to a new seed.
16651
+ * This is useful to revert the behavior where playing on a set seed and restarting the game will
16652
+ * not take you to a new seed.
16647
16653
  *
16648
16654
  * Under the hood, this function calls the `Seeds.Reset` method and the
16649
16655
  * `Seeds.Restart(Challenge.NULL)` method.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 47.4.0
3
+ isaacscript-common 47.5.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -22554,6 +22554,10 @@ function ____exports.onSetSeed(self)
22554
22554
  local challenge = Isaac.GetChallenge()
22555
22555
  return challenge == Challenge.NULL and customRun
22556
22556
  end
22557
+ function ____exports.onVictoryLap(self)
22558
+ local numVictoryLaps = game:GetVictoryLap()
22559
+ return numVictoryLaps > 0
22560
+ end
22557
22561
  function ____exports.restart(self, character)
22558
22562
  if character == nil then
22559
22563
  local command = "restart"
@@ -24,14 +24,19 @@ export declare function getSeedEffects(): SeedEffect[];
24
24
  */
25
25
  export declare function isGreedMode(): boolean;
26
26
  /**
27
- * Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
28
- * pressing tab on the character selection screen). When the player resets the game on a set seed,
29
- * the game will not switch to a different seed.
27
+ * Helper function to check whether the player is playing on a set seed (i.e. that they entered in a
28
+ * specific seed by pressing tab on the character selection screen). When the player resets the game
29
+ * on a set seed, the game will not switch to a different seed.
30
30
  *
31
31
  * Under the hood, this checks if the current challenge is `Challenge.NULL` and the
32
32
  * `Seeds.IsCustomRun` method.
33
33
  */
34
34
  export declare function onSetSeed(): boolean;
35
+ /**
36
+ * Helper function to check whether the player is on a Victory Lap (i.e. they answered "yes" to the
37
+ * popup that happens after defeating The Lamb).
38
+ */
39
+ export declare function onVictoryLap(): boolean;
35
40
  /**
36
41
  * Helper function to restart the run using the console command of "restart". If the player is
37
42
  * playing a seeded run, then it will restart the game to the beginning of the seed. Otherwise, it
@@ -43,8 +48,8 @@ export declare function restart(character?: PlayerType): void;
43
48
  /**
44
49
  * Helper function to change the run status to that of an unseeded run with a new random seed.
45
50
  *
46
- * This is useful to revert the behavior where playing on a set and restarting the game will not
47
- * take you to a new seed.
51
+ * This is useful to revert the behavior where playing on a set seed and restarting the game will
52
+ * not take you to a new seed.
48
53
  *
49
54
  * Under the hood, this function calls the `Seeds.Reset` method and the
50
55
  * `Seeds.Restart(Challenge.NULL)` method.
@@ -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;AAC/D,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAStC,qDAAqD;AACrD,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAO7C;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"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAStC,qDAAqD;AACrD,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAO7C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
@@ -54,9 +54,9 @@ end
54
54
  function ____exports.isGreedMode(self)
55
55
  return game.Difficulty == Difficulty.GREED or game.Difficulty == Difficulty.GREEDIER
56
56
  end
57
- --- Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
58
- -- pressing tab on the character selection screen). When the player resets the game on a set seed,
59
- -- the game will not switch to a different seed.
57
+ --- Helper function to check whether the player is playing on a set seed (i.e. that they entered in a
58
+ -- specific seed by pressing tab on the character selection screen). When the player resets the game
59
+ -- on a set seed, the game will not switch to a different seed.
60
60
  --
61
61
  -- Under the hood, this checks if the current challenge is `Challenge.NULL` and the
62
62
  -- `Seeds.IsCustomRun` method.
@@ -66,6 +66,12 @@ function ____exports.onSetSeed(self)
66
66
  local challenge = Isaac.GetChallenge()
67
67
  return challenge == Challenge.NULL and customRun
68
68
  end
69
+ --- Helper function to check whether the player is on a Victory Lap (i.e. they answered "yes" to the
70
+ -- popup that happens after defeating The Lamb).
71
+ function ____exports.onVictoryLap(self)
72
+ local numVictoryLaps = game:GetVictoryLap()
73
+ return numVictoryLaps > 0
74
+ end
69
75
  --- Helper function to restart the run using the console command of "restart". If the player is
70
76
  -- playing a seeded run, then it will restart the game to the beginning of the seed. Otherwise, it
71
77
  -- will put the player on a run with an entirely new seed.
@@ -88,8 +94,8 @@ function ____exports.restart(self, character)
88
94
  end
89
95
  --- Helper function to change the run status to that of an unseeded run with a new random seed.
90
96
  --
91
- -- This is useful to revert the behavior where playing on a set and restarting the game will not
92
- -- take you to a new seed.
97
+ -- This is useful to revert the behavior where playing on a set seed and restarting the game will
98
+ -- not take you to a new seed.
93
99
  --
94
100
  -- Under the hood, this function calls the `Seeds.Reset` method and the
95
101
  -- `Seeds.Restart(Challenge.NULL)` method.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "47.4.0",
3
+ "version": "47.5.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -71,9 +71,9 @@ export function isGreedMode(): boolean {
71
71
  }
72
72
 
73
73
  /**
74
- * Whether the player is playing on a set seed (i.e. that they entered in a specific seed by
75
- * pressing tab on the character selection screen). When the player resets the game on a set seed,
76
- * the game will not switch to a different seed.
74
+ * Helper function to check whether the player is playing on a set seed (i.e. that they entered in a
75
+ * specific seed by pressing tab on the character selection screen). When the player resets the game
76
+ * on a set seed, the game will not switch to a different seed.
77
77
  *
78
78
  * Under the hood, this checks if the current challenge is `Challenge.NULL` and the
79
79
  * `Seeds.IsCustomRun` method.
@@ -86,6 +86,15 @@ export function onSetSeed(): boolean {
86
86
  return challenge === Challenge.NULL && customRun;
87
87
  }
88
88
 
89
+ /**
90
+ * Helper function to check whether the player is on a Victory Lap (i.e. they answered "yes" to the
91
+ * popup that happens after defeating The Lamb).
92
+ */
93
+ export function onVictoryLap(): boolean {
94
+ const numVictoryLaps = game.GetVictoryLap();
95
+ return numVictoryLaps > 0;
96
+ }
97
+
89
98
  /**
90
99
  * Helper function to restart the run using the console command of "restart". If the player is
91
100
  * playing a seeded run, then it will restart the game to the beginning of the seed. Otherwise, it
@@ -116,8 +125,8 @@ export function restart(character?: PlayerType): void {
116
125
  /**
117
126
  * Helper function to change the run status to that of an unseeded run with a new random seed.
118
127
  *
119
- * This is useful to revert the behavior where playing on a set and restarting the game will not
120
- * take you to a new seed.
128
+ * This is useful to revert the behavior where playing on a set seed and restarting the game will
129
+ * not take you to a new seed.
121
130
  *
122
131
  * Under the hood, this function calls the `Seeds.Reset` method and the
123
132
  * `Seeds.Restart(Challenge.NULL)` method.