]> Pileus Git - ~andy/rhawk/commitdiff
Add turn command
authorAndy Spencer <andy753421@gmail.com>
Sat, 30 Mar 2013 16:52:09 +0000 (16:52 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sat, 30 Mar 2013 16:52:09 +0000 (16:52 +0000)
spades.awk

index 9151b49964c7c53343667128b61133412f0ded33..fe0142fd99a4c979f7d61d247c83eec85a54be41 100644 (file)
@@ -81,7 +81,6 @@ function sp_save(file,        game)
        game["dealer"]  = sp_dealer;
        game["turn"]    = sp_turn;
        game["player"]  = sp_player;
-       game["valid"]   = sp_valid;
        json_copy(game, "hands",   sp_hands);
        json_copy(game, "players", sp_players);
        json_copy(game, "order",   sp_order);
@@ -118,7 +117,6 @@ function sp_load(file,      game)
        sp_dealer  = game["dealer"];
        sp_turn    = game["turn"];
        sp_player  = game["player"];
-       sp_valid   = game["valid"];
        sp_acopy(sp_hands,   game["hands"]);
        sp_acopy(sp_players, game["players"]);
        sp_acopy(sp_order,   game["order"]);
@@ -545,6 +543,11 @@ sp_state == "play" &&
            sp_order[3] " took " int(sp_tricks[3]) "/" int(sp_bids[3]))
 }
 
+/\.turn/ {
+       if (sp_state == "bid" || sp_state == "play")
+               say("It is " sp_player "'s turn.");
+}
+
 (TO == NICK || DST == sp_channel) &&
 /^\.(score|status)$/ {
        if (sp_state == "new") {