Fixed colors.

Added last player.
This commit is contained in:
Erik C. Thauvin 2016-06-27 12:11:54 -07:00
parent e5064f0e0e
commit 9b8ba57e68
7 changed files with 35 additions and 23 deletions

View file

@ -13,8 +13,8 @@ import java.util.Date;
* Annotation Processor</a>
*/
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;

View file

@ -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)
{

View file

@ -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();
}

View file

@ -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));
}
}
}
@ -1813,15 +1818,23 @@ public class Mobibot extends PircBot
}
// mobibot: dice
else if (cmd.equals(Commands.DICE_CMD))
{
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))
{
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);

View file

@ -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));
}
/**

View file

@ -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)
{

View file

@ -5,4 +5,4 @@ version.major=0
version.minor=6
version.patch=1
version.prerelease=beta
version.buildmeta=006
version.buildmeta=007