Ejemplo n.º 1
0
        private static List <Mission> GetActiveMissionsAtDestination(GameObjectOverworld obj)
        {
            List <Mission> currentMissions = new List <Mission>();

            for (int i = 0; i < activeMissions.Count; i++)
            {
                if (activeMissions[i].ObjectiveDestination != null)
                {
                    if ((activeMissions[i].ObjectiveDestination is Planet ||
                         activeMissions[i].ObjectiveDestination is Station ||
                         activeMissions[i].ObjectiveDestination is SubInteractiveObject ||
                         activeMissions[i].ObjectiveDestination is Beacon) &&
                        (obj.name.ToLower() == activeMissions[i].ObjectiveDestination.name.ToLower()))
                    {
                        currentMissions.Add(activeMissions[i]);
                    }

                    else if (activeMissions[i].ObjectiveDestination == obj)
                    {
                        currentMissions.Add(activeMissions[i]);
                    }
                }
            }

            return(currentMissions);
        }
Ejemplo n.º 2
0
        public override void Initialize(GameObjectOverworld obj, Vector2 startingPoint)
        {
            base.Initialize(obj, startingPoint);

            speed = obj.speed * 0.65f;
            color = new Color(255, 255, 255, 255);
        }
Ejemplo n.º 3
0
 protected Objective(Game1 game, Mission mission, String description)
 {
     this.game        = game;
     this.mission     = mission;
     this.description = description;
     destination      = mission.Destinations[mission.Objectives.Count];
 }
Ejemplo n.º 4
0
 public void RemoveGameObject(GameObjectOverworld gameObject)
 {
     if (gameObjects.Contains(gameObject))
     {
         garbageGameObjects.Add(gameObject);
     }
 }
Ejemplo n.º 5
0
 protected void AddDestination(GameObjectOverworld destination, int times = 1)
 {
     for (int i = 0; i < times; i++)
     {
         destinations.Add(destination);
     }
 }
Ejemplo n.º 6
0
        public void Initialize(Sector sec, GameObjectOverworld startingPoint)
        {
            Initialize();

            sector   = sec;
            position = startingPoint.position;
        }
 //Checks if Object is out of screen
 public static bool OutOfScreen(GameObjectOverworld Object, Vector2 systemSize)
 {
     return((Object.position.X + Object.sprite.SourceRectangle.Value.Width / 2) < 0 ||
            (Object.position.X - Object.sprite.SourceRectangle.Value.Width / 2) > systemSize.X ||
            (Object.position.Y + Object.sprite.SourceRectangle.Value.Height / 2) < 0 ||
            (Object.position.Y - Object.sprite.SourceRectangle.Value.Height / 2) > systemSize.Y);
 }
        public ParticleManager(Game1 game, GameObjectOverworld ship)
        {
            this.game = game;
            this.ship = ship;

            particles     = new List <Particle>();
            deadParticles = new List <Particle>();
        }
Ejemplo n.º 9
0
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld highfence = Game.stateManager.overworldState.GetPlanet("Highfence");

            AddDestination(highfence, 2);
        }
Ejemplo n.º 10
0
 public void RemoveOverworldObject(GameObjectOverworld obj)
 {
     if (deepSpaceGameObjects.Contains(obj) && !garbageDeepSpaceGameObjects.Contains(obj))
     {
         garbageDeepSpaceGameObjects.Add(obj);
         obj.FinalGoodbye();
     }
 }
Ejemplo n.º 11
0
        public override void Update(GameTime gameTime, GameObjectOverworld obj)
        {
            base.Update(gameTime, obj);

            color    = GetFadingBlueFireColor(gameTime, color) * opacity;
            yScale   = scale + speed * ScaleStretch;
            parAngle = (float)((Math.PI * 90) / 180) + (float)(MathFunctions.RadiansFromDir(Direction.GetDirectionAsVector()));
        }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld telmun = Game.stateManager.overworldState.GetPlanet("Mysterious Asteroid");

            AddDestination(telmun, 5);
        }
 public HangarCollisionEvent(Game1 game, OverworldShip ship, GameObjectOverworld target)
     : base(game, ship, target)
 {
     messages = new List <string>();
     messages.Add("Die rebel scum!");
     messages.Add("You are deamed a traitor to the alliance. You will pay for your crimes!");
     messages.Add("Resistance is futile, surrender now!");
 }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld informationStation = Game.stateManager.overworldState.GetSectorX.GetGameObject("Information Station");

            AddDestination(informationStation, 7);
        }
Ejemplo n.º 15
0
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld lavis = Game.stateManager.overworldState.GetSectorX.GetGameObject("Lavis");

            AddDestination(lavis, 3);
        }
 public RebelPirateCollisionEvent(Game1 game, OverworldShip ship, GameObjectOverworld target)
     : base(game, ship, target)
 {
     messages = new List <string>();
     messages.Add("The alliance must be destroyed!");
     messages.Add("Death to the alliance!");
     messages.Add("The Alliance are destroying our homes. You must pay!");
 }
