- More chiss

This commit is contained in:
AlexTheCoder 2016-04-16 14:05:46 -04:00
parent 09f9ae3b7a
commit d8f5ac66fc
14 changed files with 298 additions and 120 deletions

View File

@ -33,7 +33,7 @@ import nautilus.game.arcade.game.games.minecraftleague.data.BlockProtection;
import nautilus.game.arcade.game.games.minecraftleague.data.MapZone;
import nautilus.game.arcade.game.games.minecraftleague.data.Spawner;
import nautilus.game.arcade.game.games.minecraftleague.data.TeamBeacon;
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTower;
import nautilus.game.arcade.game.games.minecraftleague.data.TeamCrystal;
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTowerBase;
import nautilus.game.arcade.game.games.minecraftleague.data.TowerAlert;
import nautilus.game.arcade.game.games.minecraftleague.data.TowerManager;
@ -103,7 +103,7 @@ public class MinecraftLeague extends TeamGame
//private ConcurrentHashMap<Player, PlayerRespawnPoint> _customRespawns = new ConcurrentHashMap<Player, PlayerRespawnPoint>();
//private ConcurrentHashMap<GameTeam, TeamMap> _maps = new ConcurrentHashMap<GameTeam, TeamMap>();
private ConcurrentHashMap<Player, List<ItemStack>> _gear = new ConcurrentHashMap<Player, List<ItemStack>>();
public ConcurrentHashMap<GameTeam, TeamBeacon> Beacons = new ConcurrentHashMap<GameTeam, TeamBeacon>();
public ConcurrentHashMap<Block, TeamBeacon> Beacons = new ConcurrentHashMap<Block, TeamBeacon>();
//public ConcurrentHashMap<GameTeam, Long> TeamPoison = new ConcurrentHashMap<GameTeam, Long>();
private ConcurrentHashMap<Player, BlockProtection> _blockLock = new ConcurrentHashMap<Player, BlockProtection>();
//private ConcurrentHashMap<Player, Long> _spawnAllow = new ConcurrentHashMap<Player, Long>();
@ -115,6 +115,7 @@ public class MinecraftLeague extends TeamGame
private MinecraftLeagueCommand _cmd;
private long _lastIncrease;
private long _lastOreReset;
private long _lastGrindReset;
private boolean _yellow = false;
public List<MapZone> MapZones = new ArrayList<MapZone>();
@ -126,6 +127,7 @@ public class MinecraftLeague extends TeamGame
private FreezeManager _freeze;
private TowerManager _tower;
public TowerAlert Alert;
public boolean ScoreboardAutoWrite = true;
//private final EntityType[] _passive = new EntityType[] {EntityType.CHICKEN, EntityType.COW, EntityType.PIG, EntityType.RABBIT, EntityType.SHEEP};
@ -394,9 +396,9 @@ public class MinecraftLeague extends TeamGame
return ids;
}
public TeamTowerBase getActiveTower(GameTeam team)
//public TeamTowerBase getActiveTower(GameTeam team)
{
return _tower.getVulnerable(team);
//return _tower.getVulnerable(team);
}
public TowerManager getTowerManager()
@ -454,10 +456,25 @@ public class MinecraftLeague extends TeamGame
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (!ScoreboardAutoWrite)
return;
if (event.getType() == UpdateType.FAST || event.getType() == UpdateType.SEC)
scoreboardWrite(event.getType() == UpdateType.SEC);
}
public void writeEndSb(String winner)
{
Scoreboard.Reset();
Scoreboard.WriteBlank();
Scoreboard.Write(C.cDRedB + "Minecraft League");
Scoreboard.WriteBlank();
Scoreboard.Write(C.cGoldB + "Winner:");
Scoreboard.Write(winner);
Scoreboard.Draw();
}
private void scoreboardWrite(boolean sec)
{
if (!InProgress())
@ -492,26 +509,30 @@ public class MinecraftLeague extends TeamGame
GameTeam red = GetTeam(ChatColor.RED);
GameTeam blue = GetTeam(ChatColor.AQUA);
TeamTowerBase redt = _tower.getVulnerable(red);
TeamTowerBase bluet = _tower.getVulnerable(blue);
String reds = "First Tower";
String blues = "First Tower";
if (redt instanceof TeamTower)
String reds = "";
String blues = "";
for (TeamTowerBase tb : _tower.getTeamTowers(red))
{
if (((TeamTower)redt).Number > 1)
reds = "Second Tower";
}
else
reds = "Core";
if (!reds.equalsIgnoreCase(""))
reds = reds + " ";
if (bluet instanceof TeamTower)
{
if (((TeamTower)bluet).Number > 1)
blues = "Second Tower";
String symbol = "";
if (tb instanceof TeamCrystal)
symbol = "";
reds = reds + tb.getHealthColor() + symbol;
}
for (TeamTowerBase tb : _tower.getTeamTowers(blue))
{
if (!blues.equalsIgnoreCase(""))
blues = blues + " ";
String symbol = "";
if (tb instanceof TeamCrystal)
symbol = "";
blues = blues + tb.getHealthColor() + symbol;
}
else
blues = "Core";
_liveTime = Math.max(System.currentTimeMillis() - GetStateTime(), 0);
@ -525,13 +546,19 @@ public class MinecraftLeague extends TeamGame
Scoreboard.WriteBlank();
Scoreboard.Write(C.cRedB + "Red Team");
Scoreboard.Write(reds + ": " + redt.formatHealth(redt.getHealth()));
Scoreboard.Write("Players Alive: " + red.GetPlayers(true).size());
Scoreboard.Write("Towers: " + reds);
for (String s : _vman.getSelected().getTeamScoreboardAdditions(red))
{
Scoreboard.Write(s);
}
Scoreboard.WriteBlank();
Scoreboard.Write(C.cAquaB + "Blue Team");
Scoreboard.Write(blues + ": " + bluet.formatHealth(bluet.getHealth()));
Scoreboard.Write("Players Alive: " + blue.GetPlayers(true).size());
Scoreboard.Write("Towers: " + blues);
for (String s : _vman.getSelected().getTeamScoreboardAdditions(blue))
{
Scoreboard.Write(s);
}
int i = 1;
for (ExtraScoreboardData sbD : ExtraSb.keySet())
@ -565,7 +592,7 @@ public class MinecraftLeague extends TeamGame
{
for (GameTeam team : GetTeamList())
{
TeamTowerBase tower = _tower.getVulnerable(team);
TeamTowerBase tower = _tower.getTeamTowers(team).getLast();
UtilPlayer.message(caller, team.GetColor() + team.GetName());
UtilPlayer.message(caller, C.cGray + "Health: " + tower.getHealth());
UtilPlayer.message(caller, C.cGray + "Alive: " + tower.Alive);
@ -623,6 +650,7 @@ public class MinecraftLeague extends TeamGame
{
_lastIncrease = System.currentTimeMillis();
_lastOreReset = System.currentTimeMillis();
_lastGrindReset = System.currentTimeMillis() - UtilTime.convert(30, TimeUnit.SECONDS, TimeUnit.MILLISECONDS);
Manager.GetExplosion().setEnabled(false);
Manager.GetDamage().SetEnabled(false);
Manager.GetCreature().SetForce(false);
@ -779,6 +807,9 @@ public class MinecraftLeague extends TeamGame
this.DeathSpectateSecs = Math.min(20, this.DeathSpectateSecs + 2.5);
}
if (UtilTime.elapsed(_lastGrindReset, UtilTime.convert(30, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
{
_lastGrindReset = System.currentTimeMillis();
for (Location grind : WorldData.GetCustomLocs(DataLoc.GRIND_AREA.getKey()))
{
int spider = 0;
@ -792,19 +823,20 @@ public class MinecraftLeague extends TeamGame
}
while (spider < 5)
{
spider++;
spider = 5;
CreatureAllowOverride = true;
Manager.GetCreature().SpawnEntity(grind, EntityType.SPIDER);
CreatureAllowOverride = false;
}
while (chicken < 10)
{
chicken++;
chicken = 10;
CreatureAllowOverride = true;
Manager.GetCreature().SpawnEntity(grind, EntityType.CHICKEN);
CreatureAllowOverride = false;
}
}
}
/*for (Player player : _spawnAllow.keySet())
{
@ -1487,12 +1519,22 @@ public class MinecraftLeague extends TeamGame
}
}
int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2;
while (arrowsToAdd >= 1)
//int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2;
//while (arrowsToAdd >= 1)
//{
//int subtract = Math.min(64, arrowsToAdd);
//gear.add(new ItemStack(Material.ARROW, subtract));
//arrowsToAdd -= subtract;
//}
if (UtilInv.getAmount(player, Material.ARROW) >= 1)
{
int subtract = Math.min(64, arrowsToAdd);
gear.add(new ItemStack(Material.ARROW, subtract));
arrowsToAdd -= subtract;
for (ItemStack arrow : UtilInv.getItems(player))
{
if (arrow.getType() == Material.ARROW)
{
gear.add(arrow);
}
}
}
_gear.put(player, gear);
@ -1505,6 +1547,8 @@ public class MinecraftLeague extends TeamGame
return;
if (!(event.getEntity() instanceof Player))
return;
if (UtilPlayer.isSpectator(event.getEntity()))
return;
Player player = (Player)event.getEntity();
storeGear(player);
@ -1590,7 +1634,14 @@ public class MinecraftLeague extends TeamGame
{
if (OverTime)
{
_tower.getVulnerable(GetTeam(event.GetPlayer())).damage(20, null);
for (TeamTowerBase tb : _tower.getTeamTowers(GetTeam(event.GetPlayer())))
{
if (tb.Alive)
{
tb.damage(20, null);
break;
}
}
if (_tower.getAmountAlive(GetTeam(event.GetPlayer())) >= 1)
{
event.setCancelled(true);

View File

@ -42,15 +42,15 @@ public class AdminPanel implements Listener
_slots = new ConcurrentHashMap<GameTeam, Integer>();
ItemStack red = new ItemBuilder(MenuButton.CRYSTAL.getRepresentation())
.setTitle(C.cRed + "Red Tower")
.setLore(C.cGray + "Alive: " + host.getActiveTower(host.GetTeam(ChatColor.RED)).Alive,
C.cGray + "Health: " + host.getActiveTower(host.GetTeam(ChatColor.RED)).getHealth())
.setTitle(C.cRed + "Red Core")
.setLore(C.cGray + "Alive: " + host.getTowerManager().getTeamTowers(host.GetTeam(ChatColor.RED)).getLast().Alive,
C.cGray + "Health: " + host.getTowerManager().getTeamTowers(host.GetTeam(ChatColor.RED)).getLast().getHealth())
.build();
ItemStack blue = new ItemBuilder(MenuButton.CRYSTAL.getRepresentation())
.setTitle(C.cAqua + "Blue Tower")
.setLore(C.cGray + "Alive: " + host.getActiveTower(host.GetTeam(ChatColor.AQUA)).Alive,
C.cGray + "Health: " + host.getActiveTower(host.GetTeam(ChatColor.AQUA)).getHealth())
.setTitle(C.cAqua + "Blue Core")
.setLore(C.cGray + "Alive: " + host.getTowerManager().getTeamTowers(host.GetTeam(ChatColor.AQUA)).getLast().Alive,
C.cGray + "Health: " + host.getTowerManager().getTeamTowers(host.GetTeam(ChatColor.AQUA)).getLast().getHealth())
.build();
_buttons.put(red, host.GetTeam(ChatColor.RED));
@ -75,8 +75,8 @@ public class AdminPanel implements Listener
GameTeam team = _buttons.get(item);
ItemMeta im = item.getItemMeta();
List<String> lore = new ArrayList<String>();
lore.add(C.cGray + "Alive: " + _host.getActiveTower(team).Alive);
lore.add(C.cGray + "Health: " + _host.getActiveTower(team).getHealth());
lore.add(C.cGray + "Alive: " + _host.getTowerManager().getTeamTowers(team).getLast().Alive);
lore.add(C.cGray + "Health: " + _host.getTowerManager().getTeamTowers(team).getLast().getHealth());
im.setLore(lore);
item.setItemMeta(im);
_buttons.remove(item);

View File

@ -169,7 +169,7 @@ public class DefenderAI
private void drawBeam()
{
Location base = _base.clone().add(0, 10, 0);
Location target = _manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0);
Location target = _manager.getTeamTowers(_tower.getTeam()).getLast().getLocation().clone().add(0, 10, 0);//_manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0);
Location display = base.clone();
while (UtilMath.offset(base, target) > UtilMath.offset(base, display))
{

View File

@ -24,6 +24,8 @@ public class OreGenerator
}
for (int i = 0; i < (amount + 1); i++)
{
if (_choices.size() == 0)
continue;
Location selected = _choices.remove(UtilMath.random.nextInt(_choices.size()));
selected.getBlock().setType(oreType);
}

View File

@ -35,9 +35,14 @@ public class TeamBeacon
return false;
}*/
public void setBlock(Block block)
/*public void setBlock(Block block)
{
_block = block;
}*/
public Block getBlock()
{
return _block;
}
public void update()

View File

@ -18,6 +18,7 @@ import nautilus.game.arcade.game.games.minecraftleague.DataLoc;
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -134,7 +135,7 @@ public abstract class TeamTowerBase
{
b.setType(Material.AIR);
}
for (int i = 1; i < 3; i++)
for (int i = 0; i < 3; i++)
{
getBeacon().clone().add(0, i, 0).getBlock().setType(Material.BEDROCK);
}
@ -219,6 +220,21 @@ public abstract class TeamTowerBase
return tag;
}
public ChatColor getHealthColor()
{
if (!Alive)
return ChatColor.GRAY;
ChatColor color = ChatColor.YELLOW;
if (_health > (.9 * _maxHealth))
color = ChatColor.GREEN;
else if (_health < (.45 * _maxHealth))
color = ChatColor.RED;
return color;
}
public boolean damage(double damage, Player player)
{
if (!Vulnerable)

View File

@ -7,8 +7,8 @@ import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import mineplex.core.common.util.UtilTextMiddle;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.minecraftleague.DataLoc;
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
import nautilus.game.arcade.world.WorldData;
@ -25,10 +25,10 @@ public class TowerManager implements Listener
{
public MinecraftLeague Host;
private ConcurrentHashMap<TeamTowerBase, GameTeam> _towers = new ConcurrentHashMap<TeamTowerBase, GameTeam>();
private ConcurrentHashMap<GameTeam, Integer> _vulnerableTower = new ConcurrentHashMap<GameTeam, Integer>();
//private ConcurrentHashMap<GameTeam, Integer> _vulnerableTower = new ConcurrentHashMap<GameTeam, Integer>();
private ConcurrentHashMap<TeamTowerBase, DefenderAI> _def = new ConcurrentHashMap<TeamTowerBase, DefenderAI>();
//private ConcurrentHashMap<TeamTowerBase, MapZone> _mapZone = new ConcurrentHashMap<TeamTowerBase, MapZone>();
private ConcurrentHashMap<GameTeam, TeamBeacon> _beacons = new ConcurrentHashMap<GameTeam, TeamBeacon>();
private ConcurrentHashMap<GameTeam, List<TeamBeacon>> _beacons = new ConcurrentHashMap<GameTeam, List<TeamBeacon>>();
private OreGenerator _ore;
public boolean Attack = false;
@ -38,20 +38,47 @@ public class TowerManager implements Listener
_ore = new OreGenerator();
}
private void makeVulnerable(TeamTowerBase base)
private void makeVulnerable(/*TeamTowerBase base*/GameTeam team, boolean core)
{
if (base instanceof TeamTower)
/*if (base instanceof TeamTower)
_vulnerableTower.put(base.getTeam(), ((TeamTower)base).Number);
else
_vulnerableTower.put(base.getTeam(), 3);
_vulnerableTower.put(base.getTeam(), 3);*/
base.setVulnerable(true);
_beacons.get(base.getTeam()).setBlock(base.getBeacon().getBlock());
List<TeamBeacon> beacon = new ArrayList<TeamBeacon>();
if (core)
{
for (TeamBeacon tb : _beacons.get(team))
Host.Beacons.remove(tb.getBlock());
_beacons.remove(team);
}
for (TeamTowerBase base : getTeamTowers(team))
{
if (base instanceof TeamTower)
{
base.setVulnerable(!core);
if (!core)
{
beacon.add(new TeamBeacon(team, base.getBeacon().getBlock()));
}
}
}
if (core)
{
getTeamTowers(team).getLast().setVulnerable(true);
beacon.add(new TeamBeacon(team, getTeamTowers(team).getLast().getBeacon().getBlock()));
}
_beacons.put(team, beacon);
for (TeamBeacon tb : beacon)
{
Host.Beacons.put(tb.getBlock(), tb);
}
}
public void ironOreGen(GameTeam team, boolean start)
{
int amount = 10;
int amount = 20;
if (start)
amount = 40;
@ -66,6 +93,11 @@ public class TowerManager implements Listener
_ore.generateOre(Material.IRON_ORE, Host.WorldData.GetCustomLocs(DataLoc.RED_ORE.getKey()), amount);
else
_ore.generateOre(Material.IRON_ORE, Host.WorldData.GetCustomLocs(DataLoc.BLUE_ORE.getKey()), amount);
for (Location loc : Host.WorldData.GetCustomLocs(DataLoc.MOSH_IRON.getKey()))
{
loc.getBlock().setType(Material.STONE);
}
}
else
{
@ -137,10 +169,10 @@ public class TowerManager implements Listener
return i;
}
public TeamTowerBase getVulnerable(GameTeam team)
/*public TeamTowerBase getVulnerable(GameTeam team)
{
return getTeamTowers(team).get(_vulnerableTower.get(team) - 1);
}
}*/
public void parseTowers(WorldData data)
{
@ -171,12 +203,12 @@ public class TowerManager implements Listener
_mapZone.put(tower, zone);*/
}
_beacons.put(red, new TeamBeacon(red, getTeamTowers(red).getFirst().getBeacon().getBlock()));
makeVulnerable(red, false);
makeVulnerable(blue, false);
/*_beacons.put(red, new TeamBeacon(red, getTeamTowers(red).getFirst().getBeacon().getBlock()));
_beacons.put(blue, new TeamBeacon(blue, getTeamTowers(blue).getFirst().getBeacon().getBlock()));
Host.Beacons.put(red, _beacons.get(red));
Host.Beacons.put(blue, _beacons.get(blue));
makeVulnerable(getTeamTowers(red).getFirst());
makeVulnerable(getTeamTowers(blue).getFirst());
Host.Beacons.put(blue, _beacons.get(blue));*/
ironOreGen(red, true);
ironOreGen(blue, true);
}
@ -199,7 +231,7 @@ public class TowerManager implements Listener
public void handleTowerDeath(TeamTowerBase towerBase)
{
towerBase.setVulnerable(false);
//towerBase.setVulnerable(false);
//ironOreGen(towerBase.getTeam());
for (Player player : towerBase.getTeam().GetPlayers(true))
{
@ -221,6 +253,8 @@ public class TowerManager implements Listener
else
enemy = Host.GetTeam(ChatColor.RED);
Host.ScoreboardAutoWrite = false;
Host.writeEndSb(enemy.GetColor() + enemy.getDisplayName());
Host.AnnounceEnd(enemy);
for (GameTeam team : Host.GetTeamList())
@ -243,8 +277,9 @@ public class TowerManager implements Listener
return;
}
TeamTower tower = (TeamTower)towerBase;
makeVulnerable(getTeamTowers(tower.getTeam()).get(tower.Number));
if (getTeamTowers(towerBase.getTeam()).getFirst().Alive || getTeamTowers(towerBase.getTeam()).get(1).Alive)
return;
makeVulnerable(towerBase.getTeam(), true);
}
public void toggleAttack()

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.minecraftleague.variation;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
import nautilus.game.arcade.world.WorldData;
@ -25,6 +26,11 @@ public abstract class GameVariation implements Listener
}
public String[] getTeamScoreboardAdditions(GameTeam team)
{
return new String[]{};
}
public void deregister()
{
HandlerList.unregisterAll(this);

View File

@ -18,7 +18,7 @@ public class VariationManager implements Listener
private MinecraftLeague _host;
private GameVariation _variation;
private VariationType _selected;
//private VariationType _selected;
public VariationManager(MinecraftLeague host)
{
@ -26,6 +26,11 @@ public class VariationManager implements Listener
Bukkit.getPluginManager().registerEvents(this, _host.getArcadeManager().getPlugin());
}
public GameVariation getSelected()
{
return _variation;
}
public void selectVariation()
{
VariationType type = null;
@ -39,7 +44,7 @@ public class VariationManager implements Listener
try
{
_variation = type.getVariation().getConstructor(MinecraftLeague.class).newInstance(_host);
_selected = type;
//_selected = type;
}
catch (NoSuchMethodException ex)
{
@ -58,7 +63,7 @@ public class VariationManager implements Listener
return;
}
Bukkit.broadcastMessage(type.getDisplayMessage());
//Bukkit.broadcastMessage(type.getDisplayMessage());
Bukkit.getPluginManager().registerEvents(_variation, _host.getArcadeManager().getPlugin());
_variation.ParseData();
}
@ -88,7 +93,7 @@ public class VariationManager implements Listener
{
if (_variation != null)
{
event.getPlayer().sendMessage(_selected.getDisplayMessage());
//event.getPlayer().sendMessage(_selected.getDisplayMessage());
}
}
}

View File

@ -77,6 +77,24 @@ public class WitherVariation extends GameVariation
_altars.put(Host.GetTeam(ChatColor.RED), new TeamAltar(this, Host.GetTeam(ChatColor.RED), WorldData.GetDataLocs(DataLoc.RED_ALTAR.getKey()).get(0)));
}
@Override
public String[] getTeamScoreboardAdditions(GameTeam team)
{
String skulls = "☠ ☠ ☠";
for (int i = 1; i < 4; i++)
{
if (!skulls.equalsIgnoreCase(""))
skulls = skulls + " ";
if (_altars.get(team).getPlacedSkulls() >= i)
skulls = skulls + ChatColor.GREEN + "";
else
skulls = skulls + ChatColor.GRAY + "";
}
return new String[] {"Altar Skulls: " + skulls};
}
private Location getNearest(Location to, ConcurrentHashMap<Location, Double> options)
{
Location ret = null;
@ -213,6 +231,13 @@ public class WitherVariation extends GameVariation
Host.Objective.resetPlayerToMainObjective(player);
}*/
Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable()
{
public void run()
{
Host.CreatureAllowOverride = false;
}
}, 20 * 3);
Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable()
{
public void run()
{
@ -258,20 +283,26 @@ public class WitherVariation extends GameVariation
{
event.setCancelled(true);
TeamTowerBase red = Host.getActiveTower(Host.GetTeam(ChatColor.RED));
TeamTowerBase blue = Host.getActiveTower(Host.GetTeam(ChatColor.AQUA));
LinkedList<TeamTowerBase> red = Host.getTowerManager().getTeamTowers(Host.GetTeam(ChatColor.RED));
LinkedList<TeamTowerBase> blue = Host.getTowerManager().getTeamTowers(Host.GetTeam(ChatColor.AQUA));
HashMap<Block, Double> inside = UtilBlock.getInRadius(event.getLocation().getBlock(), 4, false);
double dmg = 20 * (Host.GetTeam(ChatColor.RED).GetPlayers(true).size() + Host.GetTeam(ChatColor.RED).GetPlayers(true).size());
if (inside.containsKey(red.getLocation().getBlock()))
double dmg = 10 * (Host.GetTeam(ChatColor.RED).GetPlayers(true).size() + Host.GetTeam(ChatColor.RED).GetPlayers(true).size());
for (TeamTowerBase tb : red)
{
red.damage(dmg, null);
Host.Alert.alert(red.getTeam(), red);
if (inside.containsKey(tb.getLocation().getBlock()))
{
tb.damage(dmg, null);
Host.Alert.alert(tb.getTeam(), tb);
}
if (inside.containsKey(blue.getLocation().getBlock()))
}
for (TeamTowerBase tb : blue)
{
blue.damage(dmg, null);
Host.Alert.alert(blue.getTeam(), blue);
if (inside.containsKey(tb.getLocation().getBlock()))
{
tb.damage(dmg, null);
Host.Alert.alert(tb.getTeam(), tb);
}
}
for (Block b : inside.keySet())
{
@ -285,7 +316,12 @@ public class WitherVariation extends GameVariation
}
for (GameTeam owner : Host.GetTeamList())
{
if (Host.getActiveTower(owner).getLocation().distance(b.getLocation()) < 7)
for (TeamTowerBase tb : Host.getTowerManager().getTeamTowers(owner))
{
if (!tb.Vulnerable)
continue;
if (tb.getLocation().distance(b.getLocation()) < 7)
{
if (b.getType() == Material.BEDROCK)
continue;
@ -306,6 +342,7 @@ public class WitherVariation extends GameVariation
}
}
}
}
else if (event.getEntity() instanceof TNTPrimed)
{
event.setCancelled(true);

View File

@ -170,6 +170,10 @@ public class TeamAltar
scare.playSound(scare.getLocation(), Sound.WITHER_SPAWN, 10, 0);
}
}
else
{
_host.Host.CreatureAllowOverride = true;
}
_placed++;
}
}
@ -191,4 +195,9 @@ public class TeamAltar
{
return _center.clone();
}
public int getPlacedSkulls()
{
return _placed;
}
}

