@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
241 lines • 9.74 kB
JavaScript
/**
* Legion Main Faction
* Religious fanatic faction focused on uplifting aliens and eradicating synthetics
*
* Faction structure:
* - Eight talents (War Experience, Improved Conduits, Efficient Upgrades, Death Pact,
* Reanimate Hero, Improved Spellcasting, Ritual, Spawn Monolith)
* - Four topbars (Recall, Reanimate, Ritual, Spawn Monolith)
* - Three heroes allowed simultaneously (unique mechanic)
* - Customizable tanks with upgrade systems
* - Thrall units and reanimation mechanics
*/
import { MainFaction } from "../../engine/faction.js";
// Import all Legion entities
import Altar from "./legion/building/altar.js";
import Armory from "./legion/building/armory.js";
import Beastiary from "./legion/building/beastiary.js";
import Citadel from "./legion/building/citadel.js";
import GarrisonTower from "./legion/building/garrison-tower.js";
import GuardianObelisk from "./legion/building/guardian-obelisk.js";
import HealingObelisk from "./legion/building/healing-obelisk.js";
import IdalConduit from "./legion/building/idal-conduit.js";
import LegionBarracks from "./legion/building/legion-barracks.js";
import LegionExtractor from "./legion/building/legion-extractor.js";
import Monolith from "./legion/building/monolith.js";
import RitualSite from "./legion/building/ritual-site.js";
import SacrificialSite from "./legion/building/sacrificial-site.js";
import TerrorTower from "./legion/building/terror-tower.js";
import DarkDisciple from "./legion/unit/dark-disciple.js";
import Dreadnought from "./legion/unit/dreadnought.js";
import EmperorProjection from "./legion/unit/emperor-projection.js";
import Exalted from "./legion/unit/exalted.js";
import LegionBuildDrone from "./legion/unit/legion-build-drone.js";
import LegionLaborer from "./legion/unit/legion-laborer.js";
import LegionScoutDrone from "./legion/unit/legion-scout-drone.js";
import Mammoth from "./legion/unit/mammoth.js";
import Steelsworn from "./legion/unit/steelsworn.js";
import TerrorTank from "./legion/unit/terror-tank.js";
import Thrall from "./legion/unit/thrall.js";
import Galavax from "./legion/hero/galavax.js";
import Inquisitress from "./legion/hero/inquisitress.js";
import Kraegar from "./legion/hero/kraegar.js";
import Sabretooth from "./legion/hero/sabretooth.js";
import { LegionTalent, LegionTopbar } from "./legion-classes.js";
// Tech tree generation will be handled by generic system
/**
* Legion Faction Entity - Modern Class Architecture
*/
class LegionFactionEntity extends MainFaction {
constructor() {
super();
this.name = "Legion";
this.uuid = "42b636c6-cf98-4534-bcf1-caaf148e2c39";
// Set faction properties
this.faction = "legion";
this.factionName = "Legion";
// Faction settings
this.mercHeroesAllowed = false;
this.description = `Religious fanatic faction focused on uplifting aliens and eradicating synthetics. The Legion excels at tactical flexibility with three simultaneous heroes, powerful customizable tanks, and basic units called Thralls. Their unique mechanics emphasize flux management, hero versatility, and the ability to deploy multiple champions simultaneously while maintaining strong military infrastructure through sacred architecture and divine blessing systems.`;
// Set Legion-specific topbars first (needed for talent unlock references)
this.topbars.recall = new LegionTopbar({
name: "Recall",
topbarType: "recall",
slot: 1,
description: "Recalls all selected units to the Garrison Tower",
hotkey: "Q",
});
this.topbars.reanimate = new LegionTopbar({
name: "Reanimate",
topbarType: "special",
slot: 2,
description: "Resurrects destroyed units with stat bonuses and temporary debuff immunity",
hotkey: "W",
energyCost: 25,
cooldown: 45,
});
this.topbars.ritual = new LegionTopbar({
name: "Ritual",
topbarType: "ultimate",
slot: 3,
description: "Unlocks a ritual site that summons a temporal projection of the Emperor",
hotkey: "E",
energyCost: 50,
cooldown: 180,
});
this.topbars.spawnMonolith = new LegionTopbar({
name: "Spawn Monolith",
topbarType: "ultimate",
slot: 4,
description: "Spawn powerful defensive structure on battlefield",
hotkey: "R",
energyCost: 40,
cooldown: 120,
});
// Set Legion-specific talents using Grell-style pattern
this.talents.warExperience = new LegionTalent({
uuid: "399A15E1-05B7-40B8-8C43-2F9F8D38B639",
name: "War Experience",
level: 1,
description: "Gain additional experience by destroying enemy units (20% of hex+flux cost) as XP",
});
this.talents.improvedConduits = new LegionTalent({
uuid: "A8C7CE20-8CA0-4BA0-A79F-A6F8682D4C41",
name: "Improved Conduits",
level: 1,
description: "Conduits now build instantly and start with max energy",
});
this.talents.efficientUpgrades = new LegionTalent({
uuid: "BC726A99-C585-4FB7-9776-5ED8A654F31F",
name: "Efficient Upgrades",
level: 2,
description: "+40% research speed & -40% research cost",
});
this.talents.deathPact = new LegionTalent({
uuid: "C9E557DE-FBC0-4ABF-8B3E-BAC6454266F6",
name: "Death Pact",
level: 3,
description: "Reanimate bonuses increased by 50%",
});
this.talents.reanimateHero = new LegionTalent({
uuid: "1A0BC61D-13E3-4CD3-9EFE-4532262F97B1",
name: "Reanimate Hero",
level: 3,
description: "Reanimate can target Heroes, debuffing them for 15s upon reanimation.",
});
this.talents.improvedSpellcasting = new LegionTalent({
uuid: "3E409C0B-D96F-4C21-B37F-BC2D08A5E70D",
name: "Improved Spellcasting",
level: 4,
description: "+50% Energy Regen & -30% Ability Cooldown",
});
this.talents.ritual = new LegionTalent({
uuid: "454B28CE-6C39-4A96-B03E-ED4285CD3F27",
name: "Ritual",
level: 5,
description: "Unlocks a ritual site that summons a temporal projection of the Emperor",
unlockedBy: [this.topbars.ritual.id],
});
this.talents.spawnMonolith = new LegionTalent({
uuid: "366619CB-88AC-430E-87AE-0CA2B16D585D",
name: "Spawn Monolith",
level: 5,
description: "Spawn powerful defensive structure on battlefield",
unlockedBy: [this.topbars.spawnMonolith.id],
});
// Set up talent-topbar unlock relationships
this.talents.ritual.apply = () => {
this.topbars.ritual.unlocked = true;
};
this.talents.spawnMonolith.apply = () => {
this.topbars.spawnMonolith.unlocked = true;
};
// Wire up unlock relationships
this.wireUpUnlocks();
// Add all buildings
this.buildings = [
GarrisonTower.id,
IdalConduit.id,
LegionBarracks.id,
LegionExtractor.id,
Beastiary.id,
Citadel.id,
Altar.id,
TerrorTower.id,
Armory.id,
GuardianObelisk.id,
HealingObelisk.id,
Monolith.id,
RitualSite.id,
SacrificialSite.id,
];
// Add all units
this.units = [
LegionBuildDrone.id,
LegionLaborer.id,
LegionScoutDrone.id,
Thrall.id,
Steelsworn.id,
DarkDisciple.id,
Exalted.id,
Mammoth.id,
Dreadnought.id,
TerrorTank.id,
EmperorProjection.id,
];
// Add heroes
this.heroes = [Galavax.id, Inquisitress.id, Kraegar.id, Sabretooth.id];
}
// Provide entity classes for techTree generation
get buildingClasses() {
return [
GarrisonTower,
IdalConduit,
LegionBarracks,
LegionExtractor,
Beastiary,
Citadel,
Altar,
TerrorTower,
Armory,
GuardianObelisk,
HealingObelisk,
Monolith,
RitualSite,
SacrificialSite,
];
}
get unitClasses() {
return [
LegionBuildDrone,
LegionLaborer,
LegionScoutDrone,
Thrall,
Steelsworn,
DarkDisciple,
Exalted,
Mammoth,
Dreadnought,
TerrorTank,
EmperorProjection,
Galavax,
Inquisitress,
Kraegar,
Sabretooth,
];
}
}
LegionFactionEntity.src = "src/zerospace/faction/legion.ts";
// Export the class as default
export default LegionFactionEntity;
// Named exports for all faction contents
export {
// Buildings
Altar, Armory, Beastiary, Citadel,
// Units continued
DarkDisciple, Dreadnought, EmperorProjection, Exalted,
// Heroes
Galavax, GarrisonTower, GuardianObelisk, HealingObelisk, IdalConduit, Inquisitress, Kraegar, LegionBarracks,
// Units
LegionBuildDrone, LegionExtractor, LegionLaborer, LegionScoutDrone, Mammoth, Monolith, RitualSite, Sabretooth, SacrificialSite, Steelsworn, TerrorTank, TerrorTower, Thrall, };
//# sourceMappingURL=legion.js.map