{
if(!have_pickup_item(this))
{
+ if(g_weaponarena == 2 && weaponid)
+ weaponsInMap |= WepSet_FromWeapon(Weapons_from(weaponid));
startitem_failed = true;
delete(this);
return;
POSTGIVE_RES_ROT(e, RES_HEALTH, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_MEGAHEALTH, SND_Null);
if(e.superweapons_finished <= 0)
- if(!g_weaponarena && STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS)
+ if(!g_weaponarena && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
e.superweapons_finished = autocvar_g_balance_superweapons_time;
if(e.strength_finished <= 0)
return t;
}
+void weaponarena_available_update(entity this)
+{
+ if(!weaponsInMap)
+ {
+ // if no weapons are available, just fall back to most weapons arena
+ FOREACH(Weapons, it != WEP_Null, {
+ if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & WEP_FLAG_HIDDEN))
+ g_weaponarena_weapons |= (it.m_wepset);
+ });
+ start_weapons = g_weaponarena_weapons;
+ return;
+ }
+ g_weaponarena_weapons |= weaponsInMap;
+ start_weapons = g_weaponarena_weapons;
+}
+
void readplayerstartcvars()
{
float i, t;
g_weaponarena_weapons |= (it.m_wepset);
});
}
+ else if (s == "available")
+ {
+ g_weaponarena = 2;
+ g_weaponarena_list = "Most Weapons";
+ // include weapons the player would start with
+ FOREACH(Weapons, it != WEP_Null, {
+ int w = want_weapon(it, false);
+ if(w & 1)
+ g_weaponarena_weapons |= (it.m_wepset);
+ });
+ InitializeEntity(NULL, weaponarena_available_update, INITPRIO_FINDTARGET);
+ }
else if (s == "none")
{
g_weaponarena = 1;
set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"
set g_pickup_respawntime_scaling_offset 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening"
set g_pickup_respawntime_scaling_linear 1 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly"
-set g_weaponarena "0" "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
+set g_weaponarena "0" "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\" or \"available\""
set g_weaponarena_random "0" "if set to a number, only that weapon count is given on every spawn (randomly)"
set g_weaponarena_random_with_blaster "1" "additionally, always provide the blaster in random weapon arena games"
set g_spawnpoints_auto_move_out_of_solid 0 "if set to 1 you will see a warning if a spawn point was placed inside a solid"