;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Sonic 3 Style Sonic Character File ;
; Art by Sonic Team, def by Stealth  ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Sprite File: s3sonic.spr


;-----------------------------------------------------------------;
;----------------Character's Constant Properties------------------;
;-----------------------------------------------------------------;
;Total number is defined in Game Def File

;The 9 Required Constants
  0 - Player_InitFunc:                    22 ;Common Func 22, Player Init/Sentry

  1 - Player_VPScroll_Left:              144
  2 - Player_VPScroll_Right:             160
  3 - Player_VPScroll_Up:                 96
  4 - Player_VPScroll_Down:               96
  5 - Player_VPX_Speed:                   16
  6 - Player_VPY_Speed:                   16

  7 - Player_SlopeTolerance_Floor:         4
  8 - Player_SlopeTolerance_Ceiling:       4

;The extra Constants just for this game
  0 - Player_MaxVel:                      $600 ;Initial ("tables/sonspeed.def" contains settings for various states)
  1 - Player_Accel:                         $C ;"
  2 - Player_Decel:                         $C ;"
  3 - Player_SkidDecel:                    $80 ;"
  4 - Player_SpinDecel:                      6 ;"
  5 - Player_JumpForce:                   $680 ;"
  6 - Player_Weight:                       $38 ;"

  7 - Player_RunVel1:                     $600
  8 - Player_RunVel2:                     9999

  9 - Player_HurtBounceX:                -$280 ;"
 10 - Player_HurtBounceY:                -$480 ;"
 11 - Player_DeathBounce:                -$700

 12 - Player_SpinOffset:                     5

 13 - Player_SpecialMove:                  F22 ;This Character's Function 22, Activate Shield

 14 - Player_CarriedOffset:                 28


;-----------------------------------------------------------------;
;-----------------Character's Custom Variables--------------------;
;-----------------------------------------------------------------;
;These are just comments to document the custom variables used in scripts

; 0 - Player_SpindashCtr
; 1 - Player_VPXBackup
; 2 - Player_Temp
; 3 - Player_ShieldType
; 4 - Player_ShieldAniTrigger
; 5 - Player_ShieldAbilityFlag
; 6 - Player_GravityMode
; 7 - Player_InputMotionFlag
; 8 - Player_Rings
; 9 - Player_Score
;10 - Player_Lives
;11 - Player_Pushing
;12 - Player_Ducking
;13 - Player_Skidding
;14 - Player_LookingUp
;15 - Player_AniSpeed
;16 - Player_SlipTimer
;17 - Player_TubeFlag
;18 - Player_WaterFlag
;19 - Player_JumpedFlag
;20 - Player_FloatingFlag
;21 - Player_ForceJumpFlag
;22 - (Unused Player-Specific)
;23 - (Unused Player-Specific)
;24 - (Unused Player-Specific)
;25 - Player_TripTest_HotspotValue
;26 - Player_TripTest_SolidPixelAccumulator
;27 - Player_TripTest_SolidLineCounter
;28 - Player_TripFlag
;29 - Player_NextRingBonus
;30 - Player_NextScoreBonus
;31 - Player_EnemyScoreCtr
;32 - Player_DashDust_ObjectPtr
;33 - Player_FrontShield_ObjectPtr
;34 - Player_BackShield_ObjectPtr
;35 - Sonic_InstaShieldFlag
;36 - (Unused Player-Specific)
;37 - (Unused Player-Specific)
;38 - Player_PlatformDisconnectFlag
;39 - Player_AniDelay
;40 - Player_PreviousPushState
;41 - Player_VPPanTimer
;42 - Player_VPCenterOffset
;43 - Player_VPPanOffset
;44 - Player_InvincTimer
;45 - Player_SneakerTimer
;46 - Player_SuperFlag
;47 - Player_CarriedFlag
;48 - Player_RestartX
;49 - Player_RestartY
;50 - Player_StarpostCtr
;51 - Player_BreathBubbles_Flag
;52 - Player_BreathBubbles_Count
;53 - Player_BreathBubbles_Delay
;54 - Player_AIMode
;55 - Player_RestartMinutes
;56 - Player_RestartSeconds


;-----------------------------------------------------------------;
;-------------------Character's Sound Effects---------------------;
;-----------------------------------------------------------------;

;The 0 Required sounds
  ;There are currently no required sounds

;The extra sounds just for this game
Number of Custom Sound Effects:   0




;-----------------------------------------------------------------;
;--------------------Movement Mode Properties---------------------;
;-----------------------------------------------------------------;

Number of Movement Modes:   8

Mode 0 - Standing
        Movement Function:C11
          Update Function:C12
     Number of Key Events:  7
    Event 2 - Num of Keys:  1 ;Look Up
                    Key 1:PH0 ;Hold Up
                 Function:C25
    Event 2 - Num of Keys:  1 ;Spin or duck
                    Key 1:PH1 ;Hold Down
                 Function: C6
    Event 0 - Num of Keys:  1 ;Left Motion
                    Key 1:PH2 ;Hold Left
                 Function: C0
    Event 1 - Num of Keys:  1 ;Left Motion
                    Key 1:PH3 ;Hold Right
                 Function: C1
    Event 3 - Num of Keys:  1 ;Input Jump (or Spindash/Special)
                    Key 1:PT4 ;Tap A
                 Function: C4
    Event 3 - Num of Keys:  1 ;Input Jump (or Spindash/Special)
                    Key 1:PT5 ;Tap B
                 Function: C4
    Event 3 - Num of Keys:  1 ;Input Jump (or Spindash/Special)
                    Key 1:PT6 ;Tap C
                 Function: C4

