Add double run bombs. Logic still incomplete.
This commit is contained in:
parent
03c2f92397
commit
eafbe7693d
@ -60,16 +60,18 @@ class Play < ActiveRecord::Base
|
|||||||
# current player is not the player to beat
|
# current player is not the player to beat
|
||||||
if (game.player_to_beat != player)
|
if (game.player_to_beat != player)
|
||||||
# valid bomb?
|
# valid bomb?
|
||||||
if (self.hand_type == 'bomb' && game.play_to_beat.try("play").try("hand_type") == 'single' && game.play_to_beat.try("play").try("player_cards")[0].try('rank') == '2')
|
# if (self.hand_type =~ /bomb|double run/ && game.play_to_beat.try("play").try("hand_type") == 'single' && game.play_to_beat.try("play").try("player_cards")[0].try('rank') == '2')
|
||||||
|
if (self.hand_type =~ /bomb|double run/)
|
||||||
@truths << true
|
@truths << true
|
||||||
return @truths
|
return @truths
|
||||||
end
|
else
|
||||||
# hand_type match?
|
# hand_type match?
|
||||||
@truths << (self.hand_type == game.play_to_beat.try("play").try("hand_type")) if game.play_to_beat.try("play").try(:hand_type)
|
@truths << (self.hand_type == game.play_to_beat.try("play").try("hand_type")) if game.play_to_beat.try("play").try(:hand_type)
|
||||||
# beats?
|
# beats?
|
||||||
@truths << (self.beats? self.game.play_to_beat.try(:play))
|
@truths << (self.beats? self.game.play_to_beat.try(:play))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if has_player_cards
|
if has_player_cards
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user