Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
pp.qc
Go to the documentation of this file.
1#include "pp.qh"
2REGISTER_MINIGAME(pp, _("Push-Pull"));
3
4const int PP_TURN_PLACE = 0x0100; // player has to place a piece on the board
5const int PP_TURN_WIN = 0x0200; // player has won
6const int PP_TURN_DRAW = 0x0400; // players have equal scores
7const int PP_TURN_NEXT = 0x0800; // a player wants to start a new match
8const int PP_TURN_TYPE = 0x0f00; // turn type mask
9
10const int PP_TURN_TEAM1 = 0x0001;
11const int PP_TURN_TEAM2 = 0x0002;
12const int PP_TURN_TEAM = 0x000f; // turn team mask
13
14const int PP_SPECTATOR_TEAM = 255; // must be above max teams and equal to or below 255
15
16const int PP_LET_CNT = 7;
17const int PP_NUM_CNT = 7;
18
19const int PP_TILE_SIZE = 7;
20
21.int cnt;
22
25
27
28.entity pp_curr_piece; // identifier for the current target piece
29
30// find tic tac toe piece given its tile name
31entity pp_find_piece(entity minig, string tile)
32{
33 entity e = NULL;
34 while ( ( e = findfloat(e,minigame_id,minig.minigame_id) ) )
35 if ( e.classname == "minigame_board_piece" && e.netname == tile )
36 return e;
37 return NULL;
38}
39
40// check if the tile name is valid (3x3 grid)
41bool pp_valid_tile(string tile)
42{
43 if ( !tile )
44 return 0;
45 int number = minigame_tile_number(tile);
46 int letter = minigame_tile_letter(tile);
47 return 0 <= number && number < PP_NUM_CNT && 0 <= letter && letter < PP_LET_CNT;
48}
49
50// Checks if the given piece completes a row
51bool pp_winning_piece(entity minigame, entity piece)
52{
53 int number = minigame_tile_number(piece.netname);
54 int letter = minigame_tile_letter(piece.netname);
55
56 // here goes
65 return true;
66
67 return false;
68}
69
70bool pp_valid_move(entity minigame, string pos)
71{
72 if(!pp_valid_tile(pos))
73 return false;
74 if(pp_find_piece(minigame,pos).team == 5)
75 return false;
76
77 entity current = minigame.pp_curr_piece;
78 if(!current)
79 return true; // no current piece? allow the move anywhere
80
82 int letter = minigame_tile_letter(pos);
83
84 if( (pp_find_piece(minigame,minigame_tile_buildname(letter-1,number)) == current)
85 || (pp_find_piece(minigame,minigame_tile_buildname(letter+1,number)) == current)
86 || (pp_find_piece(minigame,minigame_tile_buildname(letter,number-1)) == current)
87 || (pp_find_piece(minigame,minigame_tile_buildname(letter,number+1)) == current)
88 || (pp_find_piece(minigame,minigame_tile_buildname(letter+1,number+1)) == current)
89 || (pp_find_piece(minigame,minigame_tile_buildname(letter-1,number-1)) == current)
90 || (pp_find_piece(minigame,minigame_tile_buildname(letter+1,number-1)) == current)
91 || (pp_find_piece(minigame,minigame_tile_buildname(letter-1,number+1)) == current)
92 ) { return true; }
93
94 return false;
95}
96
97// make a move
98void pp_move(entity minigame, entity player, string pos )
99{
100 if ( minigame.minigame_flags & PP_TURN_PLACE )
101 if ( pos && player.team == (minigame.minigame_flags & PP_TURN_TEAM) )
102 {
103 if ( pp_valid_move(minigame,pos))
104 {
105 entity existing = pp_find_piece(minigame,pos);
106
107 if(existing && existing.team != 5)
108 {
109 if(existing.team == 1)
110 ++minigame.pp_team1_score;
111 if(existing.team == 2)
112 ++minigame.pp_team2_score;
113 }
114
115 if(minigame.pp_curr_piece)
116 {
117 minigame.pp_curr_piece.cnt = 0;
118 minigame.pp_curr_piece.team = 5;
119 minigame_server_sendflags(minigame.pp_curr_piece,MINIG_SF_ALL);
120 }
121
122 if(existing)
123 {
124 strfree(existing.netname);
125 delete(existing);
126 }
127
128 entity piece = msle_spawn(minigame,new(minigame_board_piece));
129 piece.cnt = 1;
130 piece.team = player.team; // temporary
131 piece.netname = strzone(pos);
134 minigame.pp_nexteam = minigame_next_team(player.team,2);
135 minigame.pp_curr_piece = piece;
136 if ( pp_winning_piece(minigame, piece) )
137 {
138 if(minigame.pp_team1_score == minigame.pp_team2_score)
139 minigame.minigame_flags = PP_TURN_DRAW;
140 else
141 minigame.minigame_flags = PP_TURN_WIN | ((minigame.pp_team1_score > minigame.pp_team2_score) ? 1 : 2);
142 }
143 else
144 minigame.minigame_flags = PP_TURN_PLACE | minigame.pp_nexteam;
145 }
146 }
147}
148
150{
151 int i, t; // letter, number
152 for(i = 0; i < PP_LET_CNT; ++i)
153 for(t = 0; t < PP_NUM_CNT; ++t)
154 {
155 bool t2_true = ((i == 0 || i == 6) && t > 0 && t < 6);
156 bool t1_true = (i > 0 && i < 6 && (t == 0 || t == 6));
157
158 if(t1_true || t2_true)
159 {
160 entity piece = msle_spawn(minigame,new(minigame_board_piece));
161 piece.team = ((t1_true) ? 1 : 2);
162 piece.netname = strzone(minigame_tile_buildname(i,t));
165 }
166 }
167
168 minigame.pp_curr_piece = NULL;
169}
170
171// request a new match
172void pp_next_match(entity minigame, entity player)
173{
174#ifdef SVQC
175 // on multiplayer matches, wait for both players to agree
176 if ( minigame.minigame_flags & (PP_TURN_WIN|PP_TURN_DRAW) )
177 {
178 minigame.minigame_flags = PP_TURN_NEXT | player.team;
179 minigame.SendFlags |= MINIG_SF_UPDATE;
180 }
181 else if ( (minigame.minigame_flags & PP_TURN_NEXT) &&
182 !( minigame.minigame_flags & player.team ) )
183#endif
184 {
185 minigame.minigame_flags = PP_TURN_PLACE | minigame.pp_nexteam;
187 entity e = NULL;
188 while ( ( e = findfloat(e,minigame_id,minigame.minigame_id) ) )
189 if ( e.classname == "minigame_board_piece" )
190 {
191 strfree(e.netname);
192 delete(e);
193 }
194 minigame.pp_team1_score = 0;
195 minigame.pp_team2_score = 0;
196
197 pp_setup_pieces(minigame);
198 }
199}
200
201#ifdef SVQC
202
203
204// required function, handle server side events
205int pp_server_event(entity minigame, string event, ...)
206{
207 switch(event)
208 {
209 case "start":
210 {
211 minigame.minigame_flags = (PP_TURN_PLACE | PP_TURN_TEAM1);
212 pp_setup_pieces(minigame);
213 return true;
214 }
215 case "end":
216 {
217 entity e = NULL;
218 while( (e = findfloat(e, minigame_id, minigame.minigame_id)) )
219 if(e.classname == "minigame_board_piece")
220 {
221 strfree(e.netname);
222 delete(e);
223 }
224 return false;
225 }
226 case "join":
227 {
228 int pl_num = minigame_count_players(minigame);
229
230 // Don't allow more than 2 players
231 if(pl_num >= 2) { return PP_SPECTATOR_TEAM; }
232
233 // Get the right team
234 if(minigame.minigame_players)
235 return minigame_next_team(minigame.minigame_players.team, 2);
236
237 // Team 1 by default
238 return 1;
239 }
240 case "cmd":
241 {
242 entity player = ...(0,entity);
243 bool event_blocked = (player.team == PP_SPECTATOR_TEAM);
244 switch(argv(0))
245 {
246 case "move":
247 if(event_blocked)
248 return true;
249 pp_move(minigame, ...(0,entity), ...(1,int) == 2 ? argv(1) : string_null );
250 return true;
251 case "next":
252 if(event_blocked)
253 return true;
254 pp_next_match(minigame,...(0,entity));
255 return true;
256 }
257
258 return false;
259 }
260 case "network_send":
261 {
262 entity sent = ...(0,entity);
263 int sf = ...(1,int);
264 if ( sent.classname == "minigame" && (sf & MINIG_SF_UPDATE ) )
265 {
266 WriteByte(MSG_ENTITY,sent.pp_team1_score);
267 WriteByte(MSG_ENTITY,sent.pp_team2_score);
268 }
269 else if(sent.classname == "minigame_board_piece")
270 WriteByte(MSG_ENTITY,sent.cnt);
271 return false;
272 }
273 }
274
275 return false;
276}
277
278
279#elif defined(CSQC)
280
281string pp_curr_pos; // identifier of the tile under the mouse
282vector pp_boardpos; // HUD board position
283vector pp_boardsize; // HUD board size
284
285// Required function, draw the game board
286void pp_hud_board(vector pos, vector mySize)
287{
288 minigame_hud_fitsqare(pos, mySize);
289 pp_boardpos = pos;
290 pp_boardsize = mySize;
291
292 minigame_hud_simpleboard(pos,mySize,minigame_texture("pp/board"));
293
294 vector tile_size = minigame_hud_denormalize_size('1 1 0'/PP_TILE_SIZE,pos,mySize);
295 vector tile_pos;
296
297 active_minigame.pp_curr_piece = NULL;
298 entity e;
300 if(e.classname == "minigame_board_piece")
301 if(e.cnt)
302 {
303 active_minigame.pp_curr_piece = e;
304 break;
305 }
306
308 {
309 if ( e.classname == "minigame_board_piece" )
310 {
311 tile_pos = minigame_tile_pos(e.netname,PP_LET_CNT,PP_NUM_CNT);
312 tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
313
314 vector tile_color = '1 1 1';
315 switch(e.team)
316 {
317 case 1: tile_color = '1 0.3 0.3'; break;
318 case 2: tile_color = '0.3 0.3 1'; break;
319 // 3, 4 coming later?
320 }
321
322 string tile_name = strcat("pp/piece",ftos(e.team));
323 if(e.team == 5) { tile_name = "pp/piece_taken"; }
324
325 if(e == active_minigame.pp_curr_piece)
326 {
327 tile_name = "pp/piece_current";
328
329 // draw the splat too
331 minigame_texture("pp/piece_taken"),
332 tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
333 }
334
336 minigame_texture(tile_name),
337 tile_size, tile_color, panel_fg_alpha, DRAWFLAG_NORMAL );
338 }
339 }
340
341 if ( (active_minigame.minigame_flags & PP_TURN_TEAM) == minigame_self.team )
342 if ( pp_valid_move(active_minigame, pp_curr_pos) )
343 {
344 tile_pos = minigame_tile_pos(pp_curr_pos,PP_LET_CNT,PP_NUM_CNT);
345 tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
347 minigame_texture("pp/piece_current"),
348 tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
349 }
350 else if(pp_valid_tile(pp_curr_pos))
351 {
352 tile_pos = minigame_tile_pos(pp_curr_pos,PP_LET_CNT,PP_NUM_CNT);
353 tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
355 minigame_texture("pp/piece_selected"),
356 tile_size, '1 1 1', panel_fg_alpha / 2, DRAWFLAG_NORMAL );
357 }
358
359 if ( active_minigame.minigame_flags & PP_TURN_WIN )
360 {
361 vector winfs = hud_fontsize*2;
362 string pname = "";
364 if ( e.classname == "minigame_player" &&
365 e.team == (active_minigame.minigame_flags & PP_TURN_TEAM) )
366 pname = entcs_GetName(e.minigame_playerslot-1);
367
368 vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
369 vector win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
370 sprintf(_("%s^7 won the game!"), pname),
371 winfs, 0, DRAWFLAG_NORMAL, 0.5);
372
373 drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'1 1 1',0.5*panel_fg_alpha,DRAWFLAG_ADDITIVE);
374
376 sprintf(_("%s^7 won the game!"), pname),
377 winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5);
378 }
379
380 minigame_show_allspecs(pp_boardpos, pp_boardsize);
381}
382
383
384// Required function, draw the game status panel
385void pp_hud_status(vector pos, vector mySize)
386{
388 vector ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
389 hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
390
391 pos_y += ts_y;
392 mySize_y -= ts_y;
393
394 vector player_fontsize = hud_fontsize * 1.75;
395 ts_y = ( mySize_y - 2*player_fontsize_y ) / 2;
396 ts_x = mySize_x;
397 vector mypos;
398 vector tile_size = '48 48 0';
399
401 {
402 mypos = pos;
403 if ( (active_minigame.minigame_flags&PP_TURN_TEAM) == 2 )
404 mypos_y += player_fontsize_y + ts_y;
405 drawfill(mypos,eX*mySize_x+eY*player_fontsize_y,'1 1 1',0.5*panel_fg_alpha,DRAWFLAG_ADDITIVE);
406 mypos_y += player_fontsize_y;
407 drawfill(mypos,eX*mySize_x+eY*tile_size_y,'1 1 1',0.25*panel_fg_alpha,DRAWFLAG_ADDITIVE);
408 }
409
410 entity e;
412 {
413 if ( e.classname == "minigame_player" && e.team != PP_SPECTATOR_TEAM )
414 {
415 vector tile_color = '1 1 1';
416 switch(e.team)
417 {
418 case 1: tile_color = '1 0.3 0.3'; break;
419 case 2: tile_color = '0.3 0.3 1'; break;
420 // 3, 4 coming later?
421 }
422
423 mypos = pos;
424 if ( e.team == 2 )
425 mypos_y += player_fontsize_y + ts_y;
427 entcs_GetName(e.minigame_playerslot-1),
428 player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
429
430 mypos_y += player_fontsize_y;
431 drawpic( mypos,
432 minigame_texture(strcat("pp/piece",ftos(e.team))),
433 tile_size, tile_color, panel_fg_alpha, DRAWFLAG_NORMAL );
434
435 mypos_x += tile_size_x;
436 int myscore = 0;
437 if(e.team == 1) { myscore = active_minigame.pp_team1_score; }
438 if(e.team == 2) { myscore = active_minigame.pp_team2_score; }
439
440 drawstring(mypos,ftos(myscore),tile_size,
441 '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
442 }
443 }
444}
445
446// Turn a set of flags into a help message
447string pp_turn_to_string(int turnflags)
448{
450 return _("You are spectating");
451
452 if ( turnflags & PP_TURN_DRAW )
453 return _("Draw");
454
455 if ( turnflags & PP_TURN_WIN )
456 {
457 // translator-friendly messages composed of 2 existing messages
458 if ( (turnflags & PP_TURN_TEAM) != minigame_self.team )
459 return strcat(_("You lost the game!"), "\n", _("Select \"^1Next Match^7\" on the menu for a rematch!"));
460 return strcat(_("You win!"), "\n", _("Select \"^1Next Match^7\" on the menu to start a new match!"));
461 }
462
463 if ( turnflags & PP_TURN_NEXT )
464 {
465 if ( (turnflags&PP_TURN_TEAM) != minigame_self.team )
466 return _("Select \"^1Next Match^7\" on the menu to start a new match!");
467 return _("Wait for your opponent to confirm the rematch");
468 }
469
470 if ( (turnflags & PP_TURN_TEAM) != minigame_self.team )
471 return _("Wait for your opponent to make their move");
472
473 if ( turnflags & PP_TURN_PLACE )
474 return _("Click on the game board to place your piece");
475
476 return "";
477}
478
479// Make the correct move
480void pp_make_move(entity minigame)
481{
482 if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
483 {
484 minigame_cmd("move ",pp_curr_pos);
485 }
486}
487
488void pp_set_curr_pos(string s)
489{
490 strfree(pp_curr_pos);
491 if ( s )
492 s = strzone(s);
493 pp_curr_pos = s;
494}
495
496// Required function, handle client events
497int pp_client_event(entity minigame, string event, ...)
498{
499 switch(event)
500 {
501 case "activate":
502 {
503 pp_set_curr_pos("");
504 strcpy(minigame.message, pp_turn_to_string(minigame.minigame_flags));
505 return false;
506 }
507 case "deactivate":
508 {
509 strfree(minigame.message);
510 return false;
511 }
512 case "key_pressed":
513 case "key_released":
514 {
515 bool event_blocked = ((event == "key_released")
516 || ((minigame.minigame_flags & PP_TURN_TEAM) != minigame_self.team));
517 if (!(minigame.minigame_flags & (PP_TURN_WIN | PP_TURN_DRAW)))
518 {
519 switch ( ...(0,int) )
520 {
521 case K_RIGHTARROW:
522 case K_KP_RIGHTARROW:
523 if (event_blocked)
524 return true;
525 if ( ! pp_curr_pos )
526 pp_set_curr_pos("a3");
527 else
528 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,1,0,PP_LET_CNT,PP_NUM_CNT));
529 return true;
530 case K_LEFTARROW:
531 case K_KP_LEFTARROW:
532 if (event_blocked)
533 return true;
534 if ( ! pp_curr_pos )
535 pp_set_curr_pos("c3");
536 else
537 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,-1,0,PP_LET_CNT,PP_NUM_CNT));
538 return true;
539 case K_UPARROW:
540 case K_KP_UPARROW:
541 if (event_blocked)
542 return true;
543 if ( ! pp_curr_pos )
544 pp_set_curr_pos("a1");
545 else
546 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,0,1,PP_LET_CNT,PP_NUM_CNT));
547 return true;
548 case K_DOWNARROW:
549 case K_KP_DOWNARROW:
550 if (event_blocked)
551 return true;
552 if ( ! pp_curr_pos )
553 pp_set_curr_pos("a3");
554 else
555 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,0,-1,PP_LET_CNT,PP_NUM_CNT));
556 return true;
557 case K_ENTER:
558 case K_KP_ENTER:
559 case K_SPACE:
560 if (event_blocked)
561 return true;
562 pp_make_move(minigame);
563 return true;
564 }
565 }
566
567 return false;
568 }
569 case "mouse_pressed":
570 {
571 if(...(0,int) == K_MOUSE1)
572 {
573 pp_client_event(minigame, "mouse_moved");
574 pp_make_move(minigame);
575 return true;
576 }
577
578 return false;
579 }
580 case "mouse_moved":
581 {
582 vector mouse_pos = minigame_hud_normalize(mousepos,pp_boardpos,pp_boardsize);
583 if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
584 pp_set_curr_pos(minigame_tile_name(mouse_pos,PP_LET_CNT,PP_NUM_CNT));
585 if ( ! pp_valid_tile(pp_curr_pos) )
586 pp_set_curr_pos("");
587
588 return true;
589 }
590 case "network_receive":
591 {
592 entity sent = ...(0,entity);
593 int sf = ...(1,int);
594 if ( sent.classname == "minigame" )
595 {
596 if ( sf & MINIG_SF_UPDATE )
597 {
598 strcpy(sent.message, pp_turn_to_string(sent.minigame_flags));
599 if ( sent.minigame_flags & minigame_self.team )
601 sent.pp_team1_score = ReadByte();
602 sent.pp_team2_score = ReadByte();
603 }
604 }
605 else if(sent.classname == "minigame_board_piece")
606 {
607 sent.cnt = ReadByte();
608 if(sent.cnt)
609 minigame.pp_curr_piece = sent;
610 }
611
612 return false;
613 }
614 case "menu_show":
615 {
616 HUD_MinigameMenu_CustomEntry(...(0,entity),_("Next Match"),"next");
617 return false;
618 }
619 case "menu_click":
620 {
621 if(...(0,string) == "next")
622 minigame_cmd("next");
623 return false;
624 }
625 }
626
627 return false;
628}
629
630#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void minigame_drawcolorcodedstring_trunc(float maxwidth, vector pos, string text, vector fontsize, float theAlpha, int drawflags)
void minigame_show_allspecs(vector boardpos, vector boardsize)
void minigame_prompt()
vector minigame_drawstring_wrapped(float maxwidth, vector pos, string text, vector fontsize, vector color, float theAlpha, int drawflags, float align)
void minigame_hud_simpleboard(vector pos, vector mySize, string board_texture)
string minigame_texture(string name)
vector minigame_hud_denormalize_size(vector v, vector pos, vector mySize)
vector minigame_drawcolorcodedstring_wrapped(float maxwidth, vector pos, string text, vector fontsize, float theAlpha, int drawflags, float align)
vector minigame_hud_denormalize(vector v, vector pos, vector mySize)
vector minigame_hud_normalize(vector v, vector pos, vector mySize)
void minigame_drawpic_centered(vector pos, string texture, vector sz, vector color, float thealpha, int drawflags)
#define REGISTER_MINIGAME(name, nicename)
entity minigame_self
entity active_minigame
#define minigame_hud_fitsqare(pos, mySize)
#define minigame_cmd(...)
#define FOREACH_MINIGAME_ENTITY(entityvar)
void HUD_MinigameMenu_CustomEntry(entity parent, string menumessage, string event_arg)
#define drawstring(position, text, scale, rgb, alpha, flag)
Definition draw.qh:27
#define drawpic(position, pic, size, rgb, alpha, flag)
Definition draw.qh:21
#define drawfill(position, size, rgb, alpha, flag)
Definition draw.qh:36
float cnt
Definition powerups.qc:24
vector hud_fontsize
Definition main.qh:77
int team
Definition main.qh:188
const float DRAWFLAG_NORMAL
const float DRAWFLAG_ADDITIVE
WriteByte(chan, ent.angles.y/DEC_FACTOR)
string entcs_GetName(int i)
Definition ent_cs.qh:148
float panel_fg_alpha
Definition hud.qh:169
#define HUD_Panel_DrawBg()
Definition hud.qh:55
vector mousepos
Definition hud.qh:103
float K_KP_RIGHTARROW
Definition keycodes.qc:60
float K_UPARROW
Definition keycodes.qc:15
float K_DOWNARROW
Definition keycodes.qc:16
float K_MOUSE1
Definition keycodes.qc:129
float K_RIGHTARROW
Definition keycodes.qc:18
float K_KP_UPARROW
Definition keycodes.qc:64
float K_SPACE
Definition keycodes.qc:10
float K_KP_LEFTARROW
Definition keycodes.qc:57
float K_ENTER
Definition keycodes.qc:8
float K_KP_DOWNARROW
Definition keycodes.qc:53
float K_LEFTARROW
Definition keycodes.qc:17
float K_KP_ENTER
Definition keycodes.qc:74
#define int
Definition _all.inc:20
const int MSG_ENTITY
Definition net.qh:156
int ReadByte()
string ftos(float f)
string strzone(string s)
string argv(float n)
entity findfloat(entity start,.float field, float match)
entity msle_spawn(entity minigame_session, entity e)
Definition minigames.qc:96
string minigame_relative_tile(string start_id, int dx, int dy, int rows, int columns)
Definition minigames.qc:49
void minigame_server_sendflags(entity ent, int mgflags)
Definition minigames.qc:87
int minigame_count_players(entity minigame)
Definition minigames.qc:132
int minigame_next_team(int curr_team, int n_teams)
Definition minigames.qc:74
int minigame_tile_letter(string id)
Definition minigames.qc:21
string minigame_tile_name(vector pos, int rows, int columns)
Definition minigames.qc:63
vector minigame_tile_pos(string id, int rows, int columns)
Definition minigames.qc:36
string minigame_tile_buildname(int letter, int number)
Definition minigames.qc:43
int minigame_tile_number(string id)
Definition minigames.qc:30
int minigame_id
Unique ID for the minigame session, associated with all objects currently the result of etof(minigame...
Definition minigames.qh:49
const int MINIG_SF_UPDATE
Definition minigames.qh:113
const int MINIG_SF_ALL
Definition minigames.qh:116
string string_null
Definition nil.qh:9
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define NULL
Definition post.qh:14
entity pp_find_piece(entity minig, string tile)
Definition pp.qc:31
const int PP_TURN_TYPE
Definition pp.qc:8
const int PP_SPECTATOR_TEAM
Definition pp.qc:14
const int PP_TURN_PLACE
Definition pp.qc:4
entity pp_curr_piece
Definition pp.qc:28
int pp_team1_score
Definition pp.qc:23
const int PP_TURN_DRAW
Definition pp.qc:6
bool pp_winning_piece(entity minigame, entity piece)
Definition pp.qc:51
bool pp_valid_move(entity minigame, string pos)
Definition pp.qc:70
const int PP_TURN_WIN
Definition pp.qc:5
const int PP_TURN_TEAM1
Definition pp.qc:10
int pp_team2_score
Definition pp.qc:24
const int PP_LET_CNT
Definition pp.qc:16
void pp_setup_pieces(entity minigame)
Definition pp.qc:149
const int PP_NUM_CNT
Definition pp.qc:17
int pp_nexteam
Definition pp.qc:26
void pp_next_match(entity minigame, entity player)
Definition pp.qc:172
void pp_move(entity minigame, entity player, string pos)
Definition pp.qc:98
int pp_server_event(entity minigame, string event,...)
Definition pp.qc:205
const int PP_TILE_SIZE
Definition pp.qc:19
const int PP_TURN_TEAM
Definition pp.qc:12
const int PP_TURN_NEXT
Definition pp.qc:7
const int PP_TURN_TEAM2
Definition pp.qc:11
bool pp_valid_tile(string tile)
Definition pp.qc:41
vector
Definition self.qh:96
int int number
Definition impulse.qc:89
#define strfree(this)
Definition string.qh:57
#define strcpy(this, s)
Definition string.qh:51
const vector eY
Definition vector.qh:44
const vector eX
Definition vector.qh:43