float autocvar_g_balance_hook_secondary_radius;
float autocvar_g_balance_hook_secondary_refire;
float autocvar_g_balance_hook_secondary_speed;
+float autocvar_g_balance_hook_secondary_health;
+float autocvar_g_balance_hook_secondary_damageforcescale;
float autocvar_g_balance_keyhunt_damageforcescale;
float autocvar_g_balance_keyhunt_delay_collect;
float autocvar_g_balance_keyhunt_delay_return;
if(self.health > 0)
{
self.health = self.health - damage;
+
+ print(strcat("hook health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n"));
+
if (self.health <= 0)
{
if(attacker != self.realowner)
float vehic = (self.vehicle_flags & VHF_ISVEHICLE);
float projectile = (self.projectiledeathtype);
- //if(projectile)
- // print("waterlevel: ", ftos((self.watertype <= CONTENT_WATER && self.waterlevel > 0)), ". \n");
-
if (self.watertype <= CONTENT_WATER && self.waterlevel > 0) // workaround a retarded bug made by id software :P (yes, it's that old of a bug)
{
if (!(self.flags & FL_INWATER))
self.dmgtime = 0;
//te_customflash(self.origin, 200, 20, '50 0.1 0.1');
}
-
+
if(!vehic && !projectile) // vehicles and projectiles don't drown
{
if (self.waterlevel != WATERLEVEL_SUBMERGED)
self.movetype = MOVETYPE_NONE;
}
+void W_Hook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ if (self.health <= 0)
+ return;
+ self.health = self.health - damage;
+
+ print(strcat("hookbomb health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n"));
+
+ if (self.health <= 0)
+ W_PrepareExplosionByDamage(attacker, W_Hook_Explode2);
+}
+
void W_Hook_Touch2 (void)
{
PROJECTILE_TOUCH;
gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Hook_Explode2;
gren.touch = W_Hook_Touch2;
+
+ gren.takedamage = DAMAGE_YES;
+ gren.health = autocvar_g_balance_hook_secondary_health;
+ gren.damageforcescale = autocvar_g_balance_hook_secondary_damageforcescale;
+ gren.event_damage = W_Hook_Damage;
+ gren.damagedbycontents = TRUE;
gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed;
if(autocvar_g_projectiles_newton_style)