// This is the file that resets all the limits for objects within Havoc.  Some
// Mappers feel they have the right to mess with these limits without the 
// understanding of it's affect.  This puts everything back on map changes.

// The Team Deployed Counts
$TeamDeployedCount[1, ForceFieldDeployable] = 0;
$TeamDeployedCount[2, ForceFieldDeployable] = 0;
$TeamDeployedCount[1, VehicleMine] = 0;
$TeamDeployedCount[2, VehicleMine] = 0;
$TeamDeployedCount[1, TeleporterPack] = 0;
$TeamDeployedCount[2, TeleporterPack] = 0;
$TeamDeployedCount[1, LaserTurretBarrelPack] = 0;
$TeamDeployedCount[2, LaserTurretBarrelPack] = 0;
$TeamDeployedCount[1, FlameTurretBarrelPack] = 0;
$TeamDeployedCount[2, FlameTurretBarrelPack] = 0;
$TeamDeployedCount[1, IonTurretBarrelPack] = 0;
$TeamDeployedCount[2, IonTurretBarrelPack] = 0;
$TeamDeployedCount[1, FusionTurretBarrelPack] = 0;
$TeamDeployedCount[2, FusionTurretBarrelPack] = 0;
$TeamDeployedCount[1, ImpulseTurretBarrelPack] = 0;
$TeamDeployedCount[2, ImpulseTurretBarrelPack] = 0;
$TeamDeployedCount[1, TractorTurretBarrelPack] = 0;
$TeamDeployedCount[2, TractorTurretBarrelPack] = 0;
$TeamDeployedCount[1, EMPTurretBarrelPack] = 0;
$TeamDeployedCount[2, EMPTurretBarrelPack] = 0;
$TeamDeployedCount[1, DeployableSensorJammerPack] = 0;
$TeamDeployedCount[2, DeployableSensorJammerPack] = 0;
$TeamDeployedCount[1, BaseAlarmPack] = 0;
$TeamDeployedCount[2, BaseAlarmPack] = 0;
$TeamDeployedCount[1, MineDeployed] = 0;
$TeamDeployedCount[2, MineDeployed] = 0;
$TeamDeployedCount[1, DeployGenImage] = 0;
$TeamDeployedCount[2, DeployGenImage] = 0;
$TeamDeployedCount[1, SensorTapImage] = 0;
$TeamDeployedCount[2, SensorTapImage] = 0;
$TeamDeployedCount[1, DeployableTurretBase] = $Team1Turrets;
$TeamDeployedCount[2, DeployableTurretBase] = $Team2Turrets;
$TeamDeployedCount[1, TurretOutdoorDeployable] = 0;
$TeamDeployedCount[2, TurretOutdoorDeployable] = 0;
$TeamDeployedCount[1, TurretIndoorDeployable] = 0;
$TeamDeployedCount[2, TurretIndoorDeployable] = 0;
$TeamDeployedCount[1, InventoryDeployable] = 0;
$TeamDeployedCount[2, InventoryDeployable] = 0;
$TeamDeployedCount[1, BlastWallPack] = 0;
$TeamDeployedCount[2, BlastWallPack] = 0;
$TeamDeployedCount[1, SpringboardPack] = 0;
$TeamDeployedCount[2, SpringboardPack] = 0;

// Team 0 Teleporters - Universal
$Team0Teleporter[1] = 0;
$Team0Teleporter[2] = 0;
$Team0Teleporter[3] = 0;
$Team0Teleporter[4] = 0;
$Team0Teleporter[5] = 0;
$Team0Teleporter[6] = 0;
$Team0TeleporterCount = 0;

// Team 1 Teleporters 
$Team1Teleporter[1] = 0;
$Team1Teleporter[2] = 0;
$Team1Teleporter[3] = 0;
$Team1Teleporter[4] = 0;
$Team1Teleporter[5] = 0;
$Team1Teleporter[6] = 0;
$Team1TeleporterCount = 0;

// Team 2 Teleporters 
$Team2Teleporter[1] = 0;
$Team2Teleporter[2] = 0;
$Team2Teleporter[3] = 0;
$Team2Teleporter[4] = 0;
$Team2Teleporter[5] = 0;
$Team2Teleporter[6] = 0;
$Team2TeleporterCount = 0;

