45 lines
968 B
Go
45 lines
968 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 551: 使对手下回合受到其他技能的伤害翻倍
|
|
type Effect551 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect551) OnSkill() bool {
|
|
|
|
addSubEffect(e.Ctx().Our, e.Ctx().Opp, &e.EffectNode, &DamageDoubleEffect{}, 1)
|
|
|
|
return true
|
|
}
|
|
|
|
// DamageDoubleEffect 是一个临时效果,使目标受到的伤害翻倍
|
|
type DamageDoubleEffect struct {
|
|
node.EffectNode
|
|
roundsLeft int
|
|
source *input.Input
|
|
target *input.Input
|
|
}
|
|
|
|
// DamageMultiply 在计算伤害时触发,将伤害翻倍
|
|
func (d *DamageDoubleEffect) DamageDivEx(t *info.DamageZone) bool {
|
|
if t.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
// 将伤害翻倍
|
|
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(2))
|
|
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 551, &Effect551{})
|
|
}
|