Exemple #1
0
        private void HandleRoundEnd(CaptureTheFlagCaptureResultEnum roundResult)
        {
            AgentVictoryLogic missionBehaviour = this.Mission.GetMissionBehaviour <AgentVictoryLogic>();

            if (missionBehaviour == null)
            {
                return;
            }
            if (roundResult != CaptureTheFlagCaptureResultEnum.AttackersWin)
            {
                if (roundResult != CaptureTheFlagCaptureResultEnum.DefendersWin)
                {
                    return;
                }
                missionBehaviour.SetTimersOfVictoryReactions(BattleSideEnum.Defender);
            }
            else
            {
                missionBehaviour.SetTimersOfVictoryReactions(BattleSideEnum.Attacker);
            }
        }
Exemple #2
0
 public override void OnMissionTick(float dt)
 {
     if (this.Mission.IsMissionEnding)
     {
         if (this._notificationsDisabled)
         {
             this._scoreBoardOpenedOnceOnMissionEnd = true;
         }
         if (this._missionEndedMessageShown && !this._scoreBoardOpenedOnceOnMissionEnd)
         {
             if ((double)this._checkRetreatingTimer.ElapsedTime > 7.0)
             {
                 this.CheckIsEnemySideRetreatingOrOneSideDepleted();
                 this._checkRetreatingTimer.Reset();
                 if (this.Mission.MissionResult != null && this.Mission.MissionResult.PlayerDefeated)
                 {
                     GameTexts.SetVariable("leave_key", Game.Current.GameTextManager.GetHotKeyGameText("CombatHotKeyCategory", 4));
                     InformationManager.AddQuickInformation(GameTexts.FindText("str_battle_lost_press_tab_to_view_results"));
                 }
                 else if (this.Mission.MissionResult != null && this.Mission.MissionResult.PlayerVictory)
                 {
                     if (this._isEnemySideDepleted)
                     {
                         GameTexts.SetVariable("leave_key", Game.Current.GameTextManager.GetHotKeyGameText("CombatHotKeyCategory", 4));
                         InformationManager.AddQuickInformation(GameTexts.FindText("str_battle_won_press_tab_to_view_results"));
                     }
                 }
                 else
                 {
                     GameTexts.SetVariable("leave_key", Game.Current.GameTextManager.GetHotKeyGameText("CombatHotKeyCategory", 4));
                     InformationManager.AddQuickInformation(GameTexts.FindText("str_battle_finished_press_tab_to_view_results"));
                 }
             }
         }
         else if ((double)this._checkRetreatingTimer.ElapsedTime > 3.0 && !this._scoreBoardOpenedOnceOnMissionEnd)
         {
             if (this.Mission.MissionResult != null && this.Mission.MissionResult.PlayerDefeated)
             {
                 InformationManager.AddQuickInformation(GameTexts.FindText("str_battle_lost"));
             }
             else if (this.Mission.MissionResult != null && this.Mission.MissionResult.PlayerVictory)
             {
                 if (this._isEnemySideDepleted)
                 {
                     InformationManager.AddQuickInformation(GameTexts.FindText("str_battle_won"));
                 }
                 else if (this._isEnemySideRetreating)
                 {
                     InformationManager.AddQuickInformation(GameTexts.FindText("str_enemies_are_fleeing_you_won"));
                 }
             }
             else
             {
                 InformationManager.AddQuickInformation(GameTexts.FindText("str_battle_finished"));
             }
             this._missionEndedMessageShown = true;
             this._checkRetreatingTimer.Reset();
         }
         if (this._victoryReactionsActivated)
         {
             return;
         }
         AgentVictoryLogic missionBehaviour = this.Mission.GetMissionBehaviour <AgentVictoryLogic>();
         if (missionBehaviour == null)
         {
             return;
         }
         this.CheckIsEnemySideRetreatingOrOneSideDepleted();
         if (this._isEnemySideDepleted)
         {
             missionBehaviour.SetTimersOfVictoryReactions(this.Mission.PlayerTeam.Side);
             this._victoryReactionsActivated = true;
         }
         else if (this._isPlayerSideDepleted)
         {
             missionBehaviour.SetTimersOfVictoryReactions(this.Mission.PlayerEnemyTeam.Side);
             this._victoryReactionsActivated = true;
         }
         else
         {
             if (!this._isEnemySideRetreating || this._victoryReactionsActivatedForRetreating)
             {
                 return;
             }
             missionBehaviour.SetTimersOfVictoryReactionsForRetreating(this.Mission.PlayerTeam.Side);
             this._victoryReactionsActivatedForRetreating = true;
         }
     }
     else
     {
         if ((double)this._checkRetreatingTimer.ElapsedTime <= 1.0)
         {
             return;
         }
         this.CheckIsEnemySideRetreatingOrOneSideDepleted();
         this._checkRetreatingTimer.Reset();
     }
 }