移除冗余的 Calculate_Pre 调用注释,优化技能命中判断流程。 将 SkillID 赋值操作移动至命中条件判断内部,确保仅在技能命中时记录。 注释掉部分不再使用的接口方法定义,保持代码整洁。
42 lines
739 B
Go
42 lines
739 B
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
|
||
"github.com/shopspring/decimal"
|
||
)
|
||
|
||
/**
|
||
* 若造成的伤害低于n,则所有技能的PP值提高m点
|
||
*/
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 134, &Effect134{})
|
||
|
||
}
|
||
|
||
type Effect134 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
func (e *Effect134) Damage_Floor(t *info.DamageZone) bool {
|
||
if !e.Hit() {
|
||
return true
|
||
}
|
||
// fmt.Println("Effect134_old", t.Damage.IntPart())
|
||
if t.Type == info.DamageType.Red {
|
||
|
||
is := t.Damage.Cmp(decimal.NewFromInt(int64(e.Args()[0])))
|
||
if is == -1 {
|
||
|
||
e.Ctx().Our.HealPP(e.Args()[1])
|
||
|
||
}
|
||
|
||
}
|
||
//fmt.Println("Effect134_new", t.Damage.IntPart())
|
||
return true
|
||
}
|