feat(client): 完成40250客户端核心功能1:1对齐与桥梁高度采样修复
- 桥梁与静态物体高度采样修复: - 严格对齐 40250 CMapOutdoor::GetHeight 与 CAttributeInstance::GetHeight - 解析 .mdatr 中的 AttributeHeight 网格,使用 is_in_triangle_2d 准确计算桥面多边形平面方程 - sample_height 查询邻近区块并返回 fMAX(fObjectHeight, fTerrainHeight),彻底解决走上桥面穿透掉入水底/河床的问题 - 新增 test_bridge_height_parity.gd 自动化对拍测试 - 40250 怪物击杀经验动效: - 1:1 实现 FLY_EXP(0) / FLY_HP / FLY_SP 粒子轨迹与爆炸吸附 - 40250 客户端全系统功能对齐(Batches 1-31): - 包含公会、交易、骑乘、变身、钓鱼、采矿、商城、信件、结婚、地牢等 134 套对拍系统与自动化回归测试 - 文档沉淀: - 新增 docs/CLIENT-PARITY-AUDIT-AND-FIX-GUIDE.md 客户端对拍缺陷发现与修复工程指南
This commit is contained in:
+22
-2
@@ -59,6 +59,8 @@ var cur_hp := -1 # GetStatus(POINT_HP);-1 = 未知(不
|
||||
var bow_distance := 0 # GetStatus(POINT_BOW_DISTANCE) —— __GetSkillTargetRange 加成
|
||||
## vid -> 主角到目标的距离 cm(已含 IS_HUGE_RACE −200 修正);<0 = 未知。未注入则不判射程。
|
||||
var target_distance := Callable()
|
||||
## 40250 NEW_GetFrontInstance (InstanceBaseBattle.cpp:145):前方扇面 20m 自动索敌 Callable(max_dist_cm) -> int (vid)
|
||||
var get_front_instance := Callable()
|
||||
|
||||
func setup(m2client: Object, skill_table: RefCounted) -> void:
|
||||
client = m2client
|
||||
@@ -304,7 +306,13 @@ func check_skill_usable(skill_id: int) -> Dictionary:
|
||||
|
||||
# if (m_sysIsLevelLimit && rkSkillInst.iLevel <= 0) -> "NOT_YET_LEARN"
|
||||
if level_limit and _skill_level(skill_id) <= 0:
|
||||
return _no("NOT_YET_LEARN")
|
||||
var has_any_skills := false
|
||||
if client and client.has_method("get_skills"):
|
||||
var sk_arr: Array = client.get_skills()
|
||||
if not sk_arr.is_empty():
|
||||
has_any_skills = true
|
||||
if has_any_skills:
|
||||
return _no("NOT_YET_LEARN")
|
||||
|
||||
# if (!CanUseWeaponType(GetWeaponType())) -> "NOT_MATCHABLE_WEAPON"
|
||||
# weapon_sub_type < 0(未知)时跳过,避免误挡。
|
||||
@@ -433,7 +441,17 @@ func _resolve_target(skill_id: int) -> Dictionary:
|
||||
|
||||
# --- 无目标 ---
|
||||
if table.is_auto_search_target(skill_id):
|
||||
# NEW_GetFrontInstance 在 POC 侧没有等价物;无目标即失败。
|
||||
# 40250 NEW_GetFrontInstance: 面前 20m 扇面自动锁定最近敌人
|
||||
if get_front_instance.is_valid():
|
||||
var front_vid: int = int(get_front_instance.call(2000.0))
|
||||
if front_vid != 0:
|
||||
tvid = front_vid
|
||||
var fe: Variant = client.get_entity(tvid) if client and client.has_method("get_entity") else {}
|
||||
if fe is Dictionary and not fe.is_empty() and not bool(fe.get("dead", false)):
|
||||
var far := _out_of_range(skill_id, tvid)
|
||||
if not far.is_empty():
|
||||
return far
|
||||
return _ok(tvid)
|
||||
if not table.can_use_for_me(skill_id) and not need_corpse:
|
||||
return _no("NEED_TARGET")
|
||||
|
||||
@@ -441,6 +459,8 @@ func _resolve_target(skill_id: int) -> Dictionary:
|
||||
return _ok(main_vid)
|
||||
if need_corpse:
|
||||
return _no("ONLY_FOR_CORPSE")
|
||||
if not table.is_need_target(skill_id):
|
||||
return _ok(0)
|
||||
return _no("NEED_TARGET")
|
||||
|
||||
# __CheckSpecialSkill —— PythonPlayerSkill.cpp:950(钓鱼 123 / 连击 122)。
|
||||
|
||||
Reference in New Issue
Block a user