diff --git a/Commands/Fun/ZombieSurvival/CmdHuman.cs b/Commands/Fun/ZombieSurvival/CmdHuman.cs
new file mode 100644
index 000000000..42575e782
--- /dev/null
+++ b/Commands/Fun/ZombieSurvival/CmdHuman.cs
@@ -0,0 +1,48 @@
+/*
+ Copyright 2011 MCForge
+
+ Dual-licensed under the Educational Community License, Version 2.0 and
+ the GNU General Public License, Version 3 (the "Licenses"); you may
+ not use this file except in compliance with the Licenses. You may
+ obtain a copy of the Licenses at
+
+ http://www.opensource.org/licenses/ecl2.php
+ http://www.gnu.org/licenses/gpl-3.0.html
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the Licenses are distributed on an "AS IS"
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ or implied. See the Licenses for the specific language governing
+ permissions and limitations under the Licenses.
+*/
+using MCGalaxy.Games;
+
+namespace MCGalaxy.Commands {
+
+ public sealed class CmdHuman : Command {
+ public override string name { get { return "human"; } }
+ public override string shortcut { get { return ""; } }
+ public override string type { get { return CommandTypes.Moderation; } }
+ public override bool museumUsable { get { return true; } }
+ public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
+ public override bool Enabled { get { return Server.ZombieModeOn; } }
+ public CmdHuman() { }
+
+ public override void Use(Player p, string message) {
+ if (p == null) { MessageInGameOnly(p); return; }
+ if (p.assertingSurvive) {
+ Player.SendMessage(p, "You cannot un-assert that you will be infected."); return;
+ }
+
+ p.assertingSurvive = true;
+ Server.zombie.CurrentLevel
+ .ChatLevel(p.FullName + " %Sasserts that they will not succumb to the infection!");
+ }
+
+ public override void Help(Player p) {
+ Player.SendMessage(p, "%T/human %H- asserts that you will not be infected.");
+ Player.SendMessage(p, "%HIf you survive, you receive an &aextra 5 %3" + Server.moneys);
+ Player.SendMessage(p, "%HHowever, if you are infected, you will &close 2 %3" + Server.moneys);
+ }
+ }
+}
diff --git a/Games/LavaSurvival/LavaSurvival.cs b/Games/LavaSurvival/LavaSurvival.cs
index bb4acdaeb..fbc7dbe9d 100644
--- a/Games/LavaSurvival/LavaSurvival.cs
+++ b/Games/LavaSurvival/LavaSurvival.cs
@@ -303,6 +303,7 @@ namespace MCGalaxy.Games
Player[] online = PlayerInfo.Online.Items;
foreach (Player pl in online) {
pl.ratedMap = false;
+ pl.assertingSurvive = false;
if (pl.level == oldMap)
{
if (sendAfkMain && Server.afkset.Contains(pl.name)) Command.all.Find("main").Use(pl, "");
diff --git a/Games/ZombieSurvival/ZombieGame.Core.cs b/Games/ZombieSurvival/ZombieGame.Core.cs
index e9e89bddc..490bb0919 100644
--- a/Games/ZombieSurvival/ZombieGame.Core.cs
+++ b/Games/ZombieSurvival/ZombieGame.Core.cs
@@ -66,7 +66,7 @@ namespace MCGalaxy.Games {
RoundInProgress = true;
Random random = new Random();
- pickFirst:
+ pickFirst:
int firstinfect = random.Next(players.Count());
Player first = null;
if (queZombie) first = PlayerInfo.Find(nextZombie);
@@ -80,7 +80,7 @@ namespace MCGalaxy.Games {
UpdatePlayerColor(first, Colors.red);
RoundInProgress = true;
- int roundMins = random.Next(5, 8);
+ int roundMins = random.Next(4, 7);
CurrentLevel.ChatLevel("The round will last for " + roundMins + " minutes!");
RoundEnd = DateTime.UtcNow.AddMinutes(roundMins);
timer = new System.Timers.Timer(roundMins * 60 * 1000);
@@ -145,7 +145,7 @@ namespace MCGalaxy.Games {
while ((alive = Alive.Items).Length > 0) {
Player[] infected = Infected.Items;
foreach (Player pKiller in infected) {
- pKiller.infected = true;
+ pKiller.infected = true;
UpdatePlayerColor(pKiller, Colors.red);
bool aliveChanged = false;
foreach (Player pAlive in alive) {
@@ -155,7 +155,7 @@ namespace MCGalaxy.Games {
|| Math.Abs(pAlive.pos[2] - pKiller.pos[2]) > HitboxPrecision)
continue;
- if (!pAlive.infected && pKiller.infected && !pAlive.referee && !pKiller.referee && pKiller != pAlive
+ if (!pAlive.infected && pKiller.infected && !pAlive.referee && !pKiller.referee && pKiller != pAlive
&& pKiller.level.name.CaselessEq(CurrentLevelName) && pAlive.level.name.CaselessEq(CurrentLevelName))
{
InfectPlayer(pAlive);
@@ -181,17 +181,8 @@ namespace MCGalaxy.Games {
Colors.red + pKiller.DisplayName + Colors.yellow,
Colors.red + pAlive.DisplayName + Colors.yellow));
- BountyData bounty;
- if (Bounties.TryGetValue(pAlive.name, out bounty))
- Bounties.Remove(pAlive.name);
- if (bounty != null) {
- CurrentLevel.ChatLevel(pKiller.FullName + " %Scollected the bounty of &a" +
- bounty.Amount + " %S" + Server.moneys + " on " + pAlive.FullName + "%S.");
- bounty.Origin.money = Math.Max(0, bounty.Origin.money - bounty.Amount);
- bounty.Origin.OnMoneyChanged();
- pKiller.money += bounty.Amount;
- pKiller.OnMoneyChanged();
- }
+ CheckAssertHuman(pAlive);
+ CheckBounty(pAlive, pKiller);
UpdatePlayerColor(pAlive, Colors.red);
}
}
@@ -200,6 +191,28 @@ namespace MCGalaxy.Games {
Thread.Sleep(50);
}
}
+
+ void CheckAssertHuman(Player pAlive) {
+ if (!pAlive.assertingSurvive) return;
+ pAlive.assertingSurvive = false;
+ CurrentLevel.ChatLevel(pAlive.FullName + "%Sfailed the challenge of not being infected.");
+ pAlive.money = Math.Max(pAlive.money - 2, 0);
+ pAlive.OnMoneyChanged();
+ }
+
+ void CheckBounty(Player pAlive, Player pKiller) {
+ BountyData bounty;
+ if (Bounties.TryGetValue(pAlive.name, out bounty))
+ Bounties.Remove(pAlive.name);
+ if (bounty != null) {
+ CurrentLevel.ChatLevel(pKiller.FullName + " %Scollected the bounty of &a" +
+ bounty.Amount + " %S" + Server.moneys + " on " + pAlive.FullName + "%S.");
+ bounty.Origin.money = Math.Max(0, bounty.Origin.money - bounty.Amount);
+ bounty.Origin.OnMoneyChanged();
+ pKiller.money += bounty.Amount;
+ pKiller.OnMoneyChanged();
+ }
+ }
static void UpdatePlayerColor(Player p, string color) {
if (p.lastSpawnColor == color) return;
@@ -240,8 +253,15 @@ namespace MCGalaxy.Games {
foreach (Player pl in online)
ResetPlayer(pl, ref playersString);
} else {
- foreach (Player pl in alive)
+ foreach (Player pl in alive) {
+ if (pl.assertingSurvive) {
+ pl.SendMessage("You received &a5 %3" + Server.moneys +
+ "%s for successfully asserting that you would survive.");
+ pl.money += 5;
+ pl.OnMoneyChanged();
+ }
ResetPlayer(pl, ref playersString);
+ }
}
CurrentLevel.ChatLevel(playersString);
@@ -328,7 +348,7 @@ namespace MCGalaxy.Games {
if (initialChangeLevel) {
Server.votingforlevel = true;
CurrentLevel.ChatLevel(" " + Colors.black + "Level Vote: %S" + selectedLevel1 + ", " + selectedLevel2 +
- " or random " + "(" + Colors.lime + "1%S/" + Colors.red + "2%S/" + Colors.blue + "3%S)");
+ " or random " + "(" + Colors.lime + "1%S/" + Colors.red + "2%S/" + Colors.blue + "3%S)");
System.Threading.Thread.Sleep(15000);
Server.votingforlevel = false;
} else { Level1Vote = 1; Level2Vote = 0; Level3Vote = 0; }
diff --git a/Games/ZombieSurvival/ZombieGame.cs b/Games/ZombieSurvival/ZombieGame.cs
index 536c29431..582a12708 100644
--- a/Games/ZombieSurvival/ZombieGame.cs
+++ b/Games/ZombieSurvival/ZombieGame.cs
@@ -178,6 +178,7 @@ namespace MCGalaxy.Games {
online = PlayerInfo.Online.Items;
foreach (Player pl in online) {
pl.ratedMap = false;
+ pl.assertingSurvive = false;
if (!pl.level.name.CaselessEq(next) && pl.level.name.CaselessEq(LastLevelName)) {
pl.SendMessage("Going to the next map!");
Command.all.Find("goto").Use(pl, next);
@@ -201,8 +202,10 @@ namespace MCGalaxy.Games {
CurrentLevel = null;
Player[] online = PlayerInfo.Online.Items;
- foreach (Player pl in online)
+ foreach (Player pl in online) {
pl.ratedMap = false;
+ pl.assertingSurvive = false;
+ }
}
void UpdatePlayerStatus(Player p) {
diff --git a/MCGalaxy_.csproj b/MCGalaxy_.csproj
index f688734c6..5b39ff2b3 100644
--- a/MCGalaxy_.csproj
+++ b/MCGalaxy_.csproj
@@ -195,6 +195,7 @@
+
diff --git a/Player/Player.cs b/Player/Player.cs
index 54c269c00..cc7b0d3ca 100644
--- a/Player/Player.cs
+++ b/Player/Player.cs
@@ -198,6 +198,7 @@ namespace MCGalaxy {
public int playersInfected = 0;
internal string lastSpawnColor = "";
internal bool ratedMap = false;
+ internal bool assertingSurvive = false;
//Tnt Wars
public bool PlayingTntWars = false;