DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Surface.c
См. документацию.
1class Surface
2{
3 static int GetStepsParticleID(string surface_name)
4 {
5 return SurfaceInfo.GetByName(surface_name).GetStepParticleId();
6 }
7
8 static int GetWheelParticleID(string surface_name)
9 {
10 return SurfaceInfo.GetByName(surface_name).GetWheelParticleId();
11 }
12
13 static int GetParamInt(string surface_name, string param_name)
14 {
15 return GetGame().ConfigGetInt("CfgSurfaces " + surface_name + " " + param_name);
16 }
17
18 static float GetParamFloat(string surface_name, string param_name)
19 {
20 return GetGame().ConfigGetFloat("CfgSurfaces " + surface_name + " " + param_name);
21 }
22
23 static string GetParamText(string surfaceName, string paramName)
24 {
25 string output = "";
26 GetGame().ConfigGetText("CfgSurfaces " + surfaceName + " " + paramName, output);
27 return output;
28
29 }
30
31 static bool AllowedWaterSurface(float pHeight, string pSurface, array<string> pAllowedSurfaceList)
32 {
33 if (pSurface)
34 {
35 pSurface.Replace("_ext", "");
36 pSurface.Replace("_int", "");
37 pSurface.Replace("sakhal_", "");
38 }
39
40 bool isSeaCheck = false;
41
42 foreach (string allowedSurface : pAllowedSurfaceList)
43 {
44 if (pSurface == "" && allowedSurface == UAWaterType.SEA)
45 isSeaCheck = pHeight <= (g_Game.SurfaceGetSeaLevel() + 0.25); //MaxWave_default
46
47 if (isSeaCheck || allowedSurface == pSurface)
48 return true;
49 }
50
51 return false;
52 }
53
54 static bool CheckLiquidSource(float pHeight, string pSurface, int allowedWaterSourceMask)
55 {
56 bool success = false;
57 if (pSurface == "")
58 {
59 if ( allowedWaterSourceMask & LIQUID_SALTWATER )
60 {
61 success = pHeight <= (g_Game.SurfaceGetSeaLevel() + 0.25); //MaxWave_default
62 }
63 }
64 else
65 {
66 int liquidType = SurfaceInfo.GetByName(pSurface).GetLiquidType();
67
68 success = allowedWaterSourceMask & liquidType;
69 }
70
71 return success;
72 }
73}
DayZGame g_Game
Определения DayZGame.c:3868
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
static string GetParamText(string surfaceName, string paramName)
Определения Surface.c:23
static int GetStepsParticleID(string surface_name)
Определения Surface.c:3
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
Определения Surface.c:31
static float GetParamFloat(string surface_name, string param_name)
Определения Surface.c:18
static bool CheckLiquidSource(float pHeight, string pSurface, int allowedWaterSourceMask)
Определения Surface.c:54
static int GetParamInt(string surface_name, string param_name)
Определения Surface.c:13
static int GetWheelParticleID(string surface_name)
Определения Surface.c:8
Определения Surface.c:2
proto int GetLiquidType()
See 'LiquidTypes' in 'constants.c'.
static proto SurfaceInfo GetByName(string name)
proto int GetStepParticleId()
proto int GetWheelParticleId()
Определения SurfaceInfo.c:9
const string SEA
Определения ActionConstants.c:162
Определения ActionConstants.c:161
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
const int LIQUID_SALTWATER
Определения constants.c:548
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.