]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_hook.qc
Merge branch 'master' into terencehill/newpanelhud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_hook.qc
index 79240494febd784750c5b494a07da924e6ac06d0..5b1cf61350a1421b379f2a5f52846bc253e3365b 100644 (file)
@@ -1,6 +1,7 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", "Grappling Hook");
 #else
+#ifdef SVQC
 .float dmg;
 .float dmg_edge;
 .float dmg_radius;
@@ -63,7 +64,7 @@ void W_Hook_Attack2()
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
-       W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", cvar("g_balance_hook_secondary_damage"));
+       W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, cvar("g_balance_hook_secondary_damage"));
 
        gren = spawn ();
        gren.owner = self;
@@ -77,7 +78,7 @@ void W_Hook_Attack2()
        setsize(gren, '0 0 0', '0 0 0');
 
        gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
-       gren.think = adaptor_think2use;
+       gren.think = adaptor_think2use_hittype_splash;
        gren.use = W_Hook_Explode2;
        gren.touch = W_Hook_Touch2;
 
@@ -92,6 +93,8 @@ void W_Hook_Attack2()
        gren.flags = FL_PROJECTILE;
 
        CSQCProjectile(gren, TRUE, PROJECTILE_HOOKBOMB, TRUE);
+
+       other = gren; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 void spawnfunc_weapon_hook (void)
@@ -217,7 +220,7 @@ float w_hook(float req)
        {
                precache_model ("models/weapons/g_hookgun.md3");
                precache_model ("models/weapons/v_hookgun.md3");
-               precache_model ("models/weapons/h_hookgun.dpm");
+               precache_model ("models/weapons/h_hookgun.iqm");
                precache_sound ("weapons/hook_impact.wav"); // done by g_hook.qc
                precache_sound ("weapons/hook_fire.wav");
                precache_sound ("weapons/hookbomb_fire.wav");
@@ -238,10 +241,6 @@ float w_hook(float req)
        {
                return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = "did the impossible";
-       else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = "has run into #'s gravity bomb";
        else if (req == WR_RESETPLAYER)
        {
                self.hook_refire = time;
@@ -249,3 +248,26 @@ float w_hook(float req)
        return TRUE;
 };
 #endif
+#ifdef CSQC
+float w_hook(float req)
+{
+       if(req == WR_IMPACTEFFECT)
+       {
+               vector org2;
+               org2 = w_org + w_backoff * 2;
+               pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
+               if(!w_issilent)
+                       sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
+       }
+       else if(req == WR_PRECACHE)
+       {
+               precache_sound("weapons/hookbomb_impact.wav");
+       }
+       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";
+       return TRUE;
+}
+#endif
+#endif