[data]
life = 1000          ;amount of life to start with
attack = 100         ;100% attack power (more is stronger)
defence = 100        ;100% Defensive power (more is stronger)
fall.defence_up = 90 ;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 = 0     ;default spark number
guard.sparkno = 0;default guard spark number
volume = 80
intpersistindex=0
floatpersistindex=0
ko.echo = 0          ;1 to enable echo on ko
power = 3000

[size]
xscale = 1           ;horizontal scaling Factor.
yscale = 1           ;vertical scaling Factor.
ground.back = 20     ;player width (back, ground)
ground.front = 17    ;player width (front, ground)
air.back = 20        ;player width (back, air)
air.front = 11       ;player width (front, air)
z.width = 3          ;player width (into and out)
attack.width = 0     ;default attack width: back, Front
attack.dist = 160    ;default attack Distance
proj.attack.dist = 90 ;default attack Distance For projectiles
head.pos = -9, -93   ;approximate position of head
mid.pos = -5, -63    ;approximate position of midsection

[velocity]
walk.fwd  = 2.4      ;walk Forward
walk.back = -2.4     ;walk backward
run.fwd  = 5.5       ;run Forward (x, y)  - if y<0, player will hop
run.back = -5.5,-4.5 ;run backward (x, y) - if y=0, player will run
jump.neu = 0,-8    ;neutral jumping velocity (x, y)
jump.back = -3.3,-8     ;jump back speed (x, y)
jump.fwd = 3.3,-8       ;jump Forward speed (x, y)
runjump.fwd = 4,-8        ;.
;airjump.neu = 0,-9        ;.
;airjump.back = -2.55,-9   ;air jump speeds (opt)
;airjump.fwd = 2.5,-9      ;.

[movement]
;airjump.num = 0      ;number of air jumps allowed (opt)
;airjump.height = 35  ;minimum Distance From ground before you can air jump (opt)
yaccel = .450         ;vertical acceleration
stand.friction = .80  ;friction coefficient when standing
crouch.friction = .80 ;friction coefficient when crouching

;===================================================================================
; walk
[statedef 20]
type    = s
physics = s
sprpriority = 0

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

; play sound For steps
[state 100, 3.1]
type = playsnd
trigger1 = animelem = 4,=0
trigger2 = animelem = 8,=0
value = 0,12
channel = 20
volume = -20

[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
;============================================================================

; run_fwd
[statedef 100]
type = s
physics = s
anim = 100

[state 100, 1]
type = velset
trigger1 = time > 3
x = 7

; play sound when running
[state 100, 3.1]
type = playsnd
trigger1 = animelem = 2, 2
trigger2 = animelem = 5,2
value = 0,12
channel = 20
volume = 40

;stop channel 20's sound when button Fwd is release
[state 100, 4.1]
type = stopsnd
triggerall = var(9) != 1;ai cannot access
trigger1 = animelem = 5, >= 0
trigger1 = command != "holdfwd"
channel = 20;running snd

[state 100, 2]
type = changestate
triggerall = time >= 12
trigger1 = var(9) != 1
trigger1 = command != "holdfwd"
value = 101
ctrl = 1

[state 100, 2];ai modification
type = changestate
triggerall = var(9) = 1
triggerall = time >= 12
trigger1 = p2bodydist x <= 20
trigger2 = p2movetype = a
trigger3 = p2statetype = a
value = 101
ctrl = 1

[state 100, 2];ai modification
type = changestate
triggerall = var(9) = 1
triggerall = random <= 800
triggerall = p2bodydist x <= 20
trigger1 = p2movetype != a
trigger2 = p2statetype != a
trigger3 = p2stateno = 5120
value = 40
ctrl = 1

[state 100, 1]
type = assertspecial
trigger1 = 1
flag = nowalk

; run end to stand
[statedef 101]
type = s
physics = s
velset = 0,0
ctrl = 1

[state 100, 1]
type = changeanim
trigger1 = time = 0
value    = 101

[state 100, 1]
type = changestate
trigger1 = animtime = 0
value    = 0
ctrl = 1

; Dashing back (start)
[statedef 105]
type = s
physics = s
anim = 105
velset = 0
ctrl = 0

[state 105, 1]
type = changestate
trigger1 = animtime = 0
value = 106

; Dashing back (in the air)
[statedef 106]
type = a
physics = n
anim = 106

[state 106, 1]
type = velset
trigger1 = time = 0
x = -8
y = -4.5

[state 106, 2]
type = playsnd
trigger1 = time = 0
value = 0,8

[state 106, 3]
type = veladd
trigger1 = time > 0
x = .3
y = .45

[state 106, 4]
type = changestate
trigger1 = vel y > 0
trigger1 = pos y >= 0
value = 107

; Dashing back (landing)
[statedef 107]
type = s
physics = s
anim = 107
velset = 0,0

[state 107, 1]
type = posset
trigger1 = time = 0
y = 0

[state 107, 2]
type = playsnd
trigger1 = time = 0
value = 0,7

[state 107, 3]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; time over
[statedef 170]
type = s
anim = 170

[state 170, 1]
type = assertspecial
trigger1 = time = [0,120]
flag = roundnotover

;========================================================

; win pose a
[statedef 180]
type = s
physics = s
velset = 0
anim = 180

[state 180, 1]
type = changestate
triggerall = time = 0
trigger1 = command = "hold_a"
trigger2 = random <=300
trigger2 = command != "hold_a" && command != "hold_b" && command != "hold_x" && command != "hold_y" && command != "hold_z"
value = 181

[state 180, 1]
type = changestate
triggerall = time = 0
trigger1 = command = "hold_y"
trigger2 = random <=300
trigger2 = command != "hold_a" && command != "hold_b" && command != "hold_x" && command != "hold_y" && command != "hold_z"
value = 182

[state 180, 1]
type = changestate
triggerall = time = 0
trigger1 = command = "hold_b"
trigger2 = random <=300
trigger2 = command != "hold_a" && command != "hold_b" && command != "hold_x" && command != "hold_y" && command != "hold_z"
value = 183

[state 180, 1]
type = changestate
triggerall = time = 0
trigger1 = command = "hold_z"
trigger2 = random <=300
trigger2 = command != "hold_a" && command != "hold_b" && command != "hold_x" && command != "hold_y" && command != "hold_z"
value = 184

[state 180, 1]
type = assertspecial
trigger1 = time = [0,510]
flag = roundnotover

; win pose b gro Dance
[statedef 181]
type = s
physics = s
velset = 0
anim = 181

[state 180, 1]
type = assertspecial
trigger1 = time = [0,290]
flag = roundnotover

;win pose c "patweetums"
[statedef 182]
type = s
physics = s
velset = 0
anim = 182

[state 180, 1]
type = playsnd	
trigger1 = animelem = 11 
value =  0,18
volume = 70

[state 180, 1]
type = assertspecial
trigger1 = time = [0,280]
flag = roundnotover

;win pose D "tropang trumpo Dance"
[statedef 183]
type = s
physics = s
velset = 0
anim = 183

[state 180, 1]
type = assertspecial
trigger1 = time = [0,280]
flag = roundnotover

;win pose e "patikim ng pniya"
[statedef 184]
type = s
physics = s
velset = 0
anim = 184

[state 180, 1]
type = assertspecial
trigger1 = time = [0,280]
flag = roundnotover

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

; pre-fight intro
[statedef 190]
type = s
movetype = i
physics = s
velset = 0
anim = 190

[state 191, 1]
type = changestate
triggerall = time = 0
trigger1 = random < 300
value = 192

[state 191, 1]
type = changestate
trigger1 = p2name = "chris"
trigger2 = p2name = "chris"
trigger3 = p2name = "yashiro"
trigger4 = p2name = "shermie"
trigger5 = p2name = "orochi"
trigger6 = p2name = "orochir"
trigger7 = p2name = "oiori"
trigger8 = p4name = "chris"
trigger9 = p4name = "yashiro"
trigger10 = p4name = "shermie"
trigger11 = p4name = "orochi"
trigger12 = p4name = "orochir"
trigger13 = p4name = "oiori"
value = 192

[state 191, 1]
type = changestate
triggerall = time = 0
trigger1 = random < 300
value = 191

[state 191, 1]
type = changestate
triggerall = time = 0
trigger1 = p2name = "kyo"
trigger2 = p2name = "neokyo"
trigger3 = p2name = "kyo-1"
trigger4 = p2name = "iorix"
trigger5 = p2name = "shiniori"
trigger6 = p2name = "iori yagami"
trigger7 = p2name = "kyo kusanagi"
trigger8 = p4name = "neokyo"
trigger9 = p4name = "kyo-1"
trigger10 = p4name = "iorix"
trigger11 = p4name = "shiniori"
trigger12 = p4name = "iori yagami"
trigger13 = p4name = "kyo kusanagi"
value = 191

[state 191, 2]
type = assertspecial
trigger1 = time = [0,450]
flag = intro

[state 191, 3]
type = playsnd
trigger1 = animelem = 5, = 0
value = 0,0
volume = 40

[state 191, 3]
type = playsnd
trigger1 = animelem = 6, = 0
value = 0,1
volume = 50

[state 191, 4]
type = changestate
trigger1 = animtime = 0
value = 0

;***************************************************************************************
; pre-fight intro vs orochi
[statedef 191]
type = s
movetype = i
physics = s
velset = 0
anim = 191

[state 191, 3]
type = playsnd
trigger1 = animelem = 17, = 0
value = 0,3
volume = 70

[state 191, 1]
type = changestate
triggerall = time = 0
trigger1 = random < 500
value = 191

[state 191, 2]
type = assertspecial
trigger1 = time = [0,700]
flag = intro

[state 191, 4]
type = changestate
trigger1 = animtime = 0
value = 0
;=============================================================================================
;***************************************************************************************
; pre-fight intro vs kyo99
[statedef 192]
type = s
movetype = i
physics = s
velset = 0
anim = 192

[state 191, 3]
type = playsnd
trigger1 = animelem = 9,  = 4
trigger2 = animelem = 15,  = 4
value = 0,2
volume = 50

[state 191, 2]
type = assertspecial
trigger1 = time = [0,2200]
flag = intro

[state 191, 3]
type = playsnd
trigger1 = animelem = 6
value = 7,4
volume = 50

[state 191, 4]
type = changestate
trigger1 = animtime = 0
value = 0

;=============================================================================================
; taunt
[statedef 195]
type = s
movetype = i
physics = s
anim = 195
velset = 0
ctrl = 0

[state 195, 1]
type = playsnd
trigger1 = animelem = 6
value = 0,17
volume = 50

[state 1700, 2];kof 95-96 style, hehehe lose those powers!!!
type = targetpoweradd
trigger1 = animelem = 1, >= 0
value = -11

[state 195, 2]
type = ctrlset
trigger1 = animelem = 3, = 25
value = 1

[state 195, 3]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;===============================================[attacks]==============================
; standing light punch
[statedef 200]
type = s
movetype = a
physics = s
anim = 200
velset = 0
juggle = 5
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 200, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 200, 3]
type = hitdef
trigger1 = animelem = 3
attr = s, na
animtype = light
damage = 40
priority = 7, hit
guarDFlag = ma
pausetime = 10,10
sparkno = s1036
guard.sparkno = s1038
sparkxy = 0,-99
hitsound = s200,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -6.5
air.velocity = -6,-2
airguard.velocity = -6.5,-1
getpower = 50,50
givepower = 50,50

