From 80bcf56bfe7509be5dd214288f89b63195a067f6 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 8 Jul 2018 17:10:50 -0700 Subject: [PATCH] Battleship: improve "you will now attack" message --- PBot/Plugins/Battleship.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PBot/Plugins/Battleship.pm b/PBot/Plugins/Battleship.pm index 11dd428f..119b2813 100644 --- a/PBot/Plugins/Battleship.pm +++ b/PBot/Plugins/Battleship.pm @@ -310,8 +310,14 @@ sub battleship_cmd { if ($self->{state_data}->{current_player} != $player) { + my $msg; + if (not exists $self->{state_data}->{players}->[$player]->{location}) { + $msg = "$nick: You will attack $arguments when it is your turn."; + } else { + $msg = "$nick: You will now attack $arguments instead of $self->{state_data}->{players}->[$player]->{location} when it is your turn."; + } $self->{state_data}->{players}->[$player]->{location} = $arguments; - return "$nick: You will attack $arguments when it is your turn."; + return $msg; } if ($self->{player}->[$player]->{done}) { @@ -1084,7 +1090,7 @@ sub showboard { $self->show_battlefield(0); $self->send_message($self->{channel}, "Showing battlefield to $self->{player}->[1]->{nick}..."); $self->show_battlefield(1); - $self->send_message($self->{channel}, "Fight! Anybody (players and spectators) can use `board` at any time to see latest version of the board!"); + $self->send_message($self->{channel}, "Fight! Anybody (players and spectators) can use `board` at any time to see the battlefield."); $state->{result} = 'next'; return $state; }