; Jagger constants
[Data]
life = 2000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 0
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1.1
yscale = 1.05
ground.back = 15
ground.front = 16
air.back = 12
air.front = 12
height = 60
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = -5, -90
mid.pos = -5, -60
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.4
walk.back = -2.2
run.fwd  = 4.6, 0
run.back = -4.5,-3.8
jump.neu = 0,-8.4
jump.back = -2.55
jump.fwd = 2.5
runjump.back = -2.55,-8.1
runjump.fwd = 4,-9
airjump.neu = 0,-9
airjump.back = -2.55
airjump.fwd = 2.5

[Movement]
airjump.num = 0
airjump.height = 35
yaccel = .49
stand.friction = .85
crouch.friction = .82

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

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100 , 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 900,1
channel = 3

[State 100 , 1]
type = MakeDust
trigger1 = command = "FF"
value = 120
pos = -10, 0

[State 100, 5]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100 , 1]
type = MakeDust
trigger1 = command != "holdfwd"
value = 120
pos = 30, 0

[State 100, 2]
type = ChangeState
trigger1 = command != "holdfwd"
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Lose by Time Over

[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = animelem = 4
value = 7000, 6 ; tiiiiiii


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

;---------------------------------------------------------------------------
; Win state decider

[Statedef 180]
type = S
ctrl = 0
anim = 0

[State 181, Randomizer]
type = VarRandom
trigger1 = time = 0
v = 7
range = 0, 60

; risata
[State 181, 1]
type = ChangeState
trigger1 = var(7) <= 20
value = 181

;elmo
[State 181, 1]
type = ChangeState
trigger1 = var(7) > 20
trigger1 = var(7) <= 40
value = 182

;colpo in aria
[State 181, 2]
type = ChangeState
trigger1 = var(7) > 40
trigger1 = var(7) <= 60
value = 183


[Statedef 181]
type = S
ctrl = 0
anim = 181

[State 181, Sound]
type = PlaySnd
trigger1 = animelem = 10
value = 7000, 4 ; risata
volume = 255

[State 181, 2] 
type = AssertSpecial
trigger1 = animelemtime(16) < 70
flag = roundnotover

[Statedef 182]
type = S
ctrl = 0
anim = 182

[State 182, 2] 
type = AssertSpecial
trigger1 = animelemtime(3) < 150
flag = roundnotover

[State 180, Sound]
type = PlaySnd
trigger1 = animelem = 3
value = 7000, 3 ; risata
volume = 100

[State 180, Sound]
type = PlaySnd
trigger1 = animelem = 6
value = 8, 4 ; lancio
volume = 255

[State 182, 3]
type = helper
trigger1 = AnimElem = 7
stateno = 6060
pos = 0,-130

[Statedef 6060]
type = A
physics = N
anim = 6060
velset = 3,-11
ctrl = 0
sprpriority = 5

[State 6060, 1]
type = veladd
trigger1 = 1
y = .65

[State 180, Sound]
type = PlaySnd
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 8, 7 ; caduto
volume = 255

[State 6060, 2]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 6062

;-------------------------------
;colpi in aria
[Statedef 183]
type = S
ctrl = 0
anim = 195

[State 180, Sound]
type = PlaySnd
trigger1 = animelem = 7
value = 1007, 2 ; sparo
volume = 255

[State 180, Sound]
type = PlaySnd
trigger1 = animelem = 7
trigger2 = animelem = 9
value = 8, 3 ; sparo
volume = 255

[State 180, fall]
type = Changeanim
trigger1 = time = 200
value = 185


;---------------------------------------------------------------------------
; –XŽq-2
[Statedef 6062]
type = S
physics = N
anim = 6062
velset = 0,0

[State 6062, 1]
type = posset
trigger1 = Time = 0
y = 0

;---------------------------------------------------------------------------
; Introduction

[Statedef 190]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 180, Sound]
type = PlaySnd
trigger1 = animelem = 4
value = 7000, 0 ; dite il mio nome
volume = 100

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