// Set the RuleSet outside the control of the server owner
$HavocClientVersion = 1.08;
$HavocVersion = 1.08;
$Host::RuleSet = "Havoc " @ $HavocVersion;

$Camera::movementSpeed = 40;

// Reset the Item Respawn and Pop Time
$ItemRespawnTime = 30000;
$ItemPopTime = 30000;

if (isObject(BeaconGroup) == false)
   new SimGroup (BeaconGroup);

$VehicleRespawnTime        = 15000;
$Vehiclemax[ScoutVehicle]     = 4;
$VehicleMax[AssaultVehicle]   = 3;
$VehicleMax[MobileBaseVehicle]  = 1;
$VehicleMax[ScoutFlyer]       = 4;
$VehicleMax[BomberFlyer]      = 2;
$VehicleMax[HAPCFlyer]        = 2;

// Reset the Time for the Match back to what it was
$Host::TimeLimit = $Host::DefaultTimeLimit;

$DeployMask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType;

$InventorySpaceRadius      = 20;     // deployed inventory must be this many meters apart

$TurretIndoorSpaceRadius   = 12;  // deployed turrets must be this many meters apart
$TurretIndoorSphereRadius  = 40;  // radius for turret frequency check
$TurretIndoorMaxPerSphere  = 4;   // # of turrets allowed in above radius

$TurretOutdoorSpaceRadius  = 25;  // deployed turrets must be this many meters apart
$TurretOutdoorSphereRadius = 60;  // radius for turret frequency check
$TurretOutdoorMaxPerSphere = 4;   // # of turrets allowed in above radius

$TurretBaseSpaceRadius     = 35;
$TurretBaseSphereRadius    = 60;  // radius for turret frequency check
$TurretBaseMaxPerSphere    = 2;   // # of turrets allowed in above radius

$TeamDeployableMax[InventoryDeployable]      = 8;
$TeamDeployableMax[TurretIndoorDeployable]   = 20;
$TeamDeployableMax[TurretOutdoorDeployable]  = 20;
$TeamDeployableMax[IonTurretBarrelPack]      = 40;
$TeamDeployableMax[FusionTurretBarrelPack]   = 40;
$TeamDeployableMax[LaserTurretBarrelPack]    = 16;
$TeamDeployableMax[EMPTurretBarrelPack]      = 16;
$TeamDeployableMax[FlameTurretBarrelPack]    = 16;
$TeamDeployableMax[ImpulseTurretBarrelPack]  = 16;
$TeamDeployableMax[TractorTurretBarrelPack]  = 16;
$TeamDeployableMax[PulseSensorDeployable]    = 15;
$TeamDeployableMax[MotionSensorDeployable]   = 15;
$TeamDeployableMax[ForceFieldDeployable] = 6;
$TeamDeployableMax[VehicleMine] = 6;
$TeamDeployableMax[TeleporterPack] = 6;
$TeamDeployableMax[DeployableSensorJammerPack] = 6;
$TeamDeployableMax[BaseAlarmPack] = 3;
$TeamDeployableMax[MineDeployed] = 25;
$TeamDeployableMax[DeployGenImage] = 1;
$TeamDeployableMax[TargetBeacon] = 10;
$TeamDeployableMax[MarkerBeacon] = 20;
$TeamDeployableMax[SensorTapImage] = 1;
$TeamDeployableMax[DeployedCamera]  = 20;
$TeamDeployableMax[BlastWallPack]  = 2;
$TeamDeployableMax[SpringboardPack]  = 4;

if ($Host::AtLeastOneTurret == true)
{
   if ($Team1Turrets > $Team2Turrets)
      %TurretCount = $Team1Turrets;
   else
      %TurretCount = $Team2Turrets;

   if (%TurretCount >= 4)
      $TeamDeployableMax[DeployableTurretBase] = %TurretCount + 1;
}

