From ac5ab47320777b42104028f19383fdc6fc3aceb7 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 27 Oct 2008 22:59:07 +0100 Subject: UNO plugin: give cards to correct player at endgame If the winner played a Reverse in response to a picker, the previous player should pick the cards, and not the next one. This is not really important at the moment because we score by giving points to the winner instead of taking them from losers, but we fix it for correctness. It'll be especially useful when we'll implement the other scoring too. --- data/rbot/plugins/games/uno.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'data') diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index ea7ed18b..bb640125 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -761,7 +761,11 @@ class UnoGame } end if @picker > 0 and not halted - p = @players[1] + if @discard.value == 'Reverse' + p = @players.last + else + p = @players[1] + end announce _("%{p} has to pick %{b}%{n}%{b} cards!") % { :p => p, :n => @picker, :b => Bold } -- cgit v1.2.3