DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Sandstorm.c
См. документацию.
1/*
2 This class serves as the interface to the Sandstorm weather phenomenom.
3 Control of the phenomenon is driven by the server and replicated to all clients.
4 The controller instance can be obtained via `Weather::GetSandstorm`.
5*/
7{
12 private void SandstormController() { /*Disallowed.*/ }
13 private void ~SandstormController() { /*Disallowed.*/ }
14 /*
15 \brief Starts the sandstorm, gathering its full magnitude over `duration` seconds.
16 The sandstorm must be inactive prior to this call and this call is Server-only!
17 \param duration The duration in seconds over which the sandstorm gradually fades
18 in towards its target intensity.
19 */
20 proto native bool Start(float duration, bool calledByWeather);
27 proto native void Stop(float duration, bool calledByWeather);
32 proto native bool IsActive();
37 proto native vector GetDirection();
42 proto native bool IsPositionAtEnd();
47 proto native vector GetPosition();
52 proto native float GetSpeed();
57 proto native float GetRemainingMovementDuration();
65 proto native float GetPointOnEdge(vector worldPosition, out vector outPosition);
71 proto native float GetIntensity(vector worldPosition);
78 float GetIntensityForPlayer(Man player);
83 proto native float GetMagnitude();
90 protected event void OnStart(bool continuedSession, bool calledByWeather = false)
91 {
92 // Forward the callback to WorldData
93 if (g_Game.IsServer())
94 {
95 GetGame().GetMission().GetWorldData().WeatherSandstormStart(continuedSession);
96 }
97 }
98
103 protected event void OnUpdate(float deltaTime)
104 {
105 }
106
110 protected event void OnStop(bool calledByWeather = false)
111 {
112 // Forward the callback to WorldData
113 if (g_Game.IsServer())
114 {
115 GetGame().GetMission().GetWorldData().WeatherSandstormStop(calledByWeather);
116 }
117 }
118
124 private static event typename GetScriptedType()
125 {
126 //
127 // The following class is present in module 4_World and
128 // hence its typename cannot be used directly in 3_Game.
129 //
130 string className = "ScriptedSandstormController";
131 return className.ToType();
132 }
133};
134
DayZGame g_Game
Определения DayZGame.c:4074
SandstormController Sandstorm
Определения Sandstorm.c:135
proto native float GetIntensity(vector worldPosition)
Returns the intensity of the sandstorm at a given position in world space. The sandstorm must be acti...
proto native float GetPointOnEdge(vector worldPosition, out vector outPosition)
Projects the provided worldPosition to the edge of the sandstorm. The sandstorm must be active prior ...
proto native bool IsPositionAtEnd()
Returns whether the sandstorm has advanced and reached the end (final) position. The sandstorm must b...
proto native float GetRemainingMovementDuration()
Returns the remaining movement duration until the sandstorm reached its end (final) position at its c...
proto native vector GetPosition()
Returns the current position of the sandstorm in world space. The sandstorm must be active prior to t...
float GetIntensityForPlayer(Man player)
Returns the intensity of the sandstorm at a players head position in world space. Value is influenced...
event void OnUpdate(float deltaTime)
Callback raised every tick for as long as the sandstorm is active. Raised for both the server and the...
Определения Sandstorm.c:103
proto native float GetSpeed()
Returns the speed in m/s at which the sandstorm advances. The sandstorm must be active prior to this ...
proto native void Stop(float duration, bool calledByWeather)
Stops the sandstorm, leaving it to fade out over duration seconds. The sandstorm must be active prior...
static event GetScriptedType()
This method may be implemented to override the default sandstorm controller class instantiated by the...
Определения Sandstorm.c:124
void ~SandstormController()
Определения Sandstorm.c:13
event void OnStop(bool calledByWeather=false)
Callback raised when the sandstorm becomes inactive. Raised for both the server and the client.
Определения Sandstorm.c:110
event void OnStart(bool continuedSession, bool calledByWeather=false)
Callback raised when the sandstorm becomes active. Raised for both the server and the client.
Определения Sandstorm.c:90
proto native bool Start(float duration, bool calledByWeather)
proto native vector GetDirection()
Returns the direction from the start position to the end position of the sandstorm.
proto native bool IsActive()
Returns whether sandstorm is currently active.
proto native float GetMagnitude()
Returns the magnitude of the sandstorm - the intensity independent of its position.
void SandstormController()
Creation of SandstormController is disallowed in scripts. Retrieve current instance using Weather::Ge...
Определения Sandstorm.c:12
Определения Sandstorm.c:7
Определения EnConvert.c:119
DayZGame GetGame()
Определения gameplay.c:636
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...