From ff1e6e5ba499c6353c2efeba9a7a0d098ce61c88 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 16 Mar 2011 20:28:37 -0700 Subject: [PATCH] Another WIP update --- mcMMO/com/gmail/nossr50/mcBlockListener.java | 3 ++ mcMMO/com/gmail/nossr50/mcEntityListener.java | 4 +-- mcMMO/com/gmail/nossr50/mcSkills.java | 32 +++++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index fe793515f..2752df44f 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -37,6 +37,9 @@ public class mcBlockListener extends BlockListener { Block block = event.getBlock(); Player player = event.getPlayer(); ItemStack is = player.getItemInHand(); + if(mcPermissions.getInstance().unarmed(player)){ + mcSkills.getInstance().berserkActivationCheck(player, block); + } if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getBlock().getTypeId() == 42){ mcRepair.getInstance().repairCheck(player, is, event.getBlock()); } diff --git a/mcMMO/com/gmail/nossr50/mcEntityListener.java b/mcMMO/com/gmail/nossr50/mcEntityListener.java index f9ce89f2d..3a1225e7c 100644 --- a/mcMMO/com/gmail/nossr50/mcEntityListener.java +++ b/mcMMO/com/gmail/nossr50/mcEntityListener.java @@ -121,9 +121,9 @@ public class mcEntityListener extends EntityListener { /* * This will do AOE damage from the axes ability */ - if(!event.isCancelled() && mcUsers.getProfile(attacker).getSkullSplitterMode()) + if(!event.isCancelled() && mcUsers.getProfile(attacker).getSkullSplitterMode() && mcm.getInstance().isAxes(attacker.getItemInHand())) mcCombat.getInstance().applyAoeDamage(attacker, eventb, x); - if(!event.isCancelled() && mcUsers.getProfile(attacker).getSerratedStrikesMode()) + if(!event.isCancelled() && mcUsers.getProfile(attacker).getSerratedStrikesMode() && mcm.getInstance().isSwords(attacker.getItemInHand())) mcCombat.getInstance().applyAoeDamage(attacker, eventb, x); } diff --git a/mcMMO/com/gmail/nossr50/mcSkills.java b/mcMMO/com/gmail/nossr50/mcSkills.java index e616810f5..86af61081 100644 --- a/mcMMO/com/gmail/nossr50/mcSkills.java +++ b/mcMMO/com/gmail/nossr50/mcSkills.java @@ -94,9 +94,6 @@ public class mcSkills { if(mcPermissions.getInstance().excavationAbility(player)){ mcExcavation.getInstance().gigaDrillBreakerActivationCheck(player, block); } - if(mcPermissions.getInstance().unarmed(player)){ - berserkActivationCheck(player, block); - } if(mcPermissions.getInstance().swords(player)){ serratedStrikesActivationCheck(player, block); } @@ -243,7 +240,6 @@ public class mcSkills { * WOODCUTTING ABILITY */ if(mcPermissions.getInstance().woodCuttingAbility(player)){ - //Monitor the length of TreeFeller mode if(mcUsers.getProfile(player).getTreeFellerMode()){ mcUsers.getProfile(player).decreaseTreeFellerTicks(); if(mcUsers.getProfile(player).getTreeFellerTicks() <= 0){ @@ -257,7 +253,6 @@ public class mcSkills { * MINING ABILITY */ if(mcPermissions.getInstance().miningAbility(player)){ - //Monitor the length of SuperBreaker mode if(mcUsers.getProfile(player).getSuperBreakerMode()){ mcUsers.getProfile(player).decreaseSuperBreakerTicks(); if(mcUsers.getProfile(player).getSuperBreakerTicks() <= 0){ @@ -271,7 +266,6 @@ public class mcSkills { * EXCAVATION ABILITY */ if(mcPermissions.getInstance().excavationAbility(player)){ - //Monitor the length of Giga Drill Breaker mode if(mcUsers.getProfile(player).getGigaDrillBreakerMode()){ mcUsers.getProfile(player).decreaseGigaDrillBreakerTicks(); if(mcUsers.getProfile(player).getGigaDrillBreakerTicks() <= 0){ @@ -281,6 +275,32 @@ public class mcSkills { } } } + /* + * SWORDS ABILITY + */ + if(mcPermissions.getInstance().swordsAbility(player)){ + if(mcUsers.getProfile(player).getSerratedStrikesMode()){ + mcUsers.getProfile(player).decreaseSerratedStrikesTicks(); + if(mcUsers.getProfile(player).getSerratedStrikesTicks() <= 0){ + mcUsers.getProfile(player).setSerratedStrikesMode(false); + mcUsers.getProfile(player).setSerratedStrikesCooldown(120); + player.sendMessage(ChatColor.GRAY+"**You feel spiral energy leaving you**"); + } + } + } + /* + * UNARMED ABILITY + */ + if(mcPermissions.getInstance().unarmedAbility(player)){ + if(mcUsers.getProfile(player).getBerserkMode()){ + mcUsers.getProfile(player).decreaseBerserkTicks(); + if(mcUsers.getProfile(player).getBerserkTicks() <= 0){ + mcUsers.getProfile(player).setBerserkMode(false); + mcUsers.getProfile(player).setBerserkCooldown(120); + player.sendMessage(ChatColor.GRAY+"**You feel spiral energy leaving you**"); + } + } + } } public void XpCheck(Player player){ /*