[state 200, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing Forward light punch
[statedef 215]
type = s
movetype = a
physics = s
anim = 205
velset = 0
juggle = 7
poweradd = 70
hitcountpersist = 1
ctrl = 0

[state 240, 2]
type = screenbound
trigger1 = 1
value = 0
movecamera = 1,0

[state 240, 2]
type = width
trigger1 = time >=0
player = 20,40

[state 240, 2]
type = posadd
trigger1 = animelem = 4 
x = 39

[state 240, 2]
type = posadd
trigger1 = animelem = 5 
x = 14

[state 240, 2]
type = posadd
trigger1 = animelem = 7 
x = 18

[state 240, 2]
type = posadd
trigger1 = animelem = 9 
x = 17

[state 240, 2]
type = posadd
trigger1 = animelem = 14 
x = 11

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 240, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 250, 3]
type = hitdef
trigger1 = animelem = 8
attr = s, na
animtype = hard
damage = 44
guarDFlag = ma
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-73
hitsound = s240,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -11.5
air.velocity = -6.5,-2.5
airguard.velocity = -6,-1.5
ground.cornerpush.velon = 4
air.cornerpush.velon = 4
guard.cornerpush.velon = 4
air.juggle = 7
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 240, 2]
type = playsnd
trigger1 = animelem = 8
value = 215,0

[state 240, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing light kick
[statedef 220]
type = s
movetype = a
physics = s
anim = 220
velset = 0
juggle = 5
poweradd = 50
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 220, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 220, 3]
type = hitdef
trigger1 = animelem = 4
attr = s, na
animtype = light
hitflag = maf
damage = 41
guarDFlag = ma
pausetime = 10,10
priority = 7, hit
sparkno = s1036
guard.sparkno = s1038
sparkxy = 6,-93
hitsound = s220,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -6.5
air.velocity = -6,-2
airguard.velocity = -8.5,-1
getpower = 30,30
givepower = 30,30

[state 220, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing light kick (close)
[statedef 230]
type = s
movetype = a
physics = s
anim = 230
velset = 0
juggle = 5
poweradd = 70
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 220, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 230, 3]
type = hitdef
trigger1 = animelem = 3
attr = s, na
animtype = light
damage = 44
priority = 5, hit
guard.pausetime = 12,15
hitflag = maf
guarDFlag = l
pausetime = 10,10
priority = 5, hit
sparkno = s1036
guard.sparkno = s1038
sparkxy = -5,-99
priority = 7, hit
hitsound = s220,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -6.5
air.velocity = -6.5,-3
airguard.velocity = -6,-1
getpower = 30,30
givepower = 30,30

[state 230, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing Forward light kick start
[statedef 235]
type = s
movetype = i
physics = s
anim = 235
velset = 0
poweradd = 10
ctrl = 0

[state 240, 1]
type = velset 
trigger1 = time = 0
x = 0

[state 200, 1]
type = playsnd
trigger1 = animelem = 1,=2
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = animelem = 1, =2
value = 220,2

[state 240, 4]
type = changestate
trigger1 = animtime = 0
value = 236
ctrl = 0

; standing Forward light kick air
[statedef 236]
type = a
movetype = i
physics = n
anim = 236
velset = 4.3,-5.2
poweradd = 10
ctrl = 0

[state 240, 1]
type = veladd
trigger1 = time >= 0
y = .555

[state 240, 1]
type = playsnd
trigger1 = time = 0
value = 0,5
volume = 30

[state 240, 4]
type = changestate
trigger1 = pos y >0
trigger1 = vel y >0
value = 237
ctrl = 0

; standing Forward light kick land
[statedef 237]
type = s
movetype = a
physics = s
anim = 237
velset = 0,0
juggle = 7
poweradd = 70
ctrl = 0

[state 237, 1]
type = posset
trigger1 = time = 0
y = 0

;play sound when landing
[state 52, 3]
type = playsnd
trigger1 = time = 0
value = 0,7
volume = 60

[state 237, 3]
type = hitdef
trigger1 = animelem = 2
attr = s, na
animtype = medium
damage = 46
guarDFlag = ha
hitflag = maf
pausetime = 12,12
sparkno = s1037
guard.sparkno = s1039
sparkxy = -8,-85
hitsound = s260,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -7.5
air.velocity = -6,-2.5
airguard.velocity = -8,-1.5
getpower = 30,30
givepower = 30,30

[state 237, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing hard punch
[statedef 240]
type = s
movetype = a
physics = s
anim = 240
juggle = 10
velset = 0
poweradd = 70
ctrl = 0

[state 240, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 240, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 240, 3]
type = hitdef
trigger1 = animelem = 4 
attr = s, na
animtype = hard
damage = 77
guarDFlag = ma
hitflag = maf
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = 0,-52
hitsound = s240,0
guardsound = s200,3
ground.type = low
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -11
air.velocity = -6,-2.5
airguard.velocity = -10,-1.5
guard.velocity = -9
getpower = 30,30
givepower = 30,30

[state 240, 3]
type = hitdef
trigger1 = !movecontact
trigger1 = animelem = 5
attr = s, na
animtype = hard
htiflag = maf-
damage = 78
guarDFlag = ma
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
guard.sparkno = s1039
sparkxy = 1,-91
sparkno = s1037
hitsound = s240,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -9
air.velocity = -6,-2.5
airguard.velocity = -9.5,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 240, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing hard punch (close)
[statedef 250]
type = s
movetype = a
physics = s
anim = 250
juggle = 10
poweradd = 70
velset = 0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 250, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 250, 3]
type = hitdef
trigger1 = animelem = 3
attr = s, na
hitflag = maf
animtype = hard
damage = 77
guarDFlag = ma
pausetime = 12,12
priority = 7, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-104
hitsound = s240,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -11
air.velocity = -6,-2.5
airguard.velocity = -6,-1.5
guard.velocity = -9
getpower = 30,30
givepower = 30,30

[state 250, 5]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing hard kick
[statedef 260]
type = s
movetype = a
physics = s
anim = 260
juggle = 10
poweradd = 70
velset = 0
ctrl = 0

[state 240, 2]
type = width
trigger1 = animelem = 3, >=0 
player = 40,0

[state 240, 2]
type = posadd
trigger1 = animelem = 10, [0,2] 
trigger2 = animelem = 10, [2,4]
trigger3 = animelem = 11, [0,2]
x = 3.2

[state 240, 2]
type = posadd
trigger1 = animelem = 12, [0,2]
trigger2 = animelem = 13, [0,2]
x = .8

[state 240, 2]
type = posadd
trigger1 = animelem = 14 
x = 30

[state 240, 2]
type = screenbound
trigger1 = animelem = 14, =0
value = 1
movecamera = 1,0

[state 200, 1]
type = playsnd
trigger1 = animelem = 3
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = animelem = 3
value = 220,2

[state 260, 3]
type = hitdef
trigger1 = animelem = 10
attr = s, na
animtype = hard
damage = 79
guarDFlag = ma
hitflag = maf
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-88
hitsound = s260,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -10
air.velocity = -6,-2.5
airguard.velocity = -10.5,-1.5
getpower = 30,30
givepower = 30,30

[state 260, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing hard kick (close)
[statedef 270]
type = s
movetype = a
physics = s
anim = 270
poweradd = 70
juggle = 10
velset = 0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 270, 3]
type = hitdef
trigger1 = animelem = 3
attr = s, na
animtype = hard
damage = 78
hitflag = maf
guarDFlag = ma
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = 0,-72
hitsound = s260,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -9.5
air.velocity = -6,-2.5
airguard.velocity = -6,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 270, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing knockdown attack
[statedef 280]
type = s
movetype = a
physics = s
anim = 280
poweradd = 100
juggle = 15
velset = 0
ctrl = 0

[state 240, 2]
type = width
trigger1 = animelem = 5, >=0
player = 35,20

[state 200, 1]
type = playsnd
trigger1 = animelem = 5
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = animelem = 5
value = 220,2

[state 280, 3]
type = hitdef
trigger1 = animelem = 6
attr = s, na
damage = 111
hitflag = maf
guarDFlag = ma
pausetime = 15,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = -11,-65
hitsound = s280,0
guardsound = s200,3
ground.velocity = -4.5,-3.5
air.velocity = -4,-4
airguard.velocity = -4,-2
fall = 1
fall.recover = 0
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 280, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; crouching light punch
[statedef 400]
type = c
movetype = a
physics = c
anim = 400
velset = 0
juggle = 5
poweradd = 50
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 200, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 400, 3]
type = hitdef
trigger1 = animelem = 3
attr = c, na
animtype = light
damage = 40
guarDFlag = la
hitflag = maf
priority = 7, hit
pausetime = 10,10
sparkno = s1036
guard.sparkno = s1038
sparkxy = 2,-46
hitsound = s200,0
guardsound = s200,3
ground.type = low
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -7.5
air.velocity = -6,-2
airguard.velocity = -6,-1
getpower = 30,30
givepower = 30,30

