refactor(effectarg): 移动EffectArgs初始化逻辑

将EffectArgs的初始化从effectarg.go中的init函数移动到file.go的initfile函数中,
确保在使用前正确加载配置并初始化映射。

refactor(login): 更新Login方法中的Person调用

修改Login方法中对Person函数的调用,传递UserID参数以获取正确的用户信息。

refactor(user): 统一使用Person方法替代PersonOther

在UserSimInfo和UserMoreInfo方法中,将原先调用的PersonOther方法统一替换为
Person方法,保持代码一致性。

refactor(effect_damage): 简化属性获取和伤害计算逻辑

移除deepcopy相关逻辑,简化Effect0的OnSkill方法中的属性获取和伤害计算流程,
直接通过输入参数进行计算。

refactor(fightc): 优化玩家输入处理和战斗逻辑

更新GetInputByPlayer方法中的玩家判断逻辑,使用UserID比较代替对象比较;
在initplayer中添加InitAttackValue调用;
修复battleLoop中打印语句的格式问题;
调整技能攻击处理流程,增加SkillUseEnd回调调用。

refactor(attr): 改进属性获取方法和伤害计算逻辑

将GetProp方法重命名为Prop,并支持传入对方输入参数;
更新CalculatePower方法签名,使用Input类型代替BattlePetEntity;
在属性获取和伤害计算中正确处理双方属性影响。

refactor(playeraction): 简化技能使用逻辑

简化UseSkill方法中获取当前宠物信息的逻辑,去除冗余的条件判断;
在找到对应技能后添加break语句,提高执行效率。

refactor(reg): 更新Person方法实现

合并Person和PersonOther方法为统一的Person方法;
在数据库查询失败时添加错误处理,避免潜在的空指针异常。
```
This commit is contained in:
2025-09-24 12:40:13 +08:00
parent 096828646f
commit 0a1da7d035
9 changed files with 62 additions and 62 deletions

View File

@@ -15,7 +15,7 @@ import (
func (h Controller) UserSimInfo(data *user.SimUserInfoInboundInfo, c *player.Player) (result *user.SimUserInfoOutboundInfo, err errorcode.ErrorCode) {
ret := &user.SimUserInfoOutboundInfo{}
copier.Copy(ret, c.Service.PersonOther(data.UserId))
copier.Copy(ret, c.Service.Person(data.UserId))
return ret, 0
}
@@ -25,7 +25,7 @@ func (h Controller) UserSimInfo(data *user.SimUserInfoInboundInfo, c *player.Pla
// 返回: 包含用户更多信息的输出结果和错误码。
func (h Controller) UserMoreInfo(data *user.MoreUserInfoInboundInfo, c *player.Player) (result *user.MoreUserInfoOutboundInfo, err errorcode.ErrorCode) {
ret := &user.MoreUserInfoOutboundInfo{}
info := c.Service.PersonOther(data.UserId)
info := c.Service.Person(data.UserId)
copier.Copy(ret, info)
//todo 待实现