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() // Remove Invis
.scheduleSyncDelayedTask(Manager.getPlugin(), if (IsAlive(player))
new Runnable() {
{ Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
public void run() }
{
// Remove Invis // Remove Copy
if (IsAlive(player)) copy.remove();
Manager.GetCondition().EndCondition( }, 4);
player, ConditionType.CLOAK,
null);
// Remove Copy
copy.remove();
}
}, 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,17 +20,18 @@ 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)
{ {
for (Player player : getGame().GetPlayers(true)) return;
{ }
Long time = getGame().getEnemyTurfEntranceTime(player);
if (time != null && System.currentTimeMillis() - time >= 15000) for (Player player : getGame().GetPlayers(true))
addStat(player, "BehindEnemyLines", 1, true, false); {
InfiltrateData data = getGame().getInfiltrateData(player);
if (data != null && data.Seconds > 15)
{
addStat(player, "BehindEnemyLines", 1, true, false);
} }
} }
} }