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 = findentity(e,owner,minig) ) )
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
52{
53 int number = minigame_tile_number(piece.netname);
54 int letter = minigame_tile_letter(piece.netname);
55
56 // here goes
61 if(!pp_valid_tile(minigame_tile_buildname(letter+1,number+1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number+1)).team == 5)
62 if(!pp_valid_tile(minigame_tile_buildname(letter-1,number-1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number-1)).team == 5)
63 if(!pp_valid_tile(minigame_tile_buildname(letter+1,number-1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number-1)).team == 5)
64 if(!pp_valid_tile(minigame_tile_buildname(letter-1,number+1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number+1)).team == 5)
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(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 = findentity(e,owner,minigame) ) )
189 if ( e.classname == "minigame_board_piece" )
190 delete(e);
191 minigame.pp_team1_score = 0;
192 minigame.pp_team2_score = 0;
193
194 pp_setup_pieces(minigame);
195 }
196}
197
198#ifdef SVQC
199
200
201// required function, handle server side events
202int pp_server_event(entity minigame, string event, ...)
203{
204 switch(event)
205 {
206 case "start":
207 {
208 minigame.minigame_flags = (PP_TURN_PLACE | PP_TURN_TEAM1);
209 pp_setup_pieces(minigame);
210 return true;
211 }
212 case "end":
213 {
214 entity e = NULL;
215 while( (e = findentity(e, owner, minigame)) )
216 if(e.classname == "minigame_board_piece")
217 {
218 strfree(e.netname);
219 delete(e);
220 }
221 return false;
222 }
223 case "join":
224 {
225 int pl_num = minigame_count_players(minigame);
226
227 // Don't allow more than 2 players
228 if(pl_num >= 2) { return PP_SPECTATOR_TEAM; }
229
230 // Get the right team
231 if(minigame.minigame_players)
232 return minigame_next_team(minigame.minigame_players.team, 2);
233
234 // Team 1 by default
235 return 1;
236 }
237 case "cmd":
238 {
239 entity player = ...(0,entity);
240 bool event_blocked = (player.team == PP_SPECTATOR_TEAM);
241 switch(argv(0))
242 {
243 case "move":
244 if(event_blocked)
245 return true;
246 pp_move(minigame, ...(0,entity), ...(1,int) == 2 ? argv(1) : string_null );
247 return true;
248 case "next":
249 if(event_blocked)
250 return true;
251 pp_next_match(minigame,...(0,entity));
252 return true;
253 }
254
255 return false;
256 }
257 case "network_send":
258 {
259 entity sent = ...(0,entity);
260 int sf = ...(1,int);
261 if ( sent.classname == "minigame" && (sf & MINIG_SF_UPDATE ) )
262 {
263 WriteByte(MSG_ENTITY,sent.pp_team1_score);
264 WriteByte(MSG_ENTITY,sent.pp_team2_score);
265 }
266 else if(sent.classname == "minigame_board_piece")
267 WriteByte(MSG_ENTITY,sent.cnt);
268 return false;
269 }
270 }
271
272 return false;
273}
274
275
276#elif defined(CSQC)
277
278string pp_curr_pos; // identifier of the tile under the mouse
279vector pp_boardpos; // HUD board position
280vector pp_boardsize; // HUD board size
281
282// Required function, draw the game board
283void pp_hud_board(vector pos, vector mySize)
284{
285 minigame_hud_fitsqare(pos, mySize);
286 pp_boardpos = pos;
287 pp_boardsize = mySize;
288
289 minigame_hud_simpleboard(pos,mySize,minigame_texture("pp/board"));
290
291 vector tile_size = minigame_hud_denormalize_size('1 1 0'/PP_TILE_SIZE,pos,mySize);
292 vector tile_pos;
293
294 active_minigame.pp_curr_piece = NULL;
295 entity e;
297 if(e.classname == "minigame_board_piece")
298 if(e.cnt)
299 {
300 active_minigame.pp_curr_piece = e;
301 break;
302 }
303
305 {
306 if ( e.classname == "minigame_board_piece" )
307 {
308 tile_pos = minigame_tile_pos(e.netname,PP_LET_CNT,PP_NUM_CNT);
309 tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
310
311 vector tile_color = '1 1 1';
312 switch(e.team)
313 {
314 case 1: tile_color = '1 0.3 0.3'; break;
315 case 2: tile_color = '0.3 0.3 1'; break;
316 // 3, 4 coming later?
317 }
318
319 string tile_name = strcat("pp/piece",ftos(e.team));
320 if(e.team == 5) { tile_name = "pp/piece_taken"; }
321
322 if(e == active_minigame.pp_curr_piece)
323 {
324 tile_name = "pp/piece_current";
325
326 // draw the splat too
328 minigame_texture("pp/piece_taken"),
329 tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
330 }
331
333 minigame_texture(tile_name),
334 tile_size, tile_color, panel_fg_alpha, DRAWFLAG_NORMAL );
335 }
336 }
337
338 if ( (active_minigame.minigame_flags & PP_TURN_TEAM) == minigame_self.team )
339 if ( pp_valid_move(active_minigame, pp_curr_pos) )
340 {
341 tile_pos = minigame_tile_pos(pp_curr_pos,PP_LET_CNT,PP_NUM_CNT);
342 tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
344 minigame_texture("pp/piece_current"),
345 tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
346 }
347 else if(pp_valid_tile(pp_curr_pos))
348 {
349 tile_pos = minigame_tile_pos(pp_curr_pos,PP_LET_CNT,PP_NUM_CNT);
350 tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
352 minigame_texture("pp/piece_selected"),
353 tile_size, '1 1 1', panel_fg_alpha / 2, DRAWFLAG_NORMAL );
354 }
355
356 if ( active_minigame.minigame_flags & PP_TURN_WIN )
357 {
358 vector winfs = hud_fontsize*2;
359 string pname = "";
361 if ( e.classname == "minigame_player" &&
362 e.team == (active_minigame.minigame_flags & PP_TURN_TEAM) )
363 pname = entcs_GetName(e.minigame_playerslot-1);
364
365 vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
366 vector win_sz;
367 win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
368 sprintf(_("%s^7 won the game!"), pname),
369 winfs, 0, DRAWFLAG_NORMAL, 0.5);
370
371 drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'1 1 1',0.5*panel_fg_alpha,DRAWFLAG_ADDITIVE);
372
374 sprintf(_("%s^7 won the game!"), pname),
375 winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5);
376 }
377
378 minigame_show_allspecs(pp_boardpos, pp_boardsize);
379}
380
381
382// Required function, draw the game status panel
383void pp_hud_status(vector pos, vector mySize)
384{
386 vector ts;
387 ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
388 hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
389
390 pos_y += ts_y;
391 mySize_y -= ts_y;
392
393 vector player_fontsize = hud_fontsize * 1.75;
394 ts_y = ( mySize_y - 2*player_fontsize_y ) / 2;
395 ts_x = mySize_x;
396 vector mypos;
397 vector tile_size = '48 48 0';
398
400 {
401 mypos = pos;
402 if ( (active_minigame.minigame_flags&PP_TURN_TEAM) == 2 )
403 mypos_y += player_fontsize_y + ts_y;
404 drawfill(mypos,eX*mySize_x+eY*player_fontsize_y,'1 1 1',0.5*panel_fg_alpha,DRAWFLAG_ADDITIVE);
405 mypos_y += player_fontsize_y;
406 drawfill(mypos,eX*mySize_x+eY*tile_size_y,'1 1 1',0.25*panel_fg_alpha,DRAWFLAG_ADDITIVE);
407 }
408
409 entity e;
411 {
412 if ( e.classname == "minigame_player" && e.team != PP_SPECTATOR_TEAM )
413 {
414 vector tile_color = '1 1 1';
415 switch(e.team)
416 {
417 case 1: tile_color = '1 0.3 0.3'; break;
418 case 2: tile_color = '0.3 0.3 1'; break;
419 // 3, 4 coming later?
420 }
421
422 mypos = pos;
423 if ( e.team == 2 )
424 mypos_y += player_fontsize_y + ts_y;
426 entcs_GetName(e.minigame_playerslot-1),
427 player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
428
429 mypos_y += player_fontsize_y;
430 drawpic( mypos,
431 minigame_texture(strcat("pp/piece",ftos(e.team))),
432 tile_size, tile_color, panel_fg_alpha, DRAWFLAG_NORMAL );
433
434 mypos_x += tile_size_x;
435 int myscore = 0;
436 if(e.team == 1) { myscore = active_minigame.pp_team1_score; }
437 if(e.team == 2) { myscore = active_minigame.pp_team2_score; }
438
439 drawstring(mypos,ftos(myscore),tile_size,
440 '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
441 }
442 }
443}
444
445// Turn a set of flags into a help message
446string pp_turn_to_string(int turnflags)
447{
449 return _("You are spectating");
450
451 if ( turnflags & PP_TURN_DRAW )
452 return _("Draw");
453
454 if ( turnflags & PP_TURN_WIN )
455 {
456 // translator-friendly messages composed of 2 existing messages
457 if ( (turnflags & PP_TURN_TEAM) != minigame_self.team )
458 return strcat(_("You lost the game!"), "\n", _("Select \"^1Next Match^7\" on the menu for a rematch!"));
459 return strcat(_("You win!"), "\n", _("Select \"^1Next Match^7\" on the menu to start a new match!"));
460 }
461
462 if ( turnflags & PP_TURN_NEXT )
463 {
464 if ( (turnflags&PP_TURN_TEAM) != minigame_self.team )
465 return _("Select \"^1Next Match^7\" on the menu to start a new match!");
466 return _("Wait for your opponent to confirm the rematch");
467 }
468
469 if ( (turnflags & PP_TURN_TEAM) != minigame_self.team )
470 return _("Wait for your opponent to make their move");
471
472 if ( turnflags & PP_TURN_PLACE )
473 return _("Click on the game board to place your piece");
474
475 return "";
476}
477
478// Make the correct move
479void pp_make_move(entity minigame)
480{
481 if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
482 {
483 minigame_cmd("move ",pp_curr_pos);
484 }
485}
486
487void pp_set_curr_pos(string s)
488{
489 strfree(pp_curr_pos);
490 if ( s )
491 s = strzone(s);
492 pp_curr_pos = s;
493}
494
495// Required function, handle client events
496int pp_client_event(entity minigame, string event, ...)
497{
498 switch(event)
499 {
500 case "activate":
501 {
502 pp_set_curr_pos("");
503 strcpy(minigame.message, pp_turn_to_string(minigame.minigame_flags));
504 return false;
505 }
506 case "deactivate":
507 {
508 strfree(minigame.message);
509 return false;
510 }
511 case "key_pressed":
512 case "key_released":
513 {
514 bool event_blocked = ((event == "key_released")
515 || ((minigame.minigame_flags & PP_TURN_TEAM) != minigame_self.team));
516 if (!(minigame.minigame_flags & (PP_TURN_WIN | PP_TURN_DRAW)))
517 {
518 switch ( ...(0,int) )
519 {
520 case K_RIGHTARROW:
521 case K_KP_RIGHTARROW:
522 if (event_blocked)
523 return true;
524 if ( ! pp_curr_pos )
525 pp_set_curr_pos("a3");
526 else
527 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,1,0,PP_LET_CNT,PP_NUM_CNT));
528 return true;
529 case K_LEFTARROW:
530 case K_KP_LEFTARROW:
531 if (event_blocked)
532 return true;
533 if ( ! pp_curr_pos )
534 pp_set_curr_pos("c3");
535 else
536 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,-1,0,PP_LET_CNT,PP_NUM_CNT));
537 return true;
538 case K_UPARROW:
539 case K_KP_UPARROW:
540 if (event_blocked)
541 return true;
542 if ( ! pp_curr_pos )
543 pp_set_curr_pos("a1");
544 else
545 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,0,1,PP_LET_CNT,PP_NUM_CNT));
546 return true;
547 case K_DOWNARROW:
548 case K_KP_DOWNARROW:
549 if (event_blocked)
550 return true;
551 if ( ! pp_curr_pos )
552 pp_set_curr_pos("a3");
553 else
554 pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,0,-1,PP_LET_CNT,PP_NUM_CNT));
555 return true;
556 case K_ENTER:
557 case K_KP_ENTER:
558 case K_SPACE:
559 if (event_blocked)
560 return true;
561 pp_make_move(minigame);
562 return true;
563 }
564 }
565
566 return false;
567 }
568 case "mouse_pressed":
569 {
570 if(...(0,int) == K_MOUSE1)
571 {
572 pp_client_event(minigame, "mouse_moved");
573 pp_make_move(minigame);
574 return true;
575 }
576
577 return false;
578 }
579 case "mouse_moved":
580 {
581 vector mouse_pos = minigame_hud_normalize(mousepos,pp_boardpos,pp_boardsize);
582 if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
583 pp_set_curr_pos(minigame_tile_name(mouse_pos,PP_LET_CNT,PP_NUM_CNT));
584 if ( ! pp_valid_tile(pp_curr_pos) )
585 pp_set_curr_pos("");
586
587 return true;
588 }
589 case "network_receive":
590 {
591 entity sent = ...(0,entity);
592 int sf = ...(1,int);
593 if ( sent.classname == "minigame" )
594 {
595 if ( sf & MINIG_SF_UPDATE )
596 {
597 strcpy(sent.message, pp_turn_to_string(sent.minigame_flags));
598 if ( sent.minigame_flags & minigame_self.team )
600 sent.pp_team1_score = ReadByte();
601 sent.pp_team2_score = ReadByte();
602 }
603 }
604 else if(sent.classname == "minigame_board_piece")
605 {
606 sent.cnt = ReadByte();
607 if(sent.cnt)
608 minigame.pp_curr_piece = sent;
609 }
610
611 return false;
612 }
613 case "menu_show":
614 {
615 HUD_MinigameMenu_CustomEntry(...(0,entity),_("Next Match"),"next");
616 return false;
617 }
618 case "menu_click":
619 {
620 if(...(0,string) == "next")
621 minigame_cmd("next");
622 return false;
623 }
624 }
625
626 return false;
627}
628
629#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
entity owner
Definition main.qh:87
int team
Definition main.qh:188
const float DRAWFLAG_NORMAL
const float DRAWFLAG_ADDITIVE
string entcs_GetName(int i)
Definition ent_cs.qh:151
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:115
int ReadByte()
entity findentity(entity start,.entity field, entity match)
string ftos(float f)
void WriteByte(float data, float dest, float desto)
string strzone(string s)
string argv(float n)
entity msle_spawn(entity minigame_session, entity e)
Definition minigames.qc:87
string minigame_relative_tile(string start_id, int dx, int dy, int rows, int columns)
Definition minigames.qc:40
void minigame_server_sendflags(entity ent, int mgflags)
Definition minigames.qc:78
int minigame_count_players(entity minigame)
Definition minigames.qc:121
int minigame_next_team(int curr_team, int n_teams)
Definition minigames.qc:65
int minigame_tile_letter(string id)
Definition minigames.qc:12
string minigame_tile_name(vector pos, int rows, int columns)
Definition minigames.qc:54
vector minigame_tile_pos(string id, int rows, int columns)
Definition minigames.qc:27
string minigame_tile_buildname(int letter, int number)
Definition minigames.qc:34
int minigame_tile_number(string id)
Definition minigames.qc:21
const int MINIG_SF_UPDATE
Definition minigames.qh:109
const int MINIG_SF_ALL
Definition minigames.qh:112
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_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
bool pp_winning_piece(entity piece)
Definition pp.qc:51
int pp_server_event(entity minigame, string event,...)
Definition pp.qc:202
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:92
int int number
Definition impulse.qc:89
#define strfree(this)
Definition string.qh:59
#define strcpy(this, s)
Definition string.qh:52
const vector eY
Definition vector.qh:45
const vector eX
Definition vector.qh:44