public override void Begin()
        {
            var ship = (Miner)ParentShip;

            ship.CurrentMiningTarget = Target;

            ParentShip.SetDestination(Target.Position);
        }
        public override void Begin()
        {
            if (FollowDistance == 0)
            {
                FollowDistance = 50.0f + WorldData.RNG.Next(0, 50);
            }

            RandomOffset = new Vector2(WorldData.RNG.Next(-50, 50), WorldData.RNG.Next(-50, 50));
            ParentShip.SetDestination(Target + RandomOffset);
        }
        public override void Begin()
        {
            if (FollowDistance == 0)
            {
                FollowDistance = Target.ShieldRadius * 4.0f;
            }

            RandomOffset = new Vector2(WorldData.RNG.Next(-50, 50), WorldData.RNG.Next(-50, 50));
            ParentShip.SetDestination(Target.Position + RandomOffset);
        }
示例#4
0
        public override void Begin()
        {
            var ship = (Miner)ParentShip;

            ship.CurrentMiningTarget = Target;

            RandomOffset = new Vector2(WorldData.RNG.Next(-25, 25), WorldData.RNG.Next(-25, 25));

            ParentShip.SetDestination(Target.Position + RandomOffset);
        }
示例#5
0
 public override void Update(GameTime gameTime)
 {
     if (Vector2.Distance(ParentShip.Position, Target.Position + RandomOffset) <= 50)
     {
         ParentShip.StopMovement();
         Parent.SetState <MinerDepositingState>();
     }
     else
     {
         ParentShip.SetDestination(Target.Position + RandomOffset);
     }
 }
示例#6
0
 public override void Update(GameTime gameTime)
 {
     if (Vector2.Distance(ParentShip.Position, Target) <= 25.0f)
     {
         ParentShip.StopMovement();
         Parent.SetState <ShipIdleState>();
     }
     else
     {
         ParentShip.SetDestination(Target);
     }
 }
        public override void Update(GameTime gameTime)
        {
            ParentShip.SetDestination(Target.Position);

            foreach (var weapon in ParentShip.Weapons)
            {
                if (Vector2.Distance(Target.Position, ParentShip.Position) <= weapon.Range && weapon.CurrentCooldown <= 0)
                {
                    Target.TakeDamage(weapon.Damage);
                    weapon.CurrentCooldown = weapon.Cooldown;
                }
            }
        }
 public override void Update(GameTime gameTime)
 {
     if (ParentShip.CollisionRect.Intersects(Target.CollisionRect))
     {
         ParentShip.StopMovement();
         Parent.GetState <MinerMiningState>().Target = Target;
         Parent.SetState <MinerMiningState>();
     }
     else
     {
         ParentShip.SetDestination(Target.Position);
     }
 }
示例#9
0
        public override void Update(GameTime gameTime)
        {
            if (Vector2.Distance(ParentShip.Position, Target.Position + RandomOffset) <= 50)
            {
                ParentShip.StopMovement();
                Parent.GetState <MinerMiningState>().Target = Target;
                Parent.SetState <MinerMiningState>();

                GameplayState.EffectsManager.AddExplosion(Target.Position + RandomOffset, Color.OrangeRed, 1.0f, 3000);
            }
            else
            {
                ParentShip.SetDestination(Target.Position + RandomOffset);
            }
        }
示例#10
0
 public override void Update(GameTime gameTime)
 {
     if (Vector2.Distance(Target.Position + RandomOffset, ParentShip.Position) <= FollowDistance)
     {
         if (Target.IsMoving)
         {
             ParentShip.MoveSpeed = Target.MoveSpeed;
             ParentShip.SetDestination(Target.Position + RandomOffset);
         }
         else
         {
             ParentShip.StopMovement();
         }
     }
     else
     {
         ParentShip.MoveSpeed = ParentShip.BaseMoveSpeed;
         ParentShip.SetDestination(Target.Position + RandomOffset);
     }
 }
 public override void Update(GameTime gameTime)
 {
     if (Vector2.Distance(Target.Position, ParentShip.Position) <= FollowDistance)
     {
         ParentShip.StopMovement();
         Waiting = true;
     }
     else
     {
         if (Waiting)
         {
             if (Vector2.Distance(Target.Position, ParentShip.Position) >= FollowDistance * 2)
             {
                 Waiting = false;
             }
         }
         else
         {
             ParentShip.SetDestination(Target.Position);
         }
     }
 }
        public override void Update(GameTime gameTime)
        {
            if (Vector2.Distance(Target.Position, ParentShip.Position) <= FollowDistance)
            {
                if (Target.IsMoving)
                {
                    ParentShip.MoveSpeed = Target.MoveSpeed;
                    ParentShip.SetDestination(Target.Position);
                }
                else
                {
                    ParentShip.StopMovement();
                }

                Target.RepairArmour(RepairRate * gameTime.DeltaTime());
            }
            else
            {
                ParentShip.MoveSpeed = ParentShip.BaseMoveSpeed;
                ParentShip.SetDestination(Target.Position);
            }
        }
示例#13
0
        public override void Update(GameTime gameTime)
        {
            ParentShip.SetDestination(Target.Position);

            foreach (var weapon in ParentShip.Weapons)
            {
                if (weapon.TargetType != Target.TargetType)
                {
                    continue;
                }

                if (Vector2.Distance(Target.Position, ParentShip.Position) <= weapon.Range && weapon.CurrentCooldown <= 0)
                {
                    var angle = MathF.Abs(ParentShip.GetAngleToTarget(Target.Position) - ParentShip.Rotation);

                    if (angle <= weapon.MaxAngle)
                    {
                        GameplayState.ProjectileManager.FireProjectile(weapon, ParentShip, Target, weapon.Damage);
                        weapon.ResetCooldown();
                    }
                }
            }
        }
 public override void Begin()
 {
     FollowDistance = Target.ShieldRadius * 0.9f;
     ParentShip.SetDestination(Target.Position);
 }
示例#15
0
 public override void Begin()
 {
     RandomOffset = new Vector2(WorldData.RNG.Next(-50, 50), WorldData.RNG.Next(-50, 50));
     ParentShip.SetDestination(Target + RandomOffset);
 }
 public override void Begin()
 {
     ParentShip.SetDestination(Target.Position);
 }
 public override void Update(GameTime gameTime)
 {
     ParentShip.SetDestination(Target.Position);
 }
示例#18
0
 public override void Update(GameTime gameTime)
 {
     ParentShip.SetDestination(Target + RandomOffset);
 }