<?xml version="1.0" ?>
<ItemRenderer>
    <Data>
        <Sprite name="s_flower" fileName="game/particles_large15.rttex" textureSize="64,64" frame="12,11" />
        <Sprite name="s_petals" fileName="game/particles12.rttex" textureSize="32,32" frame="11,5" />
        <Animations>
            <SpriteAnimation name="a_flower" sprite="s_flower" isLoop="true" autoPlay="true" animTime="800">
                <Frame>12,11</Frame>
                <Frame>13,11</Frame>
                <Frame>14,11</Frame>
                <Frame>15,11</Frame>
            </SpriteAnimation>
            <SpriteAnimation name="a_petals" sprite="s_petals">
                <Frame>11,5</Frame>
                <Frame>12,5</Frame>
                <Frame>13,5</Frame>
                <Frame>14,5</Frame>
            </SpriteAnimation>
        </Animations>
        <StateMachines>
          <StateMachine name="Trail">
            <States>
              <State name="Off" />
              <State name="Move" />
              <State name="Sleep" />
            </States>
            <Transitions>
              <Transition to="Off" from="Move|Sleep">
                <Condition type="and">
                  <IsVariableFloat name="speed.length" operator="Less" abs="true">0.1</IsVariableFloat>
                  <IsAction operatorType="NotEqual">SLEEP</IsAction>
                </Condition>
              </Transition>
              <Transition to="Move" from="Off|Sleep">
                <Condition type="and">
                  <IsVariableFloat name="speed.length" operator="Greater" abs="true">0.1</IsVariableFloat>
                  <IsAction operatorType="NotEqual">SLEEP</IsAction>
                </Condition>
              </Transition>
              <Transition to="Sleep" from="Off|Move">
                <Condition type="and">
                  <IsVariableFloat name="speed.length" operator="Less" abs="true">0.1</IsVariableFloat>
                  <IsAction operatorType="Equal">SLEEP</IsAction>
                </Condition>
              </Transition>
            </Transitions>
          </StateMachine>
        </StateMachines>
        <ParticleSystems>
          <ParticleSystem name="ps_petals" updateStage="AddClothingParticles" updateState="Trail.Move" renderStage="RenderBehind">
            <Emitter>
              <Set name="offset">-20,-34</Set>
              <Set name="offsetFacing">true</Set>
              <Set name="emissionInterval">0.1</Set>
              <Set name="infParticles">true</Set>
              <Set name="lifeTime">0.8</Set>
              <Set name="particlesPerEmission">2</Set>
            </Emitter>
            <Particle randomSpriteFrame="true">
              <Set name="sprite">s_petals</Set>
              <Random name="offset" min="-12,-18" max="12,12" />
              <Set name="inSpecificOrder">true</Set>
              <Set name="lifeTime">1.5</Set>
              <Set name="blendingMode">PREMULTIPLIED_ALPHA</Set>
              <Curve name="initialAlpha">
                <KeyFrame>0, 1</KeyFrame>
                <KeyFrame>0.3, 1</KeyFrame>
                <KeyFrame>1, 0</KeyFrame>
              </Curve>
              <Random name="initialScale" min="0.8" max="1" />
              <Select name="initialRotationRate" input="randomNumber">
                <Item>90</Item>
                <Item>-90</Item>
              </Select>
              <Set name="useGravity">true</Set>
              <Curve name="initialVelocity">
                <KeyFrame>0, 0</KeyFrame>
                <KeyFrame>0.2, -20, 0</KeyFrame>
                <KeyFrame>0.4, 50, 0</KeyFrame>
                <KeyFrame>0.6, -50, 0</KeyFrame>
                <KeyFrame>0.8, 50, 0</KeyFrame>
                <KeyFrame>1, 0, 0</KeyFrame>
              </Curve>
              <Set name="gravityVector">0, 50</Set>
              <Random name="initialAngle" min="0" max="360" />
            </Particle>
          </ParticleSystem>
          <ParticleSystem name="ps_petals_sleep" updateStage="AddClothingParticles" updateState="Trail.Sleep" renderStage="RenderBehind">
            <Emitter>
              <Set name="offset">-20,-34</Set>
              <Set name="offsetFacing">true</Set>
              <Random name="emissionInterval" min="1" max="2" />
              <Set name="infParticles">true</Set>
              <Set name="lifeTime">0.8</Set>
              <Set name="particlesPerEmission">1</Set>
            </Emitter>
            <Particle randomSpriteFrame="true">
              <Set name="sprite">s_petals</Set>
              <Random name="offset" min="-16,-18" max="16,12" />
              <Set name="inSpecificOrder">true</Set>
              <Set name="lifeTime">1.5</Set>
              <Set name="blendingMode">PREMULTIPLIED_ALPHA</Set>
              <Curve name="initialAlpha">
                <KeyFrame>0, 1</KeyFrame>
                <KeyFrame>0.6, 1</KeyFrame>
                <KeyFrame>1, 0</KeyFrame>
              </Curve>
              <Random name="initialScale" min="0.8" max="1" />
              <Select name="initialRotationRate" input="randomNumber">
                <Item>90</Item>
                <Item>-90</Item>
              </Select>
              <Set name="useGravity">true</Set>
              <Curve name="initialVelocity">
                <KeyFrame>0, 0</KeyFrame>
                <KeyFrame>0.2, -20, 0</KeyFrame>
                <KeyFrame>0.4, 50, 0</KeyFrame>
                <KeyFrame>0.6, -50, 0</KeyFrame>
                <KeyFrame>0.8, 50, 0</KeyFrame>
                <KeyFrame>1, 0, 0</KeyFrame>
              </Curve>
              <Set name="gravityVector">0, 40</Set>
              <Random name="initialAngle" min="0" max="360" />
            </Particle>
          </ParticleSystem>
        </ParticleSystems>

        <RenderOptions>
          <Default>
            <Set name="IgnorePunchTypeCheck">true</Set>
            <Set name="UserNameOffset">20</Set>
            <Set name="DisableDefaultAncestralParticleEffects">true</Set>
            <Set name="IncludeAllActions">true</Set>
          </Default>
        </RenderOptions>
    </Data>
    <RenderRules>
        <RenderBehind>
            <SpriteRender name="s_flower" offset="-16,-8"/>
        </RenderBehind>
    </RenderRules>
</ItemRenderer>