Mode 1 - Spinning
        Movement Function:C13
          Update Function:C14
     Number of Key Events:  8
    Event 0 - Num of Keys:  1 ;Left Motion
                    Key 1:PH2 ;Hold Left
                 Function: C2
    Event 1 - Num of Keys:  1 ;Left Motion
                    Key 1:PH3 ;Hold Right
                 Function: C3
    Event 3 - Num of Keys:  1 ;Input Jump (or Spindash/Special)
                    Key 1:PT4 ;Tap A
                 Function: C4
    Event 3 - Num of Keys:  1 ;Input Jump (or Spindash/Special)
                    Key 1:PT5 ;Tap B
                 Function: C4
    Event 3 - Num of Keys:  1 ;Input Jump (or Spindash/Special)
                    Key 1:PT6 ;Tap C
                 Function: C4
    Event 3 - Num of Keys:  1 ;Jump Height Control
                    Key 1:PH4 ;Hold A
                 Function: C5
    Event 3 - Num of Keys:  1 ;Jump Height Control
                    Key 1:PH5 ;Hold B
                 Function: C5
    Event 3 - Num of Keys:  1 ;Jump Height Control
                    Key 1:PH6 ;Hold C
                 Function: C5

Mode 2 - Hurting
        Movement Function:C15
          Update Function:C16
     Number of Key Events:  1
    Event 0 - Num of Keys:  1 ;Toggle Debug Mode
                    Key 1:PT5 ;Tap B
                 Function:C10

Mode 3 - Dying
        Movement Function:C21
          Update Function:C999
     Number of Key Events:  1
    Event 0 - Num of Keys:  1 ;Toggle Debug Mode
                    Key 1:PT5 ;Tap B
                 Function:C10

Mode 4 - Debug
        Movement Function:C17
          Update Function:999
     Number of Key Events:  4
    Event 0 - Num of Keys:  1 ;Toggle Debug Mode
                    Key 1:PT5 ;Tap B
                 Function:C10
    Event 3 - Num of Keys:  1 ;Previous Debug Object or Place Debug Object
                    Key 1:PT6 ;Tap C
                 Function:C19
    Event 3 - Num of Keys:  1 ;Next Debug Object
                    Key 1:PT4 ;Tap A
                 Function:C18
    Event 3 - Num of Keys:  2 ;Save Objects
                    Key 0:156 ;Hold Enter
                    Key 1: 56 ;Tap Alt
                 Function:C20

Mode 5 - Reserved
        Movement Function:C26 ;Demo Control
          Update Function:999
     Number of Key Events:  0

Mode 6 - Reserved
        Movement Function:C26 ;Demo Control
          Update Function:999
     Number of Key Events:  0

Mode 7 - Animation Only
        Movement Function:C26 ;Demo Control
          Update Function:999
     Number of Key Events:  1
    Event 0 - Num of Keys:  1 ;Toggle Debug Mode
                    Key 1:PT5 ;Tap B
                 Function:C10


;-----------------------------------------------------------------;
;-------------------Animation Function Listing--------------------;
;-----------------------------------------------------------------;

;The 1 Required Animations
  0 - Default Animation:                1 ; Used by this script for standing still

;The extra Animations just for this game
Number of Custom Animation Entries:    32

  1 - Current Walking Animation:        7 ;   l0
  2 - Current Running Animation:       11 ;   l1
  3 - Walking Flat Animation:           7 ;   l2
  4 - Walking Angle Up Animation:       8 ;   l3
  5 - Walking Wall Animation:           9 ;   l4
  6 - Walking Angle Down Animation:    10 ;   l5
  7 - Running Flat Animation:          11 ;   l6
  8 - Running Angle Up Animation:      12 ;   l7
  9 - Running Wall Animation:          13 ;   l8
 10 - Running Angle Down Animation:    14 ;   l9
 11 - Pushing Animation:                5 ;  l10
 12 - Hurting Animation:               20 ;  l11
 13 - Spinning Animation:               6 ;  l12
 14 - Current Ducking Animation:        3 ;  l13
 15 - Ducking Animation:                3 ;  l14
 16 - Spindash Animation:              23 ;  l15
 17 - Skidding Animation:               4 ;  l16
 18 - Player Current Float Animation:  19 ;  l17
 19 - Spring 1 Animation:              19 ;  l18
 20 - Spring 2 Animation:              19 ;  l19
 21 - Dying Animation:                 25 ;  l20
 22 - Tripping Animation:              27 ;  l21
 23 - Looking Up Animation:             2 ;  l22
 24 - Being Carried Animation:         28 ;  l23
 25 - Drowning Animation:              26 ;  l24
 26 - Breathing Animation:             29 ;  l25
 27 - Running2 Flat Animation:         15 ;  l26
 28 - Running2 Angle Up Animation:     16 ;  l27
 29 - Running2 Wall Animation:         17 ;  l28
 30 - Running2 Angle Down Animation:   18 ;  l29
 31 - Super Transformation Animation:  48 ;  l30
 32 - Level-Out Pose:                  49 ;  l31




;-----------------------------------------------------------------;
;-----------Character's Animation and Action Functions------------;
;-----------------------------------------------------------------;

