<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xi="http://www.w3.org/2001/XInclude">
	<Tags></Tags>
	<Includes>
		<Include
			type="all"
			source="DATA:GlobalData/GlobalDefines.xml" />
		<Include
			type="all"
			source="ART:GBBtleBase.w3x" />
		<Include
			type="all"
			source="ART:GURigUPAK_SN.w3x" />
		<Include
			type="all"
			source="ART:GURigUPAK_AN.w3x" />
		<Include
			type="all"
			source="ART:GBBtleBase_D3SN.w3x" />
		<Include
			type="all"
			source="ART:GBBtleBase_D3AN.w3x" />
		<Include
			type="all"
			source="ART:FXInvisBone.w3x" />
		<Include
			type="all"
			source="ART:Decal_Rig_CO.xml" />
		<!-- Base Object -->
		<Include
			type="instance"
			source="DATA:BaseObjects/BaseStructure.xml" />
	</Includes>
	<!-- note: BuildTime is needed for the repair time. -->
	<GameObject
		id="GDIBattleBase"
		inheritFrom="BaseStructure"
		Side="GDI"
		EditorSorting="STRUCTURE"
		SelectPortrait="Portrait_GDIBattleBase"
		ButtonImage="Portrait_GDIBattleBase"
		BuildTime="20"
		BuildCost="2000"
		CommandSet="GDIBattleBaseCommandSet"
		KindOf="PRELOAD STRUCTURE SELECTABLE IMMOBILE SCORE ATTACK_NEEDS_LINE_OF_SIGHT CAN_ATTACK AIRFIELD FS_BASE_DEFENSE AUTO_ACQUIRABLE_BY_AI COVER"
		RadarPriority="STRUCTURE"
		BuildCompletion="PLACED_BY_PLAYER"
		ProductionQueueType="OTHER_STRUCTURE"
		BuildPlacementTypeFlag="OTHER_STRUCTURE"
		EditorName="GDIBattleBase"
		Description="DESC:GDIForwardBattleBase"
		TypeDescription="Type:GDIForwardBattleBase">
		<DisplayName
			xai:joinAction="Replace" xmlns:xai="uri:ea.com:eala:asset:instance">Name:GDIBattleBase</DisplayName>
		<DisplayUpgrade
			id="Tag_DisplayUpgrade1">Upgrade_GDIArmoryRailgunTech</DisplayUpgrade>			
		<ArmorSet
			Armor="GDIBattleBaseArmor"
			DamageFX="FactionStructureDamageFX" />
		<SkirmishAIInformation
			BaseBuildingLocation="FRONT" />
		<Draws>
			<ScriptedModelDraw
				id="ModuleTag_Draw"
				OkToChangeModelColor="true"
				UseStandardModelNames="true"
				StaticModelLODMode="true"
				InitialRecoilSpeed="10.0"
				MaxRecoilDistance="4.0"
				RecoilDamping="2.0"
				RecoilSettleSpeed="0.7">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model
						Name="GBBtleBase" />
					<WeaponFireFXBone
						WeaponSlotID="1"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon01" />
					<WeaponFireFXBone
						WeaponSlotID="2"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon02" />
					<WeaponFireFXBone
						WeaponSlotID="3"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon03" />
					<WeaponRecoilBone
						WeaponSlotID="1"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="GUN_L" />
					<WeaponRecoilBone
						WeaponSlotID="2"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="GUN_R" />
					<WeaponLaunchBone
						WeaponSlotID="1"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon01" />
					<WeaponLaunchBone
						WeaponSlotID="2"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon02" />
					<WeaponLaunchBone
						WeaponSlotID="3"
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon03" />
					<Turret
						TurretNameKey="Turret_L"
						TurretPitch="Turret_Pitch_L"
						TurretID="1" />
					<Turret
						TurretNameKey="Turret_R"
						TurretPitch="Turret_Pitch_R"
						TurretID="2" />
					<Turret
						TurretNameKey="ROCKETS"
						TurretID="3" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="STRUCTURE_UNPACKING REALLYDAMAGED">
					<Model
						Name="GURigUPAK_SN" />
					<Texture
						Original="GURig"
						New="GURig_D" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="STRUCTURE_UNPACKING">
					<Model
						Name="GURigUPAK_SN" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="UNPACKING">
					<Model
						Name="GURigUPAK_SN" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="RUBBLE">
					<Model
						Name="GBBtleBase_D3SN" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REALLYDAMAGED">
					<Model
						Name="GBBtleBase" />
					<Texture
						Original="GURig"
						New="GURig_D" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="DAMAGED">
					<Model
						Name="GBBtleBase" />
					<Texture
						Original="GURig"
						New="GURig_D" />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType="PARSE_DEFAULT">
					<Animation
						AnimationName="GBBtleBase"
						AnimationMode="LOOP" />
				</AnimationState>
				<!-- BUILDUP ANIMATION -->
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="STRUCTURE_UNPACKING">
					<Animation
						AnimationName="GURigUPAK_AN"
						AnimationMode="ONCE" />
					<ParticleSysBone
						BoneName="NONE"
						FXParticleSystemTemplate="Con_Small"
						FollowBone="true" />
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="UNPACKING">
					<Animation
						AnimationName="GURigUPAK_AN"
						AnimationMode="ONCE" />
					<ParticleSysBone
						BoneName="NONE"
						FXParticleSystemTemplate="Con_Small"
						FollowBone="true" />
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="RUBBLE"
					StateName="STATE_Rubble"
					Flags="START_FRAME_LAST">
					<Animation
						AnimationName="GBBtleBase_D3AN"
						AnimationMode="MANUAL" />
					<Script>
						Prev = CurDrawablePrevAnimationState();
						if Prev ~= "STATE_Rubble" and Prev ~= "TRANS_IntoRubble" then
						CurDrawableSetTransitionAnimState("TRANS_IntoRubble")
						end
					</Script>
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_TRANSITION"
					StateName="TRANS_IntoRubble">
					<Animation
						AnimationName="GBBtleBase_D3AN"
						AnimationMode="ONCE"
						AnimationBlendTime="0" />
				</AnimationState>
			</ScriptedModelDraw>
			<SpotlightDraw
				id="ModuleTag_Spotlight"
				AttachToBoneInAnotherModule="bone_stealthdetector"
				RefreshTime="2.0s"
				SweepTime="1.0s">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model
						Name="FXspotlight" />
				</ModelConditionState>
			</SpotlightDraw>
			<!-- draw a decal when this thing is selected -->
			<!-- This is duplicated in several files. Please do a search and update those too -->
			<ScriptedModelDraw
				id="ModuleTag_Draw_Selected_Repair_Decal"
				OkToChangeModelColor="true"
				UseStandardModelNames="true"
				StaticModelLODMode="true">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model Name="" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="SELECTED">
					<Model Name="FXInvisBone" />
					<ShadowInfo
						Type="ADDITIVE_DECAL"
						SizeX="=$BATTLEBASE_REPAIR_DRONE_HOME_DECAL_SIZE"
						SizeY="=$BATTLEBASE_REPAIR_DRONE_HOME_DECAL_SIZE"
						OverrideLODVisibility="true"
						MaxHeight="200"
						UseHouseColor="true"
						LocalPlayerOnly="true"
						Texture="Decal_Rig_CO" 
					/>
				</ModelConditionState>
			</ScriptedModelDraw>
		</Draws>
		<Behaviors>
			<WeaponSetUpdate
				id="ModuleTag_Weapon01SetUpdate">
				<WeaponSlotTurret
					ID="1">
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="GDIBattleBaseCannon" />
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="GDIGolemCannonRailgun"
						ObjectStatus="WEAPON_UPGRADED_01" />						
					<TurretSettings
						NaturalTurretAngle="90d"
						TurretTurnRate="200"
						TurretPitchRate="100"
						AllowsPitch="true"
						MinimumPitch="-10d"
						MaxDeflectionAntiClockwise="120d"
						MaxDeflectionClockwise="120d"
						PitchHeight="90%"
						MinIdleScanTime="1.0s"
						MaxIdleScanTime="5.0s"
						MinIdleScanAngle="0.0"
						MaxIdleScanAngle="90.0">
						<TurretAITargetChooserData />
					</TurretSettings>
				</WeaponSlotTurret>
				<WeaponSlotTurret
					ID="2">
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="GDIBattleBaseCannon" />
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="GDIGolemCannonRailgun"
						ObjectStatus="WEAPON_UPGRADED_01" />						
					<TurretSettings
						NaturalTurretAngle="270d"
						TurretTurnRate="200"
						TurretPitchRate="100"
						AllowsPitch="true"
						MinimumPitch="-10d"
						MaxDeflectionAntiClockwise="120d"
						MaxDeflectionClockwise="120d"
						PitchHeight="90%"
						MinIdleScanTime="1.0s"
						MaxIdleScanTime="5.0s"
						MinIdleScanAngle="0.0"
						MaxIdleScanAngle="90.0">
						<TurretAITargetChooserData />
					</TurretSettings>
				</WeaponSlotTurret>
				<WeaponSlotTurret
					ID="3">
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="GDIBattleBaseMissileWeapon" />
					<TurretSettings
						TurretTurnRate="180"
						TurretPitchRate="40"
						AllowsPitch="false"
						MinIdleScanTime="1.0s"
						MaxIdleScanTime="5.0s"
						MinIdleScanAngle="0.0"
						MaxIdleScanAngle="90.0">
						<TurretAITargetChooserData />
					</TurretSettings>
				</WeaponSlotTurret>
			</WeaponSetUpdate>
			<SlowDeath
				id="ModuleTag_Death"
				SinkDelay="5.0s"
				SinkRate="4.0"
				DestructionDelay="11.0s">
				<Sound Type="INITIAL" List="HumanFaction_MediumBuilding_DieMS" />
				<DieMuxData
					DeathTypes="ALL" />
			</SlowDeath>
			<StatusBitsUpgrade
				id="ModuleTag_UpgradeWeapon"
				StatusToSet="WEAPON_UPGRADED_01">
				<TriggeredBy>Upgrade_GDIArmoryRailgunTech</TriggeredBy>
			</StatusBitsUpgrade>		
			<StatusBitsUpgrade
				id="ModuleTag_UpgradeWeaponStatusSetForRGA"
				StatusToSet="RIDER2">
				<TriggeredBy>Upgrade_GDIArmoryRailgunTech</TriggeredBy>
			</StatusBitsUpgrade>			
			<FXListBehavior
				id="ModuleTag_FXList">
				<DieMuxData
					DeathTypes="ALL" />
				<Event
					Index="onTransitionToDamaged"
					FX="FX_BuildDamaged_Medium" />
				<Event
					Index="onTransitionToReallyDamaged"
					FX="FX_BuildDamaged_Medium" />
				<Event
					Index="onTransitionToRubble"
					FX="FX_BuildRubble_Medium" />
			</FXListBehavior>
			<StructureUnpackUpdate
				UnpackTime="0.1s" />
			<ProductionUpdate
				id="ModuleTag_ProductionUpdate" />
			<xi:include
				href="DATA:Includes/GenericPackPower.xml" />
			<xi:include
				href="DATA:Includes/GenericPackUpdate.xml" />
			<ReplaceSelfUpgrade
				id="ModuleTag_ReplaceSelf"
				NewObjectUnpackTime="3s">
				<TriggeredBy>Upgrade_Pack</TriggeredBy>
				<ReplacementTemplate>GDIRig</ReplacementTemplate>
			</ReplaceSelfUpgrade>
			<StealthDetectorUpdate
				id="ModuleTag_StealthDetect"
				DetectionRange="=$GDI_BATTLEBASE_STEALTH_DETECTION_RANGE" />
			<AssignSlavesTargetObjectSpecialPower
				id="ModuleTag_SpecialPowerRepairVehicle"
				SpecialPowerTemplate="SpecialPower_TargetedRepairVehicle" />
			<SpawnBehavior
				id="ModuleTag_SpawnRepairDrones"
				SpawnNumberData="3"
				InitialBurst="3"
				SpawnReplaceDelayData="10s"
				SpawnedRequireSpawner="true"
				KillSpawnsOnCaptured="true"
				KillSpawnsOnDisabled="true"
				SpawnInsideBuilding="true">
				<Die
					DeathTypes="ALL" />
				<SpawnTemplate>GDIBattleBaseRepairDrone</SpawnTemplate>
			</SpawnBehavior>
			<xi:include
				href="../../Includes/GenericBuildingRepair.xml" />
			<xi:include
				href="../../Includes/GenericEngineerContain.xml" />
	      <AudioLoopUpgrade id="PackSound" SoundToPlay="GDI_Rig_Unpack1">
	        <TriggeredBy>Upgrade_Pack</TriggeredBy>
	      </AudioLoopUpgrade>  
		</Behaviors>
		<AI>
			<AIUpdate
				id="ModuleTag_AI"
				AutoAcquireEnemiesWhenIdle="YES">
				<UnitAITargetChooserData
					SympathyRange="25.0" />
			</AIUpdate>
		</AI>
		<Body>
			<ActiveBody
				id="ModuleTag_Body"
				MaxHealth="5500" />
		</Body>
		<ClientBehaviors>
			<ModelConditionAudioLoopClientBehavior id="ModuleTag_PackSound">
				<ModelConditionSound Sound="GDI_Rig_Unpack1" RequiredFlags="UNPACKING" />
			</ModelConditionAudioLoopClientBehavior>
		</ClientBehaviors>
		<ClientBehaviors>
			<AnimationSoundClientBehavior id="ModuleTag_ASCB">
				<Sound Sound="GDI_Rig_Unpack3" Animation="GURigUPAK_AN" Frame="62" />
				<Sound Sound="GDI_Rig_Unpack2" Animation="GURigUPAK_AN" Frame="25" />
			</AnimationSoundClientBehavior>
		</ClientBehaviors>
		<Geometry>
			<Shape
				Type="CYLINDER"
				MajorRadius="10.0"
				Height="40.0"
				ContactPointGeneration="INFANTRY" />
			<Shape
				Type="CYLINDER"
				MajorRadius="30.0"
				Height="10.0" />
			<Shape
				Type="CYLINDER"
				MajorRadius="20.0"
				Height="5.0">
				<Offset
					y="35.0" />
			</Shape>
			<Shape
				Type="CYLINDER"
				MajorRadius="20.0"
				Height="5.0">
				<Offset
					y="-35.0" />
			</Shape>
		</Geometry>
		<AudioArrayVoice>
			<AudioEntry
				Sound="AudioEvent:GDI_ForwardBaseCommandSelect"
				AudioType="voiceSelect" />
		</AudioArrayVoice>
		<AudioArraySound>
			<AudioEntry Sound="HumanFaction_MediumBuilding_LightDamageMS" AudioType="soundOnDamaged" />
			<AudioEntry Sound="HumanFaction_MediumBuilding_HeavyDamageMS" AudioType="soundOnReallyDamaged" />
		</AudioArraySound>
		<EvaEvents
			EvaEventDamagedOwner="UnitUnderAttack" />
		<ShadowInfo
			Type="VOLUME" />
		<VisionInfo
			VisionRange="450"
			ShroudClearingRange="500" />
	</GameObject>
</AssetDeclaration>