Firebending Sounds

Most Firebending abilities will now have a sound, FireBurst sounds
ridiculous at the moment.
This commit is contained in:
MistPhizzle 2014-09-27 20:48:14 -04:00
parent 35ea5bf194
commit 544b567e92
5 changed files with 23 additions and 1 deletions

View file

@ -18,6 +18,7 @@ import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -128,6 +129,8 @@ public class Methods {
static ProjectKorra plugin; static ProjectKorra plugin;
public static Random rand = new Random();
private static final ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE); private static final ItemStack pickaxe = new ItemStack(Material.DIAMOND_PICKAXE);
public static ConcurrentHashMap<Block, Information> movedearth = new ConcurrentHashMap<Block, Information>(); public static ConcurrentHashMap<Block, Information> movedearth = new ConcurrentHashMap<Block, Information>();
@ -1972,6 +1975,10 @@ public class Methods {
loc.getWorld().playEffect(loc, Effect.MOBSPAWNER_FLAMES, 0, 15); loc.getWorld().playEffect(loc, Effect.MOBSPAWNER_FLAMES, 0, 15);
} }
public static void playFirebendingSound(Location loc) {
loc.getWorld().playSound(loc, Sound.FIRE, 1, 10);
}
public static void playMetalbendingSound(Location loc) { public static void playMetalbendingSound(Location loc) {
loc.getWorld().playSound(loc, Sound.IRONGOLEM_HIT, 1, 10); loc.getWorld().playSound(loc, Sound.IRONGOLEM_HIT, 1, 10);
} }

View file

@ -159,6 +159,9 @@ public class Combustion {
private void advanceLocation() { private void advanceLocation() {
ParticleEffect.FIREWORKS_SPARK.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 5); ParticleEffect.FIREWORKS_SPARK.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 5);
ParticleEffect.FLAME.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 2); ParticleEffect.FLAME.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 2);
if (Methods.rand.nextInt(4) == 0) {
Methods.playFirebendingSound(location);
}
location = location.add(direction.clone().multiply(speedfactor)); location = location.add(direction.clone().multiply(speedfactor));
} }

View file

@ -2,6 +2,7 @@ package com.projectkorra.ProjectKorra.firebending;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Effect; import org.bukkit.Effect;
@ -24,6 +25,8 @@ import com.projectkorra.ProjectKorra.waterbending.WaterManipulation;
public class FireBlast { public class FireBlast {
Random rand = new Random();
public static ConcurrentHashMap<Integer, FireBlast> instances = new ConcurrentHashMap<Integer, FireBlast>(); public static ConcurrentHashMap<Integer, FireBlast> instances = new ConcurrentHashMap<Integer, FireBlast>();
private static double speed = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Speed"); private static double speed = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Speed");
private static double pushfactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Push"); private static double pushfactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Push");
@ -164,7 +167,9 @@ public class FireBlast {
private void advanceLocation() { private void advanceLocation() {
location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 0, (int) range); location.getWorld().playEffect(location, Effect.MOBSPAWNER_FLAMES, 0, (int) range);
location = location.add(direction.clone().multiply(speedfactor)); location = location.add(direction.clone().multiply(speedfactor));
if (rand.nextInt(4) == 0) {
Methods.playFirebendingSound(location);
}
} }
private void ignite(Location location) { private void ignite(Location location) {

View file

@ -73,6 +73,9 @@ public class FireJet {
// player.setAllowFlight(canfly); // player.setAllowFlight(canfly);
instances.remove(player); instances.remove(player);
} else { } else {
if (Methods.rand.nextInt(2) == 0) {
Methods.playFirebendingSound(player.getLocation());
}
player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 1);
double timefactor; double timefactor;
if (AvatarState.isAvatarState(player) && isToggle) { if (AvatarState.isAvatarState(player) && isToggle) {

View file

@ -164,6 +164,10 @@ public class Fireball {
private void fireball() { private void fireball() {
for (Block block : Methods.getBlocksAroundPoint(location, radius)) { for (Block block : Methods.getBlocksAroundPoint(location, radius)) {
block.getWorld().playEffect(block.getLocation(), Effect.MOBSPAWNER_FLAMES, 0, 20); block.getWorld().playEffect(block.getLocation(), Effect.MOBSPAWNER_FLAMES, 0, 20);
if (Methods.rand.nextInt(4) == 0) {
Methods.playFirebendingSound(location);
}
} }
for (Entity entity : Methods.getEntitiesAroundPoint(location, 2 * radius)) { for (Entity entity : Methods.getEntitiesAroundPoint(location, 2 * radius)) {