#include "../client.h"
#include "cl_battlescape.h"
#include "cl_actor.h"
Go to the source code of this file.
Defines | |
#define | LOOKUP_EPSILON 0.0001f |
Functions | |
qboolean | CL_BattlescapeRunning (void) |
Check whether we already have actors spawned on the battlefield. | |
qboolean | 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 ). | |
static float | CL_LookupErrorFunction (float z) |
calculate approximate erf, the error function http://en.wikipedia.org/wiki/Error_function uses lookup table and linear interpolation approximation good to around 0.001. easily good enough for the job. | |
static qboolean | CL_TestLine (const vec3_t start, const vec3_t stop, const int levelmask) |
int | CL_GetHitProbability (const le_t *actor) |
Calculates chance to hit if the actor has a fire mode activated. | |
qboolean | CL_OutsideMap (const vec3_t position, const float delta) |
Checks whether give position is still inside the map borders. | |
char * | CL_GetConfigString (int index) |
int | CL_GetConfigStringInteger (int index) |
char * | CL_SetConfigString (int index, struct dbuffer *msg) |
Variables | |
client_state_t | cl |
static const float | lookup [30] |
table for lookup_erf lookup[]= {erf(0), erf(0.1), ...} | |
static const float | lookupdiff [30] |
table for lookup_erf lookup[]= {10*(erf(0.1)-erf(0.0)), 10*(erf(0.2)-erf(0.1)), ...} | |
static const float | mapZBorder = -(UNIT_HEIGHT * 5) |
Definition in file cl_battlescape.c.
#define LOOKUP_EPSILON 0.0001f |
Definition at line 63 of file cl_battlescape.c.
Referenced by CL_GetHitProbability(), and CL_LookupErrorFunction().
qboolean CL_BattlescapeRunning | ( | void | ) |
Check whether we already have actors spawned on the battlefield.
true
when we are in battlefield and have soldiers spawned (game is running) Definition at line 36 of file cl_battlescape.c.
References cl.
Referenced by CL_ActorInvMove(), CL_ActorNext_f(), CL_ActorSelect_f(), CL_NextRound_f(), HUD_ActorGetCvarData_f(), SCR_DrawCursor(), UI_BaseInventoryNodeInit(), UI_ContainerNodeAutoPlace(), UI_ContainerNodeDNDFinished(), UI_DrawFree(), and UI_PushNoHud_f().
char* CL_GetConfigString | ( | int | index | ) |
Definition at line 298 of file cl_battlescape.c.
References cl, Com_Error(), ERR_DROP, and MAX_CONFIGSTRINGS.
Referenced by CL_CanMultiplayerStart(), CL_DownloadMap(), CL_LogEvent(), CL_PlayerGetName(), CL_ShowConfigstrings_f(), CL_ViewLoadMedia(), SCR_DrawLoading(), and UI_InitRadar().
int CL_GetConfigStringInteger | ( | int | index | ) |
Definition at line 305 of file cl_battlescape.c.
References cl, Com_Error(), ERR_DROP, and MAX_CONFIGSTRINGS.
Referenced by CL_CanMultiplayerStart(), CL_ViewLoadMedia(), SP_misc_particle(), SP_misc_sound(), and SP_worldspawn().
int CL_GetHitProbability | ( | const le_t * | actor | ) |
Calculates chance to hit if the actor has a fire mode activated.
[in] | actor | The local entity of the actor to calculate the hit probability for. |
Definition at line 130 of file cl_battlescape.c.
References ABILITY_ACCURACY, ABILITY_MIND, le_s::actorMode, CL_ActorGetChr(), CL_LookupErrorFunction(), CL_TestLine(), Com_Error(), fireDef_s::crouch, ERR_DROP, f, le_s::fd, FIRESH_IsMedikit, GET_ACC, GET_INJURY_MULT, le_s::HP, IS_MODE_FIRE_PENDING, LE_GetFromPos(), LE_IsCrouched, LOOKUP_EPSILON, le_s::maxHP, le_s::mousePendPos, mousePos, le_s::origin, PLAYER_CROUCHING_HEIGHT, PLAYER_STANDING_HEIGHT, PLAYER_WIDTH, character_s::score, le_s::selected, 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().
static float CL_LookupErrorFunction | ( | float | z | ) | [static] |
calculate approximate erf, the error function http://en.wikipedia.org/wiki/Error_function uses lookup table and linear interpolation approximation good to around 0.001. easily good enough for the job.
[in] | z | the number to calculate the erf of. |
Definition at line 98 of file cl_battlescape.c.
References f, int(), lookup, LOOKUP_EPSILON, and lookupdiff.
Referenced by CL_GetHitProbability().
qboolean 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
).
Definition at line 49 of file cl_battlescape.c.
References ca_connected, cls, Com_ServerState(), qfalse, qtrue, and client_static_s::state.
Referenced by CL_LevelDown_f(), CL_LevelUp_f(), CL_SpawnSoldiers_f(), Con_MessageModeSay_f(), Con_MessageModeSayTeam_f(), HUD_ActorSelectionChangeListener(), HUD_LeftHandChangeListener(), HUD_RightHandChangeListener(), HUD_TUChangeListener(), Irc_Client_Invite_f(), Key_Event(), S_Frame(), SAV_GameContinue_f(), SAV_GameQuickLoad_f(), SAV_QuickSave(), and SCR_UpdateScreen().
Checks whether give position is still inside the map borders.
[in] | position | The position to check (world coordinate) |
[in] | delta | The 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 |
true
if the given position is out of the map boundaries, false
otherwise. Definition at line 250 of file cl_battlescape.c.
References cl, mapZBorder, qfalse, and qtrue.
Referenced by CL_ActorDoShootTime(), CL_ActorMouseTrace(), CL_GetEventTime(), and LET_Projectile().
char* CL_SetConfigString | ( | int | index, | |
struct dbuffer * | msg | |||
) |
Definition at line 312 of file cl_battlescape.c.
References cl, Com_Error(), CS_POSITIONS, CS_TILES, ERR_DROP, MAX_CONFIGSTRINGS, MAX_TILESTRINGS, MAX_TOKEN_CHARS, and NET_ReadString().
Referenced by CL_ParseConfigString().
static qboolean CL_TestLine | ( | const vec3_t | start, | |
const vec3_t | stop, | |||
const int | levelmask | |||
) | [inline, static] |
Definition at line 115 of file cl_battlescape.c.
References cl, and TR_TestLine().
Referenced by CL_GetHitProbability().
Definition at line 29 of file cl_battlescape.c.
Referenced by B_AssembleMap(), CL_ActorAdd(), CL_ActorAddToTeamList(), CL_ActorAppear(), CL_ActorAppearTime(), CL_ActorCheckAction(), CL_ActorConditionalMoveCalc(), CL_ActorConfirmAction(), CL_ActorConfirmAction_f(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoShootTime(), CL_ActorDoThrowTime(), CL_ActorGetChr(), CL_ActorGetNumber(), CL_ActorMouseTrace(), CL_ActorMoveMouse(), CL_ActorRemoveFromTeamList(), CL_ActorSelectList(), CL_ActorSelectNext(), CL_ActorShootHiddenTime(), CL_ActorStartShoot(), CL_ActorStartShootTime(), CL_ActorTraceMove(), CL_AddActor(), CL_AddBrushModel(), CL_AddMapParticle(), CL_AddPathingBox(), CL_AddTargetingBox(), CL_AddUGV(), CL_AreBattlescapeEventsBlocked(), CL_BattlescapeRunning(), CL_BlockBattlescapeEvents(), CL_CameraMove(), CL_CameraRoute(), CL_CameraZoomIn(), CL_CameraZoomOut(), CL_CamSetAngles_f(), CL_CamSetZoom_f(), CL_CanMultiplayerStart(), CL_CenterCameraIntoMap_f(), CL_ClampCamToMap(), CL_ClearState(), CL_ClipMoveToLEs(), CL_CompleteRecalcRouting(), CL_CvarWorldLevel(), CL_DisplayFloorArrows(), CL_DisplayObstructionArrows(), CL_DoEndRound(), CL_DoorClose(), CL_DoorOpen(), CL_EntAppear(), CL_EntPerish(), CL_Frame(), CL_GetConfigString(), CL_GetConfigStringInteger(), CL_GetEventTime(), CL_HullForEntity(), CL_InvReloadTime(), CL_LevelUp_f(), CL_LogEvent(), CL_NextAlien_f(), CL_NextAlienVisibleFromActor_f(), CL_NextRound_f(), CL_OutsideMap(), CL_ParseClientinfo(), CL_ParseConfigString(), CL_ParseEvent(), CL_ParseServerData(), CL_ParticleRun2(), CL_ParticleSpawn(), CL_RecalcRouting(), CL_RequestNextDownload(), CL_Reset(), CL_RunMapParticles(), CL_SequenceRender(), CL_SetConfigString(), CL_SpawnParseEntitystring(), CL_SpawnSoldiers_f(), CL_StartGame(), CL_TargetingGrenade(), CL_TargetingStraight(), CL_TestLine(), CL_Trace(), CL_UpdateCharacterStats(), CL_ViewCalcFieldOfViewX(), CL_ViewCenterAtGridPosition(), CL_ViewLoadMedia(), CL_ViewRender(), CL_ViewUpdateRenderData(), f_Ccall(), f_parser(), GAME_CP_Spawn(), GAME_InitializeBattlescape(), GAME_MP_EndRoundAnnounce(), GAME_Spawn(), GAME_SpawnSoldiers(), HUD_ActorGetCvarData_f(), HUD_ActorSelectionChangeListener(), HUD_DisplayFiremodes(), HUD_MapDebugCursor(), HUD_Update(), HUD_UpdateAllActors(), LE_ActorGetStepTime(), LE_Add(), LE_AddGrenade(), LE_AddProjectile(), LE_AddToScene(), LE_CenterView(), LE_Cleanup(), LE_GenerateInlineModelList(), LE_GetNext(), LE_PlaceItem(), LET_BrushModel(), LET_PathMove(), LET_Projectile(), LM_AddModel(), LM_AddToSceneOrder(), LM_Find(), LM_GetByID(), LM_Register(), LM_Think(), lua_pushcclosure(), luaD_precall(), luaV_execute(), propagatemark(), S_Frame(), S_SpatializeChannel(), SCR_DrawCursor(), SEQ_Execute(), SEQ_InitSequence(), SEQ_SetCamera(), SP_worldspawn(), SV_BroadcastPrintf(), SV_CheckGameStart(), SV_CountPlayers(), SV_DropClient(), SV_FinalMessage(), SV_GetPlayerClientStructure(), SV_Kick_f(), SV_Map(), SV_Multicast(), SV_PlayerPrintf(), SV_ReadPacket(), SV_StartGame_f(), SV_Status_f(), SV_UserInfo_f(), SVC_DirectConnect(), SVC_Info(), SVC_Status(), SVC_TeamInfo(), UI_BuildRadarImageList(), UI_GenAllRadarMap(), UI_GetRadarMapInFrameBuffer(), UI_InitRadar(), UI_RadarNodeCapturedMouseMove(), and UI_RadarNodeDraw().
const float lookup[30] [static] |
{ 0.0f, 0.1125f, 0.2227f, 0.3286f, 0.4284f, 0.5205f, 0.6039f, 0.6778f, 0.7421f, 0.7969f, 0.8427f, 0.8802f, 0.9103f, 0.9340f, 0.9523f, 0.9661f, 0.9763f, 0.9838f, 0.9891f, 0.9928f, 0.9953f, 0.9970f, 0.9981f, 0.9989f, 0.9993f, 0.9996f, 0.9998f, 0.9999f, 0.9999f, 1.0000f }
table for lookup_erf lookup[]= {erf(0), erf(0.1), ...}
Definition at line 69 of file cl_battlescape.c.
Referenced by CL_LookupErrorFunction().
const float lookupdiff[30] [static] |
{ 1.1246f, 1.1024f, 1.0592f, 0.9977f, 0.9211f, 0.8336f, 0.7395f, 0.6430f, 0.5481f, 0.4579f, 0.3750f, 0.3011f, 0.2369f, 0.1828f, 0.1382f, 0.1024f, 0.0744f, 0.0530f, 0.0370f, 0.0253f, 0.0170f, 0.0112f, 0.0072f, 0.0045f, 0.0028f, 0.0017f, 0.0010f, 0.0006f, 0.0003f, 0.0002f }
table for lookup_erf lookup[]= {10*(erf(0.1)-erf(0.0)), 10*(erf(0.2)-erf(0.1)), ...}
Definition at line 81 of file cl_battlescape.c.
Referenced by CL_LookupErrorFunction().
const float mapZBorder = -(UNIT_HEIGHT * 5) [static] |
Definition at line 240 of file cl_battlescape.c.
Referenced by CL_OutsideMap().