mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-04 01:49:35 +01:00
Spinach improvements
This commit is contained in:
parent
8ee90e0a61
commit
74c5a311a0
@ -1336,24 +1336,13 @@ sub validate_lie {
|
|||||||
my $lie_word_count = keys %lie_words;
|
my $lie_word_count = keys %lie_words;
|
||||||
|
|
||||||
my $count = 0;
|
my $count = 0;
|
||||||
foreach my $word (keys %truth_words) {
|
|
||||||
if (exists $lie_words{$word}) {
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($count == $truth_word_count) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
foreach my $word (keys %lie_words) {
|
foreach my $word (keys %lie_words) {
|
||||||
if (exists $truth_words{$word}) {
|
if (exists $truth_words{$word}) {
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count >= 2 and $count == $lie_word_count) {
|
if ($count) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1960,7 +1949,7 @@ sub getplayers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not $unready) {
|
if (@$players > 1 and not $unready) {
|
||||||
$self->send_message($self->{channel}, "All players ready!");
|
$self->send_message($self->{channel}, "All players ready!");
|
||||||
$state->{result} = 'allready';
|
$state->{result} = 'allready';
|
||||||
return $state;
|
return $state;
|
||||||
@ -1976,6 +1965,10 @@ sub getplayers {
|
|||||||
if ($state->{ticks} % $tock == 0) {
|
if ($state->{ticks} % $tock == 0) {
|
||||||
$state->{tocked} = 1;
|
$state->{tocked} = 1;
|
||||||
|
|
||||||
|
if (not $unready) {
|
||||||
|
$self->send_message($self->{channel}, "Game cannot begin with only one player.");
|
||||||
|
}
|
||||||
|
|
||||||
if (++$state->{counter} > 6) {
|
if (++$state->{counter} > 6) {
|
||||||
$self->send_message($self->{channel}, "Not all players were ready in time. The game has been stopped.");
|
$self->send_message($self->{channel}, "Not all players were ready in time. The game has been stopped.");
|
||||||
$state->{result} = 'stop';
|
$state->{result} = 'stop';
|
||||||
@ -2745,7 +2738,7 @@ sub r3q3showscore {
|
|||||||
sub round4 {
|
sub round4 {
|
||||||
my ($self, $state) = @_;
|
my ($self, $state) = @_;
|
||||||
$state->{truth_points} = 2000;
|
$state->{truth_points} = 2000;
|
||||||
$state->{lie_points} = 4000;
|
$state->{lie_points} = 3000;
|
||||||
$state->{my_lie_points} = $state->{lie_points} * 0.25;
|
$state->{my_lie_points} = $state->{lie_points} * 0.25;
|
||||||
$state->{result} = 'next';
|
$state->{result} = 'next';
|
||||||
return $state;
|
return $state;
|
||||||
|
Loading…
Reference in New Issue
Block a user