Xonotic
pp.qc
Go to the documentation of this file.
1 #include "pp.qh"
2 REGISTER_MINIGAME(pp, _("Push-Pull"));
3 
4 const int PP_TURN_PLACE = 0x0100; // player has to place a piece on the board
5 const int PP_TURN_WIN = 0x0200; // player has won
6 const int PP_TURN_DRAW = 0x0400; // players have equal scores
7 const int PP_TURN_NEXT = 0x0800; // a player wants to start a new match
8 const int PP_TURN_TYPE = 0x0f00; // turn type mask
9 
10 const int PP_TURN_TEAM1 = 0x0001;
11 const int PP_TURN_TEAM2 = 0x0002;
12 const int PP_TURN_TEAM = 0x000f; // turn team mask
13 
14 const int PP_SPECTATOR_TEAM = 255; // must be above max teams and equal to or below 255
15 
16 const int PP_LET_CNT = 7;
17 const int PP_NUM_CNT = 7;
18 
19 const 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
31 entity 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)
41 bool 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
57  if(!pp_valid_tile(minigame_tile_buildname(letter-1,number)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter-1,number)).team == 5)
58  if(!pp_valid_tile(minigame_tile_buildname(letter+1,number)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter+1,number)).team == 5)
59  if(!pp_valid_tile(minigame_tile_buildname(letter,number-1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter,number-1)).team == 5)
60  if(!pp_valid_tile(minigame_tile_buildname(letter,number+1)) || pp_find_piece(piece.owner,minigame_tile_buildname(letter,number+1)).team == 5)
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 
70 bool 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 
81  int number = minigame_tile_number(pos);
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
98 void 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 
149 void pp_setup_pieces(entity minigame)
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
172 void 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
202 int 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 
278 string pp_curr_pos; // identifier of the tile under the mouse
279 vector pp_boardpos; // HUD board position
280 vector pp_boardsize; // HUD board size
281 
282 // Required function, draw the game board
283 void 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
327  minigame_drawpic_centered( tile_pos,
328  minigame_texture("pp/piece_taken"),
329  tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
330  }
331 
332  minigame_drawpic_centered( tile_pos,
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);
343  minigame_drawpic_centered( tile_pos,
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);
351  minigame_drawpic_centered( tile_pos,
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,DRAWFLAG_ADDITIVE);
372 
373  minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
374  sprintf(_("%s^7 won the game!"), pname),
375  winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5);
376  }
377 }
378 
379 
380 // Required function, draw the game status panel
381 void pp_hud_status(vector pos, vector mySize)
382 {
384  vector ts;
385  ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
386  hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
387 
388  pos_y += ts_y;
389  mySize_y -= ts_y;
390 
391  vector player_fontsize = hud_fontsize * 1.75;
392  ts_y = ( mySize_y - 2*player_fontsize_y ) / 2;
393  ts_x = mySize_x;
394  vector mypos;
395  vector tile_size = '48 48 0';
396 
397  if(minigame_self.team != PP_SPECTATOR_TEAM)
398  {
399  mypos = pos;
400  if ( (active_minigame.minigame_flags&PP_TURN_TEAM) == 2 )
401  mypos_y += player_fontsize_y + ts_y;
402  drawfill(mypos,eX*mySize_x+eY*player_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE);
403  mypos_y += player_fontsize_y;
404  drawfill(mypos,eX*mySize_x+eY*tile_size_y,'1 1 1',0.25,DRAWFLAG_ADDITIVE);
405  }
406 
407  entity e;
409  {
410  if ( e.classname == "minigame_player" && e.team != PP_SPECTATOR_TEAM )
411  {
412  vector tile_color = '1 1 1';
413  switch(e.team)
414  {
415  case 1: tile_color = '1 0.3 0.3'; break;
416  case 2: tile_color = '0.3 0.3 1'; break;
417  // 3, 4 coming later?
418  }
419 
420  mypos = pos;
421  if ( e.team == 2 )
422  mypos_y += player_fontsize_y + ts_y;
424  entcs_GetName(e.minigame_playerslot-1),
425  player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
426 
427  mypos_y += player_fontsize_y;
428  drawpic( mypos,
429  minigame_texture(strcat("pp/piece",ftos(e.team))),
430  tile_size, tile_color, panel_fg_alpha, DRAWFLAG_NORMAL );
431 
432  mypos_x += tile_size_x;
433  int myscore = 0;
434  if(e.team == 1) { myscore = active_minigame.pp_team1_score; }
435  if(e.team == 2) { myscore = active_minigame.pp_team2_score; }
436 
437  drawstring(mypos,ftos(myscore),tile_size,
438  '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
439  }
440  }
441 }
442 
443 // Turn a set of flags into a help message
444 string pp_turn_to_string(int turnflags)
445 {
446  if(minigame_self.team == PP_SPECTATOR_TEAM)
447  return _("You are spectating");
448 
449  if ( turnflags & PP_TURN_DRAW )
450  return _("Draw");
451 
452  if ( turnflags & PP_TURN_WIN )
453  {
454  // translator-friendly messages composed of 2 existing messages
455  if ( (turnflags&PP_TURN_TEAM) != minigame_self.team )
456  return strcat(_("You lost the game!"), "\n", _("Select \"^1Next Match^7\" on the menu for a rematch!"));
457  return strcat(_("You win!"), "\n", _("Select \"^1Next Match^7\" on the menu to start a new match!"));
458  }
459 
460  if ( turnflags & PP_TURN_NEXT )
461  {
462  if ( (turnflags&PP_TURN_TEAM) != minigame_self.team )
463  return _("Select \"^1Next Match^7\" on the menu to start a new match!");
464  return _("Wait for your opponent to confirm the rematch");
465  }
466 
467  if ( (turnflags & PP_TURN_TEAM) != minigame_self.team )
468  return _("Wait for your opponent to make their move");
469 
470  if ( turnflags & PP_TURN_PLACE )
471  return _("Click on the game board to place your piece");
472 
473  return "";
474 }
475 
476 // Make the correct move
477 void pp_make_move(entity minigame)
478 {
479  if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
480  {
481  minigame_cmd("move ",pp_curr_pos);
482  }
483 }
484 
485 void pp_set_curr_pos(string s)
486 {
487  strfree(pp_curr_pos);
488  if ( s )
489  s = strzone(s);
490  pp_curr_pos = s;
491 }
492 
493 // Required function, handle client events
494 int pp_client_event(entity minigame, string event, ...)
495 {
496  switch(event)
497  {
498  case "activate":
499  {
500  pp_set_curr_pos("");
501  strcpy(minigame.message, pp_turn_to_string(minigame.minigame_flags));
502  return false;
503  }
504  case "deactivate":
505  {
506  strfree(minigame.message);
507  return false;
508  }
509  case "key_pressed":
510  case "key_released":
511  {
512  bool event_blocked = ((event == "key_released")
513  || ((minigame.minigame_flags & PP_TURN_TEAM) != minigame_self.team));
514  if (!(minigame.minigame_flags & PP_TURN_WIN) && !(minigame.minigame_flags & PP_TURN_DRAW))
515  {
516  switch ( ...(0,int) )
517  {
518  case K_RIGHTARROW:
519  case K_KP_RIGHTARROW:
520  if (event_blocked)
521  return true;
522  if ( ! pp_curr_pos )
523  pp_set_curr_pos("a3");
524  else
525  pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,1,0,PP_LET_CNT,PP_NUM_CNT));
526  return true;
527  case K_LEFTARROW:
528  case K_KP_LEFTARROW:
529  if (event_blocked)
530  return true;
531  if ( ! pp_curr_pos )
532  pp_set_curr_pos("c3");
533  else
534  pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,-1,0,PP_LET_CNT,PP_NUM_CNT));
535  return true;
536  case K_UPARROW:
537  case K_KP_UPARROW:
538  if (event_blocked)
539  return true;
540  if ( ! pp_curr_pos )
541  pp_set_curr_pos("a1");
542  else
543  pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,0,1,PP_LET_CNT,PP_NUM_CNT));
544  return true;
545  case K_DOWNARROW:
546  case K_KP_DOWNARROW:
547  if (event_blocked)
548  return true;
549  if ( ! pp_curr_pos )
550  pp_set_curr_pos("a3");
551  else
552  pp_set_curr_pos(minigame_relative_tile(pp_curr_pos,0,-1,PP_LET_CNT,PP_NUM_CNT));
553  return true;
554  case K_ENTER:
555  case K_KP_ENTER:
556  case K_SPACE:
557  if (event_blocked)
558  return true;
559  pp_make_move(minigame);
560  return true;
561  }
562  }
563 
564  return false;
565  }
566  case "mouse_pressed":
567  {
568  if(...(0,int) == K_MOUSE1)
569  {
570  pp_client_event(minigame, "mouse_moved");
571  pp_make_move(minigame);
572  return true;
573  }
574 
575  return false;
576  }
577  case "mouse_moved":
578  {
579  vector mouse_pos = minigame_hud_normalize(mousepos,pp_boardpos,pp_boardsize);
580  if ( minigame.minigame_flags == (PP_TURN_PLACE|minigame_self.team) )
581  pp_set_curr_pos(minigame_tile_name(mouse_pos,PP_LET_CNT,PP_NUM_CNT));
582  if ( ! pp_valid_tile(pp_curr_pos) )
583  pp_set_curr_pos("");
584 
585  return true;
586  }
587  case "network_receive":
588  {
589  entity sent = ...(0,entity);
590  int sf = ...(1,int);
591  if ( sent.classname == "minigame" )
592  {
593  if ( sf & MINIG_SF_UPDATE )
594  {
595  strcpy(sent.message, pp_turn_to_string(sent.minigame_flags));
596  if ( sent.minigame_flags & minigame_self.team )
597  minigame_prompt();
598  sent.pp_team1_score = ReadByte();
599  sent.pp_team2_score = ReadByte();
600  }
601  }
602  else if(sent.classname == "minigame_board_piece")
603  {
604  sent.cnt = ReadByte();
605  if(sent.cnt)
606  minigame.pp_curr_piece = sent;
607  }
608 
609  return false;
610  }
611  case "menu_show":
612  {
613  HUD_MinigameMenu_CustomEntry(...(0,entity),_("Next Match"),"next");
614  return false;
615  }
616  case "menu_click":
617  {
618  if(...(0,string) == "next")
619  minigame_cmd("next");
620  return false;
621  }
622  }
623 
624  return false;
625 }
626 
627 #endif
float K_KP_RIGHTARROW
Definition: keycodes.qc:60
float K_UPARROW
Definition: keycodes.qc:15
int minigame_tile_number(string id)
Definition: minigames.qc:21
void minigame_server_sendflags(entity ent, int mgflags)
Definition: minigames.qc:78
void HUD_MinigameMenu_CustomEntry(entity parent, string menumessage, string event_arg)
const int MINIG_SF_ALL
Definition: minigames.qh:112
float panel_fg_alpha
Definition: hud.qh:166
string string_null
Definition: nil.qh:9
#define int
Definition: _all.inc:20
#define FOREACH_MINIGAME_ENTITY(entityvar)
Definition: cl_minigames.qh:98
const vector eY
Definition: vector.qh:45
vector minigame_hud_denormalize_size(vector v, vector pos, vector mySize)
Definition: cl_minigames.qc:23
int int number
Definition: impulse.qc:89
float K_DOWNARROW
Definition: keycodes.qc:16
REGISTER_MINIGAME(pp, _("Push-Pull"))
int team
Definition: main.qh:157
bool pp_winning_piece(entity piece)
Definition: pp.qc:51
#define minigame_hud_fitsqare(pos, mySize)
Definition: cl_minigames.qh:7
entity msle_spawn(entity minigame_session, entity e)
Definition: minigames.qc:87
float K_KP_DOWNARROW
Definition: keycodes.qc:53
int minigame_next_team(int curr_team, int n_teams)
Definition: minigames.qc:65
entity() spawn
void pp_move(entity minigame, entity player, string pos)
Definition: pp.qc:98
vector minigame_hud_normalize(vector v, vector pos, vector mySize)
Definition: cl_minigames.qc:31
bool pp_valid_move(entity minigame, string pos)
Definition: pp.qc:70
const int PP_TURN_NEXT
Definition: pp.qc:7
const int PP_TURN_TEAM2
Definition: pp.qc:11
float K_SPACE
Definition: keycodes.qc:10
float K_RIGHTARROW
Definition: keycodes.qc:18
const int MINIG_SF_UPDATE
Definition: minigames.qh:109
entity owner
Definition: main.qh:73
const int PP_TURN_WIN
Definition: pp.qc:5
float K_KP_ENTER
Definition: keycodes.qc:74
int pp_team1_score
Definition: pp.qc:23
#define strcpy(this, s)
Definition: string.qh:49
string minigame_tile_name(vector pos, int rows, int columns)
Definition: minigames.qc:54
const float DRAWFLAG_ADDITIVE
Definition: csprogsdefs.qc:318
#define HUD_Panel_DrawBg()
Definition: hud.qh:54
void minigame_drawpic_centered(vector pos, string texture, vector sz, vector color, float thealpha, int drawflags)
string minigame_texture(string name)
Definition: cl_minigames.qc:49
entity active_minigame
Definition: cl_minigames.qh:85
entity pp_curr_piece
Definition: pp.qc:28
vector minigame_tile_pos(string id, int rows, int columns)
Definition: minigames.qc:27
vector minigame_drawcolorcodedstring_wrapped(float maxwidth, vector pos, string text, vector fontsize, float theAlpha, int drawflags, float align)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define NULL
Definition: post.qh:17
const float DRAWFLAG_NORMAL
Definition: csprogsdefs.qc:317
int minigame_tile_letter(string id)
Definition: minigames.qc:12
void pp_setup_pieces(entity minigame)
Definition: pp.qc:149
const int PP_TURN_TEAM
Definition: pp.qc:12
#define minigame_cmd(...)
Definition: cl_minigames.qh:90
string minigame_tile_buildname(int letter, int number)
Definition: minigames.qc:34
vector(float skel, float bonenum) _skel_get_boneabs_hidden
string minigame_relative_tile(string start_id, int dx, int dy, int rows, int columns)
Definition: minigames.qc:40
const int PP_TILE_SIZE
Definition: pp.qc:19
float K_MOUSE1
Definition: keycodes.qc:129
const int PP_LET_CNT
Definition: pp.qc:16
void minigame_prompt()
int minigame_count_players(entity minigame)
Definition: minigames.qc:121
const vector eX
Definition: vector.qh:44
int pp_team2_score
Definition: pp.qc:24
const int PP_TURN_TEAM1
Definition: pp.qc:10
vector minigame_hud_denormalize(vector v, vector pos, vector mySize)
Definition: cl_minigames.qc:16
const int PP_NUM_CNT
Definition: pp.qc:17
vector mousepos
Definition: hud.qh:102
float K_LEFTARROW
Definition: keycodes.qc:17
entity pp_find_piece(entity minig, string tile)
Definition: pp.qc:31
void minigame_drawcolorcodedstring_trunc(float maxwidth, vector pos, string text, vector fontsize, float theAlpha, int drawflags)
vector hud_fontsize
Definition: main.qh:63
#define strfree(this)
Definition: string.qh:56
float K_ENTER
Definition: keycodes.qc:8
void minigame_hud_simpleboard(vector pos, vector mySize, string board_texture)
Definition: cl_minigames.qc:4
int cnt
Definition: pp.qc:21
entity minigame_self
Definition: cl_minigames.qh:87
float K_KP_LEFTARROW
Definition: keycodes.qc:57
float K_KP_UPARROW
Definition: keycodes.qc:64
const int PP_TURN_TYPE
Definition: pp.qc:8
const int PP_TURN_PLACE
Definition: pp.qc:4
const int PP_SPECTATOR_TEAM
Definition: pp.qc:14
bool pp_valid_tile(string tile)
Definition: pp.qc:41
void pp_next_match(entity minigame, entity player)
Definition: pp.qc:172
vector minigame_drawstring_wrapped(float maxwidth, vector pos, string text, vector fontsize, vector color, float theAlpha, int drawflags, float align)
int pp_nexteam
Definition: pp.qc:26
const int PP_TURN_DRAW
Definition: pp.qc:6