- Fixed TowerDefender being too difficult to obtain

- Fixed wither attacking own towers by accident
This commit is contained in:
AlexTheCoder 2016-04-18 22:58:55 -04:00
parent 6c20427395
commit e08965aa25
4 changed files with 10 additions and 6 deletions

View File

@ -201,7 +201,7 @@ public class MinecraftLeague extends TeamGame
new AltarBuilderTracker(this),
new FirstStrikeTracker(this),
new HeadHunterTracker(this),
new TowerDefenderTracker(this, 2, 5000, "TowerDefender")
new TowerDefenderTracker(this, 2, 8000, "TowerDefender")
);
_vman = new VariationManager(this);

View File

@ -69,7 +69,7 @@ public class TowerDefenderTracker extends StatTracker<MinecraftLeague>
if (killCount == getKillCount() && System.currentTimeMillis() - lastKill < getTimeLimit())
{
if (UtilMath.offset(player.getLocation(), getGame().getActiveTower(getGame().GetTeam(player)).getLocation()) <= 5)
if (UtilMath.offset2d(player.getLocation(), getGame().getActiveTower(getGame().GetTeam(player)).getLocation()) <= 7)
{
addStat(player, getStat(), 1, true, false);
_lastKill.remove(player.getUniqueId());

View File

@ -284,6 +284,9 @@ public class WitherVariation extends GameVariation
{
event.setCancelled(true);
if (!((WitherSkull)event.getEntity()).isCharged())
return;
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);

View File

@ -114,12 +114,12 @@ public class WitherPathfinder
if (UtilTime.elapsed(_lastAttack, UtilTime.convert(2, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
{
_lastAttack = System.currentTimeMillis();
shootAt(target.getLocation());
shootAt(target.getLocation(), false);
}
}
}
private void shootAt(Location loc)
private void shootAt(Location loc, boolean charged)
{
Location old = _ent.getLocation();
Location temp = _ent.getLocation();
@ -127,7 +127,8 @@ public class WitherPathfinder
temp.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(_ent.getEyeLocation(), loc)));
_ent.teleport(temp);
_ent.setMetadata("Shooting", new FixedMetadataValue(_host.Manager.getPlugin(), "1"));
_ent.launchProjectile(WitherSkull.class);
WitherSkull skull = _ent.launchProjectile(WitherSkull.class);
skull.setCharged(charged);
_ent.removeMetadata("Shooting", _host.Manager.getPlugin());
_ent.teleport(old);
//skull.setDirection(UtilAlg.getTrajectory(_ent.getLocation(), loc).normalize());
@ -212,7 +213,7 @@ public class WitherPathfinder
if (UtilTime.elapsed(_lastTowerAttack, UtilTime.convert(5, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
{
_lastTowerAttack = System.currentTimeMillis();
shootAt(eTower.getLocation());
shootAt(eTower.getLocation(), true);
}
return false;
}