From 75d8c631b71daf6ad2019d8139771f00ad426d33 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 29 Aug 2015 22:00:35 +1000 Subject: [PATCH] De-stringify particle effects --- qcsrc/client/command/cl_cmd.qc | 2 +- qcsrc/client/csqcmodel_hooks.qc | 21 +- qcsrc/client/damage.qc | 37 +-- qcsrc/client/generator.qc | 12 +- qcsrc/client/gibs.qc | 14 +- qcsrc/client/hook.qc | 2 +- qcsrc/client/main.qc | 23 +- qcsrc/client/particles.qc | 6 +- qcsrc/client/weapons/projectile.qc | 76 ++--- qcsrc/common/effects.inc | 274 ++++++++++++------ qcsrc/common/effects.qc | 59 ++-- qcsrc/common/effects.qh | 47 +-- qcsrc/common/monsters/monster/mage.qc | 14 +- qcsrc/common/monsters/monster/shambler.qc | 4 +- qcsrc/common/monsters/monster/spider.qc | 2 +- qcsrc/common/monsters/monster/wyvern.qc | 2 +- qcsrc/common/monsters/sv_monsters.qc | 4 +- qcsrc/common/triggers/func/breakable.qc | 2 +- qcsrc/common/triggers/func/pointparticles.qc | 2 +- qcsrc/common/triggers/misc/laser.qc | 6 +- qcsrc/common/triggers/teleporters.qc | 4 +- qcsrc/common/triggers/trigger/jumppads.qc | 2 +- qcsrc/common/turrets/cl_turrets.qc | 8 +- qcsrc/common/turrets/unit/ewheel.qc | 2 +- qcsrc/common/turrets/unit/flac.qc | 2 +- qcsrc/common/turrets/unit/plasma.qc | 6 +- qcsrc/common/turrets/unit/plasma_dual.qc | 8 +- qcsrc/common/turrets/unit/walker.qc | 2 +- qcsrc/common/vehicles/sv_vehicles.qc | 12 +- qcsrc/common/vehicles/unit/bumblebee.qc | 12 +- qcsrc/common/vehicles/unit/racer.qc | 10 +- qcsrc/common/vehicles/unit/raptor.qc | 6 +- qcsrc/common/vehicles/unit/spiderbot.qc | 14 +- qcsrc/common/weapons/w_arc.qc | 58 ++-- qcsrc/common/weapons/w_blaster.qc | 4 +- qcsrc/common/weapons/w_crylink.qc | 10 +- qcsrc/common/weapons/w_devastator.qc | 6 +- qcsrc/common/weapons/w_electro.qc | 10 +- qcsrc/common/weapons/w_fireball.qc | 14 +- qcsrc/common/weapons/w_hagar.qc | 10 +- qcsrc/common/weapons/w_hlac.qc | 6 +- qcsrc/common/weapons/w_hmg.qc | 4 +- qcsrc/common/weapons/w_hook.qc | 2 +- qcsrc/common/weapons/w_machinegun.qc | 8 +- qcsrc/common/weapons/w_minelayer.qc | 4 +- qcsrc/common/weapons/w_mortar.qc | 10 +- qcsrc/common/weapons/w_porto.qc | 2 +- qcsrc/common/weapons/w_rifle.qc | 4 +- qcsrc/common/weapons/w_rpc.qc | 4 +- qcsrc/common/weapons/w_seeker.qc | 8 +- qcsrc/common/weapons/w_shockwave.qc | 2 +- qcsrc/common/weapons/w_shotgun.qc | 4 +- qcsrc/common/weapons/w_tuba.qc | 4 +- qcsrc/common/weapons/w_vaporizer.qc | 26 +- qcsrc/common/weapons/w_vortex.qc | 2 +- qcsrc/dpdefs/csprogsdefs.qh | 4 + qcsrc/dpdefs/dpextensions.qh | 5 +- qcsrc/server/cheats.qc | 6 +- qcsrc/server/cl_client.qc | 6 +- qcsrc/server/cl_player.qc | 2 +- qcsrc/server/command/sv_cmd.qc | 81 +++--- qcsrc/server/g_damage.qc | 6 +- qcsrc/server/g_hook.qc | 4 +- qcsrc/server/g_world.qc | 2 - qcsrc/server/mutators/gamemode_ctf.qc | 8 +- qcsrc/server/mutators/gamemode_keepaway.qc | 6 +- qcsrc/server/mutators/gamemode_onslaught.qc | 18 +- qcsrc/server/mutators/mutator_buffs.qc | 16 +- qcsrc/server/mutators/mutator_nades.qc | 63 ++-- qcsrc/server/mutators/mutator_touchexplode.qc | 2 +- qcsrc/server/mutators/sandbox.qc | 2 +- qcsrc/server/portals.qc | 2 +- qcsrc/server/steerlib.qc | 2 +- qcsrc/server/t_items.qc | 8 +- qcsrc/server/weapons/tracing.qc | 6 +- 75 files changed, 616 insertions(+), 532 deletions(-) diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc index b5980e216..34e891cca 100644 --- a/qcsrc/client/command/cl_cmd.qc +++ b/qcsrc/client/command/cl_cmd.qc @@ -82,7 +82,7 @@ void LocalCommand_boxparticles(int request, int argc) { if (argc == 9) { - int effect = particleeffectnum(argv(1)); + int effect = _particleeffectnum(argv(1)); if (effect >= 0) { int index = stoi(argv(2)); diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 49cb1c6a0..c3e81478c 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -8,6 +8,7 @@ #include "../common/animdecide.qh" #include "../common/csqcmodel_settings.qh" +#include "../common/effects.qh" #include "../common/teams.qh" #include "../common/triggers/trigger/viewloc.qh" @@ -527,7 +528,7 @@ void CSQCModel_Effects_Apply(void) self.traileffect = 0; if(eff & EF_BRIGHTFIELD) - self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); + self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); // ignoring EF_MUZZLEFLASH if(eff & EF_BRIGHTLIGHT) adddynamiclight(self.origin, 400, '3 3 3'); @@ -545,9 +546,9 @@ void CSQCModel_Effects_Apply(void) if(eff & EF_FULLBRIGHT) self.renderflags |= RF_FULLBRIGHT; if(eff & EF_FLAME) - pointparticles(particleeffectnum("EF_FLAME"), self.origin, '0 0 0', bound(0, frametime, 0.1)); + pointparticles(particleeffectnum(EFFECT_EF_FLAME), self.origin, '0 0 0', bound(0, frametime, 0.1)); if(eff & EF_STARDUST) - pointparticles(particleeffectnum("EF_STARDUST"), self.origin, '0 0 0', bound(0, frametime, 0.1)); + pointparticles(particleeffectnum(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) @@ -561,24 +562,24 @@ void CSQCModel_Effects_Apply(void) self.renderflags |= RF_DYNAMICMODELLIGHT; // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION if(self.csqcmodel_modelflags & MF_ROCKET) - self.traileffect = particleeffectnum("TR_ROCKET"); + self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); if(self.csqcmodel_modelflags & MF_GRENADE) - self.traileffect = particleeffectnum("TR_GRENADE"); + self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); if(self.csqcmodel_modelflags & MF_GIB) - self.traileffect = particleeffectnum("TR_BLOOD"); + self.traileffect = particleeffectnum(EFFECT_TR_BLOOD); if(self.csqcmodel_modelflags & MF_ROTATE) { self.renderflags |= RF_USEAXIS; makevectors(self.angles + '0 100 0' * fmod(time, 3.6)); } if(self.csqcmodel_modelflags & MF_TRACER) - self.traileffect = particleeffectnum("TR_WIZSPIKE"); + self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); if(self.csqcmodel_modelflags & MF_ZOMGIB) - self.traileffect = particleeffectnum("TR_SLIGHTBLOOD"); + self.traileffect = particleeffectnum(EFFECT_TR_SLIGHTBLOOD); if(self.csqcmodel_modelflags & MF_TRACER2) - self.traileffect = particleeffectnum("TR_KNIGHTSPIKE"); + self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); if(self.csqcmodel_modelflags & MF_TRACER3) - self.traileffect = particleeffectnum("TR_VORESPIKE"); + self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); if(self.drawmask) Projectile_DrawTrail(self.origin); diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 5eff455c2..32d236fba 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -7,6 +7,7 @@ #include "../common/constants.qh" #include "../common/deathtypes.qh" +#include "../common/effects.qh" #include "../common/movetypes/movetypes.qh" #include "../common/util.qh" @@ -117,7 +118,7 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum) e.classname = "damage"; e.owner = self; e.cnt = time + life; - e.team = particleeffectnum(effectname); + e.team = _particleeffectnum(effectname); e.think = DamageEffect_Think; e.nextthink = time; self.total_damages += 1; @@ -233,33 +234,33 @@ void Ent_DamageInfo(float isNew) string _snd; _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2)))); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_ROCKET: sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_SPIDERBOT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_DEATH: sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_GUN: sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_RACER_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_ROCKET: sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_RACER_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_DEATH: sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_CANNON: sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_RAPTOR_CANNON_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_FRAGMENT: float i; @@ -271,19 +272,19 @@ void Ent_DamageInfo(float isNew) RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i)); } sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_SPREAD), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_BOMB: sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_DEATH: sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_BUMB_GUN: sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_BIGPLASMA_IMPACT), self.origin, w_backoff * 1000, 1); break; } } @@ -304,11 +305,11 @@ void Ent_DamageInfo(float isNew) { case DEATH_TURRET_EWHEEL: sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_FLAC: - pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), w_org, '0 0 0', 1); _snd = W_Sound(strcat("hagexp", ftos(1 + rint(random() * 2)))); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); break; @@ -318,24 +319,24 @@ void Ent_DamageInfo(float isNew) case DEATH_TURRET_WALK_ROCKET: case DEATH_TURRET_HELLION: sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_MACHINEGUN: case DEATH_TURRET_WALK_GUN: _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2)))); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_PLASMA: sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_WALK_MELEE: sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_TE_SPARK), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_PHASER: diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc index 46872d817..80ccc441b 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/client/generator.qc @@ -81,11 +81,11 @@ void generator_draw() if(random() < 0.9 - self.health / self.max_health) if(random() < 0.01) { - pointparticles(particleeffectnum("electro_ballexplode"), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1); sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM); } else - pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_DAMAGED), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1); self.move_time = time + 0.1; @@ -102,7 +102,7 @@ void generator_draw() if(self.count==40||self.count==20) { sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 6); + pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), self.origin, '0 0 0', 6); } // rays @@ -115,7 +115,7 @@ void generator_draw() 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("onslaught_generator_gib_explode"), org, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_GIB), org, '0 0 0', 1); } // Short explosion sound + small explosion @@ -127,14 +127,14 @@ void generator_draw() // Particles org = self.origin + randompos(self.mins + '8 8 8', self.maxs + '-8 -8 -8'); - pointparticles(particleeffectnum("onslaught_generator_smallexplosion"), org, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE), org, '0 0 0', 1); // Final explosion if(self.count==1) { org = self.origin; te_explosion(org); - pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE2), org, '0 0 0', 1); sound(self, CH_TRIGGER, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); } diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index bdde3b698..b59cd4ff3 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -86,7 +86,7 @@ void Gib_Touch() if(!self.silent) sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), 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(); } @@ -102,9 +102,9 @@ void Gib_Draw() 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), "TR_SLIGHTBLOOD")), 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), "TR_BLOOD")), oldorg, self.origin); + trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin); self.renderflags = 0; @@ -222,7 +222,7 @@ void Ent_GibSplash(bool isNew) if(prandom() < amount) TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent); - new_te_bloodshower(particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount); + new_te_bloodshower(_particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount); if(prandom() < amount) TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent); @@ -255,17 +255,17 @@ void Ent_GibSplash(bool isNew) } 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 diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index ce6ca92b5..a30ab73c1 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -161,7 +161,7 @@ void Draw_GrapplingHook() case ENT_CLIENT_HOOK: break; case ENT_CLIENT_ARC_BEAM: - pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect + pointparticles(particleeffectnum(EFFECT_ARC_LIGHTNING2), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect break; } } diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 85aae33c4..6f40c3970 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -148,7 +148,6 @@ void CSQC_Init(void) CALL_ACCUMULATED_FUNCTION(RegisterNotifications); CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels); - CALL_ACCUMULATED_FUNCTION(RegisterEffects); initialize_minigames(); @@ -727,14 +726,14 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint { switch(teamnum) { - case NUM_TEAM_1: self.cnt = particleeffectnum("spawn_point_red"); break; - case NUM_TEAM_2: self.cnt = particleeffectnum("spawn_point_blue"); break; - case NUM_TEAM_3: self.cnt = particleeffectnum("spawn_point_yellow"); break; - case NUM_TEAM_4: self.cnt = particleeffectnum("spawn_point_pink"); break; - default: self.cnt = particleeffectnum("spawn_point_neutral"); break; + case NUM_TEAM_1: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_RED); break; + case NUM_TEAM_2: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_BLUE); break; + case NUM_TEAM_3: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_YELLOW); break; + case NUM_TEAM_4: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_PINK); break; + default: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_NEUTRAL); break; } } - else { self.cnt = particleeffectnum("spawn_point_neutral"); } + else { self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_NEUTRAL); } self.draw = Spawn_Draw; } @@ -764,11 +763,11 @@ void Ent_ReadSpawnEvent(float is_new) { switch(teamnum) { - case NUM_TEAM_1: pointparticles(particleeffectnum("spawn_event_red"), self.origin, '0 0 0', 1); break; - case NUM_TEAM_2: pointparticles(particleeffectnum("spawn_event_blue"), self.origin, '0 0 0', 1); break; - case NUM_TEAM_3: pointparticles(particleeffectnum("spawn_event_yellow"), self.origin, '0 0 0', 1); break; - case NUM_TEAM_4: pointparticles(particleeffectnum("spawn_event_pink"), self.origin, '0 0 0', 1); break; - default: pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); break; + 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; } } if(autocvar_cl_spawn_event_sound) diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index e997d1560..6d73e24b0 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -14,14 +14,14 @@ void Net_ReadVortexBeamParticle() endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord(); charge = ReadByte() / 255.0; - pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1); + pointparticles(particleeffectnum(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 particles_alphamin = particles_alphamax = particles_fade = charge; if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo())) - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); else - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); } diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 12f1714bf..90d3a29e6 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -279,43 +279,43 @@ void Ent_Projectile() self.traileffect = 0; switch(self.cnt) { - case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break; - case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break; - case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break; - case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break; - case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break; - case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break; - case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(""); break; - case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(""); break; - case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break; - case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break; - case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_KNIGHTSPIKE"); break; - case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("tr_hagar"); self.scale = 0.75; break; - case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("tr_hagar"); self.scale = 0.75; break; - case PROJECTILE_NAPALM_FOUNTAIN: //self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("torch_small"); break; - case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("fireball"); break; // particle effect is good enough - case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("firemine"); break; // particle effect is good enough - case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break; - case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_SEEKER"); break; - case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum("TR_SEEKER"); break; - - case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum("TR_VORESPIKE"); break; - case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - - case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break; - case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break; - case PROJECTILE_RAPTORCANNON: setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break; - - case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum("spiderbot_rocket_thrust"); break; - case PROJECTILE_WAKIROCKET: setmodel(self, "models/vehicles/rocket01.md3"); self.traileffect = particleeffectnum("wakizashi_rocket_thrust"); break; - case PROJECTILE_WAKICANNON: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(""); break; - - case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - - case PROJECTILE_RPC: setmodel(self, W_Model("ok_rocket"));self.traileffect = particleeffectnum("TR_ROCKET"); break; + case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; + case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); self.scale = 2; break; + case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break; + case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break; + case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; + case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break; + case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break; + case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break; + case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break; + case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break; + case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); break; + case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break; + case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break; + case PROJECTILE_NAPALM_FOUNTAIN: //self.model = ""; self.modelindex = 0; self.traileffect = _particleeffectnum("torch_small"); break; + case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREBALL); break; // particle effect is good enough + case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREMINE); break; // particle effect is good enough + case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break; + case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum(EFFECT_FLAC_TRAIL); break; + case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum(EFFECT_SEEKER_TRAIL); break; + + case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); break; + case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; + + case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_RAPTORCANNON: setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break; + + case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum(EFFECT_SPIDERBOT_ROCKET_TRAIL); break; + case PROJECTILE_WAKIROCKET: setmodel(self, "models/vehicles/rocket01.md3"); self.traileffect = particleeffectnum(EFFECT_RACER_ROCKET_TRAIL); break; + case PROJECTILE_WAKICANNON: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(EFFECT_NULL); break; + + case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; + case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; + + case PROJECTILE_RPC: setmodel(self, W_Model("ok_rocket"));self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break; default: if(MUTATOR_CALLHOOK(Ent_Projectile, self)) @@ -324,7 +324,7 @@ void Ent_Projectile() if (Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL) { setmodel(self, W_Model("v_ok_grenade")); - self.traileffect = particleeffectnum(Nade_TrailEffect(self.cnt, self.team)); + self.traileffect = _particleeffectnum(Nade_TrailEffect(self.cnt, self.team)); break; } error("Received invalid CSQC projectile, can't work with this!"); diff --git a/qcsrc/common/effects.inc b/qcsrc/common/effects.inc index 0d7432840..8cd4d4995 100644 --- a/qcsrc/common/effects.inc +++ b/qcsrc/common/effects.inc @@ -1,91 +1,189 @@ // Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree) // Not too concerned about the order of this list, just keep the weapon effects together! -// EFFECT(istrail, EFFECT_NAME, "effectinfo_string") -EFFECT(0, EFFECT_EXPLOSION_SMALL, "explosion_small") -EFFECT(0, EFFECT_EXPLOSION_MEDIUM, "explosion_medium") -EFFECT(0, EFFECT_EXPLOSION_BIG, "explosion_big") -EFFECT(1, EFFECT_VAPORIZER_RED, "TE_TEI_G3RED") -EFFECT(1, EFFECT_VAPORIZER_RED_HIT, "TE_TEI_G3RED_HIT") -EFFECT(1, EFFECT_VAPORIZER_BLUE, "TE_TEI_G3BLUE") -EFFECT(1, EFFECT_VAPORIZER_BLUE_HIT, "TE_TEI_G3BLUE_HIT") -EFFECT(1, EFFECT_VAPORIZER_YELLOW, "TE_TEI_G3YELLOW") -EFFECT(1, EFFECT_VAPORIZER_YELLOW_HIT, "TE_TEI_G3YELLOW_HIT") -EFFECT(1, EFFECT_VAPORIZER_PINK, "TE_TEI_G3PINK") -EFFECT(1, EFFECT_VAPORIZER_PINK_HIT, "TE_TEI_G3PINK_HIT") -EFFECT(1, EFFECT_VAPORIZER_NEUTRAL, "TE_TEI_G3NEUTRAL") -EFFECT(1, EFFECT_VAPORIZER_NEUTRAL_HIT, "TE_TEI_G3NEUTRAL_HIT") -EFFECT(0, EFFECT_ELECTRO_COMBO, "electro_combo") -EFFECT(0, EFFECT_ELECTRO_IMPACT, "electro_impact") -EFFECT(0, EFFECT_ELECTRO_MUZZLEFLASH, "electro_muzzleflash") -EFFECT(0, EFFECT_HAGAR_BOUNCE, "hagar_bounce") -EFFECT(0, EFFECT_HAGAR_MUZZLEFLASH, "hagar_muzzleflash") -EFFECT(0, EFFECT_LASER_MUZZLEFLASH, "laser_muzzleflash") -EFFECT(0, EFFECT_MACHINEGUN_MUZZLEFLASH, "uzi_muzzleflash") -EFFECT(0, EFFECT_RIFLE_MUZZLEFLASH, "rifle_muzzleflash") -EFFECT(0, EFFECT_RAPTOR_MUZZLEFLASH, "raptor_cannon_muzzleflash") -EFFECT(0, EFFECT_RACER_MUZZLEFLASH, "wakizashi_gun_muzzleflash") -EFFECT(0, EFFECT_RACER_ROCKETLAUNCH, "wakizashi_rocket_launch") -EFFECT(0, EFFECT_SPIDERBOT_ROCKETLAUNCH, "spiderbot_rocket_launch") -EFFECT(0, EFFECT_BIGPLASMA_MUZZLEFLASH, "bigplasma_muzzleflash") -EFFECT(1, EFFECT_RIFLE, "tr_rifle") -EFFECT(1, EFFECT_RIFLE_WEAK, "tr_rifle_weak") -EFFECT(0, EFFECT_SEEKER_MUZZLEFLASH, "seeker_muzzleflash") -EFFECT(0, EFFECT_SHOTGUN_MUZZLEFLASH, "shotgun_muzzleflash") -EFFECT(0, EFFECT_GRENADE_MUZZLEFLASH, "grenadelauncher_muzzleflash") -EFFECT(0, EFFECT_GRENADE_EXPLODE, "grenade_explode") -EFFECT(0, EFFECT_FLAK_BOUNCE, "flak_bounce") -EFFECT(0, EFFECT_CRYLINK_JOINEXPLODE, "crylink_joinexplode") -EFFECT(0, EFFECT_CRYLINK_MUZZLEFLASH, "crylink_muzzleflash") -EFFECT(0, EFFECT_VORTEX_MUZZLEFLASH, "nex_muzzleflash") -EFFECT(0, EFFECT_HOOK_MUZZLEFLASH, "grapple_muzzleflash") -EFFECT(0, EFFECT_HOOK_IMPACT, "grapple_impact") -EFFECT(0, EFFECT_ROCKET_EXPLODE, "rocket_explode") -EFFECT(0, EFFECT_ROCKET_GUIDE, "rocket_guide") -EFFECT(0, EFFECT_ROCKET_MUZZLEFLASH, "rocketlauncher_muzzleflash") -EFFECT(0, EFFECT_FIREBALL_LASER, "fireball_laser") -EFFECT(0, EFFECT_FIREBALL_EXPLODE, "fireball_explode") -EFFECT(0, EFFECT_FIREBALL_BFGDAMAGE, "fireball_bfgdamage") -EFFECT(0, EFFECT_FIREBALL_MUZZLEFLASH, "fireball_muzzleflash") -EFFECT(0, EFFECT_FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash") -EFFECT(0, EFFECT_TELEPORT, "teleport") -EFFECT(0, EFFECT_SPAWN_RED, "spawn_event_red") -EFFECT(0, EFFECT_SPAWN_BLUE, "spawn_event_blue") -EFFECT(0, EFFECT_SPAWN_YELLOW, "spawn_event_yellow") -EFFECT(0, EFFECT_SPAWN_PINK, "spawn_event_pink") -EFFECT(0, EFFECT_SPAWN_NEUTRAL, "spawn_event_neutral") -EFFECT(0, EFFECT_NADE_RED_EXPLODE, "nade_red_explode") -EFFECT(0, EFFECT_NADE_BLUE_EXPLODE, "nade_blue_explode") -EFFECT(0, EFFECT_NADE_YELLOW_EXPLODE, "nade_yellow_explode") -EFFECT(0, EFFECT_NADE_PINK_EXPLODE, "nade_pink_explode") -EFFECT(0, EFFECT_NADE_NEUTRAL_EXPLODE, "nade_neutral_explode") -EFFECT(0, EFFECT_ICEORGLASS, "iceorglass") -EFFECT(0, EFFECT_ICEFIELD, "icefield") -EFFECT(0, EFFECT_FIREFIELD, "firefield") -EFFECT(0, EFFECT_HEALING, "healing_fx") -EFFECT(1, EFFECT_LASER_BEAM_FAST, "nex242_misc_laser_beam_fast") -EFFECT(0, EFFECT_RESPAWN_GHOST, "respawn_ghost") -EFFECT(0, EFFECT_FLAG_RED_TOUCH, "redflag_touch") -EFFECT(0, EFFECT_FLAG_BLUE_TOUCH, "blueflag_touch") -EFFECT(0, EFFECT_FLAG_YELLOW_TOUCH, "yellowflag_touch") -EFFECT(0, EFFECT_FLAG_PINK_TOUCH, "pinkflag_touch") -EFFECT(0, EFFECT_FLAG_NEUTRAL_TOUCH, "neutralflag_touch") -EFFECT(1, EFFECT_RED_PASS, "red_pass") -EFFECT(1, EFFECT_BLUE_PASS, "blue_pass") -EFFECT(1, EFFECT_YELLOW_PASS, "yellow_pass") -EFFECT(1, EFFECT_PINK_PASS, "pink_pass") -EFFECT(1, EFFECT_NEUTRAL_PASS, "neutral_pass") -EFFECT(0, EFFECT_RED_CAP, "red_cap") -EFFECT(0, EFFECT_BLUE_CAP, "blue_cap") -EFFECT(0, EFFECT_YELLOW_CAP, "yellow_cap") -EFFECT(0, EFFECT_PINK_CAP, "pink_cap") -EFFECT(0, EFFECT_BALL_SPARKS, "kaball_sparks") -EFFECT(0, EFFECT_ELECTRIC_SPARKS, "electricity_sparks") -EFFECT(0, EFFECT_SPARKS, "sparks") -EFFECT(0, EFFECT_RAGE, "rage") -EFFECT(0, EFFECT_SMOKING, "smoking") -EFFECT(0, EFFECT_SMOKE_RING, "smoke_ring") -EFFECT(0, EFFECT_ITEM_PICKUP, "item_pickup") -EFFECT(0, EFFECT_ITEM_RESPAWN, "item_respawn") -EFFECT(0, EFFECT_JUMPPAD, "jumppad_activate") -EFFECT(1, EFFECT_BULLET, "tr_bullet") +// EFFECT(istrail, EFFECT_NAME, "effectinfo_string") +EFFECT(0, EXPLOSION_SMALL, "explosion_small") +EFFECT(0, EXPLOSION_MEDIUM, "explosion_medium") +EFFECT(0, EXPLOSION_BIG, "explosion_big") + +EFFECT(0, SMOKE_SMALL, "smoke_small") +EFFECT(0, SMOKE_LARGE, "smoke_large") + + + +EFFECT(0, BLASTER_IMPACT, "laser_impact") +EFFECT(0, BLASTER_MUZZLEFLASH, "laser_muzzleflash") + +EFFECT(0, SHOTGUN_IMPACT, "shotgun_impact") +EFFECT(0, SHOTGUN_MUZZLEFLASH, "shotgun_muzzleflash") + +EFFECT(0, ARC_BEAM, "arc_beam") +EFFECT(0, ARC_BEAM_HEAL, "arc_beam_heal") +EFFECT(0, ARC_BEAM_HEAL_IMPACT, "arc_beam_healimpact") +EFFECT(0, ARC_BEAM_HEAL_IMPACT2, "healray_impact") +EFFECT(0, ARC_LIGHTNING, "arc_lightning") +EFFECT(0, ARC_LIGHTNING2, "electro_lightning") + +EFFECT(0, MACHINEGUN_IMPACT, "machinegun_impact") +EFFECT(0, MACHINEGUN_MUZZLEFLASH, "uzi_muzzleflash") + +EFFECT(0, GRENADE_EXPLODE, "grenade_explode") +EFFECT(0, GRENADE_MUZZLEFLASH, "grenadelauncher_muzzleflash") + +EFFECT(0, ELECTRO_BALLEXPLODE, "electro_ballexplode") +EFFECT(0, ELECTRO_COMBO, "electro_combo") +EFFECT(0, ELECTRO_IMPACT, "electro_impact") +EFFECT(0, ELECTRO_MUZZLEFLASH, "electro_muzzleflash") + +EFFECT(0, CRYLINK_IMPACT, "crylink_impactbig") +EFFECT(0, CRYLINK_IMPACT2, "crylink_impact") +EFFECT(0, CRYLINK_JOINEXPLODE, "crylink_joinexplode") +EFFECT(0, CRYLINK_MUZZLEFLASH, "crylink_muzzleflash") + +EFFECT(0, VORTEX_BEAM, "nex_beam") +EFFECT(0, VORTEX_BEAM_OLD, "TE_TEI_G3") +EFFECT(0, VORTEX_IMPACT, "nex_impact") +EFFECT(0, VORTEX_MUZZLEFLASH, "nex_muzzleflash") + +EFFECT(1, VAPORIZER_RED, "TE_TEI_G3RED") +EFFECT(1, VAPORIZER_RED_HIT, "TE_TEI_G3RED_HIT") +EFFECT(1, VAPORIZER_BLUE, "TE_TEI_G3BLUE") +EFFECT(1, VAPORIZER_BLUE_HIT, "TE_TEI_G3BLUE_HIT") +EFFECT(1, VAPORIZER_YELLOW, "TE_TEI_G3YELLOW") +EFFECT(1, VAPORIZER_YELLOW_HIT, "TE_TEI_G3YELLOW_HIT") +EFFECT(1, VAPORIZER_PINK, "TE_TEI_G3PINK") +EFFECT(1, VAPORIZER_PINK_HIT, "TE_TEI_G3PINK_HIT") +EFFECT(1, VAPORIZER_NEUTRAL, "TE_TEI_G3") +EFFECT(1, VAPORIZER_NEUTRAL_HIT, "TE_TEI_G3_HIT") + +EFFECT(0, RIFLE_IMPACT, "machinegun_impact") +EFFECT(0, RIFLE_MUZZLEFLASH, "rifle_muzzleflash") +EFFECT(1, RIFLE, "tr_rifle") +EFFECT(1, RIFLE_WEAK, "tr_rifle_weak") + +EFFECT(0, HAGAR_BOUNCE, "hagar_bounce") +EFFECT(0, HAGAR_EXPLODE, "hagar_explode") +EFFECT(0, HAGAR_MUZZLEFLASH, "hagar_muzzleflash") +EFFECT(1, HAGAR_ROCKET, "tr_hagar") + +EFFECT(0, ROCKET_EXPLODE, "rocket_explode") +EFFECT(0, ROCKET_GUIDE, "rocket_guide") +EFFECT(0, ROCKET_MUZZLEFLASH, "rocketlauncher_muzzleflash") + +EFFECT(0, HOOK_EXPLODE, "hookbomb_explode") +EFFECT(0, HOOK_IMPACT, "grapple_impact") +EFFECT(0, HOOK_MUZZLEFLASH, "grapple_muzzleflash") + +EFFECT(0, SEEKER_MUZZLEFLASH, "seeker_muzzleflash") + +EFFECT(0, FLAK_BOUNCE, "flak_bounce") + +EFFECT(1, FIREBALL, "fireball") +EFFECT(0, FIREBALL_BFGDAMAGE, "fireball_bfgdamage") +EFFECT(0, FIREBALL_EXPLODE, "fireball_explode") +EFFECT(0, FIREBALL_LASER, "fireball_laser") +EFFECT(0, FIREBALL_MUZZLEFLASH, "fireball_muzzleflash") +EFFECT(0, FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash") + + + +EFFECT(0, RAPTOR_CANNON_IMPACT, "raptor_cannon_impact") +EFFECT(0, RAPTOR_BOMB_IMPACT, "raptor_bomb_impact") +EFFECT(0, RAPTOR_BOMB_SPREAD, "raptor_bomb_spread") +EFFECT(0, RAPTOR_MUZZLEFLASH, "raptor_cannon_muzzleflash") + +EFFECT(0, RACER_BOOSTER, "wakizashi_booster_smoke") +EFFECT(0, RACER_IMPACT, "wakizashi_gun_impact") +EFFECT(0, RACER_MUZZLEFLASH, "wakizashi_gun_muzzleflash") +EFFECT(0, RACER_ROCKETLAUNCH, "wakizashi_rocket_launch") +EFFECT(0, RACER_ROCKET_EXPLODE, "wakizashi_rocket_launch") +EFFECT(1, RACER_ROCKET_TRAIL, "wakizashi_rocket_thrust") + +EFFECT(0, SPIDERBOT_ROCKETLAUNCH, "spiderbot_rocket_launch") +EFFECT(1, SPIDERBOT_ROCKET_TRAIL, "spiderbot_rocket_thrust") +EFFECT(0, SPIDERBOT_ROCKET_EXPLODE, "spiderbot_rocket_explode") +EFFECT(0, SPIDERBOT_MINIGUN_IMPACT, "spiderbot_minigun_impact") +EFFECT(0, SPIDERBOT_MINIGUN_MUZZLEFLASH, "spiderbot_minigun_muzzleflash") + +EFFECT(0, BUMBLEBEE_HEAL_MUZZLEFLASH, "healray_muzzleflash") +EFFECT(0, BUMBLEBEE_HEAL_IMPACT, "healray_impact") + +EFFECT(0, BIGPLASMA_IMPACT, "bigplasma_impact") +EFFECT(0, BIGPLASMA_MUZZLEFLASH, "bigplasma_muzzleflash") + +EFFECT(0, TELEPORT, "teleport") + +EFFECT(0, SPAWNPOINT_RED, "spawn_point_red") +EFFECT(0, SPAWN_RED, "spawn_event_red") +EFFECT(0, SPAWNPOINT_BLUE, "spawn_point_blue") +EFFECT(0, SPAWN_BLUE, "spawn_event_blue") +EFFECT(0, SPAWNPOINT_YELLOW, "spawn_point_yellow") +EFFECT(0, SPAWN_YELLOW, "spawn_event_yellow") +EFFECT(0, SPAWNPOINT_PINK, "spawn_point_pink") +EFFECT(0, SPAWN_PINK, "spawn_event_pink") +EFFECT(0, SPAWNPOINT_NEUTRAL, "spawn_point_neutral") +EFFECT(0, SPAWN_NEUTRAL, "spawn_event_neutral") + +EFFECT(0, NADE_RED_EXPLODE, "nade_red_explode") +EFFECT(0, NADE_BLUE_EXPLODE, "nade_blue_explode") +EFFECT(0, NADE_YELLOW_EXPLODE, "nade_yellow_explode") +EFFECT(0, NADE_PINK_EXPLODE, "nade_pink_explode") +EFFECT(0, NADE_NEUTRAL_EXPLODE, "nade_neutral_explode") + +EFFECT(0, ICEORGLASS, "iceorglass") +EFFECT(0, ICEFIELD, "icefield") +EFFECT(0, FIREFIELD, "firefield") +EFFECT(0, HEALING, "healing_fx") +EFFECT(1, LASER_BEAM_FAST, "nex242_misc_laser_beam_fast") +EFFECT(0, RESPAWN_GHOST, "respawn_ghost") + +EFFECT(0, FLAG_RED_TOUCH, "redflag_touch") +EFFECT(0, FLAG_BLUE_TOUCH, "blueflag_touch") +EFFECT(0, FLAG_YELLOW_TOUCH, "yellowflag_touch") +EFFECT(0, FLAG_PINK_TOUCH, "pinkflag_touch") +EFFECT(0, FLAG_NEUTRAL_TOUCH, "neutralflag_touch") +EFFECT(1, RED_PASS, "red_pass") +EFFECT(1, BLUE_PASS, "blue_pass") +EFFECT(1, YELLOW_PASS, "yellow_pass") +EFFECT(1, PINK_PASS, "pink_pass") +EFFECT(1, NEUTRAL_PASS, "neutral_pass") +EFFECT(0, RED_CAP, "red_cap") +EFFECT(0, BLUE_CAP, "blue_cap") +EFFECT(0, YELLOW_CAP, "yellow_cap") +EFFECT(0, PINK_CAP, "pink_cap") + +EFFECT(0, ITEM_PICKUP, "item_pickup") +EFFECT(0, ITEM_RESPAWN, "item_respawn") + +EFFECT(0, ONS_GENERATOR_DAMAGED, "torch_small") +EFFECT(0, ONS_GENERATOR_GIB, "onslaught_generator_gib_explode") +EFFECT(0, ONS_GENERATOR_EXPLODE, "onslaught_generator_smallexplosion") +EFFECT(0, ONS_GENERATOR_EXPLODE2, "onslaught_generator_finalexplosion") + + + +EFFECT(0, LASER_DEADLY, "laser_deadly") +EFFECT(1, FLAC_TRAIL, "TR_SEEKER") +EFFECT(1, SEEKER_TRAIL, "TR_SEEKER") +EFFECT(1, FIREMINE, "firemine") +EFFECT(0, BALL_SPARKS, "kaball_sparks") +EFFECT(0, ELECTRIC_SPARKS, "electricity_sparks") +EFFECT(0, SPARKS, "sparks") +EFFECT(0, RAGE, "rage") +EFFECT(0, SMOKING, "smoking") +EFFECT(0, SMOKE_RING, "smoke_ring") +EFFECT(0, JUMPPAD, "jumppad_activate") +EFFECT(1, BULLET, "tr_bullet") +EFFECT(0, EF_FLAME, "EF_FLAME") +EFFECT(0, EF_STARDUST, "EF_STARDUST") +EFFECT(0, TE_EXPLOSION, "TE_EXPLOSION") +EFFECT(1, TR_NEXUIZPLASMA, "TR_NEXUIZPLASMA") +EFFECT(1, TR_CRYLINKPLASMA, "TR_CRYLINKPLASMA") +EFFECT(1, TR_ROCKET, "TR_ROCKET") +EFFECT(1, TR_GRENADE, "TR_GRENADE") +EFFECT(1, TR_BLOOD, "TR_BLOOD") +EFFECT(1, TR_WIZSPIKE, "TR_WIZSPIKE") +EFFECT(1, TR_SLIGHTBLOOD, "TR_SLIGHTBLOOD") +EFFECT(1, TR_KNIGHTSPIKE, "TR_KNIGHTSPIKE") +EFFECT(1, TR_VORESPIKE, "TR_VORESPIKE") +EFFECT(0, TE_SPARK, "TE_SPARK") diff --git a/qcsrc/common/effects.qc b/qcsrc/common/effects.qc index 349fdffbf..e1707021e 100644 --- a/qcsrc/common/effects.qc +++ b/qcsrc/common/effects.qc @@ -1,14 +1,3 @@ -void Create_Effect_Entity(int eff_name, string eff_string, bool eff_trail) -{ - entity eff; - effects_ent[eff_name - 1] = eff = spawn(); - - eff.classname = "effect_entity"; - eff.eent_net_name = eff_name; - eff.eent_eff_name = eff_string; - eff.eent_eff_trail = eff_trail; -} - #ifdef CSQC void Read_Effect(bool is_new) { @@ -18,7 +7,7 @@ void Read_Effect(bool is_new) int net_name = ReadByte(); #endif - entity eff = effects_ent[net_name - 1]; + entity eff = effects_ent[net_name]; vector v, vel = '0 0 0'; int eff_cnt = 1; @@ -41,9 +30,9 @@ void Read_Effect(bool is_new) if(is_new) { if(eff_trail) - WarpZone_TrailParticles(world, particleeffectnum(eff.eent_eff_name), v, vel); + WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel); else - pointparticles(particleeffectnum(eff.eent_eff_name), v, vel, eff_cnt); + pointparticles(particleeffectnum(eff), v, vel, eff_cnt); } } #endif @@ -53,9 +42,9 @@ bool Net_Write_Effect(entity client, int sf) { WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT); #if EFFECTS_COUNT >= 255 - WriteShort(MSG_ENTITY, self.eent_net_name); + WriteShort(MSG_ENTITY, self.m_id); #else - WriteByte(MSG_ENTITY, self.eent_net_name); + WriteByte(MSG_ENTITY, self.m_id); #endif WriteCoord(MSG_ENTITY, self.eent_net_location_x); WriteCoord(MSG_ENTITY, self.eent_net_location_y); @@ -75,38 +64,15 @@ bool Net_Write_Effect(entity client, int sf) return true; } -// problem with this is, we might not have all the available effects for it -int Effect_NameToID(string eff_name) -{ - int i; - for(i = EFFECT_FIRST; i < MAX_EFFECTS; ++i) - { - if((effects_ent[i - 1]).eent_eff_name == eff_name) - return (effects_ent[i - 1]).eent_net_name; - } - - return 0; -} - -void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt) +void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt) { - int eff_id = Effect_NameToID(eff_name); - - if(!eff_id) - { - // revert to engine handling? - pointparticles(particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt); - return; - } - - entity eff = effects_ent[eff_id - 1]; if(!eff) { return; } if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count! entity net_eff = spawn(); net_eff.owner = eff; net_eff.classname = "net_effect"; //net_eff.eent_broadcast = broadcast; - net_eff.eent_net_name = eff_id; + net_eff.m_id = eff.m_id; net_eff.eent_net_velocity = eff_vel; net_eff.eent_net_location = eff_loc; net_eff.eent_net_count = eff_cnt; @@ -117,4 +83,15 @@ void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt) Net_LinkEntity(net_eff, false, 0, Net_Write_Effect); } + +void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt) +{ + // problem with this is, we might not have all the available effects for it + FOREACH(effects_ent, it.eent_eff_name == eff_name, LAMBDA( + Send_Effect(it, eff_loc, eff_vel, eff_cnt); + return; + )); + // revert to engine handling + pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt); +} #endif diff --git a/qcsrc/common/effects.qh b/qcsrc/common/effects.qh index 1889f7b42..b72eab243 100644 --- a/qcsrc/common/effects.qh +++ b/qcsrc/common/effects.qh @@ -1,36 +1,39 @@ #ifndef P_EFFECTS_H #define P_EFFECTS_H -.int eent_net_name; // id -.vector eent_net_location; -.vector eent_net_velocity; -.int eent_eff_trail; -.string eent_eff_name; -.int eent_net_count; - #ifdef CSQC void Read_Effect(bool is_new); #elif defined(SVQC) -void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt); +void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt); +void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt); #endif -const int EFFECT_FIRST = 1; -int EFFECT_COUNT; +#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name) +void RegisterEffects(); const int MAX_EFFECTS = 512; -entity effects_ent[MAX_EFFECTS]; +entity effects_ent[MAX_EFFECTS], effects_ent_first, effects_ent_last; +int EFFECT_COUNT; -void Create_Effect_Entity(int eff_name, string eff_string, int eff_trail); +#define EFFECT(istrail, name, realname) \ + REGISTER(RegisterEffects, EFFECT, effects_ent, EFFECT_COUNT, name, m_id, Create_Effect_Entity(realname, istrail)); +REGISTER_REGISTRY(RegisterEffects) -#define EFFECT(istrail,name,realname) \ - int name; \ - void RegisterEffect_##name() \ - { \ - SET_FIELD_COUNT(name, EFFECT_FIRST, EFFECT_COUNT) \ - CHECK_MAX_COUNT(name, MAX_EFFECTS, EFFECT_COUNT, "EFFECT") \ - Create_Effect_Entity(name, realname, istrail); \ - } \ - ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffect_##name); +.int m_id; +.string eent_eff_name; +.int eent_eff_trail; + +.vector eent_net_location; +.vector eent_net_velocity; +.int eent_net_count; + +entity Create_Effect_Entity(string eff_name, bool eff_trail) +{ + entity this = new(effect_entity); + this.eent_eff_name = eff_name; + this.eent_eff_trail = eff_trail; + return this; +} void RegisterEffects_First() { @@ -51,8 +54,8 @@ void RegisterEffects_Done() // NOW we actually activate the declarations ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First); +EFFECT(0, NULL, string_null) #include "effects.inc" ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done); -#undef EFFECT #endif diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index e2258dbd4..46ce94dd7 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -90,7 +90,7 @@ void mage_spike_explode() self.realowner.mage_spike = world; - Send_Effect("explosion_small", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, self.origin, '0 0 0', 1); RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other); remove (self); @@ -209,7 +209,7 @@ void mage_heal() { case 0: if(head.health < autocvar_g_balance_health_regenstable) head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), autocvar_g_balance_health_regenstable); - fx = "healing_fx"; + fx = EFFECT_HEALING.eent_eff_name; break; case 1: if(head.ammo_cells) head.ammo_cells = bound(head.ammo_cells, head.ammo_cells + 1, g_pickup_cells_max); @@ -228,15 +228,15 @@ void mage_heal() break; case 3: head.health = bound(0, head.health - ((head == self) ? (autocvar_g_monster_mage_heal_self) : (autocvar_g_monster_mage_heal_allies)), autocvar_g_balance_health_regenstable); - fx = "rage"; + fx = EFFECT_RAGE.eent_eff_name; break; } - Send_Effect(fx, head.origin, '0 0 0', 1); + Send_Effect_(fx, head.origin, '0 0 0', 1); } else { - Send_Effect("healing_fx", head.origin, '0 0 0', 1); + Send_Effect(EFFECT_HEALING, head.origin, '0 0 0', 1); head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health); if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE)) WaypointSprite_UpdateHealth(head.sprite, head.health); @@ -254,7 +254,7 @@ void mage_push() { sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM); RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy); - Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_TE_EXPLOSION, self.origin, '0 0 0', 1); self.frame = mage_anim_attack; self.attack_finished_single = time + (autocvar_g_monster_mage_attack_push_delay); @@ -271,7 +271,7 @@ void mage_teleport() if(trace_fraction < 1) return; - Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1); setorigin(self, self.enemy.origin + ((v_forward * -1) * 200)); self.attack_finished_single = time + 0.2; diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index 47e371a97..80325a2fa 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -43,7 +43,7 @@ const float shambler_anim_death = 8; void shambler_smash() { makevectors(self.angles); - Send_Effect("explosion_medium", (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_MEDIUM, (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1); sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * 500, MOVE_NORMAL, self); @@ -68,7 +68,7 @@ void shambler_lightning_explode() entity head; sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("electro_impact", '0 0 0', '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_IMPACT, '0 0 0', '0 0 0', 1); self.event_damage = func_null; self.takedamage = DAMAGE_NO; diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index de5f2c459..21e0dbeb5 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -38,7 +38,7 @@ void spider_web_explode() entity e; if(self) { - Send_Effect("electro_impact", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_IMPACT, self.origin, '0 0 0', 1); RadiusDamage(self, self.realowner, 0, 0, 25, world, world, 25, self.projectiledeathtype, world); for(e = findradius(self.origin, 25); e; e = e.chain) if(e != self) if(e.takedamage && e.deadflag == DEAD_NO) if(e.health > 0) if(e.monsterid != MON_SPIDER.monsterid) diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 849abc36c..355d9fa23 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -37,7 +37,7 @@ void wyvern_fireball_explode() entity e; if(self) { - Send_Effect("fireball_explode", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_FIREBALL_EXPLODE, self.origin, '0 0 0', 1); RadiusDamage(self, self.realowner, (autocvar_g_monster_wyvern_attack_fireball_damage), (autocvar_g_monster_wyvern_attack_fireball_edgedamage), (autocvar_g_monster_wyvern_attack_fireball_force), world, world, (autocvar_g_monster_wyvern_attack_fireball_radius), self.projectiledeathtype, world); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 020355077..9f8028aa8 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -520,7 +520,7 @@ vector monster_pickmovetarget(entity targ) if(self.enemy) { - /*WarpZone_TrailParticles(world, particleeffectnum("red_pass"), self.origin, targ_origin); + /*WarpZone_TrailParticles(world, particleeffectnum(EFFECT_RED_PASS), self.origin, targ_origin); print("Trace origin: ", vtos(targ_origin), "\n"); print("Target origin: ", vtos(self.enemy.origin), "\n"); print("My origin: ", vtos(self.origin), "\n"); */ @@ -843,7 +843,7 @@ void monster_remove(entity mon) if(!mon) return; // nothing to remove - Send_Effect("item_pickup", mon.origin, '0 0 0', 1); + Send_Effect(EFFECT_ITEM_PICKUP, mon.origin, '0 0 0', 1); if(mon.weaponentity) remove(mon.weaponentity); diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 444b99b35..b70d8b600 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -282,7 +282,7 @@ void spawnfunc_func_breakable() if(!self.debristimejitter) self.debristime = 2.5; if(self.mdl != "") - self.cnt = particleeffectnum(self.mdl); + self.cnt = _particleeffectnum(self.mdl); if(self.count == 0) self.count = 1; diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index 9b32371db..654db0f72 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -141,7 +141,7 @@ void spawnfunc_func_pointparticles() setsize(self, '0 0 0', self.maxs - self.mins); } if(!self.cnt) - self.cnt = particleeffectnum(self.mdl); + self.cnt = _particleeffectnum(self.mdl); Net_LinkEntity(self, (self.spawnflags & 4), 0, pointparticles_SendEntity); diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index 2d9f09519..a7fb07815 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -218,16 +218,16 @@ void spawnfunc_misc_laser() self.cnt = -1; else { - self.cnt = particleeffectnum(self.mdl); + self.cnt = _particleeffectnum(self.mdl); if(self.cnt < 0) if(self.dmg) - self.cnt = particleeffectnum("laser_deadly"); + self.cnt = particleeffectnum(EFFECT_LASER_DEADLY); } } else if(!self.cnt) { if(self.dmg) - self.cnt = particleeffectnum("laser_deadly"); + self.cnt = particleeffectnum(EFFECT_LASER_DEADLY); else self.cnt = -1; } diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index f7240f65a..342131169 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -82,8 +82,8 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM); if(tflags & TELEPORT_FLAG_PARTICLES) { - Send_Effect("teleport", player.origin, '0 0 0', 1); - Send_Effect("teleport", to + v_forward * 32, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, to + v_forward * 32, '0 0 0', 1); } self.pushltime = time + 0.2; } diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index b14078fb4..47f08d3ac 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -181,7 +181,7 @@ void trigger_push_touch() if(self.pushltime < time) // prevent "snorring" sound when a player hits the jumppad more than once { // flash when activated - Send_Effect("jumppad_activate", other.origin, other.velocity, 1); + Send_Effect(EFFECT_JUMPPAD, other.origin, other.velocity, 1); sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); self.pushltime = time + 0.2; } diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 788f64658..f083e80d6 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -45,11 +45,11 @@ void turret_draw() if(self.health < 85) if(dt < 0.01) - pointparticles(particleeffectnum("smoke_large"), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_SMOKE_LARGE), (self.origin + (randomvec() * 80)), '0 0 0', 1); if(self.health < 32) if(dt < 0.015) - pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1); } @@ -273,7 +273,7 @@ void turret_gibboom() float i; sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); + pointparticles(particleeffectnum(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); @@ -319,7 +319,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo void turret_die() { sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1); if (!autocvar_cl_nogibs) { // Base diff --git a/qcsrc/common/turrets/unit/ewheel.qc b/qcsrc/common/turrets/unit/ewheel.qc index 32bad5fb1..1a09611da 100644 --- a/qcsrc/common/turrets/unit/ewheel.qc +++ b/qcsrc/common/turrets/unit/ewheel.qc @@ -139,7 +139,7 @@ float t_ewheel(float req) _mis = turret_projectile(W_Sound("lasergun_fire"), 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE); _mis.missile_flags = MIF_SPLASH; - Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); self.tur_head.frame += 2; diff --git a/qcsrc/common/turrets/unit/flac.qc b/qcsrc/common/turrets/unit/flac.qc index 65d00be38..3b834e477 100644 --- a/qcsrc/common/turrets/unit/flac.qc +++ b/qcsrc/common/turrets/unit/flac.qc @@ -41,7 +41,7 @@ float t_flac(float req) turret_tag_fire_update(); proj = turret_projectile(W_Sound("hagar_fire"), 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, TRUE, TRUE); - Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); proj.think = turret_flac_projectile_think_explode; proj.nextthink = time + self.tur_impacttime + (random() * 0.01 - random() * 0.01); proj.missile_flags = MIF_SPLASH | MIF_PROXY; diff --git a/qcsrc/common/turrets/unit/plasma.qc b/qcsrc/common/turrets/unit/plasma.qc index dfebe1a40..dda66f72c 100644 --- a/qcsrc/common/turrets/unit/plasma.qc +++ b/qcsrc/common/turrets/unit/plasma.qc @@ -27,7 +27,7 @@ float t_plasma(float req) FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000, 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA); - Send_Effect("nex_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); // teamcolor / hit beam effect vector v; @@ -35,7 +35,7 @@ float t_plasma(float req) v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); s = strcat("TE_TEI_G3", ((self.team) ? Static_Team_ColorName_Upper(self.team) : "")); - WarpZone_TrailParticles(world, particleeffectnum(s), self.tur_shotorg, v); + WarpZone_TrailParticles(world, _particleeffectnum(s), self.tur_shotorg, v); if (self.tur_head.frame == 0) self.tur_head.frame = 1; @@ -45,7 +45,7 @@ float t_plasma(float req) entity missile = turret_projectile(W_Sound("hagar_fire"), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); missile.missile_flags = MIF_SPLASH; - Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); if (self.tur_head.frame == 0) self.tur_head.frame = 1; } diff --git a/qcsrc/common/turrets/unit/plasma_dual.qc b/qcsrc/common/turrets/unit/plasma_dual.qc index 79e2ba815..ef762387b 100644 --- a/qcsrc/common/turrets/unit/plasma_dual.qc +++ b/qcsrc/common/turrets/unit/plasma_dual.qc @@ -28,15 +28,15 @@ float t_plasma_dual(float req) 800, 0, 0, 0, 0, DEATH_TURRET_PLASMA); - Send_Effect("nex_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); // teamcolor / hit beam effect vector v; string s; v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); - s = strcat("TE_TEI_G3", ((self.team) ? Static_Team_ColorName_Upper(self.team) : "")); + s = strcat(EFFECT_VAPORIZER_NEUTRAL.eent_eff_name, ((self.team) ? Static_Team_ColorName_Upper(self.team) : "")); - WarpZone_TrailParticles(world, particleeffectnum(s), self.tur_shotorg, v); + WarpZone_TrailParticles(world, _particleeffectnum(s), self.tur_shotorg, v); self.tur_head.frame += 1; } @@ -44,7 +44,7 @@ float t_plasma_dual(float req) { entity missile = turret_projectile(W_Sound("hagar_fire"), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, TRUE, TRUE); missile.missile_flags = MIF_SPLASH; - Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); self.tur_head.frame += 1; } diff --git a/qcsrc/common/turrets/unit/walker.qc b/qcsrc/common/turrets/unit/walker.qc index 1375d02ae..4a9ca77af 100644 --- a/qcsrc/common/turrets/unit/walker.qc +++ b/qcsrc/common/turrets/unit/walker.qc @@ -344,7 +344,7 @@ float t_walker(float req) { sound (self, CH_WEAPON_A, W_Sound("uzi_fire"), VOL_BASE, ATTEN_NORM); fireBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0); - Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); return true; } diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 7b0f65536..523156006 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -292,7 +292,7 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound, sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM); if(_mzlfx) - Send_Effect(_mzlfx, proj.origin, proj.velocity, 1); + Send_Effect_(_mzlfx, proj.origin, proj.velocity, 1); setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size); @@ -304,8 +304,8 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound, void vehicles_gib_explode() { sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); - Send_Effect("explosion_small", self.wp00.origin + '0 0 64', '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, self.wp00.origin + '0 0 64', '0 0 0', 1); remove(self); } @@ -479,7 +479,7 @@ void vehicles_clearreturn(entity veh) void vehicles_spawn(); void vehicles_return() { - Send_Effect("teleport", self.wp00.origin + '0 0 64', '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, self.wp00.origin + '0 0 64', '0 0 0', 1); self.wp00.think = vehicles_spawn; self.wp00.nextthink = time; @@ -635,7 +635,7 @@ void vehicles_painframe() float _ftmp; _ftmp = self.owner.vehicle_health / 50; self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp); - pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1); if(self.vehicle_flags & VHF_DMGSHAKE) self.velocity += randomvec() * 30; @@ -1169,7 +1169,7 @@ void vehicles_spawn() self.angles = self.pos2; setorigin(self, self.pos1); // Show it - Send_Effect("teleport", self.origin + '0 0 64', '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, self.origin + '0 0 64', '0 0 0', 1); if(self.vehicle_controller) self.team = self.vehicle_controller.team; diff --git a/qcsrc/common/vehicles/unit/bumblebee.qc b/qcsrc/common/vehicles/unit/bumblebee.qc index b33d33256..7ace8225b 100644 --- a/qcsrc/common/vehicles/unit/bumblebee.qc +++ b/qcsrc/common/vehicles/unit/bumblebee.qc @@ -104,7 +104,7 @@ float bumble_raygun_send(entity to, int sf); void bumblebee_fire_cannon(entity _gun, string _tagname, entity _owner) { vector v = gettaginfo(_gun, gettagindex(_gun, _tagname)); - vehicles_projectile("bigplasma_muzzleflash", W_Sound("flacexp3"), + vehicles_projectile(EFFECT_BIGPLASMA_MUZZLEFLASH.eent_eff_name, W_Sound("flacexp3"), v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed, autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force, 0, DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner); @@ -717,7 +717,7 @@ void bumblebee_blowup() DEATH_VH_BUMB_DEATH, world); sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_big", (self.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_BIG, (self.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1); if(self.owner.deadflag == DEAD_DYING) self.owner.deadflag = DEAD_DEAD; @@ -733,7 +733,7 @@ void bumblebee_diethink() if(random() < 0.1) { sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } self.nextthink = time + 0.1; @@ -877,7 +877,7 @@ float v_bumblebee(float req) _body.scale = 1.5; _body.angles = self.angles; - Send_Effect("explosion_medium", findbetterlocation(self.origin, 16), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation(self.origin, 16), '0 0 0', 1); self.health = 0; self.event_damage = func_null; @@ -1078,8 +1078,8 @@ void bumble_raygun_read(bool bIsNew) else self.colormod = '0 1 0'; - self.traileffect = particleeffectnum("healray_muzzleflash"); - self.lip = particleeffectnum("healray_impact"); + self.traileffect = particleeffectnum(EFFECT_BUMBLEBEE_HEAL_MUZZLEFLASH); + self.lip = particleeffectnum(EFFECT_BUMBLEBEE_HEAL_IMPACT); self.draw = bumble_raygun_draw; } diff --git a/qcsrc/common/vehicles/unit/racer.qc b/qcsrc/common/vehicles/unit/racer.qc index f83df2873..38b06c3b3 100644 --- a/qcsrc/common/vehicles/unit/racer.qc +++ b/qcsrc/common/vehicles/unit/racer.qc @@ -174,7 +174,7 @@ void racer_fire_cannon(string tagname) entity bolt; v = gettaginfo(self, gettagindex(self, tagname)); - bolt = vehicles_projectile("wakizashi_gun_muzzleflash", W_Sound("lasergun_fire"), + bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH.eent_eff_name, W_Sound("lasergun_fire"), v, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed, autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force, 0, DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, true, true, self.owner); @@ -292,7 +292,7 @@ void racer_rocket_tracker() void racer_fire_rocket(string tagname, entity trg) { vector v = gettaginfo(self, gettagindex(self, tagname)); - entity rocket = vehicles_projectile("wakizashi_rocket_launch", W_Sound("rocket_fire"), + entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), v, v_forward * autocvar_g_vehicle_racer_rocket_speed, autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3, DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, false, false, self.owner); @@ -406,7 +406,7 @@ float racer_frame() { #ifdef SVQC if(time - racer.wait > 0.2) - pointparticles(particleeffectnum("wakizashi_booster_smoke"), self.origin - v_forward * 32, v_forward * vlen(self.velocity), 1); + pointparticles(particleeffectnum(EFFECT_RACER_BOOSTER), self.origin - v_forward * 32, v_forward * vlen(self.velocity), 1); #endif racer.wait = time; @@ -427,7 +427,7 @@ float racer_frame() { traceline(racer.origin, racer.origin - '0 0 256', MOVE_NORMAL, self); if(trace_fraction != 1.0) - pointparticles(particleeffectnum("smoke_small"), trace_endpos, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), trace_endpos, '0 0 0', 1); racer.invincible_finished = time + 0.1 + (random() * 0.1); } @@ -794,7 +794,7 @@ bool v_racer(int req) self.cnt = 1 + random() * 2; self.touch = racer_deadtouch; - Send_Effect("explosion_medium", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_MEDIUM, self.origin, '0 0 0', 1); if(random() < 0.5) self.avelocity_z = 32; diff --git a/qcsrc/common/vehicles/unit/raptor.qc b/qcsrc/common/vehicles/unit/raptor.qc index 035c20b8b..d2ddea773 100644 --- a/qcsrc/common/vehicles/unit/raptor.qc +++ b/qcsrc/common/vehicles/unit/raptor.qc @@ -195,7 +195,7 @@ void raptor_bombdrop() void raptor_fire_cannon(entity gun, string tagname) { - vehicles_projectile("raptor_cannon_muzzleflash", W_Sound("lasergun_fire"), + vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, W_Sound("lasergun_fire"), gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed, autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0, DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, true, true, self.owner); @@ -728,7 +728,7 @@ void raptor_diethink() if(random() < 0.05) { sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } self.nextthink = time; @@ -842,7 +842,7 @@ float v_raptor(float req) self.nextthink = time; self.wait = time + 5 + (random() * 5); - Send_Effect("explosion_medium", findbetterlocation (self.origin, 16), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation (self.origin, 16), '0 0 0', 1); self.velocity_z += 600; diff --git a/qcsrc/common/vehicles/unit/spiderbot.qc b/qcsrc/common/vehicles/unit/spiderbot.qc index 8c238f865..973e1e594 100644 --- a/qcsrc/common/vehicles/unit/spiderbot.qc +++ b/qcsrc/common/vehicles/unit/spiderbot.qc @@ -269,7 +269,7 @@ void spiderbot_rocket_do() switch(self.vehicle_weapon2mode) { case SBRM_VOLLY: - rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner); @@ -283,7 +283,7 @@ void spiderbot_rocket_do() self.wait = -10; break; case SBRM_GUIDE: - rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner); @@ -295,7 +295,7 @@ void spiderbot_rocket_do() break; case SBRM_ARTILLERY: - rocket = vehicles_projectile("spiderbot_rocket_launch", W_Sound("rocket_fire"), + rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, W_Sound("rocket_fire"), v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed, autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1, DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner); @@ -559,8 +559,8 @@ float spiderbot_frame() autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0); sound (gun, CH_WEAPON_A, W_Sound("uzi_fire"), VOL_BASE, ATTEN_NORM); - //trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos); - pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1); + //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos); + pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH), v, v_forward * 2500, 1); self = spider; @@ -679,7 +679,7 @@ void spiderbot_headfade() if(self.alpha > 0.1) { sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_big", self.origin + '0 0 100', '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_BIG, self.origin + '0 0 100', '0 0 0', 1); } remove(self); } @@ -692,7 +692,7 @@ void spiderbot_blowup() if(random() < 0.1) { sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1); } self.nextthink = time + 0.1; return; diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 893311441..c101a8c8a 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -265,7 +265,7 @@ void W_Arc_Beam_Think(void) if ( WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max) ) { - Send_Effect("arc_overheat", + Send_Effect_("arc_overheat", self.beam_start, self.beam_wantdir, 1 ); sound(self, CH_WEAPON_A, W_Sound("arc_stop"), VOL_BASE, ATTN_NORM); } @@ -608,10 +608,10 @@ void Arc_Smoke() if ( self.arc_overheat > time ) { if ( random() < self.arc_heat_percent ) - Send_Effect("arc_smoke", smoke_origin, '0 0 0', 1 ); + Send_Effect_("arc_smoke", smoke_origin, '0 0 0', 1 ); if ( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) { - Send_Effect("arc_overheat_fire", smoke_origin, w_shotdir, 1 ); + Send_Effect_("arc_overheat_fire", smoke_origin, w_shotdir, 1 ); if ( !self.arc_smoke_sound ) { self.arc_smoke_sound = 1; @@ -624,7 +624,7 @@ void Arc_Smoke() { if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) / ( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) ) - Send_Effect("arc_smoke", smoke_origin, '0 0 0', 1 ); + Send_Effect_("arc_smoke", smoke_origin, '0 0 0', 1 ); } if ( self.arc_smoke_sound && ( self.arc_overheat <= time || @@ -1281,13 +1281,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum("arc_beam"); - self.beam_hiteffect = particleeffectnum("arc_lightning"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1306,13 +1306,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum("arc_beam"); - self.beam_hiteffect = particleeffectnum("arc_lightning"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); + self.beam_hiteffect = particleeffectnum(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("grenadelauncher_muzzleflash"); + self.beam_muzzleeffect = -1; // particleeffectnum(EFFECT_GRENADE_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1332,13 +1332,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum("arc_beam_heal"); - self.beam_hiteffect = particleeffectnum("arc_beam_healimpact"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1358,13 +1358,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum("arc_beam"); - self.beam_hiteffect = particleeffectnum("arc_lightning"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 50; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 0; @@ -1384,13 +1384,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum("arc_beam"); - self.beam_hiteffect = particleeffectnum("arc_lightning"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1410,13 +1410,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum("arc_beam"); - self.beam_hiteffect = particleeffectnum("arc_lightning"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1436,13 +1436,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum("arc_beam_heal"); - self.beam_hiteffect = particleeffectnum("healray_impact"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1462,13 +1462,13 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum("arc_beam"); - self.beam_hiteffect = particleeffectnum("arc_lightning"); + self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); + self.beam_hiteffect = particleeffectnum(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("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; @@ -1496,7 +1496,7 @@ void Ent_ReadArcBeam(float isnew) self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum("nex_muzzleflash"); + self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; diff --git a/qcsrc/common/weapons/w_blaster.qc b/qcsrc/common/weapons/w_blaster.qc index 23cb071ea..6234f4a3e 100644 --- a/qcsrc/common/weapons/w_blaster.qc +++ b/qcsrc/common/weapons/w_blaster.qc @@ -96,7 +96,7 @@ void W_Blaster_Attack( vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD); W_SetupShot_Dir(self, s_forward, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_B, atk_damage); - Send_Effect("laser_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); entity missile = spawn(); missile.owner = missile.realowner = self; @@ -275,7 +275,7 @@ bool W_Blaster(int request) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); } return true; } diff --git a/qcsrc/common/weapons/w_crylink.qc b/qcsrc/common/weapons/w_crylink.qc index 3c13a91db..08deaf78c 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -258,7 +258,7 @@ void W_Crylink_LinkJoinEffect_Think(void) e.projectiledeathtype, other ); - Send_Effect("crylink_joinexplode", self.origin, '0 0 0', n); + Send_Effect(EFFECT_CRYLINK_JOINEXPLODE, self.origin, '0 0 0', n); } } } @@ -360,7 +360,7 @@ void W_Crylink_Attack(void) up = v_up; shots = WEP_CVAR_PRI(crylink, shots); - Send_Effect("crylink_muzzleflash", w_shotorg, w_shotdir * 1000, shots); + Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots); proj = prevproj = firstproj = world; for(counter = 0; counter < shots; ++counter) { @@ -469,7 +469,7 @@ void W_Crylink_Attack2(void) up = v_up; shots = WEP_CVAR_SEC(crylink, shots); - Send_Effect("crylink_muzzleflash", w_shotorg, w_shotdir * 1000, shots); + Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots); proj = prevproj = firstproj = world; for(counter = 0; counter < shots; ++counter) { @@ -700,13 +700,13 @@ bool W_Crylink(int req) org2 = w_org + w_backoff * 2; if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT2), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("crylink_impact2"), VOL_BASE, ATTN_NORM); } else { - pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("crylink_impact"), VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index fc4e2c3e0..9a235bf35 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -293,7 +293,7 @@ void W_Devastator_Think(void) if(!self.count) { - Send_Effect("rocket_guide", self.origin, self.velocity, 1); + Send_Effect(EFFECT_ROCKET_GUIDE, self.origin, self.velocity, 1); // TODO add a better sound here sound(self.realowner, CH_WEAPON_B, W_Sound("rocket_mode"), VOL_BASE, ATTN_NORM); self.count = 1; @@ -343,7 +343,7 @@ void W_Devastator_Attack(void) W_DecreaseAmmo(WEP_CVAR(devastator, ammo)); W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 5, W_Sound("rocket_fire"), CH_WEAPON_A, WEP_CVAR(devastator, damage)); - Send_Effect("rocketlauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); missile = WarpZone_RefSys_SpawnSameRefSys(self); missile.owner = missile.realowner = self; @@ -664,7 +664,7 @@ bool W_Devastator(int req) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/w_electro.qc b/qcsrc/common/weapons/w_electro.qc index bfe6edc32..0f60fd29d 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -260,7 +260,7 @@ void W_Electro_Attack_Bolt(void) WEP_CVAR_PRI(electro, damage) ); - Send_Effect("electro_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); proj = spawn(); proj.classname = "electro_bolt"; @@ -360,7 +360,7 @@ void W_Electro_Attack_Orb(void) w_shotdir = v_forward; // no TrueAim for grenades please - Send_Effect("electro_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); entity proj = spawn(); proj.classname = "electro_orb"; @@ -580,7 +580,7 @@ bool W_Electro(int req) org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); } @@ -589,13 +589,13 @@ bool W_Electro(int req) 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("electro_combo"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("electro_impact_combo"), VOL_BASE, ATTEN_NORM); } else { - pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); } diff --git a/qcsrc/common/weapons/w_fireball.qc b/qcsrc/common/weapons/w_fireball.qc index 5f426086f..4f8f3787c 100644 --- a/qcsrc/common/weapons/w_fireball.qc +++ b/qcsrc/common/weapons/w_fireball.qc @@ -100,7 +100,7 @@ void W_Fireball_Explode(void) accuracy_add(self.realowner, WEP_FIREBALL.m_id, 0, WEP_CVAR_PRI(fireball, bfgdamage) * points); Damage(e, self, self.realowner, WEP_CVAR_PRI(fireball, bfgdamage) * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, WEP_CVAR_PRI(fireball, bfgforce) * dir); - Send_Effect("fireball_bfgdamage", e.origin, -1 * dir, 1); + Send_Effect(EFFECT_FIREBALL_BFGDAMAGE, e.origin, -1 * dir, 1); } } @@ -142,8 +142,8 @@ void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage, d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, self.origin) - RandomSelection_chosen_ent.fireball_impactvec); d = damage + (edgedamage - damage) * (d / dist); Fire_AddDamage(RandomSelection_chosen_ent, self.realowner, d * burntime, burntime, self.projectiledeathtype | HITTYPE_BOUNCE); - //trailparticles(self, particleeffectnum("fireball_laser"), self.origin, RandomSelection_chosen_ent.fireball_impactvec); - Send_Effect("fireball_laser", self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1); + //trailparticles(self, particleeffectnum(EFFECT_FIREBALL_LASER), self.origin, RandomSelection_chosen_ent.fireball_impactvec); + Send_Effect(EFFECT_FIREBALL_LASER, self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1); } } @@ -184,7 +184,7 @@ void W_Fireball_Attack1(void) W_SetupShot_ProjectileSize(self, '-16 -16 -16', '16 16 16', false, 2, W_Sound("fireball_fire2"), CH_WEAPON_A, WEP_CVAR_PRI(fireball, damage) + WEP_CVAR_PRI(fireball, bfgdamage)); - Send_Effect("fireball_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); proj = spawn(); proj.classname = "plasma_prim"; @@ -221,7 +221,7 @@ void W_Fireball_AttackEffect(float i, vector f_diff) { 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; - Send_Effect("fireball_preattack_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); } void W_Fireball_Attack1_Frame4(void) @@ -320,7 +320,7 @@ void W_Fireball_Attack2(void) traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self); w_shotorg = trace_endpos; - Send_Effect("fireball_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_FIREBALL_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); proj = spawn(); proj.owner = proj.realowner = self; @@ -462,7 +462,7 @@ bool W_Fireball(int req) else { org2 = w_org + w_backoff * 16; - pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_FIREBALL_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM * 0.25); // long range boom } diff --git a/qcsrc/common/weapons/w_hagar.qc b/qcsrc/common/weapons/w_hagar.qc index 7856d0603..4f1b90584 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -114,7 +114,7 @@ void W_Hagar_Touch2(void) self.use(); } else { self.cnt++; - Send_Effect("hagar_bounce", self.origin, self.velocity, 1); + Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1); self.angles = vectoangles(self.velocity); self.owner = world; self.projectiledeathtype |= HITTYPE_BOUNCE; @@ -129,7 +129,7 @@ void W_Hagar_Attack(void) W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage)); - Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); missile = spawn(); missile.owner = missile.realowner = self; @@ -172,7 +172,7 @@ void W_Hagar_Attack2(void) W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage)); - Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); missile = spawn(); missile.owner = missile.realowner = self; @@ -224,7 +224,7 @@ void W_Hagar_Attack2_Load_Release(void) weapon_prepareattack_do(1, WEP_CVAR_SEC(hagar, refire)); W_SetupShot(self, false, 2, W_Sound("hagar_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage)); - Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); forward = v_forward; right = v_right; @@ -533,7 +533,7 @@ bool W_Hagar(int req) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) { if(w_random<0.15) diff --git a/qcsrc/common/weapons/w_hlac.qc b/qcsrc/common/weapons/w_hlac.qc index ebcd5d2f1..49685296a 100644 --- a/qcsrc/common/weapons/w_hlac.qc +++ b/qcsrc/common/weapons/w_hlac.qc @@ -78,7 +78,7 @@ void W_HLAC_Attack(void) spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod); W_SetupShot(self, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage)); - Send_Effect("laser_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); if(!autocvar_g_norecoil) { self.punchangle_x = random() - 0.5; @@ -126,7 +126,7 @@ void W_HLAC_Attack2(void) spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod); W_SetupShot(self, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage)); - Send_Effect("laser_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); missile = spawn(); missile.owner = missile.realowner = self; @@ -291,7 +291,7 @@ bool W_HLAC(int req) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/w_hmg.qc b/qcsrc/common/weapons/w_hmg.qc index 3af3a4864..52b60e83b 100644 --- a/qcsrc/common/weapons/w_hmg.qc +++ b/qcsrc/common/weapons/w_hmg.qc @@ -74,7 +74,7 @@ void W_HeavyMachineGun_Attack_Auto() self.misc_bulletcounter = self.misc_bulletcounter + 1; - Send_Effect("uzi_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); W_MachineGun_MuzzleFlash(); W_AttachToShotorg(self.muzzle_flash, '5 0 0'); @@ -178,7 +178,7 @@ bool W_HeavyMachineGun(int req) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_NORM); diff --git a/qcsrc/common/weapons/w_hook.qc b/qcsrc/common/weapons/w_hook.qc index 068805cf3..6c5519e60 100644 --- a/qcsrc/common/weapons/w_hook.qc +++ b/qcsrc/common/weapons/w_hook.qc @@ -345,7 +345,7 @@ bool W_Hook(int req) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_HOOK_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("hookbomb_impact"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index cb87ad072..da1eb33a6 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -119,7 +119,7 @@ void W_MachineGun_Attack(int deathtype) 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); - Send_Effect("uzi_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); W_MachineGun_MuzzleFlash(); W_AttachToShotorg(self.muzzle_flash, '5 0 0'); @@ -192,7 +192,7 @@ void W_MachineGun_Attack_Auto(void) self.misc_bulletcounter = self.misc_bulletcounter + 1; - Send_Effect("uzi_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); W_MachineGun_MuzzleFlash(); W_AttachToShotorg(self.muzzle_flash, '5 0 0'); @@ -215,7 +215,7 @@ void W_MachineGun_Attack_Burst(void) 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.m_id, 0); - Send_Effect("uzi_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); W_MachineGun_MuzzleFlash(); W_AttachToShotorg(self.muzzle_flash, '5 0 0'); @@ -378,7 +378,7 @@ bool W_MachineGun(int req) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index d8f0a48e3..8048957bc 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -328,7 +328,7 @@ void W_MineLayer_Attack(void) W_DecreaseAmmo(WEP_CVAR(minelayer, ammo)); W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, W_Sound("mine_fire"), CH_WEAPON_A, WEP_CVAR(minelayer, damage)); - Send_Effect("rocketlauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); mine = WarpZone_RefSys_SpawnSameRefSys(self); mine.owner = mine.realowner = self; @@ -600,7 +600,7 @@ bool W_MineLayer(int req) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("mine_exp"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/w_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index 64bd3d97c..850a6c342 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -151,7 +151,7 @@ void W_Mortar_Grenade_Touch1(void) spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM); else spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM); - Send_Effect("hagar_bounce", self.origin, self.velocity, 1); + Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1); self.projectiledeathtype |= HITTYPE_BOUNCE; self.gl_bouncecnt += 1; } @@ -196,7 +196,7 @@ void W_Mortar_Grenade_Touch2(void) spamsound(self, CH_SHOTS, W_Sound("grenade_bounce5"), VOL_BASE, ATTN_NORM); else spamsound(self, CH_SHOTS, W_Sound("grenade_bounce6"), VOL_BASE, ATTN_NORM); - Send_Effect("hagar_bounce", self.origin, self.velocity, 1); + Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1); self.projectiledeathtype |= HITTYPE_BOUNCE; self.gl_bouncecnt += 1; @@ -231,7 +231,7 @@ void W_Mortar_Attack(void) W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage)); w_shotdir = v_forward; // no TrueAim for grenades please - Send_Effect("grenadelauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); gren = spawn(); gren.owner = gren.realowner = self; @@ -280,7 +280,7 @@ void W_Mortar_Attack2(void) W_SetupShot_ProjectileSize(self, '-3 -3 -3', '3 3 3', false, 4, W_Sound("grenade_fire"), CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage)); w_shotdir = v_forward; // no TrueAim for grenades please - Send_Effect("grenadelauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); gren = spawn(); gren.owner = gren.realowner = self; @@ -468,7 +468,7 @@ bool W_Mortar(int req) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/w_porto.qc b/qcsrc/common/weapons/w_porto.qc index fb6cc4d5f..2d08c0fcf 100644 --- a/qcsrc/common/weapons/w_porto.qc +++ b/qcsrc/common/weapons/w_porto.qc @@ -243,7 +243,7 @@ void W_Porto_Attack(float type) w_shotdir = v_forward; w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward; - //Send_Effect("grenadelauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + //Send_Effect(EFFECT_GRENADE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); gren = spawn(); gren.cnt = type; diff --git a/qcsrc/common/weapons/w_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index 640dae397..ef3babd87 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -59,7 +59,7 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolid W_SetupShot(self, true, 2, pSound, CH_WEAPON_A, pDamage * pShots); - Send_Effect("rifle_muzzleflash", w_shotorg, w_shotdir * 2000, 1); + Send_Effect(EFFECT_RIFLE_MUZZLEFLASH, w_shotorg, w_shotdir * 2000, 1); if(self.BUTTON_ZOOM | self.BUTTON_ZOOMSCRIPT) // if zoomed, shoot from the eye { @@ -273,7 +273,7 @@ bool W_Rifle(int req) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_RIFLE_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) { if(w_random < 0.2) diff --git a/qcsrc/common/weapons/w_rpc.qc b/qcsrc/common/weapons/w_rpc.qc index de051d987..8a34490e2 100644 --- a/qcsrc/common/weapons/w_rpc.qc +++ b/qcsrc/common/weapons/w_rpc.qc @@ -109,7 +109,7 @@ void W_RocketPropelledChainsaw_Attack (void) W_DecreaseAmmo(WEP_CVAR(rpc, ammo)); W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', false, 5, W_Sound("rocket_fire"), CH_WEAPON_A, WEP_CVAR(rpc, damage)); - Send_Effect("rocketlauncher_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); PROJECTILE_MAKETRIGGER(missile); missile.owner = missile.realowner = self; @@ -241,7 +241,7 @@ bool W_RocketPropelledChainsaw(int req) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); diff --git a/qcsrc/common/weapons/w_seeker.qc b/qcsrc/common/weapons/w_seeker.qc index 71938bfcc..69c4974de 100644 --- a/qcsrc/common/weapons/w_seeker.qc +++ b/qcsrc/common/weapons/w_seeker.qc @@ -252,7 +252,7 @@ void W_Seeker_Fire_Missile(vector f_diff, entity m_target) makevectors(self.v_angle); W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, W_Sound("seeker_fire"), CH_WEAPON_A, 0); w_shotorg += f_diff; - Send_Effect("seeker_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_SEEKER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); //self.detornator = false; @@ -344,7 +344,7 @@ void W_Seeker_Fire_Flac(void) W_SetupShot_ProjectileSize(self, '-2 -2 -2', '2 2 2', false, 2, W_Sound("flac_fire"), CH_WEAPON_A, WEP_CVAR(seeker, flac_damage)); w_shotorg += f_diff; - Send_Effect("hagar_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); missile = spawn(); missile.owner = missile.realowner = self; @@ -743,7 +743,7 @@ bool W_Seeker(int req) } else { - pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) { if(w_random<0.15) @@ -757,7 +757,7 @@ bool W_Seeker(int req) } else { - pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) { if(w_random<0.15) diff --git a/qcsrc/common/weapons/w_shockwave.qc b/qcsrc/common/weapons/w_shockwave.qc index f0e832f2b..3287ea3cb 100644 --- a/qcsrc/common/weapons/w_shockwave.qc +++ b/qcsrc/common/weapons/w_shockwave.qc @@ -874,7 +874,7 @@ bool W_Shockwave(int req) // handled by Net_ReadShockwaveParticle //vector org2; //org2 = w_org + w_backoff * 2; - //pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); + //pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); return false; } case WR_INIT: diff --git a/qcsrc/common/weapons/w_shotgun.qc b/qcsrc/common/weapons/w_shotgun.qc index 1c20423df..9024bbfa1 100644 --- a/qcsrc/common/weapons/w_shotgun.qc +++ b/qcsrc/common/weapons/w_shotgun.qc @@ -65,7 +65,7 @@ void W_Shotgun_Attack(float isprimary) 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.m_id, 0); - Send_Effect("shotgun_muzzleflash", w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo)); + Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo)); // casing code if(autocvar_g_casings >= 1) @@ -359,7 +359,7 @@ float W_Shotgun(float req) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum("shotgun_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_SHOTGUN_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent && time - self.prevric > 0.25) { if(w_random < 0.0165) diff --git a/qcsrc/common/weapons/w_tuba.qc b/qcsrc/common/weapons/w_tuba.qc index bd9dff50e..686c89ec3 100644 --- a/qcsrc/common/weapons/w_tuba.qc +++ b/qcsrc/common/weapons/w_tuba.qc @@ -363,7 +363,7 @@ void W_Tuba_NoteOn(float hittype) o = gettaginfo(self.exteriorweaponentity, 0); if(time > self.tuba_smoketime) { - Send_Effect("smoke_ring", o + v_up * 45 + v_right * -6 + v_forward * 8, v_up * 100, 1); + Send_Effect(EFFECT_SMOKE_RING, o + v_up * 45 + v_right * -6 + v_forward * 8, v_up * 100, 1); self.tuba_smoketime = time + 0.25; } } @@ -454,7 +454,7 @@ bool W_Tuba(int req) break; } W_SetupShot(self, false, 0, "", 0, 0); - Send_Effect("teleport", w_shotorg, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, w_shotorg, '0 0 0', 1); self.weaponentity.state = WS_INUSE; weapon_thinkf(WFRAME_RELOAD, 0.5, w_ready); } diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index c5dd7826b..f61960594 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -76,7 +76,7 @@ void W_Vaporizer_Attack(void) self.vaporizer_lasthit = damage_goodhits; - Send_Effect("nex_muzzleflash", w_shotorg, w_shotdir * 1000, 1); + Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1); // teamcolor / hit beam effect vector v; @@ -85,33 +85,33 @@ void W_Vaporizer_Attack(void) { case NUM_TEAM_1: // Red if(damage_goodhits) - Send_Effect("TE_TEI_G3RED_HIT", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_RED_HIT, w_shotorg, v, 1); else - Send_Effect("TE_TEI_G3RED", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_RED, w_shotorg, v, 1); break; case NUM_TEAM_2: // Blue if(damage_goodhits) - Send_Effect("TE_TEI_G3BLUE_HIT", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_BLUE_HIT, w_shotorg, v, 1); else - Send_Effect("TE_TEI_G3BLUE", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_BLUE, w_shotorg, v, 1); break; case NUM_TEAM_3: // Yellow if(damage_goodhits) - Send_Effect("TE_TEI_G3YELLOW_HIT", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_YELLOW_HIT, w_shotorg, v, 1); else - Send_Effect("TE_TEI_G3YELLOW", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_YELLOW, w_shotorg, v, 1); break; case NUM_TEAM_4: // Pink if(damage_goodhits) - Send_Effect("TE_TEI_G3PINK_HIT", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_PINK_HIT, w_shotorg, v, 1); else - Send_Effect("TE_TEI_G3PINK", w_shotorg, v, 1); + Send_Effect(EFFECT_VAPORIZER_PINK, w_shotorg, v, 1); break; default: if(damage_goodhits) - Send_Effect("TE_TEI_G3_HIT", w_shotorg, v, 1); + Send_Effect_("TE_TEI_G3_HIT", w_shotorg, v, 1); else - Send_Effect("TE_TEI_G3", w_shotorg, v, 1); + Send_Effect_("TE_TEI_G3", w_shotorg, v, 1); break; } @@ -266,12 +266,12 @@ float W_Vaporizer(float req) org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); + pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); } } else { - pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTN_NORM); } } return true; diff --git a/qcsrc/common/weapons/w_vortex.qc b/qcsrc/common/weapons/w_vortex.qc index d47cebde4..3aa17e526 100644 --- a/qcsrc/common/weapons/w_vortex.qc +++ b/qcsrc/common/weapons/w_vortex.qc @@ -327,7 +327,7 @@ bool W_Vortex(int req) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); + pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTN_NORM); diff --git a/qcsrc/dpdefs/csprogsdefs.qh b/qcsrc/dpdefs/csprogsdefs.qh index b42292c85..f48df8e5c 100644 --- a/qcsrc/dpdefs/csprogsdefs.qh +++ b/qcsrc/dpdefs/csprogsdefs.qh @@ -10,6 +10,8 @@ #define spawn _spawn +#define particleeffectnum _particleeffectnum + #include "upstream/csprogsdefs.qc" #undef true @@ -19,6 +21,8 @@ #undef spawn +#undef particleeffectnum + #pragma noref 0 #define ReadFloat() ReadCoord() diff --git a/qcsrc/dpdefs/dpextensions.qh b/qcsrc/dpdefs/dpextensions.qh index 2487da4ff..7b437082f 100644 --- a/qcsrc/dpdefs/dpextensions.qh +++ b/qcsrc/dpdefs/dpextensions.qh @@ -3,13 +3,16 @@ #pragma noref 1 +#define particleeffectnum __particleeffectnum + #include "upstream/dpextensions.qc" +#undef particleeffectnum + int(entity ent, string tagname) _gettagindex = #451; #define gettagindex _gettagindex int(string effectname) _particleeffectnum = #335; -#define particleeffectnum _particleeffectnum int(string s, string separator1, ...) _tokenizebyseparator = #479; #define tokenizebyseparator _tokenizebyseparator diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index b193c4d6c..4d5821c81 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -282,7 +282,7 @@ float CheatImpulse(float i) else e = self; - Send_Effect("rocket_explode", e.origin, '0 0 0', 1); + Send_Effect(EFFECT_ROCKET_EXPLODE, e.origin, '0 0 0', 1); sound(e, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); e2 = spawn(); @@ -326,7 +326,7 @@ float CheatCommand(float argc) start = (1-f) * self.origin + f * trace_endpos; end = stov(argv(3)); f = stof(argv(4)); - Send_Effect(argv(1), start, end, f); + Send_Effect_(argv(1), start, end, f); DID_CHEAT(); break; } @@ -338,7 +338,7 @@ float CheatCommand(float argc) { // arguments: // effectname - effectnum = particleeffectnum(argv(1)); + 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); diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 6577347ee..bb3d76e1f 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -190,7 +190,7 @@ void PutObserverInServer (void) entity spot; self.hud = HUD_NORMAL; - if(IS_PLAYER(self)) { Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1); } + if(IS_PLAYER(self)) { Send_Effect(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1); } spot = SelectSpawnPoint (true); if(!spot) @@ -1306,7 +1306,7 @@ void ClientDisconnect (void) if ( self.active_minigame ) part_minigame(self); - if(IS_PLAYER(self)) { Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1); } + if(IS_PLAYER(self)) { Send_Effect(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1); } CheatShutdownClient(); @@ -1449,7 +1449,7 @@ void respawn(void) self.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed; self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3; self.effects |= CSQCMODEL_EF_RESPAWNGHOST; - Send_Effect("respawn_ghost", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_RESPAWN_GHOST, self.origin, '0 0 0', 1); if(autocvar_g_respawn_ghosts_maxtime) SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5); } diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index f0ecfb3e8..8ed9619d5 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -531,7 +531,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp if(deathtype == DEATH_KILL) { // for the lemmings fans, a small harmless explosion - Send_Effect("rocket_explode", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1); } } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 0855d41c9..08728a640 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -683,42 +683,42 @@ void GameCommand_effectindexdump(float request) d = db_create(); LOG_INFO("begin of effects list\n"); - db_put(d, "TE_GUNSHOT", "1"); LOG_INFO("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n"); - db_put(d, "TE_GUNSHOTQUAD", "1"); LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(particleeffectnum("TE_GUNSHOTQUAD")), "\n"); - db_put(d, "TE_SPIKE", "1"); LOG_INFO("effect TE_SPIKE is ", ftos(particleeffectnum("TE_SPIKE")), "\n"); - db_put(d, "TE_SPIKEQUAD", "1"); LOG_INFO("effect TE_SPIKEQUAD is ", ftos(particleeffectnum("TE_SPIKEQUAD")), "\n"); - db_put(d, "TE_SUPERSPIKE", "1"); LOG_INFO("effect TE_SUPERSPIKE is ", ftos(particleeffectnum("TE_SUPERSPIKE")), "\n"); - db_put(d, "TE_SUPERSPIKEQUAD", "1"); LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(particleeffectnum("TE_SUPERSPIKEQUAD")), "\n"); - db_put(d, "TE_WIZSPIKE", "1"); LOG_INFO("effect TE_WIZSPIKE is ", ftos(particleeffectnum("TE_WIZSPIKE")), "\n"); - db_put(d, "TE_KNIGHTSPIKE", "1"); LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(particleeffectnum("TE_KNIGHTSPIKE")), "\n"); - db_put(d, "TE_EXPLOSION", "1"); LOG_INFO("effect TE_EXPLOSION is ", ftos(particleeffectnum("TE_EXPLOSION")), "\n"); - db_put(d, "TE_EXPLOSIONQUAD", "1"); LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(particleeffectnum("TE_EXPLOSIONQUAD")), "\n"); - db_put(d, "TE_TAREXPLOSION", "1"); LOG_INFO("effect TE_TAREXPLOSION is ", ftos(particleeffectnum("TE_TAREXPLOSION")), "\n"); - db_put(d, "TE_TELEPORT", "1"); LOG_INFO("effect TE_TELEPORT is ", ftos(particleeffectnum("TE_TELEPORT")), "\n"); - db_put(d, "TE_LAVASPLASH", "1"); LOG_INFO("effect TE_LAVASPLASH is ", ftos(particleeffectnum("TE_LAVASPLASH")), "\n"); - db_put(d, "TE_SMALLFLASH", "1"); LOG_INFO("effect TE_SMALLFLASH is ", ftos(particleeffectnum("TE_SMALLFLASH")), "\n"); - db_put(d, "TE_FLAMEJET", "1"); LOG_INFO("effect TE_FLAMEJET is ", ftos(particleeffectnum("TE_FLAMEJET")), "\n"); - db_put(d, "EF_FLAME", "1"); LOG_INFO("effect EF_FLAME is ", ftos(particleeffectnum("EF_FLAME")), "\n"); - db_put(d, "TE_BLOOD", "1"); LOG_INFO("effect TE_BLOOD is ", ftos(particleeffectnum("TE_BLOOD")), "\n"); - db_put(d, "TE_SPARK", "1"); LOG_INFO("effect TE_SPARK is ", ftos(particleeffectnum("TE_SPARK")), "\n"); - db_put(d, "TE_PLASMABURN", "1"); LOG_INFO("effect TE_PLASMABURN is ", ftos(particleeffectnum("TE_PLASMABURN")), "\n"); - db_put(d, "TE_TEI_G3", "1"); LOG_INFO("effect TE_TEI_G3 is ", ftos(particleeffectnum("TE_TEI_G3")), "\n"); - db_put(d, "TE_TEI_SMOKE", "1"); LOG_INFO("effect TE_TEI_SMOKE is ", ftos(particleeffectnum("TE_TEI_SMOKE")), "\n"); - db_put(d, "TE_TEI_BIGEXPLOSION", "1"); LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n"); - db_put(d, "TE_TEI_PLASMAHIT", "1"); LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(particleeffectnum("TE_TEI_PLASMAHIT")), "\n"); - db_put(d, "EF_STARDUST", "1"); LOG_INFO("effect EF_STARDUST is ", ftos(particleeffectnum("EF_STARDUST")), "\n"); - db_put(d, "TR_ROCKET", "1"); LOG_INFO("effect TR_ROCKET is ", ftos(particleeffectnum("TR_ROCKET")), "\n"); - db_put(d, "TR_GRENADE", "1"); LOG_INFO("effect TR_GRENADE is ", ftos(particleeffectnum("TR_GRENADE")), "\n"); - db_put(d, "TR_BLOOD", "1"); LOG_INFO("effect TR_BLOOD is ", ftos(particleeffectnum("TR_BLOOD")), "\n"); - db_put(d, "TR_WIZSPIKE", "1"); LOG_INFO("effect TR_WIZSPIKE is ", ftos(particleeffectnum("TR_WIZSPIKE")), "\n"); - db_put(d, "TR_SLIGHTBLOOD", "1"); LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(particleeffectnum("TR_SLIGHTBLOOD")), "\n"); - db_put(d, "TR_KNIGHTSPIKE", "1"); LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n"); - db_put(d, "TR_VORESPIKE", "1"); LOG_INFO("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n"); - db_put(d, "TR_NEHAHRASMOKE", "1"); LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n"); - db_put(d, "TR_NEXUIZPLASMA", "1"); LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n"); - db_put(d, "TR_GLOWTRAIL", "1"); LOG_INFO("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n"); - db_put(d, "TR_SEEKER", "1"); LOG_INFO("effect TR_SEEKER is ", ftos(particleeffectnum("TR_SEEKER")), "\n"); - db_put(d, "SVC_PARTICLE", "1"); LOG_INFO("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n"); + db_put(d, "TE_GUNSHOT", "1"); LOG_INFO("effect TE_GUNSHOT is ", ftos(_particleeffectnum("TE_GUNSHOT")), "\n"); + db_put(d, "TE_GUNSHOTQUAD", "1"); LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(_particleeffectnum("TE_GUNSHOTQUAD")), "\n"); + db_put(d, "TE_SPIKE", "1"); LOG_INFO("effect TE_SPIKE is ", ftos(_particleeffectnum("TE_SPIKE")), "\n"); + db_put(d, "TE_SPIKEQUAD", "1"); LOG_INFO("effect TE_SPIKEQUAD is ", ftos(_particleeffectnum("TE_SPIKEQUAD")), "\n"); + db_put(d, "TE_SUPERSPIKE", "1"); LOG_INFO("effect TE_SUPERSPIKE is ", ftos(_particleeffectnum("TE_SUPERSPIKE")), "\n"); + db_put(d, "TE_SUPERSPIKEQUAD", "1"); LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(_particleeffectnum("TE_SUPERSPIKEQUAD")), "\n"); + db_put(d, "TE_WIZSPIKE", "1"); LOG_INFO("effect TE_WIZSPIKE is ", ftos(_particleeffectnum("TE_WIZSPIKE")), "\n"); + db_put(d, "TE_KNIGHTSPIKE", "1"); LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(_particleeffectnum("TE_KNIGHTSPIKE")), "\n"); + db_put(d, "TE_EXPLOSION", "1"); LOG_INFO("effect TE_EXPLOSION is ", ftos(_particleeffectnum("TE_EXPLOSION")), "\n"); + db_put(d, "TE_EXPLOSIONQUAD", "1"); LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(_particleeffectnum("TE_EXPLOSIONQUAD")), "\n"); + db_put(d, "TE_TAREXPLOSION", "1"); LOG_INFO("effect TE_TAREXPLOSION is ", ftos(_particleeffectnum("TE_TAREXPLOSION")), "\n"); + db_put(d, "TE_TELEPORT", "1"); LOG_INFO("effect TE_TELEPORT is ", ftos(_particleeffectnum("TE_TELEPORT")), "\n"); + db_put(d, "TE_LAVASPLASH", "1"); LOG_INFO("effect TE_LAVASPLASH is ", ftos(_particleeffectnum("TE_LAVASPLASH")), "\n"); + db_put(d, "TE_SMALLFLASH", "1"); LOG_INFO("effect TE_SMALLFLASH is ", ftos(_particleeffectnum("TE_SMALLFLASH")), "\n"); + db_put(d, "TE_FLAMEJET", "1"); LOG_INFO("effect TE_FLAMEJET is ", ftos(_particleeffectnum("TE_FLAMEJET")), "\n"); + db_put(d, "EF_FLAME", "1"); LOG_INFO("effect EF_FLAME is ", ftos(_particleeffectnum("EF_FLAME")), "\n"); + db_put(d, "TE_BLOOD", "1"); LOG_INFO("effect TE_BLOOD is ", ftos(_particleeffectnum("TE_BLOOD")), "\n"); + db_put(d, "TE_SPARK", "1"); LOG_INFO("effect TE_SPARK is ", ftos(_particleeffectnum("TE_SPARK")), "\n"); + db_put(d, "TE_PLASMABURN", "1"); LOG_INFO("effect TE_PLASMABURN is ", ftos(_particleeffectnum("TE_PLASMABURN")), "\n"); + db_put(d, "TE_TEI_G3", "1"); LOG_INFO("effect TE_TEI_G3 is ", ftos(_particleeffectnum("TE_TEI_G3")), "\n"); + db_put(d, "TE_TEI_SMOKE", "1"); LOG_INFO("effect TE_TEI_SMOKE is ", ftos(_particleeffectnum("TE_TEI_SMOKE")), "\n"); + db_put(d, "TE_TEI_BIGEXPLOSION", "1"); LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(_particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n"); + db_put(d, "TE_TEI_PLASMAHIT", "1"); LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(_particleeffectnum("TE_TEI_PLASMAHIT")), "\n"); + db_put(d, "EF_STARDUST", "1"); LOG_INFO("effect EF_STARDUST is ", ftos(_particleeffectnum("EF_STARDUST")), "\n"); + db_put(d, "TR_ROCKET", "1"); LOG_INFO("effect TR_ROCKET is ", ftos(_particleeffectnum("TR_ROCKET")), "\n"); + db_put(d, "TR_GRENADE", "1"); LOG_INFO("effect TR_GRENADE is ", ftos(_particleeffectnum("TR_GRENADE")), "\n"); + db_put(d, "TR_BLOOD", "1"); LOG_INFO("effect TR_BLOOD is ", ftos(_particleeffectnum("TR_BLOOD")), "\n"); + db_put(d, "TR_WIZSPIKE", "1"); LOG_INFO("effect TR_WIZSPIKE is ", ftos(_particleeffectnum("TR_WIZSPIKE")), "\n"); + db_put(d, "TR_SLIGHTBLOOD", "1"); LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(_particleeffectnum("TR_SLIGHTBLOOD")), "\n"); + db_put(d, "TR_KNIGHTSPIKE", "1"); LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(_particleeffectnum("TR_KNIGHTSPIKE")), "\n"); + db_put(d, "TR_VORESPIKE", "1"); LOG_INFO("effect TR_VORESPIKE is ", ftos(_particleeffectnum("TR_VORESPIKE")), "\n"); + db_put(d, "TR_NEHAHRASMOKE", "1"); LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(_particleeffectnum("TR_NEHAHRASMOKE")), "\n"); + db_put(d, "TR_NEXUIZPLASMA", "1"); LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(_particleeffectnum("TR_NEXUIZPLASMA")), "\n"); + db_put(d, "TR_GLOWTRAIL", "1"); LOG_INFO("effect TR_GLOWTRAIL is ", ftos(_particleeffectnum("TR_GLOWTRAIL")), "\n"); + db_put(d, "TR_SEEKER", "1"); LOG_INFO("effect TR_SEEKER is ", ftos(_particleeffectnum("TR_SEEKER")), "\n"); + db_put(d, "SVC_PARTICLE", "1"); LOG_INFO("effect SVC_PARTICLE is ", ftos(_particleeffectnum("SVC_PARTICLE")), "\n"); fh = fopen("effectinfo.txt", FILE_READ); while((s = fgets(fh))) @@ -728,8 +728,9 @@ void GameCommand_effectindexdump(float request) { if(db_get(d, argv(1)) != "1") { - if(particleeffectnum(argv(1)) >= 0) - LOG_INFO("effect ", argv(1), " is ", ftos(particleeffectnum(argv(1))), "\n"); + int i = _particleeffectnum(argv(1)); + if(i >= 0) + LOG_INFO("effect ", argv(1), " is ", ftos(i), "\n"); db_put(d, argv(1), "1"); } } @@ -1698,8 +1699,8 @@ void GameCommand_trace(float request, float argc) vv = stov(argv(2)); dv = stov(argv(3)); traceline(vv, dv, MOVE_NORMAL, world); - trailparticles(world, particleeffectnum("TR_NEXUIZPLASMA"), vv, trace_endpos); - trailparticles(world, particleeffectnum("TR_CRYLINKPLASMA"), trace_endpos, dv); + trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos); + trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv); return; } } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index e1b9559c3..39ad85c6d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -758,7 +758,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d { Unfreeze(targ); targ.health = autocvar_g_freezetag_revive_falldamage_health; - Send_Effect("iceorglass", targ.origin, '0 0 0', 3); + Send_Effect(EFFECT_ICEORGLASS, targ.origin, '0 0 0', 3); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname); Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF); } @@ -769,7 +769,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger) { - Send_Effect("teleport", targ.origin, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, targ.origin, '0 0 0', 1); entity oldself = self; self = targ; @@ -799,7 +799,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d self.oldorigin = self.origin; self.prevorigin = self.origin; - Send_Effect("teleport", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, self.origin, '0 0 0', 1); } self = oldself; diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 866f71f72..a9b16d002 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -90,7 +90,7 @@ void GrapplingHookReset(void) void GrapplingHookThink(); void GrapplingHook_Stop() { - Send_Effect("grapple_impact", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_HOOK_IMPACT, self.origin, '0 0 0', 1); sound (self, CH_SHOTS, W_Sound("hook_impact"), VOL_BASE, ATTEN_NORM); self.state = 1; @@ -333,7 +333,7 @@ void FireGrapplingHook (void) tracebox(self.origin + self.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, self); org = trace_endpos; - Send_Effect("grapple_muzzleflash", org, '0 0 0', 1); + Send_Effect(EFFECT_HOOK_MUZZLEFLASH, org, '0 0 0', 1); missile = WarpZone_RefSys_SpawnSameRefSys(self); missile.owner = missile.realowner = self; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index de4492ac9..15c1ae68d 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -564,7 +564,6 @@ void spawnfunc___init_dedicated_server(void) CALL_ACCUMULATED_FUNCTION(RegisterTurrets); CALL_ACCUMULATED_FUNCTION(RegisterNotifications); CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); - CALL_ACCUMULATED_FUNCTION(RegisterEffects); MapInfo_Enumerate(); MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0); @@ -612,7 +611,6 @@ void spawnfunc_worldspawn (void) CALL_ACCUMULATED_FUNCTION(RegisterTurrets); CALL_ACCUMULATED_FUNCTION(RegisterNotifications); CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); - CALL_ACCUMULATED_FUNCTION(RegisterEffects); initialize_minigames(); diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index d79e1310d..2b9cf0215 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -364,7 +364,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype) // other sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM); - WarpZone_TrailParticles(world, particleeffectnum(flag.passeffect), player.origin, targ_origin); + WarpZone_TrailParticles(world, _particleeffectnum(flag.passeffect), player.origin, targ_origin); ctf_EventLog("pass", flag.team, player); break; } @@ -455,7 +455,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype) PlayerScore_Add(player, SP_CTF_CAPTIME, new_time - old_time); // effects - Send_Effect(flag.capeffect, flag.origin, '0 0 0', 1); + Send_Effect_(flag.capeffect, flag.origin, '0 0 0', 1); //shockwave_spawn("models/ctf/shockwavetransring.md3", flag.origin - '0 0 15', -0.8, 0, 1); // other @@ -609,7 +609,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) } // effects - Send_Effect(flag.toucheffect, player.origin, '0 0 0', 1); + Send_Effect_(flag.toucheffect, player.origin, '0 0 0', 1); // waypoints if(pickuptype == PICKUP_DROPPED) { WaypointSprite_Kill(flag.wps_flagdropped); } @@ -941,7 +941,7 @@ void ctf_FlagTouch() { if(time > self.wait) // if we haven't in a while, play a sound/effect { - Send_Effect(self.toucheffect, self.origin, '0 0 0', 1); + Send_Effect_(self.toucheffect, self.origin, '0 0 0', 1); sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM); self.wait = time + FLAG_TOUCHRATE; } diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 8a2368e52..65c7ba6e5 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -47,8 +47,8 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated self.think = ka_RespawnBall; self.nextthink = time + autocvar_g_keepawayball_respawntime; - Send_Effect("electro_combo", oldballorigin, '0 0 0', 1); - Send_Effect("electro_combo", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_COMBO, self.origin, '0 0 0', 1); WaypointSprite_Spawn(WP_KaBall, 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); @@ -81,7 +81,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth if(other.frozen) { return; } if (!IS_PLAYER(other)) { // The ball just touched an object, most likely the world - Send_Effect("kaball_sparks", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_BALL_SPARKS, self.origin, '0 0 0', 1); sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTEN_NORM); return; } diff --git a/qcsrc/server/mutators/gamemode_onslaught.qc b/qcsrc/server/mutators/gamemode_onslaught.qc index a84ffa57d..33bebd04c 100644 --- a/qcsrc/server/mutators/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/gamemode_onslaught.qc @@ -377,7 +377,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag 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("sparks"), hitloc, force*-1, 1); + pointparticles(particleeffectnum(EFFECT_SPARKS), hitloc, force*-1, 1); //sound on every hit if (random() < 0.5) sound(self, CH_TRIGGER, "onslaught/ons_hit1.wav", VOL_BASE+0.3, ATTEN_NORM); @@ -387,7 +387,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag if (self.health < 0) { sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); + pointparticles(particleeffectnum(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); @@ -492,7 +492,7 @@ void ons_ControlPoint_Icon_Think() // damaged fx if(random() < 0.6 - self.health / self.max_health) { - Send_Effect("electricity_sparks", self.origin + randompos('-10 -10 -20', '10 10 20'), '0 0 0', 1); + Send_Effect(EFFECT_ELECTRIC_SPARKS, self.origin + randompos('-10 -10 -20', '10 10 20'), '0 0 0', 1); if(random() > 0.8) sound(self, CH_PAIN, "onslaught/ons_spark1.wav", VOL_BASE, ATTEN_NORM); @@ -526,7 +526,7 @@ void ons_ControlPoint_Icon_BuildThink() self.owner.iscaptured = true; self.solid = SOLID_BBOX; - Send_Effect(sprintf("%s_cap", Static_Team_ColorName_Lower(self.owner.team)), self.owner.origin, '0 0 0', 1); + Send_Effect_(sprintf("%s_cap", Static_Team_ColorName_Lower(self.owner.team)), self.owner.origin, '0 0 0', 1); WaypointSprite_UpdateMaxHealth(self.owner.sprite, self.max_health); WaypointSprite_UpdateHealth(self.owner.sprite, self.health); @@ -557,7 +557,7 @@ void ons_ControlPoint_Icon_BuildThink() setmodel_fixsize(self.owner, "models/onslaught/controlpoint_pad2.md3"); if(random() < 0.9 - self.health / self.max_health) - Send_Effect("rage", self.origin + 10 * randomvec(), '0 0 -1', 1); + Send_Effect(EFFECT_RAGE, self.origin + 10 * randomvec(), '0 0 -1', 1); } void ons_ControlPoint_Icon_Spawn(entity cp, entity player) @@ -585,7 +585,7 @@ void ons_ControlPoint_Icon_Spawn(entity cp, entity player) cp.team = e.team; cp.colormap = e.colormap; - Send_Effect(sprintf("%sflag_touch", Static_Team_ColorName_Lower(player.team)), e.origin, '0 0 0', 1); + Send_Effect_(sprintf("%sflag_touch", Static_Team_ColorName_Lower(player.team)), e.origin, '0 0 0', 1); WaypointSprite_UpdateBuildFinished(cp.sprite, time + (e.max_health - e.health) / (e.count / ONS_CP_THINKRATE)); WaypointSprite_UpdateRule(cp.sprite,cp.team,SPRITERULE_TEAMPLAY); @@ -912,7 +912,7 @@ void ons_GeneratorDamage(entity inflictor, entity attacker, float damage, int de else { // particles on every hit - Send_Effect("sparks", hitloc, force * -1, 1); + Send_Effect(EFFECT_SPARKS, hitloc, force * -1, 1); //sound on every hit if (random() < 0.5) @@ -1678,7 +1678,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe { if ( tele_effects ) { - Send_Effect("teleport", player.origin, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, player.origin, '0 0 0', 1); sound (player, CH_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTEN_NORM); } setorigin(player, loc); @@ -1688,7 +1688,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe player.teleport_antispam = time + autocvar_g_onslaught_teleport_wait; if ( tele_effects ) - Send_Effect("teleport", player.origin + v_forward * 32, '0 0 0', 1); + Send_Effect(EFFECT_TELEPORT, player.origin + v_forward * 32, '0 0 0', 1); return true; } } diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index d4bdd50d2..72bbaf16d 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -67,7 +67,7 @@ void buff_Effect(entity player, string eff) if(time >= self.buff_effect_delay) { - Send_Effect(eff, player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1); + Send_Effect_(eff, player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1); self.buff_effect_delay = time + 0.05; // prevent spam } } @@ -132,8 +132,8 @@ void buff_Respawn(entity ent) if(autocvar_g_buffs_random_lifetime > 0) ent.lifetime = time + autocvar_g_buffs_random_lifetime; - Send_Effect("electro_combo", oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1); - Send_Effect("electro_combo", CENTER_OR_VIEWOFS(ent), '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_COMBO, oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_COMBO, CENTER_OR_VIEWOFS(ent), '0 0 0', 1); WaypointSprite_Ping(ent.buff_waypoint); @@ -182,7 +182,7 @@ void buff_Touch() Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, buffid); Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid); - Send_Effect("item_pickup", CENTER_OR_VIEWOFS(self), '0 0 0', 1); + Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); sound(other, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM); other.buffs |= (self.buffs); } @@ -264,7 +264,7 @@ void buff_Think() { self.buff_active = true; sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); - Send_Effect("item_respawn", CENTER_OR_VIEWOFS(self), '0 0 0', 1); + Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1); } } @@ -651,8 +651,8 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey) closest.pushltime = time + autocvar_g_maxpushtime; closest.istypefrag = closest.BUTTON_CHAT; - Send_Effect("electro_combo", their_org, '0 0 0', 1); - Send_Effect("electro_combo", my_org, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_COMBO, their_org, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_COMBO, my_org, '0 0 0', 1); sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM); sound(closest, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM); @@ -740,7 +740,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink) if(time < self.buff_disability_time) if(time >= self.buff_disability_effect_time) { - Send_Effect("smoking", self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1); + Send_Effect(EFFECT_SMOKING, self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1); self.buff_disability_effect_time = time + 0.5; } diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index 3054c40d2..bd8cb1896 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -77,8 +77,8 @@ void napalm_damage(float dist, float damage, float edgedamage, float burntime) d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, self.origin) - RandomSelection_chosen_ent.fireball_impactvec); d = damage + (edgedamage - damage) * (d / dist); Fire_AddDamage(RandomSelection_chosen_ent, self.realowner, d * burntime, burntime, self.projectiledeathtype | HITTYPE_BOUNCE); - //trailparticles(self, particleeffectnum("fireball_laser"), self.origin, RandomSelection_chosen_ent.fireball_impactvec); - Send_Effect("fireball_laser", self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1); + //trailparticles(self, particleeffectnum(EFFECT_FIREBALL_LASER), self.origin, RandomSelection_chosen_ent.fireball_impactvec); + Send_Effect(EFFECT_FIREBALL_LASER, self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1); } } @@ -225,7 +225,7 @@ void nade_napalm_boom() void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time) { frost_target.frozen_by = freezefield.realowner; - Send_Effect("electro_impact", frost_target.origin, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_IMPACT, frost_target.origin, '0 0 0', 1); Freeze(frost_target, 1/freeze_time, 3, false); if(frost_target.ballcarried) if(g_keepaway) { ka_DropEvent(frost_target); } @@ -250,14 +250,14 @@ void nade_ice_think() { if ( autocvar_g_nades_ice_explode ) { - string expef; + entity expef = NULL; switch(self.realowner.team) { - case NUM_TEAM_1: expef = "nade_red_explode"; break; - case NUM_TEAM_2: expef = "nade_blue_explode"; break; - case NUM_TEAM_3: expef = "nade_yellow_explode"; break; - case NUM_TEAM_4: expef = "nade_pink_explode"; break; - default: expef = "nade_neutral_explode"; break; + case NUM_TEAM_1: expef = EFFECT_NADE_RED_EXPLODE; break; + case NUM_TEAM_2: expef = EFFECT_NADE_BLUE_EXPLODE; break; + case NUM_TEAM_3: expef = EFFECT_NADE_YELLOW_EXPLODE; break; + case NUM_TEAM_4: expef = EFFECT_NADE_PINK_EXPLODE; break; + default: expef = EFFECT_NADE_NEUTRAL_EXPLODE; break; } Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1); sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); @@ -284,15 +284,15 @@ void nade_ice_think() randomp.x = randomr*cos(randomw); randomp.y = randomr*sin(randomw); randomp.z = 1; - Send_Effect("electro_muzzleflash", self.origin + randomp, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, self.origin + randomp, '0 0 0', 1); if(time >= self.nade_special_time) { self.nade_special_time = time+0.7; - Send_Effect("electro_impact", self.origin, '0 0 0', 1); - Send_Effect("icefield", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_ELECTRO_IMPACT, self.origin, '0 0 0', 1); + Send_Effect(EFFECT_ICEFIELD, self.origin, '0 0 0', 1); } @@ -426,7 +426,7 @@ void nade_heal_touch() if ( other.health < maxhealth ) { if ( self.nade_show_particles ) - Send_Effect("healing_fx", other.origin, '0 0 0', 1); + Send_Effect(EFFECT_HEALING, other.origin, '0 0 0', 1); other.health = min(other.health+health_factor, maxhealth); } other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot); @@ -483,53 +483,52 @@ void nade_monster_boom() void nade_boom() { - string expef; + entity expef = NULL; bool nade_blast = true; switch ( NADES[self.nade_type] ) { case NADE_TYPE_NAPALM: nade_blast = autocvar_g_nades_napalm_blast; - expef = "explosion_medium"; + expef = EFFECT_EXPLOSION_MEDIUM; break; case NADE_TYPE_ICE: nade_blast = false; - expef = "electro_combo"; // hookbomb_explode electro_combo bigplasma_impact + expef = EFFECT_ELECTRO_COMBO; // hookbomb_explode electro_combo bigplasma_impact break; case NADE_TYPE_TRANSLOCATE: nade_blast = false; - expef = ""; break; case NADE_TYPE_MONSTER: case NADE_TYPE_SPAWN: nade_blast = false; switch(self.realowner.team) { - case NUM_TEAM_1: expef = "spawn_event_red"; break; - case NUM_TEAM_2: expef = "spawn_event_blue"; break; - case NUM_TEAM_3: expef = "spawn_event_yellow"; break; - case NUM_TEAM_4: expef = "spawn_event_pink"; break; - default: expef = "spawn_event_neutral"; break; + case NUM_TEAM_1: expef = EFFECT_SPAWN_RED; break; + case NUM_TEAM_2: expef = EFFECT_SPAWN_BLUE; break; + case NUM_TEAM_3: expef = EFFECT_SPAWN_YELLOW; break; + case NUM_TEAM_4: expef = EFFECT_SPAWN_PINK; break; + default: expef = EFFECT_SPAWN_NEUTRAL; break; } break; case NADE_TYPE_HEAL: nade_blast = false; - expef = "spawn_event_red"; + expef = EFFECT_SPAWN_RED; break; default: case NADE_TYPE_NORMAL: switch(self.realowner.team) { - case NUM_TEAM_1: expef = "nade_red_explode"; break; - case NUM_TEAM_2: expef = "nade_blue_explode"; break; - case NUM_TEAM_3: expef = "nade_yellow_explode"; break; - case NUM_TEAM_4: expef = "nade_pink_explode"; break; - default: expef = "nade_neutral_explode"; break; + case NUM_TEAM_1: expef = EFFECT_NADE_RED_EXPLODE; break; + case NUM_TEAM_2: expef = EFFECT_NADE_BLUE_EXPLODE; break; + case NUM_TEAM_3: expef = EFFECT_NADE_YELLOW_EXPLODE; break; + case NUM_TEAM_4: expef = EFFECT_NADE_PINK_EXPLODE; break; + default: expef = EFFECT_NADE_NEUTRAL_EXPLODE; break; } } - if(expef != "") + if(expef) Send_Effect(expef, findbetterlocation(self.origin, 8), '0 0 0', 1); sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); @@ -779,7 +778,7 @@ float nade_customize() { //self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; if(!self.traileffectnum) - self.traileffectnum = particleeffectnum(Nade_TrailEffect(NADES[self.nade_type].m_projectile[false], self.team)); + self.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[self.nade_type].m_projectile[false], self.team)); self.alpha = 1; } @@ -819,7 +818,7 @@ void nade_prime() //setattachment(n, self, "bip01 l hand"); n.exteriormodeltoclient = self; n.customizeentityforclient = nade_customize; - n.traileffectnum = particleeffectnum(Nade_TrailEffect(NADES[n.nade_type].m_projectile[false], self.team)); + n.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[n.nade_type].m_projectile[false], self.team)); n.colormod = NADES[n.nade_type].m_color; n.realowner = self; n.colormap = self.colormap; @@ -1120,7 +1119,7 @@ MUTATOR_HOOKFUNCTION(nades_PlayerDamage) { Unfreeze(frag_target); frag_target.health = autocvar_g_freezetag_revive_nade_health; - Send_Effect("iceorglass", frag_target.origin, '0 0 0', 3); + Send_Effect(EFFECT_ICEORGLASS, frag_target.origin, '0 0 0', 3); frag_damage = 0; frag_force = '0 0 0'; Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname); diff --git a/qcsrc/server/mutators/mutator_touchexplode.qc b/qcsrc/server/mutators/mutator_touchexplode.qc index 5ceeff34b..3c0e2706f 100644 --- a/qcsrc/server/mutators/mutator_touchexplode.qc +++ b/qcsrc/server/mutators/mutator_touchexplode.qc @@ -11,7 +11,7 @@ void PlayerTouchExplode(entity p1, entity p2) org.z += (p1.mins.z + p2.mins.z) * 0.5; sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); - Send_Effect("explosion_small", org, '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_SMALL, org, '0 0 0', 1); entity e; e = spawn(); diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 6e11abcd2..273e25e3f 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -31,7 +31,7 @@ void sandbox_ObjectFunction_Touch() intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1); sound(self, CH_TRIGGER, strcat("object/impact_", self.material, "_", ftos(ceil(random() * 5)) , ".wav"), VOL_BASE * intensity, ATTEN_NORM); - Send_Effect(strcat("impact_", self.material), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10 + Send_Effect_(strcat("impact_", self.material), self.origin, '0 0 0', ceil(intensity * 10)); // allow a count from 1 to 10 } void sandbox_ObjectFunction_Think() diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 7bb6332b0..09cd6e9d2 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -415,7 +415,7 @@ void Portal_Remove(entity portal, float killed) { fixedmakevectors(portal.mangle); sound(portal, CH_SHOTS, "porto/explode.wav", VOL_BASE, ATTEN_NORM); - Send_Effect("rocket_explode", portal.origin + v_forward * 16, v_forward * 1024, 4); + Send_Effect(EFFECT_ROCKET_EXPLODE, portal.origin + v_forward * 16, v_forward * 1024, 4); remove(portal); } else diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/steerlib.qc index 01af27552..e57d56dd1 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -498,7 +498,7 @@ vector steerlib_beamsteer(vector dir, float length, float step, float step_up, f #ifdef TLIBS_TETSLIBS void flocker_die() { - Send_Effect("rocket_explode", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1); self.owner.cnt += 1; self.owner = world; diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index f883fd9e6..858a76198 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -438,8 +438,8 @@ void Item_Respawn (void) self.think = Item_Think; self.nextthink = time; - //Send_Effect("item_respawn", self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1); - Send_Effect("item_respawn", CENTER_OR_VIEWOFS(self), '0 0 0', 1); + //Send_Effect(EFFECT_ITEM_RESPAWN, self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1); + Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1); } void Item_RespawnCountdown (void) @@ -733,7 +733,7 @@ void Item_Touch (void) other.last_pickup = time; - Send_Effect("item_pickup", CENTER_OR_VIEWOFS(self), '0 0 0', 1); + Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); sound (other, CH_TRIGGER, self.item_pickupsound, VOL_BASE, ATTEN_NORM); if (self.classname == "droppedweapon") @@ -812,7 +812,7 @@ void Item_FindTeam() // TODO: perhaps nice special effect? void RemoveItem(void) { - Send_Effect("item_pickup", CENTER_OR_VIEWOFS(self), '0 0 0', 1); + Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); remove(self); } diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index c9585d1bb..eec32a3e5 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -357,11 +357,11 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat float total_damage = 0; if(tracereffects & EF_RED) - fireBullet_trace_callback_eff = particleeffectnum("tr_rifle"); + fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE); else if(tracereffects & EF_BLUE) - fireBullet_trace_callback_eff = particleeffectnum("tr_rifle_weak"); + fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE_WEAK); else - fireBullet_trace_callback_eff = particleeffectnum("tr_bullet"); + fireBullet_trace_callback_eff = particleeffectnum(EFFECT_BULLET); float lag = ANTILAG_LATENCY(self); if(lag < 0.001) -- 2.39.2