define('BIN5_TOURNAMENT_OLDRULES', 1);
define('BIN5_TOURNAMENT_NO_DRAW', 2);
+define('BIN5_TOURNAMENT_TOGETHER17', 4);
define('BIN5_RULES_OLDSCHEMA', -1);
define('BIN5_RULES_FINISH', 0);
$card = $this->table->card;
unset($user->asta_tourn_pts);
$user->asta_tourn_pts = array(0, 0, 0, 0);
- $tourn_values = array(11, 10, 4,3,2, 1,1,1,1,1);
+ if (BIN5_CARD_HAND == 8)
+ $tourn_values = array(11, 10, 4,3,2, 1,1,1,1,1);
+ else
+ $tourn_values = array(33, 30, 12,9,6, 3,3,3,3,3);
for ($i = 0 ; $i < BIN5_PLAYERS_N * BIN5_CARD_HAND ; $i++) {
$user->asta_card = -1;
$this->table->asta_pla_n--;
+ if ($this->table->asta_card == -1 && $this->table->asta_pla_n == 1) {
+ error_log('table_asta_card: ' . $this->table->asta_card);
+ // all abandon auction except one => move next bid to two and 71 points
+ $this->table->asta_card = 9;
+ $this->table->asta_pnt = 70;
+ }
+
return TRUE;
}
else if ($a_card <= 9) {
do {
if ($a_card >= 0 && $a_card < 9 && $a_card > $this->table->asta_card) {
- return TRUE;
+ ;
}
else if ($a_card == 9 &&
$a_pnt > ($this->table->asta_pnt >= 61 ? $this->table->asta_pnt : 60)
return FALSE;
}
+ function rules_nextauct(&$bri, $curtime, $action, $user, $maxcard)
+ {
+ if (($this->table->asta_pla_n > ($maxcard > -1 ? 1 : 0)) &&
+ !($this->table->asta_card == 9 && $this->table->asta_pnt == 120)) {
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+
+ }
+
} // class Rules_no_draw
?>
\ No newline at end of file
* asta_pla_n > 0 if someone NOT bet)
* THEN advance auction
*/
- if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_NEXTAUCT, $maxcard)) {
+ if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_NEXTAUCT, $user, $maxcard)) {
/* search the next player in auction and put it in gstart field */
for ($i = 1 ; $i < BIN5_PLAYERS_N ; $i++) {
$index_next = ($table->gstart + $i) % BIN5_PLAYERS_N;
if ($a_brisco >= 0 && $a_brisco < (BIN5_CARD_HAND * BIN5_PLAYERS_N)) {
$table->briscola = $a_brisco;
- $tourn_values = array(11, 10, 4,3,2, 1,1,1,1,1);
+ if (BIN5_CARD_HAND == 8)
+ $tourn_values = array(11, 10, 4,3,2, 1,1,1,1,1);
+ else
+ $tourn_values = array(33, 30, 12,9,6, 3,3,3,3,3);
+
$table->tourn_pts = 0;
$seed = $a_brisco - ($a_brisco % 10);
for ($i = $seed ; $i < ($seed + min(10, BIN5_CARD_HAND * BIN5_PLAYERS_N)) ; $i++) {