summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-11 19:20:35 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-11 19:20:35 +0200
commitda7c90c235ae65697f4969112c53294e04904d0c (patch)
treed61becb6e2ab751a69b4d685e329a3c82815a89b
parent78e4b978141ee46a54b4a62d724985f5ab1b18d7 (diff)
uno plugin: mark all legit moves as not challengeable
-rw-r--r--data/rbot/plugins/games/uno.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/data/rbot/plugins/games/uno.rb b/data/rbot/plugins/games/uno.rb
index 5f1c2679..07b9afe1 100644
--- a/data/rbot/plugins/games/uno.rb
+++ b/data/rbot/plugins/games/uno.rb
@@ -377,12 +377,23 @@ class UnoGame
end
if cards.length >= toplay
# if the played card is a W+4 not played during a stacking +x
+ # TODO if A plays an illegal W+4, B plays a W+4, should the next
+ # player be able to challenge A? For the time being we say no,
+ # but I think he should, and in case A's move was illegal
+ # game would have to go back, A would get the penalty and replay,
+ # while if it was legal the challenger would get 50% more cards,
+ # i.e. 12 cards (or more if the stacked +4 were more). This would
+ # only be possible if the first W+4 was illegal, so it wouldn't
+ # apply for a W+4 played on a +2 anyway.
+ #
if @picker == 0 and Wild === cards.first and cards.first.value
# save the previous discard in case of challenge
@last_discard = @discard.dup
# save the color too, in case it was a Wild
@last_color = @color.dup
else
+ # mark the move as not challengeable
+ @last_discard = nil
@last_color = nil
end
set_discard(p.cards.delete_one(cards.shift))