Chatting will reset Idle Timer in games (for DMT)

Minor kit changes
This commit is contained in:
Chiss 2014-11-05 14:46:49 +11:00
parent a66c3486d3
commit f3b9ad8adf
8 changed files with 26 additions and 7 deletions

View File

@ -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."
});
}

View File

@ -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

View File

@ -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}));

View File

@ -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[]
{

View File

@ -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))

View File

@ -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());

View File

@ -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);

View File

@ -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)