diff --git a/logic/controller/active.go b/logic/controller/active.go new file mode 100644 index 000000000..4e1f04561 --- /dev/null +++ b/logic/controller/active.go @@ -0,0 +1,17 @@ +package controller + +import ( + "blazing/common/socket/errorcode" + "blazing/logic/service/pet" + "blazing/logic/service/player" + + "github.com/gogf/gf/v2/util/grand" +) + +// 传送仓抓稀有 +func (h Controller) Cacthpet(data *pet.C2S_9756, c *player.Player) (result *pet.S2C_9756, err errorcode.ErrorCode) { + result = &pet.S2C_9756{ + UseEV: uint32(grand.Intn(10)), + } + return +} diff --git a/logic/controller/fight_boss.go b/logic/controller/fight_boss.go index 24af64f9c..daab809f3 100644 --- a/logic/controller/fight_boss.go +++ b/logic/controller/fight_boss.go @@ -71,9 +71,7 @@ func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, c *pla if bc.TaskID != nil { taskid = *bc.TaskID } - if bc.BossCatchable == 1 { - cancpet = xmlres.PetMAP[int(mo.ID)].CatchRate - } + for _, bm := range bc.BossMon { mo = c.GenPetInfo( @@ -88,6 +86,9 @@ func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, c *pla moinfo.PetList = append(moinfo.PetList, *mo) } + if bc.BossCatchable == 1 { + cancpet = xmlres.PetMAP[int(mo.ID)].CatchRate + } moinfo.Nick = xmlres.PetMAP[int(mo.ID)].DefName break } diff --git a/logic/service/pet/BargeList.go b/logic/service/pet/BargeList.go index c8785acf5..cf5e44756 100644 --- a/logic/service/pet/BargeList.go +++ b/logic/service/pet/BargeList.go @@ -8,6 +8,9 @@ type PetBargeListInboundInfo struct { StartPetId uint32 `description:"开始精灵id" codec:"startPetId"` // @UInt long 对应Go的uint32(无符号64位) EndPetId uint32 `description:"结束精灵id" codec:"endPetId"` // 字段标签模拟注解功能(描述、编解码标识) } +type C2S_9756 struct { + Head common.TomeeHeader `cmd:"9756" struc:"skip"` +} // PetBargeListInfo 对应Java的PetBargeListInfo类 type PetBargeListInfo struct { @@ -29,3 +32,6 @@ type PetEV struct { type S2C_50001 struct { UseEV uint32 //用掉的学习力 } +type S2C_9756 struct { + UseEV uint32 //用掉的学习力 +}