;Dan's constants.
; Format (case insensitive):
;  [groupname]        
;  constname = value  

[Data]
life = 1000          ;Amount of life to start with
attack = 110         ;100% attack power (more is stronger)
defence = 100        ;100% defensive power (more is stronger)
power = 4000
fall.defence_up = 50 ;Def goes up by 50% everytime player is hit on ground
liedown.time = 60    ;Time player takes before getting up from HIT_LIEDOWN
airjuggle = 15       ;Can do 15 points of juggling
sparkno = 2          ;Default spark number
guard.sparkno = 40   ;Default guard spark number
KO.echo = 1          ;1 to enable echo on KO
IntPersistIndex = 58
FloatPersistIndex = 0; all float vars persist

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1;1.125           ;Vertical scaling factor.
ground.back = 20     ;Player width (back, ground)
ground.front = 15    ;Player width (front, ground)
air.back = 15        ;Player width (back, air)
air.front = 10       ;Player width (front, air)
z.width = 3          ;Player width (into and out)
attack.width = 4,4   ;Default attack width: back, front
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 1
shadowoffset = -3
head.pos = 5, -87
mid.pos = -3, -57

[Velocity]
walk.fwd  = 2.1      ;Walk forward
walk.back = -2.0     ;Walk backward
;walk.up   = -1       ;Walk up (into)
;walk.down = 1        ;Walk down (outwards)
run.fwd  = 4.1, 0    ;Run forward (x, y)  - if y<0, player will hop
run.back = -3.5,-4.0 ;Run backward (x, y) - if y=0, player will run
;run.up = -2,0        ;Dash up/into (x, y)
;run.down = 2,0       ;Dash down/outwards (x, y)
jump.neu = 0,-7.0    ;Neutral jumping velocity (x, y)
jump.back = -2.8     ;Jump back Speed (x, y)
jump.fwd = 2.9       ;Jump forward Speed (x, y)
;jump.up = -1         ;Jump up Speed (z, y)
;jump.down = 1        ;Jump Back Speed (z, y)
;runjump.back = -2.55 ;Running jump speeds (opt)
runjump.fwd = 3.6    ;.
;runjump.up = -1.2    ;.
;runjump.down = 1.2   ;.
airjump.neu = 0      ;.
airjump.back = -2.55 ;Air jump speeds (opt)
airjump.fwd = 2.5    ;.
;airjump.up = -1      ;.
;airjump.down = 1     ;.

[Movement]
airjump.num = 0;     ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .35         ;Vertical acceleration
stand.friction = .8  ;Friction coefficient when standing
crouch.friction = .8 ;Friction coefficient when crouching



;VICTORY SCREEN
[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory0 = "Can you withstand the power of my Super Taunt?"
victory1 = "Hah, you're weak! Just like me!"
victory2 = "I'm not as tough as you, just better than you!"
victory3 = "I'm sorry. No, you are!"
victory4 = "It's more fun to mock you than defeat you!"
victory5 = "Me copy you? Well, I think of new moves too."
victory6 = "The only master I need is myself!"
victory7 = "You can fight, but you can't show off like me!"
victory8 = "You've never heard of me? Give me a break! I'm Dan Hibiki!"
victory9 = "My dad was a martial arts expert and now I am too!"
victory10 = "Study Saikyo style and I'll also teach you how to play puzzles!"

; Overridden states from common1.cns
;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4]
type = ChangeState
triggerall = numhelper(3477)
triggerall = helper(3477),movetype != H
triggerall = helper(3477),Vel Y >= -1
triggerall = helper(3477),movetype!=H  ; not in hit state
trigger1 = animelemno(0) < 4
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-4,8]
trigger1 = (helper(3477),RootDist Y = [90,98])
trigger1 = animelemno(0) >= 4
trigger2 = facing*(helper(3477),Pos X-Pos X) = [-4,8]
trigger2 = (helper(3477),RootDist Y = [95,103])
value = 3491

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

[State 11, 2] ; added
type = ChangeState
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-1,10]
trigger1 = helper(3477),RootDist Y = [59,69]
value = 3491

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State 12, 0]
type = Varset
trigger1 = !time
var(3) = 0

[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = var(3)
ctrl = !var(3)

[State 12, 2] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
triggerall = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger1 = AnimElem = 2, < 0
trigger1 = helper(3477),RootDist Y = [67,77];[69,75]
trigger2 = AnimElem = 2, >= 0
trigger2 = helper(3477),RootDist Y = [84,94];[86,92]
var(3) = 3491

[State 12, 3]
type = VarSet
trigger1 = var(3)
var(15) = 1

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, 5] ; added
type = ChangeState
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = animelemno(0) = 1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-3,8]
trigger1 = helper(3477),RootDist Y = [85,93];[86,92]
trigger2 = animelemno(0) > 1
trigger2 = facing*(helper(3477),Pos X-Pos X) = [-3,11]
trigger2 = helper(3477),RootDist Y = [89,97]
value = 3491
anim = 0

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
movetype = I
physics = S
anim = 40
ctrl = 0

[State 40, Fly]
type = ChangeState
trigger1 = Time = 0
trigger1 = Pos Y < 0
value = 2000

[State 40, SysVarSet(1)0]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, SysVarSet(1)1]
type = VarSet
trigger1 = PalNo = [1, 12]
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, SysVarSet(1)-1]
type = VarSet
trigger1 = PalNo = [1, 12]
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, VelSetXY]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, VelSetX]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, Next]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; JUMP_LAND
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 52, 0]
type = Varset
trigger1 = !time
var(3) = 0

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PlaySnd
trigger1 = time = 0
value = 0,52

[State 52, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = var(3)
ctrl = !var(3);1
anim = 0

[State 52, 2] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
triggerall = facing*(helper(3477),Pos X-Pos X) = [-9,2]
trigger1 = helper(3477),RootDist Y = [68,76];[69,75]
var(3) = 3491

[State 52, 3]
type = VarSet
trigger1 = var(3)
var(15) = 1

[State 52, 3]
type = CtrlSet
trigger1 = (Time = 3) && !var(3)
value = 1

;--------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = N
anim = 100
ctrl = 0

[State 100, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 100, 1]
type = VelSet
trigger1 = AnimElem = 3, >= 0
trigger1 = AnimElem = 4, < 0
x = 6

[State 100, 2]
type = VelMul
trigger1 = AnimElem = 3, >= 4
x = .9

[State 100, 4]
type = CtrlSet
trigger1 = AnimTime = -4 && !var(3)
value = 1

[State 100, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = var(3)
ctrl = (var(3)=0)
anim = 0

[State 100, 6]
type = MakeDust
trigger1 = Time = 1
pos = -25,-2
spacing = 1

[State 100, 6]
type = MakeDust
trigger1 = AnimElem = 3, >= 0
pos = -15,-2

[State 100, 7]
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = animelemno(0) <= 2 || animelemno(0) = 5
trigger1 = facing*(helper(3477),Pos X-Pos X) = [3,17];[5,15]
trigger1 = helper(3477),RootDist Y = [88,98];[90,96]
trigger2 = animelemno(0) = 3
trigger2 = facing*(helper(3477),Pos X-Pos X) = [17,34];[19,31]
trigger2 = helper(3477),RootDist Y = [80,89];[82,87]
trigger3 = animelemno(0) = 4
trigger3 = facing*(helper(3477),Pos X-Pos X) = [14,27];[16,25]
trigger3 = helper(3477),RootDist Y = [80,89];[83,87]
trigger4 = animelemno(0) = 6
trigger4 = facing*(helper(3477),Pos X-Pos X) = [-1,6]
trigger4 = helper(3477),RootDist Y = [89,97];[90,96]
trigger5 = animelemno(0) = 7
trigger5 = facing*(helper(3477),Pos X-Pos X) = [-2,8]
trigger5 = helper(3477),RootDist Y = [85,93];[86,92]
var(3) = 3491

[State 100, 8]
type = VarSet
trigger1 = var(3)
var(15)=1

; Initialize (at the start of the round)
; Damn it! Persistent vars don't persist!!
[Statedef 5900]
type = S

[State 5900, 0]
type = VarSet
trigger1 = !time
var(16) = !var(59) && var(58)

[State 5900, 0]
type = VarSet
trigger1 = !time
var(4)=-8

[State 5900, 0]
type = VarAdd
trigger1 = roundno = 1
var(58) = 1

[State 5900, 0]
type = VarSet
trigger1 = roundno = 1
var(59) = 0

[State 5900, 1] ;Intro
type = ChangeState
trigger1 = roundno = 1
value = 190

;----------------------------------------------------------------------
;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
value = 130

[State 130, Hi to Lo]
type = ChangeState
Trigger1 = var(30)<1
Trigger1 = command = "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType!=A
;Trigger2 = Random<=280;||var(24)>6
value = 131

[State 130, Stop Guarding]
type = ChangeState
Trigger1 = var(30)<1
Trigger1 = command != "holdback"
Trigger2 = !inguarddist
value = 140

[State 130, Stop Guarding(AI)]
Type = ChangeState
TriggerAll = var(30)>0
TriggerAll = P2MoveType != A
Trigger1 = P2Dist X<0
Trigger2 = P2Dist X>=0
Trigger2 = !InGuardDist
Value = 140
IgnoreHitPause = 1

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != 131
value = 131

[State 131, Lo to Hi]
type = ChangeState
Trigger1 = var(30)<1
Trigger1 = command != "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType=A
;Trigger2 = Random<=210;||var(24)>6
value = 130

[State 131, Stop Guarding]
type = ChangeState
Trigger1 = var(30)<1
Trigger1 = command != "holdback"
Trigger2 = !inguarddist
value = 140

[State 131, Stop Guarding(AI)]
Type = ChangeState
TriggerAll = var(30)>0
TriggerAll = P2MoveType != A
Trigger1 = P2Dist X<0
Trigger2 = P2Dist X>=0
Trigger2 = !InGuardDist
Value = 140
IgnoreHitPause = 1

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != 132
value = 132

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"||var(30)
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
Trigger1 = var(24)<1
Trigger1 = command != "holdback"
Trigger2 = !inguarddist
value = 140

[State 132, Stop Guarding(AI)]
Type = ChangeState
TriggerAll = var(30)>0
TriggerAll = P2MoveType != A
Trigger1 = P2Dist X<0
Trigger2 = P2Dist X>=0
Trigger2 = !InGuardDist
Value = 140
IgnoreHitPause = 1


;------------------------
; Saikyou-ryuu Bougyo
[Statedef 135]
type = A
physics = A
movetype = I
ctrl = 0
anim = 135
poweradd = 25

[State 135, 0]
type = PlaySnd
trigger1 = AnimElem = 2, -1
value = 196, 13   ; Saikyou-ryuu!
channel = 0

[State 135, 1]
type = Explod
trigger1 = AnimElem = 2, >= 0
;trigger1 = movecontact = 1
persistent = 0
anim = 7135
pos = 35,-92
postype = p1
bindtime = 1
sprpriority = 5

[State 135, 2]
type = VelSet
trigger1 = AnimElem = 2
;trigger1 = movecontact = 1
persistent = 0
x = -4.6;-3.6
y = -6;-5


;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
TriggerAll=Statetype = S
Trigger1 = var(24)<1
Trigger1 = command = "holddown"
Trigger2 = var(24)>0
Trigger2 = EnemyNear,StateType!=A
;Trigger2 = Random<=280;||var(24)>6
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
TriggerAll=Statetype = C
Trigger1 = var(24)<1
Trigger1 = command != "holddown"
Trigger2 = var(24)>0
Trigger2 = EnemyNear,StateType=A
;Trigger2 = Random<=210;||var(24)>6
statetype = S
physics = S

;[State 140, 5] ;Implemented within engine
;type = ChangeState
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
TriggerAll=Statetype = S
Trigger1 = var(30)<1
Trigger1 = command = "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType!=A
;Trigger2 = Random<=280;||var(24)>6
statetype = C
physics = C

[State 150, Lo to Hi]
type = StateTypeSet
TriggerAll=Statetype = C
Trigger1 = var(30)<1
Trigger1 = command != "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType=A
;Trigger2 = Random<=210;||var(24)>6
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

[State 151, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 151, Hi to Lo]
type = StateTypeSet
TriggerAll=Statetype = S
Trigger1 = var(30)<1
Trigger1 = command = "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType!=A
;Trigger2 = Random<=280;||var(24)>6
statetype = C
physics = C

[State 151, Lo to Hi]
type = StateTypeSet
TriggerAll=Statetype = C
Trigger1 = var(30)<1
Trigger1 = command != "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType=A
;Trigger2 = Random<=210;||var(24)>6
statetype = S
physics = S

[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 152, Hi to Lo]
type = StateTypeSet
TriggerAll=Statetype = S
Trigger1 = var(30)<1
Trigger1 = command = "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType!=A
;Trigger2 = Random<=280;||var(24)>6
statetype = C
physics = C

[State 152, Lo to Hi]
type = StateTypeSet
TriggerAll=Statetype = C
Trigger1 = var(30)<1
Trigger1 = command != "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType=A
;Trigger2 = Random<=210;||var(24)>6
statetype = S
physics = S

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151

[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 153, Hi to Lo]
type = StateTypeSet
TriggerAll=Statetype = S
Trigger1 = var(30)<1
Trigger1 = command = "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType!=A
;Trigger2 = Random<=280;||var(24)>6
statetype = C
physics = C

[State 153, Lo to Hi]
type = StateTypeSet
TriggerAll=Statetype = C
Trigger1 = var(30)<1
Trigger1 = command != "holddown"
Trigger2 = var(30)>0
Trigger2 = EnemyNear,StateType=A
;Trigger2 = Random<=210;||var(24)>6
statetype = S
physics = S

[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"||var(30)
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 170, 2]
type = PlaySnd
trigger1 = AnimElem = 4
trigger1 = (var(1):=random)<500
persistent = 0
value = 170, 0   ; gusun
channel = 0

[State 170, 3]
type = PlaySnd
trigger1 = AnimElem = 4
trigger1 = var(1) >= 500
persistent = 0
value = 7710, 3    ; maketa ssu.
channel = 0

;---------------------------------------------------------------------------
; WIN
[Statedef 180]
type = S
; anim = 180



[State 180, 1a]
type = ChangeState
trigger1 = time = 1
trigger1 = var(6) = 1
value = 3480

[State 180, 1b]
type = ChangeState
trigger1 = time = 1
trigger1 = var(6) = 6
value = 7600

[State 180, 2]
type = VarSet
trigger1 = time = 1
trigger1 = var(6) != 1
v = 7
value = 2

[State 180, 0]
type = VarSet
trigger1 = time = 0
trigger1 = var(12) = 1
v = 6
value = 3

[State 180, 0]
type = VarSet
trigger1 = time = 0
trigger1 = var(12) = 2
v = 6
value = 4

[State 180, 0]
type = VarSet
trigger1 = time = 0
trigger1 = var(12) = 3
v = 6
value = 5

[State 180, 0]
type = VarSet
trigger1 = time = 0
trigger1 = matchover = 0
trigger1 = var(6) = [3,5]
v = 6
value = 0

[State 180, 0]
type = ChangeState
trigger1 = time = 1
trigger1 = var(6) = [3,5]
value = 7700

[State 180, 1random]
type = VarRandom
trigger1 = Time = 0
v = 1
range = 0,100

[State 180, 2] ;Choose win1
type = VarSet
trigger1 = command = "hold_x"
trigger2 = command = "hold_a"
v = 1
value = 0

[State 180, 3] ;Choose win2
type = VarSet
trigger1 = command = "hold_y"
trigger2 = command = "hold_b"
v = 1
value = 30

[State 180, 4] ;Choose win3
type = VarSet
trigger1 = command = "hold_z"
v = 1
value = 50

[State 180, 6] ;Choose win4
type = VarSet
trigger1 = command = "hold_s"
trigger2 = var(6) = 2
v = 1
value = 70

[State 180, 5] ; Choose win5
type = VarSet
trigger1 = command = "hold_c"
v = 1
value = 90

[State 180, 2]
type = ChangeState
trigger1 = time = 1
trigger1 = var(1) < 30
value = 181

[State 180, 3]
type = ChangeState
trigger1 = time = 1
trigger1 = var(1) = [30,40]
value = 182

[State 180, 4]
type = ChangeState
trigger1 = time = 1
trigger1 = var(1) = [41,51]
value = 183

[State 180, 6]
type = ChangeState
triggerall = time = 1
trigger1 = var(1) = [52,62]
value = 184

[State 180, 5]
type = ChangeState
triggerall = time = 1
trigger1 = var(1) = [63,73]
value = 185

[State 180, 5]
type = ChangeState
triggerall = time = 1
trigger1 = var(1) >= 74
value = 186
;---------------------------------------------------------------------------
; WIN1
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 181, 2]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,100

[State 181, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) <= 33
value = 195,10 ; Yoyuu ssu!
channel = 0

[State 181, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) = [34,66]
value = 197,9   ; yatta gomen ne saikyou ssu!
channel = 0

[State 181, 3]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) >= 67
value = 197,10  ; yatta gomen ne yoyuu ssu!
channel = 0

;---------------------------------------------------------------------------
; WIN2
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 182, 0]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,999

[State 182, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 182, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) < 500
value = 195,2 ; Rakushou!
channel = 0

[State 182, 3]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) >= 500
value = 180,1 ; Itsu de mo yatte ru ze!
channel = 0

;---------------------------------------------------------------------------
; WIN3
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 183, 0]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,999

[State 183, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 183, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) < 500
value = 200,1  ; hiyah!
channel = 0

