package effect

import (
	"blazing/logic/service/fight/info"
	"blazing/logic/service/fight/input"
	"blazing/logic/service/fight/node"
)

type Effect10 struct {
	node.EffectNode
	Status info.EnumBattleStatus
}

func init() {
	//n%令对方麻痹
	input.InitEffect(input.EffectType.Skill, 10, &Effect10{
		Status: info.BattleStatus.Paralysis,
	})

	// n%令对方中毒
	input.InitEffect(input.EffectType.Skill, 11, &Effect10{
		Status: info.BattleStatus.Poisoned,
	})
	//n%令对方烧伤
	input.InitEffect(input.EffectType.Skill, 12, &Effect10{
		Status: info.BattleStatus.Burned,
	})
	//n回合吸取对方最大体力的1/8(草系无效)

	//n%令对方冻伤
	input.InitEffect(input.EffectType.Skill, 12, &Effect10{
		Status: info.BattleStatus.Frozen,
	})
	//n%令对方害怕
	input.InitEffect(input.EffectType.Skill, 12, &Effect10{
		Status: info.BattleStatus.Fear,
	})
	//n%令对手睡眠
	input.InitEffect(input.EffectType.Skill, 12, &Effect10{
		Status: info.BattleStatus.Sleep,
	})

}
func (e *Effect10) OnHit(opp *input.Input, skill *info.SkillEntity) {
	if e.Hit() {
		t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[0], 100)
		if t {

			t1 := e.Input.FightC.GetRand().Int31n(3)

			eff := input.Geteffect(input.EffectType.Status, int(e.Status))
			eff.Effect.Duration(int(t1 + 1))
			e.Input.AddEffect(eff)

		}
	}

}
