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

View File

@ -24,11 +24,10 @@ public class KitHumanEditor extends Kit
private static final ItemStack[] PLAYER_ITEMS =
{
ItemStackFactory.Instance.CreateStack(Material.STONE_AXE),
ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE),
ItemStackFactory.Instance.CreateStack(Material.STONE_SPADE),
new ItemStack(Material.STONE_AXE),
new ItemStack(Material.STONE_PICKAXE),
new ItemStack(Material.STONE_SPADE),
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),
};

View File

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