mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-29 16:43:30 -04:00
Modularise /zg.
This commit is contained in:
parent
42300d5617
commit
c598df0006
@ -46,7 +46,7 @@ namespace MCGalaxy.Commands {
|
|||||||
Player.SendMessage(p, "There is already a larger active bounty for " + who.name + "."); return;
|
Player.SendMessage(p, "There is already a larger active bounty for " + who.name + "."); return;
|
||||||
}
|
}
|
||||||
// TODO here - actually announce the bounty and place it
|
// TODO here - actually announce the bounty and place it
|
||||||
// "Looks like someone wants the brain of <name>! An bounty for x <money> was placed on them.
|
// "Looks like someone really wants the brains of <name>! An bounty for x <money> was placed on them.
|
||||||
// "<name> is popular! The bounty on them was increased from <old> to <new> money.
|
// "<name> is popular! The bounty on them was increased from <old> to <new> money.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,12 +27,20 @@ namespace MCGalaxy.Commands
|
|||||||
public override bool museumUsable { get { return false; } }
|
public override bool museumUsable { get { return false; } }
|
||||||
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
||||||
public CmdZombieGame() { }
|
public CmdZombieGame() { }
|
||||||
public override void Use(Player p, string message)
|
|
||||||
{
|
public override void Use(Player p, string message) {
|
||||||
if (String.IsNullOrEmpty(message)) { Help(p); return; }
|
if (message == "") { Help(p); return; }
|
||||||
string[] s = message.ToLower().Split(' ');
|
string[] args = message.ToLower().Split(' ');
|
||||||
if (s[0] == "status")
|
switch (args[0]) {
|
||||||
{
|
case "status": HandleStatus(p, message, args); break;
|
||||||
|
case "start": HandleStart(p, message, args); break;
|
||||||
|
case "stop": HandleStop(p, message, args); break;
|
||||||
|
case "force": HandleForceStop(p, message, args); break;
|
||||||
|
case "hitbox": HandleHitbox(p, message, args); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HandleStatus(Player p, string message, string[] args) {
|
||||||
switch (Server.zombie.Status) {
|
switch (Server.zombie.Status) {
|
||||||
case ZombieGameStatus.NotStarted:
|
case ZombieGameStatus.NotStarted:
|
||||||
Player.SendMessage(p, "Zombie Survival is not ccurrently running."); return;
|
Player.SendMessage(p, "Zombie Survival is not ccurrently running."); return;
|
||||||
@ -45,16 +53,15 @@ namespace MCGalaxy.Commands
|
|||||||
case ZombieGameStatus.LastRound:
|
case ZombieGameStatus.LastRound:
|
||||||
Player.SendMessage(p, "Zombie Survival game currently in progress, with this round being the final round."); return;
|
Player.SendMessage(p, "Zombie Survival game currently in progress, with this round being the final round."); return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (s[0] == "start")
|
|
||||||
{
|
static void HandleStart(Player p, string message, string[] args) {
|
||||||
if (Server.zombie.Status != ZombieGameStatus.NotStarted) {
|
if (Server.zombie.Status != ZombieGameStatus.NotStarted) {
|
||||||
Player.SendMessage(p, "There is already a Zombie Survival game currently in progress."); return;
|
Player.SendMessage(p, "There is already a Zombie Survival game currently in progress."); return;
|
||||||
}
|
}
|
||||||
if (s.Length == 2) {
|
if (args.Length == 2) {
|
||||||
int rounds = 1;
|
int rounds = 1;
|
||||||
if (!int.TryParse(s[1], out rounds)) {
|
if (!int.TryParse(args[1], out rounds)) {
|
||||||
Player.SendMessage(p, "You need to specify a valid option!"); return;
|
Player.SendMessage(p, "You need to specify a valid option!"); return;
|
||||||
}
|
}
|
||||||
ZombieGameStatus status = rounds == 0 ?
|
ZombieGameStatus status = rounds == 0 ?
|
||||||
@ -64,16 +71,16 @@ namespace MCGalaxy.Commands
|
|||||||
Server.zombie.Start(ZombieGameStatus.SingleRound, 0);
|
Server.zombie.Start(ZombieGameStatus.SingleRound, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (s[0] == "stop")
|
|
||||||
{
|
static void HandleStop(Player p, string message, string[] args) {
|
||||||
if (Server.zombie.Status == ZombieGameStatus.NotStarted) {
|
if (Server.zombie.Status == ZombieGameStatus.NotStarted) {
|
||||||
Player.SendMessage(p, "There is no Zombie Survival game currently in progress."); return;
|
Player.SendMessage(p, "There is no Zombie Survival game currently in progress."); return;
|
||||||
}
|
}
|
||||||
Player.GlobalMessage("The current game of Zombie Survival will end this round!");
|
Player.GlobalMessage("The current game of Zombie Survival will end this round!");
|
||||||
Server.zombie.Status = ZombieGameStatus.LastRound;
|
Server.zombie.Status = ZombieGameStatus.LastRound;
|
||||||
}
|
}
|
||||||
else if (s[0] == "force")
|
|
||||||
{
|
static void HandleForceStop(Player p, string message, string[] args) {
|
||||||
if (Server.zombie.Status == ZombieGameStatus.NotStarted) {
|
if (Server.zombie.Status == ZombieGameStatus.NotStarted) {
|
||||||
Player.SendMessage(p, "There is no Zombie Survival game currently in progress."); return;
|
Player.SendMessage(p, "There is no Zombie Survival game currently in progress."); return;
|
||||||
}
|
}
|
||||||
@ -81,10 +88,12 @@ namespace MCGalaxy.Commands
|
|||||||
Server.zombie.aliveCount = 0;
|
Server.zombie.aliveCount = 0;
|
||||||
Server.zombie.ResetState();
|
Server.zombie.ResetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void HandleHitbox(Player p, string message, string[] args) {
|
||||||
|
|
||||||
}
|
}
|
||||||
public override void Help(Player p)
|
|
||||||
{
|
public override void Help(Player p) {
|
||||||
Player.SendMessage(p, "/zombiegame - Shows this help menu.");
|
|
||||||
Player.SendMessage(p, "/zombiegame start - Starts a Zombie Survival game for one round.");
|
Player.SendMessage(p, "/zombiegame start - Starts a Zombie Survival game for one round.");
|
||||||
Player.SendMessage(p, "/zombiegame start 0 - Starts a Zombie Survival game for an unlimited amount of rounds.");
|
Player.SendMessage(p, "/zombiegame start 0 - Starts a Zombie Survival game for an unlimited amount of rounds.");
|
||||||
Player.SendMessage(p, "/zombiegame start [x] - Starts a Zombie Survival game for [x] amount of rounds.");
|
Player.SendMessage(p, "/zombiegame start [x] - Starts a Zombie Survival game for [x] amount of rounds.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user