isaacscript-common 51.5.2 → 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.
@@ -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 type { BossID } from 'isaac-typescript-definitions';
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 a boss room for The Beast.
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 a boss room for a particular boss. This will only
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 a boss room for The Beast.
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 a boss room for a particular boss. This will
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
 
@@ -9291,6 +9340,15 @@ export declare function isReflectionRender(): boolean;
9291
9340
  */
9292
9341
  export declare function isRepentance(): boolean;
9293
9342
 
9343
+ /**
9344
+ * Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and
9345
+ * so on.
9346
+ *
9347
+ * For example, The Pile is a boss that was added in Repentance, but since it can appear in
9348
+ * Necropolis, it is not considered a Repentance boss for the purposes of this function.
9349
+ */
9350
+ export declare function isRepentanceBoss(bossID: BossID): boolean;
9351
+
9294
9352
  /**
9295
9353
  * Helper function to check if the provided door leads to the "secret exit" off-grid room that takes
9296
9354
  * you to the Repentance floor.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 51.5.2
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 __continue80
28271
+ goto __continue82
28265
28272
  end
28266
28273
  openDoorFast(nil, door)
28267
28274
  door.ExtraVisible = false
28268
28275
  end
28269
- ::__continue80::
28276
+ ::__continue82::
28270
28277
  end
28271
28278
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
28272
28279
  game:ShakeScreen(0)
@@ -44380,6 +44387,41 @@ ____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = __TS__New(
44380
44387
  function(____, bossID) return not STORY_BOSS_IDS_SET:has(bossID) end
44381
44388
  )
44382
44389
  )
44390
+ return ____exports
44391
+ end,
44392
+ ["src.sets.repentanceBossIDsSet"] = function(...)
44393
+ local ____lualib = require("lualib_bundle")
44394
+ local __TS__New = ____lualib.__TS__New
44395
+ local ____exports = {}
44396
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
44397
+ local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
44398
+ local ____ReadonlySet = require("src.types.ReadonlySet")
44399
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
44400
+ ____exports.REPENTANCE_ONLY_BOSS_IDS_SET = __TS__New(ReadonlySet, {
44401
+ BossID.LIL_BLUB,
44402
+ BossID.WORMWOOD,
44403
+ BossID.RAINMAKER,
44404
+ BossID.VISAGE,
44405
+ BossID.SIREN,
44406
+ BossID.TUFF_TWINS,
44407
+ BossID.HERETIC,
44408
+ BossID.HORNFEL,
44409
+ BossID.GREAT_GIDEON,
44410
+ BossID.SCOURGE,
44411
+ BossID.CHIMERA,
44412
+ BossID.ROTGUT,
44413
+ BossID.MOTHER,
44414
+ BossID.MAUSOLEUM_MOM,
44415
+ BossID.MAUSOLEUM_MOMS_HEART,
44416
+ BossID.MIN_MIN,
44417
+ BossID.CLOG,
44418
+ BossID.SINGE,
44419
+ BossID.COLOSTOMIA,
44420
+ BossID.SHELL,
44421
+ BossID.TURDLET,
44422
+ BossID.HORNY_BOYS,
44423
+ BossID.CLUTCH
44424
+ })
44383
44425
  return ____exports
44384
44426
  end,
44385
44427
  ["src.sets.sinEntityTypesSet"] = function(...)
@@ -44523,8 +44565,11 @@ local __TS__New = ____lualib.__TS__New
44523
44565
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
44524
44566
  local ____exports = {}
44525
44567
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
44568
+ local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
44526
44569
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
44527
44570
  local LokiVariant = ____isaac_2Dtypescript_2Ddefinitions.LokiVariant
44571
+ local ____cachedClasses = require("src.core.cachedClasses")
44572
+ local game = ____cachedClasses.game
44528
44573
  local ____constants = require("src.core.constants")
44529
44574
  local VectorZero = ____constants.VectorZero
44530
44575
  local ____entityTypeVariantToBossIDMap = require("src.maps.entityTypeVariantToBossIDMap")
@@ -44536,6 +44581,8 @@ local ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = ____bossSets.ALL_BOSSES_EXCLUDING_
44536
44581
  local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
44537
44582
  local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
44538
44583
  local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
44584
+ local ____repentanceBossIDsSet = require("src.sets.repentanceBossIDsSet")
44585
+ local REPENTANCE_ONLY_BOSS_IDS_SET = ____repentanceBossIDsSet.REPENTANCE_ONLY_BOSS_IDS_SET
44539
44586
  local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
44540
44587
  local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
44541
44588
  local ____ReadonlySet = require("src.types.ReadonlySet")
@@ -44547,6 +44594,9 @@ local ____npcs = require("src.functions.npcs")
44547
44594
  local getAliveNPCs = ____npcs.getAliveNPCs
44548
44595
  local ____rng = require("src.functions.rng")
44549
44596
  local isRNG = ____rng.isRNG
44597
+ local ____rooms = require("src.functions.rooms")
44598
+ local inBeastRoom = ____rooms.inBeastRoom
44599
+ local inDogmaRoom = ____rooms.inDogmaRoom
44550
44600
  local ____types = require("src.functions.types")
44551
44601
  local asNumber = ____types.asNumber
44552
44602
  local ____utils = require("src.functions.utils")
@@ -44590,6 +44640,16 @@ function ____exports.getAllBossesSet(self, includeStoryBosses)
44590
44640
  end
44591
44641
  return includeStoryBosses and ALL_BOSSES_SET or ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
44592
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
44593
44653
  function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
44594
44654
  local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
44595
44655
  return ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP:get(entityTypeVariant)
@@ -44623,29 +44683,29 @@ end
44623
44683
  function ____exports.getEntityTypeVariantFromBossID(self, bossID)
44624
44684
  return BOSS_ID_TO_ENTITY_TYPE_VARIANT[bossID]
44625
44685
  end
44626
- function ____exports.isSin(self, npc)
44627
- return SIN_ENTITY_TYPES_SET:has(npc.Type)
44686
+ function ____exports.isRepentanceBoss(self, bossID)
44687
+ return REPENTANCE_ONLY_BOSS_IDS_SET:has(bossID)
44628
44688
  end
44629
44689
  local function getNumBossSegments(self, entityType, variant, numSegments)
44630
44690
  if numSegments ~= nil then
44631
44691
  return numSegments
44632
44692
  end
44633
44693
  repeat
44634
- local ____switch15 = entityType
44635
- local ____cond15 = ____switch15 == EntityType.CHUB
44636
- if ____cond15 then
44694
+ local ____switch18 = entityType
44695
+ local ____cond18 = ____switch18 == EntityType.CHUB
44696
+ if ____cond18 then
44637
44697
  do
44638
44698
  return 3
44639
44699
  end
44640
44700
  end
44641
- ____cond15 = ____cond15 or ____switch15 == EntityType.LOKI
44642
- if ____cond15 then
44701
+ ____cond18 = ____cond18 or ____switch18 == EntityType.LOKI
44702
+ if ____cond18 then
44643
44703
  do
44644
44704
  return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
44645
44705
  end
44646
44706
  end
44647
- ____cond15 = ____cond15 or ____switch15 == EntityType.GURGLING
44648
- if ____cond15 then
44707
+ ____cond18 = ____cond18 or ____switch18 == EntityType.GURGLING
44708
+ if ____cond18 then
44649
44709
  do
44650
44710
  return 2
44651
44711
  end
@@ -44657,6 +44717,9 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
44657
44717
  end
44658
44718
  until true
44659
44719
  end
44720
+ function ____exports.isSin(self, npc)
44721
+ return SIN_ENTITY_TYPES_SET:has(npc.Type)
44722
+ end
44660
44723
  function ____exports.spawnBoss(self, entityType, variant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG, numSegments)
44661
44724
  if velocity == nil then
44662
44725
  velocity = VectorZero
@@ -1,5 +1,5 @@
1
- import type { BossID, LevelStage, StageType } from "isaac-typescript-definitions";
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
@@ -64,6 +72,14 @@ export declare function getBosses(entityType?: EntityType, variant?: int, subTyp
64
72
  */
