]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_hook.qc
Proper naming for "ammo_field"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_hook.qc
index 13534a9fb0feb0c1f061441580e566aa5774b42a..a4b07319a8c00323d334ebcc4f463af0e37683a3 100644 (file)
@@ -1,11 +1,12 @@
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(
 /* WEP_##id */ HOOK,
-/* function */ w_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",
 /* netname  */ "hook",
 /* fullname */ _("Grappling Hook")
@@ -13,23 +14,23 @@ REGISTER_WEAPON(
 
 #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, MO_BOTH, animtime) \
-       w_cvar(id, sn, MO_BOTH, ammo) \
-       w_cvar(id, sn, MO_BOTH, refire) \
-       w_cvar(id, sn, MO_PRI,  hooked_ammo) \
-       w_cvar(id, sn, MO_PRI,  hooked_time_free) \
-       w_cvar(id, sn, MO_PRI,  hooked_time_max) \
-       w_cvar(id, sn, MO_SEC,  damage) \
-       w_cvar(id, sn, MO_SEC,  duration) \
-       w_cvar(id, sn, MO_SEC,  edgedamage) \
-       w_cvar(id, sn, MO_SEC,  force) \
-       w_cvar(id, sn, MO_SEC,  gravity) \
-       w_cvar(id, sn, MO_SEC,  lifetime) \
-       w_cvar(id, sn, MO_SEC,  power) \
-       w_cvar(id, sn, MO_SEC,  radius) \
-       w_cvar(id, sn, MO_SEC,  speed) \
-       w_cvar(id, sn, MO_SEC,  health) \
-       w_cvar(id, sn, MO_SEC,  damageforcescale) \
+       w_cvar(id, sn, BOTH, animtime) \
+       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) \
+       w_cvar(id, sn, SEC,  damage) \
+       w_cvar(id, sn, SEC,  duration) \
+       w_cvar(id, sn, SEC,  edgedamage) \
+       w_cvar(id, sn, SEC,  force) \
+       w_cvar(id, sn, SEC,  gravity) \
+       w_cvar(id, sn, SEC,  lifetime) \
+       w_cvar(id, sn, SEC,  power) \
+       w_cvar(id, sn, SEC,  radius) \
+       w_cvar(id, sn, SEC,  speed) \
+       w_cvar(id, sn, SEC,  health) \
+       w_cvar(id, sn, SEC,  damageforcescale) \
        w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
        w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
        w_prop(id, sn, string, weaponreplace, weaponreplace) \
@@ -127,7 +128,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 +159,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 +169,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;
                
@@ -293,7 +294,6 @@ float w_hook(float req)
                }
                case WR_SETUP:
                {
-                       self.current_ammo = ammo_fuel;
                        self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
                        return TRUE;
                }
@@ -306,7 +306,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 +332,7 @@ float w_hook(float req)
 }
 #endif
 #ifdef CSQC
-float w_hook(float req)
+float W_Hook(float req)
 {
        switch(req)
        {
@@ -350,6 +351,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;
 }