From f3b9ad8adfb57dedd6538d67eaa372d8d5f3ed5f Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 5 Nov 2014 14:46:49 +1100 Subject: [PATCH] Chatting will reset Idle Timer in games (for DMT) Minor kit changes --- .../game/classcombat/Skill/Ranger/Agility.java | 2 +- .../classcombat/Skill/Ranger/WolfsPounce.java | 2 +- .../game/classcombat/Skill/SkillFactory.java | 2 +- .../arcade/game/games/draw/kits/KitTools.java | 2 +- .../game/arcade/game/games/sheep/SheepGame.java | 2 +- .../games/sneakyassassins/SneakyAssassins.java | 2 +- .../games/sneakyassassins/npc/NpcManager.java | 6 +++++- .../game/arcade/managers/IdleManager.java | 15 +++++++++++++++ 8 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java index 7bad571e3..fb2a899f3 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java @@ -48,7 +48,7 @@ public class Agility extends SkillActive "Speed I for #3#1 seconds. You take", "#45#5 % less damage and take no knockback.", "", - "Agility ends if you interact." + "Agility ends if you Left-Click." }); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java index f18ff536d..296e0125b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java @@ -61,7 +61,7 @@ public class WolfsPounce extends SkillChargeSword public void DoSkillCustom(Player player, float charge) { //Action - UtilAction.velocity(player, 0.4 + (1.2*charge), 0.2, 0.2 + (0.6*charge), true); + UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.2 + (0.7*charge), true); _live.put(player, System.currentTimeMillis()); //Inform diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java index a7c607b90..0c9301900 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java @@ -435,7 +435,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new Agility(this, "Agility", ClassType.Ranger, SkillType.Axe, 1, 4, 0, 0, - 20000, 2000, true, + 14000, 1000, true, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/kits/KitTools.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/kits/KitTools.java index 50d68d4f9..241824054 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/kits/KitTools.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/kits/KitTools.java @@ -13,7 +13,7 @@ public class KitTools extends Kit { public KitTools(ArcadeManager manager) { - super(manager, "Tools", KitAvailability.Achievement, + super(manager, "Extra Tools", KitAvailability.Achievement, new String[] { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 36c26500c..66768fb87 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -253,7 +253,7 @@ public class SheepGame extends TeamGame @EventHandler public void Stack(UpdateEvent event) { - if (event.getType() != UpdateType.SEC) + if (event.getType() != UpdateType.TICK) return; for (Player player : GetPlayers(true)) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java index 0da116918..fa00618fa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java @@ -294,7 +294,7 @@ public class SneakyAssassins extends SoloGame if (UtilGear.isMat(event.getPlayer().getItemInHand(), Material.EMERALD)) { - if (!Recharge.Instance.use(event.getPlayer(), "Bribe Villager", 4000, true, true)) + if (!Recharge.Instance.use(event.getPlayer(), "Bribe Villager", 8000, true, true)) return; _npcManager.setBribed(event.getRightClicked(), event.getPlayer()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/npc/NpcManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/npc/NpcManager.java index fd410a916..872774c70 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/npc/NpcManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/npc/NpcManager.java @@ -4,6 +4,7 @@ import mineplex.core.common.util.*; import mineplex.core.timing.TimingManager; import mineplex.core.updater.*; import mineplex.core.updater.event.*; +import mineplex.minecraft.game.core.condition.Condition.ConditionType; import nautilus.game.arcade.game.*; import nautilus.game.arcade.game.games.sneakyassassins.*; import nautilus.game.arcade.world.*; @@ -164,6 +165,9 @@ public class NpcManager implements Listener if (data.Player.equals(other)) continue; + if (_sneakyAssassins.Manager.GetCondition().HasCondition(other, ConditionType.CLOAK, null)) + continue; + double dist = UtilMath.offset(npc, other); if (bestTarget == null || dist < bestDist) @@ -200,7 +204,7 @@ public class NpcManager implements Listener { //Damage Event _sneakyAssassins.Manager.GetDamage().NewDamageEvent(bestTarget, (LivingEntity)npc, null, - DamageCause.CUSTOM, 2, true, false, false, + DamageCause.CUSTOM, 1, true, false, false, data.Player.getName(), data.Player.getName() + "'s Bribed Villager"); npc.getWorld().playSound(npc.getLocation(), Sound.VILLAGER_NO, 1f, 1f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/IdleManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/IdleManager.java index c6071d5a4..e06146acd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/IdleManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/IdleManager.java @@ -12,10 +12,12 @@ import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.Game.GameState; +import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerQuitEvent; public class IdleManager implements Listener @@ -33,6 +35,19 @@ public class IdleManager implements Listener Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin()); } + + @EventHandler + public void ChatIdle(final AsyncPlayerChatEvent event) + { + Bukkit.getServer().getScheduler().runTaskLater(Manager.GetPlugin(), new Runnable() + { + @Override + public void run() + { + _idle.put(event.getPlayer(), System.currentTimeMillis()); + } + }, 1); + } @EventHandler public void KickIdlePlayers(UpdateEvent event)