#include "../controlpoint.qh"
#include "../generator.qh"
-vector randompos(vector m1, vector m2)
-{
- vector v;
- m2 = m2 - m1;
- v_x = m2_x * random() + m1_x;
- v_y = m2_y * random() + m1_y;
- v_z = m2_z * random() + m1_z;
- return v;
-}
-
// =======================
// CaptureShield Functions
// =======================
{
switch(autocvar_g_onslaught_debug)
{
- case 1: dprint(input); break;
- case 2: print(input); break;
+ case 1: LOG_TRACE(input); break;
+ case 2: LOG_INFO(input); break;
}
}
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);
if (self.health < 0)
{
- sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
+ sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM);
+ 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);
// 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);
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);
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)
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);
onslaught_controlpoint_icon_link(e, ons_ControlPoint_Icon_BuildThink);
}
-string ons_ControlPoint_Waypoint(entity e)
+entity ons_ControlPoint_Waypoint(entity e)
{
if(e.team)
{
int a = ons_ControlPoint_Attackable(e, e.team);
- if(a == -2) { return "ons-cp-dfnd"; } // defend now
- if(a == -1 || a == 1 || a == 2) { return "ons-cp"; } // touch
- if(a == 3 || a == 4) { return "ons-cp-atck"; } // attack
+ if(a == -2) { return WP_OnsCPDefend; } // defend now
+ if(a == -1 || a == 1 || a == 2) { return WP_OnsCP; } // touch
+ if(a == 3 || a == 4) { return WP_OnsCPAttack; } // attack
}
else
- return "ons-cp";
+ return WP_OnsCP;
- return "";
+ return WP_Null;
}
void ons_ControlPoint_UpdateSprite(entity e)
{
- string s1;
- s1 = ons_ControlPoint_Waypoint(e);
+ entity s1 = ons_ControlPoint_Waypoint(e);
WaypointSprite_UpdateSprites(e.sprite, s1, s1, s1);
bool sh;
precache_model("models/onslaught/controlpoint_icon_gib4.md3");
precache_sound("onslaught/controlpoint_build.wav");
precache_sound("onslaught/controlpoint_built.wav");
- precache_sound("weapons/grenade_impact.wav");
+ precache_sound(W_Sound("grenade_impact"));
precache_sound("onslaught/damageblockedbyshield.wav");
precache_sound("onslaught/controlpoint_underattack.wav");
precache_sound("onslaught/ons_spark1.wav");
}
// waypointsprites
- WaypointSprite_SpawnFixed(string_null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE, '0 0 0');
+ WaypointSprite_SpawnFixed(WP_Null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE);
WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY);
InitializeEntity(cp, ons_DelayedControlPoint_Setup, INITPRIO_SETLOCATION);
// Main Generator Functions
// =========================
-string ons_Generator_Waypoint(entity e)
+entity ons_Generator_Waypoint(entity e)
{
- if(e.isshielded)
- return "ons-gen-shielded";
- return "ons-gen";
+ if (e.isshielded)
+ return WP_OnsGenShielded;
+ return WP_OnsGen;
}
void ons_Generator_UpdateSprite(entity e)
{
- string s1 = ons_Generator_Waypoint(e);
+ entity s1 = ons_Generator_Waypoint(e);
WaypointSprite_UpdateSprites(e.sprite, s1, s1, s1);
if(e.lastteam != e.team + 2 || e.lastshielded != e.isshielded)
// Throw some flaming gibs on damage, more damage = more chance for gib
if(random() < damage/220)
{
- sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+ sound(self, CH_TRIGGER, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
}
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)
precache_model("models/onslaught/gen_gib2.md3");
precache_model("models/onslaught/gen_gib3.md3");
precache_sound("onslaught/generator_decay.wav");
- precache_sound("weapons/grenade_impact.wav");
- precache_sound("weapons/rocket_impact.wav");
+ precache_sound(W_Sound("grenade_impact"));
+ precache_sound(W_Sound("rocket_impact"));
precache_sound("onslaught/generator_underattack.wav");
precache_sound("onslaught/shockwave.wav");
precache_sound("onslaught/ons_hit1.wav");
droptofloor();
// waypointsprites
- WaypointSprite_SpawnFixed(string_null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE, '0 0 0');
+ WaypointSprite_SpawnFixed(WP_Null, self.origin + CPGEN_WAYPOINT_OFFSET, self, sprite, RADARICON_NONE);
WaypointSprite_UpdateRule(self.sprite, self.team, SPRITERULE_TEAMPLAY);
WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
WaypointSprite_UpdateHealth(self.sprite, self.health);
{
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);
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;
}
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}