Turf Wars

This commit is contained in:
Sam 2018-04-30 19:48:01 +01:00 committed by Alexander Meech
parent d568842d7c
commit 54e545e2ff
5 changed files with 427 additions and 387 deletions

View File

@ -711,6 +711,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
player.setFlying(false); player.setFlying(false);
((CraftPlayer) player).getHandle().spectating = false; ((CraftPlayer) player).getHandle().spectating = false;
((CraftPlayer) player).getHandle().k = true; ((CraftPlayer) player).getHandle().k = true;
Manager.GetCondition().Factory().Invulnerable("Revival", player, player, 5, false, false);
// Items // Items
player.getInventory().remove(Material.WATCH); player.getInventory().remove(Material.WATCH);
@ -729,24 +730,18 @@ public class WitherGame extends TeamGame implements IBlockRestorer
// Delayed Visibility // Delayed Visibility
if (copy != null) if (copy != null)
{ {
UtilServer Manager.runSyncLater(() ->
.getServer()
.getScheduler()
.scheduleSyncDelayedTask(Manager.getPlugin(),
new Runnable()
{
public void run()
{ {
// Remove Invis // Remove Invis
if (IsAlive(player)) if (IsAlive(player))
Manager.GetCondition().EndCondition( {
player, ConditionType.CLOAK, Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
null); }
// Remove Copy // Remove Copy
copy.remove(); copy.remove();
}
}, 4); }, 4);
} }
} }
@ -791,8 +786,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
copyIterator.remove(); copyIterator.remove();
AddGems(thrower, 3, "Revived Ally", true, true); AddGems(thrower, 3, "Revived Ally", true, true);
UtilServer.CallEvent(new HumanReviveEvent(thrower, copy.GetPlayer()));
Bukkit.getPluginManager().callEvent(new HumanReviveEvent(thrower, copy.GetPlayer()));
} }
} }

View File

@ -24,11 +24,10 @@ public class KitHumanEditor extends Kit
private static final ItemStack[] PLAYER_ITEMS = private static final ItemStack[] PLAYER_ITEMS =
{ {
ItemStackFactory.Instance.CreateStack(Material.STONE_AXE), new ItemStack(Material.STONE_AXE),
ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE), new ItemStack(Material.STONE_PICKAXE),
ItemStackFactory.Instance.CreateStack(Material.STONE_SPADE), new ItemStack(Material.STONE_SPADE),
new ItemBuilder(Material.POTION).setAmount(2).setData((short) 16429).setTitle(C.Reset + "Revival Potion").build(), new ItemBuilder(Material.POTION).setAmount(2).setData((short) 16429).setTitle(C.Reset + "Revival Potion").build(),
ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP),
ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP),
}; };

View File

@ -28,7 +28,7 @@ public class KitHumanMedic extends Kit
private static final ItemStack[] PLAYER_ITEMS = private static final ItemStack[] PLAYER_ITEMS =
{ {
ItemStackFactory.Instance.CreateStack(Material.STONE_AXE), new ItemStack(Material.STONE_AXE),
new ItemBuilder(Material.POTION).setAmount(2).setData((short) 16429).setTitle(C.Reset + "Revival Potion").build(), new ItemBuilder(Material.POTION).setAmount(2).setData((short) 16429).setTitle(C.Reset + "Revival Potion").build(),
ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP),
ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP), ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP),

View File

@ -5,11 +5,13 @@ import org.bukkit.event.EventHandler;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.turfforts.TurfForts; import nautilus.game.arcade.game.games.turfforts.TurfForts;
import nautilus.game.arcade.game.games.turfforts.TurfForts.InfiltrateData;
public class BehindEnemyLinesStatTracker extends StatTracker<TurfForts> public class BehindEnemyLinesStatTracker extends StatTracker<TurfForts>
{ {
public BehindEnemyLinesStatTracker(TurfForts game) public BehindEnemyLinesStatTracker(TurfForts game)
{ {
super(game); super(game);
@ -18,16 +20,17 @@ public class BehindEnemyLinesStatTracker extends StatTracker<TurfForts>
@EventHandler @EventHandler
public void onUpdate(UpdateEvent event) public void onUpdate(UpdateEvent event)
{ {
if (getGame().GetState() != Game.GameState.Live) if (!getGame().IsLive() || event.getType() != UpdateType.SEC)
return;
if (event.getType() == UpdateType.SEC)
{ {
return;
}
for (Player player : getGame().GetPlayers(true)) for (Player player : getGame().GetPlayers(true))
{ {
Long time = getGame().getEnemyTurfEntranceTime(player); InfiltrateData data = getGame().getInfiltrateData(player);
if (time != null && System.currentTimeMillis() - time >= 15000) if (data != null && data.Seconds > 15)
{
addStat(player, "BehindEnemyLines", 1, true, false); addStat(player, "BehindEnemyLines", 1, true, false);
} }
} }