UNPKG

isaacscript-common

Version:

Helper functions and features for IsaacScript mods.

32 lines (31 loc) 997 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PostKnifeInitLate = void 0; const isaac_typescript_definitions_1 = require("isaac-typescript-definitions"); const shouldFire_1 = require("../../shouldFire"); const CustomCallback_1 = require("../private/CustomCallback"); const v = { room: { firedSet: new Set(), }, }; class PostKnifeInitLate extends CustomCallback_1.CustomCallback { v = v; constructor() { super(); this.callbacksUsed = [ // 51 [isaac_typescript_definitions_1.ModCallback.POST_KNIFE_UPDATE, this.postKnifeUpdate], ]; } shouldFire = shouldFire_1.shouldFireKnife; // ModCallback.POST_KNIFE_UPDATE (51) postKnifeUpdate = (knife) => { const ptrHash = GetPtrHash(knife); if (!v.room.firedSet.has(ptrHash)) { v.room.firedSet.add(ptrHash); this.fire(knife); } }; } exports.PostKnifeInitLate = PostKnifeInitLate;