mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Waterbenders are more powerful during full moon
This commit is contained in:
parent
1c16d7a00f
commit
dfcbfb7132
|
@ -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 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 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 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.";
|
static final String defaultmoonsetmessage = "You feel the empowering of your waterbending subside as the moon sets.";
|
||||||
|
|
||||||
public BendingManager(ProjectKorra plugin) {
|
public BendingManager(ProjectKorra plugin) {
|
||||||
|
@ -244,7 +245,11 @@ public class BendingManager implements Runnable {
|
||||||
if (Methods.isNight(world) && !night) {
|
if (Methods.isNight(world) && !night) {
|
||||||
for (Player player: world.getPlayers()) {
|
for (Player player: world.getPlayers()) {
|
||||||
if (Methods.isBender(player.getName(), Element.Water) && player.hasPermission("bending.message.nightmessage")) {
|
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);
|
nights.replace(world, true);
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class ConfigManager {
|
||||||
|
|
||||||
plugin.getConfig().addDefault("Properties.Water.CanBendWithWeapons", true);
|
plugin.getConfig().addDefault("Properties.Water.CanBendWithWeapons", true);
|
||||||
plugin.getConfig().addDefault("Properties.Water.NightFactor", 1.5);
|
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.RevertEarthbending", true);
|
||||||
config.addDefault("Properties.Earth.SafeRevert", 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) {
|
public static void saveBendingPlayer(String player) {
|
||||||
BendingPlayer bPlayer = BendingPlayer.players.get(player);
|
BendingPlayer bPlayer = BendingPlayer.players.get(player);
|
||||||
if (bPlayer == null) return;
|
if (bPlayer == null) return;
|
||||||
|
@ -296,7 +305,7 @@ public class Methods {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void stopBending() {
|
public static void stopBending() {
|
||||||
List<AbilityModule> abilities = AbilityModuleManager.ability;
|
List<AbilityModule> abilities = AbilityModuleManager.ability;
|
||||||
for (AbilityModule ab: abilities) {
|
for (AbilityModule ab: abilities) {
|
||||||
|
@ -1089,12 +1098,17 @@ public class Methods {
|
||||||
|
|
||||||
public static double waterbendingNightAugment(double value, World world) {
|
public static double waterbendingNightAugment(double value, World world) {
|
||||||
if (isNight(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;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getWaterbendingNightAugment(World world) {
|
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");
|
if (isNight(world)) return plugin.getConfig().getDouble("Properties.Water.NightFactor");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ Properties:
|
||||||
Water:
|
Water:
|
||||||
CanBendWithWeapons: false
|
CanBendWithWeapons: false
|
||||||
NightFactor: 1.5
|
NightFactor: 1.5
|
||||||
|
FullMoonFactor: 3.0
|
||||||
Earth:
|
Earth:
|
||||||
RevertEarthbending: true
|
RevertEarthbending: true
|
||||||
SafeRevert: true
|
SafeRevert: true
|
||||||
|
|
Loading…
Reference in a new issue