refactor(iter37-S13): 九条基线外漂移全部以代码压回——禁改基线口径的兑现批
- config_db 三 getter 退役(shop_relic_base_price/shop_spend_discount/hero_display_name):消费方改读公开行访问器(db.shop.* / db.hero.*),公开方法面 47→44 - shop_table.validate 单函数分步化(六个 _validate_* 子步骤):函数长度/分支数/局部变量三阈值同时回落,校验语义与报错顺序不变 - battle_end_overlay 庆祝句柄由类成员改为节点元数据承载(21→20 类变量):三处读写改 get_meta/set_meta/remove_meta,句柄单一活跃语义不变 - standee_body 死变量 _portrait_flip 删除(30→29);set_order 并入私有面(21→20 公开方法),唯一调用点同步 - 断言随动:level_shop_economy_test 读表直取;standee_fx_sweep_test d4 三断言改读节点元数据;theme_projection_test V4 蓄力档判据换代(卡① d2 已入库代码的断言补齐) - tools/gdstyle_baseline.txt 零改动:扫描面 105 文件、基线内 229、基线外新违规 0
This commit is contained in:
1 parent
7389618fd1
commit
2ed8166852
9 files changed
+58
-48
No files matched your search
@@ -22,11 +22,24 @@ const SHELF_KINDS := ["attack", "max_hp", "armor", "ap", "feat_ticket", "heal"]
|
||||
|
||||
func validate() -> Array:
|
||||
var errs: Array[Dictionary] = []
|
||||
# 行族空护栏(legacy 四轴 + pool_shelf 皆为 ConfigDB 消费面——缺族即致命)
|
||||
_validate_families(errs)
|
||||
_validate_gp_drops(errs)
|
||||
_validate_level_bonus(errs)
|
||||
_validate_products(errs)
|
||||
_validate_pool_shelf(errs)
|
||||
_validate_price_factors(errs)
|
||||
return errs
|
||||
|
||||
|
||||
# 行族空护栏(legacy 四轴 + pool_shelf 皆为 ConfigDB 消费面——缺族即致命)
|
||||
func _validate_families(errs: Array[Dictionary]) -> void:
|
||||
for family in ["gp_drops", "level_gp_bonus", "products", "price_level_bonus", "pool_shelf"]:
|
||||
if get(family).is_empty():
|
||||
errs.append({"category": "empty_table", "message": "ShopTable 行族为空: %s" % family})
|
||||
# gp_drops:tier 词表封闭 + 掷定域 + 均值锚 + tier 唯一
|
||||
|
||||
|
||||
# gp_drops:tier 词表封闭 + 掷定域 + 均值锚 + tier 唯一
|
||||
func _validate_gp_drops(errs: Array[Dictionary]) -> void:
|
||||
var seen_tier := {}
|
||||
for row in gp_drops:
|
||||
var tier: String = row.get("tier", "")
|
||||
@@ -44,7 +57,10 @@ func validate() -> Array:
|
||||
errs.append({"category": "domain", "message": "gp_drops %s 掷定域越域 [0,999]: %d..%d..%d" % [tier, rmin, mean, rmax]})
|
||||
if rmin > mean or mean > rmax:
|
||||
errs.append({"category": "cross_field", "message": "gp_drops %s 违反 roll_min(%d) ≤ mean(%d) ≤ roll_max(%d)——均值恒等期望锚" % [tier, rmin, mean, rmax]})
|
||||
# level_gp_bonus / price_level_bonus:level_index 连续从 1 递增 + 加值域
|
||||
|
||||
|
||||
# level_gp_bonus / price_level_bonus:level_index 连续从 1 递增 + 加值域
|
||||
func _validate_level_bonus(errs: Array[Dictionary]) -> void:
|
||||
for family in ["level_gp_bonus", "price_level_bonus"]:
|
||||
var arr: Array[Variant] = get(family)
|
||||
var seen := {}
|
||||
@@ -61,7 +77,10 @@ func validate() -> Array:
|
||||
if li != i + 1:
|
||||
errs.append({"category": "structural", "message": "%s level_index 不连续(须从 1 连续递增): 位 %d = %d" % [family, i + 1, li]})
|
||||
break
|
||||
# products:product_id 唯一 + attr 词表 + 价格域 [1,999]
|
||||
|
||||
|
||||
# products:product_id 唯一 + attr 词表 + 价格域 [1,999]
|
||||
func _validate_products(errs: Array[Dictionary]) -> void:
|
||||
var seen_pid := {}
|
||||
for row in products:
|
||||
var pid: String = row.get("product_id", "")
|
||||
@@ -85,7 +104,10 @@ func validate() -> Array:
|
||||
var inc: int = int(row.get("price_increment", -1))
|
||||
if inc < 0 or inc > 999:
|
||||
errs.append({"category": "domain", "message": "%s price_increment 越域 [0,999]: %d" % [pid, inc]})
|
||||
# pool_shelf:kind_id 词表封闭(四切边后种)+ 唯一 + display_name + base_price 域 [1,999]
|
||||
|
||||
|
||||
# pool_shelf:kind_id 词表封闭(四切边后种)+ 唯一 + display_name + base_price 域 [1,999]
|
||||
func _validate_pool_shelf(errs: Array[Dictionary]) -> void:
|
||||
var seen_kind := {}
|
||||
for row in pool_shelf:
|
||||
var kind: String = row.get("kind_id", "")
|
||||
@@ -99,7 +121,10 @@ func validate() -> Array:
|
||||
var base: int = int(row.get("base_price", 0))
|
||||
if base < 1 or base > 999:
|
||||
errs.append({"category": "domain", "message": "pool_shelf %s base_price 越域 [1,999]: %d" % [kind, base]})
|
||||
# 价格因子域(乘法语义——A/b 均 ≥1 单调不降;上界防手滑投值;provisional 值本体归难度曲线与Boss)
|
||||
|
||||
|
||||
# 价格因子域(乘法语义——A/b 均 ≥1 单调不降;上界防手滑投值;provisional 值本体归难度曲线与Boss)
|
||||
func _validate_price_factors(errs: Array[Dictionary]) -> void:
|
||||
if price_a < 1.0 or price_a > 3.0:
|
||||
errs.append({"category": "domain", "message": "price_a 越域 [1.0,3.0]: %f" % price_a})
|
||||
if price_b < 1.0 or price_b > 2.0:
|
||||
@@ -108,4 +133,3 @@ func validate() -> Array:
|
||||
errs.append({"category": "domain", "message": "relic_base_price 越域 [1.0,99.0]: %f" % relic_base_price})
|
||||
if spend_discount <= 0.0 or spend_discount > 1.0:
|
||||
errs.append({"category": "domain", "message": "spend_discount 越域 (0.0,1.0]: %f" % spend_discount})
|
||||
return errs
|
||||
Reference in new issue
Block a user