UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cl_battlescape.h File Reference

Go to the source code of this file.

Data Structures

struct  clientinfo_t
 
struct  clientBattleScape_s
 This is the structure that should be used for data that is needed for tactical missions only. More...
 

Typedefs

typedef struct clientBattleScape_s clientBattleScape_t
 This is the structure that should be used for data that is needed for tactical missions only. More...
 

Functions

le_tCL_BattlescapeSearchAtGridPos (const pos3_t pos, bool includingStunned, const le_t *actor)
 Searches a local entity at the given position. More...
 
bool CL_OnBattlescape (void)
 Check whether we are in a tactical mission as server or as client. But this only means that we are able to render the map - not that the game is running (the team can still be missing - see CL_BattlescapeRunning) More...
 
bool CL_BattlescapeRunning (void)
 Check whether we already have actors spawned on the battlefield. More...
 
int CL_GetHitProbability (const le_t *actor)
 Calculates chance to hit if the actor has a fire mode activated. More...
 
bool CL_OutsideMap (const vec3_t impact, const float delta)
 Checks whether give position is still inside the map borders. More...
 
int CL_CountVisibleEnemies (void)
 Counts visible enemies on the battlescape. More...
 
char * CL_GetConfigString (int index)
 
int CL_GetConfigStringInteger (int index)
 
char * CL_SetConfigString (int index, dbuffer *msg)
 

Variables

clientBattleScape_t cl
 

Typedef Documentation

This is the structure that should be used for data that is needed for tactical missions only.

Note
the client_state_t structure is wiped completely at every server map change
See also
client_static_t

Function Documentation

bool CL_BattlescapeRunning ( void  )

Check whether we already have actors spawned on the battlefield.

See also
CL_OnBattlescape
Returns
true when we are in battlefield and have soldiers spawned (game is running)

Definition at line 82 of file cl_battlescape.cpp.

le_t* CL_BattlescapeSearchAtGridPos ( const pos3_t  pos,
bool  includingStunned,
const le_t actor 
)

Searches a local entity at the given position.

Parameters
[in]posThe grid position to search a local entity at
[in]includingStunnedAlso search for stunned actors if true.
[in]actorThe current selected actor

Definition at line 37 of file cl_battlescape.cpp.

References ACTOR_SIZE_2x2, ACTOR_SIZE_NORMAL, le_s::clientAction, Com_Error(), ERR_DROP, le_s::fieldSize, LE_GetNextInUse(), LE_IsLivingAndVisibleActor(), LE_IsStunned, le_s::pos, VectorCompare, and VectorSet.

Referenced by CL_ActorMouseTrace(), CL_TargetingGrenade(), and CL_TargetingStraight().

int CL_CountVisibleEnemies ( void  )

Counts visible enemies on the battlescape.

Returns
The amount of visible enemies (from all the other teams)

Definition at line 319 of file cl_battlescape.cpp.

References cls, count, LE_GetNextInUse(), LE_IsLivingAndVisibleActor(), client_static_s::team, le_s::team, and TEAM_CIVILIAN.

Referenced by CL_ActorAppear(), CL_ActorDie(), and CL_EntPerish().

int CL_GetConfigStringInteger ( int  index)
int CL_GetHitProbability ( const le_t actor)

Calculates chance to hit if the actor has a fire mode activated.

Parameters
[in]actorThe local entity of the actor to calculate the hit probability for.
Todo:
The hit probability should work somewhat differently for splash damage weapons. Since splash damage weapons can deal damage even when they don't directly hit an actor, the hit probability should be defined as the predicted percentage of the maximum splash damage of the firemode, assuming the projectile explodes at the desired location. This means that a percentage should be displayed for EVERY actor in the predicted blast radius. This will likely require specialized code.
Todo:
use LE_FindRadius

Definition at line 176 of file cl_battlescape.cpp.

