{
/* always need to use Schweinchen to figure out for example who has poverty */
$ok=1;
+ /* unless the gametype is set and we know that we are in poverty were schweinchen is not valid */
+ if( in_array( $gametype,array('poverty','dpoverty') ))
+ $ok=0;
}
else
{
{
/* asks the player, if he wants to join the game */
output_check_want_to_play($me);
+ echo '<div class="mycards"></div>';
break;
}
else
/* move on to the next stage*/
DB_set_hand_status_by_hash($me,'check');
+ $mystatus='check';
};
};
}
}
echo "</div>\n";
+ /* show cards */
+ echo '<div class="mycards">'._('Your cards are').": <br />\n";
+ foreach($mycards as $card)
+ display_card($card,$PREF['cardset']);
+ echo "</div>\n";
+
break;
}
}
else
echo "<div class=\"message\">Please, <a href=\"$INDEX?action=game&me=$me\">start</a> the game.</div>\n";
+ echo '<div class="mycards"></div>'."\n"; /* needed to make sure the message area is in the right position */
}
/* the following is part A) of what needs to be done */
*/
/* get calls from re/contra */
- $call_re = NULL;
- $call_contra = NULL;
+ $call_re = -1;
+ $call_contra = -1;
foreach($userids as $user)
{
$hash = DB_get_hash_from_gameid_and_userid($gameid,$user);
if($party=='re')
{
- if($call_re==NULL)
+ if($call_re== -1)
$call_re = $call;
else if( $call < $call_re)
$call_re = $call;
}
else if($party=='contra')
{
- if($call_contra==NULL)
+ if($call_contra== -1)
$call_contra = $call;
else if( $call < $call_contra)
$call_contra = $call;
/* figure out who one */
$winning_party = NULL;
- if($call_re == NULL && $call_contra==NULL)
+ if($call_re == -1 && $call_contra == -1)
{
/* nobody made a call, so it's easy to figure out who won */
if($re>120)
* if only one party made a call, the other one wins,
* if the first one didn't make it
*/
- if($call_re)
+ if($call_re != -1)
{
$offset = 120 - $call_re;
if($call_re == 0)
if($re > 120+$offset)
$winning_party='re';
- else if ($call_contra == NULL )
+ else if ($call_contra == -1 )
$winning_party='contra';
}
- if($call_contra)
+ if($call_contra != -1)
{
$offset = 120 - $call_contra;
if($call_contra == 0)
if($contra > 120+$offset)
$winning_party='contra';
- else if ($call_re == NULL )
+ else if ($call_re == -1 )
$winning_party='re';
}
}
/* one point for each call of the other party in case the other party didn't win
* and one point each in case the party made more than points than one of the calls
*/
- if($winning_party!='contra' && $call_contra!=NULL)
+ if($winning_party!='contra' && $call_contra!= -1)
{
for( $p=$call_contra;$p<=120; $p+=30 )
{
" VALUES( NULL,NULL,$gameid,'re',NULL,NULL,'made$p')");
}
}
- if($winning_party!='re' and $call_re!=NULL)
+ if($winning_party!='re' and $call_re!= -1)
{
for( $p=$call_re;$p<=120; $p+=30 )
{
foreach(array(120,150,180,210,240) as $p)
{
$offset = 0;
- if($p==240 || $call_contra!=NULL)
+ if($p==240 || $call_contra != -1)
$offset = 1;
if($re>$p-$offset)
/* re called something and won */
foreach(array(0,30,60,90,120) as $p)
{
- if($call_re!=NULL && $call_re<$p+1)
+ if($call_re!= -1 && $call_re<$p+1)
DB_query("INSERT INTO Score".
" VALUES( NULL,NULL,$gameid,'re',NULL,NULL,'call$p')");
}
foreach(array(120,150,180,210,240) as $p)
{
$offset = 0;
- if($p==240 || $call_re!=NULL)
+ if($p==240 || $call_re != -1)
$offset = 1;
if($contra>$p-$offset)
/* re called something and won */
foreach(array(0,30,60,90,120) as $p)
{
- if($call_contra!=NULL && $call_contra<$p+1)
+ if($call_contra != -1 && $call_contra<$p+1)
DB_query("INSERT INTO Score".
" VALUES( NULL,NULL,$gameid,'contra',NULL,NULL,'call$p')");
}
$howmanycards = 0;
foreach($mycards as $card)
{
- if($howmanycard>1)
+ if($howmanycards>1)
break;
/* display only cards that the player is allowed to play as links, the rest just display normal
in_array($gametype,array('normal','wedding','trump','silent'))
)
)
- continue ;
+ continue;
else
$howmanycards++;
}
+
if($howmanycards==1)
$howmanycards=1;
else
)
display_card($card,$PREF['cardset']);
else
- display_link_card($card,$PREF['cardset'],$selected=$howmanycards);
+ display_link_card($card,$PREF['cardset'],$type='card',$selected=$howmanycards);
}
}
else if($mystatus=='play' )