isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
99 lines (98 loc) • 5.1 kB
JavaScript
"use strict";
/**
* Constants relating to the first and last value for various vanilla objects.
*
* @module
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.NUM_VANILLA_CHALLENGES = exports.LAST_VANILLA_CHARACTER = exports.FIRST_CHARACTER = exports.NUM_NORMAL_PILL_COLORS = exports.LAST_HORSE_PILL_COLOR = exports.FIRST_HORSE_PILL_COLOR = exports.LAST_NORMAL_PILL_COLOR = exports.FIRST_PILL_COLOR = exports.NUM_VANILLA_PILL_EFFECTS = exports.LAST_VANILLA_PILL_EFFECT = exports.FIRST_PILL_EFFECT = exports.NUM_VANILLA_CARD_TYPES = exports.LAST_VANILLA_CARD_TYPE = exports.FIRST_CARD_TYPE = exports.NUM_VANILLA_TRINKET_TYPES = exports.LAST_VANILLA_TRINKET_TYPE = exports.FIRST_TRINKET_TYPE = exports.NUM_VANILLA_COLLECTIBLE_TYPES = exports.LAST_VANILLA_COLLECTIBLE_TYPE = exports.FIRST_COLLECTIBLE_TYPE = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const enums_1 = require("../functions/enums");
// ------------
// Collectibles
// ------------
/** Equal to `CollectibleType.SAD_ONION` (1). */
exports.FIRST_COLLECTIBLE_TYPE = isaac_typescript_definitions_1.CollectibleType.SAD_ONION;
/**
* Calculated from the `CollectibleType` enum.
*
* Note that this cannot be calculated from the length of the enum, because collectible types are
* not contiguous.
*/
exports.LAST_VANILLA_COLLECTIBLE_TYPE = (0, enums_1.getHighestEnumValue)(isaac_typescript_definitions_1.CollectibleType);
/** Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.) */
exports.NUM_VANILLA_COLLECTIBLE_TYPES = (0, enums_1.getEnumLength)(isaac_typescript_definitions_1.CollectibleType) - 1;
// --------
// Trinkets
// --------
/** Equal to `TrinketType.SWALLOWED_PENNY` (1). */
exports.FIRST_TRINKET_TYPE = isaac_typescript_definitions_1.TrinketType.SWALLOWED_PENNY;
/**
* Calculated from the `TrinketType` enum.
*
* Note that this cannot be calculated from the length of the enum, because trinket types are not
* contiguous.
*/
exports.LAST_VANILLA_TRINKET_TYPE = (0, enums_1.getHighestEnumValue)(isaac_typescript_definitions_1.TrinketType);
/** Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.) */
exports.NUM_VANILLA_TRINKET_TYPES = (0, enums_1.getEnumLength)(isaac_typescript_definitions_1.TrinketType) - 1;
// -----
// Cards
// -----
/** Equal to `Card.FOOL` (1). */
exports.FIRST_CARD_TYPE = isaac_typescript_definitions_1.CardType.FOOL;
/** Calculated from the `CardType` enum. */
exports.LAST_VANILLA_CARD_TYPE = (0, enums_1.getHighestEnumValue)(isaac_typescript_definitions_1.CardType);
/** Calculated from the `Card` enum. `Card.NULL` is not included. */
exports.NUM_VANILLA_CARD_TYPES = (0, enums_1.getEnumLength)(isaac_typescript_definitions_1.CardType) - 1;
// ------------
// Pill Effects
// ------------
/** Equal to `PillEffect.BAD_GAS` (0). */
exports.FIRST_PILL_EFFECT = isaac_typescript_definitions_1.PillEffect.BAD_GAS;
/** Calculated from the `PillEffect` enum. */
exports.LAST_VANILLA_PILL_EFFECT = (0, enums_1.getHighestEnumValue)(isaac_typescript_definitions_1.PillEffect);
/**
* Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
* do not have to subtract one here.)
*/
exports.NUM_VANILLA_PILL_EFFECTS = (0, enums_1.getEnumLength)(isaac_typescript_definitions_1.PillEffect);
// -----------
// Pill Colors
// -----------
/** Equal to `PillColor.BLUE_BLUE` (1). */
exports.FIRST_PILL_COLOR = isaac_typescript_definitions_1.PillColor.BLUE_BLUE;
/**
* Equal to `PillColor.WHITE_YELLOW` (13).
*
* Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
* this constant.
*/
exports.LAST_NORMAL_PILL_COLOR = isaac_typescript_definitions_1.PillColor.WHITE_YELLOW;
/** Equal to `PillColor.HORSE_BLUE_BLUE` (2049). */
exports.FIRST_HORSE_PILL_COLOR = isaac_typescript_definitions_1.PillColor.HORSE_BLUE_BLUE;
/**
* Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
*
* Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
* purposes of this constant.
*/
exports.LAST_HORSE_PILL_COLOR = isaac_typescript_definitions_1.PillColor.HORSE_WHITE_YELLOW;
/**
* Calculated from the difference between the first pill color and the last pill color. This does
* not include Gold Pills. In Repentance, this should be equal to 13.
*/
exports.NUM_NORMAL_PILL_COLORS = exports.LAST_NORMAL_PILL_COLOR - exports.FIRST_PILL_COLOR + 1;
// -------
// Players
// -------
/** Equal to `PlayerType.ISAAC` (0). */
exports.FIRST_CHARACTER = isaac_typescript_definitions_1.PlayerType.ISAAC;
// It is not possible to determine "LAST_CHARACTER", since there is no associated config.
/** Calculated from the `PlayerType` enum. */
exports.LAST_VANILLA_CHARACTER = (0, enums_1.getHighestEnumValue)(isaac_typescript_definitions_1.PlayerType);
// ----------
// Challenges
// ----------
/** Calculated from the `Challenge` enum. `Challenge.NULL` is not included. */
exports.NUM_VANILLA_CHALLENGES = (0, enums_1.getEnumLength)(isaac_typescript_definitions_1.Challenge) - 1;