From effafece441b230962cab300f414a54a13e8308a Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 27 Mar 2016 21:51:55 +1100 Subject: [PATCH] Show whether you are alive or dead in the top right. --- Games/ZombieSurvival/ZombieGame.Core.cs | 11 +++++++---- Games/ZombieSurvival/ZombieGame.Game.cs | 9 +++++---- Games/ZombieSurvival/ZombieGame.cs | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Games/ZombieSurvival/ZombieGame.Core.cs b/Games/ZombieSurvival/ZombieGame.Core.cs index 850b8b7d4..085cd098c 100644 --- a/Games/ZombieSurvival/ZombieGame.Core.cs +++ b/Games/ZombieSurvival/ZombieGame.Core.cs @@ -69,6 +69,7 @@ namespace MCGalaxy.Games { CurLevel.ChatLevel(first.color + first.name + " %Sstarted the infection!"); first.infected = true; + PlayerMoneyChanged(first); UpdatePlayerColor(first, InfectCol); RoundInProgress = true; @@ -282,12 +283,14 @@ namespace MCGalaxy.Games { if (!pl.level.name.CaselessEq(CurLevelName)) continue; bool inBlock = pl.CheckIfInsideBlock(); - if (!inBlock && alive.Length == 0) { + if (pl.CheckIfInsideBlock()) { + money = -1; + } else if (alive.Length == 0) { money = rand.Next(1, 5 + pl.playersInfected); - } else if (!inBlock && (alive.Length == 1 && !pl.infected)) { + } else if (alive.Length == 1 && !pl.infected) { money = rand.Next(5, 15); - } else if (inBlock) { - money = -1; + } else if (alive.Length > 1 && !pl.infected) { + money = rand.Next(2, 6); } Player.GlobalDespawn(pl, false); diff --git a/Games/ZombieSurvival/ZombieGame.Game.cs b/Games/ZombieSurvival/ZombieGame.Game.cs index 9e3df455d..b53cd217b 100644 --- a/Games/ZombieSurvival/ZombieGame.Game.cs +++ b/Games/ZombieSurvival/ZombieGame.Game.cs @@ -147,7 +147,7 @@ namespace MCGalaxy.Games { if (CurLevel.Authors != "") p.SendMessage("It was created by " + CurLevel.Authors); - p.SendCpeMessage(CpeMessageType.Status3, "%SYou have &a" + p.money + " %S" + Server.moneys); + PlayerMoneyChanged(p); UpdatePlayerStatus(p); if (Server.votingforlevel) @@ -165,9 +165,10 @@ namespace MCGalaxy.Games { } public override void PlayerMoneyChanged(Player p) { - if (Status == ZombieGameStatus.NotStarted - || !p.level.name.CaselessEq(CurLevelName)) return; - p.SendCpeMessage(CpeMessageType.Status3, "%SYou have &a" + p.money + " %S" + Server.moneys); + if (Status == ZombieGameStatus.NotStarted || !p.level.name.CaselessEq(CurLevelName)) return; + string moneyMsg = "&a" + p.money + " %S" + Server.moneys; + string stateMsg = " and you are " + (p.infected ? "&cdead" : "&aalive"); + p.SendCpeMessage(CpeMessageType.Status3, moneyMsg + stateMsg); } } } diff --git a/Games/ZombieSurvival/ZombieGame.cs b/Games/ZombieSurvival/ZombieGame.cs index da1ee7845..fc88e4cbd 100644 --- a/Games/ZombieSurvival/ZombieGame.cs +++ b/Games/ZombieSurvival/ZombieGame.cs @@ -147,18 +147,22 @@ namespace MCGalaxy.Games { if (!RoundInProgress || p == null) return; Infected.Add(p); Alive.Remove(p); + p.infected = true; UpdatePlayerColor(p, Colors.red); UpdateAllPlayerStatus(); + PlayerMoneyChanged(p); } public void DisinfectPlayer(Player p) { if (!RoundInProgress || p == null) return; Infected.Remove(p); Alive.Add(p); + p.infected = false; UpdatePlayerColor(p, p.color); UpdateAllPlayerStatus(); + PlayerMoneyChanged(p); } void ChangeLevel(string next) {