[state 400, 4]
type = changestate
trigger1 = animtime = 0
value = 11
ctrl = 1

;crouching light kick
[statedef 420]
type = c
movetype = a
physics = c
anim = 420
juggle = 5
poweradd = 50
velset = 0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 220, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 420, 3]
type = hitdef
trigger1 = animelem = 2
attr = c, na
animtype = light
damage = 43
guarDFlag = l
hitflag = maf
priority = 7, hit
pausetime = 10,10
sparkno = s1036
guard.sparkno = s1038
sparkxy = 7,-4
hitsound = s220,0
guardsound = s200,3
ground.type = low
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -7.5
air.velocity = -6,-2
airguard.velocity = -7.5,-1
getpower = 30,30
givepower = 30,30

[state 420, 4]
type = changestate
trigger1 = animtime = 0
value = 11
ctrl = 1

;sliding crouch attack
[statedef 470]
type = c
movetype = a
physics = c
anim = 470
juggle = 7
poweradd = 50
velset = 0,0
ctrl = 0

[state 240, 2]
type = screenbound
trigger1 = 1
value = 0
movecamera = 1,0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 270, 2]
type = velset
trigger1 = animelem = 3, =1
x = 15

[state 270, 2]
type = veladd
trigger1 = animelem = 5, >0
x = -.0222

[state 270, 2]
type = velset
trigger1 = animelem = 6
x = 0

[state 270, 3]
type = hitdef
trigger1 = animelem = 3
attr = s, na
animtype = medium
damage = 57
hitflag = maf
guarDFlag = l
pausetime = 12,12
priority = 7, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-5
hitsound = s260,0
guardsound = s200,3
ground.type = low
ground.slidetime = 22
ground.hittime = 18
ground.velocity = -9
air.velocity = -5,-4.5
airguard.velocity = -4,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 420, 4]
type = changestate
trigger1 = animtime = 0
value = 11
ctrl = 1

; crouching hard punch
[statedef 440]
type = c
movetype = a
physics = c
anim = 440
velset = 0
juggle = 10
poweradd = 70
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 250, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 240, 3]
type = hitdef
trigger1 = animelem = 2 
attr = s, na
animtype = hard
damage = 78
guarDFlag = ma
hitflag = maf
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = 0,-52
hitsound = s240,0
guardsound = s200,3
ground.type = low
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -9.5
air.velocity = -6,-2.5
airguard.velocity = -6,-1.5
guard.velocity = -9
getpower = 30,30
givepower = 30,30

[state 240, 3]
type = hitdef
trigger1 = !movecontact
trigger1 = animelem = 3
attr = s, na
animtype = hard
htiflag = maf
damage = 78
guarDFlag = ma
pausetime = 12,12
priority = 5, hit
guard.pausetime = 12,15
guard.sparkno = s1039
sparkxy = 1,-91
sparkno = s1037
hitsound = s240,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -9.5
air.velocity = -6,-2.5
airguard.velocity = -6,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 440, 5]
type = changestate
trigger1 = animtime = 0
value = 11
ctrl = 1

; crouching hard kick
[statedef 460]
type = c
movetype = a
physics = c
anim = 460
juggle = 15
velset = 0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 270, 3]
type = hitdef
trigger1 = animelem = 5
attr = s, na
animtype = hard
damage = 99
hitflag = maf
guarDFlag = l
pausetime = 12,12
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-5
hitsound = s260,0
guardsound = s200,3
ground.type = trip
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -4,-4
air.velocity = -4,-4.5
airguard.velocity = -4,-1.5
guard.velocity = -8.9
fall = 1
fall.recover = 0
getpower = 30,30
givepower = 30,30

[state 460, 4]
type = changestate
trigger1 = animtime = 0
value = 11
ctrl = 1

;-------------------------------------------------------------
;vertical
;----------
;jumping light punch
[statedef 600]
type = a
movetype = a
physics = a
poweradd = 50
juggle = 5
anim = 600
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 200, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 600, 3]
type = hitdef
trigger1 = animelem = 3
attr = a, na
animtype = light
damage = 46
priority = 7, hit
guarDFlag = ha
hitflag = maf
pausetime = 10,10
sparkno = s1036
guard.sparkno = s1038
sparkxy = 0,-62
hitsound = s200,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -3.5
air.velocity = -3,-2
airguard.velocity = -2.5,-1
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 600, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;jumping light kick
[statedef 620]
type = a
movetype = a
physics = a
anim = 620
poweradd = 50
juggle = 5
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 220, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 620, 3]
type = hitdef
trigger1 = animelem = 2
attr = a, na
animtype = light
priority = 7, hit
damage = 47
hitflag = maf
guarDFlag = ha
priority = 7, hit
pausetime = 10,10
sparkno = s1036
guard.sparkno = s1038
sparkxy = 0,-67
hitsound = s220,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -3.5
air.velocity = -3,-2
airguard.velocity = -2.5,-1
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 620, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;jumping hard punch
[statedef 640]
type = a
movetype = a
physics = a
poweradd = 70
juggle = 10
anim = 640
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 250, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 640, 3]
type = hitdef
trigger1 = animelem = 3
attr = a, na
animtype = hard
damage = 79
hitflag = maf
guarDFlag = ha
pausetime = 12,12
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-50
hitsound = s240,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -3.5
air.velocity = -3,-2.5
airguard.velocity = -3,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 640, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;jumping hard kick
[statedef 660]
type = a
movetype = a
physics = a
poweradd = 70
juggle = 10
anim = 660
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 660, 3]
type = hitdef
trigger1 = animelem = 4
attr = a, na
animtype = hard
damage = 79
hitflag = maf
guarDFlag = ha
pausetime = 12,12
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-55
hitsound = s260,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -3.5
air.velocity = -3.5,-2.5
airguard.velocity = -3,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 660, 5]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;-------------------------------------------------------------
; horizontal
;------------
;jumping light punch
[statedef 610]
type = a
movetype = a
physics = a
poweradd = 50
juggle = 5
anim = 610
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 200, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 600, 3]
type = hitdef
trigger1 = animelem = 3
attr = a, na
animtype = light
damage = 46
priority = 7, hit
guarDFlag = ha
pausetime = 9,9
sparkno = s1036
guard.sparkno = s1038
sparkxy = 0,-52
hitsound = s200,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -3.5
air.velocity = -3,-2
airguard.velocity = -2.5,-1
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 600, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;jumping light kick
[statedef 630]
type = a
movetype = a
physics = a
anim = 630
poweradd = 50
juggle = 5
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,0

[state 220, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 620, 3]
type = hitdef
trigger1 = animelem = 4
attr = a, na
animtype = light
priority = 7, hit
damage = 47
guarDFlag = ha
priority = 7, hit
pausetime = 9,9
sparkno = s1036
guard.sparkno = s1038
sparkxy = 0,-52
hitsound = s220,0
guardsound = s200,3
ground.type = high
ground.slidetime = 8
ground.hittime = 8
ground.velocity = -3.5
air.velocity = -3,-2
airguard.velocity = -2.5,-1
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 620, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;jumping hard punch
[statedef 650]
type = a
movetype = a
physics = a
poweradd = 70
juggle = 10
anim = 650
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 250, 2]
type = playsnd
trigger1 = time = 0
value = 200,2

