X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=0601e4443e0a9ede1af5b60529194ce45eba5690;hp=b94ee90f7ddcb0cea5f4e267bb2a1ace594d4544;hb=10c5ce6fbd07fc37b7606611bc6e49bcabca38a0;hpb=e7e541e70a2aabdd399aa9952e0f8dee435b402b
diff --git a/include/game.php b/include/game.php
index b94ee90..0601e44 100644
--- a/include/game.php
+++ b/include/game.php
@@ -1524,28 +1524,31 @@ switch($mystatus)
/* same as for foxes, karlchen doesn't always make sense
* check what kind of game it is and set karlchen accordingly */
- $ok = 1; /* default: karlchen should be accounted for */
- if($tricknr != 12 )
- $ok = 0; /* Karlchen works only in the last trick */
- if($ok && DB_get_gametype_by_gameid($gameid)=='solo' )
+
+ if($tricknr == 12 ) /* Karlchen works only in the last trick */
{
- $solo = DB_get_solo_by_gameid($gameid);
- if($solo == 'trumpless' || $solo == 'jack' || $solo == 'queen' )
- $ok = 0; /* no Karlchen in these solos */
- }
+ /* check for solo */
+ $solo = 'none';
+ if(DB_get_gametype_by_gameid($gameid)=='solo' )
+ $solo = DB_get_solo_by_gameid($gameid);
- if($ok)
- foreach($play as $played)
- if ( $played['card']==11 || $played['card']==12 )
- if ($played['pos'] == $winner )
- {
- /* possible caught a fox, check party */
- $uid1 = DB_get_userid('gameid-position',$gameid,$winner);
- $party1 = DB_get_party_by_gameid_and_userid($gameid,$uid1);
+ /* no Karlchen in these solos */
+ if($solo != 'trumpless' && $solo != 'jack' && $solo != 'queen' )
+ {
+ foreach($play as $played)
+ if ( $played['card']==11 || $played['card']==12 )
+ if ($played['pos'] == $winner )
+ {
+ /* save Karlchen */
+ $uid1 = DB_get_userid('gameid-position',$gameid,$winner);
+ $party1 = DB_get_party_by_gameid_and_userid($gameid,$uid1);
+
+ DB_query("INSERT INTO Score".
+ " VALUES( NULL,NULL,$gameid,'$party1',$uid1,NULL,'karlchen')");
+ };
+ };
+ }; /* end scoring Karlchen */
- DB_query("INSERT INTO Score".
- " VALUES( NULL,NULL,$gameid,'$party1',$uid1,NULL,'karlchen')");
- }
/*
* check for doppelopf (>40 points)
***********************************/
@@ -1901,7 +1904,7 @@ switch($mystatus)
}
else if(myisset('card') && !$myturn )
{
- echo "please wait until it's your turn!
\n";
+ echo _("please wait until it's your turn!")."
\n";
}
if($seq!=4 && $trickNR>=1 && !(myisset('card') && $myturn) )
@@ -1978,7 +1981,7 @@ switch($mystatus)
if($myturn && !myisset('card') && $mystatus=='play' )
{
echo "Hello ".$myname.", it's your turn!
\n";
- echo "Your cards are:
\n";
+ echo _('Your cards are').":
\n";
/* do we have to follow suite? */
$followsuit = 0;
@@ -2010,7 +2013,7 @@ switch($mystatus)
}
else if($mystatus=='play' )
{
- echo "Your cards are:
\n";
+ echo _('Your cards are').":
\n";
foreach($mycards as $card)
display_card($card,$PREF['cardset']);
}
@@ -2020,7 +2023,7 @@ switch($mystatus)
$oldcards = mysort($oldcards,$gametype);
if(isset($_SESSION['id']) && $myid==$_SESSION['id'])
- echo "Your cards were:
\n";
+ echo _('Your cards were').":
\n";
else
{
$name = DB_get_name('userid',$myid);
@@ -2106,10 +2109,10 @@ $gameend = time() - strtotime($r[0]);
if($gamestatus == 'play' || $gameend < 60*60*24*7)
{
- echo "
\nA short comment:\n";
+ echo "
\n"._('A short comment').":\n";
}
-echo "\n";
+echo "\n";
/* has this hand been played by others? */
$other_game_ids = DB_played_by_others($gameid);