feat(fight): 优化技能命中逻辑与效果触发流程

重构了技能攻击处理逻辑,调整了命中判断和效果应用的顺序。
新增 `Calculate_Pre` 接口方法用于实现无视类效果。
修复技能是否命中的判断逻辑,确保效果命中状态正确传递。
清理上回合缓存的效果数据,保证每回合初始状态干净。
统一使用 `IsFirst` 方法判断先后手,提升代码一致性。
完善玩家离线时的数据保存顺序,避免重复操作。
更新依赖模块版本信息。
This commit is contained in:
2025-10-05 00:29:22 +08:00
parent ed01ddedc3
commit f847386b7c
13 changed files with 118 additions and 80 deletions

View File

@@ -95,7 +95,7 @@ func StartClient(id, port uint16, callback any) *struct {
"ws://"+rpcaddr+rpcport, "", []interface{}{
&RPCClient,
}, nil, jsonrpc.WithClientHandler("", callback),
jsonrpc.WithReconnFun(func() { RPCClient.RegisterLogic(id, port) }), //TODO 这里会出现server0注册
jsonrpc.WithReconnFun(func() { RPCClient.RegisterLogic(id, port) }),
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)