49 if (
g_Game.IsMultiplayer() ||
g_Game.IsDedicatedServer())
63 if (
g_Game.IsMultiplayer() ||
g_Game.IsDedicatedServer())
89 if (
g_Game.IsMultiplayer() ||
g_Game.IsDedicatedServer())
91 g_Game.GetPlayers(players);
92 foreach(Man player: players)
101 string playerUIDToAdd = identity.
GetId();
102 if (playerUIDs.Find(playerUIDToAdd) == -1)
103 playerUIDs.Insert(playerUIDToAdd);
108 playerUIDs.Insert(
"-1");
115 if (playerUIDs.Find(playerUIDToRemove) == -1)
129 protected void ApplyShelterFade(inout
float intensity,
bool isCurrentlySheltered,
float transitionProgress)
131 if (isCurrentlySheltered)
133 intensity =
Math.
Lerp(intensity, 0.0, transitionProgress);
137 intensity =
Math.
Lerp(0.0, intensity, transitionProgress);
144 super.GetIntensityForPlayer(player);
153 vector headPosition = MiscGameplayFunctions.GetPlayerHeadPosition(playerPB);
155 if (baseIntensity <= 0.0)
164 float modifiedIntensity = baseIntensity;
170 if (modifiedIntensity > 0.0)
174 if (modifiedIntensity > 0.0)
177 return modifiedIntensity;
186 bool isUnderground =
false;
189 isUnderground =
true;
191 float currentTime =
g_Game.GetTime();
201 vector playerPos = player.GetPosition();
203 float surfaceHeight =
g_Game.SurfaceY(playerPos[0], playerPos[2]);
205 if (playerPos[1] < surfaceHeight)
207 float depthBelowSurface = surfaceHeight - playerPos[1];
209 intensity *= (1.0 - fade);
223 bool isInInterior = player.IsSoundInsideBuilding();
228 bool isCurrentlyInside = (isUnderRoof && isInInterior);
230 float currentTime =
g_Game.GetTime();
233 if (isCurrentlyInside != wasInside)
241 if (!isCurrentlyInside && !wasInside)
265 if (!transport || transport && !transport.IsAnyInherited({Car}))
268 bool isInVehicle = transport != null;
269 float currentTime =
g_Game.GetTime();
310 override void OnStart(
bool continuedSession,
bool calledByWeather =
false)
312 super.OnStart(calledByWeather, continuedSession);
338 super.OnUpdate(deltaTime);
357 override void OnStop(
bool calledByWeather =
false)
359 super.OnStop(calledByWeather);
proto native Transport GetTransport()
proto string GetId()
unique id of player (hashed steamID, database Xbox id...) can be used in database or logs
The class that will be instanced (moddable)
float m_UndergroundTransitionTimer
void SetWasInInterior(bool value)
void SetWasInVehicle(bool value)
float m_VehicleTransitionTimer
void SetWasUnderRoof(bool value)
float m_InteriorTransitionTimer
proto native float GetIntensity(vector worldPosition)
Returns the intensity of the sandstorm at a given position in world space. The sandstorm must be acti...
void SandstormController()
Creation of SandstormController is disallowed in scripts. Retrieve current instance using Weather::Ge...
ScriptInvoker Class provide list of callbacks usage:
ScriptInvoker GetSandstormStopSI()
const float SURFACE_INTENSITY_MIN
ref ScriptInvoker m_OnSandstormStopSI
static const float MAX_SURFACE_DISTANCE
PlayerSandstormData GetPlayerData(string playerId)
const ref array< typename > EXCLUDED_SHELTER_TYPES
PlayerSandstormData GetPlayerSandstormData(PlayerBase player)
static const float MAX_SURFACE_DISTANCE_INVERSE
void ApplyShelterFade(inout float intensity, bool isCurrentlySheltered, float transitionProgress)
ref ScriptInvoker m_OnSandstormStartSI
void ApplyUndergroundModifier(inout float intensity, PlayerBase player, PlayerSandstormData playerData)
const float SURFACE_TRANSITION_DISTANCE
override float GetIntensityForPlayer(Man player)
override void OnStop(bool calledByWeather=false)
void ScriptedSandstormController()
static const float SURFACE_TRANSITION_FRACTION
const float INTERIOR_TRANSITION_MAX
void ApplySurfaceDistanceModifier(inout float intensity, PlayerBase player)
void CheckConnectedPlayers()
void CleanupDisconnectedPlayer(string playerId)
override void OnStart(bool continuedSession, bool calledByWeather=false)
static const float INTERIOR_TRANSITION_DURATION
const float INTERIOR_TRANSITION_MIN
static const float INTERIOR_TRANSITION_DURATON_FRACTION
const float SURFACE_INTENSITY_MAX
void ~ScriptedSandstormController()
override void OnUpdate(float deltaTime)
void ApplyBuildingCheckModifier(inout float intensity, PlayerBase player, PlayerSandstormData playerData)
ref PPERequester_SandstormEffect m_PPESandstormRequester
void ApplyVehicleModifier(inout float intensity, PlayerBase player, PlayerSandstormData playerData)
ref map< string, ref PlayerSandstormData > m_PlayerData
ScriptInvoker GetSandstormStartSI()
Native class for boats - handles physics simulation.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const float ROOF_CHECK_RAYCAST_DIST
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.