CVTOV(g_nexball_delay_idle); //10
CVTOV(g_nexball_football_physics); //0
- radar_showennemies = cvar("g_nexball_radar_showallplayers");
+ radar_showennemies = autocvar_g_nexball_radar_showallplayers;
InitializeEntity(world, nb_delayedinit, INITPRIO_GAMETYPE);
}
void LogNB(string mode, entity actor)
{
string s;
- if(!cvar("sv_eventlog"))
+ if(!autocvar_sv_eventlog)
return;
s = strcat(":nexball:", mode);
if(actor != world)
void nexball_setstatus (void)
{
local entity oldself;
- if (!g_nexball)
- return;
+ self.items &~= IT_KEY1;
if (self.ballcarried)
{
if (self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
setorigin(self, self.spawnorigin); // make sure it's positioned correctly anyway
self.movetype = MOVETYPE_NONE;
self.think = InitBall;
- self.nextthink = max(time, game_starttime) + cvar("g_nexball_delay_start");
+ self.nextthink = max(time, game_starttime) + autocvar_g_nexball_delay_start;
}
}
football_touch();
return;
}
- if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + cvar("g_nexball_delay_collect"))) {
+ if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_nexball_delay_collect)) {
if (other.health <= 0)
return;
LogNB("caught", other);
ball.think = ResetBall;
if (ball.classname == "nexball_basketball")
ball.touch = football_touch; // better than SUB_Null: football control until the ball gets reset
- ball.nextthink = time + cvar("g_nexball_delay_goal") * (self.team != GOAL_OUT);
+ ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
}
//=======================//
if (cvar(strcat("g_", self.classname, "_trail"))) //nexball_basketball :p
{
- self.glow_color = cvar("g_nexball_trail_color");
+ self.glow_color = autocvar_g_nexball_trail_color;
self.glow_trail = TRUE;
}
self.movetype = MOVETYPE_FLY;
- if (!cvar("g_nexball_sound_bounce"))
+ if (!autocvar_g_nexball_sound_bounce)
self.noise = "";
else if (!self.noise)
self.noise = "sound/nexball/bounce.wav";
self.reset = ball_restart;
self.think = InitBall;
- self.nextthink = game_starttime + cvar("g_nexball_delay_start");
+ self.nextthink = game_starttime + autocvar_g_nexball_delay_start;
}
void spawnfunc_nexball_basketball (void)
self.effects = g_nexball_basketball_effects_default;
self.solid = SOLID_TRIGGER;
balls |= BALL_BASKET;
- self.bouncefactor = cvar("g_nexball_basketball_bouncefactor");
- self.bouncestop = cvar("g_nexball_basketball_bouncestop");
+ self.bouncefactor = autocvar_g_nexball_basketball_bouncefactor;
+ self.bouncestop = autocvar_g_nexball_basketball_bouncestop;
SpawnBall();
}
self.classname = "nexball_football";
self.solid = SOLID_TRIGGER;
balls |= BALL_FOOT;
- self.bouncefactor = cvar("g_nexball_football_bouncefactor");
- self.bouncestop = cvar("g_nexball_football_bouncestop");
+ self.bouncefactor = autocvar_g_nexball_football_bouncefactor;
+ self.bouncestop = autocvar_g_nexball_football_bouncestop;
SpawnBall();
}
if(attacker.team != other.team || g_nexball_basketball_teamsteal)
if((ball = other.ballcarried) && (attacker.classname == "player" || attacker.classname == "gib"))
{
- other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * cvar("g_balance_nexball_secondary_force");
+ other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
other.flags &~= FL_ONGROUND;
if(!attacker.ballcarried)
{
if (!(ball = self.ballcarried))
return;
- W_SetupShot (self, FALSE, 4, "nexball/shoot1.wav",0);
+ W_SetupShot (self, FALSE, 4, "nexball/shoot1.wav", CHAN_WEAPON, 0);
tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, world);
if(trace_startsolid)
{
mul = 1;
else
{
- mi = cvar("g_nexball_basketball_meter_minpower");
- ma = max(mi, cvar("g_nexball_basketball_meter_maxpower")); // avoid confusion
+ mi = autocvar_g_nexball_basketball_meter_minpower;
+ ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
//One triangle wave period with 1 as max
mul = 2 * mod(t, g_nexball_meter_period) / g_nexball_meter_period;
if (mul > 1)
mul = 2 - mul;
mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
}
- DropBall (ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * cvar("g_balance_nexball_primary_speed") * mul, FALSE));
+ DropBall (ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, FALSE));
//TODO: use the speed_up cvar too ??
}
local entity missile;
if (!(balls & BALL_BASKET))
return;
- W_SetupShot (self, FALSE, 2, "nexball/shoot2.wav",0);
+ W_SetupShot (self, FALSE, 2, "nexball/shoot2.wav", CHAN_WEAPON, 0);
// pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
missile = spawn ();
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, w_shotorg);
- W_SetupProjectileVelocity(missile, cvar("g_balance_nexball_secondary_speed"), 0);
+ W_SetupProjectileVelocity(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles (missile.velocity);
missile.touch = W_Nexball_Touch;
missile.think = SUB_Remove;
- missile.nextthink = time + cvar("g_balance_nexball_secondary_lifetime"); //FIXME: use a distance instead?
+ missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
missile.flags = FL_PROJECTILE;
if (req == WR_THINK)
{
if (self.BUTTON_ATCK)
- if (weapon_prepareattack(0, cvar("g_balance_nexball_primary_refire")))
- if (cvar("g_nexball_basketball_meter"))
+ if (weapon_prepareattack(0, autocvar_g_balance_nexball_primary_refire))
+ if (autocvar_g_nexball_basketball_meter)
{
if (self.ballcarried && !self.metertime)
self.metertime = time;
else
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
else
{
W_Nexball_Attack(-1);
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
if (self.BUTTON_ATCK2)
- if (weapon_prepareattack(1, cvar("g_balance_nexball_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_nexball_secondary_refire))
{
W_Nexball_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_nexball_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
}
if (!self.BUTTON_ATCK && self.metertime && self.ballcarried)
{
W_Nexball_Attack(time - self.metertime);
// DropBall or stealing will set metertime back to 0
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
}
else if (req == WR_PRECACHE)