feat(boss_fight): 完善宠物捕获和战斗奖励机制 - 在宠物捕获时记录当前地图ID作为CatchMap - 将经验值奖励改为通过道具系统发放,统一使用ItemAdd方法处理 - 调整EXP奖励的计算方式,移除原有S2C_GET_BOSS_MONSTER中的EXP字段 feat(arena): 优化竞技场对战奖励和EV分配 - 将竞技场胜利奖励的EV值
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"blazing/common/data"
|
||||
"blazing/cool"
|
||||
config "blazing/modules/config/service"
|
||||
"blazing/modules/player/model"
|
||||
"blazing/modules/player/service"
|
||||
"context"
|
||||
@@ -14,6 +16,8 @@ type PetBagController struct {
|
||||
}
|
||||
type PetGetReq struct {
|
||||
g.Meta `path:"/genpet" method:"POST"`
|
||||
UserID uint32 `json:"user_id"`
|
||||
IsVIP int `json:"is_vip"`
|
||||
// 新增:精灵相关参数(完全对齐自定义表单配置)
|
||||
PetTypeId int `json:"petTypeId" v:"required|min:1" comment:"精灵类型ID,必填,正整数(最小1,无0或负数类型),对应GenPetInfo的id参数"`
|
||||
IndividualValue int `json:"individualValue" v:"required|between:-1,31" comment:"精灵个体值,必填,范围-1~31(-1表示随机生成满个体,0~31为固定值,决定基础属性上限)"`
|
||||
@@ -35,16 +39,17 @@ func init() {
|
||||
cool.RegisterController(task_info_controller)
|
||||
}
|
||||
func (c *PetBagController) GetSession(ctx context.Context, req *PetGetReq) (res *cool.BaseRes, err error) {
|
||||
var shiny []data.GlowFilter
|
||||
if req.IsShiny != 0 {
|
||||
r := config.NewShinyService().GetShiny(req.IsShiny)
|
||||
shiny = append(shiny, *r)
|
||||
}
|
||||
|
||||
var (
|
||||
admin = cool.GetAdmin(ctx)
|
||||
//r = g.RequestFromCtx(ctx)
|
||||
)
|
||||
t := model.GenPetInfo(
|
||||
req.PetTypeId, req.IndividualValue, req.NatureId, req.AbilityTypeEnum, req.Level, nil, -1)
|
||||
t.FixShiny()
|
||||
req.PetTypeId, req.IndividualValue, req.NatureId, req.AbilityTypeEnum, req.Level, shiny, -1)
|
||||
t.CatchRect = 1 //代表这是人工合成的
|
||||
|
||||
service.NewUserService(uint32(admin.UserId)).Pet.PetAdd(t)
|
||||
service.NewUserService(uint32(req.UserID)).Pet.PetAdd(t)
|
||||
return
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user