X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_weaponsystem.qc;h=162f9cf8655626f8500d5e3228dc4ee275fba3db;hb=a4aa85e0876a9581bf6b0ff4b9198d82e600999c;hp=a75e2be5af16fee8e3758a60e0590a28f020ad0f;hpb=8f0f47ad72cb8977d36e9690cd958f37825097d2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index a75e2be5a..162f9cf86 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -14,21 +14,6 @@ float W_WeaponRateFactor() float t; t = 1.0 / g_weaponratefactor; - if(g_runematch) - { - if(self.runes & RUNE_SPEED) - { - if(self.runes & CURSE_SLOW) - t = t * autocvar_g_balance_rune_speed_combo_atkrate; - else - t = t * autocvar_g_balance_rune_speed_atkrate; - } - else if(self.runes & CURSE_SLOW) - { - t = t * autocvar_g_balance_curse_slow_atkrate; - } - } - return t; } @@ -103,7 +88,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright, vector org; float lag; - if(player.hitplotfh >= 0) + if(player.hitplotfh >= 0 && !(player.flags & FL_MONSTER)) { lag = ANTILAG_LATENCY(player); if(lag < 0.001) @@ -578,7 +563,6 @@ void CL_Weaponentity_Think() void CL_ExteriorWeaponentity_Think() { float tag_found; - vector ang; self.nextthink = time; if (self.owner.exteriorweaponentity != self) { @@ -609,10 +593,7 @@ void CL_ExteriorWeaponentity_Think() setattachment(self, self.owner, "bip01 r hand"); } self.effects = self.owner.effects; - if(sv_pitch_min == sv_pitch_max) - self.effects |= EF_LOWPRECISION; - else - self.effects &~= EF_LOWPRECISION; + self.effects |= EF_LOWPRECISION; self.effects = self.effects & EFMASK_CHEAP; // eat performance if(self.owner.alpha == default_player_alpha) self.alpha = default_weapon_alpha; @@ -621,58 +602,6 @@ void CL_ExteriorWeaponentity_Think() else self.alpha = 1; - if (!intermission_running) - { - ang_x = bound(sv_pitch_min, self.owner.v_angle_x, sv_pitch_max); - ang_y = 0; - ang_z = 0; - - if(sv_pitch_fixyaw) // workaround for stupid player models that don't aim forward - { - ang_y = self.owner.v_angle_y; - makevectors(ang); - var vector v = v_forward; - var float t = self.tag_entity.frame1time; - var float f = self.tag_entity.frame; - self.tag_entity.frame1time = time; - self.tag_entity.frame = self.tag_entity.anim_idle_x; - gettaginfo(self.tag_entity, self.tag_index); - self.tag_entity.frame1time = t; - self.tag_entity.frame = f; - // untransform v according to this coordinate space - vector w; - w_x = v_forward * v; - w_y = -v_right * v; - w_z = v_up * v; - self.angles = vectoangles(w); - } - else - { - ang_x = -/* don't ask */ang_x; - self.angles = ang; - } - - if(autocvar_g_loituma) - { - vector modangles; - float t; - - t = time * autocvar_g_loituma; - - modangles_x = t * 360; - modangles_y = 90; - modangles_z = 0; - - self.angles = - AnglesTransform_ToAngles( - AnglesTransform_Multiply( - AnglesTransform_FromAngles(self.angles), - AnglesTransform_FromAngles(modangles) - ) - ); - } - } - self.glowmod = self.owner.weaponentity_glowmod; self.colormap = self.owner.colormap; @@ -770,7 +699,6 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) if(clienttype(cl) == CLIENTTYPE_REAL) { play2(cl, "weapons/unavailable.wav"); - sprint(cl, strcat("You don't have any ammo for the ^2", W_Name(wpn), "\n")); Send_WeaponComplain (cl, wpn, W_Name(wpn), 0); } return FALSE; @@ -784,8 +712,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) // Report Proper Weapon Status / Modified Weapon Ownership Message if (WEPSET_CONTAINS_AW(weaponsInMap, wpn)) { - sprint(cl, strcat("You do not have the ^2", W_Name(wpn), "\n") ); - Send_WeaponComplain (cl, wpn, W_Name(wpn), 1); + Send_WeaponComplain(cl, wpn, W_Name(wpn), 1); if(autocvar_g_showweaponspawns) { @@ -816,7 +743,6 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) else { Send_WeaponComplain (cl, wpn, W_Name(wpn), 2); - sprint(cl, strcat("The ^2", W_Name(wpn), "^7 is ^1NOT AVAILABLE^7 in this map\n") ); } play2(cl, "weapons/unavailable.wav"); @@ -879,14 +805,6 @@ void W_SwitchToOtherWeapon(entity pl) W_SwitchWeapon_Force(pl, ww); } -string PrimaryOrSecondary(float secondary) -{ - if(secondary) - return "secondary"; - else - return "primary"; -} - .float prevdryfire; .float prevwarntime; float weapon_prepareattack_checkammo(float secondary) @@ -910,7 +828,15 @@ float weapon_prepareattack_checkammo(float secondary) { if(time - self.prevwarntime > 1) { - sprint(self, strcat("^2", W_Name(self.weapon), " ", PrimaryOrSecondary(secondary), "^7 is unable to fire, but its ^2", PrimaryOrSecondary(1 - secondary), "^7 can.\n")); + Send_Notification( + NOTIF_ONE, + self, + MSG_MULTI, + ITEM_WEAPON_PRIMORSEC, + self.weapon, + secondary, + (1 - secondary) + ); } self.prevwarntime = time; } @@ -1084,6 +1010,8 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float f void W_AttachToShotorg(entity flash, vector offset) { + if(self.flags & FL_MONSTER) + return; // no flash for monsters entity xflash; flash.owner = self; flash.angles_z = random() * 360; @@ -1347,6 +1275,9 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload) { + if(self.flags & FL_MONSTER) // no ammo for monsters... yet + return; + if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !ammo_reload) return;