diff --git a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs
index dc30fc974..a234e38b2 100644
--- a/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs
+++ b/MCGalaxy/Commands/Fun/ZombieSurvival/CmdHuman.cs
@@ -26,8 +26,9 @@ public sealed class CmdHuman : Command2 {
public override CommandEnable Enabled { get { return CommandEnable.Zombie; } }
public override bool SuperUseable { get { return false; } }
- public override void Use(Player p, string message, CommandData data) {
- if (p.Game.PledgeSurvive) {
+ public override void Use(Player p, string message, CommandData data_) {
+ ZSData data = ZSGame.Get(p);
+ if (data.PledgeSurvive) {
p.Message("You cannot un-pledge that you will be infected."); return;
}
if (ZSGame.IsInfected(p)) {
@@ -45,9 +46,9 @@ public sealed class CmdHuman : Command2 {
TimeSpan delta = ZSGame.Instance.RoundEnd - DateTime.UtcNow;
if (delta < TimeSpan.FromMinutes(3)) {
p.Message("Cannot use &T/human &Sin last three minutes of a round."); return;
- }
-
- p.Game.PledgeSurvive = true;
+ }
+
+ data.PledgeSurvive = true;
ZSGame.Instance.Map
.Message(p.ColoredName + " &Spledges that they will not succumb to the infection!");
}
diff --git a/MCGalaxy/CorePlugin/CorePlugin.cs b/MCGalaxy/CorePlugin/CorePlugin.cs
index be2ef4137..ca78f32c6 100644
--- a/MCGalaxy/CorePlugin/CorePlugin.cs
+++ b/MCGalaxy/CorePlugin/CorePlugin.cs
@@ -18,16 +18,13 @@
using System;
using MCGalaxy.Events;
using MCGalaxy.Events.EconomyEvents;
-using MCGalaxy.Events.GroupEvents;
using MCGalaxy.Events.PlayerEvents;
using MCGalaxy.Events.ServerEvents;
-using MCGalaxy.Tasks;
namespace MCGalaxy.Core {
public sealed class CorePlugin : Plugin {
- public override string creator { get { return Server.SoftwareName + " team"; } }
- public override string MCGalaxy_Version { get { return Server.Version; } }
+ public override string MCGalaxy_Version { get { return null; } }
public override string name { get { return "CorePlugin"; } }
public override void Load(bool startup) {
diff --git a/MCGalaxy/Games/GameProps.cs b/MCGalaxy/Games/GameProps.cs
index 846fd3074..2d1cfbf68 100644
--- a/MCGalaxy/Games/GameProps.cs
+++ b/MCGalaxy/Games/GameProps.cs
@@ -30,9 +30,6 @@ public class GameProps {
/// Whether the player has liked or disliked the map in this round.
internal bool RatedMap = false, LikedMap = false;
-
- /// Whether the player has pledged that they will survive/win in this round.
- internal bool PledgeSurvive = false;
//Zombie
public bool Referee = false;
diff --git a/MCGalaxy/Games/RoundsGame/RoundsGame.cs b/MCGalaxy/Games/RoundsGame/RoundsGame.cs
index ada966f42..ba7845679 100644
--- a/MCGalaxy/Games/RoundsGame/RoundsGame.cs
+++ b/MCGalaxy/Games/RoundsGame/RoundsGame.cs
@@ -18,12 +18,12 @@
using System;
using System.Collections.Generic;
using System.Threading;
-using MCGalaxy.Commands.World;
using MCGalaxy.Events.GameEvents;
-namespace MCGalaxy.Games {
-
- public abstract partial class RoundsGame : IGame {
+namespace MCGalaxy.Games
+{
+ public abstract partial class RoundsGame : IGame
+ {
public int RoundsLeft;
public bool RoundInProgress;
public DateTime RoundStart;
@@ -217,7 +217,6 @@ public abstract partial class RoundsGame : IGame {
foreach (Player pl in online) {
pl.Game.RatedMap = false;
- pl.Game.PledgeSurvive = false;
if (pl.level != Map && pl.level == lastMap) transfers.Add(pl);
}
@@ -254,7 +253,6 @@ public abstract partial class RoundsGame : IGame {
foreach (Player pl in players) {
if (pl.level != Map) continue;
pl.Game.RatedMap = false;
- pl.Game.PledgeSurvive = false;
PlayerLeftGame(pl);
TabList.Update(pl, true);
diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs
index 85cd320af..3d4d458aa 100644
--- a/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs
+++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.Plugin.cs
@@ -141,8 +141,9 @@ public sealed partial class ZSGame : RoundsGame {
HandleJoinedCommon(p, prevLevel, level, ref announce);
p.SetPrefix(); // TODO: Kinda hacky, not sure if needed
if (level != Map) return;
-
+
ZSData data = Get(p);
+ data.PledgeSurvive = false;
p.SetPrefix();
if (RoundInProgress) {
diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.Round.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.Round.cs
index eaef9dfd4..d5661e0c4 100644
--- a/MCGalaxy/Games/ZombieSurvival/ZSGame.Round.cs
+++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.Round.cs
@@ -29,6 +29,8 @@ public sealed partial class ZSGame : RoundsGame
protected override void DoRound() {
if (!Running) return;
+
+ ResetPledges();
List players = DoRoundCountdown(Config.InfectionCountdown);
if (players == null) return;
@@ -39,6 +41,13 @@ public sealed partial class ZSGame : RoundsGame
if (!Running) return;
DoCoreGame();
}
+
+ void ResetPledges() {
+ foreach (Player pl in GetPlayers())
+ {
+ Get(pl).PledgeSurvive = false;
+ }
+ }
void StartRound(List players) {
TimeSpan duration = Map.Config.RoundTime;
@@ -53,7 +62,7 @@ public sealed partial class ZSGame : RoundsGame
Infected.Clear();
Random rnd = new Random();
- Player first = null;
+ Player first;
do {
first = QueuedZombie != null ? PlayerInfo.FindExact(QueuedZombie) : players[rnd.Next(players.Count)];
QueuedZombie = null;
@@ -170,8 +179,9 @@ public sealed partial class ZSGame : RoundsGame
}
void CheckHumanPledge(Player p, Player killer) {
- if (!p.Game.PledgeSurvive) return;
- p.Game.PledgeSurvive = false;
+ ZSData data = Get(p);
+ if (!data.PledgeSurvive) return;
+ data.PledgeSurvive = false;
Map.Message("&c" + p.DisplayName + " &Sbroke their pledge of not being infected.");
if (killer == null) {
@@ -264,13 +274,14 @@ public sealed partial class ZSGame : RoundsGame
}
void IncreaseAliveStats(Player p) {
- if (p.Game.PledgeSurvive) {
+ ZSData data = Get(p);
+
+ if (data.PledgeSurvive) {
p.Message("You received &a5 &3" + Server.Config.Currency +
" &Sfor successfully pledging that you would survive.");
p.SetMoney(p.money + 5);
}
- ZSData data = Get(p);
data.CurrentRoundsSurvived++;
data.TotalRoundsSurvived++;
data.MaxRoundsSurvived = Math.Max(data.CurrentRoundsSurvived, data.MaxRoundsSurvived);
@@ -296,7 +307,7 @@ public sealed partial class ZSGame : RoundsGame
pl.SetMoney(pl.money + reward);
ResetRoundState(pl, data);
- pl.Game.PledgeSurvive = false;
+ data.PledgeSurvive = false;
if (pl.Game.Referee) {
pl.Message("You gained one " + Server.Config.Currency + " because you're a ref. Would you like a medal as well?");
diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.cs
index c5ae6aaa6..083c21e27 100644
--- a/MCGalaxy/Games/ZombieSurvival/ZSGame.cs
+++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.cs
@@ -47,6 +47,8 @@ internal sealed class ZSData
public DateTime LastPillarWarn;
public bool PillarFined;
+ /// Whether the player has pledged that they will survive this round.
+ public bool PledgeSurvive;
public void ResetInvisibility() {
Invisible = false;
@@ -78,6 +80,7 @@ public sealed partial class ZSGame : RoundsGame
data = new ZSData();
// TODO: Is this even thread-safe
+ // TODO don't load here, add a LoadInfectMessages method
data.InfectMessages = ZSConfig.LoadPlayerInfectMessages(p.name);
ZombieStats s = LoadStats(p.name);
data.MaxInfected = s.MaxInfected; data.TotalInfected = s.TotalInfected;
diff --git a/MCGalaxy/MCGalaxy_.csproj b/MCGalaxy/MCGalaxy_.csproj
index 7cc4a7756..247b67b11 100644
--- a/MCGalaxy/MCGalaxy_.csproj
+++ b/MCGalaxy/MCGalaxy_.csproj
@@ -692,7 +692,9 @@
Always
-
+
+
+