import * as utils from "../../utils/index";
import { WornHat } from "../worn_hat";
class CrownHat extends WornHat {
    constructor() {
        super(...arguments);
        this.hatTypeId = "ldz_crcomp:hat_crown1";
    }
    async onEquip() {
        const wearer = this.hatWearer.Entity;
        const health = wearer.Health;
        utils.waitForLoopEvent(80, () => {
            if (wearer.isValid() && health) {
                health.setCurrentValue(Math.min(health.currentValue + 1, health.effectiveMax));
            }
            return false;
        }, this.cancelCategory);
    }
    async onUnequip() {
        utils.abortEvents(this.cancelCategory);
    }
}
WornHat.HatTable["ldz_crcomp:hat_crown1"] = CrownHat;
