private void onMissionStarted(Player player, MissionInstance mission)
 {
     for (int i = 0; i < this.m_heroStats.Count; i++)
     {
         HeroStats local1 = this.m_heroStats[i];
         local1.MissionsStarted++;
     }
 }
Пример #2
0
 private void onMissionEnded(Player player, MissionInstance mission, bool success)
 {
     if (success)
     {
         Missions missions = mission.Missions;
         missions.NumUnclaimedMissionCompletions++;
     }
 }
Пример #3
0
 public CmdStartMission(string[] serialized)
 {
     this.m_player = GameLogic.Binder.GameState.Player;
     if (serialized[0] == "event")
     {
         this.m_mission = this.m_player.PromotionEvents.getNewestEventInstance().Missions.Instances[int.Parse(serialized[1])];
     }
     else
     {
         this.m_mission = this.m_player.Missions.Instances[int.Parse(serialized[0])];
     }
 }
Пример #4
0
 public MissionInstance getFirstRewardableMissionInstance()
 {
     for (int i = 0; i < this.Instances.Count; i++)
     {
         double          num2;
         MissionInstance instance = this.Instances[i];
         if (instance.isActive() && (instance.getMissionProgress(this.Player, out num2) >= 1f))
         {
             return(instance);
         }
     }
     return(null);
 }
 public CmdCheatCompleteMission(string[] serialized)
 {
     this.m_player = Binder.GameState.Player;
     if (serialized[0] == "event")
     {
         this.m_forceStartMission = true;
         this.m_mission           = this.m_player.PromotionEvents.getNewestEventInstance().Missions.Instances[int.Parse(serialized[1])];
     }
     else
     {
         this.m_forceStartMission = false;
         this.m_mission           = this.m_player.Missions.Instances[int.Parse(serialized[0])];
     }
 }
Пример #6
0
 public void enforceMissionLegality()
 {
     if (this.MissionType == GameLogic.MissionType.Adventure)
     {
         for (int i = 0; i < this.Instances.Count; i++)
         {
             MissionInstance mission = this.Instances[i];
             if (!string.IsNullOrEmpty(mission.MissionId) && !App.Binder.ConfigMeta.IsMissionIdActive(mission.MissionId))
             {
                 CmdStartMission.ExecuteStatic(this.Player, mission);
             }
         }
     }
 }
Пример #7
0
        public int getNumRewardableMissions()
        {
            int num = 0;

            for (int i = 0; i < this.Instances.Count; i++)
            {
                double          num3;
                MissionInstance instance = this.Instances[i];
                if (instance.isActive() && (instance.getMissionProgress(this.Player, out num3) >= 1f))
                {
                    num++;
                }
            }
            return(num);
        }
Пример #8
0
        public static int CompareByCooldown(MissionInstance a, MissionInstance b)
        {
            if (a == b)
            {
                return(0);
            }
            int num = a.CooldownDurationSeconds.CompareTo(b.CooldownDurationSeconds);

            if (num != 0)
            {
                return(num);
            }
            bool flag  = string.IsNullOrEmpty(a.MissionId);
            bool flag2 = string.IsNullOrEmpty(b.MissionId);

            if (!flag && !flag2)
            {
                return(a.MissionId.CompareTo(b.MissionId));
            }
            return(flag.CompareTo(flag2));
        }
Пример #9
0
        protected void FixedUpdate()
        {
            Player player = GameLogic.Binder.GameState.Player;

            if (((player != null) && player.HasUnlockedMissions) && (Service.Binder.ContentService.MasterRemoteContent != null))
            {
                for (int i = 0; i < player.Missions.Instances.Count; i++)
                {
                    MissionInstance mission = player.Missions.Instances[i];
                    if (string.IsNullOrEmpty(mission.MissionId))
                    {
                        CmdStartMission.ExecuteStatic(player, mission);
                    }
                }
                for (int j = 0; j < player.Missions.Instances.Count; j++)
                {
                    MissionInstance instance2 = player.Missions.Instances[j];
                    if (instance2.OnCooldown && (instance2.getRemainingCooldownSeconds() <= 0L))
                    {
                        CmdStartMission.ExecuteStatic(player, instance2);
                    }
                }
                foreach (KeyValuePair <string, PromotionEventInstance> pair in player.PromotionEvents.Instances)
                {
                    PromotionEventInstance instance3 = pair.Value;
                    for (int k = 0; k < instance3.Missions.Instances.Count; k++)
                    {
                        MissionInstance instance4 = instance3.Missions.Instances[k];
                        if (instance4.OnCooldown && (instance4.getRemainingCooldownSeconds() <= 0L))
                        {
                            CmdStartMission.ExecuteStatic(player, instance4);
                        }
                    }
                }
            }
        }
Пример #10
0
 public CmdStartMission(Player player, MissionInstance mission)
 {
     this.m_player  = player;
     this.m_mission = mission;
 }
Пример #11
0
 public CmdEndMission(Player player, MissionInstance mission, bool success)
 {
     this.m_player  = player;
     this.m_mission = mission;
     this.m_success = success;
 }
Пример #12
0
 public CmdEndMission(string[] serialized)
 {
     this.m_player  = GameLogic.Binder.GameState.Player;
     this.m_mission = this.m_player.Missions.Instances[int.Parse(serialized[0])];
 }
 public CmdCheatCompleteMission(Player player, MissionInstance mission, [Optional, DefaultParameterValue(false)] bool forceStartMission)
 {
     this.m_player            = player;
     this.m_mission           = mission;
     this.m_forceStartMission = forceStartMission;
 }