feat(fight): 优化精灵切换逻辑与技能效果处理
- 修改 `ChangePet` 方法,记录初始攻击值并在切换时正确传递 - 简化多个 effect 的初始化方式,移除冗余的 `EffectNode` 字段 - 增强 Effect58 和 Effect67 的逻辑判断,增加空指针检查和类型判断 - 引入 decimal 包用于精确血量计算 - 统一 `Switch` 接口参数,增强状态类和节点类的兼容性 - 修正部分技能效果的触发条件和持续时间设置 - 调整回合结束逻辑,注释掉原有后手增益机制
This commit is contained in:
@@ -60,8 +60,9 @@ func (f *FightC) ChangePet(c common.PlayerI, id uint32) {
|
||||
cool.Loger.Debug(context.Background(), " 战斗chan已关闭")
|
||||
return
|
||||
}
|
||||
selfinput := f.GetInputByPlayer(c, false)
|
||||
|
||||
selfinput := f.GetInputByPlayer(c, false)
|
||||
InitAttackValue := *selfinput.AttackValue
|
||||
oldpet := selfinput.CurrentPet
|
||||
ret := &action.ActiveSwitchAction{
|
||||
BaseAction: action.NewBaseAction(c.GetInfo().UserID),
|
||||
@@ -69,14 +70,14 @@ func (f *FightC) ChangePet(c common.PlayerI, id uint32) {
|
||||
selfinput.CurrentPet, ret.Reason = selfinput.GetPet(id)
|
||||
|
||||
f.Switch = append(f.Switch, ret)
|
||||
f.GetInputByPlayer(c, false).InitAttackValue() //切换精灵消除能力提升
|
||||
selfinput.InitAttackValue() //切换精灵消除能力提升
|
||||
//这时候精灵已经切换过了,可以直接给新精灵加效果
|
||||
|
||||
f.Broadcast(func(ff *input.Input) {
|
||||
|
||||
ff.Exec(func(t input.Effect) bool {
|
||||
|
||||
t.Switch(selfinput, oldpet, selfinput.CurrentPet)
|
||||
t.Switch(selfinput, InitAttackValue, oldpet)
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user