#endif
#ifdef SVQC
ARC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
-void ArcInit();
+void ArcInit(void);
.vector hook_start, hook_end; // used for beam
.entity arc_beam; // used for beam
.float BUTTON_ATCK_prev; // for better animation control
{
print("W_Arc_Beam_Think();\n");
self.owner.lg_fire_prev = time;
- if (self != self.owner.arc_beam)
+ if(self != self.owner.arc_beam)
{
remove(self);
print("W_Arc_Beam_Think(): EXPIRING BEAM #1\n");
return;
}
- if ((self.owner.WEP_AMMO(ARC) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
+ if((self.owner.WEP_AMMO(ARC) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
{
if(self == self.owner.arc_beam)
self.owner.arc_beam = world;
if(accuracy_isgooddamage(self.owner, trace_ent))
accuracy_add(self.owner, WEP_ARC, 0, WEP_CVAR_PRI(arc, damage) * dt * f);
- Damage (trace_ent, self.owner, self.owner, WEP_CVAR_PRI(arc, damage) * dt * f, WEP_ARC, trace_endpos, force * dt);
+ Damage(trace_ent, self.owner, self.owner, WEP_CVAR_PRI(arc, damage) * dt * f, WEP_ARC, trace_endpos, force * dt);
}
// draw effect
print("W_Arc_Beam();\n");
// only play fire sound if 0.5 sec has passed since player let go the fire button
if(time - self.lg_fire_prev > 0.5)
- sound (self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTN_NORM);
entity beam, oldself;
if(weapon_prepareattack(0, 0))
{
- if ((!self.arc_beam) || wasfreed(self.arc_beam))
+ if((!self.arc_beam) || wasfreed(self.arc_beam))
W_Arc_Beam();
if(!self.BUTTON_ATCK_prev)
}
else // todo
{
- if (self.BUTTON_ATCK_prev != 0)
+ if(self.BUTTON_ATCK_prev != 0)
{
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(arc, animtime), w_ready);
ATTACK_FINISHED(self) = time + WEP_CVAR_PRI(arc, refire) * W_WeaponRateFactor();
self.BUTTON_ATCK_prev = 0;
}
- //if (self.BUTTON_ATCK2)
- //if (weapon_prepareattack(1, autocvar_g_balance_arc_secondary_refire))
+ //if(self.BUTTON_ATCK2)
+ //if(weapon_prepareattack(1, autocvar_g_balance_arc_secondary_refire))
//{
// W_Arc_Attack2();
// self.arc_count = autocvar_g_balance_arc_secondary_count;
}
case WR_INIT:
{
- precache_model ("models/weapons/g_arc.md3");
- precache_model ("models/weapons/v_arc.md3");
- precache_model ("models/weapons/h_arc.iqm");
- //precache_sound ("weapons/arc_bounce.wav");
- precache_sound ("weapons/arc_fire.wav");
- precache_sound ("weapons/arc_fire2.wav");
- precache_sound ("weapons/arc_impact.wav");
- //precache_sound ("weapons/arc_impact_combo.wav");
- //precache_sound ("weapons/W_Arc_Beam_fire.wav");
+ precache_model("models/weapons/g_arc.md3");
+ precache_model("models/weapons/v_arc.md3");
+ precache_model("models/weapons/h_arc.iqm");
+ //precache_sound("weapons/arc_bounce.wav");
+ precache_sound("weapons/arc_fire.wav");
+ precache_sound("weapons/arc_fire2.wav");
+ precache_sound("weapons/arc_impact.wav");
+ //precache_sound("weapons/arc_impact_combo.wav");
+ //precache_sound("weapons/W_Arc_Beam_fire.wav");
return TRUE;
}
case WR_CHECKAMMO1:
return FALSE;
}
-void ArcInit()
+void ArcInit(void)
{
WEP_ACTION(WEP_ARC, WR_INIT);
arc_shotorigin[0] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC), FALSE, FALSE, 1);
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_blaster() { weapon_defaultspawnfunc(WEP_BLASTER); }
-void spawnfunc_weapon_laser() { spawnfunc_weapon_blaster(); }
+void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER); }
+void spawnfunc_weapon_laser(void) { spawnfunc_weapon_blaster(); }
-void W_Blaster_Touch()
+void W_Blaster_Touch(void)
{
PROJECTILE_TOUCH;
remove(self);
}
-void W_Blaster_Think()
+void W_Blaster_Think(void)
{
self.movetype = MOVETYPE_FLY;
self.think = SUB_Remove;
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_crylink() { weapon_defaultspawnfunc(WEP_CRYLINK); }
+void spawnfunc_weapon_crylink(void) { weapon_defaultspawnfunc(WEP_CRYLINK); }
void W_Crylink_CheckLinks(entity e)
{
}
// force projectile to explode
-void W_Crylink_LinkExplode (entity e, entity e2)
+void W_Crylink_LinkExplode(entity e, entity e2)
{
float a;
W_Crylink_LinkExplode(e.queuenext, e2);
e.classname = "spike_oktoremove";
- remove (e);
+ remove(e);
}
// adjust towards center
return targ_origin;
}
-void W_Crylink_LinkJoinEffect_Think()
+void W_Crylink_LinkJoinEffect_Think(void)
{
// is there at least 2 projectiles very close?
entity e, p;
}
// NO bounce protection, as bounces are limited!
-void W_Crylink_Touch (void)
+void W_Crylink_Touch(void)
{
float finalhit;
float f;
self.realowner.crylink_lastgroup = world;
W_Crylink_LinkExplode(self.queuenext, self);
self.classname = "spike_oktoremove";
- remove (self);
+ remove(self);
return;
}
else if(finalhit)
// CSQCProjectile(proj, TRUE, PROJECTILE_CRYLINK, TRUE);
}
-void W_Crylink_Fadethink (void)
+void W_Crylink_Fadethink(void)
{
W_Crylink_Dequeue(self);
remove(self);
}
-void W_Crylink_Attack (void)
+void W_Crylink_Attack(void)
{
float counter, shots;
entity proj, prevproj, firstproj;
if(WEP_CVAR_PRI(crylink, joinexplode))
maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
- W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
+ W_SetupShot(self, FALSE, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
forward = v_forward;
right = v_right;
up = v_up;
proj = prevproj = firstproj = world;
for(counter = 0; counter < shots; ++counter)
{
- proj = spawn ();
+ proj = spawn();
proj.reset = W_Crylink_Reset;
proj.realowner = proj.owner = self;
proj.classname = "spike";
proj.projectiledeathtype = WEP_CRYLINK;
//proj.gravity = 0.001;
- setorigin (proj, w_shotorg);
+ setorigin(proj, w_shotorg);
setsize(proj, '0 0 0', '0 0 0');
s = '0 0 0';
- if (counter == 0)
+ if(counter == 0)
s = '0 0 0';
else
{
proj.cnt = WEP_CVAR_PRI(crylink, bounces);
//proj.scale = 1 + 1 * proj.cnt;
- proj.angles = vectoangles (proj.velocity);
+ proj.angles = vectoangles(proj.velocity);
//proj.glow_size = 20;
}
}
-void W_Crylink_Attack2 (void)
+void W_Crylink_Attack2(void)
{
float counter, shots;
entity proj, prevproj, firstproj;
if(WEP_CVAR_SEC(crylink, joinexplode))
maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
- W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
+ W_SetupShot(self, FALSE, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
forward = v_forward;
right = v_right;
up = v_up;
proj = prevproj = firstproj = world;
for(counter = 0; counter < shots; ++counter)
{
- proj = spawn ();
+ proj = spawn();
proj.reset = W_Crylink_Reset;
proj.realowner = proj.owner = self;
proj.classname = "spike";
proj.projectiledeathtype = WEP_CRYLINK | HITTYPE_SECONDARY;
//proj.gravity = 0.001;
- setorigin (proj, w_shotorg);
+ setorigin(proj, w_shotorg);
setsize(proj, '0 0 0', '0 0 0');
if(WEP_CVAR_SEC(crylink, spreadtype) == 1)
{
s = '0 0 0';
- if (counter == 0)
+ if(counter == 0)
s = '0 0 0';
else
{
proj.cnt = WEP_CVAR_SEC(crylink, bounces);
//proj.scale = 1 + 1 * proj.cnt;
- proj.angles = vectoangles (proj.velocity);
+ proj.angles = vectoangles(proj.velocity);
//proj.glow_size = 20;
{
case WR_AIM:
{
- if (random() < 0.10)
+ if(random() < 0.10)
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), FALSE);
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), FALSE);
if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo))) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
- if (self.BUTTON_ATCK)
+ if(self.BUTTON_ATCK)
{
- if (self.crylink_waitrelease != 1)
- if (weapon_prepareattack(0, WEP_CVAR_PRI(crylink, refire)))
+ if(self.crylink_waitrelease != 1)
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(crylink, refire)))
{
W_Crylink_Attack();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(crylink, animtime), w_ready);
if(self.BUTTON_ATCK2 && autocvar_g_balance_crylink_secondary)
{
- if (self.crylink_waitrelease != 2)
- if (weapon_prepareattack(1, WEP_CVAR_SEC(crylink, refire)))
+ if(self.crylink_waitrelease != 2)
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(crylink, refire)))
{
W_Crylink_Attack2();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(crylink, animtime), w_ready);
}
}
- if ((self.crylink_waitrelease == 1 && !self.BUTTON_ATCK) || (self.crylink_waitrelease == 2 && !self.BUTTON_ATCK2))
+ if((self.crylink_waitrelease == 1 && !self.BUTTON_ATCK) || (self.crylink_waitrelease == 2 && !self.BUTTON_ATCK2))
{
- if (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time)
+ if(!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time)
{
// fired and released now!
if(self.crylink_lastgroup)
}
case WR_INIT:
{
- precache_model ("models/weapons/g_crylink.md3");
- precache_model ("models/weapons/v_crylink.md3");
- precache_model ("models/weapons/h_crylink.iqm");
- precache_sound ("weapons/crylink_fire.wav");
- precache_sound ("weapons/crylink_fire2.wav");
- precache_sound ("weapons/crylink_linkjoin.wav");
+ precache_model("models/weapons/g_crylink.md3");
+ precache_model("models/weapons/v_crylink.md3");
+ precache_model("models/weapons/h_crylink.iqm");
+ precache_sound("weapons/crylink_fire.wav");
+ precache_sound("weapons/crylink_fire2.wav");
+ precache_sound("weapons/crylink_linkjoin.wav");
CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_devastator() { weapon_defaultspawnfunc(WEP_DEVASTATOR); }
-void spawnfunc_weapon_rocketlauncher() { spawnfunc_weapon_devastator(); }
+void spawnfunc_weapon_devastator(void) { weapon_defaultspawnfunc(WEP_DEVASTATOR); }
+void spawnfunc_weapon_rocketlauncher(void) { spawnfunc_weapon_devastator(); }
-void W_Devastator_Unregister()
+void W_Devastator_Unregister(void)
{
if(self.realowner && self.realowner.lastrocket == self)
{
}
}
-void W_Devastator_Explode()
+void W_Devastator_Explode(void)
{
W_Devastator_Unregister();
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.realowner, WEP_CVAR(devastator, damage), WEP_CVAR(devastator, edgedamage), WEP_CVAR(devastator, radius), world, world, WEP_CVAR(devastator, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR(devastator, damage), WEP_CVAR(devastator, edgedamage), WEP_CVAR(devastator, radius), world, world, WEP_CVAR(devastator, force), self.projectiledeathtype, other);
- if (self.realowner.weapon == WEP_DEVASTATOR)
+ if(self.realowner.weapon == WEP_DEVASTATOR)
{
if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
{
self.realowner.switchweapon = w_getbestweapon(self.realowner);
}
}
- remove (self);
+ remove(self);
}
-void W_Devastator_DoRemoteExplode()
+void W_Devastator_DoRemoteExplode(void)
{
W_Devastator_Unregister();
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.realowner, WEP_CVAR(devastator, remote_damage), WEP_CVAR(devastator, remote_edgedamage), WEP_CVAR(devastator, remote_radius), world, world, WEP_CVAR(devastator, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+ RadiusDamage(self, self.realowner, WEP_CVAR(devastator, remote_damage), WEP_CVAR(devastator, remote_edgedamage), WEP_CVAR(devastator, remote_radius), world, world, WEP_CVAR(devastator, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
- if (self.realowner.weapon == WEP_DEVASTATOR)
+ if(self.realowner.weapon == WEP_DEVASTATOR)
{
if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
{
self.realowner.switchweapon = w_getbestweapon(self.realowner);
}
}
- remove (self);
+ remove(self);
}
-void W_Devastator_RemoteExplode()
+void W_Devastator_RemoteExplode(void)
{
if(self.realowner.deadflag == DEAD_NO)
if(self.realowner.lastrocket)
// normalize(thisdir + goaldir)
// normalize(0)
-void W_Devastator_Think (void)
+void W_Devastator_Think(void)
{
vector desireddir, olddir, newdir, desiredorigin, goal;
#if 0
#endif
float velspeed, f;
self.nextthink = time;
- if (time > self.cnt)
+ if(time > self.cnt)
{
other = world;
self.projectiledeathtype |= HITTYPE_BOUNCE;
- W_Devastator_Explode ();
+ W_Devastator_Explode();
return;
}
// accelerate
makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0');
velspeed = WEP_CVAR(devastator, speed) * g_weaponspeedfactor - (self.velocity * v_forward);
- if (velspeed > 0)
+ if(velspeed > 0)
self.velocity = self.velocity + v_forward * min(WEP_CVAR(devastator, speedaccel) * g_weaponspeedfactor * frametime, velspeed);
// laser guided, or remote detonation
- if (self.realowner.weapon == WEP_DEVASTATOR)
+ if(self.realowner.weapon == WEP_DEVASTATOR)
{
if(self == self.realowner.lastrocket)
if(!self.realowner.rl_release)
{
pointparticles(particleeffectnum("rocket_guide"), self.origin, self.velocity, 1);
// TODO add a better sound here
- sound (self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM);
+ sound(self.realowner, CH_WEAPON_B, "weapons/rocket_mode.wav", VOL_BASE, ATTN_NORM);
self.count = 1;
}
}
UpdateCSQCProjectile(self);
}
-void W_Devastator_Touch (void)
+void W_Devastator_Touch(void)
{
if(WarpZone_Projectile_Touch())
{
return;
}
W_Devastator_Unregister();
- W_Devastator_Explode ();
+ W_Devastator_Explode();
}
-void W_Devastator_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Devastator_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
- if (self.health <= 0)
+ if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_Devastator_Explode);
}
-void W_Devastator_Attack (void)
+void W_Devastator_Attack(void)
{
entity missile;
entity flash;
W_DecreaseAmmo(WEP_CVAR(devastator, ammo));
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(devastator, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(devastator, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = WarpZone_RefSys_SpawnSameRefSys(self);
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_DEVASTATOR;
- setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
+ setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
- setorigin (missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
+ setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
W_SetupProjVelocity_Basic(missile, WEP_CVAR(devastator, speedstart), 0);
- missile.angles = vectoangles (missile.velocity);
+ missile.angles = vectoangles(missile.velocity);
missile.touch = W_Devastator_Touch;
missile.think = W_Devastator_Think;
CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
// muzzle flash for 1st person view
- flash = spawn ();
- setmodel (flash, "models/flash.md3"); // precision set below
- SUB_SetFade (flash, time, 0.1);
+ flash = spawn();
+ setmodel(flash, "models/flash.md3"); // precision set below
+ SUB_SetFade(flash, time, 0.1);
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
W_AttachToShotorg(flash, '5 0 0');
enemydamage = 0;
targetlist = findchainfloat(bot_attack, TRUE);
missile = find(world, classname, "rocket");
- while (missile)
+ while(missile)
{
- if (missile.realowner != self)
+ if(missile.realowner != self)
{
missile = find(missile, classname, "rocket");
continue;
}
targ = targetlist;
- while (targ)
+ while(targ)
{
d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - missile.origin);
d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
// count potential damage according to type of target
- if (targ == self)
+ if(targ == self)
selfdamage = selfdamage + d;
- else if (targ.team == self.team && teamplay)
+ else if(targ.team == self.team && teamplay)
teamdamage = teamdamage + d;
- else if (bot_shouldattack(targ))
+ else if(bot_shouldattack(targ))
enemydamage = enemydamage + d;
targ = targ.chain;
}
}
float desirabledamage;
desirabledamage = enemydamage;
- if (time > self.invincible_finished && time > self.spawnshieldtime)
+ if(time > self.invincible_finished && time > self.spawnshieldtime)
desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
- if (teamplay && self.team)
+ if(teamplay && self.team)
desirabledamage = desirabledamage - teamdamage;
missile = find(world, classname, "rocket");
- while (missile)
+ while(missile)
{
- if (missile.realowner != self)
+ if(missile.realowner != self)
{
missile = find(missile, classname, "rocket");
continue;
}
makevectors(missile.v_angle);
targ = targetlist;
- if (skill > 9) // normal players only do this for the target they are tracking
+ if(skill > 9) // normal players only do this for the target they are tracking
{
targ = targetlist;
- while (targ)
+ while(targ)
{
- if (
+ if(
(v_forward * normalize(missile.origin - targ.origin)< 0.1)
&& desirabledamage > 0.1*coredamage
)self.BUTTON_ATCK2 = TRUE;
}
// if we would be doing at X percent of the core damage, detonate it
// but don't fire a new shot at the same time!
- if (desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
+ if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
self.BUTTON_ATCK2 = TRUE;
- if ((skill > 6.5) && (selfdamage > self.health))
+ if((skill > 6.5) && (selfdamage > self.health))
self.BUTTON_ATCK2 = FALSE;
//if(self.BUTTON_ATCK2 == TRUE)
// dprint(ftos(desirabledamage),"\n");
- if (self.BUTTON_ATCK2 == TRUE) self.BUTTON_ATCK = FALSE;
+ if(self.BUTTON_ATCK2 == TRUE) self.BUTTON_ATCK = FALSE;
}
return TRUE;
}
}
if(rockfound)
- sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
}
}
{
#if 0
// don't switch while guiding a missile
- if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_DEVASTATOR)
+ if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_DEVASTATOR)
{
ammo_amount = FALSE;
if(WEP_CVAR(devastator, reload_ammo))
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_electro() { weapon_defaultspawnfunc(WEP_ELECTRO); }
+void spawnfunc_weapon_electro(void) { weapon_defaultspawnfunc(WEP_ELECTRO); }
void W_Electro_TriggerCombo(vector org, float rad, entity own)
{
W_Electro_Explode();
}
-void W_Electro_Bolt_Think()
+void W_Electro_Bolt_Think(void)
{
if(time >= self.ltime)
{
pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- proj = spawn ();
+ proj = spawn();
proj.classname = "electro_bolt";
proj.owner = proj.realowner = self;
proj.bot_dodge = TRUE;
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
-void W_Electro_CheckAttack()
+void W_Electro_CheckAttack(void)
{
if(self.electro_count > 1)
if(self.BUTTON_ATCK2)
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_fireball() { weapon_defaultspawnfunc(WEP_FIREBALL); }
+void spawnfunc_weapon_fireball(void) { weapon_defaultspawnfunc(WEP_FIREBALL); }
-void W_Fireball_Explode (void)
+void W_Fireball_Explode(void)
{
entity e;
float dist;
// 1. dist damage
d = (self.realowner.health + self.realowner.armorvalue);
- RadiusDamage (self, self.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), world, world, WEP_CVAR_PRI(fireball, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), world, world, WEP_CVAR_PRI(fireball, force), self.projectiledeathtype, other);
if(self.realowner.health + self.realowner.armorvalue >= d)
if(!self.cnt)
{
}
}
- remove (self);
+ remove(self);
}
-void W_Fireball_TouchExplode (void)
+void W_Fireball_TouchExplode(void)
{
PROJECTILE_TOUCH;
- W_Fireball_Explode ();
+ W_Fireball_Explode();
}
void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage, float burntime)
}
}
-void W_Fireball_Think()
+void W_Fireball_Think(void)
{
if(time > self.pushltime)
{
self.nextthink = time + 0.1;
}
-void W_Fireball_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Fireball_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
self.health = self.health - damage;
- if (self.health <= 0)
+ if(self.health <= 0)
{
self.cnt = 1;
W_PrepareExplosionByDamage(attacker, W_Fireball_Explode);
}
}
-void W_Fireball_Attack1()
+void W_Fireball_Attack1(void)
{
entity proj;
- W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
+ W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage));
pointparticles(particleeffectnum("fireball_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- proj = spawn ();
+ proj = spawn();
proj.classname = "plasma_prim";
proj.owner = proj.realowner = self;
proj.bot_dodge = TRUE;
void W_Fireball_AttackEffect(float i, vector f_diff)
{
- W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 0, "", 0, 0);
+ W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', FALSE, 0, "", 0, 0);
w_shotorg += f_diff_x * v_up + f_diff_y * v_right;
pointparticles(particleeffectnum("fireball_preattack_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
}
-void W_Fireball_Attack1_Frame4()
+void W_Fireball_Attack1_Frame4(void)
{
W_Fireball_Attack1();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), w_ready);
}
-void W_Fireball_Attack1_Frame3()
+void W_Fireball_Attack1_Frame3(void)
{
W_Fireball_AttackEffect(0, '+1.25 +3.75 0');
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame4);
}
-void W_Fireball_Attack1_Frame2()
+void W_Fireball_Attack1_Frame2(void)
{
W_Fireball_AttackEffect(0, '-1.25 +3.75 0');
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame3);
}
-void W_Fireball_Attack1_Frame1()
+void W_Fireball_Attack1_Frame1(void)
{
W_Fireball_AttackEffect(1, '+1.25 -3.75 0');
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame2);
}
-void W_Fireball_Attack1_Frame0()
+void W_Fireball_Attack1_Frame0(void)
{
W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
- sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTEN_NORM);
+ sound(self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTEN_NORM);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1);
}
-void W_Fireball_Firemine_Think()
+void W_Fireball_Firemine_Think(void)
{
if(time > self.pushltime)
{
self.nextthink = time + 0.1;
}
-void W_Fireball_Firemine_Touch (void)
+void W_Fireball_Firemine_Touch(void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM)
+ if(other.takedamage == DAMAGE_AIM)
if(Fire_AddDamage(other, self.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), self.projectiledeathtype) >= 0)
{
remove(self);
self.projectiledeathtype |= HITTYPE_BOUNCE;
}
-void W_Fireball_Attack2()
+void W_Fireball_Attack2(void)
{
entity proj;
vector f_diff;
pointparticles(particleeffectnum("fireball_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- proj = spawn ();
+ proj = spawn();
proj.owner = proj.realowner = self;
proj.classname = "grenade";
proj.bot_dodge = TRUE;
{
self.BUTTON_ATCK = FALSE;
self.BUTTON_ATCK2 = FALSE;
- if (self.bot_primary_fireballmooth == 0)
+ if(self.bot_primary_fireballmooth == 0)
{
if(bot_aim(WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), FALSE))
{
}
case WR_THINK:
{
- if (self.BUTTON_ATCK)
+ if(self.BUTTON_ATCK)
{
- if (time >= self.fireball_primarytime)
- if (weapon_prepareattack(0, WEP_CVAR_PRI(fireball, refire)))
+ if(time >= self.fireball_primarytime)
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(fireball, refire)))
{
W_Fireball_Attack1_Frame0();
self.fireball_primarytime = time + WEP_CVAR_PRI(fireball, refire2) * W_WeaponRateFactor();
}
}
- else if (self.BUTTON_ATCK2)
+ else if(self.BUTTON_ATCK2)
{
- if (weapon_prepareattack(1, WEP_CVAR_SEC(fireball, refire)))
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(fireball, refire)))
{
W_Fireball_Attack2();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(fireball, animtime), w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_fireball.md3");
- precache_model ("models/weapons/v_fireball.md3");
- precache_model ("models/weapons/h_fireball.iqm");
- precache_model ("models/sphere/sphere.md3");
- precache_sound ("weapons/fireball_fire.wav");
- precache_sound ("weapons/fireball_fire2.wav");
- precache_sound ("weapons/fireball_prefire2.wav");
+ precache_model("models/weapons/g_fireball.md3");
+ precache_model("models/weapons/v_fireball.md3");
+ precache_model("models/weapons/h_fireball.iqm");
+ precache_model("models/sphere/sphere.md3");
+ precache_sound("weapons/fireball_fire.wav");
+ precache_sound("weapons/fireball_fire2.wav");
+ precache_sound("weapons/fireball_prefire2.wav");
FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_hagar() { weapon_defaultspawnfunc(WEP_HAGAR); }
+void spawnfunc_weapon_hagar(void) { weapon_defaultspawnfunc(WEP_HAGAR); }
// NO bounce protection, as bounces are limited!
-void W_Hagar_Explode (void)
+void W_Hagar_Explode(void)
{
self.event_damage = func_null;
- RadiusDamage (self, self.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
-void W_Hagar_Explode2 (void)
+void W_Hagar_Explode2(void)
{
self.event_damage = func_null;
- RadiusDamage (self, self.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
-void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Hagar_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : TRUE)
else
is_linkexplode = -1; // not secondary load, so continue as normal without exception.
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode))
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode))
return; // g_projectiles_damage says to halt
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
- if (self.health <= 0)
+ if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, self.think);
}
-void W_Hagar_Touch (void)
+void W_Hagar_Touch(void)
{
PROJECTILE_TOUCH;
- self.use ();
+ self.use();
}
-void W_Hagar_Touch2 (void)
+void W_Hagar_Touch2(void)
{
PROJECTILE_TOUCH;
} else {
self.cnt++;
pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
- self.angles = vectoangles (self.velocity);
+ self.angles = vectoangles(self.velocity);
self.owner = world;
self.projectiledeathtype |= HITTYPE_BOUNCE;
}
}
-void W_Hagar_Attack (void)
+void W_Hagar_Attack(void)
{
entity missile;
W_DecreaseAmmo(WEP_CVAR_PRI(hagar, ammo));
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
+ W_SetupShot(self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- missile = spawn ();
+ missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.nextthink = time + WEP_CVAR_PRI(hagar, lifetime);
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR;
- setorigin (missile, w_shotorg);
+ setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.movetype = MOVETYPE_FLY;
W_SetupProjVelocity_PRI(missile, hagar);
- missile.angles = vectoangles (missile.velocity);
+ missile.angles = vectoangles(missile.velocity);
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
-void W_Hagar_Attack2 (void)
+void W_Hagar_Attack2(void)
{
entity missile;
W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+ W_SetupShot(self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- missile = spawn ();
+ missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
- setorigin (missile, w_shotorg);
+ setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.movetype = MOVETYPE_BOUNCEMISSILE;
W_SetupProjVelocity_SEC(missile, hagar);
- missile.angles = vectoangles (missile.velocity);
+ missile.angles = vectoangles(missile.velocity);
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH;
}
.float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
-void W_Hagar_Attack2_Load_Release (void)
+void W_Hagar_Attack2_Load_Release(void)
{
// time to release the rockets we've loaded
weapon_prepareattack_do(1, WEP_CVAR_SEC(hagar, refire));
- W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
+ W_SetupShot(self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
forward = v_forward;
missile = world;
for(counter = 0; counter < shots; ++counter)
{
- missile = spawn ();
+ missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
PROJECTILE_MAKETRIGGER(missile);
missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
- setorigin (missile, w_shotorg);
+ setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
missile.movetype = MOVETYPE_FLY;
missile.missile_flags = MIF_SPLASH;
// pattern spread calculation
s = '0 0 0';
- if (counter == 0)
+ if(counter == 0)
s = '0 0 0';
else
{
W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s_y + up * s_z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, FALSE);
- missile.angles = vectoangles (missile.velocity);
+ missile.angles = vectoangles(missile.velocity);
missile.flags = FL_PROJECTILE;
CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
self.hagar_load = 0;
}
-void W_Hagar_Attack2_Load (void)
+void W_Hagar_Attack2_Load(void)
{
// loadable hagar secondary attack, must always run each frame
self.hagar_load += 1;
sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
- if (self.hagar_load >= WEP_CVAR_SEC(hagar, load_max))
+ if(self.hagar_load >= WEP_CVAR_SEC(hagar, load_max))
self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor();
else
self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor();
{
case WR_AIM:
{
- if (random()>0.15)
+ if(random()>0.15)
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), FALSE);
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), FALSE);
float loadable_secondary;
loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary));
- if (loadable_secondary)
+ if(loadable_secondary)
W_Hagar_Attack2_Load(); // must always run each frame
if(autocvar_g_balance_hagar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo))) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
- else if (self.BUTTON_ATCK && !self.hagar_load && !self.hagar_loadblock) // not while secondary is loaded or awaiting reset
+ else if(self.BUTTON_ATCK && !self.hagar_load && !self.hagar_loadblock) // not while secondary is loaded or awaiting reset
{
- if (weapon_prepareattack(0, WEP_CVAR_PRI(hagar, refire)))
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(hagar, refire)))
{
W_Hagar_Attack();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hagar, refire), w_ready);
}
}
- else if (self.BUTTON_ATCK2 && !loadable_secondary && WEP_CVAR(hagar, secondary))
+ else if(self.BUTTON_ATCK2 && !loadable_secondary && WEP_CVAR(hagar, secondary))
{
- if (weapon_prepareattack(1, WEP_CVAR_SEC(hagar, refire)))
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(hagar, refire)))
{
W_Hagar_Attack2();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_hagar.md3");
- precache_model ("models/weapons/v_hagar.md3");
- precache_model ("models/weapons/h_hagar.iqm");
- precache_sound ("weapons/hagar_fire.wav");
- precache_sound ("weapons/hagar_load.wav");
- precache_sound ("weapons/hagar_beep.wav");
+ precache_model("models/weapons/g_hagar.md3");
+ precache_model("models/weapons/v_hagar.md3");
+ precache_model("models/weapons/h_hagar.iqm");
+ precache_sound("weapons/hagar_fire.wav");
+ precache_sound("weapons/hagar_load.wav");
+ precache_sound("weapons/hagar_beep.wav");
HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
if(!w_issilent)
{
- if (w_random<0.15)
+ if(w_random<0.15)
sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
- else if (w_random<0.7)
+ else if(w_random<0.7)
sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
else
sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_hlac() { weapon_defaultspawnfunc(WEP_HLAC); }
+void spawnfunc_weapon_hlac(void) { weapon_defaultspawnfunc(WEP_HLAC); }
-void W_HLAC_Touch (void)
+void W_HLAC_Touch(void)
{
float isprimary;
RadiusDamage(self, self.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
-void W_HLAC_Attack (void)
+void W_HLAC_Attack(void)
{
entity missile;
float spread;
if(self.crouch)
spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
+ W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- if (!autocvar_g_norecoil)
+ if(!autocvar_g_norecoil)
{
- self.punchangle_x = random () - 0.5;
- self.punchangle_y = random () - 0.5;
+ self.punchangle_x = random() - 0.5;
+ self.punchangle_y = random() - 0.5;
}
- missile = spawn ();
+ missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "hlacbolt";
missile.bot_dodge = TRUE;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
- setorigin (missile, w_shotorg);
+ setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjVelocity_Basic(missile, WEP_CVAR_PRI(hlac, speed), spread);
- //missile.angles = vectoangles (missile.velocity); // csqc
+ //missile.angles = vectoangles(missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
-void W_HLAC_Attack2()
+void W_HLAC_Attack2(void)
{
entity missile;
float spread;
if(self.crouch)
spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
- W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
+ W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage));
pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- missile = spawn ();
+ missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "hlacbolt";
missile.bot_dodge = TRUE;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
- setorigin (missile, w_shotorg);
+ setorigin(missile, w_shotorg);
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjVelocity_Basic(missile, WEP_CVAR_SEC(hlac, speed), spread);
- //missile.angles = vectoangles (missile.velocity); // csqc
+ //missile.angles = vectoangles(missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
}
// weapon frames
-void W_HLAC_Attack_Frame()
+void W_HLAC_Attack_Frame(void)
{
if(self.weapon != self.switchweapon) // abort immediately if switching
{
return;
}
- if (self.BUTTON_ATCK)
+ if(self.BUTTON_ATCK)
{
- if (!WEP_ACTION(self.weapon, WR_CHECKAMMO1))
+ if(!WEP_ACTION(self.weapon, WR_CHECKAMMO1))
if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
}
}
-void W_HLAC_Attack2_Frame()
+void W_HLAC_Attack2_Frame(void)
{
float i;
for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
W_HLAC_Attack2();
- if (!autocvar_g_norecoil)
+ if(!autocvar_g_norecoil)
{
- self.punchangle_x = random () - 0.5;
- self.punchangle_y = random () - 0.5;
+ self.punchangle_x = random() - 0.5;
+ self.punchangle_y = random() - 0.5;
}
}
{
if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo))) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
- else if (self.BUTTON_ATCK)
+ else if(self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, WEP_CVAR_PRI(hlac, refire)))
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(hlac, refire)))
{
self.misc_bulletcounter = 0;
W_HLAC_Attack();
}
}
- else if (self.BUTTON_ATCK2 && WEP_CVAR(hlac, secondary))
+ else if(self.BUTTON_ATCK2 && WEP_CVAR(hlac, secondary))
{
- if (weapon_prepareattack(1, WEP_CVAR_SEC(hlac, refire)))
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(hlac, refire)))
{
W_HLAC_Attack2_Frame();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_hlac.md3");
- precache_model ("models/weapons/v_hlac.md3");
- precache_model ("models/weapons/h_hlac.iqm");
- precache_sound ("weapons/lasergun_fire.wav");
+ precache_model("models/weapons/g_hlac.md3");
+ precache_model("models/weapons/v_hlac.md3");
+ precache_model("models/weapons/h_hlac.iqm");
+ precache_sound("weapons/lasergun_fire.wav");
HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#else
#ifdef SVQC
-void spawnfunc_weapon_hook()
+void spawnfunc_weapon_hook(void)
{
if(g_grappling_hook) // offhand hook
{
weapon_defaultspawnfunc(WEP_HOOK);
}
-void W_Hook_ExplodeThink (void)
+void W_Hook_ExplodeThink(void)
{
float dt, dmg_remaining_next, f;
f = self.dmg_last - dmg_remaining_next;
self.dmg_last = dmg_remaining_next;
- RadiusDamage (self, self.realowner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.realowner, world, self.dmg_force * f, self.projectiledeathtype, world);
+ RadiusDamage(self, self.realowner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.realowner, world, self.dmg_force * f, self.projectiledeathtype, world);
self.projectiledeathtype |= HITTYPE_BOUNCE;
- //RadiusDamage (self, world, self.dmg * f, self.dmg_edge * f, self.dmg_radius, world, world, self.dmg_force * f, self.projectiledeathtype, world);
+ //RadiusDamage(self, world, self.dmg * f, self.dmg_edge * f, self.dmg_radius, world, world, self.dmg_force * f, self.projectiledeathtype, world);
if(dt < self.dmg_duration)
self.nextthink = time + 0.05; // soon
remove(self);
}
-void W_Hook_Explode2 (void)
+void W_Hook_Explode2(void)
{
self.event_damage = func_null;
self.touch = func_null;
self.movetype = MOVETYPE_NONE;
}
-void W_Hook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Hook_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
self.health = self.health - damage;
- if (self.health <= 0)
+ if(self.health <= 0)
W_PrepareExplosionByDamage(self.realowner, W_Hook_Explode2);
}
-void W_Hook_Touch2 (void)
+void W_Hook_Touch2(void)
{
PROJECTILE_TOUCH;
self.use();
}
-void W_Hook_Attack2()
+void W_Hook_Attack2(void)
{
entity gren;
//W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
- W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
+ W_SetupShot(self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
- gren = spawn ();
+ gren = spawn();
gren.owner = gren.realowner = self;
gren.classname = "hookbomb";
gren.bot_dodge = TRUE;
}
case WR_THINK:
{
- if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
+ if(self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
{
if(!self.hook)
if(!(self.hook_state & HOOK_WAITING_FOR_RELEASE))
if(!(self.hook_state & HOOK_FIRING))
- if (time > self.hook_refire)
- if (weapon_prepareattack(0, -1))
+ if(time > self.hook_refire)
+ if(weapon_prepareattack(0, -1))
{
W_DecreaseAmmo(WEP_CVAR_PRI(hook, ammo));
self.hook_state |= HOOK_FIRING;
}
}
- if (self.BUTTON_ATCK2)
+ if(self.BUTTON_ATCK2)
{
- if (weapon_prepareattack(1, WEP_CVAR_SEC(hook, refire)))
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(hook, refire)))
{
W_Hook_Attack2();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hook, animtime), w_ready);
if(self.hook && self.hook.state == 1)
{
hooked_time_max = WEP_CVAR_PRI(hook, hooked_time_max);
- if (hooked_time_max > 0)
+ if(hooked_time_max > 0)
{
- if ( time > self.hook_time_hooked + hooked_time_max )
+ if( time > self.hook_time_hooked + hooked_time_max )
self.hook_state |= HOOK_REMOVING;
}
hooked_fuel = WEP_CVAR_PRI(hook, hooked_ammo);
- if (hooked_fuel > 0)
+ if(hooked_fuel > 0)
{
- if ( time > self.hook_time_fueldecrease )
+ if( time > self.hook_time_fueldecrease )
{
if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
- if ( self.ammo_fuel >= (time - self.hook_time_fueldecrease) * hooked_fuel )
+ if( self.ammo_fuel >= (time - self.hook_time_fueldecrease) * hooked_fuel )
{
W_DecreaseAmmo((time - self.hook_time_fueldecrease) * hooked_fuel);
self.hook_time_fueldecrease = time;
self.hook_time_fueldecrease = time + WEP_CVAR_PRI(hook, hooked_time_free);
}
- if (self.BUTTON_CROUCH)
+ if(self.BUTTON_CROUCH)
{
self.hook_state &= ~HOOK_PULLING;
- if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
+ if(self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
self.hook_state &= ~HOOK_RELEASING;
else
self.hook_state |= HOOK_RELEASING;
self.hook_state |= HOOK_PULLING;
self.hook_state &= ~HOOK_RELEASING;
- if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
+ if(self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_HOOK))
{
// already fired
if(self.hook)
}
case WR_INIT:
{
- precache_model ("models/weapons/g_hookgun.md3");
- precache_model ("models/weapons/v_hookgun.md3");
- precache_model ("models/weapons/h_hookgun.iqm");
- precache_sound ("weapons/hook_impact.wav"); // done by g_hook.qc
- precache_sound ("weapons/hook_fire.wav");
- precache_sound ("weapons/hookbomb_fire.wav");
+ precache_model("models/weapons/g_hookgun.md3");
+ precache_model("models/weapons/v_hookgun.md3");
+ precache_model("models/weapons/h_hookgun.iqm");
+ precache_sound("weapons/hook_impact.wav"); // done by g_hook.qc
+ precache_sound("weapons/hook_fire.wav");
+ precache_sound("weapons/hookbomb_fire.wav");
HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#else
#ifdef SVQC
-void spawnfunc_weapon_machinegun()
+void spawnfunc_weapon_machinegun(void)
{
if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.classname != "droppedweapon")
}
weapon_defaultspawnfunc(WEP_MACHINEGUN);
}
-void spawnfunc_weapon_uzi() { spawnfunc_weapon_machinegun(); }
+void spawnfunc_weapon_uzi(void) { spawnfunc_weapon_machinegun(); }
-void W_MachineGun_MuzzleFlash_Think()
+void W_MachineGun_MuzzleFlash_Think(void)
{
self.frame = self.frame + 2;
self.scale = self.scale * 0.5;
self.alpha = self.alpha - 0.25;
self.nextthink = time + 0.05;
- if (self.alpha <= 0)
+ if(self.alpha <= 0)
{
self.think = SUB_Remove;
self.nextthink = time;
}
-void W_MachineGun_MuzzleFlash()
+void W_MachineGun_MuzzleFlash(void)
{
- if (self.muzzle_flash == world)
+ if(self.muzzle_flash == world)
self.muzzle_flash = spawn();
// muzzle flash for 1st person view
void W_MachineGun_Attack(float deathtype)
{
- W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
- if (!autocvar_g_norecoil)
+ W_SetupShot(self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
+ if(!autocvar_g_norecoil)
{
- self.punchangle_x = random () - 0.5;
- self.punchangle_y = random () - 0.5;
+ self.punchangle_x = random() - 0.5;
+ self.punchangle_y = random() - 0.5;
}
// this attack_finished just enforces a cooldown at the end of a burst
ATTACK_FINISHED(self) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor();
- if (self.misc_bulletcounter == 1)
+ if(self.misc_bulletcounter == 1)
fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
else
fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
W_AttachToShotorg(self.muzzle_flash, '5 0 0');
// casing code
- if (autocvar_g_casings >= 2)
- 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, self);
+ if(autocvar_g_casings >= 2)
+ 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, self);
- if (self.misc_bulletcounter == 1)
+ if(self.misc_bulletcounter == 1)
W_DecreaseAmmo(WEP_CVAR(machinegun, first_ammo));
else
W_DecreaseAmmo(WEP_CVAR(machinegun, sustained_ammo));
}
// weapon frames
-void W_MachineGun_Attack_Frame()
+void W_MachineGun_Attack_Frame(void)
{
if(self.weapon != self.switchweapon) // abort immediately if switching
{
w_ready();
return;
}
- if (self.BUTTON_ATCK)
+ if(self.BUTTON_ATCK)
{
- if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
- if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
+ if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
}
-void W_MachineGun_Attack_Auto()
+void W_MachineGun_Attack_Auto(void)
{
float machinegun_spread;
- if (!self.BUTTON_ATCK)
+ if(!self.BUTTON_ATCK)
{
w_ready();
return;
}
- if (!WEP_ACTION(self.weapon, WR_CHECKAMMO1))
- if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!WEP_ACTION(self.weapon, WR_CHECKAMMO1))
+ if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
W_DecreaseAmmo(WEP_CVAR(machinegun, sustained_ammo));
- W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
- if (!autocvar_g_norecoil)
+ W_SetupShot(self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+ if(!autocvar_g_norecoil)
{
- self.punchangle_x = random () - 0.5;
- self.punchangle_y = random () - 0.5;
+ self.punchangle_x = random() - 0.5;
+ self.punchangle_y = random() - 0.5;
}
machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * self.misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
W_MachineGun_MuzzleFlash();
W_AttachToShotorg(self.muzzle_flash, '5 0 0');
- if (autocvar_g_casings >= 2) // casing code
- 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, self);
+ if(autocvar_g_casings >= 2) // casing code
+ 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, self);
ATTACK_FINISHED(self) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), W_MachineGun_Attack_Auto);
}
-void W_MachineGun_Attack_Burst()
+void W_MachineGun_Attack_Burst(void)
{
- W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
- if (!autocvar_g_norecoil)
+ W_SetupShot(self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+ if(!autocvar_g_norecoil)
{
- self.punchangle_x = random () - 0.5;
- self.punchangle_y = random () - 0.5;
+ self.punchangle_x = random() - 0.5;
+ self.punchangle_y = random() - 0.5;
}
fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN, 0);
W_MachineGun_MuzzleFlash();
W_AttachToShotorg(self.muzzle_flash, '5 0 0');
- if (autocvar_g_casings >= 2) // casing code
- 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, self);
+ if(autocvar_g_casings >= 2) // casing code
+ 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, self);
self.misc_bulletcounter = self.misc_bulletcounter + 1;
- if (self.misc_bulletcounter == 0)
+ if(self.misc_bulletcounter == 0)
{
ATTACK_FINISHED(self) = time + WEP_CVAR(machinegun, burst_refire2) * W_WeaponRateFactor();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(machinegun, burst_animtime), w_ready);
WEP_ACTION(self.weapon, WR_RELOAD);
else if(WEP_CVAR(machinegun, mode) == 1)
{
- if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, 0))
+ if(self.BUTTON_ATCK)
+ if(weapon_prepareattack(0, 0))
{
self.misc_bulletcounter = 0;
W_MachineGun_Attack_Auto();
if(self.BUTTON_ATCK2)
if(weapon_prepareattack(1, 0))
{
- if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
- if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
+ if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
else
{
- if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, 0))
+ if(self.BUTTON_ATCK)
+ if(weapon_prepareattack(0, 0))
{
self.misc_bulletcounter = 1;
W_MachineGun_Attack(WEP_MACHINEGUN); // sets attack_finished
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), W_MachineGun_Attack_Frame);
}
- if (self.BUTTON_ATCK2 && WEP_CVAR(machinegun, first))
- if (weapon_prepareattack(1, 0))
+ if(self.BUTTON_ATCK2 && WEP_CVAR(machinegun, first))
+ if(weapon_prepareattack(1, 0))
{
self.misc_bulletcounter = 1;
W_MachineGun_Attack(WEP_MACHINEGUN | HITTYPE_SECONDARY); // sets attack_finished
}
case WR_INIT:
{
- precache_model ("models/uziflash.md3");
- precache_model ("models/weapons/g_uzi.md3");
- precache_model ("models/weapons/v_uzi.md3");
- precache_model ("models/weapons/h_uzi.iqm");
- precache_sound ("weapons/uzi_fire.wav");
+ precache_model("models/uziflash.md3");
+ precache_model("models/weapons/g_uzi.md3");
+ precache_model("models/weapons/v_uzi.md3");
+ precache_model("models/weapons/h_uzi.iqm");
+ precache_sound("weapons/uzi_fire.wav");
MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#ifdef SVQC
MINELAYER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
-void W_MineLayer_Think (void);
+void W_MineLayer_Think(void);
.float minelayer_detonate, mine_explodeanyway;
.float mine_time;
.vector mine_orientation;
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_minelayer() { weapon_defaultspawnfunc(WEP_MINE_LAYER); }
+void spawnfunc_weapon_minelayer(void) { weapon_defaultspawnfunc(WEP_MINE_LAYER); }
-void W_MineLayer_Stick (entity to)
+void W_MineLayer_Stick(entity to)
{
- spamsound (self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/mine_stick.wav", VOL_BASE, ATTN_NORM);
// in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
SetMovetypeFollow(self, to);
}
-void W_MineLayer_Explode()
+void W_MineLayer_Explode(void)
{
if(other.takedamage == DAMAGE_AIM)
if(IS_PLAYER(other))
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
- RadiusDamage (self, self.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), self.projectiledeathtype, other);
- if (self.realowner.weapon == WEP_MINE_LAYER)
+ if(self.realowner.weapon == WEP_MINE_LAYER)
{
entity oldself;
oldself = self;
self = self.realowner;
- if (!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1))
+ if(!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1))
{
self.cnt = WEP_MINE_LAYER;
ATTACK_FINISHED(self) = time;
self = oldself;
}
self.realowner.minelayer_mines -= 1;
- remove (self);
+ remove(self);
}
-void W_MineLayer_DoRemoteExplode ()
+void W_MineLayer_DoRemoteExplode(void)
{
self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
self.velocity = self.mine_orientation; // particle fx and decals need .velocity
- RadiusDamage (self, self.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+ RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
- if (self.realowner.weapon == WEP_MINE_LAYER)
+ if(self.realowner.weapon == WEP_MINE_LAYER)
{
entity oldself;
oldself = self;
self = self.realowner;
- if (!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1))
+ if(!WEP_ACTION(WEP_MINE_LAYER, WR_CHECKAMMO1))
{
self.cnt = WEP_MINE_LAYER;
ATTACK_FINISHED(self) = time;
self = oldself;
}
self.realowner.minelayer_mines -= 1;
- remove (self);
+ remove(self);
}
-void W_MineLayer_RemoteExplode ()
+void W_MineLayer_RemoteExplode(void)
{
if(self.realowner.deadflag == DEAD_NO)
if((self.spawnshieldtime >= 0)
}
}
-void W_MineLayer_ProximityExplode ()
+void W_MineLayer_ProximityExplode(void)
{
// make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
if(WEP_CVAR(minelayer, protection) && self.mine_explodeanyway == 0)
return minecount;
}
-void W_MineLayer_Think (void)
+void W_MineLayer_Think(void)
{
entity head;
// our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
// TODO: replace this mine_trigger.wav sound with a real countdown
- if ((time > self.cnt) && (!self.mine_time))
+ if((time > self.cnt) && (!self.mine_time))
{
if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
- spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
self.mine_time = time + WEP_CVAR(minelayer, lifetime_countdown);
self.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
}
if(head != self.realowner && DIFF_TEAM(head, self.realowner)) // don't trigger for team mates
if(!self.mine_time)
{
- spamsound (self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
self.mine_time = time + WEP_CVAR(minelayer, time);
}
head = head.chain;
}
// remote detonation
- if (self.realowner.weapon == WEP_MINE_LAYER)
- if (self.realowner.deadflag == DEAD_NO)
- if (self.minelayer_detonate)
+ if(self.realowner.weapon == WEP_MINE_LAYER)
+ if(self.realowner.deadflag == DEAD_NO)
+ if(self.minelayer_detonate)
W_MineLayer_RemoteExplode();
}
-void W_MineLayer_Touch (void)
+void W_MineLayer_Touch(void)
{
if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
return; // we're already a stuck mine, why do we get called? TODO does this even happen?
}
}
-void W_MineLayer_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_MineLayer_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
float is_from_enemy = (inflictor.realowner != self.realowner);
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1)))
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_from_enemy ? 1 : -1)))
return; // g_projectiles_damage says to halt
self.health = self.health - damage;
self.angles = vectoangles(self.velocity);
- if (self.health <= 0)
+ if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_MineLayer_Explode);
}
-void W_MineLayer_Attack()
+void W_MineLayer_Attack(void)
{
entity mine;
entity flash;
W_DecreaseAmmo(WEP_CVAR(minelayer, ammo));
- W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CH_WEAPON_A, WEP_CVAR(minelayer, damage));
+ W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CH_WEAPON_A, WEP_CVAR(minelayer, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
mine = WarpZone_RefSys_SpawnSameRefSys(self);
mine.movetype = MOVETYPE_TOSS;
PROJECTILE_MAKETRIGGER(mine);
mine.projectiledeathtype = WEP_MINE_LAYER;
- setsize (mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
+ setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
- setorigin (mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
+ setorigin(mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
W_SetupProjVelocity_Basic(mine, WEP_CVAR(minelayer, speed), 0);
- mine.angles = vectoangles (mine.velocity);
+ mine.angles = vectoangles(mine.velocity);
mine.touch = W_MineLayer_Touch;
mine.think = W_MineLayer_Think;
CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
// muzzle flash for 1st person view
- flash = spawn ();
- setmodel (flash, "models/flash.md3"); // precision set below
- SUB_SetFade (flash, time, 0.1);
+ flash = spawn();
+ setmodel(flash, "models/flash.md3"); // precision set below
+ SUB_SetFade(flash, time, 0.1);
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
W_AttachToShotorg(flash, '5 0 0');
enemydamage = 0;
targetlist = findchainfloat(bot_attack, TRUE);
mine = find(world, classname, "mine");
- while (mine)
+ while(mine)
{
- if (mine.realowner != self)
+ if(mine.realowner != self)
{
mine = find(mine, classname, "mine");
continue;
}
targ = targetlist;
- while (targ)
+ while(targ)
{
d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - mine.origin);
d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
// count potential damage according to type of target
- if (targ == self)
+ if(targ == self)
selfdamage = selfdamage + d;
- else if (targ.team == self.team && teamplay)
+ else if(targ.team == self.team && teamplay)
teamdamage = teamdamage + d;
- else if (bot_shouldattack(targ))
+ else if(bot_shouldattack(targ))
enemydamage = enemydamage + d;
targ = targ.chain;
}
}
float desirabledamage;
desirabledamage = enemydamage;
- if (time > self.invincible_finished && time > self.spawnshieldtime)
+ if(time > self.invincible_finished && time > self.spawnshieldtime)
desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
- if (teamplay && self.team)
+ if(teamplay && self.team)
desirabledamage = desirabledamage - teamdamage;
mine = find(world, classname, "mine");
- while (mine)
+ while(mine)
{
- if (mine.realowner != self)
+ if(mine.realowner != self)
{
mine = find(mine, classname, "mine");
continue;
}
makevectors(mine.v_angle);
targ = targetlist;
- if (skill > 9) // normal players only do this for the target they are tracking
+ if(skill > 9) // normal players only do this for the target they are tracking
{
targ = targetlist;
- while (targ)
+ while(targ)
{
- if (
+ if(
(v_forward * normalize(mine.origin - targ.origin)< 0.1)
&& desirabledamage > 0.1*coredamage
)self.BUTTON_ATCK2 = TRUE;
}
// if we would be doing at X percent of the core damage, detonate it
// but don't fire a new shot at the same time!
- if (desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
+ if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
self.BUTTON_ATCK2 = TRUE;
- if ((skill > 6.5) && (selfdamage > self.health))
+ if((skill > 6.5) && (selfdamage > self.health))
self.BUTTON_ATCK2 = FALSE;
//if(self.BUTTON_ATCK2 == TRUE)
// dprint(ftos(desirabledamage),"\n");
- if (self.BUTTON_ATCK2 == TRUE) self.BUTTON_ATCK = FALSE;
+ if(self.BUTTON_ATCK2 == TRUE) self.BUTTON_ATCK = FALSE;
}
return TRUE;
if(!(W_MineLayer_PlacedMines(FALSE) && self.WEP_AMMO(MINE_LAYER) < WEP_CVAR(minelayer, ammo)))
WEP_ACTION(self.weapon, WR_RELOAD);
}
- else if (self.BUTTON_ATCK)
+ else if(self.BUTTON_ATCK)
{
if(weapon_prepareattack(0, WEP_CVAR(minelayer, refire)))
{
}
}
- if (self.BUTTON_ATCK2)
+ if(self.BUTTON_ATCK2)
{
if(W_MineLayer_PlacedMines(TRUE))
- sound (self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_B, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
}
return TRUE;
}
case WR_INIT:
{
- precache_model ("models/flash.md3");
- precache_model ("models/mine.md3");
- precache_model ("models/weapons/g_minelayer.md3");
- precache_model ("models/weapons/v_minelayer.md3");
- precache_model ("models/weapons/h_minelayer.iqm");
- precache_sound ("weapons/mine_det.wav");
- precache_sound ("weapons/mine_fire.wav");
- precache_sound ("weapons/mine_stick.wav");
- precache_sound ("weapons/mine_trigger.wav");
+ precache_model("models/flash.md3");
+ precache_model("models/mine.md3");
+ precache_model("models/weapons/g_minelayer.md3");
+ precache_model("models/weapons/v_minelayer.md3");
+ precache_model("models/weapons/h_minelayer.iqm");
+ precache_sound("weapons/mine_det.wav");
+ precache_sound("weapons/mine_fire.wav");
+ precache_sound("weapons/mine_stick.wav");
+ precache_sound("weapons/mine_trigger.wav");
MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
case WR_CHECKAMMO1:
{
// don't switch while placing a mine
- if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
+ if(ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
{
ammo_amount = self.WEP_AMMO(MINE_LAYER) >= WEP_CVAR(minelayer, ammo);
ammo_amount += self.(weapon_load[WEP_MINE_LAYER]) >= WEP_CVAR(minelayer, ammo);
}
case WR_CHECKAMMO2:
{
- if (W_MineLayer_PlacedMines(FALSE))
+ if(W_MineLayer_PlacedMines(FALSE))
return TRUE;
else
return FALSE;
#else
#ifdef SVQC
-void spawnfunc_weapon_mortar() { weapon_defaultspawnfunc(WEP_MORTAR); }
-void spawnfunc_weapon_grenadelauncher() { spawnfunc_weapon_mortar(); }
+void spawnfunc_weapon_mortar(void) { weapon_defaultspawnfunc(WEP_MORTAR); }
+void spawnfunc_weapon_grenadelauncher(void) { spawnfunc_weapon_mortar(); }
-void W_Mortar_Grenade_Explode()
+void W_Mortar_Grenade_Explode(void)
{
if(other.takedamage == DAMAGE_AIM)
if(IS_PLAYER(other))
if(self.movetype == MOVETYPE_NONE)
self.velocity = self.oldvelocity;
- RadiusDamage (self, self.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
-void W_Mortar_Grenade_Explode2()
+void W_Mortar_Grenade_Explode2(void)
{
if(other.takedamage == DAMAGE_AIM)
if(IS_PLAYER(other))
if(self.movetype == MOVETYPE_NONE)
self.velocity = self.oldvelocity;
- RadiusDamage (self, self.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
void W_Mortar_Grenade_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
self.health = self.health - damage;
- if (self.health <= 0)
+ if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, self.use);
}
-void W_Mortar_Grenade_Think1()
+void W_Mortar_Grenade_Think1(void)
{
self.nextthink = time;
- if (time > self.cnt)
+ if(time > self.cnt)
{
other = world;
self.projectiledeathtype |= HITTYPE_BOUNCE;
W_Mortar_Grenade_Explode();
}
-void W_Mortar_Grenade_Touch1()
+void W_Mortar_Grenade_Touch1(void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
+ if(other.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
{
- self.use ();
+ self.use();
}
- else if (WEP_CVAR_PRI(mortar, type) == 1) // bounce
+ else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
{
float r;
r = random() * 6;
if(r < 1)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
else if(r < 2)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
else if(r < 3)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
else if(r < 4)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
else if(r < 5)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
else
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
}
else if(WEP_CVAR_PRI(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
- spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
// let it stick whereever it is
self.oldvelocity = self.velocity;
}
}
-void W_Mortar_Grenade_Touch2()
+void W_Mortar_Grenade_Touch2(void)
{
PROJECTILE_TOUCH;
- if (other.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
+ if(other.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
{
- self.use ();
+ self.use();
}
- else if (WEP_CVAR_SEC(mortar, type) == 1) // bounce
+ else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
{
float r;
r = random() * 6;
if(r < 1)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce1.wav", VOL_BASE, ATTN_NORM);
else if(r < 2)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce2.wav", VOL_BASE, ATTN_NORM);
else if(r < 3)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce3.wav", VOL_BASE, ATTN_NORM);
else if(r < 4)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce4.wav", VOL_BASE, ATTN_NORM);
else if(r < 5)
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce5.wav", VOL_BASE, ATTN_NORM);
else
- spamsound (self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_bounce6.wav", VOL_BASE, ATTN_NORM);
pointparticles(particleeffectnum("hagar_bounce"), self.origin, self.velocity, 1);
self.projectiledeathtype |= HITTYPE_BOUNCE;
self.gl_bouncecnt += 1;
- if (WEP_CVAR_SEC(mortar, lifetime_bounce) && self.gl_bouncecnt == 1)
+ if(WEP_CVAR_SEC(mortar, lifetime_bounce) && self.gl_bouncecnt == 1)
self.nextthink = time + WEP_CVAR_SEC(mortar, lifetime_bounce);
}
else if(WEP_CVAR_SEC(mortar, type) == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
{
- spamsound (self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
+ spamsound(self, CH_SHOTS, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
// let it stick whereever it is
self.oldvelocity = self.velocity;
}
}
-void W_Mortar_Attack()
+void W_Mortar_Attack(void)
{
entity gren;
W_DecreaseAmmo(WEP_CVAR_PRI(mortar, ammo));
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- gren = spawn ();
+ gren = spawn();
gren.owner = gren.realowner = self;
gren.classname = "grenade";
gren.bot_dodge = TRUE;
gren.missile_flags = MIF_SPLASH | MIF_ARC;
W_SetupProjVelocity_UP_PRI(gren, mortar);
- gren.angles = vectoangles (gren.velocity);
+ gren.angles = vectoangles(gren.velocity);
gren.flags = FL_PROJECTILE;
if(WEP_CVAR_PRI(mortar, type) == 0 || WEP_CVAR_PRI(mortar, type) == 2)
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
-void W_Mortar_Attack2()
+void W_Mortar_Attack2(void)
{
entity gren;
W_DecreaseAmmo(WEP_CVAR_SEC(mortar, ammo));
- W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
+ W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- gren = spawn ();
+ gren = spawn();
gren.owner = gren.realowner = self;
gren.classname = "grenade";
gren.bot_dodge = TRUE;
gren.missile_flags = MIF_SPLASH | MIF_ARC;
W_SetupProjVelocity_UP_SEC(gren, mortar);
- gren.angles = vectoangles (gren.velocity);
+ gren.angles = vectoangles(gren.velocity);
gren.flags = FL_PROJECTILE;
if(WEP_CVAR_SEC(mortar, type) == 0 || WEP_CVAR_SEC(mortar, type) == 2)
{
self.BUTTON_ATCK = FALSE;
self.BUTTON_ATCK2 = FALSE;
- if (self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
+ if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
{
if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), TRUE))
{
{
if(autocvar_g_balance_mortar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
- else if (self.BUTTON_ATCK)
+ else if(self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, WEP_CVAR_PRI(mortar, refire)))
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(mortar, refire)))
{
W_Mortar_Attack();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
}
}
- else if (self.BUTTON_ATCK2)
+ else if(self.BUTTON_ATCK2)
{
if(WEP_CVAR_SEC(mortar, remote_detonateprimary))
{
}
}
if(nadefound)
- sound (self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_WEAPON_B, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
}
- else if (weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire)))
+ else if(weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire)))
{
W_Mortar_Attack2();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_gl.md3");
- precache_model ("models/weapons/v_gl.md3");
- precache_model ("models/weapons/h_gl.iqm");
- precache_sound ("weapons/grenade_bounce1.wav");
- precache_sound ("weapons/grenade_bounce2.wav");
- precache_sound ("weapons/grenade_bounce3.wav");
- precache_sound ("weapons/grenade_bounce4.wav");
- precache_sound ("weapons/grenade_bounce5.wav");
- precache_sound ("weapons/grenade_bounce6.wav");
- precache_sound ("weapons/grenade_stick.wav");
- precache_sound ("weapons/grenade_fire.wav");
+ precache_model("models/weapons/g_gl.md3");
+ precache_model("models/weapons/v_gl.md3");
+ precache_model("models/weapons/h_gl.iqm");
+ precache_sound("weapons/grenade_bounce1.wav");
+ precache_sound("weapons/grenade_bounce2.wav");
+ precache_sound("weapons/grenade_bounce3.wav");
+ precache_sound("weapons/grenade_bounce4.wav");
+ precache_sound("weapons/grenade_bounce5.wav");
+ precache_sound("weapons/grenade_bounce6.wav");
+ precache_sound("weapons/grenade_stick.wav");
+ precache_sound("weapons/grenade_fire.wav");
MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_porto (void) { weapon_defaultspawnfunc(WEP_PORTO); }
+void spawnfunc_weapon_porto(void) { weapon_defaultspawnfunc(WEP_PORTO); }
-void W_Porto_Success (void)
+void W_Porto_Success(void)
{
if(self.realowner == world)
{
}
string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo);
-void W_Porto_Fail (float failhard)
+void W_Porto_Fail(float failhard)
{
if(self.realowner == world)
{
if(self.cnt < 0 && !failhard && self.realowner.playerid == self.playerid && self.realowner.deadflag == DEAD_NO && !(self.realowner.weapons & WEPSET_PORTO))
{
- setsize (self, '-16 -16 0', '16 16 32');
+ setsize(self, '-16 -16 0', '16 16 32');
setorigin(self, self.origin + trace_plane_normal);
if(move_out_of_solid(self))
{
remove(self);
}
-void W_Porto_Remove (entity p)
+void W_Porto_Remove(entity p)
{
if(p.porto_current.realowner == p && p.porto_current.classname == "porto")
{
}
}
-void W_Porto_Think (void)
+void W_Porto_Think(void)
{
trace_plane_normal = '0 0 0';
if(self.realowner.playerid != self.playerid)
W_Porto_Fail(0);
}
-void W_Porto_Touch (void)
+void W_Porto_Touch(void)
{
vector norm;
}
}
-void W_Porto_Attack (float type)
+void W_Porto_Attack(float type)
{
entity gren;
- W_SetupShot (self, FALSE, 4, "porto/fire.wav", CH_WEAPON_A, 0);
+ W_SetupShot(self, FALSE, 4, "porto/fire.wav", CH_WEAPON_A, 0);
// always shoot from the eye
w_shotdir = v_forward;
w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
//pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- gren = spawn ();
+ gren = spawn();
gren.cnt = type;
gren.owner = gren.realowner = self;
gren.playerid = self.playerid;
else
W_SetupProjVelocity_Basic(gren, WEP_CVAR_BOTH(porto, (type <= 0), speed), 0);
- gren.angles = vectoangles (gren.velocity);
+ gren.angles = vectoangles(gren.velocity);
gren.flags = FL_PROJECTILE;
gren.portal_id = time;
{
//vector v_angle_save;
- if (g_nexball) { return w_nexball_weapon(req); }
+ if(g_nexball) { return w_nexball_weapon(req); }
switch(req)
{
{
if(WEP_CVAR(porto, secondary))
{
- if (self.BUTTON_ATCK)
- if (!self.porto_current)
- if (!self.porto_forbidden)
- if (weapon_prepareattack(0, WEP_CVAR_PRI(porto, refire)))
+ if(self.BUTTON_ATCK)
+ if(!self.porto_current)
+ if(!self.porto_forbidden)
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(porto, refire)))
{
W_Porto_Attack(0);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
}
- if (self.BUTTON_ATCK2)
- if (!self.porto_current)
- if (!self.porto_forbidden)
- if (weapon_prepareattack(1, WEP_CVAR_SEC(porto, refire)))
+ if(self.BUTTON_ATCK2)
+ if(!self.porto_current)
+ if(!self.porto_forbidden)
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(porto, refire)))
{
W_Porto_Attack(1);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(porto, animtime), w_ready);
if(self.porto_v_angle_held)
makevectors(self.porto_v_angle); // override the previously set angles
- if (self.BUTTON_ATCK)
- if (!self.porto_current)
- if (!self.porto_forbidden)
- if (weapon_prepareattack(0, WEP_CVAR_PRI(porto, refire)))
+ if(self.BUTTON_ATCK)
+ if(!self.porto_current)
+ if(!self.porto_forbidden)
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(porto, refire)))
{
W_Porto_Attack(-1);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_porto.md3");
- precache_model ("models/weapons/v_porto.md3");
- precache_model ("models/weapons/h_porto.iqm");
- precache_model ("models/portal.md3");
- precache_sound ("porto/bounce.wav");
- precache_sound ("porto/create.wav");
- precache_sound ("porto/expire.wav");
- precache_sound ("porto/explode.wav");
- precache_sound ("porto/fire.wav");
- precache_sound ("porto/unsupported.wav");
+ precache_model("models/weapons/g_porto.md3");
+ precache_model("models/weapons/v_porto.md3");
+ precache_model("models/weapons/h_porto.iqm");
+ precache_model("models/portal.md3");
+ precache_sound("porto/bounce.wav");
+ precache_sound("porto/create.wav");
+ precache_sound("porto/expire.wav");
+ precache_sound("porto/explode.wav");
+ precache_sound("porto/fire.wav");
+ precache_sound("porto/unsupported.wav");
PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_rifle (void) { weapon_defaultspawnfunc(WEP_RIFLE); }
-void spawnfunc_weapon_campingrifle (void) { spawnfunc_weapon_rifle(); }
-void spawnfunc_weapon_sniperrifle (void) { spawnfunc_weapon_rifle(); }
+void spawnfunc_weapon_rifle(void) { weapon_defaultspawnfunc(WEP_RIFLE); }
+void spawnfunc_weapon_campingrifle(void) { spawnfunc_weapon_rifle(); }
+void spawnfunc_weapon_sniperrifle(void) { spawnfunc_weapon_rifle(); }
void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, float deathtype, float pTracer, float pShots, string pSound)
{
W_DecreaseAmmo(pAmmo);
- W_SetupShot (self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots);
+ W_SetupShot(self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots);
pointparticles(particleeffectnum("rifle_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
for(i = 0; i < pShots; ++i)
fireBullet(w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
- if (autocvar_g_casings >= 2)
- 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, self);
+ if(autocvar_g_casings >= 2)
+ 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, self);
}
-void W_Rifle_Attack()
+void W_Rifle_Attack(void)
{
W_Rifle_FireBullet(WEP_CVAR_PRI(rifle, spread), WEP_CVAR_PRI(rifle, damage), WEP_CVAR_PRI(rifle, force), WEP_CVAR_PRI(rifle, solidpenetration), WEP_CVAR_PRI(rifle, ammo), WEP_RIFLE, WEP_CVAR_PRI(rifle, tracer), WEP_CVAR_PRI(rifle, shots), "weapons/campingrifle_fire.wav");
}
-void W_Rifle_Attack2()
+void W_Rifle_Attack2(void)
{
W_Rifle_FireBullet(WEP_CVAR_SEC(rifle, spread), WEP_CVAR_SEC(rifle, damage), WEP_CVAR_SEC(rifle, force), WEP_CVAR_SEC(rifle, solidpenetration), WEP_CVAR_SEC(rifle, ammo), WEP_RIFLE | HITTYPE_SECONDARY, WEP_CVAR_SEC(rifle, tracer), WEP_CVAR_SEC(rifle, shots), "weapons/campingrifle_fire2.wav");
}
.float rifle_bullethail_frame;
.float rifle_bullethail_animtime;
.float rifle_bullethail_refire;
-void W_Rifle_BulletHail_Continue()
+void W_Rifle_BulletHail_Continue(void)
{
float r, sw, af;
else
{
self.rifle_accumulator = bound(time - WEP_CVAR(rifle, bursttime), self.rifle_accumulator, time);
- if (self.BUTTON_ATCK)
- if (weapon_prepareattack_check(0, WEP_CVAR_PRI(rifle, refire)))
- if (time >= self.rifle_accumulator + WEP_CVAR_PRI(rifle, burstcost))
+ if(self.BUTTON_ATCK)
+ if(weapon_prepareattack_check(0, WEP_CVAR_PRI(rifle, refire)))
+ if(time >= self.rifle_accumulator + WEP_CVAR_PRI(rifle, burstcost))
{
weapon_prepareattack_do(0, WEP_CVAR_PRI(rifle, refire));
W_Rifle_BulletHail(WEP_CVAR_PRI(rifle, bullethail), W_Rifle_Attack, WFRAME_FIRE1, WEP_CVAR_PRI(rifle, animtime), WEP_CVAR_PRI(rifle, refire));
self.rifle_accumulator += WEP_CVAR_PRI(rifle, burstcost);
}
- if (self.BUTTON_ATCK2)
+ if(self.BUTTON_ATCK2)
{
- if (WEP_CVAR(rifle, secondary))
+ if(WEP_CVAR(rifle, secondary))
{
if(WEP_CVAR_SEC(rifle, reload))
WEP_ACTION(self.weapon, WR_RELOAD);
else
{
- if (weapon_prepareattack_check(1, WEP_CVAR_SEC(rifle, refire)))
- if (time >= self.rifle_accumulator + WEP_CVAR_SEC(rifle, burstcost))
+ if(weapon_prepareattack_check(1, WEP_CVAR_SEC(rifle, refire)))
+ if(time >= self.rifle_accumulator + WEP_CVAR_SEC(rifle, burstcost))
{
weapon_prepareattack_do(1, WEP_CVAR_SEC(rifle, refire));
W_Rifle_BulletHail(WEP_CVAR_SEC(rifle, bullethail), W_Rifle_Attack2, WFRAME_FIRE2, WEP_CVAR_SEC(rifle, animtime), WEP_CVAR_PRI(rifle, refire));
}
case WR_INIT:
{
- precache_model ("models/weapons/g_campingrifle.md3");
- precache_model ("models/weapons/v_campingrifle.md3");
- precache_model ("models/weapons/h_campingrifle.iqm");
- precache_sound ("weapons/campingrifle_fire.wav");
- precache_sound ("weapons/campingrifle_fire2.wav");
+ precache_model("models/weapons/g_campingrifle.md3");
+ precache_model("models/weapons/v_campingrifle.md3");
+ precache_model("models/weapons/h_campingrifle.iqm");
+ precache_sound("weapons/campingrifle_fire.wav");
+ precache_sound("weapons/campingrifle_fire2.wav");
RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_seeker (void) { weapon_defaultspawnfunc(WEP_SEEKER); }
+void spawnfunc_weapon_seeker(void) { weapon_defaultspawnfunc(WEP_SEEKER); }
// ============================
// Begin: Missile functions, these are general functions to be manipulated by other code
// ============================
-void W_Seeker_Missile_Explode()
+void W_Seeker_Missile_Explode(void)
{
self.event_damage = func_null;
- RadiusDamage (self, self.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
-void W_Seeker_Missile_Touch()
+void W_Seeker_Missile_Touch(void)
{
PROJECTILE_TOUCH;
W_Seeker_Missile_Explode();
}
-void W_Seeker_Missile_Think()
+void W_Seeker_Missile_Think(void)
{
entity e;
vector desireddir, olddir, newdir, eorg;
float dist;
float spd;
- if (time > self.cnt)
+ if(time > self.cnt)
{
self.projectiledeathtype |= HITTYPE_SPLASH;
W_Seeker_Missile_Explode();
spd + WEP_CVAR(seeker, missile_accel) * frametime
);
- if (self.enemy != world)
- if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+ if(self.enemy != world)
+ if(self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
self.enemy = world;
- if (self.enemy != world)
+ if(self.enemy != world)
{
e = self.enemy;
eorg = 0.5 * (e.absmin + e.absmax);
dist = vlen(eorg - self.origin);
// Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
- if (WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
+ if(WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
{
// Is it a better idea (shorter distance) to trace to the target itself?
- if ( vlen(self.origin + olddir * self.wait) < dist)
+ if( vlen(self.origin + olddir * self.wait) < dist)
traceline(self.origin, self.origin + olddir * self.wait, FALSE, self);
else
traceline(self.origin, eorg, FALSE, self);
dist = 0;
// Proxy
- if (WEP_CVAR(seeker, missile_proxy))
+ if(WEP_CVAR(seeker, missile_proxy))
{
- if ( dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
+ if(dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
{
- if (self.autoswitch == 0)
+ if(self.autoswitch == 0)
{
self.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
}
else
{
- if (self.autoswitch <= time)
+ if(self.autoswitch <= time)
{
W_Seeker_Missile_Explode();
self.autoswitch = 0;
}
else
{
- if (self.autoswitch != 0)
+ if(self.autoswitch != 0)
self.autoswitch = 0;
}
}
///////////////
- if (self.enemy.deadflag != DEAD_NO)
+ if(self.enemy.deadflag != DEAD_NO)
{
self.enemy = world;
self.cnt = time + 1 + (random() * 4);
void W_Seeker_Missile_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
- if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
+ if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
return; // g_projectiles_damage says to halt
- if (self.realowner == attacker)
+ if(self.realowner == attacker)
self.health = self.health - (damage * 0.25);
else
self.health = self.health - damage;
- if (self.health <= 0)
+ if(self.health <= 0)
W_PrepareExplosionByDamage(attacker, W_Seeker_Missile_Explode);
}
/*
-void W_Seeker_Missile_Animate()
+void W_Seeker_Missile_Animate(void)
{
self.frame = self.frame +1;
self.nextthink = time + 0.05;
- if (self.enemy != world)
- if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+ if(self.enemy != world)
+ if(self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
self.enemy = world;
if(self.frame == 5)
self.think = W_Seeker_Missile_Think;
self.nextthink = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
- if (autocvar_g_balance_seeker_missile_proxy)
+ if(autocvar_g_balance_seeker_missile_proxy)
self.movetype = MOVETYPE_BOUNCEMISSILE;
else
self.movetype = MOVETYPE_FLYMISSILE;
W_DecreaseAmmo(WEP_CVAR(seeker, missile_ammo));
makevectors(self.v_angle);
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
+ W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
w_shotorg += f_diff;
pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile.damagedbycontents = TRUE;
//missile.think = W_Seeker_Missile_Animate; // csqc projectiles.
- if (missile.enemy != world)
+ if(missile.enemy != world)
missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
else
missile.projectiledeathtype = WEP_SEEKER;
- setorigin (missile, w_shotorg);
- setsize (missile, '-4 -4 -4', '4 4 4');
+ setorigin(missile, w_shotorg);
+ setsize(missile, '-4 -4 -4', '4 4 4');
missile.movetype = MOVETYPE_FLYMISSILE;
missile.flags = FL_PROJECTILE;
missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
W_SetupProjVelocity_UP_PRE(missile, seeker, missile_);
- missile.angles = vectoangles (missile.velocity);
+ missile.angles = vectoangles(missile.velocity);
CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
// ============================
// Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
// ============================
-void W_Seeker_Flac_Explode()
+void W_Seeker_Flac_Explode(void)
{
self.event_damage = func_null;
- RadiusDamage (self, self.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), self.projectiledeathtype, other);
+ RadiusDamage(self, self.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), self.projectiledeathtype, other);
- remove (self);
+ remove(self);
}
-void W_Seeker_Flac_Touch()
+void W_Seeker_Flac_Touch(void)
{
PROJECTILE_TOUCH;
W_Seeker_Flac_Explode();
}
-void W_Seeker_Fire_Flac()
+void W_Seeker_Fire_Flac(void)
{
entity missile;
vector f_diff;
f_diff = '+1.25 +3.75 0';
break;
}
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
+ W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
w_shotorg += f_diff;
pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
- missile = spawn ();
+ missile = spawn();
missile.owner = missile.realowner = self;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.missile_flags = MIF_SPLASH;
// csqc projectiles
- //missile.angles = vectoangles (missile.velocity);
+ //missile.angles = vectoangles(missile.velocity);
//missile.scale = 0.4; // BUG: the model is too big
- setorigin (missile, w_shotorg);
- setsize (missile, '-2 -2 -2', '2 2 2');
+ setorigin(missile, w_shotorg);
+ setsize(missile, '-2 -2 -2', '2 2 2');
W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
{
entity tag;
for(tag = world; (tag = find(tag, classname, "tag_tracker")); )
- if ((tag.realowner == isowner) && (tag.tag_target == istarget))
+ if((tag.realowner == isowner) && (tag.tag_target == istarget))
return tag;
return world;
}
-void W_Seeker_Attack()
+void W_Seeker_Attack(void)
{
entity tracker, closest_target;
closest_target = world;
for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
{
- if (closest_target)
+ if(closest_target)
{
- if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
+ if(vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
closest_target = tracker.tag_target;
}
else
}
traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self);
- if ((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
+ if((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
closest_target = world;
W_Seeker_Fire_Missile('0 0 0', closest_target);
}
-void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
+void W_Seeker_Vollycontroller_Think(void) // TODO: Merge this with W_Seeker_Attack
{
float c;
entity oldself,oldenemy;
self = oldself;
}
-void W_Seeker_Tracker_Think()
+void W_Seeker_Tracker_Think(void)
{
// commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
- if ((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)
+ if((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)
|| (time > self.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
{
- if (self)
+ if(self)
{
WaypointSprite_Kill(self.tag_target.wps_tag_tracker);
remove(self);
// ============================
// Begin: Tag projectile
// ============================
-void W_Seeker_Tag_Explode()
+void W_Seeker_Tag_Explode(void)
{
//if(other==self.realowner)
// return;
Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE, other.species, self);
- remove (self);
+ remove(self);
}
void W_Seeker_Tag_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if (self.health <= 0)
+ if(self.health <= 0)
return;
self.health = self.health - damage;
- if (self.health <= 0)
+ if(self.health <= 0)
W_Seeker_Tag_Explode();
}
-void W_Seeker_Tag_Touch()
+void W_Seeker_Tag_Touch(void)
{
vector dir;
vector org2;
PROJECTILE_TOUCH;
- dir = normalize (self.realowner.origin - self.origin);
- org2 = findbetterlocation (self.origin, 8);
+ dir = normalize(self.realowner.origin - self.origin);
+ org2 = findbetterlocation(self.origin, 8);
te_knightspike(org2);
self.event_damage = func_null;
Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE | HITTYPE_SECONDARY, other.species, self);
- if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
+ if(other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
{
// check to see if this person is already tagged by me
entity tag = W_Seeker_Tagged_Info(self.realowner, other);
- if (tag != world)
+ if(tag != world)
{
- if (other.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first
+ if(other.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first
WaypointSprite_Kill(other.wps_tag_tracker);
tag.tag_time = time;
return;
}
-void W_Seeker_Fire_Tag()
+void W_Seeker_Fire_Tag(void)
{
entity missile;
W_DecreaseAmmo(WEP_CVAR(seeker, tag_ammo));
- W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
+ W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
missile = spawn();
missile.owner = missile.realowner = self;
missile.health = WEP_CVAR(seeker, tag_health);
missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
- setorigin (missile, w_shotorg);
- setsize (missile, '-2 -2 -2', '2 2 2');
+ setorigin(missile, w_shotorg);
+ setsize(missile, '-2 -2 -2', '2 2 2');
missile.flags = FL_PROJECTILE;
//missile.missile_flags = MIF_..?;
missile.movetype = MOVETYPE_FLY;
W_SetupProjVelocity_PRE(missile, seeker, tag_);
- missile.angles = vectoangles (missile.velocity);
+ missile.angles = vectoangles(missile.velocity);
CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
{
case WR_AIM:
{
- if (WEP_CVAR(seeker, type) == 1)
- if (W_Seeker_Tagged_Info(self, self.enemy) != world)
+ if(WEP_CVAR(seeker, type) == 1)
+ if(W_Seeker_Tagged_Info(self, self.enemy) != world)
self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), FALSE);
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), FALSE);
if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
- else if (self.BUTTON_ATCK)
+ else if(self.BUTTON_ATCK)
{
- if (WEP_CVAR(seeker, type) == 1)
+ if(WEP_CVAR(seeker, type) == 1)
{
- if (weapon_prepareattack(0, WEP_CVAR(seeker, missile_refire)))
+ if(weapon_prepareattack(0, WEP_CVAR(seeker, missile_refire)))
{
W_Seeker_Attack();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, missile_animtime), w_ready);
}
else
{
- if (weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
+ if(weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
{
W_Seeker_Fire_Tag();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
}
}
- else if (self.BUTTON_ATCK2)
+ else if(self.BUTTON_ATCK2)
{
- if (WEP_CVAR(seeker, type) == 1)
+ if(WEP_CVAR(seeker, type) == 1)
{
- if (weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
+ if(weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
{
W_Seeker_Fire_Tag();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
}
else
{
- if (weapon_prepareattack(0, WEP_CVAR(seeker, flac_refire)))
+ if(weapon_prepareattack(0, WEP_CVAR(seeker, flac_refire)))
{
W_Seeker_Fire_Flac();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, flac_animtime), w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_seeker.md3");
- precache_model ("models/weapons/v_seeker.md3");
- precache_model ("models/weapons/h_seeker.iqm");
- precache_sound ("weapons/tag_fire.wav");
- precache_sound ("weapons/flac_fire.wav");
- precache_sound ("weapons/seeker_fire.wav");
+ precache_model("models/weapons/g_seeker.md3");
+ precache_model("models/weapons/v_seeker.md3");
+ precache_model("models/weapons/h_seeker.iqm");
+ precache_sound("weapons/tag_fire.wav");
+ precache_sound("weapons/flac_fire.wav");
+ precache_sound("weapons/seeker_fire.wav");
SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
case WR_CHECKAMMO1:
{
- if (WEP_CVAR(seeker, type) == 1)
+ if(WEP_CVAR(seeker, type) == 1)
{
ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, missile_ammo);
ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, missile_ammo);
}
case WR_CHECKAMMO2:
{
- if (WEP_CVAR(seeker, type) == 1)
+ if(WEP_CVAR(seeker, type) == 1)
{
ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo);
ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
if(!w_issilent)
{
- if (w_random<0.15)
+ if(w_random<0.15)
sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
- else if (w_random<0.7)
+ else if(w_random<0.7)
sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTEN_NORM);
else
sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTEN_NORM);
pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
if(!w_issilent)
{
- if (w_random<0.15)
+ if(w_random<0.15)
sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTEN_NORM);
- else if (w_random<0.7)
+ else if(w_random<0.7)
sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTEN_NORM);
else
sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTEN_NORM);
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_shockwave()
+void spawnfunc_weapon_shockwave(void)
{
//if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
if(autocvar_sv_q3acompat_machineshotgunswap)
vector shockwave_hit_force[MAX_SHOCKWAVE_HITS];
// MELEE ATTACK MODE
-void W_Shockwave_Melee_Think()
+void W_Shockwave_Melee_Think(void)
{
// declarations
float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
}
}
-void W_Shockwave_Melee()
+void W_Shockwave_Melee(void)
{
sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
return TRUE;
}
-void W_Shockwave_Attack()
+void W_Shockwave_Attack(void)
{
// declarations
float multiplier, multiplier_from_accuracy, multiplier_from_distance;
#ifdef SVQC
void spawnfunc_weapon_shotgun(void) { weapon_defaultspawnfunc(WEP_SHOTGUN); }
-void W_Shotgun_Attack (void)
+void W_Shotgun_Attack(void)
{
float sc;
entity flash;
W_DecreaseAmmo(WEP_CVAR_PRI(shotgun, ammo));
- W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
- for (sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
+ W_SetupShot(self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
+ for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN, 0);
pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
// casing code
- if (autocvar_g_casings >= 1)
- for (sc = 0;sc < WEP_CVAR_PRI(shotgun, ammo);sc = sc + 1)
- SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
+ if(autocvar_g_casings >= 1)
+ for(sc = 0;sc < WEP_CVAR_PRI(shotgun, ammo);sc = sc + 1)
+ SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
// muzzle flash for 1st person view
flash = spawn();
.float swing_prev;
.entity swing_alreadyhit;
-void W_Shotgun_Melee_Think()
+void W_Shotgun_Melee_Think(void)
{
// declarations
float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
}
}
-void W_Shotgun_Attack2 (void)
+void W_Shotgun_Attack2(void)
{
- sound (self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTEN_NORM);
+ sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTEN_NORM);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
entity meleetemp;
if(WEP_CVAR(shotgun, reload_ammo) && self.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload
{
// don't force reload an empty shotgun if its melee attack is active
- if (!WEP_CVAR(shotgun, secondary))
+ if(!WEP_CVAR(shotgun, secondary))
WEP_ACTION(self.weapon, WR_RELOAD);
}
else
{
- if (self.BUTTON_ATCK)
+ if(self.BUTTON_ATCK)
{
- if (time >= self.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
+ if(time >= self.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
{
if(weapon_prepareattack(0, WEP_CVAR_PRI(shotgun, animtime)))
{
}
}
}
- if (self.clip_load >= 0) // we are not currently reloading
- if (!self.crouch) // no crouchmelee please
- if (self.BUTTON_ATCK2 && WEP_CVAR(shotgun, secondary))
- if (weapon_prepareattack(1, WEP_CVAR_SEC(shotgun, refire)))
+ if(self.clip_load >= 0) // we are not currently reloading
+ if(!self.crouch) // no crouchmelee please
+ if(self.BUTTON_ATCK2 && WEP_CVAR(shotgun, secondary))
+ if(weapon_prepareattack(1, WEP_CVAR_SEC(shotgun, refire)))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
}
case WR_INIT:
{
- precache_model ("models/uziflash.md3");
- precache_model ("models/weapons/g_shotgun.md3");
- precache_model ("models/weapons/v_shotgun.md3");
- precache_model ("models/weapons/h_shotgun.iqm");
- precache_sound ("misc/itempickup.wav");
- precache_sound ("weapons/shotgun_fire.wav");
- precache_sound ("weapons/shotgun_melee.wav");
+ precache_model("models/uziflash.md3");
+ precache_model("models/weapons/g_shotgun.md3");
+ precache_model("models/weapons/v_shotgun.md3");
+ precache_model("models/weapons/h_shotgun.iqm");
+ precache_sound("misc/itempickup.wav");
+ precache_sound("weapons/shotgun_fire.wav");
+ precache_sound("weapons/shotgun_melee.wav");
SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_tuba (void) { weapon_defaultspawnfunc(WEP_TUBA); }
+void spawnfunc_weapon_tuba(void) { weapon_defaultspawnfunc(WEP_TUBA); }
float W_Tuba_HasPlayed(entity pl, string melody, float instrument, float ignorepitch, float mintempo, float maxtempo)
{
return TRUE;
}
-void W_Tuba_NoteOff()
+void W_Tuba_NoteOff(void)
{
// we have a note:
// on: self.spawnshieldtime
return TRUE;
}
-void W_Tuba_NoteThink()
+void W_Tuba_NoteThink(void)
{
float dist_mult;
float vol0, vol1;
}
}
- if (!self.tuba_note)
+ if(!self.tuba_note)
{
self.tuba_note = spawn();
self.tuba_note.owner = self.tuba_note.realowner = self;
}
case WR_THINK:
{
- if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, WEP_CVAR(tuba, refire)))
+ if(self.BUTTON_ATCK)
+ if(weapon_prepareattack(0, WEP_CVAR(tuba, refire)))
{
W_Tuba_NoteOn(0);
//weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready);
weapon_thinkf(WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready);
}
- if (self.BUTTON_ATCK2)
- if (weapon_prepareattack(1, WEP_CVAR(tuba, refire)))
+ if(self.BUTTON_ATCK2)
+ if(weapon_prepareattack(1, WEP_CVAR(tuba, refire)))
{
W_Tuba_NoteOn(HITTYPE_SECONDARY);
//weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready);
}
case WR_INIT:
{
- precache_model ("models/weapons/g_tuba.md3");
- precache_model ("models/weapons/v_tuba.md3");
- precache_model ("models/weapons/h_tuba.iqm");
- precache_model ("models/weapons/v_akordeon.md3");
- precache_model ("models/weapons/h_akordeon.iqm");
- precache_model ("models/weapons/v_kleinbottle.md3");
- precache_model ("models/weapons/h_kleinbottle.iqm");
+ precache_model("models/weapons/g_tuba.md3");
+ precache_model("models/weapons/v_tuba.md3");
+ precache_model("models/weapons/h_tuba.iqm");
+ precache_model("models/weapons/v_akordeon.md3");
+ precache_model("models/weapons/h_akordeon.iqm");
+ precache_model("models/weapons/v_kleinbottle.md3");
+ precache_model("models/weapons/h_kleinbottle.iqm");
TUBA_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
return TRUE;
}
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_vaporizer (void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
-void spawnfunc_weapon_minstanex () { spawnfunc_weapon_vaporizer(); }
+void spawnfunc_weapon_vaporizer(void) { weapon_defaultspawnfunc(WEP_VAPORIZER); }
+void spawnfunc_weapon_minstanex(void) { spawnfunc_weapon_vaporizer(); }
-void W_Vaporizer_Attack (void)
+void W_Vaporizer_Attack(void)
{
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- W_SetupShot (self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
+ W_SetupShot(self, TRUE, 0, "weapons/minstanexfire.wav", CH_WEAPON_A, 10000);
yoda = 0;
damage_goodhits = 0;
- FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
+ FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_VAPORIZER);
if(yoda && flying)
Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
WEP_ACTION(self.weapon, WR_RELOAD);
else if(WEP_CVAR(vaporizer, reload_ammo) && self.clip_load < vaporizer_ammo) // forced reload
WEP_ACTION(self.weapon, WR_RELOAD);
- else if (self.BUTTON_ATCK)
+ else if(self.BUTTON_ATCK)
{
- if (weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire)))
+ if(weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire)))
{
W_Vaporizer_Attack();
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
}
}
- else if (self.BUTTON_ATCK2)
+ else if(self.BUTTON_ATCK2)
{
- if (self.jump_interval <= time)
- if (weapon_prepareattack(1, -1))
+ if(self.jump_interval <= time)
+ if(weapon_prepareattack(1, -1))
{
// handle refire manually, so that primary and secondary can be fired without conflictions (important for minstagib)
self.jump_interval = time + WEP_CVAR_SEC(vaporizer, refire) * W_WeaponRateFactor();
#endif
#else
#ifdef SVQC
-void spawnfunc_weapon_vortex() { weapon_defaultspawnfunc(WEP_VORTEX); }
-void spawnfunc_weapon_nex() { spawnfunc_weapon_vortex(); }
+void spawnfunc_weapon_vortex(void) { weapon_defaultspawnfunc(WEP_VORTEX); }
+void spawnfunc_weapon_nex(void) { spawnfunc_weapon_vortex(); }
void SendCSQCVortexBeamParticle(float charge) {
vector v;