/bending bind is prettier

Now displays the slot #
The color of the message matches the color of the element.
This commit is contained in:
MistPhizzle 2014-06-29 20:44:05 -04:00
parent 32c0646524
commit 3bd2e51b71
2 changed files with 36 additions and 2 deletions

View file

@ -151,7 +151,7 @@ public class Commands {
}
Methods.bindAbility((Player) s, ability);
s.sendMessage("Ability Bound.");
// s.sendMessage("Ability Bound to slot");
return true;
}
@ -190,7 +190,7 @@ public class Commands {
return true;
}
Methods.bindAbility((Player) s, ability, slot);
s.sendMessage("Ability Bound");
// s.sendMessage("Ability Bound");
return true;
}
}

View file

@ -204,11 +204,45 @@ public class Methods {
int slot = player.getInventory().getHeldItemSlot() + 1;
BendingPlayer bPlayer = getBendingPlayer(player.getName());
bPlayer.abilities.put(slot, ability);
if (isAirAbility(ability)) {
player.sendMessage(getAirColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isWaterAbility(ability)) {
player.sendMessage(getWaterColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isEarthAbility(ability)) {
player.sendMessage(getEarthColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isFireAbility(ability)) {
player.sendMessage(getFireColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isChiAbility(ability)) {
player.sendMessage(getChiColor() + "Succesfully bound " + ability + " to slot " + slot);
} else {
player.sendMessage(getAvatarColor() + "Successfully bound " + ability + " to slot " + slot);
}
}
public static void bindAbility(Player player, String ability, int slot) {
BendingPlayer bPlayer = getBendingPlayer(player.getName());
bPlayer.abilities.put(slot, ability);
if (isAirAbility(ability)) {
player.sendMessage(getAirColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isWaterAbility(ability)) {
player.sendMessage(getWaterColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isEarthAbility(ability)) {
player.sendMessage(getEarthColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isFireAbility(ability)) {
player.sendMessage(getFireColor() + "Succesfully bound " + ability + " to slot " + slot);
}
else if (isChiAbility(ability)) {
player.sendMessage(getChiColor() + "Succesfully bound " + ability + " to slot " + slot);
} else {
player.sendMessage(getAvatarColor() + "Successfully bound " + ability + " to slot " + slot);
}
}
public static boolean abilityExists(String string) {
if (getAbility(string) == null) return false;