Exemplo n.º 1
0
        public override void OnFailed()
        {
            base.OnFailed();

            RemoveShips();
            PopupHandler.DisplayMessage("You were unsuccessful in retrieving Ente. Return to the rebel base to try again.");
        }
 private void DisplayTutorialMessage(String message)
 {
     if (tutorialsUsed)
     {
         PopupHandler.DisplayMessage(message);
     }
 }
Exemplo n.º 3
0
        public override void Update(Game1 game, GameTime gameTime)
        {
            if (!levelCleared && level != null && level != "")
            {
                if (game.stateManager.shooterState.CurrentLevel != null &&
                    game.stateManager.shooterState.CurrentLevel.Identifier.ToLower().Equals(level.ToLower()) &&
                    game.stateManager.shooterState.CurrentLevel.IsObjectiveFailed &&
                    GameStateManager.currentState.ToLower().Equals("overworldstate"))
                {
                    PopupHandler.DisplayMessage(levelFailedText);
                    game.stateManager.shooterState.GetLevel(level).Initialize();
                }

                else if (game.stateManager.shooterState.CurrentLevel != null &&
                         game.stateManager.shooterState.CurrentLevel.Identifier.ToLower().Equals(level.ToLower()) &&
                         game.stateManager.shooterState.CurrentLevel.IsObjectiveCompleted &&
                         GameStateManager.currentState.ToLower().Equals("overworldstate"))
                {
                    levelCleared = true;
                    PopupHandler.DisplayMessage(levelCompletedTextStrings.ToArray());
                    foreach (Item item in itemRewards)
                    {
                        ShipInventoryManager.AddItem(item);
                    }
                    StatsManager.Crebits += moneyReward;
                    ClearEvent();
                }
            }

            if (startLevelWhenTextCleared && PopupHandler.TextBufferEmpty)
            {
                game.stateManager.shooterState.BeginLevel(level);
                startLevelWhenTextCleared = false;
            }
        }
 private void DisplayTutorialMessage(List <String> messages)
 {
     if (tutorialsUsed)
     {
         PopupHandler.DisplayMessage(messages.ToArray());
     }
 }
Exemplo n.º 5
0
        public override Boolean Activate()
        {
            Boolean successfullyActivated = false;

            var eventTextList = new List <String>();

            if (!IsCleared())
            {
                eventTextList.Add(eventText);

                if (ShipInventoryManager.HasAvailableSlot())
                {
                    ShipInventoryManager.AddItem(item);
                    ClearEvent();
                    successfullyActivated = true;
                }
                else
                {
                    eventTextList.Add(inventoryFullText);
                }
            }
            else
            {
                eventTextList.Add(clearText);
            }

            PopupHandler.DisplayMessage(eventTextList.ToArray());
            return(successfullyActivated);
        }
Exemplo n.º 6
0
        private void InputhandlingDebug()
        {
            //Changes states to play-state and playerstats-state
            if (ControlManager.CheckKeyPress(Keys.P))
            {
                Game.stateManager.shooterState.BeginLevel("Level1");
            }
            if (ControlManager.CheckKeyPress(Keys.E))
            {
                Game.stateManager.shooterState.BeginLevel("ExperimentLevel");
            }

            if (ControlManager.CheckKeyPress(Keys.U))
            {
                Game.stateManager.shooterState.BeginLevel("EscortLevel");
            }

            if (ControlManager.CheckKeyPress(Keys.Y))
            {
                PopupHandler.DisplayMessage("Player position: " + Game.player.position.ToString());
            }

            if (ControlManager.CheckKeyPress(Keys.F12))
            {
                ActivateBurnOutEnding();
            }
        }
