Xonotic
minigames.qh
Go to the documentation of this file.
1 #pragma once
2 
3 // previous node in a doubly linked list
4 .entity list_prev;
5 // next node in a linked list
6 .entity list_next;
7 
9 
10 // Get letter index of a tile name
11 int minigame_tile_letter(string id);
12 
13 // Get number index of a tile name
14 // Note: this is 0 based, useful for mathematical operations
15 // Note: Since the tile notation starts from the bottom left,
16 // you may want to do number_of_rows - what_this_function_returns or something
17 int minigame_tile_number(string id);
18 
19 // Get relative position of the center of a given tile
20 vector minigame_tile_pos(string id, int rows, int columns);
21 
22 // Get a tile name from indices
23 string minigame_tile_buildname(int letter, int number);
24 
25 // Get the id of a tile relative to the given one
26 string minigame_relative_tile(string start_id, int dx, int dy, int rows, int columns);
27 
28 // Get tile name from a relative position (matches the tile covering a square area)
29 string minigame_tile_name(vector pos, int rows, int columns);
30 
31 // Get the next team number (note: team numbers are between 1 and n_teams, inclusive)
32 int minigame_next_team(int curr_team, int n_teams);
33 
34 // Get the previous team number
35 int minigame_prev_team(int curr_team, int n_teams);
36 
37 // set send flags only when on server
38 // (for example in game logic which can be used both in client and server
39 void minigame_server_sendflags(entity ent, int mgflags);
40 
41 // count the number of players in a minigame session
42 int minigame_count_players(entity minigame);
43 
45 .entity descriptor;
46 
97 .int(entity,string,...) minigame_event;
98 
99 // For run-time gameplay entities: Whether to be removed when the game is deactivated
101 
102 // For run-time gameplay entities: some place to store flags safely
104 
105 // Send flags, set to .SendFlags on networked entities to send entity information
106 // Flag values for customized events must be powers of 2 in the range
107 // [MINIG_SF_CUSTOM, MINIG_SF_MAX] (inclusive)
108 const int MINIG_SF_CREATE = 0x01; // Create a new object
109 const int MINIG_SF_UPDATE = 0x02; // miscellaneous entity update
110 const int MINIG_SF_CUSTOM = 0x10; // a customized networked event
111 const int MINIG_SF_MAX = 0x80; // maximum flag value sent over the network
112 const int MINIG_SF_ALL = 0xff; // use to resend everything
113 
114 
115 // Spawn linked entity on the server or local entity on the client
116 // This entity will be removed automatically when the minigame ends
117 entity msle_spawn(entity minigame_session, entity e);
118 
119 #include "minigame/all.qh"
120 
121 int msle_id(string class_name);
122 string msle_classname(int id);
entity minigame_get_descriptor(string id)
Definition: minigames.qc:5
int minigame_tile_number(string id)
Definition: minigames.qc:21
const int MINIG_SF_ALL
Definition: minigames.qh:112
string minigame_tile_name(vector pos, int rows, int columns)
Definition: minigames.qc:54
int int number
Definition: impulse.qc:89
entity list_next
Definition: minigames.qh:6
entity() spawn
bool minigame_autoclean
Definition: minigames.qh:100
int minigame_tile_letter(string id)
Definition: minigames.qc:12
int minigame_flags
Definition: minigames.qh:103
const int MINIG_SF_UPDATE
Definition: minigames.qh:109
int minigame_count_players(entity minigame)
Definition: minigames.qc:121
void minigame_server_sendflags(entity ent, int mgflags)
Definition: minigames.qc:78
const int MINIG_SF_CUSTOM
Definition: minigames.qh:110
entity msle_spawn(entity minigame_session, entity e)
Definition: minigames.qc:87
string msle_classname(int id)
Definition: minigames.qc:110
vector minigame_tile_pos(string id, int rows, int columns)
Definition: minigames.qc:27
int msle_id(string class_name)
Definition: minigames.qc:99
string minigame_relative_tile(string start_id, int dx, int dy, int rows, int columns)
Definition: minigames.qc:40
string minigame_tile_buildname(int letter, int number)
Definition: minigames.qc:34
vector(float skel, float bonenum) _skel_get_boneabs_hidden
int minigame_next_team(int curr_team, int n_teams)
Definition: minigames.qc:65
const int MINIG_SF_CREATE
Definition: minigames.qh:108
int minigame_prev_team(int curr_team, int n_teams)
Definition: minigames.qc:71
const int MINIG_SF_MAX
Definition: minigames.qh:111
entity descriptor
For minigame sessions: minigame descriptor object.
Definition: minigames.qh:45
entity list_prev
Definition: minigames.qh:4