;================= Ryu's Central State =========================================================
[Statedef 6001]
type = S
movetype = I
physics = S
velset = 0,0
anim = 6105
sprpriority = 0
ctrl = 0

[State 6000, Display]
type = null;displaytoclipboard
trigger1 = time >= 0
text = "p2 dist relative to ryu is %d"
params = floor(p2dist x)

[State 6001, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 6001, Win Pose]
type = ChangeState
triggerall = win
trigger1 = parent, stateno = [180,189]
trigger1 = time >= 0 && anim = 6105
value = 6950

[State 6001, Finito]
type = ChangeState
triggerall = !win
triggerall = anim = 6105 && time > 0
trigger1 = parent, power = 0
trigger2 = parent, alive = 0
value = 6011

[State 6001, Turn]
type = ChangeState
triggerall = !win && !lose
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = time >= 0
trigger1 = p2dist x < 1
value = 6003

[State 6001, Var(7)Reset]
type = ParentVarSet
triggerall = !win && !lose
trigger1 = parent, power < 1000 && time >= 0
v = 7
value = 0

[State 6350, Switch to Shinkuu Hadoken]
type = ChangeState
triggerall = !win && !lose
triggerall = parent, power >= 1000
trigger1 = anim = 6105 && time >= 7
trigger1 = parent,var(7)=1
value = 6500

[State 6001, Rush Forward]
type = ChangeState
triggerall = !win && !lose
trigger1 = anim = 6105 && time >= 7
trigger1 = p2dist x >= 150
value = 6010

[State 6001, Overhead or Rush Fierce]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = anim = 6105 && time >= 7
trigger1 = p2dist x < 60
value = ifelse(random>500,6300,6350)
;value = ifelse((parent,statetype=C) || p2statetype=C,6300,6350)

[State 6001, Standing RoundHouse]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
triggerall = anim = 6105 && time >= 7
trigger1 = p2dist x < 80 && (p2statetype = S || p2statetype = C)
trigger2 = p2dist x < 100 && p2statetype = A
value = 6400

[State 6001, Crouching Forward]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = anim = 6105 && time >= 7
trigger1 = p2dist x < 100
value = 6230

[State 6001, Walk]
type = ChangeState
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
triggerall = anim = 6105 && time >= 8
trigger1 = p2dist x < 150
value = 6002

; ================= Ryu's Walking State ========================================================
[Statedef 6002]
type    = S
movetype = I
physics = S
sprpriority = 0
anim = 6106

[State 6002, 1]
type = Velset
trigger1 = anim = 6106
x = 2.1

[State 6001, Rush Forward]
type = ChangeState
triggerall = !win && !lose
trigger1 = anim = 6106
trigger1 = p2dist x >= 150
value = 6010

[State 6002, 9]
type = ChangeState
trigger1 = win || lose
trigger2 = p2dist x < 60
value = 6001

;================= Ryu's Turning State =========================================================
[Statedef 6003]
type = S
movetype = I
physics = S
sprpriority = 0
anim = 6107
velset = 0,0
ctrl = 0

[State 6002, 1]
type = turn
trigger1 = time = 0

[State 6002, 9]
type = ChangeState
trigger1 = animtime = 0
value = 6001

;================= Ryu's Rushing In State ======================================================
[Statedef 6010]
type = S
movetype = I
physics = N
velset = 6,0
anim = 6120
sprpriority = 2
ctrl = 0

[State 6002, ScreenBound]
type = ScreenBound
triggerall = prevstateno != 6001
trigger1 = time = [0,7]
value = 1
movecamera = 0,0

[State 6010, HitO]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0
stateno = 6900

[State 6010, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 6010, Yosh!]
type = PlaySnd
trigger1 = time = 0
value = 5,0
channel = 0
persistent = 0

[State 6010, 1]
type = ChangeAnim
trigger1 = p2dist x < 100
value = 6121
persistent = 0

[State 6010, Slide Sound]
type = PlaySnd
trigger1 = anim = 6121 && animelem = 1
value = 0,11
persistent = 0

[State 6010, 2]
type = velmul
trigger1 = anim = 6121
x = 0.88

[State 6010, 8]
type = ChangeState
trigger1 = anim = 6121 && animelem =3, =4
value = 6001

;============================ Ryu Getting Ready To Hop Away ===================================
[Statedef 6011]
type = S
movetype = I
physics = N
anim = 6113
sprpriority = 0
velset = 0,0
ctrl = 0

[State 6011, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 6011, 9]
type = ChangeState
trigger1 = animtime = 0
value = 6012

;============================ Alpha Ryu's Hopping Away State ==================================
[Statedef 6012]
type = A
movetype = I
physics = N
anim = 6111

[State 6002, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 6012, 1]
type = playsnd
trigger1 = time = 0
value = 0,10

[State 6012, 2]
type = velset
trigger1 = time = 0
x = -8
y = -8

[State 6012, 3]
type = veladd
trigger1 = time >= 0
y = 0.27

[State 6012, 9]
type = DestroySelf
trigger1 = time = 50

;=========================== Ryu's Crouching Forward State ==============================
[Statedef 6230]
type    = S
movetype= A
physics = S
juggle  = 3
ctrl = 0
anim = 6230
sprpriority = 2

[State 6230, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 6230, HitDef]
type = HitDef
trigger1 = AnimElem = 6
attr = C, NA
damage    = 25
animtype = Medium
guardflag = L
hitflag = MF
priority = 4, Hit
pausetime = 10,10
sparkno = 1
guard.sparkno = S9100
sparkxy = 0,-5
hitsound = S6,4
guardsound = S0,100
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5

[State 6210, Whiff]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 3

[State 6210, Switch to Shinkuu Hadoken]
type = ChangeState
triggerall = power >= 1000
trigger1 = parent,var(7)=1
trigger1 = movecontact = 1
value = 6500

