Some minor fixes for zombie survival, /store now shows all buyable items if no item name is given.

This commit is contained in:
UnknownShadow200 2016-03-22 22:34:09 +11:00
parent a0c241f487
commit a24dbf123d
4 changed files with 17 additions and 1 deletions

View File

@ -32,6 +32,14 @@ namespace MCGalaxy.Commands {
public override bool Enabled { get { return Economy.Enabled; } } public override bool Enabled { get { return Economy.Enabled; } }
public override void Use(Player p, string message) { 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 (Item item in Economy.Items)
foreach (string alias in item.Aliases) foreach (string alias in item.Aliases)
{ {
@ -49,6 +57,8 @@ namespace MCGalaxy.Commands {
public override void Help(Player p) { public override void Help(Player p) {
Player.SendMessage(p, "%T/store [item]"); Player.SendMessage(p, "%T/store [item]");
Player.SendMessage(p, "%HViews information about the specific item, such as its cost."); 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(", ")); Player.SendMessage(p, "%H Available items: %f" + Economy.GetItemNames(", "));
} }
} }

View File

@ -38,7 +38,7 @@ namespace MCGalaxy.Eco {
"%c to buy " + (count * 10) + " " + Name + "."); return; "%c to buy " + (count * 10) + " " + Name + "."); return;
} }
p.blocksStacked += 10 * count; p.blockCount += 10 * count;
MakePurchase(p, Price * count, "%3Blocks: " + (10 * count)); MakePurchase(p, Price * count, "%3Blocks: " + (10 * count));
} }
} }

View File

@ -65,6 +65,7 @@ namespace MCGalaxy.Games {
public override bool HandlesMovement(Player p, ushort x, ushort y, ushort z, public override bool HandlesMovement(Player p, ushort x, ushort y, ushort z,
byte rotX, byte rotY) { byte rotX, byte rotY) {
if (p.level == null || !p.level.name.CaselessEq(CurrentLevelName)) return false;
if (!p.referee && noRespawn) { if (!p.referee && noRespawn) {
if (p.pos[0] >= x + 70 || p.pos[0] <= x - 70 ) { 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]); 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, ""); p.SendCpeMessage(CpeMessageType.Status3, "");
Alive.Remove(p); Alive.Remove(p);
Infected.Remove(p); Infected.Remove(p);
if (oldLvl != null && oldLvl.name.CaselessEq(CurrentLevelName))
UpdateAllPlayerStatus();
} }
public override void PlayerMoneyChanged(Player p) { public override void PlayerMoneyChanged(Player p) {

View File

@ -81,6 +81,7 @@ namespace MCGalaxy.Levels.IO {
writer.WriteLine("Dislikes = " + level.Dislikes); writer.WriteLine("Dislikes = " + level.Dislikes);
writer.WriteLine("Authors = " + level.Authors); writer.WriteLine("Authors = " + level.Authors);
writer.WriteLine("Pillaring = " + level.Pillaring); writer.WriteLine("Pillaring = " + level.Pillaring);
writer.WriteLine("BuildType = " + level.BuildType);
} }
static string GetName(LevelPermission perm) { static string GetName(LevelPermission perm) {
@ -225,6 +226,8 @@ namespace MCGalaxy.Levels.IO {
level.Authors = value; break; level.Authors = value; break;
case "pillaring": case "pillaring":
level.Pillaring = bool.Parse(value); break; level.Pillaring = bool.Parse(value); break;
case "buildtype":
level.BuildType = (BuildType)Enum.Parse(typeof(BuildType), value); break;
} }
} }