private void CheckTasksProgressForVisitorReceiveComplete(int littleZooId) { Config.missionCell missionCell = missionModel.GetTaskCell(missionModel.currTaskId); if (missionCell != null && missionCell.ParseTaskType() == TaskType.LittleZooVisit) { if (littleZooId == missionCell.GetLittleZooId()) { int progress, goal; missionModel.GetTaskProgress(missionModel.currTaskId, out progress, out goal); missionModel.SetTaskProgress(missionModel.currTaskId, progress + 1); GuideMissionStateChanged.Send(missionModel.currTaskId, GuideMissionStateChanged.ChangeDetail_TaskProgress); SetTaskStateVars(); } } }
/// <summary> /// 根据用户数据获取任务进度 /// </summary> /// <param name="taskId"></param> /// <returns></returns> public int ResolveTaskProgress(int taskId) { Config.missionCell missionCell = GetTaskCell(taskId); if (missionCell == null) { return(0); } TaskType taskType = missionCell.ParseTaskType(); if (taskType == TaskType.AdWatch || taskType == TaskType.LittleZooVisit) { return(0); } if (taskType == TaskType.LittleZooLevelup) { int litzooId = missionCell.GetLittleZooId(); LittleZooModuleDataMSS litzooData = null; try { litzooData = playerData.GetLittleZooModuleData(litzooId); } catch (Exception e) { string.Format("动物栏[{0}]还未开启", litzooId); } if (litzooData != null) { LittleZooProperty zooProp = missionCell.ParseLittleZooProperty(); if (zooProp == LittleZooProperty.TicketPrice) { return(litzooData.littleZooTicketsLevel); } else if (zooProp == LittleZooProperty.Capacity) { return(litzooData.littleZooVisitorSeatLevel); } else if (zooProp == LittleZooProperty.VisitSpeed) { return(litzooData.littleZooEnterVisitorSpawnLevel); } } return(0); } else if (taskType == TaskType.ParkingLevelup) { ParkingProperty parkProp = missionCell.ParseParkingProperty(); if (parkProp == ParkingProperty.Revenue) { return(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingProfitLevel); } else if (parkProp == ParkingProperty.Capacity) { return(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingSpaceLevel); } else if (parkProp == ParkingProperty.VisitorFlowSpeed) { return(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingEnterCarSpawnLevel); } } else if (taskType == TaskType.EntryGateLevelup) { EntryGateProperty entryProp = missionCell.ParseEntryGateProperty(); if (entryProp == EntryGateProperty.TicketPrice) { return(playerData.GetEntryDateDataIDIndexOfDataIdx().entryTicketsLevel); } else if (entryProp == EntryGateProperty.Entrance) { GateData entryData = null; int entryId = missionCell.GetEntryGateId(); try { entryData = playerData.GetEntryGateIDIndexOfDataIdx(entryId); } catch (Exception e) { string.Format("售票口[{0}]还未开启", entryId); } return(entryData != null ? entryData.level : 0); } } return(0); }