mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Move from /game set add/remove to just /game add/remove
This commit is contained in:
parent
0458010040
commit
451f131888
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "can manage CTF") }; }
|
get { return new[] { new CommandPerm(LevelPermission.Operator, "can manage CTF") }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandleSetCore(Player p, RoundsGame game, string[] args) {
|
protected override void HandleSet(Player p, RoundsGame game, string[] args) {
|
||||||
string prop = args[1];
|
string prop = args[1];
|
||||||
CTFMapConfig cfg = RetrieveConfig(p);
|
CTFMapConfig cfg = RetrieveConfig(p);
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Player.Message(p, "%T/CTF start <map> %H- Starts CTF game");
|
Player.Message(p, "%T/CTF start <map> %H- Starts CTF game");
|
||||||
Player.Message(p, "%T/CTF stop %H- Stops CTF game");
|
Player.Message(p, "%T/CTF stop %H- Stops CTF game");
|
||||||
Player.Message(p, "%T/CTF end %H- Ends current round of CTF");
|
Player.Message(p, "%T/CTF end %H- Ends current round of CTF");
|
||||||
Player.Message(p, "%T/CTF set add/remove %H- Adds/removes current map from map list");
|
Player.Message(p, "%T/CTF add/remove %H- Adds/removes current map from map list");
|
||||||
Player.Message(p, "%T/CTF set [property] %H- Sets a property. See %T/Help CTF set");
|
Player.Message(p, "%T/CTF set [property] %H- Sets a property. See %T/Help CTF set");
|
||||||
Player.Message(p, "%T/CTF status %H- View stats of both teams");
|
Player.Message(p, "%T/CTF status %H- View stats of both teams");
|
||||||
Player.Message(p, "%T/CTF go %H- Moves you to the current CTF map");
|
Player.Message(p, "%T/CTF go %H- Moves you to the current CTF map");
|
||||||
|
@ -32,22 +32,13 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
if (message.CaselessEq("rules")) {
|
if (message.CaselessEq("join")) {
|
||||||
HandleRules(p);
|
|
||||||
} else if (message.CaselessEq("join")) {
|
|
||||||
HandleJoin(p, CountdownGame.Instance);
|
HandleJoin(p, CountdownGame.Instance);
|
||||||
} else {
|
} else {
|
||||||
base.Use(p, message);
|
base.Use(p, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleRules(Player p) {
|
|
||||||
Player.Message(p, "The aim of the game is to stay alive the longest.");
|
|
||||||
Player.Message(p, "Don't fall in the lava!");
|
|
||||||
Player.Message(p, "Blocks on the ground will disapear randomly, first going yellow, then orange, then red and finally disappearing.");
|
|
||||||
Player.Message(p, "The last person alive wins!");
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleJoin(Player p, CountdownGame game) {
|
void HandleJoin(Player p, CountdownGame game) {
|
||||||
if (!game.Running) {
|
if (!game.Running) {
|
||||||
Player.Message(p, "Cannot join as countdown is not running.");
|
Player.Message(p, "Cannot join as countdown is not running.");
|
||||||
@ -78,7 +69,6 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
CountdownGame game = (CountdownGame)game_;
|
CountdownGame game = (CountdownGame)game_;
|
||||||
game.GenerateMap(p, x, y, z);
|
game.GenerateMap(p, x, y, z);
|
||||||
}
|
}
|
||||||
protected override void HandleSetCore(Player p, RoundsGame game, string[] args) { }
|
|
||||||
|
|
||||||
protected override void HandleStart(Player p, RoundsGame game_, string[] args) {
|
protected override void HandleStart(Player p, RoundsGame game_, string[] args) {
|
||||||
if (game_.Running) { Player.Message(p, "{0} is already running", game_.GameName); return; }
|
if (game_.Running) { Player.Message(p, "{0} is already running", game_.GameName); return; }
|
||||||
@ -114,7 +104,6 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Player.Message(p, "%T/CD end %H- Ends current round of Countdown");
|
Player.Message(p, "%T/CD end %H- Ends current round of Countdown");
|
||||||
Player.Message(p, "%T/CD join %H- joins the game");
|
Player.Message(p, "%T/CD join %H- joins the game");
|
||||||
Player.Message(p, "%T/CD status %H- lists players currently playing");
|
Player.Message(p, "%T/CD status %H- lists players currently playing");
|
||||||
Player.Message(p, "%T/CD rules %H- view the rules of countdown");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "can manage lava survival") }; }
|
get { return new[] { new CommandPerm(LevelPermission.Operator, "can manage lava survival") }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandleSetCore(Player p, RoundsGame game, string[] args) {
|
protected override void HandleSet(Player p, RoundsGame game, string[] args) {
|
||||||
string prop = args[1];
|
string prop = args[1];
|
||||||
if (prop.CaselessEq("spawn")) {
|
if (prop.CaselessEq("spawn")) {
|
||||||
HandleSetSpawn(p, args);
|
HandleSetSpawn(p, args);
|
||||||
@ -239,7 +239,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Player.Message(p, "%T/LS start <map> %H- Starts Lava Survival");
|
Player.Message(p, "%T/LS start <map> %H- Starts Lava Survival");
|
||||||
Player.Message(p, "%T/LS stop %H- Stops Lava Survival");
|
Player.Message(p, "%T/LS stop %H- Stops Lava Survival");
|
||||||
Player.Message(p, "%T/LS end %H- Ends current round of Lava Survival");
|
Player.Message(p, "%T/LS end %H- Ends current round of Lava Survival");
|
||||||
Player.Message(p, "%T/LS set add/remove %H- Adds/removes current map from map list");
|
Player.Message(p, "%T/LS add/remove %H- Adds/removes current map from map list");
|
||||||
Player.Message(p, "%T/LS set [property] %H- Sets a property. See %T/Help LS set");
|
Player.Message(p, "%T/LS set [property] %H- Sets a property. See %T/Help LS set");
|
||||||
Player.Message(p, "%T/LS status %H- View current round info and time");
|
Player.Message(p, "%T/LS status %H- View current round info and time");
|
||||||
Player.Message(p, "%T/LS go %H- Moves you to the current Lava Survival map");
|
Player.Message(p, "%T/LS go %H- Moves you to the current Lava Survival map");
|
||||||
|
@ -32,23 +32,12 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
if (message.CaselessEq("rules")) {
|
if (message.CaselessEq("scores")) {
|
||||||
HandleRules(p);
|
|
||||||
} else if (message.CaselessEq("scores")) {
|
|
||||||
HandleScores(p);
|
HandleScores(p);
|
||||||
} else {
|
} else {
|
||||||
base.Use(p, message);
|
base.Use(p, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleRules(Player p) {
|
|
||||||
Player.Message(p, "TNT Wars Rules:");
|
|
||||||
Player.Message(p, "The aim of the game is to blow up people using TNT!");
|
|
||||||
Player.Message(p, "To place tnt simply place a TNT block and after a short delay it shall explode!");
|
|
||||||
Player.Message(p, "During the game the amount of TNT placable at one time may be limited!");
|
|
||||||
Player.Message(p, "You are not allowed to use hacks of any sort during the game!");
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleScores(Player p) {
|
void HandleScores(Player p) {
|
||||||
TWGame game = (TWGame)Game;
|
TWGame game = (TWGame)Game;
|
||||||
@ -65,7 +54,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandleSetCore(Player p, RoundsGame game_, string[] args) {
|
protected override void HandleSet(Player p, RoundsGame game_, string[] args) {
|
||||||
TWGame game = (TWGame)game_;
|
TWGame game = (TWGame)game_;
|
||||||
TWMapConfig cfg = RetrieveConfig(p);
|
TWMapConfig cfg = RetrieveConfig(p);
|
||||||
TWConfig gameCfg = TWGame.Config;
|
TWConfig gameCfg = TWGame.Config;
|
||||||
@ -353,11 +342,10 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Player.Message(p, "%T/TW start <map> %H- Starts TNT wars");
|
Player.Message(p, "%T/TW start <map> %H- Starts TNT wars");
|
||||||
Player.Message(p, "%T/TW stop %H- Stops TNT wars");
|
Player.Message(p, "%T/TW stop %H- Stops TNT wars");
|
||||||
Player.Message(p, "%T/TW end %H- Ends current round of TNT wars");
|
Player.Message(p, "%T/TW end %H- Ends current round of TNT wars");
|
||||||
Player.Message(p, "%T/TW set add/remove %H- Adds/removes current map from map list");
|
Player.Message(p, "%T/TW add/remove %H- Adds/removes current map from map list");
|
||||||
Player.Message(p, "%T/TW set [property] %H- Sets a property. See %T/Help TW set");
|
Player.Message(p, "%T/TW set [property] %H- Sets a property. See %T/Help TW set");
|
||||||
Player.Message(p, "%T/TW status %H- View your current score and health");
|
Player.Message(p, "%T/TW status %H- View your current score and health");
|
||||||
Player.Message(p, "%T/TW go %H- Moves you to the current TNT wars map");
|
Player.Message(p, "%T/TW go %H- Moves you to the current TNT wars map");
|
||||||
Player.Message(p, "%T/TW rules %H- view the rules of TNT wars");
|
|
||||||
Player.Message(p, "%T/TW scores %H- lists players with highest scores");
|
Player.Message(p, "%T/TW scores %H- lists players with highest scores");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,20 +28,23 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
RoundsGame game = Game;
|
RoundsGame game = Game;
|
||||||
if (message.CaselessEq("go")) {
|
if (message.CaselessEq("go")) {
|
||||||
HandleGo(p, game);
|
HandleGo(p, game); return;
|
||||||
} else if (IsInfoCommand(message)) {
|
} else if (IsInfoCommand(message)) {
|
||||||
HandleStatus(p, game);
|
HandleStatus(p, game); return;
|
||||||
} else if (message.CaselessEq("start") || message.CaselessStarts("start ")) {
|
}
|
||||||
if (!CheckExtraPerm(p, 1)) return;
|
if (!CheckExtraPerm(p, 1)) return;
|
||||||
|
|
||||||
|
if (message.CaselessEq("start") || message.CaselessStarts("start ")) {
|
||||||
HandleStart(p, game, message.SplitSpaces());
|
HandleStart(p, game, message.SplitSpaces());
|
||||||
} else if (message.CaselessEq("end")) {
|
} else if (message.CaselessEq("end")) {
|
||||||
if (!CheckExtraPerm(p, 1)) return;
|
|
||||||
HandleEnd(p, game);
|
HandleEnd(p, game);
|
||||||
} else if (message.CaselessEq("stop")) {
|
} else if (message.CaselessEq("stop")) {
|
||||||
if (!CheckExtraPerm(p, 1)) return;
|
|
||||||
HandleStop(p, game);
|
HandleStop(p, game);
|
||||||
|
} else if (message.CaselessEq("add")) {
|
||||||
|
RoundsGameConfig.AddMap(p, p.level.name, p.level.Config, game);
|
||||||
|
} else if (IsDeleteCommand(message)) {
|
||||||
|
RoundsGameConfig.RemoveMap(p, p.level.name, p.level.Config, game);
|
||||||
} else if (message.CaselessStarts("set ") || message.CaselessStarts("setup ")) {
|
} else if (message.CaselessStarts("set ") || message.CaselessStarts("setup ")) {
|
||||||
if (!CheckExtraPerm(p, 1)) return;
|
|
||||||
HandleSet(p, game, message.SplitSpaces());
|
HandleSet(p, game, message.SplitSpaces());
|
||||||
} else {
|
} else {
|
||||||
Help(p);
|
Help(p);
|
||||||
@ -89,19 +92,6 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void HandleSet(Player p, RoundsGame game, string[] args) {
|
protected abstract void HandleSet(Player p, RoundsGame game, string[] args);
|
||||||
if (args.Length < 2) { Help(p, "set"); return; }
|
|
||||||
string prop = args[1];
|
|
||||||
|
|
||||||
if (prop.CaselessEq("add")) {
|
|
||||||
RoundsGameConfig.AddMap(p, p.level.name, p.level.Config, game);
|
|
||||||
} else if (IsDeleteCommand(prop)) {
|
|
||||||
RoundsGameConfig.RemoveMap(p, p.level.name, p.level.Config, game);
|
|
||||||
} else {
|
|
||||||
HandleSetCore(p, game, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void HandleSetCore(Player p, RoundsGame game, string[] args);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
get { return new[] { new CommandPerm(LevelPermission.Operator, "can manage zombie survival") }; }
|
get { return new[] { new CommandPerm(LevelPermission.Operator, "can manage zombie survival") }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void HandleSetCore(Player p, RoundsGame game, string[] args) {
|
protected override void HandleSet(Player p, RoundsGame game, string[] args) {
|
||||||
ZSConfig cfg = ZSGame.Config;
|
ZSConfig cfg = ZSGame.Config;
|
||||||
string prop = args[1];
|
string prop = args[1];
|
||||||
LevelConfig lCfg = p.level.Config;
|
LevelConfig lCfg = p.level.Config;
|
||||||
@ -112,6 +112,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Player.Message(p, "%T/ZS start <map> %H- Starts Zombie Survival");
|
Player.Message(p, "%T/ZS start <map> %H- Starts Zombie Survival");
|
||||||
Player.Message(p, "%T/ZS stop %H- Stops Zombie Survival");
|
Player.Message(p, "%T/ZS stop %H- Stops Zombie Survival");
|
||||||
Player.Message(p, "%T/ZS end %H- Ends current round of Zombie Survival");
|
Player.Message(p, "%T/ZS end %H- Ends current round of Zombie Survival");
|
||||||
|
Player.Message(p, "%T/ZS add/remove %H- Adds/removes current map from map list");
|
||||||
Player.Message(p, "%T/ZS set [property] %H- Sets a property. See %T/Help ZS set");
|
Player.Message(p, "%T/ZS set [property] %H- Sets a property. See %T/Help ZS set");
|
||||||
Player.Message(p, "%T/ZS status %H- Outputs current status of Zombie Survival");
|
Player.Message(p, "%T/ZS status %H- Outputs current status of Zombie Survival");
|
||||||
Player.Message(p, "%T/ZS go %H- Moves you to the current Zombie Survival map");
|
Player.Message(p, "%T/ZS go %H- Moves you to the current Zombie Survival map");
|
||||||
|
@ -44,7 +44,7 @@ namespace MCGalaxy.Games {
|
|||||||
public VolatileArray<Player> Remaining = new VolatileArray<Player>();
|
public VolatileArray<Player> Remaining = new VolatileArray<Player>();
|
||||||
|
|
||||||
public static CountdownConfig Config = new CountdownConfig();
|
public static CountdownConfig Config = new CountdownConfig();
|
||||||
public override string GameName { get { return "Countfown"; } }
|
public override string GameName { get { return "Countdown"; } }
|
||||||
public override RoundsGameConfig GetConfig() { return Config; }
|
public override RoundsGameConfig GetConfig() { return Config; }
|
||||||
|
|
||||||
public bool FreezeMode;
|
public bool FreezeMode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user