Number of Player Funcs: 52
; 0 - Init
; 1 - Standing
; 2 - Looking Up
; 3 - Ducking
; 4 - Skidding
; 5 - Pushing
; 6 - Spinning
; 7 - Walking Flat
; 8 - Walking Angle-Up
; 9 - Walking Wall
;10 - Walking Angle-Down
;11 - Running Flat
;12 - Running Angle-Up
;13 - Running Wall
;14 - Running Angle-Down
;15 - Running 2 Flat
;16 - Running 2 Angle-Up
;17 - Running 2 Wall
;18 - Running 2 Angle-Down
;19 - Darting Up
;20 - Getting Hurt
;21 - Insta-Shield Damage Radius Animation
;22 - Activate Shield
;23 - Spindash Animation
;24 - Unused
;25 - Dying
;26 - Drowning
;27 - Tripping
;28 - Being Carried
;29 - Breathing
;30 - Super Walking Flat
;31 - Super Walking Angle-Up
;32 - Super Walking Wall
;33 - Super Walking Angle-Down
;34 - Super Running Flat
;35 - Super Running Angle-Up
;36 - Super Running Wall
;37 - Super Running Angle-Down
;38 - Super Running 2 Flat
;39 - Super Running 2 Angle-Up
;40 - Super Running 2 Wall
;41 - Super Running 2 Angle-Down
;42 - Super Standing
;43 - Super Ducking
;44 - Super Pushing
;45 - Set Super Anis
;46 - Set Normal Anis
;47 - Super Tripping
;48 - Super Transformation
;49 - Level-Out Pose
;50 - Floating
;51 - Standing Up for Continue

;===================================================================================
;==================
;Function 0 - Init=
;==================

	#_FetchPlayer					;Get a pointer to the current player
	:_Ref_All
	:r_Curr_Player

# End	;Terminate Function

;===================================================================================
;======================
;Function 1 - Standing=
;======================

	#_Ani_SetFrame
	:   0

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Sonic only waits for 1 second to idle on select screen, 5 seconds during normal gameplay
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	~If _zone == 95
		#_Ani_Delay
		:  60							;1 Second
	~Else
		#_Ani_Delay
		: 300							;5 Seconds
	~EndIf

	#_Ani_SetFrame
	:   2

	#_Ani_Delay
	:   8
@Waiting
	#_Ani_SetFrame
	:   3

	#_Ani_Delay
	:  12

	#_Ani_SetFrame
	:   4

	#_Ani_Delay
	:  12

	#_GoTo
	: @Waiting

# End	;Terminate Function

;===================================================================================
;========================
;Function 2 - Looking Up=
;========================

	#_Ani_SetFrame
	:   9

	#_Ani_Delay
	:   6

	#_Ani_SetFrame
	:  10

@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

;===================================================================================
;=====================
;Function 3 - Ducking=
;=====================

	#_Ani_SetFrame
	: 211

	#_Ani_Delay
	:   6

	#_Ani_SetFrame
	: 212
@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

;===================================================================================
;======================
;Function 4 - Skidding=
;======================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;During animation, spawn a skidding dust on every 4th frame
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_Ani_SetFrame
	: 213

	#_RunFunc_CurrPlayer_Const
	:  23 ;Common function 23 (Skidding Dust Spawn)

	#_Ani_Delay
	:   4

	#_Ani_SetFrame
	: 214

	#_RunFunc_CurrPlayer_Const
	:  23 ;Common function 23 (Skidding Dust Spawn)

	#_Ani_Delay
	:   4

	#_Ani_SetFrame
	: 215

	#_RunFunc_CurrPlayer_Const
	:  23 ;Common function 23 (Skidding Dust Spawn)

	#_Ani_Delay
	:   4

	#_Ani_SetFrame
	: 216

	#_RunFunc_CurrPlayer_Const
	:  23 ;Common function 23 (Skidding Dust Spawn)

	#_Ani_Delay
	:   5
@Repeat
	#_RunFunc_CurrPlayer_Const
	:  23 ;Common function 23 (Skidding Dust Spawn)

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Only maintain the skid while still actively decelerating
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@CheckSkid
	#_FetchPlayer						;Reobtain player pointer every time this repeats
	:_Ref_All
	:r_Curr_Player

	~If _Player_Skidding == 1				;If player isn't actively decelerating (just skid animation)

		~Eval _Player_Skidding = 0			;End skidding, Standing Mode Update will switch animations

	~EndIf

	#_Loop							;Keep checking skidding status during the 4-frame delay
	: @CheckSkid								;(Loop)
	:   0									;(Counter)
	:   4									;(Repeat)	4 frames of delay between puffs

	#_GoTo							;Puff and delay again until skidding is stopped
	: @Repeat

# End	;Terminate Function


;===================================================================================
;=====================
;Function 5 - Pushing=
;=====================

