}
}
-vector healtharmor_maxdamage(float h, float a, float armorblock)
+#ifndef MENUQC
+vector healtharmor_maxdamage(float h, float a, float armorblock, float deathtype)
{
// NOTE: we'll always choose the SMALLER value...
float healthdamage, armordamage, armorideal;
+ if (deathtype == DEATH_DROWN) // Why should armor help here...
+ armorblock = 0;
vector v;
healthdamage = (h - 1) / (1 - armorblock); // damage we can take if we could use more health
armordamage = a + (h - 1); // damage we can take if we could use more armor
return v;
}
-vector healtharmor_applydamage(float a, float armorblock, float damage)
+vector healtharmor_applydamage(float a, float armorblock, float deathtype, float damage)
{
vector v;
+ if (deathtype == DEATH_DROWN) // Why should armor help here...
+ armorblock = 0;
v_y = bound(0, damage * armorblock, a); // save
v_x = bound(0, damage - v_y, damage); // take
v_z = 0;
return v;
}
+#endif
string getcurrentmod()
{
// (3, [0..3])
// (3.5, [0.2..2.3])
// (4, 1)
+
+ /*
+ On another note:
+ inflection point is always at (2s + e - 3) / (3s + 3e - 6).
+
+ s + e - 2 == 0: no inflection
+
+ s + e > 2:
+ 0 < inflection < 1 if:
+ 0 < 2s + e - 3 < 3s + 3e - 6
+ 2s + e > 3 and 2e + s > 3
+
+ s + e < 2:
+ 0 < inflection < 1 if:
+ 0 > 2s + e - 3 > 3s + 3e - 6
+ 2s + e < 3 and 2e + s < 3
+
+ Therefore: there is an inflection point iff:
+ e outside (3 - s)/2 .. 3 - s*2
+
+ in other words, if (s,e) in triangle (1,1)(0,3)(0,1.5) or in triangle (1,1)(3,0)(1.5,0)
+ */
}
.float FindConnectedComponent_processing;