@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
96 lines • 3.57 kB
JavaScript
"use strict";
/**
* Brood Guard - Tanky melee unit which spawns Spiderlings upon taking damage. Attacks ground units.
* Built from incubator, spawns spiderlings when taking damage
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BroodGuard = void 0;
const ability_js_1 = require("../../../../engine/ability.cjs");
const grell_js_1 = require("../../../../defaults/grell.cjs");
class BroodGuard extends grell_js_1.GrellArmyUnit {
constructor() {
super();
this.hexiteCost = 125;
this.fluxCost = 0;
this.buildTime = 30;
this.buildCount = 1;
this.name = "Brood Guard";
this.tier = "T2";
this.hotkey = "E";
this.uuid = "f8a2d3c1-9b7e-4f65-a8c9-1d2e3f4a5b6c";
// Mutable properties - tanky melee unit
this.hp = 290;
this.shields = 0;
this.armor = 1;
this.armorType = "medium";
this.speed = 550;
this.supply = 3;
this.description = "Tanky melee unit which spawns Spiderlings upon taking damage. Attacks ground units.";
// Relationships - created by incubator
this.createdBy = ["faction/grell/building/incubator"];
this.unlockedBy = ["faction/grell/building/incubator"];
this.upgradedBy = ["faction/grell/building/augmentation-pool"];
// Capture instance for upgrade apply methods
const unit = this;
// Melee attack
this.attacks.attack = new ability_js_1.Attack({
name: "Claws",
damage: 18,
cooldown: 1.3,
range: 140,
targets: ["ground"],
parentId: this.id,
parentUUID: this.uuid,
});
// Spiderling spawning passive
this.passives.spiderlingSpawn = new ability_js_1.Passive({
name: "Spiderling Spawn",
description: "Spawns a 50 HP spiderling every 60 HP lost",
parentId: this.id,
parentUUID: this.uuid,
});
// Tier 1 upgrades (alternative choices)
this.upgrades.extraHealth = new ability_js_1.Upgrade({
name: "Extra Health",
description: "+100 max HP",
tier: "T1.5",
fluxCost: 100,
researchTime: 45,
apply() {
unit.hp = (unit.hp || 0) + 100; // 290 + 100 = 390
},
parentId: this.id,
parentUUID: this.uuid,
});
this.upgrades.healthRegeneration = new ability_js_1.Upgrade({
name: "Health Regeneration",
description: "Grants health regeneration",
tier: "T1.5",
fluxCost: 100,
researchTime: 45,
apply() {
// Implementation handled by game engine for health regeneration
},
parentId: this.id,
parentUUID: this.uuid,
});
// Tier 3 upgrade
this.upgrades.doubleSpiderlings = new ability_js_1.Upgrade({
name: "Double Spiderlings",
description: "Spawns 2 spiderlings at a time",
tier: "T3.5",
fluxCost: 150,
researchTime: 60,
apply() {
// Implementation handled by game engine for double spawning
},
parentId: this.id,
parentUUID: this.uuid,
});
}
}
exports.BroodGuard = BroodGuard;
// Static property for source path
BroodGuard.src = "src/zerospace/faction/grell/unit/brood-guard.ts";
exports.default = BroodGuard;
//# sourceMappingURL=brood-guard.js.map