@Repeat
	#_Ani_SetFrame
	: 238

	#_Ani_Delay
	:  32

	#_Ani_SetFrame
	: 239

	#_Ani_Delay
	:  32

	#_Ani_SetFrame
	: 240

	#_Ani_Delay
	:  32

	#_Ani_SetFrame
	: 241

	#_Ani_Delay
	:  32

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;======================
;Function 6 - Spinning=
;======================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Spinning Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 206

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 207

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 206

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 208

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 206

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 209

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 206

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 210

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;==========================
;Function 7 - Walking Flat=
;==========================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  64

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  65

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  58

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  59

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  60

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  61

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  62

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  63

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;==============================
;Function 8 - Walking Angle-Up=
;==============================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  72

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  73

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  66

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  67

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  68

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  69

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  70

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  71

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;==========================
;Function 9 - Walking Wall=
;==========================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  80

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  81

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  74

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  75

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  76

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  77

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  78

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  79

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=================================
;Function 10 - Walking Angle-Down=
;=================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  88

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  89

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  82

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  83

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  84

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  85

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  86

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  87

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;===========================
;Function 11 - Running Flat=
;===========================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  90

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  91

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  92

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  93

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;===============================
;Function 12 - Running Angle-Up=
;===============================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  94

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  95

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  96

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  97

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;===========================
;Function 13 - Running Wall=
;===========================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	:  98

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	:  99

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 100

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 101

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=================================
;Function 14 - Running Angle-Down=
;=================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 102

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 103

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 104

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 105

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=============================
;Function 15 - Running 2 Flat=
;=============================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;=================================
;Function 16 - Running 2 Angle-Up=
;=================================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;=============================
;Function 17 - Running 2 Wall=
;=============================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;===================================
;Function 18 - Running 2 Angle-Down=
;===================================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;=========================
;Function 19 - Darting Up=
;=========================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;This is a "Floating Mode" animation
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_Ani_SetFrame
	: 198
@Repeat
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;If the player starts falling faster than 2 pixels per frame, disable this animation
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_FetchPlayer
	:_Ref_All
	:r_Curr_Player

	~If _Player_Y_Vel > 512				;If player is falling back down fast enough
		~Eval _Player_FloatingFlag = 0		;Disable the "floating" state to terminate this animation
	~EndIf

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;If the player strikes a path, disable this animation
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	~If _Player_On_Path != 0			;If player has struck a path
		~Eval _Player_FloatingFlag = 0		;Disable the "floating" state to terminate this animation
	~EndIf

	#_BreakTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;===========================
;Function 20 - Getting Hurt=
;===========================

	#_Ani_SetFrame
	:  21
@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

;===================================================================================
;===================================================
;Function 21 - Insta-Shield Damage Radius Animation=
;===================================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;This animation is added to Sonic during the insta-shield, and
	;applies the attack box that is used for Sonic's extended
	;collision radius
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_Ani_SetFrame
	: 292

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Maintain the animation (and thus, the collision) for 6 frames
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_FuncBreak
	#_FuncBreak
	#_FuncBreak
	#_FuncBreak
	#_FuncBreak
	#_FuncBreak

# End	;Terminate Function

;===================================================================================
;==============================
;Function 22 - Activate Shield=
;==============================

	#_FetchPlayer
	:_Ref_All
	:r_Curr_Player

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Sonic can't perform shield actions while invincible or super
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	~If a_Player_InvincTimer != 0				;If Sonic is invincible / super
		#_StopCurrentFunc				;abort shield actions
	~EndIf

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Perform a different action depending on the shield type
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_StateSwitch(Chr)					;Test the shield type
	:_Player_ShieldType							;(Chr0)
	:   5									;There are 5 shield types
	: @Insta								;(State 0) No (Insta-) Shield
	: @Finish								;(State 1) Normal Shield (No action)
	: @Bubble								;(State 2) Water Shield
	: @Fire									;(State 3) Fire Shield
	: @Lightning								;(State 3) Lightning Shield

@Insta
		;;;;;;;;;;;;;;;;;;;
		;No (Insta-) Shield
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Player is invincible and his damage radius extends during insta-shield
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		#_Player_AddAni_ChrSpecific			;This animation adds extended collision, but is invisible
		:  21 ;Insta-Shield Damaging Animation

		~Eval _Sonic_InstaShieldFlag = 1		;Flag that the Insta-Shield is active
		~Eval _Player_InvincTimer    = 6		;Set player as invincible for the duration of the Insta-Shield (6 frames)

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Create and setup the Insta-shield object itself
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		#_SpawnObject					;Spawn the shield object (this is the visible aspect)
		:  G11								;(Type) Shield Object
		:    0								;(X)    Will set by hotspot below
		:    0								;(Y)    Will set by hotspot below
		:   59								;(Pri)  Just in front of player draw object
		:    0								;(Tag)
		:    0								;(Flags)
		:    0								;0 Parameters

		#_FetchObject_LastSpawned			;Fetch the shield object
		:_Ref_All

		#_Obj=Chr_Hotspot				;Shield follows player
		:   0								;(Spot) Player Center Spot
		:   1								;(X)    Object X
		:   2								;(Y)    Object Y

		~Eval _Shield_TargetPlayer = _Curr_Player	;Lock shield object to the player that owns it (E0 = Source Player)
		~Eval _Shield_Type = 255			;Set the shield object's shield type. If player's shield type is not equal to shield object's shield type, it is destroyed (E1 = Shield Type)

		#_Object_SetAni_ByList				;Set the Shield Animation
		:   9 ;Insta-Shield Animation

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Set the player's shield status
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		#_Chr=Ptr(FetchedObj)				;Assign this shield object to the player
		:_Player_FrontShield_ObjectPtr

		~Eval _Player_BackShield_ObjectPtr =   0	;There is no back object

		~Eval _Player_ShieldType           = 255	;Enable the insta-shield

		;;;;;;;;;;;;;;;;;;;;;;
		;Play the shield sound
		;;;;;;;;;;;;;;;;;;;;;;

		#_PlaySound
		:_SFX_InstaShield
		:_Snd_Once

		#_GoTo						;Skip other shield types code
		: @Finish

