<?xml version="1.0" encoding="utf-8" ?>
<Defs>

  <!-- Auto mini-turret -->

  <ThingDef ParentName="BuildingBase">
    <defName>Turret_AutoMiniTurret</defName>
    <label>mini-slugger turret</label>
    <description>A self-powered defense turret mounted with a weak but long-ranged slug-thrower. May explode when damaged.</description>
    <thingClass>Building_TurretGun</thingClass>
    <drawerType>MapMeshAndRealTime</drawerType>
    <graphicData>
      <texPath>Things/Building/Mech/TurretMechMini_Base</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(1,1)</drawSize>
      <drawOffset>(0,0,-0.11)</drawOffset>
      <damageData>
        <rect>(0.2,0.2,0.6,0.6)</rect>
      </damageData>
      <shadowData>
        <volume>(0.27,0.25,0.27)</volume>
        <offset>(0,0,0)</offset>
      </shadowData>
    </graphicData>
    <receivesSignals>true</receivesSignals>
    <altitudeLayer>Building</altitudeLayer>
    <stealable>false</stealable>
    <rotatable>false</rotatable>
    <statBases>
      <MaxHitPoints>100</MaxHitPoints>
      <Flammability>0</Flammability>
      <Mass>10</Mass>
      <ShootingAccuracyTurret>0.96</ShootingAccuracyTurret>
      <Beauty>-20</Beauty>
    </statBases>
    <damageMultipliers>
      <li>
        <damageDef>Flame</damageDef>
        <multiplier>0</multiplier>
      </li>
    </damageMultipliers>
    <tickerType>Normal</tickerType>
    <comps>
      <li Class="CompProperties_Explosive">
        <wickTicks>240</wickTicks>
        <explosiveRadius>3.9</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <chanceNeverExplodeFromDamage>0.5</chanceNeverExplodeFromDamage>
      </li>
      <li Class="CompProperties_CanBeDormant" />
      <li Class="CompProperties_WakeUpDormant">
        <wakeUpSound>MechanoidsWakeUp</wakeUpSound>
      </li>
    </comps>
    <killedLeavings>
      <ChunkSlagSteel>1</ChunkSlagSteel>
    </killedLeavings>
    <passability>PassThroughOnly</passability>
    <pathCost>50</pathCost>
    <fillPercent>0.4</fillPercent>
    <hasTooltip>true</hasTooltip>
    <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
    <building>
      <combatPower>45</combatPower>   <!-- same as a scavenger -->
      <buildingTags>
        <li>MechClusterMember</li>
        <li>MechClusterCombatThreat</li>
      </buildingTags>
      <ai_combatDangerous>true</ai_combatDangerous>
      <turretGunDef>Gun_MiniTurretMech</turretGunDef>
      <turretBurstCooldownTime>2.5</turretBurstCooldownTime>
      <soundAmbient>MechTurretSmall_Call</soundAmbient>
    </building>
  </ThingDef>

  <ThingDef ParentName="BaseWeaponTurret">
    <defName>Gun_MiniTurretMech</defName>
    <label>mini-slugger</label>
    <description>An automatic turret-mounted slug-thrower.</description>
    <graphicData>
      <texPath>Things/Building/Mech/TurretMechMini_Top</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <uiIconScale>2</uiIconScale>
    <statBases>
      <AccuracyTouch>0.80</AccuracyTouch>
      <AccuracyShort>0.55</AccuracyShort>
      <AccuracyMedium>0.35</AccuracyMedium>
      <AccuracyLong>0.1</AccuracyLong>
      <RangedWeapon_Cooldown>5.1</RangedWeapon_Cooldown>
      <DeteriorationRate>0</DeteriorationRate>
      <Mass>5</Mass>
      <Flammability>0</Flammability>
    </statBases>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <defaultProjectile>Bullet_MiniSlug</defaultProjectile>
        <range>45.9</range>
        <soundCast>Shot_MiniSlug</soundCast>
        <soundCastTail>GunTail_Light</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
        <burstShotCount>1</burstShotCount>
      </li>
    </verbs>
  </ThingDef>

  <ThingDef ParentName="BaseBullet">
    <defName>Bullet_MiniSlug</defName>
    <label>mini-slug</label>
    <graphicData>
      <texPath>Things/Projectile/Bullet_Small</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>12</damageAmountBase>
      <speed>70</speed>
    </projectile>
  </ThingDef>

  <!-- Auto charge blaster -->

  <ThingDef ParentName="BuildingBase">
    <defName>Turret_AutoChargeBlaster</defName>
    <label>auto charge turret</label>
    <description>A self-powered turret mounted with a charge blaster. It cannot sense targets at very short ranges.</description>
    <thingClass>Building_TurretGun</thingClass>
    <drawerType>MapMeshAndRealTime</drawerType>
    <graphicData>
      <texPath>Things/Building/Mech/TurretMechLarge_Base</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(2, 2)</drawSize>
      <drawOffset>(0,0,-0.16)</drawOffset>
      <damageData>
        <rect>(0.3,0.3,1.4,1.4)</rect>
      </damageData>
      <shadowData>
        <volume>(1.5,0.35,1.4)</volume>
        <offset>(0,0,-0.05)</offset>
      </shadowData>
    </graphicData>
    <receivesSignals>true</receivesSignals>
    <altitudeLayer>Building</altitudeLayer>
    <stealable>false</stealable>
    <rotatable>true</rotatable>
    <size>(2,2)</size>
    <statBases>
      <MaxHitPoints>180</MaxHitPoints>
      <Flammability>0</Flammability>
      <Mass>100</Mass>
      <ShootingAccuracyTurret>0.96</ShootingAccuracyTurret>
      <Beauty>-20</Beauty>
    </statBases>
    <damageMultipliers>
      <li>
        <damageDef>Flame</damageDef>
        <multiplier>0</multiplier>
      </li>
    </damageMultipliers>
    <tickerType>Normal</tickerType>
    <comps>
      <li Class="CompProperties_Explosive">
        <wickTicks>240</wickTicks>
        <explosiveRadius>5.9</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <chanceNeverExplodeFromDamage>0.5</chanceNeverExplodeFromDamage>
      </li>
      <li Class="CompProperties_CanBeDormant" />
      <li Class="CompProperties_WakeUpDormant">
        <wakeUpSound>MechanoidsWakeUp</wakeUpSound>
      </li>
    </comps>
    <passability>PassThroughOnly</passability>
    <pathCost>50</pathCost>
    <fillPercent>0.5</fillPercent>
    <hasTooltip>true</hasTooltip>
    <killedLeavings>
      <ChunkSlagSteel>1</ChunkSlagSteel>
    </killedLeavings>
    <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
    <building>
      <combatPower>150</combatPower>
      <buildingTags>
        <li>MechClusterMember</li>
        <li>MechClusterCombatThreat</li>
      </buildingTags>
      <ai_combatDangerous>true</ai_combatDangerous>
      <turretGunDef>Gun_ChargeBlasterHeavyTurret</turretGunDef>
      <turretBurstCooldownTime>5.5</turretBurstCooldownTime>
      <turretTopDrawSize>1.75</turretTopDrawSize>
      <turretTopOffset>(0, 0.05)</turretTopOffset>
      <soundAmbient>MechTurretBig_Call</soundAmbient>
    </building>
    <uiIconScale>0.95</uiIconScale>
  </ThingDef>

  <ThingDef ParentName="Gun_ChargeBlasterHeavyBase"> <!-- Should reorganize this XML relation at some point -->
    <defName>Gun_ChargeBlasterHeavyTurret</defName> <!-- Should be called ChargeBlasterLightTurret, but we keep this defName for compatibility -->
    <label>light charge blaster</label>
    <description>A pulse-charged rapid-fire blaster for area fire.</description>
    <graphicData>
      <texPath>Things/Item/Equipment/WeaponRanged/ChargeBlasterLight</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <statBases>
      <AccuracyLong>0.08</AccuracyLong>
    </statBases>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_ChargeBlasterHeavy</defaultProjectile>
        <warmupTime>1.25</warmupTime>
        <minRange>3.9</minRange>
        <range>45.9</range>
        <ticksBetweenBurstShots>7</ticksBetweenBurstShots>
        <burstShotCount>9</burstShotCount>
        <soundCast>Shot_ChargeBlaster</soundCast>
        <soundCastTail>GunTail_Heavy</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
      </li>
    </verbs>
  </ThingDef>
  
  <!-- Auto inferno turret -->

  <ThingDef ParentName="BuildingBase">
    <defName>Turret_AutoInferno</defName>
    <label>auto inferno turret</label>
    <description>A self-powered turret mounted with an inferno cannon. It cannot sense targets at very short ranges.</description>
    <thingClass>Building_TurretGun</thingClass>
    <drawerType>MapMeshAndRealTime</drawerType>
    <graphicData>
      <texPath>Things/Building/Mech/TurretMechLarge_Base</texPath>
      <graphicClass>Graphic_Multi</graphicClass>
      <drawSize>(2, 2)</drawSize>
      <drawOffset>(0,0,-0.16)</drawOffset>
      <damageData>
        <rect>(0.3,0.3,1.4,1.4)</rect>
      </damageData>
      <shadowData>
        <volume>(1.5,0.35,1.4)</volume>
        <offset>(0,0,-0.05)</offset>
      </shadowData>
    </graphicData>
    <receivesSignals>true</receivesSignals>
    <altitudeLayer>Building</altitudeLayer>
    <stealable>false</stealable>
    <rotatable>true</rotatable>
    <size>(2,2)</size>
    <statBases>
      <MaxHitPoints>180</MaxHitPoints>
      <Flammability>0</Flammability>
      <Mass>100</Mass>
      <ShootingAccuracyTurret>0.96</ShootingAccuracyTurret>
      <Beauty>-20</Beauty>
    </statBases>
    <damageMultipliers>
      <li>
        <damageDef>Flame</damageDef>
        <multiplier>0</multiplier>
      </li>
    </damageMultipliers>
    <tickerType>Normal</tickerType>
    <comps>
      <li Class="CompProperties_Explosive">
        <wickTicks>240</wickTicks>
        <explosiveRadius>5.9</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <chanceNeverExplodeFromDamage>0.5</chanceNeverExplodeFromDamage>
      </li>
      <li Class="CompProperties_CanBeDormant" />
      <li Class="CompProperties_WakeUpDormant">
        <wakeUpSound>MechanoidsWakeUp</wakeUpSound>
      </li>
    </comps>
    <passability>PassThroughOnly</passability>
    <pathCost>50</pathCost>
    <fillPercent>0.5</fillPercent>
    <hasTooltip>true</hasTooltip>
    <killedLeavings>
      <ChunkSlagSteel>1</ChunkSlagSteel>
    </killedLeavings>
    <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
    <building>
      <buildingTags>
        <li>MechClusterMember</li>
        <li>MechClusterCombatThreat</li>
      </buildingTags>
      <combatPower>190</combatPower>
      <ai_combatDangerous>true</ai_combatDangerous>
      <turretGunDef>Gun_InfernoCannonTurret</turretGunDef>
      <turretBurstCooldownTime>17.0</turretBurstCooldownTime>
      <turretTopDrawSize>1.75</turretTopDrawSize>
      <turretTopOffset>(0, 0.05)</turretTopOffset>
      <minMechClusterPoints>570</minMechClusterPoints>
      <soundAmbient>MechTurretBig_Call</soundAmbient>
    </building>
    <uiIconScale>0.95</uiIconScale>
  </ThingDef>

  <ThingDef ParentName="Gun_InfernoCannonBase">
    <defName>Gun_InfernoCannonTurret</defName>
    <destroyOnDrop>true</destroyOnDrop>
    <statBases>
      <AccuracyLong>0.66</AccuracyLong>
    </statBases>
    <weaponTags>
      <li>TurretGun</li>
    </weaponTags>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <defaultProjectile>Bullet_InfernoCannon</defaultProjectile>
        <forcedMissRadius>4.6</forcedMissRadius>
        <ai_AvoidFriendlyFireRadius>3</ai_AvoidFriendlyFireRadius>
        <warmupTime>1.25</warmupTime>
        <minRange>3.9</minRange>
        <range>45.9</range>
        <burstShotCount>1</burstShotCount>
        <soundCast>InfernoCannon_Fire</soundCast>
        <soundCastTail>GunTail_Light</soundCastTail>
        <muzzleFlashScale>14</muzzleFlashScale>
      </li>
    </verbs>
  </ThingDef>
  
  <!-- Auto mortar -->

  <ThingDef ParentName="BuildingBase">
    <defName>Turret_AutoMortar</defName>
    <label>auto mortar</label>
    <description>A self-powered, self-loading, automatic mortar. It can hit targets at any distance, over walls, but is quite inaccurate.</description>
    <thingClass>Building_TurretGun</thingClass>
    <drawerType>MapMeshAndRealTime</drawerType>
    <graphicData>
      <texPath>Things/Building/Mech/TurretMechLarge_Base</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(2,2)</drawSize>
      <drawOffset>(0,0,-0.16)</drawOffset>
      <damageData>
        <rect>(0.3,0.3,1.4,1.4)</rect>
      </damageData>
      <shadowData>
        <offset>(-0.13,-0.87,-0.1)</offset>
        <volume>(0.5,0.4,1.05)</volume>
      </shadowData>
    </graphicData>
    <receivesSignals>true</receivesSignals>
    <altitudeLayer>Building</altitudeLayer>
    <stealable>false</stealable>
    <size>(2,2)</size>
    <passability>PassThroughOnly</passability>
    <pathCost>50</pathCost>
    <fillPercent>0.4</fillPercent>
    <killedLeavings>
      <ChunkSlagSteel>1</ChunkSlagSteel>
      <Steel>60</Steel>
      <Plasteel>10</Plasteel>
      <ReinforcedBarrel>1</ReinforcedBarrel>
    </killedLeavings>
    <tickerType>Normal</tickerType>
    <terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
    <comps>
      <li Class="CompProperties_Forbiddable"/>
      <li Class="CompProperties_Explosive">
        <wickTicks>240</wickTicks>
        <explosiveRadius>4.9</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
      </li>
      <li Class="CompProperties_Initiatable" />
      <li Class="CompProperties_WakeUpDormant">
        <wakeUpSound>MechanoidsWakeUp</wakeUpSound>
      </li>
    </comps>
    <statBases>
      <MaxHitPoints>260</MaxHitPoints>
      <Flammability>0</Flammability>
      <Mass>30</Mass>
      <ShootingAccuracyTurret>0.9</ShootingAccuracyTurret>
      <Beauty>-20</Beauty>
    </statBases>
    <damageMultipliers>
      <li>
        <damageDef>Flame</damageDef>
        <multiplier>0</multiplier>
      </li>
    </damageMultipliers>
    <generateCommonality>4</generateCommonality> <!-- generate more often than other problem causers for mech clusters -->
    <building>
      <buildingTags>
        <li>MechClusterMember</li>
        <li>MechClusterProblemCauser</li>
      </buildingTags>
      <combatPower>220</combatPower>
      <turretGunDef>Artillery_AutoMortar</turretGunDef>
      <turretBurstWarmupTime>4.0</turretBurstWarmupTime>
      <turretBurstCooldownTime>80.0</turretBurstCooldownTime>
      <turretInitialCooldownTime>120</turretInitialCooldownTime>
      <minMechClusterPoints>660</minMechClusterPoints>
      <soundAmbient>MechTurretBig_Call</soundAmbient>
    </building>
    <uiIconPath>Things/Building/Security/TurretMortar_MenuIcon</uiIconPath>
  </ThingDef>

  <ThingDef ParentName="BaseArtilleryWeapon">
    <defName>Artillery_AutoMortar</defName>
    <label>auto-mortar</label>
    <graphicData>
      <texPath>Things/Building/Mech/TurretMechMortar_Top</texPath>
    </graphicData>
    <uiIconScale>1.25</uiIconScale>
    <weaponTags>
      <li>Artillery_BaseDestroyer</li>
    </weaponTags>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <defaultProjectile>Bullet_Shell_HighExplosive</defaultProjectile>
        <forcedMissRadius>10</forcedMissRadius>
        <ai_AvoidFriendlyFireRadius>3</ai_AvoidFriendlyFireRadius>
        <warmupTime>4</warmupTime>
        <minRange>29.9</minRange>
        <range>500</range>
        <burstShotCount>1</burstShotCount>
        <soundCast>Mortar_LaunchA</soundCast>
        <soundCastTail>GunTail_Light</soundCastTail>
        <muzzleFlashScale>16</muzzleFlashScale>
        <requireLineOfSight>false</requireLineOfSight>
        <targetParams>
          <canTargetLocations>true</canTargetLocations>
        </targetParams>
      </li>
    </verbs>
  </ThingDef>

</Defs>