Files
bl/logic/service/fight/effect/effect_45.go

53 lines
1.1 KiB
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* n回合防御力和对手相同
*/
type Effect45 struct {
node.EffectNode
oldtype uint32
}
func (e *Effect45) OnSkill() bool {
if !e.Hit() {
return true
}
return true
}
func (e *Effect45) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
if !e.Hit() {
return
}
e.oldtype = e.Ctx().Opp.CurrentPet.Info.Prop[1]
e.Ctx().Our.CurrentPet.Info.Prop[1] = e.Ctx().Opp.CurrentPet.Info.Prop[1]
}
func init() {
ret := &Effect45{}
input.InitEffect(input.EffectType.Skill, 45, ret)
}
func (e *Effect45) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
2025-11-17 19:31:51 +00:00
func (e *Effect45) Alive(t ...bool) bool {
2025-11-17 19:31:51 +00:00
if e.BoolisFalse(t...) && e.Hit() { //说明到了回合结束取消节点,那么就将变化过的属性变化回来
2025-11-17 19:31:51 +00:00
//还原属性
e.Ctx().Our.CurrentPet.Info.Prop[1] = e.oldtype
}
2025-11-16 20:30:17 +00:00
return e.EffectNode.Alive(t...)
}