#elif defined(MENUQC)
#elif defined(SVQC)
#include <common/items/_mod.qh>
- #include <lib/warpzone/anglestransform.qh>
- #include <lib/warpzone/common.qh>
- #include <lib/warpzone/util_server.qh>
- #include <lib/warpzone/server.qh>
- #include "../constants.qh"
- #include "../stats.qh"
- #include "../teams.qh"
- #include <common/util.qh>
- #include "../monsters/_mod.qh"
- #include "config.qh"
- #include <server/weapons/common.qh>
- #include <server/weapons/csqcprojectile.qh>
- #include <server/weapons/tracing.qh>
- #include <server/items/spawning.qh>
- #include <server/autocvars.qh>
- #include "../notifications/all.qh"
- #include "../deathtypes/all.qh"
- #include <server/mutators/_mod.qh>
- #include "../mapinfo.qh"
- #include <server/command/_mod.qh>
- #include <lib/csqcmodel/sv_model.qh>
- #include <server/portals.qh>
- #include <server/hook.qh>
+ #include <lib/warpzone/anglestransform.qh>
+ #include <lib/warpzone/common.qh>
+ #include <lib/warpzone/util_server.qh>
+ #include <lib/warpzone/server.qh>
+ #include "../constants.qh"
+ #include "../stats.qh"
+ #include "../teams.qh"
+ #include <common/util.qh>
+ #include "../monsters/_mod.qh"
+ #include "config.qh"
+ #include <server/weapons/common.qh>
+ #include <server/weapons/csqcprojectile.qh>
+ #include <server/weapons/tracing.qh>
+ #include <server/items/spawning.qh>
+ #include <server/autocvars.qh>
+ #include "../notifications/all.qh"
+ #include "../deathtypes/all.qh"
+ #include <server/mutators/_mod.qh>
+ #include "../mapinfo.qh"
+ #include <server/command/_mod.qh>
+ #include <lib/csqcmodel/sv_model.qh>
+ #include <server/portals.qh>
+#include <server/hook.qh>
#endif
#ifdef GAMEQC
#include "calculations.qc"
Weapon e2 = REGISTRY_GET(Weapons, sj);
int d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10;
if (d != 0) return -d; // high impulse first!
- return strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),
- sprintf(" %d ", si), 0)
- -
- strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),
- sprintf(" %d ", sj), 0)
- ; // low char index first!
+ string s = strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " ");
+ return strstrofs(s, sprintf(" %d ", si), 0)
+ - strstrofs(s, sprintf(" %d ", sj), 0); // low char index first!
}
string W_FixWeaponOrder_BuildImpulseList(string o)
{
int idx = 0;
// v_ model attached to invisible h_ model
if (this.weaponchild
- && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
+ && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
{
this.spawnorigin = gettaginfo(this.weaponchild, idx);
}
int compressed_shotorg = compressShotOrigin(this.movedir);
// make them match perfectly
#ifdef SVQC
- // null during init
- if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
- this.movedir = decompressShotOrigin(compressed_shotorg);
-#else
- this.movedir = decompressShotOrigin(compressed_shotorg);
+ // null during init
+ if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
#endif
+ this.movedir = decompressShotOrigin(compressed_shotorg);
this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount
{
WFRAME fr = ReadByte();
float t = ReadFloat();
- int slot = ReadByte();
+ int slot = ReadByte();
bool restartanim = ReadByte();
entity wepent = viewmodels[slot];
if(fr == WFRAME_IDLE)
case WS_DROP:
wepent.weapon_switchdelay = wepent.activeweapon.switchdelay_drop;
break;
- default:
- wepent.weapon_switchdelay = 0;
- break;
+ default:
+ wepent.weapon_switchdelay = 0;
+ break;
}
return true;
}
{
return = true;
int weapon_id = ReadByte();
- int slot = ReadByte();
- vector sv_shotorg = ReadVector();
+ int slot = ReadByte();
+ vector sv_shotorg = ReadVector();
Weapon thiswep = REGISTRY_GET(Weapons, weapon_id);
- vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
+ vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
vector forward, right, up;
MAKE_VECTORS(viewangles, forward, right, up);
pointparticles(thiswep.m_muzzleeffect, sv_shotorg, forward * 1000, 1);
return;
}
- if(!autocvar_r_drawviewmodel) return;
+ if(!autocvar_r_drawviewmodel) return;
entity wepent = viewmodels[slot];
// get the local player entity to calculate shot origin
if(!v_shot_idx || this.beam_usevieworigin != 2)
{
this.beam_shotorigin = wepent.movedir;
- origin_offset =
- right * -this.beam_shotorigin.y
- + up * this.beam_shotorigin.z;
+ origin_offset = right * -this.beam_shotorigin.y + up * this.beam_shotorigin.z;
}
else
this.beam_shotorigin = '0 0 0';
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH;
+ proj.missile_flags = MIF_SPLASH;
CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH | MIF_PROXY;
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY;
CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
{
entity missile;
- float spread;
W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(hlac, ammo), weaponentity);
- spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
- spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
- if(IS_DUCKED(actor))
- spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
+ float spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
+ spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
+ if(IS_DUCKED(actor))
+ spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage), thiswep.m_id);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
missile.owner = missile.realowner = actor;
missile.bot_dodge = true;
- missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
+ missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
settouch(missile, W_HLAC_Touch);
setthink(missile, SUB_Remove);
- missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
+ missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
missile.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, missile);
void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
{
entity missile;
- float spread;
+ float spread = WEP_CVAR_SEC(hlac, spread);
- spread = WEP_CVAR_SEC(hlac, spread);
-
-
- if(IS_DUCKED(actor))
- spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
+ if(IS_DUCKED(actor))
+ spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage), thiswep.m_id | HITTYPE_SECONDARY);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
missile.owner = missile.realowner = actor;
missile.bot_dodge = true;
- missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
+ missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
settouch(missile, W_HLAC_Touch);
setthink(missile, SUB_Remove);
- missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
+ missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
missile.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, missile);
ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(hlac, refire) * W_WeaponRateFactor(actor);
W_HLAC_Attack(thiswep, actor, weaponentity);
actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame);
}
else
{
void W_HLAC_Attack2_Frame(Weapon thiswep, entity actor, .entity weaponentity)
{
- float i;
-
W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hlac, ammo), weaponentity);
- for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
- W_HLAC_Attack2(thiswep, actor, weaponentity);
+ for(float i = WEP_CVAR_SEC(hlac, shots); i > 0; --i)
+ W_HLAC_Attack2(thiswep, actor, weaponentity);
if(!autocvar_g_norecoil)
{
fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pHeadshotDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK));
if(autocvar_g_casings >= 2)
- {
- makevectors(actor.v_angle); // for some reason, this is lost
+ {
+ makevectors(actor.v_angle); // for some reason, this is lost
SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor, weaponentity);
- }
+ }
}
void W_Rifle_Attack(Weapon thiswep, entity actor, .entity weaponentity)
for(int sc = 0;sc < bullets;sc = sc + 1)
fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, 0, force, thiswep.m_id, bullet_trail_effect, false);
-
+
if(lag && bullets > 0)
antilag_restore_all(actor);
NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
{
float charge;
- vector shotorg = ReadVector();
- vector endpos = ReadVector();
+ vector shotorg = ReadVector();
+ vector endpos = ReadVector();
charge = ReadByte() / 255.0;
//pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
myforcehalflife = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_forcehalflife);
myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
- float dtype = thiswep.m_id;
- if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
- dtype |= HITTYPE_ARMORPIERCE;
+ float dtype = thiswep.m_id;
+ if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
+ dtype |= HITTYPE_ARMORPIERCE;
float flying;
flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
actor.vortex_lasthit = damage_goodhits;
//beam done on client
- vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+ vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
SendCSQCVortexBeamParticle(charge);