X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fminigames%2Fminigame%2Fall.qh;h=d3874e7aa77cb42b79bc8c42230982cb0a4781f6;hb=32ca966802c45c4c231210c2d8776bc3f4135dc2;hp=4085a96acca446a707b16975ed09bb35d4f7c372;hpb=4fbdc90a49386481179f329cf6cb7f7a94a5d908;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/minigames/minigame/all.qh b/qcsrc/common/minigames/minigame/all.qh index 4085a96ac..d3874e7aa 100644 --- a/qcsrc/common/minigames/minigame/all.qh +++ b/qcsrc/common/minigames/minigame/all.qh @@ -17,17 +17,17 @@ Required functions ------------------ SVQC: - int minigame_event_(entity minigame, string event, ...count) + int _server_event(entity minigame, string event, ...count) see ../minigames.qh for a detailed explanation CSQC: - void minigame_hud_board_(vector pos, vector mySize) + void _hud_board(vector pos, vector mySize) draws the main game board inside the rectangle defined by pos and mySize (That rectangle is expressed in window coordinates) - void minigame_hud_status_(vector pos, vector mySize) + void _hud_status(vector pos, vector mySize) draws the game status panel inside the rectangle defined by pos and mySize (That rectangle is expressed in window coordinates) This panel shows eg scores, captured pieces and so on - int minigame_event_(entity minigame, string event, ...count) + int _client_event(entity minigame, string event, ...count) see ../minigames.qh for a detailed explanation Managing entities @@ -47,7 +47,7 @@ used as send flags for minigame entities: * MINIG_SF_UPDATE A miscellaneous update, can be safely used if the entity has just a few fields * MINIG_SF_CUSTOM - Starting value for custom flags, since there are bit-wise flags, + Starting value for custom flags, since there are bit-wise flags, the following values shall be MINIG_SF_CUSTOM*2, MINIG_SF_CUSTOM*4 and MINIG_SF_CUSTOM*8. * MINIG_SF_MAX Maximum flag value that will be networked @@ -63,25 +63,17 @@ that .owner is set to the minigame session entity and .minigame_autoclean is tru #include "nmm.qc" #include "ttt.qc" +#include "c4.qc" #include "pong.qc" - -/** - * Registration: - * MINIGAME(id,"Name") - * id (QuakeC symbol) Game identifier, used to find the functions explained above - * "Name"(String) Human readable name for the game, shown in the UI - */ -#define REGISTERED_MINIGAMES \ - MINIGAME(nmm, "Nine Men's Morris") \ - MINIGAME(ttt, "Tic Tac Toe") \ - MINIGAME(pong, "Pong") \ - /*empty line*/ +#include "ps.qc" +#include "pp.qc" +#include "snake.qc" /** * Set up automatic entity read/write functionality * To ensure that everything is handled automatically, spawn on the server using msle_spawn * Syntax: - * MSLE(classname,Field...) \ + * MSLE(classname,Field...) \ * classname: Identifier used to recognize the type of the entity * (must be set as .classname on the sent entities) * Field... : List of FIELD calls @@ -106,5 +98,6 @@ that .owner is set to the minigame session entity and .minigame_autoclean is tru #define MINIGAME_SIMPLELINKED_ENTITIES \ MSLE(minigame_board_piece,FIELD(MINIG_SF_CREATE,Byte,team) FIELD(MINIG_SF_UPDATE, Short, minigame_flags) FIELD(MINIG_SF_UPDATE, Vector2D,origin)) \ MSLE(pong_paddle,FIELD(MINIG_SF_CREATE,Byte,team) FIELD(MINIG_SF_CREATE,Float,pong_length) FIELD(MINIG_SF_UPDATE,Vector2D,origin)) \ - MSLE(pong_ball, FIELD(PONG_SF_BALLTEAM,Byte,team) FIELD(MINIG_SF_UPDATE, Vector2D, velocity) FIELD(MINIG_SF_UPDATE, Vector2D, origin)) \ - /*empty line*/ + MSLE(pong_ball,FIELD(MINIG_SF_CREATE,Float,pong_length) FIELD(PONG_SF_BALLTEAM,Byte,team) FIELD(MINIG_SF_UPDATE, Vector2D, velocity) FIELD(MINIG_SF_UPDATE, Vector2D, origin)) \ + MSLE(pong_ai, FIELD(MINIG_SF_CREATE,Byte,team) FIELD(PONG_SF_PLAYERSCORE, Long, pong_score)) \ + /*empty line*/