按 code-conventions §1.4.1 第三轮定稿执行:core 22+schemas 18+presentation 根 14+views 28,全部头注 #→##、删日期/变更叙事/GDD 与架构反向链接/字段与域清单/机制描述,保留职责摘要+真实使用约束(防事故禁令/单一入口/信号契约每信号一行)。main.gd 31→5 行、save_manager 45→5 行、adventure_runner 37→5 行为最大单件。子代理分模块执行(波一 core+schemas、波二 presentation+views,并发≤2)。验收=tools/verify_comment_only_change.py 逐字节校验(82 文件头注区外逐行一致=零行为变更)+audit_file_headers 全绿;纯注释批免冒烟(先例 5843270)
37 lines
2.5 KiB
GDScript
37 lines
2.5 KiB
GDScript
## VERTICAL SLICE - NOT FOR PRODUCTION
|
||
## 行动经济表 schema:行动点预算旋钮单行全局类型化读取(垂直切片验证:完整战斗逐行归因)。
|
||
## validate() 违例加载期致命(fail-fast);表运行期只读,调参只走 data/tables 表值。
|
||
class_name ActionEconomyTable
|
||
extends Resource
|
||
|
||
@export var ap_per_round: int = 6 # [1,32] knob(默认值 = 现行表值基线,2026-09-16 AP 压速批 8→6 随动)
|
||
@export var dig_ap_cost: int = 1 # [1,8] knob(域下限 1 = 零预算系统失效拒绝)
|
||
@export var flag_place_ap_cost: int = 1 # [0,8] knob(flag_pull_ap_cost 随拔旗退役批 2026-09-19 删除)
|
||
@export var rap_refresh_cost: int = 6 # [1,64] knob(默认值随 AP 压速批 8→6 随动)
|
||
@export var refresh_cap_per_round: int = 2 # [1,8] knob(2026-09-12 轮内刷新批——每轮刷新兜底上限,Active/Waiting 合计)
|
||
@export var move_ap_cost: int = 0 # 冻结 0(P4 氛围承载)
|
||
@export var chain_ap_cost: int = 0 # 冻结 0(v2 定稿)
|
||
|
||
|
||
func validate() -> Array:
|
||
var errs: Array[Dictionary] = []
|
||
if ap_per_round < 1 or ap_per_round > 32:
|
||
errs.append({"category": "domain", "message": "ap_per_round 越域 [1,32]: %d" % ap_per_round})
|
||
if dig_ap_cost < 1 or dig_ap_cost > 8:
|
||
errs.append({"category": "domain", "message": "dig_ap_cost 越域 [1,8]: %d" % dig_ap_cost})
|
||
if flag_place_ap_cost < 0 or flag_place_ap_cost > 8:
|
||
errs.append({"category": "domain", "message": "flag_place_ap_cost 越域 [0,8]: %d" % flag_place_ap_cost})
|
||
if rap_refresh_cost < 1 or rap_refresh_cost > 64:
|
||
errs.append({"category": "domain", "message": "rap_refresh_cost 越域 [1,64]: %d" % rap_refresh_cost})
|
||
if refresh_cap_per_round < 1 or refresh_cap_per_round > 8:
|
||
errs.append({"category": "domain", "message": "refresh_cap_per_round 越域 [1,8]: %d" % refresh_cap_per_round})
|
||
if move_ap_cost != 0:
|
||
errs.append({"category": "frozen", "message": "move_ap_cost 结构冻结为 0: %d" % move_ap_cost})
|
||
if chain_ap_cost != 0:
|
||
errs.append({"category": "frozen", "message": "chain_ap_cost 结构冻结为 0: %d" % chain_ap_cost})
|
||
# 跨字段(行动经济 三轮评审增补):任一动作成本 ≤ ap_per_round,违规加载期致命
|
||
for pair in [["dig_ap_cost", dig_ap_cost], ["flag_place_ap_cost", flag_place_ap_cost]]:
|
||
if pair[1] > ap_per_round:
|
||
errs.append({"category": "cross_field", "message": "%s(%d) > ap_per_round(%d)——挖掘/旗动作永久不可用软锁" % [pair[0], pair[1], ap_per_round]})
|
||
return errs
|