isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
26 lines (25 loc) • 954 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAmbushType = getAmbushType;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const cachedClasses_1 = require("../core/cachedClasses");
const AmbushType_1 = require("../enums/AmbushType");
/**
* Helper function to get the corresponding ambush type for the current room. Returns undefined if
* the current room does not correspond to any particular ambush type.
*/
function getAmbushType() {
const room = cachedClasses_1.game.GetRoom();
const roomType = room.GetType();
switch (roomType) {
case isaac_typescript_definitions_1.RoomType.BOSS_RUSH: {
return AmbushType_1.AmbushType.BOSS_RUSH;
}
case isaac_typescript_definitions_1.RoomType.CHALLENGE: {
return AmbushType_1.AmbushType.CHALLENGE_ROOM;
}
default: {
return undefined;
}
}
}