[State 6230, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 6001

;=========================== Ryu's Overhead Punch State =================================
[Statedef 6300]
type = S
movetype = A
physics = S
anim = 6300
velset = 0,0
sprpriority = 2
juggle = 3

[State 6300, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 6300, Huhp]
type = PlaySnd
triggerall = anim = 6300
trigger1 = animelem = 1
value = 5,2
channel = 0
persistent = 0

[State 6300, 4]
type = PosAdd
triggerall = anim = 6300
trigger1 = animelemtime(3) >= 1 && animelemtime(6) < 0
x = 1.5

[State 6300, Yiak]
type = PlaySnd
triggerall = anim = 6300
trigger1 = animelem = 4, =1
value = 5,3
channel = 0
persistent = 0

[State 6300, 5]
type = HitDef
trigger1 = AnimElem = 5 || Animelem = 6
attr = S, NA
animtype  = Medium
damage    = 20
hitflag = MAF
guardflag = HA
priority = 4, Hit
pausetime = 10,10
sparkxy = 0,ifelse(animelemno(0)=5,-70,-40)
sparkno = 1
guard.sparkno = S9100
hitsound   = S6,4
guardsound = S0,100
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,-6
air.hittime = 15

[State 6300, 8]
type = null; changeanim
trigger1 = animtime = 0
value = 6112

[State 6300, 9]
type = null; changestate
trigger1 = anim = 6112
trigger1 = animtime = -1
value = 6012

[State 6300, 9]
type = ChangeState
trigger1 = anim = 6300 && animtime = 0
value = 6001

;=========================== Ryu's Fierce Rushing Punch State ===========================
[Statedef 6350]
type = S
movetype = A
physics = S
anim = 6350
velset = 0,0
sprpriority = 2
juggle = 4

[State 6350, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 6350, 4]
type = VelSet
trigger1 = anim = 6350 && animelem = 3
x = 7

[State 6300, Yiak]
type = PlaySnd
triggerall = anim = 6350
trigger1 = animelem = 3, =1
value = 5,3
channel = 0
persistent = 0

[State 6350, 5]
type = HitDef
trigger1 = AnimElem = 4 || Animelem = 5
attr = S, NA
animtype  = Hard
damage    = 30
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-50
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,5
guardsound = S0,100
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -8
air.velocity = -4,-5.5

[State 6350, 9]
type = ChangeState
trigger1 = anim = 6350 && animtime = 0
value = 6001

; ========================== Ryu's Standing Roundhouse ==================================
[Statedef 6400]
type = S
movetype = A
physics = S
anim = 6400
velset = 0,0
sprpriority = 2
juggle = 4

[State 6400, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 6400, Huhp]
type = PlaySnd
triggerall = anim = 6400
trigger1 = animelem = 3
value = 5,2
channel = 0
persistent = 0

[State 6350, 5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 35
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-80
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,6
guardsound = S0,100
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -8
air.velocity = -4,-5.5

[State 6400, 9]
type = ChangeState
trigger1 = animtime = 0
value = 6001

; ========================== Ryu's Shinkuu Hadoken State =======================================
[Statedef 6500]
type = S
movetype = A
physics = S
velset = 0,0
anim = 6140
sprpriority = 2
poweradd = -1000

[State 6500, ParentVar(7)Reset]
type = ParentVarSet
trigger1 = 1
v = 7
value = 0

[State 6500, Shinkuu]
type = PlaySnd
trigger1 = animelem = 1
value = 5,4
channel = 0
persistent = 0

[State 6500, Electric]
type = PlaySnd
trigger1 = animelem = 2 && anim = 6140
value = 7,10
loop = 1
channel = 3

[State 6500, 0]
type = superpause
trigger1 = animelem = 2 && anim = 6140
anim = S4960
time = 50
pos = -29, -63
;sound = S7,4
sound = S7,9
sprpriority = 3
volume = 200

[State 6500, 1]
type = explod
trigger1 = animelem = 2 && anim = 6140
anim = 4800
id = 4800
postype = p1
bindtime = 1
sprpriority = 5
supermove = 1
ownpal = 1
removeongethit = 1
persistent = 0

[State 6500, SHadoken]
type = PlaySnd
trigger1 = animelem = 3 && anim = 6140
value = 5, 1
channel = 0
persistent = 0

[State 6500, Super Fireball]
type = Projectile
trigger1 = animelem = 4 && anim = 6140
ProjAnim = 1025
projID = 6500
ProjHitAnim = 1011
ProjRemAnim = 1011
projsprpriority = 5
ProjStageBound = 80
ProjEdgeBound = 80
offset = 83, -53
velocity = 5, 0
remvelocity = .7, 0
; HitDef part of projectile info
attr = A, SP
damage    = 20,5
animtype = Hard
fall.animtype = Hard
guardflag = MAF
pausetime = 4,4
sparkno = 2
sparkxy = 0, 0
guard.sparkno = S9300
projhits = 5
;projmisstime = 1
hitsound   = S6,5
guardsound = S0,100
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -7
air.velocity = -4,-4
air.fall = 1
p2facing = 1
fall = 1

[State 6500, Stop Electric]
type = StopSnd
trigger1 = animelem =3, && anim = 6140
channel = 3

[State 6500, Flame Sound]
type = playsnd
trigger1 = animelem = 4
trigger1 = anim = 6140
value = 0,7
volume = 50

[State 6500, 9]
type = changestate
trigger1 = anim = 6140
trigger1 = animtime = 0
value = 6001

;======================= Ryu's Shin Shoryuken States ====================================
; Shin Shoryuken Start
[Statedef 6600]
type = S
movetype = A
physics = S
sprpriority = 2
anim = 6650
velset = 5,0

[State 6600, 1]
type = SuperPause
trigger1 = animelem = 2 && anim = 6650
anim = S4960
time = 50
pos = 17, -27
sound = S7,9
sprpriority = 3
volume = 200

[State 6600, Ikozo!]
type = PlaySnd
trigger1 = animelem = 2, =1
value = 5,5
channel = 0
persistent = 0

[State 6600, 5]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype  = Medium
damage    = 70
hitflag = MAFP
guardflag = MA
priority = 7, Hit
pausetime = 45,45
sparkxy = 18,-70
sparkno = -1
guard.sparkno = S9300
hitsound   = S6,11
guardsound = S0,100
ground.type = Low
ground.velocity = 2, -2.5
ground.hittime = 20
ground.slidetime = 20
air.velocity = 1.5, -2.5
fall.animtype = Medium
forcestand = 1
snap = 40, 0
p2facing = 1
kill = 0

[State 6600, 6]
type = envshake
trigger1 = movehit = 1
time = 20
freq = 90
ampl = -5
ignorehitpause = 1
persistent = 0

[State 6600, 7]
type = explod
trigger1 = movehit = 1
anim = 4965
id = 4965
postype = p1
pos = 39, -70
persistent = 0
ignorehitpause = 1
ownpal = 1
sprpriority = 4

[State 6600, 8]
type = ChangeState
trigger1 = movehit = 1
value = 6655

; Shin Shoryuken 2nd Hit ----------------
[Statedef 6655]
type = S
movetype = A
physics = S
sprpriority = 2
anim = 6655
velset = 0,0

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

[State 6600, Shin!]
type = PlaySnd
trigger1 = animelem = 2
value = 5,6
channel = 0
persistent = 0

[State 6600, 5]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype  = Hard
damage    = 70
hitflag = MAF
guardflag = MA
priority = 5, Hit
pausetime = 45,45
sparkxy = 18,-70
sparkno = -1
guard.sparkno = S9300
hitsound   = S6,11
guardsound = S0,100
ground.type = Low
ground.velocity = -0.1, -6
ground.hittime = 20
ground.slidetime = 20
air.velocity = -0.1, -6
forcestand = 1
fall.animtype = Hard
snap = 30,-25
p2facing = 1
fall = 1
kill = 0

[State 6600, 6]
type = envshake
trigger1 = movehit = 1
time = 20
freq = 90
ampl = -5
ignorehitpause = 1
persistent = 0

[State 6600, 6]
type = explod
trigger1 = movehit = 1
anim = 4965
id = 4965
postype = p1
pos = 39, -80
persistent = 0
ignorehitpause = 1
ownpal = 1
sprpriority = 4

[State 6600, 7]
type = ChangeState
trigger1 = animtime = 0
value = 6660

; Shin Shoryuken 3rd & 4th Hit ----------------
[Statedef 6660]
type = A
movetype = A
physics = N
sprpriority = 2
anim = 6660
velset = 0,-12

[State 6660, PosAdd]
type = PosAdd
trigger1 = time = 0
x = 22

[State 6660, Gravity]
type = gravity
trigger1 = 1

[State 6660, S.Shoryuken!]
type = PlaySnd
trigger1 = animelem = 1
value = 5,7
channel = 0
persistent = 0

[State 6660, 3]
type = HitDef
trigger1 = AnimElem = 1
attr = A, HA
animtype  = Up
damage    = 70
hitflag = MAF
guardflag = MA
priority = 5, Hit
pausetime = 8,7
sparkxy = 18,-70
sparkno = -1
guard.sparkno = S9300
hitsound   = S6,11
guardsound = S0,100
ground.type = High
ground.velocity = -0.1, -11
ground.hittime = 20
ground.slidetime = 20
air.velocity = -0.1, -11
forcestand = 1
snap = 10,-40
p2facing = 1
fall = 1
kill = 0

[State 6660, 4]
type = explod
trigger1 = movehit = 1
anim = 4965
id = 4965
postype = p1
pos = 0, -120
persistent = 0
ignorehitpause = 1
ownpal = 1
sprpriority = 4

[State 6600, 4b]
type = envshake
trigger1 = movehit = 1
time = 6
freq = 90
ampl = -5
ignorehitpause = 1
persistent = 0

[State 6660,5]
type = MoveHitReset
trigger1 = animelem = 1, =1

[State 6660, 6]
type = HitDef
trigger1 = AnimElem = 2
attr = A, HA
animtype  = Up
damage    = 70
hitflag = MAF
guardflag = MA
priority = 5, Hit
pausetime = 45,45
sparkxy = 18,-70
sparkno = -1
guard.sparkno = S9300
hitsound   = S6,11
guardsound = S0,100
ground.type = High
ground.velocity = -0.1, -15
ground.hittime = 20
ground.slidetime = 20
air.velocity = -0.1, -15
forcestand = 1
snap = 10,-50
p2facing = 1
fall = 1
air.recover = 0

[State 6660, 7]
type = explod
trigger1 = movehit = 1 && time > 6
anim = 4965
id = 4965
postype = p1
pos = 0, -120
persistent = 0
ignorehitpause = 1
ownpal = 1
sprpriority = 4

[State 6600, 6]
type = envshake
trigger1 = movehit = 1 && time > 6
time = 20
freq = 90
ampl = -5
ignorehitpause = 1
persistent = 0

[State 6660, 8]
type = changeanim
trigger1 = animtime = 0
value = 6665
persistent = 0

[State 6660, 9]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 6670

; Shin Shoryuken Land --------------------
[Statedef 6670]
type = S
movetype = I
physics = S
sprpriority = 2
anim = 6670
velset = 0,0

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

[State 6670, 2]
type = ChangeAnim
trigger1 = animtime = 0 && anim = 6670
value = 6500

[State 6670, 3]
type = PlaySnd
trigger1 = anim = 6500 && animelem = 4
value = 5,8
channel = 0
persistent = 0

[State 6670, 4]
type = ChangeState
trigger1 = anim = 6500 && animtime = 0
value = 6012

;=========================== Ryu's Get Hit State ========================================
[Statedef 6900]
type = A
movetype = H
physics = N
anim = 6190

[State 6900, StopChannel3]
type = StopSnd
trigger1 = time = 0
channel = 3

[State 6900, 0]
type = ChangeAnim
trigger1 = hitshakeover = 1
value = 6191
persistent = 0

[State 6900, RyuPainSnd]
type = PlaySnd
trigger1 = hitshakeover = 1 && time > 10
value = 5,9
volume = 255
channel = 0

[State 6900,0]
type = posfreeze
trigger1 = hitshakeover = 0

[State 6900,1]
type = velset
trigger1 = hitshakeover = 1
x = hitvel x
y = ifelse(hitvel y > -2, -6, 1.2*hitvel y)
persistent = 0

[State 6900,4]
type = gravity
trigger1 = anim = 6191

[State 6900,9]
type = Changestate
trigger1 = pos y >= 10 && vel y > 0
value = 6901

; Hit Ground and Bounce
[Statedef 6901]
type = L
movetype = H
physics = N
anim = 6192
velset = 0,0

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

[State 6901, 1]
type = PlaySnd
trigger1 = time = 0
value = 0,6
volume = -50

[State 6901, 2]
type = posfreeze
trigger1 = 1

[State 6901, 3]
type = ChangeState
trigger1 = animtime = 0
value = 6902

; Bouncing in air
[Statedef 6902]
type = A
movetype = H
physics = N
anim = 6193

[State 6902, 0]
type = velset
trigger1 = time = 0
x = ifelse(hitvel x < 0, -2, 2)
y = -2

[State 6902, 1]
type = VelAdd
trigger1 = time > 0
y = 0.27

[State 6902, 2]
type = ChangeState
trigger1 = pos y >= 5 && vel y > 0
value = 6903

; Hit Ground from Tripped
[Statedef 6903]
type = L
movetype = H
physics = S
anim = 6195
velset = 0,0

[State 6903, 0]
type = PlaySnd
trigger1 = time = 0
value = 0,6
volume = -50

[State 6903, 1]
type = posset
trigger1 = time = 0
y = 0

[State 6903, 7]
type = ChangeState
trigger1 = animtime = 0 
trigger1 = parent, var(10)=1
value = 6001

[State 6903, 8]
type = ChangeState
trigger1 = animtime = 0
value = 6011

;================= Ryu's Win Pose - Jab =============================================================
[Statedef 6950]
type = S
movetype = I
physics = S
velset = 0,0
sprpriority = 0
anim = 6950

[State 6950, 0]
type = posset
trigger1 = time = 0
y = 0

;================= Ryu comes in after Match =========================================================
[Statedef 6990]
type = S
movetype = I
physics = N
velset = 7, 0
sprpriority = 2
anim = 6120

[State 6990, RoundNotOver]
type = AssertSpecial
trigger1 = time = [0,300]
flag = roundnotover

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

[State 6990, 2]
type = ChangeANim
trigger1 = ParentDist X < 100
value = 6121
persistent = 0

[State 6990, 3]
type = VelMul
trigger1 = anim = 6121
x = 0.85

[State 6990, 4]
type = VarSet
trigger1 = anim = 6121 && animelem = 3, =3
v = 1
value = 1

[State 6990, 5]
type = ChangeAnim
trigger1 = anim = 6121 && animelem = 3, =4
value = 9999

[State 6990, 9]
type = DestroySelf
trigger1 = var(1) = 1 && time >= 100

;================= Sakura Central State =========================================================
[Statedef 7001]
type = S
movetype = I
physics = S
velset = 0,0
anim = 7000
sprpriority = 0
ctrl = 0

[State 7000, Display]
type = null;displaytoclipboard
trigger1 = time >= 0
text = "p2 dist relative to sakura is %d"
params = floor(p2dist x)

[State 7001, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 7181, Win Pose]
type = ChangeState
triggerall = win
trigger1 = parent, stateno = [180,189]
trigger1 = time >= 0 && anim = 7000
value = 7181

[State Finito]
type = ChangeState
triggerall = !win
triggerall = anim = 7000 && time > 0
trigger1 = parent, power = 0
trigger2 = parent, alive = 0
value = 7920

[State 7001, Turn]
type = ChangeState
triggerall = !win && !lose
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = time >= 0
trigger1 = p2dist x < 1
value = 7003

[State 7001, Var(9)Reset]
type = ParentVarSet
triggerall = !win && !lose
trigger1 = parent, power < 1000 && time >= 0
v = 9
value = 0

[State 7001, Null Super State]
type = null;ChangeState
triggerall = !win && !lose
triggerall = parent, power >= 1000
trigger1 = anim = 7000 && time >= 6
trigger1 = parent,var(9)=1
value = 7500

[State 7001, Rush Forward]
type = ChangeState
triggerall = !win && !lose
trigger1 = anim = 7000 && time >= 6
trigger1 = p2dist x >= 170
value = 7010

[State 7001, Close RH]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = anim = 7000 && time >= 6
trigger1 = p2dist x < 80
value = 7300

[State 7001, Shoken!]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
triggerall = anim = 7000 && time >= 6
trigger1 = p2statetype = A && random > 400 ; && p2dist x < 100
value = 7400

[State 7001, Standing Fierce]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = anim = 7000 && time >= 6
trigger1 = p2dist x < 130
value = ifelse(random>500,7340,7320)

[State 7001, Walk]
type = ChangeState
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
triggerall = anim = 7000 && time >= 6
trigger1 = p2dist x < 170
value = 7002

; ================= Sakura's Walking State ===================================================
[Statedef 7002]
type    = S
movetype = I
physics = S
sprpriority = 0
anim = 7020

[State 7002, 1]
type = Velset
trigger1 = anim = 7020
x = 2.4

[State 7002, Rush Forward]
type = ChangeState
triggerall = !win && !lose
trigger1 = anim = 7020
trigger1 = p2dist x >= 170
value = 7010

[State 7002, 9]
type = ChangeState
trigger1 = win || lose
trigger2 = p2dist x < 80
value = 7001

;================= Sakura's s Turning State ======================================================
[Statedef 7003]
type = S
movetype = I
physics = S
sprpriority = 0
anim = 7005
velset = 0,0
ctrl = 0

[State 7003, 1]
type = turn
trigger1 = animtime = 0

[State 7003, 9]
type = ChangeState
trigger1 = animtime = 0
value = 7001

;================= Sakura Rushing In State ======================================================
[Statedef 7010]
type = S
movetype = I
physics = N
anim = 7100
velset = 5,0
sprpriority = 2

[State 7010, ScreenBound]
type = ScreenBound
triggerall = prevstateno != 7001
trigger1 = time = [0,7]
value = 1
movecamera = 0,0

[State 7010, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 7010, Running In]
type = PlaySnd
trigger1 = time = 0
value = 3,0
channel = 0
persistent = 0

[State 7010, HitO]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 1
stateno = 7900

[State 7010, 1]
type = ChangeAnim
trigger1 = p2dist x < 140
value = 7101
persistent = 0

[State 7010, Braking Voice]
type = PlaySnd
trigger1 = anim = 7101 && animelem = 4
value = 3,1
channel = 0
persistent = 0

[State 7010, Slide Sound]
type = PlaySnd
trigger1 = anim = 7101 && animelem = 1
value = 0,11
persistent = 0

[State 7010, 2]
type = velmul
trigger1 = anim = 7101
x = 0.9

[State 7010, 8]
type = ChangeState
trigger1 = anim = 7101 && animtime = 0
value = 7001

;================= Sakura's Jab Win Pose ===================================================
[Statedef 7181]
type = S
movetype = I
physics = S
anim = 7181
velset = 0,0

[State 7181, 1]
type = posset
trigger1 = time = 0
y = 0

[State 7181, Win Laugh]
type = PlaySnd
trigger1 = animelem = 4
value = 3,8

;================= Sakura Taunt State ======================================================
[Statedef 7195]
type = S
movetype = I
physics = N
anim = 7195
velset = 0,0

[State 7195, 1]
type = PlaySnd
trigger1 = animelem = 4 && anim = 7195
value = 3,2
channel = 0

[State 7195, 9]
type = ChangeState
trigger1 = anim = 7195 && animtime = 0
value = 7001

;=========== Sakura's CLOSE Roundhouse State ==============================================
[Statedef 7300]
type = S
movetype = A
physics = S
velset = 0,0
sprpriority = 2
anim = 7300
juggle = 4

[State 7300, 1]
type = PlayerPush
trigger1 = 1
value = 1

[State 7320, yIAK!]
type = PlaySnd
trigger1 = animelem = 3
value = 3,6
channel = 0

[State 7300, Whiff]
type = PlaySnd
trigger1 = animelem = 3
value = 0,4

[State 7320, 5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 30
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-80
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,6
guardsound = S0,100
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -8
air.velocity = -4,-5.5

[State 7300, 9]
type = ChangeState
trigger1 = animtime = 0
value = 7001

;=========== Sakura's Far Roundhouse State ================================================
[Statedef 7320]
type = S
movetype = A
physics = S
velset = 0,0
sprpriority = 2
anim = 7320
juggle = 4

[State 7320, 1]
type = PlayerPush
trigger1 = 1
value = 1

[State 7320, yhakkk!]
type = PlaySnd
trigger1 = animelem = 1
value = 3,7
channel = 0

[State 7320, Whiff]
type = PlaySnd
trigger1 = animelem = 3
value = 0,4

[State 7320, 5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 30
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-65
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,6
guardsound = S0,100
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -8
air.velocity = -4,-5.5

[State 7340, 9]
type = ChangeState
trigger1 = animtime = 0
value = 7001

;=========== Sakura's Standing Fierce State ================================================
[Statedef 7340]
type = S
movetype = A
physics = S
velset = 0,0
sprpriority = 2
anim = 7340
juggle = 4

[State 7340, 1]
type = PlayerPush
trigger1 = 1
value = 1

[State 7340, PosAdd]
type = posadd
trigger1 = time = 1
x = 24

[State 7350, Yiak!]
type = PlaySnd
trigger1 = animelem = 1
value = 3,5
channel = 0

[State 7350, Whiff]
type = PlaySnd
trigger1 = animelem = 3
value = 0,4

[State 7350, 5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 30
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-65
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,5
guardsound = S0,100
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -8
air.velocity = -4,-5.5

[State 7340, 9]
type = ChangeState
trigger1 = animtime = 0
value = 7001

;=========== Sakura's Shou-oh-Ken State ====================================================
[Statedef 7400]
type = S
movetype = A
physics = N
anim = 7400
velset = 0,0
sprpriority = 2
juggle = 3

[State 7400, Shouken]
type = PlaySnd
trigger1 = animelem = 1, =1
value = 3,3
channel = 0

[State 7400, 1]
type = Velset
trigger1 = animelem = 2, =1
x = 6

[State 7400, 2]
type = PlayerPush
trigger1 = 1
value = 1

[State 7300, 5]
type = HitDef
trigger1 = AnimElem = 4, =3 || Animelem = 5, =1
attr = S, SA
animtype  = Hard
damage    = 6
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 4,4
sparkxy = -10, ifelse(animelemtime(5)>=0,-65,-50)
sparkno = 2
guard.sparkno = S9200
hitsound   = S6,5
guardsound = S0,100
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.velocity = -2,-6

[State 7300, 5b]
type = HitDef
trigger1 = AnimElem = 4, =5 || Animelem = 5, =3
attr = S, SA
animtype  = Hard
damage    = 6
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 4,4
sparkxy = -10, ifelse(animelemtime(5)>=0,-65,-50)
sparkno = 2
guard.sparkno = S9200
hitsound   = S6,5
guardsound = S0,100
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -5
air.velocity = -2,-6

[State 7400, 9]
type = changestate
trigger1 = animtime = 0
value = 7401

; Shou-oh-ken Air
[Statedef 7401]
type = A
movetype = A
physics = N
anim = 7401
sprpriority = 2

[State 7401, 0]
type = posfreeze
trigger1 = time = 0

[State 7401, 1]
type = PlayerPush
trigger1 = 1
value = 1

[State 7300, 5b]
type = HitDef
trigger1 = AnimElem = 1, =1 || Animelem = 1, =3
attr = A, SA
animtype  = Hard
damage    = 8
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 4,4
sparkxy = 0,-90
sparkno = 2
guard.sparkno = S9200
hitsound   = S6,5
guardsound = S0,100
ground.type = Low
air.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -8
air.velocity = -2, -8
fall = 1

[State 7401, 0]
type = posadd
trigger1 = time = 0
x = 18

[State 7401, 1]
type = velset
trigger1 = time = 0
x = 4
y = -7.6

[State 7401, 2]
type = velmul
trigger1 = time > 0
x = 0.94

[State 7401, 3]
type = veladd
trigger1 = time > 0
y = 0.35

[State 7401, 4]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 7402

[Statedef 7402]
type = S
movetype = I
physics = S
velset = 0,0
anim = 7402

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

[State 7402, 9] ; Go to Taunt
type = ChangeState
trigger1 = animtime = 0
value = 7195

;=========== Sakura's Get Hit State ========================================================
[Statedef 7900]
type = A
movetype = H
physics = N
anim = 7900

[State 7900, 0]
type = ChangeAnim
trigger1 = hitshakeover = 1
value = 7901
persistent = 0

[State 7900, SakuraPainSnd]
type = PlaySnd
trigger1 = hitshakeover = 1 && time > 15
value = 3,4
channel = 0
persistent = 0

[State 7900,0]
type = posfreeze
trigger1 = hitshakeover = 0

[State 7900,1]
type = velset
trigger1 = hitshakeover = 1
x = hitvel x
y = ifelse(hitvel y > -2, -6, 1.2*hitvel y)
persistent = 0

[State 7900,4]
type = gravity
trigger1 = anim = 7901

[State 7900,9]
type = Changestate
trigger1 = pos y >= 0 && vel y > 0
value = 7901

; Hit Ground and Bounce
[Statedef 7901]
type = L
movetype = H
physics = N
anim = 7902
velset = 0,0

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

[State 7901, 1]
type = PlaySnd
trigger1 = time = 0
value = 0,6
volume = -50

[State 7901, 2]
type = posfreeze
trigger1 = 1

[State 7901, 3]
type = ChangeState
trigger1 = animtime = 0
value = 7902

; Sakura Bouncing in air
[Statedef 7902]
type = A
movetype = H
physics = N
anim = 7903

[State 7902, 0]
type = velset
trigger1 = time = 0
x = ifelse(hitvel x < 0, -2, 2)
y = -2

[State 7902, 1]
type = VelAdd
trigger1 = time > 0
y = 0.27

[State 7902, 2]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 7903

; Sakura Hit Ground & Get Up
[Statedef 7903]
type = L
movetype = H
physics = S
anim = 7904
velset = 0,0

[State 7903, 0]
type = PlaySnd
trigger1 = time = 0
value = 0,6
volume = -50

[State 7903, 1]
type = posset
trigger1 = time = 0
y = 0

[State 7903, 8]
type = ChangeState
trigger1 = anim = 7904 && animtime = 0
trigger1 = parent, var(10)=1
value = 7001

[State 7903, 9]
type = ChangeState
trigger1 = anim = 7904 && animtime = 0
value = 7920

;======================= Sakura Getting Ready To Run Away ===================================
[Statedef 7920]
type = S
movetype = I
physics = N
sprpriority = 0
velset = 0,0
ctrl = 0

; evaluate between dizzy or yawning
[State 7920, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = ifelse(prevstateno=7001,7850,7910)

[State 7920, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 7920, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 7920, NotHitBy]
type = NothitBy
trigger1 = 1
value = SCA
time = 1

[State 7920, 9]
type = ChangeState
trigger1 = animtime = 0
value = 7950

; ========== Sakura Turn Around And Run Away =================================================
[Statedef 7950]
type = S
movetype = I
physics = N
velset = 0,0
sprpriority = 0
anim = 7005

[State 7950, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 7950, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

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

[State 7950, 2]
type = ChangeAnim
trigger1 = anim = 7005 && animtime = 0
value = 7100
persistent = 0

[State 7950, 3]
type = turn
trigger1 = anim = 7100
persistent = 0

[State 7950, 4]
type = veladd
trigger1 = anim = 7100 && vel x <= 5
x = 0.15

[State 7950, 5]
type = destroyself
trigger1 = time = 150

; ========== Sakura comes in after Match ========================================================
[Statedef 7990]
type = S
movetype = I
physics = N
velset = 5, 0
sprpriority = -10
anim = 7100

[State 7990, RoundNotOver]
type = AssertSpecial
trigger1 = time = [0,300]
flag = roundnotover

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

[State 7990, 2]
type = ChangeANim
trigger1 = ParentDist X < 120
value = 7101
persistent = 0

[State 7990, 3]
type = VelMul
trigger1 = anim = 7101
x = 0.90

[State 7990, 4]
type = ChangeAnim
trigger1 = anim = 7101 && animtime = 0
value = 7800
persistent = 0

[State 7990, 5]
type = velset
trigger1 = anim = 7800
x = 0

[State 7990, 9]
type = DestroySelf
trigger1 = time = 400

;===================================== DAN's STATES ===========================================
;Dan's Central State --------------------------------------------------------------------------
[Statedef 8001]
type = S
movetype = I
physics = S
velset = 0,0
anim = 8000
sprpriority = 0
ctrl = 0

[State 8001, Display]
type = null;displaytoclipboard
trigger1 = time >= 0
text = "p2 dist relative to dan is %d"
params = floor(p2dist x)

[State 8001, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 8001, Win Pose]
type = ChangeState
triggerall = win
trigger1 = parent, stateno = [180,189]
trigger1 = time >= 0 && anim = 8000
value = 8181

[State 8001, Finito]
type = ChangeState
triggerall = !win
triggerall = anim = 8000 && time > 0
trigger1 = parent, power = 0
trigger2 = parent, alive = 0
value = 8920

[State 8001, Turn]
type = ChangeState
triggerall = !win && !lose
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = time >= 0
trigger1 = p2dist x < 1
value = 8003

[State 8001, Var(8)Reset]
type = ParentVarSet
triggerall = !win && !lose
trigger1 = parent, power < 1000 && time >= 0
v = 8
value = 0

[State 8001, Null Super State]
type = null;ChangeState
triggerall = !win && !lose
triggerall = parent, power >= 1000
trigger1 = anim = 7000 && time >= 6
trigger1 = parent,var(8)=1
value = 7500

[State 7001, Rush Forward]
type = ChangeState
triggerall = !win && !lose
trigger1 = anim = 8000 && time >= 6
trigger1 = p2dist x >= 150
value = 8010

[State 8001, Dan Kuu Kyaku!]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
triggerall = anim = 8000 && time >= 6
trigger1 = p2dist x < 100 && random > 800
value = 8600

[State 8001, Crouching RH or Fierce]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = anim = 8000 && time >= 6
trigger1 = p2dist x < 80
value = ifelse(p2dist x<60,8420,8460)

[State 8001, Standing Rundhouse || Fierce]
type = changestate
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
trigger1 = anim = 8000 && time >= 6
trigger1 = p2dist x < 130
value = ifelse(random>500,8260,8220)

[State 8001, Walk]
type = ChangeState
triggerall = !win && !lose
triggerall = p2stateno != 5100 && p2stateno != 5101 && p2stateno != 5110 && p2stateno != 5120
triggerall = (parent, stateno != 920) && (parent, stateno != 930)
triggerall = anim = 8000 && time >= 6
trigger1 = p2dist x < 150
value = 8002

; ===================== Dan's Walking State ===================================================
[Statedef 8002]
type    = S
movetype = I
physics = S
sprpriority = 0
anim = 8021

[State 8002, 1]
type = Velset
trigger1 = anim = 8021
x = 2.2

[State 8002, Rush Forward]
type = ChangeState
triggerall = !win && !lose
trigger1 = anim = 8021
trigger1 = p2dist x >= 150
value = 8010

[State 8002, 9]
type = ChangeState
trigger1 = win || lose
trigger2 = p2dist x < 80
value = 8001

;================= Dan's Turning State ======================================================
[Statedef 8003]
type = S
movetype = I
physics = S
sprpriority = 0
anim = 8005
velset = 0,0
ctrl = 0

[State 8003, 1]
type = turn
trigger1 = animtime = 0

[State 8003, 9]
type = ChangeState
trigger1 = animtime = 0
value = 8001

;================ Dan's Roll Out By Taunt =================================================
[Statedef 8005]
type = S
movetype = I
physics = N
anim = 8100
velset = 3,0
sprpriority = 1

[State 8005, HitO]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 2
stateno = 8900

[State 8005, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 8005, 1]
type = ChangeAnim
trigger1 = anim = 8100 && time = 30
value = 8011
persistent = 0

[State 8005, 2]
type = velmul
trigger1 = anim = 8011
x = 0.9

[State 8005, 3]
type = makedust
trigger1 = anim = 8011
pos = -10, -2
spacing = 3

[State 8005, 4]
type = ChangeAnim
trigger1 = anim = 8011 && animelem = 1, =10
value = ifelse(numhelper(8301)>0,8196,8300)
persistent = 0

[State 8005, Dosha Dosha]
type = PlaySnd
trigger1 = anim = 8196 && animelem = 2
value = 2,5
channel = 0

[State 8005, 5]
type = ChangeAnim
trigger1 = anim = 8012 && animelem = 3, =3
value = 8300

[State 8005, Doda & DajiShoyo]
type = PlaySnd
trigger1 = anim = 8300 && animelem = 16
trigger2 = anim = 8300 && animelem = 11
value = 2,ifelse(animelemtime(15)>0,6,4)
channel = 0

[State 8005, Autograph]
type = Helper
trigger1 = anim = 8300 && animelem = 17
name = "Dan's Autograph"
id = 8301
postype = p1
pos = 65,-75
stateno = 4113
ownpal = 1
keyctrl = 0
persistent = 0

[State 8005, 6]
type = velset
trigger1 = anim = 8300 || anim = 8196
x = 0

[State 8005, 7]
type = ChangeAnim
trigger1 = anim = 8300 && animtime = 0
value = 8010
persistent = 0

[State 8005, 8]
type = ChangeAnim
trigger1 = anim = 8010 && animelem = 3, =4
trigger2 = anim = 8196 && animtime = 0
value = 8105
persistent = 0

[State 8005, 9]
type = veladd
trigger1 = anim = 8105
x = -0.1

[State 8005, 9]
type = destroyself
trigger1 = time = 300

; ============================ Dan's Rolling In ======================================
[Statedef 8010]
type = S
movetype = I
physics = N
anim = 8100
velset = 6,0
sprpriority = 1

[State 8010, ScreenBound]
type = ScreenBound
triggerall = prevstateno != 8001
trigger1 = time = [0,7]
value = 1
movecamera = 0,0

[State 8010, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 8010, HitO]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 2
stateno = 8900

[State 8010, 1]
type = ChangeAnim
trigger1 = p2dist x < 100
value = 8011
persistent = 0

[State 8010, Slide Sound]
type = PlaySnd
trigger1 = anim = 8011
value = 0,11
persistent = 0

[State 8010, 2]
type = velmul
trigger1 = anim = 8100 && p2dist x < 120
trigger2 = anim = 8011
x = ifelse(anim=8100,0.95,0.85)

[State 8010, 3]
type = makedust
trigger1 = anim = 8011
pos = -10, -2
spacing = 3

[State 8010, 8]
type = ChangeState
trigger1 = anim = 8011 && animelem = 1, =10
value = 8001

;================= Dan's Strong Win Pose ===================================================
[Statedef 8181]
type = S
movetype = I
physics = S
anim = 8960
velset = 0,0

[State 8181, 1]
type = posset
trigger1 = time = 0
y = 0

[State 8181, Rachu]
type = PLaySnd
trigger1 = animelem = 3
value = 2,10

; Dan's Standing Fierce ====================================================================
[Statedef 8220]
type = S
movetype = A
physiscs = S
velset = 0,0
anim = 8230
sprpriority = 2
juggle = 4

[State 8220, 1]
type = PlayerPush
trigger1 = 1
value = 1 

[State 8220, Whiff]
type = PlaySnd
trigger1 = animelem = 3
value = 0,4

[State 8200, Dankuu2]
type = PlaySnd
trigger1 = animelem = 3
value = 2,8
channel = 0

[State 8220, 5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 30
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-65
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,5
guardsound = S0,100
ground.type = Low
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -6
air.velocity = -4,-5

[State 8220, 9]
type = changestate
trigger1 = animtime = 0
value = 8001

; Dan's Standing RoundHouse =================================================
[Statedef 8260]
type = S
movetype = A
physiscs = S
velset = 0,0
anim = 8260
sprpriority = 2
juggle = 4

[State 8260, 1]
type = PlayerPush
trigger1 = 1
value = 1 

[State 8260, 2]
type = PosAdd
trigger1 = animelem = 3,=1 || animelem = 4
x = 8

[State 8260, Whiff]
type = PlaySnd
trigger1 = animelem = 4
value = 0,4

[State 8260, Hiyah]
type = PlaySnd
trigger1 = animelem = 5
value = 2,9
channel = 0

[State 8260, 5]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
animtype  = Hard
damage    = 34
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 12,12
sparkxy = 0,-80
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,6
guardsound = S0,100
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -8
air.velocity = -4,-5.5

[State 8260, 9]
type = changestate
trigger1 = animtime = 0
value = 8001

;Dan's Crouching Fierce =======================================================
[Statedef 8420]
type    = C
movetype= A
physics = C
juggle  = 3
anim = 8420
sprpriority = 2

[State 8420, 0]
type = PlayerPush
trigger1 = 1
value = 1

[State 8420, Whiff]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 4

[State 8420, 1]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage    = 35
animtype = Heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 12,12
sparkno = 2
guard.sparkno = S9100
sparkxy = 0,-60
hitsound = S6,5
guardsound = S0,100
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -6
air.type = Low
air.velocity = -3,-6

[State 8420, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 8001

;Dan's Crouching RoundHouse ================================================
[Statedef 8460]
type    = C
movetype= A
physics = C
juggle  = 4
anim = 8460
sprpriority = 2

[State 8460, Whiff]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 4

[State 8460, 0]
type = PlayerPush
trigger1 = 1
value = 1

[State 8460, 3]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage    = 40
hitflag = MF
guardflag = L
priority = 3, Hit
pausetime = 12,12
sparkxy = 0,-10
sparkno = 2
guard.sparkno = S9100
hitsound   = S6,6
guardsound = S0,100
ground.type = Trip
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -2,-4
guard.velocity = -5
fall = 1

[State 8460, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 8001

;Dan's Kuuchuu Kyaku ========================================================
[Statedef 8600]
type = S
movetype = A
physics = S
anim = 8600
velset = 0,0
sprpriority = 2
juggle = 3

[State 8600, 0]
type = PlayerPush
trigger1 = 1
value = 1

[State 8600, 1]
type = posset
trigger1 = time = 0
y = 0

[State 8600, 2]
type = changestate
trigger1 = animtime = 0
value = 8601

[Statedef 8601]
type = A
movetype = A
physics = N
anim = 8601
velset = 4.2,-4
sprpriority = 2

[State 8601, 1]
type = veladd
trigger1 = time >= 0
y = 0.17

[State 8601, 2]
type = PlayerPush
trigger1 = 1
value = 1

[State 8601, Whiff]
type = PlaySnd
trigger1 = AnimElem = 2 || AnimElem = 5 || AnimElem = 9
value = 0, 4

[State 8601, Dankuu1]
type = PlaySnd
trigger1 = animelem = 3 || animelem = 6
value = 2, 7
channel = 0

[State 8601, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
damage   = 30 
guardflag = MA
animtype = Hard
pausetime = 12,12
sparkxy =  0,-60
hitsound   = S6,6
guardsound = S0,100
ground.type = Low
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -6
air.velocity = -3,-3.8
air.fall = 1

[State 8601, 5]
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
damage   = 30 
animtype = Hard
guardflag = MA
pausetime = 12,12
sparkxy =  -10,-45
hitsound   = S6,6
guardsound = S0,100
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -6
air.velocity = -3,-3.8
air.fall = 1

[State 8601, Dankuu2]
type = PlaySnd
trigger1 = animelem = 9
value = 2, 8
channel = 0

[State 8601, 6]
type = HitDef
trigger1 = AnimElem = 9
attr = A, SA
damage   = 35 
guardflag = MA
pausetime = 12,12
sparkxy =  -10,-50
hitsound   = S6,6
guardsound = S0,100
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -4, -5.5
air.velocity = -3, -4
fall = 1

[State 8601, 9]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 8602

[Statedef 8602]
type = S
movetype = I
physics = S
velset = 0,0
sprpriority = 1
anim = 8602

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

[State 8602, 2]
type = PlayerPush
trigger1 = 1
value = 1

[State 8602, 9]
type = ChangeState
trigger1 = animtime = 0
value = 8001

;Dan's Get Hit State ========================================================
[Statedef 8900]
type = A
movetype = H
physics = N
anim = 8900

[State 8900, 0]
type = ChangeAnim
trigger1 = hitshakeover = 1
value = 8901
persistent = 0

[State 8900, DanPainSnd]
type = PlaySnd
trigger1 = hitshakeover = 1 && time > 15
value = 2,1
channel = 0
persistent = 0

[State 8900,0]
type = posfreeze
trigger1 = hitshakeover = 0

[State 8900,1]
type = velset
trigger1 = hitshakeover = 1
x = hitvel x
y = ifelse(hitvel y > -2, -6, 1.2*hitvel y)
persistent = 0

[State 8900,4]
type = gravity
trigger1 = anim = 8901

[State 8900,9]
type = Changestate
trigger1 = pos y >= 0 && vel y > 0
value = 8901

; Hit Ground and Bounce
[Statedef 8901]
type = L
movetype = H
physics = N
anim = 8902
velset = 0,0

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

[State 8901, 1]
type = PlaySnd
trigger1 = time = 0
value = 0,6
volume = -50

[State 8901, 2]
type = posfreeze
trigger1 = 1

[State 8901, 3]
type = ChangeState
trigger1 = animtime = 0
value = 8902

; Dan Bouncing in air
[Statedef 8902]
type = A
movetype = H
physics = N
anim = 8903

[State 8902, 0]
type = velset
trigger1 = time = 0
x = ifelse(hitvel x < 0, -2, 2)
y = -2

[State 8902, 1]
type = VelAdd
trigger1 = time > 0
y = 0.27

[State 8902, 2]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = 8903

; Dan Hit Ground & Get Up
[Statedef 8903]
type = L
movetype = H
physics = S
anim = 8904
velset = 0,0

[State 8903, 0]
type = PlaySnd
trigger1 = time = 0
value = 0,6
volume = -50

[State 8903, 1]
type = posset
trigger1 = time = 0
y = 0

[State 8903, 8]
type = ChangeState
trigger1 = anim = 8904 && animtime = 0
trigger1 = parent, var(10)=1
value = 8001

[State 8903, 9]
type = ChangeState
trigger1 = anim = 8904 && animtime = 0
value = 8920

;======================= Dan Getting Ready To Run Away ===================================
[Statedef 8920]
type = S
movetype = I
physics = N
sprpriority = 0
velset = 0,0
ctrl = 0
anim = 8950

[State 8920, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 8920, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 8920, NotHitBy]
type = NothitBy
trigger1 = 1
value = SCA
time = 1

[State 8920, GomenNe]
type = PlaySnd
trigger1 = animelem = 2
value = 2,2
channel = 0

[State 8920, 9]
type = ChangeState
trigger1 = animtime = 0
value = 8950

;======================= Dan's Rolling Away =======================================================
[Statedef 8950]
type = C
movetype = I
physics = N
sprpriority = 0
velset = 0,0

[State 8950, ChangeAnim to Crouch]
type = ChangeAnim
trigger1 = anim != 8010 && time = 0
value = 8010
persistent = 0

[State 8950, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 8950, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

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

[State 8950, 7]
type = ChangeAnim
trigger1 = anim = 8010 && animelem = 3, =4
trigger2 = anim = 8196 && animtime = 0
value = 8105
persistent = 0

[State 8950, 9]
type = veladd
trigger1 = anim = 8105
x = -0.1

[State 8950, 9]
type = destroyself
trigger1 = time = 120

;=========================== E O F ================================================================