if(eff & EF_FULLBRIGHT)
self.renderflags |= RF_FULLBRIGHT;
if(eff & EF_FLAME)
- pointparticles(particleeffectnum(EFFECT_EF_FLAME), self.origin, '0 0 0', bound(0, frametime, 0.1));
+ pointparticles(EFFECT_EF_FLAME, self.origin, '0 0 0', bound(0, frametime, 0.1));
if(eff & EF_STARDUST)
- pointparticles(particleeffectnum(EFFECT_EF_STARDUST), self.origin, '0 0 0', bound(0, frametime, 0.1));
+ pointparticles(EFFECT_EF_STARDUST, self.origin, '0 0 0', bound(0, frametime, 0.1));
if(eff & EF_NOSHADOW)
self.renderflags |= RF_NOSHADOW;
if(eff & EF_NODEPTHTEST)
// now generate the particles
vector org;
org = gettaginfo(self, 0); // origin at attached location
- pointparticles(self.team, org, '0 0 0', 1);
+ __pointparticles(self.team, org, '0 0 0', 1);
}
void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
// spiderbot
case DEATH_VH_SPID_MINIGUN:
sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_SPIDERBOT_MINIGUN_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_SPID_ROCKET:
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_SPIDERBOT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_SPIDERBOT_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_SPID_DEATH:
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_GUN:
sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_RACER_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_RACER_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_ROCKET:
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_RACER_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_RACER_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_WAKI_DEATH:
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_CANNON:
sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_RAPTOR_CANNON_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_RAPTOR_CANNON_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_FRAGMENT:
float i;
RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i));
}
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_SPREAD), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_RAPTOR_BOMB_SPREAD, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_BOMB:
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_RAPTOR_BOMB_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_RAPT_DEATH:
sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1);
break;
case DEATH_VH_BUMB_GUN:
sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_BIGPLASMA_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_BIGPLASMA_IMPACT, self.origin, w_backoff * 1000, 1);
break;
}
}
{
case DEATH_TURRET_EWHEEL:
sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_BLASTER_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_FLAC:
- pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), w_org, '0 0 0', 1);
+ pointparticles(EFFECT_HAGAR_EXPLODE, w_org, '0 0 0', 1);
sound(self, CH_SHOTS, SND_HAGEXP_RANDOM(), VOL_BASE, ATTEN_NORM);
break;
case DEATH_TURRET_WALK_ROCKET:
case DEATH_TURRET_HELLION:
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_MACHINEGUN:
case DEATH_TURRET_WALK_GUN:
sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_MACHINEGUN_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_PLASMA:
sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_ELECTRO_IMPACT, self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_WALK_MELEE:
sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_MIN);
- pointparticles(particleeffectnum(EFFECT_TE_SPARK), self.origin, w_backoff * 1000, 1);
+ pointparticles(EFFECT_TE_SPARK, self.origin, w_backoff * 1000, 1);
break;
case DEATH_TURRET_PHASER:
if(random() < 0.9 - self.health / self.max_health)
if(random() < 0.01)
{
- pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
+ pointparticles(EFFECT_ELECTRO_BALLEXPLODE, self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
sound(self, CH_TRIGGER, SND_ONS_ELECTRICITY_EXPLODE, VOL_BASE, ATTEN_NORM);
}
else
- pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_DAMAGED), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
+ pointparticles(EFFECT_ONS_GENERATOR_DAMAGED, self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
self.move_time = time + 0.1;
if(self.count==40||self.count==20)
{
sound(self, CH_TRIGGER, SND_ONS_SHOCKWAVE, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), self.origin, '0 0 0', 6);
+ pointparticles(EFFECT_ELECTRO_COMBO, self.origin, '0 0 0', 6);
}
// rays
for(i=0;i < 10;++i)
{
org = self.origin + randompos('-30 -30 -30' * i + '0 0 -20', '30 30 30' * i + '0 0 20');
- pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_GIB), org, '0 0 0', 1);
+ pointparticles(EFFECT_ONS_GENERATOR_GIB, org, '0 0 0', 1);
}
// Short explosion sound + small explosion
// Particles
org = self.origin + randompos(self.mins + '8 8 8', self.maxs + '-8 -8 -8');
- pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE), org, '0 0 0', 1);
+ pointparticles(EFFECT_ONS_GENERATOR_EXPLODE, org, '0 0 0', 1);
// Final explosion
if(self.count==1)
{
org = self.origin;
te_explosion(org);
- pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE2), org, '0 0 0', 1);
+ pointparticles(EFFECT_ONS_GENERATOR_EXPLODE2, org, '0 0 0', 1);
sound(self, CH_TRIGGER, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
}
float i, pmod;
pmod = autocvar_cl_particles_quality;
for (i = 0; i < 50 * pmod; ++i)
- pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
+ __pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
}
void SUB_RemoveOnNoImpact()
if(!self.silent)
sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
- pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
+ __pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
Gib_Delete();
}
if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie...
// TODO somehow make it spray in a direction dependent on self.angles
- trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
+ __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
else
- trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
+ __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
self.renderflags = 0;
}
break;
case 0x02:
- pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
+ __pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
break;
case 0x03:
if(prandom() < amount)
TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization?
break;
case 0x81:
- pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
+ __pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
break;
case 0x82:
- pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
+ __pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
break;
case 0x83:
// no gibs in gentle mode, sorry
case ENT_CLIENT_HOOK:
break;
case ENT_CLIENT_ARC_BEAM:
- pointparticles(particleeffectnum(EFFECT_ARC_LIGHTNING2), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
+ pointparticles(EFFECT_ARC_LIGHTNING2, trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
break;
}
}
void Spawn_Draw(entity this)
{
- pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1));
+ __pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1));
}
void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint
{
switch(teamnum)
{
- case NUM_TEAM_1: pointparticles(particleeffectnum(EFFECT_SPAWN_RED), self.origin, '0 0 0', 1); break;
- case NUM_TEAM_2: pointparticles(particleeffectnum(EFFECT_SPAWN_BLUE), self.origin, '0 0 0', 1); break;
- case NUM_TEAM_3: pointparticles(particleeffectnum(EFFECT_SPAWN_YELLOW), self.origin, '0 0 0', 1); break;
- case NUM_TEAM_4: pointparticles(particleeffectnum(EFFECT_SPAWN_PINK), self.origin, '0 0 0', 1); break;
- default: pointparticles(particleeffectnum(EFFECT_SPAWN_NEUTRAL), self.origin, '0 0 0', 1); break;
+ case NUM_TEAM_1: pointparticles(EFFECT_SPAWN_RED, self.origin, '0 0 0', 1); break;
+ case NUM_TEAM_2: pointparticles(EFFECT_SPAWN_BLUE, self.origin, '0 0 0', 1); break;
+ case NUM_TEAM_3: pointparticles(EFFECT_SPAWN_YELLOW, self.origin, '0 0 0', 1); break;
+ case NUM_TEAM_4: pointparticles(EFFECT_SPAWN_PINK, self.origin, '0 0 0', 1); break;
+ default: pointparticles(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1); break;
}
}
if(autocvar_cl_spawn_event_sound)
endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord();
charge = ReadByte() / 255.0;
- pointparticles(particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH), shotorg, normalize(endpos - shotorg) * 1000, 1);
+ pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
//draw either the old v2.3 beam or the new beam
charge = sqrt(charge); // divide evenly among trail spacing and alpha
if(eff_trail)
WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
else
- pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
+ pointparticles(eff, v, vel, eff_cnt);
}
}
#endif
return;
));
// revert to engine handling
- pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
+ __pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
}
#endif
#ifndef EFFECT_H
#define EFFECT_H
-#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
+#define particleeffectnum(e) \
+ _particleeffectnum(e.eent_eff_name)
+
+#if defined(SVQC)
+ #define pointparticles(effect, org, vel, howmany) \
+ Send_Effect(effect, org, vel, howmany)
+ #define trailparticles(e, effect, org, vel) \
+ ((!e) ? Send_Effect(effect, org, vel, 0) \
+ : __trailparticles(e, particleeffectnum(effect), org, vel))
+#elif defined(CSQC)
+ #define pointparticles(effect, org, vel, howmany) \
+ __pointparticles(particleeffectnum(effect), org, vel, howmany)
+ #define trailparticles(e, effect, org, vel) \
+ __trailparticles(e, particleeffectnum(effect), org, vel)
+#endif
.int m_id;
.string eent_eff_name;
RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, world, self.dmg_force, DEATH_HURTTRIGGER.m_id, world);
if(self.cnt) // TODO
- pointparticles(self.cnt, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count);
+ __pointparticles(self.cnt, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count);
if(self.respawntime)
{
{
traceline(p, p + normalize(self.movedir) * 4096, 0, world);
p = trace_endpos;
- pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count);
+ __pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count);
}
else
{
- pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count);
+ __pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count);
}
if(self.noise != "")
{
if (!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
{
if(self.cnt >= 0)
- pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000);
+ __pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000);
if(self.colormod != '0 0 0' && self.modelscale != 0)
adddynamiclight(trace_endpos + trace_plane_normal * 1, self.modelscale, self.colormod * 5);
}
if(self.health < 85)
if(dt < 0.01)
- pointparticles(particleeffectnum(EFFECT_SMOKE_LARGE), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+ pointparticles(EFFECT_SMOKE_LARGE, (self.origin + (randomvec() * 80)), '0 0 0', 1);
if(self.health < 32)
if(dt < 0.015)
- pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+ pointparticles(EFFECT_SMOKE_SMALL, (self.origin + (randomvec() * 80)), '0 0 0', 1);
}
float i;
sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
for (i = 1; i < 5; i = i + 1)
turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin + '0 0 2', self.velocity + randomvec() * 700, '0 0 0', false);
void turret_die()
{SELFPARAM();
sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
if (!autocvar_cl_nogibs)
{
// Base
float _ftmp;
_ftmp = self.owner.vehicle_health / 50;
self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
- pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+ pointparticles(EFFECT_SMOKE_SMALL, (self.origin + (randomvec() * 80)), '0 0 0', 1);
if(self.vehicle_flags & VHF_DMGSHAKE)
self.velocity += randomvec() * 30;
{
#ifdef SVQC
if(time - racer.wait > 0.2)
- pointparticles(particleeffectnum(EFFECT_RACER_BOOSTER), self.origin - v_forward * 32, v_forward * vlen(self.velocity), 1);
+ pointparticles(EFFECT_RACER_BOOSTER, self.origin - v_forward * 32, v_forward * vlen(self.velocity), 1);
#endif
racer.wait = time;
{
traceline(racer.origin, racer.origin - '0 0 256', MOVE_NORMAL, self);
if(trace_fraction != 1.0)
- pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), trace_endpos, '0 0 0', 1);
+ pointparticles(EFFECT_SMOKE_SMALL, trace_endpos, '0 0 0', 1);
racer.invincible_finished = time + 0.1 + (random() * 0.1);
}
sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
//trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
- pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH), v, v_forward * 2500, 1);
+ pointparticles(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH, v, v_forward * 2500, 1);
setself(spider);
.vector beam_color;
.float beam_alpha;
.float beam_thickness;
-.float beam_traileffect;
-.float beam_hiteffect;
+.entity beam_traileffect;
+.entity beam_hiteffect;
.float beam_hitlight[4]; // 0: radius, 123: rgb
-.float beam_muzzleeffect;
+.entity beam_muzzleeffect;
.float beam_muzzlelight[4]; // 0: radius, 123: rgb
.string beam_image;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 8;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING);
+ self.beam_traileffect = (EFFECT_ARC_BEAM);
+ self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 8;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING);
+ self.beam_traileffect = (EFFECT_ARC_BEAM);
+ self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; // particleeffectnum(EFFECT_GRENADE_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 8;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL_IMPACT);
+ self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
+ self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 8;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING);
+ self.beam_traileffect = (EFFECT_ARC_BEAM);
+ self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
self.beam_hitlight[0] = 20;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 0;
self.beam_hitlight[3] = 0;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 50;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 0;
self.beam_muzzlelight[3] = 0;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 14;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING);
+ self.beam_traileffect = (EFFECT_ARC_BEAM);
+ self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 14;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING);
+ self.beam_traileffect = (EFFECT_ARC_BEAM);
+ self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 14;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL_IMPACT2);
+ self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL);
+ self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = '1 1 1';
self.beam_alpha = 0.5;
self.beam_thickness = 14;
- self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM);
- self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING);
+ self.beam_traileffect = (EFFECT_ARC_BEAM);
+ self.beam_hiteffect = (EFFECT_ARC_LIGHTNING);
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
self.beam_color = randomvec();
self.beam_alpha = 1;
self.beam_thickness = 8;
- self.beam_traileffect = false;
- self.beam_hiteffect = false;
+ self.beam_traileffect = NULL;
+ self.beam_hiteffect = NULL;
self.beam_hitlight[0] = 0;
self.beam_hitlight[1] = 1;
self.beam_hitlight[2] = 1;
self.beam_hitlight[3] = 1;
- self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH);
+ self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH);
self.beam_muzzlelight[0] = 0;
self.beam_muzzlelight[1] = 1;
self.beam_muzzlelight[2] = 1;
self.beam_muzzlelight[3] = 1;
self.beam_image = "particles/lgbeam";
- if(self.beam_muzzleeffect >= 0)
+ if(self.beam_muzzleeffect)
{
setmodel(flash, MDL_ARC_MUZZLEFLASH);
flash.alpha = self.beam_alpha;
{
vector org2;
org2 = w_org + w_backoff * 6;
- pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
}
org2 = w_org + w_backoff * 2;
if(w_deathtype & HITTYPE_SECONDARY)
{
- pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT2), org2, '0 0 0', 1);
+ pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_CRYLINK_IMPACT2, VOL_BASE, ATTN_NORM);
}
else
{
- pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT), org2, '0 0 0', 1);
+ pointparticles(EFFECT_CRYLINK_IMPACT, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM);
}
{
vector org2;
org2 = w_org + w_backoff * 12;
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
}
org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_SECONDARY)
{
- pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
}
if(w_deathtype & HITTYPE_BOUNCE)
{
// this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
- pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), org2, '0 0 0', 1);
+ pointparticles(EFFECT_ELECTRO_COMBO, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM);
}
else
{
- pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), org2, '0 0 0', 1);
+ pointparticles(EFFECT_ELECTRO_IMPACT, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
}
else
{
org2 = w_org + w_backoff * 16;
- pointparticles(particleeffectnum(EFFECT_FIREBALL_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
}
{
vector org2;
org2 = w_org + w_backoff * 6;
- pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
{
if(w_random<0.15)
{
vector org2;
org2 = w_org + w_backoff * 6;
- pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM);
}
{
vector org2;
org2 = w_org + w_backoff * 2;
- pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
if(w_random < 0.05)
sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM);
{
vector org2;
org2 = w_org + w_backoff * 2;
- pointparticles(particleeffectnum(EFFECT_HOOK_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
}
{
vector org2;
org2 = w_org + w_backoff * 2;
- pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
if(w_random < 0.05)
sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTN_NORM);
{
vector org2;
org2 = w_org + w_backoff * 12;
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
}
{
vector org2;
org2 = w_org + w_backoff * 12;
- pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
}
{
vector org2;
org2 = w_org + w_backoff * 2;
- pointparticles(particleeffectnum(EFFECT_RIFLE_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
{
if(w_random < 0.2)
{
vector org2;
org2 = w_org + w_backoff * 12;
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
}
}
else
{
- pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
{
if(w_random<0.15)
}
else
{
- pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1);
+ pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
if(!w_issilent)
{
if(w_random<0.15)
// handled by Net_ReadShockwaveParticle
//vector org2;
//org2 = w_org + w_backoff * 2;
- //pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
+ //pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
}
#endif
METHOD(Shotgun, wr_impacteffect, void(entity thiswep))
{
vector org2 = w_org + w_backoff * 2;
- pointparticles(particleeffectnum(EFFECT_SHOTGUN_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent && time - self.prevric > 0.25)
{
if(w_random < 0.0165)
vector org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_SECONDARY)
{
- pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1);
+ pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
}
else
{
- pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1);
+ pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); }
}
}
METHOD(Vortex, wr_impacteffect, void(entity thiswep))
{
vector org2 = w_org + w_backoff * 6;
- pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1);
+ pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
if(!w_issilent)
sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);
}
#define spawn _spawn
#define particleeffectnum _particleeffectnum
+#define trailparticles __trailparticles
+#define pointparticles __pointparticles
#define setmodel _setmodel
#include "upstream/csprogsdefs.qc"
#undef spawn
#undef particleeffectnum
+#undef trailparticles
+#undef pointparticles
#undef setmodel
#pragma noref 0
#pragma noref 1
#define particleeffectnum __particleeffectnum
+#define trailparticles __trailparticles
+#define pointparticles __pointparticles
#include "upstream/dpextensions.qc"
#undef particleeffectnum
+#undef trailparticles
+#undef pointparticles
int(entity ent, string tagname) _gettagindex = #451;
#define gettagindex _gettagindex
float WarpZone_TrailParticles_trace_callback_eff;
void WarpZone_TrailParticles_trace_callback(vector from, vector endpos, vector to)
{
- trailparticles(WarpZone_TrailParticles_trace_callback_own, WarpZone_TrailParticles_trace_callback_eff, from, endpos);
+ __trailparticles(WarpZone_TrailParticles_trace_callback_own, WarpZone_TrailParticles_trace_callback_eff, from, endpos);
}
void WarpZone_TrailParticles(entity own, float eff, vector org, vector end)
effectnum = _particleeffectnum(argv(1));
W_SetupShot(self, false, false, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
- trailparticles(self, effectnum, w_shotorg, trace_endpos);
+ __trailparticles(self, effectnum, w_shotorg, trace_endpos);
DID_CHEAT();
break;
}
vv = stov(argv(2));
dv = stov(argv(3));
traceline(vv, dv, MOVE_NORMAL, world);
- trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos);
- trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv);
+ __trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos);
+ __trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv);
return;
}
}
WaypointSprite_UpdateBuildFinished(self.owner.sprite, time + (self.max_health - self.health) / (self.count / ONS_CP_THINKRATE));
self.pain_finished = time + 1;
// particles on every hit
- pointparticles(particleeffectnum(EFFECT_SPARKS), hitloc, force*-1, 1);
+ pointparticles(EFFECT_SPARKS, hitloc, force*-1, 1);
//sound on every hit
if (random() < 0.5)
sound(self, CH_TRIGGER, SND_ONS_HIT1, VOL_BASE+0.3, ATTEN_NORM);
if (self.health < 0)
{
sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1);
+ pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(self.team, INFO_ONSLAUGHT_CPDESTROYED_), self.owner.message, attacker.netname);
PlayerScore_Add(attacker, SP_ONS_TAKES, 1);
float total_damage = 0;
if(tracereffects & EF_RED)
- fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE);
+ fireBullet_trace_callback_eff = EFFECT_RIFLE;
else if(tracereffects & EF_BLUE)
- fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE_WEAK);
+ fireBullet_trace_callback_eff = EFFECT_RIFLE_WEAK;
else
- fireBullet_trace_callback_eff = particleeffectnum(EFFECT_BULLET);
+ fireBullet_trace_callback_eff = EFFECT_BULLET;
float lag = ANTILAG_LATENCY(self);
if(lag < 0.001)
.vector railgunforce;
void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype);
-float fireBullet_trace_callback_eff;
+entity fireBullet_trace_callback_eff;
entity fireBullet_last_hit;
void fireBullet_trace_callback(vector start, vector hit, vector end);
void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);