Exemplo n.º 1
0
        public static void MarkCompletedMissionAsDead(MissionID missionID)
        {
            Mission tempMission = GetMission(missionID);

            tempMission.CurrentObjectiveDescription = tempMission.ObjectiveCompleted;

            if (tempMission.MissionState.Equals(StateOfMission.CompletedDead))
            {
                return;
            }

            else if (tempMission.MissionState.Equals(StateOfMission.Completed))
            {
                foreach (Item reward in tempMission.RewardItems)
                {
                    ShipInventoryManager.AddItem(reward);
                }

                StatsManager.progress   += tempMission.ProgressReward;
                StatsManager.reputation += tempMission.ReputationReward;
                StatsManager.Crebits    += tempMission.MoneyReward;
                tempMission.OnCompleted();

                tempMission.MissionState = StateOfMission.CompletedDead;
            }

            RefreshLists();
        }
Exemplo n.º 2
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;
            }
        }
Exemplo n.º 3
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);
        }
 private void OnAcceptBribe()
 {
     ShipInventoryManager.AddItem(rebelBribe);
     moneyReward   = SmallReward;
     CompletedText = GetEvent((int)EventID.AcceptBribeCompletedText).Text;
     progress      = 1;
 }
Exemplo n.º 5
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.º 6
0
 public override void StartMission()
 {
     ShipInventoryManager.AddItem(medicalSupplies);
     ObjectiveIndex = 0;
     progress       = 0;
 }