private bool MissionHandler_Scene(UserInfo user, MissionInfo mission, StageClearInfo info = null) { if (null != info) { if (null != mission && mission.Param0 == info.SceneId) { mission.CurValue = mission.CurValue + info.SweepCount; if (mission.CurValue >= mission.Param1) { return(true); } } } else { if (null != mission && mission.FinishType != (int)MissionType.DAILY) { if (user.GetSceneInfo(mission.Param0) > 0) { return(true); } } } return(false); }
internal void ResetMonthCardMissions(UserInfo user) { foreach (int missionId in MissionConfigProvider.Instance.GetMonthCardMissionId()) { if (user.IsHaveMonthCard()) { MissionInfo mi = user.Mission.GetMissionInfoById(missionId); if (null != mi) { mi.Reset(); } else { user.Mission.AddMission(missionId, MissionStateType.UNCOMPLETED); } if (IsMissionFinish(user, missionId)) { MissionInfo missionInfo = user.Mission.GetMissionInfoById(missionId); if (null != missionInfo) { missionInfo.State = MissionStateType.COMPLETED; } } } else { user.Mission.RemoveMission(missionId); } } }
private bool MissionHandler_DeadCount(UserInfo user, MissionInfo mission, StageClearInfo info = null) { if (null != mission && null != info && mission.SceneId == info.SceneId && mission.Param0 >= info.DeadCount) { return(true); } return(false); }
private bool MissionHandler_Time(UserInfo user, MissionInfo mission, StageClearInfo info = null) { if (null != mission && null != info && mission.SceneId == info.SceneId && mission.Param0 >= info.Duration / 1000) { return(true); } return(false); }
internal string GetMissionProgress(UserInfo user, int missionId, bool isFinished) { if (null != user && null != user.Mission) { MissionInfo mission = user.Mission.GetMissionInfoById(missionId); return(GetMissionProgress(user, mission, isFinished)); } return(""); }
private string ProgressHandler_Scene(UserInfo user, MissionInfo mission, bool isFinished) { /* * if (null != mission) { * if (isFinished) { * return String.Format("{0} / {1}", mission.CurValue, mission.Param1); * } * } */ return(""); }
private bool MissionHandler_SceneStar(UserInfo user, MissionInfo mission, StageClearInfo info = null) { if (null != user && null != mission) { if (user.GetSceneInfo(mission.Config.Args0) >= mission.Config.Args1) { return(true); } } return(false); }
private bool MissionHandler_Level(UserInfo user, MissionInfo mission, StageClearInfo info = null) { if (null != mission) { mission.CurValue = user.Level; if (mission.Param0 <= user.Level) { return(true); } } return(false); }
internal string GetMissionProgress(UserInfo user, MissionInfo info, bool isFinished) { if (null != info) { GetProgressDelegate handler = GetProgressHandlerById(info.FinishType); if (null != handler) { return(handler(user, info, isFinished)); } } return(""); }
private string ProgressHandler_Level(UserInfo user, MissionInfo mission, bool isFinished) { /* * if(null != mission) * { * if (isFinished) { * return String.Format("{0} / {1}", user.Level, mission.Param0); * } else { * return String.Format("{0} / {1}", user.Level, mission.Param0); * } * } */ return(""); }
private string ProgressHandler_Common(UserInfo user, MissionInfo mission, bool isFinished) { /* * if (isFinished) { * return "1 / 1"; * } else { * return "0 / 1"; * } */ if (mission.Type == MissionType.MonthCard) { TimeSpan deltaTime = user.MonthCardExpiredTime - DateTime.Now; return(deltaTime.Days.ToString()); } return(""); }
private bool MissionHandler_AnyScene(UserInfo user, MissionInfo mission, StageClearInfo info = null) { if (null != mission && null != info) { mission.CurValue = mission.CurValue + info.SweepCount; if (mission.CurValue >= mission.Param0) { return(true); } else { return(false); } } return(false); }
internal bool AddCompletedMission(int id, int progressValue) { MissionInfo info; if (m_Missions.TryGetValue(id, out info)) { info.State = MissionStateType.COMPLETED; info.CurValue = progressValue; } else { info = new MissionInfo(id); info.State = MissionStateType.COMPLETED; info.CurValue = progressValue; m_Missions.TryAdd(id, info); } return(true); }
internal bool IsMissionFinish(UserInfo user, int missionId) { MissionInfo mi = user.Mission.GetMissionInfoById(missionId); if (null != mi) { if (MissionStateType.COMPLETED == mi.State) { return(true); } else { UpdateMissionDelegate handler = GetHandlerById(mi.FinishType); if (null != handler) { return(handler(user, mi)); } } } return(false); }
private string ProgressHandler_AnyScene(UserInfo user, MissionInfo mission, bool isFinished) { //return String.Format("{0} / {1}", mission.CurValue, mission.Param0); return(""); }
private bool MissionHandler_AutoFinish(UserInfo user, MissionInfo mission, StageClearInfo info = null) { return(true); }