43 lines
675 B
Go
43 lines
675 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%几率伤害为m倍
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 88, &Effect88{
|
|
EffectNode: node.EffectNode{},
|
|
})
|
|
|
|
}
|
|
|
|
type Effect88 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect88) Damage_Mul(t *info.DamageZone) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
// 概率判定
|
|
ok, _, _ := e.Input.Player.Roll(e.Args()[0], 100)
|
|
if !ok {
|
|
return true
|
|
}
|
|
if t.Type == info.DamageType.Red {
|
|
|
|
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
|
|
|
}
|
|
|
|
return true
|
|
}
|