DrawMyThing: Prevented all multiple guesses, not just when it contains an accurate word
This commit is contained in:
parent
a75aab7f98
commit
d2e37df4ca
@ -302,42 +302,42 @@ public class Draw extends SoloGame
|
||||
|
||||
String message = event.getMessage().toLowerCase();
|
||||
|
||||
if (message.contains(_round.Word.toLowerCase()))
|
||||
if (_guessers.HasPlayer(player))
|
||||
{
|
||||
int wordsInMessage = 0;
|
||||
|
||||
for (String word : _words)
|
||||
{
|
||||
if (message.contains(word.toLowerCase()))
|
||||
if (!word.equals(_round.Word) && message.contains(word.toLowerCase()))
|
||||
{
|
||||
message = message.replace(word.toLowerCase(), "");
|
||||
|
||||
if (++wordsInMessage >= 3)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "Multiple guesses are not allowed!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_guessers.HasPlayer(player))
|
||||
if (message.contains(_round.Word.toLowerCase()))
|
||||
{
|
||||
//First Guess
|
||||
// First Guess
|
||||
int score = 1;
|
||||
if (_round.Guessed.isEmpty())
|
||||
{
|
||||
score = 3;
|
||||
|
||||
//Points for Drawer
|
||||
|
||||
// Points for Drawer
|
||||
AddScore(_round.Drawer, 2);
|
||||
|
||||
|
||||
this.AddGems(_round.Drawer, 2, "Drawings Guessed", true, true);
|
||||
}
|
||||
|
||||
|
||||
if (_round.Guessed(player))
|
||||
{
|
||||
AddScore(player, score);
|
||||
Announce(C.cYellow + C.Bold + "+" + score + " " + C.cGreen + C.Bold + player.getName() + " has guessed the word!");
|
||||
|
||||
Announce(C.cYellow + C.Bold + "+" + score + " " + C.cGreen + C.Bold + player.getName()
|
||||
+ " has guessed the word!");
|
||||
|
||||
if (score == 1)
|
||||
this.AddGems(player, 1, "Words Guessed", true, true);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user