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