diff --git a/src/com/projectkorra/ProjectKorra/BendingManager.java b/src/com/projectkorra/ProjectKorra/BendingManager.java index 28a98458..24627fb7 100644 --- a/src/com/projectkorra/ProjectKorra/BendingManager.java +++ b/src/com/projectkorra/ProjectKorra/BendingManager.java @@ -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); diff --git a/src/com/projectkorra/ProjectKorra/ConfigManager.java b/src/com/projectkorra/ProjectKorra/ConfigManager.java index 9586f5f4..989db008 100644 --- a/src/com/projectkorra/ProjectKorra/ConfigManager.java +++ b/src/com/projectkorra/ProjectKorra/ConfigManager.java @@ -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); diff --git a/src/com/projectkorra/ProjectKorra/Methods.java b/src/com/projectkorra/ProjectKorra/Methods.java index 05f311f7..c3a4c3e5 100644 --- a/src/com/projectkorra/ProjectKorra/Methods.java +++ b/src/com/projectkorra/ProjectKorra/Methods.java @@ -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 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; } diff --git a/src/config.yml b/src/config.yml index 78345a43..7d32b2cc 100644 --- a/src/config.yml +++ b/src/config.yml @@ -36,6 +36,7 @@ Properties: Water: CanBendWithWeapons: false NightFactor: 1.5 + FullMoonFactor: 3.0 Earth: RevertEarthbending: true SafeRevert: true