X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fw_hook.qc;h=361d8ba62d0d263c50cf8d4c5c72fde8822be79b;hb=983d0eb7da390a57706da39e31308b33133aeb9d;hp=5310be53602e50addf68fd58f07b5dfa5d36a4c3;hpb=ec68412ed503e7ab8425dd1c39b4e26eb4bfb476;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/w_hook.qc b/qcsrc/common/weapons/w_hook.qc index 5310be536..361d8ba62 100644 --- a/qcsrc/common/weapons/w_hook.qc +++ b/qcsrc/common/weapons/w_hook.qc @@ -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,25 +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_prop(id, sn, float, reloading_ammo, reload_ammo) \ - w_prop(id, sn, float, reloading_time, reload_time) \ + 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) \ @@ -129,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 (); @@ -160,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; @@ -170,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; @@ -295,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; } @@ -308,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: { @@ -333,7 +332,7 @@ float w_hook(float req) } #endif #ifdef CSQC -float w_hook(float req) +float W_Hook(float req) { switch(req) {