mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-04 02:52:21 -04:00
Simplify OnBuyCommand for economy items
This commit is contained in:
parent
02663729ae
commit
6508dc3fca
@ -25,7 +25,7 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
// Custom command, so can still be used even when economy is disabled
|
// Custom command, so can still be used even when economy is disabled
|
||||||
public override void Use(Player p, string message, CommandData data) {
|
public override void Use(Player p, string message, CommandData data) {
|
||||||
Item item = Economy.GetItem("Snack");
|
Item item = Economy.GetItem("Snack");
|
||||||
item.OnBuyCommand(p, message, message.SplitSpaces());
|
item.OnPurchase(p, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
|
@ -27,7 +27,7 @@ namespace MCGalaxy.Commands.Eco {
|
|||||||
public override bool SuperUseable { get { return false; } }
|
public override bool SuperUseable { get { return false; } }
|
||||||
|
|
||||||
public override void Use(Player p, string message, CommandData data) {
|
public override void Use(Player p, string message, CommandData data) {
|
||||||
string[] parts = message.SplitSpaces();
|
string[] parts = message.SplitSpaces(2);
|
||||||
Item item = Economy.GetItem(parts[0]);
|
Item item = Economy.GetItem(parts[0]);
|
||||||
if (item == null) { Help(p); return; }
|
if (item == null) { Help(p); return; }
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ namespace MCGalaxy.Commands.Eco {
|
|||||||
if (data.Rank < item.PurchaseRank) {
|
if (data.Rank < item.PurchaseRank) {
|
||||||
Formatter.MessageNeedMinPerm(p, "+ can purchase a " + item.Name, item.PurchaseRank); return;
|
Formatter.MessageNeedMinPerm(p, "+ can purchase a " + item.Name, item.PurchaseRank); return;
|
||||||
}
|
}
|
||||||
item.OnBuyCommand(p, message, parts);
|
item.OnPurchase(p, parts.Length == 1 ? "" : parts[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
|
@ -64,7 +64,7 @@ namespace MCGalaxy.Commands.Eco {
|
|||||||
if (item == null) {
|
if (item == null) {
|
||||||
p.Message("No item has that name, see %T/Eco help %Sfor a list of items.");
|
p.Message("No item has that name, see %T/Eco help %Sfor a list of items.");
|
||||||
} else {
|
} else {
|
||||||
item.OnSetupCommandHelp(p);
|
item.OnSetupHelp(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,13 +49,13 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
|
|
||||||
/// <summary> Called when the player does /buy [item name] <value> </summary>
|
/// <summary> Called when the player does /buy [item name] <value> </summary>
|
||||||
protected internal abstract void OnBuyCommand(Player p, string message, string[] args);
|
protected internal abstract void OnPurchase(Player p, string args);
|
||||||
|
|
||||||
/// <summary> Called when the player does /eco [item name] [option] <value> </summary>
|
/// <summary> Called when the player does /eco [item name] [option] <value> </summary>
|
||||||
protected internal abstract void OnSetupCommand(Player p, string[] args);
|
protected internal abstract void OnSetup(Player p, string[] args);
|
||||||
|
|
||||||
/// <summary> Called when the player does /eco help [item name] </summary>
|
/// <summary> Called when the player does /eco help [item name] </summary>
|
||||||
protected internal virtual void OnSetupCommandHelp(Player p) {
|
protected internal virtual void OnSetupHelp(Player p) {
|
||||||
p.Message("%T/Eco {0} enable/disable", Name.ToLower());
|
p.Message("%T/Eco {0} enable/disable", Name.ToLower());
|
||||||
p.Message("%HEnables/disables purchasing this item.");
|
p.Message("%HEnables/disables purchasing this item.");
|
||||||
p.Message("%T/Eco {0} purchaserank [rank]", Name.ToLower());
|
p.Message("%T/Eco {0} purchaserank [rank]", Name.ToLower());
|
||||||
@ -85,7 +85,7 @@ namespace MCGalaxy.Eco {
|
|||||||
PurchaseRank = grp.Permission;
|
PurchaseRank = grp.Permission;
|
||||||
p.Message("Min purchase rank for {0} item set to {1}%S.", Name, grp.ColoredName);
|
p.Message("Min purchase rank for {0} item set to {1}%S.", Name, grp.ColoredName);
|
||||||
} else {
|
} else {
|
||||||
OnSetupCommand(p, args);
|
OnSetup(p, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
protected bool CheckPrice(Player p) { return CheckPrice(p, Price, "a " + Name); }
|
protected bool CheckPrice(Player p) { return CheckPrice(p, Price, "a " + Name); }
|
||||||
|
|
||||||
protected internal override void OnSetupCommand(Player p, string[] args) {
|
protected internal override void OnSetup(Player p, string[] args) {
|
||||||
if (args[1].CaselessEq("price")) {
|
if (args[1].CaselessEq("price")) {
|
||||||
int cost = 0;
|
int cost = 0;
|
||||||
if (!CommandParser.GetInt(p, args[2], "Price", ref cost)) return;
|
if (!CommandParser.GetInt(p, args[2], "Price", ref cost)) return;
|
||||||
@ -134,8 +134,8 @@ namespace MCGalaxy.Eco {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnSetupCommandHelp(Player p) {
|
protected internal override void OnSetupHelp(Player p) {
|
||||||
base.OnSetupCommandHelp(p);
|
base.OnSetupHelp(p);
|
||||||
p.Message("%T/Eco {0} price [amount]", Name.ToLower());
|
p.Message("%T/Eco {0} price [amount]", Name.ToLower());
|
||||||
p.Message("%HSets how many &3{0} %Hthis item costs.", Server.Config.Currency);
|
p.Message("%HSets how many &3{0} %Hthis item costs.", Server.Config.Currency);
|
||||||
}
|
}
|
||||||
|
@ -72,16 +72,17 @@ namespace MCGalaxy.Eco {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string raw) {
|
||||||
if (args.Length < 2) { OnStoreCommand(p); return; }
|
string[] args = raw.SplitSpaces();
|
||||||
LevelPreset preset = FindPreset(args[1]);
|
if (raw.Length == 0) { OnStoreCommand(p); return; }
|
||||||
|
LevelPreset preset = FindPreset(args[0]);
|
||||||
|
|
||||||
if (preset == null) { p.Message("%WThat isn't a level preset"); return; }
|
if (preset == null) { p.Message("%WThat isn't a level preset"); return; }
|
||||||
if (!CheckPrice(p, preset.price, "that map")) return;
|
if (!CheckPrice(p, preset.price, "that map")) return;
|
||||||
|
|
||||||
string name = null;
|
string name = null;
|
||||||
if (args.Length >= 3) {
|
if (args.Length > 1) {
|
||||||
name = p.name + "_" + args[2];
|
name = p.name + "_" + args[1];
|
||||||
} else {
|
} else {
|
||||||
// use a numbered map by default
|
// use a numbered map by default
|
||||||
for (int i = 1; i < 100; i++) {
|
for (int i = 1; i < 100; i++) {
|
||||||
@ -110,7 +111,7 @@ namespace MCGalaxy.Eco {
|
|||||||
Economy.MakePurchase(p, preset.price, "%3Map: %f" + preset.name);
|
Economy.MakePurchase(p, preset.price, "%3Map: %f" + preset.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnSetupCommand(Player p, string[] args) {
|
protected internal override void OnSetup(Player p, string[] args) {
|
||||||
LevelPreset preset = FindPreset(args[2]);
|
LevelPreset preset = FindPreset(args[2]);
|
||||||
string cmd = args[1];
|
string cmd = args[1];
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ namespace MCGalaxy.Eco {
|
|||||||
} else if (Command.IsEditCommand(cmd)) {
|
} else if (Command.IsEditCommand(cmd)) {
|
||||||
EditPreset(p, args, preset);
|
EditPreset(p, args, preset);
|
||||||
} else {
|
} else {
|
||||||
OnSetupCommandHelp(p);
|
OnSetupHelp(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,8 +189,8 @@ namespace MCGalaxy.Eco {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnSetupCommandHelp(Player p) {
|
protected internal override void OnSetupHelp(Player p) {
|
||||||
base.OnSetupCommandHelp(p);
|
base.OnSetupHelp(p);
|
||||||
p.Message("%T/Eco level add [name] [x] [y] [z] [theme] [price]");
|
p.Message("%T/Eco level add [name] [x] [y] [z] [theme] [price]");
|
||||||
p.Message("%T/Eco level remove [name]");
|
p.Message("%T/Eco level remove [name]");
|
||||||
p.Message("%T/Eco level edit [name] [name/x/y/z/type/price] [value]");
|
p.Message("%T/Eco level edit [name] [name/x/y/z/type/price] [value]");
|
||||||
|
@ -28,15 +28,14 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "LoginMessage"; } }
|
public override string Name { get { return "LoginMessage"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string msg) {
|
||||||
if (args.Length == 1) {
|
if (msg.Length == 0) {
|
||||||
PlayerDB.SetLoginMessage(p.name, "");
|
PlayerDB.SetLoginMessage(p.name, "");
|
||||||
p.Message("&aYour login message was removed for free.");
|
p.Message("&aYour login message was removed for free.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
string msg = message.SplitSpaces(2)[1]; // keep spaces this way
|
|
||||||
if (msg == PlayerDB.GetLoginMessage(p)) {
|
if (msg == PlayerDB.GetLoginMessage(p)) {
|
||||||
p.Message("%WYou already have that login message."); return;
|
p.Message("%WYou already have that login message."); return;
|
||||||
}
|
}
|
||||||
@ -57,15 +56,14 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "LogoutMessage"; } }
|
public override string Name { get { return "LogoutMessage"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string msg) {
|
||||||
if (args.Length == 1) {
|
if (msg.Length == 0) {
|
||||||
PlayerDB.SetLogoutMessage(p.name, "");
|
PlayerDB.SetLogoutMessage(p.name, "");
|
||||||
p.Message("&aYour logout message was removed for free.");
|
p.Message("&aYour logout message was removed for free.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
string msg = message.SplitSpaces(2)[1]; // keep spaces this way
|
|
||||||
if (msg == PlayerDB.GetLogoutMessage(p)) {
|
if (msg == PlayerDB.GetLogoutMessage(p)) {
|
||||||
p.Message("%WYou already have that logout message."); return;
|
p.Message("%WYou already have that logout message."); return;
|
||||||
}
|
}
|
||||||
|
@ -27,14 +27,13 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "Title"; } }
|
public override string Name { get { return "Title"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string title) {
|
||||||
if (args.Length == 1) {
|
if (title.Length == 0) {
|
||||||
UseCommand(p, "Title", "-own");
|
UseCommand(p, "Title", "-own");
|
||||||
p.Message("&aYour title was removed for free."); return;
|
p.Message("&aYour title was removed for free."); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
string title = message.SplitSpaces(2)[1]; // keep spaces this way
|
|
||||||
if (title == p.title) {
|
if (title == p.title) {
|
||||||
p.Message("%WYou already have that title."); return;
|
p.Message("%WYou already have that title."); return;
|
||||||
}
|
}
|
||||||
@ -55,14 +54,13 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "Nickname"; } }
|
public override string Name { get { return "Nickname"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string nick) {
|
||||||
if (args.Length == 1) {
|
if (nick.Length == 0) {
|
||||||
UseCommand(p, "Nick", "-own");
|
UseCommand(p, "Nick", "-own");
|
||||||
p.Message("&aYour nickname was removed for free."); return;
|
p.Message("&aYour nickname was removed for free."); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
string nick = message.SplitSpaces(2)[1]; // keep spaces this way
|
|
||||||
if (nick == p.DisplayName) {
|
if (nick == p.DisplayName) {
|
||||||
p.Message("%WYou already have that nickname."); return;
|
p.Message("%WYou already have that nickname."); return;
|
||||||
}
|
}
|
||||||
@ -83,13 +81,14 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "TitleColor"; } }
|
public override string Name { get { return "TitleColor"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (args.Length < 2) { OnStoreCommand(p); return; }
|
if (args.Length == 0) { OnStoreCommand(p); return; }
|
||||||
string color = Matcher.FindColor(p, args[1]);
|
string color = Matcher.FindColor(p, args);
|
||||||
|
|
||||||
if (color == null) return;
|
if (color == null) return;
|
||||||
string colName = Colors.Name(color);
|
string colName = Colors.Name(color);
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
|
|
||||||
if (color == p.titlecolor) {
|
if (color == p.titlecolor) {
|
||||||
p.Message("%WYour title color is already " + color + colName); return;
|
p.Message("%WYour title color is already " + color + colName); return;
|
||||||
}
|
}
|
||||||
@ -107,13 +106,14 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "Color"; } }
|
public override string Name { get { return "Color"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (args.Length < 2) { OnStoreCommand(p); return; }
|
if (args.Length == 0) { OnStoreCommand(p); return; }
|
||||||
string color = Matcher.FindColor(p, args[1]);
|
string color = Matcher.FindColor(p, args);
|
||||||
|
|
||||||
if (color == null) return;
|
if (color == null) return;
|
||||||
string colName = Colors.Name(color);
|
string colName = Colors.Name(color);
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
|
|
||||||
if (color == p.color) {
|
if (color == p.color) {
|
||||||
p.Message("%WYour color is already " + color + colName); return;
|
p.Message("%WYour color is already " + color + colName); return;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "Snack"; } }
|
public override string Name { get { return "Snack"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (DateTime.UtcNow < p.NextEat) {
|
if (DateTime.UtcNow < p.NextEat) {
|
||||||
p.Message("You're still full - you need to wait at least " +
|
p.Message("You're still full - you need to wait at least " +
|
||||||
"10 seconds between snacks."); return;
|
"10 seconds between snacks."); return;
|
||||||
|
@ -79,8 +79,8 @@ namespace MCGalaxy.Eco {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (args.Length >= 2) {
|
if (args.Length > 0) {
|
||||||
p.Message("%WYou cannot provide a rank name, use %T/Buy rank %Wto buy the NEXT rank."); return;
|
p.Message("%WYou cannot provide a rank name, use %T/Buy rank %Wto buy the NEXT rank."); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ namespace MCGalaxy.Eco {
|
|||||||
Economy.MakePurchase(p, nextRank.Price, "&3Rank: " + rank.ColoredName);
|
Economy.MakePurchase(p, nextRank.Price, "&3Rank: " + rank.ColoredName);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnSetupCommand(Player p, string[] args) {
|
protected internal override void OnSetup(Player p, string[] args) {
|
||||||
if (args[1].CaselessEq("price")) {
|
if (args[1].CaselessEq("price")) {
|
||||||
Group grp = Matcher.FindRanks(p, args[2]);
|
Group grp = Matcher.FindRanks(p, args[2]);
|
||||||
if (grp == null) return;
|
if (grp == null) return;
|
||||||
@ -117,12 +117,12 @@ namespace MCGalaxy.Eco {
|
|||||||
p.Message("%WThat rank was not buyable to begin with.");
|
p.Message("%WThat rank was not buyable to begin with.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
OnSetupCommandHelp(p);
|
OnSetupHelp(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal override void OnSetupCommandHelp(Player p) {
|
protected internal override void OnSetupHelp(Player p) {
|
||||||
base.OnSetupCommandHelp(p);
|
base.OnSetupHelp(p);
|
||||||
p.Message("%T/Eco rank price [rank] [amount]");
|
p.Message("%T/Eco rank price [rank] [amount]");
|
||||||
p.Message("%HSets how many &3{0} %Hthat rank costs.", Server.Config.Currency);
|
p.Message("%HSets how many &3{0} %Hthat rank costs.", Server.Config.Currency);
|
||||||
p.Message("%T/Eco rank remove [rank]");
|
p.Message("%T/Eco rank remove [rank]");
|
||||||
|
@ -32,10 +32,10 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "10Blocks"; } }
|
public override string Name { get { return "10Blocks"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
int count = 1;
|
int count = 1;
|
||||||
const string group = "Number of groups of 10 blocks";
|
const string group = "Number of groups of 10 blocks";
|
||||||
if (args.Length >= 2 && !CommandParser.GetInt(p, args[1], group, ref count, 0, 10)) return;
|
if (args.Length > 0 && !CommandParser.GetInt(p, args, group, ref count, 0, 10)) return;
|
||||||
|
|
||||||
if (!CheckPrice(p, count * Price, (count * 10) + " blocks")) return;
|
if (!CheckPrice(p, count * Price, (count * 10) + " blocks")) return;
|
||||||
|
|
||||||
@ -60,13 +60,13 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "QueueLevel"; } }
|
public override string Name { get { return "QueueLevel"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (ZSGame.Instance.Picker.QueuedMap != null) {
|
if (ZSGame.Instance.Picker.QueuedMap != null) {
|
||||||
p.Message("Someone else has already queued a level."); return;
|
p.Message("Someone else has already queued a level."); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.Length < 2) { OnStoreCommand(p); return; }
|
if (args.Length == 0) { OnStoreCommand(p); return; }
|
||||||
string map = Matcher.FindMaps(p, args[1]);
|
string map = Matcher.FindMaps(p, args);
|
||||||
if (map == null) return;
|
if (map == null) return;
|
||||||
|
|
||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
@ -91,12 +91,12 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "InfectMessage"; } }
|
public override string Name { get { return "InfectMessage"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string msg) {
|
||||||
if (args.Length < 2) { OnStoreCommand(p); return; }
|
if (msg.Length == 0) { OnStoreCommand(p); return; }
|
||||||
string text = message.SplitSpaces(2)[1]; // keep spaces this way
|
|
||||||
bool hasAToken = false;
|
bool hasAToken = false;
|
||||||
for (int i = 0; i < text.Length; i++) {
|
|
||||||
if (!CheckEscape(text, i, ref hasAToken)) {
|
for (int i = 0; i < msg.Length; i++) {
|
||||||
|
if (!CheckEscape(msg, i, ref hasAToken)) {
|
||||||
p.Message("You can only use {0} and {1} for tokens in infect messages."); return;
|
p.Message("You can only use {0} and {1} for tokens in infect messages."); return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,11 +108,11 @@ namespace MCGalaxy.Eco {
|
|||||||
if (!CheckPrice(p)) return;
|
if (!CheckPrice(p)) return;
|
||||||
ZSData data = ZSGame.Get(p);
|
ZSData data = ZSGame.Get(p);
|
||||||
if (data.InfectMessages == null) data.InfectMessages = new List<string>();
|
if (data.InfectMessages == null) data.InfectMessages = new List<string>();
|
||||||
data.InfectMessages.Add(text);
|
data.InfectMessages.Add(msg);
|
||||||
|
|
||||||
ZSConfig.AppendPlayerInfectMessage(p.name, text);
|
ZSConfig.AppendPlayerInfectMessage(p.name, msg);
|
||||||
p.Message("&aAdded infect message: &f" + text);
|
p.Message("&aAdded infect message: &f" + msg);
|
||||||
Economy.MakePurchase(p, Price, "%3InfectMessage: " + message);
|
Economy.MakePurchase(p, Price, "%3InfectMessage: " + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CheckEscape(string text, int i, ref bool hasAToken) {
|
static bool CheckEscape(string text, int i, ref bool hasAToken) {
|
||||||
@ -134,7 +134,7 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "Invisibility"; } }
|
public override string Name { get { return "Invisibility"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (!CheckPrice(p, Price, "an invisibility potion")) return;
|
if (!CheckPrice(p, Price, "an invisibility potion")) return;
|
||||||
if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) {
|
if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) {
|
||||||
p.Message("You can only buy an invisiblity potion " +
|
p.Message("You can only buy an invisiblity potion " +
|
||||||
@ -184,7 +184,7 @@ namespace MCGalaxy.Eco {
|
|||||||
|
|
||||||
public override string Name { get { return "Revive"; } }
|
public override string Name { get { return "Revive"; } }
|
||||||
|
|
||||||
protected internal override void OnBuyCommand(Player p, string message, string[] args) {
|
protected internal override void OnPurchase(Player p, string args) {
|
||||||
if (!CheckPrice(p, Price, "a revive potion")) return;
|
if (!CheckPrice(p, Price, "a revive potion")) return;
|
||||||
if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) {
|
if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) {
|
||||||
p.Message("You can only buy a revive potion " +
|
p.Message("You can only buy a revive potion " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user