UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

44 lines (43 loc) 1.84 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ForgottenSwitch = void 0; const isaac_typescript_definitions_1 = require("isaac-typescript-definitions"); const decorators_1 = require("../../../decorators"); const ISCFeature_1 = require("../../../enums/ISCFeature"); const Feature_1 = require("../../private/Feature"); class ForgottenSwitch extends Feature_1.Feature { /** @internal */ v = { run: { shouldSwitch: false, }, }; pressInput; /** @internal */ constructor(pressInput) { super(); this.featuresUsed = [ISCFeature_1.ISCFeature.PRESS_INPUT]; this.pressInput = pressInput; } /** * When used on The Forgotten, switches to The Soul. When used on The Soul, switches to The * Forgotten. This takes 1 game frame to take effect. * * In order to use this function, you must upgrade your mod with `ISCFeature.FORGOTTEN_SWITCH`. * * @public */ forgottenSwitch(player) { this.pressInput.pressInput(player, isaac_typescript_definitions_1.ButtonAction.DROP); } } exports.ForgottenSwitch = ForgottenSwitch; __decorate([ decorators_1.Exported ], ForgottenSwitch.prototype, "forgottenSwitch", null);