Implement 40250 classic client port
This commit is contained in:
@@ -16,6 +16,9 @@ class FakeClient extends Node:
|
||||
signal target_info(vid: int, hp_percent: int)
|
||||
signal chat(type: int, vid: int, text: String)
|
||||
signal damage(vid: int, amount: int, flag: int)
|
||||
signal motion(vid: int, victim_vid: int, motion: int)
|
||||
signal gift_available()
|
||||
signal guild_make_requested()
|
||||
var ents := {}
|
||||
var main := 0
|
||||
func is_in_game() -> bool: return true
|
||||
@@ -24,6 +27,7 @@ class FakeClient extends Node:
|
||||
func move(_f, _a, _r, _x, _y) -> bool: return true
|
||||
func attack(_m, _v) -> bool: return true
|
||||
func set_target(_v) -> bool: return true
|
||||
func guild_answer_make(_name: String) -> bool: return true
|
||||
func spawn(vid, nm, pos, is_main := false):
|
||||
ents[vid] = {"vid": vid, "name": nm, "pos": pos, "is_main": is_main,
|
||||
"func": 0, "moving": false, "angle_deg": 0.0, "hp": 100, "max_hp": 100, "dead": false}
|
||||
@@ -66,6 +70,7 @@ func _run() -> void:
|
||||
_ck(gs.net_world != null, "net_world built")
|
||||
_ck(gs.net_play != null, "net_play built")
|
||||
_ck(gs.hud != null, "hud built")
|
||||
_ck(gs.dragon_soul_ui == null, "Dragon Soul runtime entry disabled for target 40250")
|
||||
_ck(gs.atlas_ui != null, "atlas_ui built")
|
||||
_ck(gs.get_node_or_null("Entities") != null, "entity mount present")
|
||||
|
||||
@@ -76,6 +81,20 @@ func _run() -> void:
|
||||
# 3) net_world 不给主角画节点(本地 player 代表)
|
||||
await process_frame
|
||||
_ck(gs.net_world.node_for(1000) == null, "no net_world node for local vid")
|
||||
fc.motion.emit(1000, 0, 305) # CRaceMotionData::NAME_CLAP
|
||||
await process_frame
|
||||
_ck(int(gs.player.get_meta("last_motion", 0)) == 305,
|
||||
"local GC_MOTION reaches the player representative")
|
||||
fc.gift_available.emit()
|
||||
await process_frame
|
||||
_ck(gs._gift_dialog != null and gs._gift_dialog.visible,
|
||||
"gift server command opens a visible notification")
|
||||
gs._gift_dialog.hide() # 关闭已有 modal,模拟玩家已处理上一条通知
|
||||
fc.guild_make_requested.emit()
|
||||
await process_frame
|
||||
_ck(gs.guild_ui._create_dialog != null and gs.guild_ui._create_dialog.visible,
|
||||
"guild make request reaches the in-game guild creation dialog")
|
||||
gs.guild_ui._close_guild_create_dialog()
|
||||
|
||||
# 4) 别的实体会被镜像成挂载节点
|
||||
fc.spawn(2000, "Wolf", Vector3(25, 0, -30))
|
||||
|
||||
Reference in New Issue
Block a user