[state 640, 3]
type = hitdef
trigger1 = animelem = 3
attr = a, na
animtype = hard
damage = 78
guarDFlag = ha
pausetime = 12,12
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-40
hitsound = s240,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -3.5
air.velocity = -3.5,-2.5
airguard.velocity = -3,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 640, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;jumping hard kick
[statedef 670]
type = a
movetype = a
physics = a
poweradd = 70
juggle = 10
anim = 670
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 660, 3]
type = hitdef
trigger1 = animelem = 3
attr = a, na
animtype = hard
damage = 79
guarDFlag = ha
pausetime = 12,12
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-52
hitsound = s260,0
guardsound = s200,3
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -3.5
air.velocity = -3.5,-2.5
airguard.velocity = -3,-1.5
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 660, 5]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;-------------------------------------------------------------
; jumping knockdown attack
[statedef 680]
type = a
movetype = a
physics = a
poweradd = 100
juggle = 15
anim = 680
ctrl = 0

[state 270, 2]
type = width
trigger1 = time >= 0
player = 40,20

[state 200, 1]
type = playsnd
trigger1 = time = 0
trigger1 = random < 950
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = time = 0
value = 220,2

[state 680, 3]
type = hitdef
trigger1 = animelem = 4
attr = a, na
hitflag = maf
animtype = back
damage = 140
guarDFlag = ha
pausetime = 15,15
sparkno = s1037
guard.sparkno = s1039
sparkxy = -10,-58
hitsound = s280,0
guardsound = s200,3
ground.velocity = -4.5,-4
air.velocity = -3,-2
airguard.velocity = -2.5,-1
fall = 1
fall.recover = 0
guard.velocity = -8.9
getpower = 30,30
givepower = 30,30

[state 680, 4]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

'=======================================================================================
;throws-------------------------------
;=====================================
;throw y
;---------------------------------------------------------------------------
;graby
[statedef 300]
type    = s
movetype= a
physics = s
juggle  = 15
velset = 0,0
ctrl = 0
anim = 300
sprpriority = 5

[state 813, 7]
type = width
trigger1 = time >= 0
edge = 20,20

[state 1800, 1]
type = hitdef
trigger1 = var(4)<=0
trigger1 = time = 0
attr = s, nt          
hitflag = m-          
priority = 4, miss    
sparkno = -1          
sprpriority = 1  
hitsound = 240,0     
p2facing = 1          
p1stateno = 301       
p2stateno = 302       
fall = 1              
fall.recover = 0
down.bounce = 1

