isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
32 lines (31 loc) • 985 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostTearInitLate = 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 PostTearInitLate extends CustomCallback_1.CustomCallback {
v = v;
constructor() {
super();
this.callbacksUsed = [
// 40
[isaac_typescript_definitions_1.ModCallback.POST_TEAR_UPDATE, this.postTearUpdate],
];
}
shouldFire = shouldFire_1.shouldFireTear;
// ModCallback.POST_TEAR_UPDATE (40)
postTearUpdate = (tear) => {
const ptrHash = GetPtrHash(tear);
if (!v.room.firedSet.has(ptrHash)) {
v.room.firedSet.add(ptrHash);
this.fire(tear);
}
};
}
exports.PostTearInitLate = PostTearInitLate;