diff --git a/logic/service/fight/action.go b/logic/service/fight/action.go index cdede44d..3bf301e3 100644 --- a/logic/service/fight/action.go +++ b/logic/service/fight/action.go @@ -68,23 +68,7 @@ func (f *FightC) ChangePet(c common.PlayerI, id uint32) { selfinput.CurrentPet, ret.Reason = selfinput.GetPet(id) c.SendPackCmd(2407, &ret.Reason) - InitAttackValue := *selfinput.AttackValue - oldpet := selfinput.CurrentPet - f.Switch[c.GetInfo().UserID] = ret - - selfinput.InitAttackValue() //切换精灵消除能力提升 - //这时候精灵已经切换过了,可以直接给新精灵加效果 - - f.Broadcast(func(ff *input.Input) { - - ff.Exec(func(t input.Effect) bool { - - t.Switch(selfinput, InitAttackValue, oldpet) - - return true - }) - }) - + f.actionChan <- ret } diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 57b68de4..9abc50ba 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -332,7 +332,7 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) { } } - attacker.CanChange = true + //attacker.CanChange = true break } @@ -342,7 +342,7 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) { attacker.CurrentPet.Info.Hp = 1 } - defender.CanChange = true //被打死就可以切精灵了 + //defender.CanChange = true //被打死就可以切精灵了 // AI自动技能 if f.IsWin(attacker, defender.CurrentPet.Info.CatchTime) { //然后检查是否战斗结束 @@ -403,5 +403,6 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) { } f.Broadcast(func(ff *input.Input) { ff.Player.SendPackCmd(2505, &ret) + ff.CanChange = true }) } diff --git a/logic/service/fight/loop.go b/logic/service/fight/loop.go index b346f95f..3affd0e1 100644 --- a/logic/service/fight/loop.go +++ b/logic/service/fight/loop.go @@ -139,17 +139,30 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat // fmt.Printf("玩家%d 已经提交过动作,忽略重复\n", pid) // continue // } - if f.GetInputByAction(paction, false).CanChange { - // 被动切换处理(不计入本回合) - if _, ok := paction.(*action.ActiveSwitchAction); ok { - continue - } else { - f.GetInputByAction(paction, false).CanChange = false + if ret, ok := paction.(*action.ActiveSwitchAction); ok { + selfinput := f.GetInputByAction(paction, false) + if selfinput.CanChange || selfinput.CurrentPet.Info.Hp <= 0 { + selfinput.CanChange = false + InitAttackValue := *selfinput.AttackValue + oldpet := selfinput.CurrentPet + f.Switch[selfinput.UserID] = ret + + selfinput.InitAttackValue() //切换精灵消除能力提升 + //这时候精灵已经切换过了,可以直接给新精灵加效果 + + f.Broadcast(func(ff *input.Input) { + + ff.Exec(func(t input.Effect) bool { + + t.Switch(selfinput, InitAttackValue, oldpet) + + return true + }) + }) } } - // AI自动技能 if pid != 0 && (f.Info.Status == info.BattleMode.FIGHT_WITH_NPC) { f.GetInputByAction(paction, true).GetAction(f.Our) diff --git a/modules/blazing/model/pet.go b/modules/blazing/model/pet.go index 88e20a08..08590ef3 100644 --- a/modules/blazing/model/pet.go +++ b/modules/blazing/model/pet.go @@ -108,8 +108,12 @@ type PetInfo struct { SkinID uint32 `fieldDesc:"皮肤id默认为0" ` // 是否闪光(@UInt long → uint32,0=否,1=是) - Shiny uint32 `fieldDesc:"是不是闪" ` - // AbilityType uint32 `struc:"skip"` //特性 + ShinyLen uint32 `struc:"sizeof=Shiny"` + Shiny []GlowFilter + + //时间轮转,然后effect根据type同时只共存一个,特性是1 特质是1,柱子是两种,魂印是一个,然后异色字段,然后特训技能字段 + ExtSKill []uint32 `struc:"skip"` //特训技能 + } // 定义常量,提升可维护性(避免魔法数字) @@ -237,6 +241,7 @@ func (pet *PetInfo) RnadAN() { } } +// 1是特性特质, func (pet *PetInfo) GetEffect(ptype int) (int, *PetEffectInfo, bool) { return utils.FindWithIndex(pet.EffectInfo, func(item PetEffectInfo) bool { @@ -411,7 +416,8 @@ func GenPetInfo( // ---- 处理闪光 ---- if shinyid != -1 { - p.Shiny = uint32(shinyid) + //todo 待实现异色字段 + // p.Shiny = uint32(shinyid) } // ---- 性格 ---- @@ -565,14 +571,6 @@ type GlowFilter struct { Inner bool `json:"inner,omitempty"` // Knockout 是否挖空,默认 false - Knockout bool `json:"knockout,omitempty"` -} -type ColorMatrixFilter struct { - // Matrix 4×5 颜色变换矩阵,固定长度20的int8数组(不可变长度,避免越界) - // 矩阵格式(行优先): - // [ Rr, Rg, Rb, Ra, Ro, // 输出R = Rr*输入R + Rg*输入G + Rb*输入B + Ra*输入A + Ro - // Gr, Gg, Gb, Ga, Go, // 输出G = Gr*输入R + Gg*输入G + Gb*输入B + Ga*输入A + Go - // Br, Bg, Bb, Ba, Bo, // 输出B = Br*输入R + Bg*输入G + Bb*输入B + Ba*输入A + Bo - // Ar, Ag, Ab, Aa, Ao ] // 输出A = Ar*输入R + Ag*输入G + Ab*输入B + Aa*输入A + Ao - Matrix [20]uint8 `json:"matrix,omitempty"` + Knockout bool `json:"knockout,omitempty"` + ColorMatrixFilter [20]uint8 `json:"matrix,omitempty"` } diff --git a/public/config/bossbuff和特性.xml b/public/config/bossbuff和特性.xml index dc22fc31..8fe9b8da 100644 --- a/public/config/bossbuff和特性.xml +++ b/public/config/bossbuff和特性.xml @@ -307,7 +307,7 @@ - +