summaryrefslogtreecommitdiff
path: root/server/lib/core/line_builder/line_builder.dart
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/core/line_builder/line_builder.dart')
-rw-r--r--server/lib/core/line_builder/line_builder.dart63
1 files changed, 63 insertions, 0 deletions
diff --git a/server/lib/core/line_builder/line_builder.dart b/server/lib/core/line_builder/line_builder.dart
new file mode 100644
index 0000000..52883da
--- /dev/null
+++ b/server/lib/core/line_builder/line_builder.dart
@@ -0,0 +1,63 @@
+/// 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<String, String> 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;
+ }
+}