This commit is contained in:
@@ -1,15 +1,40 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 401. n%几率攻击技能的伤害翻倍(a1: n)
|
||||
// TODO: 实现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{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user