UFO: Alien Invasion
|
Team management, name generation and parsing. More...
#include "client.h"
#include "cl_team.h"
#include "cl_inventory.h"
#include "cgame/cl_game.h"
#include "battlescape/cl_localentity.h"
#include "battlescape/cl_actor.h"
#include "battlescape/events/e_parse.h"
#include "battlescape/events/e_main.h"
#include "ui/ui_data.h"
#include "ui/ui_nodes.h"
Go to the source code of this file.
Functions | |
actorSkin_t * | CL_AllocateActorSkin (const char *name) |
Allocate a skin from the cls structure. More... | |
unsigned int | CL_GetActorSkinCount (void) |
Get number of registered actorskins. More... | |
static const actorSkin_t * | CL_GetActorSkinByIDS (unsigned int idx) |
Get a actorskin from idx. More... | |
static void | CL_CharacterSkillAndScoreCvars (const character_t *chr) |
static void | CL_ActorCvars (const character_t *chr) |
Updates the character cvars for the given character. More... | |
const char * | CL_ActorGetSkillString (const int skill) |
Return the skill string for the given skill level. More... | |
static void | CL_UGVCvars (const character_t *chr) |
Updates the UGV cvars for the given "character". The models and stats that are displayed in the menu are stored in cvars. These cvars are updated here when you select another character. More... | |
void | CL_UpdateCharacterValues (const character_t *chr) |
void | CL_GenerateCharacter (character_t *chr, const char *teamDefName) |
Generates the skills and inventory for a character and for a 2x2 unit. More... | |
static void | CL_InitSkin_f (void) |
Init skins into the GUI. More... | |
static int | CL_FixActorSkinIDX (int idx) |
Fix actorskin idx according to game mode. More... | |
static void | CL_ChangeSkin_f (void) |
Change the skin of the selected actor. More... | |
static void | CL_ChangeSkinForWholeTeam_f (void) |
Use current skin for all team members onboard. More... | |
void | TEAM_InitStartup (void) |
Variables | |
linkedList_t * | chrDisplayList |
List of currently displayed or equipable characters. More... | |
Team management, name generation and parsing.
Definition in file cl_team.cpp.
|
static |
Updates the character cvars for the given character.
The models and stats that are displayed in the menu are stored in cvars. These cvars are updated here when you select another character.
[in] | chr | Pointer to character_t (may not be null) |
Definition at line 143 of file cl_team.cpp.
References Cvar_Set(), Item::def(), Inventory::getLeftHandContainer(), Inventory::getRightHandContainer(), character_s::inv, and objDef_s::model.
Referenced by CL_UpdateCharacterValues().
const char* CL_ActorGetSkillString | ( | const int | skill | ) |
Return the skill string for the given skill level.
[in] | skill | a skill value between 0 and MAX_SKILL |
Definition at line 165 of file cl_team.cpp.
References _, Com_Printf(), and MAX_SKILL.
Referenced by CL_CharacterSkillAndScoreCvars(), CL_UGVCvars(), and GAME_GetImportData().
actorSkin_t* CL_AllocateActorSkin | ( | const char * | name | ) |
Allocate a skin from the cls structure.
Definition at line 44 of file cl_team.cpp.
References client_static_s::actorSkins, cls, com_genericPool, actorSkin_s::id, actorSkin_s::idx, index, lengthof, Mem_PoolStrDup, client_static_s::numActorSkins, OBJZERO, R_ModAllocateActorSkin(), and Sys_Error().
Referenced by CL_ParseActorSkin().
Change the skin of the selected actor.
Definition at line 309 of file cl_team.cpp.
References character_s::bodySkin, CL_FixActorSkinIDX(), cl_selected, Cvar_GetInteger(), Cvar_SetValue(), cvar_s::integer, and LIST_GetByIdx().
Referenced by TEAM_InitStartup().
Use current skin for all team members onboard.
Definition at line 326 of file cl_team.cpp.
References CL_FixActorSkinIDX(), Cvar_GetInteger(), and LIST_Foreach.
Referenced by TEAM_InitStartup().
|
static |
Definition at line 82 of file cl_team.cpp.
References ABILITY_ACCURACY, ABILITY_MIND, ABILITY_POWER, ABILITY_SPEED, character_s::bodySkin, CHRSH_CharGetBody(), CHRSH_CharGetHead(), CL_ActorGetSkillString(), Cvar_ForceSet(), Cvar_Set(), Cvar_SetValue(), character_s::headSkin, character_s::HP, chrScoreGlobal_s::initialSkills, character_s::maxHP, character_s::name, character_s::score, SKILL_ASSAULT, SKILL_CLOSE, SKILL_EVADING, SKILL_EXPLOSIVE, SKILL_HEAVY, SKILL_PILOTING, SKILL_SNIPER, SKILL_TARGETING, chrScoreGlobal_s::skills, and va().
Referenced by CL_UpdateCharacterValues().
Fix actorskin idx according to game mode.
Definition at line 290 of file cl_team.cpp.
References CL_GetActorSkinByIDS(), GAME_IsMultiplayer(), GAME_IsSingleplayer, actorSkin_s::multiplayer, and actorSkin_s::singleplayer.
Referenced by CL_ChangeSkin_f(), and CL_ChangeSkinForWholeTeam_f().
void CL_GenerateCharacter | ( | character_t * | chr, |
const char * | teamDefName | ||
) |
Generates the skills and inventory for a character and for a 2x2 unit.
[in] | chr | The employee to create character data for. |
[in] | teamDefName | Which team to use for creation. |
Definition at line 235 of file cl_team.cpp.
References ACTOR_HAND_NOT_SET, CHRSH_CharGenAbilitySkills(), cls, Com_GetCharacterValues(), InventoryInterface::destroyInventory(), GAME_IsMultiplayer(), client_static_s::i, character_s::init(), character_s::inv, client_static_s::nextUniqueCharacterNumber, character_s::reservedTus, character_s::RFmode, FiremodeSettings::set(), chrReservations_s::shotSettings, character_s::state, STATE_REACTION, and character_s::ucn.
Referenced by GAME_AppendTeamMember(), GAME_GetImportData(), and GetCharacter().
|
static |
Get a actorskin from idx.
Definition at line 72 of file cl_team.cpp.
References client_static_s::actorSkins, cls, and client_static_s::numActorSkins.
Referenced by CL_FixActorSkinIDX(), and CL_InitSkin_f().
Get number of registered actorskins.
Definition at line 63 of file cl_team.cpp.
References cls, and client_static_s::numActorSkins.
Referenced by CL_ParseActorSkin(), and GAME_LoadCharacter().
Init skins into the GUI.
Definition at line 258 of file cl_team.cpp.
References CL_GetActorSkinByIDS(), actorSkin_s::id, actorSkin_s::idx, actorSkin_s::multiplayer, actorSkin_s::name, OPTION_MULTIPLAYER_SKINS, OPTION_SINGLEPLAYER_SKINS, actorSkin_s::singleplayer, UI_AddOption(), UI_GetOption(), UI_RegisterOption(), and va().
Referenced by TEAM_InitStartup().
|
static |
Updates the UGV cvars for the given "character". The models and stats that are displayed in the menu are stored in cvars. These cvars are updated here when you select another character.
[in] | chr | Pointer to character_t (may not be null) |
Definition at line 210 of file cl_team.cpp.
References ABILITY_MIND, CL_ActorGetSkillString(), Cvar_Set(), character_s::score, and chrScoreGlobal_s::skills.
Referenced by CL_UpdateCharacterValues().
void CL_UpdateCharacterValues | ( | const character_t * | chr | ) |
Definition at line 218 of file cl_team.cpp.
References CL_ActorCvars(), CL_CharacterSkillAndScoreCvars(), CL_UGVCvars(), GAME_CharacterCvars(), teamDef_s::robot, and character_s::teamDef.
Referenced by CL_ActorSelect(), CL_ActorUpdate_f(), GAME_ActorSelect_f(), and GAME_GetImportData().
Definition at line 339 of file cl_team.cpp.
References CL_ChangeSkin_f(), CL_ChangeSkinForWholeTeam_f(), CL_InitSkin_f(), and Cmd_AddCommand().
Referenced by CL_InitLocal().
linkedList_t* chrDisplayList |
List of currently displayed or equipable characters.
Definition at line 38 of file cl_team.cpp.
Referenced by CL_ActorUpdate_f(), GAME_ActorSelect_f(), GAME_AppendTeamMember(), GAME_GetSelectedChr(), GAME_IsTeamEmpty(), GAME_LoadTeamInfo(), GAME_ResetCharacters(), GAME_SaveTeam(), GAME_SaveTeam_f(), GAME_SaveTeamInfo(), GAME_SaveTeamState_f(), GAME_Spawn(), GAME_ToggleActorForTeam_f(), GAME_UpdateActiveTeamList(), GAME_UpdateInventory(), and GAME_UpdateTeamMenuParameters_f().