48 lines
831 B
Go
48 lines
831 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倍反馈给对手
|
||
*/
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 34, &Effect34{})
|
||
|
||
}
|
||
|
||
type Effect34 struct {
|
||
node.EffectNode
|
||
can bool
|
||
}
|
||
|
||
// 使用技能时,不可被继承,继承Miss和Hit就行
|
||
func (e *Effect34) OnSkill() bool {
|
||
if !e.Hit() {
|
||
return true
|
||
}
|
||
e.can = true
|
||
return true
|
||
}
|
||
|
||
// 被攻击时候反弹
|
||
func (e *Effect34) Damage_Floor(t *info.DamageZone) bool {
|
||
|
||
if !e.can {
|
||
return true
|
||
}
|
||
//不是技能
|
||
if e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
t.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Mul(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||
|
||
return true
|
||
}
|