From d916e97d0d63173acf45b9421382ac325870b0dd Mon Sep 17 00:00:00 2001 From: drtshock Date: Tue, 8 Sep 2015 12:04:20 -0500 Subject: [PATCH] Add option for over claim reward from #498. --- src/main/java/com/massivecraft/factions/Conf.java | 1 + .../massivecraft/factions/zcore/persist/MemoryFPlayer.java | 6 ++++++ src/main/java/com/massivecraft/factions/zcore/util/TL.java | 2 ++ 3 files changed, 9 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/Conf.java b/src/main/java/com/massivecraft/factions/Conf.java index 89d75b1e..f15e1116 100644 --- a/src/main/java/com/massivecraft/factions/Conf.java +++ b/src/main/java/com/massivecraft/factions/Conf.java @@ -234,6 +234,7 @@ public class Conf { public static String econUniverseAccount = ""; public static double econCostClaimWilderness = 30.0; public static double econCostClaimFromFactionBonus = 30.0; + public static double econOverclaimRewardMultiplier = 0.0; public static double econClaimAdditionalMultiplier = 0.5; public static double econClaimRefundMultiplier = 0.7; public static double econClaimUnconnectedFee = 0.0; diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java index 0d7a74ba..ea490f76 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java @@ -789,6 +789,12 @@ public abstract class MemoryFPlayer implements FPlayer { return false; } + // Was an over claim + if(currentFaction.isNormal() && currentFaction.hasLandInflation()) { + // Give them money for over claiming. + Econ.modifyMoney(payee, Conf.econOverclaimRewardMultiplier, TL.CLAIM_TOOVERCLAIM.toString(), TL.CLAIM_FOROVERCLAIM.toString()); + } + // announce success Set informTheseFPlayers = new HashSet(); informTheseFPlayers.add(this); diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index 3f4c7537..c4b17b7c 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -554,6 +554,8 @@ public enum TL { CLAIM_BORDER("You must start claiming land at the border of the territory."), CLAIM_TOCLAIM("to claim this land"), CLAIM_FORCLAIM("for claiming this land"), + CLAIM_TOOVERCLAIM("to overclaim this land"), + CLAIM_FOROVERCLAIM("for over claiming this land"), CLAIM_CLAIMED("%s claimed land for %s from %s."), CLAIM_CLAIMEDLOG("%s claimed land at (%s) for the faction: %s"), CLAIM_OVERCLAIM_DISABLED("Over claiming is disabled on this server."),