46 lines
1.0 KiB
Go
46 lines
1.0 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 138: 先出手时,{0}回合自己不会受到对手攻击性技能伤害并反弹对手造成伤害的1/{1}
|
|
type Effect138 struct {
|
|
RoundEffectArg0Base
|
|
can bool
|
|
}
|
|
|
|
func (e *Effect138) OnSkill() bool {
|
|
if e.IsFirst() { // 先出手
|
|
e.can = true
|
|
}
|
|
return true
|
|
}
|
|
func (e *Effect138) DamageLockEx(t *info.DamageZone) bool {
|
|
if e.can { // 先出手
|
|
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
|
|
|
// 反弹1/n造成的伤害
|
|
damageToBounce := e.Ctx().Opp.SumDamage.Div(e.Args()[1]) // 1/n
|
|
damageZone := &info.DamageZone{
|
|
Type: info.DamageType.Fixed,
|
|
Damage: damageToBounce,
|
|
}
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
|
|
if t.Type == info.DamageType.Fixed {
|
|
t.Damage = alpacadecimal.Zero
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
return true
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 138, &Effect138{})
|
|
|
|
}
|