diff --git a/logic/service/fight/effect/base.go b/logic/service/fight/effect/base.go index a9b653aa..49491029 100644 --- a/logic/service/fight/effect/base.go +++ b/logic/service/fight/effect/base.go @@ -18,7 +18,7 @@ func (this *Effect0) IsHit(opp *input.Input, skill *info.SkillEntity) { } // 比如xx技能无效 -func (this *Effect0) UseSkill(opp *input.Input, skill *info.SkillEntity) bool { +func (this *Effect0) UseSkill(opp *input.Input) bool { return true } diff --git a/logic/service/fight/input/nodemanger.go b/logic/service/fight/input/nodemanger.go index 10d2276b..a100cfaa 100644 --- a/logic/service/fight/input/nodemanger.go +++ b/logic/service/fight/input/nodemanger.go @@ -70,6 +70,7 @@ type Effect interface { Alive() bool Stack(int) int MaxStack() int + NotALive() GetOwner() bool // 技能属主,比如寄生和镇魂歌,属主是对方) //GetSkill() *BattleSkillEntity //获得技能ctx } @@ -144,7 +145,6 @@ func (c *Input) Exec(fn func(Effect) bool) bool { return result //如果是false,说明存在阻止向下执行的effect,比如免疫能力提升效果 } - } } @@ -158,62 +158,9 @@ func (c *Input) CancelTurn(efftype bool) { //var remain []Effect for _, eff := range c.Effects { if eff.Duration(0) > 0 { //false是自身,true是对方,反转后为真就是自己的 - effect.NotAlive() + eff.NotALive() } } //c.Effects = remain } - -// // 添加效果 -// func (c **NodeManager) AddEffect(e Effect) { -// var fff *NodeManager -// switch t := (e.Duration(0) > 1); t { //判断是否是回合类效果 -// case t: //t>0就是回合类效果了 -1和0都是非回合效果和无限效果,无法被断回合 -// fff = c.Turn -// default: -// fff = c.Mark -// } - -// fff.AddEffect(e) -// } - -// // 删除 -// func (c **NodeManager) RemoveEffect(e Effect) { - -// var fff *NodeManager -// switch t := (e.Duration(0) > 1); t { //判断是否是回合类效果 -// case t: //t>0就是回合类效果了 -1和0都是非回合效果和无限效果,无法被断回合 -// fff = c.Turn -// default: -// fff = c.Mark -// } -// fff.RemoveEffect(e) -// } - -// // ForEachEffectBool 遍历所有 Effect,执行“无参数、返回 bool”的方法 -// // 参数 fn:接收单个 Effect,返回 bool(如 func(e Effect) bool { return e.OnBattleStart() }) -// // 返回值:所有 Effect 的方法返回值列表 -// func (c *NodeManagerE) Exec(fn func(Effect) bool) bool { - -// // var results bool - -// // execfun := func(nm *NodeManager) { -// // for _, effect := range nm.Effects { -// // result := fn(effect) -// // if !result { -// // results = result //如果是false,说明存在阻止向下执行的effect,比如免疫能力提升效果 -// // } -// // } -// // } -// results := true -// result := c.Mark.Exec(fn) //执行叠层 -// if !result { -// results = result -// } -// result = c.Turn.Exec(fn) //执行回合类效果 -// if !result { -// results = result -// } -// return results -// } diff --git a/logic/service/fight/node/node.go b/logic/service/fight/node/node.go index c4accaab..7a46551f 100644 --- a/logic/service/fight/node/node.go +++ b/logic/service/fight/node/node.go @@ -35,6 +35,11 @@ func (this *EffectNode) ID() int { return 0 +} +func (this *EffectNode) NotALive() { + + this.NotAlive = true + } func (this *EffectNode) GetOwner() bool { diff --git a/modules/blazing/model/pet.go b/modules/blazing/model/pet.go index 2b6e1c23..50cb95d4 100644 --- a/modules/blazing/model/pet.go +++ b/modules/blazing/model/pet.go @@ -87,9 +87,13 @@ func GenPetInfo(id int, dv, natureId, abilityTypeEnum, shinyid, level []int) *Pe CatchTime: uint32(time.Now().Unix()), Level: uint32(RandomInRange(level))} //等级 - p.EffectInfo = append(p.EffectInfo, PetEffectInfo{ItemID: uint32(RandomInRange(abilityTypeEnum))}) + p.EffectInfo = append(p.EffectInfo, PetEffectInfo{ + EID: 28, + }) naxml := xmlres.NatureRootMap[int(p.Nature)] petxml := xmlres.PetMAP[int(id)] + p.EffectInfo[0].Args1 = byte(petxml.Type) //默认本族加成 + p.EffectInfo[0].Args2 = 5 //默认等级1 tttt := make([]uint32, 0) for _, v := range petxml.LearnableMoves.Moves { if p.Level >= uint32(v.LearningLv) { @@ -274,10 +278,10 @@ type PetEffectInfo struct { ItemID uint32 `struc:"uint32" json:"item_id"` Status byte `struc:"byte" json:"status"` LeftCount byte `struc:"byte" json:"left_count"` - EffectID uint16 `struc:"uint16" json:"effect_id"` - Reserve1 byte `struc:"byte" json:"reserve1"` + EID uint16 `struc:"uint16" json:"effect_id"` + Args1 byte `struc:"byte" json:"reserve1"` Reserve2 byte `struc:"byte" json:"reserve2"` - Reserve3 byte `struc:"byte" json:"reserve3"` + Args2 byte `struc:"byte" json:"reserve3"` Reserve4 [13]byte `struc:"[13]byte" json:"reserve4"` }