"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PostPickupInitFirst = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const frames_1 = require("../../functions/frames");
const roomData_1 = require("../../functions/roomData");
const shouldFire_1 = require("../../shouldFire");
const CustomCallback_1 = require("../private/CustomCallback");
class PostPickupInitFirst extends CustomCallback_1.CustomCallback {
    v = {
        room: {
            firedSet: new Set(),
        },
    };
    constructor() {
        super();
        this.callbacksUsed = [
            // 34
            [isaac_typescript_definitions_1.ModCallback.POST_PICKUP_INIT, this.postPickupInit],
        ];
    }
    shouldFire = shouldFire_1.shouldFirePickup;
    // ModCallback.POST_PICKUP_INIT (34)
    postPickupInit = (pickup) => {
        const roomVisitedCount = (0, roomData_1.getRoomVisitedCount)();
        // The room visited count is not reset when re-entering a Treasure Room or Boss room in the
        // Ascent.
        if ((0, frames_1.isAfterRoomFrame)(0) || roomVisitedCount === 0) {
            this.fire(pickup);
        }
    };
}
exports.PostPickupInitFirst = PostPickupInitFirst;
