mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Waterbenders are more powerful during full moon
This commit is contained in:
parent
1c16d7a00f
commit
dfcbfb7132
4 changed files with 24 additions and 3 deletions
|
@ -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,9 +245,13 @@ 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")) {
|
||||
if (Methods.isFullMoon(world)) {
|
||||
player.sendMessage(ChatColor.AQUA + defaultfullmoonrisemessage);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.AQUA + defaultmoonrisemessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
nights.replace(world, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
@ -1089,12 +1098,17 @@ public class Methods {
|
|||
|
||||
public static double waterbendingNightAugment(double value, World world) {
|
||||
if (isNight(world)) {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ Properties:
|
|||
Water:
|
||||
CanBendWithWeapons: false
|
||||
NightFactor: 1.5
|
||||
FullMoonFactor: 3.0
|
||||
Earth:
|
||||
RevertEarthbending: true
|
||||
SafeRevert: true
|
||||
|
|
Loading…
Reference in a new issue