if(f & 2)
{
- string rm_suffix = strcat("rocketminsta_laser_", Static_Team_ColorName_Lower(self.team));
- if(_particleeffectnum(rm_suffix) < 0 || Team_TeamToNumber(self.team) == -1) { rm_suffix = "TR_NEXUIZPLASMA"; }
-
self.cnt = ReadByte();
self.silent = (self.cnt & 0x80);
CASE(RPC) self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
- CASE(ROCKETMINSTA_LASER) self.traileffect = _particleeffectnum(rm_suffix); break;
+ CASE(ROCKETMINSTA_LASER) self.traileffect = particleeffectnum(EFFECT_ROCKETMINSTA_LASER(self.team)); break;
#undef CASE
default:
if(MUTATOR_CALLHOOK(Ent_Projectile, self))
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")
+entity EFFECT_VAPORIZER(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_VAPORIZER_RED;
+ case NUM_TEAM_2: return EFFECT_VAPORIZER_BLUE;
+ case NUM_TEAM_3: return EFFECT_VAPORIZER_YELLOW;
+ case NUM_TEAM_4: return EFFECT_VAPORIZER_PINK;
+ default: return EFFECT_VAPORIZER_NEUTRAL;
+ }
+}
EFFECT(0, RIFLE_IMPACT, "machinegun_impact")
EFFECT(0, RIFLE_MUZZLEFLASH, "rifle_muzzleflash")
EFFECT(0, NADE_PINK_EXPLODE, "nade_pink_explode")
EFFECT(0, NADE_NEUTRAL_EXPLODE, "nade_neutral_explode")
+EFFECT(1, NADE_TRAIL_RED, "nade_red")
+EFFECT(1, NADE_TRAIL_BLUE, "nade_blue")
+EFFECT(1, NADE_TRAIL_YELLOW, "nade_yellow")
+EFFECT(1, NADE_TRAIL_PINK, "nade_pink")
+EFFECT(1, NADE_TRAIL_NEUTRAL, "nade_neutral")
+entity EFFECT_NADE_TRAIL(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_NADE_TRAIL_RED;
+ case NUM_TEAM_2: return EFFECT_NADE_TRAIL_BLUE;
+ case NUM_TEAM_3: return EFFECT_NADE_TRAIL_YELLOW;
+ case NUM_TEAM_4: return EFFECT_NADE_TRAIL_PINK;
+ default: return EFFECT_NADE_TRAIL_NEUTRAL;
+ }
+}
+
+EFFECT(1, NADE_TRAIL_BURN_RED, "nade_red_burn")
+EFFECT(1, NADE_TRAIL_BURN_BLUE, "nade_blue_burn")
+EFFECT(1, NADE_TRAIL_BURN_YELLOW, "nade_yellow_burn")
+EFFECT(1, NADE_TRAIL_BURN_PINK, "nade_pink_burn")
+EFFECT(1, NADE_TRAIL_BURN_NEUTRAL, "nade_neutral_burn")
+entity EFFECT_NADE_TRAIL_BURN(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_NADE_TRAIL_BURN_RED;
+ case NUM_TEAM_2: return EFFECT_NADE_TRAIL_BURN_BLUE;
+ case NUM_TEAM_3: return EFFECT_NADE_TRAIL_BURN_YELLOW;
+ case NUM_TEAM_4: return EFFECT_NADE_TRAIL_BURN_PINK;
+ default: return EFFECT_NADE_TRAIL_BURN_NEUTRAL;
+ }
+}
+
EFFECT(0, ICEORGLASS, "iceorglass")
EFFECT(0, ICEFIELD, "icefield")
EFFECT(0, FIREFIELD, "firefield")
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(0, FLAG_TOUCH_RED, "redflag_touch")
+EFFECT(0, FLAG_TOUCH_BLUE, "blueflag_touch")
+EFFECT(0, FLAG_TOUCH_YELLOW, "yellowflag_touch")
+EFFECT(0, FLAG_TOUCH_PINK, "pinkflag_touch")
+EFFECT(0, FLAG_TOUCH_NEUTRAL, "neutralflag_touch")
+entity EFFECT_FLAG_TOUCH(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_FLAG_TOUCH_RED;
+ case NUM_TEAM_2: return EFFECT_FLAG_TOUCH_BLUE;
+ case NUM_TEAM_3: return EFFECT_FLAG_TOUCH_YELLOW;
+ case NUM_TEAM_4: return EFFECT_FLAG_TOUCH_PINK;
+ default: return EFFECT_FLAG_TOUCH_NEUTRAL;
+ }
+}
+
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, CAP_RED, "red_cap")
+EFFECT(0, CAP_BLUE, "blue_cap")
+EFFECT(0, CAP_YELLOW, "yellow_cap")
+EFFECT(0, CAP_PINK, "pink_cap")
+EFFECT(0, CAP_NEUTRAL, "neutral_cap")
+entity EFFECT_CAP(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_CAP_RED;
+ case NUM_TEAM_2: return EFFECT_CAP_BLUE;
+ case NUM_TEAM_3: return EFFECT_CAP_YELLOW;
+ case NUM_TEAM_4: return EFFECT_CAP_PINK;
+ default: return EFFECT_CAP_NEUTRAL;
+ }
+}
EFFECT(0, ITEM_PICKUP, "item_pickup")
EFFECT(0, ITEM_RESPAWN, "item_respawn")
EFFECT(1, TR_KNIGHTSPIKE, "TR_KNIGHTSPIKE")
EFFECT(1, TR_VORESPIKE, "TR_VORESPIKE")
EFFECT(0, TE_SPARK, "TE_SPARK")
+
+EFFECT(1, ROCKETMINSTA_LASER_RED, "rocketminsta_laser_red")
+EFFECT(1, ROCKETMINSTA_LASER_BLUE, "rocketminsta_laser_blue")
+EFFECT(1, ROCKETMINSTA_LASER_YELLOW, "rocketminsta_laser_yellow")
+EFFECT(1, ROCKETMINSTA_LASER_PINK, "rocketminsta_laser_pink")
+EFFECT(1, ROCKETMINSTA_LASER_NEUTRAL, "rocketminsta_laser_neutral")
+entity EFFECT_ROCKETMINSTA_LASER(int teamid)
+{
+ entity e;
+ switch (teamid) {
+ case NUM_TEAM_1: e = EFFECT_ROCKETMINSTA_LASER_RED; break;
+ case NUM_TEAM_2: e = EFFECT_ROCKETMINSTA_LASER_BLUE; break;
+ case NUM_TEAM_3: e = EFFECT_ROCKETMINSTA_LASER_YELLOW; break;
+ case NUM_TEAM_4: e = EFFECT_ROCKETMINSTA_LASER_PINK; break;
+ default: e = EFFECT_ROCKETMINSTA_LASER_NEUTRAL; break;
+ }
+ if (particleeffectnum(e) < 0 || Team_TeamToNumber(teamid) == -1) { e = EFFECT_TR_NEXUIZPLASMA; }
+ return e;
+}
));
switch (proj)
{
- case PROJECTILE_NADE: return strcat("nade_", Static_Team_ColorName_Lower(nade_team));
- case PROJECTILE_NADE_BURN: return strcat("nade_", Static_Team_ColorName_Lower(nade_team), "_burn");
+ case PROJECTILE_NADE: return EFFECT_NADE_TRAIL(nade_team).eent_eff_name;
+ case PROJECTILE_NADE_BURN: return EFFECT_NADE_TRAIL_BURN(nade_team).eent_eff_name;
}
return "";
}
SOUND(CTF_CAPTURE_BLUE, "ctf/blue_capture.wav");
SOUND(CTF_CAPTURE_YELLOW, "ctf/yellow_capture.ogg");
SOUND(CTF_CAPTURE_PINK, "ctf/pink_capture.ogg");
-Sound SND_CTF_CAPTURE(string teamname) {
- switch (teamname) {
- case "red": return SND_CTF_CAPTURE_RED;
- case "blue": return SND_CTF_CAPTURE_BLUE;
- case "yellow": return SND_CTF_CAPTURE_YELLOW;
- case "pink": return SND_CTF_CAPTURE_PINK;
+Sound SND_CTF_CAPTURE(int teamid) {
+ switch (teamid) {
+ case NUM_TEAM_1: return SND_CTF_CAPTURE_RED;
+ case NUM_TEAM_2: return SND_CTF_CAPTURE_BLUE;
+ case NUM_TEAM_3: return SND_CTF_CAPTURE_YELLOW;
+ case NUM_TEAM_4: return SND_CTF_CAPTURE_PINK;
+ default: return SND_CTF_CAPTURE_NEUTRAL;
}
- return SND_CTF_CAPTURE_NEUTRAL;
}
SOUND(CTF_DROPPED_NEUTRAL, "ctf/neutral_dropped.wav");
SOUND(CTF_DROPPED_BLUE, "ctf/blue_dropped.wav");
SOUND(CTF_DROPPED_YELLOW, "ctf/yellow_dropped.wav");
SOUND(CTF_DROPPED_PINK, "ctf/pink_dropped.wav");
-Sound SND_CTF_DROPPED(string teamname) {
- switch (teamname) {
- case "red": return SND_CTF_DROPPED_RED;
- case "blue": return SND_CTF_DROPPED_BLUE;
- case "yellow": return SND_CTF_DROPPED_YELLOW;
- case "pink": return SND_CTF_DROPPED_PINK;
- default: return SND_CTF_DROPPED_NEUTRAL;
+Sound SND_CTF_DROPPED(int teamid) {
+ switch (teamid) {
+ case NUM_TEAM_1: return SND_CTF_DROPPED_RED;
+ case NUM_TEAM_2: return SND_CTF_DROPPED_BLUE;
+ case NUM_TEAM_3: return SND_CTF_DROPPED_YELLOW;
+ case NUM_TEAM_4: return SND_CTF_DROPPED_PINK;
+ default: return SND_CTF_DROPPED_NEUTRAL;
}
}
SOUND(CTF_RETURNED_BLUE, "ctf/blue_returned.wav");
SOUND(CTF_RETURNED_YELLOW, "ctf/yellow_returned.wav");
SOUND(CTF_RETURNED_PINK, "ctf/pink_returned.wav");
-Sound SND_CTF_RETURNED(string teamname) {
- switch (teamname) {
- case "red": return SND_CTF_RETURNED_RED;
- case "blue": return SND_CTF_RETURNED_BLUE;
- case "yellow": return SND_CTF_RETURNED_YELLOW;
- case "pink": return SND_CTF_RETURNED_PINK;
- default: return SND_CTF_RETURNED_NEUTRAL;
+Sound SND_CTF_RETURNED(int teamid) {
+ switch (teamid) {
+ case NUM_TEAM_1: return SND_CTF_RETURNED_RED;
+ case NUM_TEAM_2: return SND_CTF_RETURNED_BLUE;
+ case NUM_TEAM_3: return SND_CTF_RETURNED_YELLOW;
+ case NUM_TEAM_4: return SND_CTF_RETURNED_PINK;
+ default: return SND_CTF_RETURNED_NEUTRAL;
}
}
SOUND(CTF_TAKEN_BLUE, "ctf/blue_taken.wav");
SOUND(CTF_TAKEN_YELLOW, "ctf/yellow_taken.wav");
SOUND(CTF_TAKEN_PINK, "ctf/pink_taken.wav");
-Sound SND_CTF_TAKEN(string teamname) {
- switch (teamname) {
- case "red": return SND_CTF_TAKEN_RED;
- case "blue": return SND_CTF_TAKEN_BLUE;
- case "yellow": return SND_CTF_TAKEN_YELLOW;
- case "pink": return SND_CTF_TAKEN_PINK;
- default: return SND_CTF_TAKEN_NEUTRAL;
+Sound SND_CTF_TAKEN(int teamid) {
+ switch (teamid) {
+ case NUM_TEAM_1: return SND_CTF_TAKEN_RED;
+ case NUM_TEAM_2: return SND_CTF_TAKEN_BLUE;
+ case NUM_TEAM_3: return SND_CTF_TAKEN_YELLOW;
+ case NUM_TEAM_4: return SND_CTF_TAKEN_PINK;
+ default: return SND_CTF_TAKEN_NEUTRAL;
}
}
#ifndef SOUNDS_H
#define SOUNDS_H
+#include "../teams.qh"
+
// Play all sounds via sound7, for access to the extra channels.
// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
#ifdef SVQC
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) : ""));
-
- WarpZone_TrailParticles(world, _particleeffectnum(s), self.tur_shotorg, v);
-
+ vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+ WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
if (self.tur_head.frame == 0)
self.tur_head.frame = 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(EFFECT_VAPORIZER_NEUTRAL.eent_eff_name, ((self.team) ? Static_Team_ColorName_Upper(self.team) : ""));
-
- WarpZone_TrailParticles(world, _particleeffectnum(s), self.tur_shotorg, v);
-
+ vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+ WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
self.tur_head.frame += 1;
}
else
{
if(teamplay)
{
- string s;
- s = Static_Team_ColorName_Lower(self.team);
- if(s != "neutral")
+ string s = Static_Team_ColorName_Lower(self.team);
+ if (s != "neutral")
{
defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
defaultskin = cvar(strcat("sv_defaultplayerskin_", s));
void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
{SELFPARAM();
// declarations
- string teamname = Static_Team_ColorName_Lower(teamnumber);
setself(flag); // for later usage with droptofloor()
// main setup
flag.nextthink = time + FLAG_THINKRATE;
flag.ctf_status = FLAG_BASE;
+ string teamname = Static_Team_ColorName_Lower(teamnumber);
// appearence
if(!flag.scale) { flag.scale = FLAG_SCALE; }
if(flag.skin == 0) { flag.skin = cvar(sprintf("g_ctf_flag_%s_skin", teamname)); }
set_flag_string(flag, capeffect, "%s_cap", teamname);
// sounds
- flag.snd_flag_taken = SND(CTF_TAKEN(teamname));
- flag.snd_flag_returned = SND(CTF_RETURNED(teamname));
- flag.snd_flag_capture = SND(CTF_CAPTURE(teamname));
- flag.snd_flag_dropped = SND(CTF_DROPPED(teamname));
+ flag.snd_flag_taken = SND(CTF_TAKEN(teamnumber));
+ flag.snd_flag_returned = SND(CTF_RETURNED(teamnumber));
+ flag.snd_flag_capture = SND(CTF_CAPTURE(teamnumber));
+ flag.snd_flag_dropped = SND(CTF_DROPPED(teamnumber));
if (flag.snd_flag_respawn == "") flag.snd_flag_respawn = SND(CTF_RESPAWN); // if there is ever a team-based sound for this, update the code to match.
precache_sound(flag.snd_flag_respawn);
if (flag.snd_flag_touch == "") flag.snd_flag_touch = SND(CTF_TOUCH); // again has no team-based sound
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(EFFECT_CAP(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);
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(EFFECT_FLAG_TOUCH(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);
ons_stalemate = false;
- play2all(SND(CTF_CAPTURE(Static_Team_ColorName_Lower(winner_team))));
+ play2all(SND(CTF_CAPTURE(winner_team)));
round_handler_Init(7, autocvar_g_onslaught_warmup, autocvar_g_onslaught_round_timelimit);