Add poison damage over time tactics

This commit is contained in:
2026-06-18 09:37:12 +09:00
parent 07861391c7
commit 1fa7e2afac
10 changed files with 201 additions and 70 deletions

View File

@@ -1051,6 +1051,8 @@ func _floating_text_color(kind: String) -> Color:
return Color(1.0, 0.88, 0.28)
if kind == "debuff":
return Color(0.80, 0.52, 1.0)
if kind == "poison":
return Color(0.54, 0.95, 0.36)
if kind == "miss" or kind == "fade":
return Color(0.82, 0.84, 0.90)
if kind == "defeat":
@@ -1138,7 +1140,7 @@ func _skill_target_preview_badge(selected: Dictionary, target: Dictionary) -> Di
return _make_target_preview_badge("+%d HP" % heal, "heal")
if kind == "support":
var effect_text := str(preview.get("effect_text", "Support"))
var badge_kind := "debuff" if effect_text.contains("-") else "support"
var badge_kind := "poison" if effect_text.contains("Poison") else ("debuff" if effect_text.contains("-") else "support")
return _make_target_preview_badge(_compact_support_preview_text(effect_text), badge_kind)
var result_text := "KO" if bool(preview.get("would_defeat", false)) else "-%d" % int(preview.get("damage", 0))
@@ -1185,6 +1187,9 @@ func _compact_support_preview_text(effect_text: String) -> String:
var until_index := part.find(" until ")
if until_index >= 0:
part = part.substr(0, until_index)
var for_index := part.find(" for ")
if for_index >= 0:
part = part.substr(0, for_index)
if not part.is_empty() and part != "No support effect.":
parts.append(part)
if parts.is_empty():
@@ -1205,6 +1210,8 @@ func _target_preview_badge_color(kind: String) -> Color:
return Color(1.0, 0.88, 0.30)
if kind == "debuff":
return Color(0.78, 0.55, 1.0)
if kind == "poison":
return Color(0.54, 0.95, 0.36)
return Color(0.78, 0.80, 0.86)
@@ -3245,13 +3252,16 @@ func _format_tactic_effect_text(skill: Dictionary) -> String:
for effect in skill.get("effects", []):
if typeof(effect) != TYPE_DICTIONARY:
continue
if str(effect.get("type", "")) != "stat_bonus":
continue
var effect_type := str(effect.get("type", ""))
var amount := int(effect.get("amount", 0))
if amount == 0:
continue
var sign := "+" if amount > 0 else ""
parts.append("%s %s%d" % [str(effect.get("stat", "")).to_upper(), sign, amount])
if effect_type == "stat_bonus":
if amount == 0:
continue
var sign := "+" if amount > 0 else ""
parts.append("%s %s%d" % [str(effect.get("stat", "")).to_upper(), sign, amount])
elif effect_type == "damage_over_time" and amount > 0:
var status_name := str(effect.get("status", "status")).replace("_", " ").capitalize()
parts.append("%s -%d" % [status_name, amount])
if not parts.is_empty():
return _join_strings(parts, ", ")
return "P%d" % int(skill.get("power", 0))