refactor(fight/input): 将Death方法移至attr.go文件,新增Prop方法处理属性变更并优化效果实现

This commit is contained in:
1
2025-09-23 19:49:17 +00:00
parent 9296f47605
commit 61bab92921
3 changed files with 21 additions and 11 deletions

View File

@@ -46,11 +46,10 @@ func (e *EffectStat) SkillUseEnd(opp *input.Input) {
t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100)
if t {
if !e.etype { //自身
e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2])
e.Input.Prop(e.EffectNode.SideEffectArgs[0], e.EffectNode.SideEffectArgs[2])
} else { //对方
opp.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2])
opp.Prop(e.EffectNode.SideEffectArgs[0], e.EffectNode.SideEffectArgs[2])
}
}

View File

@@ -0,0 +1,19 @@
package input
func (u *Input) Death() {
u.CurrentPet.Info.Hp = 0
//todo 待实现死亡effet
}
// 1是添加-1是减少0是清除
func (u *Input) Prop(prop, level int) {
//todo 待交互
u.AttackValue.Prop[prop] = u.AttackValue.Prop[prop] + int8(level)
//todo 待交互
}

View File

@@ -57,14 +57,6 @@ func (i *Input) GetPet(id uint32) (ii *info.BattlePetEntity, Reason info.ChangeP
}
func (u *Input) Death() {
u.CurrentPet.Info.Hp = 0
//todo 待实现死亡effet
}
// GetStatusBonus 获取最高的状态倍率
// 遍历状态数组返回存在的状态中最高的倍率无状态则返回1.0
func (i *Input) GetStatusBonus() float64 {