chr_shared.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  chrTemplate_s
struct  chrScoreMission_s
 Structure of all stats collected in a mission. More...
struct  chrScoreGlobal_s
 Structure of all stats collected for an actor over time. More...
struct  chrFiremodeSettings_s
struct  chrReservations_s
 How many TUs (and of what type) did a player reserve for a unit? More...
struct  ugv_s
 Defines a type of UGV/Robot. More...
struct  teamDef_s
struct  character_s
 Describes a character with all its attributes. More...

Defines

#define MAX_CHARACTER_TEMPLATES   24
#define MAX_TEMPLATES_PER_TEAM   16
#define ABILITY_NUM_TYPES   SKILL_CLOSE
#define MAX_UGV   8
#define MAX_TEAMDEFS   64
#define MAX_CHARACTER_TEMPLATES   24
#define MAX_TEMPLATES_PER_TEAM   16

Typedefs

typedef struct chrTemplate_s chrTemplate_t
typedef struct chrScoreMission_s chrScoreMission_t
 Structure of all stats collected in a mission.
typedef struct chrScoreGlobal_s chrScoreGlobal_t
 Structure of all stats collected for an actor over time.
typedef struct
chrFiremodeSettings_s 
chrFiremodeSettings_t
typedef struct chrReservations_s chrReservations_t
 How many TUs (and of what type) did a player reserve for a unit?
typedef int32_t actorSizeEnum_t
typedef struct ugv_s ugv_t
 Defines a type of UGV/Robot.
typedef struct teamDef_s teamDef_t
typedef struct character_s character_t
 Describes a character with all its attributes.

Enumerations

enum  killtypes_t { KILLED_ENEMIES, KILLED_CIVILIANS, KILLED_TEAM, KILLED_NUM_TYPES }
enum  abilityskills_t {
  ABILITY_POWER, ABILITY_SPEED, ABILITY_ACCURACY, ABILITY_MIND,
  SKILL_CLOSE, SKILL_HEAVY, SKILL_ASSAULT, SKILL_SNIPER,
  SKILL_EXPLOSIVE, SKILL_NUM_TYPES
}
enum  reservation_types_t {
  RES_REACTION, RES_CROUCH, RES_SHOT, RES_ALL,
  RES_ALL_ACTIVE, RES_TYPES
}
enum  actorSound_t { SND_DEATH, SND_HURT, SND_MAX }
 

Types of actor sounds being issued by CL_ActorPlaySound().

More...
enum  nametypes_t {
  NAME_NEUTRAL, NAME_FEMALE, NAME_MALE, NAME_LAST,
  NAME_FEMALE_LAST, NAME_MALE_LAST, NAME_NUM_TYPES
}
enum  racetypes_t {
  RACE_PHALANX_HUMAN, RACE_CIVILIAN, RACE_ROBOT, RACE_TAMAN,
  RACE_ORTNOK, RACE_BLOODSPIDER, RACE_SHEVAAR
}
 

Different races of actors used in game.

More...

Functions

void CHRSH_CharGenAbilitySkills (character_t *chr, qboolean multiplayer) __attribute__((nonnull))
 Generates a skill and ability set for any character.
const char * CHRSH_CharGetBody (const character_t *const chr) __attribute__((nonnull))
 Returns the body model for the soldiers for armoured and non armoured soldiers.
const char * CHRSH_CharGetHead (const character_t *const chr) __attribute__((nonnull))
 Returns the head model for the soldiers for armoured and non armoured soldiers.
qboolean CHRSH_IsTeamDefAlien (const teamDef_t *const td) __attribute__((nonnull))
 Check if a team definition is alien.
qboolean CHRSH_IsTeamDefRobot (const teamDef_t *const td) __attribute__((nonnull))
 Check if a team definition is a robot.

Detailed Description

Definition in file chr_shared.h.


Define Documentation

#define ABILITY_NUM_TYPES   SKILL_CLOSE

Definition at line 54 of file chr_shared.h.

Referenced by CL_SwapSkills(), and Com_ParseFire().

#define MAX_CHARACTER_TEMPLATES   24

Definition at line 176 of file chr_shared.h.

#define MAX_CHARACTER_TEMPLATES   24

Definition at line 176 of file chr_shared.h.

Referenced by Com_ParseCharacterTemplate().

#define MAX_TEAMDEFS   64

Definition at line 175 of file chr_shared.h.

Referenced by Com_ParseTeam(), and G_ClientReadCharacter().

#define MAX_TEMPLATES_PER_TEAM   16

Definition at line 177 of file chr_shared.h.

#define MAX_TEMPLATES_PER_TEAM   16

Definition at line 177 of file chr_shared.h.

#define MAX_UGV   8

Definition at line 174 of file chr_shared.h.

Referenced by Com_ParseUGVs().


Typedef Documentation

Definition at line 162 of file chr_shared.h.

typedef struct character_s character_t

Describes a character with all its attributes.

How many TUs (and of what type) did a player reserve for a unit?

See also:
CL_ActorUsableTUs
CL_ActorReservedTUs
CL_ActorReserveTUs

Structure of all stats collected for an actor over time.

Note:
More general Info: http://ufoai.ninex.info/wiki/index.php/Proposals/Attribute_Increase
This information is stored in savegames (in contract to chrScoreMission_t).
WARNING: if you change something here you'll have to make sure all the network and savegame stuff is updated as well! Additionally you have to check the size of the network-transfer in G_SendCharacterData and GAME_CP_Results

Structure of all stats collected in a mission.

