make gem feature more battle.net like and adapted it to xleave's code style
This commit is contained in:
parent
ef9f37e12f
commit
5278dc13e6
|
@ -16,6 +16,7 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
private int gamerRating = 3;
|
private int gamerRating = 3;
|
||||||
private Thread discoThread;
|
private Thread discoThread;
|
||||||
private boolean shouldStopDisco;
|
private boolean shouldStopDisco;
|
||||||
|
private boolean gemActivated = false;
|
||||||
|
|
||||||
public TheGame(IGuiControl guiControl) {
|
public TheGame(IGuiControl guiControl) {
|
||||||
this.guiControl = guiControl;
|
this.guiControl = guiControl;
|
||||||
|
@ -274,18 +275,8 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
disco();
|
disco();
|
||||||
} else if(message.startsWith("disco stop")) {
|
} else if(message.startsWith("disco stop")) {
|
||||||
discoStop();
|
discoStop();
|
||||||
} else if(message.startsWith("gem activate")) {
|
} else if(message.startsWith("gem")) {
|
||||||
java.util.Random random = new java.util.Random();
|
handleGem();
|
||||||
int scry = random.nextInt(100);
|
|
||||||
if (scry >= 98) {
|
|
||||||
ircClient.say("Perfect Gem Activated");
|
|
||||||
} else if (scry >= 90) {
|
|
||||||
ircClient.say("Moooooooo!");
|
|
||||||
} else {
|
|
||||||
ircClient.say("Gem Activated");
|
|
||||||
}
|
|
||||||
} else if(message.startsWith("gem deactivate")) {
|
|
||||||
ircClient.say("Gem Deactivated");
|
|
||||||
} else {
|
} else {
|
||||||
ircClient.say("y u no use valid command?");
|
ircClient.say("y u no use valid command?");
|
||||||
}
|
}
|
||||||
|
@ -319,6 +310,8 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
machine.pauseTimer(true);
|
machine.pauseTimer(true);
|
||||||
} else if(params.startsWith("resume")) {
|
} else if(params.startsWith("resume")) {
|
||||||
machine.pauseTimer(false);
|
machine.pauseTimer(false);
|
||||||
|
} else if(params.startsWith("gem")) {
|
||||||
|
ircClient.say("You don't say?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,6 +335,24 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Yes, it makes no sense, but I want have it anyway. For more Spass am Geraet!
|
||||||
|
private void handleGem() {
|
||||||
|
if (!gemActivated) {
|
||||||
|
java.util.Random random = new java.util.Random();
|
||||||
|
int scry = random.nextInt(100);
|
||||||
|
if (scry >= 99) {
|
||||||
|
ircClient.say("Perfect Gem Activated");
|
||||||
|
} else if (scry >= 90) {
|
||||||
|
ircClient.say("Moooooooo!");
|
||||||
|
} else {
|
||||||
|
ircClient.say("Gem Activated");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ircClient.say("Gem Deactivated");
|
||||||
|
}
|
||||||
|
gemActivated = !gemActivated;
|
||||||
|
}
|
||||||
|
|
||||||
private void handleRelaisCommand(final String message) {
|
private void handleRelaisCommand(final String message) {
|
||||||
|
|
||||||
String params = message.substring("relais".length()).trim().toLowerCase();
|
String params = message.substring("relais".length()).trim().toLowerCase();
|
||||||
|
|
Loading…
Reference in New Issue