feat(service): 宠物添加功能增加销售计数参数并优化价格更新逻辑 - 修改PetAdd方法签名,增加salecount参数用于追踪宠物销售次数 - 在多个控制器中统一调用PetAdd方法时传入0作为初始销售次数 - 临时禁用寒流枪活动中的宠物发放功能 - 优化UPdatePrice方法,添加错误处理和价格范围验证逻辑 - 调整宠物购买逻辑,使用免费金币系统并计算递增购买
This commit is contained in:
@@ -68,7 +68,7 @@ func (h Controller) DASHIbeiR(data *C2s_MASTER_REWARDSR, c *player.Player) (resu
|
||||
|
||||
if taskInfo.Pet != nil {
|
||||
|
||||
c.Service.Pet.PetAdd(taskInfo.Pet)
|
||||
c.Service.Pet.PetAdd(taskInfo.Pet, 0)
|
||||
result.CaptureTime = taskInfo.Pet.CatchTime
|
||||
result.PetTypeId = taskInfo.Pet.ID
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func (h Controller) EggGamePlay(data1 *C2S_EGG_GAME_PLAY, c *player.Player) (res
|
||||
newPet.RandomByWeightShiny()
|
||||
}
|
||||
|
||||
c.Service.Pet.PetAdd(newPet)
|
||||
c.Service.Pet.PetAdd(newPet, 0)
|
||||
|
||||
result.HadTime = newPet.CatchTime
|
||||
result.PetID = newPet.ID
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"blazing/logic/service/common"
|
||||
"blazing/logic/service/fight"
|
||||
"blazing/logic/service/player"
|
||||
"blazing/modules/player/model"
|
||||
)
|
||||
|
||||
// CatchPet 传送仓抓稀有宠物
|
||||
@@ -24,15 +23,15 @@ func (h Controller) HanLiuQiang(data *C2S_2608, c *player.Player) (result *fight
|
||||
}
|
||||
c.ItemAdd(500655, 1)
|
||||
|
||||
pet := model.GenPetInfo(426, 31, -1, -1, 100, nil, 0)
|
||||
// pet := model.GenPetInfo(426, 31, -1, -1, 100, nil, 0)
|
||||
|
||||
c.Service.Pet.PetAdd(pet)
|
||||
pet = model.GenPetInfo(1567, 31, -1, -1, 100, nil, 0)
|
||||
// c.Service.Pet.PetAdd(pet, 0)
|
||||
// pet = model.GenPetInfo(1567, 31, -1, -1, 100, nil, 0)
|
||||
|
||||
c.Service.Pet.PetAdd(pet)
|
||||
pet = model.GenPetInfo(1905, 31, -1, -1, 100, nil, 0)
|
||||
// c.Service.Pet.PetAdd(pet)
|
||||
// pet = model.GenPetInfo(1905, 31, -1, -1, 100, nil, 0)
|
||||
|
||||
c.Service.Pet.PetAdd(pet)
|
||||
// c.Service.Pet.PetAdd(pet)
|
||||
return result, -1
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
r.RandomByWeightShiny()
|
||||
|
||||
}
|
||||
c.Service.Pet.PetAdd(r)
|
||||
c.Service.Pet.PetAdd(r, 0)
|
||||
println(c.Info.UserID, "进行融合", len(c.Info.PetList), Mcatchpetinfo.ID, Auxpetinfo.ID, r.ID)
|
||||
|
||||
c.PetDel(data.Mcatchtime)
|
||||
|
||||
@@ -86,7 +86,7 @@ func (h Controller) Collect(
|
||||
r.Set(uint(data.Type))
|
||||
te.Data = r.Bytes()
|
||||
r := model.GenPetInfo(int(data.ID), -1, -1, 0, 1, nil, 0)
|
||||
c.Service.Pet.PetAdd(r)
|
||||
c.Service.Pet.PetAdd(r, 0)
|
||||
result.CatchTime = r.CatchTime
|
||||
|
||||
return true
|
||||
|
||||
@@ -185,7 +185,7 @@ func (ctl Controller) GetHatchPet(
|
||||
if r == nil {
|
||||
return nil, errorcode.ErrorCodes.ErrSystemError
|
||||
}
|
||||
playerObj.Service.Pet.PetAdd(r)
|
||||
playerObj.Service.Pet.PetAdd(r, 0)
|
||||
|
||||
result.PetID = r.ID
|
||||
result.CatchTime = r.CatchTime
|
||||
|
||||
@@ -35,7 +35,7 @@ func (h Controller) CDK(data *user.C2S_GET_GIFT_COMPLETE, player *player.Player)
|
||||
pet := service.NewPetRewardService().Get(v)
|
||||
if pet != nil {
|
||||
peti := model.GenPetInfo(int(pet.MonID), int(pet.DV), int(pet.Nature), int(pet.Effect), int(pet.Lv), nil, 0)
|
||||
player.Service.Pet.PetAdd(peti)
|
||||
player.Service.Pet.PetAdd(peti, 0)
|
||||
result.PetGift = append(result.PetGift, user.PetGiftInfo{PetID: peti.ID, CacthTime: peti.CatchTime})
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ func (h Controller) CompleteTask(data1 *task.CompleteTaskInboundInfo, c *player.
|
||||
|
||||
if taskInfo.Pet != nil {
|
||||
|
||||
c.Service.Pet.PetAdd(taskInfo.Pet)
|
||||
c.Service.Pet.PetAdd(taskInfo.Pet, 0)
|
||||
result.CaptureTime = taskInfo.Pet.CatchTime
|
||||
result.PetTypeId = taskInfo.Pet.ID
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ func (f *FightC) battleLoop() {
|
||||
f.WinnerId = f.ownerID
|
||||
|
||||
addpet.EffectInfo = nil //清空特性信息
|
||||
f.Our.Player.(*player.Player).Service.Pet.PetAdd(&addpet)
|
||||
f.Our.Player.(*player.Player).Service.Pet.PetAdd(&addpet, 0)
|
||||
|
||||
f.Our.Player.SendPackCmd(2409, &info.CatchMonsterOutboundInfo{
|
||||
CatchTime: uint32(addpet.CatchTime),
|
||||
|
||||
@@ -47,7 +47,7 @@ func (p *Player) TawerCompletedTask(taskID int, ot int) {
|
||||
return
|
||||
}
|
||||
// 处理默认分支(ot=-1):仅奖励存在时才完成主任务
|
||||
if p.Info.GetTask(taskID) != model.Completed {
|
||||
if p.Info.GetTask(taskID) != model.Completed {
|
||||
defaultGift := p.getTaskGift(taskID, -1)
|
||||
if defaultGift != nil { // 奖励存在才标记主任务完成
|
||||
p.Info.SetTask(taskID, model.Completed)
|
||||
@@ -94,7 +94,7 @@ func (p *Player) bossgive(taskID int, ot int) {
|
||||
|
||||
// 发放宠物奖励
|
||||
if gift.Pet != nil {
|
||||
p.Service.Pet.PetAdd(gift.Pet)
|
||||
p.Service.Pet.PetAdd(gift.Pet, 0)
|
||||
res.PetID = gift.Pet.ID
|
||||
res.CaptureTm = gift.Pet.CatchTime
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user