From e40a7bb4e12f8112c1ee3417f727b5552cb1de1d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 21 Mar 2019 14:32:01 -0700 Subject: [PATCH] XP Gain from Roll has a CD now (60 seconds) --- Changelog.txt | 17 ++++++++++++----- pom.xml | 2 +- .../skills/subskills/acrobatics/Roll.java | 8 ++++---- .../skills/acrobatics/AcrobaticsManager.java | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 6f04e8bcf..8f680a5fd 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,12 +7,19 @@ Key: ! Change - Removal +Version 2.1.21 + Improved anti-farm/anti-grinding mechanics for Rolling + When you gain XP from Rolling there is a cooldown period (60~ seconds) for gaining XP again + This XP cooldown period extends if players are taking fall damage within the cooldown period + NOTE: Roll already has a few built in measures to prevent XP grinding / abuse, those are still the same. + NOTE: Rolls still happen in the cooldown period, you just won't gain XP. + Version 2.1.20 - Added Hungarian localization (Locale code: hu_HU) (thanks andris155) - Players can now fish in the same spot about 3 times before mcMMO will mark the area as being over-fished (over-fishing is to prevent abuse) - Added a toggle to turn off the fishing exploit detection to experience.yml "ExploitFix.Fishing" - Note: The new config update is coming soon and will use a different setting, putting this out as a band-aid fix for people that don't like the new fishing exploit prevention stuff - Added a message to warn players that their next fishing attempt will result in over-fishing (Locale: Fishing.LowResources) +Added Hungarian localization (Locale code: hu_HU) (thanks andris155) +Players can now fish in the same spot about 3 times before mcMMO will mark the area as being over-fished (over-fishing is to prevent abuse) +Added a toggle to turn off the fishing exploit detection to experience.yml "ExploitFix.Fishing" + Note: The new config update is coming soon and will use a different setting, putting this out as a band-aid fix for people that don't like the new fishing exploit prevention stuff +Added a message to warn players that their next fishing attempt will result in over-fishing (Locale: Fishing.LowResources) Version 2.1.19 Greatly Improved Fishing AFK/Exploit Detection diff --git a/pom.xml b/pom.xml index 2cd9ae2cd..70db7329c 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.20 + 2.1.21 mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java index 0355c8821..b29895927 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java @@ -210,7 +210,7 @@ public class Roll extends AcrobaticsSubSkill { //player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text")); //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { - if(!isExploiting(player)) + if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP()) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); //} @@ -219,7 +219,7 @@ public class Roll extends AcrobaticsSubSkill { } else if (!isFatal(player, damage)) { //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { - if(!isExploiting(player)) + if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP()) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); //} } @@ -249,14 +249,14 @@ public class Roll extends AcrobaticsSubSkill { { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Acrobatics.Ability.Proc"); SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS,0.5F); - if(!isExploiting(player)) + if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP()) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); addFallLocation(player); return modifiedDamage; } else if (!isFatal(player, damage)) { - if(!isExploiting(player)) + if(!isExploiting(player) && mcMMOPlayer.getAcrobaticsManager().canGainRollXP()) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); addFallLocation(player); diff --git a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java index 49bf29a09..35abe80f7 100644 --- a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java @@ -24,6 +24,24 @@ public class AcrobaticsManager extends SkillManager { super(mcMMOPlayer, PrimarySkillType.ACROBATICS); } + private long rollXPCooldown = 0; + private long rollXPInterval = (1000 * 60); //1 Minute + private long rollXPIntervalLengthen = (1000 * 10); //10 Seconds + + public boolean canGainRollXP() + { + if(System.currentTimeMillis() >= rollXPCooldown) + { + rollXPCooldown = System.currentTimeMillis() + rollXPInterval; + rollXPIntervalLengthen = (1000 * 10); //5 Seconds + return true; + } else { + rollXPCooldown += rollXPIntervalLengthen; + rollXPIntervalLengthen += 1000; //Add another second to the next penalty + return false; + } + } + public boolean canDodge(Entity damager) { if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE)) return false;