isaacscript-common 31.8.0 → 31.9.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.
- package/dist/index.rollup.d.ts +23 -6
- package/dist/isaacscript-common.lua +10 -7
- package/dist/src/functions/pickups.d.ts +6 -3
- package/dist/src/functions/pickups.d.ts.map +1 -1
- package/dist/src/functions/pickups.lua +7 -3
- package/dist/src/functions/stage.d.ts +18 -4
- package/dist/src/functions/stage.d.ts.map +1 -1
- package/dist/src/functions/stage.lua +26 -12
- package/package.json +1 -1
- package/src/functions/pickups.ts +14 -4
- package/src/functions/stage.ts +19 -5
package/dist/index.rollup.d.ts
CHANGED
|
@@ -8107,8 +8107,11 @@ declare type ISCFeatureTupleToClassTuple<T extends ISCFeature[]> = {
|
|
|
8107
8107
|
*/
|
|
8108
8108
|
export declare function isCharacter(player: EntityPlayer, ...characters: PlayerType[]): boolean;
|
|
8109
8109
|
|
|
8110
|
-
/**
|
|
8111
|
-
|
|
8110
|
+
/**
|
|
8111
|
+
* Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
8112
|
+
* variants.
|
|
8113
|
+
*/
|
|
8114
|
+
export declare function isChest(pickupOrPickupVariant: EntityPickup | PickupVariant): boolean;
|
|
8112
8115
|
|
|
8113
8116
|
/**
|
|
8114
8117
|
* Helper function to detect if a particular player is a "child" player, meaning that they have a
|
|
@@ -8846,8 +8849,15 @@ export declare function isSpikes(variable: unknown): variable is GridEntitySpike
|
|
|
8846
8849
|
export declare function isStageWithNaturalDevilRoom(effectiveStage: LevelStage): boolean;
|
|
8847
8850
|
|
|
8848
8851
|
/**
|
|
8849
|
-
*
|
|
8850
|
-
*
|
|
8852
|
+
* Helper function to check if the provided stage is one that will have a random collectible drop
|
|
8853
|
+
* upon defeating the boss of the floor.
|
|
8854
|
+
*
|
|
8855
|
+
* This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
8856
|
+
* The Chest, and Home (due to the presence of a story boss).
|
|
8857
|
+
*
|
|
8858
|
+
* Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
8859
|
+
* considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
8860
|
+
* Rooms will drop random boss collectibles.
|
|
8851
8861
|
*/
|
|
8852
8862
|
export declare function isStageWithRandomBossCollectible(stage: LevelStage): boolean;
|
|
8853
8863
|
|
|
@@ -13551,8 +13561,15 @@ export declare function onStageType(...stageTypes: StageType[]): boolean;
|
|
|
13551
13561
|
export declare function onStageWithNaturalDevilRoom(): boolean;
|
|
13552
13562
|
|
|
13553
13563
|
/**
|
|
13554
|
-
*
|
|
13555
|
-
*
|
|
13564
|
+
* Helper function to check if the current stage is one that will have a random collectible drop
|
|
13565
|
+
* upon defeating the boss of the floor.
|
|
13566
|
+
*
|
|
13567
|
+
* This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
13568
|
+
* The Chest, and Home (due to the presence of a story boss).
|
|
13569
|
+
*
|
|
13570
|
+
* Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
13571
|
+
* considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
13572
|
+
* Rooms will drop random boss collectibles.
|
|
13556
13573
|
*/
|
|
13557
13574
|
export declare function onStageWithRandomBossCollectible(): boolean;
|
|
13558
13575
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 31.
|
|
3
|
+
isaacscript-common 31.9.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -27213,6 +27213,9 @@ local inRange = ____utils.inRange
|
|
|
27213
27213
|
function ____exports.isRepentanceStage(self, stageType)
|
|
27214
27214
|
return stageType == StageType.REPENTANCE or stageType == StageType.REPENTANCE_B
|
|
27215
27215
|
end
|
|
27216
|
+
function ____exports.isStageWithStoryBoss(self, stage)
|
|
27217
|
+
return stage == LevelStage.DEPTHS_2 or stage >= LevelStage.WOMB_2
|
|
27218
|
+
end
|
|
27216
27219
|
function ____exports.onRepentanceStage(self)
|
|
27217
27220
|
local level = game:GetLevel()
|
|
27218
27221
|
local stageType = level:GetStageType()
|
|
@@ -27307,7 +27310,7 @@ function ____exports.isStageWithNaturalDevilRoom(self, effectiveStage)
|
|
|
27307
27310
|
return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
|
|
27308
27311
|
end
|
|
27309
27312
|
function ____exports.isStageWithRandomBossCollectible(self, stage)
|
|
27310
|
-
return
|
|
27313
|
+
return not ____exports.isStageWithStoryBoss(nil, stage) or stage == LevelStage.THE_VOID
|
|
27311
27314
|
end
|
|
27312
27315
|
function ____exports.isStageWithSecretExitToDownpour(self, stage)
|
|
27313
27316
|
return stage == LevelStage.BASEMENT_1 or stage == LevelStage.BASEMENT_2
|
|
@@ -27324,9 +27327,6 @@ function ____exports.isStageWithShovelTrapdoors(self, stage, stageType)
|
|
|
27324
27327
|
local repentanceStage = ____exports.isRepentanceStage(nil, stageType)
|
|
27325
27328
|
return stage < LevelStage.WOMB_2 or stage == LevelStage.WOMB_2 and not repentanceStage
|
|
27326
27329
|
end
|
|
27327
|
-
function ____exports.isStageWithStoryBoss(self, stage)
|
|
27328
|
-
return stage == LevelStage.DEPTHS_2 or stage >= LevelStage.WOMB_2
|
|
27329
|
-
end
|
|
27330
27330
|
function ____exports.onAscent(self)
|
|
27331
27331
|
return game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
|
|
27332
27332
|
end
|
|
@@ -39718,6 +39718,8 @@ local ____pickupVariants = require("src.functions.pickupVariants")
|
|
|
39718
39718
|
local isHeart = ____pickupVariants.isHeart
|
|
39719
39719
|
local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
39720
39720
|
local getHearts = ____pickupsSpecific.getHearts
|
|
39721
|
+
local ____types = require("src.functions.types")
|
|
39722
|
+
local isNumber = ____types.isNumber
|
|
39721
39723
|
function ____exports.getCoinValue(self, coinSubType)
|
|
39722
39724
|
local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
|
|
39723
39725
|
return value or DEFAULT_COIN_VALUE
|
|
@@ -39729,8 +39731,9 @@ function ____exports.getRedHearts(self)
|
|
|
39729
39731
|
function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
|
|
39730
39732
|
)
|
|
39731
39733
|
end
|
|
39732
|
-
function ____exports.isChest(self,
|
|
39733
|
-
|
|
39734
|
+
function ____exports.isChest(self, pickupOrPickupVariant)
|
|
39735
|
+
local pickupVariant = isNumber(nil, pickupOrPickupVariant) and pickupOrPickupVariant or pickupOrPickupVariant.Variant
|
|
39736
|
+
return CHEST_PICKUP_VARIANTS:has(pickupVariant)
|
|
39734
39737
|
end
|
|
39735
39738
|
function ____exports.isRedHeart(self, pickup)
|
|
39736
39739
|
return isHeart(nil, pickup) and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoinSubType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { CoinSubType, PickupVariant } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
4
4
|
* sub-types.
|
|
@@ -6,8 +6,11 @@ import type { CoinSubType } from "isaac-typescript-definitions";
|
|
|
6
6
|
export declare function getCoinValue(coinSubType: CoinSubType): int;
|
|
7
7
|
/** Helper function to get all of the red heart pickup entities in the room. */
|
|
8
8
|
export declare function getRedHearts(): EntityPickupHeart[];
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
11
|
+
* variants.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isChest(pickupOrPickupVariant: EntityPickup | PickupVariant): boolean;
|
|
11
14
|
/**
|
|
12
15
|
* Helper function to test if the provided pickup matches one of the various red heart sub types.
|
|
13
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAY/E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,GAAG,CAK1D;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,iBAAiB,EAAE,CAGlD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,qBAAqB,EAAE,YAAY,GAAG,aAAa,GAClD,OAAO,CAMT;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE,CAGjE"}
|
|
@@ -14,6 +14,8 @@ local ____pickupVariants = require("src.functions.pickupVariants")
|
|
|
14
14
|
local isHeart = ____pickupVariants.isHeart
|
|
15
15
|
local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
16
16
|
local getHearts = ____pickupsSpecific.getHearts
|
|
17
|
+
local ____types = require("src.functions.types")
|
|
18
|
+
local isNumber = ____types.isNumber
|
|
17
19
|
--- Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
18
20
|
-- sub-types.
|
|
19
21
|
function ____exports.getCoinValue(self, coinSubType)
|
|
@@ -28,9 +30,11 @@ function ____exports.getRedHearts(self)
|
|
|
28
30
|
function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
|
|
29
31
|
)
|
|
30
32
|
end
|
|
31
|
-
--- Helper function to test if the provided pickup matches one of the various chest
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
--- Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
34
|
+
-- variants.
|
|
35
|
+
function ____exports.isChest(self, pickupOrPickupVariant)
|
|
36
|
+
local pickupVariant = isNumber(nil, pickupOrPickupVariant) and pickupOrPickupVariant or pickupOrPickupVariant.Variant
|
|
37
|
+
return CHEST_PICKUP_VARIANTS:has(pickupVariant)
|
|
34
38
|
end
|
|
35
39
|
--- Helper function to test if the provided pickup matches one of the various red heart sub types.
|
|
36
40
|
function ____exports.isRedHeart(self, pickup)
|
|
@@ -80,8 +80,15 @@ export declare function isRepentanceStage(stageType: StageType): boolean;
|
|
|
80
80
|
*/
|
|
81
81
|
export declare function isStageWithNaturalDevilRoom(effectiveStage: LevelStage): boolean;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
83
|
+
* Helper function to check if the provided stage is one that will have a random collectible drop
|
|
84
|
+
* upon defeating the boss of the floor.
|
|
85
|
+
*
|
|
86
|
+
* This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
87
|
+
* The Chest, and Home (due to the presence of a story boss).
|
|
88
|
+
*
|
|
89
|
+
* Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
90
|
+
* considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
91
|
+
* Rooms will drop random boss collectibles.
|
|
85
92
|
*/
|
|
86
93
|
export declare function isStageWithRandomBossCollectible(stage: LevelStage): boolean;
|
|
87
94
|
/**
|
|
@@ -170,8 +177,15 @@ export declare function onStageType(...stageTypes: StageType[]): boolean;
|
|
|
170
177
|
*/
|
|
171
178
|
export declare function onStageWithNaturalDevilRoom(): boolean;
|
|
172
179
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
180
|
+
* Helper function to check if the current stage is one that will have a random collectible drop
|
|
181
|
+
* upon defeating the boss of the floor.
|
|
182
|
+
*
|
|
183
|
+
* This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
184
|
+
* The Chest, and Home (due to the presence of a story boss).
|
|
185
|
+
*
|
|
186
|
+
* Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
187
|
+
* considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
188
|
+
* Rooms will drop random boss collectibles.
|
|
175
189
|
*/
|
|
176
190
|
export declare function onStageWithRandomBossCollectible(): boolean;
|
|
177
191
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAS9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,CAaR;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,iCAAiC,UAAQ,GACxC,MAAM,CAOR;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAa7E;A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____exports.isRepentanceStage(self, stageType)
|
|
29
29
|
return stageType == StageType.REPENTANCE or stageType == StageType.REPENTANCE_B
|
|
30
30
|
end
|
|
31
|
+
--- Helper function to check if the provided stage is one with a story boss. Specifically, this is
|
|
32
|
+
-- Depths 2 (Mom), Womb 2 (Mom's Heart / It Lives), Blue Womb (Hush), Sheol (Satan), Cathedral
|
|
33
|
+
-- (Isaac), Dark Room (Lamb), The Chest (Blue Baby), The Void (Delirium), and Home (Dogma / The
|
|
34
|
+
-- Beast).
|
|
35
|
+
function ____exports.isStageWithStoryBoss(self, stage)
|
|
36
|
+
return stage == LevelStage.DEPTHS_2 or stage >= LevelStage.WOMB_2
|
|
37
|
+
end
|
|
31
38
|
--- Helper function to check if the current stage type is equal to `StageType.REPENTANCE` or
|
|
32
39
|
-- `StageType.REPENTANCE_B`.
|
|
33
40
|
function ____exports.onRepentanceStage(self)
|
|
@@ -174,10 +181,17 @@ end
|
|
|
174
181
|
function ____exports.isStageWithNaturalDevilRoom(self, effectiveStage)
|
|
175
182
|
return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
|
|
176
183
|
end
|
|
177
|
-
---
|
|
178
|
-
--
|
|
184
|
+
--- Helper function to check if the provided stage is one that will have a random collectible drop
|
|
185
|
+
-- upon defeating the boss of the floor.
|
|
186
|
+
--
|
|
187
|
+
-- This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
188
|
+
-- The Chest, and Home (due to the presence of a story boss).
|
|
189
|
+
--
|
|
190
|
+
-- Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
191
|
+
-- considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
192
|
+
-- Rooms will drop random boss collectibles.
|
|
179
193
|
function ____exports.isStageWithRandomBossCollectible(self, stage)
|
|
180
|
-
return
|
|
194
|
+
return not ____exports.isStageWithStoryBoss(nil, stage) or stage == LevelStage.THE_VOID
|
|
181
195
|
end
|
|
182
196
|
--- Helper function to check if the provided stage will spawn a locked door to Downpour/Dross after
|
|
183
197
|
-- defeating the boss.
|
|
@@ -202,13 +216,6 @@ function ____exports.isStageWithShovelTrapdoors(self, stage, stageType)
|
|
|
202
216
|
local repentanceStage = ____exports.isRepentanceStage(nil, stageType)
|
|
203
217
|
return stage < LevelStage.WOMB_2 or stage == LevelStage.WOMB_2 and not repentanceStage
|
|
204
218
|
end
|
|
205
|
-
--- Helper function to check if the provided stage is one with a story boss. Specifically, this is
|
|
206
|
-
-- Depths 2 (Mom), Womb 2 (Mom's Heart / It Lives), Blue Womb (Hush), Sheol (Satan), Cathedral
|
|
207
|
-
-- (Isaac), Dark Room (Lamb), The Chest (Blue Baby), The Void (Delirium), and Home (Dogma / The
|
|
208
|
-
-- Beast).
|
|
209
|
-
function ____exports.isStageWithStoryBoss(self, stage)
|
|
210
|
-
return stage == LevelStage.DEPTHS_2 or stage >= LevelStage.WOMB_2
|
|
211
|
-
end
|
|
212
219
|
--- Helper function to check if the player has taken Dad's Note. This sets the game state flag of
|
|
213
220
|
-- `GameStateFlag.BACKWARDS_PATH` and causes floor generation to change.
|
|
214
221
|
function ____exports.onAscent(self)
|
|
@@ -304,8 +311,15 @@ function ____exports.onStageWithNaturalDevilRoom(self)
|
|
|
304
311
|
local effectiveStage = ____exports.getEffectiveStage(nil)
|
|
305
312
|
return ____exports.isStageWithNaturalDevilRoom(nil, effectiveStage)
|
|
306
313
|
end
|
|
307
|
-
---
|
|
308
|
-
--
|
|
314
|
+
--- Helper function to check if the current stage is one that will have a random collectible drop
|
|
315
|
+
-- upon defeating the boss of the floor.
|
|
316
|
+
--
|
|
317
|
+
-- This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
318
|
+
-- The Chest, and Home (due to the presence of a story boss).
|
|
319
|
+
--
|
|
320
|
+
-- Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
321
|
+
-- considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
322
|
+
-- Rooms will drop random boss collectibles.
|
|
309
323
|
function ____exports.onStageWithRandomBossCollectible(self)
|
|
310
324
|
local level = game:GetLevel()
|
|
311
325
|
local stage = level:GetStage()
|
package/package.json
CHANGED
package/src/functions/pickups.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoinSubType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { CoinSubType, PickupVariant } from "isaac-typescript-definitions";
|
|
2
2
|
import {
|
|
3
3
|
COIN_SUB_TYPE_TO_VALUE,
|
|
4
4
|
DEFAULT_COIN_VALUE,
|
|
@@ -8,6 +8,7 @@ import { RED_HEART_SUB_TYPES_SET } from "../sets/redHeartSubTypesSet";
|
|
|
8
8
|
import { removeEntities } from "./entities";
|
|
9
9
|
import { isHeart } from "./pickupVariants";
|
|
10
10
|
import { getHearts } from "./pickupsSpecific";
|
|
11
|
+
import { isNumber } from "./types";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
@@ -26,9 +27,18 @@ export function getRedHearts(): EntityPickupHeart[] {
|
|
|
26
27
|
return hearts.filter((heart) => RED_HEART_SUB_TYPES_SET.has(heart.SubType));
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
32
|
+
* variants.
|
|
33
|
+
*/
|
|
34
|
+
export function isChest(
|
|
35
|
+
pickupOrPickupVariant: EntityPickup | PickupVariant,
|
|
36
|
+
): boolean {
|
|
37
|
+
const pickupVariant = isNumber(pickupOrPickupVariant)
|
|
38
|
+
? pickupOrPickupVariant
|
|
39
|
+
: pickupOrPickupVariant.Variant;
|
|
40
|
+
|
|
41
|
+
return CHEST_PICKUP_VARIANTS.has(pickupVariant);
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
/**
|
package/src/functions/stage.ts
CHANGED
|
@@ -233,11 +233,18 @@ export function isStageWithNaturalDevilRoom(
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
236
|
+
* Helper function to check if the provided stage is one that will have a random collectible drop
|
|
237
|
+
* upon defeating the boss of the floor.
|
|
238
|
+
*
|
|
239
|
+
* This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
240
|
+
* The Chest, and Home (due to the presence of a story boss).
|
|
241
|
+
*
|
|
242
|
+
* Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
243
|
+
* considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
244
|
+
* Rooms will drop random boss collectibles.
|
|
238
245
|
*/
|
|
239
246
|
export function isStageWithRandomBossCollectible(stage: LevelStage): boolean {
|
|
240
|
-
return stage
|
|
247
|
+
return !isStageWithStoryBoss(stage) || stage === LevelStage.THE_VOID;
|
|
241
248
|
}
|
|
242
249
|
|
|
243
250
|
/**
|
|
@@ -453,8 +460,15 @@ export function onStageWithNaturalDevilRoom(): boolean {
|
|
|
453
460
|
}
|
|
454
461
|
|
|
455
462
|
/**
|
|
456
|
-
*
|
|
457
|
-
*
|
|
463
|
+
* Helper function to check if the current stage is one that will have a random collectible drop
|
|
464
|
+
* upon defeating the boss of the floor.
|
|
465
|
+
*
|
|
466
|
+
* This happens on most stages but will not happen on Depths 2, Womb 2, Sheol, Cathedral, Dark Room,
|
|
467
|
+
* The Chest, and Home (due to the presence of a story boss).
|
|
468
|
+
*
|
|
469
|
+
* Note that even though Delirium does not drop a random boss collectible, The Void is still
|
|
470
|
+
* considered to be a stage that has a random boss collectible since all of the non-Delirium Boss
|
|
471
|
+
* Rooms will drop random boss collectibles.
|
|
458
472
|
*/
|
|
459
473
|
export function onStageWithRandomBossCollectible(): boolean {
|
|
460
474
|
const level = game.GetLevel();
|