修改战斗系统
This commit is contained in:
@@ -9,6 +9,38 @@ import (
|
||||
"blazing/modules/blazing/model"
|
||||
)
|
||||
|
||||
func (h Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
var petid int
|
||||
var mo *model.PetInfo
|
||||
if c.MapID() == 515 && data.BossId == 0 { //说明是新手,随机生成
|
||||
switch c.Info.PetList[0].ID {
|
||||
|
||||
case 1:
|
||||
petid = 4
|
||||
|
||||
case 7:
|
||||
petid = 1
|
||||
|
||||
case 4:
|
||||
petid = 7
|
||||
}
|
||||
|
||||
mo = model.GenPetInfo(
|
||||
int(petid), []int{0, 31},
|
||||
[]int{0, 24},
|
||||
[]int{0}, //野怪没特性
|
||||
[]int{int(0)},
|
||||
[]int{int(2)})
|
||||
}
|
||||
|
||||
if c.FightC != nil {
|
||||
return nil, errorcode.ErrorCodes.ErrOnlineOver6HoursCannotFight
|
||||
}
|
||||
ai := player.NewAI_player(model.PlayerInfo{}, *mo)
|
||||
fight.NewFight(info.BattleMode.PVE, c, ai)
|
||||
|
||||
return nil, -1
|
||||
}
|
||||
func (h Controller) OnPlayerFightNpcMonster(data *fight.FightNpcMonsterInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
|
||||
refpet := c.OgreInfo.Data[data.Number]
|
||||
|
||||
@@ -64,6 +64,10 @@ func (h *Controller) Login(data *login.InInfo, c *player.Conn) (result *login.Ou
|
||||
t.Info.MapID = 1
|
||||
|
||||
}
|
||||
if t.IsNewPlayer() {
|
||||
t.Info.MapID = 515
|
||||
}
|
||||
|
||||
t.CompleteLogin() //通知客户端登录成功
|
||||
|
||||
glog.Debug(context.Background(), "登录成功,初始地图 人数:", space.GetSpace(t.Info.MapID).Len())
|
||||
|
||||
@@ -90,8 +90,19 @@ func (h Controller) Complete_Task(data *task.CompleteTaskInboundInfo, c *player.
|
||||
// })
|
||||
}
|
||||
if data.TaskId == 86 { //新手注册任务
|
||||
var petid int
|
||||
switch data.OutState {
|
||||
|
||||
r := model.GenPetInfo(1, []int{0, 31}, []int{0, 24}, []int{0}, []int{0}, []int{5})
|
||||
case 1:
|
||||
petid = 1
|
||||
|
||||
case 2:
|
||||
petid = 7
|
||||
|
||||
case 3:
|
||||
petid = 4
|
||||
}
|
||||
r := model.GenPetInfo(petid, []int{0, 31}, []int{0, 24}, []int{0, 39}, []int{0}, []int{5})
|
||||
result.CaptureTime = r.CatchTime
|
||||
result.PetTypeId = r.ID
|
||||
c.Service.PetAdd(*r)
|
||||
|
||||
Reference in New Issue
Block a user