Only allow kills to damage king/crystals if tnt has spawned at least once

This commit is contained in:
AlexTheCoder 2017-05-16 21:23:46 -04:00 committed by cnr
parent eb0e9c0504
commit f69203884c

View File

@ -135,6 +135,8 @@ public class CastleAssault extends TeamGame
private boolean _writeScoreboard = true; private boolean _writeScoreboard = true;
private boolean _killsAreObjective = false;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public CastleAssault(ArcadeManager manager) public CastleAssault(ArcadeManager manager)
{ {
@ -636,6 +638,13 @@ public class CastleAssault extends TeamGame
} }
_tntSpawner.update(); _tntSpawner.update();
if (!_killsAreObjective)
{
if (_tntSpawner.isSpawned())
{
_killsAreObjective = true;
}
}
} }
if (InProgress()) if (InProgress())
{ {
@ -864,6 +873,8 @@ public class CastleAssault extends TeamGame
} }
AddStat(player, GetKit(player).GetName() + "KitKills", 1, false, false); AddStat(player, GetKit(player).GetName() + "KitKills", 1, false, false);
if (_killsAreObjective)
{
_teamKills.merge(GetTeam(player), 1, Integer::sum); _teamKills.merge(GetTeam(player), 1, Integer::sum);
if (GetTeam(player).GetColor() == ChatColor.RED) if (GetTeam(player).GetColor() == ChatColor.RED)
{ {
@ -913,6 +924,7 @@ public class CastleAssault extends TeamGame
_kings.get(enemy).handleDamage(player.getName(), 10, true); _kings.get(enemy).handleDamage(player.getName(), 10, true);
} }
} }
}
if (UtilPlayer.isSpectator(player)) if (UtilPlayer.isSpectator(player))
{ {