- Misc changes [increased game time, captures required]

This commit is contained in:
AlexTheCoder 2015-09-25 00:44:28 -04:00
parent 5b42d25bff
commit 5f45e8c1d3
3 changed files with 24 additions and 11 deletions

View File

@ -75,12 +75,12 @@ public class CaptureTheFlag extends TeamGame
private HashMap<String, PlayerData> _stats = new HashMap<String, PlayerData>();
//Captures
private static int _victoryCaps = 3;
private static int _victoryCaps = 5;
private int _redScore = 0;
private int _blueScore = 0;
//Times
private long _gameTime = 300000;
private long _gameTime = 420000;
//protected String[] _blockedItems = new String[] {"SWORD", "AXE", "BOW"};
private boolean _suddenDeath = false;
@ -98,7 +98,7 @@ public class CaptureTheFlag extends TeamGame
{
"Capture The Opponent's Flag",
"First team to " + _victoryCaps + " Captures",
"Or with the most Captures after 5 minutes wins"
"Or with the most Captures after 7 minutes wins"
});
@ -364,9 +364,6 @@ public class CaptureTheFlag extends TeamGame
if (UtilMath.offset(player.getLocation(), flag.getPlacedLocation()) < 1)
flag.Pickup(player);
}
else if (event.getType() == UpdateType.SEC)
for (Flag flag : _flags)
flag.UpdateEntity();
else
ProgressTime();
}

View File

@ -21,6 +21,8 @@ import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@ -129,13 +131,14 @@ public class Flag
UtilTextMiddle.display("", _team.GetColor() + _team.GetName() + " Flag " + C.cWhite + " has returned to base", 0, 60, 10);
}
public void UpdateEntity()
{
_flagEntity.update();
}
public void Update()
{
_flagEntity.update();
for (Entity e : _spawn.getWorld().getEntities())
if (e instanceof Item)
e.remove();
if (_moved)
{
if (_dropped)

View File

@ -46,9 +46,13 @@ public class FlagEntity implements Listener
UtilEnt.Vegetate(_entity, true);
UtilEnt.ghost(_entity, true, true);
DisguiseArmorStand disguise = new DisguiseArmorStand(_entity);
//DisguisePlayer d = new DisguisePlayer(_entity, new GameProfile(UUID.randomUUID(), "defek7"));
//d.setInvisible(true);
//d.setBoots(_holding);
disguise.setHelmet(_holding);
disguise.setInvisible(true);
_manager.disguise(disguise, UtilServer.getPlayers());
//_manager.disguise(d, UtilServer.getPlayers());
}
public void despawn()
@ -68,7 +72,15 @@ public class FlagEntity implements Listener
public void update()
{
if (_entity != null)
{
if (_entity.isDead())
{
despawn();
spawn();
}
_entity.teleport(_loc);
}
}
private void toggle(boolean on)
@ -105,6 +117,7 @@ public class FlagEntity implements Listener
{
if (event.GetState() == GameState.Dead)
{
despawn();
toggle(false);
}
}