Example #1
0
        public override void Initialize()
        {
            base.Initialize();

            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, MessageTime, MissionManager.GetMission(MissionID.Main6_InTheNameOfScience).GetEvent(MessageIndex).Text, PortraitID.RebelTroopLeader));
        }
 public override void StartMission()
 {
     MissionManager.RemoveAvailableMission(MissionID.Main9_A_RebelArc);
     MissionManager.RemoveAvailableMission(MissionID.Main9_C_OnYourOwnArc);
 }
Example #3
0
        protected override void Initialize()
        {
            CreateDirectories();
            SetAvailableResolutions();
            GameStarted = false;

            settingsFile = new SaveFile(this);
            settingsFile.Load(SaveFilePath, "settings.ini");

            Vector2 defaultResolution = GetDefaultResolution();

            resolution = new Vector2(settingsFile.GetPropertyAsFloat("visual", "resolutionx", defaultResolution.X),
                                     settingsFile.GetPropertyAsFloat("visual", "resolutiony", defaultResolution.Y));
            ScreenSize = new Point((int)resolution.X, (int)resolution.Y);

            random = new Random(DateTime.Now.Millisecond);

            showFPS = settingsFile.GetPropertyAsBool("visual", "showfps", false);

            graphics.PreferredBackBufferWidth  = (int)resolution.X;
            graphics.PreferredBackBufferHeight = (int)resolution.Y;
            if (IsDualMonitor())
            {
                graphics.IsFullScreen = false;
            }
            else
            {
                graphics.IsFullScreen = settingsFile.GetPropertyAsBool("visual", "fullscreen", true);
            }
            graphics.SynchronizeWithVerticalRetrace = true;

            // Uncomment to unlock FPS
            //IsFixedTimeStep = false;
            //graphics.SynchronizeWithVerticalRetrace = false;

            graphics.ApplyChanges();

            CenterScreenWindow();

            IsMouseVisible = settingsFile.GetPropertyAsBool("game options", "showmouse", true);

            menuBGController = new MenuBackdropController(this);
            menuBGController.Initialize();

            musicManager = new MusicManager(this);
            musicManager.Initialize();

            soundEffectsManager = new SoundEffectsManager(this);
            soundEffectsManager.Initialize();

            fontManager = new FontManager(this);
            fontManager.Initialize();

            ControlManager.LoadControls(settingsFile);

            spriteSheetOverworld       = new Sprite(Content.Load <Texture2D>("Overworld-Sprites/smallObjectSpriteSheet"));
            spriteSheetVerticalShooter = new Sprite(Content.Load <Texture2D>("Vertical-Sprites/shooterSheet"));
            messageBoxSpriteSheet      = new Sprite(Content.Load <Texture2D>("Overworld-Sprites/messageBoxSpriteSheet"));
            spriteSheetItemDisplay     = new Sprite(Content.Load <Texture2D>("itemVisualSheet"));
            beaconMenuSprite           = new Sprite(Content.Load <Texture2D>("Overworld-Sprites/BeaconMenu"));
            CollisionHandlingOverWorld.LoadLineTexture(this);

            shipInventoryManager = new ShipInventoryManager(this);
            shipInventoryManager.Initialize();

            statsManager = new StatsManager(this);
            statsManager.Initialize();

            player = new PlayerOverworld(this, spriteSheetOverworld);
            player.Initialize();

            beaconMenu = new BeaconMenu(this, beaconMenuSprite);
            beaconMenu.Initialize();

            stateManager = new GameStateManager(this);
            stateManager.Initialize();

            missionManager = new MissionManager(this);
            missionManager.Initialize();

            tutorialManager = new TutorialManager(this);
            tutorialManager.Initialize();
            tutorialManager.TutorialsUsed = settingsFile.GetPropertyAsBool("game options", "tutorials", true);

            shopManager = new ShopManager();

            saveFile = new SaveFile(this);

            Portrait.InitializePortraitSpriteSheet(this);
            popupHandler = new PopupHandler(this, messageBoxSpriteSheet);
            popupHandler.Initialize();

            helper = new HelperBox(this);

            ShopManager.SetShopUpdateTime(ShopManager.PRESET_SHOPTIME);

            base.Initialize();
        }
        public override void Initialize()
        {
            base.Initialize();

            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message1Time, MissionManager.GetMission(MissionID.Main1_1_RebelsInTheAsteroids).GetEvent(Message1).Text, PortraitID.AllianceCaptain));
            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message2Time, MissionManager.GetMission(MissionID.Main1_1_RebelsInTheAsteroids).GetEvent(Message2).Text, PortraitID.AllianceCaptain));
        }
        public override void Initialize()
        {
            base.Initialize();

            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message1Time, MissionManager.GetMission(MissionID.Main5_Retribution).GetEvent(Message1Index).Text, PortraitID.RebelPilot));
            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message1Time, MissionManager.GetMission(MissionID.Main5_Retribution).GetEvent(Message2Index).Text, PortraitID.AlliancePilot));
        }
