<?xml version="1.0" encoding="utf-8"?>
<ItemRenderer NPCType="Shriekgazer" NPCTypeID="3">
	<Data>
		<Sprite name="s_sprite" fileName="game/npc1.rttex" textureSize="32" frame="12,9" />
		<Sprite name="s_HitEffect" fileName="game/particles.rttex" textureSize="32" frame="10,9" />
		<Animations>
			<SpriteAnimation name="patrol" sprite="s_sprite" isLoop="true" animTime="700" playOnState="NPC.FlyPatrol">
				<Frame>12,9</Frame>
				<Frame>13,9</Frame>
				<Frame>14,9</Frame>
				<Frame>15,9</Frame>
				<Frame>16,9</Frame>
				<Frame>17,9</Frame>
				<Frame>18,9</Frame>
				<Frame>19,9</Frame>
			</SpriteAnimation>
			<SpriteAnimation name="chase" sprite="s_sprite" isLoop="true" animTime="700" playOnState="NPC.Chase">
				<Frame>0,9</Frame>
				<Frame>1,9</Frame>
				<Frame>2,9</Frame>
				<Frame>3,9</Frame>
				<Frame>4,9</Frame>
				<Frame>5,9</Frame>
				<Frame>6,9</Frame>
				<Frame>7,9</Frame>
			</SpriteAnimation>
			<SpriteAnimation name="anticipation" sprite="s_sprite" isLoop="false" animTime="400" playOnState="NPC.Anticipation">
				<Frame>8,9</Frame>
				<Frame>9,9</Frame>
				<Frame>10,9</Frame>
			</SpriteAnimation>
			<SpriteAnimation name="attack" sprite="s_sprite" isLoop="true" animTime="50" playOnState="NPC.AttackProjectile">
				<Frame>11,9</Frame>
			</SpriteAnimation>
		</Animations>
		<ParticleSystems>
			<ParticleSystem name="ps_HitEffect" updateStage="OnDamaged">
				<Emitter>
					<Set name="particlesPerEmission">10</Set>
				</Emitter>
				<Particle>
					<Set name="sprite">s_HitEffect</Set>
					<Set name="rotateWithVelocity">true</Set>
					<Curve name="initialAlpha">
						<KeyFrame>0, 0</KeyFrame>
						<KeyFrame>0.4, 0</KeyFrame>
						<KeyFrame>0.41, 1</KeyFrame>
						<KeyFrame>1, 0</KeyFrame>
					</Curve>
					<Set name="initialScale">0.5,0.5</Set>
					<Set name="lifeTime">0.5</Set>
					<Set name="initalRGB">0.44,0.27,0.48</Set>
					<RandomRadial name="initialVelocity" angleRange="0,360" radiusRange="30,90" />
				</Particle>
			</ParticleSystem>
		</ParticleSystems>
		<StateMachines>
			<StateMachine name="NPC" ServerOnly="true">
				<States start="FlyPatrol">
					<NPCFlyingPatrol name="FlyPatrol">
						<PatrolSpeed>50</PatrolSpeed>
						<PatrolRange>160</PatrolRange>
						<StayHome>false</StayHome>
					</NPCFlyingPatrol>
					<NPCFlyingChase name="Chase">
						<ChaseSpeed>100</ChaseSpeed>
					</NPCFlyingChase>	
					<NPCFlyingAttack name="AttackProjectile" ExitTime="0.5">
						<AttackTimeoutInSeconds>0</AttackTimeoutInSeconds>
						<ProjectileName>"ShriekgazerProjectile"</ProjectileName>
					</NPCFlyingAttack>
					<NPCAnticipation name="Anticipation" ExitTime="0.5"/>
				</States>
				<Transitions>
					<Transition to="Chase" from="FlyPatrol">
						<Condition type="and">
							<IsPlayerDistanceMatching operatorType="Less">250</IsPlayerDistanceMatching>
							<IsPlayerDistanceMatching operatorType="Greater">200</IsPlayerDistanceMatching>
						</Condition>
					</Transition>	
					<Transition to="Chase" from="AttackProjectile">
						<Condition type="or">
							<IsPlayerDistanceMatching operatorType="Greater">200</IsPlayerDistanceMatching>
							<IsCollidableBetweenTarget Width="32">true</IsCollidableBetweenTarget>
						</Condition>
					</Transition>	
					<Transition to="FlyPatrol" from="Chase|AttackProjectile|Anticipation">
						<Condition>
							<IsPlayerDistanceMatching operatorType="Greater">250</IsPlayerDistanceMatching>
						</Condition>
					</Transition>								
					<Transition to="Anticipation" from="AttackProjectile|Chase">
						<Condition type="and">
							<IsPlayerDistanceMatching operatorType="LessOrEqual">200</IsPlayerDistanceMatching>
							<IsCollidableBetweenTarget Width="32">false</IsCollidableBetweenTarget>
						</Condition>
					</Transition>				
					<Transition to="AttackProjectile" from="Anticipation"/>
				</Transitions>
			</StateMachine>
		</StateMachines>
		<Components>
			<Info/>
			<MustKillNPC/>
			<AttachmentSlotsCmp/>
			<TintOverrideCmp/>
			<Enemy>
				<Set name="SoulsReward">10</Set>
				<Set name="destroyTileId">3452</Set>
			</Enemy>
			<Movement/>
			<Damage>
				<Set name="damage">10</Set>
			</Damage>
			<StateMachine/>
			<NPCRenderActionCmp/>
			<Health>
				<Set name="healthAmount">250</Set>
				<Set name="maxHealth">250</Set>
			</Health>
			<Physics>
				<Set name="acceleration">0, 0</Set>
				<Set name="mass">20</Set>
				<Set name="drag">1.25, 1.25</Set>
			</Physics>
			<CollisionBox>
				<Set name="size">32,32</Set>
				<Set name="CollisionFlag">"PLAYERS|PROJECTILES"</Set>
				<Set name="CollisionType">"ENEMY_NPC"</Set>
			</CollisionBox>
			<DebugDraw/>
		</Components>
	</Data>
	<RenderRules>
		<Render>
			<SpriteRender name="s_sprite"/>
		</Render>
		<RenderInFront>
			<Translate>0,-4,0</Translate>
			<NPCHealthBarRender TexturePath="interface/large/gui_event_npchealth_bar.rttex" TextureSize="17,9" TextureCoordinates="0,0"/>
		</RenderInFront>
	</RenderRules>
</ItemRenderer>