TacoServer/Classic/scripts/autoexec/antiTurret.cs

36 lines
778 B
C#
Raw Normal View History

//Amount of players on a team to enable turrets
//$Host::EnableTurretPlayerCount = 10;
2018-11-13 21:39:50 -05:00
//
//Disable MortarTurret
//$Host::EnableMortarTurret = 0;
//
//Disable = 0
//Enable = 1
2018-06-28 14:34:52 -04:00
2018-11-13 21:39:50 -05:00
package antiTurret
{
2018-06-28 14:34:52 -04:00
function TurretData::selectTarget(%this, %turret)
{
2018-11-13 21:39:50 -05:00
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $Host::EnableTurretPlayerCount )
{
%turret.clearTarget();
}
else if( $Host::EnableMortarTurret )
{
Parent::selectTarget(%this, %turret);
}
//No possibility of mortar turret working if map already has it and its banned.
else if( %turret.initialBarrel !$= "MortarBarrelLarge" )
{
Parent::selectTarget(%this, %turret);
}
2018-06-28 14:34:52 -04:00
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(antiTurret))
activatePackage(antiTurret);