Exemplo n.º 7
0
        public virtual void OnFailed()
        {
            if (failLogic == null)
            {
                if (objectiveFailedEventText != null && objectiveFailedEventText.Text != "")
                {
                    if (eventTextCanvas.Equals(EventTextCanvas.BaseState))
                    {
                        mission.MissionHelper.ShowEvent(objectiveFailedEventText);
                    }
                    else if (eventTextCanvas.Equals(EventTextCanvas.MessageBox))
                    {
                        PopupHandler.DisplayMessage(objectiveFailedEventText.Text);
                    }
                }

                MissionManager.MarkMissionAsFailed(mission.MissionID);
                mission.CurrentObjective = null;
            }
            else
            {
                failLogic.Invoke();
            }

            mission.OnFailed();

            if (mission.IsRestartAfterFail())
            {
                MissionManager.ResetMission(mission.MissionID);
            }
        }
        public override Boolean Activate()
        {
            var     eventTextList         = new List <String>();
            Boolean successfullyActivated = false;

            if (!IsCleared())
            {
                String      interactText   = "[SAIR] An ambush!";
                int         moneyReward    = 0;
                List <Item> itemRewards    = new List <Item>();
                String      levelCompleted = "You successfully fended of the ambush.";
                String      levelFailed    = "They got the better of you. Next time...";

                String levelString = GetProgressBasedLevel();

                levelEvent            = new LevelOE(interactText, levelString, moneyReward, itemRewards, levelCompleted, levelFailed);
                successfullyActivated = levelEvent.Activate();

                if (successfullyActivated)
                {
                    ClearEvent();
                }
            }
            else
            {
                eventTextList.Add(clearText);
                PopupHandler.DisplayMessage(eventTextList.ToArray());
            }

            return(successfullyActivated);
        }
        public override Boolean Activate()
        {
            var     eventTextList         = new List <String>();
            Boolean successfullyActivated = false;

            if (!IsCleared())
            {
                var item = GetProgressBasedRandomItem(Game);
                if (getItemOE == null)
                {
                    getItemOE = new GetItemOE(item, string.Format("You found the {0}!", item.Name), "Your inventory is full!", "Cleared (is this shown?)");
                }
                successfullyActivated = getItemOE.Activate();

                if (successfullyActivated)
                {
                    ClearEvent();
                }
            }
            else
            {
                eventTextList.Add(clearText);
                PopupHandler.DisplayMessage(eventTextList.ToArray());
            }

            return(successfullyActivated);
        }
Exemplo n.º 10
0
        public override void Invoke()
        {
            base.Invoke();

            game.stateManager.overworldState.RemoveOverworldObject(ship);
            game.stateManager.shooterState.BeginLevel(level);
            PopupHandler.DisplayMessage(encounterMessage);
        }
 public override bool Activate()
 {
     game.player.UnlockDevelopHyperSpeed();
     PopupHandler.DisplayMessage(activationMessage);
     game.stateManager.overworldState.AddEffectsObject(ExplosionGenerator.GenerateSpaceDuckExplosion(game, game.spriteSheetVerticalShooter, spaceDuck));
     game.stateManager.overworldState.GetSectorX.RemoveGameObject(spaceDuck);
     return(true);
 }
        public override void OnFailed()
        {
            base.OnFailed();

            RemoveShips();
            OverworldShip.FollowPlayer = true;
            PopupHandler.DisplayMessage("The attack on the alliance freighter failed. Return to the rebel base to try again.");
        }
        public override void Invoke()
        {
            base.Invoke();

            ship.Explode();
            game.stateManager.overworldState.RemoveOverworldObject(ship);
            game.stateManager.shooterState.BeginPirateLevel();
            PopupHandler.DisplayMessage("You should have stayed in the warm comfort of you home planet. Surrender your cargo peacefully or take the consequences.");
        }
        public override void Invoke()
        {
            if (StatsManager.reputation < 0)
            {
                base.Invoke();

                ship.Explode();
                game.stateManager.overworldState.RemoveOverworldObject(ship);
                game.stateManager.shooterState.BeginHangarLevel();
                PopupHandler.DisplayMessage(GetMessage());
            }
        }
Exemplo n.º 15
0
        public override Boolean Activate()
        {
            Boolean successfullyActivated = false;

            if (!IsCleared())
            {
                PopupHandler.DisplayMessage(interactText);
                startLevelWhenTextCleared = true;
                successfullyActivated     = true;
            }
            return(successfullyActivated);
        }
 //The function called when the class is activated.
 //For events inheriting from the "PointLevelEvent"-class
 //this is all that is executed before the event is removed.
 //Check "Swarm"-class to see how lasting events can look.
 public override void Run(GameTime gameTime)
 {
     if (portrait != PortraitID.None)
     {
         PopupHandler.DisplayPortraitMessage(portrait, message);
     }
     else
     {
         PopupHandler.DisplayMessage(message);
     }
     TriggerStatus = Trigger.Completed;
 }
        public override void OnFailed()
        {
            base.OnFailed();

            RemoveShips(allianceShips);
            RemoveShips(rebelShips1);
            RemoveShips(rebelShips2);

            allianceShips.Clear();
            rebelShips1.Clear();
            rebelShips2.Clear();

            PopupHandler.DisplayMessage("You failed to dispatch the treacherous alliance attack fleet leader and gain the trust of the rebels. Go back to Fortrun Station to try again.");
        }
