diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/War.java b/src/main/java/net/thauvin/erik/mobibot/modules/War.java index 89c98fb..12036a2 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/War.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/War.java @@ -52,8 +52,16 @@ public final class War extends AbstractModule { // War command private static final String WAR_CMD = "war"; - private static final String[] DECK = {"A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3", "2"}; - private static final String[] SUITS = {"โ™ฅ", "โ™ ", "โ™ฆ", "โ™ฃ"}; + private static final String[] HEARTS = + {"๐Ÿ‚ฑ", "๐Ÿ‚พ", "๐Ÿ‚ฝ", "๐Ÿ‚ป", "๐Ÿ‚บ", "๐Ÿ‚น", "๐Ÿ‚ธ", "๐Ÿ‚ท", "๐Ÿ‚ถ", "๐Ÿ‚ต", "๐Ÿ‚ด", "๐Ÿ‚ณ", "๐Ÿ‚ฒ"}; + private static final String[] SPADES = + {"๐Ÿ‚ก", "๐Ÿ‚ฎ", "๐Ÿ‚ญ", "๐Ÿ‚ซ", "๐Ÿ‚ช", "๐Ÿ‚ฉ", "๐Ÿ‚จ", "๐Ÿ‚ง", "๐Ÿ‚ฆ", "๐Ÿ‚ฅ", "๐Ÿ‚ค", "๐Ÿ‚ฃ", "๐Ÿ‚ข"}; + private static final String[] DIAMONDS = + {"๐Ÿƒ", "๐ŸƒŽ", "๐Ÿƒ", "๐Ÿƒ‹", "๐ŸƒŠ", "๐Ÿƒ‰", "๐Ÿƒˆ", "๐Ÿƒ‡", "๐Ÿƒ†", "๐Ÿƒ…", "๐Ÿƒ„", "๐Ÿƒƒ", "๐Ÿƒ‚"}; + private static final String[] CLUBS = + {"๐Ÿƒ‘", "๐Ÿƒž", "๐Ÿƒ", "๐Ÿƒ›", "๐Ÿƒš", "๐Ÿƒ™", "๐Ÿƒ˜", "๐Ÿƒ—", "๐Ÿƒ–", "๐Ÿƒ•", "๐Ÿƒ”", "๐Ÿƒ“", "๐Ÿƒ’"}; + + private static final String[][] DECK = {HEARTS, SPADES, DIAMONDS, CLUBS}; /** * The default constructor. @@ -83,22 +91,21 @@ public final class War extends AbstractModule { int y; do { - i = RANDOM.nextInt(DECK.length); - y = RANDOM.nextInt(DECK.length); - - event.respond("you drew " + bold(DECK[i]) + SUITS[RANDOM.nextInt(SUITS.length)]); + i = RANDOM.nextInt(HEARTS.length); + y = RANDOM.nextInt(HEARTS.length); final String result; if (i < y) { - result = bold("lost") + '.'; + result = bold("win"); } else if (i > y) { - result = bold("wins") + '.'; + result = bold("lose"); } else { - result = bold("tied") + ". This means " + bold("WAR!"); + result = bold("tie") + ". This means " + bold("WAR"); } - event.getBot().sendIRC().action(channel, "drew " + bold(DECK[y]) + SUITS[RANDOM.nextInt(SUITS.length)] + - " and " + result); + event.respond(DECK[RANDOM.nextInt(DECK.length)][i] + " " + DECK[RANDOM.nextInt(DECK.length)][y] + + " ยป You " + result + '!'); + } while (i == y); } } diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/modules/RockPaperScissors.kt b/src/main/kotlin/net/thauvin/erik/mobibot/modules/RockPaperScissors.kt index 1143b38..5a4cfda 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/modules/RockPaperScissors.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/modules/RockPaperScissors.kt @@ -33,7 +33,6 @@ package net.thauvin.erik.mobibot.modules import net.thauvin.erik.mobibot.Utils.bold -import net.thauvin.erik.mobibot.Utils.bot import net.thauvin.erik.mobibot.Utils.helpFormat import org.pircbotx.hooks.types.GenericMessageEvent @@ -99,17 +98,15 @@ class RockPaperScissors : AbstractModule() { override fun commandResponse(channel: String, cmd: String, args: String, event: GenericMessageEvent) { val hand = Hands.valueOf(cmd.uppercase()) val botHand = Hands.values()[(0..Hands.values().size).random()] - with(event.bot()) { - when { - hand == botHand -> { - sendIRC().action(channel, "tied: ${hand.name} vs. ${botHand.name}") - } - hand.beats(botHand) -> { - sendIRC().action(channel, "lost: ${hand.name.bold()} ${hand.action} ${botHand.name}") - } - else -> { - sendIRC().action(channel, "wins: ${botHand.name.bold()} ${botHand.action} ${hand.name}") - } + when { + hand == botHand -> { + event.respond("${hand.name} vs. ${botHand.name} ยป You ${"tie".bold()}.") + } + hand.beats(botHand) -> { + event.respond("${hand.name.bold()} ${hand.action} ${botHand.name} ยป You ${"win".bold()}!") + } + else -> { + event.respond("${botHand.name.bold()} ${botHand.action} ${hand.name} ยป You ${"lose".bold()}!") } } } diff --git a/version.properties b/version.properties index ce7184b..9a8da70 100644 --- a/version.properties +++ b/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Sun Mar 27 22:37:50 PDT 2022 -version.buildmeta=142 +#Mon Mar 28 20:39:02 PDT 2022 +version.buildmeta=214 version.major=0 version.minor=8 version.patch=0 version.prerelease=rc version.project=mobibot -version.semver=0.8.0-rc+142 +version.semver=0.8.0-rc+214