3 const int TYPE_HEALTH = 1;
4 const int TYPE_BLOOD = 2;
5 const int TYPE_BODY_TEMP = 3;
6 const int TYPE_POSITION = 4;
7 const int TYPE_LAST_DAMAGE = 5;
9 const int LAST_DAMAGE_FALL = 1;
10 const int LAST_DAMAGE_HIT = 2;
12 const float VALUE_CHECK_INTERVAL = 1;
13 const float SENSITIVTY_PERCENTAGE = 1;
18 string m_CurrentLastDamage;
20 float m_LastHealthUpdate;
21 float m_LastBloodUpdate;
22 string m_lastDamageUpdate;
24 float m_HealthMaxValue;
25 float m_BloodMaxValue;
29 string m_LastDamageClient;
40 m_BloodMaxValue =
m_Player.GetMaxHealth(
"",
"Blood");
43 void OnScheduledTick(
float deltatime)
45 if (
GetGame().IsClient() )
return;
46 if ( !
GetGame().IsDebugMonitor() )
return;
71 return m_HealthClient;
74 string GetLastDamage()
76 return m_LastDamageClient;
79 void SetLastDamage(
string value)
81 m_CurrentLastDamage = value;
86 float health_current =
m_Player.GetHealth(
"",
"Health");
89 float diff_abs =
Math.AbsFloat(difference_normalized);
93 Param1<float> param =
new Param1<float>( health_current );
95 SendValue(TYPE_HEALTH, param);
102 float blood_current =
m_Player.GetHealth(
"",
"Blood");
103 float blood_normalized = blood_current / m_BloodMaxValue;
104 float difference_normalized = blood_normalized - m_LastBloodUpdate;
105 float diff_abs =
Math.AbsFloat(difference_normalized);
109 Param1<float> param =
new Param1<float>( blood_current );
111 SendValue(TYPE_BLOOD, param);
112 m_LastBloodUpdate = blood_normalized;
116 void CheckLastDamage()
118 if (m_CurrentLastDamage != m_lastDamageUpdate)
120 Param1<string> param =
new Param1<string>(m_CurrentLastDamage);
121 SendValue(TYPE_LAST_DAMAGE, param);
122 m_lastDamageUpdate = m_CurrentLastDamage;
126 void SendValue(
int value_type,
Param param)
133 Param1<float> value_float = Param1<float>.Cast( param );
143 Param1<string> value_string = Param1<string>.Cast( param );
154 void ReceiveValue(
int value_type,
Param param)
156 GetGame().GetMission().CreateDebugMonitor();
162 Param1<float> valueHealth = Param1<float>.Cast( param );
164 m_HealthClient = valueHealth.param1;
169 Param1<float> valueBlood = Param1<float>.Cast( param );
171 m_BloodClient = valueBlood.param1;
176 Param1<string> valueLastDamage = Param1<string>.Cast( param );
178 m_LastDamageClient = valueLastDamage.param1;
186 Param1<float> value =
new Param1<float>(0);
192 ReceiveValue(value_type, value);
197 Param1<string> value =
new Param1<string>(
"");
203 ReceiveValue(value_type, value);