This commit is contained in:
2025-09-30 18:32:15 +08:00
parent 91d0d29ec9
commit 3aa0362cfe
9 changed files with 135 additions and 145 deletions

View File

@@ -1,8 +1,10 @@
package input
import (
"blazing/common/data/xmlres"
"blazing/common/utils"
"blazing/logic/service/common"
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"github.com/jinzhu/copier"
@@ -10,11 +12,12 @@ import (
)
type Input struct {
CanChange bool //是否可以死亡切换CanChange
CurrentPet *info.BattlePetEntity //当前精灵
AllPet []*info.BattlePetEntity
Player common.PlayerI
Finished bool //是否加载完成
CanChange bool //是否可以死亡切换CanChange
CurrentPet *info.BattlePetEntity //当前精灵
AllPet []*info.BattlePetEntity
Player common.PlayerI
EffectCache []Effect
Finished bool //是否加载完成
*info.AttackValue
FightC common.FightI
// info.BattleActionI
@@ -32,7 +35,7 @@ type Input struct {
//OldAttack int //攻击伤害被挡前伤害记录
} //伤害容器
First bool //是否先手
//First bool //是否先手
}
func NewInput(c common.FightI, p common.PlayerI) *Input {
@@ -97,3 +100,33 @@ func (i *Input) GetStatusBonus() float64 {
return maxBonus
}
// 解析并 施加effect
func (i *Input) Parseskill(defender *Input, skill *action.SelectSkillAction) {
temparg := skill.Skill.SideEffectArgS
for _, v := range skill.Skill.SideEffectS {
t := Geteffect(EffectType.Skill, v)
args := xmlres.EffectArgs[v]
if t.ID != 0 {
t.Effect.SetArgs(i, temparg[:args]...) //设置入参,施加方永远是我方
// if t.Effect.GetOwner() { //如果取反,说明是给对方添加的回合效果
// //实际上,owner永远为反,说明是对方给我添加的
// t.Effect.SetArgs(attacker, temparg[:args]...) //设置入参,施加方永远是我方
// //给双方添加
// defender.AddEffect(t)
// } else {
// t.Effect.SetArgs(attacker, temparg[:args]...) //设置入参
// attacker.AddEffect(t)
// }
//ret = append(ret, t.Effect)
i.EffectCache = append(i.EffectCache, t.Effect)
}
temparg = temparg[args:]
}
}