Updating stats more often just like @SuperYoshi did originally during teams spawn reset. Tweaked message colors.

This commit is contained in:
taoneill 2012-01-09 00:21:02 -05:00
parent 2adb328115
commit 25bbf5b185
4 changed files with 11 additions and 14 deletions

View File

@ -151,12 +151,6 @@ public class WarEntityListener extends EntityListener {
}
defenderWarzone.handleDeath(d);
if (War.war.isSpoutServer()) {
// make sure score is updated
War.war.getSpoutMessenger().updateStats(defenderWarzone);
}
event.setCancelled(true);
}
} else if (attackerTeam != null && defenderTeam != null && attackerTeam == defenderTeam && attackerWarzone == defenderWarzone && attacker.getEntityId() != defender.getEntityId()) {
@ -196,7 +190,7 @@ public class WarEntityListener extends EntityListener {
Warzone defenderWarzone = Warzone.getZoneByPlayerName(d.getName());
if (d != null && defenderWarzone != null && event.getDamage() >= d.getHealth()) {
String deathMessage = "";
String defenderString = Team.getTeamByPlayerName(d.getName()).getKind().getColor() + d.getDisplayName();
String defenderString = Team.getTeamByPlayerName(d.getName()).getKind().getColor() + d.getName();
if (event.getDamager() instanceof CraftTNTPrimed) {
deathMessage = defenderString + ChatColor.WHITE + " exploded";
@ -360,7 +354,7 @@ public class WarEntityListener extends EntityListener {
} else if (event.getCause() == DamageCause.FALL) {
cause = " fell to an untimely death";
}
deathMessage = Team.getTeamByPlayerName(player.getName()).getKind().getColor() + player.getDisplayName() + ChatColor.WHITE + cause;
deathMessage = Team.getTeamByPlayerName(player.getName()).getKind().getColor() + player.getName() + ChatColor.WHITE + cause;
for (Team team : zone.getTeams()) {
team.teamcast(deathMessage);
}

View File

@ -323,6 +323,10 @@ public class Team {
SignHelper.setToSign(War.war, signBlock, (byte) signData, lines);
}
if (War.war.isSpoutServer()) {
War.war.getSpoutMessenger().updateStats(this.warzone);
}
}
private void setBlock(int x, int y, int z, TeamKind kind) {

View File

@ -726,8 +726,8 @@ public class Warzone {
SpoutPlayer sp = SpoutManager.getPlayer(p);
if (sp.isSpoutCraftEnabled()) {
sp.sendNotification(
SpoutMessenger.cleanForNotification("Round over! " + ChatColor.WHITE + "Team " + playerTeam.getKind().getColor() + playerTeam.getName()),
SpoutMessenger.cleanForNotification("had no more lives."),
SpoutMessenger.cleanForNotification("Round over! " + playerTeam.getKind().getColor() + playerTeam.getName()),
SpoutMessenger.cleanForNotification("ran out of lives."),
playerTeam.getKind().getMaterial(),
playerTeam.getKind().getData(),
5000);

View File

@ -137,14 +137,13 @@ public class SpoutMessenger {
int lineCounter = 1;
for (Team t : zone.getTeams()) {
// team name
String teamStr = t.getName() + "-" + t.getPlayers().size() + "/" + t.getTeamConfig().resolveInt(TeamConfig.TEAMSIZE);
String teamStr = t.getName() + " (" + t.getPlayers().size() + "/" + t.getTeamConfig().resolveInt(TeamConfig.TEAMSIZE) + ")";
line = new GenericLabel(teamStr);
if (t.getPlayers().size() == 0) {
line.setText(teamStr.replace("-", " "));
line.setTextColor(new Color(100,100,100));
}
else {
line.setText(t.getKind().getColor() + teamStr.replace("-", " " + ChatColor.WHITE));
line.setText(t.getKind().getColor() + teamStr.replace("(", ChatColor.GRAY + "(" + ChatColor.WHITE).replace(")", ChatColor.GRAY + ")" + ChatColor.WHITE));
}
line.setTooltip("Warzone: " + zone.getName()).setAnchor(WidgetAnchor.TOP_LEFT);
line.setAlign(WidgetAnchor.TOP_LEFT).setX(2).setY(4 + lineCounter * 8).setWidth(GenericLabel.getStringWidth(line.getText())).setHeight(GenericLabel.getStringHeight(line.getText()));
@ -246,7 +245,7 @@ public class SpoutMessenger {
drawStats(player, statsLines);
if (messages.size() > 0) {
if (messages != null && messages.size() > 0) {
int rank = 0;
Warzone zone = Warzone.getZoneByPlayerName(playerName);
int verticalOffset = statsOffset + 4;