// battle royale
// ======
set g_br 0 "Battle Royale: survive on a shrinking battlefield"
+set g_br_not_assault_maps 0 "when this is set, CTF maps will NOT be listed in BR"
+set g_br_not_ctf_maps 0 "when this is set, CTF maps will NOT be listed in BR"
set g_br_not_dm_maps 0 "when this is set, DM maps will NOT be listed in BR"
set g_br_minplayers 2 "minimum players to start the BR match"
set g_br_squad_size 3 "maximum squad size"
#pragma once
+#include <common/gamemodes/gamemode/assault/assault.qh>
+#include <common/gamemodes/gamemode/ctf/ctf.qh>
#include <common/gamemodes/gamemode/deathmatch/deathmatch.qh>
#include <common/mapinfo.qh>
+bool autocvar_g_br_not_assault_maps = false;
+bool autocvar_g_br_not_ctf_maps = false;
bool autocvar_g_br_not_dm_maps = false;
#ifdef CSQC
}
METHOD(BattleRoyale, m_isForcedSupported, bool(Gametype this))
{
+ if(!autocvar_g_br_not_assault_maps)
+ {
+ // if this is unset, all ASSAULT maps support BR too
+ if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ASSAULT.m_flags))
+ return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+ }
+
+ if(!autocvar_g_br_not_ctf_maps)
+ {
+ // if this is unset, all CTF maps support BR too
+ if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTF.m_flags))
+ return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+ }
+
if(!autocvar_g_br_not_dm_maps)
{
// if this is unset, all DM maps support BR too
player.br_ring_warned = true;
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_BR_RING_WARN);
}
- player.event_damage(player, ring, ring, ring.strength * frametime, DEATH_RING.m_id, DMG_NOWEP, player.origin, '0 0 0'); // ring damage
+
+ if (player.vehicle) // if a player is controlling vehicles
+ vehicles_damage(player.vehicle, ring, ring, 10 * ring.strength * frametime, DEATH_RING.m_id, DMG_NOWEP, player.vehicle.origin, '0 0 0');
+
+ Damage(player, ring, ring, ring.strength * frametime, DEATH_RING.m_id, DMG_NOWEP, player.origin, '0 0 0'); // ring damage
}
else
{