65
73
  export declare function getCombinedBossSet(stage: LevelStage): ReadonlySet<BossID> | undefined;
66
74
  export declare function getEntityTypeVariantFromBossID(bossID: BossID): readonly [EntityType, int];
75
+ /**
76
+ * Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and
77
+ * so on.
78
+ *
79
+ * For example, The Pile is a boss that was added in Repentance, but since it can appear in
80
+ * Necropolis, it is not considered a Repentance boss for the purposes of this function.
81
+ */
82
+ export declare function isRepentanceBoss(bossID: BossID): boolean;
67
83
  /** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
68
84
  export declare function isSin(npc: EntityNPC): boolean;
69
85
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AA4BvE;;;;;;;;;;;;;GAa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CAAC,EAAE,GAAG,EACb,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,GAChB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAEjC;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,GACb,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,CAE5B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAmCD,6FAA6F;AAC7F,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAiCX;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"}
@@ -3,8 +3,11 @@ local __TS__New = ____lualib.__TS__New
3
3
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
4
4
  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")
@@ -16,6 +19,8 @@ local ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = ____bossSets.ALL_BOSSES_EXCLUDING_
16
19
  local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
17
20
  local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
18
21
  local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
22
+ local ____repentanceBossIDsSet = require("src.sets.repentanceBossIDsSet")
23
+ local REPENTANCE_ONLY_BOSS_IDS_SET = ____repentanceBossIDsSet.REPENTANCE_ONLY_BOSS_IDS_SET
19
24
  local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
20
25
  local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
21
26
  local ____ReadonlySet = require("src.types.ReadonlySet")
@@ -27,6 +32,9 @@ local ____npcs = require("src.functions.npcs")
27
32
  local getAliveNPCs = ____npcs.getAliveNPCs
28
33
  local ____rng = require("src.functions.rng")
29
34
  local isRNG = ____rng.isRNG
35
+ local ____rooms = require("src.functions.rooms")
36
+ local inBeastRoom = ____rooms.inBeastRoom
37
+ local inDogmaRoom = ____rooms.inDogmaRoom
30
38
  local ____types = require("src.functions.types")
31
39
  local asNumber = ____types.asNumber
32
40
  local ____utils = require("src.functions.utils")
@@ -99,6 +107,21 @@ function ____exports.getAllBossesSet(self, includeStoryBosses)
99
107
  end
100
108
  return includeStoryBosses and ALL_BOSSES_SET or ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET
101
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
102
125
  function ____exports.getBossIDFromEntityTypeVariant(self, entityType, variant)
103
126
  local entityTypeVariant = (tostring(entityType) .. ".") .. tostring(variant)
104
127
  return ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP:get(entityTypeVariant)
@@ -150,30 +173,34 @@ end
150
173
  function ____exports.getEntityTypeVariantFromBossID(self, bossID)
151
174
  return BOSS_ID_TO_ENTITY_TYPE_VARIANT[bossID]
152
175
  end
153
- --- Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
154
- function ____exports.isSin(self, npc)
155
- return SIN_ENTITY_TYPES_SET:has(npc.Type)
176
+ --- Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and
177
+ -- so on.
178
+ --
179
+ -- For example, The Pile is a boss that was added in Repentance, but since it can appear in
180
+ -- Necropolis, it is not considered a Repentance boss for the purposes of this function.
181
+ function ____exports.isRepentanceBoss(self, bossID)
182
+ return REPENTANCE_ONLY_BOSS_IDS_SET:has(bossID)
156
183
  end
157
184
  local function getNumBossSegments(self, entityType, variant, numSegments)
158
185
  if numSegments ~= nil then
159
186
  return numSegments
160
187
  end
161
188
  repeat
162
- local ____switch15 = entityType
163
- local ____cond15 = ____switch15 == EntityType.CHUB
164
- if ____cond15 then
189
+ local ____switch18 = entityType
190
+ local ____cond18 = ____switch18 == EntityType.CHUB
191
+ if ____cond18 then
165
192
  do
166
193
  return 3
167
194
  end
168
195
  end
169
- ____cond15 = ____cond15 or ____switch15 == EntityType.LOKI
170
- if ____cond15 then
196
+ ____cond18 = ____cond18 or ____switch18 == EntityType.LOKI
197
+ if ____cond18 then
171
198
  do
172
199
  return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
173
200
  end
174
201
  end
175
- ____cond15 = ____cond15 or ____switch15 == EntityType.GURGLING
176
- if ____cond15 then
202
+ ____cond18 = ____cond18 or ____switch18 == EntityType.GURGLING
203
+ if ____cond18 then
177
204
  do
178
205
  return 2
179
206
  end
@@ -185,6 +212,10 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
185
212
  end
186
213
  until true
187
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
188
219
  --- Helper function to spawn a boss.
189
220
  --
190
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 a boss room for The Beast.
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 a boss room for a particular boss. This will only
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 a boss room for The Beast.
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 a boss room for a particular boss. This will
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
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAQT,SAAS,EACT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,W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AAE,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 a boss room for The Beast.
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 a boss room for a particular boss. This will
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 a boss room for The Beast.
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 a boss room for a particular boss. This will only
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 __continue80
627
+ goto __continue82
593
628
  end
594
629
  openDoorFast(nil, door)
595
630
  door.ExtraVisible = false
596
631
  end
597
- ::__continue80::
632
+ ::__continue82::
598
633
  end
599
634
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
600
635
  game:ShakeScreen(0)
@@ -0,0 +1,3 @@
1
+ import { BossID } from "isaac-typescript-definitions";
2
+ export declare const REPENTANCE_ONLY_BOSS_IDS_SET: ReadonlySet<BossID>;
3
+ //# sourceMappingURL=repentanceBossIDsSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repentanceBossIDsSet.d.ts","sourceRoot":"","sources":["../../../src/sets/repentanceBossIDsSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD,eAAO,MAAM,4BAA4B,qBAwBvC,CAAC"}
@@ -0,0 +1,33 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__New = ____lualib.__TS__New
3
+ local ____exports = {}
4
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
+ local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
6
+ local ____ReadonlySet = require("src.types.ReadonlySet")
7
+ local ReadonlySet = ____ReadonlySet.ReadonlySet
8
+ ____exports.REPENTANCE_ONLY_BOSS_IDS_SET = __TS__New(ReadonlySet, {
9
+ BossID.LIL_BLUB,
10
+ BossID.WORMWOOD,
11
+ BossID.RAINMAKER,
12
+ BossID.VISAGE,
13
+ BossID.SIREN,
14
+ BossID.TUFF_TWINS,
15
+ BossID.HERETIC,
16
+ BossID.HORNFEL,
17
+ BossID.GREAT_GIDEON,
18
+ BossID.SCOURGE,
19
+ BossID.CHIMERA,
20
+ BossID.ROTGUT,
21
+ BossID.MOTHER,
22
+ BossID.MAUSOLEUM_MOM,
23
+ BossID.MAUSOLEUM_MOMS_HEART,
24
+ BossID.MIN_MIN,
25
+ BossID.CLOG,
26
+ BossID.SINGE,
27
+ BossID.COLOSTOMIA,
28
+ BossID.SHELL,
29
+ BossID.TURDLET,
30
+ BossID.HORNY_BOYS,
31
+ BossID.CLUTCH
32
+ })
33
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "51.5.2",
3
+ "version": "51.7.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,9 +1,6 @@
1
- import type {
2
- BossID,
3
- LevelStage,
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";
@@ -13,11 +10,13 @@ import {
13
10
  STAGE_TO_COMBINED_BOSS_SET_MAP,
14
11
  STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP,
15
12
  } from "../sets/bossSets";
13
+ import { REPENTANCE_ONLY_BOSS_IDS_SET } from "../sets/repentanceBossIDsSet";
16
14
  import { SIN_ENTITY_TYPES_SET } from "../sets/sinEntityTypesSet";
17
15
  import { ReadonlySet } from "../types/ReadonlySet";
18
16
  import { getNPCs, spawnNPC } from "./entitiesSpecific";
19
17
  import { getAliveNPCs } from "./npcs";
20
18
  import { isRNG } from "./rng";
19
+ import { inBeastRoom, inDogmaRoom } from "./rooms";
21
20
  import { asNumber } from "./types";
22
21
  import { repeat } from "./utils";
23
22
 
@@ -82,6 +81,26 @@ export function getAllBossesSet(
82
81
  : ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET;
83
82
  }
84
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
+
85
104
  export function getBossIDFromEntityTypeVariant(
86
105
  entityType: EntityType,
87
106
  variant: int,
@@ -148,9 +167,15 @@ export function getEntityTypeVariantFromBossID(
148
167
  return BOSS_ID_TO_ENTITY_TYPE_VARIANT[bossID];
149
168
  }
150
169
 
151
- /** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
152
- export function isSin(npc: EntityNPC): boolean {
153
- return SIN_ENTITY_TYPES_SET.has(npc.Type);
170
+ /**
171
+ * Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and
172
+ * so on.
173
+ *
174
+ * For example, The Pile is a boss that was added in Repentance, but since it can appear in
175
+ * Necropolis, it is not considered a Repentance boss for the purposes of this function.
176
+ */
177
+ export function isRepentanceBoss(bossID: BossID): boolean {
178
+ return REPENTANCE_ONLY_BOSS_IDS_SET.has(bossID);
154
179
  }
