X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fw_hlac.qc;h=5959965a6c3414ed1e97b5877a20b342ac3346a5;hb=5c4ae3ec7458cf4e8d07f6eed4fe24fceea13b70;hp=a2697b2f5cb527050677ace98031e52896c6b83e;hpb=fcbf9538330960b989dbe84e7188349d7e8b109f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index a2697b2f5..5959965a6 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -1,5 +1,15 @@ #ifdef REGISTER_WEAPON -REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", _("Heavy Laser Assault Cannon")) +REGISTER_WEAPON( +/* WEP_##id */ HLAC, +/* function */ w_hlac, +/* ammotype */ IT_CELLS, +/* impulse */ 6, +/* flags */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, +/* rating */ BOT_PICKUP_RATING_MID, +/* model */ "hlac", +/* shortname */ "hlac", +/* fullname */ _("Heavy Laser Assault Cannon") +); #else #ifdef SVQC @@ -7,7 +17,7 @@ void W_HLAC_Touch (void) { PROJECTILE_TOUCH; - self.event_damage = SUB_Null; + self.event_damage = func_null; if(self.projectiledeathtype & HITTYPE_SECONDARY) RadiusDamage (self, self.realowner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other); @@ -31,7 +41,7 @@ void W_HLAC_Attack (void) W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, autocvar_g_balance_hlac_primary_damage); pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); - if (!g_norecoil) + if (!autocvar_g_norecoil) { self.punchangle_x = random () - 0.5; self.punchangle_y = random () - 0.5; @@ -119,7 +129,7 @@ void W_HLAC_Attack2 (void) for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i) W_HLAC_Attack2f(); - if (!g_norecoil) + if (!autocvar_g_norecoil) { self.punchangle_x = random () - 0.5; self.punchangle_y = random () - 0.5; @@ -219,6 +229,14 @@ float w_hlac(float req) { W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav"); } + else if (req == WR_SUICIDEMESSAGE) + { + return WEAPON_HLAC_SUICIDE; + } + else if (req == WR_KILLMESSAGE) + { + return WEAPON_HLAC_MURDER; + } return TRUE; } #endif @@ -231,16 +249,12 @@ float w_hlac(float req) org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM); } else if(req == WR_PRECACHE) { precache_sound("weapons/laserimpact.wav"); } - else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = _("%s should have used a smaller gun"); - else if (req == WR_KILLMESSAGE) - w_deathtypestring = _("%s was cut down with a HLAC by %s"); return TRUE; } #endif