Example #6
0
        private void DrawVisibleGameObjects(SpriteBatch spriteBatch)
        {
            float drawDistance = 0.91f;

            foreach (GameObjectOverworld obj in objectsVisibleOnRadar)
            {
                Color color = ImmovableObjectColor;
                float scale = 1f;
                activeSprite = objectSprite;
                drawDistance = 0.91f;
                bool isHidden = false;

                if (MissionManager.IsCurrentObjectiveDestination(obj) ||
                    MissionManager.IsFailedMissionDestination(obj))
                {
                    drawDistance = 0.92f;
                    if (colorSwapCounter <= 25)
                    {
                        if (MissionManager.IsMainMissionDestination(obj))
                        {
                            color = MainMissionColor;
                        }
                        else
                        {
                            color = SecondaryMissionColor;
                        }
                        activeSprite = blinkingSprite;
                        scale        = 1.25f;
                    }

                    else
                    {
                        color = Color.White;
                        scale = 1f;
                    }

                    if (colorSwapCounter >= 50)
                    {
                        colorSwapCounter = 0;
                    }
                }
                else if (IsObjectAvailableMainMissionLocation(obj) &&
                         MissionManager.IsNoMainMissionActive())
                {
                    drawDistance = 0.92f;
                    if (colorSwapCounter <= 25)
                    {
                        color        = MainMissionColor;
                        activeSprite = blinkingSprite;
                        scale        = 1.25f;
                    }

                    else
                    {
                        color = Color.White;
                        scale = 1f;
                    }

                    if (colorSwapCounter >= 50)
                    {
                        colorSwapCounter = 0;
                    }
                }
                else if (obj.isHidden)
                {
                    isHidden = true;
                }
                else if (obj is FreighterShip)
                {
                    color = FriendlyShipColor;
                }
                else if (obj is RebelShip)
                {
                    if (StatsManager.reputation >= 0)
                    {
                        color = HostileShipColor;
                    }
                    else
                    {
                        color = FriendlyShipColor;
                    }
                }
                else if (obj is AllianceShip ||
                         obj is HangarShip)
                {
                    if (StatsManager.reputation < 0)
                    {
                        color = HostileShipColor;
                    }
                    else
                    {
                        color = FriendlyShipColor;
                    }
                }
                else if (obj is SystemStar)
                {
                    color = Color.White;
                    scale = 1.25f;
                }
                else if (obj is Asteroid)
                {
                    activeSprite = asteroidSprite;
                    color        = AsteroidColor;
                    scale        = 1.5f;
                }
                else if (obj is ShopStation)
                {
                    activeSprite = shopSprite;
                    color        = Color.White;
                    drawDistance = 0.915f;
                }

                if (!isHidden)
                {
                    spriteBatch.Draw(activeSprite.Texture,
                                     new Vector2(Origin.X + ((obj.position.X - View.X) / scaleX), Origin.Y + ((obj.position.Y - View.Y) / scaleY)),
                                     activeSprite.SourceRectangle,
                                     color,
                                     0.0f,
                                     new Vector2(activeSprite.SourceRectangle.Value.Width / 2, activeSprite.SourceRectangle.Value.Height / 2),
                                     scale,
                                     SpriteEffects.None,
                                     drawDistance
                                     );
                }
            }
        }
Example #7
0
        public override void Initialize()
        {
            base.Initialize();

            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message1Time, MissionManager.GetMission(MissionID.Main4_Infiltration).GetEvent(Message1Index).Text, PortraitID.AllianceCaptain));
            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message1Time, MissionManager.GetMission(MissionID.Main4_Infiltration).GetEvent(Message2Index).Text));
            untriggeredEvents.Add(new SimpleMessageVertical(Game, player, spriteSheet, this, Message1Time, MissionManager.GetMission(MissionID.Main4_Infiltration).GetEvent(Message3Index).Text, PortraitID.Rok));
        }