61 lines
1.3 KiB
Go
61 lines
1.3 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
)
|
||
|
||
// 基类特性
|
||
// 特性的ID=PET cacthtime+eid 这样保证不重复
|
||
type NewSel0 struct {
|
||
node.EffectNode
|
||
//Catchtime int //保存精灵的唯一指令,保证在上场时候正确注入
|
||
//Hide bool //是否隐藏 ,所属精灵下场后特性就应该消失
|
||
//??如果2只精灵一个特性,怎么办,每次切精灵注入特性
|
||
}
|
||
|
||
// 重写回合结束效果,特性都是无线回合类的
|
||
// 次数类本质上也是这种
|
||
// 特性,无法被切精灵消除
|
||
func (e *NewSel0) SwitchOut(in *input.Input) bool {
|
||
return true
|
||
}
|
||
func (e *NewSel0) IsOwner() bool {
|
||
if e.Ctx().Our == nil {
|
||
return false
|
||
}
|
||
if e.Ctx().Our.CurrentPet[0] == nil {
|
||
return false
|
||
}
|
||
return e.ID().GetCatchTime() == e.Ctx().Our.CurrentPet[0].Info.CatchTime
|
||
}
|
||
|
||
// 免疫"能力(battle_lv)下降"
|
||
type NewSel1 struct {
|
||
NewSel0
|
||
}
|
||
|
||
func (e *NewSel1) PropBefer(in *input.Input, prop int8, level int8) bool {
|
||
|
||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||
if !e.IsOwner() {
|
||
return true
|
||
}
|
||
if in == e.Ctx().Our {
|
||
return true
|
||
}
|
||
|
||
//能力下降类
|
||
if level < 0 {
|
||
|
||
return false
|
||
|
||
}
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.NewSel, 1, &NewSel1{})
|
||
|
||
}
|