@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
77 lines • 3.07 kB
JavaScript
/**
* Operating Tower - Protectorate command center
* Main base building that serves as the faction's central command hub
*/
import { Attack, Spell } from "../../../../engine/ability.js";
import { Turret } from "../../../../engine/turret.js";
import { ProtectorateBaseBuilding } from "../../protectorate-classes.js";
import ProtBuildDrone from "../unit/prot-build-drone.js";
import ProtHarvester from "../unit/prot-harvester.js";
import ProtScoutDrone from "../unit/prot-scout-drone.js";
import ProtExtractor from "./prot-extractor.js";
import SupplyPlatform from "./supply-platform.js";
export class OperatingTower extends ProtectorateBaseBuilding {
constructor() {
super();
this.name = "Operating Tower";
this.tier = "T0";
this.hexiteCost = 400;
this.fluxCost = 0;
this.buildTime = 60;
this.buildCount = 1;
this.hotkey = "Q";
this.uuid = "a8166e7b-4a15-4ce7-b307-674adc8e9959";
this.hp = 2000;
this.shields = 0;
this.armorType = "heavy";
// Capture operating tower instance for turret apply method
const operatingTower = this;
// Building relationships
this.createdBy = [ProtBuildDrone.id];
this.creates = [ProtBuildDrone.id, ProtExtractor.id, ProtHarvester.id, ProtScoutDrone.id];
this.unlocks = [SupplyPlatform.id, ProtBuildDrone.id, ProtHarvester.id];
// Home Base spell - set as primary base for recall priority
this.spells.homeBase = new Spell({
name: "Home Base",
hotkey: "U",
cooldown: 0.2,
targets: ["self"],
description: "Set this base as primary",
parentId: this.id,
parentUUID: this.uuid,
});
// Turret capability
this.maxAddOns = 1;
// Defensive turret capability
this.turrets.operatingTowerDefender = new Turret({
name: "Operating Tower Defender",
description: "Adds defensive capabilities to the command center",
hexiteCost: 200,
buildTime: 5,
hp: 500, // HP addition amount
unlocked: false,
apply() {
// Add HP boost (+500 HP, making total 2500)
operatingTower.hp = (operatingTower.hp || 0) + 500;
// Unlock defensive attack ability
operatingTower.attacks.defense.unlocked = true;
},
});
// Defensive attack ability (unlocked by turret)
this.attacks.defense = new Attack({
name: "Defense",
description: "Defensive turret attack",
damage: 15,
cooldown: 1.2,
range: 1400,
targets: ["air", "ground"],
unlocked: false,
parentId: this.id,
parentUUID: this.uuid,
});
}
}
// Static property for source path
OperatingTower.src = "src/zerospace/faction/protectorate/building/operating-tower.ts";
export default OperatingTower;
//# sourceMappingURL=operating-tower.js.map