refactor(fight/input): 将Death方法移至attr.go文件,新增Prop方法处理属性变更并优化效果实现
This commit is contained in:
@@ -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])
|
||||
}
|
||||
}
|
||||
|
||||
19
logic/service/fight/input/attr.go
Normal file
19
logic/service/fight/input/attr.go
Normal 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 待交互
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user