[state 1800, 2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[statedef 301]
type    = s
movetype= a
physics = s
anim = 301
sprpriority = -1
poweradd = 100

[state 810, 10]
type = targetstate
trigger1 = time = 0
value = 302

[state 810, 10]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1,0

[state 813, 7]
type = width
trigger1 = 1
edge = 70,40

[state 270, 2]
type = playsnd
trigger1 = animelem = 9
value = 4,0
volume = 50

[state 240, 2]
type = playsnd
trigger1 = animelem = 9
value = 215,0
volume = 50

[state 810, bind 1]
type = targetbind
trigger1 = animelem = 9,<=0 
pos = 50, 0
time = 1

[state 810, 1]
type = targetlifeadd
trigger1 = animelem = 9, =2
value = -174

[state 810, 10]
type = targetstate
trigger1 = animelem = 9,=3
value = 303

[state 810, 2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;(hit by, on ground)
[statedef 302]
type    = a
movetype= h ;get hit
physics = n
ctrl = 0

[state 820, 1]
type = changeanim2
trigger1 = time = 0
value = 302
;---------------------------------------------------------------------------
; (hit by, on ground)
[statedef 309]
type    = a
movetype= h ;get hit
physics = n
ctrl = 0

[state 820, 1]
type = changeanim2
trigger1 = time = 0
value = 308
;---------------------------------------------------------------------------
; (hit by, into air)
[statedef 303]
type    = a
movetype= h ;get hit
velset = -1,-3
physics = n
ctrl = 0

[state 1028, anim 5060] ;coming Down 
type = changeanim2
trigger1 = time = 0
trigger1 = selfanimexist(5030)
persistent = 0
value = 5030

[state 1028, anim 5060] ;coming Down  
type = changeanim2
trigger1 = vel y > -2
trigger1 = anim = 5052
trigger1 = selfanimexist(5062)
persistent = 0
value = 5060

[state 830, 2] ;gravity
type = veladd
trigger1 = time = 1 
x = -.5
y = -2

[state 830, 2] ;gravity
type = veladd
trigger1 = time >= 2
y = .45

[state 830, 7] ;hit ground
type = selfstate
trigger1 = (vel y > 0) && (pos y >= 0)
value = 5100 ;hit ground

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


;throw b
;---------------------------------------------------------------------------
;grabb
[statedef 305]
type    = s
movetype= a
physics = s
juggle  = 15
velset = 0,0
ctrl = 0
anim = 305
sprpriority = 5

[state 1800, 1]
type = hitdef
trigger1 = var(4) <= 0
trigger1 = time = 0
attr = s, nt          
hitflag = m-          
priority = 4, miss    
sparkno = -1          
sprpriority = 1       
p2facing = 1          
p1stateno = 306       
p2stateno = 307       
fall = 1              
fall.recover = 0
down.bounce = 1

[state 1800, 2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[statedef 306]
type    = s
movetype= a
physics = n
anim = 306
poweradd = 100
sprpriority = -1

[state 810, 10]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1,0

[state 813, 7]
type = width
trigger1 = 1
edge = 70,40

[state 813, 7]
type = posadd
trigger1 = animelem = 7, =0
x = 45

[state 810, bind 1]
type = targetbind
trigger1 = animelem = 7, <0
pos = 50, 0
time = 1

[state 810, bind 1]
type = targetbind
trigger1 = animelem = 7, >=0
trigger1 = animelem = 9, <0
pos = 10, 0
time = 1

[state 270, 2]
type = playsnd
trigger1 = animelem = 9
value = 4,1
volume = 50

[state 240, 2]
type = playsnd
trigger1 = animelem = 9
value = 215,0
volume = 50

[state 810, 10]
type = turn
trigger1 = animtime = 0
value = 1

[state 810, 1]
type = targetlifeadd
trigger1 = animelem = 9,=0
value = -174

[state 810, 10]
type = targetstate
trigger1 = animelem = 9=0
value = 308

[state 810, 2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------

;(hit by, on ground)
[statedef 307]
type    = a
movetype= h ;get hit
physics = n
ctrl = 0

[state 820, 1]
type = changeanim2
trigger1 = time = 0
value = 307

[state 820, 1]
type = changeanim2
trigger1 = animtime = 0
value = 308

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

;(hit by, into air)
[statedef 308]
type    = a
movetype= h ;get hit
physics = n
velset = 2,-6.5
ctrl = 0

[state 810, 10]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1,0

[state 820, 1]
type = changeanim2
trigger1 = time = 0
value = 308

[state 813, 7]
type = width
trigger1 = time >= 0
edge = 40,40

[state 830, 1]
type = posadd
trigger1 = time = 0
x = 0
y = -75

[state 830, 2] ;gravity
type = veladd
trigger1 = time >= 0
y = .6

[state 2027, 5]
type = angleset
trigger1 = time = 0
value = 0

[state 2027, 5]
type = angleadd
trigger1 = time < 27
value = -10.5

[state 2027, 6]
type = angledraw
trigger1 = time < 27

[state 830, 1]
type = velset
trigger1 = time = 27
x = 1

[state 830, 2] ;gravity
type = velset
trigger1 = (vel y = 3) && (pos y = 3)
y = .2

[state 1028, hit ground]
type = selfstate
trigger1 = (vel y > 0) && (pos y >= 0)
value = 5100

;---------------------------------------------------------------------------
;=================================================================================
;---[rolls, sidestep n charge]---
;=================================================================================
;roll (forwards)
[statedef 700]
type = s
movetype = i
physics = n
anim = 700
poweradd = 50
velset = 0,0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
volume = 70
value = 2,0

[state 1000, 1]
type = hitby
trigger1 = animelem = 8, <= 0
value = sca, nt, st, ht

[state 1000, 1]
type = varset
trigger1 = time = 0
var(1) = 0

[state 200, 1]
type = afterimage
trigger1 = time = 8
trigger1 = animelemtime(3) = 0
time = 7
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 5

[state 750, 4]
type = sprpriority
trigger1 = time = 8
value = -2

[state 250, 4]
type = velset
trigger1 = animelem = 3
x = 6.7

[state 250, 5]
type = veladd
trigger1 = animelem = 3, >= 0
trigger2 = animelem = 7, >= 0
x = -.10

[state 250, 6]
type = velset
trigger1 = animelem = 8
x = 0

[state 750, 6]
type = playerpush
trigger1 = time < 24
value = 0

[state 750, 6]
type = playerpush
trigger1 = time >= 24
value = 1

[state 250, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;######################################################################
;roll (forwards) while running
[statedef 706]
type = s
movetype = i
physics = n
anim = 700
poweradd = 50
velset = 0,0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
volume = 70
value = 2,0

[state 1000, 1]
type = hitby
trigger1 = animelem = 8, <= 0
value = sca, nt, st, ht

[state 1000, 1]
type = varset
trigger1 = time = 0
var(1) = 0

[state 200, 1]
type = afterimage
trigger1 = time = 8
trigger1 = animelemtime(3) = 0
time = 7
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 5

[state 750, 4]
type = sprpriority
trigger1 = time = 8
value = -2

[state 250, 4]
type = velset
trigger1 = animelem = 3
x = 8.5

[state 250, 5]
type = veladd
trigger1 = animelem = 3, >= 0
trigger2 = animelem = 7, >= 0
x = -.09

[state 250, 6]
type = velset
trigger1 = animelem = 8
x = 0

[state 750, 6]
type = playerpush
trigger1 = time < 24
value = 0

[state 750, 6]
type = playerpush
trigger1 = time >= 24
value = 1

[state 1000, 1]
type = varset
triggerall = time > 1
trigger1 = command = "x"
trigger2 = command = "y"
var(1) = 1

[state 250, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;######################################################################
;######################################################################
;  roll (backwards)
[statedef 701]
type = s
movetype = i
physics = n
anim = 700
poweradd = 50
velset = 0
ctrl = 0
sprpriority = -1

[state 200, 1]
type = playsnd
trigger1 = time = 0
volume = 70
value = 2,0

[state 750, 6]
type = playerpush
trigger1 = time < 24
value = 0

[state 750, 6]
type = playerpush
trigger1 = time >= 24
value = 1

[state 1000, 1]
type = hitby
trigger1 = time >= 0
value = sca, nt, st, ht

[state 200, 1]
type = afterimage
trigger1 = time = 8
trigger1 = animelemtime(3) = 0
time = 7
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 5

[state 750, 4]
type = sprpriority
trigger1 = time = 8
value = -2

[state 250, 4]
type = velset
trigger1 = animelem = 3
x = -6

[state 250, 5]
type = veladd
trigger1 = animelem = 3, >= 0
trigger2 = animelem = 7, >= 0
x = .12

[state 250, 6]
type = velset
trigger1 = animelem = 8
x = 0

[state 260, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;=================================================================================
;########################################################################################
;=================================================================================
;sidestep
[statedef 702]
type = s
movetype = i
physics = n
anim = 702
poweradd = 50
velset = 0,0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
volume = 70
value = 2,0

[state 200, 1]
type = playsnd
trigger1 = time = 0
value = 23,4
volume = 30

[state 1000, 1]
type = hitby
trigger1 = time >= 0
value = sca, nt, st, ht

[state 1000, 1]
type = varset
trigger1 = time = 0
var(1) = 0

[state 750, 4]
type = sprpriority
trigger1 = time = 8
value = -2

[state 750, 6]
type = playerpush
trigger1 = time >= 0
value = 0

[state 1000, 1]
type = varset
triggerall = time > 1
trigger1 = command = "x"
trigger2 = command = "y"
var(1) = 1

[state 250, 7]
type = changestate
triggerall = var(9) != 1
triggerall = time >= 20
trigger1 = var(1) = 1
value = 703

[state 250, 7]
type = changestate
triggerall = var(9) = 1
triggerall = time >= 20
trigger1 = p2bodydist x = [5,40]
value = 703

[state 250, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;=================================================================================
;attack
[statedef 703]
type = s
movetype = a
physics = s
anim = 703
poweradd = 50
sprpriority = 3
velset = 0,0
ctrl = 0

[state 200, 1]
type = playsnd
trigger1 = time = 0
value = 200,1

[state 680, 3]
type = hitdef
trigger1 = animelem = 4
attr = a, sa
hitflag = maf
animtype = medium
damage = 75
guarDFlag = ma
pausetime = 11,11
sparkno = s1037
guard.sparkno = s1039
sparkxy = -14,-80
ground.hittime = 14
ground.slidetime = 11
hitsound = s240,0
guardsound = s200,3
ground.velocity = -11.5
air.velocity = -7,-2
airguard.velocity = -7.5,-1

[state 750, 6]
type = playerpush
trigger1 = time >= 0
value = 0

[state 250, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;==========================================================================================
;=========================================================================
;---------------------------------------------------------------------------
; charge level = 0
[statedef 704]
type = s
movetype = i
physics = s
ctrl = 0
velset = 0,0
anim = 704

[state 255, 1]
type = poweradd
trigger1 = time >= 1
value = 6

[state 1230, 2]
type = playsnd
trigger1 = time = 5
value = 3,0
channel = 0
volume = 50

[state 1230, 2]
type = playsnd
trigger1 = time = 5
value = 3,1
channel = 1
volume = 50

[state 3153, 6]
type = explod
trigger1 = time = 4
ignorehitpause = 1
anim = 706
id = 706
pos= 0,0
postype = p1
removetime = 9999
supermove = 10
sprpriority = 2
removeongethit = 1
ownpal = 1

[state 255, 2]
type = changestate
triggerall = time >= 2
trigger1 = command != "hold_x"
trigger2 = command != "hold_y"
value = 705
ctrl = 1

[state 255, 2]
type = changestate
triggerall = power  >=  3000
trigger1 = command = "hold_x"
trigger1 = command = "hold_y"
value = 705
ctrl = 1

;+++++++++++++++++++++++++++++++++++++++++++
; charge over
[statedef 705]
type = s
movetype = i
physics = s
anim = 705
ctrl = 0

[state 255, 2]
type = stopsnd
trigger1 = time = 0
channel = 0
value = 3,0

[state 255, 2]
type = stopsnd
trigger1 = time = 0
channel = 1
value = 3,1

[state 255, 2]
type = removeexplod
trigger1 = time = 0
id = 706

[state 256, stop voice]
type = ctrlset 
trigger1 = time = 2
value = 1

[state 256, 2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;===================================================

;maximum
[statedef 707]
type = s
movetype = i
physics = s
anim = 708
ctrl = 0

[state 255, 2]
type = playsnd
trigger1 = animelem = 6
channel = 0
value = 2,1
volume = 30

[state 255, 2]
type = playsnd
trigger1 = animelem = 6
value = 12,0
volume = 30

[state 3153, 6]
type = explod
trigger1 = animelem = 6 
ignorehitpause = 1
anim = 707
id = 707
pos= 0,0
postype = p1
removetime = 16
supermove = 10
sprpriority = 2
removeongethit = 1
ownpal = 1

[state 256, ctrlset]
type = poweradd 
trigger1 = animelem = 6
value = -1000

[state 256, varset]
type = varset 
trigger1 = animelem = 6
var(10) = 1000

[state 700, meter]
type = helper
trigger1 = animelem = 6
helpertype = normal
stateno = 713
name = "maxmeter"
id      = 713
postype = p1
pos = 0,17
keyctrl = 0
ownpal = 1

[state 256, 2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;================================================================
;stolen From neogouki's timer :p

[statedef 713]
anim = 9999

[state 713, 1]
type = bindtoroot
trigger1 = 1
pos = 0,17

[state 713, 2]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 713, power Up]
type = explod
trigger1 = time = 0
trigger1 = Facing = 1
anim = 717
id =   717
postype = p1
pos = 0,-10
facing = 1
bindtime = -1
ontop = 1

[state 713, power Up]
type = explod
trigger1 = time = 0
trigger1 = Facing = -1
anim = 717
id =   717
postype = p1
pos = 0,10
facing = -1
bindtime = -1
ontop = 1

[state 713, 3]
type = explod
trigger1 = time = 0
trigger1 = Facing = 1
anim = 714
id =   714
postype = p1
pos = 0,0
facing = 1
bindtime = -1
removetime = -1
ontop = 1

[state 713, 4]
type = explod
trigger1 = time = 0
trigger1 = Facing = -1
anim = 714
id =   714
postype = p1
pos = 0,0
facing = -1
bindtime = -1
removetime = -1
ontop = 1

[state 713, 5]
type = explod
trigger1 = time = 0
trigger1 = Facing = 1
anim = 715
id = 715
postype = p1
pos = 38,0
facing = 1
removetime = 99999
bindtime = -1
ontop = 1
ignorehitpause = 1

[state 713, 6]
type = explod
trigger1 = time = 0
trigger1 = Facing = -1
anim = 715
id = 715
postype = p1
pos = -38,0
facing = -1
removetime = 99999
bindtime = -1
ontop = 1
ignorehitpause = 1

[state 713, 7]
type = modifyexplod
trigger1 = root, var(10) > 0
id = 715
scale = (1000 - root, var(10)) / 1000.0,1
ontop = 1

[state 713, 8]
type = changestate
trigger1 = root, var(10) <= 0
trigger2 = life <= 0
value = 715

;=======================================================

; timer (disappearing)
[statedef 715]
anim = 9999

[state 714, 1]
type = bindtoroot
trigger1 = 1
pos = 0,17

[state 714, 2]
type = removeexplod
trigger1 = time = 0

[state 714, 3]
type = explod
trigger1 = time = 0 && Facing = 1
anim = 716
postype = p1
pos = 0,0
facing = 1
removetime = -1
bindtime = -1
ontop = 1

[state 714, 4]
type = explod
trigger1 = time = 0 && Facing = -1
anim = 716
postype = p1
pos = 0,0
facing = -1
removetime = -1
bindtime = -1
ontop = 1

[state 714, 5]
type = modifyexplod
trigger1 = 1
scale =1,(1-(0.05*time))

[state 714, 6]
type = removeexplod
trigger1 = time = 20

[state 714, 7]
type = Destroyself
trigger1 = time = 20

;=============================================================================


;######################################################################
;  roll (backwards) counter
[statedef 710]
type = s
movetype = i
physics = n
anim = 700
velset = 0
ctrl = 0
sprpriority = -1

[state 2005, 6]
type = superpause
trigger1 = time = 0
time = 11
pos = 0,-80
poweradd = -1000
movetime = 0
anim = s1350

[state 200, 1]
type = playsnd
trigger1 = time = 0
volume = 70
value = 2,0

[state 750, 6]
type = playerpush
trigger1 = time < 24
value = 0

[state 750, 6]
type = playerpush
trigger1 = time >= 24
value = 1

[state 1000, 1]
type = hitby
trigger1 = time >= 0
value = sca, nt, st, ht

[state 200, 1]
type = afterimage
trigger1 = time = 8
trigger1 = animelemtime(3) = 0
time = 7
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 5

[state 750, 4]
type = sprpriority
trigger1 = time = 8
value = -2

[state 250, 4]
type = velset
trigger1 = animelem = 3
x = -6

[state 250, 5]
type = veladd
trigger1 = animelem = 3, >= 0
trigger2 = animelem = 7, >= 0
x = .12

[state 250, 6]
type = velset
trigger1 = animelem = 8
x = 0

[state 260, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1


;=================================================================================

;######################################################################
;  roll (forward) counter
[statedef 711]
type = s
movetype = i
physics = n
anim = 700
poweradd = 50
velset = 0,0
ctrl = 0

[state 2005, 6]
type = superpause
trigger1 = time = 0
time = 11
pos = 0,-80
poweradd = -1000
movetime = 0
anim = s1350

[state 200, 1]
type = playsnd
trigger1 = time = 0
volume = 70
value = 2,0

[state 1000, 1]
type = hitby
trigger1 = time >= 0
value = sca, nt, st, ht

[state 1000, 1]
type = varset
trigger1 = time = 0
var(1) = 0

[state 200, 1]
type = afterimage
trigger1 = time = 8
trigger1 = animelemtime(3) = 0
time = 7
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 5

[state 750, 4]
type = sprpriority
trigger1 = time = 8
value = -2

[state 250, 4]
type = velset
trigger1 = animelem = 3
x = 6.7

[state 250, 5]
type = veladd
trigger1 = animelem = 3, >= 0
trigger2 = animelem = 7, >= 0
x = -.10

[state 250, 6]
type = velset
trigger1 = animelem = 8
x = 0

[state 750, 6]
type = playerpush
trigger1 = time < 24
value = 0

[state 750, 6]
type = playerpush
trigger1 = time >= 24
value = 1

[state 1000, 1]
type = varset
triggerall = time > 1
trigger1 = command = "x"
trigger2 = command = "y"
var(1) = 1

[state 250, 7]
type = changestate
triggerall = var(9) != 1
triggerall = animtime = 0
trigger1 = var(1) = 1
value = 703

[state 250, 7]
type = changestate
triggerall = var(9) = 1
triggerall = animtime = 0
trigger1 = p2bodydist x = [5,40]
value = 703

[state 250, 7]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; standing knockdown attack counter
[statedef 712]
type = s
movetype = a
physics = s
anim = 280
poweradd = 100
juggle = 15
velset = 0
ctrl = 0

[state 2005, 6]
type = superpause
trigger1 = time = 0
time = 11
pos = 0,-90
poweradd = -1000
movetime = 0
anim = s1350

[state 240, 2]
type = nothitby
trigger1 = time >=0 
value = sca
time = 1

[state 240, 2]
type = width
trigger1 = animelem = 5, >=0
player = 50,20

[state 200, 1]
type = playsnd
trigger1 = animelem = 5
trigger1 = random < 750
volume = 50
value = 2,1

[state 270, 2]
type = playsnd
trigger1 = animelem = 5
value = 220,2

[state 280, 3]
type = hitdef
trigger1 = animelem = 6
attr = s, na
damage = 134
hitflag = ma
guarDFlag = ma
pausetime = 14,14
sparkno = s1037
guard.sparkno = s1039
sparkxy = -11,-75
hitsound = s280,0
guardsound = s200,3
ground.velocity = -4.5,-3.5
air.velocity = -4,-4
airguard.velocity = -4,-2
fall = 1
fall.recover = 0
guard.velocity = -8.9

[state 200, 1]
type = afterimage
trigger1 = animelemtime(3) = 0
time = 7
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 5

[state 280, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;==========================================================================================


;===========================================================================================
;*******************************************************************************************
;===========================================================================================


;============================
; overide common states
;============================
; hit_fallrecover (on the ground)
[statedef 5201]
type    = s
movetype= h
physics = s
anim = 5200
ctrl = 0

[state 5201, 1] ;turn if not Facing opponent
type = turn
trigger1 = time = 0
trigger1 = p2dist x < -5

[state 5201, 2]
type = velset
trigger1 = time = 0
y = 0

[state 5201, 2.1]
type = velset
trigger1 = time >= 0
trigger1 = time <= 12
x = -4

[state 5201, 3]
type = posset
trigger1 = time = 0
y = 0

[state 5201, 4]
type = nothitby
trigger1 = 1
value = sca
time = 1

[state 5201, 5]
type = playsnd
trigger1 = animelem = 5
value = 52,0
volume = 10

[state 5201, 5]
type = playsnd
trigger1 = time = 0
value = 23,7
volume = 50
channel = 0

[state 5201, 6]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;-------------------------------
;---------------------------------------------------------------------------
; jump_up
[statedef 40]
type    = s
physics = s
anim = 40
ctrl = 0

[state 40, 0.1b]
;ai modification crossover attack
type = varset
triggerall = time >= 0
triggerall = p2bodydist x >= 10
trigger1 = random <= 300
trigger1 = var(9)  = 1
var(8) = 2

[state 40, 0.0]
type = varset
trigger1 = time = 0
var(8) = 0

[state 40, 0.1]
type = varset
trigger1 = command = "holdfwd"
trigger1 = var(8) != 2
var(8) = 1

[state 40, 0.2]
type = varset
trigger1 = command = "holdback"
trigger1 = var(8) != -2
var(8) = -1

[state 40, 0.1b]
type = varset
triggerall = time = 0
triggerall = command = "holdfwd"
trigger1 = command = "longjump"
trigger2 = prevstateno = 100 ;run_fwd
var(8) = 2

[state 40, 0.2b]
type = varset
trigger1 = time = 0
trigger1 = command = "holdback"
trigger1 = command = "longjump"
var(8) = -2

;make sure running snd is off
[state 40, 3]
type = stopsnd
trigger1 = time = 0
channel = 20;running snd

[state 40, 4]
type = changestate
triggerall = animtime = 0
trigger1 = var(8) != 0
trigger1 = var(8) != 1
trigger1 = var(8) != -1
trigger1 = command = "holdup"
trigger2 = command != "holdup"
value = 201

[state 40, 5]
type = velset
trigger1 = animtime = 0
x = ifelse(var(8)=0, const(velocity.jump.neu.x), ifelse(var(8)>0, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[state 40, 6]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; jump_up (short)
[statedef 201]
type    = a
physics = a
velset = 0, -5.8
ctrl = 1

[state 40, 6]
type = ctrlset
trigger1 = var(9) != 1
trigger1 = time = 0
value = 1

[state 9000, 1a] ; play sound when jumping (light)
type = playsnd
trigger1 = time = 0
trigger1 = var(8) != -2
trigger1 = var(8) != 2
value = 0,5
volume = 60

[state 9000, 1b] ; play sound when jumping (shadow)
type = playsnd
triggerall = time = 0
trigger1 = var(8) = -2
trigger2 = var(8) = 2
value = 0,16
volume = 10

[state 200, 1]
type = afterimage
trigger1 = time = 0
time = 20
palbright = 0,0,0
palcontrast = 250,250,250
paladd = 0,0,0
palmul = 0.6,0.6,0.6
timegap = 1
framegap = 2
length = 7

[state 9000, 2] ; shadows off
type = afterimage
trigger1 = var(28) <= 0
trigger1 = time = 20
time = 0

[state 9000, -0.1] ;holding Up?
type = velset
trigger1 = time = 0
trigger1 = command = "holdup"
y = -8

[state 9000, 0.1]
type = velset
trigger1 = var(9) = 1
trigger1 = time = 0
trigger1 = p2bodydist x = [-10,40]
x = 0
y = -5.8

[state 9000, 3.2] ;short
type = changestate
trigger1 = time = 0
trigger1 = var(9) = 1
trigger1 = vel y >= 0
trigger1 = p2bodydist x = [-10,40]
value = 660

[state 9000, 3.2] ;short
type = changestate
trigger1 = time = 0
trigger1 = var(9) = 1
trigger1 = vel y >= 0
trigger1 = p2bodydist x = [-10,40]
value = 680

[state 9000, 0.1]
type = velset
trigger1 = var(9) != 1
trigger1 = time = 0
trigger1 = var(8) = 1
x = 3.1

[state 9000, 0.1b]
type = velset
trigger1 = time = 0
trigger1 = var(8) = 2
x = 4.0

[state 9000, 0.2]
type = velset
trigger1 = time = 0
trigger1 = var(8) = -1
x = -3.1

[state 9000, 0.2b]
type = velset
trigger1 = time = 0
trigger1 = var(8) = -2
x = -4.0

[state 9000, 1.1]
type = changeanim
trigger1 = time = 0
trigger1 = vel x = 0
trigger1 = command = "holdup"
value = 41

[state 9000, 1.2] ;short
type = changeanim
trigger1 = time = 0
trigger1 = vel x = 0
trigger1 = command != "holdup"
value = 41

[state 9000, 2.1]
type = changeanim
trigger1 = time = 0
trigger1 = vel x > 0
trigger1 = command = "holdup"
value = 42

[state 9000, 2.2] ;short
type = changeanim
trigger1 = time = 0
trigger1 = vel x > 0
trigger1 = command != "holdup"
value = 41

[state 9000, 3.1]
type = changeanim
trigger1 = time = 0
trigger1 = vel x < 0
trigger1 = command = "holdup"
value = 43

[state 9000, 3.2] ;short
type = changeanim
trigger1 = time = 0
trigger1 = vel x < 0
trigger1 = command != "holdup"
value = 41

;---------------------------------------------------------------------------
; jump land
[statedef 52]
type    = s
physics = s
anim = 47
ctrl = 1
facep2 = 1

[state 52, 1]
type = velset
trigger1 = time = 0
y = 0

[state 52, 2]
type = posset
trigger1 = time = 0
y = 0

;play sound when landing
[state 52, 3]
type = playsnd
trigger1 = time = 0
value = 0,7
volume = 60

[state 52, 4]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;
; ai activation code by winane.
; (credit to anmc, bagaliao, and Flowagirl For the basic helper method concept.)
;
;------------------
; ai activation helper state - primary version
; (credit to yongming For the basic hitpause bugfix concept.)
;
; var(1) - First tick button activation prevention.
; var(2) - Used For pause/superpause and custom state check, basically.
; var(3) - (super/)pause & custom state-triggered Dir Detection Disabler.
; var(4) - persistent Direction command Detection enabler (due to 2002.04.14).
; var(9) - autoturn bug Fixer.
; parent's var(58) - parent's gametime var, For pause and custom state check.
; parent's var(59) - parent's primary ai variable.

[statedef 9741]
type = s
movetype = i
physics = n
anim = 9741
ctrl = 0

[state 9741, safety]; just in case your opponent is very poorly coded.
type = selfstate
trigger1 = !ishelper
value = 0

[state 9741, pausecheck]
type = varset
trigger1 = (gametime>(parent,var(58)))
trigger2 = !(parent,alive)
trigger3 = (roundstate != 2)
trigger4 = parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)+(var(4):=0)

[state 9741, Facing]
type = turn
trigger1 = (var(9):=(facing != parent,Facing))

[state 9741, Dirturnonai]
type = parentvarset
triggerall = !var(3)
triggerall = !var(9)
trigger1 = (parent,command = "holdfwd")
trigger2 = (parent,command = "holdback")
trigger3 = (parent,command = "holdup")
trigger4 = (parent,command = "holddown")
trigger5 = !(var(4):=1)
var(59) = var(4)

[state 9741, Dirturnoffai]
type = parentvarset
triggerall = !var(3)
triggerall = parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (parent,command = "holddown")
var(59) = (var(4):=0)

[state 9741, buttonturnonai]
type = parentvarset
triggerall = var(1)
triggerall = !var(2)
trigger1 = (parent,command = "a")
trigger2 = (parent,command = "b")
trigger3 = (parent,command = "c")
trigger4 = (parent,command = "x")
trigger5 = (parent,command = "y")
trigger6 = (parent,command = "z")
trigger7 = (parent,command = "s")
var(59) = 1

[state 9741, buttonturnoffai]
type = parentvarset
triggerall = !var(2)
trigger1 = (command = "a")
trigger1 = (parent,command = "a")
trigger2 = (command = "b")
trigger2 = (parent,command = "b")
trigger3 = (command = "c")
trigger3 = (parent,command = "c")
trigger4 = (command = "x")
trigger4 = (parent,command = "x")
trigger5 = (command = "y")
trigger5 = (parent,command = "y")
trigger6 = (command = "z")
trigger6 = (parent,command = "z")
trigger7 = (command = "s")
trigger7 = (parent,command = "s")
var(59) = -1

[state 9741, Unpausecheck]
type = varset
triggerall = var(2)
trigger1 = (parent,command = "a")
trigger2 = (parent,command = "b")
trigger3 = (parent,command = "c")
trigger4 = (parent,command = "x")
trigger5 = (parent,command = "y")
trigger6 = (parent,command = "z")
trigger7 = (parent,command = "s")
trigger8 = (var(2) = 2)
trigger8 = (var(2):=0)
var(2) = 2

[state 9741, gooDBye]
type = Destroyself
triggerall = (var(1):=1)
trigger1 = parent,var(59)
trigger2 = !(parent,alive)
trigger3 = (roundstate != 2)


;------------------
; ai activation helper state - compatibly partnered version
;
; var(1) - First tick Dir activation prevention
; var(2) - Used For pause/superpause and custom state check, basically.
; var(3) - (super/)pause & custom state-triggered Dir Detection Disabler.
; var(4) - hitpause check.
; var(5) - no button on previous tick.
; var(6) - any Dir on this tick.
; var(7) - any button on this tick.
; var(8) - matching partner button Detected.
; var(9) - autoturn bug Fixer.
; parent's var(58) - parent's gametime var, For pause and custom state check.
; parent's var(59) - parent's primary ai variable.

[statedef 9742]
type = s
movetype = i
physics = n
anim = 9741
ctrl = 0

[state 9742, safety]; just in case your opponent is very poorly coded.
type = selfstate
trigger1 = !ishelper
value = 0

[state 9742, pausecheck]
type = varset
trigger1 = (gametime>parent,var(58))
trigger2 = !(parent,alive)
trigger3 = (roundstate != 2)
trigger4 = parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)

[state 9742, Facing]
type = turn
trigger1 = (var(9):=(facing != parent,Facing))

[state 9742, parentdircheck]
type = varset
trigger1 = (parent,command = "holdfwd")
trigger2 = (parent,command = "holdback")
trigger3 = (parent,command = "holdup")
trigger4 = (parent,command = "holddown")
trigger5 = (var(6):=0)
var(6) = 1

[state 9742, parentbuttoncheck]
type = varset
trigger1 = (parent,command = "a")
trigger2 = (parent,command = "b")
trigger3 = (parent,command = "c")
trigger4 = (parent,command = "x")
trigger5 = (parent,command = "y")
trigger6 = (parent,command = "z")
trigger7 = (parent,command = "s")
trigger8 = (var(7):=0)
var(7) = 1

[state 9742, samebuttoncheck]
type = varset
triggerall = var(7)
triggerall = !var(2)
triggerall = numpartner
trigger1 = (parent,command = "a")
trigger1 = (partner,command = "a")
trigger2 = (parent,command = "b")
trigger2 = (partner,command = "b")
trigger3 = (parent,command = "c")
trigger3 = (partner,command = "c")
trigger4 = (parent,command = "x")
trigger4 = (partner,command = "x")
trigger5 = (parent,command = "y")
trigger5 = (partner,command = "y")
trigger6 = (parent,command = "z")
trigger6 = (partner,command = "z")
trigger7 = (parent,command = "s")
trigger7 = (partner,command = "s")
trigger8 = (var(8):=0)
var(8) = 1

[state 9742, Dirturnonai]
type = parentvarset
trigger1 = var(1)
trigger1 = var(6)
trigger1 = !var(3)
trigger1 = !var(4)
trigger1 = !var(9)
var(59) = 1

[state 9742, Dirturnoffai]
type = parentvarset
triggerall = var(6)
triggerall = !var(3)
triggerall = parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (parent,command = "holddown")
var(59) = 0

[state 9742, buttonturnonai]
type = parentvarset
trigger1 = var(5)
trigger1 = var(7)
trigger1 = !var(2)
trigger1 = !var(8)
var(59) = 1

[state 9742, buttonturnoffai]
type = parentvarset
triggerall = var(7)
triggerall = !var(2)
triggerall = !var(8)
trigger1 = (command = "a")
trigger1 = (parent,command = "a")
trigger2 = (command = "b")
trigger2 = (parent,command = "b")
trigger3 = (command = "c")
trigger3 = (parent,command = "c")
trigger4 = (command = "x")
trigger4 = (parent,command = "x")
trigger5 = (command = "y")
trigger5 = (parent,command = "y")
trigger6 = (command = "z")
trigger6 = (parent,command = "z")
trigger7 = (command = "s")
trigger7 = (parent,command = "s")
var(59) = -1

[state 9742, Unpausecheck]
type = varset
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = (var(2) = 2)
trigger2 = (var(2):=0)
var(2) = 2

[state 9742, gooDBye]
type = Destroyself
trigger1 = parent,var(59)
trigger2 = !(parent,alive)
trigger3 = (roundstate != 2)

[state 9742, hitpausecheck]
type = varset
trigger1 = var(6)
trigger2 = var(7)
trigger3 = !(parent,hitpausetime)
var(4) = parent,hitpausetime

[state 9742, Delay]
type = varset
trigger1 = (var(1):=1)
var(5) = !var(7)

;=================================================================================
;*********************************************************************************
;=================================================================================
[statedef -2]

[state -2, stopai]
type = varset
triggerall = (var(59) > 0)
trigger1 = (roundstate != 2)
trigger2 = !alive
var(59) = -2
ignorehitpause = 1

[state -2, simplifier]
type = varset
trigger1 = 1
var(9) = (var(59) = 1)
ignorehitpause = 1

[state -2, varadd max]
type = varadd 
trigger1 = var(10) > 0
var(10) = -1

;maximum palfx
[state -2, palfx]
type = palfx
trigger1 = movetype != h
trigger1 = (gametime%2)=0
trigger1 = var(10) != 0
time = 1
add = 60,60,60
ignorehitpause = 1

; play sound when jumping
[state -2, 1.1]
type = playsnd
triggerall = time = 1
trigger1 = stateno = 50
value = 0,5
persistent = 0 ;make sure it play only once each time
volume = 10

; play "ouch" sound when hit light or medium
[state -2, 3]
type = playsnd
triggerall = random < 500
triggerall = time = 1
triggerall = stateno = 5000
trigger1 = anim = 5000
trigger2 = anim = 5001
trigger3 = anim = 5010
trigger4 = anim = 5011
value = 1,0
volume = 50

; play "ouch" sound when hit light or medium (in the air)
[state -2, 4]
type = playsnd
triggerall = random < 700
triggerall = time = 1
triggerall = stateno = 5010
trigger1 = anim = 5020
trigger2 = anim = 5021
value = 1,0
volume = 50

; play "ouch" sound when hit hard
[state -2, 5]
type = playsnd
triggerall = random < 700
triggerall = time = 1
triggerall = stateno = 5000
trigger1 = anim = 5002
trigger2 = anim = 5012
value = 1,1
volume = 50

; play "ouch" sound when hit hard (in the air)
[state -2, 6]
type = playsnd
trigger1 = random < 700
trigger1 = time = 1
trigger1 = stateno = 5010
trigger1 = anim = 5022
value = 1,1
volume = 50

; play "ouch" when landing on back
[state -2, 7]
type = playsnd
trigger1 = random < 710
trigger1 = time = 1
trigger1 = stateno = 5100
value = 1,2
volume = 70

[state -2, Dtc]
type = Displaytoclipboard
trigger1 = 1
text = "ai: %d"
params = var(9)
ignorehitpause = 1

;============================================================================

[statedef -3]

;kof style !!!!
[state -3, Defense Up]
type = Defencemulset
trigger1 = life <= 400
value = .67

; max
[state -3, Defense Up]
type = Defencemulset
trigger1 = var(10) > 0
value = .77

;attack
[state -3, attack Up]
type = attackmulset
trigger1 = var(10) > 0
value = 1.2

[state -3, attack Down]
type = attackmulset
trigger1 = var(10) = 1
value = 1

[state -3, stp chrge snd]
type = stopsnd
trigger1 = movetype = h
channel = 1
value = 3,1

;get rid of trailing anims when hit
[state -3, 3]
type = afterimagetime
triggerall = time = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5070
time = 0

[state -3, 4];kill the corner push bug
type = velset
trigger1 = Frontedgedist < 10
trigger1 = vel x > 0.1
x = 0.1

;tnx sorrow edge ^_^-------------------------------
[state -3, throwa]
type = varset
trigger1 = hitdefattr = sca, na, ap && movecontact
var(4) = 15
ignorehitpause = 1 

[state -3, throwb]
type = varadd
trigger1 = var(4) >= 1
var(4) = -1
ignorehitpause = 1 

:kof combo attack mulset code !!!!^_^
[state -3, ]
type = varset
trigger1 = hitdefattr = sca, na, ap && movehit
var(6) = 30
ignorehitpause = 1 

[state -3, throwb]
type = varadd
trigger1 = var(6) >=1 
var(6) = -1
ignorehitpause = 1 

[state -3, attackmulset]
type = attackmulset
trigger1 = var(10) = 0
trigger1 = var(6) > 0
value = .9

[state -3, attackmulset]
type = attackmulset
trigger1 = var(10) = 0
trigger1 = var(6) <= 0
value = 1

[state -3, attackmulset]
type = attackmulset
trigger1 = var(10) = 0
trigger1 = numhelper(1901)=1
value = .9

[state -3, reset]
type = varset
trigger1 = roundstate = 0 
var(11) = 0

[state -3, reset]
type = varset
trigger1 = roundstate = 0 
var(10) = 0

;=========================================================================
; kamek and luchini appear to have been the First ones to Use the ishometeam ai activation concept.
[state -3, setai]
type = varset
triggerall = !roundstate
triggerall = ishometeam
trigger1 = (teamside = 2)
trigger2 = (matchno > 1)
var(59) = 1

[state -3, Unfair]
type = varset
trigger1 = !roundstate
trigger1 = (var(59) != 1)
trigger1 = numpartner
trigger1 = (id > partner,id)
trigger1 = (teamside = 2)
var(59) = 1

[state -3, ai helper (compatibly partnered version)]
type = helper
trigger1 = !var(59)
trigger1 = !numhelper(9742)
trigger1 = (roundstate = 2)
trigger1 = alive
trigger1 = numpartner
trigger1 = partner,selfanimexist(9741)
helpertype = normal
name = "ai helper (simul version)"
id = 9742
pos = 9999999,99999
stateno = 9742
keyctrl = 1
pausemovetime = 999999999
supermovetime = 999999999

; 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 your
; character, then all you need to Do is temporarily Disable this controller.
[state -3, ai helper]
type = helper
triggerall = !var(59)
triggerall = !numhelper(9741)
triggerall = (roundstate = 2)
triggerall = alive
trigger1 = !numpartner
trigger2 = !(partner,selfanimexist(9741))
helpertype = normal
name = "ai helper"
id = 9741
pos = 9999999,99999
stateno = 9741
keyctrl = 1
pausemovetime = 999999999
supermovetime = 999999999

[state -3, turnbackonai]
type = varset
trigger1 = (var(59) = -2)
trigger1 = (roundstate = 2)
trigger1 = alive
var(59) = 1

[state -3, xor]
type = varset
triggerall = var(59)!=1
triggerall = !var(57)
triggerall = (var(58) = gametime-1)
trigger1 = (command = "a") ^^ (command = "a2")
trigger2 = (command = "b") ^^ (command = "b2")
trigger3 = (command = "c") ^^ (command = "c2")
trigger4 = (command = "x") ^^ (command = "x2")
trigger5 = (command = "y") ^^ (command = "y2")
trigger6 = (command = "z") ^^ (command = "z2")
trigger7 = (command = "s") ^^ (command = "s2")
trigger8 = (command = "holda") ^^ (command = "holda2")
trigger9 = (command = "holDB") ^^ (command = "holDB2")
trigger10 = (command = "holdc") ^^ (command = "holdc2")
trigger11 = (command = "holdx") ^^ (command = "holdx2")
trigger12 = (command = "holdy") ^^ (command = "holdy2")
trigger13 = (command = "holdz") ^^ (command = "holdz2")
trigger14 = (command = "holds") ^^ (command = "holds2")
trigger15 = (command = "holdfwd") ^^ (command = "holdfwd2")
trigger16 = (command = "holdback") ^^ (command = "holdback2")
trigger17 = (command = "holdup") ^^ (command = "holdup2")
trigger18 = (command = "holddown") ^^ (command = "holddown2")
trigger19 = (command = "recovery") ^^ (command = "recovery2")
var(59) = 1

[state -3, Fixor]
type = varset
trigger1 = !hitpausetime
trigger2 = (var(58) < gametime-1)
var(57) = hitpausetime
ignorehitpause = 1

[state -3, gametimevar]
type = varset
trigger1 = 1
var(58) = gametime
ignorehitpause = 1

;=======================================================================
; ---<> Delete the lines below if you want to remove the strikers <>---
;=======================================================================

[state -3, mai]
type = helper
trigger1 = numhelper(3000) = 0
name = "mai"
id = 3000
pos = 70,-8
postype = back
stateno = 3000
helpertype = normal
keyctrl = 0
ownpal = 1

[state -3, king]
type = helper
trigger1 = numhelper(3100) = 0
name = "king"
id = 3100
pos = 10,-8
postype = back
stateno = 3100
helpertype = normal
keyctrl = 0
ownpal = 1

;=======================================================================
