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
@@ -11,8 +11,13 @@ const Narrator := preload("res://presentation/battle_narrator.gd")
|
||||
# 每次结算行/轮次/节点变化/动作返回后调用(组合根全量重查装配)
|
||||
# 钱包 GP/钥石不在本装配面投喂(中/大循环资源迁出战斗屏——信息归属单一展示面原则);
|
||||
# HP/状态效果单投喂 B 区站桩(B/C 双投喂属重复展示——单一展示面原则)
|
||||
static func refresh(stage: BattleStageView, info: HeroInfoPanelView, ap_bar: ApBarView,
|
||||
settlement, runner, level_active: bool, db, refresh_remaining: int) -> void:
|
||||
# 运行态尾参收拢 ctx 束(u19——键 {settlement, runner, level_active, db, refresh_remaining})
|
||||
static func refresh(stage: BattleStageView, info: HeroInfoPanelView, ap_bar: ApBarView, ctx: Dictionary) -> void:
|
||||
var settlement = ctx.get("settlement")
|
||||
var runner = ctx.get("runner")
|
||||
var level_active: bool = ctx.get("level_active", false)
|
||||
var db = ctx.get("db")
|
||||
var refresh_remaining: int = ctx.get("refresh_remaining", 0)
|
||||
# 特性列表(runner 统一加算区投影:商店购买与关卡大奖励
|
||||
# 共账本〔level_runner bonus{atk,max_hp,armor_class}〕;空加算=整节隐藏〔视图内空态纪律〕。
|
||||
# 呈现只读投影零核心触碰;行文格式=白名单项)
|
||||
@@ -36,7 +41,7 @@ static func refresh(stage: BattleStageView, info: HeroInfoPanelView, ap_bar: ApB
|
||||
info.set_feat_holdings([])
|
||||
if settlement == null:
|
||||
info.set_board_variants([]) # 战斗域角标出战斗即隐(空态纪律)
|
||||
_refresh_out_of_battle(stage, info, ap_bar, runner, level_active, db)
|
||||
_refresh_out_of_battle(stage, info, ap_bar, ctx)
|
||||
return
|
||||
var s: Dictionary[Variant, Variant] = settlement.presentation_snapshot()
|
||||
# 地形变异常驻角标投影(整图变异快照 → 文案行;
|
||||
@@ -44,7 +49,7 @@ static func refresh(stage: BattleStageView, info: HeroInfoPanelView, ap_bar: ApB
|
||||
info.set_board_variants(board_variant_lines(db, s.get("board_variants", [])))
|
||||
var hero: Dictionary[Variant, Variant] = s.hero
|
||||
if hero.is_empty() or not bool(hero.get("alive", false)):
|
||||
_refresh_out_of_battle(stage, info, ap_bar, runner, level_active, db)
|
||||
_refresh_out_of_battle(stage, info, ap_bar, ctx)
|
||||
return
|
||||
_refresh_hero(stage, info, s)
|
||||
_refresh_economy(ap_bar, s, db, refresh_remaining)
|
||||
@@ -92,7 +97,7 @@ static func _refresh_economy(ap_bar: ApBarView, s: Dictionary, db: ConfigDb, ref
|
||||
# 无 archetype 字段,聚合形态会空键兜底实显「流派 ×N · 档一」僵尸文案;流派档位非现行机制)
|
||||
static func feat_holdings_lines(db: ConfigDb, held: Array) -> Array[String]:
|
||||
var rlines: Array[String] = []
|
||||
if db == null or db.feats == null or (db.crossrun.feats.rows as Array).is_empty() or held.is_empty():
|
||||
if db == null or db.crossrun.feats == null or (db.crossrun.feats.rows as Array).is_empty() or held.is_empty():
|
||||
return rlines
|
||||
var counts := {}
|
||||
for rid in held:
|
||||
@@ -109,7 +114,7 @@ static func feat_holdings_lines(db: ConfigDb, held: Array) -> Array[String]:
|
||||
# 文案用常规表述,不用俚语
|
||||
static func board_variant_lines(db: ConfigDb, ids: Array) -> Array[String]:
|
||||
var lines: Array[String] = []
|
||||
if db == null or db.variation == null:
|
||||
if db == null or db.combat.variation == null:
|
||||
return lines
|
||||
for vid in ids:
|
||||
var row: Dictionary[Variant, Variant] = db.combat.variation.row_by_id(String(vid))
|
||||
@@ -145,7 +150,10 @@ static func sync_settlement_visuals(stage: BattleStageView, board_view: BoardVie
|
||||
|
||||
# 战斗外(节点间隙/关卡结束)——HP 读 runner 携带值
|
||||
static func _refresh_out_of_battle(stage: BattleStageView, info: HeroInfoPanelView,
|
||||
ap_bar: ApBarView, runner, level_active: bool, db) -> void:
|
||||
ap_bar: ApBarView, ctx: Dictionary) -> void:
|
||||
var runner = ctx.get("runner")
|
||||
var level_active: bool = ctx.get("level_active", false)
|
||||
var db = ctx.get("db")
|
||||
if not level_active:
|
||||
return
|
||||
if runner != null:
|
||||
@@ -185,7 +193,14 @@ static func outcome_text(outcome: Dictionary) -> String:
|
||||
|
||||
# ---- 批量模拟报告装配(文案归 presenter——视图只 set_text) ----
|
||||
|
||||
static func tune_sim_report(n: int, atk_pct: int, hp_pct: int, wins: int, dmg_all: Array, hp_left_win: Array, hp_boss: Array, rounds_all: Array, death_nodes: Dictionary, base_hp: int) -> String:
|
||||
## 统计束收拢(u19——stats 六键 {wins, dmg_all, hp_left_win, hp_boss, rounds_all, death_nodes})
|
||||
static func tune_sim_report(n: int, atk_pct: int, hp_pct: int, stats: Dictionary, base_hp: int) -> String:
|
||||
var wins: int = stats.get("wins", 0)
|
||||
var dmg_all: Array = stats.get("dmg_all", [])
|
||||
var hp_left_win: Array = stats.get("hp_left_win", [])
|
||||
var hp_boss: Array = stats.get("hp_boss", [])
|
||||
var rounds_all: Array = stats.get("rounds_all", [])
|
||||
var death_nodes: Dictionary = stats.get("death_nodes", {})
|
||||
var lines: Array[String] = []
|
||||
lines.append("[b]模拟 N=%d(atk+%d%% / hp+%d%%)[/b]" % [n, atk_pct, hp_pct])
|
||||
lines.append("关卡完成率 [color=#%s]%.0f%%[/color](%d/%d)" % [UiKit.HEX_LOG_WIN, 100.0 * float(wins) / float(maxi(1, n)), wins, n])
|
||||
|
||||
Reference in new issue
Block a user