diff --git a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java index a97f667..ac16dd0 100644 --- a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java +++ b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java @@ -13,8 +13,8 @@ import java.util.Date; * Annotation Processor */ public final class ReleaseInfo { - private final static String buildmeta = "006"; - private final static Date date = new Date(1467010048201L); + private final static String buildmeta = "007"; + private final static Date date = new Date(1467054540566L); private final static int major = 0; private final static int minor = 6; private final static int patch = 1; diff --git a/src/main/java/net/thauvin/erik/mobibot/Dice.java b/src/main/java/net/thauvin/erik/mobibot/Dice.java index 127e9c1..eeb9f8b 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Dice.java +++ b/src/main/java/net/thauvin/erik/mobibot/Dice.java @@ -68,7 +68,7 @@ final class Dice final int playerTotal = i + y; bot.send(bot.getChannel(), - sender + " rolled two dice: " + Utils.reverseColor(i) + " and " + Utils.reverseColor(y) + " for a total of " + Utils + sender + " rolled two dice: " + Utils.bold(i) + " and " + Utils.bold(y) + " for a total of " + Utils .bold(playerTotal)); i = r.nextInt(6) + 1; @@ -76,7 +76,7 @@ final class Dice final int total = i + y; bot.action( - "rolled two dice: " + Utils.reverseColor(i) + " and " + Utils.reverseColor(y) + " for a total of " + Utils.bold(total)); + "rolled two dice: " + Utils.bold(i) + " and " + Utils.bold(y) + " for a total of " + Utils.bold(total)); if (playerTotal < total) { @@ -91,4 +91,4 @@ final class Dice bot.action("tied."); } } -} \ No newline at end of file +} diff --git a/src/main/java/net/thauvin/erik/mobibot/Joke.java b/src/main/java/net/thauvin/erik/mobibot/Joke.java index facffa7..3649b8d 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Joke.java +++ b/src/main/java/net/thauvin/erik/mobibot/Joke.java @@ -99,7 +99,7 @@ class Joke implements Runnable bot.send(bot.getChannel(), Colors.CYAN + json.getJSONObject("value").get("joke").toString().replaceAll("\\'", "'") - .replaceAll("\\\"", "\"") + Colors.CYAN); + .replaceAll("\\\"", "\"") + Colors.NORMAL); reader.close(); } @@ -109,4 +109,4 @@ class Joke implements Runnable bot.send(sender, "An error has occurred: " + e.getMessage()); } } -} \ No newline at end of file +} diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java index fc256e4..39946f7 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java @@ -267,6 +267,11 @@ public class Mobibot extends PircBot */ private String identMsg = ""; + /** + * The last player. + */ + private String lastPlayer = ""; + /** * The ident nick. */ @@ -1359,8 +1364,8 @@ public class Mobibot extends PircBot { send(sender, "The op commands are:"); send(sender, - helpIndent(Commands.CYCLE_CMD + " " + Commands.ME_CMD + " " + Commands.MSG_CMD + " " - + Commands.SAY_CMD + " " + Commands.VERSION_CMD)); + helpIndent(Commands.CYCLE_CMD + " " + Commands.INFO_CMD + " " + Commands.ME_CMD + " " + + Commands.MSG_CMD + " " + Commands.SAY_CMD + " " + Commands.VERSION_CMD)); } } } @@ -1814,14 +1819,22 @@ public class Mobibot extends PircBot // mobibot: dice else if (cmd.equals(Commands.DICE_CMD)) { - send(channel, SHALL_WE_PLAY_A_GAME); + if (!lastPlayer.equalsIgnoreCase(sender)) + { + send(channel, SHALL_WE_PLAY_A_GAME); + lastPlayer = sender; + } Dice.roll(this, sender); } // mobibot: war else if (cmd.equals(Commands.WAR_CMD)) { - send(channel, SHALL_WE_PLAY_A_GAME); + if (!lastPlayer.equalsIgnoreCase(sender)) + { + send(channel, SHALL_WE_PLAY_A_GAME); + lastPlayer = sender; + } War.play(this, sender); } @@ -2384,8 +2397,8 @@ public class Mobibot extends PircBot if (!isMessage) { send(nickname, - Utils.bold("You") + " wanted me to remind you: " + Colors.REVERSE + message - .getMessage() + Colors.NORMAL, true); + Utils.bold("You") + " wanted me to remind you: " + Utils.reverseColor(message + .getMessage()), true); message.setIsReceived(); message.setIsNotified(); @@ -2396,8 +2409,7 @@ public class Mobibot extends PircBot else { send(nickname, - message.getSender() + " wanted me to tell you: " + Colors.REVERSE + message.getMessage() - + Colors.NORMAL, + message.getSender() + " wanted me to tell you: " + Utils.reverseColor(message.getMessage()), true); message.setIsReceived(); @@ -2409,7 +2421,7 @@ public class Mobibot extends PircBot .isNotified()) { send(nickname, - "Your message " + Colors.REVERSE + "[ID " + message.getId() + ']' + Colors.NORMAL + "Your message " + Utils.reverseColor("[ID " + message.getId() + ']') + " was sent to " + Utils.bold(message.getRecipient()) + " on " + Utils.UTC_SDF .format(message.getReceived()), true); diff --git a/src/main/java/net/thauvin/erik/mobibot/Utils.java b/src/main/java/net/thauvin/erik/mobibot/Utils.java index 176c1ac..cc6294a 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Utils.java +++ b/src/main/java/net/thauvin/erik/mobibot/Utils.java @@ -85,7 +85,7 @@ final class Utils */ public static String bold(final int i) { - return Colors.BOLD + i + Colors.BOLD; + return bold(Integer.toString(i)); } /** @@ -163,7 +163,7 @@ final class Utils */ public static String bold(final String s) { - return Colors.BOLD + s + Colors.NORMAL; + return Colors.BOLD + s + Colors.BOLD; } /** @@ -387,7 +387,7 @@ final class Utils */ public static String reverseColor(final int i) { - return Colors.REVERSE + i + Colors.REVERSE; + return reverseColor(Integer.toString(i)); } /** diff --git a/src/main/java/net/thauvin/erik/mobibot/War.java b/src/main/java/net/thauvin/erik/mobibot/War.java index f4c5b0e..4798a3b 100644 --- a/src/main/java/net/thauvin/erik/mobibot/War.java +++ b/src/main/java/net/thauvin/erik/mobibot/War.java @@ -83,8 +83,8 @@ final class War y = r.nextInt(WAR_DECK.length); bot.send(bot.getChannel(), - sender + " drew the " + Utils.reverseColor(WAR_DECK[i]) + " of " + WAR_SUITS[r.nextInt(WAR_SUITS.length)]); - bot.action("drew the " + Utils.reverseColor(WAR_DECK[y]) + " of " + WAR_SUITS[r.nextInt(WAR_SUITS.length)]); + sender + " drew the " + Utils.bold(WAR_DECK[i]) + " of " + WAR_SUITS[r.nextInt(WAR_SUITS.length)]); + bot.action("drew the " + Utils.bold(WAR_DECK[y]) + " of " + WAR_SUITS[r.nextInt(WAR_SUITS.length)]); if (i != y) { @@ -107,4 +107,4 @@ final class War bot.action("tied."); } } -} \ No newline at end of file +} diff --git a/version.properties b/version.properties index 4d62098..7ccf793 100644 --- a/version.properties +++ b/version.properties @@ -5,4 +5,4 @@ version.major=0 version.minor=6 version.patch=1 version.prerelease=beta -version.buildmeta=006 +version.buildmeta=007