diff --git a/Commands/Fun/CmdTeam.cs b/Commands/Fun/CmdTeam.cs index ae7019dd2..686b2f72a 100644 --- a/Commands/Fun/CmdTeam.cs +++ b/Commands/Fun/CmdTeam.cs @@ -102,7 +102,9 @@ namespace MCGalaxy.Commands { Player.SendMessage(p, "\"" + color + "\" is not a valid color."); return; } team.Color = color; + team.Action(p, "changed the team color to: " + args[1]); team.UpdatePrefix(); + Team.SaveList(); } void HandleCreate(Player p, string[] args) { diff --git a/Commands/Fun/WeaponCmd.cs b/Commands/Fun/WeaponCmd.cs index 7785291ab..ebccb8a5b 100644 --- a/Commands/Fun/WeaponCmd.cs +++ b/Commands/Fun/WeaponCmd.cs @@ -123,7 +123,7 @@ namespace MCGalaxy.Commands { void CheckTile(Level lvl, List toSend, int x, int y, int z) { Pos pos; if (lvl.GetTile((ushort)x, (ushort)(y - 1), (ushort)z) == Block.air) { - pos.x = (ushort)x; pos.y = (ushort)y; pos.z = (ushort)z; + pos.x = (ushort)x; pos.y = (ushort)(y - 1); pos.z = (ushort)z; toSend.Add(pos); } if (lvl.GetTile((ushort)x, (ushort)y, (ushort)z) == Block.air) { diff --git a/Commands/Fun/ZombieSurvival/CmdQueue.cs b/Commands/Fun/ZombieSurvival/CmdQueue.cs index 5c1297e5d..c7c270207 100644 --- a/Commands/Fun/ZombieSurvival/CmdQueue.cs +++ b/Commands/Fun/ZombieSurvival/CmdQueue.cs @@ -33,14 +33,14 @@ namespace MCGalaxy.Commands if (args.Length != 2) { Help(p); return; } string value = args[1]; - if (args[0] == "zombie") { + if (args[0].CaselessEq("zombie")) { Player who = PlayerInfo.FindOrShowMatches(p, value); if (who == null) return; p.SendMessage(value + " was queued."); Server.zombie.queZombie = true; Server.zombie.nextZombie = value; - } else if (args[0] == "level") { + } else if (args[0].CaselessEq("level")) { if (LevelInfo.ExistsOffline(value)) { p.SendMessage(value + " was queued."); Server.zombie.queLevel = true; diff --git a/Economy/Economy.cs b/Economy/Economy.cs index 4b2e104ad..5d4476e74 100644 --- a/Economy/Economy.cs +++ b/Economy/Economy.cs @@ -150,7 +150,7 @@ namespace MCGalaxy { public static Item[] Items = { new ColorItem(), new TitleColorItem(), new TitleItem(), new RankItem(), new LevelItem(), new LoginMessageItem(), - new LogoutMessageItem(), new BlocksItem() }; + new LogoutMessageItem(), new BlocksItem(), new QueueLevelItem() }; public static Item GetItem(string name) { foreach (Item item in Items) { diff --git a/Economy/BlocksItem.cs b/Economy/ZombieItems.cs similarity index 66% rename from Economy/BlocksItem.cs rename to Economy/ZombieItems.cs index 7534a886f..a94648c37 100644 --- a/Economy/BlocksItem.cs +++ b/Economy/ZombieItems.cs @@ -1,5 +1,5 @@ /* - Copyright 2011 MCForge + Copyright 2015 MCGalaxy Dual-licensed under the Educational Community License, Version 2.0 and the GNU General Public License, Version 3 (the "Licenses"); you may @@ -42,4 +42,26 @@ namespace MCGalaxy.Eco { MakePurchase(p, Price, "%3Blocks: " + (10 * count)); } } + + public sealed class QueueLevelItem : SimpleItem { + + public QueueLevelItem() { + Aliases = new[] { "queuelevel", "queuelvl", "queue" }; + Price = 150; + } + + public override string Name { get { return "QueueLevel"; } } + + protected override void OnBuyCommand(Player p, string message, string[] args) { + if (Server.zombie.queLevel) { + Player.SendMessage(p, "Someone else has already queued a level."); return; + } + if (!LevelInfo.ExistsOffline(message)) { + Player.SendMessage(p, "Given level does not exist."); return; + } + + Command.all.Find("queue").Use(p, "level " + message); + MakePurchase(p, Price, "%3QueueLevel: " + message); + } + } } diff --git a/Games/Team.List.cs b/Games/Team.List.cs index 5a4a3ca70..37e87f867 100644 --- a/Games/Team.List.cs +++ b/Games/Team.List.cs @@ -54,7 +54,7 @@ namespace MCGalaxy.Games { w.WriteLine("Name=" + pair.Value.Name); w.WriteLine("Color=" + pair.Value.Color); w.WriteLine("Owner=" + pair.Value.Owner); - string list = String.Join(",", TeamsList.ToArray()); + string list = String.Join(",", pair.Value.Members); w.WriteLine("Members=" + list); w.WriteLine(""); } diff --git a/Levels/Physics/TntPhysics.cs b/Levels/Physics/TntPhysics.cs index 2daee6f3d..1ad15cd83 100644 --- a/Levels/Physics/TntPhysics.cs +++ b/Levels/Physics/TntPhysics.cs @@ -45,7 +45,7 @@ namespace MCGalaxy.BlockPhysics { ShowWarningFuse(lvl, x, y, z); return; } - lvl.MakeExplosion(x, y, z, power); + MakeExplosion(lvl, x, y, z, power); } } @@ -73,7 +73,7 @@ namespace MCGalaxy.BlockPhysics { } if (p.TntWarsKillStreak >= TntWarsGame.Properties.DefaultStreakTwoAmount && game.Streaks) power++; - lvl.MakeExplosion(x, y, z, power - 2, true, game); + MakeExplosion(lvl, x, y, z, power - 2, true, game); List Killed = new List(); Player[] players = PlayerInfo.Online.Items; @@ -94,7 +94,7 @@ namespace MCGalaxy.BlockPhysics { ? Block.air : Block.lavastill); return; } - lvl.MakeExplosion(x, y, z, 0); + MakeExplosion(lvl, x, y, z, 0); } } } @@ -127,9 +127,10 @@ namespace MCGalaxy.BlockPhysics { continue; } - if (rand.Next(1, 11) <= 4) + int mode = rand.Next(1, 11); + if (mode <= 4) lvl.AddUpdate(index, Block.tntexplosion); - else if (rand.Next(1, 11) <= 8) + else if (mode <= 8) lvl.AddUpdate(index, Block.air); else lvl.AddCheck(index, false, "drop 50 dissipate 8"); diff --git a/MCGalaxy_.csproj b/MCGalaxy_.csproj index c24464c58..5f7caae24 100644 --- a/MCGalaxy_.csproj +++ b/MCGalaxy_.csproj @@ -411,7 +411,7 @@ - + diff --git a/Server/Server.cs b/Server/Server.cs index 15aa09f33..40f4e19b9 100644 --- a/Server/Server.cs +++ b/Server/Server.cs @@ -585,6 +585,7 @@ namespace MCGalaxy CommandOtherPerms.Load(); ProfanityFilter.Init(); Alias.Load(); + Team.LoadList(); } public static void Setup()