2025-10-20 00:23:16 +08:00
|
|
|
package controller
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/common/socket/errorcode"
|
|
|
|
|
"blazing/logic/service/nono"
|
|
|
|
|
"blazing/logic/service/player"
|
2026-03-31 08:19:53 +08:00
|
|
|
)
|
2025-10-20 00:23:16 +08:00
|
|
|
|
2026-03-31 08:19:53 +08:00
|
|
|
const (
|
|
|
|
|
nonoFuncValue = 255
|
|
|
|
|
nonoDefaultNum = 1
|
|
|
|
|
nonoDefaultPower = 0
|
|
|
|
|
nonoDefaultLevel = 12
|
|
|
|
|
nonoPetCureCost int64 = 50
|
2025-10-20 00:23:16 +08:00
|
|
|
)
|
|
|
|
|
|
2026-04-05 23:13:06 +08:00
|
|
|
// NonoFollowOrHome 处理控制器请求。
|
2026-04-05 07:24:36 +08:00
|
|
|
func (h Controller) NonoFollowOrHome(data *NonoFollowOrHomeInInfo, c *player.Player) (result *nono.NonoFollowOutInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
2025-10-20 00:23:16 +08:00
|
|
|
c.Info.NONO.Flag = data.Flag
|
|
|
|
|
result = &nono.NonoFollowOutInfo{
|
2025-11-20 05:57:29 +08:00
|
|
|
UserID: data.Head.UserID,
|
2025-11-01 18:36:21 +08:00
|
|
|
SuperStage: data.Flag,
|
2025-11-20 05:57:29 +08:00
|
|
|
Flag: data.Flag,
|
|
|
|
|
Nick: "",
|
2026-02-01 01:01:16 +08:00
|
|
|
Color: c.Info.NONO.NonoColor,
|
2026-03-31 08:19:53 +08:00
|
|
|
Power: nonoDefaultPower,
|
2025-10-20 00:23:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-24 19:03:11 +08:00
|
|
|
// GetNonoInfo 获取nono信息
|
2026-04-05 07:24:36 +08:00
|
|
|
func (h *Controller) GetNonoInfo(data *NonoInboundInfo, c *player.Player) (result *nono.NonoOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
2026-03-31 08:19:53 +08:00
|
|
|
_ = data
|
2025-10-20 00:23:16 +08:00
|
|
|
|
2026-03-31 08:19:53 +08:00
|
|
|
result = &nono.NonoOutboundInfo{
|
|
|
|
|
UserID: c.Info.UserID,
|
|
|
|
|
Nick: c.Info.NONO.Nick,
|
|
|
|
|
SuperNono: nonoDefaultNum,
|
|
|
|
|
Color: c.Info.NONO.NonoColor,
|
|
|
|
|
Num: nonoDefaultNum,
|
|
|
|
|
SuperLevel: nonoDefaultLevel,
|
|
|
|
|
SuperStage: c.Info.NONO.Flag,
|
|
|
|
|
Power: nonoDefaultPower,
|
|
|
|
|
SuperEnergy: nonoDefaultPower,
|
|
|
|
|
}
|
|
|
|
|
for i := range result.Func {
|
|
|
|
|
result.Func[i] = nonoFuncValue
|
2025-10-20 00:23:16 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-05 23:13:06 +08:00
|
|
|
// SwitchFlying 处理控制器请求。
|
2026-04-05 07:24:36 +08:00
|
|
|
func (h *Controller) SwitchFlying(data *SwitchFlyingInboundInfo, c *player.Player) (result *nono.SwitchFlyingOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
2025-10-20 00:23:16 +08:00
|
|
|
result = &nono.SwitchFlyingOutboundInfo{
|
2025-11-01 18:36:21 +08:00
|
|
|
UserId: data.Head.UserID,
|
2025-11-20 05:57:29 +08:00
|
|
|
Type: data.Type,
|
2025-10-20 00:23:16 +08:00
|
|
|
}
|
|
|
|
|
|
2025-11-20 05:57:29 +08:00
|
|
|
c.GetSpace().Broadcast(c, data.Head.CMD, result)
|
2025-10-20 00:23:16 +08:00
|
|
|
return
|
|
|
|
|
}
|
2025-10-21 23:00:00 +08:00
|
|
|
|
2026-04-05 23:13:06 +08:00
|
|
|
// PlayerPetCure 处理控制器请求。
|
2026-04-05 07:24:36 +08:00
|
|
|
func (h *Controller) PlayerPetCure(data *PetCureInboundInfo, c *player.Player) (result *nono.PetCureOutboundEmpty, err errorcode.ErrorCode) { //这个时候player应该是空的
|
2026-03-31 08:19:53 +08:00
|
|
|
_ = data
|
2026-04-09 02:14:09 +08:00
|
|
|
result = &nono.PetCureOutboundEmpty{}
|
2026-04-02 23:05:18 +08:00
|
|
|
if c.IsArenaHealLocked() {
|
2025-11-20 05:57:29 +08:00
|
|
|
return result, errorcode.ErrorCodes.ErrChampionCannotHeal
|
|
|
|
|
}
|
2026-03-31 08:19:53 +08:00
|
|
|
if !c.GetCoins(nonoPetCureCost) {
|
2025-12-16 02:50:10 +08:00
|
|
|
return result, errorcode.ErrorCodes.ErrSunDouInsufficient10016
|
2025-11-25 12:29:50 +08:00
|
|
|
}
|
2026-03-31 08:19:53 +08:00
|
|
|
for i := range c.Info.PetList {
|
2025-10-21 23:00:00 +08:00
|
|
|
c.Info.PetList[i].Cure()
|
|
|
|
|
}
|
2026-04-09 02:14:09 +08:00
|
|
|
for i := range c.Info.BackupPetList {
|
|
|
|
|
c.Info.BackupPetList[i].Cure()
|
|
|
|
|
}
|
2026-03-31 08:19:53 +08:00
|
|
|
c.Info.Coins -= nonoPetCureCost
|
2025-10-21 23:00:00 +08:00
|
|
|
return
|
|
|
|
|
}
|