isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
36 lines (35 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostTearInitVeryLate = 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 PostTearInitVeryLate 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) => {
// This callback fires on frame 1.
if (tear.FrameCount === 0) {
return;
}
const index = GetPtrHash(tear);
if (!v.room.firedSet.has(index)) {
v.room.firedSet.add(index);
this.fire(tear);
}
};
}
exports.PostTearInitVeryLate = PostTearInitVeryLate;