package effect

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

/**
 * 对方体力小于1/2时威力加倍
 */

func init() {
	input.InitEffect(input.EffectType.Skill, 2, &Effect2{
		EffectNode: node.EffectNode{},
	})

}

type Effect2 struct {
	node.EffectNode
}

func (e *Effect2) BeforeSkill(opp *input.Input, skill *info.SkillEntity) {
	opp.Prop(e.Input, func() { //我方取敌方防御
		if opp.CurrentPet.Info.Hp < (opp.CurrentPet.Info.MaxHp / 2) {
			skill.Power *= 2

		}

	})

}
