Files
bl/logic/service/fight/effect/effect_56.go
2025-11-21 03:07:17 +00:00

44 lines
981 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* n 回合内与对方战斗时属性相同
*/
type Effect56 struct {
node.EffectNode
oldtype int
}
func (e *Effect56) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
e.oldtype = e.Ctx().Our.CurrentPet.PetInfo.Type
e.Ctx().Our.CurrentPet.PetInfo.Type = e.Ctx().Opp.CurrentPet.PetInfo.Type
}
func init() {
ret := &Effect56{}
input.InitEffect(input.EffectType.Skill, 56, ret)
}
func (e *Effect56) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
func (e *Effect56) Alive(t ...bool) bool {
if e.BoolisFalse(t...) && e.Hit() { //说明到了回合结束取消节点,那么就将变化过的属性变化回来
//还原属性
e.Ctx().Our.CurrentPet.PetInfo.Type = e.oldtype
}
return e.EffectNode.Alive(t...)
}