Exemplo n.º 18
0
        public override void Update(PlayTime playTime)
        {
            base.Update(playTime);

            if (GameStateManager.currentState == "OverworldState" &&
                !startMessageDisplayed)
            {
                startMessageDisplayed = true;
                PopupHandler.DisplayMessage(startMessage);
            }

            if (!deviationAllowed &&
                !CollisionDetection.IsPointInsideCircle(game.player.position, shipsToFollow[0].position, deviationRadius) &&
                outOfRangeTimer <= 0)
            {
                outOfRangeTimer = 150;
                PopupHandler.DisplayMessage(deviationMessage);

                foreach (OverworldShip ship in shipsToFollow)
                {
                    ship.Wait();
                }
            }

            if (!deviationAllowed &&
                outOfRangeTimer > 0)
            {
                outOfRangeTimer--;

                if (outOfRangeTimer == 149)
                {
                    game.player.InitializeHyperSpeedJump(shipsToFollow[0].position, false);
                }

                if (outOfRangeTimer < 1)
                {
                    outOfRangeTimer = -100;

                    foreach (OverworldShip ship in shipsToFollow)
                    {
                        ship.Start();
                    }
                }
            }
        }
Exemplo n.º 19
0
        public override Boolean Activate()
        {
            itemBought = false;

            var responseChoices = new List <String>()
            {
                "Yes", "No"
            };

            PopupHandler.DisplaySelectionMenu(welcomeText, responseChoices, new List <System.Action>()
            {
                delegate
                {
                    if (!ShipInventoryManager.HasAvailableSlot())
                    {
                        PopupHandler.DisplayMessage(inventoryFullText);
                    }

                    else if (StatsManager.Crebits >= price)
                    {
                        PopupHandler.DisplayMessage(itemBoughtText);

                        StatsManager.Crebits -= price;
                        ShipInventoryManager.AddItem(item);
                        if (oneTimeOnly)
                        {
                            IsCleared();
                        }
                        itemBought = true;
                    }

                    else
                    {
                        PopupHandler.DisplayMessage(notEnoughMoneyText);
                    }
                },

                delegate
                {
                    PopupHandler.DisplayMessage(declinePurchaseText);
                }
            });

            return(true);
        }
Exemplo n.º 20
0
        private void StartEnemyLevel(int enemyIndex, string level)
        {
            game.stateManager.shooterState.BeginLevel(level);
            game.stateManager.shooterState.CurrentLevel.SetFreighterMaxHP(shipToDefendMaxHP);
            game.stateManager.shooterState.CurrentLevel.SetFreighterHP(shipToDefendMaxHP);
            enemies.RemoveAt(enemyIndex);

            if (enemyMessages.Count > 0)
            {
                if (enemyPortraits[0] != PortraitID.None)
                {
                    PopupHandler.DisplayPortraitMessage(enemyPortraits[0], enemyMessages[0]);
                }
                else
                {
                    PopupHandler.DisplayMessage(enemyMessages[0]);
                }
                enemyMessages.RemoveAt(0);
                enemyPortraits.RemoveAt(0);
            }
        }
Exemplo n.º 21
0
        public override void Invoke()
        {
            if (StatsManager.reputation < 0)
            {
                base.Invoke();

                game.stateManager.overworldState.RemoveOverworldObject(ship);
                ship.Explode();

                if (ship.Level == null ||
                    ship.Level.Equals(""))
                {
                    game.stateManager.shooterState.BeginAlliancePirateLevel();
                }
                else
                {
                    game.stateManager.shooterState.BeginLevel(ship.Level);
                }

                PopupHandler.DisplayMessage(GetMessage());
            }
        }
