DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
SquintState.c
См. документацию.
2{
3 //this is just for the Symptom parameters set-up and is called even if the Symptom doesn't execute, don't put any gameplay code in here
4 override void OnInit()
5 {
6 m_Priority = 0;
7 m_SymptomType = SymptomTypes.SECONDARY;
8 m_ID = SymptomIDs.SYMPTOM_SQUINT;
10 m_IsPersistent = false;
12 m_SyncToClient = true;
13 }
14
15 override bool AllowInUnconscious()
16 {
17 return true;
18 }
19
20 override void OnUpdateClient(PlayerBase player, float deltatime)
21 {
22 if (player.IsUnconscious())
23 return;
24
27 query.m_Placement = ECachedEquipmentPlacement.ATTACHMENT;
28 query.m_MaximumDepth = 2;
29
30 float protectionLevel = 0.0;
31 ItemBase coverItem = null;
32 array<Entity> coverItems = player.GetCachedEquipment().GetEntitiesByCategory(query);
33 int coverItemsCount = coverItems.Count();
34 for (int i = 0; i < coverItemsCount; ++i)
35 {
36 coverItem = ItemBase.Cast(coverItems[i]);
37 protectionLevel = coverItem.GetProtectionLevel(DEF_DUST_PARTICLE_EYES);
38 if (protectionLevel > 0.0)
39 break;
40 }
41
42 float sandstormIntensity;
43 ScriptedSandstormController sandstorm = ScriptedSandstormController.Cast(g_Game.GetWeather().GetSandstorm());
44 if (sandstorm)
45 sandstormIntensity = sandstorm.GetIntensityForPlayer(player);
46
47 float squintIntensity = Math.Clamp(sandstormIntensity - protectionLevel, 0.0, 1.0);
48
49 Param1<float> params = new Param1<float>(squintIntensity);
50 g_Game.GetMission().GetEffectWidgets().UpdateWidgets(EffectWidgetsTypes.SQUINTING, deltatime, params, EffectWidgetHandles.SQUINTING);
51 }
52
54 override void OnGetActivatedServer(PlayerBase player)
55 {
57 Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
58 }
59
60 override void OnGetActivatedClient(PlayerBase player)
61 {
63 Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetActivated", m_Player.ToString());
64
65 g_Game.GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.SQUINTING});
66 }
67
68 override void OnGetDeactivatedServer(PlayerBase player)
69 {
71 Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
72 }
73
75 override void OnGetDeactivatedClient(PlayerBase player)
76 {
78 Debug.SymptomLog("n/a", this.ToString(), "n/a", "OnGetDeactivated", m_Player.ToString());
79
80 g_Game.GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.SQUINTING});
81 }
82
83}
DayZGame g_Game
Определения DayZGame.c:4074
ECachedEquipmentItemCategory
Определения ECachedEquipmentItemCategory.c:2
ECachedEquipmentPlacement
Определения ECachedEquipmentPlacement.c:2
proto string ToString()
SymptomTypes
Определения StateManager.c:35
ECachedEquipmentItemCategory m_Category
Определения CachedEquipmentStorageBase.c:5
ECachedEquipmentPlacement m_Placement
Определения CachedEquipmentStorageBase.c:6
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:193
Определения 3_Game/DayZ/tools/Debug.c:2
static bool IsSymptomLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:819
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
override float GetIntensityForPlayer(Man player)
Определения ScriptedSandstormController.c:142
override void OnInit()
Определения SquintState.c:4
override void OnGetDeactivatedServer(PlayerBase player)
Определения SquintState.c:68
override void OnGetActivatedServer(PlayerBase player)
gets called once on an Symptom which is being activated
Определения SquintState.c:54
override void OnGetDeactivatedClient(PlayerBase player)
only gets called once on an active Symptom that is being deactivated
Определения SquintState.c:75
override void OnUpdateClient(PlayerBase player, float deltatime)
Определения SquintState.c:20
override bool AllowInUnconscious()
Определения SquintState.c:15
override void OnGetActivatedClient(PlayerBase player)
Определения SquintState.c:60
Определения SquintState.c:2
bool m_IsPersistent
Определения StateBase.c:19
bool m_SyncToClient
Определения StateBase.c:21
float m_ServerUpdateInterval
Определения StateBase.c:9
int m_Priority
Определения StateBase.c:4
bool m_DestroyOnAnimFinish
Определения StateBase.c:16
int m_ID
Определения StateBase.c:13
int m_SymptomType
Определения StateBase.c:18
void SymptomBase()
Определения StateBase.c:30
PlayerBase m_Player
Определения StateBase.c:8
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const int DEF_DUST_PARTICLE_EYES
Определения 3_Game/DayZ/constants.c:550
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'.