@Bubble
		;;;;;;;;;;;;;
		;Water Shield
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Begin bubble bounce by applying strong vertical force in the
		;gravity direction and stopping horizontal motion
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_Y_Vel    = $800			;Throw player down
		~Eval _Player_Path_Vel = 0			;Stop horizontal movement

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Trigger shield reaction animation
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_ShieldAniTrigger = 2		;This value will be read by the shield object (Shield bouncing down Animation)

		;;;;;;;;;;;;;;;;;;;;;;
		;Play the shield sound
		;;;;;;;;;;;;;;;;;;;;;;

		#_PlaySound
		:_SFX_BubbleBounce
		:_Snd_Once

		#_GoTo 						;Skip other shield types code
		: @Finish


@Fire
		;;;;;;;;;;;;
		;Fire Shield
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Begin fireball dash by applying strong horizontal force in the
		;direction the player is facing and resetting vertical motion
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_Path_Vel = $800			;Throw player Right
		~Eval _Player_Y_Vel    = 0			;Stop vertical movement

		~If   _Player_X_Dir   == 0			;If player facing right

			~Eval _Player_Cant_Go_Right = 0		;Clear collision in this direction in case Player is dashing against a destructable solid object

		~Else						;If player facing left

			~Eval  _Player_Cant_Go_Left  = 0	;Clear collision in this direction in case Player is dashing against a destructable solid object
			~Eval -_Player_Path_Vel			;Reverse Speed for leftward motion

		~EndIf

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Trigger shield reaction animation
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_ShieldAniTrigger = 2008		;This value will be read by the shield object (Fire Shield Dash Animation [Add 2000 to make back animation disappear while front plays the special])

		;;;;;;;;;;;;;;;;;;;;;;
		;Play the shield sound
		;;;;;;;;;;;;;;;;;;;;;;

		#_PlaySound
		:_SFX_FireDash
		:_Snd_Once

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Set the screen lock wait timer based on the speed of the dash
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_SpindashCtr   = _Player_Path_Vel - $800
		~Eval _Player_SpindashCtr >>= 8
		~Eval _Player_SpindashCtr  &= $0F
		~Eval _Player_SpindashCtr  -= $10

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Setup the temporary camera lock effect
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_VPXBackup = _Player_VPX		;Copy VPX position for locking

		#_CallFunc
		:   9 ;Spindash Viewport Sentry (Common Character Function)

		#_GoTo 						;Skip other shield types code
		: @Finish


@Lightning
		;;;;;;;;;;;;;;;;;
		;Lightning Shield
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Begin lightning jump by applying vertical force
		;away from the gravity direction
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		~Eval _Player_Y_Vel = -$580			;Throw Player Up

		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;Spawn four lightning sparks that travel diagonally away from player center
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		#_SpawnObject					;Spawn a spark
		: G12								;(Type) Lightning Spark Object
		:   0								;(X)    Set by hotspot below
		:   0								;(Y)    Set by hotspot below
		:65535								;(Pri)  From Object Def
		:   0								;(Tag)
		:   0								;(Flags)
		:   2								;2 Parameters
		:-512								;(Param 0) X Velocity
		:-512								;(Param 1) Y Velocity
		#_FetchObject_LastSpawned			;Fetch the Spark
		:_Ref_All
		#_Obj=Chr_Hotspot				;Position Spark at center of player
		:   0								;(Spot)   Player Center Spot
		:   1								;(Obj2 X) Object X
		:   2								;(Obj2 Y) Object Y

		#_SpawnObject					;Spawn a spark
		: G12								;(Type) Lightning Spark Object
		:   0								;(X)    Set by hotspot below
		:   0								;(Y)    Set by hotspot below
		:65535								;(Pri)  From Object Def
		:   0								;(Tag)
		:   0								;(Flags)
		:   2								;2 Parameters
		: 512								;(Param 0) X Velocity
		:-512								;(Param 1) Y Velocity
		#_FetchObject_LastSpawned			;Fetch the Spark
		:_Ref_All
		#_Obj=Chr_Hotspot				;Position Spark at center of player
		:   0								;(Spot)   Player Center Spot
		:   1								;(Obj2 X) Object X
		:   2								;(Obj2 Y) Object Y

		#_SpawnObject					;Spawn a spark
		: G12								;(Type) Lightning Spark Object
		:   0								;(X)    Set by hotspot below
		:   0								;(Y)    Set by hotspot below
		:65535								;(Pri)  From Object Def
		:   0								;(Tag)
		:   0								;(Flags)
		:   2								;2 Parameters
		:-512								;(Param 0) X Velocity
		: 512								;(Param 1) Y Velocity
		#_FetchObject_LastSpawned			;Fetch the Spark
		:_Ref_All
		#_Obj=Chr_Hotspot				;Position Spark at center of player
		:   0								;(Spot)   Player Center Spot
		:   1								;(Obj2 X) Object X
		:   2								;(Obj2 Y) Object Y

		#_SpawnObject					;Spawn a spark
		: G12								;(Type) Lightning Spark Object
		:   0								;(X)    Set by hotspot below
		:   0								;(Y)    Set by hotspot below
		:65535								;(Pri)  From Object Def
		:   0								;(Tag)
		:   0								;(Flags)
		:   2								;2 Parameters
		: 512								;(Param 0) X Velocity
		: 512								;(Param 1) Y Velocity
		#_FetchObject_LastSpawned			;Fetch the Spark
		:_Ref_All
		#_Obj=Chr_Hotspot				;Position Spark at center of player
		:   0								;(Spot)   Player Center Spot
		:   1								;(Obj2 X) Object X
		:   2								;(Obj2 Y) Object Y

		;;;;;;;;;;;;;;;;;;;;;;
		;Play the shield sound
		;;;;;;;;;;;;;;;;;;;;;;

		#_PlaySound
		:_SFX_LightningJump
		:_Snd_Once

