X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbrisk.phh;h=2a7355c97bc4e6ab0f078d06147d2019da1ec311;hb=ef0eff447cc1d588c95b9b6bfc5da4cb14ba7af6;hp=9db417c7154f9607d55303dce416c95f2d9a7bdf;hpb=ee868390334d5d48f41b6b572867819b4f18a9e0;p=brisk.git diff --git a/web/brisk.phh b/web/brisk.phh index 9db417c..2a7355c 100644 --- a/web/brisk.phh +++ b/web/brisk.phh @@ -34,21 +34,42 @@ define(NICKSERV, "SERVER"); define(BRISK_DEBUG, FALSE); // define(DEBUGGING, "local"); -/* -$root_wellarr = Array ( 'GOOGLE', - 'pinollo lanollo', - 'rorella liolla' ); -*/ -$root_wellarr = Array ( ); -$table_wellarr = Array ( ); - -$G_brisk_version = "0.4.2"; - -/*$G_room_help = ' -Brisk - Ver. '.$G_brisk_version.'

-Copyright 2006 Matteo Nastasi

'; -*/ -$G_room_help = 'Brisk - Ver. '.$G_brisk_version.'

Copyright 2006 Matteo Nastasi

'; +$root_wellarr = Array ( 'Benvenuto in brisk (Ver. 0.4.3).', + 'Se vuoi iscriverti alla Mailing List, cliccala!' ); +$table_wellarr = Array ( 'In bocca al lupo!'); + +$G_brisk_version = "0.4.3"; + +$G_room_help= ' +
+Descrizione
+Questa è un\'implementazione della briscola in cinque, così come è spiegata su +Wikipedia; in breve è la variante con l\'asta prima sulla carta e poi sui punti.

+Uso del sito
+Potete sedervi a un tavolo o rimanere in piedi.
+Se al vostro tavolo si raggiungono i 5 giocatori inizia automaticamente la partita.
+
+Partita
+All\'inizio vengono distribuite le carte e parte l\'asta; per partecipare all\'asta, quando sarà il vostro turno, potrete scegliere se andare avanti o passare cliccando sulle icone corrispondenti. Se si arriva ai punti, scrivete nella textbox il vostro rilancio e cliccate PUNTI.

+Chi vince l\'asta dovrà decidere il seme della carta scelta e inizierà la mano.
+Per giocare le carte dovrete trascinarle nel quadrato al centro del vostro schermo.

+Il vostro turno è sempre segnalato da una cornice verde lampeggiante intorno quadrato al centro del vostro schermo.

+Durante la partita, se vorrete ricaricare la pagina, usate l\'apposito bottone \\"reload\\" in basso a destra.
+
+
Comandi della chat +
/nick <nuovo_nickname> - cambio di nickname +
.. to be continue .. +
+
+'; + +$G_room_about= '
+
+ + briscola chiamata in salsa ajax +
+
version '.$G_brisk_version.'

+Copyright 2006-2007 Matteo Nastasi (aka mop)

'; function xcape($s) @@ -533,7 +554,8 @@ class brisco { // update remote graphs for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { $user_cur = &$this->user[$i]; - if ($user_cur->sess == '' || $user_cur->stat != 'room') + // if ($user_cur->sess == '' || $user_cur->stat != 'room') + if ($user_cur->sess == '') continue; if ($user_cur->name == $name_new) { $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; @@ -964,18 +986,12 @@ function standup_content(&$bri, $user) } - - - -function show_notify($anc, $text, $tout, $butt) +function show_notify($text, $tout, $butt, $w, $h) { log_main("SHOW_NOTIFY", $text); - return sprintf('var noti = new notify(gst,$("%s"),"%s",%d,"%s");', $anc, $text, $tout,$butt); + return sprintf('var noti = new notify(gst,"%s",%d,"%s",%d,%d);', $text, $tout, $butt, $w, $h); } - - - function briscola_show($bri, $table, $user) { $ptnadd = ""; @@ -1033,6 +1049,8 @@ function multoval($mult) function show_table_info(&$bri, &$table, $table_pos) { + $user = &$bri->user[$table->player[$table_pos]]; + $pnt_min = $table->points_n - MAX_POINTS < 0 ? 0 : $table->points_n - MAX_POINTS; $noty = sprintf(''); @@ -1092,10 +1110,29 @@ function show_table_info(&$bri, &$table, $table_pos) } } if ($table->mazzo == $table_pos) - $noty .= "Fai tu il mazzo."; + $noty .= "Fai tu il mazzo,"; else { $unam = xcape($bri->user[$table->player[$table->mazzo]]->name); - $noty .= "Il mazzo a $unam."; + $noty .= "Il mazzo a $unam,"; + } + + if ($user->subst == 'asta') { + if ($table->asta_win == -1) // auction case + $curplayer = $table->gstart % PLAYERS_N; + else + $curplayer = $table->asta_win; + } + else if ($user->subst == 'game') { + $curplayer = ($table->gstart + $table->turn) % PLAYERS_N; + } + + + if ($curplayer == $table_pos) { + $noty .= " tocca a te giocare."; + } + else { + $unam = xcape($bri->user[$table->player[$curplayer]]->name); + $noty .= " tocca a $unam giocare."; } if ($table->mult > 1) { @@ -1103,7 +1140,7 @@ function show_table_info(&$bri, &$table, $table_pos) } $noty .= "

"; - $ret .= show_notify("bg", $noty, 3000, "torna alla partita"); + $ret .= show_notify($noty, 3000, "torna alla partita", 500, 400); return ($ret); } @@ -1152,6 +1189,12 @@ function show_room(&$bri, &$user) /* show table is_transition (is from room to table ?) is_again (is another game) + +Examles of $is_transition, $is_again: + from reload of the page: FALSE, FALSE + from sitdown in room: TRUE, FALSE + from table: asta cmd e tutti passano: TRUE, TRUE + from table: fine partita: TRUE, TRUE */ function show_table(&$bri, &$user, $sendstep, $is_transition, $is_again) { @@ -1191,8 +1234,9 @@ function show_table(&$bri, &$user, $sendstep, $is_transition, $is_again) /* NOTIFY FOR THE CARD MAKER */ if ($is_transition) { // && $user->subst == "asta" superfluo $ret .= show_table_info(&$bri, &$table, $user->table_pos); - $ret .= table_wellcome($user); } + if (!$is_again) + $ret .= table_wellcome($user); /* CARDS */ if ($is_transition) { // && $user->subst == "asta" superfluo