isaacscript-common 51.6.0 → 51.7.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 +57 -8
- package/dist/isaacscript-common.lua +36 -13
- package/dist/src/functions/bosses.d.ts +10 -2
- package/dist/src/functions/bosses.d.ts.map +1 -1
- package/dist/src/functions/bosses.lua +32 -11
- package/dist/src/functions/rooms.d.ts +45 -7
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +44 -9
- package/package.json +1 -1
- package/src/functions/bosses.ts +29 -11
- package/src/functions/rooms.ts +57 -7
package/dist/index.rollup.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { BackdropType } from 'isaac-typescript-definitions';
|
|
|
7
7
|
import type { BatterySubType } from 'isaac-typescript-definitions';
|
|
8
8
|
import type { BombSubType } from 'isaac-typescript-definitions';
|
|
9
9
|
import type { BombVariant } from 'isaac-typescript-definitions';
|
|
10
|
-
import
|
|
10
|
+
import { BossID } from 'isaac-typescript-definitions';
|
|
11
11
|
import { ButtonAction } from 'isaac-typescript-definitions';
|
|
12
12
|
import { CacheFlag } from 'isaac-typescript-definitions';
|
|
13
13
|
import { CallbackPriority } from 'isaac-typescript-definitions/dist/src/enums/CallbackPriority';
|
|
@@ -4909,6 +4909,15 @@ export declare function getBooleansFromTable(luaMap: LuaMap<string, unknown>, ob
|
|
|
4909
4909
|
*/
|
|
4910
4910
|
export declare function getBosses(entityType?: EntityType, variant?: int, subType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
4911
4911
|
|
|
4912
|
+
/**
|
|
4913
|
+
* Helper function to get the boss ID corresponding to the current room. Returns 0 if the current
|
|
4914
|
+
* room is not a Boss Room.
|
|
4915
|
+
*
|
|
4916
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it correctly handles Dogma and The
|
|
4917
|
+
* Beast.
|
|
4918
|
+
*/
|
|
4919
|
+
export declare function getBossID(): BossID | 0;
|
|
4920
|
+
|
|
4912
4921
|
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
|
|
4913
4922
|
|
|
4914
4923
|
/**
|
|
@@ -8088,18 +8097,25 @@ declare type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
|
8088
8097
|
*/
|
|
8089
8098
|
export declare function in2x1Room(): boolean;
|
|
8090
8099
|
|
|
8100
|
+
/**
|
|
8101
|
+
* Helper function to check to see if the current room is an angel shop.
|
|
8102
|
+
*
|
|
8103
|
+
* Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
8104
|
+
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
8105
|
+
*/
|
|
8091
8106
|
export declare function inAngelShop(): boolean;
|
|
8092
8107
|
|
|
8093
8108
|
/**
|
|
8094
|
-
* Helper function to check to see if the current room is
|
|
8109
|
+
* Helper function to check to see if the current room is the Boss Room for The Beast.
|
|
8095
8110
|
*
|
|
8096
|
-
* Under the hood, this checks the room type and sub-type
|
|
8111
|
+
* Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
8112
|
+
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
8097
8113
|
*/
|
|
8098
8114
|
export declare function inBeastRoom(): boolean;
|
|
8099
8115
|
|
|
8100
8116
|
/**
|
|
8101
|
-
* Helper function to check if the current room is
|
|
8102
|
-
* work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
8117
|
+
* Helper function to check if the current room is the Boss Room for a particular boss. This will
|
|
8118
|
+
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
8103
8119
|
*/
|
|
8104
8120
|
export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
8105
8121
|
|
|
@@ -8148,6 +8164,19 @@ export declare function inDevilsCrownTreasureRoom(): boolean;
|
|
|
8148
8164
|
|
|
8149
8165
|
export declare function inDimension(dimension: Dimension): boolean;
|
|
8150
8166
|
|
|
8167
|
+
/**
|
|
8168
|
+
* Helper function to check to see if the current room is the Boss Room for Dogma.
|
|
8169
|
+
*
|
|
8170
|
+
* Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
8171
|
+
* Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
8172
|
+
*
|
|
8173
|
+
* Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
8174
|
+
* being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
8175
|
+
* Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
8176
|
+
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
8177
|
+
*/
|
|
8178
|
+
export declare function inDogmaRoom(): boolean;
|
|
8179
|
+
|
|
8151
8180
|
/**
|
|
8152
8181
|
* Helper function to detect if the current room is a Double Trouble Boss Room.
|
|
8153
8182
|
*
|
|
@@ -8437,6 +8466,12 @@ export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[] | readon
|
|
|
8437
8466
|
|
|
8438
8467
|
export declare function isAngelRoomDoor(door: GridEntityDoor): boolean;
|
|
8439
8468
|
|
|
8469
|
+
/**
|
|
8470
|
+
* Helper function to check to see if the current room is an angel shop.
|
|
8471
|
+
*
|
|
8472
|
+
* Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
8473
|
+
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
8474
|
+
*/
|
|
8440
8475
|
export declare function isAngelShop(roomData: RoomConfig): boolean;
|
|
8441
8476
|
|
|
8442
8477
|
/**
|
|
@@ -8466,9 +8501,10 @@ export declare function isArrayInArray<T>(arrayToMatch: T[] | readonly T[], pare
|
|
|
8466
8501
|
export declare function isBattery(pickup: EntityPickup): pickup is EntityPickupBattery;
|
|
8467
8502
|
|
|
8468
8503
|
/**
|
|
8469
|
-
* Helper function to check to see if the provided room is
|
|
8504
|
+
* Helper function to check to see if the provided room is the Boss Room for The Beast.
|
|
8470
8505
|
*
|
|
8471
|
-
* Under the hood, this checks the room type and sub-type
|
|
8506
|
+
* Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
8507
|
+
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
8472
8508
|
*/
|
|
8473
8509
|
export declare function isBeastRoom(roomData: RoomConfig): boolean;
|
|
8474
8510
|
|
|
@@ -8506,7 +8542,7 @@ export declare function isBombPickup(pickup: EntityPickup): pickup is EntityPick
|
|
|
8506
8542
|
export declare function isBoolean(variable: unknown): variable is boolean;
|
|
8507
8543
|
|
|
8508
8544
|
/**
|
|
8509
|
-
* Helper function to check if the provided room is
|
|
8545
|
+
* Helper function to check if the provided room is the Boss Room for a particular boss. This will
|
|
8510
8546
|
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
8511
8547
|
*/
|
|
8512
8548
|
export declare function isBossRoomOf(roomData: RoomConfig, bossID: BossID): boolean;
|
|
@@ -8785,6 +8821,19 @@ export declare function isDevilRoomDoor(door: GridEntityDoor): boolean;
|
|
|
8785
8821
|
*/
|
|
8786
8822
|
export declare function isDevilsCrownTreasureRoom(roomDescriptor: RoomDescriptor): boolean;
|
|
8787
8823
|
|
|
8824
|
+
/**
|
|
8825
|
+
* Helper function to check to see if the provided room is the Boss Room for Dogma.
|
|
8826
|
+
*
|
|
8827
|
+
* Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
8828
|
+
* Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
8829
|
+
*
|
|
8830
|
+
* Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
8831
|
+
* being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
8832
|
+
* Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
8833
|
+
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
8834
|
+
*/
|
|
8835
|
+
export declare function isDogmaRoom(roomData: RoomConfig): boolean;
|
|
8836
|
+
|
|
8788
8837
|
/** Helper function to detect if a variable is of type `GridEntityDoor`. */
|
|
8789
8838
|
export declare function isDoor(variable: unknown): variable is GridEntityDoor;
|
|
8790
8839
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 51.
|
|
3
|
+
isaacscript-common 51.7.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -28010,6 +28010,9 @@ end
|
|
|
28010
28010
|
function ____exports.isDevilsCrownTreasureRoom(self, roomDescriptor)
|
|
28011
28011
|
return hasFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.DEVIL_TREASURE)
|
|
28012
28012
|
end
|
|
28013
|
+
function ____exports.isDogmaRoom(self, roomData)
|
|
28014
|
+
return roomData.StageID == StageID.HOME and roomData.Type == RoomType.DEFAULT and roomData.Variant == 1000 and roomData.Subtype == asNumber(nil, HomeRoomSubType.LIVING_ROOM)
|
|
28015
|
+
end
|
|
28013
28016
|
function ____exports.isDoubleTrouble(self, roomData)
|
|
28014
28017
|
return roomData.Type == RoomType.BOSS and __TS__StringIncludes(roomData.Name, "Double Trouble")
|
|
28015
28018
|
end
|
|
@@ -28146,6 +28149,10 @@ function ____exports.inDevilsCrownTreasureRoom(self)
|
|
|
28146
28149
|
local roomDescriptor = getRoomDescriptorReadOnly(nil)
|
|
28147
28150
|
return ____exports.isDevilsCrownTreasureRoom(nil, roomDescriptor)
|
|
28148
28151
|
end
|
|
28152
|
+
function ____exports.inDogmaRoom(self)
|
|
28153
|
+
local roomData = getRoomData(nil)
|
|
28154
|
+
return ____exports.isDogmaRoom(nil, roomData)
|
|
28155
|
+
end
|
|
28149
28156
|
function ____exports.inDoubleTrouble(self)
|
|
28150
28157
|
local roomData = getRoomData(nil)
|
|
28151
28158
|
return ____exports.isDoubleTrouble(nil, roomData)
|
|
@@ -28261,12 +28268,12 @@ function ____exports.setRoomCleared(self)
|
|
|
28261
28268
|
for ____, door in ipairs(getDoors(nil)) do
|
|
28262
28269
|
do
|
|
28263
28270
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
28264
|
-
goto
|
|
28271
|
+
goto __continue82
|
|
28265
28272
|
end
|
|
28266
28273
|
openDoorFast(nil, door)
|
|
28267
28274
|
door.ExtraVisible = false
|
|
28268
28275
|
end
|
|
28269
|
-
::
|
|
28276
|
+
::__continue82::
|
|
28270
28277
|
end
|
|
28271
28278
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
28272
28279
|
game:ShakeScreen(0)
|
|
@@ -44558,8 +44565,11 @@ local __TS__New = ____lualib.__TS__New
|
|
|
44558
44565
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
44559
44566
|
local ____exports = {}
|
|
44560
44567
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
44568
|
+
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
44561
44569
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
44562
44570
|
local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
|
|
44571
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
44572
|
+
local game = ____cachedClasses.game
|
|
44563
44573
|
local ____constants = require("src.core.constants")
|
|
44564
44574
|
local VectorZero = ____constants.VectorZero
|
|
44565
44575
|
local ____entityTypeVariantToBossIDMap = require("src.maps.entityTypeVariantToBossIDMap")
|
|
@@ -44584,6 +44594,9 @@ local ____npcs = require("src.functions.npcs")
|
|
|
44584
44594
|
local getAliveNPCs = ____npcs.getAliveNPCs
|
|
44585
44595
|
local ____rng = require("src.functions.rng")
|
|
44586
44596
|
local isRNG = ____rng.isRNG
|
|
44597
|
+
local ____rooms = require("src.functions.rooms")
|
|
44598
|
+
local inBeastRoom = ____rooms.inBeastRoom
|
|
44599
|
+
local inDogmaRoom = ____rooms.inDogmaRoom
|
|
44587
44600
|
local ____types = require("src.functions.types")
|
|
44588
44601
|
local asNumber = ____types.asNumber
|
|
44589
44602
|
local ____utils = require("src.functions.utils")
|
|
@@ -44627,6 +44640,16 @@ function ____exports.getAllBossesSet(self, includeStoryBosses)
|
|
|
44627
44640
|
end
|
|
44628
44641
|
return includeStoryBosses and ALL_BOSSES_SET or ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
|
|
44629
44642
|
end
|
|
44643
|
+
function ____exports.getBossID(self)
|
|
44644
|
+
if inDogmaRoom(nil) then
|
|
44645
|
+
return BossID.DOGMA
|
|
44646
|
+
end
|
|
44647
|
+
if inBeastRoom(nil) then
|
|
44648
|
+
return BossID.BEAST
|
|
44649
|
+
end
|
|
44650
|
+
local room = game:GetRoom()
|
|
44651
|
+
return room:GetBossID()
|
|
44652
|
+
end
|
|
44630
44653
|
function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
|
|
44631
44654
|
local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
|
|
44632
44655
|
return ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP:get(entityTypeVariant)
|
|
@@ -44663,29 +44686,26 @@ end
|
|
|
44663
44686
|
function ____exports.isRepentanceBoss(self, bossID)
|
|
44664
44687
|
return REPENTANCE_ONLY_BOSS_IDS_SET:has(bossID)
|
|
44665
44688
|
end
|
|
44666
|
-
function ____exports.isSin(self, npc)
|
|
44667
|
-
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
44668
|
-
end
|
|
44669
44689
|
local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
44670
44690
|
if numSegments ~= nil then
|
|
44671
44691
|
return numSegments
|
|
44672
44692
|
end
|
|
44673
44693
|
repeat
|
|
44674
|
-
local
|
|
44675
|
-
local
|
|
44676
|
-
if
|
|
44694
|
+
local ____switch18 = entityType
|
|
44695
|
+
local ____cond18 = ____switch18 == EntityType.CHUB
|
|
44696
|
+
if ____cond18 then
|
|
44677
44697
|
do
|
|
44678
44698
|
return 3
|
|
44679
44699
|
end
|
|
44680
44700
|
end
|
|
44681
|
-
|
|
44682
|
-
if
|
|
44701
|
+
____cond18 = ____cond18 or ____switch18 == EntityType.LOKI
|
|
44702
|
+
if ____cond18 then
|
|
44683
44703
|
do
|
|
44684
44704
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
44685
44705
|
end
|
|
44686
44706
|
end
|
|
44687
|
-
|
|
44688
|
-
if
|
|
44707
|
+
____cond18 = ____cond18 or ____switch18 == EntityType.GURGLING
|
|
44708
|
+
if ____cond18 then
|
|
44689
44709
|
do
|
|
44690
44710
|
return 2
|
|
44691
44711
|
end
|
|
@@ -44697,6 +44717,9 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
44697
44717
|
end
|
|
44698
44718
|
until true
|
|
44699
44719
|
end
|
|
44720
|
+
function ____exports.isSin(self, npc)
|
|
44721
|
+
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
44722
|
+
end
|
|
44700
44723
|
function ____exports.spawnBoss(self, entityType, variant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG, numSegments)
|
|
44701
44724
|
if velocity == nil then
|
|
44702
44725
|
velocity = VectorZero
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { EntityType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
import { BossID, EntityType } from "isaac-typescript-definitions";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to get all of the non-dead bosses in the room.
|
|
5
5
|
*
|
|
@@ -35,6 +35,14 @@ export declare function getAliveBosses(entityType?: EntityType | -1, variant?: n
|
|
|
35
35
|
* Default is true.
|
|
36
36
|
*/
|
|
37
37
|
export declare function getAllBossesSet(includeStoryBosses?: boolean): ReadonlySet<BossID>;
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to get the boss ID corresponding to the current room. Returns 0 if the current
|
|
40
|
+
* room is not a Boss Room.
|
|
41
|
+
*
|
|
42
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it correctly handles Dogma and The
|
|
43
|
+
* Beast.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getBossID(): BossID | 0;
|
|
38
46
|
export declare function getBossIDFromEntityTypeVariant(entityType: EntityType, variant: int): BossID | undefined;
|
|
39
47
|
/**
|
|
40
48
|
* Helper function to get the set of vanilla bosses for a particular stage and stage type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AA+B/E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,kBAAkB,UAAO,GACxB,WAAW,CAAC,MAAM,CAAC,CAIrB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,CAAC,CAWtC;AAED,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,GACX,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAOjC;AAED;;;;;;;;;;GAUG;AACH,wB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
|
local ____exports = {}
|
|
5
5
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
|
+
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
6
7
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
7
8
|
local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
|
|
9
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
10
|
+
local game = ____cachedClasses.game
|
|
8
11
|
local ____constants = require("src.core.constants")
|
|
9
12
|
local VectorZero = ____constants.VectorZero
|
|
10
13
|
local ____entityTypeVariantToBossIDMap = require("src.maps.entityTypeVariantToBossIDMap")
|
|
@@ -29,6 +32,9 @@ local ____npcs = require("src.functions.npcs")
|
|
|
29
32
|
local getAliveNPCs = ____npcs.getAliveNPCs
|
|
30
33
|
local ____rng = require("src.functions.rng")
|
|
31
34
|
local isRNG = ____rng.isRNG
|
|
35
|
+
local ____rooms = require("src.functions.rooms")
|
|
36
|
+
local inBeastRoom = ____rooms.inBeastRoom
|
|
37
|
+
local inDogmaRoom = ____rooms.inDogmaRoom
|
|
32
38
|
local ____types = require("src.functions.types")
|
|
33
39
|
local asNumber = ____types.asNumber
|
|
34
40
|
local ____utils = require("src.functions.utils")
|
|
@@ -101,6 +107,21 @@ function ____exports.getAllBossesSet(self, includeStoryBosses)
|
|
|
101
107
|
end
|
|
102
108
|
return includeStoryBosses and ALL_BOSSES_SET or ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
|
|
103
109
|
end
|
|
110
|
+
--- Helper function to get the boss ID corresponding to the current room. Returns 0 if the current
|
|
111
|
+
-- room is not a Boss Room.
|
|
112
|
+
--
|
|
113
|
+
-- Use this instead of the vanilla `Room.GetBossID` method since it correctly handles Dogma and The
|
|
114
|
+
-- Beast.
|
|
115
|
+
function ____exports.getBossID(self)
|
|
116
|
+
if inDogmaRoom(nil) then
|
|
117
|
+
return BossID.DOGMA
|
|
118
|
+
end
|
|
119
|
+
if inBeastRoom(nil) then
|
|
120
|
+
return BossID.BEAST
|
|
121
|
+
end
|
|
122
|
+
local room = game:GetRoom()
|
|
123
|
+
return room:GetBossID()
|
|
124
|
+
end
|
|
104
125
|
function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
|
|
105
126
|
local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
|
|
106
127
|
return ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP:get(entityTypeVariant)
|
|
@@ -160,30 +181,26 @@ end
|
|
|
160
181
|
function ____exports.isRepentanceBoss(self, bossID)
|
|
161
182
|
return REPENTANCE_ONLY_BOSS_IDS_SET:has(bossID)
|
|
162
183
|
end
|
|
163
|
-
--- Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
|
|
164
|
-
function ____exports.isSin(self, npc)
|
|
165
|
-
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
166
|
-
end
|
|
167
184
|
local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
168
185
|
if numSegments ~= nil then
|
|
169
186
|
return numSegments
|
|
170
187
|
end
|
|
171
188
|
repeat
|
|
172
|
-
local
|
|
173
|
-
local
|
|
174
|
-
if
|
|
189
|
+
local ____switch18 = entityType
|
|
190
|
+
local ____cond18 = ____switch18 == EntityType.CHUB
|
|
191
|
+
if ____cond18 then
|
|
175
192
|
do
|
|
176
193
|
return 3
|
|
177
194
|
end
|
|
178
195
|
end
|
|
179
|
-
|
|
180
|
-
if
|
|
196
|
+
____cond18 = ____cond18 or ____switch18 == EntityType.LOKI
|
|
197
|
+
if ____cond18 then
|
|
181
198
|
do
|
|
182
199
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
183
200
|
end
|
|
184
201
|
end
|
|
185
|
-
|
|
186
|
-
if
|
|
202
|
+
____cond18 = ____cond18 or ____switch18 == EntityType.GURGLING
|
|
203
|
+
if ____cond18 then
|
|
187
204
|
do
|
|
188
205
|
return 2
|
|
189
206
|
end
|
|
@@ -195,6 +212,10 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
195
212
|
end
|
|
196
213
|
until true
|
|
197
214
|
end
|
|
215
|
+
--- Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
|
|
216
|
+
function ____exports.isSin(self, npc)
|
|
217
|
+
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
218
|
+
end
|
|
198
219
|
--- Helper function to spawn a boss.
|
|
199
220
|
--
|
|
200
221
|
-- Use this function instead of `spawnNPC` since it handles automatically spawning multiple segments
|
|
@@ -103,16 +103,23 @@ export declare function getRoomsOutsideGrid(): RoomDescriptor[];
|
|
|
103
103
|
* `RoomShape.2x1`.
|
|
104
104
|
*/
|
|
105
105
|
export declare function in2x1Room(): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Helper function to check to see if the current room is an angel shop.
|
|
108
|
+
*
|
|
109
|
+
* Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
110
|
+
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
111
|
+
*/
|
|
106
112
|
export declare function inAngelShop(): boolean;
|
|
107
113
|
/**
|
|
108
|
-
* Helper function to check to see if the current room is
|
|
114
|
+
* Helper function to check to see if the current room is the Boss Room for The Beast.
|
|
109
115
|
*
|
|
110
|
-
* Under the hood, this checks the room type and sub-type
|
|
116
|
+
* Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
117
|
+
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
111
118
|
*/
|
|
112
119
|
export declare function inBeastRoom(): boolean;
|
|
113
120
|
/**
|
|
114
|
-
* Helper function to check if the current room is
|
|
115
|
-
* work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
121
|
+
* Helper function to check if the current room is the Boss Room for a particular boss. This will
|
|
122
|
+
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
116
123
|
*/
|
|
117
124
|
export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
118
125
|
/**
|
|
@@ -137,6 +144,18 @@ export declare function inDeathCertificateArea(): boolean;
|
|
|
137
144
|
* Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`.
|
|
138
145
|
*/
|
|
139
146
|
export declare function inDevilsCrownTreasureRoom(): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Helper function to check to see if the current room is the Boss Room for Dogma.
|
|
149
|
+
*
|
|
150
|
+
* Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
151
|
+
* Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
152
|
+
*
|
|
153
|
+
* Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
154
|
+
* being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
155
|
+
* Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
156
|
+
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
157
|
+
*/
|
|
158
|
+
export declare function inDogmaRoom(): boolean;
|
|
140
159
|
/**
|
|
141
160
|
* Helper function to detect if the current room is a Double Trouble Boss Room.
|
|
142
161
|
*
|
|
@@ -228,15 +247,22 @@ export declare function is2x1Room(roomData: RoomConfig): boolean;
|
|
|
228
247
|
* @allowEmptyVariadic
|
|
229
248
|
*/
|
|
230
249
|
export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[] | readonly RoomType[], includeSecretAndSuperSecretRoom?: boolean, includeUltraSecretRoom?: boolean): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Helper function to check to see if the current room is an angel shop.
|
|
252
|
+
*
|
|
253
|
+
* Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
254
|
+
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
255
|
+
*/
|
|
231
256
|
export declare function isAngelShop(roomData: RoomConfig): boolean;
|
|
232
257
|
/**
|
|
233
|
-
* Helper function to check to see if the provided room is
|
|
258
|
+
* Helper function to check to see if the provided room is the Boss Room for The Beast.
|
|
234
259
|
*
|
|
235
|
-
* Under the hood, this checks the room type and sub-type
|
|
260
|
+
* Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
261
|
+
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
236
262
|
*/
|
|
237
263
|
export declare function isBeastRoom(roomData: RoomConfig): boolean;
|
|
238
264
|
/**
|
|
239
|
-
* Helper function to check if the provided room is
|
|
265
|
+
* Helper function to check if the provided room is the Boss Room for a particular boss. This will
|
|
240
266
|
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
241
267
|
*/
|
|
242
268
|
export declare function isBossRoomOf(roomData: RoomConfig, bossID: BossID): boolean;
|
|
@@ -262,6 +288,18 @@ export declare function isDeathCertificateArea(roomData: RoomConfig): boolean;
|
|
|
262
288
|
* Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`.
|
|
263
289
|
*/
|
|
264
290
|
export declare function isDevilsCrownTreasureRoom(roomDescriptor: RoomDescriptor): boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Helper function to check to see if the provided room is the Boss Room for Dogma.
|
|
293
|
+
*
|
|
294
|
+
* Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
295
|
+
* Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
296
|
+
*
|
|
297
|
+
* Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
298
|
+
* being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
299
|
+
* Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
300
|
+
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
301
|
+
*/
|
|
302
|
+
export declare function isDogmaRoom(roomData: RoomConfig): boolean;
|
|
265
303
|
/**
|
|
266
304
|
* Helper function to detect if the provided room is a Double Trouble Boss Room.
|
|
267
305
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|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AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEvE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAOzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,UAAU,GACrB,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAO1D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,UAAU,EACpB,GAAG,UAAU,EAAE,SAAS,EAAE,GACzB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
|
|
@@ -140,16 +140,21 @@ end
|
|
|
140
140
|
function ____exports.is2x1Room(self, roomData)
|
|
141
141
|
return roomData.Shape == RoomShape.SHAPE_1x2 or roomData.Shape == RoomShape.SHAPE_2x1
|
|
142
142
|
end
|
|
143
|
+
--- Helper function to check to see if the current room is an angel shop.
|
|
144
|
+
--
|
|
145
|
+
-- Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
146
|
+
-- being equal to `AngelRoomSubType.SHOP` (1).
|
|
143
147
|
function ____exports.isAngelShop(self, roomData)
|
|
144
148
|
return roomData.Type == RoomType.ANGEL and roomData.Subtype == asNumber(nil, AngelRoomSubType.SHOP)
|
|
145
149
|
end
|
|
146
|
-
--- Helper function to check to see if the provided room is
|
|
150
|
+
--- Helper function to check to see if the provided room is the Boss Room for The Beast.
|
|
147
151
|
--
|
|
148
|
-
-- Under the hood, this checks the room type and sub-type
|
|
152
|
+
-- Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
153
|
+
-- being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
149
154
|
function ____exports.isBeastRoom(self, roomData)
|
|
150
155
|
return roomData.Type == RoomType.DUNGEON and roomData.Subtype == asNumber(nil, DungeonSubType.BEAST_ROOM)
|
|
151
156
|
end
|
|
152
|
-
--- Helper function to check if the provided room is
|
|
157
|
+
--- Helper function to check if the provided room is the Boss Room for a particular boss. This will
|
|
153
158
|
-- only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
154
159
|
function ____exports.isBossRoomOf(self, roomData, bossID)
|
|
155
160
|
return roomData.Type == RoomType.BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == asNumber(nil, bossID)
|
|
@@ -176,6 +181,18 @@ end
|
|
|
176
181
|
function ____exports.isDevilsCrownTreasureRoom(self, roomDescriptor)
|
|
177
182
|
return hasFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.DEVIL_TREASURE)
|
|
178
183
|
end
|
|
184
|
+
--- Helper function to check to see if the provided room is the Boss Room for Dogma.
|
|
185
|
+
--
|
|
186
|
+
-- Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
187
|
+
-- Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
188
|
+
--
|
|
189
|
+
-- Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
190
|
+
-- being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
191
|
+
-- Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
192
|
+
-- `HomeRoomSubType.LIVING_ROOM` (3).
|
|
193
|
+
function ____exports.isDogmaRoom(self, roomData)
|
|
194
|
+
return roomData.StageID == StageID.HOME and roomData.Type == RoomType.DEFAULT and roomData.Variant == 1000 and roomData.Subtype == asNumber(nil, HomeRoomSubType.LIVING_ROOM)
|
|
195
|
+
end
|
|
179
196
|
--- Helper function to detect if the provided room is a Double Trouble Boss Room.
|
|
180
197
|
--
|
|
181
198
|
-- This is performed by checking for the string "Double Trouble" inside of the room name. The
|
|
@@ -370,19 +387,24 @@ function ____exports.in2x1Room(self)
|
|
|
370
387
|
local roomData = getRoomData(nil)
|
|
371
388
|
return ____exports.is2x1Room(nil, roomData)
|
|
372
389
|
end
|
|
390
|
+
--- Helper function to check to see if the current room is an angel shop.
|
|
391
|
+
--
|
|
392
|
+
-- Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
393
|
+
-- being equal to `AngelRoomSubType.SHOP` (1).
|
|
373
394
|
function ____exports.inAngelShop(self)
|
|
374
395
|
local roomData = getRoomData(nil)
|
|
375
396
|
return ____exports.isAngelShop(nil, roomData)
|
|
376
397
|
end
|
|
377
|
-
--- Helper function to check to see if the current room is
|
|
398
|
+
--- Helper function to check to see if the current room is the Boss Room for The Beast.
|
|
378
399
|
--
|
|
379
|
-
-- Under the hood, this checks the room type and sub-type
|
|
400
|
+
-- Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
401
|
+
-- being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
380
402
|
function ____exports.inBeastRoom(self)
|
|
381
403
|
local roomData = getRoomData(nil)
|
|
382
404
|
return ____exports.isBeastRoom(nil, roomData)
|
|
383
405
|
end
|
|
384
|
-
--- Helper function to check if the current room is
|
|
385
|
-
-- work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
406
|
+
--- Helper function to check if the current room is the Boss Room for a particular boss. This will
|
|
407
|
+
-- only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
386
408
|
function ____exports.inBossRoomOf(self, bossID)
|
|
387
409
|
local roomData = getRoomData(nil)
|
|
388
410
|
return ____exports.isBossRoomOf(nil, roomData, bossID)
|
|
@@ -413,6 +435,19 @@ function ____exports.inDevilsCrownTreasureRoom(self)
|
|
|
413
435
|
local roomDescriptor = getRoomDescriptorReadOnly(nil)
|
|
414
436
|
return ____exports.isDevilsCrownTreasureRoom(nil, roomDescriptor)
|
|
415
437
|
end
|
|
438
|
+
--- Helper function to check to see if the current room is the Boss Room for Dogma.
|
|
439
|
+
--
|
|
440
|
+
-- Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
441
|
+
-- Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
442
|
+
--
|
|
443
|
+
-- Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
444
|
+
-- being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
445
|
+
-- Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
446
|
+
-- `HomeRoomSubType.LIVING_ROOM` (3).
|
|
447
|
+
function ____exports.inDogmaRoom(self)
|
|
448
|
+
local roomData = getRoomData(nil)
|
|
449
|
+
return ____exports.isDogmaRoom(nil, roomData)
|
|
450
|
+
end
|
|
416
451
|
--- Helper function to detect if the current room is a Double Trouble Boss Room.
|
|
417
452
|
--
|
|
418
453
|
-- This is performed by checking for the string "Double Trouble" inside of the room name. The
|
|
@@ -589,12 +624,12 @@ function ____exports.setRoomCleared(self)
|
|
|
589
624
|
for ____, door in ipairs(getDoors(nil)) do
|
|
590
625
|
do
|
|
591
626
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
592
|
-
goto
|
|
627
|
+
goto __continue82
|
|
593
628
|
end
|
|
594
629
|
openDoorFast(nil, door)
|
|
595
630
|
door.ExtraVisible = false
|
|
596
631
|
end
|
|
597
|
-
::
|
|
632
|
+
::__continue82::
|
|
598
633
|
end
|
|
599
634
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
600
635
|
game:ShakeScreen(0)
|
package/package.json
CHANGED
package/src/functions/bosses.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
StageType,
|
|
5
|
-
} from "isaac-typescript-definitions";
|
|
6
|
-
import { EntityType, LokiVariant } from "isaac-typescript-definitions";
|
|
1
|
+
import type { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
import { BossID, EntityType, LokiVariant } from "isaac-typescript-definitions";
|
|
3
|
+
import { game } from "../core/cachedClasses";
|
|
7
4
|
import { VectorZero } from "../core/constants";
|
|
8
5
|
import { ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP } from "../maps/entityTypeVariantToBossIDMap";
|
|
9
6
|
import { BOSS_ID_TO_ENTITY_TYPE_VARIANT } from "../objects/bossIDToEntityTypeVariant";
|
|
@@ -19,6 +16,7 @@ import { ReadonlySet } from "../types/ReadonlySet";
|
|
|
19
16
|
import { getNPCs, spawnNPC } from "./entitiesSpecific";
|
|
20
17
|
import { getAliveNPCs } from "./npcs";
|
|
21
18
|
import { isRNG } from "./rng";
|
|
19
|
+
import { inBeastRoom, inDogmaRoom } from "./rooms";
|
|
22
20
|
import { asNumber } from "./types";
|
|
23
21
|
import { repeat } from "./utils";
|
|
24
22
|
|
|
@@ -83,6 +81,26 @@ export function getAllBossesSet(
|
|
|
83
81
|
: ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET;
|
|
84
82
|
}
|
|
85
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Helper function to get the boss ID corresponding to the current room. Returns 0 if the current
|
|
86
|
+
* room is not a Boss Room.
|
|
87
|
+
*
|
|
88
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it correctly handles Dogma and The
|
|
89
|
+
* Beast.
|
|
90
|
+
*/
|
|
91
|
+
export function getBossID(): BossID | 0 {
|
|
92
|
+
if (inDogmaRoom()) {
|
|
93
|
+
return BossID.DOGMA;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (inBeastRoom()) {
|
|
97
|
+
return BossID.BEAST;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const room = game.GetRoom();
|
|
101
|
+
return room.GetBossID();
|
|
102
|
+
}
|
|
103
|
+
|
|
86
104
|
export function getBossIDFromEntityTypeVariant(
|
|
87
105
|
entityType: EntityType,
|
|
88
106
|
variant: int,
|
|
@@ -160,11 +178,6 @@ export function isRepentanceBoss(bossID: BossID): boolean {
|
|
|
160
178
|
return REPENTANCE_ONLY_BOSS_IDS_SET.has(bossID);
|
|
161
179
|
}
|
|
162
180
|
|
|
163
|
-
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
164
|
-
export function isSin(npc: EntityNPC): boolean {
|
|
165
|
-
return SIN_ENTITY_TYPES_SET.has(npc.Type);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
181
|
function getNumBossSegments(
|
|
169
182
|
entityType: EntityType,
|
|
170
183
|
variant: int,
|
|
@@ -198,6 +211,11 @@ function getNumBossSegments(
|
|
|
198
211
|
}
|
|
199
212
|
}
|
|
200
213
|
|
|
214
|
+
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
215
|
+
export function isSin(npc: EntityNPC): boolean {
|
|
216
|
+
return SIN_ENTITY_TYPES_SET.has(npc.Type);
|
|
217
|
+
}
|
|
218
|
+
|
|
201
219
|
/**
|
|
202
220
|
* Helper function to spawn a boss.
|
|
203
221
|
*
|
package/src/functions/rooms.ts
CHANGED
|
@@ -294,15 +294,22 @@ export function in2x1Room(): boolean {
|
|
|
294
294
|
return is2x1Room(roomData);
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Helper function to check to see if the current room is an angel shop.
|
|
299
|
+
*
|
|
300
|
+
* Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
301
|
+
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
302
|
+
*/
|
|
297
303
|
export function inAngelShop(): boolean {
|
|
298
304
|
const roomData = getRoomData();
|
|
299
305
|
return isAngelShop(roomData);
|
|
300
306
|
}
|
|
301
307
|
|
|
302
308
|
/**
|
|
303
|
-
* Helper function to check to see if the current room is
|
|
309
|
+
* Helper function to check to see if the current room is the Boss Room for The Beast.
|
|
304
310
|
*
|
|
305
|
-
* Under the hood, this checks the room type and sub-type
|
|
311
|
+
* Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
312
|
+
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
306
313
|
*/
|
|
307
314
|
export function inBeastRoom(): boolean {
|
|
308
315
|
const roomData = getRoomData();
|
|
@@ -310,8 +317,8 @@ export function inBeastRoom(): boolean {
|
|
|
310
317
|
}
|
|
311
318
|
|
|
312
319
|
/**
|
|
313
|
-
* Helper function to check if the current room is
|
|
314
|
-
* work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
320
|
+
* Helper function to check if the current room is the Boss Room for a particular boss. This will
|
|
321
|
+
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
315
322
|
*/
|
|
316
323
|
export function inBossRoomOf(bossID: BossID): boolean {
|
|
317
324
|
const roomData = getRoomData();
|
|
@@ -356,6 +363,22 @@ export function inDevilsCrownTreasureRoom(): boolean {
|
|
|
356
363
|
return isDevilsCrownTreasureRoom(roomDescriptor);
|
|
357
364
|
}
|
|
358
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Helper function to check to see if the current room is the Boss Room for Dogma.
|
|
368
|
+
*
|
|
369
|
+
* Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
370
|
+
* Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
371
|
+
*
|
|
372
|
+
* Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
373
|
+
* being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
374
|
+
* Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
375
|
+
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
376
|
+
*/
|
|
377
|
+
export function inDogmaRoom(): boolean {
|
|
378
|
+
const roomData = getRoomData();
|
|
379
|
+
return isDogmaRoom(roomData);
|
|
380
|
+
}
|
|
381
|
+
|
|
359
382
|
/**
|
|
360
383
|
* Helper function to detect if the current room is a Double Trouble Boss Room.
|
|
361
384
|
*
|
|
@@ -546,6 +569,12 @@ export function isAllRoomsClear(
|
|
|
546
569
|
return matchingRooms.every((roomDescriptor) => roomDescriptor.Clear);
|
|
547
570
|
}
|
|
548
571
|
|
|
572
|
+
/**
|
|
573
|
+
* Helper function to check to see if the current room is an angel shop.
|
|
574
|
+
*
|
|
575
|
+
* Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
576
|
+
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
577
|
+
*/
|
|
549
578
|
export function isAngelShop(roomData: RoomConfig): boolean {
|
|
550
579
|
return (
|
|
551
580
|
roomData.Type === RoomType.ANGEL &&
|
|
@@ -554,9 +583,10 @@ export function isAngelShop(roomData: RoomConfig): boolean {
|
|
|
554
583
|
}
|
|
555
584
|
|
|
556
585
|
/**
|
|
557
|
-
* Helper function to check to see if the provided room is
|
|
586
|
+
* Helper function to check to see if the provided room is the Boss Room for The Beast.
|
|
558
587
|
*
|
|
559
|
-
* Under the hood, this checks the room type and sub-type
|
|
588
|
+
* Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
589
|
+
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
560
590
|
*/
|
|
561
591
|
export function isBeastRoom(roomData: RoomConfig): boolean {
|
|
562
592
|
return (
|
|
@@ -566,7 +596,7 @@ export function isBeastRoom(roomData: RoomConfig): boolean {
|
|
|
566
596
|
}
|
|
567
597
|
|
|
568
598
|
/**
|
|
569
|
-
* Helper function to check if the provided room is
|
|
599
|
+
* Helper function to check if the provided room is the Boss Room for a particular boss. This will
|
|
570
600
|
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
571
601
|
*/
|
|
572
602
|
export function isBossRoomOf(roomData: RoomConfig, bossID: BossID): boolean {
|
|
@@ -625,6 +655,26 @@ export function isDevilsCrownTreasureRoom(
|
|
|
625
655
|
return hasFlag(roomDescriptor.Flags, RoomDescriptorFlag.DEVIL_TREASURE);
|
|
626
656
|
}
|
|
627
657
|
|
|
658
|
+
/**
|
|
659
|
+
* Helper function to check to see if the provided room is the Boss Room for Dogma.
|
|
660
|
+
*
|
|
661
|
+
* Note that the "living room" on the Home floor with the TV at the top of the room is not the Dogma
|
|
662
|
+
* Boss Room, as the player is teleported to a different room after watching the TV cutscene.
|
|
663
|
+
*
|
|
664
|
+
* Under the hood, this checks the stage ID being equal to `StageID.HOME` (35) and the room type
|
|
665
|
+
* being equal to `RoomType.DEFAULT` (1) and the variant being equal to 1000 (which is the only
|
|
666
|
+
* Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
667
|
+
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
668
|
+
*/
|
|
669
|
+
export function isDogmaRoom(roomData: RoomConfig): boolean {
|
|
670
|
+
return (
|
|
671
|
+
roomData.StageID === StageID.HOME &&
|
|
672
|
+
roomData.Type === RoomType.DEFAULT &&
|
|
673
|
+
roomData.Variant === 1000 &&
|
|
674
|
+
roomData.Subtype === asNumber(HomeRoomSubType.LIVING_ROOM)
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
|
|
628
678
|
/**
|
|
629
679
|
* Helper function to detect if the provided room is a Double Trouble Boss Room.
|
|
630
680
|
*
|