References ABILITY_ACCURACY, le_s::actorMode, CL_ActorGetChr(), CL_ActorInjuryModifier(), CL_LookupErrorFunction(), CL_TestLine(), Com_Error(), fireDef_s::crouch, ERR_DROP, f, le_s::fd, FIRESH_IsMedikit, GET_ACC, IS_MODE_FIRE_PENDING, LE_GetFromPos(), LE_IsCrouched, LE_IsInvisible, LE_IsSelected, LOOKUP_EPSILON, MODIFIER_ACCURACY, le_s::mousePendPos, mousePos, le_s::origin, PLAYER_CROUCHING_HEIGHT, PLAYER_STANDING_HEIGHT, PLAYER_WIDTH, character_s::score, SKILL_BALANCE, chrScoreGlobal_s::skills, fireDef_s::spread, TL_FLAG_NONE, torad, UNIT_HEIGHT, VectorCopy, WEAPON_BALANCE, and fireDef_s::weaponSkill.

Referenced by HUD_UpdateActorFireMode().

bool CL_OnBattlescape ( void  )

Check whether we are in a tactical mission as server or as client. But this only means that we are able to render the map - not that the game is running (the team can still be missing - see CL_BattlescapeRunning)

Note
handles multiplayer and singleplayer
See also
CL_BattlescapeRunning
Returns
true when we are in battlefield

Definition at line 95 of file cl_battlescape.cpp.

References ca_connected, cls, Com_ServerState(), and client_static_s::state.

Referenced by CL_ActionDown_f(), CL_LevelDown_f(), CL_LevelUp_f(), CL_SpawnSoldiers_f(), GAME_GetImportData(), HUD_ActorSelectionChangeListener(), HUD_LeftHandChangeListener(), HUD_RightHandChangeListener(), HUD_TUChangeListener(), Irc_Client_Invite_f(), Key_Event(), M_Change_f(), M_PlayRandomByCategory(), S_Frame(), and SCR_UpdateScreen().

bool CL_OutsideMap ( const vec3_t  position,
const float  delta 
)

Checks whether give position is still inside the map borders.

Parameters
[in]positionThe position to check (world coordinate)
[in]deltaThe delta from the map boundaries. Positive values to make the position being earlier out of the map, negative values to let the position be later out of the map
Returns
true if the given position is out of the map boundaries, false otherwise.

Definition at line 296 of file cl_battlescape.cpp.

References AABB::getMaxX(), AABB::getMaxY(), AABB::getMinX(), AABB::getMinY(), mapData_s::mapBox, clientBattleScape_s::mapData, and mapZBorder.

Referenced by CL_ActorDoShootTime(), CL_ActorMouseTrace(), CL_ActorShootHidden(), and LET_Projectile().

Variable Documentation

Definition at line 29 of file cl_battlescape.cpp.

