]> Pileus Git - ~andy/rhawk/blobdiff - spades.awk
fix fortune
[~andy/rhawk] / spades.awk
index 844326a076483817d87c6a72a7eac733b10dbfa7..efd4769c375905fb880528fa57d6ed8df56a76f2 100644 (file)
@@ -1,7 +1,3 @@
-# Todo:
-#   - highest bidder leads
-#   - show card after play
-
 # Functions
 function sp_init(cards, tmp0, tmp1)
 {
@@ -149,7 +145,7 @@ function sp_score(  bids, tricks)
                bids   = sp_bids[i]   + sp_bids[i+2]
                tricks = sp_tricks[i] + sp_tricks[i+2]
                bags   = tricks - bids
-               if (sp_bags(i) + bags > 10) {
+               if (sp_bags(i) + bags >= 10) {
                        say(sp_team(i) " bag out")
                        sp_scores[i] -= 100
                }
@@ -274,7 +270,7 @@ FROM == OWNER &&
 
 
 # Setup
-/^\.newgame ?([0-9]+)?$/ {
+/^\.newgame ?([0-9]+)?/ {
        if (sp_state != "new") {
                reply("There is already a game in progress.")
        } else {
@@ -319,7 +315,7 @@ FROM == OWNER &&
 
 !sp_valid &&
 (sp_state "bid" || sp_state == "play") &&
-/^\.(bid|play)\>$/ {
+/^\.(bid|play)\>/ {
        if (FROM in sp_players)
                say(".slap " FROM ", it is not your turn.")
        else
@@ -456,12 +452,13 @@ sp_state == "play" &&
            sp_order[3] " took " int(sp_tricks[3]) "/" int(sp_bids[3]))
 }
 
+(TO == NICK || DST == sp_channel) &&
 /^\.(score|status)$/ {
        if (sp_state == "new") {
                say("There is no game in progress")
        }
        if (sp_state == "join") {
-               say("Waiting for palyers: " \
+               say("Waiting for players: " \
                    sp_order[0] " " sp_order[1] " " \
                    sp_order[2] " " sp_order[3])
        }