.bool pushable;
-void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc
+void ctf_FlagSetup(int teamnum, entity flag) // called when spawning a flag entity on the map as a spawnfunc
{
// main setup
flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist
setattachment(flag, NULL, "");
- flag.netname = strzone(sprintf("%s%s^7 flag", Team_ColorCode(teamnumber), Team_ColorName_Upper(teamnumber)));
- flag.team = teamnumber;
+ flag.netname = strzone(sprintf("%s%s^7 flag", Team_ColorCode(teamnum), Team_ColorName_Upper(teamnum)));
+ flag.team = teamnum;
flag.classname = "item_flag_team";
flag.target = "###item###"; // for finding the nearest item using findnearest
flag.flags = FL_ITEM | FL_NOTARGET;
if(autocvar_g_ctf_score_ignore_fields)
flag.cnt = flag.score_assist = flag.score_team_capture = flag.score_capture = flag.score_drop = flag.score_pickup = flag.score_return = 0;
- string teamname = Static_Team_ColorName_Lower(teamnumber);
+ string teamname = Static_Team_ColorName_Lower(teamnum);
// appearence
if(!flag.scale) { flag.scale = FLAG_SCALE; }
if(flag.skin == 0) { flag.skin = cvar(sprintf("g_ctf_flag_%s_skin", teamname)); }
if(flag.model == "") { flag.model = cvar_string(sprintf("g_ctf_flag_%s_model", teamname)); }
- if (flag.toucheffect == "") { flag.toucheffect = EFFECT_FLAG_TOUCH(teamnumber).eent_eff_name; }
- if (flag.passeffect == "") { flag.passeffect = EFFECT_PASS(teamnumber).eent_eff_name; }
- if (flag.capeffect == "") { flag.capeffect = EFFECT_CAP(teamnumber).eent_eff_name; }
+ if (flag.toucheffect == "") { flag.toucheffect = EFFECT_FLAG_TOUCH(teamnum).eent_eff_name; }
+ if (flag.passeffect == "") { flag.passeffect = EFFECT_PASS(teamnum).eent_eff_name; }
+ if (flag.capeffect == "") { flag.capeffect = EFFECT_CAP(teamnum).eent_eff_name; }
// sounds
#define X(s,b) \
if(flag.s == "") flag.s = b; \
precache_sound(flag.s);
- X(snd_flag_taken, strzone(SND(CTF_TAKEN(teamnumber))))
- X(snd_flag_returned, strzone(SND(CTF_RETURNED(teamnumber))))
- X(snd_flag_capture, strzone(SND(CTF_CAPTURE(teamnumber))))
- X(snd_flag_dropped, strzone(SND(CTF_DROPPED(teamnumber))))
+ X(snd_flag_taken, strzone(SND(CTF_TAKEN(teamnum))))
+ X(snd_flag_returned, strzone(SND(CTF_RETURNED(teamnum))))
+ X(snd_flag_capture, strzone(SND(CTF_CAPTURE(teamnum))))
+ X(snd_flag_dropped, strzone(SND(CTF_DROPPED(teamnum))))
X(snd_flag_respawn, strzone(SND(CTF_RESPAWN)))
X(snd_flag_touch, strzone(SND(CTF_TOUCH)))
X(snd_flag_pass, strzone(SND(CTF_PASS)))
if(autocvar_g_ctf_flag_glowtrails)
{
- switch(teamnumber)
+ switch(teamnum)
{
case NUM_TEAM_1: flag.glow_color = 251; break;
case NUM_TEAM_2: flag.glow_color = 210; break;
if(autocvar_g_ctf_fullbrightflags) { flag.effects |= EF_FULLBRIGHT; }
if(autocvar_g_ctf_dynamiclights)
{
- switch(teamnumber)
+ switch(teamnum)
{
case NUM_TEAM_1: flag.effects |= EF_RED; break;
case NUM_TEAM_2: flag.effects |= EF_BLUE; break;
// Main Control Point Functions
// =============================
-int ons_ControlPoint_CanBeLinked(entity cp, int teamnumber)
+int ons_ControlPoint_CanBeLinked(entity cp, int teamnum)
{
- if(cp.aregensneighbor & BIT(teamnumber)) return 2;
- if(cp.arecpsneighbor & BIT(teamnumber)) return 1;
+ if(cp.aregensneighbor & BIT(teamnum)) return 2;
+ if(cp.arecpsneighbor & BIT(teamnum)) return 1;
return 0;
}
-int ons_ControlPoint_Attackable(entity cp, int teamnumber)
+int ons_ControlPoint_Attackable(entity cp, int teamnum)
// -2: SAME TEAM, attackable by enemy!
// -1: SAME TEAM!
// 0: off limits
else if(cp.goalentity)
{
// if there's already an icon built, nothing happens
- if(cp.team == teamnumber)
+ if(cp.team == teamnum)
{
- a = ons_ControlPoint_CanBeLinked(cp, teamnumber);
+ a = ons_ControlPoint_CanBeLinked(cp, teamnum);
if(a) // attackable by enemy?
return -2; // EMERGENCY!
return -1;
}
// we know it can be linked, so no need to check
// but...
- a = ons_ControlPoint_CanBeLinked(cp, teamnumber);
+ a = ons_ControlPoint_CanBeLinked(cp, teamnum);
if(a == 2) // near our generator?
return 3; // EMERGENCY!
return 1;
else
{
// free point
- if(ons_ControlPoint_CanBeLinked(cp, teamnumber))
+ if(ons_ControlPoint_CanBeLinked(cp, teamnum))
{
- a = ons_ControlPoint_CanBeLinked(cp, teamnumber); // why was this here NUM_TEAM_1 + NUM_TEAM_2 - t
+ a = ons_ControlPoint_CanBeLinked(cp, teamnum); // why was this here NUM_TEAM_1 + NUM_TEAM_2 - t
if(a == 2)
return 4; // GET THIS ONE NOW!
else
void ons_GeneratorSetup(entity gen) // called when spawning a generator entity on the map as a spawnfunc
{
// declarations
- int teamnumber = gen.team;
+ int teamnum = gen.team;
// main setup
gen.ons_worldgeneratornext = ons_worldgeneratorlist; // link generator into ons_worldgeneratorlist
ons_worldgeneratorlist = gen;
- gen.netname = sprintf("%s generator", Team_ColoredFullName(teamnumber));
+ gen.netname = sprintf("%s generator", Team_ColoredFullName(teamnum));
gen.classname = "onslaught_generator";
gen.solid = SOLID_BBOX;
- gen.team_saved = teamnumber;
+ gen.team_saved = teamnum;
IL_PUSH(g_saved_team, gen);
set_movetype(gen, MOVETYPE_NONE);
gen.lasthealth = gen.max_health = autocvar_g_onslaught_gen_health;
// model handled by CSQC
setsize(gen, GENERATOR_MIN, GENERATOR_MAX);
setorigin(gen, (gen.origin + CPGEN_SPAWN_OFFSET));
- gen.colormap = 1024 + (teamnumber - 1) * 17;
+ gen.colormap = 1024 + (teamnum - 1) * 17;
// generator placement
droptofloor(gen);
// declarations for functions used outside gamemode_onslaught.qc
void ons_Generator_UpdateSprite(entity e);
void ons_ControlPoint_UpdateSprite(entity e);
-bool ons_ControlPoint_Attackable(entity cp, int teamnumber);
+bool ons_ControlPoint_Attackable(entity cp, int teamnum);
// CaptureShield: Prevent capturing or destroying control point/generator if it is not available yet
float ons_captureshield_force; // push force of the shield