Note:
More general Info: http://ufoai.ninex.info/wiki/index.php/Proposals/Attribute_Increase
Mostly collected in g_client.c and not used anywhere else (at least that's the plan ;)). The result is parsed into chrScoreGlobal_t which is stored in savegames.
BTAxis about "hit" count: "But yeah, what we want is a counter per skill. This counter should start at 0 every battle, and then be increased by 1 everytime:
  • a direct fire weapon hits (or deals damage, same thing) the actor the weapon was fired at. If it wasn't fired at an actor, nothing should happen.
  • a splash weapon deals damage to any enemy actor. If multiple actors are hit, increase the counter multiple times."
typedef struct chrTemplate_s chrTemplate_t
typedef struct teamDef_s teamDef_t
typedef struct ugv_s ugv_t

Defines a type of UGV/Robot.


Enumeration Type Documentation

Note:
Changing order/entries also changes network-transmission and savegames!
Enumerator:
ABILITY_POWER 
ABILITY_SPEED 
ABILITY_ACCURACY 
ABILITY_MIND 
SKILL_CLOSE 
SKILL_HEAVY 
SKILL_ASSAULT 
SKILL_SNIPER 
SKILL_EXPLOSIVE 
SKILL_NUM_TYPES 

Definition at line 40 of file chr_shared.h.

Types of actor sounds being issued by CL_ActorPlaySound().

Enumerator:
SND_DEATH 

Sound being played on actor death.

SND_HURT 

Sound being played when an actor is being hit.

SND_MAX 

Definition at line 165 of file chr_shared.h.

Enumerator:
KILLED_ENEMIES 

Killed enemies

KILLED_CIVILIANS 

Civilians, animals

KILLED_TEAM 

Friendly fire, own team, partner-teams.

KILLED_NUM_TYPES 

Definition at line 31 of file chr_shared.h.

Enumerator:
NAME_NEUTRAL 
NAME_FEMALE 
NAME_MALE 
NAME_LAST 
NAME_FEMALE_LAST 
NAME_MALE_LAST 
NAME_NUM_TYPES 

Definition at line 179 of file chr_shared.h.

Different races of actors used in game.

Todo:
add different robot races.
Enumerator:
RACE_PHALANX_HUMAN 

Phalanx team

RACE_CIVILIAN 

Civilian team

RACE_ROBOT 

Robot

RACE_TAMAN 

Alien: taman race

RACE_ORTNOK 

Alien: ortnok race

RACE_BLOODSPIDER 

Alien: bloodspider race

RACE_SHEVAAR 

Alien: shevaar race

Definition at line 195 of file chr_shared.h.

Enumerator:
RES_REACTION 
RES_CROUCH 
RES_SHOT 
RES_ALL 
RES_ALL_ACTIVE 
RES_TYPES 

Max.

Definition at line 153 of file chr_shared.h.


Function Documentation

void CHRSH_CharGenAbilitySkills ( character_t chr,
qboolean  multiplayer 
)

Generates a skill and ability set for any character.

Parameters:
[in] chr Pointer to the character, for which we generate stats.
[in] multiplayer If this is true we use the skill values from soldier_mp mulitplayer is a special case here

Definition at line 54 of file chr_shared.c.

References ABILITY_MIND, teamDef_s::characterTemplates, chrScoreGlobal_s::experience, frand(), GET_MORALE, character_s::HP, i, teamDef_s::id, chrTemplate_s::id, chrScoreGlobal_s::initialSkills, int(), MAX_SKILL, character_s::maxHP, character_s::morale, teamDef_s::numTemplates, teamDef_s::race, RACE_PHALANX_HUMAN, chrTemplate_s::rate, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::skills, chrTemplate_s::skills, Sys_Error(), td, and character_s::teamDef.

Referenced by AI_SetStats(), and CL_GenerateCharacter().

const char* CHRSH_CharGetBody ( const character_t *const   chr  ) 

Returns the body model for the soldiers for armoured and non armoured soldiers.

Parameters:
[in] chr Pointer to character struct
See also:
CHRSH_CharGetBody
Returns:
the character body model (from a static buffer)

Definition at line 135 of file chr_shared.c.

References objDef_s::armourPath, character_s::body, Com_sprintf(), character_s::i, INV_IsArmour, INVSH_HasArmour(), invList_s::item, MAX_VAR, character_s::path, teamDef_s::race, RACE_ROBOT, Sys_Error(), item_s::t, and character_s::teamDef.

Referenced by AI_InitPlayer(), CL_CharacterSkillAndScoreCvars(), CL_UpdateActorAircraftVar(), and G_ClientAssignDefaultActorValues().

const char* CHRSH_CharGetHead ( const character_t *const   chr  ) 

Returns the head model for the soldiers for armoured and non armoured soldiers.

Parameters:
[in] chr Pointer to character struct
See also:
CHRSH_CharGetBody

Definition at line 157 of file chr_shared.c.

References objDef_s::armourPath, Com_sprintf(), character_s::head, character_s::i, INV_IsArmour, INVSH_HasArmour(), invList_s::item, MAX_VAR, character_s::path, teamDef_s::race, RACE_ROBOT, Sys_Error(), item_s::t, and character_s::teamDef.

Referenced by AI_InitPlayer(), CL_CharacterSkillAndScoreCvars(), CL_UpdateActorAircraftVar(), and G_ClientAssignDefaultActorValues().

qboolean CHRSH_IsTeamDefAlien ( const teamDef_t *const   td  ) 
qboolean CHRSH_IsTeamDefRobot ( const teamDef_t *const   td  ) 

Check if a team definition is a robot.

Parameters:
[in] td Pointer to the team definition to check.

Definition at line 43 of file chr_shared.c.

References teamDef_s::race, RACE_BLOODSPIDER, and RACE_ROBOT.

Referenced by AL_AddAliens(), and G_Damage().


Generated by  doxygen 1.6.2