iter41-卡2:呈现层结构收敛批:67清+2豁免+2展平改善——拆私有族+六状态件+ui_kit收敛+束收拢+print删;含u14补做、并master并案与收尾产出物
This commit is contained in:
1 parent
bc75dab615
commit
7beb9bfdd5
94 files changed
+3417
-5314
No files matched your search
@@ -145,71 +145,122 @@ func _format_row(row: Dictionary, agg_count := -1) -> String:
|
||||
var src := _source_label(String(row.get("source_class", "")))
|
||||
var round_no: int = int(row.get("round_index", 0))
|
||||
var prefix := " [color=#%s]R%d%s[/color] " % [UiKit.HEX_LOG_ROUND, round_no, ("·" + src) if src != "" else ""]
|
||||
var hl := String(row.get("highlight", ""))
|
||||
var v: int = int(row.get("value", 0))
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
var target := String(row.get("target", ""))
|
||||
var tail := " → %s" % target if target != "" else ""
|
||||
var suffix := "(%s)" % src if src != "" else ""
|
||||
match String(row.get("type", "")):
|
||||
var kind := String(row.get("type", ""))
|
||||
var body := ""
|
||||
match kind:
|
||||
"effect":
|
||||
# GP 型效果行:「GP 袋 +3」兑付反馈——value = 本行 ±power,
|
||||
# escrow = 战斗内缓冲现值(入钱包在战斗末一次上抛——呈现语义与增益池分账)
|
||||
if String(row.get("effect_id", "")) in ["gp_gain", "gp_loss"]:
|
||||
var gp_col := UiKit.HEX_LOG_GAIN if v > 0 else UiKit.HEX_LOG_LOSS
|
||||
var gp_body := "%s %+d(战斗暂存 %+d)%s" % [name_, v, int(row.get("escrow", 0)), suffix]
|
||||
return prefix + (_gold_frame(gp_body) if hl != "" else "[color=%s]%s[/color]" % [gp_col, gp_body])
|
||||
# 效果行 value = 单次贡献值,pool_value = 池合成值——禁相加呈现(战斗结算 呈现细则)
|
||||
var pool: int = int(row.get("pool_value", 0))
|
||||
var col := UiKit.HEX_LOG_HEAL if v > 0 else UiKit.HEX_LOG_LOSS
|
||||
var body := "%s 单次%+d(池 %+d)%s" % [name_, v, pool, suffix]
|
||||
return prefix + (_gold_frame(body) if hl != "" else "[color=%s]%s[/color]" % [col, body])
|
||||
body = _fmt_effect(row, prefix, suffix)
|
||||
"damage":
|
||||
# 伤害行无行上拆行文案——行上归因读数只剩掷点档位随行
|
||||
# 护甲等级掷点留档(掷点读数与档位随行可读;吃掷点分量恒带,棋盘来源行不带)
|
||||
var roll_txt := ""
|
||||
if row.get("roll", null) != null:
|
||||
roll_txt = "〔掷 %d vs 护甲 %d" % [int(row.roll), int(row.ac)]
|
||||
if bool(row.get("crit", false)):
|
||||
roll_txt += " · 暴击×%d" % int(_db.combat.settlement.damage_roll.crit_multiplier)
|
||||
elif int(row.tier) < 100:
|
||||
roll_txt += " · ×%d%%" % int(row.tier)
|
||||
roll_txt += "〕"
|
||||
var kill := " ⚔击杀!" if row.get("killed", false) else ""
|
||||
# 伤害数字不明显——伤害值放大加色独立于行文(朱红大一号——数字即信息主角,非同字号色温微差)
|
||||
var body := "%s [color=#%s][size=17]-%d[/size][/color]%s%s%s%s" % [name_, UiKit.HEX_LOG_DMG_NUM, v, roll_txt, tail, kill, suffix]
|
||||
var body_col := UiKit.HEX_LOG_DMG_KILL if row.get("killed", false) else (UiKit.HEX_LOG_ROUND if v == 0 else UiKit.HEX_LOG_DMG_BODY)
|
||||
if bool(row.get("crit", false)):
|
||||
return prefix + _gold_frame(body) # nat 最大面暴击 = 金框高亮行
|
||||
return prefix + "[color=%s]%s[/color]" % [body_col, body]
|
||||
"heal":
|
||||
return prefix + "[color=#%s]%s +%d%s%s[/color]" % [UiKit.HEX_LOG_HEAL, name_, v, tail, suffix]
|
||||
body = _fmt_damage(row, prefix, suffix)
|
||||
"heal", "cast", "decay":
|
||||
body = _fmt_simple(kind, row, prefix, suffix)
|
||||
"reward_ineffective":
|
||||
# 未生效类行:⚠ icon + 划线形状冗余(非色相独载)+ 聚合计数
|
||||
var n := (" ×%d" % agg_count) if agg_count > 1 else ""
|
||||
return prefix + "[s][color=#%s]⚠ %s%s[/color][/s]%s" % [UiKit.HEX_LOG_VOIDED, name_, n, suffix]
|
||||
body = _fmt_ineffective(row, prefix, suffix, agg_count)
|
||||
"seal_miss":
|
||||
var miss_note := ""
|
||||
if hl == "perfect_broken":
|
||||
miss_note = "(本图完美封印已破——清图奖励不再加倍)"
|
||||
elif hl == "":
|
||||
miss_note = "(首次封印落空已豁免——不计入完美封印判定)"
|
||||
var body := "✗ %s%s" % [name_, miss_note]
|
||||
return prefix + (_gold_frame(body) if hl == "perfect_broken" else "[color=#%s]%s[/color]" % [UiKit.HEX_LOG_ROUND, body])
|
||||
body = _fmt_seal_miss(row, prefix)
|
||||
"verdict":
|
||||
body = _fmt_verdict(row)
|
||||
_:
|
||||
body = _fmt_default(row, prefix, suffix)
|
||||
return body
|
||||
|
||||
|
||||
## 简单行域(heal/cast/decay 三型——单行单墨直排)
|
||||
func _fmt_simple(kind: String, row: Dictionary, prefix: String, suffix: String) -> String:
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
match kind:
|
||||
"heal":
|
||||
return prefix + "[color=#%s]%s +%d%s%s[/color]" % [UiKit.HEX_LOG_HEAL, name_, int(row.get("value", 0)), _tail_of(row), suffix]
|
||||
"cast":
|
||||
# 施放行:增益技 0 伤害施放,具名技能
|
||||
return prefix + "[color=#%s]✦ %s%s[/color]" % [UiKit.HEX_LOG_CAST, name_, suffix]
|
||||
"decay":
|
||||
return prefix + "[color=#%s]状态衰减 ×%d[/color]" % [UiKit.HEX_LOG_DECAY, v]
|
||||
"verdict":
|
||||
if int(row.value) == 1:
|
||||
return "[color=#%s][b]◆ %s[/b][/color]" % [UiKit.HEX_LOG_WIN, name_]
|
||||
return "[color=#%s][b]◆ %s[/b][/color]" % [UiKit.HEX_LOG_GAIN, name_]
|
||||
"highlight":
|
||||
return prefix + _gold_frame("★ %s" % name_)
|
||||
return prefix + "[color=#%s]状态衰减 ×%d[/color]" % [UiKit.HEX_LOG_DECAY, int(row.get("value", 0))]
|
||||
return ""
|
||||
|
||||
|
||||
## 默认行域(未知型/高亮星标——未知型=名行直排)
|
||||
func _fmt_default(row: Dictionary, prefix: String, suffix: String) -> String:
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
if String(row.get("type", "")) == "highlight":
|
||||
return prefix + _gold_frame("★ %s" % name_)
|
||||
return prefix + name_ + suffix
|
||||
|
||||
|
||||
## 尾注域:目标格指向(行文附加)
|
||||
func _tail_of(row: Dictionary) -> String:
|
||||
var target := String(row.get("target", ""))
|
||||
return " → %s" % target if target != "" else ""
|
||||
|
||||
|
||||
## GP 型效果行域:「GP 袋 +3」兑付反馈——value = 本行 ±power,
|
||||
## escrow = 战斗内缓冲现值(入钱包在战斗末一次上抛——呈现语义与增益池分账)
|
||||
func _fmt_effect(row: Dictionary, prefix: String, suffix: String) -> String:
|
||||
var v: int = int(row.get("value", 0))
|
||||
var hl := String(row.get("highlight", ""))
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
if String(row.get("effect_id", "")) in ["gp_gain", "gp_loss"]:
|
||||
var gp_col := UiKit.HEX_LOG_GAIN if v > 0 else UiKit.HEX_LOG_LOSS
|
||||
var gp_body := "%s %+d(战斗暂存 %+d)%s" % [name_, v, int(row.get("escrow", 0)), suffix]
|
||||
return prefix + (_gold_frame(gp_body) if hl != "" else "[color=%s]%s[/color]" % [gp_col, gp_body])
|
||||
# 效果行 value = 单次贡献值,pool_value = 池合成值——禁相加呈现(战斗结算 呈现细则)
|
||||
var pool: int = int(row.get("pool_value", 0))
|
||||
var col := UiKit.HEX_LOG_HEAL if v > 0 else UiKit.HEX_LOG_LOSS
|
||||
var body := "%s 单次%+d(池 %+d)%s" % [name_, v, pool, suffix]
|
||||
return prefix + (_gold_frame(body) if hl != "" else "[color=%s]%s[/color]" % [col, body])
|
||||
|
||||
|
||||
## 伤害行域:行上归因读数只剩掷点档位随行(护甲等级掷点留档——掷点读数与档位随行可读;
|
||||
## 吃掷点分量恒带,棋盘来源行不带)。伤害数字不明显——伤害值放大加色独立于行文(朱红大一号)
|
||||
func _fmt_damage(row: Dictionary, prefix: String, suffix: String) -> String:
|
||||
var v: int = int(row.get("value", 0))
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
var tail := _tail_of(row)
|
||||
var roll_txt := ""
|
||||
if row.get("roll", null) != null:
|
||||
roll_txt = "〔掷 %d vs 护甲 %d" % [int(row.roll), int(row.ac)]
|
||||
if bool(row.get("crit", false)):
|
||||
roll_txt += " · 暴击×%d" % int(_db.combat.settlement.damage_roll.crit_multiplier)
|
||||
elif int(row.tier) < 100:
|
||||
roll_txt += " · ×%d%%" % int(row.tier)
|
||||
roll_txt += "〕"
|
||||
var kill := " ⚔击杀!" if row.get("killed", false) else ""
|
||||
var body := "%s [color=#%s][size=17]-%d[/size][/color]%s%s%s%s" % [name_, UiKit.HEX_LOG_DMG_NUM, v, roll_txt, tail, kill, suffix]
|
||||
if bool(row.get("crit", false)):
|
||||
return prefix + _gold_frame(body) # nat 最大面暴击 = 金框高亮行
|
||||
var body_col := UiKit.HEX_LOG_DMG_KILL if row.get("killed", false) else (UiKit.HEX_LOG_ROUND if v == 0 else UiKit.HEX_LOG_DMG_BODY)
|
||||
return prefix + "[color=%s]%s[/color]" % [body_col, body]
|
||||
|
||||
|
||||
## 未生效行域:⚠ icon + 划线形状冗余(非色相独载)+ 聚合计数
|
||||
func _fmt_ineffective(row: Dictionary, prefix: String, suffix: String, agg_count: int) -> String:
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
var n := (" ×%d" % agg_count) if agg_count > 1 else ""
|
||||
return prefix + "[s][color=#%s]⚠ %s%s[/color][/s]%s" % [UiKit.HEX_LOG_VOIDED, name_, n, suffix]
|
||||
|
||||
|
||||
## 封印落空行域:完美破/首失豁免两注记分档(金框=破完美/普通墨=豁免)
|
||||
func _fmt_seal_miss(row: Dictionary, prefix: String) -> String:
|
||||
var hl := String(row.get("highlight", ""))
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
var miss_note := ""
|
||||
if hl == "perfect_broken":
|
||||
miss_note = "(本图完美封印已破——清图奖励不再加倍)"
|
||||
elif hl == "":
|
||||
miss_note = "(首次封印落空已豁免——不计入完美封印判定)"
|
||||
var body := "✗ %s%s" % [name_, miss_note]
|
||||
return prefix + (_gold_frame(body) if hl == "perfect_broken" else "[color=#%s]%s[/color]" % [UiKit.HEX_LOG_ROUND, body])
|
||||
|
||||
|
||||
## 裁定行域:胜金/负绿双墨(粗体菱形头)
|
||||
func _fmt_verdict(row: Dictionary) -> String:
|
||||
var name_: String = String(row.get("display_name", ""))
|
||||
if int(row.value) == 1:
|
||||
return "[color=#%s][b]◆ %s[/b][/color]" % [UiKit.HEX_LOG_WIN, name_]
|
||||
return "[color=#%s][b]◆ %s[/b][/color]" % [UiKit.HEX_LOG_GAIN, name_]
|
||||
|
||||
|
||||
func _strip_bb(bb: String) -> String:
|
||||
var out := ""
|
||||
var in_tag := false
|
||||
|
||||
Reference in new issue
Block a user