@Finish

# End	;Terminate Function

;===================================================================================
;=================================
;Function 23 - Spindash Animation=
;=================================

@Repeat
	#_Ani_SetFrame
	: 190

	#_FuncBreak

	#_Ani_SetFrame
	: 191

	#_FuncBreak

	#_Ani_SetFrame
	: 190

	#_FuncBreak

	#_Ani_SetFrame
	: 192

	#_FuncBreak

	#_Ani_SetFrame
	: 190

	#_FuncBreak

	#_Ani_SetFrame
	: 193

	#_FuncBreak

	#_Ani_SetFrame
	: 190

	#_FuncBreak

	#_Ani_SetFrame
	: 194

	#_FuncBreak

	#_Ani_SetFrame
	: 190

	#_FuncBreak

	#_Ani_SetFrame
	: 195

	#_BreakTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=====================
;Function 24 - Unused=
;=====================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Unused space for a removed function
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;====================
;Function 25 - Dying=
;====================

	#_Ani_SetFrame
	: 223
@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

;===================================================================================
;=======================
;Function 26 - Drowning=
;=======================

	#_Ani_SetFrame
	: 225
@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

;===================================================================================
;=======================
;Function 27 - Tripping=
;=======================

@Repeat
	#_Ani_SetFrame
	: 220

	#_Ani_Delay
	:   8

	#_Ani_SetFrame
	: 221

	#_Ani_Delay
	:   8

	#_Ani_SetFrame
	: 222

	#_Ani_Delay
	:   8

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;============================
;Function 28 - Being Carried=
;============================

	#_Ani_SetFrame
	: 201

	#_Ani_Delay
	:  24
@Repeat
	#_Ani_SetFrame
	: 200

	#_Ani_Delay
	:  72

	#_Ani_SetFrame
	: 202

	#_Ani_Delay
	:  72

	#_Ani_SetFrame
	: 201

	#_Ani_Delay
	:  61

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;========================
;Function 29 - Breathing=
;========================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;This is a "Floating Mode" animation
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_Ani_SetFrame
	: 228

	#_Ani_Delay
	:  25

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Disable "float" to re-enable normal animations
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	~Eval _Player_FloatingFlag = 0		;Disable the "floating" animation

	#_Player_SetAni_ByList			;Set the walking animation immediately
	:  L0 ;Walking

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;New animation starts on the next frame, keep this one alive for one
	;more frame so player doesn't become invisible for a split-second
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_FuncBreak

# End	;Terminate Function

;===================================================================================
;=================================
;Function 30 - Super Walking Flat=
;=================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 252

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 253

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 254

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 255

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 256

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 257

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 258

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 259

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=====================================
;Function 31 - Super Walking Angle-Up=
;=====================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 260

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 261

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 262

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 263

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 264

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 265

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 266

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 267

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=================================
;Function 32 - Super Walking Wall=
;=================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 268

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 269

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 270

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 271

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 272

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 273

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 274

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 275

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=======================================
;Function 33 - Super Walking Angle-Down=
;=======================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 276

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 277

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 278

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 279

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 280

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 281

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 282

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 283

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=================================
;Function 34 - Super Running Flat=
;=================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 284

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 285

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=====================================
;Function 35 - Super Running Angle-Up=
;=====================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 286

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 287

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=================================
;Function 36 - Super Running Wall=
;=================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 288

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 289

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=======================================
;Function 37 - Super Running Angle-Down=
;=======================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Frame delay for this animation is relative to player's movement
	;speed. _Player_AniDelay is set up during Standing Mode Update
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@Repeat
	#_Ani_SetFrame
	: 290

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_Ani_SetFrame
	: 291

	#_Ani_SetDelay(Chr)
	:_Player_AniDelay

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;===================================
;Function 38 - Super Running 2 Flat=
;===================================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;=======================================
;Function 39 - Super Running 2 Angle-Up=
;=======================================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;===================================
;Function 40 - Super Running 2 Wall=
;===================================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;=========================================
;Function 41 - Super Running 2 Angle-Down=
;=========================================

	;;;;;;;;;;;;;;;;
	;Not Implemented
	;;;;;;;;;;;;;;;;

# End	;Terminate Function

;===================================================================================
;=============================
;Function 42 - Super Standing=
;=============================

@Repeat
	#_Ani_SetFrame
	: 250

	#_Ani_Delay
	:   8

	#_Ani_SetFrame
	: 251

	#_Ani_Delay
	:   8

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;============================
;Function 43 - Super Ducking=
;============================

	#_Ani_SetFrame
	: 242
@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

;===================================================================================
;============================
;Function 44 - Super Pushing=
;============================