Referenced by CL_ActorAdd(), CL_ActorAddToTeamList(), CL_ActorAppear(), CL_ActorConditionalMoveCalc(), CL_ActorConfirmAction(), CL_ActorConfirmAction_f(), CL_ActorDie(), CL_ActorDieTime(), CL_ActorDoMove(), CL_ActorEndShootTime(), CL_ActorGetChr(), CL_ActorGetFromCharacter(), CL_ActorGetNumber(), CL_ActorMaximumMove(), CL_ActorMouseTrace(), CL_ActorMoveLength(), CL_ActorMoveMode(), CL_ActorRemoveFromTeamList(), CL_ActorSelect(), CL_ActorSelectList(), CL_ActorSelectNext(), CL_ActorSelectPrev(), CL_ActorStandCrouch_f(), CL_ActorStats(), CL_ActorTraceMove(), CL_AddActor(), CL_AddBrushModel(), CL_AddMapParticle(), CL_AddPathingBox(), CL_AddTargetingBox(), CL_AddUGV(), CL_AreBattlescapeEventsBlocked(), CL_BattlescapeMouseDragging(), CL_BattlescapeRadarGenerateAll(), CL_BattlescapeRadarMapInFrameBuffer(), CL_BlockBattlescapeEvents(), CL_CameraMove(), CL_CameraRoute(), CL_CameraZoomIn(), CL_CameraZoomOut(), CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_CanMultiplayerStart(), CL_CenterCameraIntoMap_f(), CL_CheckCameraRoute(), CL_ClampCamToMap(), CL_ClearState(), CL_ClipMoveToLEs(), CL_CompleteRecalcRouting(), CL_CvarWorldLevel(), CL_DisplayFloorArrows(), CL_DisplayObstructionArrows(), CL_DoEndRound(), CL_EntAppear(), CL_EntAppearTime(), CL_EntPerish(), CL_Explode(), CL_ExplodeTime(), CL_Frame(), CL_GetEventTime(), CL_GetWorldCoordsUnderMouse(), CL_GridRecalcRouting(), CL_HullForEntity(), CL_InvAddTime(), CL_InvDelTime(), CL_LevelUp_f(), CL_LogEvent(), CL_MoveView(), CL_NextAlien_f(), CL_NextAlienVisibleFromActor_f(), CL_ParseClientinfo(), CL_ParseConfigString(), CL_ParseEvent(), CL_ParseServerData(), CL_ParticleAppearTime(), CL_ParticleRun2(), CL_ParticleSpawn(), CL_ParticleSpawnEventTime(), CL_PlayerGetName(), CL_PrevAlien_f(), CL_RequestNextDownload(), CL_Reset(), CL_RunMapParticles(), CL_SoundEvent(), CL_SpawnParseEntitystring(), CL_SpawnSoldiers_f(), CL_StartGame(), CL_StartMatch_f(), CL_TargetingGrenade(), CL_TargetingStraight(), CL_Trace(), CL_ViewCalcFieldOfViewX(), CL_ViewCenterAtGridPosition(), CL_ViewLoadMedia(), CL_ViewRender(), CL_ViewUpdateRenderData(), uiRadarNode::draw(), GAME_InitializeBattlescape(), GAME_SetMode(), GAME_SpawnSoldiers(), GAME_StartBattlescape(), GAME_StartMatch(), HUD_ActorSelectionChangeListener(), HUD_MapDebugCursor(), HUD_Update(), client_static_s::isOurRound(), LE_ActorGetStepTime(), LE_Add(), LE_AddEdictHighlight(), LE_AddGrenade(), LE_AddProjectile(), LE_AddToScene(), LE_CenterView(), LE_Cleanup(), LE_GenerateInlineModelList(), LE_GetClipModel(), LE_GetDrawModel(), LE_GetNext(), LE_PlaceItem(), LET_BrushModel(), LET_PathMove(), LET_Projectile(), LET_RotateDoor(), LET_SlideDoor(), LM_AddModel(), LM_AddToSceneOrder(), LM_Find(), LM_GetByID(), LM_Register(), LM_Think(), uiRadarNode::onCapturedMouseMove(), PTL_Trace(), R_RenderFrame(), S_Frame(), S_SpatializeChannel(), SEQ_Execute(), SEQ_InitContext(), SEQ_Render3D(), SEQ_SetCamera(), SP_worldspawn(), SV_BroadcastPrintf(), SV_CheckSpawnSoldiers(), SV_CheckStartMatch(), SV_CheckTimeouts(), SV_CountPlayers(), SV_DropClient(), SV_FinalMessage(), SV_GetPlayerClientStructure(), SV_Kick_f(), SV_Map(), SV_Multicast(), SV_PingPlayers(), SV_PlayerPrintf(), SV_ReadPacket(), SV_StartGame_f(), SV_Status_f(), SV_UserInfo_f(), SVC_DirectConnect(), SVC_Info(), SVC_Status(), SVC_TeamInfo(), UI_BuildRadarImageList(), UI_InitRadar(), and Weather::update().