Fixed silly mistake I made

This commit is contained in:
CoderTim 2014-08-06 23:55:55 -04:00
parent f7f9d3e703
commit 8a74b08b0d

View File

@ -161,31 +161,37 @@ public class PowerUpManager implements Listener
event.setCancelled(true);
powerUp.remove();
int count = getPowerUpCount(event.getPlayer());
int count = incrementPowerUpCount(event.getPlayer());
PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom());
if (count == 5)
if (count <= 4)
{
PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom());
powerUp.remove();
UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players"));
if (PowerUpType.SMOKE_BOMB.powerUpPlayer(event.getPlayer(), getRandom()))
UtilPlayer.message(event.getPlayer(), F.main("Power-Up", "+1 " + F.item("Smoke Bomb")));
getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin")));
if (count == 4)
{
PowerUpType.COMPASS.powerUpPlayer(event.getPlayer(), getRandom());
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f);
}
else if (count < 5)
{
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players"));
UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!"));
getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin")));
getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + "."));
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f);
}
else
{
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!"));
getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + "."));
}
incrementPowerUpCount(event.getPlayer());
}
schedulePowerUpSpawn(10);