From: Giuseppe Bilotta Date: Thu, 9 Dec 2010 10:32:49 +0000 (+0100) Subject: UNO!: prevent joins after a challengeable card X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=4ff3c5d894c9b6b375b69d5fe9506a0a73e33871;hp=539685183e46a9fe7f0d334688b8760a99e3d169;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git UNO!: prevent joins after a challengeable card If someone joins after a challengeable W+4, he would be inserted between the last and first player, and if there is a challenge _his_ cards would be exposed. So prevent joining in such a situation. --- diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb index 6b50d03e..c689c253 100644 --- a/data/rbot/plugins/games/uno.rb +++ b/data/rbot/plugins/games/uno.rb @@ -689,6 +689,13 @@ class UnoGame return end end + if @last_discard + announce _("you can't join now, %{p}, a %{card} was just played, wait until next turn") % { + :card => @discard, + :p => user + } + return + end cards = 7 if @start_time cards = (@players.inject(0) do |s, pl|