41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
|
|
"github.com/gogf/gf/v2/util/grand"
|
|
)
|
|
|
|
// Effect 163: {0}回合内若对手使用属性技能则对手随机进入烧伤、冻伤、中毒、麻痹、害怕、睡眠中的一种异常状态
|
|
type Effect163 struct {
|
|
RoundEffectArg0Base
|
|
}
|
|
|
|
func (e *Effect163) Skill_Use_ex() bool {
|
|
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
// 随机选择一个异常状态
|
|
statusTypes := []int{
|
|
int(info.PetStatus.Burned),
|
|
int(info.PetStatus.Frozen),
|
|
int(info.PetStatus.Poisoned),
|
|
int(info.PetStatus.Paralysis),
|
|
int(info.PetStatus.Fear),
|
|
int(info.PetStatus.Sleep),
|
|
}
|
|
|
|
randomIndex := grand.Intn(len(statusTypes))
|
|
selectedStatus := statusTypes[randomIndex]
|
|
|
|
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, selectedStatus)
|
|
if statusEffect != nil {
|
|
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 163, &Effect163{})
|
|
}
|