Files
windroost/p2_godot_sample/scripts/edict_rules_parity_test.gd
T
wushenghua 8062880b7d feat: edict descriptions become real global combat rules (stage D complete)
Continued PRODUCTION/51. Edicts were flat +3% numbers; their descriptions
(连战加速/持续伤害/能量/召唤/...) now drive actual global rules:

- edict_rules.py / .gd: 6 combat edicts rewrite EVERY visible hero's skills
  (疾风 cooldown x0.85, 守望 weakness, 烈焰 poison DoT, 影行 lowest-hp+crit,
  星辉 energy, 根脉 summon); 3 meta edicts (商路 econ / 远征 branches / 裂隙
  challenge affixes) honestly kept as out-of-combat rules, not faked into DPS.
- hero_skill_loader gained active_edicts param (identity preserved); game_root
  injects edicts alongside talents/growth on the live P3a path.
- test_edict_rules.py PASS 6 checks (each combat edict changes behaviour,
  rules mostly distinct, global across heroes, meta untouched, real battle
  outcome differs); check_edict_rules_parity.py PASS 7 cases python==gd.
- run_edict_rules_ui_test.sh PASS (real game_root): D01 shortens intervals
  [2,3,100,6]->[1.7,2.55,85,5.1]; D03 adds 18 poison events, skill events 19->36.
- 3 new gates; full P2_CHECKS_PASS (78 gates), identity preserved.

Edicts now differ mechanically from talents (global rule vs per-hero rewrite)
and from skills (rule hook vs archetype). Stage E (enemy/boss mechanics) remains.
prototype/ untracked.
2026-11-19 13:56:09 +08:00

39 lines
1.2 KiB
GDScript

extends SceneTree
## Stage D emitter: build skills with active combat edicts (GDScript) for parity.
const HeroSkillLoader = preload("res://scripts/hero_skill_loader.gd")
const OUTPUT_PATH := "res://artifacts/edict_rules_parity_gd.json"
const CASES := [
{"hero": "H01", "edict": "D01"},
{"hero": "H01", "edict": "D03"},
{"hero": "H02", "edict": "D06"},
{"hero": "H05", "edict": "D01"},
{"hero": "H05", "edict": "D04"},
{"hero": "H03", "edict": "D02"},
{"hero": "H06", "edict": "D05"},
]
func _init() -> void:
_run.call_deferred()
func _run() -> void:
var skill_data := HeroSkillLoader.load_skill_data()
var hero_stats := HeroSkillLoader.load_hero_stats()
var results: Array = []
for c in CASES:
var hero := str(c["hero"])
var edict := str(c["edict"])
var skills := HeroSkillLoader.build_skills([hero], skill_data, hero_stats, {}, {}, {edict: true})
results.append({"hero": hero, "edict": edict, "skills": skills})
var dir := ProjectSettings.globalize_path("res://artifacts")
DirAccess.make_dir_recursive_absolute(dir)
var f := FileAccess.open(OUTPUT_PATH, FileAccess.WRITE)
if f != null:
f.store_string(JSON.stringify({"results": results}, "\t", true))
f.close()
print("EDICT_PARITY_GD cases=%d" % results.size())
quit(0)