<?xml version="1.0" encoding="utf-8"?>
<ThingDefs>
  <!--=============== Improvised turret ===============-->
  <ThingDef ParentName="BuildingBase_MTV">
    <defName>Vanya_PulseTurret</defName>
    <label>脉冲机枪塔</label>
    <thingClass>Building_TurretGun</thingClass>
    <graphicData>
      <texPath>Vanya/Things/Building/Security/Vanya_PulseTurret</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(3,3)</drawSize>
      <shaderType>CutoutComplex</shaderType>
      <damageData>
        <rect>(0.2,0.2,0.6,0.6)</rect>
      </damageData>
    </graphicData>
    <minifiedDef>MinifiedFurniture</minifiedDef>
    <altitudeLayer>Building</altitudeLayer>
    <stealable>false</stealable>
    <rotatable>false</rotatable>
    <statBases>
      <MaxHitPoints>180</MaxHitPoints>
      <Flammability>0</Flammability>
      <WorkToBuild>36000</WorkToBuild>
      <Mass>100</Mass>
      <Beauty>0</Beauty>
    </statBases>
    <tickerType>Normal</tickerType>
    <comps>
      <li Class="CompProperties_Explosive">
        <explosiveRadius>3.9</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
        <chanceNeverExplodeFromDamage>0.5</chanceNeverExplodeFromDamage>
      </li>
      <li Class="CompProperties_Forbiddable" />
      <li Class="CompProperties_Power">
        <compClass>CompPowerTrader</compClass>
        <basePowerConsumption>998</basePowerConsumption>
      </li>
      <li Class="CompProperties_Flickable" />
      <li Class="CompProperties_Breakdownable" />
    </comps>
    <description>装载了脉冲机枪的炮塔，发射聚集的能量团，能够造成扩散性的伤害。</description>
    <passability>PassThroughOnly</passability>
    <pathCost>50</pathCost>
    <fillPercent>0.4</fillPercent>
    <castEdgeShadows>true</castEdgeShadows>
    <hasTooltip>true</hasTooltip>
    <stuffCategories>
      <li>Metallic</li>
    </stuffCategories>
    <costStuffCount>75</costStuffCount>
    <costList>
      <Vanya_Cobalt>50</Vanya_Cobalt>
      <Component>25</Component>
      <Vanya_InstabEnergon>3</Vanya_InstabEnergon>
    </costList>
    <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
    <designationCategory>Security</designationCategory>
    <specialDisplayRadius>32</specialDisplayRadius>
    <building>
      <ai_combatDangerous>true</ai_combatDangerous>
      <turretGunDef>Vanya_PulseTurretGun</turretGunDef>
      <turretBurstCooldownTime>0.67</turretBurstCooldownTime>
      <turretTopgraphicPath>Vanya/Things/Building/Security/Vanya_PulseTurret_Top</turretTopgraphicPath>
    </building>
    <researchPrerequisites>
      <li>Vanya_RootCCAI</li>
    </researchPrerequisites>
  </ThingDef>
  <ThingDef ParentName="BaseBullet_MTV">
    <defName>Bullet_Vanya_PulseTurretGun</defName>
    <label>脉冲</label>
    <graphicData>
      <texPath>Vanya/Things/Projectile/Bullet_Vanya_PulseTurretGun</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <projectile>
      <damageDef>Vanya_IgnoreDiffusion</damageDef>
      <damageAmountBase>15</damageAmountBase>
      <speed>110</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseGun_MTV">
    <defName>Vanya_PulseTurretGun</defName>
    <label>脉冲机枪</label>
    <graphicData>
      <texPath>Things/Item/Equipment/WeaponRanged/ChargeRifle</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <menuHidden>true</menuHidden>
    <description>脉冲机枪</description>
    <soundInteract>InteractRifle</soundInteract>
    <canBeSpawningInventory>false</canBeSpawningInventory>
    <tradeability>Never</tradeability>
    <destroyOnDrop>true</destroyOnDrop>
    <statBases>
      <AccuracyTouch>0.80</AccuracyTouch>
      <AccuracyShort>0.78</AccuracyShort>
      <AccuracyMedium>0.70</AccuracyMedium>
      <AccuracyLong>0.66</AccuracyLong>
      <RangedWeapon_Cooldown>0.66</RangedWeapon_Cooldown>
    </statBases>
    <weaponTags>
      <li>TurretGun</li>
    </weaponTags>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <projectileDef>Bullet_Vanya_PulseTurretGun</projectileDef>
        <warmupTime>1.5</warmupTime>
        <range>32</range>
        <burstShotCount>1</burstShotCount>
        <soundCast>GunShotA</soundCast>
        <soundCastTail>GunTail_Light</soundCastTail>
        <muzzleFlashScale>9</muzzleFlashScale>
      </li>
    </verbs>
  </ThingDef>
  <!-- ================ Mortars ==================-->
  <ThingDef ParentName="BuildingBase_MTV">
    <defName>Vanya_MassTurret</defName>
    <label>质量加速炮</label>
    <description>电磁驱动将钨芯弹发射到指定位置，造成毁灭性打击。</description>
    <thingClass>Building_TurretGun</thingClass>
    <graphicData>
      <texPath>Vanya/Things/Building/Security/Vanya_MassTurret</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(3.6,3.6)</drawSize>
      <shaderType>CutoutComplex</shaderType>
      <damageData>
        <rect>(0.38,0.2,0.56375,0.8)</rect>
        <cornerTL>Damage/Corner</cornerTL>
      </damageData>
    </graphicData>
    <minifiedDef>MinifiedFurniture</minifiedDef>
    <altitudeLayer>Building</altitudeLayer>
    <hasInteractionCell>True</hasInteractionCell>
    <interactionCellOffset>(0,0,-1)</interactionCellOffset>
    <stealable>false</stealable>
    <size>(2,2)</size>
    <passability>PassThroughOnly</passability>
    <pathCost>50</pathCost>
    <fillPercent>0.4</fillPercent>
    <castEdgeShadows>true</castEdgeShadows>
    <costStuffCount>250</costStuffCount>
    <stuffCategories>
      <li>Metallic</li>
    </stuffCategories>
    <costList>
      <Vanya_Cobalt>500</Vanya_Cobalt>
      <Vanya_tombarthite>5</Vanya_tombarthite>
      <Vanya_InstabEnergon>20</Vanya_InstabEnergon>
    </costList>
    <tickerType>Normal</tickerType>
    <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
    <designationCategory>Security</designationCategory>
    <comps>
      <li Class="CompProperties_Forbiddable" />
      <li Class="CompProperties_Mannable">
        <manWorkType>Violent</manWorkType>
      </li>
      <li Class="CompProperties_Explosive">
        <explosiveRadius>4.9</explosiveRadius>
        <explosiveDamageType>Bomb</explosiveDamageType>
      </li>
    </comps>
    <statBases>
      <MaxHitPoints>390</MaxHitPoints>
      <Flammability>1.0</Flammability>
      <WorkToBuild>2700</WorkToBuild>
      <Mass>200</Mass>
      <Beauty>-60</Beauty>
    </statBases>
    <building>
      <turretGunDef>Vanya_MassTurretGun</turretGunDef>
      <turretTopgraphicPath>Vanya/Things/Building/Security/Vanya_MassTurret_Top</turretTopgraphicPath>
      <turretShellDef>Vanya_WolframiumShell</turretShellDef>
      <turretBurstwarmupTime>2.0</turretBurstwarmupTime>
      <turretBurstCooldownTime>6.0</turretBurstCooldownTime>
      <buildingTags>
        <li>Artillery</li>
        <li>Artillery_BaseDestroyer</li>
      </buildingTags>
    </building>
    <placeWorkers>
      <li>PlaceWorker_NotUnderRoof</li>
    </placeWorkers>
    <researchPrerequisites>
      <li>Vanya_RootCCAI</li>
    </researchPrerequisites>
  </ThingDef>
  <ThingDef>
    <defName>Vanya_MassTurretGun</defName>
    <label>质量加速炮</label>
    <description>电磁驱动将钨芯弹发射到指定位置，造成毁灭性打击。</description>
    <category>Item</category>
    <thingClass>ThingWithComps</thingClass>
    <equipmentType>Primary</equipmentType>
    <tickerType>Never</tickerType>
    <techLevel>Industrial</techLevel>
    <destroyOnDrop>True</destroyOnDrop>
    <menuHidden>True</menuHidden>
    <tradeability>Never</tradeability>
    <weaponTags>
      <li>Artillery</li>
      <li>Artillery_BaseDestroyer</li>
    </weaponTags>
    <comps>
      <li>
        <compClass>CompEquippable</compClass>
      </li>
    </comps>
    <verbs>
      <li>
        <verbClass>Verb_Shoot</verbClass>
        <forceNormalTimeSpeed>false</forceNormalTimeSpeed>
        <hasStandardCommand>true</hasStandardCommand>
        <projectileDef>Bullet_Vanya_MassTurretGun</projectileDef>
        <forcedMissRadius>2</forcedMissRadius>
        <warmupTime>5.8</warmupTime>
        <minRange>15</minRange>
        <range>500</range>
        <burstShotCount>1</burstShotCount>
        <soundCast>Mortar_LaunchA</soundCast>
        <muzzleFlashScale>16</muzzleFlashScale>
        <targetParams>
          <canTargetLocations>true</canTargetLocations>
        </targetParams>
      </li>
    </verbs>
  </ThingDef>
  <ThingDef ParentName="BaseBullet_MTV">
    <defName>Bullet_Vanya_MassTurretGun</defName>
    <label>钨芯高爆弹</label>
    <graphicData>
      <texPath>Vanya/Things/Projectile/Bullet_Vanya_MassTurretGun</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>TransparentPostLight</shaderType>
    </graphicData>
    <thingClass>Projectile_DoomsdayRocket</thingClass>
    <projectile>
      <damageDef>Bomb</damageDef>
      <damageAmountBase>100</damageAmountBase>
      <speed>80</speed>
      <explosionRadius>9.5</explosionRadius>
      <flyOverhead>true</flyOverhead>
      <soundHitThickRoof>ArtilleryHitThickRoof</soundHitThickRoof>
      <soundExplode>MortarBomb_Explode</soundExplode>
      <soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
      <soundAmbient>MortarRound_Ambient</soundAmbient>
    </projectile>
  </ThingDef>
  <!--Storage-->
  <ThingDef ParentName="BuildingBase_MTV">
    <defName>Vanya_ShellRack</defName>
    <label>弹药架</label>
    <thingClass>Building_Storage</thingClass>
    <graphicData>
      <texPath>Vanya/Things/Building/Security/Vanya_ShellRack</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(2,1)</drawSize>
      <shaderType>CutoutComplex</shaderType>
    </graphicData>
    <altitudeLayer>Building</altitudeLayer>
    <passability>PassThroughOnly</passability>
    <fillPercent>0.4</fillPercent>
    <castEdgeShadows>true</castEdgeShadows>
    <stuffCategories>
      <li>Metallic</li>
      <li>Woody</li>
      <li>Stony</li>
    </stuffCategories>
    <costStuffCount>45</costStuffCount>
    <statBases>
      <MaxHitPoints>200</MaxHitPoints>
      <Mass>8</Mass>
      <WorkToBuild>1800</WorkToBuild>
      <Flammability>1.0</Flammability>
    </statBases>
    <description>可以存储炮弹和装备，不会老化。</description>
    <size>(2,1)</size>
    <building>
      <preventDeterioration>true</preventDeterioration>
      <fixedStorageSettings>
        <filter>
          <categories>
            <li>Weapons</li>
            <li>Apparel</li>
          </categories>
          <thingDefs>
            <li>MortarShell</li>
            <li>Vanya_WolframiumShell</li>
          </thingDefs>
        </filter>
      </fixedStorageSettings>
      <defaultStorageSettings>
        <priority>Important</priority>
        <filter>
          <thingDefs>
            <li>MortarShell</li>
            <li>Vanya_WolframiumShell</li>
          </thingDefs>
        </filter>
      </defaultStorageSettings>
    </building>
    <inspectorTabs>
      <li>ITab_Storage</li>
    </inspectorTabs>
    <staticSunShadowHeight>0.5</staticSunShadowHeight>
    <surfaceType>Item</surfaceType>
    <comps>
      <li>
        <compClass>CompQuality</compClass>
      </li>
    </comps>
    <DesignationCategory>Furniture</DesignationCategory>
    <minifiedDef>MinifiedFurniture</minifiedDef>
    <tradeTags>
      <li>Furniture</li>
    </tradeTags>
  </ThingDef>
</ThingDefs>