36 lines
675 B
Go
36 lines
675 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
"github.com/gogf/gf/v2/util/grand"
|
|
)
|
|
|
|
/**
|
|
* 1回合做m~n次攻击
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 31, &Effect31{})
|
|
|
|
}
|
|
|
|
// Effect 31: 未在 effectInfo.json 配置说明
|
|
type Effect31 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect31) Damage_Mul(t *info.DamageZone) bool {
|
|
|
|
if t.Type == info.DamageType.Red {
|
|
n := grand.Intn(e.SideEffectArgs[1]-e.SideEffectArgs[0]+1) + e.SideEffectArgs[0]
|
|
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(n)))
|
|
|
|
}
|
|
|
|
return true
|
|
}
|