- 桥梁与静态物体高度采样修复: - 严格对齐 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 客户端对拍缺陷发现与修复工程指南
77 lines
2.7 KiB
GDScript
77 lines
2.7 KiB
GDScript
# RemotePlayerView —— ClientVS22 的远端 PC 表现层。
|
|
#
|
|
# 远端 PC 与本地玩家共用 PlayerView 的 race / GR2 / MSA 装载,但装备来源
|
|
# 必须是 awPart[CHR_EQUIPPART_ARMOR..HAIR],不能读取本地 get_equipment()。
|
|
extends "res://ui/player_view.gd"
|
|
|
|
const EquipModel = preload("res://ui/equip_model.gd")
|
|
|
|
var remote_equip: Node
|
|
var _remote_parts: Array = []
|
|
var _remote_proto: Node
|
|
|
|
const ITEM_TYPE_WEAPON := 1
|
|
const MODE_GENERAL := 1
|
|
const MODE_ONEHAND_SWORD := 2
|
|
const MODE_TWOHAND_SWORD := 3
|
|
const MODE_DUALHAND_SWORD := 4
|
|
const MODE_BOW := 5
|
|
const MODE_FAN := 6
|
|
const MODE_BELL := 7
|
|
const WEAPON_MODE := {0: MODE_ONEHAND_SWORD, 1: MODE_DUALHAND_SWORD, 2: MODE_BOW,
|
|
3: MODE_TWOHAND_SWORD, 4: MODE_BELL, 5: MODE_FAN}
|
|
|
|
func _ready() -> void:
|
|
if remote_equip and remote_equip.has_method("refresh_refine_effects"):
|
|
remote_equip.call_deferred("refresh_refine_effects")
|
|
|
|
func build_remote(assets_root: String, race: int, parts: Array, item_list: RefCounted,
|
|
proto: Node = null, pump := Callable(), effects: RefCounted = null) -> bool:
|
|
if not build(assets_root, race, pump):
|
|
return false
|
|
_remote_proto = proto
|
|
_remote_parts = parts.duplicate()
|
|
while _remote_parts.size() < 4:
|
|
_remote_parts.append(0)
|
|
if _remote_parts.size() > 4:
|
|
_remote_parts = _remote_parts.slice(0, 4)
|
|
remote_equip = EquipModel.new()
|
|
remote_equip.name = "RemoteEquipModel"
|
|
add_child(remote_equip)
|
|
remote_equip.effect_registry = effects
|
|
remote_equip.setup_remote(item_list, func() -> Node: return self, assets_root, race,
|
|
_remote_parts, proto)
|
|
_refresh_weapon_motion()
|
|
return true
|
|
|
|
# net_world 按 NetworkActorManager.cpp:473 的顺序调用这四个字段。
|
|
func set_armor(vnum: int) -> void:
|
|
_set_remote_part(EquipModel.PART_ARMOR, vnum)
|
|
|
|
func set_weapon(vnum: int) -> void:
|
|
_set_remote_part(EquipModel.PART_WEAPON, vnum)
|
|
_refresh_weapon_motion()
|
|
|
|
func set_head(vnum: int) -> void:
|
|
_set_remote_part(EquipModel.PART_HEAD, vnum)
|
|
|
|
func set_hair(vnum: int) -> void:
|
|
_set_remote_part(EquipModel.PART_HAIR, vnum)
|
|
|
|
func _set_remote_part(index: int, vnum: int) -> void:
|
|
while _remote_parts.size() <= index:
|
|
_remote_parts.append(0)
|
|
_remote_parts[index] = vnum
|
|
if remote_equip:
|
|
remote_equip._set_remote_part(index, vnum)
|
|
remote_equip.refresh()
|
|
|
|
func _refresh_weapon_motion() -> void:
|
|
var vnum := int(_remote_parts[EquipModel.PART_WEAPON]) if _remote_parts.size() > EquipModel.PART_WEAPON else 0
|
|
var mode := MODE_GENERAL
|
|
if vnum > 0 and _remote_proto and _remote_proto.has_method("item"):
|
|
var item: Dictionary = _remote_proto.item(vnum)
|
|
if int(item.get("type", -1)) == ITEM_TYPE_WEAPON:
|
|
mode = int(WEAPON_MODE.get(int(item.get("sub_type", -1)), MODE_GENERAL))
|
|
set_motion_mode(mode)
|