<?xml version="1.0" encoding="utf-8"?>
<ItemRenderer NPCType="BladeofRevolt" NPCTypeID="0">
	<Data>
		<Sprite name="s_sprite" fileName="game/particles11.rttex" textureSize="32" frame="8,24" />
		<Sprite name="s_sprite_glow" fileName="game/particles11.rttex" textureSize="32" frame="9,24" />
		<Sprite name="s_HitEffect" fileName="game/particles9.rttex" textureSize="32" frame="12,0" />
		<Animations>
			<SpriteCurveAnimation name="s_sprite_glow" isLoop="true" autoPlay="true" sprite="s_sprite_glow" animTime="100" playOnState="NPC.Chase">
				<Curve name="alpha">
					<KeyFrame>0.f, 1.f</KeyFrame>
					<KeyFrame>0.2f, 1.f </KeyFrame>
					<KeyFrame>0.4f, 1.f</KeyFrame>
					<KeyFrame>0.8f, 1.f</KeyFrame>
					<KeyFrame>1.f, 1.f</KeyFrame>
				</Curve>
			</SpriteCurveAnimation>
			<SpriteCurveAnimation name="s_sprite_glow_fade" isLoop="true" autoPlay="true" sprite="s_sprite_glow" animTime="100" playOnState="NPC.FlyPatrol">
				<Curve name="alpha">
					<KeyFrame>0.f, 0.f</KeyFrame>
					<KeyFrame>0.2f, 0.f </KeyFrame>
					<KeyFrame>0.4f, 0.f</KeyFrame>
					<KeyFrame>0.8f, 0.f</KeyFrame>
					<KeyFrame>1.f, 0.f</KeyFrame>
				</Curve>
			</SpriteCurveAnimation>
			<CurveAnimationVec3 name="anim_hover" autoPlay="false" isLoop="true" animTime="2000" playOnState="NPC.FlyPatrol" >
				<Curve name="position">
					<KeyFrame>0, 0, 0, 0</KeyFrame>
					<KeyFrame>0.5, 0, -16, 0</KeyFrame>
					<KeyFrame>1, 0, 0, 0</KeyFrame>
				</Curve>
			</CurveAnimationVec3>
			<CurveAnimationVec3 name="anim_normal" autoPlay="false" isLoop="true" animTime="1" playOnState="NPC.Chase|NPC.AttackProjectile" >
				<Curve name="position">
					<KeyFrame>0, 0, 0, 0</KeyFrame>
					<KeyFrame>0.5, 0, 0, 0</KeyFrame>
					<KeyFrame>1, 0, 0, 0</KeyFrame>
				</Curve>
			</CurveAnimationVec3>
			<CurveAnimationVec4 name="attack_rotate" isLoop="true" playOnState="NPC.AttackProjectile" animTime="460">
				<Curve name="rotation">
					<KeyFrame>0, 0, 0,0,1</KeyFrame>
					<KeyFrame>1, 360, 0,0,1</KeyFrame>
				</Curve>
			</CurveAnimationVec4>			
			<CurveAnimationVec4 name="attack_rotate_patrol" isLoop="true" playOnState="NPC.FlyPatrol|NPC.Chase" animTime="100">
				<Curve name="rotation">
					<KeyFrame>0, 0, 0,0,1</KeyFrame>
					<KeyFrame>1, 0, 0,0,1</KeyFrame>
				</Curve>
			</CurveAnimationVec4>		
		</Animations>
		<StateMachines>
			<StateMachine name="NPC" ServerOnly="true">
				<States start="FlyPatrol">
					<NPCFlyingPatrol name="FlyPatrol">
						<PatrolSpeed>0</PatrolSpeed>
						<PatrolRange>0</PatrolRange>
						<StayHome>false</StayHome>
					</NPCFlyingPatrol>
					<NPCFlyingChase name="Chase">
						<ChaseSpeed>200</ChaseSpeed>
					</NPCFlyingChase>	
					<NPCFlyingAttack name="AttackProjectile" ExitTime="0.5">
						<AttackTimeoutInSeconds>0</AttackTimeoutInSeconds>
						<ProjectileName>"BladeSlash"</ProjectileName>
					</NPCFlyingAttack>
					<NPCAnticipation name="Anticipation" ExitTime="0.25"/>
				</States>
				<Transitions>
					<Transition to="Chase" from="FlyPatrol">
						<Condition type="and">
							<IsPlayerDistanceMatching operatorType="Less">250</IsPlayerDistanceMatching>
							<IsPlayerDistanceMatching operatorType="Greater">40</IsPlayerDistanceMatching>
						</Condition>
					</Transition>	
					<Transition to="Chase" from="AttackProjectile">
						<Condition type="or">
							<IsPlayerDistanceMatching operatorType="Greater">40</IsPlayerDistanceMatching>
							<IsCollidableBetweenTarget Width="8">false</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">40</IsPlayerDistanceMatching>
							<IsCollidableBetweenTarget Width="8">false</IsCollidableBetweenTarget>
						</Condition>
					</Transition>				
					<Transition to="AttackProjectile" from="Anticipation"/>
				</Transitions>
			</StateMachine>
		</StateMachines>
		<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>
					<RandomRadial name="initialVelocity" angleRange="0,360" radiusRange="30,90" />
				</Particle>
			</ParticleSystem>
		</ParticleSystems>
		<Components>
			<Info/>
			<MustKillNPC/>
			<AttachmentSlotsCmp/>
			<StateMachineTimer/>
			<TintOverrideCmp/>
			<Enemy>
				<Set name="SoulsReward">5</Set>
				<Set name="destroyTileId">186</Set>
			</Enemy>
			<Movement/>
			<Damage>
				<Set name="damage">10</Set>
			</Damage>
			<StateMachine/>
			<NPCRenderActionCmp/>
			<Health>
				<Set name="healthAmount">200</Set>
				<Set name="maxHealth">200</Set>
			</Health>
			<Physics>
				<Set name="acceleration">0, 0</Set>
				<Set name="mass">20</Set>
				<Set name="drag">1.24, 1.25</Set>
			</Physics>
			<CollisionBox>
				<Set name="size">16,32</Set>
				<Set name="CollisionFlag">"PLAYERS|PROJECTILES"</Set>
				<Set name="CollisionType">"ENEMY_NPC"</Set>
			</CollisionBox>
			<DebugDraw/>
		</Components>
		<VariableMap>
			<Set name="position">0, -16, 0</Set>
			<Set name="rotation">0, 0, 0, 1</Set>
		</VariableMap>
	</Data>
	<RenderRules>
		<Render>
			<Translate>position</Translate>
			<Rotate>rotation</Rotate>
			<SpriteRender name="s_sprite"/>
			<SpriteRender name="s_sprite_glow"/>
		</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>