예제 #1
0
        public override void Update()
        {
            if (Enabled)
            {
                base.Update();

                List <Player> PlayersInRange = GameLevel.GetIntersectingPlayers(EntityRange, IntersectionType.BY_EQUAL_OWNER);

                if (SkippedRenewTicks++ > SKIP_RENEW_TICKS)
                {
                    SkippedRenewTicks = 0;
                    foreach (Player P in PlayersInRange)
                    {
                        if (P.Health < P.MaxHealth)
                        {
                            P.Heal(1);
                            --Energy;
                            GameLevel.AddParticle(new DispenseBeam(this, P, DispenseBeamType.Heal));
                        }

                        if (P.Ammunition < P.MAX_AMMUNITION)
                        {
                            P.AddAmmunition(1);
                            --Energy;
                            GameLevel.AddParticle(new DispenseBeam(this, P, DispenseBeamType.Ammunition));
                        }
                    }
                }

                if (Energy <= 0)
                {
                    Remove();
                }
            }
        }
예제 #2
0
 public override void Die()
 {
     foreach (GEntity Tile in GameLevel.GetIntersectingTiles(ExplosionRange))
     {
         if (GameLevel.GetIntersectingEntities(Tile).Count == 0)
         {
             GameLevel.AddParticle(new MineExplosion(Tile.X, Tile.Y));
         }
     }
 }
예제 #3
0
 public override void Die(GEntity ContactedWith)
 {
     if (ContactedWith.IsMetallic)
     {
         Sound.MetalHit.Play();
         GameLevel.AddParticle(new Spark(X, Y, Direction));
     }
     else if (ContactedWith.IsBrick)
     {
         Sound.BrickHit.Play();
         GameLevel.AddParticle(new BrickDust(X, Y, Direction));
     }
 }
예제 #4
0
        public override void Die()
        {
            ++Deaths;
            if (IsMe(Id))
            {
                ++GameComponent.Gs.StatsDeaths;
            }
            GameLevel.AddParticle(new RobotDebris(X, Y, Direction));

            if (IsHolding())
            {
                StopHolding();
            }
        }
예제 #5
0
        public void Shoot()
        {
            long CurrentShot = Program.GetCurrentTimeMillis();

            if (CurrentShot - LastShot > SHOT_DELAY)
            {
                LastShot = CurrentShot;

                Sound.Shoot.Play();

                int[]  Spo = GetBulletStartPositionOffsets();
                Bullet B   = new Bullet(X + Spo[0], Y + Spo[1], Id, Direction, false, true);
                GameLevel.AddBullet(B);

                GameLevel.AddParticle(new BarrelFlame(X, Y, Direction, true));
            }
        }
예제 #6
0
        public void Shoot(bool justShoot = false)
        {
            long CurrentShot = Program.GetCurrentTimeMillis();

            if ((GameGuiScreen.IsPlaying() && !IsHolding() && !BindingMaster && !Shooting && CurrentShot - LastShot > SHOT_DELAY && Ammunition > 0) || justShoot)
            {
                if (IsMe(Id))
                {
                    ++GameComponent.Gs.IntStatsShots;
                }

                LastShot = CurrentShot;
                Shooting = true;
                --Ammunition;

                Sound.Shoot.Play();

                int[]  Spo = GetBulletStartPositionOffsets();
                Bullet B   = new Bullet(X + Spo[0], Y + Spo[1], Id, Direction, Bonus.IsAPBulletsA());
                GameLevel.AddBullet(B);

                GameLevel.AddParticle(new BarrelFlame(X, Y, Direction, false));
            }
        }
예제 #7
0
 public override void Die()
 {
     GameLevel.AddParticle(new TurretDebris(X, Y, Direction));
 }
예제 #8
0
 public override void Die()
 {
     GameLevel.AddParticle(new WallDebris(X, Y));
 }