View File

@ -223,7 +223,7 @@ public class WitherMinionManager implements Listener
{
if (secLeft > 0)
{
UtilTextMiddle.display(C.cGold + secLeft + " Seconds", "Until Wither Skeleton Spawn");
UtilTextMiddle.display(secLeft + " Seconds", "Until Wither Skeleton Spawn");
}
}
}
@ -375,14 +375,14 @@ public class WitherMinionManager implements Listener
{
public void run()
{
UtilTextMiddle.display("", C.cGold + "Place the skull on top of", event.getPlayer());
UtilTextMiddle.display("", "Place the skull on top of", event.getPlayer());
}
}, 20 * 5);
Bukkit.getScheduler().runTaskLater(_host.Manager.getPlugin(), new Runnable()
{
public void run()
{
UtilTextMiddle.display("", C.cGold + "Your Altar's Soul Sand!", event.getPlayer());
UtilTextMiddle.display("", "Your Altar's Soul Sand!", event.getPlayer());
}
}, 20 * 8);
//_host.Host.Objective.setPlayerObjective(event.getPlayer(), new ReturnSkullObjective());

View File

@ -12,6 +12,7 @@ import mineplex.core.common.util.UtilTime.TimeUnit;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.minecraftleague.DataLoc;
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTower;
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTowerBase;
import nautilus.game.arcade.game.games.minecraftleague.data.TowerManager;
import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVariation;
@ -132,6 +133,16 @@ public class WitherPathfinder
//skull.setDirection(UtilAlg.getTrajectory(_ent.getLocation(), loc).normalize());
}
private TeamTowerBase getProperTarget()
{
for (TeamTowerBase t : _towerManager.getTeamTowers(_enemy))
{
if (t.Alive)
return t;
}
return null;
}
/**
* Returns true if the entity is dead or invalid
*/
@ -140,7 +151,7 @@ public class WitherPathfinder
if ((_ent == null) || _ent.isDead() || !_ent.isValid())
return true;
Entity eTower = _towerManager.getVulnerable(_enemy).getEntity();
Entity eTower = getProperTarget().getEntity();
if (eTower == null || !eTower.isValid() || eTower.isDead())
{
_ent.remove();
@ -185,8 +196,8 @@ public class WitherPathfinder
if (_team.GetColor() == ChatColor.AQUA)
tName = "BLUE";
Integer cNumber = -1;
if (_towerManager.getVulnerable(_enemy) instanceof TeamTower)
cNumber = ((TeamTower)_towerManager.getVulnerable(_enemy)).Number;
if (getProperTarget() instanceof TeamTower)
cNumber = ((TeamTower)getProperTarget()).Number;
else
cNumber = 3;
Location finalize = _host.Host.WorldData.GetCustomLocs(DataLoc.TOWER_WAYPOINT.getKey().replace("$team$", tName).replace("$number$", cNumber + "")).get(0);

View File

@ -13,6 +13,7 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
@ -965,14 +966,14 @@ public class GameFlagManager implements Listener
}
else
{
Manager.GetDamage().NewDamageEvent(player, null, null,
DamageCause.VOID, 9001, false, false, false,
"Border", "Border Damage");
if (!Manager.GetDamage().IsEnabled())
{
Bukkit.getPluginManager().callEvent(new EntityDamageEvent(player, DamageCause.VOID, 9001));
}
Manager.GetDamage().NewDamageEvent(player, null, null,
DamageCause.VOID, 9001, false, false, false,
"Border", "Border Damage");
}
}
@ -1291,7 +1292,7 @@ public class GameFlagManager implements Listener
continue;
}
long sec = UtilTime.convert(_respawnTimers.get(player) - System.currentTimeMillis(), TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
UtilTextMiddle.display("Respawning In", sec + " Seconds", player);
UtilTextBottom.display("Respawning In: " + sec + " Seconds", player);
}
}
}