Kraken sounds can now be set to either player-only or global (default).

This commit is contained in:
GJ
2013-05-03 07:48:50 -04:00
parent 499713c8e7
commit 09abab1b5d
4 changed files with 18 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import com.gmail.nossr50.util.Misc;
public class KrakenAttackTask extends BukkitRunnable {
private Squid kraken;
private Player player;
private final boolean GLOBAL_SOUNDS = AdvancedConfig.getInstance().getKrakenGlobalSoundsEnabled();
public KrakenAttackTask(Squid kraken, Player player) {
this.kraken = kraken;
@ -31,6 +32,14 @@ public class KrakenAttackTask extends BukkitRunnable {
kraken.teleport(player);
player.damage(AdvancedConfig.getInstance().getKrakenAttackDamage(), kraken);
if (GLOBAL_SOUNDS) {
world.playSound(location, Sound.GHAST_SCREAM, Misc.GHAST_VOLUME, Misc.getGhastPitch());
}
else {
player.playSound(location, Sound.GHAST_SCREAM, Misc.GHAST_VOLUME, Misc.getGhastPitch());
}
world.playSound(location, Sound.GHAST_SCREAM, Misc.GHAST_VOLUME, Misc.getGhastPitch());
world.strikeLightningEffect(location);
}