X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=inline;f=data%2Frbot%2Fplugins%2Fgames%2Funo.rb;h=6ea0063355c162710dae4007df26acb1a5207709;hb=fc24a86d3f1c95c3c35a5647334287ff34097720;hp=ecf322d5f48f62e0f399ac2b109cfb781f0cb991;hpb=94d72bb656a6d0877e2d87cb0218a2fb150d446b;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index ecf322d5..6ea00633 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -397,10 +397,24 @@ class UnoGame toplay = (full == short) ? 1 : 2 end debug [full, short, jolly, jcolor, toplay].inspect - # r7r7 -> r7r7, r7, nil, nil - # r7 -> r7, r7, nil, nil - # w -> w, nil, w, nil - # wg -> wg, nil, w, g + # r7r7 -> r7r7, r7, nil, nil, 2 + # r7 -> r7, r7, nil, nil, 1 + # w -> w, nil, w, nil, 1 + # wg -> wg, nil, w, g, 1 + + # if @color is nil, the player just played a wild without specifying + # a color. (s)he should now use "co ", but we allow him to + # replay the wild _and_ specify the color, without actually replaying + # the card (which would otherwise happen if the player has another wild) + if @color.nil? + if jcolor + choose_color(p.user, jcolor) + else + announce _("you already played your card, ") + _("%{p}, choose a color with: co r|b|g|y") % { :p => p } + end + return + end + if cards = p.has_card?(short) debug cards unless can_play(cards.first)