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
|
|
}
|
|
|
|
// GetNonoInfo 获取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.GetCoins(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
|
|
}
|