]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
uno game: non-wilds can't be played on a +something unless they're the right color
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 9 Apr 2008 14:57:01 +0000 (16:57 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 9 Apr 2008 14:57:01 +0000 (16:57 +0200)
data/rbot/plugins/games/uno.rb

index 90a8ee480edb23a8fabc2d24401465af6e50fba7..13f39c9b5992d3445c3484d0e554419215cdb129 100644 (file)
@@ -274,6 +274,9 @@ class UnoGame
     # a +something of same or higher something, or a Reverse
     # TODO make optional
     if @picker > 0
+      if card.color and card.color != @color
+        return false
+      end
       if card.value == 'Reverse' or card.picker >= @discard.picker
         return true
       else