From d738229294b353dd58515a7092f89fa6810ebdcf Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:21:07 -0600 Subject: [PATCH 01/34] Punishes players who are not participating in the siege with war sickness --- .../goosius/siegewar/SiegeController.java | 11 ++ .../listeners/SiegeWarTownyEventListener.java | 1 + .../siegewar/settings/ConfigNodes.java | 31 +++- .../siegewar/settings/SiegeWarSettings.java | 8 + .../tasks/SiegeWarTimerTaskController.java | 7 + .../siegewar/utils/SiegeWarSicknessUtil.java | 141 ++++++++++++++++++ src/main/resources/english.yml | 4 + 7 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java diff --git a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java index 12e64ba38..4705de6fd 100644 --- a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java +++ b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java @@ -10,6 +10,7 @@ import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; +import com.gmail.goosius.siegewar.utils.SiegeWarDistanceUtil; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; @@ -294,5 +295,15 @@ public static Set getPlayersInBannerControlSessions() { } return result; } + + public static List getSiegesAt(Location location) { + List siegesAtLocation = new ArrayList<>(); + for (Siege siege : sieges.values()) { + if (SiegeWarDistanceUtil.isInSiegeZone(location, siege)) { + siegesAtLocation.add(siege); + } + } + return siegesAtLocation; + } } diff --git a/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java b/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java index 08d4ef8b3..7334c23aa 100644 --- a/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java +++ b/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java @@ -77,6 +77,7 @@ public void onShortTime(NewShortTimeEvent event) { SiegeWarTimerTaskController.evaluateBannerControl(); SiegeWarTimerTaskController.evaluateTacticalVisibility(); SiegeWarTimerTaskController.evaluateTimedSiegeOutcomes(); + SiegeWarTimerTaskController.punishNonSiegeParticipantsInSiegeZone(); SiegeHUDManager.updateHUDs(); } diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index b82224552..3bdb92fa6 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -602,7 +602,36 @@ public enum ConfigNodes { "true", "", "# If this value is true, then a town under occupation cannot unclaim.", - "# This setting is recommended, to avoid occupation escape exploits."); + "# This setting is recommended, to avoid occupation escape exploits."), + + PUNISH_NON_SIEGE_PARTICIPANTS_IN_SIEGE_ZONE( + "punish_non_siege_participants_in_siege_zone", + "", + "############################################################", + "# +------------------------------------------------------+ #", + "# | War Sickness | #", + "# +------------------------------------------------------+ #", + "############################################################", + ""), + + ENABLE_SICKNESS( + "punish_non_siege_participants_in_siege_zone.enable_sickness", + "true", + "# If true, players that are not participating in a siege will receive war sickness", + "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", + "# There are two types of war sickness, full and special.", + "# Special war sickness is only given if a non-participant is at his town that happened to be in a siege zone", + "# - Effects: Weakness V", + "# Full sickness is given to all players that are not allied to either side, do not have a military rank, or is peaceful, and are not in their own town.", + "# - Effects: Nausea V, Poison V, Weakness V, Slowness III, Mining Fatigue III" + ), + + SECONDS_BEFORE_SICKNESS( + "punish_non_siege_participants_in_siege_zone.seconds_warning", + "5", + "# This is how many seconds a player has to leave the siege zone before he gets war sickness", + "# If this is set to 0, no war will be given and non-participants will receive war sickness instantly, if enabled" + ); private final String Root; private final String Default; diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java b/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java index e2392b9ad..412d10ec0 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java @@ -342,4 +342,12 @@ public static boolean getWarCommonPeacefulTownsAllowedToTogglePVP() { return Settings.getBoolean(ConfigNodes.PEACEFUL_TOWNS_ALLOWED_TO_TOGGLE_PVP); } + public static boolean getPunishingNonSiegeParticipantsInSiegeZone() { + return Settings.getBoolean(ConfigNodes.ENABLE_SICKNESS); + } + + public static int getSicknessWarningTimeInTicks() { + return Settings.getInt(ConfigNodes.SECONDS_BEFORE_SICKNESS) * 20; + } + } diff --git a/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java b/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java index ba1193767..b810a2972 100644 --- a/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java +++ b/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java @@ -114,4 +114,11 @@ public static void punishPeacefulPlayersInActiveSiegeZones() { TownPeacefulnessUtil.punishPeacefulPlayersInActiveSiegeZones(); } } + + public static void punishNonSiegeParticipantsInSiegeZone() { + if (SiegeWarSettings.getPunishingNonSiegeParticipantsInSiegeZone()) { + SiegeWarSicknessUtil.punishNonSiegeParticipantsInSiegeZone(); + } + } + } diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java new file mode 100644 index 000000000..e27b1cfef --- /dev/null +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -0,0 +1,141 @@ +package com.gmail.goosius.siegewar.utils; + +import com.gmail.goosius.siegewar.SiegeController; +import com.gmail.goosius.siegewar.enums.SiegeWarPermissionNodes; +import com.gmail.goosius.siegewar.objects.Siege; +import com.gmail.goosius.siegewar.settings.SiegeWarSettings; +import com.gmail.goosius.siegewar.settings.Translation; +import com.palmergames.bukkit.towny.Towny; +import com.palmergames.bukkit.towny.TownyAPI; +import com.palmergames.bukkit.towny.TownySettings; +import com.palmergames.bukkit.towny.TownyUniverse; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Nation; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.util.BukkitTools; +import com.palmergames.util.TimeTools; +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.util.ArrayList; +import java.util.List; + +public class SiegeWarSicknessUtil { + + public static void punishNonSiegeParticipantsInSiegeZone() { + + for (Player player : BukkitTools.getOnlinePlayers()) { + Location location = player.getLocation(); + List sieges = SiegeController.getSiegesAt(location); + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + TownyUniverse universe = TownyUniverse.getInstance(); + + // not in a siege zone + if (sieges.isEmpty()) + continue; + + // Players immune to war nausea won't be punished for this + if (universe.getPermissionSource().testPermission(player, + SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + continue; + + boolean allowedInAnyOverlappingSiege = false; + try { + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; + } + } + + if (!allowedInAnyOverlappingSiege) { + if (isInOwnClaims(resident)) { + punishWithSpecialWarSickness(player); + } else { + punishWithFullWarSickness(player); + } + + } + } catch (NotRegisteredException ignored) {} + + } + + } + + public static void punishWithFullWarSickness(Player player) { + final int effectDurationTicks = (int)(TimeTools.convertToTicks(TownySettings.getShortInterval() + 5)); + if (SiegeWarSettings.getSicknessWarningTimeInTicks() / 20 >= 1) { + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_will_get_sickness", + SiegeWarSettings.getSicknessWarningTimeInTicks() / 20)); + } + Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { + public void run() { + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + }, SiegeWarSettings.getSicknessWarningTimeInTicks()); + } + + public static void punishWithSpecialWarSickness(Player player) { + final int effectDurationTicks = (int)(TimeTools.convertToTicks(TownySettings.getShortInterval() + 5)); + Towny.getPlugin().getServer().getScheduler().runTask(Towny.getPlugin(), new Runnable() { + public void run() { + player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + } + }); + } + + public static boolean isSiegeParticipant(Resident resident, Siege siege) throws NotRegisteredException { + + if (!resident.hasTown()) + return false; + + TownyUniverse universe = TownyUniverse.getInstance(); + Town defendingTown = siege.getDefendingTown(); + Town residentTown = resident.getTown(); + Nation attackingNation = siege.getAttackingNation(); + + if (residentTown == defendingTown && universe.getPermissionSource().testPermission(resident.getPlayer(), + SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { + // Player is defending their own town + return true; + } + + if (residentTown.hasNation() && + (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation()))) { + // Player is attacking + return true; + + } + + if (defendingTown.hasNation() + && (defendingTown.getNation() == residentTown.getNation() + || defendingTown.getNation().hasMutualAlly(residentTown.getNation()))) { + // Player is defending another town in the nation + return true; + } + + return false; + } + + private static boolean isInOwnClaims(Resident resident) throws NotRegisteredException { + Location location = resident.getPlayer().getLocation(); + if (!resident.hasTown()) + return false; + + if (TownyAPI.getInstance().isWilderness(location)) + return false; + + return TownyAPI.getInstance().getTownBlock(location).getTown().equals(resident.getTown()); + } + +} diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml index f72bd97df..ccb769401 100644 --- a/src/main/resources/english.yml +++ b/src/main/resources/english.yml @@ -226,3 +226,7 @@ msg_swa_resident_already_has_control: '&cResident %s already has control.' msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' msg_swa_set_captured_success: '&bSet captured to %s for %s.' + +#War sickness +msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' \ No newline at end of file From 3079bea6335be2ee7a06c02099a9a6c504a21704 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:39:40 -0600 Subject: [PATCH 02/34] Fixes players still getting sickness even after leaving in time --- .../siegewar/utils/SiegeWarSicknessUtil.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index e27b1cfef..45d7fa2a3 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -73,14 +73,29 @@ public static void punishWithFullWarSickness(Player player) { } Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { public void run() { - List potionEffects = new ArrayList<>(); - potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); - player.addPotionEffects(potionEffects); - player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + try { + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + List sieges = SiegeController.getSiegesAt(player.getLocation()); + boolean allowedInAnyOverlappingSiege = false; + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; + } + } + + if (!allowedInAnyOverlappingSiege && SiegeWarDistanceUtil.isLocationInActiveSiegeZone(player.getLocation())) { + // still in siege zone + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + } catch (NotRegisteredException ignored) {} } }, SiegeWarSettings.getSicknessWarningTimeInTicks()); } From 4b3f35db0772887eb989d7196dd8927926f931f5 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 05:30:45 -0600 Subject: [PATCH 03/34] Fixes small typo --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 3bdb92fa6..894ead014 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -630,7 +630,7 @@ public enum ConfigNodes { "punish_non_siege_participants_in_siege_zone.seconds_warning", "5", "# This is how many seconds a player has to leave the siege zone before he gets war sickness", - "# If this is set to 0, no war will be given and non-participants will receive war sickness instantly, if enabled" + "# If this is set to 0, no warn will be given and non-participants will receive war sickness instantly, if enabled" ); private final String Root; From f821488c1a6d4a59acd69a7f37fe24a11c76fceb Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:37:51 -0600 Subject: [PATCH 04/34] Flip checks around --- .../goosius/siegewar/utils/SiegeWarSicknessUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 45d7fa2a3..25a2aab8c 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -31,15 +31,16 @@ public static void punishNonSiegeParticipantsInSiegeZone() { Location location = player.getLocation(); List sieges = SiegeController.getSiegesAt(location); Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); - TownyUniverse universe = TownyUniverse.getInstance(); + + // Players immune to war nausea won't be punished + if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + continue; // not in a siege zone if (sieges.isEmpty()) continue; - // Players immune to war nausea won't be punished for this - if (universe.getPermissionSource().testPermission(player, - SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + if (resident == null) continue; boolean allowedInAnyOverlappingSiege = false; From d8ff436db4bf8989a9761fb14b00d5fb46ea3ad2 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:38:56 -0600 Subject: [PATCH 05/34] Add "" after default config values --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 894ead014..c92a0b70d 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -617,6 +617,7 @@ public enum ConfigNodes { ENABLE_SICKNESS( "punish_non_siege_participants_in_siege_zone.enable_sickness", "true", + "", "# If true, players that are not participating in a siege will receive war sickness", "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", "# There are two types of war sickness, full and special.", @@ -629,6 +630,7 @@ public enum ConfigNodes { SECONDS_BEFORE_SICKNESS( "punish_non_siege_participants_in_siege_zone.seconds_warning", "5", + "", "# This is how many seconds a player has to leave the siege zone before he gets war sickness", "# If this is set to 0, no warn will be given and non-participants will receive war sickness instantly, if enabled" ); From 7b2923b74abbb941975feb02ef399c969f4e1320 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:45:05 -0600 Subject: [PATCH 06/34] Moving sieges list so it is below the permission check --- .../gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 25a2aab8c..d6fc70460 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -29,17 +29,19 @@ public static void punishNonSiegeParticipantsInSiegeZone() { for (Player player : BukkitTools.getOnlinePlayers()) { Location location = player.getLocation(); - List sieges = SiegeController.getSiegesAt(location); - Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); // Players immune to war nausea won't be punished if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) continue; + List sieges = SiegeController.getSiegesAt(location); + // not in a siege zone if (sieges.isEmpty()) continue; + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + if (resident == null) continue; From 99b7de868b98ac79ba2f66ebd305b67846439469 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:21:07 -0600 Subject: [PATCH 07/34] Rebase --- .../goosius/siegewar/SiegeController.java | 11 ++ .../listeners/SiegeWarTownyEventListener.java | 1 + .../siegewar/settings/ConfigNodes.java | 31 +++- .../siegewar/settings/SiegeWarSettings.java | 8 + .../tasks/SiegeWarTimerTaskController.java | 7 + .../siegewar/utils/SiegeWarSicknessUtil.java | 141 ++++++++++++++++++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java diff --git a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java index c729c23df..d93e5adb3 100644 --- a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java +++ b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java @@ -10,6 +10,7 @@ import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; +import com.gmail.goosius.siegewar.utils.SiegeWarDistanceUtil; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; @@ -293,5 +294,15 @@ public static Set getPlayersInBannerControlSessions() { } return result; } + + public static List getSiegesAt(Location location) { + List siegesAtLocation = new ArrayList<>(); + for (Siege siege : sieges.values()) { + if (SiegeWarDistanceUtil.isInSiegeZone(location, siege)) { + siegesAtLocation.add(siege); + } + } + return siegesAtLocation; + } } diff --git a/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java b/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java index 08d4ef8b3..7334c23aa 100644 --- a/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java +++ b/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java @@ -77,6 +77,7 @@ public void onShortTime(NewShortTimeEvent event) { SiegeWarTimerTaskController.evaluateBannerControl(); SiegeWarTimerTaskController.evaluateTacticalVisibility(); SiegeWarTimerTaskController.evaluateTimedSiegeOutcomes(); + SiegeWarTimerTaskController.punishNonSiegeParticipantsInSiegeZone(); SiegeHUDManager.updateHUDs(); } diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 7a032f1e2..31a326880 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -603,7 +603,36 @@ public enum ConfigNodes { "true", "", "# If this value is true, then a town under occupation cannot unclaim.", - "# This setting is recommended, to avoid occupation escape exploits."); + "# This setting is recommended, to avoid occupation escape exploits."), + + PUNISH_NON_SIEGE_PARTICIPANTS_IN_SIEGE_ZONE( + "punish_non_siege_participants_in_siege_zone", + "", + "############################################################", + "# +------------------------------------------------------+ #", + "# | War Sickness | #", + "# +------------------------------------------------------+ #", + "############################################################", + ""), + + ENABLE_SICKNESS( + "punish_non_siege_participants_in_siege_zone.enable_sickness", + "true", + "# If true, players that are not participating in a siege will receive war sickness", + "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", + "# There are two types of war sickness, full and special.", + "# Special war sickness is only given if a non-participant is at his town that happened to be in a siege zone", + "# - Effects: Weakness V", + "# Full sickness is given to all players that are not allied to either side, do not have a military rank, or is peaceful, and are not in their own town.", + "# - Effects: Nausea V, Poison V, Weakness V, Slowness III, Mining Fatigue III" + ), + + SECONDS_BEFORE_SICKNESS( + "punish_non_siege_participants_in_siege_zone.seconds_warning", + "5", + "# This is how many seconds a player has to leave the siege zone before he gets war sickness", + "# If this is set to 0, no war will be given and non-participants will receive war sickness instantly, if enabled" + ); private final String Root; private final String Default; diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java b/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java index e2392b9ad..412d10ec0 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java @@ -342,4 +342,12 @@ public static boolean getWarCommonPeacefulTownsAllowedToTogglePVP() { return Settings.getBoolean(ConfigNodes.PEACEFUL_TOWNS_ALLOWED_TO_TOGGLE_PVP); } + public static boolean getPunishingNonSiegeParticipantsInSiegeZone() { + return Settings.getBoolean(ConfigNodes.ENABLE_SICKNESS); + } + + public static int getSicknessWarningTimeInTicks() { + return Settings.getInt(ConfigNodes.SECONDS_BEFORE_SICKNESS) * 20; + } + } diff --git a/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java b/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java index ba1193767..b810a2972 100644 --- a/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java +++ b/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java @@ -114,4 +114,11 @@ public static void punishPeacefulPlayersInActiveSiegeZones() { TownPeacefulnessUtil.punishPeacefulPlayersInActiveSiegeZones(); } } + + public static void punishNonSiegeParticipantsInSiegeZone() { + if (SiegeWarSettings.getPunishingNonSiegeParticipantsInSiegeZone()) { + SiegeWarSicknessUtil.punishNonSiegeParticipantsInSiegeZone(); + } + } + } diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java new file mode 100644 index 000000000..e27b1cfef --- /dev/null +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -0,0 +1,141 @@ +package com.gmail.goosius.siegewar.utils; + +import com.gmail.goosius.siegewar.SiegeController; +import com.gmail.goosius.siegewar.enums.SiegeWarPermissionNodes; +import com.gmail.goosius.siegewar.objects.Siege; +import com.gmail.goosius.siegewar.settings.SiegeWarSettings; +import com.gmail.goosius.siegewar.settings.Translation; +import com.palmergames.bukkit.towny.Towny; +import com.palmergames.bukkit.towny.TownyAPI; +import com.palmergames.bukkit.towny.TownySettings; +import com.palmergames.bukkit.towny.TownyUniverse; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Nation; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.util.BukkitTools; +import com.palmergames.util.TimeTools; +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.util.ArrayList; +import java.util.List; + +public class SiegeWarSicknessUtil { + + public static void punishNonSiegeParticipantsInSiegeZone() { + + for (Player player : BukkitTools.getOnlinePlayers()) { + Location location = player.getLocation(); + List sieges = SiegeController.getSiegesAt(location); + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + TownyUniverse universe = TownyUniverse.getInstance(); + + // not in a siege zone + if (sieges.isEmpty()) + continue; + + // Players immune to war nausea won't be punished for this + if (universe.getPermissionSource().testPermission(player, + SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + continue; + + boolean allowedInAnyOverlappingSiege = false; + try { + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; + } + } + + if (!allowedInAnyOverlappingSiege) { + if (isInOwnClaims(resident)) { + punishWithSpecialWarSickness(player); + } else { + punishWithFullWarSickness(player); + } + + } + } catch (NotRegisteredException ignored) {} + + } + + } + + public static void punishWithFullWarSickness(Player player) { + final int effectDurationTicks = (int)(TimeTools.convertToTicks(TownySettings.getShortInterval() + 5)); + if (SiegeWarSettings.getSicknessWarningTimeInTicks() / 20 >= 1) { + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_will_get_sickness", + SiegeWarSettings.getSicknessWarningTimeInTicks() / 20)); + } + Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { + public void run() { + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + }, SiegeWarSettings.getSicknessWarningTimeInTicks()); + } + + public static void punishWithSpecialWarSickness(Player player) { + final int effectDurationTicks = (int)(TimeTools.convertToTicks(TownySettings.getShortInterval() + 5)); + Towny.getPlugin().getServer().getScheduler().runTask(Towny.getPlugin(), new Runnable() { + public void run() { + player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + } + }); + } + + public static boolean isSiegeParticipant(Resident resident, Siege siege) throws NotRegisteredException { + + if (!resident.hasTown()) + return false; + + TownyUniverse universe = TownyUniverse.getInstance(); + Town defendingTown = siege.getDefendingTown(); + Town residentTown = resident.getTown(); + Nation attackingNation = siege.getAttackingNation(); + + if (residentTown == defendingTown && universe.getPermissionSource().testPermission(resident.getPlayer(), + SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { + // Player is defending their own town + return true; + } + + if (residentTown.hasNation() && + (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation()))) { + // Player is attacking + return true; + + } + + if (defendingTown.hasNation() + && (defendingTown.getNation() == residentTown.getNation() + || defendingTown.getNation().hasMutualAlly(residentTown.getNation()))) { + // Player is defending another town in the nation + return true; + } + + return false; + } + + private static boolean isInOwnClaims(Resident resident) throws NotRegisteredException { + Location location = resident.getPlayer().getLocation(); + if (!resident.hasTown()) + return false; + + if (TownyAPI.getInstance().isWilderness(location)) + return false; + + return TownyAPI.getInstance().getTownBlock(location).getTown().equals(resident.getTown()); + } + +} From 99602165e57f97093f74364c8cbb12122d3a1876 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:39:40 -0600 Subject: [PATCH 08/34] Fixes players still getting sickness even after leaving in time --- .../siegewar/utils/SiegeWarSicknessUtil.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index e27b1cfef..45d7fa2a3 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -73,14 +73,29 @@ public static void punishWithFullWarSickness(Player player) { } Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { public void run() { - List potionEffects = new ArrayList<>(); - potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); - player.addPotionEffects(potionEffects); - player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + try { + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + List sieges = SiegeController.getSiegesAt(player.getLocation()); + boolean allowedInAnyOverlappingSiege = false; + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; + } + } + + if (!allowedInAnyOverlappingSiege && SiegeWarDistanceUtil.isLocationInActiveSiegeZone(player.getLocation())) { + // still in siege zone + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + } catch (NotRegisteredException ignored) {} } }, SiegeWarSettings.getSicknessWarningTimeInTicks()); } From e9599d79d66b865b44b9667b7a9e16414e032cce Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 05:30:45 -0600 Subject: [PATCH 09/34] Fixes small typo --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 31a326880..b610634f8 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -631,7 +631,7 @@ public enum ConfigNodes { "punish_non_siege_participants_in_siege_zone.seconds_warning", "5", "# This is how many seconds a player has to leave the siege zone before he gets war sickness", - "# If this is set to 0, no war will be given and non-participants will receive war sickness instantly, if enabled" + "# If this is set to 0, no warn will be given and non-participants will receive war sickness instantly, if enabled" ); private final String Root; From 16ee4334999ab450fdcf5519195cd10e56fddf02 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:37:51 -0600 Subject: [PATCH 10/34] Flip checks around --- .../goosius/siegewar/utils/SiegeWarSicknessUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 45d7fa2a3..25a2aab8c 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -31,15 +31,16 @@ public static void punishNonSiegeParticipantsInSiegeZone() { Location location = player.getLocation(); List sieges = SiegeController.getSiegesAt(location); Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); - TownyUniverse universe = TownyUniverse.getInstance(); + + // Players immune to war nausea won't be punished + if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + continue; // not in a siege zone if (sieges.isEmpty()) continue; - // Players immune to war nausea won't be punished for this - if (universe.getPermissionSource().testPermission(player, - SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + if (resident == null) continue; boolean allowedInAnyOverlappingSiege = false; From 9ce395b526c41055de97227fa0c247aa67d1a245 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:38:56 -0600 Subject: [PATCH 11/34] Add "" after default config values --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index b610634f8..48cbfd7bc 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -618,6 +618,7 @@ public enum ConfigNodes { ENABLE_SICKNESS( "punish_non_siege_participants_in_siege_zone.enable_sickness", "true", + "", "# If true, players that are not participating in a siege will receive war sickness", "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", "# There are two types of war sickness, full and special.", @@ -630,6 +631,7 @@ public enum ConfigNodes { SECONDS_BEFORE_SICKNESS( "punish_non_siege_participants_in_siege_zone.seconds_warning", "5", + "", "# This is how many seconds a player has to leave the siege zone before he gets war sickness", "# If this is set to 0, no warn will be given and non-participants will receive war sickness instantly, if enabled" ); From d275014e0c7a7df6ecc0926e5e6119c9d5df8883 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:45:05 -0600 Subject: [PATCH 12/34] Moving sieges list so it is below the permission check --- .../gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 25a2aab8c..d6fc70460 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -29,17 +29,19 @@ public static void punishNonSiegeParticipantsInSiegeZone() { for (Player player : BukkitTools.getOnlinePlayers()) { Location location = player.getLocation(); - List sieges = SiegeController.getSiegesAt(location); - Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); // Players immune to war nausea won't be punished if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) continue; + List sieges = SiegeController.getSiegesAt(location); + // not in a siege zone if (sieges.isEmpty()) continue; + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + if (resident == null) continue; From c576ff101f61dc8b5fe0bf6e948912618de217e4 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 16:26:39 -0600 Subject: [PATCH 13/34] Merge branch 'master' of https://github.com/TownyAdvanced/SiegeWar into war_sickness --- src/main/resources/english.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml index ccb769401..a2b3d7976 100644 --- a/src/main/resources/english.yml +++ b/src/main/resources/english.yml @@ -227,6 +227,27 @@ msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' msg_swa_set_captured_success: '&bSet captured to %s for %s.' +siege_status_in_progress: 'In Progress' +siege_status_attacker_win: 'Attacker Win' +siege_status_defender_win: 'Defender Win' +siege_status_attacker_abandon: 'Attacker Abandon' +siege_status_defender_surrender: 'Defender Surrender' +siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' +siege_status_pending_defender_surrender: 'Pending Defender Surrender' +siege_status_unknown: 'Unknown' + +dynmap_siege_title: 'Siege: %s' +dynmap_siege_attacker: 'Attacker: %s' +dynmap_siege_defender: 'Defender: %s' +dynmap_siege_points: 'Points: %d' +dynmap_siege_banner_control: 'Banner Control: %s' +dynmap_siege_status: 'Status: %s' +dynmap_siege_status_in_progress: 'In Progress' +dynmap_siege_status_pending_surrender: 'Pending Surrender' +dynmap_siege_status_pending_abandon: 'Pending Abandon' +dynmap_siege_time_left: 'Time Left: %s' +dynmap_siege_war_chest: 'War Chest: %s' + #War sickness msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' -msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' \ No newline at end of file +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' From b5b416b18d8cec506935fb98604ddb9a80816079 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Fri, 15 Jan 2021 15:31:39 -0600 Subject: [PATCH 14/34] Sickness is now disabled by default --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 48cbfd7bc..bb147631d 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -617,7 +617,7 @@ public enum ConfigNodes { ENABLE_SICKNESS( "punish_non_siege_participants_in_siege_zone.enable_sickness", - "true", + "false", "", "# If true, players that are not participating in a siege will receive war sickness", "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", From 36a72675b56a73bbe2deed4c884bc9c0ec9282e4 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Sat, 16 Jan 2021 11:13:20 -0600 Subject: [PATCH 15/34] Renamed getSiegesAt to getActiveSiegesAt and added isActive check --- src/main/java/com/gmail/goosius/siegewar/SiegeController.java | 4 ++-- .../gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java index d93e5adb3..c42ee7361 100644 --- a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java +++ b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java @@ -295,10 +295,10 @@ public static Set getPlayersInBannerControlSessions() { return result; } - public static List getSiegesAt(Location location) { + public static List getActiveSiegesAt(Location location) { List siegesAtLocation = new ArrayList<>(); for (Siege siege : sieges.values()) { - if (SiegeWarDistanceUtil.isInSiegeZone(location, siege)) { + if (SiegeWarDistanceUtil.isInSiegeZone(location, siege) && siege.getStatus().isActive()) { siegesAtLocation.add(siege); } } diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index d6fc70460..1c6932bcb 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -34,7 +34,7 @@ public static void punishNonSiegeParticipantsInSiegeZone() { if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) continue; - List sieges = SiegeController.getSiegesAt(location); + List sieges = SiegeController.getActiveSiegesAt(location); // not in a siege zone if (sieges.isEmpty()) @@ -78,7 +78,7 @@ public static void punishWithFullWarSickness(Player player) { public void run() { try { Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); - List sieges = SiegeController.getSiegesAt(player.getLocation()); + List sieges = SiegeController.getActiveSiegesAt(player.getLocation()); boolean allowedInAnyOverlappingSiege = false; for (Siege siege : sieges) { if (isSiegeParticipant(resident, siege)) { From 99b1ed302bd316bdfdc5ac98b5532d5a11eb1c32 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Tue, 19 Jan 2021 21:56:35 -0600 Subject: [PATCH 16/34] Adds military rank check --- .../goosius/siegewar/utils/SiegeWarSicknessUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 1c6932bcb..74165e965 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -117,27 +117,27 @@ public static boolean isSiegeParticipant(Resident resident, Siege siege) throws if (!resident.hasTown()) return false; - TownyUniverse universe = TownyUniverse.getInstance(); Town defendingTown = siege.getDefendingTown(); Town residentTown = resident.getTown(); Nation attackingNation = siege.getAttackingNation(); - if (residentTown == defendingTown && universe.getPermissionSource().testPermission(resident.getPlayer(), - SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { + if (residentTown == defendingTown && resident.getPlayer() + .hasPermission(SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { // Player is defending their own town return true; } if (residentTown.hasNation() && - (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation()))) { + (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation())) + && resident.getPlayer().hasPermission(SiegeWarPermissionNodes.SIEGEWAR_NATION_SIEGE_POINTS.getNode())) { // Player is attacking return true; - } if (defendingTown.hasNation() && (defendingTown.getNation() == residentTown.getNation() - || defendingTown.getNation().hasMutualAlly(residentTown.getNation()))) { + || defendingTown.getNation().hasMutualAlly(residentTown.getNation())) + && resident.getPlayer().hasPermission(SiegeWarPermissionNodes.SIEGEWAR_NATION_SIEGE_POINTS.getNode())) { // Player is defending another town in the nation return true; } From 30c787324fbae40a0ee25f4ee02ead08116bc6b9 Mon Sep 17 00:00:00 2001 From: ceeedric <62527577+ceeedric@users.noreply.github.com> Date: Thu, 21 Jan 2021 15:10:15 -0600 Subject: [PATCH 17/34] attempt to fix english.yml --- src/main/resources/english.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml index e25434c4b..daa781533 100644 --- a/src/main/resources/english.yml +++ b/src/main/resources/english.yml @@ -248,12 +248,12 @@ dynmap_siege_status_pending_abandon: 'Pending Abandon' dynmap_siege_time_left: 'Time Left: %s' dynmap_siege_war_chest: 'War Chest: %s' -#War sickness -msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' -msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' - #Added in 0.06: msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' msg_swa_remove_siege_success: '&bSuccessfully removed siege.' msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' +#War sickness +msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' + From d7ee8c98100714c285995516ed4718081bdad275 Mon Sep 17 00:00:00 2001 From: ceeedric <62527577+ceeedric@users.noreply.github.com> Date: Thu, 21 Jan 2021 15:21:33 -0600 Subject: [PATCH 18/34] Delete english.yml --- src/main/resources/english.yml | 259 --------------------------------- 1 file changed, 259 deletions(-) delete mode 100644 src/main/resources/english.yml diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml deleted file mode 100644 index daa781533..000000000 --- a/src/main/resources/english.yml +++ /dev/null @@ -1,259 +0,0 @@ -name: SiegeWar -version: 0.06 -language: english -author: Goosius -website: 'http://townyadvanced.github.io/' -description: > - Language file for all game messages. Do not alter this file. - If you wish to change any of the entries, make a copy named something else. - Alternate language files can be enabled by altering the - [language] entry in config.yml -# -# -# You MUST retain spacing in the texts. -# If a text begins or ends with a space, it must remain that way. -# -# -# %s = data to be supplied by the plugin. - -# Text colouring -# -------------- -# Black = &0, Navy = &1, Green = &2, Blue = &3, Red = &4 -# Purple = &5, Gold = &6, LightGray = &7, Gray = &8 -# DarkPurple = &9, LightGreen = &a, LightBlue = &b -# Rose = &c, LightPurple = &d, Yellow = &e, White = &f - -plugin_prefix: '&f[&6SiegeWar&f] ' -msg_err_command_disable: '&cYou don''t have enough permissions for that command.' - -#Added in (Siegewar version) -#Siege war happy-path messages -msg_siege_war_revolt: '&bThe people of %s, led by %s, have revolted against %s, and declared themselves free to choose their own destiny!' -msg_siege_war_siege_started_neutral_town: '&bAn army belonging to %s has attacked %s. A siege has begun!' -msg_siege_war_siege_started_nation_town: '&bAn army belonging to %s has attacked %s at %s. A siege has begun!' -msg_siege_war_attack_pay_war_chest: '&bA war-chest has been prepared by %s, with a value of %s. Whoever wins the siege will get this money.' -msg_siege_war_attack_recover_war_chest: '&bThe war chest has been recovered by %s, with a value of %s.' -msg_siege_war_attacker_death: '&bSiege of %s > Attacker died > %s > Siege points -%d' -msg_siege_war_defender_death: '&bSiege of %s > Defender died > %s > Siege points +%d' -msg_siege_war_defender_win: '&bThe defenders of %s have successfully driven off all attacking armies. The siege has failed!' -msg_siege_war_attacker_win: '&bAn army belonging to %s has successfully breached the defences of %s. The siege is over!' -msg_siege_war_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. The defenders are victorious!' -msg_siege_war_pending_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. Defender victory will be confirmed in %s!' -msg_siege_war_town_surrender: '&b%s has surrendered to an army belonging to %s. The attackers are victorious!' -msg_siege_war_pending_town_surrender: '&b%s has surrendered to an army belonging to %s. Attacker victory will be confirmed in %s!' -msg_siege_war_neutral_town_captured: '&b%s has been captured by %s!' -msg_siege_war_nation_town_captured: '&b%s, previously belonging to %s, has been captured by %s!' -msg_siege_war_neutral_town_plundered: '&b%s has been plundered of %s by %s!' -msg_siege_war_nation_town_plundered: '&b%s has been plundered of %s by %s!' -msg_siege_war_town_ruined_from_plunder: '&b%s has been reduced to ruins by %s!' -msg_siege_war_town_bankrupted_from_plunder: '&b%s has been bankrupted by %s!' -msg_siege_war_nation_defeated: '&b%s has been defeated!.' -msg_siege_war_attacking_troops_at_siege_banner: '&bSiege on %s > Attackers are at the siege banner.' -msg_siege_war_defending_troops_at_siege_banner: '&bSiege on %s > Town defenders are at the siege banner.' -msg_siege_war_banner_control_session_started: '&bBanner control session started. Remain close to the siege-banner (%d blocks horizonally, %d blocks vertically), outside the town, and not flying, for %s. If your session succeeds, you will gain banner control for your side (or be added to the banner control list).' -msg_siege_war_banner_control_session_success: '&bBanner control session succeeded!. You have been added to the banner control list.' -msg_siege_war_banner_control_gained_by_attacker: '&bSiege on %s > The attackers have gained banner control.' -msg_siege_war_banner_control_gained_by_defender: '&bSiege on %s > The defenders have gained banner control.' -msg_siege_war_nation_refund_available: "A nation refund of %s is now available to you. It can be claimed using '/sw nation refund'" -msg_siege_war_nation_refund_claimed: "You have claimed the nation refund of %s." -msg_town_destroyed_by_nation_tax: '&b%s couldn''t pay taxes and has fallen.' -msg_town_destroyed_by_nation_tax_multiple: '&bThe following towns could not afford the nation tax and have fallen: ' - -#Siege war error message -#Town Toggling -msg_err_siege_besieged_town_cannot_toggle_pvp: "&cBesieged towns have PVP forced ON." -msg_err_siege_besieged_town_cannot_toggle_explosions: "&cBesieged towns have Explosions forced ON." -#Recruiting -msg_err_siege_besieged_town_cannot_toggle_open_off: "&cBesieged towns cannot open their doors to new residents." -msg_err_siege_besieged_town_cannot_recruit: "&cBesieged towns cannot recruit new residents." -#Claiming/Unclaiming -msg_err_siege_claim_too_near_siege_zone: "&cThe claim is too close to a siege." -msg_err_siege_besieged_town_cannot_claim: "&cBesieged towns cannot claim new land." -msg_err_siege_besieged_town_cannot_unclaim: "&cBesieged towns (or towns which recently lost a siege) cannot un-claim land." -msg_err_war_common_occupied_town_cannot_unclaim: "&cOccupied towns cannot un-claim land." -#Nation Delete -msg_err_siege_war_delete_nation_warning: "WARNING!!!: If you delete your nation you will be refunded %s. This can be claimed later by using '/sw nation refund'." -msg_err_siege_war_nation_refund_unavailable: "There is no nation refund available to you." -#Revolt -msg_err_siege_war_town_voluntary_leave_impossible: "&cTowns cannot leave nations without agreement. To leave your nation, persuade the king (or an assistant) to kick your town." -msg_err_siege_war_revolt_immunity_active: "&cYour town has revolt immunity. It cannot revolt until the revolt immunity expires." -#Attack -msg_err_siege_war_not_enabled_in_world: '&cWar is not enabled in this world.' -msg_err_siege_war_banner_must_be_placed_above_ground: '&cThe siege banner must be placed above ground.' -msg_err_siege_war_action_not_a_town_member: '&cYou must be a member of a town to do this action.' -msg_err_siege_war_action_not_a_nation_member: '&cYou must be a member of a nation to do this action.' -msg_err_siege_war_cannot_attack_own_town: '&cYou cannot attack your own town.' -msg_err_siege_war_cannot_attack_town_in_own_nation: '&cYou cannot attack a town in your own nation.' -msg_err_siege_war_cannot_attack_non_enemy_nation: '&cYou cannot attack a town unless the nation of that town is an enemy of your nation.' -msg_err_siege_war_too_many_adjacent_cardinal_town_blocks: '&cYou cannot perform this action because this chunk is facing more than one town block. Try placing the item in a different area.' -msg_err_siege_war_too_many_adjacent_towns: '&cYou cannot perform this action because there are multiple towns adjacent to this chunk. Try placing the item in a different area.' -msg_err_siege_war_nation_already_attacking_town: '&cYour nation is already attacking this town.' -msg_err_siege_war_cannot_attack_siege_immunity: '&cThe target town has siege immunity. It cannot be attacked until the siege immunity expires.' -msg_err_siege_war_cannot_place_banner_far_above_town: 'The siege banner cannot be placed on a much higher elevation than the town. Try placing the banner at a lower elevation' -msg_err_siege_war_cannot_join_siege: '&cYou cannot attack a town while it is under siege by another nation.' -msg_err_siege_war_nation_has_too_many_active_siege_attacks: '&cYour nation is at the maximum number of concurrent siege-attacks. To start another attack, one or more of the current attacks must finish.' -msg_err_siege_war_town_not_close_enough_to_nation: '&cThe town is too far away from your nation capital to be attacked.' -#Abandon -msg_err_siege_war_cannot_abandon_no_nearby_siege_attacks: '&cYou cannot abandon because there are no active siege banners nearby.' -msg_err_siege_war_cannot_abandon_nation_not_attacking_zone: '&cYou cannot abandon because your nation is not attacking in this area.' -msg_err_siege_war_cannot_abandon_siege_over: '&cYou cannot abandon because the siege is over.' -#Invade -msg_err_siege_war_cannot_invade_own_town: '&cYou cannot capture your own town.' -msg_err_siege_war_cannot_invade_without_victory: "&cYou cannot capture the town unless your nation is victorious in the siege." -msg_err_siege_war_no_siege_on_target_town: '&cThere is no siege on the target town of %s.' -msg_err_siege_war_town_already_invaded: '&cThis town has already been captured' -msg_err_siege_war_town_already_belongs_to_your_nation: '&cThis town already belongs to your nation' -#Plunder -msg_err_siege_war_cannot_plunder_own_town: '&cYou cannot plunder your own town.' -msg_err_siege_war_cannot_plunder_without_victory: "&cYou cannot plunder unless your nation is victorious in the siege." -msg_err_siege_war_cannot_plunder_without_economy: "&cYou cannot plunder because no economy plugin is active" -msg_err_siege_war_town_already_plundered: '&cThis town has already been plundered.' -#Surrender -msg_err_siege_war_cannot_surrender_not_your_town: '&cYou cannot surrender because this is not your town.' -msg_err_siege_war_cannot_surrender_siege_finished: '&cYou cannot surrender because the siege is over.' -#Block change -msg_err_siege_war_cannot_destroy_siege_banner: "&cWhile the siege is in progress you cannot destroy the siege banner or the block it is attached to." -msg_err_siege_war_nation_zone_this_area_protected_but_besieged: '&cThis part of the %s is under the protection of %s, and also cannot be altered while the nearby town is under siege.' -msg_err_siege_war_banner_support_block_not_stable: "&cYou cannot place the banner on unstable ground e.g. sand or gravel." -# Spawn -msg_err_siege_war_cannot_spawn_into_siegezone_or_besieged_town: '&cOnly town residents can spawn into a besieged town or siege zone (unless the target town is peaceful).' -#Banner control -msg_siege_war_banner_control_session_failure: '&cBanner control session failed!. Common causes for this include: Going into the town, too far from the banner, or flying.' -msg_war_siege_zone_milk_bucket_forbidden_while_attempting_banner_control: 'You cannot use this item while in a banner control session.' - -#Town Info Siege Section -status_town_revolt_immunity_timer: '&2Revolt Immunity Timer: &a%s' -status_town_siege_status: '&2Siege: &a%s' -status_town_siege_status_in_progress: 'In Progress' -status_town_siege_status_attacker_win: 'Attacker Victory - %s' -status_town_siege_status_defender_win: 'Town Victory' -status_town_siege_status_attacker_abandon: 'Attacker Retreat' -status_town_siege_status_defender_surrender: 'Town Surrender - to %s' -status_town_siege_status_pending_attacker_abandon: 'Attacker Retreat Pending, in %s' -status_town_siege_status_pending_defender_surrender: 'Town Surrender Pending, in %s' - -status_town_siege_status_besieger: '&2 > Besieger: &a%s {%s}' -status_town_siege_status_banner_xyz: '&2 > Banner XYZ: &a%d,%d,%d' -status_town_siege_immunity_timer: '&2 > Immunity Timer: &a%s' -status_town_siege_victory_timer: '&2 > Victory Timer: &a%s' -status_town_siege_invaded_plundered_status: '&2 > Town Captured: %s &2Town Plundered: %s' -status_town_banner_control: '&2 > Banner Control: %s &a[%s]&2: &f' -status_town_banner_control_nobody: '&2 > Banner Control: %s' - -#Nation Info Siege Section -status_nation_siege_attacks: '&2Siege Attacks &a[%s]&2: &f' -status_nation_siege_defences: '&2Siege Defences &a[%s]&2: &f' - -#General -msg_days: ' days' -status_no_green: '&aNO' -msg_occupier: '&4*Occupier*' -msg_nobody: '&aNobody' -msg_attackers: '&aAttackers' -msg_defenders: '&aDefenders' - -#Town Peacefulness -status_town_peacefulness_status_change_timer: '&2Countdown To Peacefulness Status Change: &a%d days' -msg_war_common_town_declared_peaceful: '&bPeacefulness Declared!. The town will be confirmed as peaceful in %d day(s).' -msg_war_common_town_declared_non_peaceful: '&bNon-Peacefulness Declared!. The town will be confirmed as non-peaceful in %d day(s).' -msg_war_common_town_peacefulness_countdown_cancelled: '&bThe peacefulness status change countdown was cancelled.' -msg_war_common_town_became_peaceful: '&b%s has been confirmed as Peaceful.' -msg_war_common_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful.' - -msg_war_siege_town_became_peaceful: '&b%s has been confirmed as Peaceful. The town is now immune to sieges and taxes. The town''s nation choice is now restricted to nations with a strong presence in the local area. (see user-guide for more details). Residents cannot enter siege-zones or gain nation-military ranks.' -msg_war_siege_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful. The town is no longer immune to sieges and taxes. The town''s nation choice is no longer restricted. Residents can enter siege-zones and gain nation-military ranks.' -msg_war_siege_cannot_add_nation_military_rank_to_peaceful_resident: '&cUnable to add military rank to resident, because they are in a peaceful town.' -msg_war_siege_peaceful_player_punished_for_being_in_siegezone: '&cWar-allergy active. To remove this effect, leave the siege-zone immediately.' -msg_war_siege_err_cannot_attack_peaceful_town: '&cYou cannot attack a peaceful town.' -msg_war_siege_peaceful_town_cannot_join_nation: 'c%s [PEACEFUL] cannot join %s, because the nation does not have a guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_zero: '&cYou cannot revolt at this time, because there are no guardian towns nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_one: '&cYou cannot revolt at this time, because there is only 1 guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_changed_nation: "&b%s has peacefully changed hands, moving from %s to %s." -msg_war_siege_peaceful_town_joined_nation: "&b%s has peacefully joined %s." -msg_war_siege_peaceful_town_left_nation: "&b%s has peacefully left %s." -msg_war_siege_warning_peaceful_town_should_not_create_nation: '&cYou are about to make a peaceful town into a nation capital. This is usually a bad idea, because the nation could fall without a fight.' -msg_war_siege_peaceful_towns_cannot_make_nations: '&cPeaceful towns cannot found nations!' - -#Siege immunities -msg_set_siege_immunities_town: 'Siege immunity for town %s set to %s hours.' -msg_set_siege_immunities_nation: 'Siege immunities for all towns in nation %s set to %s hours.' -msg_set_siege_immunities_all: 'Siege immunities for all towns set to %s hours.' - -#Battle sessions -msg_war_siege_battle_session_started: '&2Battle session started. You are free to enter any siege-zone for the next %s. After that you will get a %s rest from battle.' -msg_war_siege_battle_session_warning: '&cYour battle session will expire in %s. To avoid battle-fatigue, exit any siege zone you are in (and/or return to your own town).' -msg_war_siege_battle_session_expired: '&cBattle session expired. Battle-fatigue active. To remove this effect, leave the siege-zone (and/or return to your own town). You can return in %s.' -msg_war_siege_battle_session_ended: '&2Battle session ended. The next time you enter a siege-zone, a new battle session will begin.' - -#Siege-zone block placement restrictions -msg_war_siege_zone_block_placement_forbidden: '&cYou cannot place this type of block in the wilderness area of a siege zone.' -msg_war_siege_zone_bucket_emptying_forbidden: '&cYou cannot use this type of bucket in the wilderness area of a siege zone.' - -#Nation Refund -nation_help_11 : 'Claim all your nation refunds.' - -#Added in 0.02: -admin_help_1: 'Reload the config and language file.' -config_and_lang_file_reloaded_successfully: 'Config and Language file reloaded successfully.' -config_and_lang_file_could_not_be_loaded: 'Reload unsuccessful. See console for details.' -status_yes: '&aYES' -status_no: '&cNO' - -#Added in 0.03: -msg_err_no_money: '&cThere is not enough money in the bank.' - -#Added in 0.04: -msg_war_siege_peaceful_town_total_switches: '&b%d peaceful town%s %s peacefully switched nations.' -msg_err_not_registered_1: '&c%s is not registered.' -msg_error_must_be_num: '&bAmount must be a number.' - -#Added in 0.05: -msg_err_not_being_sieged: '&bTown %s does not have any active sieges.' -msg_err_town_not_registered: '&cTown %s is not registered.' - -#Scoreboard -hud_title: 'Siege' -hud_siegestatus: 'Siege Status' -hud_attackers: 'ATK: ' -hud_defenders: 'DEF: ' -hud_points: 'Points: ' -hud_banner_control: 'Banner Ctrl: ' -hud_time_remaining: 'Time Left: ' - -msg_err_peaceful_town_pvp_forced_off: '&cPeaceful towns have PVP forced OFF.' -msg_swa_set_points_success: '&bSuccessfully set siege points to %d for %s.' -msg_swa_resident_already_has_control: '&cResident %s already has control.' -msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." -msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' -msg_swa_set_captured_success: '&bSet captured to %s for %s.' - -siege_status_in_progress: 'In Progress' -siege_status_attacker_win: 'Attacker Win' -siege_status_defender_win: 'Defender Win' -siege_status_attacker_abandon: 'Attacker Abandon' -siege_status_defender_surrender: 'Defender Surrender' -siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' -siege_status_pending_defender_surrender: 'Pending Defender Surrender' -siege_status_unknown: 'Unknown' - -dynmap_siege_title: 'Siege: %s' -dynmap_siege_attacker: 'Attacker: %s' -dynmap_siege_defender: 'Defender: %s' -dynmap_siege_points: 'Points: %d' -dynmap_siege_banner_control: 'Banner Control: %s' -dynmap_siege_status: 'Status: %s' -dynmap_siege_status_in_progress: 'In Progress' -dynmap_siege_status_pending_surrender: 'Pending Surrender' -dynmap_siege_status_pending_abandon: 'Pending Abandon' -dynmap_siege_time_left: 'Time Left: %s' -dynmap_siege_war_chest: 'War Chest: %s' - -#Added in 0.06: -msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' -msg_swa_remove_siege_success: '&bSuccessfully removed siege.' -msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' - -#War sickness -msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' -msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' - From 19e111ea96e963ccdb39f326f8a3a2861623ca37 Mon Sep 17 00:00:00 2001 From: ceeedric <62527577+ceeedric@users.noreply.github.com> Date: Thu, 21 Jan 2021 15:22:08 -0600 Subject: [PATCH 19/34] Create english.yml --- src/main/resources/english.yml | 259 +++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 src/main/resources/english.yml diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml new file mode 100644 index 000000000..daa781533 --- /dev/null +++ b/src/main/resources/english.yml @@ -0,0 +1,259 @@ +name: SiegeWar +version: 0.06 +language: english +author: Goosius +website: 'http://townyadvanced.github.io/' +description: > + Language file for all game messages. Do not alter this file. + If you wish to change any of the entries, make a copy named something else. + Alternate language files can be enabled by altering the + [language] entry in config.yml +# +# +# You MUST retain spacing in the texts. +# If a text begins or ends with a space, it must remain that way. +# +# +# %s = data to be supplied by the plugin. + +# Text colouring +# -------------- +# Black = &0, Navy = &1, Green = &2, Blue = &3, Red = &4 +# Purple = &5, Gold = &6, LightGray = &7, Gray = &8 +# DarkPurple = &9, LightGreen = &a, LightBlue = &b +# Rose = &c, LightPurple = &d, Yellow = &e, White = &f + +plugin_prefix: '&f[&6SiegeWar&f] ' +msg_err_command_disable: '&cYou don''t have enough permissions for that command.' + +#Added in (Siegewar version) +#Siege war happy-path messages +msg_siege_war_revolt: '&bThe people of %s, led by %s, have revolted against %s, and declared themselves free to choose their own destiny!' +msg_siege_war_siege_started_neutral_town: '&bAn army belonging to %s has attacked %s. A siege has begun!' +msg_siege_war_siege_started_nation_town: '&bAn army belonging to %s has attacked %s at %s. A siege has begun!' +msg_siege_war_attack_pay_war_chest: '&bA war-chest has been prepared by %s, with a value of %s. Whoever wins the siege will get this money.' +msg_siege_war_attack_recover_war_chest: '&bThe war chest has been recovered by %s, with a value of %s.' +msg_siege_war_attacker_death: '&bSiege of %s > Attacker died > %s > Siege points -%d' +msg_siege_war_defender_death: '&bSiege of %s > Defender died > %s > Siege points +%d' +msg_siege_war_defender_win: '&bThe defenders of %s have successfully driven off all attacking armies. The siege has failed!' +msg_siege_war_attacker_win: '&bAn army belonging to %s has successfully breached the defences of %s. The siege is over!' +msg_siege_war_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. The defenders are victorious!' +msg_siege_war_pending_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. Defender victory will be confirmed in %s!' +msg_siege_war_town_surrender: '&b%s has surrendered to an army belonging to %s. The attackers are victorious!' +msg_siege_war_pending_town_surrender: '&b%s has surrendered to an army belonging to %s. Attacker victory will be confirmed in %s!' +msg_siege_war_neutral_town_captured: '&b%s has been captured by %s!' +msg_siege_war_nation_town_captured: '&b%s, previously belonging to %s, has been captured by %s!' +msg_siege_war_neutral_town_plundered: '&b%s has been plundered of %s by %s!' +msg_siege_war_nation_town_plundered: '&b%s has been plundered of %s by %s!' +msg_siege_war_town_ruined_from_plunder: '&b%s has been reduced to ruins by %s!' +msg_siege_war_town_bankrupted_from_plunder: '&b%s has been bankrupted by %s!' +msg_siege_war_nation_defeated: '&b%s has been defeated!.' +msg_siege_war_attacking_troops_at_siege_banner: '&bSiege on %s > Attackers are at the siege banner.' +msg_siege_war_defending_troops_at_siege_banner: '&bSiege on %s > Town defenders are at the siege banner.' +msg_siege_war_banner_control_session_started: '&bBanner control session started. Remain close to the siege-banner (%d blocks horizonally, %d blocks vertically), outside the town, and not flying, for %s. If your session succeeds, you will gain banner control for your side (or be added to the banner control list).' +msg_siege_war_banner_control_session_success: '&bBanner control session succeeded!. You have been added to the banner control list.' +msg_siege_war_banner_control_gained_by_attacker: '&bSiege on %s > The attackers have gained banner control.' +msg_siege_war_banner_control_gained_by_defender: '&bSiege on %s > The defenders have gained banner control.' +msg_siege_war_nation_refund_available: "A nation refund of %s is now available to you. It can be claimed using '/sw nation refund'" +msg_siege_war_nation_refund_claimed: "You have claimed the nation refund of %s." +msg_town_destroyed_by_nation_tax: '&b%s couldn''t pay taxes and has fallen.' +msg_town_destroyed_by_nation_tax_multiple: '&bThe following towns could not afford the nation tax and have fallen: ' + +#Siege war error message +#Town Toggling +msg_err_siege_besieged_town_cannot_toggle_pvp: "&cBesieged towns have PVP forced ON." +msg_err_siege_besieged_town_cannot_toggle_explosions: "&cBesieged towns have Explosions forced ON." +#Recruiting +msg_err_siege_besieged_town_cannot_toggle_open_off: "&cBesieged towns cannot open their doors to new residents." +msg_err_siege_besieged_town_cannot_recruit: "&cBesieged towns cannot recruit new residents." +#Claiming/Unclaiming +msg_err_siege_claim_too_near_siege_zone: "&cThe claim is too close to a siege." +msg_err_siege_besieged_town_cannot_claim: "&cBesieged towns cannot claim new land." +msg_err_siege_besieged_town_cannot_unclaim: "&cBesieged towns (or towns which recently lost a siege) cannot un-claim land." +msg_err_war_common_occupied_town_cannot_unclaim: "&cOccupied towns cannot un-claim land." +#Nation Delete +msg_err_siege_war_delete_nation_warning: "WARNING!!!: If you delete your nation you will be refunded %s. This can be claimed later by using '/sw nation refund'." +msg_err_siege_war_nation_refund_unavailable: "There is no nation refund available to you." +#Revolt +msg_err_siege_war_town_voluntary_leave_impossible: "&cTowns cannot leave nations without agreement. To leave your nation, persuade the king (or an assistant) to kick your town." +msg_err_siege_war_revolt_immunity_active: "&cYour town has revolt immunity. It cannot revolt until the revolt immunity expires." +#Attack +msg_err_siege_war_not_enabled_in_world: '&cWar is not enabled in this world.' +msg_err_siege_war_banner_must_be_placed_above_ground: '&cThe siege banner must be placed above ground.' +msg_err_siege_war_action_not_a_town_member: '&cYou must be a member of a town to do this action.' +msg_err_siege_war_action_not_a_nation_member: '&cYou must be a member of a nation to do this action.' +msg_err_siege_war_cannot_attack_own_town: '&cYou cannot attack your own town.' +msg_err_siege_war_cannot_attack_town_in_own_nation: '&cYou cannot attack a town in your own nation.' +msg_err_siege_war_cannot_attack_non_enemy_nation: '&cYou cannot attack a town unless the nation of that town is an enemy of your nation.' +msg_err_siege_war_too_many_adjacent_cardinal_town_blocks: '&cYou cannot perform this action because this chunk is facing more than one town block. Try placing the item in a different area.' +msg_err_siege_war_too_many_adjacent_towns: '&cYou cannot perform this action because there are multiple towns adjacent to this chunk. Try placing the item in a different area.' +msg_err_siege_war_nation_already_attacking_town: '&cYour nation is already attacking this town.' +msg_err_siege_war_cannot_attack_siege_immunity: '&cThe target town has siege immunity. It cannot be attacked until the siege immunity expires.' +msg_err_siege_war_cannot_place_banner_far_above_town: 'The siege banner cannot be placed on a much higher elevation than the town. Try placing the banner at a lower elevation' +msg_err_siege_war_cannot_join_siege: '&cYou cannot attack a town while it is under siege by another nation.' +msg_err_siege_war_nation_has_too_many_active_siege_attacks: '&cYour nation is at the maximum number of concurrent siege-attacks. To start another attack, one or more of the current attacks must finish.' +msg_err_siege_war_town_not_close_enough_to_nation: '&cThe town is too far away from your nation capital to be attacked.' +#Abandon +msg_err_siege_war_cannot_abandon_no_nearby_siege_attacks: '&cYou cannot abandon because there are no active siege banners nearby.' +msg_err_siege_war_cannot_abandon_nation_not_attacking_zone: '&cYou cannot abandon because your nation is not attacking in this area.' +msg_err_siege_war_cannot_abandon_siege_over: '&cYou cannot abandon because the siege is over.' +#Invade +msg_err_siege_war_cannot_invade_own_town: '&cYou cannot capture your own town.' +msg_err_siege_war_cannot_invade_without_victory: "&cYou cannot capture the town unless your nation is victorious in the siege." +msg_err_siege_war_no_siege_on_target_town: '&cThere is no siege on the target town of %s.' +msg_err_siege_war_town_already_invaded: '&cThis town has already been captured' +msg_err_siege_war_town_already_belongs_to_your_nation: '&cThis town already belongs to your nation' +#Plunder +msg_err_siege_war_cannot_plunder_own_town: '&cYou cannot plunder your own town.' +msg_err_siege_war_cannot_plunder_without_victory: "&cYou cannot plunder unless your nation is victorious in the siege." +msg_err_siege_war_cannot_plunder_without_economy: "&cYou cannot plunder because no economy plugin is active" +msg_err_siege_war_town_already_plundered: '&cThis town has already been plundered.' +#Surrender +msg_err_siege_war_cannot_surrender_not_your_town: '&cYou cannot surrender because this is not your town.' +msg_err_siege_war_cannot_surrender_siege_finished: '&cYou cannot surrender because the siege is over.' +#Block change +msg_err_siege_war_cannot_destroy_siege_banner: "&cWhile the siege is in progress you cannot destroy the siege banner or the block it is attached to." +msg_err_siege_war_nation_zone_this_area_protected_but_besieged: '&cThis part of the %s is under the protection of %s, and also cannot be altered while the nearby town is under siege.' +msg_err_siege_war_banner_support_block_not_stable: "&cYou cannot place the banner on unstable ground e.g. sand or gravel." +# Spawn +msg_err_siege_war_cannot_spawn_into_siegezone_or_besieged_town: '&cOnly town residents can spawn into a besieged town or siege zone (unless the target town is peaceful).' +#Banner control +msg_siege_war_banner_control_session_failure: '&cBanner control session failed!. Common causes for this include: Going into the town, too far from the banner, or flying.' +msg_war_siege_zone_milk_bucket_forbidden_while_attempting_banner_control: 'You cannot use this item while in a banner control session.' + +#Town Info Siege Section +status_town_revolt_immunity_timer: '&2Revolt Immunity Timer: &a%s' +status_town_siege_status: '&2Siege: &a%s' +status_town_siege_status_in_progress: 'In Progress' +status_town_siege_status_attacker_win: 'Attacker Victory - %s' +status_town_siege_status_defender_win: 'Town Victory' +status_town_siege_status_attacker_abandon: 'Attacker Retreat' +status_town_siege_status_defender_surrender: 'Town Surrender - to %s' +status_town_siege_status_pending_attacker_abandon: 'Attacker Retreat Pending, in %s' +status_town_siege_status_pending_defender_surrender: 'Town Surrender Pending, in %s' + +status_town_siege_status_besieger: '&2 > Besieger: &a%s {%s}' +status_town_siege_status_banner_xyz: '&2 > Banner XYZ: &a%d,%d,%d' +status_town_siege_immunity_timer: '&2 > Immunity Timer: &a%s' +status_town_siege_victory_timer: '&2 > Victory Timer: &a%s' +status_town_siege_invaded_plundered_status: '&2 > Town Captured: %s &2Town Plundered: %s' +status_town_banner_control: '&2 > Banner Control: %s &a[%s]&2: &f' +status_town_banner_control_nobody: '&2 > Banner Control: %s' + +#Nation Info Siege Section +status_nation_siege_attacks: '&2Siege Attacks &a[%s]&2: &f' +status_nation_siege_defences: '&2Siege Defences &a[%s]&2: &f' + +#General +msg_days: ' days' +status_no_green: '&aNO' +msg_occupier: '&4*Occupier*' +msg_nobody: '&aNobody' +msg_attackers: '&aAttackers' +msg_defenders: '&aDefenders' + +#Town Peacefulness +status_town_peacefulness_status_change_timer: '&2Countdown To Peacefulness Status Change: &a%d days' +msg_war_common_town_declared_peaceful: '&bPeacefulness Declared!. The town will be confirmed as peaceful in %d day(s).' +msg_war_common_town_declared_non_peaceful: '&bNon-Peacefulness Declared!. The town will be confirmed as non-peaceful in %d day(s).' +msg_war_common_town_peacefulness_countdown_cancelled: '&bThe peacefulness status change countdown was cancelled.' +msg_war_common_town_became_peaceful: '&b%s has been confirmed as Peaceful.' +msg_war_common_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful.' + +msg_war_siege_town_became_peaceful: '&b%s has been confirmed as Peaceful. The town is now immune to sieges and taxes. The town''s nation choice is now restricted to nations with a strong presence in the local area. (see user-guide for more details). Residents cannot enter siege-zones or gain nation-military ranks.' +msg_war_siege_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful. The town is no longer immune to sieges and taxes. The town''s nation choice is no longer restricted. Residents can enter siege-zones and gain nation-military ranks.' +msg_war_siege_cannot_add_nation_military_rank_to_peaceful_resident: '&cUnable to add military rank to resident, because they are in a peaceful town.' +msg_war_siege_peaceful_player_punished_for_being_in_siegezone: '&cWar-allergy active. To remove this effect, leave the siege-zone immediately.' +msg_war_siege_err_cannot_attack_peaceful_town: '&cYou cannot attack a peaceful town.' +msg_war_siege_peaceful_town_cannot_join_nation: 'c%s [PEACEFUL] cannot join %s, because the nation does not have a guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_zero: '&cYou cannot revolt at this time, because there are no guardian towns nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_one: '&cYou cannot revolt at this time, because there is only 1 guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_changed_nation: "&b%s has peacefully changed hands, moving from %s to %s." +msg_war_siege_peaceful_town_joined_nation: "&b%s has peacefully joined %s." +msg_war_siege_peaceful_town_left_nation: "&b%s has peacefully left %s." +msg_war_siege_warning_peaceful_town_should_not_create_nation: '&cYou are about to make a peaceful town into a nation capital. This is usually a bad idea, because the nation could fall without a fight.' +msg_war_siege_peaceful_towns_cannot_make_nations: '&cPeaceful towns cannot found nations!' + +#Siege immunities +msg_set_siege_immunities_town: 'Siege immunity for town %s set to %s hours.' +msg_set_siege_immunities_nation: 'Siege immunities for all towns in nation %s set to %s hours.' +msg_set_siege_immunities_all: 'Siege immunities for all towns set to %s hours.' + +#Battle sessions +msg_war_siege_battle_session_started: '&2Battle session started. You are free to enter any siege-zone for the next %s. After that you will get a %s rest from battle.' +msg_war_siege_battle_session_warning: '&cYour battle session will expire in %s. To avoid battle-fatigue, exit any siege zone you are in (and/or return to your own town).' +msg_war_siege_battle_session_expired: '&cBattle session expired. Battle-fatigue active. To remove this effect, leave the siege-zone (and/or return to your own town). You can return in %s.' +msg_war_siege_battle_session_ended: '&2Battle session ended. The next time you enter a siege-zone, a new battle session will begin.' + +#Siege-zone block placement restrictions +msg_war_siege_zone_block_placement_forbidden: '&cYou cannot place this type of block in the wilderness area of a siege zone.' +msg_war_siege_zone_bucket_emptying_forbidden: '&cYou cannot use this type of bucket in the wilderness area of a siege zone.' + +#Nation Refund +nation_help_11 : 'Claim all your nation refunds.' + +#Added in 0.02: +admin_help_1: 'Reload the config and language file.' +config_and_lang_file_reloaded_successfully: 'Config and Language file reloaded successfully.' +config_and_lang_file_could_not_be_loaded: 'Reload unsuccessful. See console for details.' +status_yes: '&aYES' +status_no: '&cNO' + +#Added in 0.03: +msg_err_no_money: '&cThere is not enough money in the bank.' + +#Added in 0.04: +msg_war_siege_peaceful_town_total_switches: '&b%d peaceful town%s %s peacefully switched nations.' +msg_err_not_registered_1: '&c%s is not registered.' +msg_error_must_be_num: '&bAmount must be a number.' + +#Added in 0.05: +msg_err_not_being_sieged: '&bTown %s does not have any active sieges.' +msg_err_town_not_registered: '&cTown %s is not registered.' + +#Scoreboard +hud_title: 'Siege' +hud_siegestatus: 'Siege Status' +hud_attackers: 'ATK: ' +hud_defenders: 'DEF: ' +hud_points: 'Points: ' +hud_banner_control: 'Banner Ctrl: ' +hud_time_remaining: 'Time Left: ' + +msg_err_peaceful_town_pvp_forced_off: '&cPeaceful towns have PVP forced OFF.' +msg_swa_set_points_success: '&bSuccessfully set siege points to %d for %s.' +msg_swa_resident_already_has_control: '&cResident %s already has control.' +msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." +msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' +msg_swa_set_captured_success: '&bSet captured to %s for %s.' + +siege_status_in_progress: 'In Progress' +siege_status_attacker_win: 'Attacker Win' +siege_status_defender_win: 'Defender Win' +siege_status_attacker_abandon: 'Attacker Abandon' +siege_status_defender_surrender: 'Defender Surrender' +siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' +siege_status_pending_defender_surrender: 'Pending Defender Surrender' +siege_status_unknown: 'Unknown' + +dynmap_siege_title: 'Siege: %s' +dynmap_siege_attacker: 'Attacker: %s' +dynmap_siege_defender: 'Defender: %s' +dynmap_siege_points: 'Points: %d' +dynmap_siege_banner_control: 'Banner Control: %s' +dynmap_siege_status: 'Status: %s' +dynmap_siege_status_in_progress: 'In Progress' +dynmap_siege_status_pending_surrender: 'Pending Surrender' +dynmap_siege_status_pending_abandon: 'Pending Abandon' +dynmap_siege_time_left: 'Time Left: %s' +dynmap_siege_war_chest: 'War Chest: %s' + +#Added in 0.06: +msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' +msg_swa_remove_siege_success: '&bSuccessfully removed siege.' +msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' + +#War sickness +msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' + From 57bf1279077359c83d573213e1f9726859893807 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:21:07 -0600 Subject: [PATCH 20/34] Rebase --- .../goosius/siegewar/SiegeController.java | 11 ++ .../listeners/SiegeWarTownyEventListener.java | 1 + .../siegewar/settings/ConfigNodes.java | 31 +++- .../siegewar/settings/SiegeWarSettings.java | 8 + .../tasks/SiegeWarTimerTaskController.java | 7 + .../siegewar/utils/SiegeWarSicknessUtil.java | 141 ++++++++++++++++++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java diff --git a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java index c729c23df..d93e5adb3 100644 --- a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java +++ b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java @@ -10,6 +10,7 @@ import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; +import com.gmail.goosius.siegewar.utils.SiegeWarDistanceUtil; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; @@ -293,5 +294,15 @@ public static Set getPlayersInBannerControlSessions() { } return result; } + + public static List getSiegesAt(Location location) { + List siegesAtLocation = new ArrayList<>(); + for (Siege siege : sieges.values()) { + if (SiegeWarDistanceUtil.isInSiegeZone(location, siege)) { + siegesAtLocation.add(siege); + } + } + return siegesAtLocation; + } } diff --git a/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java b/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java index 106a90cfc..ca2299e3c 100644 --- a/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java +++ b/src/main/java/com/gmail/goosius/siegewar/listeners/SiegeWarTownyEventListener.java @@ -77,6 +77,7 @@ public void onShortTime(NewShortTimeEvent event) { SiegeWarTimerTaskController.evaluateBannerControl(); SiegeWarTimerTaskController.evaluateMapSneaking(); SiegeWarTimerTaskController.evaluateTimedSiegeOutcomes(); + SiegeWarTimerTaskController.punishNonSiegeParticipantsInSiegeZone(); SiegeHUDManager.updateHUDs(); } diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index f6e012bed..a2a15af85 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -584,7 +584,36 @@ public enum ConfigNodes { "true", "", "# If this value is true, then a town under occupation cannot unclaim.", - "# This setting is recommended, to avoid occupation escape exploits."); + "# This setting is recommended, to avoid occupation escape exploits."), + + PUNISH_NON_SIEGE_PARTICIPANTS_IN_SIEGE_ZONE( + "punish_non_siege_participants_in_siege_zone", + "", + "############################################################", + "# +------------------------------------------------------+ #", + "# | War Sickness | #", + "# +------------------------------------------------------+ #", + "############################################################", + ""), + + ENABLE_SICKNESS( + "punish_non_siege_participants_in_siege_zone.enable_sickness", + "true", + "# If true, players that are not participating in a siege will receive war sickness", + "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", + "# There are two types of war sickness, full and special.", + "# Special war sickness is only given if a non-participant is at his town that happened to be in a siege zone", + "# - Effects: Weakness V", + "# Full sickness is given to all players that are not allied to either side, do not have a military rank, or is peaceful, and are not in their own town.", + "# - Effects: Nausea V, Poison V, Weakness V, Slowness III, Mining Fatigue III" + ), + + SECONDS_BEFORE_SICKNESS( + "punish_non_siege_participants_in_siege_zone.seconds_warning", + "5", + "# This is how many seconds a player has to leave the siege zone before he gets war sickness", + "# If this is set to 0, no war will be given and non-participants will receive war sickness instantly, if enabled" + ); private final String Root; private final String Default; diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java b/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java index 261130903..a0929ca3e 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/SiegeWarSettings.java @@ -330,4 +330,12 @@ public static boolean getWarCommonPeacefulTownsAllowedToTogglePVP() { return Settings.getBoolean(ConfigNodes.PEACEFUL_TOWNS_ALLOWED_TO_TOGGLE_PVP); } + public static boolean getPunishingNonSiegeParticipantsInSiegeZone() { + return Settings.getBoolean(ConfigNodes.ENABLE_SICKNESS); + } + + public static int getSicknessWarningTimeInTicks() { + return Settings.getInt(ConfigNodes.SECONDS_BEFORE_SICKNESS) * 20; + } + } diff --git a/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java b/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java index d24f32fc6..da291ce66 100644 --- a/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java +++ b/src/main/java/com/gmail/goosius/siegewar/tasks/SiegeWarTimerTaskController.java @@ -114,4 +114,11 @@ public static void punishPeacefulPlayersInActiveSiegeZones() { TownPeacefulnessUtil.punishPeacefulPlayersInActiveSiegeZones(); } } + + public static void punishNonSiegeParticipantsInSiegeZone() { + if (SiegeWarSettings.getPunishingNonSiegeParticipantsInSiegeZone()) { + SiegeWarSicknessUtil.punishNonSiegeParticipantsInSiegeZone(); + } + } + } diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java new file mode 100644 index 000000000..e27b1cfef --- /dev/null +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -0,0 +1,141 @@ +package com.gmail.goosius.siegewar.utils; + +import com.gmail.goosius.siegewar.SiegeController; +import com.gmail.goosius.siegewar.enums.SiegeWarPermissionNodes; +import com.gmail.goosius.siegewar.objects.Siege; +import com.gmail.goosius.siegewar.settings.SiegeWarSettings; +import com.gmail.goosius.siegewar.settings.Translation; +import com.palmergames.bukkit.towny.Towny; +import com.palmergames.bukkit.towny.TownyAPI; +import com.palmergames.bukkit.towny.TownySettings; +import com.palmergames.bukkit.towny.TownyUniverse; +import com.palmergames.bukkit.towny.exceptions.NotRegisteredException; +import com.palmergames.bukkit.towny.object.Nation; +import com.palmergames.bukkit.towny.object.Resident; +import com.palmergames.bukkit.towny.object.Town; +import com.palmergames.bukkit.util.BukkitTools; +import com.palmergames.util.TimeTools; +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.util.ArrayList; +import java.util.List; + +public class SiegeWarSicknessUtil { + + public static void punishNonSiegeParticipantsInSiegeZone() { + + for (Player player : BukkitTools.getOnlinePlayers()) { + Location location = player.getLocation(); + List sieges = SiegeController.getSiegesAt(location); + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + TownyUniverse universe = TownyUniverse.getInstance(); + + // not in a siege zone + if (sieges.isEmpty()) + continue; + + // Players immune to war nausea won't be punished for this + if (universe.getPermissionSource().testPermission(player, + SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + continue; + + boolean allowedInAnyOverlappingSiege = false; + try { + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; + } + } + + if (!allowedInAnyOverlappingSiege) { + if (isInOwnClaims(resident)) { + punishWithSpecialWarSickness(player); + } else { + punishWithFullWarSickness(player); + } + + } + } catch (NotRegisteredException ignored) {} + + } + + } + + public static void punishWithFullWarSickness(Player player) { + final int effectDurationTicks = (int)(TimeTools.convertToTicks(TownySettings.getShortInterval() + 5)); + if (SiegeWarSettings.getSicknessWarningTimeInTicks() / 20 >= 1) { + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_will_get_sickness", + SiegeWarSettings.getSicknessWarningTimeInTicks() / 20)); + } + Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { + public void run() { + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + }, SiegeWarSettings.getSicknessWarningTimeInTicks()); + } + + public static void punishWithSpecialWarSickness(Player player) { + final int effectDurationTicks = (int)(TimeTools.convertToTicks(TownySettings.getShortInterval() + 5)); + Towny.getPlugin().getServer().getScheduler().runTask(Towny.getPlugin(), new Runnable() { + public void run() { + player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + } + }); + } + + public static boolean isSiegeParticipant(Resident resident, Siege siege) throws NotRegisteredException { + + if (!resident.hasTown()) + return false; + + TownyUniverse universe = TownyUniverse.getInstance(); + Town defendingTown = siege.getDefendingTown(); + Town residentTown = resident.getTown(); + Nation attackingNation = siege.getAttackingNation(); + + if (residentTown == defendingTown && universe.getPermissionSource().testPermission(resident.getPlayer(), + SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { + // Player is defending their own town + return true; + } + + if (residentTown.hasNation() && + (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation()))) { + // Player is attacking + return true; + + } + + if (defendingTown.hasNation() + && (defendingTown.getNation() == residentTown.getNation() + || defendingTown.getNation().hasMutualAlly(residentTown.getNation()))) { + // Player is defending another town in the nation + return true; + } + + return false; + } + + private static boolean isInOwnClaims(Resident resident) throws NotRegisteredException { + Location location = resident.getPlayer().getLocation(); + if (!resident.hasTown()) + return false; + + if (TownyAPI.getInstance().isWilderness(location)) + return false; + + return TownyAPI.getInstance().getTownBlock(location).getTown().equals(resident.getTown()); + } + +} From 004df0128245c799512053e90d6e81b3adeec199 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:39:40 -0600 Subject: [PATCH 21/34] Fixes players still getting sickness even after leaving in time --- .../siegewar/utils/SiegeWarSicknessUtil.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index e27b1cfef..45d7fa2a3 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -73,14 +73,29 @@ public static void punishWithFullWarSickness(Player player) { } Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { public void run() { - List potionEffects = new ArrayList<>(); - potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); - player.addPotionEffects(potionEffects); - player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + try { + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + List sieges = SiegeController.getSiegesAt(player.getLocation()); + boolean allowedInAnyOverlappingSiege = false; + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; + } + } + + if (!allowedInAnyOverlappingSiege && SiegeWarDistanceUtil.isLocationInActiveSiegeZone(player.getLocation())) { + // still in siege zone + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + } catch (NotRegisteredException ignored) {} } }, SiegeWarSettings.getSicknessWarningTimeInTicks()); } From c0de3e58e7f765f9e31694f0c935102b8c0a5960 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 05:30:45 -0600 Subject: [PATCH 22/34] Fixes small typo --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index a2a15af85..4d1cebca6 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -612,7 +612,7 @@ public enum ConfigNodes { "punish_non_siege_participants_in_siege_zone.seconds_warning", "5", "# This is how many seconds a player has to leave the siege zone before he gets war sickness", - "# If this is set to 0, no war will be given and non-participants will receive war sickness instantly, if enabled" + "# If this is set to 0, no warn will be given and non-participants will receive war sickness instantly, if enabled" ); private final String Root; From 0f4445c5b624f4b52a6f7d1c032bf806e4caf231 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:37:51 -0600 Subject: [PATCH 23/34] Flip checks around --- .../goosius/siegewar/utils/SiegeWarSicknessUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 45d7fa2a3..25a2aab8c 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -31,15 +31,16 @@ public static void punishNonSiegeParticipantsInSiegeZone() { Location location = player.getLocation(); List sieges = SiegeController.getSiegesAt(location); Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); - TownyUniverse universe = TownyUniverse.getInstance(); + + // Players immune to war nausea won't be punished + if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + continue; // not in a siege zone if (sieges.isEmpty()) continue; - // Players immune to war nausea won't be punished for this - if (universe.getPermissionSource().testPermission(player, - SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) + if (resident == null) continue; boolean allowedInAnyOverlappingSiege = false; From 255fad73d7a6f530815ec903a979be6b52fccbf6 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:38:56 -0600 Subject: [PATCH 24/34] Add "" after default config values --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 4d1cebca6..68d06cd67 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -599,6 +599,7 @@ public enum ConfigNodes { ENABLE_SICKNESS( "punish_non_siege_participants_in_siege_zone.enable_sickness", "true", + "", "# If true, players that are not participating in a siege will receive war sickness", "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", "# There are two types of war sickness, full and special.", @@ -611,6 +612,7 @@ public enum ConfigNodes { SECONDS_BEFORE_SICKNESS( "punish_non_siege_participants_in_siege_zone.seconds_warning", "5", + "", "# This is how many seconds a player has to leave the siege zone before he gets war sickness", "# If this is set to 0, no warn will be given and non-participants will receive war sickness instantly, if enabled" ); From 9650ab6b1ba59862f867a0a2bf87f4f3eb7868d9 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:45:05 -0600 Subject: [PATCH 25/34] Moving sieges list so it is below the permission check --- .../gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 25a2aab8c..d6fc70460 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -29,17 +29,19 @@ public static void punishNonSiegeParticipantsInSiegeZone() { for (Player player : BukkitTools.getOnlinePlayers()) { Location location = player.getLocation(); - List sieges = SiegeController.getSiegesAt(location); - Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); // Players immune to war nausea won't be punished if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) continue; + List sieges = SiegeController.getSiegesAt(location); + // not in a siege zone if (sieges.isEmpty()) continue; + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + if (resident == null) continue; From 0750f9a044209634197441e64be5a5c438850a05 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Wed, 13 Jan 2021 21:21:07 -0600 Subject: [PATCH 26/34] rebase --- .../gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index d6fc70460..1c6932bcb 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -34,7 +34,7 @@ public static void punishNonSiegeParticipantsInSiegeZone() { if (player.hasPermission(SiegeWarPermissionNodes.SIEGEWAR_IMMUNE_TO_WAR_NAUSEA.getNode())) continue; - List sieges = SiegeController.getSiegesAt(location); + List sieges = SiegeController.getActiveSiegesAt(location); // not in a siege zone if (sieges.isEmpty()) @@ -78,7 +78,7 @@ public static void punishWithFullWarSickness(Player player) { public void run() { try { Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); - List sieges = SiegeController.getSiegesAt(player.getLocation()); + List sieges = SiegeController.getActiveSiegesAt(player.getLocation()); boolean allowedInAnyOverlappingSiege = false; for (Siege siege : sieges) { if (isSiegeParticipant(resident, siege)) { From f7dbc06d1b126912b7b9593d2011faef4cffc938 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 15:37:51 -0600 Subject: [PATCH 27/34] Flip checks around --- .../siegewar/utils/SiegeWarSicknessUtil.java | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 1c6932bcb..88bf15a1f 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -74,32 +74,30 @@ public static void punishWithFullWarSickness(Player player) { player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_will_get_sickness", SiegeWarSettings.getSicknessWarningTimeInTicks() / 20)); } - Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), new Runnable() { - public void run() { - try { - Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); - List sieges = SiegeController.getActiveSiegesAt(player.getLocation()); - boolean allowedInAnyOverlappingSiege = false; - for (Siege siege : sieges) { - if (isSiegeParticipant(resident, siege)) { - allowedInAnyOverlappingSiege = true; - break; - } + Towny.getPlugin().getServer().getScheduler().runTaskLater(Towny.getPlugin(), () -> { + try { + Resident resident = TownyUniverse.getInstance().getResident(player.getUniqueId()); + List sieges = SiegeController.getActiveSiegesAt(player.getLocation()); + boolean allowedInAnyOverlappingSiege = false; + for (Siege siege : sieges) { + if (isSiegeParticipant(resident, siege)) { + allowedInAnyOverlappingSiege = true; + break; } + } - if (!allowedInAnyOverlappingSiege && SiegeWarDistanceUtil.isLocationInActiveSiegeZone(player.getLocation())) { - // still in siege zone - List potionEffects = new ArrayList<>(); - potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); - potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); - player.addPotionEffects(potionEffects); - player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); - } - } catch (NotRegisteredException ignored) {} - } + if (!allowedInAnyOverlappingSiege && SiegeWarDistanceUtil.isLocationInActiveSiegeZone(player.getLocation())) { + // still in siege zone + List potionEffects = new ArrayList<>(); + potionEffects.add(new PotionEffect(PotionEffectType.CONFUSION, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.POISON, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.WEAKNESS, effectDurationTicks, 4)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW, effectDurationTicks, 2)); + potionEffects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, effectDurationTicks, 2)); + player.addPotionEffects(potionEffects); + player.sendMessage(Translation.of("plugin_prefix") + Translation.of("msg_you_received_war_sickness")); + } + } catch (NotRegisteredException ignored) {} }, SiegeWarSettings.getSicknessWarningTimeInTicks()); } From 9d11a9f3f8f4063f006ea388988d9104d33a9b67 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Thu, 14 Jan 2021 16:26:39 -0600 Subject: [PATCH 28/34] Merge branch 'master' of https://github.com/TownyAdvanced/SiegeWar into war_sickness --- src/main/resources/english.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml index dde08e893..3c3b2a2a8 100644 --- a/src/main/resources/english.yml +++ b/src/main/resources/english.yml @@ -252,3 +252,7 @@ dynmap_siege_war_chest: 'War Chest: %s' msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' msg_swa_remove_siege_success: '&bSuccessfully removed siege.' msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' + +#War sickness +msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' \ No newline at end of file From c3b42106d9e8e45026d76e94c8def5452f7c13e8 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Fri, 15 Jan 2021 15:31:39 -0600 Subject: [PATCH 29/34] Sickness is now disabled by default --- .../java/com/gmail/goosius/siegewar/settings/ConfigNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java index 68d06cd67..fe7d37485 100644 --- a/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java +++ b/src/main/java/com/gmail/goosius/siegewar/settings/ConfigNodes.java @@ -598,7 +598,7 @@ public enum ConfigNodes { ENABLE_SICKNESS( "punish_non_siege_participants_in_siege_zone.enable_sickness", - "true", + "false", "", "# If true, players that are not participating in a siege will receive war sickness", "# A non-participant is a player who does not have a military rank, is not allied to either the attacker or the defender, or is peaceful.", From 3eeac57a90a2cd29d05ce7c2324c5eaa217ba099 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Sat, 16 Jan 2021 11:13:20 -0600 Subject: [PATCH 30/34] Renamed getSiegesAt to getActiveSiegesAt and added isActive check --- src/main/java/com/gmail/goosius/siegewar/SiegeController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java index d93e5adb3..c42ee7361 100644 --- a/src/main/java/com/gmail/goosius/siegewar/SiegeController.java +++ b/src/main/java/com/gmail/goosius/siegewar/SiegeController.java @@ -295,10 +295,10 @@ public static Set getPlayersInBannerControlSessions() { return result; } - public static List getSiegesAt(Location location) { + public static List getActiveSiegesAt(Location location) { List siegesAtLocation = new ArrayList<>(); for (Siege siege : sieges.values()) { - if (SiegeWarDistanceUtil.isInSiegeZone(location, siege)) { + if (SiegeWarDistanceUtil.isInSiegeZone(location, siege) && siege.getStatus().isActive()) { siegesAtLocation.add(siege); } } From 4d4934c22b311dd705523a0904efc89ce6afe7a1 Mon Sep 17 00:00:00 2001 From: ceeedric Date: Tue, 19 Jan 2021 21:56:35 -0600 Subject: [PATCH 31/34] Adds military rank check --- .../goosius/siegewar/utils/SiegeWarSicknessUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java index 88bf15a1f..86f9e4a5f 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarSicknessUtil.java @@ -115,27 +115,27 @@ public static boolean isSiegeParticipant(Resident resident, Siege siege) throws if (!resident.hasTown()) return false; - TownyUniverse universe = TownyUniverse.getInstance(); Town defendingTown = siege.getDefendingTown(); Town residentTown = resident.getTown(); Nation attackingNation = siege.getAttackingNation(); - if (residentTown == defendingTown && universe.getPermissionSource().testPermission(resident.getPlayer(), - SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { + if (residentTown == defendingTown && resident.getPlayer() + .hasPermission(SiegeWarPermissionNodes.SIEGEWAR_TOWN_SIEGE_POINTS.getNode())) { // Player is defending their own town return true; } if (residentTown.hasNation() && - (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation()))) { + (attackingNation == residentTown.getNation() || attackingNation.hasMutualAlly(residentTown.getNation())) + && resident.getPlayer().hasPermission(SiegeWarPermissionNodes.SIEGEWAR_NATION_SIEGE_POINTS.getNode())) { // Player is attacking return true; - } if (defendingTown.hasNation() && (defendingTown.getNation() == residentTown.getNation() - || defendingTown.getNation().hasMutualAlly(residentTown.getNation()))) { + || defendingTown.getNation().hasMutualAlly(residentTown.getNation())) + && resident.getPlayer().hasPermission(SiegeWarPermissionNodes.SIEGEWAR_NATION_SIEGE_POINTS.getNode())) { // Player is defending another town in the nation return true; } From 32779696cc9b64592769b1e202ce95013ac506cd Mon Sep 17 00:00:00 2001 From: ceeedric <62527577+ceeedric@users.noreply.github.com> Date: Thu, 21 Jan 2021 15:10:15 -0600 Subject: [PATCH 32/34] attempt to fix english.yml --- src/main/resources/english.yml | 516 ++++++++++++++++----------------- 1 file changed, 258 insertions(+), 258 deletions(-) diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml index 3c3b2a2a8..2b7ed428b 100644 --- a/src/main/resources/english.yml +++ b/src/main/resources/english.yml @@ -1,258 +1,258 @@ -name: SiegeWar -version: 0.06 -language: english -author: Goosius -website: 'http://townyadvanced.github.io/' -description: > - Language file for all game messages. Do not alter this file. - If you wish to change any of the entries, make a copy named something else. - Alternate language files can be enabled by altering the - [language] entry in config.yml -# -# -# You MUST retain spacing in the texts. -# If a text begins or ends with a space, it must remain that way. -# -# -# %s = data to be supplied by the plugin. - -# Text colouring -# -------------- -# Black = &0, Navy = &1, Green = &2, Blue = &3, Red = &4 -# Purple = &5, Gold = &6, LightGray = &7, Gray = &8 -# DarkPurple = &9, LightGreen = &a, LightBlue = &b -# Rose = &c, LightPurple = &d, Yellow = &e, White = &f - -plugin_prefix: '&f[&6SiegeWar&f] ' -msg_err_command_disable: '&cYou don''t have enough permissions for that command.' - -#Added in (Siegewar version) -#Siege war happy-path messages -msg_siege_war_revolt: '&bThe people of %s, led by %s, have revolted against %s, and declared themselves free to choose their own destiny!' -msg_siege_war_siege_started_neutral_town: '&bAn army belonging to %s has attacked %s. A siege has begun!' -msg_siege_war_siege_started_nation_town: '&bAn army belonging to %s has attacked %s at %s. A siege has begun!' -msg_siege_war_attack_pay_war_chest: '&bA war-chest has been prepared by %s, with a value of %s. Whoever wins the siege will get this money.' -msg_siege_war_attack_recover_war_chest: '&bThe war chest has been recovered by %s, with a value of %s.' -msg_siege_war_attacker_death: '&bSiege of %s > Attacker died > %s > Siege points -%d' -msg_siege_war_defender_death: '&bSiege of %s > Defender died > %s > Siege points +%d' -msg_siege_war_defender_win: '&bThe defenders of %s have successfully driven off all attacking armies. The siege has failed!' -msg_siege_war_attacker_win: '&bAn army belonging to %s has successfully breached the defences of %s. The siege is over!' -msg_siege_war_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. The defenders are victorious!' -msg_siege_war_pending_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. Defender victory will be confirmed in %s!' -msg_siege_war_town_surrender: '&b%s has surrendered to an army belonging to %s. The attackers are victorious!' -msg_siege_war_pending_town_surrender: '&b%s has surrendered to an army belonging to %s. Attacker victory will be confirmed in %s!' -msg_siege_war_neutral_town_captured: '&b%s has been captured by %s!' -msg_siege_war_nation_town_captured: '&b%s, previously belonging to %s, has been captured by %s!' -msg_siege_war_neutral_town_plundered: '&b%s has been plundered of %s by %s!' -msg_siege_war_nation_town_plundered: '&b%s has been plundered of %s by %s!' -msg_siege_war_town_ruined_from_plunder: '&b%s has been reduced to ruins by %s!' -msg_siege_war_town_bankrupted_from_plunder: '&b%s has been bankrupted by %s!' -msg_siege_war_nation_defeated: '&b%s has been defeated!.' -msg_siege_war_attacking_troops_at_siege_banner: '&bSiege on %s > Attackers are at the siege banner.' -msg_siege_war_defending_troops_at_siege_banner: '&bSiege on %s > Town defenders are at the siege banner.' -msg_siege_war_banner_control_session_started: '&bBanner control session started. Remain close to the siege-banner (%d blocks horizonally, %d blocks vertically), outside the town, and not flying, for %s. If your session succeeds, you will gain banner control for your side (or be added to the banner control list).' -msg_siege_war_banner_control_session_success: '&bBanner control session succeeded!. You have been added to the banner control list.' -msg_siege_war_banner_control_gained_by_attacker: '&bSiege on %s > The attackers have gained banner control.' -msg_siege_war_banner_control_gained_by_defender: '&bSiege on %s > The defenders have gained banner control.' -msg_siege_war_nation_refund_available: "A nation refund of %s is now available to you. It can be claimed using '/sw nation refund'" -msg_siege_war_nation_refund_claimed: "You have claimed the nation refund of %s." -msg_town_destroyed_by_nation_tax: '&b%s couldn''t pay taxes and has fallen.' -msg_town_destroyed_by_nation_tax_multiple: '&bThe following towns could not afford the nation tax and have fallen: ' - -#Siege war error message -#Town Toggling -msg_err_siege_besieged_town_cannot_toggle_pvp: "&cBesieged towns have PVP forced ON." -msg_err_siege_besieged_town_cannot_toggle_explosions: "&cBesieged towns have Explosions forced ON." -#Recruiting -msg_err_siege_besieged_town_cannot_toggle_open_off: "&cBesieged towns cannot open their doors to new residents." -msg_err_siege_besieged_town_cannot_recruit: "&cBesieged towns cannot recruit new residents." -#Claiming/Unclaiming -msg_err_siege_claim_too_near_siege_zone: "&cThe claim is too close to a siege." -msg_err_siege_besieged_town_cannot_claim: "&cBesieged towns cannot claim new land." -msg_err_siege_besieged_town_cannot_unclaim: "&cBesieged towns (or towns which recently lost a siege) cannot un-claim land." -msg_err_war_common_occupied_town_cannot_unclaim: "&cOccupied towns cannot un-claim land." -#Nation Delete -msg_err_siege_war_delete_nation_warning: "WARNING!!!: If you delete your nation you will be refunded %s. This can be claimed later by using '/sw nation refund'." -msg_err_siege_war_nation_refund_unavailable: "There is no nation refund available to you." -#Revolt -msg_err_siege_war_town_voluntary_leave_impossible: "&cTowns cannot leave nations without agreement. To leave your nation, persuade the king (or an assistant) to kick your town." -msg_err_siege_war_revolt_immunity_active: "&cYour town has revolt immunity. It cannot revolt until the revolt immunity expires." -#Attack -msg_err_siege_war_not_enabled_in_world: '&cWar is not enabled in this world.' -msg_err_siege_war_banner_must_be_placed_above_ground: '&cThe siege banner must be placed above ground.' -msg_err_siege_war_action_not_a_town_member: '&cYou must be a member of a town to do this action.' -msg_err_siege_war_action_not_a_nation_member: '&cYou must be a member of a nation to do this action.' -msg_err_siege_war_cannot_attack_own_town: '&cYou cannot attack your own town.' -msg_err_siege_war_cannot_attack_town_in_own_nation: '&cYou cannot attack a town in your own nation.' -msg_err_siege_war_cannot_attack_non_enemy_nation: '&cYou cannot attack a town unless the nation of that town is an enemy of your nation.' -msg_err_siege_war_too_many_adjacent_cardinal_town_blocks: '&cYou cannot perform this action because this chunk is facing more than one town block. Try placing the item in a different area.' -msg_err_siege_war_too_many_adjacent_towns: '&cYou cannot perform this action because there are multiple towns adjacent to this chunk. Try placing the item in a different area.' -msg_err_siege_war_nation_already_attacking_town: '&cYour nation is already attacking this town.' -msg_err_siege_war_cannot_attack_siege_immunity: '&cThe target town has siege immunity. It cannot be attacked until the siege immunity expires.' -msg_err_siege_war_cannot_place_banner_far_above_town: 'The siege banner cannot be placed on a much higher elevation than the town. Try placing the banner at a lower elevation' -msg_err_siege_war_cannot_join_siege: '&cYou cannot attack a town while it is under siege by another nation.' -msg_err_siege_war_nation_has_too_many_active_siege_attacks: '&cYour nation is at the maximum number of concurrent siege-attacks. To start another attack, one or more of the current attacks must finish.' -msg_err_siege_war_town_not_close_enough_to_nation: '&cThe town is too far away from your nation capital to be attacked.' -#Abandon -msg_err_siege_war_cannot_abandon_no_nearby_siege_attacks: '&cYou cannot abandon because there are no active siege banners nearby.' -msg_err_siege_war_cannot_abandon_nation_not_attacking_zone: '&cYou cannot abandon because your nation is not attacking in this area.' -msg_err_siege_war_cannot_abandon_siege_over: '&cYou cannot abandon because the siege is over.' -#Invade -msg_err_siege_war_cannot_invade_own_town: '&cYou cannot capture your own town.' -msg_err_siege_war_cannot_invade_without_victory: "&cYou cannot capture the town unless your nation is victorious in the siege." -msg_err_siege_war_no_siege_on_target_town: '&cThere is no siege on the target town of %s.' -msg_err_siege_war_town_already_invaded: '&cThis town has already been captured' -msg_err_siege_war_town_already_belongs_to_your_nation: '&cThis town already belongs to your nation' -#Plunder -msg_err_siege_war_cannot_plunder_own_town: '&cYou cannot plunder your own town.' -msg_err_siege_war_cannot_plunder_without_victory: "&cYou cannot plunder unless your nation is victorious in the siege." -msg_err_siege_war_cannot_plunder_without_economy: "&cYou cannot plunder because no economy plugin is active" -msg_err_siege_war_town_already_plundered: '&cThis town has already been plundered.' -#Surrender -msg_err_siege_war_cannot_surrender_not_your_town: '&cYou cannot surrender because this is not your town.' -msg_err_siege_war_cannot_surrender_siege_finished: '&cYou cannot surrender because the siege is over.' -#Block change -msg_err_siege_war_cannot_destroy_siege_banner: "&cWhile the siege is in progress you cannot destroy the siege banner or the block it is attached to." -msg_err_siege_war_nation_zone_this_area_protected_but_besieged: '&cThis part of the %s is under the protection of %s, and also cannot be altered while the nearby town is under siege.' -msg_err_siege_war_banner_support_block_not_stable: "&cYou cannot place the banner on unstable ground e.g. sand or gravel." -# Spawn -msg_err_siege_war_cannot_spawn_into_siegezone_or_besieged_town: '&cOnly town residents can spawn into a besieged town or siege zone (unless the target town is peaceful).' -#Banner control -msg_siege_war_banner_control_session_failure: '&cBanner control session failed!. Common causes for this include: Going into the town, too far from the banner, or flying.' -msg_war_siege_zone_milk_bucket_forbidden_while_attempting_banner_control: 'You cannot use this item while in a banner control session.' - -#Town Info Siege Section -status_town_revolt_immunity_timer: '&2Revolt Immunity Timer: &a%s' -status_town_siege_status: '&2Siege: &a%s' -status_town_siege_status_in_progress: 'In Progress' -status_town_siege_status_attacker_win: 'Attacker Victory - %s' -status_town_siege_status_defender_win: 'Town Victory' -status_town_siege_status_attacker_abandon: 'Attacker Retreat' -status_town_siege_status_defender_surrender: 'Town Surrender - to %s' -status_town_siege_status_pending_attacker_abandon: 'Attacker Retreat Pending, in %s' -status_town_siege_status_pending_defender_surrender: 'Town Surrender Pending, in %s' - -status_town_siege_status_besieger: '&2 > Besieger: &a%s {%s}' -status_town_siege_status_banner_xyz: '&2 > Banner XYZ: &a%d,%d,%d' -status_town_siege_immunity_timer: '&2 > Immunity Timer: &a%s' -status_town_siege_victory_timer: '&2 > Victory Timer: &a%s' -status_town_siege_invaded_plundered_status: '&2 > Town Captured: %s &2Town Plundered: %s' -status_town_banner_control: '&2 > Banner Control: %s &a[%s]&2: &f' -status_town_banner_control_nobody: '&2 > Banner Control: %s' - -#Nation Info Siege Section -status_nation_siege_attacks: '&2Siege Attacks &a[%s]&2: &f' -status_nation_siege_defences: '&2Siege Defences &a[%s]&2: &f' - -#General -msg_days: ' days' -status_no_green: '&aNO' -msg_occupier: '&4*Occupier*' -msg_nobody: '&aNobody' -msg_attackers: '&aAttackers' -msg_defenders: '&aDefenders' - -#Town Peacefulness -status_town_peacefulness_status_change_timer: '&2Countdown To Peacefulness Status Change: &a%d days' -msg_war_common_town_declared_peaceful: '&bPeacefulness Declared!. The town will be confirmed as peaceful in %d day(s).' -msg_war_common_town_declared_non_peaceful: '&bNon-Peacefulness Declared!. The town will be confirmed as non-peaceful in %d day(s).' -msg_war_common_town_peacefulness_countdown_cancelled: '&bThe peacefulness status change countdown was cancelled.' -msg_war_common_town_became_peaceful: '&b%s has been confirmed as Peaceful.' -msg_war_common_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful.' - -msg_war_siege_town_became_peaceful: '&b%s has been confirmed as Peaceful. The town is now immune to sieges and taxes. The town''s nation choice is now restricted to nations with a strong presence in the local area. (see user-guide for more details). Residents cannot enter siege-zones or gain nation-military ranks.' -msg_war_siege_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful. The town is no longer immune to sieges and taxes. The town''s nation choice is no longer restricted. Residents can enter siege-zones and gain nation-military ranks.' -msg_war_siege_cannot_add_nation_military_rank_to_peaceful_resident: '&cUnable to add military rank to resident, because they are in a peaceful town.' -msg_war_siege_peaceful_player_punished_for_being_in_siegezone: '&cWar-allergy active. To remove this effect, leave the siege-zone immediately.' -msg_war_siege_err_cannot_attack_peaceful_town: '&cYou cannot attack a peaceful town.' -msg_war_siege_peaceful_town_cannot_join_nation: 'c%s [PEACEFUL] cannot join %s, because the nation does not have a guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_zero: '&cYou cannot revolt at this time, because there are no guardian towns nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_one: '&cYou cannot revolt at this time, because there is only 1 guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_changed_nation: "&b%s has peacefully changed hands, moving from %s to %s." -msg_war_siege_peaceful_town_joined_nation: "&b%s has peacefully joined %s." -msg_war_siege_peaceful_town_left_nation: "&b%s has peacefully left %s." -msg_war_siege_warning_peaceful_town_should_not_create_nation: '&cYou are about to make a peaceful town into a nation capital. This is usually a bad idea, because the nation could fall without a fight.' -msg_war_siege_peaceful_towns_cannot_make_nations: '&cPeaceful towns cannot found nations!' - -#Siege immunities -msg_set_siege_immunities_town: 'Siege immunity for town %s set to %s hours.' -msg_set_siege_immunities_nation: 'Siege immunities for all towns in nation %s set to %s hours.' -msg_set_siege_immunities_all: 'Siege immunities for all towns set to %s hours.' - -#Battle sessions -msg_war_siege_battle_session_started: '&2Battle session started. You are free to enter any siege-zone for the next %s. After that you will get a %s rest from battle.' -msg_war_siege_battle_session_warning: '&cYour battle session will expire in %s. To avoid battle-fatigue, exit any siege zone you are in (and/or return to your own town).' -msg_war_siege_battle_session_expired: '&cBattle session expired. Battle-fatigue active. To remove this effect, leave the siege-zone (and/or return to your own town). You can return in %s.' -msg_war_siege_battle_session_ended: '&2Battle session ended. The next time you enter a siege-zone, a new battle session will begin.' - -#Siege-zone block placement restrictions -msg_war_siege_zone_block_placement_forbidden: '&cYou cannot place this type of block in the wilderness area of a siege zone.' -msg_war_siege_zone_bucket_emptying_forbidden: '&cYou cannot use this type of bucket in the wilderness area of a siege zone.' - -#Nation Refund -nation_help_11 : 'Claim all your nation refunds.' - -#Added in 0.02: -admin_help_1: 'Reload the config and language file.' -config_and_lang_file_reloaded_successfully: 'Config and Language file reloaded successfully.' -config_and_lang_file_could_not_be_loaded: 'Reload unsuccessful. See console for details.' -status_yes: '&aYES' -status_no: '&cNO' - -#Added in 0.03: -msg_err_no_money: '&cThere is not enough money in the bank.' - -#Added in 0.04: -msg_war_siege_peaceful_town_total_switches: '&b%d peaceful town%s %s peacefully switched nations.' -msg_err_not_registered_1: '&c%s is not registered.' -msg_error_must_be_num: '&bAmount must be a number.' - -#Added in 0.05: -msg_err_not_being_sieged: '&bTown %s does not have any active sieges.' -msg_err_town_not_registered: '&cTown %s is not registered.' - -#Scoreboard -hud_title: 'Siege' -hud_siegestatus: 'Siege Status' -hud_attackers: 'ATK: ' -hud_defenders: 'DEF: ' -hud_points: 'Points: ' -hud_banner_control: 'Banner Ctrl: ' -hud_time_remaining: 'Time Left: ' - -msg_err_peaceful_town_pvp_forced_off: '&cPeaceful towns have PVP forced OFF.' -msg_swa_set_points_success: '&bSuccessfully set siege points to %d for %s.' -msg_swa_resident_already_has_control: '&cResident %s already has control.' -msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." -msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' -msg_swa_set_captured_success: '&bSet captured to %s for %s.' - -siege_status_in_progress: 'In Progress' -siege_status_attacker_win: 'Attacker Win' -siege_status_defender_win: 'Defender Win' -siege_status_attacker_abandon: 'Attacker Abandon' -siege_status_defender_surrender: 'Defender Surrender' -siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' -siege_status_pending_defender_surrender: 'Pending Defender Surrender' -siege_status_unknown: 'Unknown' - -dynmap_siege_title: 'Siege: %s' -dynmap_siege_attacker: 'Attacker: %s' -dynmap_siege_defender: 'Defender: %s' -dynmap_siege_points: 'Points: %d' -dynmap_siege_banner_control: 'Banner Control: %s' -dynmap_siege_status: 'Status: %s' -dynmap_siege_status_in_progress: 'In Progress' -dynmap_siege_status_pending_surrender: 'Pending Surrender' -dynmap_siege_status_pending_abandon: 'Pending Abandon' -dynmap_siege_time_left: 'Time Left: %s' -dynmap_siege_war_chest: 'War Chest: %s' - -#Added in 0.06: -msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' -msg_swa_remove_siege_success: '&bSuccessfully removed siege.' -msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' - -#War sickness -msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' -msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' \ No newline at end of file +name: SiegeWar +version: 0.06 +language: english +author: Goosius +website: 'http://townyadvanced.github.io/' +description: > + Language file for all game messages. Do not alter this file. + If you wish to change any of the entries, make a copy named something else. + Alternate language files can be enabled by altering the + [language] entry in config.yml +# +# +# You MUST retain spacing in the texts. +# If a text begins or ends with a space, it must remain that way. +# +# +# %s = data to be supplied by the plugin. + +# Text colouring +# -------------- +# Black = &0, Navy = &1, Green = &2, Blue = &3, Red = &4 +# Purple = &5, Gold = &6, LightGray = &7, Gray = &8 +# DarkPurple = &9, LightGreen = &a, LightBlue = &b +# Rose = &c, LightPurple = &d, Yellow = &e, White = &f + +plugin_prefix: '&f[&6SiegeWar&f] ' +msg_err_command_disable: '&cYou don''t have enough permissions for that command.' + +#Added in (Siegewar version) +#Siege war happy-path messages +msg_siege_war_revolt: '&bThe people of %s, led by %s, have revolted against %s, and declared themselves free to choose their own destiny!' +msg_siege_war_siege_started_neutral_town: '&bAn army belonging to %s has attacked %s. A siege has begun!' +msg_siege_war_siege_started_nation_town: '&bAn army belonging to %s has attacked %s at %s. A siege has begun!' +msg_siege_war_attack_pay_war_chest: '&bA war-chest has been prepared by %s, with a value of %s. Whoever wins the siege will get this money.' +msg_siege_war_attack_recover_war_chest: '&bThe war chest has been recovered by %s, with a value of %s.' +msg_siege_war_attacker_death: '&bSiege of %s > Attacker died > %s > Siege points -%d' +msg_siege_war_defender_death: '&bSiege of %s > Defender died > %s > Siege points +%d' +msg_siege_war_defender_win: '&bThe defenders of %s have successfully driven off all attacking armies. The siege has failed!' +msg_siege_war_attacker_win: '&bAn army belonging to %s has successfully breached the defences of %s. The siege is over!' +msg_siege_war_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. The defenders are victorious!' +msg_siege_war_pending_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. Defender victory will be confirmed in %s!' +msg_siege_war_town_surrender: '&b%s has surrendered to an army belonging to %s. The attackers are victorious!' +msg_siege_war_pending_town_surrender: '&b%s has surrendered to an army belonging to %s. Attacker victory will be confirmed in %s!' +msg_siege_war_neutral_town_captured: '&b%s has been captured by %s!' +msg_siege_war_nation_town_captured: '&b%s, previously belonging to %s, has been captured by %s!' +msg_siege_war_neutral_town_plundered: '&b%s has been plundered of %s by %s!' +msg_siege_war_nation_town_plundered: '&b%s has been plundered of %s by %s!' +msg_siege_war_town_ruined_from_plunder: '&b%s has been reduced to ruins by %s!' +msg_siege_war_town_bankrupted_from_plunder: '&b%s has been bankrupted by %s!' +msg_siege_war_nation_defeated: '&b%s has been defeated!.' +msg_siege_war_attacking_troops_at_siege_banner: '&bSiege on %s > Attackers are at the siege banner.' +msg_siege_war_defending_troops_at_siege_banner: '&bSiege on %s > Town defenders are at the siege banner.' +msg_siege_war_banner_control_session_started: '&bBanner control session started. Remain close to the siege-banner (%d blocks horizonally, %d blocks vertically), outside the town, and not flying, for %s. If your session succeeds, you will gain banner control for your side (or be added to the banner control list).' +msg_siege_war_banner_control_session_success: '&bBanner control session succeeded!. You have been added to the banner control list.' +msg_siege_war_banner_control_gained_by_attacker: '&bSiege on %s > The attackers have gained banner control.' +msg_siege_war_banner_control_gained_by_defender: '&bSiege on %s > The defenders have gained banner control.' +msg_siege_war_nation_refund_available: "A nation refund of %s is now available to you. It can be claimed using '/sw nation refund'" +msg_siege_war_nation_refund_claimed: "You have claimed the nation refund of %s." +msg_town_destroyed_by_nation_tax: '&b%s couldn''t pay taxes and has fallen.' +msg_town_destroyed_by_nation_tax_multiple: '&bThe following towns could not afford the nation tax and have fallen: ' + +#Siege war error message +#Town Toggling +msg_err_siege_besieged_town_cannot_toggle_pvp: "&cBesieged towns have PVP forced ON." +msg_err_siege_besieged_town_cannot_toggle_explosions: "&cBesieged towns have Explosions forced ON." +#Recruiting +msg_err_siege_besieged_town_cannot_toggle_open_off: "&cBesieged towns cannot open their doors to new residents." +msg_err_siege_besieged_town_cannot_recruit: "&cBesieged towns cannot recruit new residents." +#Claiming/Unclaiming +msg_err_siege_claim_too_near_siege_zone: "&cThe claim is too close to a siege." +msg_err_siege_besieged_town_cannot_claim: "&cBesieged towns cannot claim new land." +msg_err_siege_besieged_town_cannot_unclaim: "&cBesieged towns (or towns which recently lost a siege) cannot un-claim land." +msg_err_war_common_occupied_town_cannot_unclaim: "&cOccupied towns cannot un-claim land." +#Nation Delete +msg_err_siege_war_delete_nation_warning: "WARNING!!!: If you delete your nation you will be refunded %s. This can be claimed later by using '/sw nation refund'." +msg_err_siege_war_nation_refund_unavailable: "There is no nation refund available to you." +#Revolt +msg_err_siege_war_town_voluntary_leave_impossible: "&cTowns cannot leave nations without agreement. To leave your nation, persuade the king (or an assistant) to kick your town." +msg_err_siege_war_revolt_immunity_active: "&cYour town has revolt immunity. It cannot revolt until the revolt immunity expires." +#Attack +msg_err_siege_war_not_enabled_in_world: '&cWar is not enabled in this world.' +msg_err_siege_war_banner_must_be_placed_above_ground: '&cThe siege banner must be placed above ground.' +msg_err_siege_war_action_not_a_town_member: '&cYou must be a member of a town to do this action.' +msg_err_siege_war_action_not_a_nation_member: '&cYou must be a member of a nation to do this action.' +msg_err_siege_war_cannot_attack_own_town: '&cYou cannot attack your own town.' +msg_err_siege_war_cannot_attack_town_in_own_nation: '&cYou cannot attack a town in your own nation.' +msg_err_siege_war_cannot_attack_non_enemy_nation: '&cYou cannot attack a town unless the nation of that town is an enemy of your nation.' +msg_err_siege_war_too_many_adjacent_cardinal_town_blocks: '&cYou cannot perform this action because this chunk is facing more than one town block. Try placing the item in a different area.' +msg_err_siege_war_too_many_adjacent_towns: '&cYou cannot perform this action because there are multiple towns adjacent to this chunk. Try placing the item in a different area.' +msg_err_siege_war_nation_already_attacking_town: '&cYour nation is already attacking this town.' +msg_err_siege_war_cannot_attack_siege_immunity: '&cThe target town has siege immunity. It cannot be attacked until the siege immunity expires.' +msg_err_siege_war_cannot_place_banner_far_above_town: 'The siege banner cannot be placed on a much higher elevation than the town. Try placing the banner at a lower elevation' +msg_err_siege_war_cannot_join_siege: '&cYou cannot attack a town while it is under siege by another nation.' +msg_err_siege_war_nation_has_too_many_active_siege_attacks: '&cYour nation is at the maximum number of concurrent siege-attacks. To start another attack, one or more of the current attacks must finish.' +msg_err_siege_war_town_not_close_enough_to_nation: '&cThe town is too far away from your nation capital to be attacked.' +#Abandon +msg_err_siege_war_cannot_abandon_no_nearby_siege_attacks: '&cYou cannot abandon because there are no active siege banners nearby.' +msg_err_siege_war_cannot_abandon_nation_not_attacking_zone: '&cYou cannot abandon because your nation is not attacking in this area.' +msg_err_siege_war_cannot_abandon_siege_over: '&cYou cannot abandon because the siege is over.' +#Invade +msg_err_siege_war_cannot_invade_own_town: '&cYou cannot capture your own town.' +msg_err_siege_war_cannot_invade_without_victory: "&cYou cannot capture the town unless your nation is victorious in the siege." +msg_err_siege_war_no_siege_on_target_town: '&cThere is no siege on the target town of %s.' +msg_err_siege_war_town_already_invaded: '&cThis town has already been captured' +msg_err_siege_war_town_already_belongs_to_your_nation: '&cThis town already belongs to your nation' +#Plunder +msg_err_siege_war_cannot_plunder_own_town: '&cYou cannot plunder your own town.' +msg_err_siege_war_cannot_plunder_without_victory: "&cYou cannot plunder unless your nation is victorious in the siege." +msg_err_siege_war_cannot_plunder_without_economy: "&cYou cannot plunder because no economy plugin is active" +msg_err_siege_war_town_already_plundered: '&cThis town has already been plundered.' +#Surrender +msg_err_siege_war_cannot_surrender_not_your_town: '&cYou cannot surrender because this is not your town.' +msg_err_siege_war_cannot_surrender_siege_finished: '&cYou cannot surrender because the siege is over.' +#Block change +msg_err_siege_war_cannot_destroy_siege_banner: "&cWhile the siege is in progress you cannot destroy the siege banner or the block it is attached to." +msg_err_siege_war_nation_zone_this_area_protected_but_besieged: '&cThis part of the %s is under the protection of %s, and also cannot be altered while the nearby town is under siege.' +msg_err_siege_war_banner_support_block_not_stable: "&cYou cannot place the banner on unstable ground e.g. sand or gravel." +# Spawn +msg_err_siege_war_cannot_spawn_into_siegezone_or_besieged_town: '&cOnly town residents can spawn into a besieged town or siege zone (unless the target town is peaceful).' +#Banner control +msg_siege_war_banner_control_session_failure: '&cBanner control session failed!. Common causes for this include: Going into the town, too far from the banner, or flying.' +msg_war_siege_zone_milk_bucket_forbidden_while_attempting_banner_control: 'You cannot use this item while in a banner control session.' + +#Town Info Siege Section +status_town_revolt_immunity_timer: '&2Revolt Immunity Timer: &a%s' +status_town_siege_status: '&2Siege: &a%s' +status_town_siege_status_in_progress: 'In Progress' +status_town_siege_status_attacker_win: 'Attacker Victory - %s' +status_town_siege_status_defender_win: 'Town Victory' +status_town_siege_status_attacker_abandon: 'Attacker Retreat' +status_town_siege_status_defender_surrender: 'Town Surrender - to %s' +status_town_siege_status_pending_attacker_abandon: 'Attacker Retreat Pending, in %s' +status_town_siege_status_pending_defender_surrender: 'Town Surrender Pending, in %s' + +status_town_siege_status_besieger: '&2 > Besieger: &a%s {%s}' +status_town_siege_status_banner_xyz: '&2 > Banner XYZ: &a%d,%d,%d' +status_town_siege_immunity_timer: '&2 > Immunity Timer: &a%s' +status_town_siege_victory_timer: '&2 > Victory Timer: &a%s' +status_town_siege_invaded_plundered_status: '&2 > Town Captured: %s &2Town Plundered: %s' +status_town_banner_control: '&2 > Banner Control: %s &a[%s]&2: &f' +status_town_banner_control_nobody: '&2 > Banner Control: %s' + +#Nation Info Siege Section +status_nation_siege_attacks: '&2Siege Attacks &a[%s]&2: &f' +status_nation_siege_defences: '&2Siege Defences &a[%s]&2: &f' + +#General +msg_days: ' days' +status_no_green: '&aNO' +msg_occupier: '&4*Occupier*' +msg_nobody: '&aNobody' +msg_attackers: '&aAttackers' +msg_defenders: '&aDefenders' + +#Town Peacefulness +status_town_peacefulness_status_change_timer: '&2Countdown To Peacefulness Status Change: &a%d days' +msg_war_common_town_declared_peaceful: '&bPeacefulness Declared!. The town will be confirmed as peaceful in %d day(s).' +msg_war_common_town_declared_non_peaceful: '&bNon-Peacefulness Declared!. The town will be confirmed as non-peaceful in %d day(s).' +msg_war_common_town_peacefulness_countdown_cancelled: '&bThe peacefulness status change countdown was cancelled.' +msg_war_common_town_became_peaceful: '&b%s has been confirmed as Peaceful.' +msg_war_common_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful.' + +msg_war_siege_town_became_peaceful: '&b%s has been confirmed as Peaceful. The town is now immune to sieges and taxes. The town''s nation choice is now restricted to nations with a strong presence in the local area. (see user-guide for more details). Residents cannot enter siege-zones or gain nation-military ranks.' +msg_war_siege_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful. The town is no longer immune to sieges and taxes. The town''s nation choice is no longer restricted. Residents can enter siege-zones and gain nation-military ranks.' +msg_war_siege_cannot_add_nation_military_rank_to_peaceful_resident: '&cUnable to add military rank to resident, because they are in a peaceful town.' +msg_war_siege_peaceful_player_punished_for_being_in_siegezone: '&cWar-allergy active. To remove this effect, leave the siege-zone immediately.' +msg_war_siege_err_cannot_attack_peaceful_town: '&cYou cannot attack a peaceful town.' +msg_war_siege_peaceful_town_cannot_join_nation: 'c%s [PEACEFUL] cannot join %s, because the nation does not have a guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_zero: '&cYou cannot revolt at this time, because there are no guardian towns nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_one: '&cYou cannot revolt at this time, because there is only 1 guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_changed_nation: "&b%s has peacefully changed hands, moving from %s to %s." +msg_war_siege_peaceful_town_joined_nation: "&b%s has peacefully joined %s." +msg_war_siege_peaceful_town_left_nation: "&b%s has peacefully left %s." +msg_war_siege_warning_peaceful_town_should_not_create_nation: '&cYou are about to make a peaceful town into a nation capital. This is usually a bad idea, because the nation could fall without a fight.' +msg_war_siege_peaceful_towns_cannot_make_nations: '&cPeaceful towns cannot found nations!' + +#Siege immunities +msg_set_siege_immunities_town: 'Siege immunity for town %s set to %s hours.' +msg_set_siege_immunities_nation: 'Siege immunities for all towns in nation %s set to %s hours.' +msg_set_siege_immunities_all: 'Siege immunities for all towns set to %s hours.' + +#Battle sessions +msg_war_siege_battle_session_started: '&2Battle session started. You are free to enter any siege-zone for the next %s. After that you will get a %s rest from battle.' +msg_war_siege_battle_session_warning: '&cYour battle session will expire in %s. To avoid battle-fatigue, exit any siege zone you are in (and/or return to your own town).' +msg_war_siege_battle_session_expired: '&cBattle session expired. Battle-fatigue active. To remove this effect, leave the siege-zone (and/or return to your own town). You can return in %s.' +msg_war_siege_battle_session_ended: '&2Battle session ended. The next time you enter a siege-zone, a new battle session will begin.' + +#Siege-zone block placement restrictions +msg_war_siege_zone_block_placement_forbidden: '&cYou cannot place this type of block in the wilderness area of a siege zone.' +msg_war_siege_zone_bucket_emptying_forbidden: '&cYou cannot use this type of bucket in the wilderness area of a siege zone.' + +#Nation Refund +nation_help_11 : 'Claim all your nation refunds.' + +#Added in 0.02: +admin_help_1: 'Reload the config and language file.' +config_and_lang_file_reloaded_successfully: 'Config and Language file reloaded successfully.' +config_and_lang_file_could_not_be_loaded: 'Reload unsuccessful. See console for details.' +status_yes: '&aYES' +status_no: '&cNO' + +#Added in 0.03: +msg_err_no_money: '&cThere is not enough money in the bank.' + +#Added in 0.04: +msg_war_siege_peaceful_town_total_switches: '&b%d peaceful town%s %s peacefully switched nations.' +msg_err_not_registered_1: '&c%s is not registered.' +msg_error_must_be_num: '&bAmount must be a number.' + +#Added in 0.05: +msg_err_not_being_sieged: '&bTown %s does not have any active sieges.' +msg_err_town_not_registered: '&cTown %s is not registered.' + +#Scoreboard +hud_title: 'Siege' +hud_siegestatus: 'Siege Status' +hud_attackers: 'ATK: ' +hud_defenders: 'DEF: ' +hud_points: 'Points: ' +hud_banner_control: 'Banner Ctrl: ' +hud_time_remaining: 'Time Left: ' + +msg_err_peaceful_town_pvp_forced_off: '&cPeaceful towns have PVP forced OFF.' +msg_swa_set_points_success: '&bSuccessfully set siege points to %d for %s.' +msg_swa_resident_already_has_control: '&cResident %s already has control.' +msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." +msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' +msg_swa_set_captured_success: '&bSet captured to %s for %s.' + +siege_status_in_progress: 'In Progress' +siege_status_attacker_win: 'Attacker Win' +siege_status_defender_win: 'Defender Win' +siege_status_attacker_abandon: 'Attacker Abandon' +siege_status_defender_surrender: 'Defender Surrender' +siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' +siege_status_pending_defender_surrender: 'Pending Defender Surrender' +siege_status_unknown: 'Unknown' + +dynmap_siege_title: 'Siege: %s' +dynmap_siege_attacker: 'Attacker: %s' +dynmap_siege_defender: 'Defender: %s' +dynmap_siege_points: 'Points: %d' +dynmap_siege_banner_control: 'Banner Control: %s' +dynmap_siege_status: 'Status: %s' +dynmap_siege_status_in_progress: 'In Progress' +dynmap_siege_status_pending_surrender: 'Pending Surrender' +dynmap_siege_status_pending_abandon: 'Pending Abandon' +dynmap_siege_time_left: 'Time Left: %s' +dynmap_siege_war_chest: 'War Chest: %s' + +#Added in 0.06: +msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' +msg_swa_remove_siege_success: '&bSuccessfully removed siege.' +msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' + +#War sickness +msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' From ea3af298b0b756c6ffc6671489bb1b7b8a21ae7d Mon Sep 17 00:00:00 2001 From: ceeedric <62527577+ceeedric@users.noreply.github.com> Date: Thu, 21 Jan 2021 17:04:54 -0600 Subject: [PATCH 33/34] Delete english.yml --- src/main/resources/english.yml | 259 --------------------------------- 1 file changed, 259 deletions(-) delete mode 100644 src/main/resources/english.yml diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml deleted file mode 100644 index daa781533..000000000 --- a/src/main/resources/english.yml +++ /dev/null @@ -1,259 +0,0 @@ -name: SiegeWar -version: 0.06 -language: english -author: Goosius -website: 'http://townyadvanced.github.io/' -description: > - Language file for all game messages. Do not alter this file. - If you wish to change any of the entries, make a copy named something else. - Alternate language files can be enabled by altering the - [language] entry in config.yml -# -# -# You MUST retain spacing in the texts. -# If a text begins or ends with a space, it must remain that way. -# -# -# %s = data to be supplied by the plugin. - -# Text colouring -# -------------- -# Black = &0, Navy = &1, Green = &2, Blue = &3, Red = &4 -# Purple = &5, Gold = &6, LightGray = &7, Gray = &8 -# DarkPurple = &9, LightGreen = &a, LightBlue = &b -# Rose = &c, LightPurple = &d, Yellow = &e, White = &f - -plugin_prefix: '&f[&6SiegeWar&f] ' -msg_err_command_disable: '&cYou don''t have enough permissions for that command.' - -#Added in (Siegewar version) -#Siege war happy-path messages -msg_siege_war_revolt: '&bThe people of %s, led by %s, have revolted against %s, and declared themselves free to choose their own destiny!' -msg_siege_war_siege_started_neutral_town: '&bAn army belonging to %s has attacked %s. A siege has begun!' -msg_siege_war_siege_started_nation_town: '&bAn army belonging to %s has attacked %s at %s. A siege has begun!' -msg_siege_war_attack_pay_war_chest: '&bA war-chest has been prepared by %s, with a value of %s. Whoever wins the siege will get this money.' -msg_siege_war_attack_recover_war_chest: '&bThe war chest has been recovered by %s, with a value of %s.' -msg_siege_war_attacker_death: '&bSiege of %s > Attacker died > %s > Siege points -%d' -msg_siege_war_defender_death: '&bSiege of %s > Defender died > %s > Siege points +%d' -msg_siege_war_defender_win: '&bThe defenders of %s have successfully driven off all attacking armies. The siege has failed!' -msg_siege_war_attacker_win: '&bAn army belonging to %s has successfully breached the defences of %s. The siege is over!' -msg_siege_war_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. The defenders are victorious!' -msg_siege_war_pending_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. Defender victory will be confirmed in %s!' -msg_siege_war_town_surrender: '&b%s has surrendered to an army belonging to %s. The attackers are victorious!' -msg_siege_war_pending_town_surrender: '&b%s has surrendered to an army belonging to %s. Attacker victory will be confirmed in %s!' -msg_siege_war_neutral_town_captured: '&b%s has been captured by %s!' -msg_siege_war_nation_town_captured: '&b%s, previously belonging to %s, has been captured by %s!' -msg_siege_war_neutral_town_plundered: '&b%s has been plundered of %s by %s!' -msg_siege_war_nation_town_plundered: '&b%s has been plundered of %s by %s!' -msg_siege_war_town_ruined_from_plunder: '&b%s has been reduced to ruins by %s!' -msg_siege_war_town_bankrupted_from_plunder: '&b%s has been bankrupted by %s!' -msg_siege_war_nation_defeated: '&b%s has been defeated!.' -msg_siege_war_attacking_troops_at_siege_banner: '&bSiege on %s > Attackers are at the siege banner.' -msg_siege_war_defending_troops_at_siege_banner: '&bSiege on %s > Town defenders are at the siege banner.' -msg_siege_war_banner_control_session_started: '&bBanner control session started. Remain close to the siege-banner (%d blocks horizonally, %d blocks vertically), outside the town, and not flying, for %s. If your session succeeds, you will gain banner control for your side (or be added to the banner control list).' -msg_siege_war_banner_control_session_success: '&bBanner control session succeeded!. You have been added to the banner control list.' -msg_siege_war_banner_control_gained_by_attacker: '&bSiege on %s > The attackers have gained banner control.' -msg_siege_war_banner_control_gained_by_defender: '&bSiege on %s > The defenders have gained banner control.' -msg_siege_war_nation_refund_available: "A nation refund of %s is now available to you. It can be claimed using '/sw nation refund'" -msg_siege_war_nation_refund_claimed: "You have claimed the nation refund of %s." -msg_town_destroyed_by_nation_tax: '&b%s couldn''t pay taxes and has fallen.' -msg_town_destroyed_by_nation_tax_multiple: '&bThe following towns could not afford the nation tax and have fallen: ' - -#Siege war error message -#Town Toggling -msg_err_siege_besieged_town_cannot_toggle_pvp: "&cBesieged towns have PVP forced ON." -msg_err_siege_besieged_town_cannot_toggle_explosions: "&cBesieged towns have Explosions forced ON." -#Recruiting -msg_err_siege_besieged_town_cannot_toggle_open_off: "&cBesieged towns cannot open their doors to new residents." -msg_err_siege_besieged_town_cannot_recruit: "&cBesieged towns cannot recruit new residents." -#Claiming/Unclaiming -msg_err_siege_claim_too_near_siege_zone: "&cThe claim is too close to a siege." -msg_err_siege_besieged_town_cannot_claim: "&cBesieged towns cannot claim new land." -msg_err_siege_besieged_town_cannot_unclaim: "&cBesieged towns (or towns which recently lost a siege) cannot un-claim land." -msg_err_war_common_occupied_town_cannot_unclaim: "&cOccupied towns cannot un-claim land." -#Nation Delete -msg_err_siege_war_delete_nation_warning: "WARNING!!!: If you delete your nation you will be refunded %s. This can be claimed later by using '/sw nation refund'." -msg_err_siege_war_nation_refund_unavailable: "There is no nation refund available to you." -#Revolt -msg_err_siege_war_town_voluntary_leave_impossible: "&cTowns cannot leave nations without agreement. To leave your nation, persuade the king (or an assistant) to kick your town." -msg_err_siege_war_revolt_immunity_active: "&cYour town has revolt immunity. It cannot revolt until the revolt immunity expires." -#Attack -msg_err_siege_war_not_enabled_in_world: '&cWar is not enabled in this world.' -msg_err_siege_war_banner_must_be_placed_above_ground: '&cThe siege banner must be placed above ground.' -msg_err_siege_war_action_not_a_town_member: '&cYou must be a member of a town to do this action.' -msg_err_siege_war_action_not_a_nation_member: '&cYou must be a member of a nation to do this action.' -msg_err_siege_war_cannot_attack_own_town: '&cYou cannot attack your own town.' -msg_err_siege_war_cannot_attack_town_in_own_nation: '&cYou cannot attack a town in your own nation.' -msg_err_siege_war_cannot_attack_non_enemy_nation: '&cYou cannot attack a town unless the nation of that town is an enemy of your nation.' -msg_err_siege_war_too_many_adjacent_cardinal_town_blocks: '&cYou cannot perform this action because this chunk is facing more than one town block. Try placing the item in a different area.' -msg_err_siege_war_too_many_adjacent_towns: '&cYou cannot perform this action because there are multiple towns adjacent to this chunk. Try placing the item in a different area.' -msg_err_siege_war_nation_already_attacking_town: '&cYour nation is already attacking this town.' -msg_err_siege_war_cannot_attack_siege_immunity: '&cThe target town has siege immunity. It cannot be attacked until the siege immunity expires.' -msg_err_siege_war_cannot_place_banner_far_above_town: 'The siege banner cannot be placed on a much higher elevation than the town. Try placing the banner at a lower elevation' -msg_err_siege_war_cannot_join_siege: '&cYou cannot attack a town while it is under siege by another nation.' -msg_err_siege_war_nation_has_too_many_active_siege_attacks: '&cYour nation is at the maximum number of concurrent siege-attacks. To start another attack, one or more of the current attacks must finish.' -msg_err_siege_war_town_not_close_enough_to_nation: '&cThe town is too far away from your nation capital to be attacked.' -#Abandon -msg_err_siege_war_cannot_abandon_no_nearby_siege_attacks: '&cYou cannot abandon because there are no active siege banners nearby.' -msg_err_siege_war_cannot_abandon_nation_not_attacking_zone: '&cYou cannot abandon because your nation is not attacking in this area.' -msg_err_siege_war_cannot_abandon_siege_over: '&cYou cannot abandon because the siege is over.' -#Invade -msg_err_siege_war_cannot_invade_own_town: '&cYou cannot capture your own town.' -msg_err_siege_war_cannot_invade_without_victory: "&cYou cannot capture the town unless your nation is victorious in the siege." -msg_err_siege_war_no_siege_on_target_town: '&cThere is no siege on the target town of %s.' -msg_err_siege_war_town_already_invaded: '&cThis town has already been captured' -msg_err_siege_war_town_already_belongs_to_your_nation: '&cThis town already belongs to your nation' -#Plunder -msg_err_siege_war_cannot_plunder_own_town: '&cYou cannot plunder your own town.' -msg_err_siege_war_cannot_plunder_without_victory: "&cYou cannot plunder unless your nation is victorious in the siege." -msg_err_siege_war_cannot_plunder_without_economy: "&cYou cannot plunder because no economy plugin is active" -msg_err_siege_war_town_already_plundered: '&cThis town has already been plundered.' -#Surrender -msg_err_siege_war_cannot_surrender_not_your_town: '&cYou cannot surrender because this is not your town.' -msg_err_siege_war_cannot_surrender_siege_finished: '&cYou cannot surrender because the siege is over.' -#Block change -msg_err_siege_war_cannot_destroy_siege_banner: "&cWhile the siege is in progress you cannot destroy the siege banner or the block it is attached to." -msg_err_siege_war_nation_zone_this_area_protected_but_besieged: '&cThis part of the %s is under the protection of %s, and also cannot be altered while the nearby town is under siege.' -msg_err_siege_war_banner_support_block_not_stable: "&cYou cannot place the banner on unstable ground e.g. sand or gravel." -# Spawn -msg_err_siege_war_cannot_spawn_into_siegezone_or_besieged_town: '&cOnly town residents can spawn into a besieged town or siege zone (unless the target town is peaceful).' -#Banner control -msg_siege_war_banner_control_session_failure: '&cBanner control session failed!. Common causes for this include: Going into the town, too far from the banner, or flying.' -msg_war_siege_zone_milk_bucket_forbidden_while_attempting_banner_control: 'You cannot use this item while in a banner control session.' - -#Town Info Siege Section -status_town_revolt_immunity_timer: '&2Revolt Immunity Timer: &a%s' -status_town_siege_status: '&2Siege: &a%s' -status_town_siege_status_in_progress: 'In Progress' -status_town_siege_status_attacker_win: 'Attacker Victory - %s' -status_town_siege_status_defender_win: 'Town Victory' -status_town_siege_status_attacker_abandon: 'Attacker Retreat' -status_town_siege_status_defender_surrender: 'Town Surrender - to %s' -status_town_siege_status_pending_attacker_abandon: 'Attacker Retreat Pending, in %s' -status_town_siege_status_pending_defender_surrender: 'Town Surrender Pending, in %s' - -status_town_siege_status_besieger: '&2 > Besieger: &a%s {%s}' -status_town_siege_status_banner_xyz: '&2 > Banner XYZ: &a%d,%d,%d' -status_town_siege_immunity_timer: '&2 > Immunity Timer: &a%s' -status_town_siege_victory_timer: '&2 > Victory Timer: &a%s' -status_town_siege_invaded_plundered_status: '&2 > Town Captured: %s &2Town Plundered: %s' -status_town_banner_control: '&2 > Banner Control: %s &a[%s]&2: &f' -status_town_banner_control_nobody: '&2 > Banner Control: %s' - -#Nation Info Siege Section -status_nation_siege_attacks: '&2Siege Attacks &a[%s]&2: &f' -status_nation_siege_defences: '&2Siege Defences &a[%s]&2: &f' - -#General -msg_days: ' days' -status_no_green: '&aNO' -msg_occupier: '&4*Occupier*' -msg_nobody: '&aNobody' -msg_attackers: '&aAttackers' -msg_defenders: '&aDefenders' - -#Town Peacefulness -status_town_peacefulness_status_change_timer: '&2Countdown To Peacefulness Status Change: &a%d days' -msg_war_common_town_declared_peaceful: '&bPeacefulness Declared!. The town will be confirmed as peaceful in %d day(s).' -msg_war_common_town_declared_non_peaceful: '&bNon-Peacefulness Declared!. The town will be confirmed as non-peaceful in %d day(s).' -msg_war_common_town_peacefulness_countdown_cancelled: '&bThe peacefulness status change countdown was cancelled.' -msg_war_common_town_became_peaceful: '&b%s has been confirmed as Peaceful.' -msg_war_common_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful.' - -msg_war_siege_town_became_peaceful: '&b%s has been confirmed as Peaceful. The town is now immune to sieges and taxes. The town''s nation choice is now restricted to nations with a strong presence in the local area. (see user-guide for more details). Residents cannot enter siege-zones or gain nation-military ranks.' -msg_war_siege_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful. The town is no longer immune to sieges and taxes. The town''s nation choice is no longer restricted. Residents can enter siege-zones and gain nation-military ranks.' -msg_war_siege_cannot_add_nation_military_rank_to_peaceful_resident: '&cUnable to add military rank to resident, because they are in a peaceful town.' -msg_war_siege_peaceful_player_punished_for_being_in_siegezone: '&cWar-allergy active. To remove this effect, leave the siege-zone immediately.' -msg_war_siege_err_cannot_attack_peaceful_town: '&cYou cannot attack a peaceful town.' -msg_war_siege_peaceful_town_cannot_join_nation: 'c%s [PEACEFUL] cannot join %s, because the nation does not have a guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_zero: '&cYou cannot revolt at this time, because there are no guardian towns nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_one: '&cYou cannot revolt at this time, because there is only 1 guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' -msg_war_siege_peaceful_town_changed_nation: "&b%s has peacefully changed hands, moving from %s to %s." -msg_war_siege_peaceful_town_joined_nation: "&b%s has peacefully joined %s." -msg_war_siege_peaceful_town_left_nation: "&b%s has peacefully left %s." -msg_war_siege_warning_peaceful_town_should_not_create_nation: '&cYou are about to make a peaceful town into a nation capital. This is usually a bad idea, because the nation could fall without a fight.' -msg_war_siege_peaceful_towns_cannot_make_nations: '&cPeaceful towns cannot found nations!' - -#Siege immunities -msg_set_siege_immunities_town: 'Siege immunity for town %s set to %s hours.' -msg_set_siege_immunities_nation: 'Siege immunities for all towns in nation %s set to %s hours.' -msg_set_siege_immunities_all: 'Siege immunities for all towns set to %s hours.' - -#Battle sessions -msg_war_siege_battle_session_started: '&2Battle session started. You are free to enter any siege-zone for the next %s. After that you will get a %s rest from battle.' -msg_war_siege_battle_session_warning: '&cYour battle session will expire in %s. To avoid battle-fatigue, exit any siege zone you are in (and/or return to your own town).' -msg_war_siege_battle_session_expired: '&cBattle session expired. Battle-fatigue active. To remove this effect, leave the siege-zone (and/or return to your own town). You can return in %s.' -msg_war_siege_battle_session_ended: '&2Battle session ended. The next time you enter a siege-zone, a new battle session will begin.' - -#Siege-zone block placement restrictions -msg_war_siege_zone_block_placement_forbidden: '&cYou cannot place this type of block in the wilderness area of a siege zone.' -msg_war_siege_zone_bucket_emptying_forbidden: '&cYou cannot use this type of bucket in the wilderness area of a siege zone.' - -#Nation Refund -nation_help_11 : 'Claim all your nation refunds.' - -#Added in 0.02: -admin_help_1: 'Reload the config and language file.' -config_and_lang_file_reloaded_successfully: 'Config and Language file reloaded successfully.' -config_and_lang_file_could_not_be_loaded: 'Reload unsuccessful. See console for details.' -status_yes: '&aYES' -status_no: '&cNO' - -#Added in 0.03: -msg_err_no_money: '&cThere is not enough money in the bank.' - -#Added in 0.04: -msg_war_siege_peaceful_town_total_switches: '&b%d peaceful town%s %s peacefully switched nations.' -msg_err_not_registered_1: '&c%s is not registered.' -msg_error_must_be_num: '&bAmount must be a number.' - -#Added in 0.05: -msg_err_not_being_sieged: '&bTown %s does not have any active sieges.' -msg_err_town_not_registered: '&cTown %s is not registered.' - -#Scoreboard -hud_title: 'Siege' -hud_siegestatus: 'Siege Status' -hud_attackers: 'ATK: ' -hud_defenders: 'DEF: ' -hud_points: 'Points: ' -hud_banner_control: 'Banner Ctrl: ' -hud_time_remaining: 'Time Left: ' - -msg_err_peaceful_town_pvp_forced_off: '&cPeaceful towns have PVP forced OFF.' -msg_swa_set_points_success: '&bSuccessfully set siege points to %d for %s.' -msg_swa_resident_already_has_control: '&cResident %s already has control.' -msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." -msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' -msg_swa_set_captured_success: '&bSet captured to %s for %s.' - -siege_status_in_progress: 'In Progress' -siege_status_attacker_win: 'Attacker Win' -siege_status_defender_win: 'Defender Win' -siege_status_attacker_abandon: 'Attacker Abandon' -siege_status_defender_surrender: 'Defender Surrender' -siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' -siege_status_pending_defender_surrender: 'Pending Defender Surrender' -siege_status_unknown: 'Unknown' - -dynmap_siege_title: 'Siege: %s' -dynmap_siege_attacker: 'Attacker: %s' -dynmap_siege_defender: 'Defender: %s' -dynmap_siege_points: 'Points: %d' -dynmap_siege_banner_control: 'Banner Control: %s' -dynmap_siege_status: 'Status: %s' -dynmap_siege_status_in_progress: 'In Progress' -dynmap_siege_status_pending_surrender: 'Pending Surrender' -dynmap_siege_status_pending_abandon: 'Pending Abandon' -dynmap_siege_time_left: 'Time Left: %s' -dynmap_siege_war_chest: 'War Chest: %s' - -#Added in 0.06: -msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' -msg_swa_remove_siege_success: '&bSuccessfully removed siege.' -msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' - -#War sickness -msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' -msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.' - From 8cb7258a335b3640e58f45e679f6a184e487fc7e Mon Sep 17 00:00:00 2001 From: ceeedric <62527577+ceeedric@users.noreply.github.com> Date: Thu, 21 Jan 2021 17:05:08 -0600 Subject: [PATCH 34/34] Add files via upload --- src/main/resources/english.yml | 256 +++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 src/main/resources/english.yml diff --git a/src/main/resources/english.yml b/src/main/resources/english.yml new file mode 100644 index 000000000..34b83c1f3 --- /dev/null +++ b/src/main/resources/english.yml @@ -0,0 +1,256 @@ +name: SiegeWar +version: 0.06 +language: english +author: Goosius +website: 'http://townyadvanced.github.io/' +description: > + Language file for all game messages. Do not alter this file. + If you wish to change any of the entries, make a copy named something else. + Alternate language files can be enabled by altering the + [language] entry in config.yml +# +# +# You MUST retain spacing in the texts. +# If a text begins or ends with a space, it must remain that way. +# +# +# %s = data to be supplied by the plugin. + +# Text colouring +# -------------- +# Black = &0, Navy = &1, Green = &2, Blue = &3, Red = &4 +# Purple = &5, Gold = &6, LightGray = &7, Gray = &8 +# DarkPurple = &9, LightGreen = &a, LightBlue = &b +# Rose = &c, LightPurple = &d, Yellow = &e, White = &f + +plugin_prefix: '&f[&6SiegeWar&f] ' +msg_err_command_disable: '&cYou don''t have enough permissions for that command.' + +#Added in (Siegewar version) +#Siege war happy-path messages +msg_siege_war_revolt: '&bThe people of %s, led by %s, have revolted against %s, and declared themselves free to choose their own destiny!' +msg_siege_war_siege_started_neutral_town: '&bAn army belonging to %s has attacked %s. A siege has begun!' +msg_siege_war_siege_started_nation_town: '&bAn army belonging to %s has attacked %s at %s. A siege has begun!' +msg_siege_war_attack_pay_war_chest: '&bA war-chest has been prepared by %s, with a value of %s. Whoever wins the siege will get this money.' +msg_siege_war_attack_recover_war_chest: '&bThe war chest has been recovered by %s, with a value of %s.' +msg_siege_war_attacker_death: '&bSiege of %s > Attacker died > %s > Siege points -%d' +msg_siege_war_defender_death: '&bSiege of %s > Defender died > %s > Siege points +%d' +msg_siege_war_defender_win: '&bThe defenders of %s have successfully driven off all attacking armies. The siege has failed!' +msg_siege_war_attacker_win: '&bAn army belonging to %s has successfully breached the defences of %s. The siege is over!' +msg_siege_war_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. The defenders are victorious!' +msg_siege_war_pending_attacker_abandon: '&bAn army belonging to %s has abandoned its attack on %s. Defender victory will be confirmed in %s!' +msg_siege_war_town_surrender: '&b%s has surrendered to an army belonging to %s. The attackers are victorious!' +msg_siege_war_pending_town_surrender: '&b%s has surrendered to an army belonging to %s. Attacker victory will be confirmed in %s!' +msg_siege_war_neutral_town_captured: '&b%s has been captured by %s!' +msg_siege_war_nation_town_captured: '&b%s, previously belonging to %s, has been captured by %s!' +msg_siege_war_neutral_town_plundered: '&b%s has been plundered of %s by %s!' +msg_siege_war_nation_town_plundered: '&b%s has been plundered of %s by %s!' +msg_siege_war_town_ruined_from_plunder: '&b%s has been reduced to ruins by %s!' +msg_siege_war_town_bankrupted_from_plunder: '&b%s has been bankrupted by %s!' +msg_siege_war_nation_defeated: '&b%s has been defeated!.' +msg_siege_war_attacking_troops_at_siege_banner: '&bSiege on %s > Attackers are at the siege banner.' +msg_siege_war_defending_troops_at_siege_banner: '&bSiege on %s > Town defenders are at the siege banner.' +msg_siege_war_banner_control_session_started: '&bBanner control session started. Remain close to the siege-banner (%d blocks horizonally, %d blocks vertically), outside the town, and not flying, for %s. If your session succeeds, you will gain banner control for your side (or be added to the banner control list).' +msg_siege_war_banner_control_session_success: '&bBanner control session succeeded!. You have been added to the banner control list.' +msg_siege_war_banner_control_gained_by_attacker: '&bSiege on %s > The attackers have gained banner control.' +msg_siege_war_banner_control_gained_by_defender: '&bSiege on %s > The defenders have gained banner control.' +msg_siege_war_nation_refund_available: "A nation refund of %s is now available to you. It can be claimed using '/sw nation refund'" +msg_siege_war_nation_refund_claimed: "You have claimed the nation refund of %s." +msg_town_destroyed_by_nation_tax: '&b%s couldn''t pay taxes and has fallen.' +msg_town_destroyed_by_nation_tax_multiple: '&bThe following towns could not afford the nation tax and have fallen: ' + +#Siege war error message +#Town Toggling +msg_err_siege_besieged_town_cannot_toggle_pvp: "&cBesieged towns have PVP forced ON." +msg_err_siege_besieged_town_cannot_toggle_explosions: "&cBesieged towns have Explosions forced ON." +#Recruiting +msg_err_siege_besieged_town_cannot_toggle_open_off: "&cBesieged towns cannot open their doors to new residents." +msg_err_siege_besieged_town_cannot_recruit: "&cBesieged towns cannot recruit new residents." +#Claiming/Unclaiming +msg_err_siege_claim_too_near_siege_zone: "&cThe claim is too close to a siege." +msg_err_siege_besieged_town_cannot_claim: "&cBesieged towns cannot claim new land." +msg_err_siege_besieged_town_cannot_unclaim: "&cBesieged towns (or towns which recently lost a siege) cannot un-claim land." +msg_err_war_common_occupied_town_cannot_unclaim: "&cOccupied towns cannot un-claim land." +#Nation Delete +msg_err_siege_war_delete_nation_warning: "WARNING!!!: If you delete your nation you will be refunded %s. This can be claimed later by using '/sw nation refund'." +msg_err_siege_war_nation_refund_unavailable: "There is no nation refund available to you." +#Revolt +msg_err_siege_war_town_voluntary_leave_impossible: "&cTowns cannot leave nations without agreement. To leave your nation, persuade the king (or an assistant) to kick your town." +msg_err_siege_war_revolt_immunity_active: "&cYour town has revolt immunity. It cannot revolt until the revolt immunity expires." +#Attack +msg_err_siege_war_not_enabled_in_world: '&cWar is not enabled in this world.' +msg_err_siege_war_banner_must_be_placed_above_ground: '&cThe siege banner must be placed above ground.' +msg_err_siege_war_action_not_a_town_member: '&cYou must be a member of a town to do this action.' +msg_err_siege_war_action_not_a_nation_member: '&cYou must be a member of a nation to do this action.' +msg_err_siege_war_cannot_attack_own_town: '&cYou cannot attack your own town.' +msg_err_siege_war_cannot_attack_town_in_own_nation: '&cYou cannot attack a town in your own nation.' +msg_err_siege_war_cannot_attack_non_enemy_nation: '&cYou cannot attack a town unless the nation of that town is an enemy of your nation.' +msg_err_siege_war_too_many_adjacent_cardinal_town_blocks: '&cYou cannot perform this action because this chunk is facing more than one town block. Try placing the item in a different area.' +msg_err_siege_war_too_many_adjacent_towns: '&cYou cannot perform this action because there are multiple towns adjacent to this chunk. Try placing the item in a different area.' +msg_err_siege_war_nation_already_attacking_town: '&cYour nation is already attacking this town.' +msg_err_siege_war_cannot_attack_siege_immunity: '&cThe target town has siege immunity. It cannot be attacked until the siege immunity expires.' +msg_err_siege_war_cannot_place_banner_far_above_town: 'The siege banner cannot be placed on a much higher elevation than the town. Try placing the banner at a lower elevation' +msg_err_siege_war_cannot_join_siege: '&cYou cannot attack a town while it is under siege by another nation.' +msg_err_siege_war_nation_has_too_many_active_siege_attacks: '&cYour nation is at the maximum number of concurrent siege-attacks. To start another attack, one or more of the current attacks must finish.' +msg_err_siege_war_town_not_close_enough_to_nation: '&cThe town is too far away from your nation capital to be attacked.' +#Abandon +msg_err_siege_war_cannot_abandon_no_nearby_siege_attacks: '&cYou cannot abandon because there are no active siege banners nearby.' +msg_err_siege_war_cannot_abandon_nation_not_attacking_zone: '&cYou cannot abandon because your nation is not attacking in this area.' +msg_err_siege_war_cannot_abandon_siege_over: '&cYou cannot abandon because the siege is over.' +#Invade +msg_err_siege_war_cannot_invade_own_town: '&cYou cannot capture your own town.' +msg_err_siege_war_cannot_invade_without_victory: "&cYou cannot capture the town unless your nation is victorious in the siege." +msg_err_siege_war_no_siege_on_target_town: '&cThere is no siege on the target town of %s.' +msg_err_siege_war_town_already_invaded: '&cThis town has already been captured' +msg_err_siege_war_town_already_belongs_to_your_nation: '&cThis town already belongs to your nation' +#Plunder +msg_err_siege_war_cannot_plunder_own_town: '&cYou cannot plunder your own town.' +msg_err_siege_war_cannot_plunder_without_victory: "&cYou cannot plunder unless your nation is victorious in the siege." +msg_err_siege_war_cannot_plunder_without_economy: "&cYou cannot plunder because no economy plugin is active" +msg_err_siege_war_town_already_plundered: '&cThis town has already been plundered.' +#Surrender +msg_err_siege_war_cannot_surrender_not_your_town: '&cYou cannot surrender because this is not your town.' +msg_err_siege_war_cannot_surrender_siege_finished: '&cYou cannot surrender because the siege is over.' +#Block change +msg_err_siege_war_cannot_destroy_siege_banner: "&cWhile the siege is in progress you cannot destroy the siege banner or the block it is attached to." +msg_err_siege_war_nation_zone_this_area_protected_but_besieged: '&cThis part of the %s is under the protection of %s, and also cannot be altered while the nearby town is under siege.' +msg_err_siege_war_banner_support_block_not_stable: "&cYou cannot place the banner on unstable ground e.g. sand or gravel." +# Spawn +msg_err_siege_war_cannot_spawn_into_siegezone_or_besieged_town: '&cOnly town residents can spawn into a besieged town or siege zone (unless the target town is peaceful).' +#Banner control +msg_siege_war_banner_control_session_failure: '&cBanner control session failed!. Common causes for this include: Going into the town, too far from the banner, or flying.' +msg_war_siege_zone_milk_bucket_forbidden_while_attempting_banner_control: 'You cannot use this item while in a banner control session.' + +#Town Info Siege Section +status_town_revolt_immunity_timer: '&2Revolt Immunity Timer: &a%s' +status_town_siege_status: '&2Siege: &a%s' +status_town_siege_status_in_progress: 'In Progress' +status_town_siege_status_attacker_win: 'Attacker Victory - %s' +status_town_siege_status_defender_win: 'Town Victory' +status_town_siege_status_attacker_abandon: 'Attacker Retreat' +status_town_siege_status_defender_surrender: 'Town Surrender - to %s' +status_town_siege_status_pending_attacker_abandon: 'Attacker Retreat Pending, in %s' +status_town_siege_status_pending_defender_surrender: 'Town Surrender Pending, in %s' + +status_town_siege_status_besieger: '&2 > Besieger: &a%s {%s}' +status_town_siege_status_banner_xyz: '&2 > Banner XYZ: &a%d,%d,%d' +status_town_siege_immunity_timer: '&2 > Immunity Timer: &a%s' +status_town_siege_victory_timer: '&2 > Victory Timer: &a%s' +status_town_siege_invaded_plundered_status: '&2 > Town Captured: %s &2Town Plundered: %s' +status_town_banner_control: '&2 > Banner Control: %s &a[%s]&2: &f' +status_town_banner_control_nobody: '&2 > Banner Control: %s' + +#Nation Info Siege Section +status_nation_siege_attacks: '&2Siege Attacks &a[%s]&2: &f' +status_nation_siege_defences: '&2Siege Defences &a[%s]&2: &f' + +#General +msg_days: ' days' +status_no_green: '&aNO' +msg_occupier: '&4*Occupier*' +msg_nobody: '&aNobody' +msg_attackers: '&aAttackers' +msg_defenders: '&aDefenders' + +#Town Peacefulness +status_town_peacefulness_status_change_timer: '&2Countdown To Peacefulness Status Change: &a%d days' +msg_war_common_town_declared_peaceful: '&bPeacefulness Declared!. The town will be confirmed as peaceful in %d day(s).' +msg_war_common_town_declared_non_peaceful: '&bNon-Peacefulness Declared!. The town will be confirmed as non-peaceful in %d day(s).' +msg_war_common_town_peacefulness_countdown_cancelled: '&bThe peacefulness status change countdown was cancelled.' +msg_war_common_town_became_peaceful: '&b%s has been confirmed as Peaceful.' +msg_war_common_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful.' + +msg_war_siege_town_became_peaceful: '&b%s has been confirmed as Peaceful. The town is now immune to sieges and taxes. The town''s nation choice is now restricted to nations with a strong presence in the local area. (see user-guide for more details). Residents cannot enter siege-zones or gain nation-military ranks.' +msg_war_siege_town_became_non_peaceful: '&b%s has been confirmed as Not-Peaceful. The town is no longer immune to sieges and taxes. The town''s nation choice is no longer restricted. Residents can enter siege-zones and gain nation-military ranks.' +msg_war_siege_cannot_add_nation_military_rank_to_peaceful_resident: '&cUnable to add military rank to resident, because they are in a peaceful town.' +msg_war_siege_peaceful_player_punished_for_being_in_siegezone: '&cWar-allergy active. To remove this effect, leave the siege-zone immediately.' +msg_war_siege_err_cannot_attack_peaceful_town: '&cYou cannot attack a peaceful town.' +msg_war_siege_peaceful_town_cannot_join_nation: 'c%s [PEACEFUL] cannot join %s, because the nation does not have a guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_zero: '&cYou cannot revolt at this time, because there are no guardian towns nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_cannot_revolt_nearby_guardian_towns_one: '&cYou cannot revolt at this time, because there is only 1 guardian town nearby (within %d chunks). A guardian town is a non-peaceful nation town with at least %d plots.' +msg_war_siege_peaceful_town_changed_nation: "&b%s has peacefully changed hands, moving from %s to %s." +msg_war_siege_peaceful_town_joined_nation: "&b%s has peacefully joined %s." +msg_war_siege_peaceful_town_left_nation: "&b%s has peacefully left %s." +msg_war_siege_warning_peaceful_town_should_not_create_nation: '&cYou are about to make a peaceful town into a nation capital. This is usually a bad idea, because the nation could fall without a fight.' +msg_war_siege_peaceful_towns_cannot_make_nations: '&cPeaceful towns cannot found nations!' + +#Siege immunities +msg_set_siege_immunities_town: 'Siege immunity for town %s set to %s hours.' +msg_set_siege_immunities_nation: 'Siege immunities for all towns in nation %s set to %s hours.' +msg_set_siege_immunities_all: 'Siege immunities for all towns set to %s hours.' + +#Battle sessions +msg_war_siege_battle_session_started: '&2Battle session started. You are free to enter any siege-zone for the next %s. After that you will get a %s rest from battle.' +msg_war_siege_battle_session_warning: '&cYour battle session will expire in %s. To avoid battle-fatigue, exit any siege zone you are in (and/or return to your own town).' +msg_war_siege_battle_session_expired: '&cBattle session expired. Battle-fatigue active. To remove this effect, leave the siege-zone (and/or return to your own town). You can return in %s.' +msg_war_siege_battle_session_ended: '&2Battle session ended. The next time you enter a siege-zone, a new battle session will begin.' + +#Siege-zone block placement restrictions +msg_war_siege_zone_block_placement_forbidden: '&cYou cannot place this type of block in the wilderness area of a siege zone.' +msg_war_siege_zone_bucket_emptying_forbidden: '&cYou cannot use this type of bucket in the wilderness area of a siege zone.' + +#Nation Refund +nation_help_11 : 'Claim all your nation refunds.' + +#Added in 0.02: +admin_help_1: 'Reload the config and language file.' +config_and_lang_file_reloaded_successfully: 'Config and Language file reloaded successfully.' +config_and_lang_file_could_not_be_loaded: 'Reload unsuccessful. See console for details.' +status_yes: '&aYES' +status_no: '&cNO' + +#Added in 0.03: +msg_err_no_money: '&cThere is not enough money in the bank.' + +#Added in 0.04: +msg_war_siege_peaceful_town_total_switches: '&b%d peaceful town%s %s peacefully switched nations.' +msg_err_not_registered_1: '&c%s is not registered.' +msg_error_must_be_num: '&bAmount must be a number.' + +#Added in 0.05: +msg_err_not_being_sieged: '&bTown %s does not have any active sieges.' +msg_err_town_not_registered: '&cTown %s is not registered.' + +#Scoreboard +hud_title: 'Siege' +hud_siegestatus: 'Siege Status' +hud_attackers: 'ATK: ' +hud_defenders: 'DEF: ' +hud_points: 'Points: ' +hud_banner_control: 'Banner Ctrl: ' +hud_time_remaining: 'Time Left: ' + +msg_err_peaceful_town_pvp_forced_off: '&cPeaceful towns have PVP forced OFF.' +msg_swa_set_points_success: '&bSuccessfully set siege points to %d for %s.' +msg_swa_resident_already_has_control: '&cResident %s already has control.' +msg_swa_resident_doesnt_have_control: "&cResident %s doesn't have control." +msg_swa_set_plunder_success: '&bSet plundered to %s for %s.' +msg_swa_set_captured_success: '&bSet captured to %s for %s.' + +siege_status_in_progress: 'In Progress' +siege_status_attacker_win: 'Attacker Win' +siege_status_defender_win: 'Defender Win' +siege_status_attacker_abandon: 'Attacker Abandon' +siege_status_defender_surrender: 'Defender Surrender' +siege_status_pending_attacker_abandon: 'Pending Attacker Abandon' +siege_status_pending_defender_surrender: 'Pending Defender Surrender' +siege_status_unknown: 'Unknown' + +dynmap_siege_title: 'Siege: %s' +dynmap_siege_attacker: 'Attacker: %s' +dynmap_siege_defender: 'Defender: %s' +dynmap_siege_points: 'Points: %d' +dynmap_siege_banner_control: 'Banner Control: %s' +dynmap_siege_status: 'Status: %s' +dynmap_siege_status_in_progress: 'In Progress' +dynmap_siege_status_pending_surrender: 'Pending Surrender' +dynmap_siege_status_pending_abandon: 'Pending Abandon' +dynmap_siege_time_left: 'Time Left: %s' +dynmap_siege_war_chest: 'War Chest: %s' + +#Added in 0.06: +msg_inventory_degrade_warning: '&4WARNING: &cSome of your gear is close to breaking due to inventory degradation.' +msg_swa_remove_siege_success: '&bSuccessfully removed siege.' +msg_war_siege_occupied_towns_cannot_surrender: '&cOccupied towns cannot surrender.' +msg_you_received_war_sickness: '&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave to remove the war sickness. Common causes of war sickness: being in a peaceful town, not having a military rank or not being allied to either side.' +msg_you_will_get_sickness: '&c&cYou are not a participant of this siege and cannot be in the Siege Zone. Please leave or you will receive war sickness in %s seconds.'