mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-25 22:30:52 -04:00
Show whether you are alive or dead in the top right.
This commit is contained in:
parent
496327853a
commit
effafece44
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user