From a24dbf123dfe1f0d0068ca581a0287c76f9589ac Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 22 Mar 2016 22:34:09 +1100 Subject: [PATCH] Some minor fixes for zombie survival, /store now shows all buyable items if no item name is given. --- Commands/Economy/CmdStore.cs | 10 ++++++++++ Economy/ZombieItems.cs | 2 +- Games/ZombieSurvival/ZombieGame.Game.cs | 3 +++ Levels/IO/LvlProperties.cs | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Commands/Economy/CmdStore.cs b/Commands/Economy/CmdStore.cs index c680eb16e..dcdebf39c 100644 --- a/Commands/Economy/CmdStore.cs +++ b/Commands/Economy/CmdStore.cs @@ -32,6 +32,14 @@ namespace MCGalaxy.Commands { public override bool Enabled { get { return Economy.Enabled; } } public override void Use(Player p, string message) { + if (message == "") { + foreach (Item item in Economy.Items) { + if (!item.Enabled) continue; + item.OnStoreCommand(p); + } + return; + } + foreach (Item item in Economy.Items) foreach (string alias in item.Aliases) { @@ -49,6 +57,8 @@ namespace MCGalaxy.Commands { public override void Help(Player p) { Player.SendMessage(p, "%T/store [item]"); Player.SendMessage(p, "%HViews information about the specific item, such as its cost."); + Player.SendMessage(p, "%T/store"); + Player.SendMessage(p, "%HViews information about all enabled items."); Player.SendMessage(p, "%H Available items: %f" + Economy.GetItemNames(", ")); } } diff --git a/Economy/ZombieItems.cs b/Economy/ZombieItems.cs index f462465b7..231e055b9 100644 --- a/Economy/ZombieItems.cs +++ b/Economy/ZombieItems.cs @@ -38,7 +38,7 @@ namespace MCGalaxy.Eco { "%c to buy " + (count * 10) + " " + Name + "."); return; } - p.blocksStacked += 10 * count; + p.blockCount += 10 * count; MakePurchase(p, Price * count, "%3Blocks: " + (10 * count)); } } diff --git a/Games/ZombieSurvival/ZombieGame.Game.cs b/Games/ZombieSurvival/ZombieGame.Game.cs index f632ca830..202d51ba9 100644 --- a/Games/ZombieSurvival/ZombieGame.Game.cs +++ b/Games/ZombieSurvival/ZombieGame.Game.cs @@ -65,6 +65,7 @@ namespace MCGalaxy.Games { public override bool HandlesMovement(Player p, ushort x, ushort y, ushort z, byte rotX, byte rotY) { + if (p.level == null || !p.level.name.CaselessEq(CurrentLevelName)) return false; if (!p.referee && noRespawn) { if (p.pos[0] >= x + 70 || p.pos[0] <= x - 70 ) { p.SendPos(0xFF, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1]); @@ -156,6 +157,8 @@ namespace MCGalaxy.Games { p.SendCpeMessage(CpeMessageType.Status3, ""); Alive.Remove(p); Infected.Remove(p); + if (oldLvl != null && oldLvl.name.CaselessEq(CurrentLevelName)) + UpdateAllPlayerStatus(); } public override void PlayerMoneyChanged(Player p) { diff --git a/Levels/IO/LvlProperties.cs b/Levels/IO/LvlProperties.cs index 3b362fac9..ab9437f5d 100644 --- a/Levels/IO/LvlProperties.cs +++ b/Levels/IO/LvlProperties.cs @@ -81,6 +81,7 @@ namespace MCGalaxy.Levels.IO { writer.WriteLine("Dislikes = " + level.Dislikes); writer.WriteLine("Authors = " + level.Authors); writer.WriteLine("Pillaring = " + level.Pillaring); + writer.WriteLine("BuildType = " + level.BuildType); } static string GetName(LevelPermission perm) { @@ -225,6 +226,8 @@ namespace MCGalaxy.Levels.IO { level.Authors = value; break; case "pillaring": level.Pillaring = bool.Parse(value); break; + case "buildtype": + level.BuildType = (BuildType)Enum.Parse(typeof(BuildType), value); break; } }