/// Port of the pure-logic parts of the reference app's ability-line builder. /// /// The reference `LineBuilder` also builds Flutter widgets to render ability /// lines (`createLines`, font metrics, shimmer animation). That rendering is /// re-implemented by the web client in Phase 4 — only the token table and /// element detection are kept here, along with the `debugColors` flag that /// the ported game logic references. class LineBuilder { static const bool debugColors = false; static const Map tokens = { "attack": "Attack", "move": "Move", "teleport": "Teleport", "range": "Range", "heal": "Heal", "target": "Target", "shield": "Shield", "loot": "Loot", "retaliate": "Retaliate", "jump": "Jump", "stun": "STUN", "wound": "WOUND", "disarm": "DISARM", "immobilize": "IMMOBILIZE", "poison": "POISON", "invisible": "INVISIBLE", "strengthen": "STRENGTHEN", "muddle": "MUDDLE", "regenerate": "REGENERATE", "ward": "WARD", "impair": "IMPAIR", "bane": "BANE", "brittle": "BRITTLE", "chill": "CHILL", "infect": "INFECT", "rupture": "RUPTURE", "push": "PUSH", "pull": "PULL", "pierce": "PIERCE", "curse": "CURSE", "enfeeble": "ENFEEBLE", "empower": "EMPOWER", "bless": "BLESS", "safeguard": "SAFEGUARD", "flip": "ROLLING", "damage": "damage", "and": "and", }; static bool isElement(String item) { if (item.contains("air") || item.contains("earth") || item.contains("fire") || item.contains("ice") || item.contains("dark") || item.contains("light") || item == "any") { return true; } return false; } }