| | |
| | |
|
| | | curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskValue % taskGroup)
|
| | | curState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup)
|
| | | if curState == ChConfig.TaskState_Finish:
|
| | | if curState == ChConfig.TaskState_CanGet:
|
| | | continue
|
| | |
|
| | | needFix = False
|
| | |
| | | needFix = True
|
| | |
|
| | | # 可能修改降低了所需任务值,需要修正下完成状态
|
| | | if curValue >= needValue and curState != ChConfig.TaskState_Finish:
|
| | | if curValue >= needValue and curState != ChConfig.TaskState_CanGet:
|
| | | GameWorld.Log("需要修正任务状态: taskID=%s,curValue=%s,needValue=%s,curState=%s" % (taskID, curValue, needValue, curState), playerID)
|
| | | needFix = True
|
| | |
|
| | |
| | | if not taskID:
|
| | | return
|
| | | curState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup)
|
| | | if curState == ChConfig.TaskState_Finish:
|
| | | if curState != ChConfig.TaskState_Doing:
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Task", taskID)
|
| | | if not ipyData:
|
| | |
| | | if taskIpyData.GetTaskID() != taskID:
|
| | | return
|
| | | curState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup)
|
| | | if curState == ChConfig.TaskState_Finish:
|
| | | if curState == ChConfig.TaskState_CanGet:
|
| | | return
|
| | | taskType = taskIpyData.GetTaskType()
|
| | | finishNeedValue = taskIpyData.GetNeedValue()
|
| | |
| | |
|
| | | def __OnTaskFinish(curPlayer, taskGroup, taskID, taskIpyData):
|
| | | GameWorld.DebugLog("任务完成: taskGroup=%s,taskID=%s" % (taskGroup, taskID), curPlayer.GetPlayerID())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, ChConfig.TaskState_Finish)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, ChConfig.TaskState_CanGet)
|
| | | return
|
| | |
|
| | | def IsTaskFinish(curPlayer, taskID):
|
| | |
| | | return
|
| | | taskGroup = ipyData.GetTaskGroup()
|
| | | #nowTaskID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskID % taskGroup)
|
| | | #if nowTaskID and curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup) == ChConfig.TaskState_Finish:
|
| | | #if nowTaskID and curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup) == ChConfig.TaskState_CanGet:
|
| | | # finishTaskID = nowTaskID
|
| | | #else:
|
| | | # finishTaskID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskIDLast % taskGroup)
|
| | |
| | | awardItemList = ipyData.GetAwardItemList()
|
| | | curState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskState % taskGroup)
|
| | | curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TaskValue % taskGroup)
|
| | | if curState != ChConfig.TaskState_Finish:
|
| | | if curState != ChConfig.TaskState_CanGet:
|
| | | GameWorld.DebugLog("任务未完成无法领奖: taskID=%s,curValue=%s/%s,curState=%s" % (taskID, curValue, needValue, curState), playerID)
|
| | | return
|
| | | if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
|