35 lines
675 B
Go
35 lines
675 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/gogf/gf/v2/util/grand"
|
|
)
|
|
|
|
// Effect 139: 50%威力301-350、30%威力101-300,20%威力5-100
|
|
type Effect139 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect139) SkillHit() bool {
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
|
|
randVal := grand.Intn(100)
|
|
switch {
|
|
case randVal < 50:
|
|
e.Ctx().SkillEntity.XML.Power = grand.N(301, 350)
|
|
case randVal < 80:
|
|
e.Ctx().SkillEntity.XML.Power = grand.N(101, 300)
|
|
default:
|
|
e.Ctx().SkillEntity.XML.Power = grand.N(5, 100)
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 139, &Effect139{})
|
|
}
|