UNPKG

@zerospacegg/iolin

Version:

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

91 lines 3.44 kB
/** * Thrall - Legion's basic infantry unit with battle frenzy capabilities * Religious warriors enhanced by divine blessing and upgrade potential */ import { Attack, Upgrade } from "../../../../engine/ability.js"; import { LegionArmyUnit } from "../../legion-classes.js"; import Citadel from "../building/citadel.js"; import LegionBarracks from "../building/legion-barracks.js"; export class Thrall extends LegionArmyUnit { constructor() { super(); this.name = "Thrall"; this.tier = "T1"; this.hexiteCost = 50; this.fluxCost = 0; this.buildTime = 18; this.buildCount = 3; this.uuid = "36ebdf54-30ef-4672-8cf2-69b099129c6d"; // Mutable properties - basic infantry enhanced by religious fervor this.supply = 1; this.hp = 75; this.shields = 0; this.armor = 0; this.armorType = "light"; this.speed = 525; // Enhanced by divine blessing this.hotkey = "Q"; // Relationships - created by Legion Barracks this.createdBy = [LegionBarracks.id]; this.unlockedBy = [LegionBarracks.id]; this.upgradedBy = [Citadel.id]; this.description = "Light ranged infantry. Attacks ground and air units."; // Tags for identification and targeting this.tag("legion:thrall"); // Versatile attack system this.attacks.attack = new Attack({ name: "Attack", damage: 7, cooldown: 1.5, range: 750, targets: ["air", "ground"], parentId: this.id, parentUUID: this.uuid, }); // Capture instance for upgrade apply methods const unit = this; // Battle Frenzy upgrade - stacking attack speed bonus this.upgrades.battleFrenzy = new Upgrade({ name: "Battle Frenzy", description: "Each hit increases attack speed (+15% up to 75%)", tier: "T1.5", fluxCost: 100, researchTime: 40, apply() { // Implementation handled by game engine for stacking bonuses }, parentId: this.id, parentUUID: this.uuid, }); // Charged Shot upgrade - periodic damage bonus this.upgrades.chargedShot = new Upgrade({ name: "Charged Shot", description: "Attacks twice every 10 seconds instead of double damage", tier: "T1.5", fluxCost: 100, researchTime: 40, apply() { // Implementation handled by game engine for charged attack timing }, parentId: this.id, parentUUID: this.uuid, }); // Performance Enhancers upgrade - speed bonuses this.upgrades.performanceEnhancers = new Upgrade({ name: "Performance Enhancers", description: "+15% attack and move speed", tier: "T2.5", fluxCost: 150, researchTime: 50, apply() { unit.speed = (unit.speed || 0) * 1.15; unit.attacks.attack.cooldown = (unit.attacks.attack.cooldown || 0) * 0.85; }, parentId: this.id, parentUUID: this.uuid, }); } } // Static property for source path Thrall.src = "src/zerospace/faction/legion/unit/thrall.ts"; export default Thrall; //# sourceMappingURL=thrall.js.map