上传战斗代码
This commit is contained in:
parent
2ebaa538ae
commit
ff5334445b
@ -703,6 +703,7 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, tid, pos int) (ro
|
||||
role.SubSuitSkill = suit.Skill
|
||||
}
|
||||
}
|
||||
role.Currhp = role.Property[comm.Hp]
|
||||
return
|
||||
}
|
||||
|
||||
@ -778,6 +779,7 @@ func (this *modelBattleComp) createMasterRoles(comp, wheel int, fid int32) (capt
|
||||
roles[i].Property[comm.Atk] = int32(float32(roles[i].Property[comm.Atk]) * v.Atkpro)
|
||||
roles[i].Property[comm.Def] = int32(float32(roles[i].Property[comm.Def]) * v.Defpro)
|
||||
roles[i].Property[comm.Speed] = monst.Speed
|
||||
roles[i].Currhp = roles[i].Property[comm.Hp]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,6 @@ func (this *apiComp) GymInfo(session comm.IUserSession, req *pb.PracticeGymInfoR
|
||||
"gymrefresh": room.Gymrefresh,
|
||||
})
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "gymInfo", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
|
||||
session.SendMsg(string(this.module.GetType()), "gyminfo", &pb.PracticeGymInfoResp{Lastaction: room.Gymaction, Refreshnum: room.Gymrefresh})
|
||||
return
|
||||
}
|
||||
|
@ -59,7 +59,12 @@ func (this *apiComp) NPCBattkleFinish(session comm.IUserSession, req *pb.Practic
|
||||
"refresh": room.Refresh,
|
||||
})
|
||||
} else {
|
||||
room.Formation = req.Report.Alive
|
||||
room.Formation = make([]*pb.BattleRole, 5)
|
||||
for _, v := range req.Report.Alive {
|
||||
if v.Tid/200 == 1 {
|
||||
room.Formation[v.Pos] = v
|
||||
}
|
||||
}
|
||||
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
"npcstate": room.Npcstate,
|
||||
"battlenum": room.Battlenum,
|
||||
|
Loading…
Reference in New Issue
Block a user