X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_nex.qc;h=23dcce96d81a73fa8e2e3ab2e51cd56dbb2189cf;hb=93735d2e627b843f01841ec565221aa3854a2e6a;hp=04a1151910bf0f290a7f91eee114aeb97a8a9fc8;hpb=562cba9b843ea3d6a11e71aaa416fabfb9fbb30d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 04a115191..23dcce96d 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -56,25 +56,21 @@ void W_Nex_Attack (float issecondary) mydmg *= charge; myforce *= charge; - W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg); + W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg); if(charge > autocvar_g_balance_nex_charge_animlimit && autocvar_g_balance_nex_charge_animlimit) // if the Nex is overcharged, we play an extra sound { - sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM); + sound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM); } yoda = 0; FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX); if(yoda && flying) - AnnounceTo(self, "yoda"); + Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA); //beam and muzzle flash done on client SendCSQCNexBeamParticle(charge); - // flash and burn the wall - if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)) - Damage_DamageInfo(trace_endpos, mydmg, 0, 0, myforce * w_shotdir, WEP_NEX, self); - W_DecreaseAmmo(ammo_cells, myammo, autocvar_g_balance_nex_reload_ammo); } @@ -161,7 +157,7 @@ float w_nex(float req) { self.clip_load = max(autocvar_g_balance_nex_secondary_ammo, self.clip_load - autocvar_g_balance_nex_secondary_ammo * dt); } - self.weapon_load[WEP_NEX] = self.clip_load; + self.(weapon_load[WEP_NEX]) = self.clip_load; } else { @@ -216,23 +212,37 @@ float w_nex(float req) else if (req == WR_CHECKAMMO1) { ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_primary_ammo; - ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_primary_ammo); + ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_primary_ammo); return ammo_amount; } else if (req == WR_CHECKAMMO2) { - // don't allow charging if we don't have enough ammo - ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo; - ammo_amount += self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_secondary_ammo; - return ammo_amount; + if(autocvar_g_balance_nex_secondary) + { + // don't allow charging if we don't have enough ammo + ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo; + ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo; + return ammo_amount; + } + else + { + return FALSE; // zoom is not a fire mode + } } else if (req == WR_RELOAD) { W_Reload(min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav"); } - + else if (req == WR_SUICIDEMESSAGE) + { + return WEAPON_THINKING_WITH_PORTALS; + } + else if (req == WR_KILLMESSAGE) + { + return WEAPON_NEX_MURDER; + } return TRUE; -}; +} #endif #ifdef CSQC float w_nex(float req) @@ -243,16 +253,12 @@ float w_nex(float req) org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); } else if(req == WR_PRECACHE) { precache_sound("weapons/neximpact.wav"); } - else if (req == WR_SUICIDEMESSAGE) - w_deathtypestring = _("%s did the impossible"); - else if (req == WR_KILLMESSAGE) - w_deathtypestring = _("%s has been vaporized by %s"); return TRUE; } #endif