# weapon_trace_reach_affect_parity_test —— 40250 AFFECT_GEOMGYEONG。 # # InstanceBaseEffect.cpp::__Warrior_SetGeomgyeongAffect 在开启铁剑气时把 # CActorInstance::SetReachScale 设为 1.5,关闭时恢复 1.0;该值同时被 # WeaponTrace::Update 与攻击碰撞使用。 extends SceneTree const PlayerView = preload("res://ui/player_view.gd") var _fail := 0 func _ck(condition: bool, message: String) -> void: if not condition: _fail += 1 printerr("FAIL: " + message) func _run() -> void: var pv := PlayerView.new() root.add_child(pv) await process_frame var model := Node3D.new() var weapon := MeshInstance3D.new() weapon.name = "Weapon" var box := BoxMesh.new() box.size = Vector3(0.1, 0.1, 1.0) weapon.mesh = box model.add_child(weapon) pv.add_child(model) pv.model = model pv._refresh_weapon_trace() pv.set_affect(15, true, null) var enabled: Dictionary = pv.weapon_trace_state() _ck(is_equal_approx(float(enabled.get("reach_scale", 0.0)), 1.5), "AFFECT_GEOMGYEONG sets WeaponTrace reach scale to 1.5") pv.set_affect(15, false, null) var disabled: Dictionary = pv.weapon_trace_state() _ck(is_equal_approx(float(disabled.get("reach_scale", 0.0)), 1.0), "removing AFFECT_GEOMGYEONG restores WeaponTrace reach scale to 1.0") if _fail == 0: print("PASS: weapon_trace_reach_affect_parity_test (Geomgyeong reach scale)") quit(0) else: printerr("%d check(s) failed" % _fail) quit(1) func _init() -> void: call_deferred("_run")