X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_hook.qc;h=ea9514417e83dc69bbd804824ce6391dd4327c75;hp=32892d5558b5e6862848740296b7e47a2a6b2050;hb=6018d119b3c9f4e54d6d21f6339948708c83d83f;hpb=f2a79cba0897fb6f6cb7ebeecb596b5547af3ddd diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index 32892d5558..ea9514417e 100644 --- a/qcsrc/server/w_hook.qc +++ b/qcsrc/server/w_hook.qc @@ -23,9 +23,9 @@ void W_Hook_ExplodeThink (void) f = self.dmg_last - dmg_remaining_next; self.dmg_last = dmg_remaining_next; - RadiusDamage (self, self.realowner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.realowner, self.dmg_force * f, self.projectiledeathtype, world); + RadiusDamage (self, self.realowner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.realowner, world, self.dmg_force * f, self.projectiledeathtype, world); self.projectiledeathtype |= HITTYPE_BOUNCE; - //RadiusDamage (self, world, self.dmg * f, self.dmg_edge * f, self.dmg_radius, world, self.dmg_force * f, self.projectiledeathtype, world); + //RadiusDamage (self, world, self.dmg * f, self.dmg_edge * f, self.dmg_radius, world, world, self.dmg_force * f, self.projectiledeathtype, world); if(dt < self.dmg_duration) self.nextthink = time + 0.05; // soon @@ -52,6 +52,20 @@ void W_Hook_Explode2 (void) 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; + + if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions + return; // g_projectiles_damage says to halt + + self.health = self.health - damage; + + if (self.health <= 0) + W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2); +} + void W_Hook_Touch2 (void) { PROJECTILE_TOUCH; @@ -60,7 +74,7 @@ void W_Hook_Touch2 (void) void W_Hook_Attack2() { - local entity gren; + entity gren; W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hook_secondary_ammo, FALSE); W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, autocvar_g_balance_hook_secondary_damage); @@ -80,6 +94,13 @@ void W_Hook_Attack2() 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.missile_flags = MIF_SPLASH | MIF_ARC; gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed; if(autocvar_g_projectiles_newton_style) @@ -143,7 +164,7 @@ float w_hook(float req) if(self.hook) { // if hooked, no bombs, and increase the timer - self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire); + self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire * W_WeaponRateFactor()); // hook also inhibits health regeneration, but only for 1 second if not(self.items & IT_UNLIMITED_WEAPON_AMMO) @@ -245,7 +266,7 @@ float w_hook(float req) self.hook_refire = time; } return TRUE; -}; +} #endif #ifdef CSQC float w_hook(float req) @@ -265,7 +286,7 @@ float w_hook(float req) else if (req == WR_SUICIDEMESSAGE) w_deathtypestring = _("%s did the impossible"); else if (req == WR_KILLMESSAGE) - w_deathtypestring = _("%s has run into %s's gravity bomb"); + w_deathtypestring = _("%s was caught in %s's hook gravity bomb"); return TRUE; } #endif