Waterbenders are more powerful during full moon

This commit is contained in:
MistPhizzle 2014-07-20 16:27:40 -04:00
parent 1c16d7a00f
commit dfcbfb7132
4 changed files with 24 additions and 3 deletions

View file

@ -74,6 +74,7 @@ public class BendingManager implements Runnable {
static final String defaultsunrisemessage = "You feel the strength of the rising sun empowering your firebending.";
static final String defaultsunsetmessage = "You feel the empowering of your firebending subside as the sun sets.";
static final String defaultmoonrisemessage = "You feel the strength of the rising moon empowering your waterbending.";
static final String defaultfullmoonrisemessage = "A full moon is rising, empowering your waterbending like never before.";
static final String defaultmoonsetmessage = "You feel the empowering of your waterbending subside as the moon sets.";
public BendingManager(ProjectKorra plugin) {
@ -244,7 +245,11 @@ public class BendingManager implements Runnable {
if (Methods.isNight(world) && !night) {
for (Player player: world.getPlayers()) {
if (Methods.isBender(player.getName(), Element.Water) && player.hasPermission("bending.message.nightmessage")) {
player.sendMessage(ChatColor.AQUA + defaultmoonrisemessage);
if (Methods.isFullMoon(world)) {
player.sendMessage(ChatColor.AQUA + defaultfullmoonrisemessage);
} else {
player.sendMessage(ChatColor.AQUA + defaultmoonrisemessage);
}
}
}
nights.replace(world, true);

View file

@ -66,6 +66,7 @@ public class ConfigManager {
plugin.getConfig().addDefault("Properties.Water.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Properties.Water.NightFactor", 1.5);
config.addDefault("Properties.Water.FullMoonFactor", 3.0);
config.addDefault("Properties.Earth.RevertEarthbending", true);
config.addDefault("Properties.Earth.SafeRevert", true);

View file

@ -196,6 +196,15 @@ public class Methods {
}
}
public static boolean isFullMoon(World world) {
long days = world.getFullTime() / 24000;
long phase = days%8;
if (phase == 0) {
return true;
}
return false;
}
public static void saveBendingPlayer(String player) {
BendingPlayer bPlayer = BendingPlayer.players.get(player);
if (bPlayer == null) return;
@ -296,7 +305,7 @@ public class Methods {
}
}
}
public static void stopBending() {
List<AbilityModule> abilities = AbilityModuleManager.ability;
for (AbilityModule ab: abilities) {
@ -1089,12 +1098,17 @@ public class Methods {
public static double waterbendingNightAugment(double value, World world) {
if (isNight(world)) {
return plugin.getConfig().getDouble("Properties.Water.NightFactor") * value;
if (isFullMoon(world)) {
return plugin.getConfig().getDouble("Properties.Water.FullMoonFactor") * value;
} else {
return plugin.getConfig().getDouble("Properties.Water.NightFactor") * value;
}
}
return value;
}
public static double getWaterbendingNightAugment(World world) {
if (isNight(world) && isFullMoon(world)) return plugin.getConfig().getDouble("Properties.Water.FullMoonFactor");
if (isNight(world)) return plugin.getConfig().getDouble("Properties.Water.NightFactor");
return 1;
}

View file

@ -36,6 +36,7 @@ Properties:
Water:
CanBendWithWeapons: false
NightFactor: 1.5
FullMoonFactor: 3.0
Earth:
RevertEarthbending: true
SafeRevert: true