NEW FEATURE: display if someone is sick during the init phase
authorArun Persaud <arun@nubati.net>
Sun, 11 May 2008 05:30:52 +0000 (22:30 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 11 May 2008 05:30:52 +0000 (22:30 -0700)
Now players can see if someone in front of them said they were sick or not.
This way people can decide to wait until people in front of them finished the init phase
to see what the other playes said... it's made so that you can also see if people behind
you already have decided or not, but the player won't see the result in that case...

Signed-off-by: Arun Persaud <arun@nubati.net>
include/game.php
include/output.php

index 35b94cd70c1cc6862ad285b949fb98fe7525ddb3..d7e7b9545050f0d20ccb82eb1a0c0ebdbf8de9d5 100644 (file)
@@ -186,7 +186,30 @@ switch($mystatus)
     /* here we ask the player if he is sick */
     $mycards = DB_get_hand($me);
     sort($mycards);
+
+    /* output sickness of other playes, in case the already selected and are sitting in front of the current player */
+    echo "\n<ul class=\"tricks\">\n";
+    echo "  <li class=\"nohighlight\"> Game ".DB_format_gameid($gameid).": </li>\n";
+    echo "  <li onclick=\"hl('0');\" class=\"current\"><a href=\"#\">Pre</a>\n".
+      "    <div class=\"trick\" id=\"trick0\">\n";
     
+    for($pos=1;$pos<5;$pos++)
+      {
+       $usersick   = DB_get_sickness_by_pos_and_gameid($pos,$gameid);
+       $userid     = DB_get_userid('gameid-position',$gameid,$pos);
+       $userstatus = DB_get_hand_status_by_userid_and_gameid($userid,$gameid);
+
+       if($userstatus=='start' || $userstatus=='init')
+         echo " <div class=\"vorbehalt".($pos-1)."\"> still needs to decide </div>\n"; /* show this to everyone */
+       else
+         if($usersick!=NULL && $pos<=$mypos ) /* only show this for people sitting before the player */
+           echo " <div class=\"vorbehalt".($pos-1)."\"> sick </div>\n"; 
+         else if($usersick==NULL && $pos<=$mypos)
+           echo " <div class=\"vorbehalt".($pos-1)."\"> healthy </div>\n";
+      }
+    echo "    </div>\n  </li>\n</ul>\n";  /* end div trick, end li trick , end tricks*/
+    /* end displaying sickness */
+
     if(!myisset("solo","wedding","poverty","nines") )
       {
        output_check_for_sickness($me,$mycards);
@@ -271,7 +294,7 @@ switch($mystatus)
            echo "</p>\n";
            
            /* move on to the next stage*/
-           DB_set_hand_status_by_hash($me,'poverty');
+           DB_set_hand_status_by_hash($me,'check');
          };
       };
 
index 5f46470904c9172a0eb7575d5c7e66141ebb96d7..dc10fa3d5e2f8e967961c257e86ba1862a5bb276 100644 (file)
@@ -243,7 +243,7 @@ function output_header()
        function high_last(){
         if(document.getElementById){
           var i;
-          for(i=13;i>0;i--) {
+          for(i=13;i>=0;i--) {
             if(document.getElementById("trick"+i))
               {
                 hl(i);