X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fbriskin5%2FObj%2Fbriskin5.phh;h=28a502c2619ee3fa65fb8cf27e06f47cec13a595;hb=7ac0de00caeb2a71ab3f18d8ad0089134d479de1;hp=beaeed6395990284992f79c560b9ca9f9ffc95d2;hpb=dcff4d0735d2c55fe7ae7b1abc6854df39465de3;p=brisk.git
diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh
index beaeed6..28a502c 100644
--- a/web/briskin5/Obj/briskin5.phh
+++ b/web/briskin5/Obj/briskin5.phh
@@ -49,7 +49,7 @@ $mlang_bin5_bin5 = array(
'en' => 'they have lost'),
'info_yturn'=> array( 'it' => ' tocca a te giocare.',
'en' => ' it\'s your turn.'),
- 'info_turn' => array( 'it' => 'tocca a $unam giocare.',
+ 'info_turn' => array( 'it' => 'tocca a %s giocare.',
'en' => 'it\'s the %s\'s turn.'),
'info_mult' => array( 'it' => ' La partita vale %s.',
'en' => ' The game worth %s.' ),
@@ -195,7 +195,7 @@ class Table_briskin5 extends Table {
*/
/* CLONE() NOT USED
- function &clone(&$from)
+ function &myclone(&$from)
{
GLOBAL $G_false;
@@ -403,13 +403,14 @@ class Table_briskin5 extends Table {
-
+define(BIN5_USER_FLAG_RING_ENDAUCT, 0x01);
class User_briskin5 extends User {
var $asta_card; //
var $asta_pnt; //
var $handpt; // Total card points at the beginning of the current hand.
var $exitislock; // Player can exit from the table ?
+ var $privflags; // Flags for briskin5 only
function User() {
}
@@ -425,6 +426,7 @@ class User_briskin5 extends User {
$thiz->asta_pnt = -1;
$thiz->handpt = -1;
$thiz->exitislock = TRUE;
+ $thiz->privflags = 0;
return ($thiz);
}
@@ -443,10 +445,11 @@ class User_briskin5 extends User {
$this->asta_pnt = $from->asta_pnt;
$this->handpt = $from->handpt;
$this->exitislock = $from->exitislock;
+ $this->privflags = $from->privflags;
}
/* CLONE NOT USED
- function &clone(&$from)
+ function &myclone(&$from)
{
GLOBAL $G_false;
@@ -461,7 +464,7 @@ class User_briskin5 extends User {
function &spawn(&$from, $table, $table_pos)
{
- GLOBAL $G_false;
+ GLOBAL $G_false, $CO_bin5_pref_ring_endauct;
if (($thiz =& new User_briskin5()) == FALSE)
return ($G_false);
@@ -473,6 +476,10 @@ class User_briskin5 extends User {
$thiz->handpt = -1;
$thiz->exitislock = TRUE;
+ log_wr("Briskin5 constructor");
+
+ $this->privflags = ($CO_bin5_pref_ring_endauct == "true" ? BIN5_USER_FLAG_RING_ENDAUCT : 0) | 0;
+
$thiz->table_orig = $table;
$thiz->table = 0;
$thiz->table_pos = $table_pos;
@@ -951,11 +958,12 @@ function locshm_exists($tok)
}
-
+// rendiamo qui l'elenco dei punti come return della func
function calculate_points(&$table)
{
GLOBAL $G_all_points;
+ $ret = array();
$pro = 0;
if ($table->asta_pnt == 60)
@@ -979,13 +987,15 @@ function calculate_points(&$table)
if ($table->asta_pnt == 61 && $pro == 60) { // PATTA !
$table->points[$table->points_n % MAX_POINTS] = array();
- for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++)
+ for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) {
$table->points[$table->points_n % MAX_POINTS][$i] = 0;
+ $ret[$i] = 0;
+ }
$table->points_n++;
$table->old_pnt = $pro;
$table->mult *= 2;
- return;
+ return($ret);
}
if ($pro >= $table->asta_pnt)
@@ -1010,10 +1020,13 @@ function calculate_points(&$table)
$table->points[$table->points_n % MAX_POINTS][$i] = $pt;
$table->total[$i] += $pt;
+ $ret[$i] = $pt;
}
$table->points_n++;
$table->old_pnt = $pro;
$table->mult = 1;
+
+ return($ret);
}
/* show table
@@ -1163,6 +1176,7 @@ function show_table(&$room, &$user, $sendstep, $is_transition, $is_again)
}
if (BRISKIN5_PLAYERS_N == 3)
$showst .= ",-2,-2";
+ $ret .= sprintf('document.title = "Brisk - Tavolo %d (asta)";', $user->table_orig);
$ret .= sprintf('show_astat(%s);', $showst);
if ($table->asta_win != -1 && $table->asta_win == $table_pos) {
@@ -1384,6 +1398,7 @@ function table_wellcome($user)
function briscola_show($room, $table, $user)
{
+ GLOBAL $G_lang, $mlang_bin5_bin5;
$ptnadd = "";
$ret = "";