summaryrefslogtreecommitdiffstats
path: root/include/functions.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-10-18 16:46:59 -0700
committerArun Persaud <arun@nubati.net>2008-10-18 16:46:59 -0700
commit567f0d615194566c629887a315cd864bbe84fde9 (patch)
treeea973a9c3afc86b4ce4c76cce581628bb5890267 /include/functions.php
parenteb20bf1a0cae1192eb50c19220e72df8d971d8e7 (diff)
downloade-DoKo-567f0d615194566c629887a315cd864bbe84fde9.tar.gz
e-DoKo-567f0d615194566c629887a315cd864bbe84fde9.tar.bz2
e-DoKo-567f0d615194566c629887a315cd864bbe84fde9.zip
NEW FEATURE: implement Lance's Schweinchen rule
new rule that only allows Schweinchen in case one of the teammembers called re/contra. Signed-off-by: Arun Persaud <arun@nubati.net>
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php
index ca62cd9..d09408c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -177,14 +177,27 @@ function compare_cards($a,$b,$game)
return 1;
if($b == 19 || $b == 20 )
return 0;
- };
- if($RULES['schweinchen']=='second' && $GAME['schweinchen-second'])
+ }
+ else if($RULES['schweinchen']=='second' && $GAME['schweinchen-second'])
{
if($a == 19 || $a == 20 )
return 1;
if($b == 19 || $b == 20 )
return 0;
- };
+ }
+ else if($RULES['schweinchen']=='secondaftercall' && $GAME['schweinchen-who'] && $GAME['schweinchen-second'] )
+ {
+ /* check if a call was made either by the player or his partner. If so activate Schweinchen rule. */
+ if(DB_get_call_by_hash($GAME['schweinchen-who']) || DB_get_partner_call_by_hash($GAME['schweinchen-who']) )
+ {
+ if($a == 19 || $a == 20 )
+ return 1;
+ if($b == 19 || $b == 20 )
+ return 0;
+ }
+ /* if not, do nothing and the foxes are just handeled as normal trump */
+ }
+ ;
case "heart":
case "spade":
case "club":