;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 195, 1]
type = CtrlSet
trigger1 = Time = 40
value = 1

[State 180, Sound]
type = PlaySnd
trigger1 = animelem = 7
trigger2 = animelem = 9
value = 8, 3 ; sparo
volume = 255

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

;---------------------------------------------------------------------------
; Stand Light Punch

[Statedef 200]
type    = S                     
movetype= A                      
physics = S                      
juggle  = 1                      
velset = 0,0                     
ctrl = 0                         
anim = 200                       
poweradd = 20                    
sprpriority = 2                  

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 200, 3]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA                     
damage = 20, 0                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit               
pausetime = 8, 8                
sparkno = 0                     
sparkxy = -10, -87              
hitsound = s1, 1                 
guardsound = 6, 0         
ground.type = High               
ground.slidetime = 15            
ground.hittime  = 22             
ground.velocity = -4             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12          

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


; Standing light punch (close)
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 205
sprpriority = 3

[State 205]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

[State 205, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2

[State 205, 3]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = 20,0
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-87
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = High
ground.slidetime = 22
ground.hittime  = 25
ground.velocity = -5.5
air.velocity = -2.5,-4

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

;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 2,0
anim = 210
sprpriority = 3

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 60,10
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-84
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = High
ground.slidetime = 22
ground.hittime  = 27
ground.velocity = -5.5
air.velocity = -2.5,-4

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

; Standing strong punch(close)
[Statedef 215]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 215
sprpriority = 3

[State 215]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 215, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 70,10
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-87
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = High
ground.slidetime = 22
ground.hittime  = 25
ground.velocity = -5.5
air.velocity = -2.5,-4

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

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 230, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-79
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = -5
air.velocity = -2.5,-3.5

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

;---------------------------------------------------------------------------
; Standing light kick(close)
; CNS difficulty: easy
[Statedef 235]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 235
sprpriority = 2

[State 235, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 235, 2.5]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = 0,-79
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -5
air.velocity = -2.5,-3.5

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

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

[State 240, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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


[State 240, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 60,10
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-60
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 25
ground.velocity = -6
air.velocity = -2.2,-3.2

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



; Standing strong kick(close)
; CNS difficulty: easy
[Statedef 245]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 245
sprpriority = 2

[State 245, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 245, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 70,10
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-72
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 25
ground.velocity = -6
air.velocity = -2.2,-3.2

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


;---------------------------------------------------------------------------
;Crouching light punch
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

[State 400, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 400, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 20
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkno = 0
sparkxy = -10,-52
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 22
ground.velocity = -4
air.velocity = -1.5,-3

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

;---------------------------------------------------------------------------
;Crouching strong punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 410, 2.5]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 60,10
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -4
air.velocity = -3,-4

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


;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2

[State 430, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 430, 2]
type = HitDef
trigger1 = animelem = 1
attr = C, NA
damage    = 20
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 12,12
sparkno = 0
sparkxy = -10,-40
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 22
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 20

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



;---------------------------------------------------------------------------
;Crouch Strong Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 70
ctrl = 0
anim = 440
sprpriority = 2

[State 440, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 440, 3.5]
type = HitDef
trigger1 = AnimElem = 1
attr = C, NA
damage    = 60,10
hitflag = MAF
guardflag = L
pausetime = 12,12
sparkno = 1
sparkxy = -5,-10
hitsound   =  s1, 2
guardsound = 6, 0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 25
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1

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

;---------------------------------------------------------------------------
;Jump Light Punch
[Statedef 605]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 11
ctrl = 0
anim = 605
sprpriority = 2

[State 605, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 605, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage    = 30
guardflag = HA
priority = 3
pausetime = 7,8
sparkno = 0
sparkxy = -10,-40
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 25
ground.hittime  = 28
ground.velocity = -4
air.velocity = -1.3,-3

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

;---------------------------------------------------------------------------
;Jump Light Punch FB
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 11
ctrl = 0
anim = 600
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 600, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage    = 30
guardflag = HA
priority = 3
pausetime = 7,8
sparkno = 0
sparkxy = -10,-40
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 25
ground.hittime  = 35
ground.velocity = -4
air.velocity = -1.3,-3

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

;---------------------------------------------------------------------------
;Jump Strong Punch UP
[Statedef 615]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 615
sprpriority = 2

[State 615, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

[State 615, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2

[State 615, 3]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage = 70,10
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   =  s1, 2
guardsound = 6, 0
animtype = Med
ground.type = High
ground.slidetime = 27
ground.hittime  = 37
ground.velocity = -5
air.velocity = -3,-4

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

;---------------------------------------------------------------------------
;Jump Strong Punch FB
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 610
sprpriority = 2

[State 610, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 610, 3]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage = 60,10
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = 10,-55
hitsound   =  s1, 2
guardsound = 6, 0
animtype = Med
ground.type = High
ground.slidetime = 27
ground.hittime  = 37
ground.velocity = -5
air.velocity = -3,-4

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

;---------------------------------------------------------------------------
;Jump Strong Kick UP
; CNS difficulty: easy
[Statedef 635]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 635
sprpriority = 2

[State 635, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

[State 635, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2

[State 635, 3]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage = 30
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   =  s1, 2
guardsound = 6, 0
animtype = Med
ground.type = High
ground.slidetime = 27
ground.hittime  = 37
ground.velocity = -5
air.velocity = -3,-4

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


;---------------------------------------------------------------------------
;Jump Light Kick FB
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 0

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

[State 630, 2.5]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage = 20
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = 1
sparkxy = -5,-35
hitsound   =  s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 26
ground.hittime  = 26
ground.velocity = -4
air.velocity = -2,-3

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

;---------------------------------------------------------------------------
;Jump Strong Kick Up
[Statedef 645]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 645
sprpriority = 2

[State 645, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

[State 645, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2

[State 645, 3.5]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage    = 70,10
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   =  s1, 2
guardsound = 6, 0
animtype = Med
ground.type = High
ground.slidetime = 27
ground.hittime  = 37
ground.velocity = -5
air.velocity = -3,-4

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

;---------------------------------------------------------------------------
;Jump Strong Kick FB
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 640
sprpriority = 2

[State 640, 1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 5, 1

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

[State 640, 3.5]
type = HitDef
trigger1 = AnimElem = 1
attr = A, NA
damage = 60,10
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-35
hitsound   =  s1, 2
guardsound = 6, 0
animtype = Med
ground.type = High
ground.slidetime = 27
ground.hittime  = 37
ground.velocity = -5
air.velocity = -3,-4

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

;----------------------------------------
; Dodge
[Statedef 700]
type = S
movetype = I
physics = S
velset = 0
anim = 700
ctrl = 0

[State 700, 1]
type = SprPriority
trigger1 = Time = 0
value = 0

[State 700, 2]
type = PlaySnd
trigger1 = Time = 0
value = 5,0
volume = -50

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

; Respinta

[Statedef 750]
type = S
movetype = A
physics = S
velset = 0
anim = 750
ctrl = 0
velset = 0,0
poweradd = -1000

[State 750, 1]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 750, Blink]
type = PalFX
trigger1 = Time = 0
time = 40
add = 32,16,0
sinadd = 64,32,5,3

[State 750, colpo]
type = hitdef
trigger1 = animelem = 2
attr = A, NA
damage    = 20
getpower  = 50
givepower = 30
guardflag = HA
priority = 5
animtype = Low
pausetime = 10, 12
sparkxy = -10,-51
hitsound   = S1,3
guardsound = 6,0
ground.type = trip
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4,-6
air.velocity = -4, -6
fall = 1

[State 750, fine]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

; Scivolata ----------------------------------------------------------------------------------------------
[Statedef 790]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
movetime = 0
anim = 790

[State 790, 0]
type = HitBy
trigger1 = Time >= 0
value = SCA, AT

[State 790, 1]
type = SprPriority
trigger1 = Time = 0
value = -2

[State 790, 2]
type = PlaySnd
trigger1 = Time = 2
value = 901,2
volume = -50

[State 790, 1]
type = VelSet
trigger1 = AnimElem = 7
x = 0

[State 790, 0]
type = PlayerPush
trigger1 = AnimElem = 1, < 6
value = 0

[State 790, 1]
type = VelSet
trigger1 = Var(22) != 22
trigger1 = AnimElem = 1
x = 5.9

[State 790, 1]
type = VelSet
trigger1 = Var(22) = 22
trigger1 = AnimElem = 1
x = 7

[State 790, 1]
type = VarSet
trigger1 = AnimElem = 2
v = 22
value = 0

[State 790, 2]
type =AfterImage
trigger1 = time = 0
time = 2
timeGap  = 1
frameGap = 2
length = 8
trans = add1
palBright   =   0,  0,  0
palContrast = 128,128,128
palAdd      =   0,  0,  0
palMul      =   1,  1,  1

[State 790, 2]
type = AfterImageTime
trigger1 = AnimElem = 5, < 0
time = 2

[State 790, 0]
type = Turn
trigger1 = AnimElem = 6
trigger1 = P2Dist X < 0

[State 790, 1]
type = CtrlSet
trigger1 = AnimElem = 6
value = 1

[State 790, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
;Presa
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
sprpriority = 1       ;Draw in front of p2
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent

[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1, 1

[State 810, Throw Sound1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2

[State 810, Throw Sound2]
type = PlaySnd
trigger1 = AnimElem = 4
value = 5, 0

[State 810, Bind 10]
type = TargetBind
trigger1 = AnimElem = 1
pos = 30, -30

[State 810, Bind 11]
type = TargetBind
trigger1 = AnimElem = 3
pos = -50, -90

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 3
value = -78

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 3
value = 821

[State 810, Pos 15]
type = PosAdd
trigger1 = AnimElem = 3
x = -10

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

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw

[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air

[Statedef 821]
type    = A
movetype= H
physics = N
velset = 2.8,-7
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .5

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground


;Carica Power BAR ******************************************************************************************

[Statedef 196]
type    = A
movetype= H
physics = N
velset = 0,0
anim = 196

[State 196, rand]
type = VarRandom
trigger1 = time%20 = 0
v = 20
range = 0,1000

[State 196, energia]
type = Explod
triggerall = time = 0
trigger1 = var(0) = 0
trigger2 = var(20) <= 200
trigger2 = var(0) = 1
anim = 197
ID = 198
pos = 2,0
removetime = -1

[State 196, suono]
type = PlaySnd
trigger1 = time = 0
value = 4500,1
channel = 2
loop = 0
pan = 1

[State 196, premuto]
type = PowerAdd
trigger1 = command = "hold_s"
trigger1 = var(0) = 0
trigger2 = var(0) = 1
trigger2 = var(20) <= 200
value = 8

[State 196, trema]
type = EnvShake
trigger1 = time%5 = 0
time = 5
freq = 60
ampl = -2

[State 196, fine]
type = ChangeState
trigger1 = command != "hold_s"
trigger1 = var(0) = 0
trigger2 = var(20) >= 200
trigger2 = var(0) = 1
value = 0


;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;Pugno Basso Debole*******************************************************************
[Statedef 1400]
type    = S
movetype= A
physics = S
poweradd= 100
ctrl = 0
velset = 0
anim = 1400

[State 1120, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1400, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
damage    = 70,10
animtype  = light
getpower  = 10
givepower = 8
hitflag = MA
guardflag = MA
pausetime = 9,9
sparkxy = -2,-50
hitsound   = S7000,7
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 75
ground.velocity = -2
air.velocity = -1.3,-3
volume = 255

[State 1400, 1]
type = PlaySnd
trigger1 = animelem = 5 && !Movehit
value = 900,2

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

;Pugno Basso Forte*******************************************************************
[Statedef 1401]
type    = S
movetype= A
physics = S
poweradd= 100
ctrl = 0
velset = 0
anim = 1400

[State 1401, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1401, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
damage    = 85,15
animtype  = hard
getpower  = 10
givepower = 8
hitflag = MA
guardflag = MA
pausetime = 9,9
sparkxy = -2,-50
hitsound   = S7000,7
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 150
ground.velocity = -2
air.velocity = -1.3,-3

[State 1401, 1]
type = PlaySnd
trigger1 = animelem = 5 && !Movehit
value = 900,2

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



;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
[Statedef -2]

[State -2, colpito]
type = VarSet
v = 10
trigger1 = stateno = 3000
value = 1

;pugni a terra

[State -2, Blocco]
type = SuperPause
trigger1 = (prevstateno = 2212 || prevstateno = 2202) && win && !Var(6)
anim = -1
darken = 1
time = 40

[State -2, Back harat]
type = Envcolor
trigger1 = (prevstateno = 2212 || prevstateno = 2202) && win && !Var(6)
value = 0,0,0
time = 40
under = 1

[State -2, name]
type = Explod
trigger1 = (prevstateno = 2212 || prevstateno = 2202) && win && !Var(6)
anim = F206
pos = 60, 0
postype = left
bindtime = -1
supermove = 0 ;1
removetime = 1
ontop = 1
ownpal = 1

[State -2, name ITA]
type = Explod
trigger1 = (prevstateno = 2212 || prevstateno = 2202) && win && !Var(6)
anim = F306
pos = 0, 50
postype = left
bindtime = -1
supermove = 0 ;1
removetime = 1
ontop = 1
ownpal = 1

[State -2, namevarset]
type = VarSet
v = 6
trigger1 = (prevstateno = 2212 || prevstateno = 2202) && win
value = 1

;cento pugni

[State -2, Blocco]
type = SuperPause
trigger1 = win && !Var(9) && Var(10)
anim = -1
darken = 1
time = 80

[State -2, Back 100pugni]
type = Envcolor
trigger1 = win && !Var(9) && Var(10)
value = 0,0,0
time = 80
under = 1

[State -2, name]
type = Explod
trigger1 = win && !Var(9) && Var(10)
anim = F207
pos = 60, 0
postype = left
bindtime = -1
supermove = 0 ;1
removetime = 1
ontop = 1
ownpal = 1

[State -2, name ITA] 
type = Explod
trigger1 = win && !Var(9) && Var(10)
anim = F307
pos = 10, 50
postype = left
bindtime = -1
supermove = 0 ;1
removetime = 1
ontop = 1
ownpal = 1

[State -2, namevarset]
type = VarSet
v = 9
trigger1 = win
value = 1

;*****************************************************************************************************

[State -2, finecorsa]
type = StopSnd
trigger1 = stateno != 100
channel = 11

[State -2, 1]
type = AfterImage
triggerall = time = 0
trigger1 = anim = 105
trigger2 = anim = 100
time = 10
length = 9;6;12
PalBright   =   0,  0,  0
PalContrast = 128,128,128
PalAdd      =   0,  0,  0
PalMul      =  1,1,1;.9, .9, .9
FrameGap = 3;2
Trans = Add1

[State -2, 2]
type = AfterImageTime
triggerall = Time = [0,24]
trigger1 = anim = 105
trigger2 = anim = 100
time = 2

;---------------------------------------------------------------------------
;Auto Guard - Any Range

[State -2, StandGuard]
type = ChangeState
triggerall = Var(0) = 1 
triggerall = StateType = S
triggerall = Pos Y >= 0
triggerall = P2BodyDist Y <= 0
triggerall = P2BodyDist Y >= -120 
triggerall = P2StateType != C
triggerall = P2MoveType = A
trigger1 = P2BodyDist X > 80 
trigger1 = Ctrl = 1
trigger2 = StateNo = [140, 155]
value = 130

[State -2, StandGuardClose]
type = ChangeState
triggerall = Var(0) = 1 
triggerall = Random > 399
triggerall = StateType = S
triggerall = Pos Y >= 0
triggerall = P2BodyDist Y <= 0
triggerall = P2BodyDist Y >= -120 
triggerall = P2StateType != C
triggerall = P2MoveType = A
trigger1 = P2BodyDist X <= 80 
trigger1 = Ctrl = 1
trigger2 = StateNo = [140, 155]
value = 130

[State -2, CrouchGuard]
type = ChangeState
triggerall = Var(0) = 1 
triggerall = StateType = S
triggerall = Pos Y >= 0
triggerall = P2BodyDist Y <= 0
triggerall = P2BodyDist Y >= -50
triggerall = P2StateType = C
triggerall = P2MoveType = A
trigger1 = P2BodyDist X > 80 
triggerall = Random > 399
trigger1 = Ctrl = 1
trigger2 = StateNo = [140, 155]
value = 131

[State -2, CrouchGuardClose]
type = ChangeState
triggerall = Var(0) = 1
triggerall = Random > 399
triggerall = StateType = S
triggerall = Pos Y >= 0
triggerall = P2BodyDist Y <= 0
triggerall = P2BodyDist Y >= -50
triggerall = P2StateType = C
triggerall = P2MoveType = A
trigger1 = P2BodyDist X <= 80 
trigger1 = Ctrl = 1
trigger2 = StateNo = [140, 155]
value = 131

[State -2, AirGuard]
type = ChangeState
triggerall = Var(0) = 1 
triggerall = StateType = A
triggerall = Pos Y < 0
triggerall = P2BodyDist X <= 120
triggerall = P2BodyDist Y >= -120
triggerall = P2MoveType = A
triggerall = StateType = A
trigger1 = Ctrl = 1
trigger2 = StateNo = [140, 155]
value = 132

[State -2, carica end]
type = RemoveExplod
trigger1 = stateno != 196
ID = 198

[State -2, finesuono]
type = StopSnd
trigger1 = stateno != 196
channel = 2

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------

[Statedef -3]

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 900, 0

[State -3, Jump Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 50 ;Jump
volume = -100
value = 900, 2

[state -3, corsa]
type = Stopsnd
trigger1 = stateno != 100
channel = 3

[state -3, back]
type = Playsnd
trigger1 = stateno = 105
trigger1 = time = 5
value = 900,2
volume = -80

[State -3, noncolpito]
type = VarSet
v = 10
trigger1 = !win
value = 0
;---------------------------------------------------------------------------
; parry variables 31 (S), 32 (C), 33 (A)
;---------------------------------------------------------------------------
; to avoid multiple press the variable is not reset! :)

; stand parry
[State -1, SetVar31]
type = Varset
v = 31
trigger1 = command = "parryS"
value = ifelse((var(31) >= 5), 0, (var(31) + 1))
ctrl = 1

[State -1, IncreaseVar31]
type = Varset
v = 31
trigger1 = var(31) < 5
value = var(31) + 1
ctrl = 1

; crouch parry 32
[State -1, SetVar32]
type = Varset
v = 32
trigger1 = command = "parryC"
value = ifelse((var(32) >= 5), 0, (var(32) + 1))
ctrl = 1

[State -1, IncreaseVar32]
type = Varset
v = 32
trigger1 = var(32) < 5
value = var(32) + 1
ctrl = 1

; air parry
[State -1, SetVar33]
type = Varset
v = 33
trigger1 = command = "parryA"
value = ifelse((var(33) >= 5), 0, (var(33) + 1))
ctrl = 1

[State -1, IncreaseVar33]
type = Varset
v = 33
trigger1 = var(33) < 5
value = var(33) + 1
ctrl = 1

;---------------------------------------------------------------------------

; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 0]
type = VarRangeset
first = 1
last =  12
value = 0
trigger1 = roundno = 1
; Sets these values to zero, indicating the names of the moves haven't been
; displayed yet
[State 5900, 1] ;Intro
type = ChangeState
trigger1 = roundno = 1
value = 190





