; Run onto screen (Ground-Level Knockback, Etc.)
[Statedef 103]
type    = S
physics = N
anim = 108
sprpriority = 1
velset = 7.5, 0
ctrl = 0


[State 101, Dust]
type = Explod
trigger1 = Animelem = 1
trigger2 = Animelem = 3
trigger3 = Animelem = 5
trigger4 = Animelem = 7
anim = 5556
ID = 101
pos = 0,2
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
removetime = -2
scale = -1,-1
sprpriority = 7
ontop = 1
ownpal = 1
removeongethit = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 32

[State 101, 10]
type = ChangeState
trigger1 = time > 10 && p2bodydist x <= 60
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Run onto screen (Aerial Rave, Etc.)
[Statedef 102]
type    = S
physics = N
anim = 108
sprpriority = 1
velset = 7.5, 0
ctrl = 0

;[State 102, PosSet]
;type = PosSet
;trigger1 = time = 0
;x = (enemy, pos x - facing*(320))
;y = 0


[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 47

[State 102, 10]
type = ChangeState
trigger1 = time > 10 && p2bodydist x <= 100
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Pause Before running onto screen
[Statedef 101]
type = S
movetype= I
physics = N
velset = 0, 0
ctrl = 0
anim = 107
sprpriority = 2

[State 103, PosSet]
type = PosSet
trigger1 = time = 0
x = backedgebodydist
y = 0


[State 103, ScreenBound]
type = ScreenBound
trigger1 = p2movetype = H
value = 0
movecamera = 0,0

[state 103, run]
type = ChangeState
trigger1 = time > 40 && enemynear, pos y >= 0
trigger2 = time = 55
value = 102 ;101 ;run back onscreen state
ctrl = 0


;---------------------------------------------------------------------------
;Guard Push (Stand)
[Statedef 6300]
type    = S
movetype= I
physics = N
poweradd= 0
velset = 4,0
ctrl = 0
anim = 705
sprpriority = 2

[State 6300, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 130,0


[State 6300, a1]
type = VelMul
trigger1 = 1
x = 0.75

[State 6300, a2]
type = VelSet
trigger1 = Time = 10
x = 0

[State 6300, a3]
type = Width
trigger1 = 1
value = 10,0

[State 6300, a4]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 35

[State 6300, a5]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "GuardPush"
postype = P1
pos = -50,0
stateno = 6350
ownpal = 1
size.height = 200
size.ground.back = 30
size.ground.front = 30

[State 6300, a6]
type = Explod
trigger1 = animelem = 1
anim = 725
postype = p1
pos = 100,-50
ownpal = 1
vel = 0,0
scale = 0.5,0.5
ignorehitpause = 1
sprpriority = 7

[State 6300, a7]
type = PlaySnd
trigger1 = Time = 0
value = 44,0
volume = 255
channel = 1

[State 6300, a8]
type = PlaySnd
trigger1 = Time = 0
value = 6,5
channel = 0

[State 6300, a9]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;------------------------------------------
;Push Block (Crouch)
[Statedef 6310]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 4,0
ctrl = 0
anim = 710
sprpriority = 2

[State 6310, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 130,0


[State 6310, a1]
type = VelMul
trigger1 = 1
x = 0.75

[State 6310, a2]
type = VelSet
trigger1 = Time = 10
x = 0

[State 6310, a3]
type = Width
trigger1 = 1
value = 10,0

[State 6310, a4]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 35

[State 6310, a5]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "GuardPush"
postype = P1
pos = -20,0
stateno = 6350
ownpal = 1
size.height = 200
size.ground.back = 30
size.ground.front = 30

[State 6310, a6]
type = Explod
trigger1 = animelem = 1
anim = 725
postype = p1
pos = 55,-45
ownpal = 1
vel = 0,0
removetime = 24
scale = 0.5,0.5
ignorehitpause = 1
sprpriority = 7

[State 6300, a7]
type = PlaySnd
trigger1 = Time = 0
value = 44,0
volume = 255
channel = 1

[State 6310, a8]
type = PlaySnd
trigger1 = Time = 0
value = 6,5
channel = 0

[State 6310, a9]
type = ChangeState
trigger1 = animtime = 0
value = 11
ctrl = 1

;---------------------------------------------
;Push Block (Air)
[Statedef 6320]
type    = S
movetype= I
physics = N
poweradd= 0
velset = 4,0
ctrl = 0
anim = 715
sprpriority = 2

[State 6300, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 130,0


[State 6320, a1]
type = VelMul
trigger1 = 1
x = 0.75

[State 6320, a2]
type = VelSet
trigger1 = Time = 10
x = 0

[State 6320, a3]
type = Width
trigger1 = 1
value = 10,0

[State 6320, a4]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 35

[State 6320, a5]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "GuardPush"
postype = P1
pos = -20,0
stateno = 6350
ownpal = 1
size.height = 200
size.ground.back = 30
size.ground.front = 30

[State 6320, a6]
type = Explod
trigger1 = animelem = 1
anim = 725
postype = p1
removetime = 24
pos = 65,-55
ownpal = 1
scale = 0.5,0.5
vel = 0,0
ignorehitpause = 1
sprpriority = 7

[State 6300, a7]
type = PlaySnd
trigger1 = Time = 0
value = 44,0
volume = 255
channel = 1

[State 6320, a8]
type = PlaySnd
trigger1 = Time = 0
value = 6,5
channel = 0

[State 6320, a9]
type = ChangeState
trigger1 = animtime = 0
value = 660;51
ctrl = 1

;------------------------------------
[Statedef 6350];guard push helper
type    = S
movetype= I
physics = N
poweradd= 0
ctrl = 0
anim = 720
sprpriority = -4

[State 6350, a1]
type = PlayerPush
trigger1 = Time >= 0
value = 1

[State 6350, a2]
type = VelSet
trigger1 = Time = [0,10]
x = 30

[State 6350, a3]
type = VelSet
trigger1 = Time = [11,13]
x = 20

[State 6350, a4]
type = VelSet
trigger1 = Time >= 14
x = 10

[State 6350, a5]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 6350, a6]
type = DestroySelf
trigger1 = Time >= 12

;---------------------------------------------------------------------------
; Slam FX
[StateDef 256]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
anim = 925
sprpriority = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1;time = 0
flag = noshadow
ignorehitpause = 1

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 256, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0


;---------------------------------------------------------------------------
; Guard Counter - Dash Rip
[Statedef 700]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
velset = 0,0
anim = 700
sprpriority = 3
poweradd= -500

[State 700, SuperPause]
type = SuperPause
trigger1 = time = 0
pos = 25, -57
anim = 760
sound = s700,0
unhittable = 1
Time = 30

[State 700, Counter FX]
type = Explod
trigger1 = time = 0
anim = 921
postype = p1
pos = 7,-29
ownpal = 1
sprpriority = 5
supermovetime = 50


[State 1010, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 100,1

[State 1010, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 260,5


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 500,1


[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit=1
value = 500,6


[State 1005, Explod]
type = Explod
trigger1 = animelem = 2
anim = 1020
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 99
removetime = -2
scale = 1,1
sprpriority = 3
ontop = 0
ownpal = 0
removeongethit = 1

[State 1005, Explod]
type = Explod
trigger1 = animelem = 2
anim = 1021
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 99
removetime = -2
scale = 1,1
sprpriority = 3
ontop = 0
ownpal = 0
removeongethit = 1

[State 1005, Explod]
type = Explod
trigger1 = animelem = 2
anim = 1022
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 99
removetime = -2
scale = 1,1
sprpriority = 3
ontop = 0
ownpal = 0
removeongethit = 1

[State 1005, Explod]
type = Explod
trigger1 = animelem = 2
anim = 1023
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 99
removetime = -2
scale = 1,1
sprpriority = 3
ontop = 0
ownpal = 0
removeongethit = 1


[State 700, Burst]
type = Explod
trigger1 = Animelem = 2
anim = 930
postype = p1
pos = -25, 0
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 7
scale = 0.5, 0.5


[State 700, VelSet]
type = VelSet
trigger1 = animelem = 2
x = 33

[State 700, VelSet]
type = VelSet
trigger1 = time >= 5 && time < 18
x = 0.5

[State 700, 1]
type = HitDef
trigger1 = time = 0
attr = S, SA			;Attribute: Standing, Normal Attack
damage = 21, 0			;Damage that move inflicts, guard damage
animtype = Back			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
hitflag = MAF			;Flags of conditions that move can hit
priority = 4, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 2, 1			;Time attacker pauses, time opponent shakes
guard.pausetime = 13, 20
sparkno = s981				;Spark anim no (Def: set above)
guard.sparkno = s935
sparkxy = -20, -44		;X-offset for the "hit spark" rel. to p2,
hitsound = s500, 2			;Sound to play on hit
guardsound = s130, 1			;Sound to play on guard
ground.type = High		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 30		;Time that the opponent slides back
ground.hittime  = 30		;Time opponent is in hit state
ground.velocity = 15, -7		;Velocity at which opponent is pushed
;airguard.velocity = -3,-3	;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = high			;Type: High, Low, Trip (def: same as ground.type)
air.velocity = 15,-7		;X-velocity at which opponent is pushed,
air.hittime = 30			;Time before opponent regains control in air
air.fall = 1
fall = 1
fall.recover = 1
fall.recovertime = 30
envshake.time = 8
envshake.ampl = 6
p2facing = -1


[State 700, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;---------------------------------------------------------------------------
;Air Guard Counter - Instinctive Flip
[Statedef 710]
type    = A
movetype= A
physics = S
juggle  = 0
ctrl = 0
velset = 0,0
anim = 4001
sprpriority = 3
poweradd= -500

[State 710, SuperPause]
type = SuperPause
trigger1 = time = 0
pos = 25, -57
anim = 780
sound = s700,0
unhittable = 1
Time = 30


[State 710, Counter FX]
type = Explod
trigger1 = time = 0
anim = 921
postype = p1
pos = 5,-47
ownpal = 1
sprpriority = 5
supermovetime = 50



[State 710, 1]
type = PlaySnd
trigger1 = time = 6
value = 400, 0
volume = -2

[State 710, a4]
type = NotHitBy
trigger1 = Time = 0
value = SCA, AA, AT, AP
time = 10

[State 710, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 1705
ctrl = 0


;---------------------------------------------------------------------------------------------
;Beginning of the super jump
[Statedef 7000]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1


[State 7000, ChangeState]
type = ChangeState
triggerall = prevstateno = 250 || prevstateno = 1806
trigger1 = AnimTime = 0
value = 7002
ctrl = 0



[State 7000, VarSet]
type = VarSet
trigger1 = Time = 0
v = 11
value = 0

[State 7000, VarSet]
type = VarSet
trigger1 = command = "holdfwd"
v = 11
value = 1

[State 7000, VarSet]
type = VarSet
trigger1 = command = "holdback"
v = 11
value = -1



[State 7000, ChangeState]
type = ChangeState
triggerall = prevstateno != 250 || prevstateno != 1806
trigger1 = AnimTime = 0
value = 7001
ctrl = 1

;---------------------------------------------------------------------------------------------
;Super Jump
[Statedef 7001]
type = A
physics = A
ctrl = 1
anim = 48; 41
velset = 0,-15;-16.2 ;.5

[State 0, Jump]
type = PlaySnd
trigger1 = time = 0
value =  7000, 0


[State 7001, VelAdd]
type = VelAdd
triggerall = Vel X >= -2.5
trigger1 = command = "holdback"
trigger1 = Anim != 43
x = -0.3

[State 7001, VelAdd]
type = VelAdd
triggerall = Vel X <= 3
trigger1 = command = "holdfwd"
trigger1 = Anim != 42
trigger2 = var(59)>0;--------------AI
trigger2 = Anim != 42
x = 0.4

;[State 7001, VelSet]
;type = VelSet
;trigger1 = Anim = 42
;trigger1 = Time = [0,5]
;x = 4

;[State 7001, VelSet]
;type = VelSet
;trigger1 = Anim = 43
;trigger1 = Time = [0,5]
;x = -3.5

[State 7001, ChangeAnim]
type = ChangeAnim
trigger1 = Var(11) = 0
trigger1 = Time = [0,4]
value = 41  ;41

[State 7001, ChangeAnim]
type = ChangeAnim
trigger1 = Var(11) = 1
trigger1 = Time = [0,4]
value = 41 ; 41

[State 7001, ChangeAnim]
type = ChangeAnim
trigger1 = Var(11) = -1
trigger1 = Time = [0,4]
value = 41 ; 41

[State 7001, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 9999,5
volume = 255

[State 7001, VelAdd]
type = VelAdd
trigger1 = Vel Y > 0
y= - 0.10  ;0.18

[State 7001, Explod]
type = Explod
trigger1 = Time = 0
ID = 7001
anim = 905
postype = p1
pos = 0, 15
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 2
scale = 0.7,0.7



[State 7001, ChangeState]
type = ChangeState
triggerall = prevstateno != [46,47]
trigger1 = pos y <= -75 && backedgebodydist <= 5 && command = "holdfwd" && command != "holdup" && command != "holddown"
value = 46
ctrl = 0

[State 7001, ChangeState]
type = ChangeState
triggerall = prevstateno != [46,47]
trigger1 = pos y <= -75 &&  Frontedgebodydist <= 10 && command = "holdback" && command != "holdup" && command != "holddown"
value = 47
ctrl = 0



;---------------------------------------------------------------------------------------------
;Super Jump for Aerial Rave
[Statedef 7002]
type = A
physics = A
ctrl = 1
anim = 48; 41
velset = 0,-14.5


[State 0, Jump]
type = PlaySnd
trigger1 = time = 0
value =  7000, 0


[State 7002, VelAdd]
type = VelAdd
triggerall = Vel X >= -2.5
trigger1 = command = "holdback"
trigger1 = Anim != 43
x = -0.3

[State 7002, VelAdd]
type = VelAdd
triggerall = Vel X <= 3
trigger1 = command = "holdfwd"
trigger1 = Anim != 42
trigger2 = var(59)>0;--------------AI
trigger2 = Anim != 42
x = 0.4

;[State 7001, VelSet]
;type = VelSet
;trigger1 = Anim = 42
;trigger1 = Time = [0,5]
;x = 4

;[State 7001, VelSet]
;type = VelSet
;trigger1 = Anim = 43
;trigger1 = Time = [0,5]
;x = -3.5

[State 7002, ChangeAnim]
type = ChangeAnim
trigger1 = Var(11) = 0
trigger1 = Time = [0,4]
value = 41  ;41

[State 7002, ChangeAnim]
type = ChangeAnim
trigger1 = Var(11) = 1
trigger1 = Time = [0,4]
value = 41 ; 41

[State 7002, ChangeAnim]
type = ChangeAnim
trigger1 = Var(11) = -1
trigger1 = Time = [0,4]
value = 41 ; 41

[State 7002, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 9999,5
volume = 255

[State 7002, VelAdd]
type = VelAdd
trigger1 = Vel Y > 0
y= - 0.10  ;0.18

[State 7001, Explod]
type = Explod
trigger1 = Time = 0
ID = 7001
anim = 905
postype = p1
pos = 0, 15
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 2
scale = 0.7,0.7

[State 0, Helper]
type = Helper
trigger1 = time = 0
helpertype = normal ;player
name = "Rave_Timer"
ID = 7003
stateno = 7003
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1




;---------------------------------------------------------
;Aerial Rave Timer
[Statedef 7003]
physics = N
anim = 3999
sprpriority = -3

[State 7003, 8]
Type = Destroyself
trigger1 = time = 50 || time > 10 && parent, vel y > 0 || parent, movetype = H



;---------------------------------------------------------------------------
; Wakeup Forward
[Statedef 5155]
type    = L
movetype= I
physics = N

[State 5155, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5155 + (anim % 10))
value = 5155

[State 5155, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5155 + (anim % 10))
value = 5155 + (anim % 10)

[State 5155, VelSet]
type = VelSet
trigger1 = animelem = 1
x = 7.5
y = 0


[State 5155, 4]
type = HitFallSet
trigger1 = Time = 0
value = 1

[State 5155, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 10

[State 5155, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 10



[State 5155, 7]
type = changestate
trigger1 = AnimTime = 0
Value = 5159
ctrl = 0


;----------------------------------------------------
; Wakeup Back
[Statedef 5156]
type    = L
movetype= I
physics = N

[State 5156, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5156 + (anim % 10))
value = 5156

[State 5156, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5156 + (anim % 10))
value = 5156 + (anim % 10)


[State 5156, VelSet]
type = VelSet
trigger1 = animelem = 1
x = -7.5
y = 0


[State 5156, 4]
type = HitFallSet
trigger1 = Time = 0
value = 1

[State 5156, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 10

[State 5156, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 10



[State 5156, 7]
type = changestate
trigger1 = AnimTime = 0
Value = 5159
ctrl = 0

;---------------------------------------------------------------------------
; Wakeup Forward
[Statedef 5157]
type    = L
movetype= I
physics = N

[State 5157, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5157 + (anim % 10))
value = 5157

[State 5157, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5157 + (anim % 10))
value = 5157 + (anim % 10)

[State 5157, VelSet]
type = VelSet
trigger1 = animelem = 1
x = 9
y = 0


[State 5157, 4]
type = HitFallSet
trigger1 = Time = 0
value = 1

[State 5157, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA, NT,ST,HT
time = 10

[State 5157, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 10



[State 5157, 7]
type = changestate
trigger1 = Time = 23
Value = 5159
ctrl = 0

;----------------------------------------------------
; Wakeup Back
[Statedef 5158]
type    = L
movetype= I
physics = N

[State 5158, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5158 + (anim % 10))
value = 5158

[State 5158, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5158 + (anim % 10))
value = 5158 + (anim % 10)


[State 5158, VelSet]
type = VelSet
trigger1 = animelem = 1
x = -9
y = 0


[State 5158, 4]
type = HitFallSet
trigger1 = Time = 0
value = 1

[State 5158, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA, NT,ST,HT
time = 10

[State 5158, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 10



[State 5158, 7]
type = changestate
trigger1 = time = 23
Value = 5159
ctrl = 0


;----------------------------------------------------
; Get Up from Wakeup Back
[Statedef 5159]
type    = L
movetype= I
physics = N
anim = 5159

[State 51589, VelSet]
type = VelSet
triggerall = prevstateno = 5156 || prevstateno = 5158
trigger1 = 1
x = -1


[State 5159, VelSet]
type = VelSet
triggerall = prevstateno = 5155 || prevstateno = 5157
trigger1 = 1
x = 1

[State 5159, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA, NT,ST,HT
time = 10

[State 5159, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 10



[State 5159, 7]
type = changestate
trigger1 = animtime = 0
Value = 0
ctrl = 1