@Repeat
	#_Ani_SetFrame
	: 246

	#_Ani_Delay
	:  32

	#_Ani_SetFrame
	: 247

	#_Ani_Delay
	:  32

	#_Ani_SetFrame
	: 248

	#_Ani_Delay
	:  32

	#_Ani_SetFrame
	: 249

	#_Ani_Delay
	:  32

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=============================
;Function 45 - Set Super Anis=
;=============================

		#_FetchPlayer
		:_Ref_All
		:r_Curr_Player

		#_Player_ChangeAnimations		;Setup Spindashing Animation
		:  17							;17 Animations
		:   0							;(RefID 0)  Standing Animation
		: P42							;(NewID 0)  Super Standing Animation
		:_AniChange_Restart					;(Smooth)
		:  l2							;(RefID 1)  Walking Flat Animation
		: P30							;(NewID 1)  Super Walking Flat Animation
		:_AniChange_Restart					;(Smooth)
		:  l3							;(RefID 2)  Walking Angle Up Animation
		: P31							;(NewID 2)  Super Walking Angle UpAnimation
		:_AniChange_Restart					;(Smooth)
		:  l4							;(RefID 3)  Walking Wall Animation
		: P32							;(NewID 3)  Super Walking Wall Animation
		:_AniChange_Restart					;(Smooth)
		:  l5							;(RefID 4)  Walking Angle Down Animation
		: P33							;(NewID 4)  Super Walking Angle Down Animation
		:_AniChange_Restart					;(Smooth)
		:  l6							;(RefID 5)  Running Flat Animation
		: P34							;(NewID 5)  Super Running Flat Animation
		:_AniChange_Restart					;(Smooth)
		:  l7							;(RefID 6)  Running Angle Up Animation
		: P35							;(NewID 6)  Super Running Angle Up Animation
		:_AniChange_Restart					;(Smooth)
		:  l8							;(RefID 7)  Running Wall Animation
		: P36							;(NewID 7)  Super Running Wall Animation
		:_AniChange_Restart					;(Smooth)
		:  l9							;(RefID 8)  Running Angle Down Animation
		: P37							;(NewID 8)  Super Running Angle Down Animation
		:_AniChange_Restart					;(Smooth)
		: l10							;(RefID 9)  Pushing Animation
		: P44							;(NewID 9)  Super Pushing Animation
		:_AniChange_Restart					;(Smooth)
		: l13							;(RefID 10) Current Ducking Animation
		: P43							;(NewID 10) Super Ducking Animation
		:_AniChange_Restart					;(Smooth)
		: l14							;(RefID 10) Ducking Animation
		: P43							;(NewID 10) Super Ducking Animation
		:_AniChange_Restart					;(Smooth)
		: l21							;(RefID 11) Tripping Animation
		: P47							;(NewID 11) Super Tripping Animation
		:_AniChange_Restart					;(Smooth)
		: l26							;(RefID 12) Running2 Flat Animation
		: P38							;(NewID 12) Super Running2 Flat Animation
		:_AniChange_Restart					;(Smooth)
		: l27							;(RefID 13) Running2 Angle Up Animation
		: P39							;(NewID 13) Super Running2 Angle Up Animation
		:_AniChange_Restart					;(Smooth)
		: l28							;(RefID 14) Running2 Wall Animation
		: P40							;(NewID 14) Super Running2 Wall Animation
		:_AniChange_Restart					;(Smooth)
		: l29							;(RefID 15) Running2 Angle Down Animation
		: P41							;(NewID 15) Super Running2 Angle Down Animation
		:_AniChange_Restart					;(Smooth)

		~Eval _Player_RunVel1 = $800

# End	;Terminate Function

;===================================================================================
;==============================
;Function 46 - Set Normal Anis=
;==============================

		#_FetchPlayer
		:_Ref_All
		:r_Curr_Player

		#_Player_ChangeAnimations		;Setup Spindashing Animation
		:  17							;17 Animations
		:   0							;(RefID 0)  Standing Animation
		:  P1							;(NewID 0)  Normal Standing Animation
		:_AniChange_Restart					;(Smooth)
		:  l2							;(RefID 1)  Walking Flat Animation
		:  P7							;(NewID 1)  Normal Walking Flat Animation
		:_AniChange_Restart					;(Smooth)
		:  l3							;(RefID 2)  Walking Angle Up Animation
		:  P8							;(NewID 2)  Normal Walking Angle UpAnimation
		:_AniChange_Restart					;(Smooth)
		:  l4							;(RefID 3)  Walking Wall Animation
		:  P9							;(NewID 3)  Normal Walking Wall Animation
		:_AniChange_Restart					;(Smooth)
		:  l5							;(RefID 4)  Walking Angle Down Animation
		: P10							;(NewID 4)  Normal Walking Angle Down Animation
		:_AniChange_Restart					;(Smooth)
		:  l6							;(RefID 5)  Running Flat Animation
		: P11							;(NewID 5)  Normal Running Flat Animation
		:_AniChange_Restart					;(Smooth)
		:  l7							;(RefID 6)  Running Angle Up Animation
		: P12							;(NewID 6)  Normal Running Angle Up Animation
		:_AniChange_Restart					;(Smooth)
		:  l8							;(RefID 7)  Running Wall Animation
		: P13							;(NewID 7)  Normal Running Wall Animation
		:_AniChange_Restart					;(Smooth)
		:  l9							;(RefID 8)  Running Angle Down Animation
		: P14							;(NewID 8)  Normal Running Angle Down Animation
		:_AniChange_Restart					;(Smooth)
		: l10							;(RefID 9)  Pushing Animation
		:  P5							;(NewID 9)  Normal Pushing Animation
		:_AniChange_Restart					;(Smooth)
		: l13							;(RefID 10) Current Ducking Animation
		:  P3							;(NewID 10) Normal Ducking Animation
		:_AniChange_Restart					;(Smooth)
		: l14							;(RefID 10) Ducking Animation
		:  P3							;(NewID 10) Normal Ducking Animation
		:_AniChange_Restart					;(Smooth)
		: l21							;(RefID 11) Tripping Animation
		: P27							;(NewID 11) Normal Tripping Animation
		:_AniChange_Restart					;(Smooth)
		: l26							;(RefID 12) Running2 Flat Animation
		: P15							;(NewID 12) Normal Running2 Flat Animation
		:_AniChange_Restart					;(Smooth)
		: l27							;(RefID 13) Running2 Angle Up Animation
		: P16							;(NewID 13) Normal Running2 Angle Up Animation
		:_AniChange_Restart					;(Smooth)
		: l28							;(RefID 14) Running2 Wall Animation
		: P17							;(NewID 14) Normal Running2 Wall Animation
		:_AniChange_Restart					;(Smooth)
		: l29							;(RefID 15) Running2 Angle Down Animation
		: P18							;(NewID 15) Normal Running2 Angle Down Animation
		:_AniChange_Restart					;(Smooth)

		~Eval _Player_RunVel1 = $600

