From 30768c6b1d4008356582a7800c35b2cf278c334c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 27 Feb 2018 19:50:30 -0800 Subject: [PATCH] Spinach: Prevent lie-hunting for truth --- PBot/Plugins/Spinach.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/Plugins/Spinach.pm b/PBot/Plugins/Spinach.pm index d4601e23..37c297fb 100644 --- a/PBot/Plugins/Spinach.pm +++ b/PBot/Plugins/Spinach.pm @@ -680,15 +680,15 @@ sub spinach_cmd { } } + if (not $found_truth and ++$player->{lie_count} > 2) { + return "/msg $nick You cannot change your lie again this round."; + } + if ($found_truth) { $self->send_message($self->{channel}, "$color{yellow}$nick has found the truth!$color{reset}"); return "$nick: Your lie is too similar to the truth! Please submit a different lie."; } - if (++$player->{lie_count} > 2) { - return "/msg $nick You cannot change your lie again this round."; - } - my $changed = exists $player->{lie}; $player->{lie} = $arguments; @@ -1406,7 +1406,7 @@ sub choosecategory { push @choices, $cat; } - last if @choices == 8; + last if @choices == 6; } push @choices, 'RANDOM CATEGORY'; @@ -1447,7 +1447,7 @@ sub choosecategory { if (exists $state->{random_category}) { delete $state->{random_category}; - my $category = $state->{category_options}->[rand (@{$state->{category_options}} - 1)]; + my $category = $state->{category_options}->[rand (@{$state->{category_options}} - 2)]; $self->send_message($self->{channel}, "Category: $category!"); $state->{current_category} = $category; return 'next';