mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Unarmed now has some spam detection
Fixed an error in the skillranks.yml file as well
This commit is contained in:
parent
84b3cfc309
commit
371a3ceec7
@ -8,6 +8,7 @@ Key:
|
||||
- Removal
|
||||
Version 2.1.7
|
||||
Fixed an almost 6 year old bug where Salvage materials did not have a defined material count so they defaulted to 2 (which could lead to shovels giving back more diamonds than normal)
|
||||
Added spam detection for Unarmed's bonus damage and disarm
|
||||
(API) Added addXpFromBlocks to ExperienceAPI to help make adding XP for a player easier
|
||||
(API) Added addXpFromBlocksBySkill to ExperienceAPI to help make adding XP for a player easier
|
||||
(API) Added addXpFromBlock to ExperienceAPI to help make adding XP for a player easier
|
||||
|
@ -12,13 +12,10 @@ public class Taming {
|
||||
public static int goreBleedTicks = 2; //Equivalent to rank 1 in Rupture
|
||||
public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier();
|
||||
|
||||
public static int sharpenedClawsUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.TAMING_SHARPENED_CLAWS);
|
||||
public static double sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
|
||||
|
||||
public static int shockProofUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.TAMING_SHOCK_PROOF);
|
||||
public static double shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier();
|
||||
|
||||
public static int thickFurUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.TAMING_THICK_FUR);
|
||||
public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
|
||||
|
||||
public static boolean canPreventDamage(Tameable pet, AnimalTamer owner) {
|
||||
|
@ -65,7 +65,8 @@ public class TamingManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canUseSharpenedClaws() {
|
||||
return getSkillLevel() >= Taming.sharpenedClawsUnlockLevel && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS);
|
||||
return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS)
|
||||
&& Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS);
|
||||
}
|
||||
|
||||
public boolean canUseGore() {
|
||||
|
@ -10,8 +10,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Unarmed {
|
||||
public static boolean blockCrackerSmoothBrick = Config.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked();
|
||||
|
||||
public static double berserkDamageModifier = 1.5;
|
||||
public static long lastAttacked = 0;
|
||||
public static long attackInterval = 750;
|
||||
|
||||
public static void handleItemPickup(Player player, EntityPickupItemEvent event) {
|
||||
ItemStack[] storageContents = player.getInventory().getStorageContents();
|
||||
|
@ -146,6 +146,10 @@ public class UnarmedManager extends SkillManager {
|
||||
return getIronArmDamage();
|
||||
}
|
||||
|
||||
public boolean isPunchingCooldownOver() {
|
||||
return (Unarmed.lastAttacked + Unarmed.attackInterval) <= System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public double getIronArmDamage() {
|
||||
return RankUtils.getRank(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE) * 2;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import com.gmail.nossr50.skills.archery.ArcheryManager;
|
||||
import com.gmail.nossr50.skills.axes.AxesManager;
|
||||
import com.gmail.nossr50.skills.swords.SwordsManager;
|
||||
import com.gmail.nossr50.skills.taming.TamingManager;
|
||||
import com.gmail.nossr50.skills.unarmed.Unarmed;
|
||||
import com.gmail.nossr50.skills.unarmed.UnarmedManager;
|
||||
import com.gmail.nossr50.util.*;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
@ -122,20 +123,26 @@ public final class CombatUtils {
|
||||
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED);
|
||||
}
|
||||
|
||||
if (unarmedManager.canUseIronArm()) {
|
||||
finalDamage += unarmedManager.ironArm();
|
||||
}
|
||||
//Only execute bonuses if the player is not spamming
|
||||
if(unarmedManager.isPunchingCooldownOver())
|
||||
{
|
||||
if (unarmedManager.canUseIronArm()) {
|
||||
finalDamage += unarmedManager.ironArm();
|
||||
}
|
||||
|
||||
if (unarmedManager.canUseBerserk()) {
|
||||
finalDamage += unarmedManager.berserkDamage(initialDamage);
|
||||
}
|
||||
if (unarmedManager.canUseBerserk()) {
|
||||
finalDamage += unarmedManager.berserkDamage(initialDamage);
|
||||
}
|
||||
|
||||
if (unarmedManager.canDisarm(target)) {
|
||||
unarmedManager.disarmCheck((Player) target);
|
||||
if (unarmedManager.canDisarm(target)) {
|
||||
unarmedManager.disarmCheck((Player) target);
|
||||
}
|
||||
}
|
||||
|
||||
applyScaledModifiers(initialDamage, finalDamage, event);
|
||||
startGainXp(mcMMOPlayer, target, PrimarySkillType.UNARMED);
|
||||
|
||||
Unarmed.lastAttacked = System.currentTimeMillis(); //Track how often the player is punching
|
||||
}
|
||||
|
||||
private static void processTamingCombat(LivingEntity target, Player master, Wolf wolf, EntityDamageByEntityEvent event) {
|
||||
|
@ -338,7 +338,7 @@ Fishing:
|
||||
Standard:
|
||||
Rank_1: 50
|
||||
RetroMode:
|
||||
Rank_1: 150
|
||||
Rank_1: 500
|
||||
IceFishing:
|
||||
Standard:
|
||||
Rank_1: 5
|
||||
|
Loading…
Reference in New Issue
Block a user