UNPKG

@zerospacegg/iolin

Version:

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

129 lines (116 loc) 6.7 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TopbarAbilities = void 0; const mechanic_js_1 = require("../../engine/mechanic.cjs"); const protectorate_js_1 = __importDefault(require("../faction/protectorate.cjs")); // Import main faction entities const grell_js_1 = __importDefault(require("../faction/grell.cjs")); const legion_js_1 = __importDefault(require("../faction/legion.cjs")); // Import mercenary faction entities const arandi_js_1 = __importDefault(require("../mercenary/arandi.cjs")); const chakru_js_1 = __importDefault(require("../mercenary/chakru.cjs")); const dread_js_1 = __importDefault(require("../mercenary/dread.cjs")); const marran_js_1 = __importDefault(require("../mercenary/marran.cjs")); const valkaru_js_1 = __importDefault(require("../mercenary/valkaru.cjs")); // import Sanctuary from "../mercenary/sanctuary.cjs"; // import Koru from "../mercenary/koru.cjs"; class TopbarAbilities extends mechanic_js_1.GameMechanic { constructor() { super(); this.name = "Topbar Abilities"; this.uuid = "b5d54656-c982-4b01-b78d-1879a0703159"; // Instantiate all factions to get their topbar data dynamically const protectorate = new protectorate_js_1.default(); const grell = new grell_js_1.default(); const legion = new legion_js_1.default(); const arandi = new arandi_js_1.default(); const chakru = new chakru_js_1.default(); const dreadRaiders = new dread_js_1.default(); const marran = new marran_js_1.default(); const valkaru = new valkaru_js_1.default(); // const sanctuary = new Sanctuary(); // const koru = new Koru(); // Build dynamic topbar analysis const mainFactions = [ { name: protectorate.name, topbars: protectorate.topbars, talents: protectorate.talents }, { name: grell.name, topbars: grell.topbars, talents: grell.talents }, { name: legion.name, topbars: legion.topbars, talents: legion.talents }, ]; const mercFactions = [ { name: arandi.name, topbars: arandi.topbars }, { name: chakru.name, topbars: chakru.topbars }, { name: dreadRaiders.name, topbars: dreadRaiders.topbars }, { name: marran.name, topbars: marran.topbars }, { name: valkaru.name, topbars: valkaru.topbars }, // { name: sanctuary.name, topbars: sanctuary.topbars }, // { name: koru.name, topbars: koru.topbars } ].filter(faction => faction.topbars && Object.keys(faction.topbars).length > 0); // Analyze main faction topbar patterns const mainFactionAnalysis = mainFactions .map(faction => { const topbarEntries = Object.entries(faction.topbars); const recall = topbarEntries.find(([key, topbar]) => topbar.topbarType === "recall" || topbar.slot === 1); const special = topbarEntries.find(([key, topbar]) => topbar.topbarType === "special" || topbar.slot === 2); const ultimates = topbarEntries.filter(([key, topbar]) => topbar.topbarType === "ultimate" || (topbar.slot >= 3 && topbar.slot <= 4)); // Find level 5 talents that unlock topbars const level5Talents = Object.entries(faction.talents || {}).filter(([key, talent]) => talent.level === 5); return ` **${faction.name}:** - **Recall (Slot 1):** ${recall ? `${recall[1].name} - ${recall[1].description}` : "Unknown"} - **Core Ability (Slot 2):** ${special ? `${special[1].name} - ${special[1].description}` : "Unknown"} - **Level 5 Talents:** ${level5Talents.map(([key, talent]) => `${talent.name} (unlocks topbar abilities)`).join(", ") || "None found"} - **Ultimate Abilities (Slots 3-4):** ${ultimates.map(([key, topbar]) => `Slot ${topbar.slot}: ${topbar.name}`).join(", ") || "None"}`; }) .join("\n"); // Analyze mercenary faction topbars const mercAnalysis = mercFactions.length > 0 ? mercFactions .map(faction => { const topbarEntries = Object.entries(faction.topbars); return ` **${faction.name}:** ${topbarEntries.map(([key, topbar]) => `${topbar.name} (Slot ${topbar.slot || "Unknown"})`).join(", ")}`; }) .join("\n") : "\n*No mercenary factions with topbar abilities found.*"; // Simple description for API/JSON usage this.description = "Topbar abilities are powerful faction-specific powers activated via a 4-slot action bar system, with recall, core abilities, and talent-unlocked ultimates that define faction identity."; // Rich wiki content with {{box}} components this.wiki = ` ## Overview Each faction in ZeroSpace has access to topbar abilities - powerful faction-specific powers activated via the top action bar using a consistent 4-slot structure. {{box-grid}} {{box header="Slot Structure" icon="mdi-view-grid"}} **Universal 4-Slot Layout** 1. **Slot 1 (Q):** Faction-specific recall ability 2. **Slot 2 (W):** Core faction mechanic ability 3. **Slot 3 (E):** Ultimate ability (talent unlock) 4. **Slot 4 (R):** Ultimate ability (talent unlock) - **Choice System**: Level 5 talents unlock slots 3-4 (choose one) {{/box}} {{box header="Energy System" icon="mdi-battery-charging"}} **Topbar Energy Management** - **Separate Pool**: Independent from unit energy systems - **Generation**: Slow passive gain + bonus when your units die - **Cooldowns**: Abilities have faction-specific cooldown periods - **Strategic Resource**: Must manage energy for optimal timing {{/box}} {{/box-grid}} ## Main Faction Topbars All main factions follow the standardized slot pattern: ### Current Main Faction Analysis ${mainFactionAnalysis} ## Mercenary Faction Topbars Mercenary factions may provide additional topbar abilities when chosen as your mercenary ally: ${mercAnalysis} ## Strategic Impact Topbar abilities are crucial for faction identity and provide significant tactical advantages when used effectively in combination with your faction's core strategies and unit compositions. `; } } exports.TopbarAbilities = TopbarAbilities; TopbarAbilities.src = "src/zerospace/mechanic/topbar-abilities.ts"; //# sourceMappingURL=topbar-abilities.js.map