diff --git a/logic/controller/fight_boss野怪和地图怪.go b/logic/controller/fight_boss野怪和地图怪.go index 6d9e8f594..a5c4f59b4 100644 --- a/logic/controller/fight_boss野怪和地图怪.go +++ b/logic/controller/fight_boss野怪和地图怪.go @@ -60,35 +60,7 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play int(bm.Lv), nil, 0) monster.CatchTime = uint32(i) - if bm.Hp != 0 { - monster.Hp = uint32(bm.Hp) - monster.MaxHp = uint32(bm.Hp) - } - if len(bm.Prop) == 5 { - - monster.Prop = [5]uint32(bm.Prop) - - } - - if len(bm.SKill) != 0 { - - for i := 0; i < 4; i++ { - if bm.SKill[i] != 0 { - monster.SkillList[i].ID = bm.SKill[i] - } - - } - - } - effects := service.NewEffectService().Args(bm.Effect) - - for _, v := range effects { - monster.EffectInfo = append(monster.EffectInfo, model.PetEffectInfo{ - Idx: uint16(v.SeIdx), - EID: gconv.Uint16(v.Eid), - Args: gconv.Ints(v.Args), - }) - } + monster.ConfigBoss(bm.PetBaseConfig) monsterInfo.PetList = append(monsterInfo.PetList, *monster) } diff --git a/logic/service/fight/effect/effect_439.go b/logic/service/fight/effect/effect_439.go index 5fc72ce8f..146dbb261 100644 --- a/logic/service/fight/effect/effect_439.go +++ b/logic/service/fight/effect/effect_439.go @@ -27,10 +27,19 @@ func (e *Effect439) SetArgs(t *input.Input, a ...int) { } func (e *Effect439) Action_end() bool { - - e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + var isprop bool + for _, v := range e.Ctx().Our.Prop { + if v < 0 { + isprop = true + } + } + if e.Ctx().Our.StatEffect_Exist_all() || isprop { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Fixed, Damage: e.Args()[1], }) + } + + return true } diff --git a/logic/service/fight/input.go b/logic/service/fight/input.go index cc13d790d..ced047210 100644 --- a/logic/service/fight/input.go +++ b/logic/service/fight/input.go @@ -1,12 +1,10 @@ package fight import ( - "blazing/common/data" "blazing/common/socket/errorcode" "blazing/common/utils" config "blazing/modules/config/model" "blazing/modules/player/model" - "encoding/json" "blazing/logic/service/common" "blazing/logic/service/fight/action" @@ -177,49 +175,14 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode } pet := model.GenPetInfo(int(v.MonID), 24, int(v.Nature), int(v.Effect[0]), int(v.Lv), nil, 0) - var color data.GlowFilter - err := json.Unmarshal([]byte(v.Color), &color) - if err == nil && color.Alpha != 0 { - pet.ShinyInfo = append(pet.ShinyInfo, color) - } - if len(v.Prop) == 5 { - - pet.Prop = [5]uint32(v.Prop) - - } - - if v.Hp != 0 { - pet.MaxHp = uint32(v.Hp) - - } - if len(v.SKill) != 0 { - - for i := 0; i < 4; i++ { - if v.SKill[i] != 0 { - pet.SkillList[i].ID = v.SKill[i] - } - - } - - } + pet.ConfigBoss(v) pet.CatchTime = c.GetInfo().UserID + uint32(i)*1000000 pet.Cure() in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(*pet, f.rand)) } - // for i, v := range meetpet { - // v1 := v - // if len(in.AllPet) > 2 { - // break - // } - // v1.CatchTime = c.GetInfo().UserID + uint32(i)*1000000 - // v1.Cure() - // in.AllPet = append(in.AllPet, info.CreateBattlePetEntity(v1, f.rand)) - // } - - //in.AllPet = in.AllPet[:3] default: } diff --git a/modules/player/model/pet.go b/modules/player/model/pet.go index b876d917c..6b8908ec4 100644 --- a/modules/player/model/pet.go +++ b/modules/player/model/pet.go @@ -5,7 +5,9 @@ import ( "blazing/common/data/xmlres" "blazing/common/utils" "blazing/cool" + "encoding/json" + "blazing/modules/config/model" "blazing/modules/config/service" "errors" "fmt" @@ -118,6 +120,50 @@ type PetInfo struct { ExtSkin []uint32 `struc:"skip"` //可用皮肤 } +func (pet *PetInfo) ConfigBoss(bm model.PetBaseConfig) { + var color data.GlowFilter + err := json.Unmarshal([]byte(bm.Color), &color) + if err == nil && color.Alpha != 0 { + pet.ShinyInfo = append(pet.ShinyInfo, color) + + } + if bm.Hp != 0 { + pet.Hp = uint32(bm.Hp) + pet.MaxHp = uint32(bm.Hp) + } + if len(bm.Prop) == 5 { + for i := 0; i < 5; i++ { + if bm.Prop[i] != 0 { + pet.Prop[i] = bm.Prop[i] + } + + } + + //monster.Prop = [5]uint32(bm.Prop) + + } + + if len(bm.SKill) != 0 { + + for i := 0; i < 4; i++ { + if bm.SKill[i] != 0 { + pet.SkillList[i].ID = bm.SKill[i] + } + + } + + } + effects := service.NewEffectService().Args(bm.Effect) + + for _, v := range effects { + pet.EffectInfo = append(pet.EffectInfo, PetEffectInfo{ + Idx: uint16(v.SeIdx), + EID: gconv.Uint16(v.Eid), + Args: gconv.Ints(v.Args), + }) + } +} + func (pet *PetInfo) Type() int { return xmlres.PetMAP[int(pet.ID)].Type