sv_gameplayfix_stepmultipletimes 1
// delay for "kill" to prevent abuse
-set g_balance_kill_delay 5
+set g_balance_kill_delay 2
+set g_balance_kill_antispam 5
// this feature is currently buggy in the engine (it appears to PREVENT any dropping in lots of maps, leading to weirdly aligned entities, and in some cases even CAUSES them to drop through solid, like in facing worlds nex)
sv_gameplayfix_droptofloorstartsolid 0
sprite wpn-fireball "Fireball" ff8000 000000 0.0 # orange
sprite wpn-hlac "HLAC" 00ff00 000000 0.0 # green
sprite wpn-campingrifle "Rifle" 80ff00 000000 0.0 # orange
+sprite wpn-minelayer "Mine Layer" ccff00 000000 0.0 # yellowish orange
sprite dom-neut "Control point" 00ffff 000000 0.0
sprite dom-red "Control point" ff0000 000000 0.0
waypointsprite_distancefadealpha = autocvar_g_waypointsprite_distancefadealpha;
waypointsprite_distancefadescale = autocvar_g_waypointsprite_distancefadescale;
waypointsprite_distancefadedistance = waypointsprite_fadedistance * autocvar_g_waypointsprite_distancefadedistancemultiplier;
+ waypointsprite_alpha = autocvar_g_waypointsprite_alpha;
if(!waypointsprite_initialized)
{
// WEAPON PLUGIN SYSTEM
-entity weapon_info[24];
+entity weapon_info[WEP_MAXCOUNT];
entity dummy_weapon_info;
void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
float i;
weaponorder_byid = "";
- for(i = 24; i >= 1; --i)
+ for(i = WEP_MAXCOUNT; i >= 1; --i)
if(weapon_info[i-1])
weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1));
float autocvar_g_balance_keyhunt_score_push;
float autocvar_g_balance_keyhunt_throwvelocity;
float autocvar_g_balance_kill_delay;
+float autocvar_g_balance_kill_antispam;
float autocvar_g_balance_laser_primary_animtime;
float autocvar_g_balance_laser_primary_damage;
float autocvar_g_balance_laser_primary_delay;
string autocvar_g_xonoticversion;
float autocvar_gamecfg;
float autocvar_gameversion;
+float autocvar_gameversion_min;
+float autocvar_gameversion_max;
string autocvar_hostname;
float autocvar_lastlevel;
float autocvar_leadlimit;
needarmor = TRUE;
// Needs weapons?
- for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+ for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
// Find weapon
if(power2of(i-1) & self.weapons)
=============
*/
+.float clientkill_nexttime;
void ClientKill_Now_TeamChange()
{
if(self.killindicator_teamchange == -1)
self.team = -1;
JoinBestTeam( self, FALSE, FALSE );
}
+ else if(self.killindicator_teamchange == -2)
+ {
+ if(g_ca)
+ self.caplayer = 0;
+ if(blockSpectators)
+ sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+ PutObserverInServer();
+ }
else
SV_ChangeTeam(self.killindicator_teamchange - 1);
}
{
if(self.owner.killindicator_teamchange == -1)
centerprint(self.owner, strcat("Changing team in ", ftos(self.cnt), " seconds"));
+ else if(self.owner.killindicator_teamchange == -2)
+ centerprint(self.owner, strcat("Spectating in ", ftos(self.cnt), " seconds"));
else
centerprint(self.owner, strcat("Changing to ", ColoredTeamName(self.owner.killindicator_teamchange), " in ", ftos(self.cnt), " seconds"));
}
}
}
-void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
+void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 = spec
{
float killtime;
entity e;
if(!self.killindicator)
{
+ if(self.modelindex && self.deadflag == DEAD_NO)
+ {
+ killtime = max(killtime, self.clientkill_nexttime - time);
+ self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
+ }
+
if(killtime <= 0 || !self.modelindex || self.deadflag != DEAD_NO)
{
ClientKill_Now();
}
if(self.killindicator)
{
- if(targetteam)
- self.killindicator.colormod = TeamColor(targetteam);
- else
+ if(targetteam == 0) // just die
self.killindicator.colormod = '0 0 0';
+ else if(targetteam == -1) // auto
+ self.killindicator.colormod = '0 1 0';
+ else if(targetteam == -2) // spectate
+ self.killindicator.colormod = '0.5 0.5 0.5';
+ else
+ self.killindicator.colormod = TeamColor(targetteam);
}
}
} else {
self.version = stof(argv(1));
}
- if(self.version != autocvar_gameversion)
+ if(self.version < autocvar_gameversion_min || self.version > autocvar_gameversion_max)
{
- self.classname = "observer";
self.version_mismatch = 1;
- PutClientInServer();
+ ClientKill_TeamChange(-2); // observe
} else if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force) {
//JoinBestTeam(self, FALSE, TRUE);
} else if(teams_matter && !autocvar_sv_spectate && !(self.team_forced > 0)) {
}
}
if(self.classname == "player" && autocvar_sv_spectate == 1) {
- if(self.flagcarried)
- DropFlag(self.flagcarried, world, world);
- if(self.ballcarried && g_nexball)
- DropBall(self.ballcarried, self.origin, self.velocity);
- WaypointSprite_PlayerDead();
- self.classname = "observer";
- if(g_ca)
- self.caplayer = 0;
- if(blockSpectators)
- sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
- PutClientInServer();
+ ClientKill_TeamChange(-2); // observe
}
} else if(cmd == "join") {
if not(self.flags & FL_CLIENT)
} else if(lockteams) {
sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n");
} else if( argv(1) == "red" ) {
- DoTeamChange(COLOR_TEAM1);
+ ClientKill_TeamChange(COLOR_TEAM1);
} else if( argv(1) == "blue" ) {
- DoTeamChange(COLOR_TEAM2);
+ ClientKill_TeamChange(COLOR_TEAM2);
} else if( argv(1) == "yellow" ) {
- DoTeamChange(COLOR_TEAM3);
+ ClientKill_TeamChange(COLOR_TEAM3);
} else if( argv(1) == "pink" ) {
- DoTeamChange(COLOR_TEAM4);
+ ClientKill_TeamChange(COLOR_TEAM4);
} else if( argv(1) == "auto" ) {
- DoTeamChange(-1);
+ ClientKill_TeamChange(-1);
} else {
sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) );
}
if (g_weaponarena)
{
start_weapons = g_weaponarena;
- if (g_weaponarena & (WEPBIT_GRENADE_LAUNCHER | WEPBIT_MINE_LAYER | WEPBIT_HAGAR | WEPBIT_ROCKET_LAUNCHER))
- start_ammo_rockets = 999;
- if (g_weaponarena & WEPBIT_SHOTGUN)
- start_ammo_shells = 999;
- if (g_weaponarena & (WEPBIT_ELECTRO | WEPBIT_CRYLINK | WEPBIT_NEX | WEPBIT_MINSTANEX | WEPBIT_HLAC | WEPBIT_HOOK))
- start_ammo_cells = 999;
- if (g_weaponarena & (WEPBIT_UZI | WEPBIT_CAMPINGRIFLE))
- start_ammo_nails = 999;
- if (g_weaponarena & WEPBIT_HOOK)
- start_ammo_fuel = 999;
+ for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+ {
+ e = get_weaponinfo(j);
+ if(start_weapons & e.weapons)
+ {
+ if(e.items & IT_ROCKETS)
+ start_ammo_rockets = 999;
+ if(e.items & IT_SHELLS)
+ start_ammo_shells = 999;
+ if(e.items & IT_CELLS)
+ start_ammo_cells = 999;
+ if(e.items & IT_NAILS)
+ start_ammo_nails = 999;
+ if(e.items & IT_FUEL)
+ start_ammo_fuel = 999;
+ }
+ }
start_items |= IT_UNLIMITED_AMMO;
}
else if (g_minstagib)
// If custom weapon priorities for bots is enabled rate most wanted weapons higher
if( bot_custom_weapon && c )
{
- for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+ for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
// Find weapon
if( (get_weaponinfo(i)).weapons & item.weapons != item.weapons )
c = 0;
// Detect needed ammo
- for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+ for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
{
wi = get_weaponinfo(i);
{
local entity missile;
- if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_missile_ammo;
makevectors(self.v_angle);