Exemple #1
0
            public void ContinueArtilleryStrike()
            {
                Stage++;
                int continuing = 100;
                int bulletPer  = 10;

                if (Stage % bulletPer == 0)
                {
                    Area    area   = GlobalGame.GetCameraArea();
                    Vector2 newPos = new Vector2(GlobalRandom.Next((int)area.Left, (int)area.Right), WorldTop);
                    GlobalGame.SpawnProjectile(ProjectileItem.GRENADE_LAUNCHER, newPos, new Vector2(0, -1));
                }
                if (Stage >= continuing)
                {
                    MinusAmmo();
                }
            }
Exemple #2
0
            public bool CallPinpointStrike(TPlayer player)
            {
                int        angle = 0;
                PlayerTeam team  = player.Team;

                if (IsHacking(player.Team))
                {
                    team = GetEnemyTeam(player.Team);
                    GlobalGame.RunCommand("MSG PINPOINT STRIKE HAS BEEN HACKED");
                }
                Vector2 target = GetRandomAirEnemy(team, 1, ref angle);

                if (target.X == 0 && target.Y == 0)
                {
                    if (IsHacking(player.Team))
                    {
                        target = GetRandomWorldPoint();
                    }
                    else
                    {
                        return(false);
                    }
                }
                if (IsJamming(player.Team))
                {
                    target.X += GlobalRandom.Next(-99, 100);
                    GlobalGame.RunCommand("MSG PINPOINT STRIKE HAS BEEN JAMMED");
                }
                else
                {
                    target.X += GlobalRandom.Next(-12, 13);
                }
                Vector2 position = GetBeginPointTarget(target, angle);

                GlobalGame.SpawnProjectile(ProjectileItem.BAZOOKA, position, (target - position));
                GlobalGame.PlaySound("Explosion", position, 1);
                return(true);
            }
Exemple #3
0
            public void ContinueAirstrike()
            {
                Stage++;
                int continuing = 100;
                int bulletPer  = 5;
                int rocketPer  = 50;

                if (Stage % bulletPer == 0)
                {
                    Vector2 newPos = TargetPosition;
                    newPos.X += GlobalRandom.Next(-16, 17);
                    GlobalGame.SpawnProjectile(ProjectileItem.SNIPER, BeginPosition, (newPos - BeginPosition));
                }
                if (Stage % rocketPer == 0)
                {
                    Vector2 newPos = TargetPosition;
                    newPos.X += GlobalRandom.Next(-16, 17);
                    GlobalGame.SpawnProjectile(ProjectileItem.BAZOOKA, BeginPosition, (newPos - BeginPosition));
                }
                if (Stage >= continuing)
                {
                    MinusAmmo();
                }
            }
Exemple #4
0
            public void CreateProjectile(TTurretWeapon weapon)
            {
                float   angle = MainBlock.GetAngle() + MainBlockAngle + GlobalRandom.Next(-weapon.Scatter, weapon.Scatter + 1) / 180.0f * (float)Math.PI;
                Vector2 pos   = MainMotor.GetWorldPosition();
                Vector2 dir   = new Vector2((float)Math.Cos(angle) * 10, (float)Math.Sin(angle) * 10);

                if (weapon.BulletType >= 0)
                {
                    GlobalGame.SpawnProjectile((ProjectileItem)weapon.BulletType, pos + dir, dir);
                }
                else if (weapon.BulletType == -1)
                {
                    GlobalGame.SpawnFireNode(pos + dir, dir * 2, FireNodeType.Flamethrower);
                }
                else if (weapon.BulletType == -2)
                {
                    ElectricExplosion(MainMotor.GetWorldPosition(), 20, 50);
                }
                else if (weapon.BulletType == -3)
                {
                    ForceImpulse(MainMotor.GetWorldPosition(), 10, 50);
                }
                GlobalGame.PlaySound(weapon.Sound, MainMotor.GetWorldPosition(), 1.0f);
            }