[State 183, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(1) >= 500
value = 198,4   ; Yossha!!!
channel = 0

;-------------------
; WIN4
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0

[State 184, 0]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,999

[State 184, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 184, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(6) = 0
trigger1 = var(1) < 500
value = 195,9 ; Yattt...
channel = 0

[State 184, 3]
type = PlaySnd
trigger1 = time = 70
trigger1 = var(6) = 0
trigger1 = var(1) < 500
value = 195,11 ; ...ta ze!
channel = 0

[State 184, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(6) = 0
trigger1 = var(1) >= 500
value = 180, 0   ; Ore, yatta yo, ore!
channel = 0

[State 184, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = var(6) = 2
value = 195,7 ; Yatta de!
channel = 0

[State 184, 3]
type = PlaySnd
trigger1 = time = 70
trigger1 = var(6) = 2
value = 195,8 ; Oyaji!!!
channel = 0

[State 184, 3]
type = AssertSpecial
trigger1 = time = [0, 210]
flag = roundnotover

;----------------------
; WIN5
[Statedef 185]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 185, 1]
type = Helper
trigger1 = time = 0
helpertype = player
keyctrl = 0
ownpal = 0
pos = 0,0
postype = p1
stateno = 7698
name = "cameraman"

[State 185, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 185, 0]
type = ScreenBound
trigger1 = time >= 0
value = 0
movecamera = 0

[State 185, 1]
type = PlaySnd
trigger1 = AnimElem = 3
persistent = 0
value = 197,12    ; Kore zo! Saikyou-ryuu...
channel = 0

[State 185, 2]
type = ChangeAnim
trigger1 = time = 55
value = 7602      ; Slow turn

[State 185, 2.5]
type = Turn
trigger1 = time = 55

[State 185, 3]
type = ChangeAnim
trigger1 = anim = 7602
trigger1 = animtime = 0
value = 7605      ; indefinite forward roll

[State 185, 4]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 185, 5]
type = VelSet
trigger1 = anim = 7605
x = 2.5

[State 185, 6]
type = AssertSpecial
trigger1 = time >= 0
trigger1 = Pos X >= -200
trigger1 = Pos X <= 200
trigger2 = time <= 200
flag = roundnotover

;-------------------
; WIN6
[Statedef 186]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 186, 0]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,999

[State 186, 1]
type = helper; Projectile
trigger1 = time = 25
persistent = 0
id = 777
stateno = 187
pos = 100, 0  
postype = p1
bindtime = 1
keyctrl = 0
ownpal = 1
size.xscale = 1
helpertype = normal

[State 186, 2]
type = ChangeAnim
trigger1 = time = 26
value = 3110  

[State 186, 2]
type = PlaySnd
trigger1 = time = 26
persistent = 0
value = 7710,1
channel = 0

[Statedef 187]
type = S
anim = 30000
velset = 0, 0

[State 187, 0]
type = PlaySnd
trigger1 = time = 0
persistent = 0
value = 30000,0
channel = 0

[State 187, 1]
type = AssertSpecial
trigger1 = time >= 0
trigger1 = time <= 150
flag = roundnotover

;---------------------------------------------------------------------------
; INTRO
[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 191, 0]
type = ChangeState
trigger1 = var(16)
value = 196

[State 191, 0]
type = VarRandom
trigger1 = Time = 0
trigger1 = p2name != "TNGNM Dan"
trigger1 = p3name != "TNGNM Dan"
trigger1 = p4name != "TNGNM Dan"
v = 1
range = 0,100

[State 191, 0]
type = VarRandom
triggerall = !time
trigger1 = p2name = "TNGNM Dan"
trigger2 = p3name = "TNGNM Dan"
trigger3 = p4name = "TNGNM Dan"
v = 1
range = 0,90

[State 191, 9]
type = ChangeState
trigger1 = var(1) = [50,80]
value = 193

[State 191, 9]
type = ChangeState
trigger1 = Var(1) = [81,90]
value = 192

[State 191, 9]
type = ChangeState
trigger1 = Var(1) > 90
value = 194

[State 191, 1] ;Intro not yet over
type = AssertSpecial
trigger1 = Time = [0,90]
flag = intro

[State 191, 4]
type = ScreenBound
trigger1 = Time = [0,40]
value = 0
movecamera = 0,0

[State 191, 5]
type = VelSet
trigger1 = Time = 0
x = 3.5

[State 191, 2]
type = PosAdd
trigger1 = Time = 0
x = -126

[State 191, 3]
type = VelSet
trigger1 = time = 36
x = 0

[State 191, 6]
type = ChangeAnim
trigger1 = Time = 100
value = 0

[State 191, 8]
type = PlaySnd
value = 195,4 ; yossha!
trigger1 = Time = 42 
channel = 0

;intro2
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0

[State 192, 0]
type = ScreenBound
trigger1 = time >= 0
value = 0
movecamera = 0,0

[State 192, 0]
type = PosAdd
trigger1 = Time = 0
x = -210

[State 192, 2]
type = Turn
trigger1 = time = 80
trigger2 = time = 159

[State 192, 1]
type = VelSet
trigger1 = time = 1
trigger2 = time = 80
x = 8

[State 192, 2]
type = VelSet
trigger1 = time = 159
x = 5.25

[State 192, 2]
type = VelSet
trigger1 = time = 199
x = 0

[State 192, 2]
type = ChangeAnim
trigger1 = time = 199
value = 194

[State 192, 3]
type = PlaySnd
trigger1 = anim = 194
trigger1 = AnimElem = 3
channel = 0
persistent = 0
value = 5300, 0    ; euhhh
channel = 0

[State 192, 4]
type = PlaySnd
trigger1 = time = 20
trigger2 = time = 100
channel = 0
value = 197, 3     ; shawayahoo!
channel = 0

[State 192,5]
type = SndPan
trigger1 = 1
channel = 0
pan = 0

[State 192, 7]
type = AssertSpecial
trigger1 = Time < 210
flag = intro

[Statedef 193]
type = S
movetype = I
physics = N
anim = 193

[State 193, 0]
type = ScreenBound
trigger1 = Time = [0,40]
value = 0
movecamera = 0,0

[State 193, 2]
type = PosAdd
trigger1 = Time = 0
x = -126

[State 193, 1]
type = VelSet
trigger1 = Time = 0
x = 3.5

[State 193, 3]
type = VelSet
trigger1 = time = 36
x = 0
y = 0

[State 193, 3]
type = PosSet
trigger1 = time = 36
y = 0

[State 193, 4]
type = VelSet
trigger1 = time = 26
y = -2.8

[State 193, 5]
type = VelAdd
trigger1 = time = [27,35]
y = .7

[State 193, 6]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 0

[State 193, 7]
type = AssertSpecial
trigger1 = time = [0,100]
flag = intro

[State 193, 8]
type = PlaySnd
trigger1 = time = 33
value = 193, 0    ; tadaima sanjou!
channel = 0

[Statedef 194]
type = S
movetype = I
physics = N
velset = 0,0
anim = 191

[State 194, 3]
type = ChangeAnim
trigger1 = time = 120
value = 0

[State 194, 4]
type = AssertSpecial
trigger1 = time = [0,140]
flag = intro

[State 194, 4]
type = ScreenBound
trigger1 = Time = [0,40]
value = 0
movecamera = 0,0

[State 194, 5]
type = VelSet
trigger1 = Time = 0
x = 3.5

[State 194, 2]
type = PosAdd
trigger1 = Time = 0
x = -126

[State 194, 0]
type = helper;Explod
trigger1 = time = 0
pos = 196, 0
postype = p1
facing = -1
;removetime = 110
size.xscale = 1
bindtime = 1
keyctrl = 0
ownpal = 1
stateno = 3249
helpertype = normal

[State 194, 3]
type = VelSet
trigger1 = time = 36
x = 0

[State 194, 4]
type = ChangeAnim
trigger1 = anim = 191
trigger1 = AnimElem = 15
value = 184

;-----------------
; standing taunt
[Statedef 195]
type = S
movetype = A
physics = S
ctrl = 0
velset = 0,0
anim = 195
juggle = 1
poweradd = 100

[State 195, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

; Var 3 holds next state to change to. 
[State 195, 1]
type = VarSet
trigger1 = !time
var(3) = 0

[State 195, 2]
type = ChangeState
trigger1 = Time = 40
value = var(3)
ctrl = (var(3)=0)

[State 195, 3]
type = PlaySnd
trigger1 = AnimElem = 3
persistent = 0
value = 195, 0   ; Doshita doshita!
channel = 0

[State 195, 4]
type = ForceFeedback
trigger1 = time = 0
self = 0
waveform = square
time = 90

[State 195, 5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype = Hard
damage = 1
hitflag = AF
guardflag = A
guard.dist = 25
pausetime = 12,12
sparkxy = 0,-89
hitsound = 5,0
guardsound = 6,0
air.hittime = 20
air.velocity = -.5, -5

[State 195, 5]
type = PowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = 250

[State 195, 5]
type = TargetPowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = -75

[State 195, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 195, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = animelemno(0)=1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [1,11]
trigger1 = helper(3477),RootDist Y = [89,97];[90,96]
trigger2 = animelemno(0)=2
trigger2 = facing*(helper(3477),Pos X-Pos X) = [8,18]
trigger2 = helper(3477),RootDist Y = [88,96];[89,95]
trigger3 = animelemno(0)>=3
trigger3 = facing*(helper(3477),Pos X-Pos X) = [15,26]
trigger3 = helper(3477),RootDist Y = [88,96];[89,95]
var(3) = 3491

[State 195, 1]
type = VarSet
trigger1 = var(3)
var(15)=1

[Statedef 196]
type = A
movetype = I
physics = N
anim = 196

[State 196, 4]
type = AssertSpecial
trigger1 = 1
flag = intro

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

[State 196, 0]
type = VarSet
trigger1 = !time
fvar(0) = Pos X

[State 196, 5]
type = VelSet
trigger1 = time = 210
x = (200-abs(fvar(0)))/45.25
y = -6.5

[State 196, 0]
type = PosAdd
trigger1 = !time
x = -(200-abs(fvar(0)))
y = -83

[State 196, 1]
type = Gravity
trigger1 = time >= 210

[State 196, 2]
type = ChangeState
trigger1 = Pos Y >= 0
value = 197

; hit the ground
[Statedef 197] 
type = S
movetype = I
physics = N
velset = 0,0
anim = 197

[State 197, 1]
type = LifeAdd
trigger1 = !time
value = -50

[State 197, 1]
type = PlaySnd
trigger1 = !time
value = 0,3400

[State 197, 0]
type = EnvShake
trigger1 = !time
time = 20
ampl = -7

[State 197, 0]
type = AssertSpecial
trigger1 = 1
flag = intro

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

[State 197, 0]
type = Helper
trigger1 = !time
stateno = 198
id = 1
pos = 61,-39
keyctrl = 0
ownpal = 0
postype = p1

[State 197, 0]
type = Helper
trigger1 = !time
stateno = 198
id = 2
pos = 50,-44
keyctrl = 0
ownpal = 0
postype = p1

[State 197, 0]
type = Explod
trigger1 = AnimElem = 2
pos = 0,0
anim = 7400
removetime = -2
postype = p1
sprpriority = 6

; stupid rounding errors
[State 197, 1]
type = PosSet
trigger1 = AnimElem = 2, = 1
x = fvar(0)

[State 197, 2]
type = PlaySnd
trigger1 = AnimElem = 2, = 4
value = 5070, 0

[State 197, 3]
type = ChangeState
trigger1 = time = 160
value = 199

; Geta
[Statedef 198]
type = A
movetype = I
physics = N
velset = ifelse(ishelper(1),-1.5,0),ifelse(ishelper(1),-4,-10)
anim = 198

[State 198, 1]
type = VarSet
trigger1 = !time
var(1) = 0

[State 198, 0]
type = VelAdd
trigger1 = !var(1)
y = .2

[State 198, 0]
type = VelSet
trigger1 = Pos Y > -6
x = 0
y = 0

[State 198, 1]
type = VarSet
trigger1 = Pos Y > -6
var(1) = time

[State 198, 1]
type = PosSet
trigger1 = Pos Y > -6
y = -6

[State 198, 1]
type = AssertSpecial
trigger1 = var(1)
trigger1 = (time-var(1)) >= 30
trigger1 = (time%4)<2
flag = invisible

[State 198, 2]
type = DestroySelf
trigger1 = var(1)
trigger1 = (time-var(1)) >= 60

[State 198, 3]
type = SprPriority
trigger1 = !time
value = 4 + ishelper(2)

; Get up
[Statedef 199]
type = S
movetype = I
physics = S
anim = 5120

[State 199, 0]
type = ChangeAnim
trigger1 = anim = 5120
trigger1 = !animtime
value = 0

; roll forward taunt
[Statedef 800]
type = S
movetype = A
physics = N
ctrl = 0
anim = 800
poweradd = 150

[State 800, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 800, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 800, 0]
type = StateTypeSet
trigger1 = AnimElem = 2 
value = C 

; state to change to
[State 800, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 800, 0]
type = VarSet
trigger1 = AnimElem = 14
var(1) = P2Dist X < 0

[State 800, 0]
type = Turn
trigger1 = AnimElem = 14
trigger1 = var(1)

[State 800, 0]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 800, 1]
type = PlayerPush
trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 800, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 800, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 197, 1 ; Koi yo hora!
channel = 0

[State 800, 2]
type = ChangeState
trigger1 = time = 69
value = var(3)
ctrl = (var(3)=0)

[State 800, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype = Hard
damage = 1
hitflag = AF
guardflag = N
pausetime = 12,12
sparkxy = 0,-55
hitsound = 5,0
guardsound = 6,0
guard.dist = 40
air.hittime = 20
air.velocity = n, -6
p1stateno = 810
fall = 1

[State 800, 5]
type = HitDef
trigger1 = AnimElem = 16
ground.type = none

[State 800, 5]
type = HitDef
trigger1 = AnimElem = 16 && var(1)
attr = S, NA
animtype = Hard
ground.type = high
damage = 1
hitflag = M
guardflag = M
guard.dist = 25
pausetime = 12,12
sparkxy = 0,-89
hitsound = 5,0
guardsound = 6,0
ground.velocity = -12,0 
ground.hittime = 20

[State 800, 5]
type = HitDef
trigger1 = AnimElem = 18, =1 && var(1)
ground.type = none 

[State 800, 4]
type = TargetPowerAdd
trigger1 = movehit
persistent = 0
value = -75

[State 800, 4]
type = PowerAdd
trigger1 = movehit
persistent = 0
value = 75

[State 800, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 800, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = AnimElemNo(0) = 14
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger1 = helper(3477),RootDist Y = [67,77];[69,75]
trigger2 = AnimElemNo(0) = 15
trigger2 = facing*(helper(3477),Pos X-Pos X) = [2,-9]
trigger2 = helper(3477),RootDist Y = [85,94];[86,92]
trigger3 = animelemno(0)=16
trigger3 = facing*(helper(3477),Pos X-Pos X) = [1,11]
trigger3 = helper(3477),RootDist Y = [89,97];[90,96]
trigger4 = animelemno(0)=17
trigger4 = facing*(helper(3477),Pos X-Pos X) = [8,18]
trigger4 = helper(3477),RootDist Y = [88,96];[89,95]
trigger5 = animelemno(0)>=18
trigger5 = facing*(helper(3477),Pos X-Pos X) = [15,26]
trigger5 = helper(3477),RootDist Y = [88,96];[89,95]
var(3) = 3491

[State 800, 1]
type = VarSet
trigger1 = var(3)
var(15)=1

; roll backward taunt
[Statedef 801]
type = C
physics = N
movetype = A
ctrl = 0
velset = 0,0
anim = 801
poweradd = 125

[State 801, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 801, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 801, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

; state to change to
[State 801, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 801, 3]
type = PlayerPush
trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 801, 2]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20

[State 801, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 197, 2 ; Rakushou!
channel = 0

[State 801, 2]
type = ChangeState
trigger1 = time = 80
value = var(3) 
ctrl = (var(3)=0)

[State 801, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype = Hard
damage = 1
hitflag = AF
guardflag = N
pausetime = 12,12
sparkxy = 0,-55
hitsound = 5,0
guardsound = 6,0
guard.dist = 40
air.hittime = 20
air.velocity = n, -6
p1stateno = 811
fall = 1

[State 801, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 801, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = AnimElemNo(0) = 14
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger1 = helper(3477),RootDist Y = [67,77];[69,75]
trigger2 = AnimElemNo(0) = 15
trigger2 = facing*(helper(3477),Pos X-Pos X) = [2,-9]
trigger2 = helper(3477),RootDist Y = [85,94];[86,92]
trigger3 = animelemno(0)=16
trigger3 = facing*(helper(3477),Pos X-Pos X) = [1,11]
trigger3 = helper(3477),RootDist Y = [89,97];[90,96]
trigger4 = animelemno(0)=17
trigger4 = facing*(helper(3477),Pos X-Pos X) = [8,18]
trigger4 = helper(3477),RootDist Y = [88,96];[89,95]
trigger5 = animelemno(0)>=18
trigger5 = facing*(helper(3477),Pos X-Pos X) = [15,26]
trigger5 = helper(3477),RootDist Y = [88,96];[89,95]
var(3) = 3491

[State 801, 1]
type = VarSet
trigger1 = var(3)
var(15)=1

; crouching taunt
[Statedef 802]
type = C
physics = C
movetype = A
ctrl = 0
velset = 0.0
juggle = 1
anim = 802
poweradd = 100

[State 802, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 802, 0]
type = VarSet
trigger1 = !time
var(3) = 11

[State 802, 1]
type = HitDef
trigger1 = AnimElem = 1
attr = C, NA
animtype = Hard
damage = 1
hitflag = M
guardflag = M
pausetime = 12,12
sparkxy = 0,-55
hitsound = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 16
ground.hittime = 30 ;20
ground.velocity = -7

[State 802, 2]
type = PowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = 220

[State 802, 2]
type = TargetPowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = -75

[State 802, 3]
type = ChangeState
trigger1 = Time = 60
value = var(3) 
ctrl = var(3)=11

[State 802, 4]
type = PlaySnd
trigger1 = AnimElem = 1
value = 195, 1 ; Namen ja nee zo!
channel = 0

[State 802, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 802, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = animelemno(0)=1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [1,12]
trigger1 = helper(3477),RootDist Y = [60,70];[62,68]
trigger2 = animelemno(0)=2
trigger2 = facing*(helper(3477),Pos X-Pos X) = [4,15]
trigger2 = helper(3477),RootDist Y = [60,70];[62,68]
trigger3 = animelemno(0)>=3
trigger3 = facing*(helper(3477),Pos X-Pos X) = [11,22]
trigger3 = helper(3477),RootDist Y = [62,72];[64,70]
var(3) = 3491

[State 802, 1]
type = VarSet
trigger1 = var(3) = 3491
var(15)=1

; jumping taunt
[Statedef 803]
type = A
movetype = A
physics = N
anim = 803
ctrl = 0
poweradd = 50

[State 803, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 803, 0]
type = Gravity
trigger1 = 1

[State 803, 0]
type = VarSet
trigger1 = !time
var(3) = 52

[State 803, 3]
type = ChangeState
trigger1 = Pos Y >= 0
value = var(3) 
ctrl = 0

[State 803, 1]
type = PlaySnd
trigger1 = AnimElem = 1
persistent = 0
value = 195, 3  ; Hyahuui! 
channel = 0

[State 803, 2]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 803, 3]
type = HitDef
trigger1 = AnimElem = 1
persistent = 0
attr = A, NA
animtype = Hard
damage = 1
getpower = 200
givepower = -10
hitflag = A
guardflag = A
guard.dist = 25
pausetime = 12,12
sparkxy = 0,-55
hitsound = 5,0
guardsound = 6,0
air.hittime = 20
air.velocity = -1, -4.6
air.fall = 1

[State 803, 4]
type = PowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = 225

[State 803, 5]
type = TargetPowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = -75

[State 803, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= Vel Y-2
trigger1 = animelemno(0)=1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [2,16]
trigger1 = helper(3477),RootDist Y = [92,102]
trigger2 = animelemno(0)>=2
trigger2 = facing*(helper(3477),Pos X-Pos X) = [-22,-7]
trigger2 = helper(3477),RootDist Y = [96,106]
var(3) = 804

[State 803, 1]
type = VarSet
trigger1 = var(3) = 804
var(15)=1

; Jump taunt special landing 
[Statedef 804]
type = S
physics = S
anim = 47

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

[State 804, 1]
type = VelSet
trigger1 = !time
y = 0

[State 804, 2]
type = VarSet
trigger1 = 1
var(15) = 1

[State 804, 2]
type = PlaySnd
trigger1 = time = 0
value = 0,52

[State 804, 2]
type = ChangeState
trigger1 = !animtime
value = 3491
anim = 0

; Saikyou Backdash!
[Statedef 805]
type = A
anim = 805
ctrl = 0
poweradd = 75
velset = -3.5, -6

[State 805, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 805, 0]
type = LifeAdd
trigger1 = Pos Y > 0
value = -50

[State 805, 2]
type = ChangeState
trigger1 = Pos Y > 0
value = 5110

[State 805, 1]
type = Gravity
trigger1 = time > 0

[State 805, 3]
type = VelSet
trigger1 = AnimElem = 4
x = -2.5

[State 805, 4]
type = PlaySnd
trigger1 = AnimElem = 2, -1
value = 196, 11  ;   Saikyou-ryuu?
channel = 0

[State 805, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Roll forward taunt -- hit success
[Statedef 810]
type = C
movetype = I
physics = N
poweradd = 300
velset = 3.6, 0  ; prevent slowdown from hit

[State 810, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 810, 0]
type = TargetPowerAdd
trigger1 = time = 0
value = -100

[State 810, 0]
type = PlayerPush
trigger1 = anim = 800
value = 0

[State 810, 1]
type = VelSet
trigger1 = anim = 800
trigger1 = AnimElem = 14, >= 0
x = 0

[State 810, 2]
type = ChangeAnim
trigger1 = anim = 800
trigger1 = AnimElem = 14, >= 0
value = 810

[State 810, 3]
type = StateTypeSet
trigger1 = anim = 810
trigger1 = AnimElem = 1
value = S

[State 810, 3]
type = Turn 
trigger1 = anim = 810
trigger1 = AnimElem = 1
trigger1 = P2Dist X <= 0;-3

[State 810, 4]
type = PlaySnd
trigger1 = anim = 810
trigger1 = AnimElem = 4
value = 810, 0       ; Gomen ne
channel = 0

[State 810, 4] ; added
type = VarSet
triggerall = anim = 810
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = animelemno(0)=1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger1 = helper(3477),RootDist Y = [68,76]; [69,75]
trigger2 = animelemno(0)=2
trigger2 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger2 = helper(3477),RootDist Y = [85,93];[86,92]
trigger3 = animelemno(0)=3
trigger3 = facing*(helper(3477),Pos X-Pos X) = [1,11]
trigger3 = helper(3477),RootDist Y = [89,97];[90,96]
trigger4 = animelemno(0)>=4
trigger4 = facing*(helper(3477),Pos X-Pos X) = [29,42]
trigger4 = helper(3477),RootDist Y = [88,96];[89,95]
var(3) = 3491

[State 810, 1]
type = VarSet
trigger1 = var(3)
var(15) = 1

[State 810, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = var(3)
ctrl = !var(3)

; Roll backward taunt -- hit success
[Statedef 811]
type = C
movetype = I
physics = N
poweradd = 330
velset = -2, 0  ; slow down after hit

[State 811, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 811, 0]
type = TargetPowerAdd
trigger1 = time = 0
value = -100

[State 811, 0]
type = PlayerPush
trigger1 = anim = 801
value = 0

[State 811, 1]
type = VelSet
trigger1 = anim = 801
trigger1 = AnimElem = 14, >= 0
x = 0

[State 811, 2]
type = ChangeAnim
trigger1 = anim = 801
trigger1 = AnimElem = 14, >= 0
value = 810

[State 811, 3]
type = StateTypeSet
trigger1 = anim = 810
trigger1 = AnimElem = 1
value = S

[State 811, 3]
type = Turn 
trigger1 = anim = 810
trigger1 = AnimElem = 1
trigger1 = P2Dist X < 15 

[State 811, 4]
type = PlaySnd
trigger1 = anim = 810
trigger1 = AnimElem = 4
value = 810, 0       ; Gomen ne
channel = 0

[State 811, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = anim = 810
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = animelemno(0)=1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger1 = helper(3477),RootDist Y = [68,77];[69,75]
trigger2 = animelemno(0)=2
trigger2 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger2 = helper(3477),RootDist Y = [85,93];[86,92]
trigger3 = animelemno(0)=3
trigger3 = facing*(helper(3477),Pos X-Pos X) = [1,11]
trigger3 = helper(3477),RootDist Y = [89,97];[90,96]
trigger4 = animelemno(0)>=4
trigger4 = facing*(helper(3477),Pos X-Pos X) = [29,42]
trigger4 = helper(3477),RootDist Y = [88,96];[89,95]
var(3) = 3491

[State 811, 1]
type = VarSet
trigger1 = var(3)
var(15)=1

[State 811, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = var(3)
ctrl = !var(3)
anim = 0

;---------------------------------------------------------------------------
; STAND_A
[Statedef 200]
type    = S
movetype= A
physics = S
juggle  = 3
poweradd= 8
ctrl = 0
anim = 200
velset = 0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 200

[State 200, 3]
type = HitDef
trigger1 = Time = 3              ;Time to activate controller
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage    = 23                   ;Damage that move inflicts
guardflag = MA                   ;Flags on how move is to be guarded against
;hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3                     ;Attack priority: 0 (least) to 7 (most),
pausetime = 10,10                ;Time attacker pauses, time opponent shakes
; sparkno = 0, 3                   ;Spark image group and no
sparkxy = 0,-50                  ;X-offset for the "hit spark" rel. to p2,
                                 ;Y-offset for the spark rel. to p1
hitsound = 5,0                   ;Sound to play on hit
guardsound = 6,0                 ;Sound to play on guard
; mindist  = 0,0,0                 ;Min distance of p2 from p1 when hit
; maxdist  = 0,0,0                 ;Max distance of p2 from p1 when hit
; snap = 0,0,0                     ;Snaps p2 to position rel to p1
ground.type = Low                ;Type (refer to testp.h)
ground.slidetime = 5             ;Time that the victim slides back
ground.hittime  = 15             ;Time victim is in hit state
ground.velocity = -4             ;Velocity at which victim is pushed
; guard.slidetime = 5              ;Values for guarded attack (def: ground.slidetime)
; guard.hittime  = 15              ; (def: ground.hittime)
; guard.velocity = -4              ; (def: ground.velocity)
; guard.ctrltime = 7               ;Time to regain control after guard (def: guard.slidetime)
; airguard.velocity = -2.6,-1.5    ;Guard velocity in air (def: (air.xvel*2, air.yvel/2))
; airguard.ctrltime = 7            ;Time to regain control after air guard (def: ground.ctrltime)
air.type = High                 
air.velocity = -1.3,-1           ;X-velocity at which victim is pushed,
                                 ;Y-velocity at which victim is pushed
; attack.width = 3, 3              ;Override default attack width
fall = 0                         ;1 to cause opponent to fall. If omitted, assumed 0.

[State 200, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 200, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;STAND_B
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 40
ctrl = 0
anim = 210
velset = 0,0

[State 210, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 210

[State 210, 4]
type = VelMul
trigger1 = AnimElem = 8, >= 0
trigger2 = Vel X < -2
x = .85

[State 210, 5] ;ARRR1 tweaked
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage   = 23
animtype = Med
guardflag = MA
pausetime = 10,10
sparkxy =  -10,-50
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 17
ground.velocity = -6
air.type = Low
air.velocity = -3.3,-4
airguard.velocity = -3.5,-3

[State 210, 6] 
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage   = 30
animtype = Med
guardflag = MA
pausetime = 10,10
sparkxy =  -17,-84
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 17
ground.velocity = -6
air.type = Low
air.velocity = -3.1,-3.3
airguard.velocity = -3.5,-2.5

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 210, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;STAND_C
[Statedef 220]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 50
ctrl = 0
anim = 220
velset = 0,0

[State 220, 0]
type = PlaySnd
trigger1 = time = 0
value = 0, 220

[State 220, 1]
type = PosAdd
trigger1 = AnimElem = 3
x = 7

[State 220, 1]
type = PosAdd
trigger1 = AnimElem = 9
x = -5

[State 220, 1]
type = PosAdd
trigger1 = AnimElem = 3, =2
;trigger2 = AnimElem = 4, =1
x = 5

[State 220, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 200, 1 ; hiyah!
channel = 0

[State 220, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage   = 82
animtype = Med
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy =  -15,-90
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 23
ground.velocity = -7.5
air.velocity = -3,-5
airguard.velocity = -3.5,-3

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

[State 220, 4]
type = SprPriority
trigger1 = AnimElem = 3
value = -1

[State 220, 5]
type = SprPriority
trigger1 = AnimElem = 5
value = 1

[State 220, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;STAND_X
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 3
poweradd= 8
ctrl = 0
anim = 230
velset = 0

[State 230, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,200

[State 230, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage   = 19
priority = 3
guardflag = MA
pausetime = 8,9
sparkxy =  -5,-70
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 8
ground.hittime  = 8
ground.velocity = -3.5
air.velocity = -2,-3
air.cornerpush.veloff = -4
air.hittime = 5
airguard.velocity = -3,-2.5

[State 230, 3]
type = CtrlSet
trigger1 = AnimTime = -1
value = 1

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

[State 230, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;STAND_Y
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 20
ctrl = 0
anim = 240
velset = 0,0

[State 240, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,210

[State 240, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage   = 47
guardflag = MA
pausetime = 10,10
sparkxy =  -5,-54
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 14
ground.velocity = -4.2
air.velocity = -2.5,-3.2
airguard.velocity = -3,-2.8
priority = 5

[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 240, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;STAND_Z
[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 50
velset = 0,0
ctrl = 0
anim = 250

[State 250, 0]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 220

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 200, 2  ; hah!
channel = 0

[State 250, 3]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage    = 66
animtype  = Hard
hitflag = AF
guardflag = A
pausetime = 12,12
sparkxy =  -15,-99
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 18
ground.velocity = -6.5
air.type = Low
air.velocity = -3.4,-3.5
airguard.velocity = -4,-2.5

[State 250, 3]
type = HitDef
trigger1 = AnimElem = 3
trigger1 = movecontact = 0
attr = S, NA
damage    = 66
animtype  = Hard
hitflag = AF
guardflag = A
pausetime = 12,12
sparkxy =  -12,-64
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 18
ground.velocity = -6.5
air.type = Low
air.velocity = -3.4,-3.5
airguard.velocity = -4,-2.5

[State 250, 3]
type = HitDef
trigger1 = AnimElem = 4
trigger1 = movecontact = 0
attr = S, NA
damage    = 66
animtype  = Hard
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy =  -12,-64
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 18
ground.velocity = -6.5
air.type = Low
air.velocity = -3.4,-3.5
airguard.velocity = -4,-2.5

[State 250, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 250, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
; CROUCH_A
[Statedef 400]
type    = S
movetype= A
physics = C
juggle  = 3
poweradd= 8 
ctrl = 0
anim = 400
velset = 0,0

[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,200

[State 400, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 23
guardflag = LA
pausetime = 11,11
sparkxy = -10,-24
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 9
ground.hittime  = 9
ground.velocity = -4.1
air.type = High
air.velocity = -1.4,-3

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

[State 400, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
; CROUCH_B
[Statedef 410]
type    = S
movetype= A
physics = C
juggle  = 4
poweradd= 18
ctrl = 0
anim = 410
velset = 0,0

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,210

[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 43
guardflag = LA
pausetime = 11,11
sparkxy = -10,-21
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -5
air.type = High
air.velocity = -1.8,-3.1

[State 410, 3]
type = SprPriority
trigger1 = AnimElem = 4
value = -2

[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

[State 410, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;CROUCH_C
[Statedef 420]
type    = S
movetype= A
physics = S
juggle  = 2
poweradd= 50
ctrl = 0
anim = 420
velset = 0,0

[State 420, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,220

[State 420, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage   = 82
guardflag = LA
pausetime = 11,12
sparkxy =  -7,-20
hitsound   = 5,3
guardsound = 6,0
ground.type = Trip
ground.slidetime = 18
ground.hittime  = 25
guard.hittime = 36
guard.ctrltime = 36
ground.velocity = -2,-4
guard.velocity = -6
air.velocity = -2.4,-3.5
airguard.velocity = -3,-3
fall = 1

[State 420, 4]
type = SprPriority
trigger1 = AnimElem = 3
value = -2

[State 420, 5]
type = SprPriority
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
value = 1

[State 420, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

[State 420, 7]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
; CROUCH_X
[Statedef 430]
type    = S
movetype= A
physics = S
juggle  = 2
poweradd= 12
ctrl = 0
anim = 430

[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,200

[State 430, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 16
guardflag = MA
pausetime = 9,9
sparkxy = -5,-50
hitsound   = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 9
ground.hittime  = 9
ground.velocity = -4
air.type = High
air.velocity = -1.2,-3
guard.velocity = -5

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

[State 430, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
; CROUCH_Y
[Statedef 440]
type    = S
movetype= A
physics = S
juggle  = 3
poweradd= 28
ctrl = 0
anim = 440

[State 440, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,210

[State 440, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 43
guardflag = MA
pausetime = 11,11
sparkxy = -7,-45
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -4.7
air.type = High
air.velocity = -1.5,-3.2

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

[State 440, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
; CROUCH_Z
[Statedef 450]
type    = C
movetype= A
physics = C
juggle  = 1
poweradd= 49
ctrl = 0
anim = 450

[State 450, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,220

[State 450, 2]
type = HitDef
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3 
trigger2 = !movecontact
attr = C, NA
damage   = 66
animtype = Med
guardflag = MA
pausetime = 10,8
sparkxy = ifelse((AnimElem=2),-12,-10),ifelse((AnimElem=2),-60,-109)
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = 0 ,-14.5 
air.type = High  
air.animtype = Back
air.velocity = 0,-13
air.juggle = 4
airguard.velocity = -1.8,-.8 
air.slidetime = 20               
air.hittime = 20 
fall = 0

[State 450, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

[State 450, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;JUMP_A
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 15
ctrl = 0
anim = 600

[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,200

[State 600, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
damage   = 23
guardflag = HA
priority = 3
pausetime = 9,9
sparkxy =  -5,-41
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -3.6
air.velocity = -2.2,-3
airguard.velocity = -3,-2.5

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

[State 600, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;JUMP_B
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 610

[State 610, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,210

[State 610, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage   = 35
guardflag = HA
priority = 3
pausetime = 9,11
sparkxy =  -7,-52
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -4
air.velocity = -2.5,-3.1
airguard.velocity = -3.3,-2.5

[State 610, 2]
type = Width
trigger1 = AnimElemNo(0) = 3
value = 20,-5

[State 610, 2]
type = Width
trigger1 = !(AnimElemNo(0) & 1)
value = 10,-2

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

[State 610, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;JUMP_C
[Statedef 620]
type    = A
movetype= A
physics = A
juggle  = 1
poweradd= 30
ctrl = 0
anim = 620

[State 620, 1]
type = PlaySnd
trigger1 = Time = 3
value = 0,220

[State 620, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
animtype  = Med
damage    = 55
guardflag = HA
pausetime = 12,11
sparkxy = -15,-50;-65
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 16
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2,19
sparkno = 2
air.hittime = 20
air.fall = 1

[State 620, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 0

[State 620, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;JUMP_X
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 10
ctrl = 0
anim = 630

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,200

[State 630, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage   = 19
guardflag = HA
priority = 3
pausetime = 9,9
sparkxy =  -5,-60
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 8
ground.hittime  = 8
ground.velocity = -3.5
air.velocity = -2,-3
airguard.velocity = -3,-2.5

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

[State 630, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;JUMP_Y
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 17
ctrl = 0
anim = 640

[State 640, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,210

[State 640, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage   = 35
guardflag = HA
priority = 3
pausetime = 11,11
sparkxy =  -5,-60
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -4
air.velocity = -2.5,-3.1
airguard.velocity = -3.3,-2.5

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

[State 640, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;---------------------------------------------------------------------------
;JUMP_Z
[Statedef 650]
type    = A
movetype= A
physics = A
juggle  = 1
poweradd= 40
ctrl = 0
anim = 650

[State 650, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,220

[State 650, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage   = 62
guardflag = HA
pausetime = 12,12
sparkxy =  -5,-60
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 21
ground.hittime  = 19
ground.velocity = -6
air.velocity = -2,19
sparkno = 2
air.hittime = 20
air.fall = 1

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

[State 650, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Seoi nage attempt
[Statedef 900]
type = S
physics = S
movetype = A
velset = 0,0
poweradd = 10
ctrl = 0
anim = 900
juggle = 0

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

[State 900, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 900, 3]
type = HitDef
trigger1 = AnimElem = 2
trigger1 = P2BodyDist X < 25
trigger1 = Vel X < 4
attr = S, NT
id = 900
getpower  = 40
givepower = 30
hitflag = H-
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
sparkxy = -25, -70
sparkno = -1
p2facing = 0
p1stateno = 905
p2stateno = 910
hitsound = 6,0
fall = 1
fall.damage = 26

[State 900, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Back Seoi nage attempt
[Statedef 901]
type = S
physics = S
movetype = A
velset = 0.0
poweradd = 10
id = 900
ctrl = 0
anim = 900
juggle = 0

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

[State 901, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 901, 3]
type = HitDef
Trigger1 = AnimElem = 2
Trigger1 = P2BodyDist X < 25
Trigger1 = Vel X < 4
attr = S, NT
getpower  = 40
givepower = 30
id = 900
hitflag = M-
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
sparkxy = -25, -70
sparkno = -1
p1facing = -1
p2facing = 0
p1stateno = 905
p2stateno = 910
hitsound = 6,0
fall = 1
fall.damage = 26

[State 901, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Air Seoi nage attempt
[Statedef 902]
type = A
physics = A 
movetype = A
poweradd = 8
ctrl = 0
anim = 902
juggle = 0

[State 902, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 902, 3]
type = HitDef
Trigger1 = AnimElem = 2
trigger1 = P2BodyDist X < 25
trigger1 = Vel X < 4
attr = A, NT
getpower  = 40
givepower = 30
id = 900
hitflag = A-
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
;snap = 20, 0, 0
sparkxy = -25, -70
sparkno = -1
p2facing = 0
p1stateno = 906
p2stateno = 910
hitsound = 6,0
fall = 1
fall.damage = 26

[State 902, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Air Seoi nage back attempt
[Statedef 903]
type = A
physics = A 
movetype = A
poweradd = 8
ctrl = 0
anim = 902
juggle = 0

[State 903, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 903, 0]
type = CtrlSet
trigger1 = time = 0
value = 0

[State 903, 3]
type = HitDef
trigger1 = AnimElem = 2
trigger1 = P2BodyDist X < 25
trigger1 = Vel X < 4
attr = A, NT
getpower  = 40
givepower = 30
hitflag = A-
id = 900
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
;snap = 20, 0, 0
sparkxy = -25, -70
sparkno = -1
p1facing = -1
p2facing = 0
p1stateno = 906
p2stateno = 910
hitsound = 6,0
fall.damage = 26
fall = 1

[State 903, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Seoi Nage success
[Statedef 905]
type    = S
movetype= A
physics = S
poweradd = 70
anim = 905

[State 905, 0]
type = TargetDrop
trigger1 = !time
excludeID = 900
keepone = 1

[State 905, 0]
type = PosAdd
trigger1 = AnimElem = 3
x = 15   ; 17

[State 905, 0]
type = PosAdd
trigger1 = AnimElem = 4
x = 16   ; 18

[State 905, 0]
type = PosAdd
trigger1 = AnimElem = 5
x = 4   ; 4

[State 905, 0]
type = TargetBind
trigger1 = AnimElem = 2, < 0 
pos = -20, -1

[State 905, 0]
type = TargetBind
trigger1 = AnimElem = 2, >= 0 
trigger1 = AnimElem = 3, < 0
pos = -27, -90

[State 905, 0]
type = TargetBind
trigger1 = AnimElem = 3, >= 0 
trigger1 = AnimElem = 4, < 0
pos = -7, -91

[State 905, 0]
type = TargetBind
trigger1 = AnimElem = 4, >= 0 
trigger1 = AnimElem = 5, < 0 
pos = 24, -76

[State 905, 0]
type = TargetBind
trigger1 = AnimElem = 5
pos = 20,-45

[State 905, 0]
type = PlaySnd
trigger1 = time = 4
value = 905, 0   ; got you!
channel = 0

[State 905, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = 200, 1   ; hiyah!
channel = 0

;[State 905, 2]
;type = HitBy
;Trigger1 = Time >= 0
;value = SCA
;time = 1

[State 905, 1]
type = VelSet
Trigger1 = Time = 0
x = 0

[State 905, 8]
type = PosAdd
trigger1 = animtime = 0
x = -21

[State 905, 9]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Air Seoi Nage success
[Statedef 906]
type    = A
movetype= A
physics = N
poweradd = 70
anim = 906

[State 906, 0]
type = TargetBind
trigger1 = AnimElem = 2, < 0 
pos = -20, -1

[State 906, 0]
type = TargetBind
trigger1 = AnimElem = 2, >= 0 
trigger1 = AnimElem = 3, < 0
pos = -27, -90

[State 906, 0]
type = TargetBind
trigger1 = AnimElem = 3, >= 0 
trigger1 = AnimElem = 4, < 0
pos = -7, -91

[State 906, 0]
type = TargetBind
trigger1 = AnimElem = 4, >= 0 
trigger1 = AnimElem = 5, < 0 
pos = 24, -76

[State 906, 0]
type = TargetBind
trigger1 = AnimElem = 5
pos = 20,-45

[State 906, 0]
type = PlaySnd
trigger1 = time = 4
value = 905, 0   ; got you!
channel = 0

[State 906, 0]
type = PlaySnd
trigger1 = AnimElem = 5
value = 200, 1   ; hiyah!
channel = 0

[State 906, 2]
type = HitBy
Trigger1 = Time >= 0
value = SCA
time = 1

[State 906, 2]
type = PosFreeze
trigger1 = AnimElem = 5, < 0
time = 1

[State 906, 3]
type = ChangeState
trigger1 = AnimElem = 5
value = 907

[Statedef 907]
type = A
movetype = A
physics = A

[State 907, 0]
type = null
trigger1 = time = 0

; Thrown by Seoi Nage
[Statedef 910]
type    = A
movetype= H ;Get hit
physics = N
ctrl = 0
facep2 = 1
velset = 0,0

[State 910, 0]
type = ScreenBound
trigger1 = 1
value = 0

[State 910, 1]
type = HitBy
Trigger1 = 1
value = SCA
time = 1

[State 910, 2]
type = HitFallSet
Trigger1 = Time = 0
value = 1

[State 910, 2]
type = LifeAdd
trigger1 = AnimElem = 4
value = -60

[State 910, 3]
type = ChangeAnim2
Trigger1 = Time = 0
value = 910

[State 910, 0]
type = ChangeState
trigger1 = time < 3
trigger1 = command = "recovery"
value = 912

[State 910, 8]
type = PowerAdd
Trigger1 = AnimElem = 4
value = 60

[State 910, 10]
type = ChangeState
Trigger1 = AnimElem = 5
value = 911

[Statedef 911]
type    = A
movetype= H ;Get hit
physics = N
velset = 3.8,-4.8 

[State 911, 4] ;Acceleration
type = Gravity;VelAdd
trigger1 = 1;Time >= 0
;y = .45

[State 911, 5] ;If yvelocity > 0
type = SelfState
trigger1 = Vel Y >= 4.8
trigger1 = Pos Y > 0
value = 5100

[State 911, 7] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > -1
triggerall = Vel Y < 40 ;4
triggerall = alive = 1
triggerall = CanRecover = 1
trigger1 = command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

; Tech hit in Seoi Nage
[Statedef 912]
type    = A
movetype= H ;Get hit
physics = N
ctrl = 0

[State 912, 0]
type = PalFX
trigger1 = time < 3
time = 2
add = -32,64,-32

[State 912, 0]
type = ScreenBound
trigger1 = 1
value = 0

[State 912, 1]
type = HitBy
Trigger1 = 1
value = SCA
time = 1

[State 912, 2]
type = HitFallSet
Trigger1 = Time = 0
value = 1

[State 912, 2]
type = LifeAdd
trigger1 = AnimElem = 4
value = -30

[State 912, 8]
type = PowerAdd
Trigger1 = AnimElem = 4
value = 60

[State 912, 10]
type = ChangeState
Trigger1 = AnimElem = 5
value = 913

[Statedef 913]
type    = A
movetype= H ;Get hit
physics = N
velset = 3.8,-4.8 

[State 913, 4] ;Acceleration
type = Gravity
trigger1 = 1

[State 913, 5] ;If yvelocity > 0
type = SelfState
trigger1 = Vel Y >= 0
value = 5210 ; recover

; Generic Kick Throw
[Statedef 950]
type = S
movetype = A
physics = S
velset = 0,0
poweradd = 20
anim = 1205
ctrl = 0

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

[State 950, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 950, 3]
type = HitDef
trigger1 = AnimElem = 2
trigger1 = P2BodyDist X < 25
trigger1 = Vel X < 4
attr = S, NT
id = 950
getpower  = 40
givepower = 30
hitflag = H-
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
sparkxy = -25, -70
sparkno = -1
p2facing = 1
p1stateno = 955
p2stateno = 970
hitsound = 6,0
numhits = 0

[State 950, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Generic Kick Throw success
[Statedef 955]
type = S
movetype = A
physics = S
anim = 950
juggle = 5

[State 955, 0]
type = TargetDrop
trigger1 = !time
excludeid = 950
keepone = 1

[State 955, 0]
type = PlaySnd
trigger1 = AnimElem = 6
value = 200,0  ; dah!
channel = 0

[State 955, 0]
type = TargetBind
trigger1 = AnimElemNo(0) = 1
trigger1 = animtime
time = 1
pos = 48,-90

[State 955, 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 2
time = 1
pos = 29,-85

[State 955, 2]
type = StateTypeSet
trigger1 = AnimElem = 4
value = C

[State 955, 2]
type = HitDef
trigger1 = AnimElem = 6
trigger2 = AnimElem = 7 
trigger2 = !movecontact
attr = S, NT
damage   = 57
animtype = Up
chainid = 950
hitflag = A+
pausetime = 12,12
sparkxy = ifelse((AnimElem=6),-12,-10),ifelse((AnimElem=7),-60,-109)
hitsound   = 5,3
guardsound = 6,0
air.type = Low
air.animtype = Back
air.velocity = -.64,-13.5

[State 955, 3]
type = ChangeState
trigger1 = !animtime
value = 11
ctrl = 1

; Hit by Generic Kick Throw
[Statedef 970]
type = A
movetype = H
physics = N

[State 970, 0]
type = SprPriority
trigger1 = !time
value = 3

[State 970, 0]
type = ChangeAnim2
trigger1 = !time
value = 970

[State 970, 0]
type = ChangeState
trigger1 = time < 3
trigger1 = command = "recovery"
value = 971

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

[State 970, 0]
type = ScreenBound
trigger1 = time < 18
value = 1
movecamera = 1,0

[State 970, 1]
type = ChangeAnim2
trigger1 = time = 18
value = 971

[State 970, 1]
type = PosAdd
trigger1 = time = 18
y = -const(size.head.pos.y)

[State 970, 1]
type = PosSet
trigger1 = time = 18
trigger1 = Pos Y > 0
y = 0

[State 970, 1]
type = VelSet
trigger1 = time = 18
x = 0
y = -Const(movement.yaccel)*9

[State 970, 2]
type = Gravity
trigger1 = time >= 18

[State 970, 3]
type = SelfState
trigger1 = Pos Y > 0
value = 5100

; Hit by Generic Kick Throw (tech hit)
[Statedef 971]
type = A
movetype = H
physics = N

[State 971, 0]
type = PalFX
trigger1 = time < 3
time = 2
add = -32,64,-32

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

[State 971, 0]
type = ScreenBound
trigger1 = anim = 970
trigger1 = AnimElem = 1, < 18
value = 1
movecamera = 1,0

[State 971, 1]
type = ChangeAnim2
trigger1 = anim = 970
trigger1 = AnimElem = 1, = 18
value = 971

[State 971, 1]
type = PosAdd
trigger1 = anim = 971
trigger1 = AnimElem = 1
y = -const(size.head.pos.y)

[State 971, 1]
type = PosSet
trigger1 = anim = 971
trigger1 = AnimElem = 1
trigger1 = Pos Y > 0
y = 0

[State 971, 1]
type = VelSet
trigger1 = anim = 971
trigger1 = AnimElem = 1
x = 0
y = -Const(movement.yaccel)*9

[State 971, 2]
type = Gravity
trigger1 = anim = 971

[State 971, 3]
type = ChangeState
trigger1 = anim = 971
trigger1 = Vel Y > 0
value = 972

[Statedef 972]
type = A
movetype = I
physics = N
velset = -3.6,-2

[State 972, 0]
type = SelfState
trigger1 = !time
value = 5210 

; Saikyou Jigoku Otoshi
[Statedef 980]
type = A
movetype = A
physics = A
poweradd = 20
anim = 980
ctrl = 0
juggle = 7

[State 980, 1]
type = VarSet
trigger1 = !time
var(1) = command = "back_2k"

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

[State 980, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 980, 3]
type = HitDef
trigger1 = AnimElem = 2
trigger1 = P2BodyDist X < 25
trigger1 = Vel X < 4
attr = A, NT
id = 980
getpower  = 40
givepower = 30
hitflag = AF
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
sparkxy = -25, -70
sparkno = -1
p2facing = ifelse(var(1),-1,1)
p1stateno = 985
p2stateno = 990
hitsound = 6,0
fall = 1
fall.recovertime = 4

[State 980, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Saikyou Jigoku Otoshi success
[Statedef 985]
type = A
movetype = A
physics = N
anim = 985

[State 985, 0]
type = TargetDrop
trigger1 = !time
excludeID = 980
keepone = 1

[State 985, 0]
type = Turn
triggerall = !time
trigger1 = var(1)

[State 985, 3]
type = PlaySnd
trigger1 = AnimElem = 1, = 2
value = 200, 2   ; hah!

[State 985, 0]
type = PosFreeze
trigger1 = AnimElem = 4, < 0

[State 985, 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 1
pos = -30, -86

[State 985, 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 2
pos = -15, -83

[State 985, 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 3
pos = 2, -75

[State 985, 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 4
time = 1
pos = 28, -64

[State 985, 0]
type = Width
trigger1 = AnimElemNo(0) = 4
edge = 18

[State 985, 1]
type = VelSet
trigger1 = AnimElem = 4
y = ifelse(Vel Y > 0, 0, Vel Y)

[State 985, 2]
type = Gravity
trigger1 = AnimElemNo(0) = 4

[State 985, 2]
type = ChangeState
trigger1 = Pos Y > 0
value = 986

[Statedef 986]
type = S
movetype = A
physics = S
velset = 0,0
poweradd = 20
anim = 986

[State 986, 0]
type = Width
trigger1 = 1
edge = 13

[State 986, 0]
type = TargetBind
trigger1 = !time
pos = 28, -5

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

[State 986, 1]
type = TargetState
trigger1 = !time
value = target(980),stateno+1

[State 986, 2]
type = EnvShake
trigger1 = !time
time = 20
ampl = -5

[State 986, 3]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1

; Saikyou Jigoku Otosareta (air)
[Statedef 990]
type = A
movetype = H
physics = N

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

[State 990, 0]
type = ChangeAnim2
trigger1 = !time
value = 990

[State 990, 0]
type = ChangeState
trigger1 = command = "recovery"
trigger1 = time < 3
value = 993

; Saikyou Jigoku Otosareta (ground)
[Statedef 991]
type = L
movetype = H
physics = N

[State 991, 1]
type = ChangeAnim2
trigger1 = !time
value = 991

[State 991, 4]
type = PlaySnd
trigger1 = !time
value = F7, 2

[State 991, 5]
type = Explod
trigger1 = !time
anim = F62
pos = 0,0
postype = p1
removetime = -2
ownpal = 1
sprpriority = 3

[State 991, 0]
type = LifeAdd
trigger1 = !time
value = -63

[State 991, 3]
type = ChangeState
trigger1 = time = 20
value = 992

; Saikyou Jigoku Otosareta (bounce)
[Statedef 992]
type = A
movetype = H
physics = A
velset = -2.2, -7.5
anim = ifelse(SelfAnimExist(5052),5052,5050)

[State 991, 3]
type = SelfState
trigger1 = Vel Y > 0
value = 5050

; Saikyou Jigoku Otosareta (air, after tech hit)
[Statedef 993]
type = A
movetype = H
physics = N

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

[State 993, 0]
type = PalFX
trigger1 = time < 3
time = 2
add = -32,64,-32

; Saikyou Jigoku Otosareta (ground, after tech hit)
[Statedef 994]
type = L
movetype = H
physics = N

[State 994, 1]
type = ChangeAnim2
trigger1 = !time
value = 991

[State 994, 4]
type = PlaySnd
trigger1 = !time
value = F7, 2

[State 994, 5]
type = Explod
trigger1 = !time
anim = F62
pos = 0,0
postype = p1
removetime = -2
ownpal = 1
sprpriority = 3

[State 994, 0]
type = LifeAdd
trigger1 = !time
value = -31

[State 994, 3]
type = ChangeState
trigger1 = time = 20
value = 995

[Statedef 995]
type = A
movetype = H
physics = A
velset = -3.6, -5.5
anim = ifelse(SelfAnimExist(5052),5052,5050)

[State 991, 3]
type = SelfState
trigger1 = time = 4
value = 5040

; light Dan Kuu Kyaku (start)
[Statedef 1000]
type = S
movetype = A
physics = S
ctrl = 0
velset = 0,0
anim = 1000
juggle = 3

[State 1000, 0]
type = ChangeState
trigger1 = AnimElem = 2, =3
value = 1001

[State 1000, 1]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; light Dan Kuu Kyaku (in air)
[Statedef 1001]
type = A
movetype = A
velset = 3, -9.5
poweradd = 50

[State 1001, 1]
type = VelAdd
trigger1 = Time >= 0
y = 0.75

[State 1001, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -7
type = ChangeState
value = 1002

[State 1001, 0]
type = PlaySnd
trigger1 = AnimElem = 3, =1
value = 200, 0; dah!
channel = 0

[State 1001, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 220; whoosh

[State 1001, 4]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
damage   = 35 
guardflag = HA
animtype = DiagUp
pausetime = 12,12
sparkxy =  -5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -2.5,-5
air.velocity = -2.5,-5
airguard.velocity = -3.4,-2.6
fall = 1
fall.damage = 5

; Dan Kuu Kyaku (land)
[Statedef 1002]
type = S
movetype = I
velset = 0, 0 
anim = 10

[State 1002, 0]
type = ChangeState
trigger1 = AnimTime = 0
ctrl = 1
value = 11

[State 1002, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 1002, 2]
type = PlaySnd
trigger1 = time = 0
value = 0,52

; air Dan Kuu Kyaku (going forward/backward)
[Statedef 1005]
type = A
movetype = A
physics = N
anim = 1005
poweradd = 40
ctrl = 0
juggle = 2   ; this is evil

[State 1005, 0]
type = VelSet
trigger1 = time = 0
trigger1 = Vel X < 0
x = -3.1

[State 1005, 1]
type = VelSet
trigger1 = time = 0
trigger1 = Vel X > 0
x = 3.1

[State 1005, 0]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1005, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 220

[State 1005, 1]
type = PlaySnd
trigger1 = AnimElem = 2, =1
value = 200, 0; dah!
channel = 0

[State 1005, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
damage   =  35
guardflag = HA
animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 5

[State 1005, 3]
type = VelSet
trigger1 = time = 0
y = -4

[State 1005, 4]
type = VelAdd
trigger1 = Time > 0
y = 0.75

[State 1005, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1006, 6]
type = Width
trigger1 = animelemno(0) = 3
value = 20,-10

; air Dan Kuu Kyaku (neutral)
[Statedef 1006]
type = A
movetype = A
physics = N
anim = 1005
velset = 1,-4
poweradd = 40
ctrl = 0
juggle = 2

[State 1006, 0]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1006, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 220

[State 1006, 1]
type = PlaySnd
trigger1 = AnimElem = 2, =1
value = 200, 0; dah!
channel = 0

[State 1006, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
damage   =  35
guardflag = HA
animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 5

[State 1006, 4]
type = VelAdd
trigger1 = Time > 0
y = 0.75

[State 1006, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1006, 6]
type = Width
trigger1 = animelemno(0) = 3
value = 20,-10

; "Command buffer" light Dan Kuu Kyaku
[Statedef 1007]
type = S
movetype = A
physics = N
velset = 0, 0
poweradd = 40
anim = 1000
juggle = 3

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

[State 1007, 1]
type = ChangeState
trigger1 = AnimElem = 2, =3
value = 1008

[State 1007, 2]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[Statedef 1008]
type = A
movetype = A
velset = -3, -6.5

[State 1008, 1]
type = VelAdd
trigger1 = Time >= 0
y = 0.75

[State 1008, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -7
type = ChangeState
value = 1002

[State 1008, 0]
type = PlaySnd
trigger1 = AnimElem = 3, =1
value = 200, 0; dah!
channel = 0

[State 1008, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 220; whoosh

[State 1008, 4]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
damage   =  35
guardflag = HA
animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -2.5,-5
air.velocity = -2.5,-5
airguard.velocity = -3.4,-2.6
fall = 1
fall.damage = 5

; medium Dan Kuu Kyaku (start)
[Statedef 1010]
type = S
ctrl = 0
velset = 0,0,0
anim = 1010
juggle = 4

[State 1010, 0]
type = ChangeState
trigger1 = AnimElem = 2, = 3
value = 1011

[State 1010, 1]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[Statedef 1011]
type = A
movetype = A
velset = 4, -7.2
poweradd = 55

[State 1011, 1]
type = VelAdd
trigger1 = Time >= 0
trigger1 = AnimElem = 7, < 0
y = 0.5

[State 1011, 1]
type = VelAdd
trigger1 = AnimElem = 7, >= 0
y = 0.57

[State 1011, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1011, 0]
type = PlaySnd
trigger1 = time = 0
trigger2 = AnimElem = 6
value = 0, 220

[State 1011, 0]
type = PlaySnd
trigger1 = time = 1
trigger2 = AnimElem = 6, =1
value = 200, 0; dah!
channel = 0

[State 1011, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
damage   = 35 
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1011, 5]
type = HitDef
trigger1 = AnimElem = 7
attr = A, SA
damage   = 50 
animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 7

; air medium Dan Kuu Kyaku (forward/backward)
[Statedef 1015]
type = A
movetype = A
physics = N
anim = 1015
juggle = 4
poweradd = 45
ctrl = 0

[State 1015, 0]
type = VelSet
trigger1 = time = 0
y = -3

[State 1015, 0]
type = VelSet
trigger1 = time = 0
trigger1 = Vel X < 0
x = -3.1

[State 1015, 0]
type = VelSet
trigger1 = time = 0
trigger1 = Vel X > 0
x = 3.1

[State 1015, 0]
type = VelAdd
trigger1 = Time > 0
trigger1 = AnimElem = 7, < 0
y = 0.25

[State 1015, 1]
type = VelAdd
trigger1 = AnimElem = 7, >= 0
y = .5

[State 1015, 1]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1015, 2]
type = PlaySnd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 5
value = 0, 220

[State 1015, 2]
type = PlaySnd
trigger1 = AnimElem = 1, =1
trigger2 = AnimElem = 5, =1
value = 200, 0; dah!
channel = 0

[State 1015, 4]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
damage   =  35
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1015, 5]
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
damage   = 50 
animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-63;-10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 7

[State 1015, 6] 
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; air medium Dan Kuu Kyaku (neutral)
[Statedef 1016]
type = A
movetype = A
physics = N
anim = 1015
velset = 1.5, -3
juggle = 4
poweradd = 45
ctrl = 0

[State 1016, 0]
type = VelAdd
trigger1 = AnimElem = 6, < 0
y = 0.25

[State 1016, 1]
type = VelAdd
trigger1 = AnimElem = 6, >= 0
y = .5

[State 1016, 1]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1016, 2]
type = PlaySnd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 5
value = 0, 220

[State 1016, 2]
type = PlaySnd
trigger1 = AnimElem = 1, =1
trigger2 = AnimElem = 5, =1
value = 200, 0; dah!
channel = 0

[State 1016, 4]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
damage   =  35
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall =1
fall.damage = 5

[State 1016, 5]
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
damage   = 50 
animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-63;-10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 7

[State 1016, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; "command buffer" medium Dan Kuu Kyaku (start)
[Statedef 1017]
type = S
ctrl = 0
velset = 0,0
poweradd = 45
anim = 1010
juggle = 4

[State 1017, 0]
type = ChangeState
trigger1 = AnimElem = 2, = 3
value = 1018

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

[State 1017, 2]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[Statedef 1018]
type = A
movetype = A
velset = -4, -5.6

[State 1018, 1]
type = VelAdd
trigger1 = Time >= 0
trigger1 = AnimElem = 7, < 0
y = 0.5

[State 1018, 1]
type = VelAdd
trigger1 = AnimElem = 7, >= 0
y = 0.57

[State 1018, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1018, 0]
type = PlaySnd
trigger1 = time = 0
trigger2 = AnimElem = 6
value = 0, 220

[State 1018, 0]
type = PlaySnd
trigger1 = time = 1
trigger2 = AnimElem = 6, =1
value = 200, 0; dah!
channel = 0

[State 1018, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
damage   =  35
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1018, 5]
type = HitDef
trigger1 = AnimElem = 7
attr = A, SA
damage   = 50 
animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-63;-10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 7

; hard Dan Kuu Kyaku (start)
[Statedef 1020]
movetype = A
type = S
physics = S
ctrl = 0
velset = 0,0
anim = 1020
juggle = 5

[State 1020, 0]
type = ChangeState
trigger1 = AnimElem = 2, =4
value = 1021

[State 1020, 1]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[Statedef 1021]
type = A
movetype = A
poweradd = 60
velset = 4, -4

[State 1021, 1]
type = VelAdd
trigger1 = Time >= 0
y = 0.17

[State 1021, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1021, 0]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 6
trigger3 = AnimElem = 10
value = 0, 220

[State 1021, 0]
type = PlaySnd
trigger1 = AnimElem = 3, = 1
trigger2 = AnimElem = 6, =1
value = 200, 0; dah!
channel = 0

[State 1021, 4]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
damage   = 35 
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1021, 5]
type = HitDef
trigger1 = AnimElem = 7
attr = A, SA
damage   = 45 
animtype = Hard
air.animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 6

[State 1021, 3]
type = PlaySnd
trigger1 = AnimElem = 10, =1
value = 200, 1; hiyah!
channel = 0

[State 1021, 6]
type = HitDef
trigger1 = AnimElem = 11
animtype = DiagUp
attr = A, SA
damage   = 60 
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-50
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 8

; air Dan Kuu Kyaku (hard) (forward/backward)
[Statedef 1025]
type = A
movetype = A
physics = N
anim = 1025
juggle = 5
poweradd = 50
ctrl = 0

[State 1025, 0]
type = VelSet
trigger1 = time = 0
y = -4 

[State 1025, 0]
type = VelSet
trigger1 = time = 0
trigger1 = Vel X < 0
x = -4 

[State 1025, 0]
type = VelSet
trigger1 = time = 0
trigger1 = Vel X > 0
x = 4 

[State 1025, 1]
type = VelAdd
trigger1 = Time > 0
trigger1 = AnimElem = 11, < 0
y = 0.17

[State 1025, 1]
type = VelAdd
trigger1 = AnimElem = 11, >= 0
y = 0.25

[State 1025, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1025, 0]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 9
value = 0, 220

[State 1025, 0]
type = PlaySnd
trigger1 = AnimElem = 2, =1
trigger2 = AnimElem = 5, =1
value = 200, 0; dah!
channel = 0

[State 1025, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
damage   =  35
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1025, 5]
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
damage   = 45 
animtype = Hard
air.animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-63;-10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 6

[State 1025, 3]
type = PlaySnd
trigger1 = AnimElem = 9, =1
value = 200, 1; hiyah!
channel = 0

[State 1025, 6]
type = HitDef
trigger1 = AnimElem = 10
animtype = DiagUp
attr = A, SA
damage   = 60 
guardflag = HA
pausetime = 12,12
sparkxy =  -15,-70;-12,-50
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 8

[State 1025, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; air Dan Kuu Kyaku (hard) (neutral)
[Statedef 1026]
type = A
movetype = A
physics = N
anim = 1025
velset = 2, -4
juggle = 5
poweradd = 50
ctrl = 0

[State 1026, 1]
type = VelAdd
trigger1 = Time > 0
trigger1 = AnimElem = 11, < 0
y = 0.17

[State 1026, 1]
type = VelAdd
trigger1 = AnimElem = 11, >= 0
y = 0.25

[State 1026, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1026, 0]
type = PlaySnd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 5
trigger3 = AnimElem = 9 
value = 0, 220

[State 1026, 0]
type = PlaySnd
trigger1 = AnimElem = 1, =1
trigger2 = AnimElem = 5, =1
value = 200, 0; dah!
channel = 0

[State 1026, 4]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
damage   = 35 
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1026, 5]
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
damage   = 45 
animtype = Hard
air.animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-63;-10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 6

[State 1026, 3]
type = PlaySnd
trigger1 = AnimElem = 9, =1
value = 200, 1; hiyah!
channel = 0

[State 1026, 6]
type = HitDef
trigger1 = AnimElem = 10
animtype = DiagUp
attr = A, SA
damage   = 60 
guardflag = HA
pausetime = 12,12
sparkxy =  -15,-70;-12,-50
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 8

[State 1026, 7]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; "command buffer" hard Dan Kuu Kyaku (start)
[Statedef 1027]
movetype = A
type = S
;physics = S
ctrl = 0
velset = 0,0
anim = 1020
poweradd = 50
juggle = 5

[State 1027, 0]
type = ChangeState
trigger1 = AnimElem = 2, =4
value = 1028

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

[State 1027, 2]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[Statedef 1028]
type = A
movetype = A
velset = -4, -4

[State 1028, 1]
type = VelAdd
trigger1 = Time >= 0
y = 0.25

[State 1028, 2]
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
type = ChangeState
value = 1002

[State 1028, 0]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 6
trigger3 = AnimElem = 10
value = 0, 220

[State 1028, 0]
type = PlaySnd
trigger1 = AnimElem = 3, = 1
trigger2 = AnimElem = 6, =1
value = 200, 0; dah!
channel = 0

[State 1028, 4]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
damage   =  35
guardflag = HA
animtype = Hard
air.animtype = DiagUp
pausetime = 12,12
sparkxy =  -7,-70;-5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 5

[State 1028, 5]
type = HitDef
trigger1 = AnimElem = 7
attr = A, SA
damage   =  45
animtype = Hard
air.animtype = DiagUp
guardflag = HA
pausetime = 12,12
sparkxy =  -12,-63;-10,-43
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -2.7,-3.5
airguard.velocity = -3.4,-2.6
air.fall = 1
fall.damage = 6

[State 1028, 3]
type = PlaySnd
trigger1 = AnimElem = 10, =1
value = 200, 1; hiyah!
channel = 0

[State 1028, 6]
type = HitDef
trigger1 = AnimElem = 11
animtype = DiagUp
attr = A, SA
damage   = 60 
guardflag = HA
pausetime = 12,12
sparkxy =  -15,-70;-12,-50
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3, -5.5
air.velocity = -3, -5
airguard.velocity = -3.4,-3
fall = 1
fall.damage = 8

; light Gadouken
[Statedef 1030]
type = S
physics = S
movetype = A
velset = 0,0
poweradd = 40
juggle = 1
ctrl = 0
anim = 1030

[State 1030, 1]
type = projectile
trigger1 = AnimElem = 4
projanim = 1035   
projhitanim = 1036
projremanim = 1036
offset = 82, -68  
velocity = 0, 0       ;Speed fireball moves (x,y) (optional)
remvelocity = 0, 0     ;Speed fireball moves when being removed (x,y) (opt)
accel = 0, 0            ;Acceleration (opt)
projremovetime = 3
; hitdef
attr = S, SP
damage = 30,2
guardflag = MA
pausetime = 0, 9
sparkno = 1
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -4
air.velocity = -2.5, -4
air.juggle = 1

[State 1030, 2]
type = ChangeState
trigger1 = AnimTime = 0
ctrl = 1
value = 0

[State 1030, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1030, 0 ; Gadouken!
channel = 0

[State 1030, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 1030  ; Swoosh

[State 1030, 5]
type = width
trigger1 = AnimElem = 4, > 0
value = 20   ; wider in front

[State 1030, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

;medium Gadouken
[Statedef 1040]
type = S
movetype = A
physics = S
velset = 0.0
poweradd = 50
juggle = 1
ctrl = 0
anim = 1040

[State 1040, 1]
type = projectile
trigger1 = AnimElem = 4
projanim = 1035   
projhitanim = 1036
projremanim = 1036
offset = 82, -68  
velocity = 1, 0       ;Speed fireball moves (x,y) (optional)
remvelocity = 0, 0     ;Speed fireball moves when being removed (x,y) (opt)
;accel = -.04, 0            ;Acceleration (opt)
projremovetime = 6
; hitdef
attr = S, SP
damage = 30,2
guardflag = MA
pausetime = 0, 9
sparkno = 1
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -4
air.velocity = -2.5, -4
air.juggle = 1

[State 1040, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 1040, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1030, 1 ; Gadouken!
channel = 0

[State 1040, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 1030  ; Swoosh

[State 1040, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1040, 5]
type = width
trigger1 = AnimElem = 4, > 0
value = 20   ; wider in front

; strong Gadouken
[Statedef 1050]
type = S
movetype = A
physics = S
velset = 0,0
poweradd = 60
juggle = 1
ctrl = 0
anim = 1050

[State 1050, 1]
type = Projectile
trigger1 = AnimElem = 4
projanim = 1035   
projhitanim = 1036
projremanim = 1036
offset = 82, -68  
velocity = 2, 0       ;Speed fireball moves (x,y) (optional)
remvelocity = 0, 0     ;Speed fireball moves when being removed (x,y) (opt)
;accel = -0.1, 0            ;Acceleration (opt)
projremovetime = 9
; hitdef
attr = S, SP
damage = 40,3
guardflag = MA
pausetime = 0, 9
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -4
air.velocity = -2.5, -4
air.juggle = 1

[State 1050, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 1050, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1030, 2 ; Gadouken!
channel = 0

[State 1050, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 1030  ; Swoosh

[State 1050, 5]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1050, 5]
type = width
trigger1 = AnimElem = 4, > 0
value = 20   ; wider in front

; light kouryuuken (start)
[Statedef 1060]
type = S
physics = S
movetype = A
ctrl = 0
poweradd = 30
velset = 0,0 
anim = 1060
juggle = 4

[State 1060, 0]  ; this first
type = VarSet
trigger1 = time = 0
v = 1
value = (var(4)=14)

[State 1060, 0]  ; this second
type = VarSet
trigger1 = time = 0
var(4) = (var(4)+1)%15

[State 1060, 1]
type = NotHitBy
trigger1 = anim = 1060
trigger1 = AnimElem = 2, >= 0
trigger1 = var(1) = 1
value = SCA    ; invincible
ignorehitpause = 1

[State 1060, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 2, >= 0
trigger1 = palno != 11
add = 256, 256, 256   ; blink white
time = 2
ignorehitpause = 1

[State 1060, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 2, >= 0
trigger1 = palno = 11
add = 256, -256, 256   ; blink purple
time = 2
ignorehitpause = 1

[State 1060, 1]
type = ChangeState
trigger1 = AnimElem = 3
value = 1061

[State 1060, 3]
type = PlaySnd
trigger1 = AnimElem = 2, =-1
value = 1060,0  ; Kouryuuken
channel = 0

[State 1060, 3]
type = PlaySnd
trigger1 = AnimElem = 2, =-1
value = 0, 220 

[State 1060, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
animtype = back 
damage = 65,3
priority = 5
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -10, -60
hitsound = 5, 4
guardsound = 6,0
ground.velocity = -2, -7
ground.hittime = 20
air.velocity = -2, -6.5
fall = 1
fall.recovertime = 46
fall.damage = 10

; light kouryuuken (going up)
[Statedef 1061]
type = A
movetype = A
physics = A
velset = 0, -5
movehitpersist = 1

[State 1061, 1]
type = NotHitBy
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
value = SCA
ignorehitpause = 1

[State 1061, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
trigger1 = palno != 11
add = 256, 256, 256
time = 2
ignorehitpause = 1

[State 1061, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
trigger1 = palno = 11
add = 256, -256, 256
time = 2
ignorehitpause = 1

[State 1061, 2]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 1061, 2]
type = HitDef
trigger1 = time = 0
trigger1 = MoveContact = 0
attr = S, SA
animtype = back 
damage = 65,3
priority = 5
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -4,-55;-10, -80
hitsound = 5, 4
guardsound = 6,0
ground.velocity = -2, -7
ground.hittime = 20
air.velocity = -2, -6.5
fall = 1
fall.recovertime = 46
fall.damage = 10

; all kouryuukens (coming down)
[Statedef 1062]
type = A
velset = 0
anim = 1061

[State 1062, 1]
type = ChangeState
trigger1 = Pos Y >= -5
value = 1063

[State 1062, 3] ; gravity
type = Gravity
trigger1 = Pos Y < -5

[State 1062, 4]
type = VelSet
trigger1 = Pos Y >= -5
y = 0
x = 0

[State 1062, 5]
type = PosSet
trigger1 = Pos Y >= -5
y = 0

; kouryuuken land
[Statedef 1063]
type = S
physics = S
ctrl = 0
anim = 1062

[State 1063, 1]
type = VelSet
trigger1 = time = 0
y = 0

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

[State 1063, 2]
type = PlaySnd
trigger1 = time = 0
value = 0,52

[State 1063, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; med kouryuuken (start)
[Statedef 1070]
type = S
physics = S
movetype = A
ctrl = 0
poweradd = 45
velset = 0,0 
anim = 1060
juggle = 4

[State 1070, 0]  ; this first
type = VarSet
trigger1 = time = 0
v = 1
value = (var(4)=14)

[State 1070, 0]  ; this second
type = VarSet
trigger1 = time = 0
var(4) = (var(4)+1)%15

[State 1070, 1]
type = NotHitBy
trigger1 = anim = 1060
trigger1 = AnimElem = 2, >= 0
trigger1 = var(1) = 1
value = SCA    ; invincible
ignorehitpause = 1

[State 1070, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 2, >= 0
trigger1 = palno != 11
add = 256, 256, 256   ; blink white
time = 2
ignorehitpause = 1

[State 1070, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 2, >= 0
trigger1 = palno = 11
add = 256, -256, 256   ; blink purple
time = 2
ignorehitpause = 1

[State 1070, 1]
type = ChangeState
trigger1 = AnimElem = 3
value = 1071

[State 1070, 5]
type = PlaySnd
trigger1 = animelem = 2, =-1
value = 1060,1  ; Kouryuuken
channel = 0

[State 1070, 3]
type = PlaySnd
trigger1 = AnimElem = 2, =-2
value = 0, 220

[State 1070, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
animtype = back 
damage = 75,1
priority = 5
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -10, -60
hitsound = 5, 4
guardsound = 6,0
ground.velocity = -2, -7
ground.hittime = 20
air.velocity = -2, -6.5
fall = 1
fall.recovertime = 46
fall.damage = 11

; med kouryuuken (going up)
[Statedef 1071]
type = A
movetype = A
movehitpersist = 1
velset = 2, -6

[State 1071, 1]
type = NotHitBy
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
value = SCA
ignorehitpause = 1

[State 1071, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
trigger1 = palno != 11
add = 256, 256, 256
time = 2
ignorehitpause = 1

[State 1071, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
trigger1 = palno = 11
add = 256, -256, 256
time = 2
ignorehitpause = 1

[State 1071, 3]
type = Gravity
trigger1 = Pos Y < -5

[State 1071, 4]
type = VelMul
trigger1 = time >= 0
x = .93

[State 1071, 2]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 1071, 2]
type = HitDef
trigger1 = time = 0
trigger1 = MoveHit = 0
attr = S, SA
animtype = back 
damage = 75,1
priority = 5
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -4,-55;-10, -80
hitsound = 5, 4
guardsound = 6,0
ground.velocity = -2, -7
ground.hittime = 20
air.velocity = -2, -6.5
fall = 1
fall.recovertime = 46
fall.damage = 11

; heavy kouryuuken (start)
[Statedef 1080]
type = S
movetype = A
physics = S
ctrl = 0
poweradd = 60
velset = 0,0 
anim = 1060
juggle = 4

[State 1080, 0]  ; this first
type = VarSet
trigger1 = time = 0
v = 1
value = (var(4)=14)

[State 1080, 0]  ; this second
type = VarSet
trigger1 = time = 0
var(4) = (var(4)+1)%15

[State 1080, 1]
type = NotHitBy
trigger1 = AnimElem = 2, >= 0
trigger1 = anim = 1060
trigger1 = var(1) = 1
value = SCA    ; invincible
ignorehitpause = 1

[State 1080, 2]
type = PalFX
trigger1 = var(1) = 1
trigger1 = anim = 1060
trigger1 = AnimElem = 2, >= 0
trigger1 = palno != 11
add = 256, 256, 256   ; blink white
time = 2
ignorehitpause = 1

[State 1080, 2]
type = PalFX
trigger1 = var(1) = 1
trigger1 = anim = 1060
trigger1 = AnimElem = 2, >= 0
trigger1 = palno = 11
add = 256, -256, 256   ; blink purple
time = 2
ignorehitpause = 1

[State 1080, 1]
type = ChangeState
trigger1 = AnimElem = 3
value = 1081

[State 1080, 3]
type = PlaySnd
trigger1 = AnimElem = 2, =-2
value = 0, 220

[State 1080, 3]
type = PlaySnd
trigger1 = AnimElem = 2, =-1
value = 1060,2  ; Doryaa!
channel = 0

[State 1080, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
animtype = back 
damage = 40,1
priority = 5
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -10, -60
hitsound = 5, 4
guardsound = 6,0
ground.velocity = -3, -7
ground.hittime = 20
air.velocity = -3, -6.5
fall = 1
fall.recovertime = 46
fall.damage = 12

; heavy kouryuuken (going up)
[Statedef 1081]
type = A
movetype = A
velset = 4, -8

[State 1081, 1]
type = NotHitBy
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
value = SCA
ignorehitpause = 1

[State 1081, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
trigger1 = palno != 11
add = 256, 256, 256
time = 2
ignorehitpause = 1

[State 1081, 2]
type = PalFX
trigger1 = anim = 1060
trigger1 = var(1) = 1
trigger1 = AnimElem = 1, <= 3
trigger1 = palno = 11
add = 256, -256, 256
time = 2
ignorehitpause = 1

[State 1081, 3]
type = Gravity
trigger1 = Pos Y < -5

[State 1081, 4]
type = VelMul
trigger1 = time >= 0
x = .93

[State 1081, 2]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 1081, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
animtype = back 
damage = 40,1
priority = 5
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -4,-55;-5, -96
hitsound = 5, 4
guardsound = 6,0
ground.velocity = -2, -7
ground.hittime = 20
air.velocity = -2, -6.5
fall = 1
fall.recovertime = 56
fall.damage = 12

; light Premium Sign
[Statedef 1100]
type = S
movetype = A
physics = S
ctrl = 0
anim = 1100
poweradd = 60
juggle = 0

[State 1100, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 1100, 0]
type = VarSet
trigger1 = time = 0
v = 13
value = 0

[State 1100, 0]
type = VarSet
trigger1 = MoveHit = 1
persistent = 0
v = 1
value = 1

; Trigger only if we hit and won by KO in the same frame
; (as good as it's gonna get, folks)
[State 1100, 0]
type = VarSet
trigger1 = var(1) = 1
trigger1 = winko = 1
trigger1 = var(3) < 3
v = 6
value = 3

[State 1100, 0]
type = VarSet
trigger1 = 1
var(3)=roundstate

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

[State 1100, 1] ;Poke - ARRR1, added
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
animtype = light
damage = 4
priority = 8
hitflag = MAF
guardflag = HA
pausetime = 2,2
sparkxy = -5, -85
hitsound = 5, 0
guardsound = 6,0
ground.velocity = -1, -4
ground.hittime = 10
air.velocity = -1, -3
guard.dist = 90

[State 1100, 1] ; disable guarding
type = AttackDist
trigger1 = AnimElem = 7
trigger2 = AnimElem = 10
value = 0

[State 1100, 2] ;Poke2
type = HitDef
trigger1 = AnimElem = 9
attr = A, SA
animtype = light
damage = 4
priority = 8
hitflag = MAF
guardflag = HA
pausetime = 2,2
sparkxy = -5, -85
hitsound = 5, 0
guardsound = 6,0
ground.velocity = 1, -4
ground.hittime = 10
air.velocity = 1, -3
guard.dist = 40

[State 1100, 1]
type = helper
trigger1 = AnimElem = 1
helpertype = normal
id = 1100
pos = -1, -66
postype = p1
stateno = 1104
keyctrl = 0
ownpal = 0
name = "Dan's autograph"
size.shadowoffset = 0

[State 1100, 1]
type = VarAdd
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
trigger7 = animelem = 8
trigger8 = animelem = 9
trigger9 = animelem = 10
trigger10 = animelem = 11
v = 13
value = 1

[State 1100, 2]
type = PlaySnd
trigger1 = AnimElem = 5  
value = 1100, 0    ; dou da?
channel = 0

[State 1100, 3]
type = PlaySnd
trigger1 = AnimElem = 10, =5
value = 1100, 1    ; daiji ni shiro yo!
channel = 0

[State 1100, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1100, 5]
type = width
trigger1 = AnimElem = 11, > 0
value = 20   ; wider in front

; Premium Sign projectile -- idle before throw
[Statedef 1104]
type = A
movetype = I
physics = N
velset = 0,0
anim = 7999   ; null

[State 1104, 0]
type = BindToRoot
trigger1 = root, var(13) = 1
trigger1 = root, stateno = [1100,1120]
time = 1
pos = -1, -66
facing = 1

[State 1104, 1]
type = BindToRoot
trigger1 = root, var(13) = 2
trigger1 = root, stateno = [1100,1120]
time = 1
pos = 16, -73
facing = 1

[State 1104, 2]
type = BindToRoot
trigger1 = root, var(13) = 3
trigger1 = root, stateno = [1100,1120]
time = 1
pos = 17, -67
facing = 1

[State 1104, 3]
type = BindToRoot
triggerall = root, stateno = [1100,1120]
trigger1 = root, var(13) = 4
trigger2 = root, var(13) = 6
time = 1
pos = 27, -71
facing = 1

[State 1104, 4]
type = BindToRoot
trigger1 = root, var(13) = 5
trigger1 = root, stateno = [1100,1120]
time = 1
pos = 57, -81
facing = 1

[State 1104, 5]
type = BindToRoot
trigger1 = root, var(13) = 7
trigger1 = root, stateno = [1100,1120]
time = 1
pos = 6, -61
facing = 1

[State 1104, 6]
type = BindToRoot
trigger1 = root, var(13) = 8
trigger1 = root, stateno = [1100,1120]
time = 1
pos = -30, -97
facing = 1

[State 1104, 7]
type = BindToRoot
trigger1 = root, var(13) = 9
trigger1 = root, stateno = [1100,1120]
time = 1
pos = -4, -57
facing = 1

[State 1104, 8]
type = ChangeState
trigger1 = root, var(13) = 10
trigger1 = ishelper(1100)
value = 1105

[State 1104, 8]
type = ChangeState
trigger1 = root, var(13) = 10
trigger1 = ishelper(1110)
value = 1115

[State 1104, 8]
type = ChangeState
trigger1 = root, var(13) = 10
trigger1 = ishelper(1120)
value = 1125

[State 1104, 9]
type = ChangeState
triggerall = root, var(13) != 0
trigger1 = root, stateno < 1100
trigger2 = root, stateno > 1120
value = 1107

; Light Premium Sign projectile 
[Statedef 1105]
type = A
movetype = A
physics = N
velset = 2, 0
anim = 1125

[State 1105, 0]
type = BindToRoot
trigger1 = time = 0
time = 1
pos = 72, -72
facing = 1

[State 1105, 0]
type = NotHitBy
trigger1 = 1
value = , AT    ; not necessary, but oh well

[State 1105, 1]
type = HitOverride
trigger1 = time = 0
time = -1
stateno = 1107
slot = 0
attr = SCA,AA,AP ;, AP

[State 1105, 1]
type = ChangeState
trigger1 = Pos Y >= 0
value = 1106

[State 1105, 2]
type = VelAdd
trigger1 = time > 0
y = .1

[State 1105, 3]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage = 40,2
getpower = 0
hitflag = MAFD
guardflag = MA
pausetime = 0, 9
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -3
air.velocity = -2.5, -4
air.juggle = 1
guard.dist = 90
down.velocity = -3,0
priority = 1,Hit

[State 1105, 3]
type = VarSet
trigger1 = 1
var(3) = roundstate

[State 1105, 4]
type = ChangeState
trigger1 = movecontact = 1
value = 1107

; Autograph hits ground -- remove
[Statedef 1106]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0

[State 1106, 0]
type = ChangeAnim
trigger1 = (anim = 1127 && time = 8) || (anim = 1125 && time = 12)
persistent = 0
value = 1106

[State 1106, 0]
type = DestroySelf
trigger1 = anim = 1106 && !AnimTime

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

; hit animation
; var(3) = last value of roundstate (if needed)
[Statedef 1107]
type = A
movetype = I
physics = N
anim = 1126
velset = 0, -2.5
movehitpersist = 1

[State 1107, 0]
type = VelAdd
trigger1 = time > 0
y = .1

[State 1107, 1]
type = DestroySelf
trigger1 = Vel Y > 3
trigger2 = Pos Y > 0 

[State 1107, 1]
type = ParentVarSet
trigger1 = time = 1
trigger1 = winko = 1
trigger1 = movecontact = 1
trigger1 = var(3) = 2
v = 12
value = ifelse(ishelper(1100),1,ifelse(ishelper(1110),2,3))

; medium Premium Sign
[Statedef 1110]
type = S
movetype = A
physics = S
ctrl = 0
anim = 1110
poweradd = 80
juggle = 0

[State 1110, 0]
type = AttackDist
trigger1 = !time
value = 0

[State 1110, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 1110, 0]
type = VarSet
trigger1 = time = 0
v = 13
value = 0

[State 1110, 0]
type = VarSet
trigger1 = MoveHit = 1
persistent = 0
v = 1
value = 1

[State 1110, 0]
type = VarSet
trigger1 = var(1) = 1
trigger1 = winko = 1
trigger1 = var(3) < 3
v = 6
value = 4

[State 1110, 0]
type = VarSet
trigger1 = 1
var(3)=roundstate

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

[State 1110, 1] ;Poke
type = HitDef
trigger1 = AnimElem = 12
attr = A, SA
animtype = light
damage = 4
priority = 8
hitflag = MAF
guardflag = HA
pausetime = 2,2
sparkxy = -5, -85
hitsound = 5, 0
guardsound = 6,0
ground.velocity = -1, -4
ground.hittime = 10
air.velocity = -1, -3
guard.dist = 90

[State 1110, 2]
type = AttackDist
trigger1 = AnimElem = 13
trigger2 = AnimElem = 16
value = 0

[State 1110, 1] ;Poke2
type = HitDef
trigger1 = AnimElem = 15
attr = A, SA
animtype = light
damage = 4
priority = 8
hitflag = MAF
guardflag = HA
pausetime = 2,2
sparkxy = -5, -85
hitsound = 5, 0
guardsound = 6,0
ground.velocity = 1, -4
ground.hittime = 10
air.velocity = 1, -3
guard.dist = 40

[State 1110, 1]
type = helper
trigger1 = AnimElem = 1;17
helpertype = normal
id = 1110
pos = -1, -66
postype = p1
stateno = 1104
keyctrl = 0
name = "Dan's autograph"
ownpal = 0
size.shadowoffset = 0

[State 1110, 1]
type = VarAdd
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 11
trigger5 = animelem = 12
trigger6 = animelem = 13
trigger7 = animelem = 14
trigger8 = animelem = 15
trigger9 = animelem = 16
trigger10 = animelem = 17
v = 13
value = 1

[State 1110, 2]
type = PlaySnd
trigger1 = AnimElem = 11
value = 1100, 0   ; dou da?
channel = 0

[State 1110, 3]
type = PlaySnd
trigger1 = AnimElem = 16, =5
value = 1100, 1   ; daiji ni shiro yo!
channel = 0

[State 1110, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1110, 5]
type = width
trigger1 = AnimElem = 17, > 0
value = 20   ; wider in front

; Medium Premium Sign projectile 
[Statedef 1115]
type = A
movetype = A
physics = N
velset = 4, 0 
anim = 1127

[State 1115, 3]
type = VarSet
trigger1 = 1
var(3) = roundstate

[State 1115, 0]
type = BindToRoot
trigger1 = time = 0
time = 1
pos = 72, -72
facing = 1

[State 1115, 0]
type = NotHitBy
trigger1 = time >= 0
value = , AT

[State 1115, 1]
type = HitOverride
trigger1 = time = 0
time = -1
stateno = 1107
slot = 0
attr = SCA, AA,AP;, AP

[State 1115, 3]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage = 40,2
getpower = 0
hitflag = MAFD
guardflag = MA
pausetime = 0, 9
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -3
air.velocity = -2.5, -4
air.juggle = 1
guard.dist = 90
priority = 1,Hit

[State 1115, 4]
type = ChangeState
trigger1 = movecontact = 1
value = 1107

[State 1115, 4]
type = ChangeState
trigger1 = Pos Y >= 0
value = 1106

[State 1115, 6]
type = DestroySelf
trigger1 = Pos X >= 180
trigger2 = Pos X <= -180

[State 1115, 7]
type = VelAdd
trigger1 = time >= 30
trigger1 = Vel Y < .5
y = .07

[State 1115, 7]
type = VelMul
trigger1 = time >= 30
trigger1 = Vel X >= 3.5
x = .99

; hard Premium Sign
[Statedef 1120]
type = S
movetype = A
physics = S
ctrl = 0
anim = 1120
poweradd = 100
juggle = 0

[State 1120, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 1120, 0]
type = VarSet
trigger1 = time = 0
v = 13
value = 0

[State 1120, 0]
type = VarSet
trigger1 = MoveHit = 1
persistent = 0
v = 1
value = 1

[State 1120, 0]
type = VarSet
trigger1 = var(1) = 1
trigger1 = winko = 1
trigger1 = var(3) < 3
v = 6
value = 5

[State 1120, 0]
type = VarSet
trigger1 = 1
var(3)=roundstate

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

[State 1120, 1] ;Poke - ARRR1, added
type = HitDef
trigger1 = AnimElem = 20
attr = A, SA
animtype = light
id = 1120
nochainid=1120
damage = 4
priority = 8
hitflag = MAF
guardflag = HA
pausetime = 2,2
sparkxy = -5, -85
hitsound = 5, 0
guardsound = 6,0
ground.velocity = -1, -4
ground.hittime = 10
air.velocity = -1, -3
guard.dist = 90

[State 1120, 2]
type = AttackDist
trigger1 = AnimElem = 21
trigger2 = AnimElem = 24
value = 0

[State 1120, 1] ;Poke2
type = HitDef
trigger1 = AnimElem = 23
attr = A, SA
animtype = light
id = 1120
nochainid=1120
damage = 4
priority = 8
hitflag = MAF
guardflag = HA
pausetime = 2,2
sparkxy = -5, -85
hitsound = 5, 0
guardsound = 6,0
ground.velocity = 1, -4
ground.hittime = 10
air.velocity = 1, -3
guard.dist = 40

[State 1120, 1]
type = helper
trigger1 = AnimElem = 1;25
helpertype = normal
id = 1120
pos = -1, -66
postype = p1
stateno = 1104
keyctrl = 0
name = "Dan's autograph"
ownpal = 0
size.shadowoffset = 0

[State 1120, 1]
type = VarAdd
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 19
trigger5 = animelem = 20
trigger6 = animelem = 21
trigger7 = animelem = 22
trigger8 = animelem = 23
trigger9 = animelem = 24
trigger10 = animelem = 25
v = 13
value = 1

[State 1120, 2]
type = PlaySnd
trigger1 = AnimElem = 19
value = 1100, 0   ; dou da?
channel = 0

[State 1120, 3]
type = PlaySnd
trigger1 = AnimElem = 24, =5
value = 1100, 1   ; daiji ni shiro yo!
channel = 0

[State 1120, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 1120, 5]
type = width
trigger1 = AnimElem = 25, > 0
value = 20   ; wider in front

; Heavy Premium Sign projectile 
[Statedef 1125]
type = A
movetype = A
physics = N
velset = 3, 2.7
anim = 1128

[State 1105, 3]
type = VarSet
trigger1 = 1
var(3) = roundstate

[State 1125, 0]
type = BindToRoot
trigger1 = time = 0
time = 1
pos = 72, -72
facing = 1

[State 1125, 0]
type = NotHitBy
trigger1 = time >= 0
value = , AT

[State 1125, 1]
type = HitOverride
trigger1 = time = 0
time = -1
stateno = 1107
slot = 0
attr = SCA, AA,AP;, AP

[State 1125, 2]
type = VelAdd
trigger1 = time > 0
y = -.2

[State 1125, 3]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage = 40,2
getpower = 0
hitflag = MAFD
guardflag = MA
pausetime = 0, 9
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -3
air.velocity = -2.5, -4
air.juggle = 1
guard.dist = 90
priority = 1,Hit

[State 1125, 4]
type = ChangeState
trigger1 = movecontact = 1
value = 1107

[State 1125, 5]
type = DestroySelf
trigger1 = Pos X >= 180
trigger2 = Pos X <= -180
trigger3 = Pos Y <= -260

; Otoko Michibiki
[Statedef 1200]
type = S
movetype = A
physics = S
ctrl = 0
anim = 1205
velset = 0,0
poweradd = 20

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

[State 1200, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 900, 0   ; throw miss
channel = 0

[State 1200, 3]
type = HitDef
trigger1 = AnimElem = 2
trigger1 = P2BodyDist X < 25
trigger1 = Vel X < 4
attr = S, NT
getpower  = 40
givepower = 30
hitflag = M-
forcestand = 1
id = 1200
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
sparkxy = -25, -70
sparkno = -1
p2facing = 1
p1stateno = 1205
p2stateno = 1220
hitsound = 6,0
numhits = 0
fall = 1

[State 1200, 4]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Otoko Michibiki success
[Statedef 1205]
type = S
movetype = A
physics = S

[State 1205, 0]
type = TargetDrop
trigger1 = !time
excludeID=1200
keepone = 1

[State 1205, 0]
type = VarSet
trigger1 = 1 || (var(1):=0)
trigger1 = numtarget(1200)
var(1) = target(1200),stateno = [1220,1222]

[State 1205, 0]
type = TargetBind
trigger1 = var(1)
time = 1
pos = 44,0

[State 1205, 0]
type = Width
trigger1 = 1
edge = 29  

[State 1205, 0]
type = ChangeState
trigger1 = anim = 1205 
trigger1 = AnimElem = 4
value = 1206

; Otoko Michibiki indoctrination
[Statedef 1206]
type = S
movetype = A
physics = S
anim = 1200

[State 1206, 0]
type = VarSet
trigger1 = !time
var(9) = var(19):= 0

[State 1206, 0]
type = VarSet
trigger1 = !time
var(18) = 56

[State 1206, 1]
type = ChangeAnim
trigger1 = AnimElemTime(AnimElemNo(0)) = 8-var(9)
value = 1200
elem = AnimElemNo(0)%4+1

[State 1206, 0]
type = ChangeAnim
trigger1 = !animtime
value = 1200

[State 1206, 0]
type = AfterImage
trigger1 = AnimElem = 1
trigger1 = var(9) > 2
length = 4
PalBright   =   0,  0,  0
PalContrast = 128,128,128
PalAdd      = -10,-10,-10
PalMul      = .75,.75,.75
TimeGap  = 8-var(9)
FrameGap = 1
Time = 24-3*var(9)
Trans = Add

[State 1206, 0]
type = PalFX
trigger1 = command = "anybutton"
trigger1 = ((var(3):=var(3)+1)*2)%3
add = 48,48,48
time = 3

[State 1205, 0]
type = Width
trigger1 = 1
edge = 29  

[State 1206, 0]
type = VarSet
trigger1 = 1 || (var(1):=0)
trigger1 = numtarget(1200)
var(1) = target(1200),stateno = [1220,1222]

[State 1206, 0]
type = PlaySnd
trigger1 = AnimElem = 2
value = 197,13   ; Saikyou!
;channel = 0    Dan's patented multi-voice technology

[State 1206, 0]
type = TargetBind
trigger1 = var(1)
time = 1
pos = 44,0

[State 1206, 2]
type = MoveHitReset
trigger1 = AnimElem = 3

[State 1206, 3]
type = VarSet
trigger1 = AnimElem = 3
var(9) = var(3)*2/3

[State 1206, 3]
type = VarSet
trigger1 = var(9) > 4
var(9) = 4

[State 1206, 0]
type = VarAdd
trigger1 = AnimElem = 3, = 1
trigger1 = movehit
var(18) = 6

[State 1206, 0]
type = VarAdd
trigger1 = time%2
var(18) = -1

; note: player 1 can lock out player 2 by jamming fast enough? (MUGEN bug)
[State 1206, 0]
type = VarAdd
trigger1 = numtarget(1200)
trigger1 = var(19):=var(19)+target(1200),command = "anybutton"
var(18) = ifelse(var(19)%3,0,-1)

[State 1206, 1]
type = TargetState
trigger1 = numtarget(1200)
trigger1 = var(18) > 0
trigger1 = !(var(19)%3)
trigger1 = target(1200),command="anybutton"
trigger1 = target(1200),stateno=[1221,1222]
trigger1 = target,time>0
value = 1222

[State 1206, 2]
type = TargetState
trigger1 = AnimElem = 3, =1
trigger1 = numtarget(1200)
trigger1 = var(18) <= 0 
persistent = 0
value = 1223

[State 1206, 2]
type = HitDef
trigger1 = AnimElem = 3
trigger1 = var(18) > 0
trigger1 = numtarget(1200)
trigger1 = target(1200),stateno = [1220,1222]
attr = S,NT
hitflags = H
guardflags = N
getpower = 30
givepower = 12
chainID = 1200
id = 1200
damage = ifelse((hitcount=[3,11]),20-hitcount,ifelse(hitcount<3,18,9))
p2stateno = 1221
pausetime = 0,0
ground.hittime = 0
animtype = hard
ground.type = low
hitsound = 5,2
sparkxy = 3,-75
fall.recovertime = var(9) 

[State 1206, 0]
type = VarSet
trigger1 = AnimElem = 3
trigger1 = time > 17
var(3) = 0

[State 1206, 3]
type = HitDef
trigger1 = AnimElem = 3, = 1
ground.type = none

[State 1206, 2]
type = TargetState
trigger1 = numtarget(1200)
trigger1 = target(1200),stateno = 1219
trigger1 = AnimElem = 3
value = 1223

[State 1206, 1]
type = ChangeState
trigger1 = AnimElemNo(0) = 4 && (!movehit || !var(1))
value = 1210
ctrl = 0

; Recover from Otoko Michibiki
[Statedef 1210]
type = S
movetype = I
physics = S
velset = 0,0
anim = 1210

[State 1210, 0]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1

; Hit by Otoko Michibiki (tech hit)
[Statedef 1219]
type = S
movetype = H
physics = S

[State 1219, 0]
type = Width
trigger1 = 1
edge = 5-Const(size.ground.front),5-Const(size.ground.back)

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

[State 1219, 0]
type = SelfState
trigger1 = !animtime
value = 0
ctrl = 1

[State 1219, 0]
type = PalFX
trigger1 = time < 3
time = 1
add = -32,64,-32

; Hit by Otoko Michibiki
[Statedef 1220]
type = S
movetype = H
physics = S

[State 1220, 0]
type = Width
trigger1 = 1
edge = 5-Const(size.ground.front),5-Const(size.ground.back)

[State 1220, 0]
type = ChangeAnim2
trigger1 = !time
value = 1220

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

[State 1220, 0]
type = SelfState
trigger1 = !animtime
value = 0
ctrl = 1

[State 1220, 0]
type = ChangeState
trigger1 = time < 3
trigger1 = command = "recovery"
value = 1219

; Otoko Michibiki -- bashed
[Statedef 1221]
type = S
movetype = H
physics = S
velset = 0,0

[State 1220, 0]
type = Width
trigger1 = 1
edge = 5-Const(size.ground.front),5-Const(size.ground.back)

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

[State 1221, 0]
type = ChangeAnim2
trigger1 = !time
value = 1221

[State 1221, 1]
type = ChangeAnim2
trigger1 = (AnimElemTime(AnimElemNo(0)) + (AnimElemNo(0)=1)) = (8-GetHitVar(fall.recovertime))
value = 1221
elem = AnimElemNo(0)+1

[State 1221, 0]
type = SelfState
trigger1 = animtime = 0
value = 0
ctrl = 1

; die
[State 1221, 2]
type = ChangeState
trigger1 = !life
value = 1223

; Otoko Michibiki -- bashed and flashing
[Statedef 1222]
type = S
movetype = H
physics = S
velset = 0,0

[State 1222, 0]
type = PalFX
trigger1 = !time
add = 48,48,48
time = 3

[State 1222, 0]
type = Width
trigger1 = 1
edge = 5-Const(size.ground.front),5-Const(size.ground.back)

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

[State 1222, 1]
type = ChangeAnim2
trigger1 = (AnimElemTime(AnimElemNo(0)) + (AnimElemNo(0)=1)) = (8-GetHitVar(fall.recovertime))
value = 1221
elem = AnimElemNo(0)+1

[State 1222, 0]
type = SelfState
trigger1 = animtime = 0
value = 0
ctrl = 1

; die
[State 1222, 2]
type = ChangeState
trigger1 = !life
value = 1222

; Released by Otoko Michibiki
[Statedef 1223]
type = A
movetype = I
physics = A
velset = -3, -6
anim = ifelse(life || !SelfAnimExist(5052),ifelse(SelfAnimExist(5035),5035,5050),5052)

[State 1223, 2]
type = SelfState
trigger1 = prevstateno != 1219
value = 5035

[State 1223, 3]
type = VelSet
trigger1 = !time
y = -2.2

[State 1223, 3]
type = SelfState
trigger1 = time = 3
value = 5210

; Zero Counter
[Statedef 2000]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2000
velset = 0, 0
poweradd = -1000

[State 2000, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 2000, 0]
type = PlaySnd
trigger1 = !time
value = 0,2000

[State 2000,0]
type = SprPriority
trigger1 = !time
value = 2

[State 2000,1]
type = helper
trigger1 = time = 2
stateno = 2001
ownpal = 1
keyctrl = 0
helpertype = normal
pos = 30, floor(pos y - ScreenPos y)
postype = p1 
bindtime = 1
pausemovetime = 999
size.xscale = 1

[State 2000, 0]
type = EnvColor
trigger1 = !time
value = 255,255,255 
time = 2

[State 2000,0]
type = Pause
trigger1 = !time
time = 25 ; 15
movetime = 25 ; 15

[State 2000, 1]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 2000, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2000, 0     ; Zakeru na!
channel = 0

[State 2000, 2]
type = NotHitBy
trigger1 = time <= 32
value = SCA

[State 2000, 3]
type = HitDef
trigger1 = time = 32
hitflag = MA
attr = S,SA
guardflag = N
guard.dist = 0
damage = 55,0
sparkxy = 16,-82
p2stateno = 2010
priority = 8, hit
pausetime = 0,4
hitsound = 5,3
hitonce = 1

[State 2000, 3]
type = HitDef
trigger1 = time = 33
ground.type = none

[State 2000, 4]
type = Explod
trigger1 = movehit
persistent = 0
postype = p2
bindtime = -1
removetime = floor(0.5+14.0/target,Const(movement.yaccel))
ownpal = 1
pos = 0,-40
anim = 2011
sprpriority = 5

; Hacky Zero Counter spark.
[Statedef 2001]
type = S
movetype = I
physics = N
anim = 7999

[State 2001, 0]
type = VarSet
trigger1 =!time
fvar(0)=pos x

[State 2001, 0]
type = PosSet
trigger1 = 1
x = fvar(0)
y = pos y - screenpos y

[State 2001, 0]
type = Explod
trigger1 = !time
anim = 7420
pos = 0,0
bindtime = -1
ownpal = 0
ontop = 1
pausemovetime = 999

[State 2001, 1]
type = PalFX
trigger1 = time >= 14 ;AnimElem = 8, >= 0
time = 2
add = 45-8*time,45-8*time,45-8*time

[State 2001, 2]
type = DestroySelf
trigger1 = time = 35

[Statedef 2010]
type = A
movetype = H
velset = -3.5,-7
physics = N
ctrl = 0

[State 2010, 0]
type = Gravity
trigger1 = 1

[State 2010, 0]
type = ChangeAnim2
trigger1 = !time
value = 2010

[State 2010, 1]
type = SelfState
trigger1 = Pos Y > 0
value = 5100

; Crouching Zero Counter
[Statedef 2020]
type = C
movetype = A
physics = C
ctrl = 0
anim = 2020
velset = 0, 0
poweradd = -1000

[State 2020, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 2020, 0]
type = PlaySnd
trigger1 = !time
value = 0,2000

[State 2020,0]
type = SprPriority
trigger1 = !time
value = 2

[State 2020,0]
type = SprPriority
trigger1 = animelem = 4
value = -1

[State 2000,0]
type = Pause
trigger1 = !time
time = 25
movetime = 25

[State 2000, 0]
type = EnvColor
trigger1 = !time
value = 255,255,255 
time = 2

[State 2000,1]
type = helper
trigger1 = time = 2
stateno = 2001
ownpal = 1
keyctrl = 0
helpertype = normal
pos = 30, floor(pos y - ScreenPos y)
postype = p1 
bindtime = 1
pausemovetime = 999
size.xscale = 1

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

[State 2020, 2]
type = PlaySnd
trigger1 = AnimElem = 5
value = 2000, 0     ; Zakeru na!
channel = 0

[State 2020, 2]
type = NotHitBy
trigger1 = time <= 39
value = SCA

[State 2020, 3]
type = HitDef
trigger1 = time = 39
hitflag = MA
attr = S,SA
guardflag = N
guard.dist = 0
damage = 55,0
sparkxy = 16,-22
p2stateno = 2010
priority = 8, hit
pausetime = 0,4
hitsound = 5,3
hitonce = 1

[State 2020, 3]
type = HitDef
trigger1 = time = 40
ground.type = none

[State 2020, 4]
type = Explod
trigger1 = movehit
persistent = 0
postype = p2
bindtime = -1
removetime = floor(0.5+14.0/target,Const(movement.yaccel))
ownpal = 1
pos = 0,-40
anim = 2011
sprpriority = 5


; Saikyou Zenten Hissatsu Waza
[Statedef 2100]
type = A
physics = N
movetype = I
anim = 2100
velset = 2.9,-5
poweradd = 60
juggle = 4
ctrl = 0

[State 2100, 0]
type = PlaySnd
trigger1 = AnimElem = 2
persistent = 0
value = 2100, 0    ; araa!
channel = 0

[State 2100, 1]
type = ChangeState
trigger1 = Pos Y > 0
value = 2101

[State 2100, 2]
type = Gravity
trigger1 = time > 0

[State 2100, 0]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[Statedef 2101]
type = C
physics = N
movetype = A
anim = 2101
velset = 0, 0

[State 2101, 0]
type = PlaySnd
trigger1 = time = 0
value = 0,52

[State 2101, 0]
type = VarSet
trigger1 = time = 0
v = 3
value = 0

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

[State 2101, 1]
type = VelSet
trigger1 = AnimElem = 2
persistent = 0
x = 4

[State 2101, 2]
type = HitDef
trigger1 = AnimElem = 2
persistent = 0
ID = 2101
attr = C, SA
hitflag = MAF
guardflag = L
damage   = 23 
animtype = Back
guardflag = MA
pausetime = 5,5
sparkxy =  0,-27
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime  = 17
p2facing = 1
p2stateno = 2110
down.bounce = 1
down.velocity = -3

[State 2101, 3]
type = ChangeState
trigger1 = moveguarded = 1
value = 2105

[State 2101, 4]
type = VarSet
trigger1 = movehit = 1
persistent = 0
v = 3
value = 1

[State 2101, 5]
type = PlayerPush
trigger1 = time > 0
value = 0

; give player some control over velocity
[State 2101, 6]
type = VelMul
trigger1 = AnimElem = 2, > 0
trigger1 = command = "holdfwd"
trigger1 = Vel X < 5.58
x = 1.075

[State 2101, 6]
type = VelMul
trigger1 = AnimElem = 2, < 0
trigger1 = command = "holdback"
trigger1 = Vel X > 2
x = .93

[State 2101, 6]
type = VelSet
trigger1 = Vel X > 6
x = 6

[State 2101, 6]
type = VelSet
trigger1 = Vel X < 2
x = 2

; hit on the bounce
[State 2101, 2]
type = HitDef
ID = 2103   ; can't be chained again
trigger1 = var(3) = 1
trigger1 = time%2  ;hakkkkkkkkk
chainID = 2101
attr = C, SA
hitflag = MAF
guardflag = 
damage   = 23 
animtype = Back
pausetime = 5,5
sparkxy =  0,-45
hitsound   = 5,2
guardsound = 6,0
p2stateno = 2111
down.velocity = -3
down.bounce = 1

; hit a second person
[State 2101, 3]
type = HitDef
ID = 2102
trigger1 = var(3) = 1
trigger1 = !(time%2)
nochainID = 2101, 2103
attr = C, SA
hitflag = MAF
guardflag = L
damage = 23
animtype = Back
guardflag = L
pausetime = 5,5
sparkxy =  0,-27
hitsound   = 5,2
guardsound = 6,0
p2facing = 1
p1stateno = 2103
p2stateno = 2110
down.bounce = 1
down.velocity = -3

[State 2101, 4]
type = ChangeState
trigger1 = frontedgedist = 0
trigger2 = time = 60
value = 2102

; Saikyou Zenten Hissatsu Waza (get up and taunt)
[Statedef 2102]
type = S
movetype = A
physics = S
velset = 0,0
anim = 2102
facep2 = 1

[State 2102, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 2102, 0]
type = PlaySnd
trigger1 = AnimElem = 3
value = 197, 13   ; Saikyou! ; 2100,2     ; Oh yeah!
channel = 0

[State 2102, 1]
type = Turn
trigger1 = AnimElem = 2, < 0
trigger1 = P2Dist X < 0

[State 2102, 1]
type = ChangeState
trigger1 = time = 80
value = var(3)
ctrl = !var(3)

; hit first person on the bounce
[State 2102, 2]
type = HitDef
ID = 2103   ; can't be chained again
trigger1 = time%2  ;hakkkkkkkkk
chainID = 2101
attr = C, SA
hitflag = MAF
guardflag = 
damage   = 23 
animtype = Back
pausetime = 5,5
sparkxy =  0,-45
hitsound   = 5,2
guardsound = 6,0
p2stateno = 2111
down.bounce = 1
down.velocity = -3

; hit the second person on the bounce
[State 2102, 3]
type = HitDef
ID = 2103
trigger1 = !(time%2)
chainID = 2102
attr = C, SA
hitflag = MAF
guardflag = 
damage   = 23 
animtype = Back
pausetime = 5,5
sparkxy =  0,-45
hitsound   = 5,2
guardsound = 6,0
p2stateno = 2111
down.bounce = 1
down.velocity = -3

[State 2102, 4] ; added
type = VarSet
triggerall = numhelper(3477)
triggerall = helper(3477),movetype!=H  ; not in hit state
triggerall = helper(3477),Vel Y >= -1
trigger1 = AnimElemNo(0) = 1
trigger1 = facing*(helper(3477),Pos X-Pos X) = [-2,9]
trigger1 = helper(3477),RootDist Y = [67,77];[69,75]
trigger2 = AnimElemNo(0) = 2
trigger2 = facing*(helper(3477),Pos X-Pos X) = [2,-9]
trigger2 = helper(3477),RootDist Y = [85,94];[86,92]
trigger3 = animelemno(0)=3
trigger3 = facing*(helper(3477),Pos X-Pos X) = [1,11]
trigger3 = helper(3477),RootDist Y = [89,97];[90,96]
trigger4 = animelemno(0)=4
trigger4 = facing*(helper(3477),Pos X-Pos X) = [8,18]
trigger4 = helper(3477),RootDist Y = [88,96];[89,95]
trigger5 = animelemno(0)>=5
trigger5 = facing*(helper(3477),Pos X-Pos X) = [15,26]
trigger5 = helper(3477),RootDist Y = [88,96];[89,95]
var(3) = 3491

[State 2102, 5]
type = VarSet
trigger1 = var(3)
var(15) = 1

; After hitting second person the first time
[Statedef 2103]
type = C
physics = N
movetype = A

[State 2103, 0]
type = VarSet
trigger1 = time = 0
v = 3
value = 0

; hit first person on the bounce
[State 2103, 2]
type = HitDef
ID = 2103   ; can't be chained again
trigger1 = time%2 ;hakkkkkkkkk
chainID = 2101
attr = C, SA
hitflag = MAF
guardflag = 
damage   = 23 
animtype = Back
pausetime = 5,5
sparkxy =  0,-45
hitsound   = 5,2
guardsound = 6,0
p2stateno = 2111
down.bounce = 1
down.velocity = -3

; hit the second person on the bounce
[State 2103, 3]
type = HitDef
ID = 2103
trigger1 = !(time%2)
chainID = 2102
attr = C, SA
hitflag = MAF
guardflag = 
damage   = 23 
animtype = Back
pausetime = 5,5
sparkxy =  0,-45
hitsound   = 5,2
guardsound = 6,0
p2stateno = 2111
down.bounce = 1
down.velocity = -3

[State 2103, 4]
type = ChangeState
trigger1 = frontedgedist = 0
trigger2 = time = 60
value = 2102

; give player some control over velocity
[State 2103, 6]
type = VelAdd
trigger1 = AnimElem = 2, > 0
trigger1 = command = "holdfwd"
trigger1 = Vel X < 4.4
x = .1

[State 2103, 6]
type = VelAdd
trigger1 = AnimElem = 2, < 0
trigger1 = command = "holdback"
trigger1 = Vel X > 2.9
x = -.1

[State 2103, 5]
type = PlayerPush
trigger1 = time >= 0
value = 0

; Saikyou Zenten Hissatsu Waza (blocked)
[Statedef 2105]
type = A
movetype = H
physics = N
velset = -3.5, -8.8
anim = 7604

[State 2105, 0]
type = Gravity
trigger1 = time > 0

[State 2105, 1]
type = PlaySnd
trigger1 = time = 5
value = 2100, 1    ; maketa ssu.
channel = 0

[State 2105, 2]
type = ChangeAnim
trigger1 = Vel Y > -.5
persistent = 0
value = 5061

[State 2105, 2]
type = PosAdd
trigger1 = Vel Y > -.5
y = 40
persistent = 0

[State 2105, 3]
type = LifeAdd
trigger1 = !time
value = -10

[State 2105, 3]
type = LifeAdd
trigger1 = Pos Y > 0
trigger1 = Vel Y > 0
value = -30

[State 2105, 3]
type = ChangeState
trigger1 = Pos Y > 0
trigger1 = Vel Y > 0
value = 5100

[State 2105, 4]
type = ChangeState
trigger1 = command = "recovery"
trigger1 = time = [0,5] 
value = 2106

; Recovering out of blocked Saikyou Zenten Hissatsu Waza
[Statedef 2106]
type = A
movetype = I
physics = N

[State 2106, 0]
type = Gravity
trigger1 = statetype = A

[State 2106, 0]
type = PalFX
trigger1 = !time
add = 255,255,255
time = 6

[State 2106, 1]
type = PlaySnd
trigger1 = !time
value = 7610, 0   ; araraa?
;value = 195, 3  ; Hyahuui!

[State 2106, 0]
type = ChangeState
trigger1 = Pos Y > 0
value = 2107

[Statedef 2107]
type = C
movetype = I
physics = N

[State 2107, 0]
type = VelSet
trigger1 = !time
y = 0

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

[State 2107, 1]
type = ChangeState
trigger1 = time >= 10
trigger1 = animelem = 4, = 2
value = 2108

[Statedef 2108]
type = C
movetype = I
physics = N
velset = 0,0
anim = 7607

[State 2108, 0]
type = PlaySnd
trigger1 = AnimElem = 3
persistent = 0
value = 197, 6;   Ora!!!
channel = 0

[State 2108, 0]
type = ChangeState
trigger1 = time = 60
value = 11
ctrl = 1

; Hit by Saikyou Zenten Hissatsu Waza
[Statedef 2110]
type = A
movetype = H
physics = N
facep2 = 1
ctrl = 0

[State 2110, 0]
type = VelSet
trigger1 = time = 0
x = -6
y = -9

[State 2110, 0]
type = VelMul  ; hakk
trigger1 = time < 2
trigger1 = Vel X > 0
x = -1

[State 2110, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 2110

[State 2110, 0]
type = ChangeAnim2
trigger1 = backedgebodydist = 0
trigger1 = Vel Y < 4
persistent = 0
value = 2112

[State 2110, 0]
type = PosFreeze
trigger1 = anim = 2112
trigger1 = animtime

[State 2110, 0]
type = VelAdd
trigger1 = anim = 2112
y = -const(movement.yaccel)

[State 2110, 0]
type = VelMul
trigger1 = anim = 2112
persistent = 0
x = -.9

[State 2110, 2]
type = PlaySnd
trigger1 = anim=2112
persistent = 0
value = F7, 0    ; bounce sound

[State 2110, 2]
type = Explod
trigger1 = anim = 2112
persistent = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 2110, 1]
type = Turn
trigger1 = anim = 2112
trigger1 = !animtime

[State 2110, 1]
type = ChangeAnim2
trigger1 = anim = 2112
trigger1 = !animtime
value = 2110

[State 2110, 3]
type = SelfState
trigger1 = Pos Y > 0
trigger1 = Vel Y >= 3
value = 5100

[State 2110, 4]
type = Gravity
trigger1 = time > 0

; Hit again by Saikyou Zenten Hissatsu Waza
[Statedef 2111]
type = A
movetype = H
physics = N
posadd = 0, 40
ctrl = 0

[State 2111, 0]
type = VelSet
trigger1 = time = 0
y = -8.5

[State 2111, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 2111

[State 2111, 0]
type = VelMul
trigger1 = backedgebodydist = 0
trigger1 = Vel Y < 4
x = -.9

[State 2111, 2]
type = PlaySnd
trigger1 = backedgebodydist = 0
trigger1 = Vel Y < 4
value = F7, 0    ; bounce sound

[State 2111, 1]
type = Turn
trigger1 = Vel Y < 4
trigger1 = backedgebodydist = 0

[State 2111, 3]
type = SelfState
trigger1 = Vel Y >= 5
value = 5100

[State 2111, 4]
type = AngleSet
trigger1 = Time = 0
value = 0

[State 2111, 5]
type = AngleAdd
trigger1 = Time >= 1
value = 22.5

[State 2111, 6]
type = AngleDraw
trigger1 = Time >= 1

[State 2111, 4]
type = VelAdd
trigger1 = time > 0
y = .35

; Chouhatsu Densetsu
[Statedef 3000]
type = C
movetype = A
ctrl = 0
anim = 3000
poweradd = -1000
juggle = 1

[State 3000, 17]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3000, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 3000, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3000, 1]
type = ChangeState
trigger1 = AnimElem = 83;81
value = 3003

[State 3000, 2]
type = PlaySnd
trigger1 = AnimElem = 4
value = 195, 5 ; Ikuzora!
channel = 0

[State 3000, 3]
type = PlaySnd
trigger1 = AnimElem = 25;23
value = 195, 4 ; Yossha!
channel = 0

[State 3000, 3]
type = width
trigger1 = AnimElem = 26,>=0;24, >= 0
trigger1 = AnimElem = 37,<0;35, < 0
trigger2 = AnimElem = 44,>=0;42, >= 0
trigger2 = AnimElem = 57,<0;55, < 0
trigger3 = AnimElem = 64,>=0;62, >= 0
trigger3 = AnimElem = 77,<0;75, < 0
value = 20   ; wider in front

[State 3000, 6]
type = PlaySnd
trigger1 = AnimElem = 43;41
value = 195, 0 ; Doshita doshita!
channel = 0

[State 3000, 7]
type = PlaySnd
trigger1 = AnimElem = 63;61
value = 195, 2 ; Rakushou!
channel = 0

[State 3000, 8]
type = PlaySnd
trigger1 = AnimElem = 82;80
value = 195, 3	; Hyahuui!
channel = 0

[State 3000, 13]
type = Turn
triggerall = P2Dist X < -20
trigger1 = AnimElem = 23;21
trigger2 = AnimElem = 41;39
trigger3 = AnimElem = 61;59
trigger4 = AnimElem = 81;79
trigger5 = AnimElem = 19;17
trigger6 = AnimElem = 37;35
trigger7 = AnimElem = 57;55
trigger8 = AnimElem = 77;75

[State 3000, 13]
type = StateTypeSet
trigger1 = AnimElem = 23;21
trigger2 = AnimElem = 41;39
trigger3 = AnimElem = 61;59
trigger4 = AnimElem = 81;79
value = S

[State 3000, 14]
type = StateTypeSet
trigger1 = AnimElem = 19;17
trigger2 = AnimElem = 37;35
trigger3 = AnimElem = 57;55
trigger4 = AnimElem = 77;75
value = C

[State 3000, 11]
type = VelSet
trigger1 = AnimElem = 19;17
trigger2 = AnimElem = 37;35
trigger3 = AnimElem = 57;55
trigger4 = AnimElem = 77;75
x = 2

[State 3000, 12]
type = VelSet
trigger1 = AnimElem = 23;21
trigger2 = AnimElem = 41;39
trigger3 = AnimElem = 61;59
trigger4 = AnimElem = 81;79
x = 0

[State 3000, 14]
type = PlayerPush
trigger1 = Vel X = 2
;triggerall = Vel X = 2
;trigger1 = AnimElem = 21, < -1
;trigger2 = AnimElem = 39, < -1
;trigger2 = AnimElem = 21, > 0
;trigger3 = AnimElem = 59, < -1
;trigger3 = AnimElem = 39, > 0
;trigger4 = AnimElem = 79, < -1
;trigger4 = AnimElem = 59, > 0
value = 0

[State 3000, 4]
type = SuperPause
trigger1 = AnimElem = 4
time = 44;38
pos = 33, -63
anim = 102
movetime =  44;38

[State 3000, 14]
type = Explod
trigger1 = AnimElem = 4
anim = 7000
pos = 160, 230 
postype = left
bindtime = -1
supermove = 1
removetime = 44;38
ontop = 1

[State 3000, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = F20,0

[State 3000, 16]
type = HitDef
trigger1 = AnimElem = 26;24
trigger2 = AnimElem = 44;42
trigger3 = AnimElem = 64;62
attr = S, HA
hitflag = MA
guardflag = MA
guard.dist = 30
hitsound = 5, 0
guardsound = 6, 0
pausetime = 3, 3
p2stateno = 3005
sparkxy = -18, -77

; Chouhatsu Densetsu (jump)
[Statedef 3001]
type = A
movetype = A
physics = N
velset = 2.1,-7.4;2.5, -7.0

[State 3001, 1]
type = Gravity
trigger1 = time > 0

[State 3001, 2]
type = HitDef
trigger1 = time = 0
nochainID = 3004
attr = A, HA
hitflag = A
guardflag = A
guard.dist = 30
hitsound = 5, 0
guardsound = 6, 0
pausetime = 3, 3
air.type = hard
air.velocity = -3, -6
sparkxy = -10, -99
fall = 1

[State 3001, 3]
type = TargetPowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = -150

[State 3001, 0]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y > -2
value = 3002

; Chouhatsu Densetsu [land]
[Statedef 3002]
type = S
movetype = A
velset = 0, 0
physics = S
anim = 3002

[State 3002, 0]
type = PosSet
trigger1 = Time = 0
y = 0

[State 3002, 0]
type = PlaySnd
trigger1 = time = 0
value = 0,52

[State 3002, 1]
type = Turn
trigger1 = AnimElem = 2
trigger1 = P2Dist X < -10

[State 3002, 1]
type = PosAdd
trigger1 = AnimElem = 3
x = 18

[State 3002, 2]
type = PlaySnd
trigger1 = Time = 15
value = 195, 10 ; Yoyuu ssu!
channel = 0

[State 3002, 3]
type = ChangeState
trigger1 = Time = 59
value = 0
ctrl = 1

[State 3002, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = S, HA
hitflag = M
guardflag = M
guard.dist = 30
hitsound = 5, 0
guardsound = 6, 0
pausetime = 3, 3
ground.type = trip
ground.velocity = -2, -4
p2facing = 1
sparkxy = -25, -58

[State 3002, 5]
type = TargetPowerAdd
trigger1 = MoveHit = 1
persistent = 0
value = -200

; Chouhatsu Densetsu (hop)
[Statedef 3003]
type = A
physics = N
velset = 2, -1.5

[State 3003, 0]
type = ChangeState
trigger1 = Pos Y > 0
value = 3004

[State 3003, 1]
type = Gravity
trigger1 = time > 0

; Chouhatsu Densetsu (landing from hop)
[Statedef 3004]
type = S
movetype = A
physics = N
velset = 0, 0
anim = 3001

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

[State 3004, 1]
type = PlaySnd
trigger1 = time = 0
value = 0,52

[State 3004, 2]
type = PlaySnd
trigger1 = AnimElem = 10
value = 198, 6	; Oraoraoraoraoraoraora!
channel = 0

[State 3004, 3]
type = width
trigger1 = AnimElem = 11, >= 0
trigger1 = AnimElem = 39, < 0
value = 20   ; wider in front

[State 3004, 3]
type = PlaySnd
trigger1 = AnimElem = 44
value = 195, 1	; Namen ja nee zo!
channel = 0

[State 3004, 4]
type = ChangeState
trigger1 = AnimElem = 45
value = 3001

[State 3004, 5]
type = VelSet
trigger1 = AnimElem = 4
trigger2 = AnimElem = 39
x = 2

[State 3004, 6]
type = VelSet
trigger1 = AnimElem = 8
trigger2 = AnimElem = 43
x = 0

[State 3004, 7]
type = StateTypeSet
trigger1 = AnimElem = 4
trigger2 = AnimElem = 39
value = C

[State 3004, 7]
type = StateTypeSet
trigger1 = AnimElem = 8
trigger2 = AnimElem = 43
value = S

[State 3004, 7]
type = PlayerPush
triggerall = Vel X = 2
trigger1 = AnimElem = 8, < -1
trigger2 = AnimElem = 43, < -1
trigger2 = AnimElem = 8, > 0
value = 0

[State 3004, 8]
type = Turn
triggerall = P2Dist X < -10
trigger1 = AnimElem = 4
trigger2 = AnimElem = 8
trigger3 = AnimElem = 39
trigger4 = AnimElem = 43

[State 3004, 9]
type = HitDef
trigger1 = AnimElem = 1
attr = S, HA
hitflag = MA
guardflag = MA
guard.dist = 30
hitsound = 5, 0
guardsound = 6, 0
pausetime = 3, 3
p2stateno = 3005
sparkxy = -30, -70

[State 3004, 9]
type = HitDef
trigger1 = AnimElem = 11
attr = S, HA
hitflag = MA
guardflag = MA
guard.dist = 30
hitsound = 5, 0
guardsound = 6, 0
pausetime = 3, 3
p2stateno = 3005
sparkxy = -18, -77

[State 3004, 10]
type = HitDef
trigger1 = AnimElem = 44
ID = 3004
attr = S, HA
hitflag = MA
guardflag = MA
guard.dist = 30
hitsound = 5, 0
guardsound = 6, 0
pausetime = 3, 3
ground.velocity = -8;-7, 0
p2stateno = 3005
sparkxy = -10, -52

; Dizzied by Chouhatsu Densetsu
[Statedef 3005]
type = S
movetype = H
physics = S
ctrl = 0
poweradd = -150

[State 3005, 0]
type = ChangeState
trigger1 = Pos Y < -5    ; Go to air hit state instead
value = 3006

[State 3005, 0]
type = ChangeAnim
trigger1 = time = 0
trigger1 = selfanimexist(5300)  ; check for dizzy anim
trigger1 = anim != 5300
value = 5300

[State 3005, 1]
type = ChangeAnim2
trigger1 = time = 0
trigger1 = !selfanimexist(5300)
trigger1 = anim != 3005
value = 3005  ; fake dizzy anim

[State 3005, 2]
type = SelfState
trigger1 = time = 120
value = 0
ctrl = 1

[State 3005, 3]
type = PowerAdd
trigger1 = time > 0
value = -1

; Chouhatsu Densetsu air hit
[Statedef 3006]
type = L    ; not really, but oh well
movetype = H
physics = N
ctrl = 0
velset = 0, -4
poweradd = -150

[State 3006, 0]
type = ChangeAnim
trigger1 = time = 0
value = 5035 

[State 3006, 1]
type = ChangeAnim
trigger1 = time = 7
value = 5050

[State 3006, 2]
type = ChangeAnim
trigger1 = anim = 5050
trigger1 = Vel Y >= 1
trigger1 = animexist(5051)
value = 5051

[State 3006, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3007

[State 3006, 4]
type = Gravity
trigger1 = time > 0

[Statedef 3007]
type = L
movetype = H
velset = 0,0
anim = 5110   ; HIT_LIEDOWN

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

[State 3007, 1]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 3007, 2]
type = SelfState
trigger1 = time = 90
value = 5120   ; HIT_GETUP

[State 3007, 3]
type = PowerAdd
trigger1 = time >= 0
value = -1

; Kouryuu Rekka (light) (ground portion)
[Statedef 3010]
type = S
movetype = A
physics = N
ctrl = 0
anim = 3030
poweradd = -1000
juggle = 4

[State 3010, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3010, 0]
type = NotHitBy
trigger1 = AnimElem = 1
value = C, AT, NA, SA, NP
time = 10

[State 3010, 0]
type = Explod
trigger1 = AnimElem = 2
anim = 7004
supermove = 1
removetime = 48
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3010, 0]
type = SuperPause
trigger1 = AnimElem = 2
time = 48
pos = 12, -47
anim = 102

[State 3010, a]
type = AfterImage
trigger1 = AnimElem = 2
time = 2
TimeGap = 1
FrameGap = 4

[State 3010, b]
type = AfterImageTime
trigger1 = AnimElem = 2, >= 0
time = 2

[State 3010, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = F20, 0
;value = 0, 3200   ; super charge

[State 3010, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = 196, 5 ; Ikuzora!
channel = 0

[State 3010, 6]
type = PlaySnd
trigger1 = AnimElem = 2, =1
value = 3010, 0   ; Kouryuu rekka!
channel = 0

[State 3010, 4]
type = ChangeState
trigger1 = AnimElem = 10
value = 3011

[State 3010, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = S, HA
animtype = hard
damage = 50,1
hitflag = MAF
guardflag = MA
pausetime = 2,2
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0 
ground.hittime = 20
air.velocity = -1.5, -4.5
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3010, 9]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype = hard
damage = 50,1
hitflag = MAF
guardflag = MA
pausetime = 4,4
sparkxy = -10, -70
hitsound = 5, 3
guardsound = 6,0
ground.type = high
ground.velocity = 0 
ground.hittime = 25
air.velocity = -1.5, -4.5
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3010, 10]
type = HitDef
trigger1 = AnimElem = 9
attr = S, HA
animtype = back
damage = 50,1
hitflag = MAF
guardflag = MA
pausetime = 2,2
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0, -4.5 
ground.hittime = 20
air.velocity = -1.5, -4.5
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3010, 11]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Kouryuu Rekka (light) (in air)
[Statedef 3011]
type = A
movetype = A
velset = 0, -8

[State 3011, 0]
type = AfterImageTime
trigger1 = time >= 0
time = 2

[State 3011, 1]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 3011, 2]
type = Gravity
trigger1 = Pos Y < -5

[State 3011, 4]
type = HitDef
trigger1 = AnimElem = 10, = 2
attr = S, SA
animtype = back
damage = 50,1
hitflag = MAF
guardflag = MA
pausetime = 6,6
sparkxy = 0, -55
hitsound = 5, 4
guardsound = 6,0
ground.type = high
ground.velocity = -1.5, -4.5
ground.hittime = 20
air.velocity = -1.5, -4.5
fall = 1
fall.recover = 0
sparkno = 3
getpower = 0

; Kouryuu Rekka (medium) (ground portion)
[Statedef 3020]
type = S
movetype = A
physics = N
ctrl = 0
anim = 3030
juggle = 4
poweradd = -2000

[State 3020, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3020, 0] ;ARRR1 added
type = NotHitBy
trigger1 = AnimElem = 1
value = C, AT, NA, SA, NP
time = 10

[State 3020, 0]
type = Explod
trigger1 = AnimElem = 2
anim = 7004
supermove = 1
removetime = 48
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3020, 0]
type = SuperPause
trigger1 = AnimElem = 2
time = 48
pos = 12, -47
anim = 102

[State 3020, a]
type = AfterImage
trigger1 = AnimElem = 2
time = 2
TimeGap = 1
FrameGap = 4

[State 3020, b]
type = AfterImageTime
trigger1 = AnimElem = 2, >= 0
time = 2

[State 3020, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = F20, 0
;value = 0, 3200 ; super charge

[State 3020, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = 196, 5 ; Ikuzora!
channel = 0

[State 3020, 6]
type = PlaySnd
trigger1 = AnimElem = 2, =1
value = 3010, 0   ; kouryuu rekka!
channel = 0

[State 3020, 2]
type = VelSet
trigger1 = AnimElem = 3
x = 4

[State 3020, 3]
type = VelSet
trigger1 = AnimElem = 6
x = 0

[State 3020, 7]
type = VelMul
trigger1 = Vel X > 0
x = .93

[State 3020, 4]
type = ChangeState
trigger1 = AnimElem = 10
value = 3031

[State 3020, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = S, HA
animtype = hard
damage = 60,1
hitflag = MAF
guardflag = MA
pausetime = 3,3
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0 
ground.hittime = 20
air.velocity = -1.5, -4.5
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3020, 9]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype = hard
damage = 60,1
hitflag = MAF
guardflag = MA
sparkxy = 0, -55
pausetime = 6,6
hitsound = 5, 3
guardsound = 6,0
ground.type = high
ground.velocity = 0 
ground.hittime = 24
air.velocity = -1.5, -4.5
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3020, 10]
type = HitDef
trigger1 = AnimElem = 9
attr = S, HA
animtype = hard
damage = 60,1
hitflag = MAF
guardflag = MA
pausetime = 3,3
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0,-4.5
ground.hittime = 20
air.velocity = -.5,-7
fall = 1
fall.recover = 0
sparkno = 3
getpower = 0

[State 3020, 11]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Kouryuu Rekka (strong) (ground portion)
[Statedef 3030]
type = S
movetype = A
physics = N
ctrl = 0
anim = 3030
juggle = 4
poweradd = -3000

[State 3030, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3030, 0] ;ARRR1 added
type = NotHitBy
trigger1 = AnimElem = 1
value = C, AT, NA, SA, NP
time = 10

[State 3030, 0]
type = Explod
trigger1 = AnimElem = 2
anim = 7004
supermove = 1
removetime = 48
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3030, 0]
type = SuperPause
trigger1 = AnimElem = 2
time = 48
pos = 12, -47
anim = 102

[State 3030, a]
type = AfterImage
trigger1 = AnimElem = 2
time = 2
TimeGap = 1
FrameGap = 4

[State 3030, b]
type = AfterImageTime
trigger1 = AnimElem = 2, >= 0
time = 2

[State 3030, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = F20, 0
;value = 0, 3200  ; super charge

[State 3030, 5]
type = PlaySnd
trigger1 = AnimElem = 2 
value = 196, 5 ; Ikuzora!
channel = 0

[State 3030, 6]
type = PlaySnd
trigger1 = AnimElem = 2, =1
value = 3010, 1  ; Dorya dorya doryaa!
channel = 0

[State 3030, 2]
type = VelSet
trigger1 = AnimElem = 3
x = 9

[State 3030, 2]
type = VelSet
trigger1 = AnimElem = 4, = -1
trigger1 = movecontact = 1
x = 4.5

[State 3030, 3]
type = VelSet
trigger1 = AnimElem = 6
x = 0

[State 3030, 7]
type = VelMul
trigger1 = Vel X > 0
x = .93

[State 3030, 4]
type = ChangeState
trigger1 = AnimElem = 10
value = 3031

[State 3030, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = S, HA
animtype = hard
damage = 70,1
hitflag = MAF
guardflag = MA
pausetime = 6,0
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0 
ground.hittime = 12
air.velocity = -.5, -2.4
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3030, 8]
type = HitDef
trigger1 = AnimElem = 3, = 3
attr = S, HA
animtype = hard
damage = 70,1
hitflag = MAF
guardflag = MA
pausetime = 4,0
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0 
ground.hittime = 12
air.velocity = -.5, -2.4
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3030, 9]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype = hard
damage = 70,1
hitflag = MAF
guardflag = MA
pausetime = 6,0
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = high
ground.velocity = 0 
ground.hittime = 24
air.velocity = 0, -4.4
air.fall = 1
air.fall.recover = 0
sparkno = 3
getpower = 0

[State 3030, 10]
type = HitDef
trigger1 = AnimElem = 9
attr = S, HA
animtype = hard
damage = 70,1
hitflag = MAF
guardflag = MA
pausetime = 4,0
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = low
ground.velocity = 0, -4.5 
ground.hittime = 12
air.velocity = -.4, -4.5
air.fall = 1
air.fall.recover = 0
getpower = 0

[State 3030, 11]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Kouryuu Rekka (hard) (in air)
[Statedef 3031]
type = A
movetype = A
velset = 0, -8

[State 3031, 0]
type = AfterImageTime
trigger1 = time >= 0
time = 2

[State 3031, 1]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 3031, 2]
type = Gravity
trigger1 = Pos Y < -5

[State 3031, 3]
type = HitDef
trigger1 = AnimElem = 10
attr = S, HA
animtype = hard
damage = 70,1
hitflag = MAF
guardflag = MA
pausetime = 5,5
sparkxy = 0, -55
hitsound = 5, 3
guardsound = 6,0
ground.type = high
ground.velocity = -0.5, -5.5
ground.hittime = 12
air.velocity = -0.7, -5.5
sparkno = 3
fall = 1
fall.recover = 0
getpower = 0

[State 3031, 4]
type = HitDef
trigger1 = AnimElem = 10, =7
persistent = 0
attr = S, SA
animtype = back
damage = 70,1
hitflag = MAF
guardflag = HA
pausetime = 6,6
sparkxy = 0, -55
hitsound = 5, 4
guardsound = 6,0
ground.type = high
ground.velocity = -2, -6.5
ground.hittime = 20
air.velocity = -2, -6.5
fall = 1
fall.recover = 0
sparkno = 3
getpower = 0

; Hisshou Buraiken (light, ground portion)
[Statedef 3040]
type = S
movetype = A
physics = S
anim = 3040
ctrl = 0
juggle = 4
poweradd = -1000
velset = 0,0

[State 3040, 0]
type = Pause   ; SFA3 pause! Cheap!
trigger1 = AnimElem = 1, =3
time = 3
movetime = 3

[State 3040, 0]
type = SuperPause
trigger1 = AnimElem = 1, = 3
time = 38
pos = 2, -72
anim = 102

[State 3040, 0]
type = Explod
trigger1 = AnimElem = 1, = 3
anim = 7002
supermove = 1
removetime = 38
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3040, afterim]
type = AfterImage
trigger1 = time = 0
time = 2 
TimeGap = 1
FrameGap = 4

[State 3040, afterim]
type = AfterImageTime
trigger1 = time >= 0
time = 2

[State 3040, 1]
type = PlaySnd
trigger1 = AnimElem = 1, =3
value = F20,0

[State 3040, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3040, 0   ; Hisshou!
channel = 0

[State 3040, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 196, 6   ; Oraoraoraoraoraoraora!
channel = 0

[State 3040, 4]
type = PlaySnd
trigger1 = AnimElem = 21;19
value = 3040, 1  ; Buraiken!
channel = 0

[State 3040, 5]
type = ChangeState
trigger1 = AnimElem = 21
value = 3041

; fun with HitDefs
[State 3040, 6]
type = HitDef
trigger1 = AnimElem = 4  ; light kick
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = light
damage = 30, 2
pausetime = 3,3
hitsound = 5, 0
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
sparkxy = 0, -50
pausetime = 3, 3
getpower = 0

[State 3040, 7]
type = HitDef
trigger1 = AnimElem = 6  ; light punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = light
damage = 30, 2
pausetime = 3,3
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -5, -70
pausetime = 3, 3
getpower = 0

[State 3040, 7]
type = PlaySnd
trigger1 = AnimElem = 6, = -1
trigger2 = AnimElem = 4, = -1
value = 0, 200 

[State 3040, 8]
type = PlaySnd
trigger1 = AnimElem = 10, = -1
trigger2 = AnimElem = 15, = -1
trigger3 = AnimElem = 20, = -1
value = 0, 220

[State 3040, 8]
type = HitDef
trigger1 = AnimElem = 10 ; hard punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 3
guardsound = 6, 0
ground.type = high
ground.hittime = 24
sparkxy = -12, -64
pausetime = 3, 3
getpower = 0

[State 3040, 9]
type = HitDef
trigger1 = AnimElem = 15 ; hard kick
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 4
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -21, -40
pausetime = 3, 3
getpower = 0

[State 3040, 11]
type = SprPriority
trigger1 = AnimElem = 13
value = -1

[State 3040, 12]
type = SprPriority
trigger1 = AnimElem = 15
value = 1

[State 3040, 10]
type = HitDef
trigger1 = AnimElem = 20 ; kouryuuken
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 4
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
ground.velocity = -4, -8
air.velocity = 0, -8
sparkxy = -3, -66
pausetime = 3, 3
getpower = 0

[State 3040, 13]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Hisshou Buraiken (in air)
[Statedef 3041]
type = A
movetype = A
velset = 4, -8

[State 3041, 0]
type = AfterImageTime
trigger1 = time >= 0
time = 2 

[State 3041, 0]
type = VelMul
trigger1 = time > 0
x = .93

[State 3041, 1]
type = Gravity
trigger1 = time > 0

[State 3041, 2]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 3041, 3]
type = HitDef
trigger1 = Pos Y < -15
persistent = 0
attr = A, HA
hitflag = MAF
guardflag = MA
animtype = back
damage = 60, 5
hitsound = 5, 4
guardsound = 6, 0
ground.type = Low
ground.velocity = -4, -8
air.velocity = -2, -6
ground.hittime = 12
sparkxy = 5, -97
fall = 1
fall.recover = 0
getpower = 0

; Hisshou Buraiken (medium) (ground portion)
[Statedef 3050]
type = S
movetype = A
physics = S
anim = 3050
ctrl = 0
juggle = 4
poweradd = -2000
velset = 0,0

[State 3050, 0]
type = SuperPause
trigger1 = AnimElem = 1, = 3
time = 38
pos = 2, -72
anim = 102

[State 3050, 0]
type = Pause   ; SFA3 pause! Cheap!
trigger1 = AnimElem = 1, =3
time = 3
movetime = 3

[State 3050, 0]
type = Explod
trigger1 = AnimElem = 1, = 3
anim = 7002
supermove = 1
removetime = 38
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3050, afterim]
type = AfterImage
trigger1 = time = 0
time = 2
TimeGap = 1
FrameGap = 4

[State 3050, afterim]
type = AfterImageTime
trigger1 = time >= 0
time = 2

[State 3050, 1]
type = PlaySnd
trigger1 = AnimElem = 1, =3
value = F20,0

[State 3050, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3040, 0   ; Hisshou!
channel = 0

[State 3050, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 196, 6   ; Oraoraoraoraoraoraora!
channel = 0

[State 3050, 4]
type = PlaySnd
trigger1 = AnimElem = 34;28
value = 3040, 1  ; Buraiken!
channel = 0

[State 3050, 5]
type = ChangeState
trigger1 = AnimElem = 34
value = 3051

[State 3050, 6]
type = HitDef
trigger1 = AnimElem = 3  ; light punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = light
damage = 30, 2
pausetime = 3,3
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -5, -70
pausetime = 3, 3
getpower = 0

[State 3050, 6]
type = PlaySnd
trigger1 = AnimElem = 3, = -1
trigger2 = AnimElem = 25, = -1
value = 0, 200

[State 3050, 7]
type = PlaySnd
trigger1 = AnimElem = 6, = -1
trigger2 = AnimElem = 20, = -1
trigger3 = AnimElem = 9, = -1
trigger4 = AnimElem = 28, = -1
value = 0, 210

[State 3050, 8]
type = PlaySnd
trigger1 = AnimElem = 14, = -1
trigger2 = AnimElem = 32, = -1
value = 0, 220

[State 3050, 7]
type = HitDef
trigger1 = AnimElem = 6  ; medium punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 35, 2
pausetime = 3,3
hitsound = 5, 2
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -5, -54
pausetime = 3, 3
getpower = 0

[State 3050, 8]
type = HitDef
trigger1 = AnimElem = 9  ; medium kick (knee)
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
sparkxy = -10, -50
pausetime = 3, 3
getpower = 0

[State 3050, 9]
type = HitDef
trigger1 = AnimElem = 10  ; medium kick (full)
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 2
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -17, -84
pausetime = 3, 3
getpower = 0

[State 3050, 10]
type = HitDef
trigger1 = AnimElem = 14  ; strong kick
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 4
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -15, -90
pausetime = 3, 3
getpower = 0

[State 3050, 11]
type = HitDef
trigger1 = AnimElem = 20  ; ducking medium kick
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 35, 2
pausetime = 3,3
hitsound = 5, 2
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
sparkxy = -7, -45
pausetime = 3, 3
air.velocity = 0, -3

[State 3050, 11]
type = HitDef
trigger1 = AnimElem = 25  ; ducking taunt
trigger2 = AnimElem = 28  ; ducking light punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = light
damage = 30, 2
hitsound = 5, 2
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
sparkxy = -7, -45
pausetime = 3, 8
getpower = 0

[State 3050, 12]
type = HitDef
trigger1 = AnimElem = 32 ; kouryuuken
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 4
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
ground.velocity = -1.5, -8
air.velocity = 0,-8;-1.5, -8
sparkxy = -10, -60
pausetime = 3, 3
getpower = 0

[State 3050, 13]
type = SprPriority
trigger1 = AnimElem = 12
value = -1

[State 3050, 14]
type = SprPriority
trigger1 = AnimElem = 14
value = 1

[State 3050, 15]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Hisshou Buraiken (medium, in air)
[Statedef 3051]
type = A
movetype = A
velset = 4, -8

[State 3051, 0]
type = VelMul
trigger1 = time > 0
x = .93

[State 3051, afterim]
type = AfterImageTime
trigger1 = time >= 0
time = 2

[State 3051, 1]
type = Gravity
trigger1 = time > 0

[State 3051, 2]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 3051, 3]
type = HitDef
trigger1 = Pos Y < -15
persistent = 0
attr = A, HA
hitflag = MAF
guardflag = MA
animtype = back
damage = 60, 5
hitsound = 5, 4
guardsound = 6, 0
ground.type = Low
ground.velocity = -4, -8
air.velocity = -2,-6;-4, -8
ground.hittime = 12
sparkxy = -10, -96
fall = 1
fall.recover=0
getpower = 0

; Hisshou Buraiken (strong) (ground portion)
[Statedef 3060]
type = S
movetype = A
physics = S
anim = 3060
ctrl = 0
juggle = 4
poweradd = -3000
velset = 0,0

[State 3060, 0]
type = Pause   ; SFA3 pause! Cheap!
trigger1 = AnimElem = 1, =3
time = 3
movetime = 3

[State 3060, 0]
type = SuperPause ; pre-empts other pause, which gets postponed
trigger1 = AnimElem = 1, = 3
time = 38
pos = 2, -72
anim = 102

[State 3060, 0]
type = Explod
trigger1 = AnimElem = 1, = 3
anim = 7002
supermove = 1
removetime = 38
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3060, afterim]
type = AfterImage
trigger1 = time = 0
time = 2  
TimeGap = 1
FrameGap = 4

[State 3060, afterim]
type = AfterImageTime
trigger1 = time >= 0
time = 2  

[State 3060, 1]
type = PlaySnd
trigger1 = AnimElem = 1, =3
value = F20,0

[State 3060, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3040, 0   ; Hisshou!
channel = 0

[State 3060, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 195, 6   ; Oraoraoraoraoraoraora!
channel = 0

[State 3060, 4]
type = PlaySnd
trigger1 = AnimElem = 44
value = 3040, 1  ; Buraiken!
channel = 0

[State 3060, 5]
type = ChangeState
trigger1 = AnimElem = 46
value = 3061

[State 3060, 0]
type = SprPriority
trigger1 = AnimElem = 2
trigger2 = AnimElem = 29
trigger3 = AnimElem = 36
value = 1

[State 3060, 0]
type = SprPriority
trigger1 = AnimElem = 27
trigger2 = AnimElem = 34
value = -1

[State 3060, 6]
type = PlaySnd
trigger1 = AnimElem = 34
trigger2 = AnimElem = 40, = -1
value = 200, 0  ; dah!
channel = 0

[State 3060, 7]
type = PlaySnd
trigger1 = AnimElem = 3, = -1
trigger2 = AnimElem = 29, = -1
trigger3 = AnimElem = 36, = -1
;trigger4 = AnimElem = 41, = -1
trigger4 = AnimElem = 45, = -1
value = 0, 220

[State 3060, 8]
type = PlaySnd
trigger1 = AnimElem = 9, = -1
trigger2 = AnimElem = 19, = -1
value = 0, 200

[State 3060, 9]
type = PlaySnd
trigger1 = AnimElem = 14, = -1
trigger2 = AnimElem = 23, = -1
trigger3 = AnimElem = 39, = -1
value = 0, 210

; fun with HitDefs
[State 3060, 7]
type = HitDef
trigger1 = AnimElem = 3  ; hard punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -21, -52
getpower = 0

[State 3060, 8]
type = HitDef
trigger1 = AnimElem = 9  ; taunt
attr = S, HA
hitflag = MAF
guardflag = MA
pausetime = 5, 5
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -9, -79
getpower = 0

[State 3060, 9]
type = HitDef
trigger1 = AnimElem = 10  ; taunt part 2
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = light
damage = 20, 2
pausetime = 3,3
hitsound = 5, 0
ground.type = High
ground.hittime = 24
sparkxy = -9, -79
getpower = 0

[State 3060, 9]
type = HitDef
trigger1 = AnimElem = 14 ; standing med kick - knee
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
pausetime = 3, 3
guardsound = 6, 0
ground.type = low
ground.hittime = 24
sparkxy = -11,-52
getpower = 0

[State 3060, 10]
type = HitDef
trigger1 = AnimElem = 15 ; standing med kick - full
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -37, -70
getpower = 0

[State 3060, 11]
type = HitDef
trigger1 = AnimElem = 19 ; crouching light punch
attr = C, HA
hitflag = MAF
guardflag = MA
animtype = light
damage = 20, 2
pausetime = 3,3
hitsound = 5, 0
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
sparkxy = -9, -58
getpower = 0

[State 3060, 12]
type = HitDef
trigger1 = AnimElem = 23 ; crouching medium punch
attr = C, HA
hitflag = MAF
guardflag = MA
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
guardsound = 6, 0
ground.type = Low
ground.hittime = 24
sparkxy = -13, -56
getpower = 0

[State 3060, 13]
type = HitDef
trigger1 = AnimElem = 29 ; standing hard kick
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 50, 2
pausetime = 3,3
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.hittime = 24
sparkxy = -28, -83
getpower = 0

[State 3060, 14]
type = HitDef
trigger1 = AnimElem = 36 ; reverse sweep
attr = C, HA
hitflag = MAF
guardflag = MA
animtype = back
damage = 50, 2
pausetime = 3,3
hitsound = 5, 3
guardsound = 6, 0
guard.velocity = 2.5   ; vacuum
ground.type = High
ground.velocity = 0, -3
ground.hittime = 24
sparkxy = -15, -13
getpower = 0

[State 3060, 15]
type = HitDef
trigger1 = AnimElem = 39 ; standing medium punch
attr = S, HA
hitflag = MAF+
guardflag = MA
animtype = medium
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
guardsound = 6, 0
ground.type = Low
air.velocity = 0, -2
ground.velocity = 2
ground.hittime = 24
sparkxy = -17, -56
getpower = 0

[State 3060, 16]
type = HitDef
trigger1 = AnimElem = 40 ; chained into reverse standing hard punch
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 30, 2
pausetime = 3,3
hitsound = 5, 1
guardsound = 6, 0
guard.velocity = 2.5 ; vacuum
ground.type = Low
ground.velocity = 1.5, -5
air.velocity = 1.25, -4.3
fall = 1
fall.recover = 0
ground.hittime = 24
sparkxy = -32, -50
getpower = 0

[State 3060, 17]
type = HitDef
trigger1 = AnimElem = 45 ; kouryuuken on ground
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
damage = 60, 2
pausetime = 3,3
hitsound = 5, 4
guardsound = 6, 0
ground.type = Low
ground.velocity = 0, -8
air.velocity = 0, -8
ground.hittime = 24
sparkxy = -3, -66
getpower = 0

[State 3060, 17]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Hisshou Buraiken (strong, in air)
[Statedef 3061]
type = A
movetype = A
velset = 4, -8

[State 3061, afterim]
type = AfterImageTime
trigger1 = time >= 0
time = 2  

[State 3061, 0]
type = VelMul
trigger1 = time > 0
x = .93

[State 3061, 1]
type = Gravity
trigger1 = time > 0

[State 3061, 2]
type = ChangeState
trigger1 = Vel Y > 0
value = 1062

[State 3061, 3]
type = HitDef
trigger1 = Pos Y < -50
persistent = 0
attr = A, HA
hitflag = MAF
guardflag = MA
animtype = back
damage = 60, 2
pausetime = 3,3
hitsound = 5, 4
guardsound = 6, 0
ground.type = Low
ground.velocity = -4, -8
air.velocity = -2, -6.5
ground.hittime = 12
sparkxy = -5, -97
fall = 1
fall.recover = 0
getpower = 0

; Shinkuu Gadouken (light)
[Statedef 3070]
type = S
movetype = A
physics = S
anim = 1030
juggle = 2
poweradd = -1000

[State 3070, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3070, 0]
type = Explod
trigger1 = AnimElem = 2
anim = 7003
supermove = 1
removetime = 60
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3070, 0]
type = SuperPause
trigger1 = AnimElem = 2
anim = 102
time = 60
pos = -30,-90

[State 3070, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0,3200 		; super charge
channel = 1

[State 3070, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3070, 0    ; Shinkuu
channel = 0

[State 3070, 3]
type = Projectile
trigger1 = AnimElem = 4
projanim = 1035   
projhitanim = 1036
projremanim = 1036
offset = 82, -68  
velocity = 2.5, 0       ;Speed fireball moves (x,y) (optional)
remvelocity = 0, 0     ;Speed fireball moves when being removed (x,y) (opt)
;accel = -0.1, 0            ;Acceleration (opt)
projremovetime = 18
projhits = 3
projmisstime = 2
; hitdef
attr = S, HP
damage = 65,3
getpower = 0
guardflag = MA
pausetime = 0, 5
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -3, -6.5
air.velocity = -3, -6.5
air.juggle = 4
fall = 1
fall.animtype = High

[State 3070, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0,1030    ; swoosh

[State 3070, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1030, 0    ; Gadouken!
channel = 0

[State 3070, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 3070, 7]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3070, 8]
type = width
trigger1 = AnimElem = 4, > 0
value = 20   ; wider in front

; Shinkuu Gadouken (medium)
[Statedef 3080]
type = S
movetype = A
physics = S
anim = 1040
juggle = 2
poweradd = -2000

[State 3080, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3080, 0]
type = Explod
trigger1 = AnimElem = 2
anim = 7003
supermove = 1
removetime = 60
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3080, 0]
type = SuperPause
trigger1 = AnimElem = 2
anim = 102
time = 60
pos = -30,-90

[State 3080, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0,3200 		; super charge

[State 3080, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3070, 0    ; Shinkuu
channel = 0

[State 3080, 3]
type = Projectile
trigger1 = AnimElem = 4
projanim = 1035   
projhitanim = 1036
projremanim = 1036
offset = 82, -68  
velocity = 2.5, 0       ;Speed fireball moves (x,y) (optional)
remvelocity = 0, 0     ;Speed fireball moves when being removed (x,y) (opt)
;accel = -0.1, 0            ;Acceleration (opt)
projremovetime = 24
projhits = 4
projmisstime = 2
; hitdef
attr = S, HP
damage = 65,3
getpower = 0
guardflag = MA
pausetime = 0, 5
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -3, -6.5
air.velocity = -3, -6.5
air.juggle = 4
fall = 1
fall.animtype = High

[State 3080, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0,1030    ; swoosh

[State 3080, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1030, 1    ; Gadouken!
channel = 0

[State 3080, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 3080, 7]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3080, 8]
type = width
trigger1 = AnimElem = 4, > 0
value = 20   ; wider in front

; Shinkuu Gadouken (hard)
[Statedef 3090]
type = S
movetype = A
physics = S
anim = 1050
juggle = 2
poweradd = -3000

[State 3090, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3090, 0]
type = Explod
trigger1 = AnimElem = 2
anim = 7003
supermove = 1
removetime = 60
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3090, 0]
type = SuperPause
trigger1 = AnimElem = 2
anim = 102
time = 60
pos = -30,-90

[State 3090, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = F20,0

[State 3090, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3070, 1    ; Shinkuu
channel = 0

[State 3090, 3]
type = Projectile
trigger1 = AnimElem = 4
projanim = 1035   
projhitanim = 1036
projremanim = 1036
offset = 82, -68  
velocity = 2.5, 0       ;Speed fireball moves (x,y) (optional)
remvelocity = 0, 0     ;Speed fireball moves when being removed (x,y) (opt)
;accel = -0.1, 0            ;Acceleration (opt)
projremovetime = 48
projhits = 5
projmisstime = 2
; hitdef
attr = S, HP
damage = 70,4
getpower = 0
guardflag = MA
pausetime = 0, 5
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -3, -6.5
air.velocity = -3, -6.5
air.juggle = 4
fall = 1
fall.animtype = High

[State 3090, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0,1030    ; swoosh

[State 3090, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1030, 2    ; Gadouken!
channel = 0

[State 3090, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 3090, 7]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3090, 8]
type = width
trigger1 = AnimElem = 4, > 0
value = 20   ; wider in front

;========================================
; Chouhatsu Shinwa block

; Chouhatsu Shinwa start
[Statedef 3100]
type = S
physics = S
poweradd = -3000
anim = 3100
ctrl = 0

[State 3100, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 3100, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3100, 0]
type = VarSet
trigger1 = time = 0
v = 2
value = 1

[State 3100, 1]
type = SuperPause
trigger1 = time = 3
time = 51
movetime = 51
pos = 33, -63
anim = 102

[State 3100, 2]
type = Explod
trigger1 = time = 3
anim = 7001
pos = 160, 230
postype = left
bindtime = -1
supermove = 1
removetime = 51
ontop = 1

[State 3100, 2]
type = PlaySnd
trigger1 = time = 3
value = F20,0

[State 3100, 3]
type = PlaySnd
trigger1 = time = 0
value = 195, 10   ; Yoyuu ssu!
channel = 0

[State 3100, 4]
type = ChangeState
trigger1 = time = 54
value = 0
ctrl = 1

[State 3100, 5]
type = AfterImage
trigger1 = time = 3
time = 2
TimeGap = 2
FrameGap = 8

; Chouhatsu Shinwa end
[Statedef 3101]
type = S
movetype = I
physics = S
velset = 0, 0
anim = 3100
ctrl = 0

[State 3101, 0]
type = PlaySnd
trigger1 = time = 0
value = 196, 10   ; Yoyuu ssu!
channel = 0

[State 3101, 1]
type = VarSet
trigger1 = time = 54
v = 2
value = 0

[State 3101, 2]
type = ChangeState
trigger1 = time = 54
value = 0
ctrl = 1

[State 3101, 3]
type = Explod
trigger1 = time = 40
pos = -2, -84
anim = 7100
postype = p1
bindtime = 1
sprpriority = 5

; Chouhatsu Shinwa standing X
[Statedef 3123]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0
anim = 3110

[State 3123, 0]
type = ChangeState
trigger1 = time = 30
value = 0
ctrl = 1

[State 3123, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 18 ; Dohyaan!

[State 3123, 1]
type = CtrlSet
trigger1 = time = 8 ; AnimElem = 4
trigger1 = var(2) < 1200
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa standing Y
[Statedef 3124]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0
anim = 195

[State 3124, 0]
type = ChangeState
trigger1 = time = 45
value = 0
ctrl = 1

[State 3124, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 201, 2  ; Heuh!

[State 3124, 1]
type = CtrlSet
trigger1 = AnimElem = 4
trigger1 = var(2) < 1200
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa standing Z
[Statedef 3125]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0
anim = 195

[State 3125, 0]
type = ChangeState
trigger1 = time = 30
value = 0
ctrl = 1

[State 3125, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 201, 1  ; Fiyah!

[State 3125, 1]
type = CtrlSet
trigger1 = AnimElem = 4
trigger1 = var(2) < 1200
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa standing A
[Statedef 3120]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0
anim = 195

[State 3120, 0]
type = ChangeState
trigger1 = time = 45
value = 0
ctrl = 1

[State 3120, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 21  ; hmmm...

[State 3120, 1]
type = CtrlSet
trigger1 = AnimElem = 4
trigger1 = var(2) < 1200
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa standing B
[Statedef 3121]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0
anim = 195

[State 3121, 0]
type = ChangeState
trigger1 = time = 45
value = 0
ctrl = 1

[State 3121, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 0  ; Doshita doshita!

[State 3123, 2]
type = CtrlSet
trigger1 = AnimElem = 4
trigger1 = var(2) < 1200
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa standing C
[Statedef 3122] 
type = S
movetype = I
physics = S
ctrl = 0
velset = 0
anim = 195

[State 3122, 0]
type = ChangeState
trigger1 = time = 45
value = 0
ctrl = 1

[State 3122, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 1  ; Namen ja nee zo!

[State 3122, 2]
type = CtrlSet
trigger1 = AnimElem = 4
trigger1 = var(2) < 1200
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll forward A
[Statedef 3130]
type = C
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0

[State 3130, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 3130, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3130, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3130, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 196, 2 ; Rakushou!

[State 3130, 4]
type = ChangeState
trigger1 = time = 69 ;75
value = 0
ctrl = 1

[State 3130, 5]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3130, 6]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3130, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll forward B
[Statedef 3131]
type = C
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0

[State 3131, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 3131, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3131, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3131, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 196, 7   ; Yatta ze!

[State 3131, 2]
type = ChangeState
trigger1 = time = 69 ;75
value = 0
ctrl = 1

[State 3131, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3131, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3131, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll forward C
[Statedef 3132]
type = C
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0

[State 3132, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 3132, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3132, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3132, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 3040, 0   ; Hisshou!

[State 3132, 2]
type = ChangeState
trigger1 = time = 69 ;75
value = 0
ctrl = 1

[State 3132, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3132, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3132, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll forward X
[Statedef 3133]
type = C
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0

[State 3133, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 3133, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3133, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3133, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 196, 9   ; Oyajiii!

[State 3133, 2]
type = ChangeState
trigger1 = time = 69 ;75
value = 0
ctrl = 1

[State 3133, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3133, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3133, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll forward Y
[Statedef 3134]
type = C
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0

[State 3134, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 3134, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3134, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3134, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 196, 4   ; Yossha!

[State 3134, 2]
type = ChangeState
trigger1 = time = 69 ;75
value = 0
ctrl = 1

[State 3134, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3134, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3134, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll forward Z
[Statedef 3135]
type = C
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0

[State 3135, 0]
type = VelSet
trigger1 = AnimElem = 2
x = 3.6

[State 3135, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3135, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3135, 3]
type = PlaySnd
trigger1 = AnimElem = 16
value = 196, 3   ; Shawayahoo!

[State 3135, 2]
type = ChangeState
trigger1 = time = 69 ;75
value = 0
ctrl = 1

[State 3135, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3135, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3135, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa crouching X
[Statedef 3143]
type = C
movetype = I
physics = C
ctrl = 0
velset = 0
anim = 802

[State 3143, 0]
type = ChangeState
trigger1 = time = 30
value = 11
ctrl = 1

[State 3143, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 197, 8  ; yatta de!

[State 3143, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3143, 3]
type = VarSet
trigger1 = AnimElem = 4
persistent = 0
v = 1
value = 1

[State 3143, 4]
type = CtrlSet
triggerall = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "holdnotdown"
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; explicit move cancels since ctrlset doesn't work properly
; on button presses (consumes the event)
[State 3143, 4]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command != "holddown"
value = 3120

[State 3143, 5]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command != "holddown"
value = 3121

[State 3143, 6]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command != "holddown"
value = 3122

[State 3143, 7]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command != "holddown"
value = 3123

[State 3143, 8]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command != "holddown"
value = 3124

[State 3143, 9]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command != "holddown"
value = 3125

[State 3143, 10]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command = "holddown"
value = 3140

[State 3143, 11]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command = "holddown"
value = 3141

[State 3143, 12]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command = "holddown"
value = 3142

[State 3143, 13]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 3143

[State 3143, 14]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command = "holddown"
value = 3144

[State 3143, 15]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command = "holddown"
value = 3145

; Chouhatsu Shinwa crouching Y
[Statedef 3144]
type = C
movetype = I
physics = C
ctrl = 0
velset = 0
anim = 802

[State 3144, 0]
type = ChangeState
trigger1 = time = 45
value = 11
ctrl = 1

[State 3144, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 15  ; Yatta ze!

[State 3144, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3144, 3]
type = VarSet
trigger1 = AnimElem = 4
persistent = 0
v = 1
value = 1

[State 3144, 4]
type = CtrlSet
triggerall = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "holdnotdown"
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; explicit move cancels since ctrlset doesn't work properly
; on button presses (consumes the event)
[State 3144, 4]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command != "holddown"
value = 3120

[State 3144, 5]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command != "holddown"
value = 3121

[State 3144, 6]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command != "holddown"
value = 3122

[State 3144, 7]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command != "holddown"
value = 3123

[State 3144, 8]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command != "holddown"
value = 3124

[State 3144, 9]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command != "holddown"
value = 3125

[State 3144, 10]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command = "holddown"
value = 3140

[State 3144, 11]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command = "holddown"
value = 3141

[State 3144, 12]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command = "holddown"
value = 3142

[State 3144, 13]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 3143

[State 3144, 14]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command = "holddown"
value = 3144

[State 3144, 15]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command = "holddown"
value = 3145

; Chouhatsu Shinwa crouching Z
[Statedef 3145]
type = C
movetype = I
physics = C
ctrl = 0
velset = 0
anim = 802

[State 3145, 0]
type = ChangeState
trigger1 = time = 30
value = 11
ctrl = 1

[State 3145, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 19  ; hmmph!

[State 3145, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3145, 3]
type = VarSet
trigger1 = AnimElem = 4
persistent = 0
v = 1
value = 1

[State 3145, 4]
type = CtrlSet
triggerall = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "holdnotdown"
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; explicit move cancels since ctrlset doesn't work properly
; on button presses (consumes the event)
[State 3145, 4]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command != "holddown"
value = 3120

[State 3145, 5]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command != "holddown"
value = 3121

[State 3145, 6]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command != "holddown"
value = 3122

[State 3145, 7]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command != "holddown"
value = 3123

[State 3145, 8]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command != "holddown"
value = 3124

[State 3145, 9]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command != "holddown"
value = 3125

[State 3145, 10]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command = "holddown"
value = 3140

[State 3145, 11]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command = "holddown"
value = 3141

[State 3145, 12]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command = "holddown"
value = 3142

[State 3145, 13]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 3143

[State 3145, 14]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command = "holddown"
value = 3144

[State 3145, 15]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command = "holddown"
value = 3145

; Chouhatsu Shinwa crouching A
[Statedef 3140]
type = C
movetype = I
physics = C
ctrl = 0
velset = 0
anim = 802

[State 3140, 0]
type = ChangeState
trigger1 = time = 45
value = 11
ctrl = 1

[State 3140, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 195, 5  ; Ikuzora!

[State 3140, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3140, 3]
type = VarSet
trigger1 = AnimElem = 4
persistent = 0
v = 1
value = 1

[State 3140, 4]
type = CtrlSet
triggerall = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "holdnotdown"
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; explicit move cancels since ctrlset doesn't work properly
; on button presses (consumes the event)
[State 3145, 4]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command != "holddown"
value = 3120

[State 3145, 5]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command != "holddown"
value = 3121

[State 3145, 6]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command != "holddown"
value = 3122

[State 3145, 7]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command != "holddown"
value = 3123

[State 3145, 8]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command != "holddown"
value = 3124

[State 3145, 9]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command != "holddown"
value = 3125

[State 3145, 10]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command = "holddown"
value = 3140

[State 3145, 11]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command = "holddown"
value = 3141

[State 3145, 12]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command = "holddown"
value = 3142

[State 3145, 13]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 3143

[State 3145, 14]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command = "holddown"
value = 3144

[State 3145, 15]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command = "holddown"
value = 3145

; Chouhatsu Shinwa crouching B
[Statedef 3141]
type = C
movetype = I
physics = C
ctrl = 0
velset = 0
anim = 3120;802

[State 3141, 0]
type = ChangeState
trigger1 = time = 40
value = 11
ctrl = 1

[State 3141, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 20  ; Ohhhh! 

[State 3141, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3141, 3]
type = VarSet
trigger1 = time = 9
v = 1
value = 1

[State 3141, 4]
type = CtrlSet
triggerall = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "holdnotdown"
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; explicit move cancels since ctrlset doesn't work properly
; on button presses (consumes the event)
[State 3145, 4]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command != "holddown"
value = 3120

[State 3145, 5]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command != "holddown"
value = 3121

[State 3145, 6]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command != "holddown"
value = 3122

[State 3145, 7]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command != "holddown"
value = 3123

[State 3145, 8]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command != "holddown"
value = 3124

[State 3145, 9]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command != "holddown"
value = 3125

[State 3145, 10]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command = "holddown"
value = 3140

[State 3145, 11]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command = "holddown"
value = 3141

[State 3145, 12]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command = "holddown"
value = 3142

[State 3145, 13]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 3143

[State 3145, 14]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command = "holddown"
value = 3144

[State 3145, 15]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command = "holddown"
value = 3145

; Chouhatsu Shinwa crouching C
[Statedef 3142] 
type = C
movetype = I
physics = C
ctrl = 0
velset = 0
anim = 802

[State 3142, 0]
type = ChangeState
trigger1 = time = 45
value = 11
ctrl = 1

[State 3142, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 17  ; ii ssu!

[State 3142, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3142, 3]
type = VarSet
trigger1 = AnimElem = 4
persistent = 0
v = 1
value = 1

[State 3142, 4]
type = CtrlSet
triggerall = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "holdnotdown"
persistent = 0
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; explicit move cancels since ctrlset doesn't work properly
; on button presses (consumes the event)
[State 3145, 4]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command != "holddown"
value = 3120

[State 3145, 5]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command != "holddown"
value = 3121

[State 3145, 6]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command != "holddown"
value = 3122

[State 3145, 7]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command != "holddown"
value = 3123

[State 3145, 8]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command != "holddown"
value = 3124

[State 3145, 9]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command != "holddown"
value = 3125

[State 3145, 10]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "a"
trigger1 = command = "holddown"
value = 3140

[State 3145, 11]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "b"
trigger1 = command = "holddown"
value = 3141

[State 3145, 12]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "c"
trigger1 = command = "holddown"
value = 3142

[State 3145, 13]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 3143

[State 3145, 14]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "y"
trigger1 = command = "holddown"
value = 3144

[State 3145, 15]
type = ChangeState
trigger1 = var(1) = 1
trigger1 = var(2) < 1200
trigger1 = command = "z"
trigger1 = command = "holddown"
value = 3145

; Chouhatsu Shinwa roll backward A
[Statedef 3150]
type = C
physics = N
movetype = I
ctrl = 0
velset = 0,0
anim = 801

[State 3150, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 3150, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

[State 3150, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 198, 2 ; Rakushou!

[State 3150, 2]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 3150, 4]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3150, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3150, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3150, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll backward B
[Statedef 3151]
type = C
physics = N
movetype = I
ctrl = 0
velset = 0,0
anim = 801

[State 3151, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 3151, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

[State 3151, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 195, 7 ; Yatta de!

[State 3151, 2]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 3151, 4]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3151, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3151, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3151, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll backward C
[Statedef 3152]
type = C
physics = N
movetype = I
ctrl = 0
velset = 0,0
anim = 801

[State 3152, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 3152, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

[State 3152, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 2000, 1 ; Zakenna!

[State 3152, 2]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 3152, 4]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3152, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3152, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3152, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll backward X
[Statedef 3153]
type = C
physics = N
movetype = I
ctrl = 0
velset = 0,0
anim = 801

[State 3153, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 3153, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

[State 3153, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 198, 1 ; Namen ja nee zo!

[State 3153, 2]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 3153, 4]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3153, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3153, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3153, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll backward Y
[Statedef 3154]
type = C
physics = N
movetype = I
ctrl = 0
velset = 0,0
anim = 801

[State 3154, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 3154, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

[State 3154, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 197, 4 ; Yossha!

[State 3154, 2]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 3154, 4]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3154, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3154, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3154, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa roll backward Z
[Statedef 3155]
type = C
physics = N
movetype = I
ctrl = 0
velset = 0,0
anim = 801

[State 3155, 0]
type = VelSet
trigger1 = AnimElem = 2
x = -3

[State 3155, 3]
type = VelSet
trigger1 = AnimElem = 14
x = 0.0

[State 3155, 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 197, 0  ; Doshita doshita!

[State 3155, 2]
type = ChangeState
trigger1 = time = 80
value = 0
ctrl = 1

[State 3155, 4]
type = StateTypeSet
trigger1 = AnimElem = 14
value = S

[State 3155, 4]
type = PlayerPush
trigger1 = AnimElem = 2, > 0
trigger1 = AnimElem = 14, < 0
value = 0

[State 3155, 5]
type = Turn
trigger1 = AnimElem = 14
trigger1 = P2Dist X < -20
value = 0

[State 3155, 7]
type = CtrlSet
trigger1 = AnimElem = 19
trigger1 = var(2) < 1200
persistent = 0 
value = 1

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa Jumping A
[Statedef 3160]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3160, 0]
type = PlaySnd
trigger1 = AnimElem = 1
;persistent = 0
value = 196, 14  ; Chahoo! 

; Chouhatsu Shinwa Jumping B
[Statedef 3161]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3161, 0]
type = PlaySnd
trigger1 = AnimElem = 1
;persistent = 0
value = 197, 14  ; Chahoo! 

; Chouhatsu Shinwa Jumping C
[Statedef 3162]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3162, 0]
type = PlaySnd
trigger1 = AnimElem = 1
;persistent = 0
value = 7710, 1  ; dahyou! 

; Chouhatsu Shinwa Jumping X
[Statedef 3163]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3163, 0]
type = PlaySnd
trigger1 = AnimElem = 1
;persistent = 0
value = 195, 3  ; Hyahuui! 

; Chouhatsu Shinwa Jumping Y
[Statedef 3164]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3164, 0]
type = PlaySnd
trigger1 = AnimElem = 1
;persistent = 0
value = 198, 3  ; Hyahuui! 

; Chouhatsu Shinwa Jumping Z
[Statedef 3165]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3165, 0]
type = PlaySnd
trigger1 = AnimElem = 1
value = 201, 0  ; dan!

; Chouhatsu Shinwa alternate stand taunt
[Statedef 3195]
type = S
movetype = I
physics = S
anim = 3100
poweradd = 10
ctrl = 0

[State 3195, 0]
type = PlaySnd
trigger1 = time = 4
value = 197, 11   ; Yoyuu ssu!

[State 3195, 1]
type = CtrlSet
trigger1 = var(2) < 1200
trigger1 = time = 20
value = 1

[State 3195, 1]
type = ChangeState
trigger1 = time = 44
value = 0

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa alternate crouch taunt
[Statedef 3196]
type = S
movetype = I
physics = S
anim = 3100
poweradd = 10
ctrl = 0

[State 3196, 0]
type = PlaySnd
trigger1 = time = 4
value = 196, 16  

[State 3196, 1]
type = CtrlSet
trigger1 = var(2) < 1200
trigger1 = time = 20
value = 1

[State 3196, 1]
type = ChangeState
trigger1 = time = 44
value = 0

; MUGEN BUG
[State 3123, 2]
type = ChangeState
trigger1 = ctrl
trigger1 = command = "holdfwd" || command = "holdback"
value = 0

; Chouhatsu Shinwa alternate air taunt
[Statedef 3197]
type = A
movetype = I
physics = A
anim = 803
poweradd = 10

[State 3197, 0]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3450, 1  ; Want you! 

;------------------------
; Jun Kokusatsu
[Statedef 3200]
physics = N
type = S
movetype = A
velset = -3.3,-1.5
juggle = 7
poweradd = -2000
ctrl = 0
anim = 3200

[State 3200, 0]
type = Gravity
trigger1 = time > 0
trigger1 = Pos Y < 0

[State 3200, 1]
type = ChangeAnim
trigger1 = anim = 3200
trigger1 = Pos Y > 0
persistent = 0
value = 3201

[State 3200, 2]
type = VelSet
trigger1 = Pos Y > 0
y = 0

[State 3200, 3]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 3200, 4]
type = VelMul
trigger1 = anim = 3201
trigger1 = AnimElem = 2, < 0
x = .9

[State 3200, 5]
type = MakeDust
trigger1 = anim = 3201
trigger1 = AnimElem = 2, < 0
trigger1 = !(time%3)
pos = -24, -2
spacing = 1

[State 3200, 6]
type = VelSet
trigger1 = AnimElem = 1, = 24
x = 0

[State 3200, 2]
type = SuperPause
trigger1 = time = 0
time = 40
movetime = 38;26;14
anim = -1

[State 3200, 3]
type = Explod
trigger1 = time = 13
pos = -28, -88
postype = p1
bindtime = 15
supermove = 1
sprpriority = 5
anim = F102

[State 3200, 7]
type = PlaySnd
trigger1 = time = 10
value = 0, 3200

[State 3200, 1]
type = helper; Projectile
trigger1 = time = 25
persistent = 0
id = 7777
stateno = 3230
pos = 30, 5  
postype = p1
bindtime = 1
keyctrl = 0
ownpal = 1
size.xscale = 1
helpertype = normal
supermovetime = 15

[State 3200, 3]
type = PlaySnd
trigger1 = AnimElem = 4 
persistent = 0
channel = 0
value = 196, 8   ; Oyaji!

[State 3200, 5]
type = ChangeState
trigger1 = time = 110
value = 0
ctrl = 1

[State 3200, 6]
type = ChangeState
trigger1 = time >= 26
trigger1 = numhelper(7777)
trigger1 = helper(7777), movecontact
value = 3202

[State 3200, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Jun Kokusatsu success
[Statedef 3202]
physics = S
movetype = A
velset = 0,0
poweradd = 6
ctrl = 0

[State 3202, 11]
type = AssertSpecial
trigger1 = 1
flag = timerfreeze

[State 3202, 12]
type = NotHitBy
trigger1 = time = [0,60]
value = SCA

[State 3202, 10]
type = ChangeState
trigger1 = time = 61
trigger1 = win
value = 3203 

[State 3202, 0]
type = EnvColor
trigger1 = time >= 5
trigger1 = time <= 60
value = 231,231,231
time = 2 

[State 3202, 0]
type = ChangeAnim
trigger1 = time = 6
value = 3451

[State 3202, 1]
type = ChangeState
trigger1 = time = 170
value = 0
ctrl = 1

[State 3202, 7]
type = Explod
trigger1 = time >= 5
trigger1 = TimeMod = 2, 0
trigger1 = time < 60
anim = F1
postype = p2
pos = 0, -40
bindtime = 1
random = 40,80
ontop = 1

[State 3202, 9]
type = PlaySnd
trigger1 = time = [5, 59]
trigger1 = TimeMod = 5, 0
trigger1 = var(3) = 0
value = F5, 1

[State 3202, 10]
type = PlaySnd
trigger1 = time = [5, 59]
trigger1 = TimeMod = 5, 0
trigger1 = var(3) = 1
value = F5, 2

[State 3202, 11]
type = PlaySnd
trigger1 = time = [5, 59]
trigger1 = TimeMod = 5, 0
trigger1 = var(3) >= 2
value = F5, 3

[State 3202, 8]
type = HitAdd
trigger1 = time = [5, 59]
trigger1 = TimeMod = 5, 0
value = 1

[State 3202, 9]
type = HitAdd
trigger1 = time = 60
value = 1

[State 3202, 11]
type = PosAdd
trigger1 = time = 10
trigger1 = P2Dist X < 60
x = -60

[State 3202, 11]
type = AssertSpecial
trigger1 = time < 160
flag = NoKOSnd
flag2 = NoKOSlow

[State 3202, 12]
type = NotHitBy
trigger1 = time >= 0
value = SCA;C, AT, NA, SA, NP
time = 2

; Jun Kokusatsu (win)
[Statedef 3203]
type = S
movetype = I
physics = S

[State 3203, 0]
type = Explod
trigger1 = time = 0
pos = 160,120
postype = left
ontop = 1
anim = 7201
time = 100

[State 3203, 1]
type = EnvColor
trigger1 = time = 0
value = 16, 16, 16
under = 1
time = 100

[State 3203, 2]
type = PlaySnd
trigger1 = time = 0
persistent = 0
value = 0,7200

[State 3203, 4]
type = AssertSpecial
trigger1 = time >= 0
flag = NoKOSlow

[State 3203, 4]
type = AssertSpecial
trigger1 = time = [0,99]
flag = timerfreeze

[State 3203, 4]
type = AssertSpecial
trigger1 = time = [0,51]
flag = NoKOSnd

[State 3203, 6]
type = ChangeState
trigger1 = time = 150
value = 0
ctrl = 1

[State 3203, 12]
type = NotHitBy
trigger1 = time = [0,100]
value = C, AT, NA, SA, NP
time = 2

[State 3203, 13]
type = VarSet
trigger1 = time = 0
v = 6 
value = 2

; Hit by Jun Kokusatsu
[Statedef 3220]
physics = S
movetype = H
velset = 0
ctrl = 0

[State 3220, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 3220

[State 3220, 1]
type = SelfState
trigger1 = time = 180  ; match with state 3201  + 20 or so
trigger1 = life > 0
value = 5120  ; HIT_GETUP

[State 3220, 1]
type = SelfState
trigger1 = time = 180
trigger1 = life <= 0
value = 5150  ; HIT_LIEDEAD

[State 3220, 2]
type = PosAdd
trigger1 = P2Dist X < 100
trigger1 = time = 9
x = -60

[State 3220, 2] ;ARRR1 modified
type = LifeAdd
trigger1 = time = [5,54] ;[5, 59]
trigger1 = TimeMod = 5, 0
value = -40
kill = 0

[State 3220, 2] ;Last hit kills ;ARRR1 added
type = LifeAdd
trigger1 = time = [55, 59]
trigger1 = TimeMod = 5, 0
value = -50
kill = 1

; Oyaji 
[Statedef 3230]
type = S
movetype = A
physics = N
anim = 3205
velset = 0, 0

[State 3230, 0]
type = PalFX
trigger1 = time < 15
add = 6*(time-15),6*(time-15),6*(time-15)
time = 2

[State 3230, 0]
type = HitDef
trigger1 = time = 15
attr = S, HA
damage = 0,0
getpower = 0
guardflag = N
guard.dist = 0
hitflag = M
sparkno = -1;0, 5
hitsound = -1,-1;5, 3
animtype = light
ground.type = high
p1stateno = 3235
p2stateno = 3220

[State 3230, 1]
type = VelSet
trigger1 = time = 15
x = 2.5

[State 3230, 0]
type = HitDef
trigger1 = time = 60
type = none

[State 3230, 0]
type = PalFX
trigger1 = time >= 60
add = 5*(60-time),5*(60-time),5*(60-time)
time = 2

[State 3230, 2]
type = DestroySelf
trigger1 = time = 80

[Statedef 3235]
type = S
movetype = I
physics = S
anim = 3206

[State 3235, 5]
type = BindToTarget
trigger1 = time = 0
pos = 15,0
bindtime = 5

[State 3235, 10]
type = ChangeState
trigger1 = time = 61
value = ifelse(win,3245,3240) 

; Oyaji pose/fade (normal)
[Statedef 3240]
type = S
movetype = I
physics = S
anim = 3210

[State 3240, 1]
type = BindToTarget
trigger1 = !time
pos = 60,0

[State 3240, 2]
type = PlaySnd
trigger1 = time = 1
value = 3200, 2   ; tanomu zo
channel = 0

[State 3240, 3]
type = PlaySnd
trigger1 = time = 69
value = 3200, 1   ; musuko yo
channel = 0

[State 3240, 4]
type = PalFX
trigger1 = time >= 70
add = 5*(70-time),5*(70-time),5*(70-time)
time = 2

[State 3240, 5]
type = DestroySelf
trigger1 = animtime = 0

; Oyaji pose/fade (win)
[Statedef 3245]
type = S
movetype = I
physics = S
anim = 3209

[State 3245, 1]
type = BindToTarget
trigger1 = !time
pos = 60,0

[State 3245, 0]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim = 3209
value = 3210

[State 3245, 4]
type = PlaySnd
trigger1 = time = 105
value = 3200, 3   ; makaseta na
channel = 0

[State 3245, 4]
type = PalFX
trigger1 = animtime >= -19
trigger1 = anim = 3210
add = -5*(20+animtime),-5*(20+animtime),-5*(20+animtime)
time = 2

[State 3245, 5]
type = DestroySelf
trigger1 = animtime = 0
trigger1 = anim = 3210

; Oyaji's standing pose (for intro 194)
[Statedef 3249]
type = S
movetype = I
physics = S
velset = 0,0
anim = 3230

[State 3249, turn]
type = turn
trigger1 = !time

[State 3249, 0]
type = ChangeAnim
trigger1 = time = 90
value = 3231
elem = 4

[State 3249, 1]
type = PlaySnd
trigger1 = time = 6
value = 3200, 0    ; watashi no kataki o tore
channel = 0

[State 3249, 1]
type = PalFX
trigger1 = time >= 90
add = 5*(89-time),5*(89-time),5*(89-time)
time = 2

[State 3249, 2]
type = DestroySelf
trigger1 = time = 110

; Shun Bokusatsu
[Statedef 3250]
type = S
movetype = A
physics = N
anim = 3250
juggle = 1
ctrl = 0
velset = 3, 0
poweradd = -1000

[State 3250, 6]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3250, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3250, 0]
type = SuperPause
trigger1 = !time
time = 40
anim = 102
pos = 7,-80

[State 3250, 0]
type = PlaySnd
trigger1 = time = 0
value = F20, 0

[State 3250, 0]
type = PlaySnd
trigger1 = !time
value = 195, 5  ; Ikuzora!
channel = 0

[State 3230, 0]
type = HitDef
trigger1 = time = 1
attr = S, HA
damage = 0,0
getpower = 0
guardflag = N
guard.dist = 0
hitflag = M
sparkno = -1;0, 5
hitsound = -1,-1;5, 3
animtype = light
ground.type = high
p1stateno = 3255
p2stateno = 3260

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

[State 3250, 5]
type = AfterImage
trigger1 = Time = 1
;length = 4
PalBright   =  0,0,0
PalContrast = 220,220,220;256,256,256;128,128,128
PalAdd      = -10,-10,-10
PalMul      = .75,.75,.75
TimeGap  = 2
FrameGap = 4
time = 2

[State 3230, 5]
type = AfterImageTime
trigger1 = 1
time = 2

; Shun Bokusatsu hit
[Statedef 3255]
type = S
movetype = H
physics = S
anim = 3251
velset = 0, 0

[State 3255, 6]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3255, 5]
type = BindToTarget
trigger1 = time = 0
pos = 15,0
bindtime = 5

[State 3255, 11]
type = AssertSpecial
trigger1 = time >= 0
flag = timerfreeze

[State 3255, 0]
type = EnvColor
trigger1 = time >= 5
trigger1 = time <= 60
value = 231,231,231
time = 2 

[State 3255, 7]
type = Explod
trigger1 = time >= 5
trigger1 = !(time%2)
trigger1 = time < 60
anim = F1
postype = p1
pos = 0, -40
bindtime = 1
random = 40,80
ontop = 1

[State 3255, 9]
type = PlaySnd
trigger1 = time = [5, 59]
trigger1 = !(time%5)
trigger1 = var(3) = 0
value = F5, 1

[State 3255, 10]
type = PlaySnd
trigger1 = time = [5, 59]
trigger1 = !(time%5)
trigger1 = var(3) = 1
value = F5, 2

[State 3255, 11]
type = PlaySnd
trigger1 = time = [5, 59]
trigger1 = !(time%5)
trigger1 = var(3) >= 2
value = F5, 3

[State 3255, 12]
type = NotHitBy
trigger1 = time >= 0
value = SCA;C, AT, NA, SA, NP
time = 2

[State 3255, 2] ;ARRR1 modified
type = LifeAdd
trigger1 = time = [5,54] ;[5, 59]
trigger1 = TimeMod = 5, 0
value = -20
kill = 0

[State 3255, 2] ;Last hit kills ;ARRR1 added
type = LifeAdd
trigger1 = time = [55, 59]
trigger1 = TimeMod = 5, 0
value = -life
absolute = 1
kill = 1

[State 3255, 3]
type = ChangeAnim
trigger1 = time = 60
value = 5110   ; HIT_LIEDOWN

[State 3255, 4]
type = ChangeState
trigger1 = time = 60
value = ifelse(life>0,5120,5150)

; Hit by Shun Bokusatsu
[Statedef 3260]
physics = S
movetype = H
velset = 0
ctrl = 0

[State 3260, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 3220

[State 3260, 1]
type = SelfState
trigger1 = time = 60
value = 0; 3261
ctrl = 1

; Kataki
[Statedef 3300]
type = S
movetype = A
physics = S
anim = 3300
juggle = 14
ctrl = 0

[State 3300, 0]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3300, 0]
type = PosAdd 
trigger1 = time = 0
x = 10   ; 11

[State 3300, 0]
type = PosAdd 
trigger1 = AnimElem = 2
persistent = 0
x = 11   ; 13

[State 3300, 0]
type = PosAdd 
trigger1 = AnimElem = 3
persistent = 0
x = 21   ; 24

[State 3300, 0]
type = PosAdd 
trigger1 = AnimElem = 4
persistent = 0
x = 21   ; 24

[State 3300, 0]
type = SprPriority
trigger1 = AnimElem = 1
value = 3

[State 3300, 0]
type = SprPriority
trigger1 = AnimElem = 5
value = 0

[State 3300, 0]
type = PosAdd 
trigger1 = AnimElem = 5
persistent = 0
x = 10   ; 11

[State 3300, 0]
type = NotHitBy
;trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 5, < 0
value = , AA, AP

[State 3300, 1]
type = poweradd
trigger1 = AnimElem = 5
value = -3000

[State 3300, 1]
type = SuperPause
trigger1 = AnimElem = 5
time = 30
pos = -29,-84   ;-37, 84
anim = 102

[State 3300, 2]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0,3200

[State 3300, 3]
type = HitDef
trigger1 = AnimElem = 9
;trigger1 = P2BodyDist X < 25
attr = S, HT
getpower  = 40
givepower = 30
hitflag = M-
priority = 2, Miss    ;Throw has low priority, should be miss or dodge type.
sparkno = -1
p2facing = -1
p1stateno = 3305
p2stateno = 3350
hitsound = 6,0

[State 3300, 4]
type = ChangeAnim
trigger1 = anim = 3300
trigger1 = AnimElem = 10
trigger1 = movecontact = 0
value = 3301   ; missed grab

[State 3300, 4]
type = PosAdd
trigger1 = anim = 3301
persistent = 0
x = 27   ; 30

[State 3300, 4]
type = PlaySnd
trigger1 = anim = 3301
persistent = 0
value = 900, 0   ; throw miss
channel = 0

[State 3300, 4]
type = ChangeState
trigger1 = anim = 3301
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Kataki grab success
[Statedef 3305]
type = S
movetype = A
physics = S
ctrl = 0
velset = 0,0

[State 3305, 0]
type = TargetBind
trigger1 = AnimElem = 9, >= 0
trigger1 = AnimElem = 10, < 0
pos = 64,0  ;72, 0

[State 3305, 0]
type = TargetBind
trigger1 = AnimElem = 10, >= 0
trigger1 = AnimElem = 11, < 0
pos = 28, 0

[State 3305, 2]
type = HitDef
trigger1 = AnimElem = 12
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Up
damage = 48, 2
pausetime = 12,12
hitsound = 5, 4
guardsound = 6, 0
ground.velocity = 0,-8
air.velocity = 0, -8
ground.hittime = 12
sparkxy = -9, -72
p2facing = 1
fall = 1
fall.recover = 0
getpower = 0

[State 3305, 2]
type = HitDef
trigger1 = AnimElem = 13
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Up
damage = 54, 2
pausetime = 9,9
hitsound = 5, 3
guardsound = 6, 0
ground.velocity = 0,-11.35
air.velocity = 0, -11.35
ground.hittime = 12
sparkxy = -12, -101
fall = 1
fall.recover = 0
getpower = 0

[State 3305, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(roundstate >= 3,0,3310)
ctrl = (roundstate >= 3)

; Charge for super taunt
[Statedef 3310]
type = S
movetype = I
physics = S
velset = 0, 0
anim = 3305
poweradd = -2000

[State 3310, 0]
type = VarSet
trigger1 = !time
var(1)=0

[State 3310, 0]
type = VarSet
trigger1 = !time
var(3) = ifelse(screenpos y > 240, floor(230 - screenpos y), 0) -10

[State 3310, 0]
type = VarSet
trigger1 = !time
fvar(0) = screenpos y

[State 3310, 1]
type = SuperPause
trigger1 = 1
time = 2
movetime = 2
anim = -1
p2defmul = 1

[State 3310, 0]
type = Explod
trigger1 = !time
pos = -30,-91
anim = F102
supermovetime = 9999

[State 3310, 1]
type = Explod
trigger1 = !(time%25 || var(1)) 
supermove = 1
removetime = -2
pos = 40, -2
postype = p1
bindtime = 1
ownpal = 1
sprpriority = 5
anim = 7410

[State 3310, 2]
type = PlaySnd
trigger1 = anim = 3305
persistent = 0
value = F20, 0

[State 3310, 2]
type = PlaySnd
trigger1 = anim = 3305
trigger1 = AnimElem = 5
value = 196, 12     ; Kore zo!
channel = 0

[State 3310, 3]
type = Explod
id = 3310
trigger1 = time = 31
persistent = 0
anim = 3310
removetime = -1
pos = 0,-100
postype = p1
ownpal = 1
supermovetime = -1
facing = facing

[State 3310, 3]
type = Helper
id = 3311
trigger1 = time = 31
persistent = 0
stateno = 3311
pos = 0,-140
postype = p1
ownpal = 1
supermovetime = 9999

[State 3310, 3]
type = VarAdd
trigger1 = command = "s"
trigger1 = time <= 120
var(1)=1

[State 3310, 4]
type = RemoveExplod
trigger1 = time = 120
id = 3310

[State 3310, 5]
type = ChangeState
trigger1 = time = 135
value = 3315

; Helper for "Press Start!"
[Statedef 3311]
type = A
physics = N
movetype = I
anim = 7999;3311
velset = 0,0

[State 3311, 0]
type = Turn
trigger1 = facing = -1

[State 3311, 0]
type = BindToRoot
trigger1 = 1;!time
pos = 0,-140
time = 1;-1

[State 3311, 0]
type = Explod
removetime = 89
supermovetime = 89
trigger1 = !time
anim = 3311
ontop = 1
ownpal = 0
scale = .88888889,1
pos = 0,0
bindtime = -1

[State 3311, 0]
type = VarSet
trigger1 = 1
var(0) = floor(256*cos(2*pi*(((time+15)%45)-15)/70.0)-256)

[State 3311, 0]
type = VarSet
trigger1 = 1
var(1) = floor(256*cos(2*pi*((time%45)-15)/70.0)-256)

[State 3311, 0]
type = VarSet
trigger1 = 1
var(2) = floor(256*cos(2*pi*((time%45)-30)/70.0)-256)

[State 3311, 0]
type = PalFX
trigger1 = 1
add = var(0),var(1),var(2)
mul = 512,512,341  ; need to counteract SuperPause darkening
time = 2

[State 3311, 0]
type = DestroySelf
trigger1 = time = 89

; Hold taunt
[Statedef 3315]
type = S
movetype = I
physics = S
velset = 0, 0
anim = 3306

[State 3315, 0]
type = VarSet
trigger1 = time = 0
v = 3
value = 0

[State 3315, 0]
type = VarAdd
trigger1 = time > 0
v = 3
value = 1

[State 3315, 1]
type = Explod
trigger1 = time = 22
removetime = -2
pos = 40, -2
postype = p1
bindtime = 1
ownpal = 1
sprpriority = 5
anim = 7410

[State 3315, 1]
type = ChangeState
trigger1 = command = "s"
trigger1 = time >= 8
value = 3320

[State 3315, 0]
type = ChangeState
trigger1 = time = 55
value = 3325

[State 3315, 2]
type = PalFX
trigger1 = var(3) >= 8 ;[8,20]
add = 2*(var(3)-7),2*(var(3)-7),2*(var(3)-7);16, 16, 16  
time = 2

; Super taunt
[Statedef 3320]
type = S
movetype = A
physics = S
velset = 0,0
anim = 3320

[State 3320, 0]
type = PlaySnd
trigger1 = AnimElem = 1
value = 196, 13    ; Saikyou-ryuu!
channel = 0

[State 3320, 0]
type = HitDef
trigger1 = AnimElem = 3
persistent = 0
attr = S, HA
hitflag = MAF
guardflag = MA 
damage = 91+floor((-.21*var(1)+14)*var(1)),2+var(1)
getpower = 80
givepower = -80
animtype = DiagUp
pausetime = 5,5
sparkxy =  0,-95
hitsound   = 5,4
guardsound = 6,0
ground.velocity = -5, -8
air.velocity = -5, -8
p2stateno = 3355
fall = 1
fall.damage = 20
fall.recover = 0
down.velocity = -3
down.bounce = 1

[State 3320, 1]
type = HitDef
trigger1 = AnimElem = 3, = 1
type = none

[State 3320, 2]
type = ChangeState
trigger1 = time = 40
value = 0
ctrl = 1

[State 3320, 4]
type = TargetBind
trigger1 = movecontact = 1
ignorehitpause=1
persistent = 0
pos = 41, -89
time = 1

[State 3320, 4]
type = EnvColor
trigger1 = movecontact
persistent = 0
ignorehitpause = 1
value = 231, 231, 231
time = 3

[State 3320, 4]
type = Helper
trigger1 = movecontact = 1
ignorehitpause = 1
persistent = 0
pos = 41, -89
postype = p1
stateno = 3321
keyctrl = 0
ownpal = 1

[Statedef 3321]
type = A
movetype = I
physics = N
velset = 0,0
anim = 7999

[State 3321, 0]
type = BindToRoot
trigger1 = 1;!time
time = 1;-1
pos = 41, -89

[State 3321, 0]
type = Explod
trigger1 = time = 3
anim = 3325
id = 1
pos = 0,0
postype = p1
ownpal = 0
bindtime = -1
removetime = -1
scale = fvar(0):=1.0,fvar(1):=1.0
sprpriority = 4

[State 3321, 0]
type = Explod
trigger1 = time = 6
anim = 3326
id = 2
pos = 0,0
postype = p1
ownpal = 1
bindtime = -1
removetime = -1
scale = fvar(2):=1.0,fvar(3):=1.0
sprpriority = 4

[State 3321, 1]
type = ModifyExplod
id = 1
trigger1 = time > 8
scale=(fvar(0):=(fvar(0)+.03)),(fvar(1):=(fvar(1)+.03))

[State 3321, 1]
type = ModifyExplod
id = 2
trigger1 = time > 10
scale=(fvar(2):=(fvar(2)+.06)),(fvar(3):=(fvar(3)+.06))

[State 3321, 0]
type = PalFx
trigger1 = time > 8
add = -24*(time-5),-24*(time-5),-24*(time-5)
time = 2

[State 3321, 0]
type = RemoveExplod
id = 2
trigger1 = time = 16

[State 3321, 0]
type = RemoveExplod
trigger1 = time = 18

[State 3321, 0]
type = DestroySelf
trigger1 = time = 18

; Super taunt overcharge
[Statedef 3325]
type = S
movetype = H
physics = S
velset = 0,0

[State 3325, 0]
type = PalFX
trigger1 = time = [1,4]
time = 2
add = 256, 256, 256

[State 3325, 5]
type = Explod  ; literally!
trigger1 = time = 4
anim = 7400
pos = 0,0
postype = p1
bindtime = 1
sprpriority = 5
ownpal = 1

[State 3325, 6]
type = PlaySnd
trigger1 = time = 5
value = 0,3400

[State 3325, 5]
type = AssertSpecial
trigger1 = time = [4, 23]
flag = noshadow

[State 3325, 6]
type = ChangeState
trigger1 = time = 22
value = 3330

; Dan sent flying
[Statedef 3330]
type = A
movetype = H
physics = N
velset = -1, -6
anim = 5052

[State 3330, 0]
type = Gravity
trigger1 = time > 0

[State 3330, 2]
type = ChangeAnim
trigger1 = Vel Y > -.5
persistent = 0
value = 5062

[State 3330, 3]
type = LifeAdd
trigger1 = time = 0
value = -75

[State 3330, 3]
type = ChangeState
trigger1 = Pos Y > 0
value = 5100

; Grabbed by kataki
[Statedef 3350]
type = S
movetype = H
physics = S
ctrl = 0

[State 3350, 0]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 3350, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3350, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 3350

[State 3350, 2]
type = SelfState
trigger1 = animtime = 0
value = 0
ctrl = 1

; Hit by mega taunt
[Statedef 3355]
type = A
movetype = H
physics = N
ctrl = 0

[State 3355, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 2111

[State 3355, 0]
type = VelSet
trigger1 = time <= 4
x = -5
y = -8

[State 3355, 3]
type = ChangeState 
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3360

[State 3355, 4]
type = AngleSet
trigger1 = Time = 0
value = 0

[State 3355, 5]
type = AngleAdd
trigger1 = Time >= 1
value = 22.5

[State 3355, 6]
type = AngleDraw
trigger1 = Time >= 1

[State 3355, 4]
type = VelAdd
trigger1 = time > 0
y = .35

; bounce
[Statedef 3360]
type    = L
movetype= H
physics = N

[State 3360, 0]
type = HitFallDamage
trigger1 = time = 0

[State 3360, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
trigger1 = time = 0
value = 5100

[State 3360, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 3360, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 3360, 3] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 3360, 4]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

[State 3360, 5]
type = PlaySnd
trigger1 = Time = 1
value = F7, 0 ;Hit ground

[State 3360, 6]
type = PosFreeze
trigger1 = Time >= 0

[State 3360, 7]
type = VelSet
trigger1 = time = 3
y = -3

[State 3360, 7]
type = SelfState 
trigger1 = Time = 3
value = 5101

[State 3360, 8]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
;ampl = 255,-3,-.2,.005
time = 20

; Otoko Michi
[Statedef 3400]
type = S
movetype = A
physics = N
juggle = 3
anim = 3400
poweradd = -1000
ctrl = 0

[State 3400, 0]
type = VarAdd
trigger1 = !time
var(59) = 1

[State 3400, 0]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 3400, 0]
type = Explod
trigger1 = AnimElem = 1
pos = 40, -2
supermove = 1
removetime = -2
sprpriority = 4
anim = 7405

[State 3400, 0]
type = SuperPause
trigger1 = AnimElem = 1
time = 30;45
anim = -1

[State 3400, 1]
type = PlaySnd
trigger1 = AnimElem = 1 
value = F20,0

[State 3400, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3400, 0 ; todome da!
;channel = 0

[State 3400, 3]
type = VelSet
trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 3, < 0
x = 7

[State 3400, 4]
type = VelMul
trigger1 = AnimElem = 3, >=0
x = .9

[State 3400, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 3400, 5]
type = HitDef
trigger1 = AnimElem = 2
attr = S, HT
damage   = 21
hitflag = M
guardflag = N
p1stateno = 3410
p2stateno = 3415
sparkxy =  -5,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
getpower = 0

[State 3400, 6]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

; Otoko Michi success
[Statedef 3410]
type = S
movetype = A
physics = S
velset = 0,0
anim = 3410

[State 3410, 0]
type = ChangeState
trigger1 = time = 78
value = 3411

[State 3410, 1]
type = TargetBind
trigger1 = time >= 0
pos = 1, 0

[State 3410, 1]
type = PlaySnd
trigger1 = time = 0
value = 197, 7    ; uruuto yatta ze, oyaji!
channel = 0

[State 3410, 2]
type = Explod
trigger1 = AnimElem = 3
anim = F102
postype = p1
pos = 11, -82
sprpriority = -1

[State 3410, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3200  ; super charge

[State 3410, 4]
type = PalFX
trigger1 = time = 57
trigger1 = palno != 11
add = 256,256,256
time = 3

[State 3410, 4]
type = PalFX
trigger1 = time = 57
trigger1 = palno = 11
add = 256,-256,256
time = 3

[State 3410, 5]
type = NotHitBy
trigger1 = time >= 57
value = SCA

[State 3410, 5]
type = Explod  ; literally!
trigger1 = time = 60
anim = 7400
pos = 20,0
postype = p1
bindtime = 1
sprpriority = 5

[State 3410, 5]
type = AssertSpecial
trigger1 = time >= 60
flag = noshadow

[State 3410, 6]
type = PlaySnd
trigger1 = time = 58
value = 0,3400

; Dan sent flying
[Statedef 3411]
type = A
movetype = H
physics = N
velset = -3.5, -6
anim = 5052

[State 3411, 0]
type = Gravity
trigger1 = time > 0

[State 3411, 2]
type = ChangeAnim
trigger1 = Vel Y > -.5
persistent = 0
value = 5062

[State 3411, 3]
type = LifeAdd
trigger1 = time = 0
value = -750
kill = 0

[State 3411, 3]
type = ChangeState
trigger1 = Pos Y > 0
value = 5100

; Otoko Michi grabbed
[Statedef 3415]
type = S
movetype = H
physics = S
velset = 0,0
ctrl = 0

[State 3415, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 3415

[State 3415, 5]
type = AssertSpecial
trigger1 = time >= 60
flag = noshadow

[State 3415, 0]
type = ChangeState 
trigger1 = time = 78
value = 3420

[State 3415, 1]
type = ChangeState
trigger1 = time < 3
trigger1 = command = "recovery"
value = 3416

; Otoko Michi grabbed (tech hit)
[Statedef 3416]
type = S
movetype = H
physics = S
velset = 0,0
ctrl = 0

[State 3416, 0]
type = PalFX
trigger1 = time < 3
time = 2
add = -32,64,-32

[State 3416, 5]
type = AssertSpecial
trigger1 = AnimElem = 1, >= 60
flag = noshadow

[State 3416, 0]
type = ChangeState 
trigger1 = AnimElem = 1, =78
value = 3420

; Sent flying by Otoko Michi
[Statedef 3420]
type = A
movetype = H
physics = N
velset = -6, -9

[State 3420, 0]
type = ChangeAnim
trigger1 = selfanimexist(5052)
trigger1 = time = 0
value = 5052

[State 3420, 0]
type = ChangeAnim
trigger1 = anim = 5052
trigger1 = selfanimexist(5062)
trigger1 = Vel Y > -.5
persistent = 0
value = 5062

[State 3420, 0]
type = ChangeAnim
trigger1 = Vel Y > -.5
trigger1 = !selfanimexist(5052)
trigger1 = selfanimexist(5051)
value = 5051

[State 3420, 1]
type = LifeAdd
trigger1 = time = 0
value = ifelse(prevstateno = 3416,-20,-80)
kill = (prevstateno != 3416)

[State 3420, 2]
type = Gravity
trigger1 = time > 0

[State 3420, 3]
type = SelfState
trigger1 = Vel Y >= 9
trigger1 = Pos Y > 0
value = 5100

[State 3420, 0]
type = SelfState
trigger1 = !selfanimexist(5052)
trigger1 = !time
value = 5050

; recover if tech hit
[State 3420, 4]
type = VelMul
trigger1 = prevstateno = 3416
trigger1 = time = 15
x = .6
y = .4

[State 3420, 4]
type = SelfState
trigger1 = prevstateno = 3416
trigger1 = time = 15
value = 5210

;----------------------------------------------------
;----------------------------------------------------
[Statedef 9999]
type = S

[State 9999, 0]
type = VarAdd
trigger1 = time = 0
v = 19
value = 1

[State 9999, 1random]
type = VarRandom
trigger1 = Time = 0
v = 19
range = 0,3

[State 9999, 2]
type = ChangeState
trigger1 = time = 0
trigger1 = var(19) = 0
value = 9998

[State 9999, 3]
type = ChangeState
trigger1 = time = 0
trigger1 = var(19) = 1
value = 3450

[State 9999, 4]
type = ChangeState
trigger1 = time = 0
trigger1 = var(19) = 2
value = 9990

[State 9999, 5]
type = ChangeState
trigger1 = time = 0
trigger1 = var(19) = 3
value = 9996

;----------------------------------------------------
;----------------------------------------------------
; Jimmy's banana attack
; return values:
; var(7) is the strength (light, med, strong, aim)
; var(16) is the absolute facing (forward or back) 
; var(17) is false if postype = front (why oh why isn't there a facing param
;   to Helper???
[Statedef 3450]
type = S
movetype = A
physics = S
velset = 0, 0
juggle = 0
ctrl = 0
poweradd = 40
anim = 3450

[State 3450, 0]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3450, 0]
type = VarSet
trigger1 = !time
var(16) = 0

[State 3450, 0]
type = VarSet
trigger1 = time = 0
var(1) = var(5) = 4

[State 3450, 0]
type = VarSet
trigger1 = time = 0
var(3) = numhelper(3477) = 4

[State 3450, 0]
type = VarSet
trigger1 = time = 0
var(5) = (var(5)+1)%5

[State 3450, 0]
type = VarSet
trigger1 = !time
var(7) = ifelse(command="x",0,ifelse(command="y",1,ifelse(command="z",2,3)))

[State 3450, 0]
type = VarSet
trigger1 = !time
var(17) = ifelse(command="straightfwd",0,ifelse(command="straightdown",1,2))

[State 3450, 0]
type = VarSet
trigger1 = command = "tapback"
trigger1 = command != "releaseback"
var(16) = -facing

[State 3450, 0]
type = VarSet
trigger1 = command = "tapfwd"
trigger1 = command != "releasefwd"
var(16) = facing

[State 3450, 0]
type = helper
trigger1 = AnimElem = 4
trigger1 = var(17) = 0
pos = 40, -140
postype = front
helpertype = normal
id = 3450
stateno = 3470
keyctrl = 0
name = "Dan's Jimmy"
ownpal = 1

[State 3450, 0]
type = helper
trigger1 = AnimElem = 4
trigger1 = var(17) = 1
pos = 60, -200
postype = p1
helpertype = normal
id = 3450
stateno = 3470
keyctrl = 0
name = "Dan's Jimmy"
ownpal = 1

[State 3450, 0]
type = helper
trigger1 = AnimElem = 4
trigger1 = var(17) = 2
pos = -40, -140
postype = back
helpertype = normal
id = 3450
stateno = 3470
keyctrl = 0
name = "Dan's Jimmy"
ownpal = 1

[State 3450, 1]
type = ChangeState
trigger1 = time = 60
trigger1 = var(1) = 0
trigger1 = var(3) = 0
value = 0
ctrl = 1

[State 3450, 2]
type = ChangeState
triggerall = time = 100
trigger1 = var(1) = 1
trigger2 = var(3) = 1
value = 3455

[State 3450, 2]
type = PlaySnd
trigger1 = time = AnimElem = 2
value = 3450, 0   ; yuujou!
channel = 0

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

[State 3455, 0]
type = PlaySnd
trigger1 = time = 3
value = 3455, 0    ; Sorya nai ssu!
channel = 0

[State 3455, 0]
type = ChangeState
trigger1 = time = 90
value = 0
ctrl = 1

; Jimmy's air roll
[Statedef 3470]
type = A
movetype = A
physics = N
;velset = 3.5, -2
anim = 7520

[State 3470, 0]
type = Turn
trigger1 = !time
trigger1 = !parent,var(17)

[State 3470, 0]
type = VelSet
trigger1 = !time
x = ifelse(parent,var(17)-1,3.5,0)
y = ifelse(parent,var(17)-1,-2,0)

[State 3470, 0]
type = VarSet
trigger1 = !time
var(2) = parent, var(7)

[State 3470, 0]
type = VarSet
trigger1 = !time
var(17) = parent, var(17)

[State 3470, 0]
type = ParentVarSet
trigger1 = !time
var(7) = 0

[State 3470, 0]
type = VarSet
trigger1 = 1;!time
var(16) = parent, var(16)

[State 3470, 0]
type = Gravity
trigger1 = time > 0

[State 3470, 1]
type = VarSet
trigger1 = !time
var(3) = parent,var(1) || parent,var(3)

[State 3470, 1]
type = ChangeState
trigger1 = Pos Y > 0
value = ifelse(var(3),3475,3471)

[State 3470, 1]
type = VarSet
trigger1 = !time
var(0) = 7575   ; desired state after getting hit

[State 3470, 1]
type = HitOverride
trigger1 = 1;!time
time = 1
stateno = 7570
slot = 0
attr = SCA, AA, AT, AP

[State 3470, 2]
type = PlaySnd
trigger1 = time = 1
value = 7470, 0   ; roarr!
channel = 0

[State 3470, 3]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 210   ; whoosh

[State 3470, 4]
type = SprPriority
trigger1 = time = 0
value = 3

[State 3470, 5]
type = HitDef
trigger1 = !time ;1
damage = 90,0
animtype = back
sparkxy = -3,-40
id = 3470
nochainid = 3470
attr = A,SA
hitflags=MA
guardflags = N
air.hittime = 14
ground.velocity = -4.2,-5
guard.dist = 50
sparkno = 3
hitsound = 5,3
pausetime = 9,9
air.velocity = -4.8,2
air.fall = 1
air.fall.recover = 0
air.hittime = 8
down.bounce = 1
down.velocity = -3

; Jimmy's banana throw
[Statedef 3471]
type = S
movetype = A
physics = S
velset = 0, 0
anim = ifelse(var(3):=(var(16)=-facing),7531,7510)
; var(3) must be preserved; until banana is thrown

[State 3471, 0]
type = VarSet
trigger1 = RoundState = 3
persistent = 0
var(15) = p2life = p2life

[State 3471, 0]
type = VarSet
trigger1 = RoundState = 3
trigger1 = (p2life = p2life)
fvar(0) = P2Dist X

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

[State 3471, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3471, 1]
type = VarSet
trigger1 = !time
var(0) = 7579   ; desired state after getting hit

[State 3471, 1]
type = HitOverride
trigger1 = time >= 0
time = 1
stateno = 7580
forceair = 1
slot = 0
attr = SCA, AA, AT, AP

[State 3471, 1]
type = VarSet
trigger1 = anim = 7531
trigger1 = animelem = 3;6
var(8)=1

[State 3471, 1]
type = VarSet
trigger1 = anim = 7531
trigger1 = animelem = 4;10
var(8)=2

[State 3471, 1]
type = VarSet
trigger1 = anim = 7531
trigger1 = animelem = 6;12
var(8)=0

[State 3471, 1]
type = VarSet
trigger1 = anim = 7531
trigger1 = animelem = 3 || animelem = 5 ;9 || animelem = 11
var(9)=31+!(var(10):=-27)

[State 3471, 1]
type = VarSet
trigger1 = anim = 7531
trigger1 = animelem = 4;10
var(9)=34+!(var(10):=-34)

[State 3471, 0]
type = AttackDist
trigger1 = time = 0
value = 0

[State 3471, 1]
type = VarAdd
trigger1 = var(1) > 0
v = 1
value = 1

[State 3471, 1]
type = PlaySnd
trigger1 = anim = 7531
trigger1 = AnimElem = 4;10
value = 7470, 1    ; munch
channel = 0

[State 3471, 2]
type = helper
helpertype = normal
pos = 7, -68
postype = p1
trigger1 = anim = 7531
trigger1 = animelem = 6;12
keyctrl = 0
ownpal = 1
id = 3477
name = "Dan's Jimmy's banana"
stateno = 3477
size.xscale = 1
size.shadowoffset = 0
facing = -1

[State 3471, 1]
type = Turn
trigger1 = anim = 7510
trigger1 = animtime = 0

[State 3471, 1]
type = ChangeAnim
trigger1 = anim = 7510
trigger1 = animtime = 0
value = 7530

[State 3471, 1]
type = ChangeAnim
trigger1 = anim = 7530
trigger1 = animtime = 0
value = 7531

[State 3471, 2]
type = ChangeState
triggerall = matchover = 0
triggerall = win = 0
trigger1 = time = 160-var(3)*11
trigger2 = time >= 120-var(3)*11
trigger2 = var(1) >= 15
value = 3473

[State 3471, 3]
type = ParentVarSet
trigger1 = matchover = 1
v = 6
value = 1

[State 3471, 4]
type = ChangeState
trigger1 = parent, var(7) = 1
value = 3485

[State 3471, 4]
type = ChangeState
trigger1 = parent, var(7) = 2
trigger1 = time >= 120
value = 3473

; banana thrown (init state) through air
[Statedef 3477]
type = A
physics = N
movetype = A
anim = 7540

[State 3477, 0]
type = SprPriority
trigger1 = !time
value = 3

[State 3477, 0]
type = Turn
trigger1 = !time 
trigger1 = !var(3)
persistent = 0

[State 3477, 0]
type = VarSet
trigger1 = !time
var(0) = parent, var(2)

[State 3477, 0]
type = VarSet
trigger1 = !time
var(15) = parent, var(15)

[State 3477, 0]
type = VarSet
trigger1 = !time
fvar(1) = parent, fvar(0)

[State 3477, 0]
type = VarSet
trigger1 = !time
var(9)= p2life = p2life

[State 3477, 0]
type = VarSet
trigger1 = !time
fvar(0) = 160.0

[State 3477, 0]
type = VarSet
trigger1 = !time
trigger1 = var(0)=3
trigger1 = var(9)
fvar(0)= P2Dist X

[State 3477, 0]
type = VelSet
trigger1 = !time
x = ifelse(var(0)=3,ifelse(fvar(0)>=0,fvar(0)/80.0,2),2**var(0))
y = ifelse(var(0)=3,-8,-5-2*var(0))

[State 3477, 1]
type = HitOverride
trigger1 = time >= 0
time = 1
stateno = 3479
slot = 0
attr = SCA, AA, AT, AP

[State 3477, 0]
type = ChangeState
trigger1 = time!=0
value = 3474

; banana flying through air (general)
[Statedef 3474]
type = A
physics = N
movetype = A

[State 3474, 0]
type = VelAdd
trigger1 = time >= 0
y = .2

[State 3474, 1]
type = HitOverride
trigger1 = time >= 0
time = 1
stateno = 3479
slot = 0
attr = SCA, AA, AT, AP

[State 3474, 0]
type = VelMul
trigger1 = frontedgedist <= -6
;trigger1 = var(0)=2
persistent = 0
x = -.6

[State 3474, 0]
type = Turn
trigger1 = frontedgedist <= -6
;trigger1 = var(0)=2
persistent = 0

[State 3474, 0]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage = 40, 4
guardflag = MA
hitflag = MAF
;sparkno = 0, 5
hitsound = 5, 1
animtype = light
ground.type = high
ground.hittime = 12
ground.velocity = -1
guard.dist = 20
priority = 6
p1getp2facing = -1   ; face opposite direction
getpower = 20

[State 3474, 1]
type = ChangeState
trigger1 = movecontact = 1
value = 3478

[State 3474, 4]
type = VelSet
trigger1 = Pos Y >= -1
y = 0

[State 3474, 5]
type = PosSet
trigger1 = Pos Y >= -1
y = 0

[State 3474, 5]
type = ChangeState
trigger1 = root, var(15) = 1
value = 3499

[State 3474, 4]
type = helper
trigger1 = Pos Y = 0
trigger1 = Vel Y = 0
helpertype = normal
pos = 0, 0
postype = p1
keyctrl = 0
ownpal = 1
id = 3477
name = "Dan's Jimmy's banana"
stateno = 3472
size.xscale = 1
size.shadowoffset = 0
facing = 1

[State 3474, 5]
type = DestroySelf
trigger1 = Pos Y = 0 && Vel Y = 0

; Banana custom hit state
[Statedef 3479]
type = A
movetype = I
physics = N
anim = 7540
facep2 = 1
velset = GetHitVar(xvel), GetHitVar(yvel)
movehitpersist = 1

[State 3479, 1]
type = ChangeState
trigger1 = movecontact
value = 3478

[State 3479, 1]
type = ChangeState
value = 3474
trigger1 = !time

; banana on ground
[Statedef 3472]
type = S
ctrl = 0
movetype = A
velset = 0, 0
anim = 7541

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

[State 3472, 0]
type = HitDef
trigger1 = !time
velocity = 0
attr = S, SP
damage = 40, 4
guardflag = N
guard.dist = 0
hitflag = MF
sparkno = 1
hitsound = 5, 1
animtype = light
p1getp2facing = 1    ; face same direction
ground.type = trip
ground.velocity = n, -4
hitonce = 1
getpower = 20

[State 3472, 0]
type = ChangeState
trigger1 = movecontact = 1
value = 3476

; play banana removal anim
[Statedef 3476]
type = A
movetype = H
physics = N
anim = 7547

[State 3476, 0]
type = VelSet
trigger1 = time = 1
x = numtarget > 0
y = -3

[State 3476, 1]
type = VelAdd
trigger1 = time > 1
y = .15

[State 3476, 1]
type = DestroySelf
trigger1 = time = 30

; play banana hit anim
[Statedef 3478]
type = A
movetype = H
physics = N
anim = 7547

[State 3478, 0]
type = VelSet
trigger1 = time = 1
x = -1
y = -2

[State 3478, 1]
type = VelAdd
trigger1 = time > 1
y = .15

[State 3478, 1]
type = DestroySelf
trigger1 = time = 30

; Jimmy picks up blender (from normal blender anim)
[Statedef 3469]
type = S
movetype = I
physics = S
velset = 0,0
anim = 7558

[State 3469, 0]
type = VarSet
trigger1 = !time
var(3) = 0

[State 3469, 0]
type = ChangeState
trigger1 = !animtime
value = 3473

[State 3469, 0]
type = HitOverride
trigger1 = !time
slot = 0
time = -1
stateno = 7585
attr = SCA, AA, AT, AP

; Jimmy leaves
[Statedef 3473]
type = A
movetype = I
physics = N
velset = 0, 0
anim = ifelse(var(3),7524,7521)

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

[State 3473, 0]
type = ChangeState
trigger1 = var(17) = 1 
value = 3497

[State 3473, 0]
type = VelSet
trigger1 = AnimElem = 2, = 1
x = ifelse(var(3),-5.5,5.5)
y = -12.75

[State 3473, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = 0, 200   ; whoosh

[State 3473, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 7470, 2  ; wahoo!
channel = 0

[State 3473, 3]
type = Gravity
trigger1 = AnimElem = 2, > 2

[State 3473, 1] 
type = DestroySelf
triggerall = AnimElem = 2, > 1
trigger1 = Pos X > 160
trigger2 = Pos Y < -240
trigger3 = Pos Y > 0

; Jimmy don't wanna play
[Statedef 3475]
type = S
movetype = I
physics = S
velset = 0, 0
anim = 7510

[State 3475, 0]
type = HitOverride
trigger1 = !time
time = -1
slot = 0
attr = SCA, AA, AT, AP
stateno = 7585

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

[State 3475, 1]
type = Turn
trigger1 = anim = 7510
trigger1 = animtime = 0

[State 3475, 1]
type = ChangeAnim
trigger1 = anim = 7510
trigger1 = animtime = 0
value = 7550

[State 3475, 2]
type = ChangeState
trigger1 = time = 230
;trigger1 = win = 0
value = 3469;3473

[State 3475, 3]
type = PlaySnd
triggerall = anim = 7550
trigger1 = AnimElem = 12
trigger2 = AnimElem = 16
value = 7470,3   ; zap

[State 3475, 4]
type = ParentVarSet
trigger1 = var(1):=(win && Pos X = [-215,215])
persistent = 0
v = 6
value = 6

[State 3475, 0]
type = Turn
trigger1 = var(1)
persistent = 0

[State 3475, 0]
type = helper
trigger1 = var(1)
persistent = 0
;trigger1 = !numhelper(7640)
pos = ifelse((Pos X!=[-160,159]),floor((153-abs(Pos X))*ifelse(anim=7510,-1,1)*facing*Pos X/abs(Pos X)),0),0
postype = p1
stateno = 7698
ownpal = 0
id = 7640
helpertype = player
name = "Dan's Jimmy's cameraman"
size.ground.back=0
size.ground.front=0
keyctrl = 0

[State 3475, 0]
type = Turn
trigger1 = var(1)
persistent = 0

[State 3475, 5]
type = ChangeState
trigger1 = win = 1
trigger1 = anim = 7550
trigger1 = AnimElemNo(0) > 20
trigger1 = Pos X = [-200,200]
value = 7640

; Win pose with Jimmy
[Statedef 3480]
type = S
physics = N
anim = 3480  

[State 3480, 0]
type = VarSet
trigger1 = time = 0
v = 7
value = 1  ; notify helper

[State 3480, 0]
type = VelSet
trigger1 = time >= 3
x = 4.4

; Hack to keep a bit ahead of Jimmy
[State 3480, 0]
type = VelSet
trigger1 = helper(3450),facing=facing
trigger1 = helper(3450),RootDist X = [40,75]
x = 4.8

[State 3480, 1]
type = Turn
trigger1 = frontedgedist <= 25

[State 3480, 2]
type = PlaySnd
trigger1 = time = 15
value = 3480, 0   ; Yahoo! Ore tte saikyou!
channel = 0

[State 3480, 2]
type = PlaySnd
trigger1 = time = 175
value = 198, 8    ; Oyaji! 
channel = 0

[State 3480, 3]
type = NotHitBy
trigger1 = time >= 0
value = SCA

[State 3480, 4]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 3480, 4]
type = ScreenBound
trigger1 = time >= 0
value = 1
movecamera = 0,0

[State 3480, 4]
type = AssertSpecial
trigger1 = time = [0, 280]
flag = roundnotover

; Jimmy's win pose with Dan
[Statedef 3485]
type = S
physics = N
anim = 7522  

[State 3485, 0]
type = VelSet
trigger1 = time >= 3
x = 4.4

[State 3485, 1]
type = Turn
trigger1 = frontedgedist <= 25
trigger1 = backedgedist < 320
trigger1 = RootDist X != [-40,40]
trigger2 = backedgedist >= 320

[State 3485, 2]
type = PlaySnd
trigger1 = time = 20
value = 7470, 4   ; cackle
channel = 0

[State 3485, 2]
type = PlaySnd
trigger1 = time = 105
value = 7470, 5   ; rowww!
channel = 0

[State 3485, 3]
type = NotHitBy
trigger1 = time >= 0
value = SCA

[State 3485, 4]
type = PlayerPush
trigger1 = time >= 0
value = 0

; taunt
[Statedef 3491]
type = S
movetype = I
physics = S
ctrl = 0

[State 3491, 0]
type = VarSet
trigger1 = 1
var(15)=1

; bail if something's wrong.
[State 3491, 0]
type = ChangeState
triggerall = !time
trigger1 = !numhelper(3477)
trigger2 = time =1 && helper(3477),stateno!=3499
value = 0
ctrl = 1

[State 3491, 0]
type = VarAdd
trigger1 = time = 1
var(59) = 1

[State 3491, 0]
type = ChangeAnim
trigger1 = time = 10
trigger1 = (anim = [800,801]) || anim = 195 || anim = 0 || anim = 2102
trigger2 = anim=12 && !animtime
value = 3490 + 0*(var(1):=time)

[State 3491, 1]
type = ChangeAnim
triggerall = time = 6
trigger1 = anim = 11
trigger2 = anim = 802
value = 12

[State 3491, 1]
type = PlaySnd
triggerall = anim = 3490
trigger1 = time = var(1)+3
value = 3491, 0    ; me ga nai ssu!
channel = 0

[State 3491, 2]
type = ChangeState
triggerall = anim = 3490
trigger1 = time = var(1)+75
value = 0
ctrl = 1

[Statedef 3492]
type = S
movetype = I
physics = S

[State 3492, 0]
type = ChangeState
trigger1 = time = 30
value = 0
ctrl = 1

; Banana knocked off Dan's head
[Statedef 3493]
type = A
movetype = H
physics = N
velset = -2, -4
anim = 7547

[State 3493, 0]
type = VelAdd
trigger1 = time > 0
y = .2

[State 3493, 1]
type = DestroySelf
trigger1 = time = 30

; Banana falling naturally off Dan's head
[Statedef 3494]
type = A
movetype = H
physics = N
velset = -1.6, 0
anim = 7547

[State 3494, 0]
type = VelAdd
trigger1 = time > 0
y = .1

[State 3494, 1]
type = DestroySelf
trigger1 = time = 30

; Jimmy leaves -- straight up
[Statedef 3497]
type = A
movetype = I
physics = N
velset = 0, 0
anim = 7521

[State 3497, 0]
type = VelSet
trigger1 = AnimElem = 2, = 1
y = -12.75

[State 3497, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = 0, 200   ; whoosh

[State 3497, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 7470, 2  ; wahoo!
channel = 0

[State 3497, 3]
type = Gravity
trigger1 = AnimElem = 2, > 2

[State 3497, 1] 
type = DestroySelf
triggerall = AnimElem = 2, > 1
trigger1 = Pos Y < -240

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

; Banana landing on Dan's head
[Statedef 3499]
type = A
movetype = H
physics = N
anim = 7541
velset = 0, 0

[State 3499, 0]
type = SprPriority
trigger1 = time = 0
value = 3

; note: for desired x offset x_0, use x_0-1+root,facing due to bug (?)

[State 3499, 0]
type = VarSet
trigger1 = !time
var(32)=-1

[State 3499, 0]
type = VarSet
trigger1 = root,anim=0
trigger1 = root,stateno!=var(32)
var(0)=!((var(1):=var(3):=-94)+(var(2):=-92)+(var(4):=var(6):=-99+root,facing)+(var(5):=-101+root,facing))

[State 3499, 0]
type = VarRangeSet
trigger1 = root,anim=0
trigger1 = root,stateno!=var(32)
first = 8
last = 13
value = 4

[State 3499, 1]
type = VarSet
trigger1 = root,anim=195
trigger1 = root,anim!=var(32)
var(0)=(var(1):=-94)+(var(2):=-91)+(var(3):=var(4):=-92)

[State 3499, 1]
type = VarSet
trigger1 = root,anim=195
trigger1 = root,anim!=var(32)
var(0)=!((var(8):=5+root,facing)+(var(9):=13+root,facing)+(var(10):=var(11):=22+root,facing))

[State 3499, 2]
type = VarSet
trigger1 = root,anim=11
trigger1 = root,anim!=var(32)
var(0)=0*((var(1):=-65)+(var(8):=3+root,facing))

[State 3499, 3]
type = VarSet
trigger1 = root,anim=12
trigger1 = root,anim!=var(32)
var(0)=0*((var(8):=var(9):=2+root,facing)+(var(1):=-72)+(var(2):=-89))

[State 3499, 3]
type = VarSet
trigger1 = root,anim=47 || root,anim = 40
trigger1 = root,anim!=var(32)
var(0)=0*((var(8):=2+root,facing)+(var(1):=-89))

[State 3499, 5]
type = VarSet
trigger1 = (root,anim = 2102) || (root,anim=[800,801])
trigger1 = root,anim!=var(32)
var(0)=(var(1):=-72)+(var(2):=-89)+(var(3):=-94)+(var(4):=-91)+(var(5):=var(6):=-92)

[State 3499,5]
type = VarSet
trigger1 = (root,anim=[800,801]) || (root,anim = 2102)
trigger1 = root,anim!=var(32)
var(0)=13+!((var(8):=var(9):=2+root,facing)+(var(10):=5+root,facing)+(var(11):=13+root,facing)+(var(12):=var(13):=22+root,facing))

[State 3499, 5]
type = VarSet
trigger1 = root,anim = 2102
var(0) = 0

[State 3499, 4]
type = VarSet
trigger1 = root,anim=3490
trigger1 = root,anim!=var(32)
var(0)=0*((var(8):=4+root,facing)+(var(9):=var(10):=6+root,facing)+(var(1):=-91)+(var(2):=var(3):=-93))

[State 3499, 5]
type = VarSet
trigger1 = root,anim=802
trigger1 = root,anim!=var(32)
var(0)=(var(1):=var(2):=-65)+(var(3):=var(4):=-67)

[State 3499, 5]
type = VarSet
trigger1 = root,anim=802
trigger1 = root,anim!=var(32)
var(0)=0*((var(8):=5+root,facing)+(var(9):=8+root,facing)+(var(10):=var(11):=17+root,facing))

[State 3499, 6]
type = VarSet
trigger1 = root,anim=100
trigger1 = root,anim!=var(32)
var(0)=(var(1):=var(2):=var(5):=var(6):=-94)+(var(3):=-84)+(var(4):=-85)+(var(7):=-89)

[State 3499, 6.5]
type = VarSet
trigger1 = root,anim=100
trigger1 = root,anim!=var(32)
var(0)=!((var(8):=var(9):=var(12):=7+root,facing)+(var(10):=20+root,facing)+(var(11):=17+root,facing)+(var(13):=5+root,facing)+(var(14):=1+root,facing))

[State 3499, 7]
type = VarSet
trigger1 = root,anim=810
trigger1 = root,anim!=var(32)
var(0)=2+!((var(1):=-94)+(var(2):=var(3):=-91)+(var(8):=5+root,facing)+(var(9):=var(10):=34+root,facing))

[State 3499, 8]
type = VarSet
trigger1 = root,anim = 803
trigger1 = root,anim!=var(32)
var(0)=0*((var(1):=-95)+(var(2):=var(3):=-102)+(var(8):=9)+(var(9):=var(10):=-13))

[State 3499, 9]
type = VarSet
trigger1 = root,anim = [41,43]
trigger1 = root,anim != var(32)
var(0)=0*((var(1):=-106)+(var(2):=-104)+(var(3):=-103)+(var(8):=-2)+(var(9):=2)+(var(10):=4))

[State 3499, 9]
type = VarSet
trigger1 = root,anim = [44,46]
trigger1 = root,anim != var(32)
var(0)=0*((var(1):=var(3):=var(4):=var(5):=-103)+(var(2):=-100)+(var(8):=4)+(var(9):=5)+(var(10):=-4)+(var(11):=var(12):=-1))

[State 3499, 10]
type = VarSet
trigger1 = 1
var(32) = root,anim
 
[State 3499, 0]
type = BindToRoot
trigger1 = root,var(15)
time = 1
pos = var(7+root,animelemno(0)-var(0)),var(root,animelemno(0)-var(0))
facing = 1

[State 3499, 2]
type = ChangeState
trigger1 = root, movetype = H
value = 3493

[State 3499, 3]
type = ChangeState
trigger1 = !root, var(15)
value = 3494

; Variable Shinkuu Gadouken
[Statedef 3600]
type = S
movetype = A
physics = S
anim = 3605
velset = 0,0
poweradd = -1000
movehitpersist = 1

[State 3600, 0]
type = VarAdd
trigger1 = time = 0
v = 4
value = 1

[State 3600, 0]
type = VarSet
trigger1 = !time
var(18) = 0

[State 3600, 0]
type = VarSet
trigger1 = !time
var(19) = movecontact

[State 3600, 1]
type = MoveHitReset
trigger1 = !time

[State 3600, 0]
type = VarSet
trigger1 = AnimElem = 2, = 1
persistent = 0
var(18) = 1

[State 3600, 0]
type = VarSet
trigger1 = !time
var(1) = (command="qcf_xy")+2*(command="qcf_yz")+4*(command="qcf_xz")

[State 3600, 0]
type = VarSet
trigger1 = !time
var(3) = var(9):=0

[State 3600, 0]
type = Explod
trigger1 = AnimElem = 2
persistent = 0
anim = 7003
supermove = 1
removetime = 60
pos = 160, 230
postype = left
bindtime = -1
ontop = 1

[State 3600, 1]
type = PlaySnd
trigger1 = AnimElem = 2
persistent = 0
value = F20,0

[State 3600, 1]
type = PlaySnd
triggerall = !var(3)
triggerall = roundstate < 3
trigger1 = AnimElem = 2
trigger2 = var(18) && !numexplod(3600)
value = 0,3600

[State 3600, 1]
type = Explod
triggerall = roundstate < 3
trigger1 = var(18) && !numexplod(3600) && !var(3)
trigger2 = AnimElem = 2 && (!var(18))
pos = -30,-90
id = 3600
supermovetime = -1
anim = F102
removetime = -2
postype = p1
sprpriority = 5

[State 3600, 2]
type = SuperPause
triggerall = var(18) || AnimElem = 2
trigger1 = time <= 60
trigger2 = !var(3)
trigger3 = (time - var(3)) < 20
time = 2
anim = -1
p2defmul = 1
movetime = 2

[State 3600, 2]
type = VarSet
persistent = 0
triggerall = time > 0
trigger1 = command = "release_x"
trigger1 = var(1) & 5
trigger2 = command = "release_y"
trigger2 = var(1) & 3
trigger3 = command = "release_z"
trigger3 = var(1) & 6
trigger4 = power <= 0
var(3) = time

[State 3600, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3070, 1    ; Shinkuu
channel = 0

[State 3600, 3]
type = PowerAdd
triggerall = time > 0
trigger1 = var(18)
trigger1 = !var(3)
value = -15

[State 3600, 3]
type = VarAdd
triggerall = time > 0
trigger1 = var(18)
trigger1 = !var(3)
var(9) = 1

[State 3600, 0]
type = RemoveExplod
trigger1 = var(3)
trigger1 = time-var(3) >= 20
trigger1 = time >= 60
trigger2 = var(9) >= 133
trigger2 = roundstate >= 3
id = 3600

[State 3600, 0]
type = ChangeState
trigger1 = var(3)
trigger1 = time-var(3) >= 20
trigger1 = time >= 60
; prevent infinite charge after round is over
trigger2 = var(9) >= 133
trigger2 = roundstate >= 3
value = 3601

[Statedef 3601]
type = S
movetype = A
physics = S

[State 3601, 0]
type = ChangeAnim
trigger1 = time >= var(9)/133.0*8
persistent = 0
value = 3606

[State 3601, 3]
type = Projectile
trigger1 = AnimElem = 2
projanim =  3600  
projhitanim = 3600
projremanim = 3601
projcancelanim = 3602
offset = 82, -68  
velocity = .25+var(9)*.75/133.0, 0 
remvelocity = .25+var(9)*.75/133.0, 0 
;accel = -0.1, 0            ;Acceleration (opt)
projremovetime = 24+floor(48.0/133.0*var(9));72
projremove = 0
projhits = 4 + floor(var(9)*8/133.0+.01)
projmisstime = 7 - (var(9) > 0) - (var(9) > 33) - (var(9) > 66)
; hitdef
attr = S, HP
damage = (40+floor(5*var(9)/133.0+.001)),4
getpower = 0
guardflag = MA
pausetime = 2, 2
sparkxy = 10, 0
hitsound = 5, 3
guardsound = 6, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -1.9+var(9)/133.0, -3
air.velocity = -1.97+var(9)/133.0, -2.15
air.juggle = 3 + (var(9)>0) + (var(9) > 66) + (var(9)>99) + var(19)
fall = 1
fall.animtype = Back
projpriority = 0

[State 3601, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1030, 2    ; Gadouken!
channel = 0

[State 3601, 6]
type = ChangeState
triggerall = anim = 3606
trigger1 = AnimTime = (var(9)-133)/4
trigger2 = !animtime
value = 0
ctrl = 1

[State 3601, 8]
type = width
trigger1 = anim = 3606
trigger1 = AnimElem = 2, > 0
value = 20   ; wider in front

; More Jimmy states.
; Flip backwards (out of air roll)
[Statedef 7570]
type = A
movetype = H
physics = N
;velset = -2.3, -6.3
anim = 7570
facep2 = 1

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

; Assign nice velocities
[State 7570, 0]
type = VelSet
trigger1 = !time
x = ifelse(GetHitVar(xvel)<-6.3,-6.3,ifelse(GetHitVar(xvel)>-2.3,-2.3,GetHitVar(xvel)))
y = ifelse(GetHitVar(yvel)<-12.3,-12.3,ifelse(GetHitVar(yvel)>-6.3,-6.3,GetHitVar(yvel)))

[State 7570, 0] 
type = Gravity
trigger1 = 1

[State 7570, 0] 
type = VelMul
trigger1 = AnimElem = 4, > 0
x = 0.97

[State 7570, 1]
type = ChangeState
trigger1 = Pos Y > -10
trigger1 = vel y > 0
value = var(0);7575

[State 7570, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 7570, 0
channel = 0

; Jimmy howl
[Statedef 7575]
type = S
movetype = I
physics = S
velset = 0,0
anim = 7575

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

[State 7575, 1]
type = VarSet
trigger1 = !time
var(0) = 7579   ; desired state after getting hit

[State 7575, 1]
type = HitOverride
trigger1 = time >= 0
time = 1
stateno = 7580
slot = 0
forceair = 1
attr = SCA, AA, AT, AP

[State 7575, 1]
type = PlaySnd
trigger1 = animelem = 8
value = 7570,1
channel = 0

[State 7575, 1]
type = ChangeState
trigger1 = anim = 7575 && animtime = 0
value = 7576

; Start Jimmy's rolling attack
[Statedef 7576]
type = A
movetype = A
physics = N
velset = 10,0
anim = 7576

[State 7576, 0]
type = PosSet
trigger1 = !time
y = -10

[State 7576, 1]
type = VarSet
trigger1 = !time
var(0) = 7579   ; desired state after getting hit

[State 7576, 1]
type = VarSet
trigger1 = !time
var(5) = 1

[State 7576, 1]
type = HitOverride
trigger1 = 1
time = 1
stateno = 7570
slot = 0
attr = SCA, AA, AT, AP

[State 7576, 1]
type = DestroySelf
trigger1 = time = 100 || backedgedist > 320

[State 7576, 2]
type = HitDef
trigger1 = AnimElem = 2
persistent = 0
attr = A, SA
damage   = 66
animtype = Hard
guardflag = MA
pausetime = 3,6
sparkxy = -40,-80
sparkno = 11
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -12;-1.4, -7
air.animtype = Back
air.velocity = -7,-4;-1.4,-7
airguard.velocity = -4, -3.3
priority = 5
;fall = 1

[State 7576, 3]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 210   ; whoosh

[State 7576, 4]
type = ChangeState
trigger1 = movecontact
value = 7577

; Hit with rolling attack
[Statedef 7577]
type = A
physics = N
movetype = I
velset = -2.1,-8.5

[State 7577, 0]
type = Gravity
trigger1 = 1

[State 7577, 1]
type = ChangeState
trigger1 = Pos Y > 0
value = 7578

[State 7577, 2]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 210   ; whoosh

[State 7577, 3]
type = VelMul
trigger1 = Vel Y > -1
x = .99

; Jimmy's jump around until gone
[Statedef 7578]
type = S
movetype = I
physics = N
velset = 0,0
anim = 7515

[State 7578, 0]
type = PosSet
trigger1 = !time
y = var(1):=0

[State 7578, 0]
type = ChangeAnim
trigger1 = anim = 7515 && !animtime
persistent = 0
value = 7578

[State 7578, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 7578, 2]
type = VelSet
trigger1 = anim = 7578
trigger1 = var(1):=animelem=2
persistent = 0
x = -2.6
y = -12.75

[State 7578, 3]
type = Gravity
trigger1 = pos y < 0

[State 7578, 4]
type = DestroySelf
trigger1 = screenpos y < 0
trigger2 = screenpos x != [-40,360]

[State 7578, 5]
type = ChangeAnim
trigger1 = vel y > -2 && var(1)
persistent = 0
value = 7579

[State 7578, 8]
type = ChangeState
trigger1 = pos y > 0
value = 7578 

; Jimmy slinking away
[Statedef 7579]
type = S
movetype = I
physics = S
velset = 0,0

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

[State 7579, 1]
type = ChangeAnim
trigger1 = !time 
value = ifelse (var(5),7526,7505)
 
[State 7579, 2]
type = Turn
trigger1 = !time && var(5)

[State 7579, 3]
type = ChangeAnim
trigger1 = anim = 7526 && !animtime
value = 7505

[State 7579, 4]
type = NotHitBy
trigger1 = 1
value = SCA

[State 7579, 5]
type = PlaySnd
trigger1 = anim = 7505
trigger1 = var(1):=(animelem = 3)
persistent = 0
value = 7570, 2   ; owwww....

[State 7579, 6]
type = VelSet
trigger1 = anim = 7505
x = 2.9

[State 7579, 7]
type = DestroySelf
trigger1 = var(1) && (backedgedist > 330)

; Jimmy hit, not out of roll.
[Statedef 7580]
type = A
movetype = H
physics = N
velset = root,facing*GetHitVar(xvel)*((P2Dist X < 0)*-2+1),ifelse(GetHitVar(yvel)>-6,-6,GetHitVar(yvel))
;velset = GetHitVar(xvel),GetHitVar(yvel)

[State 7580, 0]
type = Explod
trigger1 = !time && var(8)
pos = var(9),var(10)
anim = ifelse(var(8)=1,7543,7547)
removetime = 45;51
postype = p1
bindtime = 1
vel = 0,-4
accel = 0,0.2
scale = 1
ownpal = 1
sprpriority = 4

[State 7580, 0]
type = VarSet
trigger1 = !time
var(5)=(Vel X <= 0)  

[State 7580, 0]
type = ChangeAnim
trigger1 = !time
value = ifelse(Vel X <=0, 7580, 7582)

[State 7580, 0]
type = Gravity
trigger1 = 1

[State 7580, 1]
type = ChangeState
trigger1 = Pos Y > 0
value = var(0)

[State 7580, 1]
type = HitOverride
trigger1 = 1
time = 1
stateno = 7580
slot = 0
forceair = 1
attr = SCA, AA, AT, AP

; Blender hit state: send equipment flying
[Statedef 7585]
type = S
movetype = H

; blender
[State 7585, 0]
type = Explod
trigger1 = (anim = 7550) && (AnimElemNo(0)>=9)
trigger2 = (anim = 7558) && (AnimElemNo(0)<=4)
anim = 7560
vel = 0.5,-4
accel = 0,.35
pos = 54,-10
postype = p1
sprpriority = 4
;facing = root,facing*facing

; juice
[State 7585, 1]
type = Explod
trigger1 = (anim = 7550) && (AnimElemNo(0)=[9,11])
anim = 7561
vel = 1,-5
accel = 0,.35
pos = 54,-10
postype = p1
sprpriority = 4
;facing = root,facing*facing

[State 7585, 2]
type = Explod
trigger1 = (anim = 7550) && (AnimElemNo(0)=[12,20])
anim = 7562
vel = 1,-5
accel = 0,.35
pos = 54,-10
postype = p1
sprpriority = 4
;facing = root,facing*facing

[State 7585, 2]
type = Explod
trigger1 = (anim = 7550) && (AnimElemNo(0)>20)
trigger2 = (anim = 7558) && (AnimElemNo(0)=1)
anim = 7563
vel = 1,-5
accel = 0,.35
pos = 20,-50
postype = p1
sprpriority = 4
;facing = root,facing*facing

[State 7585, 3]
type = Explod
trigger1 = (anim = 7558) && (AnimElemNo(0)=[2,4])
anim = 7563
vel = 1,-5
accel = 0,.35
pos = 54,-10
postype = p1
sprpriority = 4
;facing = root,facing*facing

[State 7585, 4]
type = VarSet
trigger1 = 1
var(8) = 0  ; no banana

[State 7585, 5]
type = VarSet
trigger1 = 1
var(0) = 7579  ; slink away

[State 7585, 6]
type = ChangeState
trigger1 = 1
value = 7580   ; get hit

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

; Keep round going
[State 7600, 0]
type = AssertSpecial
trigger1 = time >= 0
flag = roundnotover

; Lock camera
[State 7600, 0]
type = ScreenBound
trigger1 = time >= 0
value = 1
movecamera = 0,0

; Turn off push checking
[State 7600, 0]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 7600, 0]
type = Width
trigger1 = time >= 0
value = 20

; Prepare var(0) for helper communication
[State 7600, 0]
type = VarSet
trigger1 = time = 0
v = 0
value = 0

; Prepare var(7) for helper communication
[State 7600, 1]
type = VarSet
trigger1 = time = 0
v = 7
value = 7600   ; ready to go

[State 7600, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 7600, 2]
type = VarSet
trigger1 = time = 0
v = 3
value = 0

; Need to get at least 110 pixels away from Jimmy, and face away.
; Set var(1) to the direction to move (0 if no movement needed).
[State 7600, 2]
type = VarSet
trigger1 = !time
var(1)=(abs(Pos X-helper(3450),Pos X)<110)*ifelse(helper(3450),Pos X<0,1,-1)

; Turn if far enough away but facing Jimmy, or if we need to move back
[State 7600, 3]
type = ChangeAnim
triggerall = !time
trigger1 = var(3):=(var(1) && facing != var(1))
trigger2 = var(3):=(!var(1) && facing*(helper(3450),Pos X-Pos X) > 0)
value = 7601

[State 7600, 3]
type = Turn
triggerall = !time
trigger1 = var(3)

[State 7600, 4]
type = ChangeAnim
trigger1 = anim = 7601 && !animtime
value = 0

[State 7600, 5]
type = ChangeAnim
persistent = 0
trigger1 = anim!=7601 && var(1)
value = 7605

[State 7600, 6]
type = VelSet
trigger1 = anim = 7605
x = 2.5

[State 7600, 2]
type = ChangeState
trigger1 = abs(helper(3450),Pos X - Pos X) >= 110
value = 7601

; Come out of roll (if applicable) and strike the pose
[Statedef 7601]
type = S
movetype = I
physics = N

[State 7601, 0]
type = Width
trigger1 = time >= 0
value = 20

; Keep round going
[State 7601, 0]
type = AssertSpecial
trigger1 = time >= 0
flag = roundnotover

; Lock camera
[State 7601, 0]
type = ScreenBound
trigger1 = time >= 0
value = 1
movecamera = 0,0

; Disable push checking
[State 7601, 0]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 7601, 0]
type = VelSet
trigger1 = anim = 7605
trigger1 = animelem = 5, = 1
x = 0

[State 7601, 1]
type = ChangeAnim
trigger1 = anim = 7605
trigger1 = animelem = 5, =1
;trigger1 = Vel X = 0
value = 7606

[State 7601, 2]
type = ChangeAnim
trigger1 = anim = 7606
trigger1 = animtime = 0
trigger2 = anim = 0
trigger3 = anim = 7601
trigger3 = animtime = 0
value = 184

[State 7601, 2.5]
type = PlaySnd
trigger1 = anim = 184
trigger1 = animelem = 3
persistent = 0
value = 7600, 0       ; ttarimee da!
channel = 0

[State 7601, 2.5]
type = VarSet
trigger1 = anim = 184
trigger1 = animelem = 3
persistent = 0
var(7) = 7601

[State 7601, 4]
type = ChangeState
trigger1 = var(0) = 7641
value = 7605

; Turn back around and wait for power
[Statedef 7605]
type = S
movetype = I
physics = S
velset = 0, 0
anim = 7601

[State 7605, 0]
type = AssertSpecial
trigger1 = time >= 0
flag = roundnotover

[State 7605, 0]
type = ScreenBound
trigger1 = time >= 0
value = 1
movecamera = 0,0

; Disable push checking
[State 7605, 0]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 7605, 0]
type = VarSet
trigger1 = time = 0
v = 0
value = 0

[State 7605, 0]
type = Turn
trigger1 = time = 0

[State 7605, 1]
type = VarSet
trigger1 = time = 30
persistent = 0
v = 7
value = 7605

[State 7605, 1]
type = ChangeAnim
trigger1 = anim = 7601
trigger1 = animtime = 0
persistent = 0
value = 0

[State 7605, 2]
type = PlaySnd
trigger1 = time = 3
value = 7605, 0    ; nan da?
channel = 0

[State 7605, 3]
type = ChangeState
trigger1 = var(0) = 1
value = 7610

; zapped
[Statedef 7610]
type = A
movetype = H
physics = N
anim = 7600
velset = -4, -6

[State 7610, 0]
type = AssertSpecial
trigger1 = time >= 0
flag = roundnotover

[State 7610, 0]
type = ScreenBound
trigger1 = time >= 0
value = 1
movecamera = 0,0

; Disable push checking
[State 7610, 0]
type = PlayerPush
trigger1 = time >= 0
value = 0

[State 7610, 0]
type = PlaySnd
trigger1 = time = 3
trigger1 = time = 15
value = 7470, 3   ; zap

[State 7610, 0]
type = PlaySnd
trigger1 = time = 6
value = 7610, 0   ; araraa?
channel = 0

[State 7610, 0]
type = Gravity
trigger1 = time > 0

[State 7610, 1]
type = VarSet
trigger1 = Pos Y > 0
v = 7
value = 7615

[State 7610, 2]
type = ChangeState
trigger1 = Pos Y > 0
value = 7614

[Statedef 7614]
type = L
movetype = H
physics = N
anim = 5160

[State 7614, 0]
type = VelSet
trigger1 = !time
y = -4.5

[State 7614, 1]
type = Gravity
trigger1 = 1

[State 7614, 0]
type = PlaySnd
trigger1 = time = 0
value = F7, 0   ; bounce sound

[State 7614, 2]
type = AssertSpecial
trigger1 = 1
flag = roundnotover

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

; Turn off push checking
[State 7614, 0]
type = PlayerPush
trigger1 = 1
value = 0

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

[State 7614, 0]
type = Explod
trigger1 = !time
pos = 0,-20
anim = F61

[State 7614, 4]
type = ChangeState
trigger1 = Pos Y > 0 
trigger1 = Vel Y > 0
value = 7615

[Statedef 7615]
type = L
movetype = H
physics = S
anim = 5110
velset = 0, 0

[State 7614, 0]
type = Explod
trigger1 = !time
anim = F60

[State 7615, 0]
type = PlaySnd
trigger1 = time = 0
value = F7, 0   ; bounce sound

[State 7615, 0]
type = AssertSpecial
trigger1 = var(0) != 7650
flag = roundnotover

[State 7615, 0]
type = ScreenBound
trigger1 = time >= 0
value = 1
movecamera = 0,0

; Turn off push checking
[State 7615, 0]
type = PlayerPush
trigger1 = time >= 0
value = 0

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

[State 7615, 1]
type = VarSet
trigger1 = time = 0
v = 7
value = 7615

[State 7615, 2]
type = PlaySnd
trigger1 = time = 45
value = 7610, 1    ; mou, dame ssu!
channel = 0

; Jimmy still drinking
[Statedef 7640]
type = S
movetype = I
physics = N

; BUG: why does this helper appear in random spots sometimes?
[State 7640, 0]
type = helper
trigger1 = time = 0
trigger1 = !numhelper(7640)
pos = ifelse((Pos X!=[-160,159]),floor((153-abs(Pos X))*facing*Pos X/abs(Pos X)),0),0
postype = p1
stateno = 7698
ownpal = 0
id = 7640
helpertype = player
name = "Dan's Jimmy's cameraman"
size.ground.back=0
size.ground.front=0
keyctrl = 0

[State 7640, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 7640, 0]
type = VarSet
trigger1 = time = 0
v = 3
value = 0

[State 7640, 0]
type = ChangeState ; get me out of this horrible state!
trigger1 = parent,stateno = 7601
value = 7641

[State 7640, 3]
type = PlaySnd
triggerall = anim = 7550
trigger1 = AnimElem = 12
trigger2 = AnimElem = 16
value = 7470,3   ; zap

[Statedef 7641]
type = S
movetype = I
physics = N

[State 7640, 0]
type = VarSet
trigger1 = time = 0
v = 11
value = 1

[State 7641, 0]
type = VarSet
trigger1 = time = 0
persistent = 0
v = 1
value = 0

[State 7641, 1]
type = VarAdd
trigger1 = var(1)
trigger2 = parent, var(7) = 7601
v = 1
value = 1

[State 7641, 2]
type = ChangeAnim
trigger1 = var(1) = 55
value = 7555

[State 7641, 3]
type = ChangeAnim
triggerall = anim = 7555
triggerall = animtime = 0
trigger1 = ParentDist X < 0
value = 7526

[State 7641, 4]
type = Turn
trigger1 = anim = 7526
persistent = 0

[State 7641, 5]
type = ChangeAnim
triggerall = animtime = 0
trigger1 = anim = 7526
trigger2 = anim = 7555
value = 7505

[State 7641, 6]
type = VelSet
trigger1 = anim = 7505
x = 2.1

[State 7641, 7]
type = helper
trigger1 = anim = 7555
trigger1 = AnimElem = 2
stateno = 7699
id = 7699
pos = 0,0
ownpal = 0
keyctrl = 0
name = "Dan's Jimmy's blender"
postype = p1

[State 7641, 8]
type = ChangeAnim
trigger1 = anim = 7505
trigger1 = ParentDist X <= 50
persistent = 0
value = 7500

[State 7641, 9]
type = VelSet
trigger1 = anim = 7500
persistent = 0
x = 0

[State 7641, 10]
type = ParentVarSet
trigger1 = anim = 7500
persistent = 0
v = 0
value = 7641

[State 7641, 3]
type = ChangeAnim
trigger1 = parent, var(7) = 7605
trigger1 = anim = 7500
persistent = 0
value = 7515

[State 7641, 4]
type = ChangeState
trigger1 = anim = 7515
trigger1 = animtime = 0
value = 7645

; our shocking finale
[Statedef 7645]
type = S
movetype = I
physics = S
anim = 7610

[State 7645, 0]
type = ParentVarSet
trigger1 = AnimElem = 4
v = 0
value = 1

[State 7645, 0]
type = PlaySnd
triggerall = anim = 7610
trigger1 = AnimElem = 2
value = 7470, 0  ; roarr!
channel = 0

[State 7645, 1]
type = PlaySnd
triggerall = anim = 7610
trigger1 = AnimElem = 3
trigger2 = AnimElem = 6
trigger3 = AnimElem = 9
trigger4 = AnimElem = 12
value = 7470,6   ; zap

[State 7645, 2]
type = ChangeAnim
trigger1 = anim = 7610
trigger1 = animtime = 0
value = 7510

[State 7645, 3]
type = ChangeAnim
trigger1 = anim = 7510
trigger1 = animtime = 0
value = 7500

[State 7645, 4]
type = ChangeState
trigger1 = anim = 7500
trigger1 = parent, var(7) = 7615
value = 7650

; Walk back to juice
[Statedef 7650]
type = S
movetype = I
physics = N
anim = 7526

[State 7650, 1]
type = Turn
trigger1 = !time

[State 7650, 0]
type = VarSet
trigger1 = time = 0
v = 0
value = 0

[State 7650, 2]
type = ChangeAnim
trigger1 = anim = 7526
trigger1 = animtime = 0
value = 7505

[State 7650, 3]
type = VelSet
trigger1 = anim = 7505
trigger1 = var(0) != 2
x = 2.1

[State 7650, 3]
type = VelSet
trigger1 = anim = 7505
trigger1 = var(0) = 2
x = .5

[State 7650, 4]
type = ChangeState
trigger1 = var(0) = 1
persistent = 0
value = 7655

[Statedef 7655]
type = S
movetype = I
physics = N
velset = 0, 0

[State 7655, 0]
type = ChangeAnim
triggerall = numhelper(7699)
trigger1 = var(1):=(facing!=helper(7699),facing); var(1) = 1
persistent = 0
value = 7526

[State 7655, 1]
type = Turn
trigger1 = var(1);var(1) = 0
persistent = 0

[State 7655, 2]
type = ChangeAnim
trigger1 = var(1)
trigger1 = anim = 7526
trigger1 = animtime = 0
trigger2 = !var(1)
persistent = 0
value = 7557

[State 7655, 3]
type = VarSet
trigger1 = anim = 7557
trigger1 = animelem = 6
persistent = 0
v = 7
value = 1

[State 7655, 4]
type = ParentVarSet
trigger1 = time = 240
v = 0
value = 7650  ; end round now, please

; hakky invisible player to hold the camera
[Statedef 7698]
type = S
physics = N
movetype = I
velset = 0, 0
anim = 7999

[State 7698, 0]
type = VarSet
trigger1 = time < 61
var(0) = time

[State 7698, 1]
type = Width
trigger1 = IsHelper(7640)
edge = var(0)*60/60,var(0)*40/60

; blender on ground
[Statedef 7699]
type = S
physics = N
movetype = I
velset = 0, 0
anim = 7556

[State 7699, 0]
type = ParentVarSet
trigger1 = ParentDist X < 2
trigger1 = ParentDist X > -2
v = 0
value = 2

[State 7699, 0]
type = ParentVarSet
trigger1 = ParentDist X < 1
trigger1 = ParentDist X > -1
v = 0
value = 1

[State 7699, 0]
type = DestroySelf
trigger1 = parent, var(7) = 1

[State 7699, 3]
type = SprPriority
trigger1 = time = 0
value = 3

; win pose with Sakura -- call Sakura and wait for positioning
[Statedef 7700]
type = S
movetype = I
physics = S
velset = 0, 0

[State 7700, 0]
type = AssertSpecial
trigger1 = time >= 0
flag = roundnotover

; Prepare var(10) for helper communication
[State 7700, 0]
type = VarSet
trigger1 = time = 0
v = 10
value = 0

; Prepare var(11) for helper communication
[State 7700, 1]
type = VarSet
trigger1 = time = 0
v = 11
value = 0

; Call Sakura from the right if Dan is on the left
[State 7700, 2]
type = helper
trigger1 = time = 0
trigger1 = Pos X <= 0
pos = 40, 0
postype = right
ID = 7700
stateno = 7740
helpertype = normal
ownpal = 1
name = "Dan's Ichiban Teishi"
keyctrl = 0

; Call Sakura from the left if Dan is on the right
[State 7700, 3]
type = helper
trigger1 = time = 0
trigger1 = Pos X > 0
pos = -40, 0
postype = left 
ID = 7700
stateno = 7740
helpertype = normal
ownpal = 1
name = "Dan's Ichiban Teishi"
keyctrl = 0

; Turn around if facing wrong way
[State 7700, 5]
type = ChangeAnim
triggerall = var(10) = 1
trigger1 = Pos X <=0
trigger1 = facing = -1
trigger2 = Pos X > 0
trigger2 = facing = 1
persistent = 0
value = 5 ; turning animation

[State 7700, 4]
type = Turn
triggerall = var(10) = 1   ; Sakura in position
trigger1 = Pos X <=0
trigger1 = facing = -1
trigger2 = Pos X > 0
trigger2 = facing = 1
persistent = 0

[State 7700, 6]
type = ChangeAnim
trigger1 = anim = 5
trigger1 = animtime = 0
value = 0

[State 7700, 7]
type = VarAdd
trigger1 = var(10) > 0
trigger1 = anim != 5
v = 10
value = 1

[State 7700, 8]
type = ChangeState
trigger1 = var(10) = 31
value = 7705

; Bring out sign and pose
[Statedef 7705]
type = S
movetype = I
physics = S
anim = 7701

; re-initialize var(10)
[State 7705, 0]
type = VarSet
trigger1 = time = 0
v = 10
value = 0

[State 7705, 0]
type = VarSet
trigger1 = time = 15 ; small delay
v = 11
value = 7705

[State 7705, 0]
type = AssertSpecial
trigger1 = time = [0,600]
flag = roundnotover

[State 7705, 1] ; Hakk!!!!!
type = helper  ; hold the camera in place
trigger1 = AnimElem = 12
pos = 0, 0
postype = p1
stateno = 7711
ownpal = 0
helpertype = player
name = "cameraman"
keyctrl = 0

[State 7705, 1]
type = PlaySnd
trigger1 = AnimElem = 12
trigger1 = var(6) = 3
value = 1100, 0  ; dou da?
channel = 0

[State 7705, 1]
type = PlaySnd
trigger1 = AnimElem = 12
trigger1 = var(6) = 4
value = 2100, 2  ; oh yeah!
channel = 0

[State 7705, 1]
type = PlaySnd
trigger1 = AnimElem = 12
trigger1 = var(6) = 5
value = 7705, 0  ; bab-ay!
channel = 0

[State 7705, 2]
type = ChangeState
trigger1 = var(10) = 1
value = 7710

[Statedef 7710]
type = A
movetype = H
physics = N
anim = 5052

[State 7710, 0]
type = VarSet
trigger1 = time = 0
v = 10
value = 0

[State 7710, 0]
type = AssertSpecial
trigger1 = time = [0,300]
trigger1 = var(10) != 1
flag = roundnotover

; Drop the autograph
[State 7710, 0]
type = Projectile
trigger1 = time = 0
projanim = 1106
projheightbound = -320, 1
velocity = .5, -.5
offset = 52, -72
accel = 0, .1

[State 7710, 0]
type = ScreenBound
trigger1 = time >= 0
value = 0
movecamera = 0,0

[State 7710, 0]
type = PlaySnd
trigger1 = time = 5
trigger1 = var(6) = 3
value = 7710, 0    ; chikushou!
channel = 0

[State 7710, 1]
type = PlaySnd
trigger1 = time = 18 
trigger1 = var(6) = 4
value = 196, 22    ; eh?!
channel = 0

[State 7710, 1]
type = PlaySnd
trigger1 = time = 5
trigger1 = var(6) = 5
value = 7710, 2    ; dahyou!
channel = 0

[State 7710, 1]
type = VelSet
trigger1 = time = 0
x = -4.6
y = -6.5

[State 7710, 2]
type = VelAdd
trigger1 = time > 0
trigger1 = anim != 7999
y = .28

[State 7710, 3]
type = ChangeAnim
trigger1 = anim = 5052
trigger1 = Vel Y > -1
value = 5062

[State 7710, 4]
type = VarSet
trigger1 = Pos X < -220
trigger2 = Pos X > 220
trigger3 = anim = 7999
v = 11
value = 7710

[State 7710, 5]
type = ChangeAnim
trigger1 = Vel Y >= 6
value = 7999

[State 7710, 6]
type = PosAdd
trigger1 = anim = 7999
persistent = 0
x = 200 

[State 7710, 5]
type = VelSet
trigger1 = anim = 7999
persistent = 0
y = 0
x = 0

[Statedef 7711]
type = S
movetype = I
physics = N
velset = 0, 0
anim = 7999

[State 7711, 0]
type = null
trigger1 = time = 0

; Sakura walking in
[Statedef 7740]
type = S
movetype = I
physics = N
anim = 7705

[State 7740, 0]
type = Turn
triggerall = time = 0
trigger1 = Pos X > 0
trigger1 = facing = 1
trigger2 = Pos X <= 0
trigger2 = facing = -1

[State 7740, 1]
type = VelSet
trigger1 = ParentDist X > 100
x = 2.3

[State 7740, 1]
type = VelSet
trigger1 = ParentDist X <= 100
persistent = 0
x = 0

[State 7740, 1]
type = ChangeAnim
trigger1 = ParentDist X <= 100
persistent = 0
value = 7700

[State 7740, 2]
type = ParentVarSet
trigger1 = ParentDist X <= 100
persistent = 0
v = 10
value = 1

[State 7740, 3]
type = ChangeAnim
trigger1 = parent, var(11) = 7705
persistent = 0
value = 7710

[State 7740, 4]
type = ChangeState
trigger1 = anim = 7710
trigger1 = animtime = 0
value = 7745

[Statedef 7745]
type = S
movetype = A
physics = S
anim = 7715

[State 7745, 0]
type = PlaySnd
trigger1 = anim = 7715
trigger1 = AnimElem = 8
value = 7700, 0    ; hadouken!
channel = 0

[State 7745, 0]
type = ChangeAnim
trigger1 = anim = 7715
trigger1 = animtime = 0
value = 7720

[State 7745, 1]
type = Projectile
trigger1 = anim = 7720
trigger1 = animelem = 1, =1
projanim = 7725
projremanim = 7726
velocity = 1.5, 0
offset = 79, -55
projremovetime = 20
remvelocity = 0, 0

[State 7745, 0]
type = PlaySnd
trigger1 = anim = 7720
trigger1 = AnimElem = 1, =1
value = 0, 1030    ; swish

[State 7745, 0]
type = PlaySnd
trigger1 = anim = 7720
trigger1 = AnimElem = 1, =4
value = 0, 450    ; smack

[State 7745, 1]
type = ParentVarSet
trigger1 = anim = 7720
trigger1 = animelem = 1, =4
v = 10
value = 1

[State 7745, 2]
type = ChangeAnim
trigger1 = anim = 7720
trigger1 = animtime = 0
value = 7700

[State 7745, 3]
type = ChangeState
trigger1 = anim = 7700
trigger1 = parent, var(11) = 7710
value = 7750

[Statedef 7750]
type = S
movetype = I
physics = N
velset = 0, 0

[State 7750, 0]
type = ChangeAnim
trigger1 = time = 30
trigger1 = parent, var(6) = 3
persistent = 0
value = 7730

[State 7750, 0]
type = ChangeAnim
trigger1 = time = 30
trigger1 = parent, var(6) = 4
value = 7735

[State 7750, 0]
type = ChangeAnim
trigger1 = time = 30
trigger1 = parent, var(6) = 5
value = 7740

[State 7750, 0]
type = PlaySnd
triggerall = AnimElem = 3
persistent = 0
trigger1 = anim = 7730
trigger2 = anim = 7740
value = 7700, 1   ; laugh
channel = 0

[State 7750, 0]
type = ParentVarSet
trigger1 = time = 270
v = 10
value = 1

;---------------------------------------------------------------------------
; States that are almost always checked (use -3) :
;---------------------------------------------------------------------------

[Statedef -3]

; Play "kujikenai ssu" sound when recovering in air or on ground
[State -3, 1]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 5201
trigger2 = stateno = 5210
value = 5200,0
channel = 0


[State -3, hitcount]
type = VarSet
trigger1 = movetype != H
trigger2 = stateno = 5110
v = 8
value = 0

[State -3, hitcount]
type = VarAdd
triggerall = time = 0
triggerall = var(8) = 0
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5080
v = 14
value = 1

[State -3, hitcount]
type = VarSet
trigger1 = movetype = H
trigger1 = !var(8)
v = 8
value = 1

[State -3, hitcount]
type = VarSet
trigger1 = var(14) = 2
v = 14
value = 0

[State -3, tripped]
type = VarSet
triggerall = var(8) = 1
triggerall = alive
trigger1 = stateno = 5070
trigger1 = time = 2
trigger2 = anim = 5052 
trigger2 = AnimElem = 1, = 3
trigger2 = stateno != 7710 
trigger2 = stateno != 3411
trigger2 = stateno != 2105
v = 8
value = 4

; Play hit sound when tripped or hit up
[State -3, tripped]
type = PlaySnd
trigger1 = var(8) = 4
value = 5070, 0
channel = 1
lowpriority = 1

[State -3, hitcount]
type = VarSet
trigger1 = var(8) = 1
trigger1 = var(14) = 1
v = 8
value = 2 + (random >= 500)

[State -3, hit2]
type = PlaySnd
triggerall = time = 3
triggerall = var(8) = [2,3]
triggerall = alive 
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5080
value = 5070, var(8)-1
channel = 1
lowpriority = 1

[State -3, hit2]
type = VarSet
trigger1 = time = 3
trigger1 = var(8) = [2,4]
v = 8
value = 5

; Less wide in front when hit
[State -3, 1]
type = Width
trigger1 = stateno = 5000
trigger2 = stateno = 5001
value = -13

;---------------------------------------------
; reset assertable flags
[State -3, 1]
type = VarSet
trigger1 = 1
var(15)=0

;---------------------------------------------
; manage variables for Chouhatsu Shinwa state
[State -3, 1]
type = VarAdd
trigger1 = var(2)
v = 2
value = 1

[State -3, 1]
type = AfterImageTime
trigger1 = var(2)
time = 2

[State -3, 1]
type = AssertSpecial
trigger1 = var(2)
flag = nostandguard
flag2 = noairguard
flag3 = nocrouchguard

[State -3, 1]
type = ChangeState
trigger1 = var(2) >= 1200
trigger1 = statetype != A
trigger1 = ctrl
value = 3101

[State -3, 1]
type = VarSet
trigger1 = movetype = H
var(2) = 0




[Statedef -3]

[State -3, AI Helper - Compatibly Partnered Version]
type = Helper
trigger1 = !var(58) && !IsHelper
trigger1 = !NumHelper(9742)
trigger1 = Alive && RoundState = 2
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

; If you want to use the Guard mode, Dummy mode, Distance, or Button jam dummy
; control options in Training mode without activating the dummy's AI while
; working on the character, then all you need to do is temporarily disable
; this controller.  Or, if you want to permanently disable this controller in
; Training mode, then you could use the Training mode detection code available
; from my site ( http://www.mugenguild.net/~winane/ ), and then just add a
; "(var(59)&63)>30" triggerall to this controller.
; Alternatively, you can just set "Dummy control" to "Manual", press a P2 button
; to kill the AI helper, and then set dummy control back to "Cooperative".  (In
; fact, setting dummy control to manual isn't even necessary, if you press the
; P2 button prior to the first time you pause.)
[State -3, AI Helper]
type = Helper
triggerall = !var(58) && !IsHelper
triggerall = !NumHelper(9741)
triggerall = Alive && RoundState = 2
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647