Exemplo n.º 22
0
        public virtual void OnCompleted()
        {
            isOnCompletedCalled = true;

            if (objectiveCompletedEventText != null && objectiveCompletedEventText.Text != "")
            {
                if (eventTextCanvas.Equals(EventTextCanvas.BaseState))
                {
                    mission.MissionHelper.ShowEvent(objectiveCompletedEventText);
                }
                else if (eventTextCanvas.Equals(EventTextCanvas.MessageBox))
                {
                    if (usePortraits)
                    {
                        if (portraits != null &&
                            portraits.Count > 0)
                        {
                            PopupHandler.DisplayPortraitMessage(portraits, portraitTriggers, objectiveCompletedEventText.Text);
                        }
                        else
                        {
                            PopupHandler.DisplayPortraitMessage(portraits[0], objectiveCompletedEventText.Text);
                        }
                    }
                    else
                    {
                        PopupHandler.DisplayMessage(objectiveCompletedEventText.Text);
                    }
                }
            }

            if (completedLogic != null)
            {
                completedLogic.Invoke();
            }
        }
Exemplo n.º 23
0
 public override void OnFailed()
 {
     base.OnFailed();
     PopupHandler.DisplayMessage("The freighter was destroyed and the mission failed. Return to Highfence to try again.");
 }
        public override void OnFailed()
        {
            base.OnFailed();

            PopupHandler.DisplayMessage("You did not manage to shake off the suspicious rebels. Go back to the rebel base to try again.");
        }
        public override void OnFailed()
        {
            base.OnFailed();

            PopupHandler.DisplayMessage("You could not reach the Murt before the Alliance and the rebels. Go to the Murt asteroid to try again.");
        }
Exemplo n.º 26
0
 public void DisplayRumors()
 {
     PopupHandler.DisplayMessage(rumorStrings[CheckValidRumorIndex()]);
 }
        public override void OnFailed()
        {
            base.OnFailed();

            PopupHandler.DisplayMessage("You could not gain control of the Murt, return to the Alliance fleet outside Telmun to try again.");
        }