Ejemplo n.º 17
0
        public void Initialize(Sector sec, GameObjectOverworld startingPoint, GameObjectOverworld endDestination)
        {
            Initialize();

            sector            = sec;
            position          = startingPoint.position;
            destinationPlanet = endDestination;
            destination       = destinationPlanet.position;
        }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld fortrunStaion1 =
                Game.stateManager.overworldState.GetStation("Fortrun Station");

            destinations.Add(fortrunStaion1);
            destinations.Add(fortrunStaion1);
        }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld rebelBase = Game.stateManager.overworldState.GetStation("Rebel Base");

            AddDestination(rebelShips1[1], 3);
            AddDestination(allianceShips[1], 5);
            AddDestination(rebelBase, 3);
        }
Ejemplo n.º 20
0
        public void AddRebelShip(Vector2 pos, string levelToStart, GameObjectOverworld target)
        {
            RebelShip tmpShip = new RebelShip(game, spriteSheet);

            tmpShip.Initialize();
            tmpShip.position = pos;
            tmpShip.Level    = levelToStart;
            tmpShip.SetTarget(target);
            overworld.AddOverworldObject(tmpShip);
        }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld newNorrland =
                Game.stateManager.overworldState.GetPlanet("New Norrland");

            AddDestination(destroyedShip, 2);
            AddDestination(newNorrland);
        }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld rebelBase = Game.stateManager.overworldState.GetStation("Rebel Base");

            AddDestination(rebelShips[0], 6);
            AddDestination(freighter, 2);
            AddDestination(rebelBase, 4);
        }
Ejemplo n.º 23
0
        public OrbitAction(OverworldShip ship, GameObjectOverworld target)
        {
            this.ship   = ship;
            this.target = target;

            centerX    = 243063;
            centerY    = 252133;
            radius     = 600f;
            orbitSpeed = 600f;
            speedScale = (0.001f * 2 * (float)Math.PI) / orbitSpeed;
        }
        protected override void SetDestinations()
        {
            destinations = new List <GameObjectOverworld>();

            GameObjectOverworld soelaraBeacon   = Game.stateManager.overworldState.GetBeacon("Soelara Beacon");
            GameObjectOverworld highfence       = Game.stateManager.overworldState.GetPlanet("Highfence");
            GameObjectOverworld fortrunStation1 = Game.stateManager.overworldState.GetStation("Fortrun Station");

            AddDestination(soelaraBeacon, 2);
            AddDestination(highfence, 2);
            AddDestination(fortrunStation1, 2);
        }
Ejemplo n.º 25
0
        private bool IsObjectAvailableMainMissionLocation(GameObjectOverworld obj)
        {
            foreach (String str in availableMainMissionLocationNames)
            {
                if (obj.name.ToLower().Equals(str.ToLower()))
                {
                    return(true);
                }
            }

            return(false);
        }
        protected override void SetDestinations()
        {
            GameObjectOverworld miningAsteroids =
                Game.stateManager.overworldState.GetMiningOutpost.GetGameObject("Mining Asteroids");
            GameObjectOverworld borderStation =
                Game.stateManager.overworldState.GetBorderXOutpost.GetGameObject("Border Station");

            destinations = new List <GameObjectOverworld>();

            AddDestination(ally1, 4);
            AddDestination(miningAsteroids);
            AddDestination(borderStation, 2);
        }
Ejemplo n.º 27
0
        public static bool IsFailedMissionDestination(GameObjectOverworld obj)
        {
            foreach (Mission mission in missions)
            {
                if (mission.MissionState == StateOfMission.Failed &&
                    mission.LocationName.ToLower().Equals(obj.name.ToLower()))
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 28
0
        // Checks if gameobject is target for main mission objective
        public static Boolean IsMainMissionDestination(GameObjectOverworld obj)
        {
            List <Mission> currentMissions = GetActiveMissionsAtDestination(obj);

            foreach (Mission mission in currentMissions)
            {
                if (mission.IsMainMission)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 29
0
        public void SetRandomEndPlanet()
        {
            List <GameObjectOverworld> tempList = new List <GameObjectOverworld>();

            tempList.AddRange(sector.GetGameObjects());

            destinationPlanet = tempList[(int)Game.random.Next(0, tempList.Count - 1)];
            destination       = destinationPlanet.position;

            if (position == destination)
            {
                SetRandomEndPlanet();
            }
        }
Ejemplo n.º 30
0
        public virtual void Update(GameTime gameTime, GameObjectOverworld obj)
        {
            Direction = obj.Direction;

            //Note to self: This code needs to be fixed to compensate for diagonal movement

            float particleMoveDistance = 0.5f * MathFunctions.FPSSyncFactor(gameTime);

            if (position.X < obj.position.X)
            {
                position.X += particleMoveDistance;
            }

            else if (position.X > obj.position.X)
            {
                position.X -= particleMoveDistance;
            }

            if (position.Y < obj.position.Y)
            {
                position.Y += particleMoveDistance;
            }

            else if (position.Y > obj.position.Y)
            {
                position.Y -= particleMoveDistance;
            }

            if (scale > 0)
            {
                scale -= 0.03f * MathFunctions.FPSSyncFactor(gameTime);
            }
            else
            {
                scale = 0;
            }

            color = GetFadingFireColor(gameTime, color) * opacity;

            if (lifeSpawn > 0)
            {
                lifeSpawn -= 1.0f * MathFunctions.FPSSyncFactor(gameTime);
            }

            yScale   = scale + speed * ScaleStretch;
            parAngle = (float)((Math.PI * 90) / 180) + (float)(MathFunctions.RadiansFromDir(Direction.GetDirectionAsVector()));

            base.Update(gameTime);
        }