isaacscript-common 82.0.2 → 83.1.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/functions/bosses.d.ts +25 -22
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.lua +36 -36
- package/dist/functions/stage.d.ts +17 -5
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +70 -23
- package/dist/index.rollup.d.ts +46 -28
- package/dist/isaacscript-common.lua +397 -332
- package/dist/objects/stageIDNames.d.ts +40 -0
- package/dist/objects/stageIDNames.d.ts.map +1 -0
- package/dist/objects/stageIDNames.lua +41 -0
- package/dist/objects/stageToStageID.d.ts +2 -1
- package/dist/objects/stageToStageID.d.ts.map +1 -1
- package/dist/objects/stageToStageID.lua +29 -0
- package/dist/objects/versusScreenBackgroundColors.d.ts +0 -6
- package/dist/objects/versusScreenBackgroundColors.d.ts.map +1 -1
- package/dist/objects/versusScreenBackgroundColors.lua +2 -8
- package/dist/objects/versusScreenDirtSpotColors.d.ts +0 -6
- package/dist/objects/versusScreenDirtSpotColors.d.ts.map +1 -1
- package/dist/objects/versusScreenDirtSpotColors.lua +2 -8
- package/dist/sets/bossSets.d.ts +3 -3
- package/dist/sets/bossSets.d.ts.map +1 -1
- package/dist/sets/bossSets.lua +197 -119
- package/package.json +2 -2
- package/src/functions/bosses.ts +42 -38
- package/src/functions/stage.ts +62 -8
- package/src/objects/stageIDNames.ts +41 -0
- package/src/objects/stageToStageID.ts +33 -1
- package/src/objects/versusScreenBackgroundColors.ts +2 -8
- package/src/objects/versusScreenDirtSpotColors.ts +2 -8
- package/src/sets/bossSets.ts +143 -136
- package/dist/objects/levelNames.d.ts +0 -115
- package/dist/objects/levelNames.d.ts.map +0 -1
- package/dist/objects/levelNames.lua +0 -117
- package/src/objects/levelNames.ts +0 -141
|
@@ -16,8 +16,8 @@ import { BossID, EntityType } from "isaac-typescript-definitions";
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function getAliveBosses(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): readonly EntityNPC[];
|
|
18
18
|
/**
|
|
19
|
-
* Helper function to get
|
|
20
|
-
* enum
|
|
19
|
+
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
20
|
+
* enum.
|
|
21
21
|
*
|
|
22
22
|
* This includes:
|
|
23
23
|
* - Ultra Greed
|
|
@@ -30,12 +30,15 @@ export declare function getAliveBosses(entityType?: EntityType | -1, variant?: n
|
|
|
30
30
|
* - sub-bosses of The Beast fight (e.g. Ultra Famine, Ultra Pestilence, Ultra War, Ultra Death)
|
|
31
31
|
* - bosses that do not have any Boss Rooms defined due to being unfinished (e.g. Raglich)
|
|
32
32
|
*
|
|
33
|
-
* Also see the `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
* Also see the `getAllNonStoryBosses` function.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getAllBosses(): readonly BossID[];
|
|
36
|
+
/**
|
|
37
|
+
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
38
|
+
* enum. This is the same thing as the `getAllBosses` helper function, but with story bosses
|
|
39
|
+
* filtered out.
|
|
37
40
|
*/
|
|
38
|
-
export declare function
|
|
41
|
+
export declare function getAllNonStoryBosses(): readonly BossID[];
|
|
39
42
|
/**
|
|
40
43
|
* Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
41
44
|
* current room is not a Boss Room.
|
|
@@ -46,17 +49,25 @@ export declare function getAllBossesSet(includeStoryBosses?: boolean): ReadonlyS
|
|
|
46
49
|
export declare function getBossID(): BossID | undefined;
|
|
47
50
|
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
|
|
48
51
|
/**
|
|
49
|
-
* Helper function to get the
|
|
50
|
-
* `
|
|
52
|
+
* Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
53
|
+
* types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
54
|
+
* for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
55
|
+
*
|
|
56
|
+
* Also see the `getAllBossesSet` and `getBossIDsForStageID` functions.
|
|
51
57
|
*/
|
|
52
|
-
export declare function
|
|
58
|
+
export declare function getBossIDsForStage(stage: LevelStage): ReadonlySet<BossID> | undefined;
|
|
53
59
|
/**
|
|
54
|
-
* Helper function to get the set of vanilla bosses
|
|
55
|
-
*
|
|
60
|
+
* Helper function to get the set of vanilla bosses that can randomly appear on a particular stage
|
|
61
|
+
* ID.
|
|
56
62
|
*
|
|
57
|
-
* Also see the `getAllBossesSet` and `
|
|
63
|
+
* Also see the `getAllBossesSet` and `getBossIDsForStage` functions.
|
|
58
64
|
*/
|
|
59
|
-
export declare function
|
|
65
|
+
export declare function getBossIDsForStageID(stageID: StageID): readonly BossID[] | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Helper function to get the proper English name for a boss. For example, the name for
|
|
68
|
+
* `BossID.WRETCHED` (36) is "The Wretched".
|
|
69
|
+
*/
|
|
70
|
+
export declare function getBossName(bossID: BossID): string;
|
|
60
71
|
/** Helper function to get the set of stage IDs that a particular boss naturally appears in. */
|
|
61
72
|
export declare function getBossStageIDs(bossID: BossID): ReadonlySet<StageID>;
|
|
62
73
|
/**
|
|
@@ -71,14 +82,6 @@ export declare function getBossStageIDs(bossID: BossID): ReadonlySet<StageID>;
|
|
|
71
82
|
* @param ignoreFriendly Optional. Default is false.
|
|
72
83
|
*/
|
|
73
84
|
export declare function getBosses(entityType?: EntityType, variant?: int, subType?: int, ignoreFriendly?: boolean): readonly EntityNPC[];
|
|
74
|
-
/**
|
|
75
|
-
* Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
76
|
-
* types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
77
|
-
* for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
78
|
-
*
|
|
79
|
-
* Also see the `getAllBossesSet` and `getBossSet` functions.
|
|
80
|
-
*/
|
|
81
|
-
export declare function getCombinedBossSet(stage: LevelStage): ReadonlySet<BossID> | undefined;
|
|
82
85
|
export declare function getEntityTypeVariantFromBossID(bossID: BossID): readonly [EntityType, int];
|
|
83
86
|
/**
|
|
84
87
|
* Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,MAAM,EACN,UAAU,EAGX,MAAM,8BAA8B,CAAC;AAiCtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,SAAS,EAAE,CAGtB;AAED
|
|
1
|
+
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,MAAM,EACN,UAAU,EAGX,MAAM,8BAA8B,CAAC;AAiCtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,SAAS,EAAE,CAGtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,IAAI,SAAS,MAAM,EAAE,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CA0B9C;A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iCX;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
|
|
@@ -19,10 +19,10 @@ local ____bossNames = require("objects.bossNames")
|
|
|
19
19
|
local BOSS_NAMES = ____bossNames.BOSS_NAMES
|
|
20
20
|
local DEFAULT_BOSS_NAME = ____bossNames.DEFAULT_BOSS_NAME
|
|
21
21
|
local ____bossSets = require("sets.bossSets")
|
|
22
|
-
local
|
|
23
|
-
local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
|
|
22
|
+
local ALL_BOSSES = ____bossSets.ALL_BOSSES
|
|
24
23
|
local BOSS_ID_TO_STAGE_IDS = ____bossSets.BOSS_ID_TO_STAGE_IDS
|
|
25
|
-
local
|
|
24
|
+
local NON_STORY_BOSSES = ____bossSets.NON_STORY_BOSSES
|
|
25
|
+
local STAGE_ID_TO_BOSS_IDS = ____bossSets.STAGE_ID_TO_BOSS_IDS
|
|
26
26
|
local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
|
|
27
27
|
local ____repentanceBossIDsSet = require("sets.repentanceBossIDsSet")
|
|
28
28
|
local REPENTANCE_ONLY_BOSS_IDS_SET = ____repentanceBossIDsSet.REPENTANCE_ONLY_BOSS_IDS_SET
|
|
@@ -89,8 +89,8 @@ function ____exports.getAliveBosses(self, entityType, variant, subType, ignoreFr
|
|
|
89
89
|
function(____, aliveNPC) return aliveNPC:IsBoss() end
|
|
90
90
|
)
|
|
91
91
|
end
|
|
92
|
-
--- Helper function to get
|
|
93
|
-
-- enum
|
|
92
|
+
--- Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
93
|
+
-- enum.
|
|
94
94
|
--
|
|
95
95
|
-- This includes:
|
|
96
96
|
-- - Ultra Greed
|
|
@@ -103,15 +103,15 @@ end
|
|
|
103
103
|
-- - sub-bosses of The Beast fight (e.g. Ultra Famine, Ultra Pestilence, Ultra War, Ultra Death)
|
|
104
104
|
-- - bosses that do not have any Boss Rooms defined due to being unfinished (e.g. Raglich)
|
|
105
105
|
--
|
|
106
|
-
-- Also see the `
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return
|
|
106
|
+
-- Also see the `getAllNonStoryBosses` function.
|
|
107
|
+
function ____exports.getAllBosses(self)
|
|
108
|
+
return ALL_BOSSES
|
|
109
|
+
end
|
|
110
|
+
--- Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
111
|
+
-- enum. This is the same thing as the `getAllBosses` helper function, but with story bosses
|
|
112
|
+
-- filtered out.
|
|
113
|
+
function ____exports.getAllNonStoryBosses(self)
|
|
114
|
+
return NON_STORY_BOSSES
|
|
115
115
|
end
|
|
116
116
|
--- Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
117
117
|
-- current room is not a Boss Room.
|
|
@@ -139,18 +139,26 @@ function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
|
|
|
139
139
|
local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
|
|
140
140
|
return ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP:get(entityTypeVariant)
|
|
141
141
|
end
|
|
142
|
+
--- Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
143
|
+
-- types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
144
|
+
-- for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
145
|
+
--
|
|
146
|
+
-- Also see the `getAllBossesSet` and `getBossIDsForStageID` functions.
|
|
147
|
+
function ____exports.getBossIDsForStage(self, stage)
|
|
148
|
+
return STAGE_TO_COMBINED_BOSS_SET_MAP:get(stage)
|
|
149
|
+
end
|
|
150
|
+
--- Helper function to get the set of vanilla bosses that can randomly appear on a particular stage
|
|
151
|
+
-- ID.
|
|
152
|
+
--
|
|
153
|
+
-- Also see the `getAllBossesSet` and `getBossIDsForStage` functions.
|
|
154
|
+
function ____exports.getBossIDsForStageID(self, stageID)
|
|
155
|
+
return STAGE_ID_TO_BOSS_IDS:get(stageID)
|
|
156
|
+
end
|
|
142
157
|
--- Helper function to get the proper English name for a boss. For example, the name for
|
|
143
158
|
-- `BossID.WRETCHED` (36) is "The Wretched".
|
|
144
159
|
function ____exports.getBossName(self, bossID)
|
|
145
160
|
return BOSS_NAMES[bossID] or DEFAULT_BOSS_NAME
|
|
146
161
|
end
|
|
147
|
-
--- Helper function to get the set of vanilla bosses for a particular stage and stage type
|
|
148
|
-
-- combination.
|
|
149
|
-
--
|
|
150
|
-
-- Also see the `getAllBossesSet` and `getCombinedBossSet` functions.
|
|
151
|
-
function ____exports.getBossSet(self, stageID)
|
|
152
|
-
return STAGE_ID_TO_BOSS_SET_MAP:get(stageID)
|
|
153
|
-
end
|
|
154
162
|
--- Helper function to get the set of stage IDs that a particular boss naturally appears in.
|
|
155
163
|
function ____exports.getBossStageIDs(self, bossID)
|
|
156
164
|
return BOSS_ID_TO_STAGE_IDS[bossID]
|
|
@@ -180,14 +188,6 @@ function ____exports.getBosses(self, entityType, variant, subType, ignoreFriendl
|
|
|
180
188
|
function(____, npc) return npc:IsBoss() end
|
|
181
189
|
)
|
|
182
190
|
end
|
|
183
|
-
--- Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
184
|
-
-- types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
185
|
-
-- for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
186
|
-
--
|
|
187
|
-
-- Also see the `getAllBossesSet` and `getBossSet` functions.
|
|
188
|
-
function ____exports.getCombinedBossSet(self, stage)
|
|
189
|
-
return STAGE_TO_COMBINED_BOSS_SET_MAP:get(stage)
|
|
190
|
-
end
|
|
191
191
|
function ____exports.getEntityTypeVariantFromBossID(self, bossID)
|
|
192
192
|
return BOSS_ID_TO_ENTITY_TYPE_VARIANT[bossID]
|
|
193
193
|
end
|
|
@@ -208,21 +208,21 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
208
208
|
return numSegments
|
|
209
209
|
end
|
|
210
210
|
repeat
|
|
211
|
-
local
|
|
212
|
-
local
|
|
213
|
-
if
|
|
211
|
+
local ____switch23 = entityType
|
|
212
|
+
local ____cond23 = ____switch23 == EntityType.CHUB
|
|
213
|
+
if ____cond23 then
|
|
214
214
|
do
|
|
215
215
|
return 3
|
|
216
216
|
end
|
|
217
217
|
end
|
|
218
|
-
|
|
219
|
-
if
|
|
218
|
+
____cond23 = ____cond23 or ____switch23 == EntityType.LOKI
|
|
219
|
+
if ____cond23 then
|
|
220
220
|
do
|
|
221
221
|
return variant == LokiVariant.LOKII and 2 or 1
|
|
222
222
|
end
|
|
223
223
|
end
|
|
224
|
-
|
|
225
|
-
if
|
|
224
|
+
____cond23 = ____cond23 or ____switch23 == EntityType.GURGLING
|
|
225
|
+
if ____cond23 then
|
|
226
226
|
do
|
|
227
227
|
return 2
|
|
228
228
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LevelStage, RoomType, StageType } from "isaac-typescript-definitions";
|
|
1
|
+
import { LevelStage, RoomType, StageID, StageType } from "isaac-typescript-definitions";
|
|
3
2
|
/**
|
|
4
3
|
* Helper function that calculates what the stage type should be for the provided stage. This
|
|
5
4
|
* emulates what the game's internal code does.
|
|
@@ -42,9 +41,13 @@ export declare function getLevelName(stage?: LevelStage, stageType?: StageType):
|
|
|
42
41
|
/** Alias for the `Level.GetStage` method. */
|
|
43
42
|
export declare function getStage(): LevelStage;
|
|
44
43
|
/**
|
|
45
|
-
* Helper function to get the stage ID that corresponds to a particular
|
|
46
|
-
*
|
|
47
|
-
* `getRoomStageID` will not correctly return the `StageID` if the player is
|
|
44
|
+
* Helper function to get the stage ID that corresponds to a particular stage and stage type.
|
|
45
|
+
*
|
|
46
|
+
* This is useful because `getRoomStageID` will not correctly return the `StageID` if the player is
|
|
47
|
+
* in a special room.
|
|
48
|
+
*
|
|
49
|
+
* This correctly handles the case of Greed Mode. In Greed Mode, if an undefined stage and stage
|
|
50
|
+
* type combination are passed, `StageID.SPECIAL_ROOMS` (0) will be returned.
|
|
48
51
|
*
|
|
49
52
|
* @param stage Optional. If not specified, the stage corresponding to the current floor will be
|
|
50
53
|
* used.
|
|
@@ -52,6 +55,15 @@ export declare function getStage(): LevelStage;
|
|
|
52
55
|
* will be used.
|
|
53
56
|
*/
|
|
54
57
|
export declare function getStageID(stage?: LevelStage, stageType?: StageType): StageID;
|
|
58
|
+
/**
|
|
59
|
+
* Helper function to get the English name corresponding to a stage ID. For example, "Caves".
|
|
60
|
+
*
|
|
61
|
+
* This is derived from the data in the "stages.xml" file.
|
|
62
|
+
*
|
|
63
|
+
* Note that unlike "stages.xml", Blue Womb is specified with a name of "Blue Womb" instead of
|
|
64
|
+
* "???".
|
|
65
|
+
*/
|
|
66
|
+
export declare function getStageIDName(stageID: StageID): string;
|
|
55
67
|
/** Alias for the `Level.GetStageType` method. */
|
|
56
68
|
export declare function getStageType(): StageType;
|
|
57
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAatC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAA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,OAAO,CAGrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAK1D;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAKzD;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAM1D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAMtD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAMpD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAYN"}
|
package/dist/functions/stage.lua
CHANGED
|
@@ -5,15 +5,17 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
5
5
|
local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
|
|
6
6
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
7
7
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
8
|
+
local StageID = ____isaac_2Dtypescript_2Ddefinitions.StageID
|
|
8
9
|
local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
|
|
9
10
|
local ____cachedClasses = require("core.cachedClasses")
|
|
10
11
|
local game = ____cachedClasses.game
|
|
11
|
-
local ____levelNames = require("objects.levelNames")
|
|
12
|
-
local LEVEL_NAMES = ____levelNames.LEVEL_NAMES
|
|
13
12
|
local ____roomTypeSpecialGotoPrefixes = require("objects.roomTypeSpecialGotoPrefixes")
|
|
14
13
|
local ROOM_TYPE_SPECIAL_GOTO_PREFIXES = ____roomTypeSpecialGotoPrefixes.ROOM_TYPE_SPECIAL_GOTO_PREFIXES
|
|
14
|
+
local ____stageIDNames = require("objects.stageIDNames")
|
|
15
|
+
local STAGE_ID_NAMES = ____stageIDNames.STAGE_ID_NAMES
|
|
15
16
|
local ____stageToStageID = require("objects.stageToStageID")
|
|
16
17
|
local STAGE_TO_STAGE_ID = ____stageToStageID.STAGE_TO_STAGE_ID
|
|
18
|
+
local STAGE_TO_STAGE_ID_GREED_MODE = ____stageToStageID.STAGE_TO_STAGE_ID_GREED_MODE
|
|
17
19
|
local ____stageTypeSuffixes = require("objects.stageTypeSuffixes")
|
|
18
20
|
local STAGE_TYPE_SUFFIXES = ____stageTypeSuffixes.STAGE_TYPE_SUFFIXES
|
|
19
21
|
local ____log = require("functions.log")
|
|
@@ -22,6 +24,45 @@ local ____types = require("functions.types")
|
|
|
22
24
|
local asLevelStage = ____types.asLevelStage
|
|
23
25
|
local ____utils = require("functions.utils")
|
|
24
26
|
local inRange = ____utils.inRange
|
|
27
|
+
--- Helper function to get the stage ID that corresponds to a particular stage and stage type.
|
|
28
|
+
--
|
|
29
|
+
-- This is useful because `getRoomStageID` will not correctly return the `StageID` if the player is
|
|
30
|
+
-- in a special room.
|
|
31
|
+
--
|
|
32
|
+
-- This correctly handles the case of Greed Mode. In Greed Mode, if an undefined stage and stage
|
|
33
|
+
-- type combination are passed, `StageID.SPECIAL_ROOMS` (0) will be returned.
|
|
34
|
+
--
|
|
35
|
+
-- @param stage Optional. If not specified, the stage corresponding to the current floor will be
|
|
36
|
+
-- used.
|
|
37
|
+
-- @param stageType Optional. If not specified, the stage type corresponding to the current floor
|
|
38
|
+
-- will be used.
|
|
39
|
+
function ____exports.getStageID(self, stage, stageType)
|
|
40
|
+
local level = game:GetLevel()
|
|
41
|
+
if stage == nil then
|
|
42
|
+
stage = level:GetStage()
|
|
43
|
+
end
|
|
44
|
+
if stageType == nil then
|
|
45
|
+
stageType = level:GetStageType()
|
|
46
|
+
end
|
|
47
|
+
if game:IsGreedMode() then
|
|
48
|
+
local stageTypeToStageID = STAGE_TO_STAGE_ID_GREED_MODE:get(stage)
|
|
49
|
+
if stageTypeToStageID == nil then
|
|
50
|
+
return StageID.SPECIAL_ROOMS
|
|
51
|
+
end
|
|
52
|
+
return stageTypeToStageID[stageType]
|
|
53
|
+
end
|
|
54
|
+
local stageTypeToStageID = STAGE_TO_STAGE_ID[stage]
|
|
55
|
+
return stageTypeToStageID[stageType]
|
|
56
|
+
end
|
|
57
|
+
--- Helper function to get the English name corresponding to a stage ID. For example, "Caves".
|
|
58
|
+
--
|
|
59
|
+
-- This is derived from the data in the "stages.xml" file.
|
|
60
|
+
--
|
|
61
|
+
-- Note that unlike "stages.xml", Blue Womb is specified with a name of "Blue Womb" instead of
|
|
62
|
+
-- "???".
|
|
63
|
+
function ____exports.getStageIDName(self, stageID)
|
|
64
|
+
return STAGE_ID_NAMES[stageID]
|
|
65
|
+
end
|
|
25
66
|
--- Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
|
|
26
67
|
-- `StageType.REPENTANCE_B`.
|
|
27
68
|
function ____exports.isRepentanceStage(self, stageType)
|
|
@@ -114,33 +155,39 @@ function ____exports.getLevelName(self, stage, stageType)
|
|
|
114
155
|
if stageType == nil then
|
|
115
156
|
stageType = level:GetStageType()
|
|
116
157
|
end
|
|
117
|
-
local
|
|
118
|
-
|
|
158
|
+
local stageID = ____exports.getStageID(nil, stage, stageType)
|
|
159
|
+
local stageIDName = ____exports.getStageIDName(nil, stageID)
|
|
160
|
+
local suffix
|
|
161
|
+
repeat
|
|
162
|
+
local ____switch14 = stage
|
|
163
|
+
local ____cond14 = ____switch14 == LevelStage.BASEMENT_1 or ____switch14 == LevelStage.CAVES_1 or ____switch14 == LevelStage.DEPTHS_1 or ____switch14 == LevelStage.WOMB_1
|
|
164
|
+
if ____cond14 then
|
|
165
|
+
do
|
|
166
|
+
suffix = " 1"
|
|
167
|
+
break
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
____cond14 = ____cond14 or (____switch14 == LevelStage.BASEMENT_2 or ____switch14 == LevelStage.CAVES_2 or ____switch14 == LevelStage.DEPTHS_2 or ____switch14 == LevelStage.WOMB_2)
|
|
171
|
+
if ____cond14 then
|
|
172
|
+
do
|
|
173
|
+
suffix = " 2"
|
|
174
|
+
break
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
do
|
|
178
|
+
do
|
|
179
|
+
suffix = ""
|
|
180
|
+
break
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
until true
|
|
184
|
+
return stageIDName .. suffix
|
|
119
185
|
end
|
|
120
186
|
--- Alias for the `Level.GetStage` method.
|
|
121
187
|
function ____exports.getStage(self)
|
|
122
188
|
local level = game:GetLevel()
|
|
123
189
|
return level:GetStage()
|
|
124
190
|
end
|
|
125
|
-
--- Helper function to get the stage ID that corresponds to a particular floor. It does this by
|
|
126
|
-
-- manually converting `LevelStage` and `StageType` into `StageID`. This is useful because
|
|
127
|
-
-- `getRoomStageID` will not correctly return the `StageID` if the player is in a special room.
|
|
128
|
-
--
|
|
129
|
-
-- @param stage Optional. If not specified, the stage corresponding to the current floor will be
|
|
130
|
-
-- used.
|
|
131
|
-
-- @param stageType Optional. If not specified, the stage type corresponding to the current floor
|
|
132
|
-
-- will be used.
|
|
133
|
-
function ____exports.getStageID(self, stage, stageType)
|
|
134
|
-
local level = game:GetLevel()
|
|
135
|
-
if stage == nil then
|
|
136
|
-
stage = level:GetStage()
|
|
137
|
-
end
|
|
138
|
-
if stageType == nil then
|
|
139
|
-
stageType = level:GetStageType()
|
|
140
|
-
end
|
|
141
|
-
local stageTypeToStageID = STAGE_TO_STAGE_ID[stage]
|
|
142
|
-
return stageTypeToStageID[stageType]
|
|
143
|
-
end
|
|
144
191
|
--- Alias for the `Level.GetStageType` method.
|
|
145
192
|
function ____exports.getStageType(self)
|
|
146
193
|
local level = game:GetLevel()
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ import { RoomType } from 'isaac-typescript-definitions';
|
|
|
76
76
|
import type { SackSubType } from 'isaac-typescript-definitions';
|
|
77
77
|
import { SeedEffect } from 'isaac-typescript-definitions';
|
|
78
78
|
import { SlotVariant } from 'isaac-typescript-definitions';
|
|
79
|
-
import
|
|
79
|
+
import { StageID } from 'isaac-typescript-definitions';
|
|
80
80
|
import { StageType } from 'isaac-typescript-definitions';
|
|
81
81
|
import { TearFlag } from 'isaac-typescript-definitions';
|
|
82
82
|
import type { TearVariant } from 'isaac-typescript-definitions';
|
|
@@ -4912,8 +4912,8 @@ export declare function getAliveBosses(entityType?: EntityType | -1, variant?: n
|
|
|
4912
4912
|
export declare function getAliveNPCs(entityType?: EntityType | -1, variant?: number, subType?: number, ignoreFriendly?: boolean): readonly EntityNPC[];
|
|
4913
4913
|
|
|
4914
4914
|
/**
|
|
4915
|
-
* Helper function to get
|
|
4916
|
-
* enum
|
|
4915
|
+
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
4916
|
+
* enum.
|
|
4917
4917
|
*
|
|
4918
4918
|
* This includes:
|
|
4919
4919
|
* - Ultra Greed
|
|
@@ -4926,12 +4926,9 @@ export declare function getAliveNPCs(entityType?: EntityType | -1, variant?: num
|
|
|
4926
4926
|
* - sub-bosses of The Beast fight (e.g. Ultra Famine, Ultra Pestilence, Ultra War, Ultra Death)
|
|
4927
4927
|
* - bosses that do not have any Boss Rooms defined due to being unfinished (e.g. Raglich)
|
|
4928
4928
|
*
|
|
4929
|
-
* Also see the `
|
|
4930
|
-
*
|
|
4931
|
-
* @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives.
|
|
4932
|
-
* Default is true.
|
|
4929
|
+
* Also see the `getAllNonStoryBosses` function.
|
|
4933
4930
|
*/
|
|
4934
|
-
export declare function
|
|
4931
|
+
export declare function getAllBosses(): readonly BossID[];
|
|
4935
4932
|
|
|
4936
4933
|
/**
|
|
4937
4934
|
* Helper function to get every legal grid index for the current room.
|
|
@@ -4940,6 +4937,13 @@ export declare function getAllBossesSet(includeStoryBosses?: boolean): ReadonlyS
|
|
|
4940
4937
|
*/
|
|
4941
4938
|
export declare function getAllGridIndexes(): readonly int[];
|
|
4942
4939
|
|
|
4940
|
+
/**
|
|
4941
|
+
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
4942
|
+
* enum. This is the same thing as the `getAllBosses` helper function, but with story bosses
|
|
4943
|
+
* filtered out.
|
|
4944
|
+
*/
|
|
4945
|
+
export declare function getAllNonStoryBosses(): readonly BossID[];
|
|
4946
|
+
|
|
4943
4947
|
/**
|
|
4944
4948
|
* Helper function to get an array with every non-null pill color. This includes all gold colors and
|
|
4945
4949
|
* all horse colors.
|
|
@@ -5118,6 +5122,23 @@ export declare function getBossID(): BossID | undefined;
|
|
|
5118
5122
|
|
|
5119
5123
|
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
|
|
5120
5124
|
|
|
5125
|
+
/**
|
|
5126
|
+
* Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
5127
|
+
* types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
5128
|
+
* for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
5129
|
+
*
|
|
5130
|
+
* Also see the `getAllBossesSet` and `getBossIDsForStageID` functions.
|
|
5131
|
+
*/
|
|
5132
|
+
export declare function getBossIDsForStage(stage: LevelStage): ReadonlySet<BossID> | undefined;
|
|
5133
|
+
|
|
5134
|
+
/**
|
|
5135
|
+
* Helper function to get the set of vanilla bosses that can randomly appear on a particular stage
|
|
5136
|
+
* ID.
|
|
5137
|
+
*
|
|
5138
|
+
* Also see the `getAllBossesSet` and `getBossIDsForStage` functions.
|
|
5139
|
+
*/
|
|
5140
|
+
export declare function getBossIDsForStageID(stageID: StageID): readonly BossID[] | undefined;
|
|
5141
|
+
|
|
5121
5142
|
/**
|
|
5122
5143
|
* Helper function to get the proper English name for a boss. For example, the name for
|
|
5123
5144
|
* `BossID.WRETCHED` (36) is "The Wretched".
|
|
@@ -5148,14 +5169,6 @@ export declare function getBossPortraitPNGFilePath(bossID: BossID): string;
|
|
|
5148
5169
|
*/
|
|
5149
5170
|
export declare function getBossRushDoor(): GridEntityDoor | undefined;
|
|
5150
5171
|
|
|
5151
|
-
/**
|
|
5152
|
-
* Helper function to get the set of vanilla bosses for a particular stage and stage type
|
|
5153
|
-
* combination.
|
|
5154
|
-
*
|
|
5155
|
-
* Also see the `getAllBossesSet` and `getCombinedBossSet` functions.
|
|
5156
|
-
*/
|
|
5157
|
-
export declare function getBossSet(stageID: StageID): ReadonlySet<BossID> | undefined;
|
|
5158
|
-
|
|
5159
5172
|
/** Helper function to get the set of stage IDs that a particular boss naturally appears in. */
|
|
5160
5173
|
export declare function getBossStageIDs(bossID: BossID): ReadonlySet<StageID>;
|
|
5161
5174
|
|
|
@@ -5520,15 +5533,6 @@ export declare function getCollectibleTags(collectibleOrCollectibleType: EntityP
|
|
|
5520
5533
|
*/
|
|
5521
5534
|
export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntity): readonly Entity[];
|
|
5522
5535
|
|
|
5523
|
-
/**
|
|
5524
|
-
* Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
5525
|
-
* types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
5526
|
-
* for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
5527
|
-
*
|
|
5528
|
-
* Also see the `getAllBossesSet` and `getBossSet` functions.
|
|
5529
|
-
*/
|
|
5530
|
-
export declare function getCombinedBossSet(stage: LevelStage): ReadonlySet<BossID> | undefined;
|
|
5531
|
-
|
|
5532
5536
|
/** Helper function to get the entity type, variant, and sub-type from an `EntityID`. */
|
|
5533
5537
|
export declare function getConstituentsFromEntityID(entityID: EntityID): [entityType: EntityType, variant: int, subType: int];
|
|
5534
5538
|
|
|
@@ -7889,9 +7893,13 @@ export declare function getSpikes(variant?: number): readonly GridEntitySpikes[]
|
|
|
7889
7893
|
export declare function getStage(): LevelStage;
|
|
7890
7894
|
|
|
7891
7895
|
/**
|
|
7892
|
-
* Helper function to get the stage ID that corresponds to a particular
|
|
7893
|
-
*
|
|
7894
|
-
* `getRoomStageID` will not correctly return the `StageID` if the player is
|
|
7896
|
+
* Helper function to get the stage ID that corresponds to a particular stage and stage type.
|
|
7897
|
+
*
|
|
7898
|
+
* This is useful because `getRoomStageID` will not correctly return the `StageID` if the player is
|
|
7899
|
+
* in a special room.
|
|
7900
|
+
*
|
|
7901
|
+
* This correctly handles the case of Greed Mode. In Greed Mode, if an undefined stage and stage
|
|
7902
|
+
* type combination are passed, `StageID.SPECIAL_ROOMS` (0) will be returned.
|
|
7895
7903
|
*
|
|
7896
7904
|
* @param stage Optional. If not specified, the stage corresponding to the current floor will be
|
|
7897
7905
|
* used.
|
|
@@ -7900,6 +7908,16 @@ export declare function getStage(): LevelStage;
|
|
|
7900
7908
|
*/
|
|
7901
7909
|
export declare function getStageID(stage?: LevelStage, stageType?: StageType): StageID;
|
|
7902
7910
|
|
|
7911
|
+
/**
|
|
7912
|
+
* Helper function to get the English name corresponding to a stage ID. For example, "Caves".
|
|
7913
|
+
*
|
|
7914
|
+
* This is derived from the data in the "stages.xml" file.
|
|
7915
|
+
*
|
|
7916
|
+
* Note that unlike "stages.xml", Blue Womb is specified with a name of "Blue Womb" instead of
|
|
7917
|
+
* "???".
|
|
7918
|
+
*/
|
|
7919
|
+
export declare function getStageIDName(stageID: StageID): string;
|
|
7920
|
+
|
|
7903
7921
|
/** Alias for the `Level.GetStageType` method. */
|
|
7904
7922
|
export declare function getStageType(): StageType;
|
|
7905
7923
|
|