4 /// Create a new minigame session
5 /// \return minigame session entity
6 entity start_minigame(entity player, string minigame );
8 /// Join an existing minigame session
9 /// \return minigame session entity
10 entity join_minigame(entity player, string game_id );
12 /// Invite a player to join in a minigame
13 /// \return Error string
14 string invite_minigame(entity inviter, entity player);
16 // Part minigame session
17 void part_minigame(entity player);
19 // Ends a minigame session
20 void end_minigame(entity minigame_session);
22 // Ends all minigame sessions
25 // Only sends entities to players who joined the minigame
26 // Use on customizeentityforclient for gameplay entities
27 bool minigame_CheckSend(entity this, entity client);
29 // Check for minigame impulses
30 bool MinigameImpulse(entity this, int imp);
32 // Parse a client command ( cmd minigame ... )
33 void ClientCommand_minigame(entity caller, int request, int argc, string command);
35 // Find the minigame_player entity for the given client entity
36 entity minigame_find_player(entity client);
38 /// For players: Minigame being played
39 .entity active_minigame;
41 /// For minigame sessions: list of players
42 /// For minigame_player: client entity
43 .entity minigame_players;
45 entity minigame_sessions;
47 bool minigame_SendEntity(entity this, entity to, int sf);
49 REGISTRY(Minigames, BITS(4))
50 #define Minigames_from(i) _Minigames_from(i, NULL)
51 REGISTER_REGISTRY(Minigames)
52 REGISTRY_CHECK(Minigames)
53 #define REGISTER_MINIGAME(name,nicename) \
54 REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \
55 int name##_server_event(entity, string, ...); \
56 REGISTER_INIT(MINIGAME_##name) { \
57 this.netname = strzone(strtolower(#name)); \
58 this.message = nicename; \
59 this.minigame_event = name##_server_event; \
61 REGISTER_INIT(MINIGAME_##name)