145 |
} |
} |
146 |
else if (g->state == GAME_STATE_CHIEN_MANAGMENT) |
else if (g->state == GAME_STATE_CHIEN_MANAGMENT) |
147 |
{ |
{ |
148 |
/* Some code was written the day after my Grand'ma died. |
/* Some code was written the day after my Grand'ma died. |
149 |
* I dedicate that code to her. |
* I dedicate that code to her. |
150 |
* I, her and my Grand'pa spent hours and hours playing Tarot |
* I, her and my Grand'pa spent hours and hours playing Tarot |
151 |
* Please do not remove this comment |
* Please do not remove this comment |
152 |
* Yves (June 6th 2003) |
* Yves (June 6th 2003) |
153 |
*/ |
*/ |
154 |
if ((LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_PRISE)) |
if ((LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_PRISE)) |
155 |
&& (LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_GARDE))) |
&& (LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_GARDE))) |
156 |
{ |
{ |
160 |
{ |
{ |
161 |
int s1; |
int s1; |
162 |
player_t *p1; |
player_t *p1; |
163 |
|
int nb = 0; |
164 |
|
int pos; |
165 |
for (i = 0; i < g->players->len; i++) |
for (i = 0; i < g->players->len; i++) |
166 |
{ |
{ |
167 |
s1 = g_array_index (g->players, int, i); |
s1 = g_array_index (g->players, int, i); |
172 |
s1 = g_array_index (g->players, int, g->rules->preneur); |
s1 = g_array_index (g->players, int, g->rules->preneur); |
173 |
p1 = g_tree_lookup (config->sock_id, GINT_TO_POINTER (s1)); |
p1 = g_tree_lookup (config->sock_id, GINT_TO_POINTER (s1)); |
174 |
g_assert (p1 != NULL); |
g_assert (p1 != NULL); |
175 |
|
if (g->nb_players_max == 3) |
176 |
|
nb = 6; |
177 |
|
else if (g->nb_players_max == 4) |
178 |
|
nb = 6; |
179 |
|
else if (g->nb_players_max == 5) |
180 |
|
nb = 3; |
181 |
|
g_assert (nb != 0); |
182 |
|
pos = player_get_position (p1); |
183 |
|
for (i = 0; i < nb; i++) |
184 |
|
{ |
185 |
|
g->rules->card_status[g->rules->chien[i]] = pos; |
186 |
|
} |
187 |
send_ask_chien (s1, p1); |
send_ask_chien (s1, p1); |
188 |
g->state = GAME_STATE_ASKING_CHIEN; |
g->state = GAME_STATE_ASKING_CHIEN; |
189 |
} |
} |
190 |
} |
} |
191 |
else if (g->state == GAME_STATE_ASKING_CHIEN) |
else if (g->state == GAME_STATE_ASKING_CHIEN) |
192 |
{ |
{ |
193 |
|
/* Nothing to do here but maybe some timeout job ? */ |
194 |
|
} |
195 |
|
else if (g->state == GAME_STATE_ASKING_CHIEN_DONE) |
196 |
|
{ |
197 |
|
g->state = GAME_STATE_PLAYING_GAME; |
198 |
} |
} |
199 |
else if (g->state == GAME_STATE_PLAYING_GAME) |
else if (g->state == GAME_STATE_PLAYING_GAME) |
200 |
{ |
{ |