Files
gplan-2/game/data/schemas/hero_table.gd
T

22 lines
1.3 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## VERTICAL SLICE - NOT FOR PRODUCTION
## 英雄基线表 schema:max_hp/atk/armor_class 三数值轴单行全局类型化读取(垂直切片验证:完整战斗逐行归因)。
## 类型轴不归本表(所有权在锻造工坊):默认值住 forge 表常驻持有、选中态写存档经参数面注入。
## atk 无零基线:0 = 加载拒绝(零基线死锁在 schema 层杜绝)。
class_name HeroTable
extends Resource
@export var max_hp: int = 50 # [1,999] knob(provisional,溯源 = 原型锚)
@export var atk: int = 6 # [1,999] knob——基础攻击(溯源 = 概念原型 HERO_BASE_ATK,provisional 归 难度曲线与Boss);消费面 = 战斗结算·战斗段先手攻击
@export var armor_class: int = 10 # [0,999] knob——防守方护甲等级基准(暂定 10 归 难度曲线与Boss);消费面 = 战斗结算掷点判定阈值基数(ac_up 效果加算其上)
func validate() -> Array:
var errs: Array[Dictionary] = []
if max_hp < 1 or max_hp > 999:
errs.append({"category": "domain", "message": "max_hp 越域 [1,999]: %d" % max_hp})
if atk < 1 or atk > 999:
errs.append({"category": "domain", "message": "atk 越域 [1,999]: %d" % atk})
if armor_class < 0 or armor_class > 999:
errs.append({"category": "domain", "message": "armor_class 越域 [0,999]: %d" % armor_class})
return errs