37 lines
2.4 KiB
GDScript
37 lines
2.4 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(默认值 = 现行表值基线,随 AP 压速调整)
|
||
@export var dig_ap_cost: int = 1 # [1,8] knob(域下限 1 = 零预算系统失效拒绝)
|
||
@export var seal_place_ap_cost: int = 1 # [0,8] knob(无 seal_pull_ap_cost 字段——拔印不占 AP)
|
||
@export var rap_refresh_cost: int = 6 # [1,64] knob(默认值随 AP 压速调整)
|
||
@export var refresh_cap_per_round: int = 2 # [1,8] knob(每轮刷新兜底上限,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 seal_place_ap_cost < 0 or seal_place_ap_cost > 8:
|
||
errs.append({"category": "domain", "message": "seal_place_ap_cost 越域 [0,8]: %d" % seal_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], ["seal_place_ap_cost", seal_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
|