X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_hook.qc;h=4a25b871d8f5be6a1360186f1aa59d1ac28b6439;hb=e0c76a13de11a8e14284021a420c0908a8186507;hp=9e5868355991106d4b48cd6feae4171c2903802d;hpb=f54d799f3e6e3f31b7d685453156bb7f0e448ce1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index 9e5868355..4a25b871d 100644 --- a/qcsrc/server/w_hook.qc +++ b/qcsrc/server/w_hook.qc @@ -1,5 +1,5 @@ #ifdef REGISTER_WEAPON -REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", "Grappling Hook"); +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; @@ -41,12 +41,12 @@ void W_Hook_Explode2 (void) self.think = W_Hook_ExplodeThink; self.nextthink = time; - self.dmg = cvar("g_balance_hook_secondary_damage"); - self.dmg_edge = cvar("g_balance_hook_secondary_edgedamage"); - self.dmg_radius = cvar("g_balance_hook_secondary_radius"); - self.dmg_force = cvar("g_balance_hook_secondary_force"); - self.dmg_power = cvar("g_balance_hook_secondary_power"); - self.dmg_duration = cvar("g_balance_hook_secondary_duration"); + self.dmg = autocvar_g_balance_hook_secondary_damage; + self.dmg_edge = autocvar_g_balance_hook_secondary_edgedamage; + self.dmg_radius = autocvar_g_balance_hook_secondary_radius; + self.dmg_force = autocvar_g_balance_hook_secondary_force; + self.dmg_power = autocvar_g_balance_hook_secondary_power; + self.dmg_duration = autocvar_g_balance_hook_secondary_duration; self.teleport_time = time; self.dmg_last = 1; self.movetype = MOVETYPE_NONE; @@ -63,36 +63,38 @@ void W_Hook_Attack2() local entity gren; 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")); + self.ammo_cells = self.ammo_cells - autocvar_g_balance_hook_secondary_ammo; + W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, autocvar_g_balance_hook_secondary_damage); gren = spawn (); gren.owner = self; gren.classname = "hookbomb"; gren.bot_dodge = TRUE; - gren.bot_dodgerating = cvar("g_balance_hook_secondary_damage"); + gren.bot_dodgerating = autocvar_g_balance_hook_secondary_damage; gren.movetype = MOVETYPE_TOSS; PROJECTILE_MAKETRIGGER(gren); gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY; setorigin(gren, w_shotorg); setsize(gren, '0 0 0', '0 0 0'); - gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime"); + gren.nextthink = time + autocvar_g_balance_hook_secondary_lifetime; gren.think = adaptor_think2use_hittype_splash; gren.use = W_Hook_Explode2; gren.touch = W_Hook_Touch2; - gren.velocity = '0 0 1' * cvar("g_balance_hook_secondary_speed"); - if(cvar("g_projectiles_newton_style")) + gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed; + if(autocvar_g_projectiles_newton_style) gren.velocity = gren.velocity + self.velocity; - gren.gravity = cvar("g_balance_hook_secondary_gravity"); + gren.gravity = autocvar_g_balance_hook_secondary_gravity; //W_SetupProjectileVelocity(gren); // just falling down! gren.angles = '0 0 0'; gren.flags = FL_PROJECTILE; CSQCProjectile(gren, TRUE, PROJECTILE_HOOKBOMB, TRUE); + + other = gren; MUTATOR_CALLHOOK(EditProjectile); } void spawnfunc_weapon_hook (void) @@ -125,41 +127,41 @@ float w_hook(float req) if (weapon_prepareattack(0, -1)) { if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - self.ammo_fuel = self.ammo_fuel - cvar("g_balance_hook_primary_fuel"); + self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_hook_primary_fuel; self.hook_state |= HOOK_FIRING; - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready); + weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready); } } if (self.BUTTON_ATCK2) { - if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire"))) + if (weapon_prepareattack(1, autocvar_g_balance_hook_secondary_refire)) { W_Hook_Attack2(); - weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hook_secondary_animtime"), w_ready); + weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hook_secondary_animtime, w_ready); } } if(self.hook) { // if hooked, no bombs, and increase the timer - self.hook_refire = max(self.hook_refire, time + cvar("g_balance_hook_primary_refire")); + self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire); // hook also inhibits health regeneration, but only for 1 second if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen")); + self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen); } if(self.hook && self.hook.state == 1) { - hooked_time_max = cvar("g_balance_hook_primary_hooked_time_max"); + hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max; if (hooked_time_max > 0) { if ( time > self.hook_time_hooked + hooked_time_max ) self.hook_state |= HOOK_REMOVING; } - hooked_fuel = cvar("g_balance_hook_primary_hooked_fuel"); + hooked_fuel = autocvar_g_balance_hook_primary_hooked_fuel; if (hooked_fuel > 0) { if ( time > self.hook_time_fueldecrease ) @@ -185,7 +187,7 @@ float w_hook(float req) else { self.hook_time_hooked = time; - self.hook_time_fueldecrease = time + cvar("g_balance_hook_primary_hooked_time_free"); + self.hook_time_fueldecrease = time + autocvar_g_balance_hook_primary_hooked_time_free; } if (self.BUTTON_CROUCH) @@ -233,16 +235,12 @@ float w_hook(float req) if(self.hook) return self.ammo_fuel > 0; else - return self.ammo_fuel >= cvar("g_balance_hook_primary_fuel"); + return self.ammo_fuel >= autocvar_g_balance_hook_primary_fuel; } else if (req == WR_CHECKAMMO2) { - return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo"); + return self.ammo_cells >= autocvar_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; @@ -265,6 +263,10 @@ float w_hook(float req) { 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