155
180
 
156
181
  function getNumBossSegments(
@@ -186,6 +211,11 @@ function getNumBossSegments(
186
211
  }
187
212
  }
188
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
+
189
219
  /**
190
220
  * Helper function to spawn a boss.
191
221
  *
@@ -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 a boss room for The Beast.
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 a boss room for a particular boss. This will only
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 a boss room for The Beast.
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 a boss room for a particular boss. This will
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
  *
@@ -0,0 +1,28 @@
1
+ import { BossID } from "isaac-typescript-definitions";
2
+ import { ReadonlySet } from "../types/ReadonlySet";
3
+
4
+ export const REPENTANCE_ONLY_BOSS_IDS_SET = new ReadonlySet<BossID>([
5
+ BossID.LIL_BLUB, // 75
6
+ BossID.WORMWOOD, // 76
7
+ BossID.RAINMAKER, // 77
8
+ BossID.VISAGE, // 78
9
+ BossID.SIREN, // 79
10
+ BossID.TUFF_TWINS, // 80
11
+ BossID.HERETIC, // 81
12
+ BossID.HORNFEL, // 82
13
+ BossID.GREAT_GIDEON, // 83
14
+ BossID.SCOURGE, // 85
15
+ BossID.CHIMERA, // 86
16
+ BossID.ROTGUT, // 87
17
+ BossID.MOTHER, // 88
18
+ BossID.MAUSOLEUM_MOM, // 89
19
+ BossID.MAUSOLEUM_MOMS_HEART, // 90
20
+ BossID.MIN_MIN, // 91
21
+ BossID.CLOG, // 92
22
+ BossID.SINGE, // 93
23
+ BossID.COLOSTOMIA, // 95
24
+ BossID.SHELL, // 96
25
+ BossID.TURDLET, // 97
26
+ BossID.HORNY_BOYS, // 101
27
+ BossID.CLUTCH, // 102
28
+ ]);