<?xml version="1.0" encoding="utf-8"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude">
	<Tags></Tags>
	<Includes>
		<Include
			type="all"
			source="DATA:GlobalData/GlobalDefines.xml" />
		<Include
			type="all"
			source="ART:NBLsrCann_SKN.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_IDLA.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_UPAK.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_BLD.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_D2SN.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_D2AN.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_D3SN.w3x" />
		<Include
			type="all"
			source="ART:NBLsrCann_D3AN.w3x" />
		<Include
			type="all"
			source="ART:FXTracerGDI.xml" />
		<Include
			type="all"
			source="DATA:GlobalData/GlobalDefines.xml" />
		<!-- Base Object -->
		<Include
			type="instance"
			source="DATA:BaseObjects/BaseStructure.xml" />
	</Includes>
	<GameObject
		id="NODLaserCannonSpawn"
		inheritFrom="BaseStructure"
		SelectPortrait="Portrait_NODLaserTurret"
		ButtonImage="Portrait_NODLaserTurret"
		Side="NOD"
		EditorSorting="STRUCTURE"
		TransportSlotCount="1"
		BuildCost="400"
		BuildTime="4"
		CommandSet="GDIWatchTowerCommandSet"
		KindOf="STRUCTURE SELECTABLE IMMOBILE CAN_CAST_REFLECTIONS POWERED AUTO_ACQUIRABLE_BY_AI COVER CAN_ATTACK NOT_SELLABLE KEEP_CLASSIFIED_WHEN_DEAD ATTACK_NEEDS_LINE_OF_SIGHT CANT_TOGGLE_POWER CAN_SEE_THROUGH_STRUCTURE FS_BASE_DEFENSE"
		RadarPriority="STRUCTURE"
		PlacementViewAngle="225d"
		CampnessValue="=$CAMPNESS_DEFENSIVE_STRUCTURE"
		ProductionQueueType="OTHER_STRUCTURE"
		BuildPlacementTypeFlag="OTHER_STRUCTURE"
		EditorName="NODLaserCannonSpawn"
		Description="Desc:NODLaserCannon"
		WeaponCategory="CANNON"
		TypeDescription="Type:NODLaserCannon">
		<DisplayName
			xai:joinAction="Replace" xmlns:xai="uri:ea.com:eala:asset:instance">Name:NODLaserCannon</DisplayName>
		<DisplayUpgrade
			id="Tag_DisplayUpgrade1">Upgrade_NODTechCenterLaserCapacitor</DisplayUpgrade>
		<DisplayUpgrade>Upgrade_NODQuadTurrets</DisplayUpgrade>
			
		<ArmorSet
			Armor="NODBaseDefenceArmor"
			DamageFX="FactionStructureDamageFX" />
		<SkirmishAIInformation
			BaseBuildingLocation="SPREAD" />
		<Draws>
			<ScriptedModelDraw
				id="ModuleTag_Draw"
				OkToChangeModelColor="true"
				ExtraPublicBone="FX_Weapon01 FX_Weapon02">
				<ModelConditionState
					ParseCondStateType="PARSE_DEFAULT">
					<Model
						Name="NBLsrCann_SKN" />
					<WeaponFireFXBone
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon" />
					<WeaponLaunchBone
						WeaponSlotType="PRIMARY_WEAPON"
						BoneName="FX_Weapon" />
					<Turret
						TurretNameKey="Turret"
						TurretPitch="Turret_Pitch"
						TurretID="1" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REPAIRING_DISABLED">
					<Model
						Name="NBLsrCann_D3SN" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="RUBBLE">
					<Model
						Name="NBLsrCann_D3SN" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REALLYDAMAGED">
					<Model
						Name="NBLsrCann_D2SN" />
				</ModelConditionState>
				<ModelConditionState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="DAMAGED">
					<Model
						Name="NBLsrCann_SKN" />
					<Texture
						Original="NBLsrCann"
						New="NBLsrCannD" />
				</ModelConditionState>
				<AnimationState
					ParseCondStateType="PARSE_DEFAULT"
					Flags="RESTART_ANIM_WHEN_COMPLETE">
					<Animation
						AnimationName="NBLsrCann_IDLA"
						AnimationMode="ONCE" />
				</AnimationState>
				<!-- REBUILD FROM RUBBLE ANIMATION -->
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="USER_1">
					<Animation
						AnimationName="NBLsrCann_BLD"
						AnimationMode="ONCE"
						AnimationBlendTime="0" />
				</AnimationState>
				<!-- BUILDUP ANIMATION -->
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="STRUCTURE_UNPACKING">
					<Animation
						AnimationName="NBLsrCann_BLD"
						AnimationMode="ONCE"
						AnimationBlendTime="0" />
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REPAIRING_DISABLED"
					StateName="STATE_Rubble"
					Flags="START_FRAME_LAST">
					<Animation
						AnimationName="NBLsrCann_D3AN"
						AnimationMode="ONCE"
						AnimationBlendTime="0" />
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="RUBBLE"
					StateName="STATE_Rubble"
					Flags="START_FRAME_LAST">
					<Animation
						AnimationName="NBLsrCann_D3AN"
						AnimationMode="ONCE" />
					<Script>
						Prev = CurDrawablePrevAnimationState();
						if Prev ~= "STATE_Rubble" and Prev ~= "TRANS_IntoRubble" then
						CurDrawableSetTransitionAnimState("TRANS_IntoRubble")
						end
					</Script>
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_NORMAL"
					ConditionsYes="REALLYDAMAGED"
					StateName="STATE_ReallyDamaged"
					Flags="START_FRAME_LAST">
					<Animation
						AnimationName="NBLsrCann_D2AN"
						AnimationMode="MANUAL" />
					<Script>
						Prev = CurDrawablePrevAnimationState();
						if Prev ~= "STATE_ReallyDamaged" and Prev ~= "TRANS_IntoReallyDamaged" then
						CurDrawableSetTransitionAnimState("TRANS_IntoReallyDamaged")
						end
					</Script>
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_TRANSITION"
					StateName="TRANS_IntoReallyDamaged">
					<Animation
						AnimationName="NBLsrCann_D2AN"
						AnimationMode="ONCE"
						AnimationBlendTime="0" />
				</AnimationState>
				<AnimationState
					ParseCondStateType="PARSE_TRANSITION"
					StateName="TRANS_IntoRubble">
					<Animation
						AnimationName="NBLsrCann_D3AN"
						AnimationMode="ONCE"
						AnimationBlendTime="0" />
				</AnimationState>
			</ScriptedModelDraw>
			<LaserDraw
				id="ModuleTag_LaserDraw"
				Texture1_UTile="1"
				Texture1_VTile=".5"
				Texture1_UScrollRate="0"
				Texture1_VScrollRate=".2"
				Texture1_NumFrames="1"
				Texture1_FrameRate="30"
				Texture2_UTile="1"
				Texture2_VTile=".03"
				Texture2_UScrollRate="0"
				Texture2_VScrollRate="1"
				Texture2_NumFrames="1"
				Texture2_FrameRate="30"
				LaserWidth="20">
				<FXShader
					ShaderName="Laser.fx"
					TechniqueIndex="0">
					<Constants>
						<Texture
							Name="Texture1">
							<Value>FXObeliskLaser</Value>
						</Texture>
						<Texture
							Name="Texture2">
							<Value>FXLaserOverlay</Value>
						</Texture>
					</Constants>
				</FXShader>
			</LaserDraw>
		</Draws>
		<Behaviors>
			<WeaponSetUpdate
				id="ModuleTag_WeaponSetUpdate">
				<WeaponSlotTurret
					ID="1">
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="NODLaserCannonWeapon" />
					<Weapon
						Ordering="PRIMARY_WEAPON"
						Template="NODLaserCannonCapacitorsWeapon" 
						ObjectStatus="WEAPON_UPGRADED_01" />

					<TurretSettings
						TurretTurnRate="360"
						TurretPitchRate="100"
						AllowsPitch="true"
						MinimumPitch="-60d"
						PitchHeight="90%"
						MinIdleScanTime="1.0s"
						MaxIdleScanTime="5.0s"
						MinIdleScanAngle="0.0"
						MaxIdleScanAngle="180.0">
						<TurretAITargetChooserData />
					</TurretSettings>
				</WeaponSlotTurret>
			</WeaponSetUpdate>
			<LaserState
				id="ModuleTag_LaserState"
				LaserId="0"></LaserState>
			<FXListBehavior
				id="ModuleTag_FXList">
				<DieMuxData
					DeathTypes="ALL" />
				<Event
					Index="onDeath"
					FX="FX_NOD_DefensiveTurret_Explode" />
				<Event
					Index="onTransitionToDamaged"
					FX="FX_BuildDamaged_Small" />
				<Event
					Index="onTransitionToReallyDamaged"
					FX="FX_BuildDamaged_Small" />
				<Event
					Index="onTransitionToRubble"
					FX="FX_BuildRubble_Small" />
			</FXListBehavior>	
			
			<StatusBitsUpgrade
				id="ModuleTag_UpgradeWeapon"
				StatusToSet="WEAPON_UPGRADED_01">
				<TriggeredBy>Upgrade_NODTechCenterLaserCapacitor</TriggeredBy>
			</StatusBitsUpgrade>
			
		<!-- causing weird animation bug
		
			<AttributeModifierUpgrade
				id="Upgrade_LaserROF"
				AttributeModifier="AttributeModifier_LaserROF"
				Permanent="true">
				<TriggeredBy>Upgrade_NODTechCenterLaserCapacitor</TriggeredBy>
			</AttributeModifierUpgrade>
		-->
			<SlavedUpdate
				id="ModuleTag_SlavedUpdate"
				DieOnMastersDeath="true"
				DieOnMastersDeathType="SUICIDED" />
			<StructureUnpackUpdate
				UnpackTime="1.5s" />
			<!-- master was sold or destroyed. Commit suicide by dying slowly -->
			<SlowDeath
				id="ModuleTag_Death"
				SinkDelay="3.0s"
				SinkRate="4.0"
				DestructionDelay="8.0s">
				<DieMuxData
					DeathTypes="SUICIDED" />
			</SlowDeath>			
			<KeepObjectDie
				id="ModuleTag_KeepObjectForRepair">
				<DieMuxData
					DeathTypes="ALL"
					DeathTypesForbidden="SUICIDED" />
			</KeepObjectDie>
			<InitiateRepairDie
				id="ModuleTag_InitiateRepair"
				DelayTime="20s"
				Options="REPAIR_INSTANT"
				InstantRepairModelCondition="USER_1"
				InstantRepairAnimDuration="1.5s"
				MasterDeadDieFX="FX_TEMPLarge">
				<Die
					DeathTypes="ALL"
					DeathTypesForbidden="SUICIDED" />
			</InitiateRepairDie>
			<xi:include
				href="../../Includes/GenericBuildingRepairNODDefenseSpawns.xml" />
		<AudioLoopUpgrade 
				id="LaserCapacitorUpgradeSound" 
				SoundToPlay="NOD_LaserCapacitor_Upgrade">
        	<TriggeredBy>Upgrade_NODTechCenterLaserCapacitor</TriggeredBy>
      </AudioLoopUpgrade>
		</Behaviors>
		<AI>
			<AIUpdate
				id="AIUpdate"
				AutoAcquireEnemiesWhenIdle="YES">
				<UnitAITargetChooserData
					CanPickDynamicTargets="false"
					CheckVisionRange="false" />
			</AIUpdate>
			<!--					
			<DeployStyleAIUpdate
				id="ModuleTag_AI"
				AutoAcquireEnemiesWhenIdle="YES"
				UnpackTime="1s"
				PackTime="1s"
				MustDeployToAttack="true">
				<UnitAITargetChooserData
					CheckVisionRange="false"
					CanPickDynamicTargets="false" />
			</DeployStyleAIUpdate>
