This commit is contained in:
meixiongfeng 2023-06-16 18:01:35 +08:00
commit 601e45a4bc
2 changed files with 25 additions and 22 deletions

View File

@ -524,6 +524,10 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
}
change.Arenacoin += add
case comm.ResPs:
ggd := this.ModuleTools.GetGlobalConf()
if ggd == nil {
return
}
if add < 0 {
if user.Ps+add < 0 {
errdata = &pb.ErrorData{
@ -532,11 +536,11 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
}
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 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_UserVitLimit,

View File

@ -101,26 +101,25 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
break
}
}
}
// else {
// tasks = &pb.Worldtasks{
// TaskMap: make(map[int32]*pb.Worldtask),
// }
// task := &pb.Worldtask{
// TaskId: req.TaskId,
// TaskType: curTaskConf.Des,
// NpcStatus: 1, //接取
// }
} 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,
// })
// }
for _, cid := range curTaskConf.Completetask {
task.Conds = append(task.Conds, &pb.ConIProgress{
Conid: cid,
})
}
// tasks.TaskMap[req.TaskId] = task
// myWorldtask.CurrentTasks[curTaskConf.Group] = tasks
// }
tasks.TaskMap[req.TaskId] = task
myWorldtask.CurrentTasks[curTaskConf.Group] = tasks
}
update := map[string]interface{}{
"currentTasks": myWorldtask.CurrentTasks,