X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_weaponsystem.qc;h=271dff6291e551d75075d3eefc84db9d3bf32efc;hp=907f1788196e56adc947c9a0180fb00694231790;hb=fd5886b4935bc9bcec2c48615209621d3b2fc8dc;hpb=ff35e838d3cfa0162951d604d213e48aeb771e80 diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 907f17881..271dff629 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -159,14 +159,8 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m v_up = vu; // track max damage - if not(inWarmupStage) { - entity w; - w = get_weaponinfo(ent.weapon); - if(w.spawnflags & WEP_TYPE_SPLASH) { // splash damage - ent.stats_fired[ent.weapon - 1] += maxdamage; - ent.stat_fired = ent.weapon + 64 * floor(ent.stats_fired[ent.weapon - 1]); - } - } + if(accuracy_canbegooddamage(ent)) + accuracy_add(ent, ent.weapon, maxdamage, 0); W_HitPlotAnalysis(ent, v_forward, v_right, v_up); @@ -243,9 +237,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m ent.punchangle_x = recoil * -1; if (snd != "") - { sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM); - } if(ent.items & IT_STRENGTH) if(!g_minstagib) @@ -1042,6 +1034,7 @@ void W_SwitchToOtherWeapon(entity pl) if(ww) W_SwitchWeapon_Force(pl, ww); } +.float prevdryfire; float weapon_prepareattack_checkammo(float secondary) { if not(self.items & IT_UNLIMITED_WEAPON_AMMO) @@ -1053,8 +1046,11 @@ float weapon_prepareattack_checkammo(float secondary) for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self) return FALSE; - if(self.weapon == self.switchweapon) // only play once BEFORE starting to switch weapons + if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons + { sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM); + self.prevdryfire = time; + } W_SwitchToOtherWeapon(self); return FALSE; @@ -1266,7 +1262,7 @@ void weapon_boblayer1(float spd, vector org) // VorteX: haste can be added here }; -vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity) +vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float forceAbsolute) { vector mdirection; float mspeed; @@ -1280,7 +1276,7 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity) mspeed = vlen(mvelocity); nstyle = cvar("g_projectiles_newton_style"); - if(nstyle == 0) + if(nstyle == 0 || forceAbsolute) { // absolute velocity outvelocity = mvelocity; @@ -1573,7 +1569,7 @@ float mspercallsum; float mspercallsstyle; float mspercallcount; #endif -void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread) +void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute) { if(missile.owner == world) error("Unowned missile"); @@ -1598,13 +1594,13 @@ void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float print("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n"); #endif - missile.velocity = W_CalculateProjectileVelocity(missile.owner.velocity, pSpeed * dir); + missile.velocity = W_CalculateProjectileVelocity(missile.owner.velocity, pSpeed * dir, forceAbsolute); } void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) { - W_SetupProjectileVelocityEx(missile, w_shotdir, v_up, pSpeed, 0, 0, spread); + W_SetupProjectileVelocityEx(missile, w_shotdir, v_up, pSpeed, 0, 0, spread, FALSE); } -#define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread")) -#define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread")) +#define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread"), FALSE) +#define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"), FALSE)