1 /** 2 * @file 3 */ 4 5 /* 6 Copyright (C) 2002-2013 UFO: Alien Invasion. 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 17 See the GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 23 */ 24 25 #pragma once 26 27 #include "../../common/grid.h" 28 29 typedef struct { 30 char name[MAX_VAR]; 31 } clientinfo_t; 32 33 /** 34 * @brief This is the structure that should be used for data that is needed for tactical missions only. 35 * @note the client_state_t structure is wiped completely at every server map change 36 * @sa client_static_t 37 */ 38 typedef struct clientBattleScape_s { 39 int time; /**< this is the time value that the client 40 * is rendering at. always <= cls.realtime */ 41 camera_t cam; 42 43 le_t* teamList[MAX_ACTIVETEAM]; 44 int numTeamList; 45 int numEnemiesSpotted; 46 47 bool eventsBlocked; /**< if the client interrupts the event execution, this is true */ 48 49 /** server state information */ 50 int pnum; /**< player num you have on the server */ 51 int actTeam; /**< the currently active team (in this round) */ 52 53 char configstrings[MAX_CONFIGSTRINGS][MAX_TOKEN_CHARS]; 54 55 /** locally derived information from server state */ 56 model_t* model_draw[MAX_MODELS]; 57 const struct cBspModel_s* model_clip[MAX_MODELS]; 58 59 bool radarInitialized; /**< every radar image (for every level [1-8]) is loaded */ 60 61 clientinfo_t clientinfo[MAX_CLIENTS]; /**< client info of all connected clients */ 62 63 int mapMaxLevel; 64 65 /** @todo make this private to the particle code */ 66 int numMapParticles; 67 68 int numLMs; 69 localModel_t LMs[MAX_LOCALMODELS]; 70 71 int numLEs; 72 le_t LEs[MAX_EDICTS]; 73 74 const char* leInlineModelList[MAX_EDICTS + 1]; 75 76 bool spawned; /**< soldiers already spawned? This is only true if we are already on battlescape but 77 * our team is not yet spawned */ 78 bool started; /**< match already started? */ 79 80 mapData_t* mapData; 81 82 pathing_t pathMap; /**< This is where the data for TUS used to move and actor locations go */ 83 84 mapTiles_t* mapTiles; 85 86 linkedList_t* chrList; /**< the list of characters that are used as team in the currently running tactical mission */ 87 } clientBattleScape_t; 88 89 extern clientBattleScape_t cl; 90 91 le_t* CL_BattlescapeSearchAtGridPos(const pos3_t pos, bool includingStunned, const le_t* actor); 92 bool CL_OnBattlescape(void); 93 bool CL_BattlescapeRunning(void); 94 int CL_GetHitProbability(const le_t* actor); 95 bool CL_OutsideMap(const vec3_t impact, const float delta); 96 int CL_CountVisibleEnemies(void); 97 char* CL_GetConfigString(int index); 98 int CL_GetConfigStringInteger(int index); 99 char* CL_SetConfigString(int index, dbuffer* msg); 100 #ifdef DEBUG 101 void Grid_DumpWholeClientMap_f(void); 102 void Grid_DumpClientRoutes_f(void); 103 #endif 104