UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

63 lines (62 loc) 3.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isStoryBoss = isStoryBoss; exports.isStoryBossID = isStoryBossID; const isaac_typescript_definitions_1 = require("isaac-typescript-definitions"); const ReadonlySet_1 = require("../types/ReadonlySet"); const STORY_BOSS_IDS = [ isaac_typescript_definitions_1.BossID.MOM, // 6 isaac_typescript_definitions_1.BossID.MOMS_HEART, // 8 isaac_typescript_definitions_1.BossID.SATAN, // 24 isaac_typescript_definitions_1.BossID.IT_LIVES, // 25 isaac_typescript_definitions_1.BossID.ISAAC, // 39 isaac_typescript_definitions_1.BossID.BLUE_BABY, // 40 isaac_typescript_definitions_1.BossID.LAMB, // 54 isaac_typescript_definitions_1.BossID.MEGA_SATAN, // 55 (Mega Satan 2 is in the same room.) isaac_typescript_definitions_1.BossID.ULTRA_GREED, // 62 isaac_typescript_definitions_1.BossID.HUSH, // 63 isaac_typescript_definitions_1.BossID.DELIRIUM, // 70 isaac_typescript_definitions_1.BossID.ULTRA_GREEDIER, // 71 isaac_typescript_definitions_1.BossID.MOTHER, // 88 isaac_typescript_definitions_1.BossID.MAUSOLEUM_MOM, // 89 isaac_typescript_definitions_1.BossID.MAUSOLEUM_MOMS_HEART, // 90 isaac_typescript_definitions_1.BossID.DOGMA, // 99 isaac_typescript_definitions_1.BossID.BEAST, // 100 ]; const STORY_BOSS_ENTITY_TYPES_SET = new ReadonlySet_1.ReadonlySet([ isaac_typescript_definitions_1.EntityType.MOM, // 45 isaac_typescript_definitions_1.EntityType.MOMS_HEART, // 78 isaac_typescript_definitions_1.EntityType.SATAN, // 84 // - It Lives is a variant of Mom's Heart. isaac_typescript_definitions_1.EntityType.ISAAC, // 102 // - Blue Baby is a variant of Isaac. isaac_typescript_definitions_1.EntityType.LAMB, // 273 isaac_typescript_definitions_1.EntityType.MEGA_SATAN, // 274 isaac_typescript_definitions_1.EntityType.MEGA_SATAN_2, // 275 isaac_typescript_definitions_1.EntityType.ULTRA_GREED, // 406 isaac_typescript_definitions_1.EntityType.HUSH, // 407 isaac_typescript_definitions_1.EntityType.DELIRIUM, // 412 // - Ultra Greedier is a variant of Ultra Greed. isaac_typescript_definitions_1.EntityType.MOTHER, // 912 // - Mausoleum Mom is a sub-type of Mom. // - Mausoleum Mom's Heart is a sub-type of Mom's Heart. isaac_typescript_definitions_1.EntityType.DOGMA, // 950 isaac_typescript_definitions_1.EntityType.BEAST, // 951 ]); const STORY_BOSS_IDS_SET = new ReadonlySet_1.ReadonlySet(STORY_BOSS_IDS); /** * Helper function to determine if the specified entity type is an end-game story boss, like Isaac, * Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only * apply to non-story bosses, like Vanishing Twin. */ function isStoryBoss(entityType) { return STORY_BOSS_ENTITY_TYPES_SET.has(entityType); } /** * Helper function to determine if the specified boss ID is an end-game story boss, like Isaac, Blue * Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply * to non-story bosses, like Vanishing Twin. */ function isStoryBossID(bossID) { return STORY_BOSS_IDS_SET.has(bossID); }