"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntityTakeDmgPlayer = void 0;
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
const shouldFire_1 = require("../../shouldFire");
const CustomCallback_1 = require("../private/CustomCallback");
class EntityTakeDmgPlayer extends CustomCallback_1.CustomCallback {
    constructor() {
        super();
        this.callbacksUsed = [
            // 11
            [
                isaac_typescript_definitions_1.ModCallback.ENTITY_TAKE_DMG,
                this.entityTakeDmgPlayer,
                [isaac_typescript_definitions_1.EntityType.PLAYER],
            ],
        ];
    }
    shouldFire = shouldFire_1.shouldFirePlayer;
    // ModCallback.ENTITY_TAKE_DMG (11)
    entityTakeDmgPlayer = (entity, amount, damageFlags, source, countdownFrames) => {
        const player = entity.ToPlayer();
        if (player === undefined) {
            return undefined;
        }
        return this.fire(player, amount, damageFlags, source, countdownFrames);
    };
}
exports.EntityTakeDmgPlayer = EntityTakeDmgPlayer;
