@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
104 lines • 4.06 kB
JavaScript
/**
* Thrall - Legion's basic infantry unit with battle frenzy capabilities
* Religious warriors enhanced by divine blessing and upgrade potential
*/
import { LegionArmyUnit } from "../../../../defaults/legion.js";
import { Attack, Upgrade } from "../../../../engine/ability.js";
export class Thrall extends LegionArmyUnit {
constructor() {
super();
// Auto-generated fixes from dev data comparison
this.hexiteCost = 50;
this.fluxCost = 0;
this.buildTime = 18;
this.buildCount = 3;
this.name = "Thrall";
this.tier = "T1";
this.internalId = "Troop_Empire_Thrall_C";
this.internalPath = "/Game/Nova/Archetypes_Troops/Troop_Empire_Thrall.Default__Troop_Empire_Thrall_C";
this.internalTags = [
"Attackable.Unit.Troop",
"Attackable.Unit.Light",
"Attackable.ArmorType.Light",
"Attackable.Biological",
"Local.Legion.Infantry.Thrall.Ranged",
];
this.internalSecondaryTags = ["Infantry"];
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.turnSpeed = 5000;
this.hotkey = "Q";
// Relationships - created by Legion Barracks
this.createdBy = ["faction/legion/building/legion-barracks"];
this.unlockedBy = ["faction/legion/building/legion-barracks"];
this.upgradedBy = ["faction/legion/building/citadel"];
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,
cooldownBetweenShots: 1.5,
range: 750,
targets: ["air", "ground"],
armorPenetration: 0,
delay: 0.06,
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