chr_shared.h
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GAME_CHR_SHARED_H
00026 #define GAME_CHR_SHARED_H
00027
00028 #define MAX_CHARACTER_TEMPLATES 24
00029 #define MAX_TEMPLATES_PER_TEAM 16
00030
00031 typedef enum {
00032 KILLED_ENEMIES,
00033 KILLED_CIVILIANS,
00034 KILLED_TEAM,
00036 KILLED_NUM_TYPES
00037 } killtypes_t;
00038
00040 typedef enum {
00041 ABILITY_POWER,
00042 ABILITY_SPEED,
00043 ABILITY_ACCURACY,
00044 ABILITY_MIND,
00045
00046 SKILL_CLOSE,
00047 SKILL_HEAVY,
00048 SKILL_ASSAULT,
00049 SKILL_SNIPER,
00050 SKILL_EXPLOSIVE,
00051 SKILL_NUM_TYPES
00052 } abilityskills_t;
00053
00054 #define ABILITY_NUM_TYPES SKILL_CLOSE
00055
00056 typedef struct chrTemplate_s {
00057 char id[MAX_VAR];
00058 float rate;
00059 int skills[SKILL_NUM_TYPES + 1][2];
00060 } chrTemplate_t;
00061
00075 typedef struct chrScoreMission_s {
00076
00077
00078 int movedNormal;
00079 int movedCrouched;
00080
00081
00083 int kills[KILLED_NUM_TYPES];
00084 int stuns[KILLED_NUM_TYPES];
00086
00087 int fired[SKILL_NUM_TYPES];
00088 int firedTUs[SKILL_NUM_TYPES];
00089 qboolean firedHit[KILLED_NUM_TYPES];
00090 int hits[SKILL_NUM_TYPES][KILLED_NUM_TYPES];
00093 int firedSplash[SKILL_NUM_TYPES];
00094 int firedSplashTUs[SKILL_NUM_TYPES];
00095 qboolean firedSplashHit[KILLED_NUM_TYPES];
00096 int hitsSplash[SKILL_NUM_TYPES][KILLED_NUM_TYPES];
00097 int hitsSplashDamage[SKILL_NUM_TYPES][KILLED_NUM_TYPES];
00100 int skillKills[SKILL_NUM_TYPES];
00102 int heal;
00103 } chrScoreMission_t;
00104
00112 typedef struct chrScoreGlobal_s {
00113 int experience[SKILL_NUM_TYPES + 1];
00115 int skills[SKILL_NUM_TYPES];
00116 int initialSkills[SKILL_NUM_TYPES + 1];
00118
00119 int kills[KILLED_NUM_TYPES];
00120 int stuns[KILLED_NUM_TYPES];
00122 int assignedMissions;
00124 int rank;
00125 } chrScoreGlobal_t;
00126
00127 typedef struct chrFiremodeSettings_s {
00128 actorHands_t hand;
00129 fireDefIndex_t fmIdx;
00130 const objDef_t *weapon;
00131 } chrFiremodeSettings_t;
00132
00139 typedef struct chrReservations_s {
00140
00141 int reaction;
00144
00145 int crouch;
00147
00148 int shot;
00149 chrFiremodeSettings_t shotSettings;
00151 } chrReservations_t;
00152
00153 typedef enum {
00154 RES_REACTION,
00155 RES_CROUCH,
00156 RES_SHOT,
00157 RES_ALL,
00158 RES_ALL_ACTIVE,
00159 RES_TYPES
00160 } reservation_types_t;
00161
00162 typedef int32_t actorSizeEnum_t;
00163
00165 typedef enum {
00166 SND_DEATH,
00167 SND_HURT,
00169 SND_MAX
00170 } actorSound_t;
00171
00172
00173
00174 #define MAX_UGV 8
00175 #define MAX_TEAMDEFS 64
00176 #define MAX_CHARACTER_TEMPLATES 24
00177 #define MAX_TEMPLATES_PER_TEAM 16
00178
00179 typedef enum {
00180 NAME_NEUTRAL,
00181 NAME_FEMALE,
00182 NAME_MALE,
00183
00184 NAME_LAST,
00185 NAME_FEMALE_LAST,
00186 NAME_MALE_LAST,
00187
00188 NAME_NUM_TYPES
00189 } nametypes_t;
00190
00195 typedef enum {
00196 RACE_PHALANX_HUMAN,
00197 RACE_CIVILIAN,
00199 RACE_ROBOT,
00201 RACE_TAMAN,
00202 RACE_ORTNOK,
00203 RACE_BLOODSPIDER,
00204 RACE_SHEVAAR
00205 } racetypes_t;
00206
00208 typedef struct ugv_s {
00209 char *id;
00210 int idx;
00211 char weapon[MAX_VAR];
00212 char armour[MAX_VAR];
00213 int tu;
00214 char actors[MAX_VAR];
00215 int price;
00216 } ugv_t;
00217
00218 typedef struct teamDef_s {
00219 int idx;
00220 char id[MAX_VAR];
00221 char name[MAX_VAR];
00222 char tech[MAX_VAR];
00224 linkedList_t *names[NAME_NUM_TYPES];
00225 int numNames[NAME_NUM_TYPES];
00227 linkedList_t *models[NAME_LAST];
00228 int numModels[NAME_LAST];
00230 linkedList_t *sounds[SND_MAX][NAME_LAST];
00231 int numSounds[SND_MAX][NAME_LAST];
00233 racetypes_t race;
00235 qboolean armour;
00236 qboolean weapons;
00237 struct objDef_s *onlyWeapon;
00242 actorSizeEnum_t size;
00243 char hitParticle[MAX_VAR];
00244 char deathTextureName[MAX_VAR];
00246 short resistance[MAX_DAMAGETYPES];
00248 const chrTemplate_t *characterTemplates[MAX_TEMPLATES_PER_TEAM];
00249 int numTemplates;
00250 } teamDef_t;
00251
00253 typedef struct character_s {
00254 int ucn;
00255 char name[MAX_VAR];
00256 char path[MAX_VAR];
00257 char body[MAX_VAR];
00258 char head[MAX_VAR];
00259 int skin;
00261 int HP;
00262 int minHP;
00263 int maxHP;
00264 int STUN;
00265 int morale;
00266
00267 int state;
00269 chrScoreGlobal_t score;
00270 chrScoreMission_t *scoreMission;
00273 actorSizeEnum_t fieldSize;
00275 inventory_t i;
00277 teamDef_t *teamDef;
00278 int gender;
00279 chrReservations_t reservedTus;
00280 chrFiremodeSettings_t RFmode;
00281 } character_t;
00282
00283
00284
00285
00286
00287 void CHRSH_CharGenAbilitySkills(character_t * chr, qboolean multiplayer) __attribute__((nonnull));
00288 const char *CHRSH_CharGetBody(const character_t* const chr) __attribute__((nonnull));
00289 const char *CHRSH_CharGetHead(const character_t* const chr) __attribute__((nonnull));
00290 qboolean CHRSH_IsTeamDefAlien(const teamDef_t* const td) __attribute__((nonnull));
00291 qboolean CHRSH_IsTeamDefRobot(const teamDef_t* const td) __attribute__((nonnull));
00292
00293 #endif