UNPKG

@zerospacegg/iolin

Version:

Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)

92 lines 3.37 kB
/** * Brood Guard - Tanky melee unit which spawns Spiderlings upon taking damage. Attacks ground units. * Built from incubator, spawns spiderlings when taking damage */ import { Attack, Passive, Upgrade } from "../../../../engine/ability.js"; import { GrellArmyUnit } from "../../../../defaults/grell.js"; export class BroodGuard extends 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 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 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 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 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 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, }); } } // Static property for source path BroodGuard.src = "src/zerospace/faction/grell/unit/brood-guard.ts"; export default BroodGuard; //# sourceMappingURL=brood-guard.js.map