-->
		</AI>
		<Body>
			<ActiveBody
				id="ModuleTag_Body"
				MaxHealth="1000.0" />
		</Body>
		<ClientBehaviors>
			<ModelConditionAudioLoopClientBehavior
				id="MT_MCALCB">
				<!-- Repaired by InitiateRepairDie -->
				<ModelConditionSound
					Sound="NOD_GenericTurret_Regenerate"
					RequiredFlags="USER_1" />
			</ModelConditionAudioLoopClientBehavior>
		</ClientBehaviors>
		<Geometry
			IsSmall="false">
			<Shape
				Type="CYLINDER"
				MajorRadius="9.0"
				Height="23.0"
				ContactPointGeneration="INFANTRY"/>
		</Geometry>
		<AudioArrayVoice>
			<AudioEntry
				Sound="NOD_LaserTurret"
				AudioType="voiceSelect" />
		</AudioArrayVoice>
		<AudioArraySound>
			<AudioEntry
				Sound="AudioEvent:NOD_GenericTurret_MoveStart"
				AudioType="soundTurretMoveLoop" />
			<AudioEntry
				Sound="NOD_GenericTurret_Deploy"
				AudioType="soundPrepositioned" />
			<AudioEntry Sound="Nod_BuildingPlacedForTurrets" AudioType="soundUnderConstruction" />
			<AudioEntry Sound="HumanFaction_SmallBuilding_LightDamageMS" AudioType="soundOnDamaged" />
			<AudioEntry Sound="HumanFaction_SmallBuilding_HeavyDamageMS" AudioType="soundOnReallyDamaged" />
		</AudioArraySound>
		<ShadowInfo
			Type="VOLUME" />
		<VisionInfo
			VisionRange="450"
			ShroudClearingRange="500" />
	</GameObject>
</AssetDeclaration>