Exemplo n.º 28
0
        private void UpdateTutorialMessages(GameTime gameTime)
        {
            if (!hasEnteredStation && GameStateManager.currentState.Equals("StationState") &&
                game.stateManager.stationState.SubStateManager.ButtonControl == ButtonControl.Menu)
            {
                hasEnteredStation = true;
                DisplayTutorialMessage("You can disable tutorial messages in the options menu.", TutorialImage.MenuControls);
            }

            if (!hasEnteredOverworld && GameStateManager.currentState.Equals("OverworldState"))
            {
                tempTimer -= gameTime.ElapsedGameTime.Milliseconds;

                if (tempTimer < 0)
                {
                    tempTimer           = 50;
                    hasEnteredOverworld = true;

                    DisplayTutorialImage(TutorialImage.OverworldControls);
                }
            }

            else if (!coordinatesDisplayed &&
                     hasEnteredOverworld &&
                     PopupHandler.TextBufferEmpty)
            {
                coordinatesDisplayed = true;

                DisplayTutorialMessage("Your current objective is to go to coordinates (2450, 700). To find that location, follow the blinking dot on your radar. Main missions are represented by gold-colored dots and secondary missions by silver-colored dots.",
                                       TutorialImage.Radar);
            }

            Vector2 highfenceBeaconPosition = game.stateManager.overworldState.GetBeacon("Highfence Beacon").position;

            if (!hasEnteredHighfenceBeaconArea &&
                Vector2.Distance(game.player.position, highfenceBeaconPosition) < BeaconTutorialActivationRadius)
            {
                hasEnteredHighfenceBeaconArea = true;
                DisplayTutorialMessage("This is a 'beacon'. Beacons are used for traveling quickly between planets, but they need to be activated before use. Activate a beacon by flying close to it!");
            }

            if (!hasEnteredVerticalShooter && GameStateManager.currentState.Equals("ShooterState"))
            {
                tempTimer2 -= gameTime.ElapsedGameTime.Milliseconds;

                if (tempTimer2 < 0)
                {
                    tempTimer2 = 500;

                    hasEnteredVerticalShooter = true;
                    DisplayTutorialMessage(new List <String> {
                        "You can rebind the keys in the options menu.",
                        "Down at the bottom-left you can find information about the current level objective, your active weapons and on your ship's health, energy and shields."
                    },
                                           new List <TutorialImage> {
                        TutorialImage.CombatControls, TutorialImage.CombatBars
                    },
                                           new List <int> {
                        1
                    });
                }
            }

            if (!hasEnteredShooterWithShield && !(ShipInventoryManager.equippedShield is EmptyShield) &&
                GameStateManager.currentState.Equals("ShooterState"))
            {
                tempTimer2 -= gameTime.ElapsedGameTime.Milliseconds;

                if (tempTimer2 < 0)
                {
                    tempTimer2 = 500;

                    hasEnteredShooterWithShield = true;
                    DisplayTutorialMessage("You now have a shield to protect your ship's hull! If you take a hit, the shield will absorb the damage if it has enough power.");
                }
            }

            if (equipShieldTutorial &&
                !equipShieldTutorialFinished)
            {
                game.stateManager.stationState.SubStateManager.ShopMenuState.DisplayBuyAndEquip = false;
                switch (equipShieldProgress)
                {
                case 0:
                    if (GameStateManager.currentState.Equals("StationState") &&
                        game.stateManager.stationState.Station.name.Equals("Highfence Shop"))
                    {
                        string message = "[Alliance Pilot] \"Start by selecting 'Buy/Sell' and pressing 'Enter'.";

                        if (!hasRecievedTutorialMoney)
                        {
                            message += " Here is two hundred Crebits, it should cover the cost for the shield.\"";
                        }

                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, message);

                        if (!hasRecievedTutorialMoney)
                        {
                            StatsManager.Crebits += 200;
                            PopupHandler.DisplayMessage("You recieved 200 Crebits.");
                            hasRecievedTutorialMoney = true;
                        }

                        equipShieldProgress = 1;
                    }
                    break;

                case 1:
                    if (GameStateManager.currentState.Equals("StationState") &&
                        game.stateManager.stationState.Station.name.Equals("Highfence Shop") &&
                        game.stateManager.stationState.SubStateManager.ActiveMenuState.Equals(game.stateManager.stationState.SubStateManager.ShopMenuState))
                    {
                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "[Alliance Pilot] \"Select the 'Basic shield' in the column to the right and select 'Buy'.\"");
                        equipShieldProgress = 2;
                    }
                    break;

                case 2:
                    if (GameStateManager.currentState.Equals("StationState") &&
                        game.stateManager.stationState.Station.name.Equals("Highfence Shop") &&
                        game.stateManager.stationState.SubStateManager.ActiveMenuState.Equals(game.stateManager.stationState.SubStateManager.ShopMenuState) &&
                        ShipInventoryManager.ownedShields.Count > 0)
                    {
                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "[Alliance Pilot] \"Good! Now exit the shop by selecting and pressing 'Go Back' and return to the overworld!\"");
                        equipShieldProgress = 3;
                    }
                    break;

                case 3:
                    if (GameStateManager.currentState.Equals("OverworldState"))
                    {
                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "[Alliance Pilot] \"Now, press 'I' to access your inventory.\"");
                        equipShieldProgress = 4;
                    }
                    break;

                case 4:
                    if (GameStateManager.currentState.Equals("ShipManagerState"))
                    {
                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "[Alliance Pilot] \"To equip your shield, select the shield slot and press 'Enter' to select from your list of available shields.\"");
                        equipShieldProgress = 5;
                    }
                    break;

                case 5:
                    if (GameStateManager.currentState.Equals("ShipManagerState") &&
                        game.stateManager.shipManagerState.IsShieldSlotSelected)
                    {
                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "[Alliance Pilot] \"Now, press 'Enter' again to equip the selected shield.\"");
                        equipShieldProgress = 6;
                    }
                    break;

                case 6:
                    if (!(ShipInventoryManager.equippedShield is EmptyShield))
                    {
                        PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "[Alliance Pilot] \"Good! Now your shield is equipped! What parts you have equipped is crucial for your success. Come back here often and try different combinations of ship parts.\"#\"Now, exit the inventory by pressing 'Escape' and return to me!\"");
                        equipShieldTutorialFinished = true;
                    }
                    break;
                }

                if (equipShieldProgress < 2 &&
                    ShipInventoryManager.OwnedShields.Count > 0)
                {
                    PopupHandler.DisplayPortraitMessage(PortraitID.AlliancePilot, "You already bought a shield? Okay, let me tell you how to equip it! Start by pressing 'I' to access your inventory.");
                    equipShieldProgress = 4;
                }
            }

            if (equipShieldTutorialFinished &&
                game.stateManager.stationState.SubStateManager.ShopMenuState.DisplayBuyAndEquip == false)
            {
                game.stateManager.stationState.SubStateManager.ShopMenuState.DisplayBuyAndEquip = true;
            }

            if (ShipInventoryManager.HasItemOfKind("LongShot") &&
                MissionManager.GetMission(MissionID.Main3_DefendColony).MissionState.Equals(StateOfMission.Unavailable) &&
                GameStateManager.currentState.Equals("OverworldState") && !longShotTutorialActivated)
            {
                tempTimer3 -= gameTime.ElapsedGameTime.Milliseconds;

                if (tempTimer3 <= 0)
                {
                    tempTimer3 = 1000;
                    longShotTutorialActivated = true;
                    DisplayTutorialMessage(new List <string>()
                    {
                        String.Format("You have recieved your first long-range weapon: 'LongShot'. You can have two weapons equipped at a time, and you can toggle between them in combat using '{0}'.", ControlManager.GetKeyName(RebindableKeys.Action2)),
                        "Try accessing your inventory with 'I' and equip LongShot on one slot and SpreadBullet on the other. Then you can vary your strategy in combat depending on which enemies you encounter."
                    });
                }
            }

            if (ShipInventoryManager.OwnedSecondary.Count > 0 && GameStateManager.currentState.Equals("OverworldState") &&
                !secondaryWeaponTutorialDisplayed)
            {
                tempTimer3 -= gameTime.ElapsedGameTime.Milliseconds;

                if (tempTimer3 <= 0)
                {
                    tempTimer3 = 1000;
                    secondaryWeaponTutorialDisplayed = true;
                    DisplayTutorialMessage("You have acquired your first secondary weapon! Don't forget to equip it if you havn't done so already. Secondary weapons are fired automatically and don't use energy, so they are very handy!");
                }
            }

            if (isAMissionFailed && GameStateManager.currentState.Equals("OverworldState") &&
                !hasDisplayedSkipMessage)
            {
                tempTimer2 -= gameTime.ElapsedGameTime.Milliseconds;

                if (tempTimer2 < 0)
                {
                    tempTimer2 = 500;

                    hasDisplayedSkipMessage = true;
                    DisplayTutorialMessage("When you fail a mission, you can replay most of them by going back to where they started. Press 'Escape' to skip dialogs and mission events you have already seen.");
                }
            }
        }
