]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_hook.qc
commit message goes here
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_hook.qc
index bf9fc160e26f1ab2d6bff10121548e10afc6edf7..82b3b77b40f467041eed8a57f940e2d05abaa6f5 100644 (file)
@@ -1,21 +1,23 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(
-/* WEP_##id */ HOOK,
-/* function */ w_hook,
-/* ammotype */ ammo_fuel,
-/* impulse  */ 0,
-/* flags    */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
-/* rating   */ 0,
-/* model    */ "hookgun",
-/* netname  */ "hook",
-/* fullname */ _("Grappling Hook")
+/* WEP_##id  */ HOOK,
+/* function  */ W_Hook,
+/* ammotype  */ ammo_fuel,
+/* impulse   */ 0,
+/* flags     */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
+/* rating    */ 0,
+/* color     */ '0 0.5 0',
+/* model     */ "hookgun",
+/* crosshair */ "gfx/crosshairhook 0.5",
+/* refname   */ "hook",
+/* wepname   */ _("Grappling Hook")
 );
 
 #define HOOK_SETTINGS(w_cvar,w_prop) HOOK_SETTINGS_LIST(w_cvar, w_prop, HOOK, hook)
 #define HOOK_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
        w_cvar(id, sn, BOTH, animtime) \
-       w_cvar(id, sn, BOTH, ammo) \
        w_cvar(id, sn, BOTH, refire) \
+       w_cvar(id, sn, PRI,  ammo) \
        w_cvar(id, sn, PRI,  hooked_ammo) \
        w_cvar(id, sn, PRI,  hooked_time_free) \
        w_cvar(id, sn, PRI,  hooked_time_max) \
@@ -127,7 +129,7 @@ void W_Hook_Attack2()
 {
        entity gren;
 
-       W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo));
+       //W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
        W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
 
        gren = spawn ();
@@ -158,7 +160,7 @@ void W_Hook_Attack2()
                gren.velocity = gren.velocity + self.velocity;
 
        gren.gravity = WEP_CVAR_SEC(hook, gravity);
-       //W_SetupProjectileVelocity(gren); // just falling down!
+       //W_SetupProjVelocity_Basic(gren); // just falling down!
 
        gren.angles = '0 0 0';
        gren.flags = FL_PROJECTILE;
@@ -168,7 +170,7 @@ void W_Hook_Attack2()
        other = gren; MUTATOR_CALLHOOK(EditProjectile);
 }
 
-float w_hook(float req)
+float W_Hook(float req)
 {
        float hooked_time_max, hooked_fuel;
                
@@ -288,12 +290,11 @@ float w_hook(float req)
                        precache_sound ("weapons/hook_impact.wav"); // done by g_hook.qc
                        precache_sound ("weapons/hook_fire.wav");
                        precache_sound ("weapons/hookbomb_fire.wav");
-                       HOOK_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
+                       HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
                        return TRUE;
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_fuel;
                        self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
                        return TRUE;
                }
@@ -306,7 +307,8 @@ float w_hook(float req)
                }
                case WR_CHECKAMMO2:
                {
-                       return self.ammo_cells >= WEP_CVAR_SEC(hook, ammo);
+                       // infinite ammo for now
+                       return TRUE; // self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
                }
                case WR_CONFIG:
                {
@@ -331,7 +333,7 @@ float w_hook(float req)
 }
 #endif
 #ifdef CSQC
-float w_hook(float req)
+float W_Hook(float req)
 {
        switch(req)
        {
@@ -350,6 +352,11 @@ float w_hook(float req)
                        precache_sound("weapons/hookbomb_impact.wav");
                        return TRUE;
                }
+               case WR_ZOOMRETICLE:
+               {
+                       // no weapon specific image for this weapon
+                       return FALSE;
+               }
        }
        return TRUE;
 }