# End	;Terminate Function

;===================================================================================
;=============================
;Function 47 - Super Tripping=
;=============================

@Repeat
	#_Ani_SetFrame
	: 243

	#_Ani_Delay
	:  10

	#_Ani_SetFrame
	: 244

	#_Ani_Delay
	:  10

	#_Ani_SetFrame
	: 245

	#_Ani_Delay
	:  10

	#_Ani_SetFrame
	: 244

	#_Ani_Delay
	:  10

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;===================================
;Function 48 - Super Transformation=
;===================================

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;This is a "Floating Mode" animation, and begins with Player_Freeze set
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_Ani_SetFrame
	:  22

	#_Ani_Delay
	:   6

	#_Ani_SetFrame
	:  23

	#_Ani_Delay
	:   6

	#_Ani_SetFrame
	:  24

	#_Ani_Delay
	:   3

	#_CallFunc_Game
	: 16 ;Super Sonic Palette Cycle

	#_Ani_SetFrame
	:  25

	#_Ani_Delay
	:   3

	#_Ani_SetFrame
	:  26

	#_Ani_Delay
	:   3

	#_Ani_SetFrame
	:  25

	#_Ani_Delay
	:   3

	;;;;;;;;;;;;;;;;;;;;;;;
	;Resume player movement
	;;;;;;;;;;;;;;;;;;;;;;;

	#_FetchPlayer
	:_Ref_All
	:r_Curr_Player
	~Eval _Player_Freeze       = _PFreeze_Off			;Clear the player freeze flag
	~If _Player_Movement_Mode == _PMM_Spinning
		~Eval _Player_Movement_Mode = _PMM_Standing		;Abort spin by switching to standing mode
		~Eval _Player_VPPanOffset  -= _Player_SpinOffset	;Adjust the VPY offset so the sudden transition from spinning to standing doesn't cause the screen to jerk
	~EndIf
@Repeat
	#_Ani_SetFrame
	:  26

	#_Ani_Delay
	:   3

	#_Ani_SetFrame
	:  25

	#_Ani_Delay
	:   3

	#_Loop								;Animate this 2 times before resuming normal animation
	: @Repeat									;(Loop)
	:   0										;(Counter)
	:   1										;(Repeat)

	#_FuncBreak							;Delay once more for a full 3 frames, since the "Loop" did not cause a break when falling through

	#_Ani_SetFrame
	:  26

	#_Ani_Delay
	:   3

	#_FetchPlayer
	:_Ref_All
	:r_Curr_Player

	~Eval _Player_FloatingFlag = 0
	~Eval _Player_AniSpeed     = 1

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;Keep the animation alive for one more frame so that the player doesn't
	;become invisible while waiting for the animation change to take effect
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	#_FuncBreak

# End	;Terminate Function

;===================================================================================
;=============================
;Function 49 - Level-Out Pose=
;=============================

	#_Ani_SetFrame
	: 231

	#_Ani_Delay
	:   8

	#_Ani_SetFrame
	: 232

	#_Ani_Delay
	:   8

	#_Ani_SetFrame
	: 233

	#_Ani_Delay
	:  48

@Repeat
	#_Ani_SetFrame
	: 234

	#_Ani_Delay
	:  8

	#_Ani_SetFrame
	: 235

	#_Ani_Delay
	:  8

	#_Ani_SetFrame
	: 234

	#_Ani_Delay
	:  8

	#_Ani_SetFrame
	: 233

	#_Ani_Delay
	:  8

	#_GoTo
	: @Repeat

# End	;Terminate Function

;===================================================================================
;=======================
;Function 50 - Floating=
;=======================

@Repeat
	#_Ani_SetFrame
	: 16

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	: 17

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	:294

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	:295

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	: 18

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	: 19

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	: 14

	#_Ani_Delay
	:  4

	#_Ani_SetFrame
	: 15

	#_Ani_Delay
	:  4

	#_GoTo
	: Repeat

# End	;Terminate Function

;=======================================
;Function 51 - Standing Up for Continue=
;=======================================

	#_Ani_SetFrame
	: 212

	#_Ani_Delay
	:   4

	#_Ani_SetFrame
	: 211

	#_Ani_Delay
	:   4

	#_Ani_SetFrame
	:   0
@Sustain
	#_BreakTo
	: @Sustain

# End	;Terminate Function

-EOF-