Exemplo n.º 29
0
 public override Boolean Activate()
 {
     PopupHandler.DisplayMessage(text.ToArray());
     return(true);
 }
Exemplo n.º 30
0
        public void UpdateProgressionConditions()
        {
            // Screening off player from certain locations
            if (StatsManager.gameMode != GameMode.Develop &&
                mainInfiltration.MissionState != StateOfMission.CompletedDead &&
                mainInfiltration.ObjectiveIndex < 9)
            {
                if (!game.player.HyperspeedOn)
                {
                    if (CollisionDetection.IsRectInRect(game.player.Bounds,
                                                        game.stateManager.overworldState.GetRebelOutpost.SpaceRegionArea) &&
                        PopupHandler.MessageQueueCount <= 0)
                    {
                        PopupHandler.DisplayMessage("A large group of rebels prevents you from entering this area.");

                        game.player.BounceBack();
                    }
                }
            }

            // Unlock missions
            if (mainNewFirstMission.MissionState == StateOfMission.CompletedDead &&
                mainHighfence.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main1_2_ToHighfence);
                UnlockMission(MissionID.Side_FlightTraining);
            }

            if (mainHighfence.MissionState == StateOfMission.CompletedDead &&
                mainRebels.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main2_1_TheConvoy);
                askRebelMission = true;
            }

            if (mainRebels.MissionState == StateOfMission.Available &&
                game.stateManager.planetState.SubStateManager.ButtonControl == ButtonControl.Menu &&
                askRebelMission)
            {
                askRebelMission = false;
                game.stateManager.planetState.SubStateManager.ChangeMenuSubState("Mission");
                game.stateManager.planetState.SubStateManager.MissionMenuState.SelectedMission = mainRebels;
                game.stateManager.planetState.SubStateManager.MissionMenuState.DisplayMissionIntroduction();
            }

            if (mainRebels.MissionState == StateOfMission.CompletedDead &&
                mainToPhaseTwo.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main2_2_ToFortrun);
                MarkMissionAsActive(MissionID.Main2_2_ToFortrun);
            }

            if (mainToPhaseTwo.MissionState == StateOfMission.CompletedDead &&
                mainDefendColony.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main3_DefendColony);
                MarkMissionAsActive(MissionID.Main3_DefendColony);
            }

            if (mainDefendColony.ObjectiveIndex > 6 &&
                astroDodger.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Side_AstroDodger);
            }

            if (mainDefendColony.MissionState == StateOfMission.CompletedDead &&
                mainInfiltration.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main4_Infiltration);
            }

            if (mainInfiltration.MissionState == StateOfMission.CompletedDead &&
                mainRetaliation.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main5_Retribution);
                MarkMissionAsActive(MissionID.Main5_Retribution);
            }

            if (mainRetaliation.MissionState == StateOfMission.CompletedDead &&
                mainInTheNameOfScience.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main6_InTheNameOfScience);
            }

            if (mainInTheNameOfScience.MissionState == StateOfMission.CompletedDead &&
                mainInformation.MissionState == StateOfMission.Unavailable)
            {
                UnlockMission(MissionID.Main7_Information);
                MarkMissionAsActive(MissionID.Main7_Information);
            }

            if (mainInformation.MissionState == StateOfMission.Completed &&
                mainBeginningOfTheEnd.MissionState == StateOfMission.Unavailable)
            {
                mainInformation.MissionState = StateOfMission.CompletedDead;
                UnlockMission(MissionID.Main8_1_BeginningOfTheEnd);
                MarkMissionAsActive(MissionID.Main8_1_BeginningOfTheEnd);
                game.AutoSave();
            }

            // Start second mission after first is completed
            if (mainNewFirstMission.MissionState == StateOfMission.CompletedDead &&
                mainHighfence.MissionState == StateOfMission.Available &&
                mainHighfence.MissionHelper.IsPlayerOnStation("Border Station"))
            {
                MarkMissionAsActive(MissionID.Main1_2_ToHighfence);
            }

            // Start part 2 of final mission
            if (mainBeginningOfTheEnd.MissionState == StateOfMission.Completed &&
                mainTheEnd.MissionState == StateOfMission.Unavailable)
            {
                mainBeginningOfTheEnd.MissionState = StateOfMission.CompletedDead;
                UnlockMission(MissionID.Main8_2_TheEnd);
                MarkMissionAsActive(MissionID.Main8_2_TheEnd);
                game.AutoSave();
            }

            // Final mission stuff
            if ((mainTheEnd.MissionState == StateOfMission.Completed ||
                 (mainTheEnd.MissionState == StateOfMission.CompletedDead &&
                  !RebelFleet.IsShown)) &&
                GameStateManager.currentState.Equals("OverworldState"))
            {
                UnlockMission(MissionID.Main9_C_OnYourOwnArc);
                mainTheEnd.MissionState = StateOfMission.CompletedDead;

                RebelFleet rebelFleet = new RebelFleet(game,
                                                       game.stateManager.overworldState.GetSectorX.GetSpriteSheet(), Vector2.Zero);
                AllianceFleet allianceFleet = new AllianceFleet(game,
                                                                game.stateManager.overworldState.GetSectorX.GetSpriteSheet(), Vector2.Zero);
                RebelFleet.IsShown = true;

                rebelFleet.Initialize();
                allianceFleet.Initialize();

                game.stateManager.overworldState.AddOverworldObject(rebelFleet);
                game.stateManager.overworldState.AddOverworldObject(allianceFleet);

                game.AutoSave();
            }

            if (mainRebelArc.MissionState == StateOfMission.Completed)
            {
                mainRebelArc.MissionState = StateOfMission.CompletedDead;
                game.stateManager.outroState.SetOutroType(OutroType.RebelEnd);
                game.stateManager.ChangeState("OutroState");
            }

            else if (mainAllianceArc.MissionState == StateOfMission.Completed)
            {
                mainAllianceArc.MissionState = StateOfMission.CompletedDead;
                game.stateManager.outroState.SetOutroType(OutroType.AllianceEnd);
                game.stateManager.ChangeState("OutroState");
            }

            else if (mainOnYourOwnArc.MissionState == StateOfMission.Completed)
            {
                mainOnYourOwnArc.MissionState = StateOfMission.CompletedDead;
                game.stateManager.ChangeState("OverworldState");
                game.stateManager.overworldState.ActivateBurnOutEnding();
            }
        }