X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=spades.awk;h=50952f182b4e8f13ae13d4a641a442bcd88ed529;hb=44f0dadfc7e9f153a87a2a8d86669f189cdc4314;hp=013f373b7ca3ef53faf92f032f3908015978d7e5;hpb=d1677ba28a81639d0869c209c7e299a4cd8b2c16;p=~andy%2Frhawk diff --git a/spades.awk b/spades.awk index 013f373..50952f1 100644 --- a/spades.awk +++ b/spades.awk @@ -709,9 +709,6 @@ sp_state == "play" && if (!(_card in sp_deck)) { reply("Invalid card") } - else if (!(_card in sp_hands[sp_from])) { - reply("You do not have that card") - } else if (sp_suit && _card !~ sp_suit && sp_hasa(sp_from, sp_suit)) { reply("You must follow suit (" sp_suit ")") } @@ -721,6 +718,9 @@ sp_state == "play" && else if (_card ~ /s/ && length(sp_pile) == 0 && sp_hasa(sp_from, "[^s]$") && !sp_broken) { reply("Spades have not been broken") } + else if (!(_card in sp_hands[sp_from])) { + reply("You do not have that card") + } else { sp_play(_card) if (sp_state == "play") { @@ -760,11 +760,12 @@ sp_state == "play" && if (/!!/ && (sp_state == "bid" || sp_state == "play")) { if (sp_player in sp_notify) { - mail_send(sp_notify[sp_player], \ - (sp_state == "bid" ? "It is your bid!" : "") \ - (sp_state == "play" ? "It is your turn!" : ""), \ - (sp_state == "bid" ? "Bids: " _bids : "") \ - (sp_state == "play" ? "Pile: " _pile : "")) + _bids = _bids ? _bids : "none" + _pile = _pile ? sp_piles : "none" + mail_send(sp_notify[sp_player], \ + "It is your " sp_state "!", \ + "Bids so far: " _bids "\n" \ + "Cards played: " _pile) say("Notified " sp_player " at " sp_notify[sp_player]) } else { say("No email address for " sp_player)