Files
bl/logic/service/fight/boss/NewSeIdx_401.go

41 lines
757 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// 401. n%几率攻击技能的伤害翻倍a1: n
type NewSel401 struct {
NewSel0
}
func (e *NewSel401) DamageAdd(t *info.DamageZone) bool {
if !e.IsOwner() {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if t.Type != info.DamageType.Red {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !success {
return true
}
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(2))
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 401, &NewSel401{})
}