예제 #1
0
 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);
 }
예제 #2
0
 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);
         }
     }
 }
예제 #3
0
 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
 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("");
 }
예제 #6
0
 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("");
 }
예제 #7
0
 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);
 }
예제 #8
0
 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);
 }
예제 #9
0
 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("");
 }
예제 #10
0
 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("");
 }
예제 #11
0
 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("");
 }
예제 #12
0
 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);
 }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
 private string ProgressHandler_AnyScene(UserInfo user, MissionInfo mission, bool isFinished)
 {
     //return String.Format("{0} / {1}", mission.CurValue, mission.Param0);
     return("");
 }
예제 #16
0
 private bool MissionHandler_AutoFinish(UserInfo user, MissionInfo mission, StageClearInfo info = null)
 {
     return(true);
 }