public bool CallAirstrike(TPlayer player) { int angle = 0; PlayerTeam team = player.Team; if (IsHacking(player.Team)) { team = GetEnemyTeam(player.Team); GlobalGame.RunCommand("MSG AIRSTRIKE HAS BEEN HACKED"); } Vector2 target = GetRandomAirEnemy(team, 2, 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"); } Vector2 position = GetBeginPointTarget(target, angle); TargetPosition = target; BeginPosition = position; return(true); }
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); }
public void Use(TPlayer player) { if (Reloading > 0 || FastReloading > 0 || CurrentAmmo <= 0) { return; } switch (Id) { case 1: { if (RevivePlayer(player)) { } else if (StopBleedingSelf(player)) { } else if (StopBleedingNear(player)) { } else { return; } MinusAmmo(); break; } case 2: { if (RevivePlayer(player)) { } else if (StopBleedingSelf(player)) { } else if (StopBleedingNear(player)) { } else { return; } Reloading = 5; MinusAmmo(); break; } case 3: { if (!IsJamming(player.Team)) { CallAirDrop(player); MinusAmmo(); } break; } case 4: { if (!ReloadUse && !IsActive) { if (!IsJamming(player.Team)) { ReloadUse = true; Reloading = 3; GlobalGame.RunCommand("MSG NAPALM STRIKE IS COMING"); } } else { if (!IsHacking(player.Team)) { IsActive = true; } else { MinusAmmo(); GlobalGame.RunCommand("MSG NAPALM STRIKE HAS BEED HACKED"); } } break; } case 5: { if (!ReloadUse) { if (CheckAirPlayer(player, 1) && !IsJamming(player.Team)) { ReloadUse = true; Reloading = 3; if (player.Team == PlayerTeam.Team1) { GlobalGame.RunCommand("MSG BLUE TEAM CALLED PINPOINT STRIKE"); } else { GlobalGame.RunCommand("MSG RED TEAM CALLED PINPOINT STRIKE"); } } } else { if (!CallPinpointStrike(player)) { GlobalGame.RunCommand("MSG PINPOINT STRIKE: TARGET LOST"); ReloadUse = false; Reloading = 5; } else { MinusAmmo(); } } break; } case 6: { if (!IsActive) { if (!ReloadUse) { if (CheckAirPlayer(player, 2) && !IsJamming(player.Team)) { ReloadUse = true; Reloading = 3; if (player.Team == PlayerTeam.Team1) { GlobalGame.RunCommand("MSG BLUE TEAM CALLED AIRSTRIKE"); } else { GlobalGame.RunCommand("MSG RED TEAM CALLED AIRSTRIKE"); } } } else { if (CallAirstrike(player)) { IsActive = true; } else { GlobalGame.RunCommand("MSG AIRSTRIKE: TARGET LOST"); ReloadUse = false; Reloading = 5; } } } break; } case 7: { if (!IsJamming(player.Team)) { CallAirDrop(player, 3); MinusAmmo(); } break; } case 8: { if (!ReloadUse && !IsActive) { if (!IsJamming(player.Team)) { ReloadUse = true; Reloading = 3; GlobalGame.RunCommand("MSG ARTILLERY STRIKE IS COMING"); } } else { if (!IsHacking(player.Team)) { IsActive = true; } else { MinusAmmo(); GlobalGame.RunCommand("MSG ARTILLERY STRIKE HAS BEED HACKED"); } } break; } case 9: { if (!ReloadUse && !IsActive) { if (!IsJamming(player.Team)) { ReloadUse = true; Reloading = 3; GlobalGame.RunCommand("MSG MINE STRIKE IS COMING"); } } else { if (!IsHacking(player.Team)) { IsActive = true; } else { MinusAmmo(); GlobalGame.RunCommand("MSG MINE STRIKE HAS BEED HACKED"); } } break; } case 10: { if (!IsJamming(player.Team)) { CallReinforcement(player); SetId(0); if (player.Team == PlayerTeam.Team1) { GlobalGame.RunCommand("MSG BLUE TEAM CALLED REINFORCEMENT"); } else { GlobalGame.RunCommand("MSG RED TEAM CALLED REINFORCEMENT"); } } break; } case 11: { TeamJamming[(int)player.Team - 1] += 10; MinusAmmo(); if (player.Team == PlayerTeam.Team1) { GlobalGame.RunCommand("MSG BLUE TEAM ENABLE SUPPLY JAMMER"); } else { GlobalGame.RunCommand("MSG RED TEAM ENABLE SUPPLY JAMMER"); } break; } case 12: { TeamHacking[(int)player.Team - 1] += 10; MinusAmmo(); if (player.Team == PlayerTeam.Team1) { GlobalGame.RunCommand("MSG BLUE TEAM ENABLE SUPPLY HACKING"); } else { GlobalGame.RunCommand("MSG RED TEAM ENABLE SUPPLY HACKING"); } break; } case 13: { MinusAmmo(); PlaceTurret(player, 0); break; } case 14: { MinusAmmo(); PlaceTurret(player, 1); break; } case 15: { MinusAmmo(); PlaceTurret(player, 2); break; } case 16: { MinusAmmo(); PlaceTurret(player, 3); break; } case 18: { if (!ReloadUse) { if (player.IsAdrenaline) { MinusAmmo(); } else { ReloadUse = true; Reloading = 5; ForceShowReloading = true; player.IsAdrenaline = true; player.AdrenalineDamageFactor = 0.2f; player.DamageDelaySpeed = 1; GlobalGame.PlaySound("GetHealthSmall", player.Position, 1); } } else { player.IsAdrenaline = false; MinusAmmo(); } break; } case 19: { MinusAmmo(); PlaceShieldGenerator(player); break; } case 21: { MinusAmmo(); SpawnStreetsweeper(player); break; } case 22: { MinusAmmo(); SpawnDrone(player, 7); break; } case 23: { MinusAmmo(); SpawnDrone(player, 6); break; } case 24: { MinusAmmo(); SpawnDrone(player, 5); break; } case 25: { MinusAmmo(); SpawnDrone(player, 4); break; } } }