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

29 lines
2.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
# Validation Question: 玩家能否无指导在一场完整战斗中经历「开战→挖掘规划→轮末结算逐行兑现→胜/负」并逐行归因(P2)
# Date: 2026-09-10
# 数据配置 HeroTable schema(敌人系统 接口漂移新增;单行全局,Rule 4 豁免)。
# atk = 基础攻击恒存在(2026-09-11 用户裁决):域 [1,999]、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——防守方护甲等级基准(2026-09-16 护甲等级掷点批,暂定 10 归 难度曲线与Boss);消费面 = 战斗结算掷点判定阈值基数(ac_up 效果加算其上)
@export var armor_type: String = "light" # enum {light, ward, heavy}——主角护甲类型轴(2026-09-18 营地扩展前置批:可配置可修改;缺省 light 向后兼容);消费面 = 战斗结算甲效矩阵(现行敌方攻击恒 normal 档 = 数值中性的结构位)
@export var attack_type: String = "normal" # enum {normal, pierce, magic}——主角基础攻击类型轴(2026-09-18 营地扩展前置批:基础攻击量(atk)与攻击类型抽象分离——营地永久强化换攻击类型 = 改此字段,量轴不动);消费面 = 战斗结算·战斗段基础分量查甲效矩阵
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})
if not ["light", "ward", "heavy"].has(armor_type):
errs.append({"category": "enum", "message": "armor_type 出域 {light, ward, heavy}: %s" % armor_type})
if not ["normal", "pierce", "magic"].has(attack_type):
errs.append({"category": "enum", "message": "attack_type 出域 {normal, pierce, magic}: %s" % attack_type})
return errs