$TeamDeployableMin[TurretIndoorDeployable]   = 4;
$TeamDeployableMin[TurretOutdoorDeployable]  = 4;
$TeamDeployableMin[IonTurretBarrelPack]      = 8;
$TeamDeployableMin[FusionTurretBarrelPack]   = 8;
$TeamDeployableMin[LaserTurretBarrelPack]    = 4;
$TeamDeployableMin[EMPTurretBarrelPack]      = 4;
$TeamDeployableMin[FlameTurretBarrelPack]    = 4;
$TeamDeployableMin[ImpulseTurretBarrelPack]  = 4;
$TeamDeployableMin[TractorTurretBarrelPack]  = 4;

$NotDeployableReason::None                   =  0;
$NotDeployableReason::MaxDeployed            =  1;
$NotDeployableReason::NoSurfaceFound         =  2;
$NotDeployableReason::SlopeTooGreat          =  3;
$NotDeployableReason::SelfTooClose           =  4;
$NotDeployableReason::ObjectTooClose         =  5;
$NotDeployableReason::NoTerrainFound         =  6;
$NotDeployableReason::NoInteriorFound        =  7;
$NotDeployableReason::TurretTooClose         =  8;
$NotDeployableReason::TurretSaturation       =  9;
$NotDeployableReason::SurfaceTooNarrow       =  10;
$NotDeployableReason::InventoryTooClose      =  11;

$MinDeployableDistance =  0.75;
$MaxDeployableDistance =  5.0;

// Define/Redefine the Bomb Properties
$BombName[1] = "Standard Bomb";
$BombType[1] = "BomberBomb";
$BombName[2] = "Cluster Bomb";
$BombType[2] = "ClusterBomb";
$BombName[3] = "Incendiary Bomb";
$BombType[3] = "IncendiaryBomb";
$BombName[4] = "EMP Bomb";
$BombType[4] = "EMPBomb";
$BombName[5] = "Depth Charge";
$BombType[5] = "DepthCharge";

$PowerGroupCount = 1;

// put vars here for ammo max counts with ammo pack
$AmmoItem[0] = PlasmaAmmo;
$AmmoItem[1] = ChaingunAmmo;
$AmmoItem[2] = DiscAmmo;
$AmmoItem[3] = GrenadeLauncherAmmo;
$AmmoItem[4] = MortarAmmo;
$AmmoItem[5] = MissileLauncherAmmo;
$AmmoItem[6] = RepairKit;
$AmmoItem[7] = RifleAmmo;
$AmmoItem[8] = ShotgunAmmo;

$numAmmoItems = 9;

$grenAmmoType[0] = Grenade;
$grenAmmoType[1] = ConcussionGrenade;
$grenAmmoType[2] = FlashGrenade;
$grenAmmoType[3] = FlareGrenade;
$grenAmmoType[4] = PlasticExplosive;
$grenAmmoType[5] = IncendiaryGrenade;
$grenAmmoType[6] = EMPGrenade;
$grenAmmoType[7] = CameraGrenade;

$numGrenTypes = 8;

$mineAmmoType[0] = Mine;
$mineAmmoType[1] = EMPMine;
$mineAmmoType[2] = IncendiaryMine;
$mineAmmoType[3] = StunMine;
$mineAmmoType[4] = ConcussionMine;

$numGrenTypes = 5;

// Reset the Player Properties
$DamageVariance = 0.15;
$SafeEnterWaterSpeed = 65;
$CorpseTimeoutValue = 25000;

//Damage Rate for entering Liquid
$DamageLava       = 0.032;
$DamageHotLava    = 0.038;
$DamageCrustyLava = 0.026;

// Loop through and set everyone's Hacking Experience back to 0
%Count = clientGroup.getCount();
%i = 0;

while (%i < %Count)
{
   %Client = clientGroup.getObject(%i);

   %Client.HackingExperience = 0;
   %Client.Tks = 0;

   %i++;
}

// If there is not water, then disable the DepthCharge Barrel
if ($MapHasWater == true)
   $InvBanList[$CurrentMissionType, DepthChargeBarrelPack] = "";
else
   $InvBanList[$CurrentMissionType, DepthChargeBarrelPack] = true;

// If the Extra Rocket Pack is enabled, use it
$InvBanList[$CurrentMissionType, "JetPack"] = 1;
if ($UseRocketPack == true)
   $InvBanList[$CurrentMissionType, "JetPack"] = "";
$UseRocketPack = false;

