feat(xml): 添加进化配置映射并更新错误码提示 - 在 `common/data/xmlres/file.go` 中添加 EVOLVMAP 用于加载进化配置 - 更新多个控制器中的金币不足错误码,统一使用骄阳余额不足错误码 `ErrSunDouInsufficient10016` - 修改战斗逻辑中 AI 动作触发机制,并优化战斗流程 - 增加对融合材料合法性的校验 - 调整战斗动作通道缓冲区大小以提升并发处理能力 - 更新 XML 配置
67 lines
1.8 KiB
Go
67 lines
1.8 KiB
Go
package controller
|
|
|
|
import (
|
|
"blazing/common/socket/errorcode"
|
|
"blazing/logic/service/nono"
|
|
"blazing/logic/service/player"
|
|
|
|
"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{
|
|
|
|
UserID: data.Head.UserID,
|
|
SuperStage: data.Flag,
|
|
Flag: data.Flag,
|
|
Nick: "",
|
|
Color: 0,
|
|
Power: 0,
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
// 获取nono信息
|
|
func (h *Controller) GetNonoInfo(data *nono.NonoInboundInfo, c *player.Player) (result *nono.NonoOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
|
|
|
result = &nono.NonoOutboundInfo{}
|
|
copier.Copy(result, &c.Info.NONO)
|
|
result.UserID = c.Info.UserID
|
|
|
|
for i := 0; i < 20; i++ {
|
|
result.Func[i] = 255
|
|
}
|
|
result.Num = 1
|
|
result.SuperNono = 1
|
|
result.SuperLevel = 12
|
|
return
|
|
}
|
|
|
|
func (h *Controller) SwitchFlying(data *nono.SwitchFlyingInboundInfo, c *player.Player) (result *nono.SwitchFlyingOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
|
|
|
result = &nono.SwitchFlyingOutboundInfo{
|
|
UserId: data.Head.UserID,
|
|
Type: data.Type,
|
|
}
|
|
|
|
c.GetSpace().Broadcast(c, data.Head.CMD, result)
|
|
return
|
|
}
|
|
|
|
func (h *Controller) PlayerPetCure(data *nono.PetCureInboundInfo, c *player.Player) (result *nono.PetCureOutboundEmpty, err errorcode.ErrorCode) { //这个时候player应该是空的
|
|
if c.GetSpace().Owner.UserID == c.Info.UserID {
|
|
return result, errorcode.ErrorCodes.ErrChampionCannotHeal
|
|
}
|
|
if !c.UseCoins(50) {
|
|
return result, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
|
}
|
|
for i := 0; i < len(c.Info.PetList); i++ {
|
|
c.Info.PetList[i].Cure()
|
|
|
|
}
|
|
c.Info.Coins -= 50
|
|
return
|
|
}
|