From: Giuseppe Bilotta Date: Mon, 27 Oct 2008 21:59:07 +0000 (+0100) Subject: UNO plugin: give cards to correct player at endgame X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=ac5ab47320777b42104028f19383fdc6fc3aceb7;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git 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. --- 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 }