```
feat(xml): 添加进化配置映射并更新错误码提示 - 在 `common/data/xmlres/file.go` 中添加 EVOLVMAP 用于加载进化配置 - 更新多个控制器中的金币不足错误码,统一使用骄阳余额不足错误码 `ErrSunDouInsufficient10016` - 修改战斗逻辑中 AI 动作触发机制,并优化战斗流程 - 增加对融合材料合法性的校验 - 调整战斗动作通道缓冲区大小以提升并发处理能力 - 更新 XML 配置
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
|
||||
func (h *Controller) NonoFollowOrHome(data *nono.NonoFollowOrHomeInInfo, c *player.Player) (result *nono.NonoFollowOutInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
c.Info.NONO.Flag = data.Flag
|
||||
result = &nono.NonoFollowOutInfo{
|
||||
@@ -56,7 +55,7 @@ func (h *Controller) PlayerPetCure(data *nono.PetCureInboundInfo, c *player.Play
|
||||
return result, errorcode.ErrorCodes.ErrChampionCannotHeal
|
||||
}
|
||||
if !c.UseCoins(50) {
|
||||
return result, errorcode.ErrorCodes.ErrSystemBusy
|
||||
return result, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
||||
}
|
||||
for i := 0; i < len(c.Info.PetList); i++ {
|
||||
c.Info.PetList[i].Cure()
|
||||
|
||||
1
logic/controller/pet_elo.go
Normal file
1
logic/controller/pet_elo.go
Normal file
@@ -0,0 +1 @@
|
||||
package controller
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result *pet.PetFusionInfo, err errorcode.ErrorCode) {
|
||||
if !c.UseCoins(1000) {
|
||||
return result, errorcode.ErrorCodes.ErrSystemBusy
|
||||
return result, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
||||
}
|
||||
// g.Dump(c.Info.PetList)
|
||||
|
||||
@@ -49,10 +49,14 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
|
||||
if resid == 0 {
|
||||
//todo失败降低等级
|
||||
|
||||
return &pet.PetFusionInfo{}, 0
|
||||
}
|
||||
effect := int(service.PetFusionMaterialServiceIns.Data(data.Item1))
|
||||
if effect == 0 {
|
||||
return &pet.PetFusionInfo{}, 0
|
||||
}
|
||||
|
||||
effect := int(service.PetFusionMaterialServiceIns.Data(data.Item1))
|
||||
dv1 := alpacadecimal.NewFromInt(2).Div(alpacadecimal.NewFromInt(3)).Mul(alpacadecimal.NewFromInt(int64(Mcatchpetinfo.Dv)))
|
||||
dv2 := alpacadecimal.NewFromInt(1).Div(alpacadecimal.NewFromInt(3)).Mul(alpacadecimal.NewFromInt(int64(Auxpetinfo.Dv)))
|
||||
dv := dv1.Add(dv2).Add(alpacadecimal.NewFromInt(1)).IntPart()
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func (h Controller) SetPetSkill(data *pet.ChangeSkillInfo, c *player.Player) (result *pet.ChangeSkillOutInfo, err errorcode.ErrorCode) {
|
||||
if !c.UseCoins(100) {
|
||||
return result, errorcode.ErrorCodes.ErrSystemBusy
|
||||
return result, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
||||
}
|
||||
c.Info.Coins -= 50
|
||||
_, onpet, ok := c.FindPet(data.CatchTime)
|
||||
|
||||
@@ -15,7 +15,7 @@ func (h Controller) BUY_FITMENT(data *room.C2S_BUY_FITMENT, c *player.Player) (r
|
||||
used := xmlres.ItemsMAP[int(data.ID)].Price * int(data.Count)
|
||||
|
||||
if !c.UseCoins(uint32(used)) {
|
||||
return nil, errorcode.ErrorCodes.ErrPurchaseFailed
|
||||
return nil, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
||||
|
||||
}
|
||||
c.Service.Room.Add(data.ID, data.Count)
|
||||
|
||||
@@ -38,7 +38,7 @@ func (h Controller) Chat(data *user.ChatInboundInfo, c *player.Player) (result *
|
||||
func (h Controller) ChangePlayerColor(data *user.ChangeColorInboundInfo, c *player.Player) (result *user.ChangeColorOutboundInfo, err errorcode.ErrorCode) {
|
||||
|
||||
if !c.UseCoins(200) { //如果花不了200,直接返回
|
||||
return
|
||||
return nil, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
||||
}
|
||||
c.Info.Coins -= 50
|
||||
c.Info.Color = data.Color
|
||||
@@ -55,7 +55,7 @@ func (h Controller) ChangePlayerColor(data *user.ChangeColorInboundInfo, c *play
|
||||
}
|
||||
func (h Controller) ChangePlayerDoodle(data *user.ChangeDoodleInboundInfo, c *player.Player) (result *user.ChangeDoodleOutboundInfo, err errorcode.ErrorCode) {
|
||||
if !c.UseCoins(200) { //如果花不了200,直接返回
|
||||
return
|
||||
return nil, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
||||
}
|
||||
c.Info.Coins -= 50
|
||||
c.Info.Texture = data.Id
|
||||
|
||||
Reference in New Issue
Block a user