var _a;
import * as utils from "../../utils/index";
import { ComponentCompanion } from "../../npc/components/base";
export class CompanionCombatSupportComponent extends ComponentCompanion {
    async onComponentAdded(npc) {
        var _b, _c;
        super.onComponentAdded(npc);
        (_b = this.npc) === null || _b === void 0 ? void 0 : _b.broadcastEvent("start_support");
        (_c = this.npc) === null || _c === void 0 ? void 0 : _c.Entity.triggerEvent("add_owner_target");
        utils.writeDynamicProperty(npc.Entity, "combat_support", true);
    }
    async onComponentRemoved(npc) {
        var _b, _c;
        (_b = this.npc) === null || _b === void 0 ? void 0 : _b.broadcastEvent("end_support");
        (_c = this.npc) === null || _c === void 0 ? void 0 : _c.Entity.triggerEvent("remove_owner_target");
        utils.writeDynamicProperty(npc.Entity, "combat_support", false);
    }
}
_a = CompanionCombatSupportComponent;
CompanionCombatSupportComponent.ComponentId = _a.name;
