Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
601e45a4bc
@ -524,6 +524,10 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
|
|||||||
}
|
}
|
||||||
change.Arenacoin += add
|
change.Arenacoin += add
|
||||||
case comm.ResPs:
|
case comm.ResPs:
|
||||||
|
ggd := this.ModuleTools.GetGlobalConf()
|
||||||
|
if ggd == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if add < 0 {
|
if add < 0 {
|
||||||
if user.Ps+add < 0 {
|
if user.Ps+add < 0 {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -532,11 +536,11 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
//体力消耗,增加玩家经验
|
||||||
|
// exp := int32(math.Abs(float64(add))) * ggd.FightPs
|
||||||
|
// user.Exp += int64(exp)
|
||||||
}
|
}
|
||||||
ggd := this.ModuleTools.GetGlobalConf()
|
|
||||||
if ggd == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if change.Ps+add > ggd.PsUl {
|
if change.Ps+add > ggd.PsUl {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_UserVitLimit,
|
Code: pb.ErrorCode_UserVitLimit,
|
||||||
|
@ -101,26 +101,25 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tasks = &pb.Worldtasks{
|
||||||
|
TaskMap: make(map[int32]*pb.Worldtask),
|
||||||
|
}
|
||||||
|
task := &pb.Worldtask{
|
||||||
|
TaskId: req.TaskId,
|
||||||
|
TaskType: curTaskConf.Des,
|
||||||
|
NpcStatus: 1, //接取
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, cid := range curTaskConf.Completetask {
|
||||||
|
task.Conds = append(task.Conds, &pb.ConIProgress{
|
||||||
|
Conid: cid,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.TaskMap[req.TaskId] = task
|
||||||
|
myWorldtask.CurrentTasks[curTaskConf.Group] = tasks
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// tasks = &pb.Worldtasks{
|
|
||||||
// TaskMap: make(map[int32]*pb.Worldtask),
|
|
||||||
// }
|
|
||||||
// task := &pb.Worldtask{
|
|
||||||
// TaskId: req.TaskId,
|
|
||||||
// TaskType: curTaskConf.Des,
|
|
||||||
// NpcStatus: 1, //接取
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for _, cid := range curTaskConf.Completetask {
|
|
||||||
// task.Conds = append(task.Conds, &pb.ConIProgress{
|
|
||||||
// Conid: cid,
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
// tasks.TaskMap[req.TaskId] = task
|
|
||||||
// myWorldtask.CurrentTasks[curTaskConf.Group] = tasks
|
|
||||||
// }
|
|
||||||
|
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
"currentTasks": myWorldtask.CurrentTasks,
|
"currentTasks": myWorldtask.CurrentTasks,
|
||||||
|
Loading…
Reference in New Issue
Block a user