Kelsidavis-WoWee/include/pipeline/wowee_runes.hpp
Kelsi ad603c0c44 feat(pipeline): add WRUN (Wowee DK Rune Cost) catalog
62nd open format — replaces RuneCost.dbc plus the DK-specific
portions of ChrPowerType. Defines per-spell rune costs (Blood
/ Frost / Unholy) and runic-power generation / consumption
for the Death Knight class.

4 spell tree branches (BloodTree / FrostTree / UnholyTree /
Generic) classify which spec uses each rune cost. Each entry
binds a spell to its rune cost (how many of each rune kind
the spell consumes), an optional anyDeathConvertCost (extra
Death-rune-acceptable cost for procced abilities), and a
runicPowerCost (negative = generator, positive = spender).

Cross-references with prior formats — spellId points at
WSPL.spellId (the spell that uses this rune cost).

CLI: --gen-rune (3 baseline DK abilities — Death Strike
1F+1U + 20RP gen, Frost Strike pure 40 RP spender, Heart
Strike 1B + 10RP gen), --gen-rune-blood (4 blood-tree DK
abilities — Heart Strike, Death and Decay AoE, Vampiric
Blood tank cooldown, Rune Tap self-heal), --gen-rune-frost
(4 frost-tree — Frost Strike, Howling Blast AoE, Obliterate
finisher, Icy Touch ranged opener applying Frost Fever),
--info-wrun, --validate-wrun with --json variants. Validator
catches id+name+spellId required, branch 0..3, no rune cost
> 2 (DK only has 2 of each rune type so a higher cost can
never be paid), runicPowerCost > 100 (DK RP cap), no-cost
warning (spell consumes nothing — verify it's a
passive/stance/form), and high-RP-generator warning (> 25
RP per cast is unusual).

Format graph: 61 → 62 binary formats. CLI flag count: 840
→ 847.
2026-05-09 20:52:19 -07:00

96 lines
3.5 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace wowee {
namespace pipeline {
// Wowee Open Death Knight Rune Cost catalog (.wrun) — novel
// replacement for Blizzard's RuneCost.dbc plus the DK-specific
// portions of ChrPowerType. Defines per-spell rune costs
// (Blood / Frost / Unholy) and runic-power generation /
// consumption for the Death Knight class.
//
// Each entry binds a spell to its rune cost: how many of each
// rune kind the spell consumes, and how much runic power it
// generates (positive) or spends (negative). Death runes —
// the wildcard rune that fills any slot — are tracked
// implicitly: a spell with anyDeathConvertCost > 0 will
// consume Death runes preferentially over its specified type.
//
// Cross-references with previously-added formats:
// WRUN.entry.spellId → WSPL.spellId (the spell that uses
// this rune cost)
//
// Binary layout (little-endian):
// magic[4] = "WRUN"
// version (uint32) = current 1
// nameLen + name (catalog label)
// entryCount (uint32)
// entries (each):
// runeCostId (uint32)
// spellId (uint32)
// nameLen + name
// descLen + description
// bloodCost (uint8) / frostCost (uint8) /
// unholyCost (uint8) / anyDeathConvertCost (uint8)
// runicPowerCost (int16) / pad[2]
// spellTreeBranch (uint8) / pad[3]
struct WoweeRuneCost {
enum SpellTreeBranch : uint8_t {
BloodTree = 0, // tank-spec blood tree
FrostTree = 1, // 2H DPS frost tree
UnholyTree = 2, // pet-spec unholy tree
Generic = 3, // baseline non-tree-specific
};
struct Entry {
uint32_t runeCostId = 0;
uint32_t spellId = 0; // WSPL cross-ref
std::string name;
std::string description;
uint8_t bloodCost = 0; // # blood runes consumed
uint8_t frostCost = 0; // # frost runes consumed
uint8_t unholyCost = 0; // # unholy runes consumed
uint8_t anyDeathConvertCost = 0; // # additional Death-rune-OK runes
int16_t runicPowerCost = 0; // < 0 = generator, > 0 = spender
uint8_t spellTreeBranch = Generic;
};
std::string name;
std::vector<Entry> entries;
bool isValid() const { return !entries.empty(); }
const Entry* findById(uint32_t runeCostId) const;
static const char* spellTreeBranchName(uint8_t b);
};
class WoweeRuneCostLoader {
public:
static bool save(const WoweeRuneCost& cat,
const std::string& basePath);
static WoweeRuneCost load(const std::string& basePath);
static bool exists(const std::string& basePath);
// Preset emitters used by --gen-rune* variants.
//
// makeStarter — 3 baseline DK abilities (Death Strike
// 1B+1F, Frost Strike +20 RP spender,
// Heart Strike 1B generator).
// makeBlood — 4 blood-tree abilities (Heart Strike,
// Death and Decay, Vampiric Blood, Rune
// Tap) — tanking + self-heal kit.
// makeFrost — 4 frost-tree abilities (Frost Strike,
// Howling Blast, Obliterate, Icy Touch)
// — DPS rotation kit.
static WoweeRuneCost makeStarter(const std::string& catalogName);
static WoweeRuneCost makeBlood(const std::string& catalogName);
static WoweeRuneCost makeFrost(const std::string& catalogName);
};
} // namespace pipeline
} // namespace wowee