fix: 添加宠物进化等级检查并修复降级逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -11,10 +11,6 @@ import (
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
// PetEVDiy 自定义分配宠物努力值(EV)
|
||||
// data: 包含宠物捕获时间和EV分配数据的输入信息
|
||||
// c: 当前玩家对象
|
||||
// 返回: 分配结果和错误码
|
||||
func (h Controller) PetELV(data *pet.C2S_PET_EVOLVTION, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
_, currentPet, found := c.FindPet(data.CacthTime)
|
||||
if !found {
|
||||
@@ -26,6 +22,9 @@ func (h Controller) PetELV(data *pet.C2S_PET_EVOLVTION, c *player.Player) (resul
|
||||
if flag == 0 {
|
||||
return nil, errorcode.ErrorCodes.ErrPokemonNotEvolveReady
|
||||
}
|
||||
if xmlres.PetMAP[int(currentPet.ID)].EvolvingLv > int(currentPet.Level) {
|
||||
return nil, errorcode.ErrorCodes.ErrPokemonNotEvolveReady
|
||||
}
|
||||
evinfo := xmlres.EVOLVMAP[flag].Branches[data.Index-1]
|
||||
|
||||
if c.Service.Item.CheakItem(uint32(evinfo.EvolvItem)) < int64(evinfo.EvolvItemCount) {
|
||||
|
||||
Reference in New Issue
Block a user