@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
119 lines • 4.29 kB
JavaScript
/**
* Lasher - Ranged combat unit. Attacks ground and air units.
* Light armor, high mobility, long-range attacks with stealth potential
*/
import { GrellArmyUnit } from "../../../../defaults/grell.js";
import { Attack, Spell, Upgrade } from "../../../../engine/ability.js";
export class Lasher extends GrellArmyUnit {
// Static properties for ID references
constructor() {
super();
this.hexiteCost = 50;
this.fluxCost = 25;
this.buildTime = 20;
this.buildCount = 1;
this.name = "Lasher";
this.tier = "T1.5";
this.hotkey = "R";
this.uuid = "6c1ec0c5-af3f-4bb1-867f-bd16792d2de6";
// Internal game engine data
this.internalId = "Troop_GrellLasher_C";
this.internalPath = "/Game/Nova/Archetypes_Troops/Troop_GrellLasher.Default__Troop_GrellLasher_C";
this.internalTags = [
"Attackable.Unit.Troop",
"Attackable.Unit.Light",
"Attackable.ArmorType.Light",
"Attackable.Biological",
];
this.internalSecondaryTags = [];
this.unlockedBy = ["faction/grell/building/augmentation-pool"];
this.createdBy = ["faction/grell/building/incubator"];
this.upgradedBy = ["faction/grell/building/augmentation-pool"];
// Capture instance for upgrade apply methods
const unit = this;
this.hp = 150;
this.shields = 0;
this.armor = 0;
this.armorType = "light";
this.speed = 550;
this.supply = 2;
this.vision = 1800;
this.turnSpeed = 4000;
this.description = "Ranged combat unit. Attacks ground and air units.";
this.attacks.attack = new Attack({
name: "Attack",
damage: 20,
range: 775,
cooldown: 1.2,
cooldownBetweenShots: 1.2,
armorPenetration: 0,
delay: 0.12,
targets: ["air", "ground"],
parentId: this.id,
parentUUID: this.uuid,
});
this.spells.camouflage = new Spell({
name: "Camouflage",
description: "Grants invisibility and +75% movement speed for 3s",
hotkey: "X",
cooldown: 20,
duration: 3,
unlocked: false,
parentId: this.id,
parentUUID: this.uuid,
});
this.upgrades.attackRange = new Upgrade({
name: "Attack Range",
description: "Increase lasher attack range by 200",
tier: "T1.5",
fluxCost: 100,
researchTime: 50,
apply() {
unit.attacks.attack.range = (unit.attacks.attack.range || 0) + 200;
},
parentId: this.id,
parentUUID: this.uuid,
});
this.upgrades.fastLegs = new Upgrade({
name: "Fast Legs",
description: "Increase lasher movement speed by 25%",
tier: "T1.5",
fluxCost: 100,
researchTime: 50,
apply() {
unit.speed = (unit.speed || 0) * 1.25;
},
parentId: this.id,
parentUUID: this.uuid,
});
this.upgrades.corrosiveShots = new Upgrade({
name: "Corrosive Shots",
description: "+50% damage against medium armor",
tier: "T2.5",
fluxCost: 100,
researchTime: 50,
apply() {
unit.attacks.attack.bonusDamage = [{ multiplier: 1.5, vs: ["medium"] }];
},
parentId: this.id,
parentUUID: this.uuid,
});
this.upgrades.camouflage = new Upgrade({
name: "Camouflage",
description: "Unlocks the Camouflage ability (+25% movement speed and cloak for 6s)",
tier: "T3.5",
fluxCost: 150,
researchTime: 60,
apply() {
unit.spells.camouflage.unlocked = true;
unit.spells.camouflage.duration = 6;
},
parentId: this.id,
parentUUID: this.uuid,
});
}
}
// Static property for source path
Lasher.src = "src/zerospace/faction/grell/unit/lasher.ts";
export default Lasher;
//# sourceMappingURL=lasher.js.map