<?xml version="1.0"?>
<ItemRenderer>
  <Data>
    <Sprite name="s_bow" fileName="game/player_cosmetics4.rttex" textureSize="32" frame="9,3" />
    <Sprite name="s_ribbonLeft" fileName="game/particles12.rttex" textureSize="32" frame="10,16" />
    <Sprite name="s_ribbonRight" fileName="game/particles12.rttex" textureSize="32" frame="11,16" />
    <Sprite name="s_sparkle" fileName="game/particles.rttex" textureSize="32" frame="1,1" />

    <Animations>
      <SpriteAnimation name="a_ribbonLeftIdle" sprite="s_ribbonLeft" animTime="1000" isLoop="true" playOnState="Action.Idle">
        <Frame>10,16</Frame>
      </SpriteAnimation>
      <SpriteAnimation name="a_ribbonRightIdle" sprite="s_ribbonRight" animTime="1000" isLoop="true" playOnState="Action.Idle">
        <Frame>11,16</Frame>
      </SpriteAnimation>
      <SpriteAnimation name="a_ribbonLeftMove" sprite="s_ribbonLeft" animTime="600" isLoop="true" playOnState="Action.Walk|Action.JumpStraight|Action.JumpDiagonal|Action.FallStraight|Action.FallDiagonal">
        <Frame>17,16</Frame>
        <Frame>12,16</Frame>
        <Frame>13,16</Frame>
        <Frame>12,16</Frame>
      </SpriteAnimation>
      <SpriteAnimation name="a_ribbonRightFall" sprite="s_ribbonRight" animTime="600" isLoop="true" playOnState="Action.FallStraight|Action.FallDiagonal">
        <Frame>13,16</Frame>
        <Frame>12,16</Frame>
        <Frame>17,16</Frame>
        <Frame>12,16</Frame>
      </SpriteAnimation>
      <SpriteAnimation name="a_ribbonRightMove" sprite="s_ribbonRight" animTime="600" isLoop="true" playOnState="Action.Walk|Action.JumpStraight|Action.JumpDiagonal">
        <Frame>14,16</Frame>
        <Frame>15,16</Frame>
        <Frame>16,16</Frame>
        <Frame>15,16</Frame>
      </SpriteAnimation>
      <InterpolationVec4Animation name="a_idleLeftRot" variableName="belt_rotationLeft" targetValue="0, 0, 0, 1" animTime="600" playOnState="Action.Idle"/>
      <InterpolationVec4Animation name="a_walkLeftRot" variableName="belt_rotationLeft" targetValue="0, 0, 0, 1" animTime="400" playOnState="Action.Walk"/>
      <InterpolationVec4Animation name="a_fallLeftRotFallStraight" variableName="belt_rotationLeft" targetValue="15, 0, 0, 1" animTime="1000" playOnState="Action.FallStraight"/>
      <InterpolationVec4Animation name="a_fallLeftRotFallDiagonal" variableName="belt_rotationLeft" targetValue="15, 0, 0, 1" animTime="400" playOnState="Action.FallDiagonal"/>
      <InterpolationVec4Animation name="a_jumpLeftRotJumpStraight" variableName="belt_rotationLeft" targetValue="-40, 0, 0, 1" animTime="1000" playOnState="Action.JumpStraight"/>
      <InterpolationVec4Animation name="a_jumpLeftRotJumpDiagonal" variableName="belt_rotationLeft" targetValue="10, 0, 0, 1" animTime="400" playOnState="Action.JumpDiagonal"/>

      <InterpolationVec4Animation name="a_idleRightRot" variableName="belt_rotationRight" targetValue="0, 0, 0, 1" animTime="600" playOnState="Action.Idle"/>
      <InterpolationVec4Animation name="a_walkRightRot" variableName="belt_rotationRight" targetValue="40, 0, 0, 1" animTime="400" playOnState="Action.Walk"/>
      <InterpolationVec4Animation name="a_fallRightRotFallStraight" variableName="belt_rotationRight" targetValue="-15, 0, 0, 1" animTime="1000" playOnState="Action.FallStraight"/>
      <InterpolationVec4Animation name="a_fallRightRotFallDiagonal" variableName="belt_rotationRight" targetValue="-15, 0, 0, 1" animTime="400" playOnState="Action.FallDiagonal"/>
      <InterpolationVec4Animation name="a_jumpRightRotJumpStraight" variableName="belt_rotationRight" targetValue="40, 0, 0, 1" animTime="1000" playOnState="Action.JumpStraight"/>
      <InterpolationVec4Animation name="a_jumpRightRotJumpDiagonal" variableName="belt_rotationRight" targetValue="40, 0, 0, 1" animTime="400" playOnState="Action.JumpDiagonal"/>
    </Animations>
    <StateMachines>
      <StateMachine name="Action">
        <States>
          <State name="Idle" />
          <State name="Walk" />
          <State name="JumpStraight" />
          <State name="JumpDiagonal" />
          <State name="FallStraight" />
          <State name="FallDiagonal" />
        </States>
        <Transitions>
          <Transition to="Idle" from="Walk|FallStraight|FallDiagonal">
            <Condition>
              <IsAction>IDLE</IsAction>
            </Condition>
          </Transition>
          <Transition to="Walk" from="Idle|FallDiagonal|FallStraight">
            <Condition type="and">
              <IsVariableFloat name="speed.x" operator="Greater" abs="true">0.1</IsVariableFloat>
              <IsVariableFloat name="speed.y" operator="Less" abs="true">0.1</IsVariableFloat>
              <IsAction operatorType="NotEqual">JUMP</IsAction>
              <IsAction operatorType="NotEqual">FALL</IsAction>
            </Condition>
          </Transition>
          <Transition to="JumpStraight" from="Idle|Walk|FallStraight|JumpDiagonal|FallDiagonal">
            <Condition type="and">
              <IsVariableFloat name="speed.y" operator="Less">-0.1</IsVariableFloat>
              <IsVariableFloat name="speed.x" operator="Less" abs="true">0.1</IsVariableFloat>
            </Condition>
          </Transition>
          <Transition to="JumpDiagonal" from="Idle|Walk|FallStraight|JumpStraight|FallDiagonal">
            <Condition type="and">
              <IsVariableFloat name="speed.y" operator="Less">-0.1</IsVariableFloat>
              <IsVariableFloat name="speed.x" operator="Greater" abs="true">0.1</IsVariableFloat>
            </Condition>
          </Transition>
          <Transition to="FallStraight" from="Walk|FallDiagonal|JumpStraight|JumpDiagonal|Idle">
            <Condition type="and">
              <IsVariableFloat name="speed.y" operator="Greater">0.1</IsVariableFloat>
              <IsVariableFloat name="speed.x" operator="Less" abs="true">0.1</IsVariableFloat>
            </Condition>
          </Transition>
          <Transition to="FallDiagonal" from="Walk|FallStraight|JumpStraight|JumpDiagonal|Idle">
            <Condition type="and">
              <IsVariableFloat name="speed.y" operator="Greater">0.1</IsVariableFloat>
              <IsVariableFloat name="speed.x" operator="Greater" abs="true">0.1</IsVariableFloat>
            </Condition>
          </Transition>
        </Transitions>
      </StateMachine>
    </StateMachines>

    <ParticleSystems>
      <ParticleSystem name="randomWingSparklesLeft" updateStage="AddClothingParticles" renderStage="RenderBackpack">
        <Emitter>
          <Set name="infLifeTime">true</Set>
          <Set name="infParticles">true</Set>
          <Set name="particlesToEmit">1</Set>
          <Set name="particlesPerEmission">1</Set>
          <Set name="randomizeInterval">true</Set>
          <Set name="intervalMin">0.2</Set>
          <Set name="intervalMax">2</Set>
        </Emitter>
        <Particle>
          <Set name="sprite">s_sparkle</Set>
          <Set name="blendingMode">ADDITIVE</Set>
          <Set name="relativeToEmitter">true</Set>
          <Set name="inSpecificOrder">true</Set>
          <Set name="lifeTime">1</Set>
          <Select name="initialRotationRate" input="randomNumber">
            <Item>-180</Item>
            <Item>180</Item>
          </Select>
          <Curve name="initialAlpha">
            <KeyFrame>0, 0</KeyFrame>
            <KeyFrame>0.3, 1</KeyFrame>
            <KeyFrame>0.6, 1</KeyFrame>
            <KeyFrame>1, 0</KeyFrame>
          </Curve>
          <Curve name="initialScale">
            <KeyFrame>0, 0, 0</KeyFrame>
            <KeyFrame>0.3, 0.5, 0.5</KeyFrame>
            <KeyFrame>0.6, 0.5, 0.5</KeyFrame>
            <KeyFrame>1, 0, 0</KeyFrame>
          </Curve>
          <Random name="offset" min="-24,-32" max="-16,-8"/>
        </Particle>
      </ParticleSystem>
      <ParticleSystem name="randomWingSparklesRight" updateStage="AddClothingParticles" renderStage="RenderBackpack">
        <Emitter>
          <Set name="infLifeTime">true</Set>
          <Set name="infParticles">true</Set>
          <Set name="particlesToEmit">1</Set>
          <Set name="particlesPerEmission">1</Set>
          <Set name="randomizeInterval">true</Set>
          <Set name="intervalMin">0.2</Set>
          <Set name="intervalMax">2</Set>
        </Emitter>
        <Particle>
          <Set name="sprite">s_sparkle</Set>
          <Set name="blendingMode">ADDITIVE</Set>
          <Set name="relativeToEmitter">true</Set>
          <Set name="inSpecificOrder">true</Set>
          <Set name="lifeTime">1</Set>
          <Select name="initialRotationRate" input="randomNumber">
            <Item>-180</Item>
            <Item>180</Item>
          </Select>
          <Curve name="initialAlpha">
            <KeyFrame>0, 0</KeyFrame>
            <KeyFrame>0.3, 1</KeyFrame>
            <KeyFrame>0.6, 1</KeyFrame>
            <KeyFrame>1, 0</KeyFrame>
          </Curve>
          <Curve name="initialScale">
            <KeyFrame>0, 0, 0</KeyFrame>
            <KeyFrame>0.3, 0.5, 0.5</KeyFrame>
            <KeyFrame>0.6, 0.5, 0.5</KeyFrame>
            <KeyFrame>1, 0, 0</KeyFrame>
          </Curve>
          <Random name="offset" min="16,-8" max="24,-32"/>
        </Particle>
      </ParticleSystem>
    </ParticleSystems>
    
    <VariableMap>
      <Set name="belt_rotationLeft">0, 0, 0, 1</Set>
      <Set name="belt_rotationRight">0, 0, 0, 1</Set>
    </VariableMap>
  </Data>
  <RenderRules>
    <RenderBackpack>
      <SpriteRender name="s_bow" offset="0,-17" alignmentLeft="LEFT_CENTER" alignmentRight="RIGHT_CENTER"/>
      <SpriteRender name="s_bow" offset="0,-17" flip="1,0" alignmentLeft="RIGHT_CENTER" alignmentRight="LEFT_CENTER"/>
      <Group>
        <Rotate>belt_rotationLeft</Rotate>
        <SpriteRender name="s_ribbonLeft" offset="-2,-15" alignmentLeft="UPPER_LEFT" alignmentRight="UPPER_RIGHT"/>
      </Group>
      <Group>
        <Rotate>belt_rotationRight</Rotate>
        <Group onState="Action.Idle">
          <SpriteRender name="s_ribbonRight" offset="2,-15" alignmentLeft="UPPER_RIGHT" alignmentRight="UPPER_LEFT"/>
        </Group>
        <Group onState="Action.Walk|Action.JumpStraight|Action.JumpDiagonal|Action.FallStraight|Action.FallDiagonal">
          <SpriteRender name="s_ribbonRight" offset="2,-15" flip="1,0" alignmentLeft="UPPER_RIGHT" alignmentRight="UPPER_LEFT"/>
        </Group>
      </Group>
    </RenderBackpack>
  </RenderRules>
</ItemRenderer>
