UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_battlescape.h File Reference
Include dependency graph for cl_battlescape.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  clientinfo_t
struct  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.
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).
bool CL_BattlescapeRunning (void)
 Check whether we already have actors spawned on the battlefield.
int CL_GetHitProbability (const le_t *actor)
 Calculates chance to hit if the actor has a fire mode activated.
bool CL_OutsideMap (const vec3_t impact, const float delta)
 Checks whether give position is still inside the map borders.
int CL_CountVisibleEnemies (void)
 Counts visible enemies on the battlescape.
char * CL_GetConfigString (int index)
int CL_GetConfigStringInteger (int index)
char * CL_SetConfigString (int index, dbuffer *msg)

Variables

clientBattleScape_t cl

Function Documentation

◆ CL_BattlescapeRunning()

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.

◆ CL_BattlescapeSearchAtGridPos()

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_t::clientAction, Com_Error(), ERR_DROP, le_t::fieldSize, LE_GetNextInUse(), LE_IsLivingAndVisibleActor(), LE_IsStunned, le_t::pos, VectorCompare, and VectorSet.

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

◆ CL_CountVisibleEnemies()

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(), le_t::team, and TEAM_CIVILIAN.

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

◆ CL_GetConfigString()

◆ CL_GetConfigStringInteger()

int CL_GetConfigStringInteger ( int index)

◆ CL_GetHitProbability()

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_t::actorMode, CL_ActorGetChr(), CL_ActorInjuryModifier(), CL_LookupErrorFunction(), CL_TestLine(), Com_Error(), fireDef_t::crouch, ERR_DROP, le_t::fd, FIRESH_IsMedikit, GET_ACC, IS_MODE_FIRE_PENDING, LE_GetFromPos(), LE_IsCrouched, LE_IsInvisible, LE_IsSelected, LOOKUP_EPSILON, MODIFIER_ACCURACY, le_t::mousePendPos, mousePos, le_t::origin, PLAYER_CROUCHING_HEIGHT, PLAYER_STANDING_HEIGHT, PLAYER_WIDTH, character_t::score, SKILL_BALANCE, chrScoreGlobal_t::skills, fireDef_t::spread, TL_FLAG_NONE, torad, UNIT_HEIGHT, VectorCopy, WEAPON_BALANCE, and fireDef_t::weaponSkill.

Referenced by HUD_UpdateActorFireMode().

◆ CL_OnBattlescape()

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, and Com_ServerState().

Referenced by cgame_import_t::bool(), 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().

◆ CL_OutsideMap()

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 cl, and mapZBorder.

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

◆ CL_SetConfigString()

char * CL_SetConfigString ( int index,
dbuffer * msg )

Variable Documentation

◆ cl

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_BattlescapeRunning(), 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_GetConfigString(), 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_OutsideMap(), 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_SetConfigString(), CL_SoundEvent(), CL_SpawnParseEntitystring(), CL_SpawnSoldiers_f(), CL_StartGame(), CL_StartMatch_f(), CL_TargetingGrenade(), CL_TargetingStraight(), CL_TestLine(), 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_t::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_Begin_f(), SV_BroadcastPrintf(), SV_BroadcastPrintf(), SV_CheckSpawnSoldiers(), SV_CheckStartMatch(), SV_CheckTimeouts(), SV_ClientPrintf(), SV_ClientPrintf(), SV_CountPlayers(), SV_Disconnect_f(), SV_DropClient(), SV_ExecuteClientMessage(), SV_ExecuteUserCommand(), SV_FinalMessage(), SV_GetPlayerClientStructure(), SV_Kick_f(), SV_Map(), SV_Multicast(), SV_New_f(), SV_PingPlayers(), SV_PlayerPrintf(), SV_ReadPacket(), SV_ShowServerinfo_f(), SV_StartGame_f(), SV_StartMatch_f(), SV_Status_f(), SV_UserInfo_f(), SV_UserinfoChanged(), SVC_DirectConnect(), SVC_Info(), SVC_Status(), SVC_TeamInfo(), UI_BuildRadarImageList(), UI_InitRadar(), and Weather::update().