;---------------------- Integer variable list ----------------------

; var(0):= -3, 5900, 10001, 10020, 3002, 6002, 6004, 6007, 30001, 30603, 30604, 9999
; var(1):= 1941, 10001, 3001, 6002, 6005, 30601, 30603, 9999
; var(2):= 1010, 1050, 1100, -2, 10001, 9998, 9999
; var(3):= -3, 10001, 3002, 9999
; var(4):= 205, 210, 211, 405, 410, 605, 610, 831, 1010, 1100, 3000, 3010, -3, 4, 5, 10001, 3002, 9998, 9999
; var(5):= 800, 830, 3002, 9999
; var(6):= 3059, -2, 45, 3002, 9999
; var(7):= -2, 10003, 9999
; var(8):= -2, 55, 59, 3002, 9999
; var(9):= -2, 9999
;var(10):= 1005, 3050, -2, 10001, 10002, 10003, 10004, 30002, 8050, 9999
;var(11):= 211, 810, 831, 1005, 1100, -2, 10001, 3002, 30002, 9999
;var(12):= -2, -3, 1942, 30002, 9999
;var(13):= -3, 10004, 9999
;var(14):= 3060, 9999
;var(15):= 9999
;var(16):= 9999
;var(17):= 3071, 9999
;var(18):= -2
;var(19):= 810, 831, 1005, 1006, 1010, 1050, 3000, 3010, -2, 10001, 10003, 9999
;var(20):= 800, 810, 830, 831, 9999
;var(21):= 205, 210, 211, 212, 700, 831, 1005, 1006, 1007, 1010, 1050, 1100, 3000, 3010, -2, 9999
;var(22):= -2, 10001, 10003, 9998
;var(23):= -2
;var(24):= 1005, -2
;var(25):= -2, 9999
;var(26):= -2, 40, 45
;var(27):= 1005, 1010, -2
;var(28):= 3060
;var(29):= -2, 10004
;var(30):= 10001, 10004, 9998, 9999
;var(31):= -2
;var(32):= 9998
;var(33):= -2
;var(34):= 9998
;var(35):= 9998
;var(36):= 3010, -3
;var(37):= 205, 210, 410, -2
;var(40):= -2
;var(41):= -3
;var(42):= -3
;var(50):= -2
;var(52):= 154
;var(54):= -2
;var(55):= 5900
;var(56):= -3
;var(57):= 7000
;var(59):= 190

;---------------------- Float variable list ----------------------

; fvar(0):= 190, 6002
; fvar(1):= 3002
; fvar(2):= -3, 10001, 10006
; fvar(4):= -3, 10001, 4004
; fvar(5):= -3
;fvar(10):= 3060, 10001, 10006, 3002, 30002
;fvar(11):= 10001, 10004, 3002, 30002
;fvar(12):= 10001, 10004, 3002, 30002, 30602, 30604
;fvar(15):= 193, 194
;fvar(21):= -3, 10001, 10004, 3002
;fvar(30):= 10001
;fvar(31):= 10001
;fvar(35):= 10001







[Data]
life = 905
power=1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 18
sparkno = 2
guard.sparkno = 40
kO.echo = 1
volumescale = 100
IntPersistIndex = 52
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 18
ground.front = 20
air.back = 16
air.front = 16
height = 60
attack.dist = 160
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 6     ;Number of pixels to vertically offset the shadow
draw.offset = 0,3  ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 2.4      ;Walk forward
walk.back = -2.2     ;Walk backward
run.fwd  = 5.5,0   ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9    ;Neutral jumping velocity (x, y)
jump.back = -2.55    ;Jump back Speed (x, y)
jump.fwd = 2.5      ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.
air.gethit.groundrecover = -.15,-3.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5
[Movement]
airjump.num = 0      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .5        ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching
air.gethit.groundlevel = 15          ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -20 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 10   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -1  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = .35    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 10      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 20            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = .4               ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 12          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .05
[Quotes]
victory0 = "I want you to remember how badly I crushed you."
victory1 = "Make no mistake, you never had a chance."
victory2 = "Toying with you was amusing, but now it's time to die."
victory3 = "You'll never beat me. Not even once."
victory4 = "As long as he lives I kill."
victory5 = "Glad you could make it brother, but the fun ends now."
victory6 = "Such weakness offends me. But your soul will make a nice snack."
victory7 = "She had more power than I thought. How amusing!"
victory8 = "I don't know where you came from. But I cannot let you leave alive!"
;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S



[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = cond(var(28),183,cond(matchover,182,181))

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

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 120
flag = roundnotover
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S180,0
;volumescale = 0
channel = 0


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

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

[Statedef 182]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 110
flag = roundnotover
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S180,1+random%2
;volumescale = 0
channel = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(6)=[15,20]
x = -10
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0
;ignorehitpause = 
;persistent = 
[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelemtime(6)=20
value = 3, 4
channel=1
[State 0, Trans]
type = Trans
trigger1 = animelemtime(6)=24
trans = addalpha;, sub
alpha = 10,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(6)=24
trans = addalpha;, sub
alpha = 75,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(6)=23
trans = addalpha;, sub
alpha = 115,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(6)=22
trans = addalpha;, sub
alpha = 150,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(6)=21
trans = addalpha;, sub
alpha = 180,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(6)=20
trans = addalpha;, sub
alpha = 230,255

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6)>=24
flag = invisible

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

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

[Statedef 183]
type = S
ctrl = 0
anim = 182
velset = 0,0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 220
flag = roundnotover
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=85
value = S180,3+(random%2)
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S180,6
channel = 0
[State 0, PalFXWiz]
type = PalFX
trigger1 = time=20
time = 35
add = 0,0,0
mul = 170,20,255
sinadd = 100,40,180,80
invertall = 0
color = 60
[State 0, PalFXWiz]
type = PalFX
trigger1 = time=55
time =999
add = 100,40,180
mul = 170,20,255
sinadd = 100,40,180,1
invertall = 0
color = 60
[State -2, Helper]
type = Helper
trigger1 = time%15=0
helpertype = normal ;player
name = "kk"
ID = 7000
stateno = 6006
pos = 60,-240
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime =999
pausemovetime = 999
ignorehitpause = 1

[State -2, Helper]
type = Helper
trigger1 =time%15=0
helpertype = normal ;player
name = "kk"
ID = 7001
stateno = 6006
pos = -60,-240
postype = p1  ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal =1
supermovetime =999
pausemovetime = 999
ignorehitpause = 1

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 191]
type = S
physics = N
ctrl = 0
anim = 190
velset = 0,0
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy,var(59)=161
value =193
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy,var(59)=142
value =194
[State 0, ScreenBound]
type = ScreenBound
trigger1 = time <20
value = 0
movecamera = 0,0
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = time=10
x = -50
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=[14,18]
x = 10


[State 0, Helper]
type = Helper
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos = ceil(-ifelse(teamside=1,50,-60)*const(size.xscale)),ceil(-190*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=.5
size.yscale=.5
supermovetime=999
pausemovetime=999

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || AnimTime = 0 || AIlevel >0
id =12010
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelemtime(1)=50 &&  var(59)=1
value = S191,6+random%2
channel=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(1)=50 && var(59)=2
value = S191,8+random%2
channel=0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(1)=50 && var(59)=3
value = S191,10+random%3
channel=0


[State 810, Grab Sound]
type = PlaySnd
trigger1 =  animelemtime(1)=50 && !var(59)
value =190, 0+(random%4)
channel=0
[State 810, Grab Sound]
type = PlaySnd
trigger1 =  animelemtime(1)=10
value = 3, 4
channel=1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =  animelemtime(1)<15
flag= invisible



[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=15
trans = addalpha;, sub
alpha = 10,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=16
trans = addalpha;, sub
alpha = 75,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=17
trans = addalpha;, sub
alpha = 115,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=18
trans = addalpha;, sub
alpha = 150,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=19
trans = addalpha;, sub
alpha = 180,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=20
trans = addalpha;, sub
alpha = 230,255
[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro


[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0
value = 0


;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 192]
type = S
physics = N
ctrl = 0
anim = 192
velset = 0,0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 810, Grab Sound]
type = PlaySnd
trigger1 =  animelemtime(1)=2
value = 3, 4
channel=0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =  animelemtime(1)<5
flag= invisible



[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=5
trans = addalpha;, sub
alpha = 10,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=6
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=7
trans = addalpha;, sub
alpha = 150,250

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = animtime = 0
value = 0


;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 193]
type = S
physics = N
ctrl = 0
anim = 192
velset = 0,0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id =12010
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 15    
value = pos x
[State 0, PosSet]
type = PosSet
trigger1 = time=0
x = enemy,pos x
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem= 2
value = S2,3
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem= 2
value = S5000,4
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem= 5
value = S191,10
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem= 7
value = S191,11
channel = 0
[State 0, Explod]
type = Explod
trigger1 = animelem= 2
anim = 7000+(random%4)
ID = 7003
pos = 13,-46
postype = p1  ;p2,front,back,left,right
bindtime = 1
scale = 1,1
sprpriority = 2
ontop = 1
ownpal = 0
removeongethit = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(3)>=0 && animelemtime(4)<3
x = -14
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelemtime(4)=3
x = fvar(15)
;ignorehitpause = 
;persistent = 


[State 191, 3] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 194]
type = S
physics = N
ctrl = 0
anim = 191
velset = 0,0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id =12010
[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
ignorehitpause=1
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 15    
value = pos x
[State 0, PosAdd]
type = Posset
trigger1 = time=0
x = -70*facing
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0 
x = -30
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value =  S191,0
channel = 3
 


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=7&& anim!=100
value =  S191,4
channel = 0
[State 0, Helper]
type = Helper
Trigger1 = animelem=10
helpertype = normal ;player
name ="Reppuken"
ID = 1049
stateno = 1941
pos = 58,-83
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1.2
size.yscale=1.2
pausemovetime=99

[State 0, Pause]
type = Pause
trigger1 = animelem=7&& anim!=100
time = 45
movetime = 13
pausebg = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=7&& anim!=100
value =  S999,0
channel = 3
 

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 =animelem=7&& anim!=100
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,ifelse(GameHeight=180,.75,1)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = animelem=7&& anim!=100
anim = 8002
ID =8002
pos = 9,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1


[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(13)>=0&&animelemtime(16)<0&& anim!=100
x =4.5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(16)>=0&&animelemtime(18)<0&& anim!=100
x =3.5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(18)>=0&&animelemtime(18)<12&& anim!=100
x =7.5

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(18)>=12&&animelemtime(19)<2&& anim!=100
x =2.5

[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelemtime(20)=0 && anim!=100
value = 3, 4
channel=1
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=5&& anim!=100
trans = addalpha;, sub
alpha = 10,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=4&& anim!=100
trans = addalpha;, sub
alpha = 75,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=3&& anim!=100
trans = addalpha;, sub
alpha = 115,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=2&& anim!=100
trans = addalpha;, sub
alpha = 150,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=1&& anim!=100
trans = addalpha;, sub
alpha = 180,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=0&& anim!=100
trans = addalpha;, sub
alpha = 230,255

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(20)>=6 && animelemtime(20)<8
flag = invisible


[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=8&& anim!=100
trans = addalpha;, sub
alpha = 10,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=9&& anim!=100
trans = addalpha;, sub
alpha = 75,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=10&& anim!=100
trans = addalpha;, sub
alpha = 115,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=11&& anim!=100
trans = addalpha;, sub
alpha = 150,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=12&& anim!=100
trans = addalpha;, sub
alpha = 180,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(20)=13&& anim!=100
trans = addalpha;, sub
alpha = 230,255
;
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(20)>=0&&animelemtime(20)<6&& anim!=100
x =-4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(20)>=6&&animelemtime(20)<8&& anim!=100
x =-85
;
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(22)>=0&&animelemtime(23)<0&& anim!=100
x =7.5
;
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(23)>=0&&animelemtime(25)<0&& anim!=100
x =2.5
;;ignorehitpause = 
;;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(27)>=0&&animelemtime(28)<0&& anim!=100
x =-6.5
[State 0, Explod]
type = Explod
triggerall = !var(53)
trigger1=animelemtime(22)>=0&&animelemtime(23)<0 && time%3=0 && anim!=100
anim = 8300
ID = 8306
pos = -24,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=29
value = 100
persistent = 0
[State 0, PosAdd]
type = PosAdd
triggerall = pos x < fvar(15) && facing =1 || pos x > fvar(15) && facing =-1
trigger1 = anim=100 && animelemtime(2)>=0 && animelemtime(3)<0
x =5.5
[State 0, PosAdd]
type = PosAdd
triggerall = pos x < fvar(15) && facing =1 || pos x > fvar(15) && facing =-1
trigger1 = anim=100 && animelemtime(3)>=0 
x =2.75

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=100&& animelemtime(3)>=0
trigger1 = pos x > fvar(15) && facing =1 || pos x < fvar(15) && facing =-1
value = 191
elem=29
persistent = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=29&& anim!=100
x = fvar(15)
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=29&& anim!=100
value =  S191,1
channel = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = animtime = 0 && anim!=100
value = 0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 195]
type = S
physics = N
ctrl = 0
anim = 195
velset = 0,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S191,2+(random%2)
channel = 0

[State 191, 3] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl=1
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2              ;Set p1's sprite layering priority to 2 (in front)

[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1


;
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "umm"
;ID =30611
;stateno =30603
;pos = 0,-52
;postype = p2   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1
;size.xscale = .8
;size.yscale=.8
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "umm"
;ID =30612
;stateno =30603
;pos = 0,-52
;postype = p2   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1
;size.xscale = .8
;size.yscale=.8
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "umm"
;ID =30613 
;stateno =30603
;pos = 0,-52
;postype = p2   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1
;size.xscale = .8
;size.yscale=.8
;
;
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "umm"
;ID =30614
;stateno =30603
;pos = 0,-52
;postype = p2   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1
;size.xscale = .8
;size.yscale=.8
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "umm"
;ID =30615
;stateno =30603
;pos = 0,-52
;postype = p2   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1
;size.xscale = .8
;size.yscale=.8
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "umm"
;ID =30616 
;stateno =30603
;pos = 0,-52
;postype = p2   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1
;size.xscale = .8
;size.yscale=.8


[State 200, 1]
type = HitDef
trigger1 = AnimElem =2
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 13, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = LA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime =8,8               ;Time attacker pauses, time opponent shakes
sparkno = S7000+(random%4)                      ;Spark anim no (Def: set above)
sparkxy = -10, -26               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S2, 0
guard.sparkno= S7500       
getpower=5      ;Sound to play on hit
givepower=5,5
guardsound = S6, 0                ;Sound to play on guard
ground.type = High     
p2facing=1          ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7             ;Time that the opponent slides back
ground.hittime  = ifelse(var(21)=1,22,10)          ;Time opponent is in hit state
ground.velocity = -4
guard.velocity=-4.5            ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime =ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,18,13)))             ;Time before opponent regains control in air
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,18,13)))  
air.fall=1
forcenofall= p2statetype=C
id=200
yaccel=.48

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

[State 200, 1]
type = PlaySnd
triggerall = random<499
trigger1 = Time = 1
value = 200, 0
channel=0
[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 205]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(p2bodydist x <25,205,206)                      ;Change animation (Def: no change)
poweradd =0                    ;Power to add (Def: 0)
sprpriority = 2              ;Set p1's sprite layering priority to 2 (in front)
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=1 
v = 37   
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4 && anim=205
x = 11
[State 0, VarSet]
type = Varadd
trigger1 =animelem=4 && anim=205
v = 37   
value = 11
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 && anim=205
x = -11
[State 0, VarSet]
type = Varadd
trigger1 =animelem=6&& anim=205
v = 37   
value = 11
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2 && anim=206
x = 13
[State 0, VarSet]
type = Varadd
trigger1 =animelem=2 && anim=206
v = 37   
value = 13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3&& anim=206
x = 3
[State 0, VarSet]
type = Varadd
trigger1 =animelem=3 && anim=206
v = 37   
value = 3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& anim=206
x = -3
[State 0, VarSet]
type = Varadd
trigger1 =animelem=5 && anim=206
v = 37   
value = -3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6&& anim=206
x = -13
[State 0, VarSet]
type = Varadd
trigger1 =animelem=6 && anim=206
v = 37   
value = -13
[State 0, ChangeAnim]
type = ChangeAnim
triggerall=anim=205
trigger1 = animelemtime(2)>=0 &&animelemtime(3)<0 && time <16&& command !="holdy" && AIlevel=0 
trigger2 = animelemtime(2)>=0 &&animelemtime(3)<0 && time <16 && (p2statetype!=L||p2statetype!=C||p2stateno!=[120,155]) && AIlevel>0 
value = anim
elem = 3
[State 0, Helper]
type = Helper
trigger1 = time=16 &&animelemtime(2)>=0 &&animelemtime(3)<0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
;ignorehitpause = 
;persistent = 
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1
channel=1

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4 && anim=205 && time <15
attr = S, NA
animtype  = Medium
damage    = 27
guardflag = MA
pausetime = 12,12
sparkno = S7010+(random%4)
priority=5
sparkxy = -10,-40
hitsound = S2, 1
guard.sparkno= S7500
getpower=25,7 
guardsound = S6, 0
ground.type = High
givepower=10,5
ground.slidetime = 14
guard.ctrltime=10
ground.hittime  = 14
ground.velocity = -5.2
guard.velocity=-6
air.velocity = -1.5,-3.5
p2facing=1
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,20,17)))  
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,20,17)))
air.fall=1
id=440
yaccel=.48
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4 && anim=205 && time >15
attr = S, NA
animtype  = Medium
damage    = 40
guardflag = HA
pausetime = 12,12
sparkno = S7010+(random%4)
priority=5
sparkxy = -10,-40
hitsound = S2, 1
guard.sparkno= S7500
getpower=25,7 
guardsound = S6, 0
ground.type = High
givepower=10,5
ground.slidetime = 14
guard.ctrltime=10
ground.hittime  = 16
ground.velocity = -4.5
guard.velocity=-6
air.velocity = -1.5,-3.5
p2facing=1
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,20,17)))  
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,20,17)))
air.fall=1
id=440
yaccel=.48
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3  && anim=206
attr = S, NA
animtype  = Medium
damage    = 30
guardflag = MA
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -10,-45
hitsound = S2, 1
guard.sparkno= S7500
getpower=15,7 
guardsound = S6, 0
priority=4
ground.type = High
givepower=10,5
ground.slidetime = 14
guard.ctrltime=10
ground.hittime  = 14
ground.velocity = -3.5
guard.velocity=-6
air.velocity = -1.5,-3.5
p2facing=1
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,20,17)))  
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,20,17)))
air.fall=1
id=200
yaccel=.48
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5 && anim=206
trigger2 = animelem=6 && anim=205
movetype = I  
[State 200, 1]
type = PlaySnd
triggerall = random<499
trigger1 = Time = 1
value = 200, 1
channel=0
[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 210]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(p2bodydist x + var(37)  <15,210,211)                     ;Change animation (Def: no change)
poweradd = 0                  ;Power to add (Def: 0)
sprpriority = 2              ;Set p1's sprite layering priority to 2 (in front)
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 2
channel=1

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=1 
v = 37   
value = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3&& anim=211
x = 8

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4&& anim=211
x = 12
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& anim=211
x = 8
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7&& anim=211
x = 13
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8&& anim=211
x = 8
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2 && anim=210
x = 8
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 && anim=210
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7&& anim=210
x = -16
[State 200, 1]
type = PlaySnd
triggerall = random<499
trigger1 = Time = 1
value = 200, 2
channel=0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    =45
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,ifelse(anim=211,-57,-65)
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
priority=5
getpower=30,20 
givepower=20,5
ground.type = High
p2facing=1
guard.ctrltime=14
ground.slidetime =18
ground.hittime  = 18
ground.velocity = -5.5
guard.velocity=-7
air.velocity = -2.5,-5
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,27,19)))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,27,19)))
air.fall=1
id=200
yaccel=.48
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7
movetype = I  

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 211]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 215                   ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2              ;Set p1's sprite layering priority to 2 (in front)
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 200, 1]
type = PlaySnd
trigger1 = animelem=2
value = 0, 2
channel=1

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1
x = 19
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4 
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 
x = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7 
x = 7
;[State 0, PosAdd]
;type = PosAdd
;trigger1 = animtime=0 
;x = 5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(1)>1 && animelemtime(2)<0 
x = 5.5
;ignorehitpause = 
;persistent = 
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 8
channel=0
[State 0, VarSet]
type = VarSet
trigger1 = movehit
v = 11    
value = 1
ignorehitpause = 1
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    =40
guardflag = LA
pausetime = 12,12
priority=45
sparkno = S7020+(random%4)
sparkxy = -10,-40
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=30,20 
givepower=20,5
ground.type = High
p2facing=1
guard.ctrltime=11
ground.slidetime =14
ground.hittime  = 10
ground.velocity = -2.5,-4.5
guard.velocity=-7
air.velocity = -2.5,-4.5
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,27,20)))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,27,20)))
fall=1
id=999
yaccel=.48

;persistent = 

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7
movetype = I  

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-------------------------------------------------------
[Statedef 212]
type    = S
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim = 220
ctrl = 0
sprpriority = 1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  
v = 21   ;v = 570
value = 0


[State 113, VarSet]
type = VarSet
trigger1 = numexplod(212)>2 && movehit && var(21)=2
v =21   ;v = 570
value = 1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 5
channel=0
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
;ignorehitpause =
;persistent =



[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
anim =10000
ID =212
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S0,2
channel = 1

 [State 0, VelSet]
type = VelSet
trigger1 =animelem=2 
x = 4
y = -5
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2
statetype = A
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>0&&animelemtime(6)<0 
y = .51
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=6
value = S40,0

[State 0, NotHitBy]
type = HitBy
trigger1 = animelem = 2
value =SA,AA,AP,AT
time = 27

[State 0, PosSet]
type = PosSet
trigger1 = animelem=6
y = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = 0
y = 0
;ignorehitpause = 
;persistent = 
;
;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v =15   
;value = (15+((var(21)=1)*15))-(numexplod(1001)*5)
;ignorehitpause=1
 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
statetype = S
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
animtype  = Medium
damage    =50
guardflag = MA
pausetime = 10,10
sparkno = S7020+(random%4)
priority=4
sparkxy = -10,-45
hitsound = S2, 3
guardsound = S6, 0
guard.sparkno= S7500
getpower=ceil(10),5
givepower=5,5
ground.type = High
p2facing=1
guard.ctrltime=12
ground.slidetime =15
ground.hittime  = 17
ground.velocity = -5,-4.5
guard.velocity=-6
air.velocity =  -5,-4.5
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,32,26)))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,32,26)))
fall=1
id=211
yaccel=.48

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1

[State 0, Width]
type = Width
trigger1 = 1
edge = 35,0
;value = 0,0
;ignorehitpause = 
;persistent = 

[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =1
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 201]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1



[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type
[State 0, Turn]
type = Turn
trigger1 =facing=enemy,facing
;ignorehitpause = 
;persistent = 


[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 202
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 202]
type    = A
movetype= H
physics = N
ctrl = 0
[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5061)
value = 5061
[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = Time = 0 && !selfanimexist(5061)
value = 5050
[State 5030, 1]
type = VelAdd;Gravity
triggerall = prevstateno!=10003
trigger1 = time>0
y = GetHitVar(yaccel)
[State 5030, 1]
type = VelAdd;Gravity
triggerall = prevstateno=10003
trigger1 = time>0
y =.47
[State 5030, 2]
type = HitVelSet
triggerall = prevstateno!=10003
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 2]
type = VelSet
triggerall = prevstateno=10003
trigger1 = Time = 0
x = -.75
y = -6

[State 5035, 4]
type=selfState
triggerall = time>2
trigger1= Pos Y >= Const240p(35)
value = 5100 ;HITA_FALL

[State 0, SelfState]
type = SelfState
triggerall = alive 
triggerall =canrecover && HitOver  && (time>gethitvar(hittime)) 
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210
;ctrl =
;ignorehitpause = 0
;persistent = 1

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 203 ;HITA_UP (transition)

;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 203]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5061)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5061

[State 5035, 2]
type = VelAdd
trigger1 = time>0
y = GetHitVar(yaccel)



[State 5035, 4]
type=selfState
triggerall = time>2 
trigger1 = Pos Y >=35;.
value = 5100 ;HITA_FALL


[State 0, SelfState]
type = SelfState
triggerall = alive 
triggerall =canrecover && HitOver  && (time>gethitvar(hittime)) 
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 301]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1


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

 ;5051 - 4 + type
;[State 0, PosAdd]
;type = PosAdd
;trigger1 = time=0 ;&&prevstateno=5020 && enemy,var(29)
;y = -const(size.mid.pos.y)


[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 302
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 302]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim2
trigger1 = Time = 0 
value =1028
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && anim=1028 
y = const(size.mid.pos.y)

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = time>0
y = GetHitVar(yaccel)

[State 0, TargetVelSet]
type = VelSet
trigger1 =p2stateno=1003 && enemy,animelemtime(3)>0
x = (p2dist x/12)
y =-9.5
persistent=0
[State 0, VelMul]
type = VelMul
trigger1 = p2stateno=1003 && enemy,animelemtime(3)>0
x = .89
;ignorehitpause = 
;persistent = 

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0&&prevstateno!=1051
trigger1 =p2stateno=1003 && enemy,animelemtime(3)<0 || p2stateno!=1003
x = 1
y =1

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0&&prevstateno=1051
trigger1 =p2stateno=1003 && enemy,animelemtime(3)<0 || p2stateno!=1003
x = 1
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&prevstateno=1051

y = -vel y
;ignorehitpause = 
;persistent = 

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
triggerall= enemy,var(11)
triggerall = alive &&  time >2
triggerall =HitOver && enemy,var(19)=0 && (time>gethitvar(hittime)) &&canrecover
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
y = -const(size.mid.pos.y)-10
[State 0, SelfState]
type = SelfState
triggerall= enemy,var(11) 
triggerall = alive&&  time >2
triggerall = p2stateno!=3061
triggerall =HitOver && enemy,var(19)=0 && (time>gethitvar(hittime)) &&canrecover
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210

;anim =
;ignorehitpause = 
;persistent = 

[State 5035, 4]
type=changeState
triggerall = time>10
trigger1 = Pos Y >= const(size.mid.pos.y)+40&& vel y >0
value = 303 ;HITA_FALL

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 303]
type    = L
movetype= H
physics = N

[State 0, VelSet]
type = VelSet
trigger1 =time=0
x = -7
;ignorehitpause =
;persistent =


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

[State 820, 1]
type = ChangeAnim2
Trigger1 = animtime=0 && anim=5100
value = 5110


[State 0, VelSet]
type = VelSet
trigger1 =1
y = 0
[State 0, PosSet]
type = PosSet
trigger1 =1
y = 0

[State 0, VelMul]
type = VelMul
trigger1 =1
x = .8
[State 0, VelSet]
type = VelSet
trigger1 =time=12
x = 0

[State 5035, 4]
type=SelfState
triggerall = time>2 
trigger1 = Pos Y >= Const240p(35);.
value = 5050
[State 0, SelfState]
type = SelfState
trigger1 = time > 2
value =ifelse(alive,5201,5110)



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


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


[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 14
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = LA
pausetime = 8,8
givepower=5,5
sparkno = S7000+(random%4)
sparkxy = -10,-5
hitsound = S2, 0
guardsound = S6, 0
ground.type = Low
getpower=ceil(2) 
guard.sparkno= S7500
guard.ctrltime=10
ground.slidetime =12
ground.hittime  = 10
fall.recovertime=10
down.hittime=10
air.hittime=10
ground.velocity = -5
guard.velocity=-4.5
down.velocity=-.5,-5
air.velocity = -1.5,-4
air.fall=1
forcenofall= 1
id=200
yaccel=.48
[State 200, 1]
type = PlaySnd
triggerall = random<499
trigger1 = Time = 1
value = 200, 0
channel=0
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
;Crouching light punch
[Statedef 405]
type    = C
movetype= A
physics = C
juggle  = 0; 5
poweradd= 0
ctrl = 0
anim = 405
sprpriority = 2
[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1
channel=1

[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 400, 2]
type = HitDef
trigger1 = animelem = 3
attr = C, NA
damage    = 25
animtype  = medium
hitflag = MAF
guardflag = MA
guard.sparkno= S7500
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -10,-35
hitsound = S2, 1
guardsound = S6, 0
getpower=15,7
ground.type = Low
guard.ctrltime=9
ground.slidetime =13
guard.ctrltime=10
ground.hittime  = 14
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,23,14))
air.hittime=ifelse(var(21)=1,99,ifelse(var(21)=2,23,14))
ground.velocity = -5
air.velocity = -2,-4
guard.velocity=-6
down.velocity = -5,0
down.hittime = 20
air.fall=1
id=200
yaccel=.48
[State 200, 1]
type = PlaySnd
triggerall = random<499
trigger1 = Time = 1
value = 200, 1
channel=0
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl =1
;---------------------------------------------------------------------------
;Crouching strong punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 0; 5
poweradd=0
ctrl = 0
anim = 410
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=1 
v = 37   
value = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = 7
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = 6
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = 1
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = -14
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3 && !movecontact
attr = C, NA
damage    = 50
animtype  = Medium
hitflag = MAF
guardflag = LA
priority=5
pausetime = 8,8
sparkno = S7020+(random%4)
sparkxy = -30,-10
guard.sparkno= S7500
hitsound = S2, 2
guardsound = S6, 0
ground.type = Low
guard.ctrltime=15
ground.slidetime =16
ground.hittime  =16
air.hittime=15
getpower=20
ground.velocity = -2.5,-5.5
guard.velocity=-5
air.velocity = -2,-4.5
yaccel=.52
fall=1
fall.recovertime=ifelse(var(21)=1,99,ifelse(Var(21)=2,25,17))
id=440
yaccel=.48
[State 200, 1]
type = PlaySnd
triggerall = random<499
trigger1 = Time = 1
value = 200, 2
channel=0
[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1


;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = N
juggle  = 0; ifelse(prevstateno = 102,0,1)
poweradd= 0
ctrl = 0
anim = 600
sprpriority = 2



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

[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    =10
guardflag = HA
priority = 3
pausetime = 9,9
sparkno = S7000+(random%4)
sparkxy = -10,-78
hitsound = S2, 0
getpower=10,5  
givepower=5,5
guardsound = S6, 0
guard.sparkno= S7500
ground.type = High
ground.slidetime = 5
ground.hittime  =ifelse(var(21)=1,20,ifelse(var(21)=2,12,10))
ground.velocity = -4
air.velocity = -1.3,ifelse(p2bodydist y <=-30,-1,-3.5)
air.hittime=ifelse(var(21)=1,20,ifelse(var(21)=2,12,10))
fall.recovertime=ceil(ifelse(var(21)=1,20,ifelse(var(21)=2,12,10))-(var(25)))
air.fall=1
id=200
yaccel=.48

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0
value = 57
ctrl = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >0
value = 52
ctrl = 0
;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 605]
type    = A
movetype= A
physics = N
juggle  = 0; ifelse(prevstateno = 102,0,2)
poweradd=0
ctrl = 0
anim = 605
sprpriority = 2

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

[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 20
guardflag = HA
priority = 4
pausetime = 11,11
sparkno = S7010+(random%4)
sparkxy = -5,-80
hitsound = S2, 1
getpower=ceil(10),10  
givepower=7,5
guardsound = S6, 0
ground.type = High
guard.sparkno= S7500
ground.slidetime = 9
ground.hittime  = 18
ground.velocity = -4
air.velocity = -2,-2.5;ifelse(fvar(15) <=-60,-.5,-2.5)
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,28,23)))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,28,23)))
air.fall=1
id=200
yaccel=.48
[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0
value = 57
ctrl = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >0
value = 52
ctrl = 0

;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 0; ifelse(prevstateno = 102,0,2)
poweradd= 0
ctrl = 0
anim = 610
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2
channel=1

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 40
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -13,-65
hitsound = S2, 2
getpower=ceil(20),15 
givepower=10,5
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = ceil(ifelse(var(21)=1,23,ifelse(var(21)=2,21,19))-(var(25)))
guard.ctrltime=19
ground.velocity = -5
air.velocity = -3,-4
air.hittime=ifelse(var(21)=1,99,ifelse(var(21)=2,37-((numexplod(610)>4)*7),28-(numexplod(610)*2)))
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,37-((numexplod(610)>4)*7),28-(numexplod(610)*2)))
air.fall=1
forcenofall= p2statetype=C && !var(21)
id=200
yaccel=.48



;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 700]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= -350
ctrl = 0
velset = 0,0
anim = 700
sprpriority =2
[State pal, *]
type = PalFX
trigger1 = time = 0
time = 8
add = 128,128,128
sinadd = -128,-128,-128,16
invertall = 0
color = 256
ignorehitpause = 1

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

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = 8
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = 6

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = 4
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 20
channel=0
[State 210, 2]
type = HitDef
trigger1 =!movecontact
attr = S, NA
animtype  = Medium
damage    = 5
guardflag = MA
priority=7
pausetime = 7,7
sparkno = S7020+(random%4)
sparkxy = -10,-85
hitsound = S2, 2
guard.sparkno= S7500
getpower=0,0 
givepower=5,5
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=16
ground.hittime  = 20
ground.velocity = -8.5,-5.5
guard.velocity=-3
air.velocity = -7.5,-5.5
p2facing=1
air.hittime=23
fall.recovertime=23
air.fall=1
id=200
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7
movetype = I  
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0; 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 20   
value = 0

[State 800, 1]
type = HitDef
triggerall = p2bodydist x <=40
Trigger1 = Time = 1
attr = S, NT         ;Attributes: Standing, Normal Throw         ;Affect only ground people who are not being hit
priority = 2    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2                      ;p2's sprite priority is set to 0 by default
p1facing = ifelse(command = "holdfwd",1,-1)
p2facing = 1          ;Force p2 to face KFM
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
id=800
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 =var(21)>0
v = 5  
value = 1
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno=[140,155])||p2movetype=H
v = 5  
value = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno!=[140,155])&&p2movetype=I
v = 5  
value =0
[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 11    
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = (random<33*(enemy,AIlevel))&&var(5)=0&&(enemy,AIlevel)>0&&time=0
trigger2 = (random<53*(enemy,AIlevel))&&var(5)=2&&(enemy,AIlevel)>0&&time<3
v = 20   
value = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = (time=[1,21])&&((enemy,command="z")||(enemy,command="x"&&enemy,command="a")||(enemy,command="x"&&enemy,command="y")||(enemy,command="y"&&enemy,command="z"))&&var(5)=2&&enemy,AIlevel=0
trigger2 = (time=[1,6])&&((enemy,command="z")||(enemy,command="x"&&enemy,command="a")||(enemy,command="x"&&enemy,command="y")||(enemy,command="y"&&enemy,command="z"))&&var(5)=0&&enemy,AIlevel=0
trigger3 = var(20)=1&&(var(5)=0||var(5)=2)&&(enemy,AIlevel>0)&& time >7
value =811
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=9&&var(5)=1
trigger2= time=12&&var(5)=0
value = 810
elem = 2
[State 0, VarSet]
type = VarSet
trigger1 = var(5)>=1
v = 19    
value = 1
[State 0, Explod]
type = Explod
triggerall =numexplod(840)<1
trigger1 =time=1 && var(5)=1
trigger2= (time=12) && var(5)=0
trigger3= (time=26) && var(5)=2
anim =840
ID =840
pos = 43,-73
postype = p1  ;p2,front,back,left,right
facing=facing
vfacing = 1
bindtime = -1
removetime=6
vel = 0,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=0
anim =842
ID =841
pos = 43,-73
postype = p1  ;p2,front,back,left,right
facing=facing
vfacing = 1
bindtime = -1
removetime=14
vel = 0,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=2
anim =841
ID =841
pos = 43,-73
postype = p1  ;p2,front,back,left,right
facing=facing
vfacing = 1
bindtime = -1
removetime=28
vel = 0,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[0,5]
ID =840
scale = 2-((time)*.12),2-((time)*.12)
facing=facing
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=6
ID =840
scale = 1,1
facing=facing

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[0,5]
ID =841
scale = 2-((time)*.12),2-((time)*.12)
facing=facing
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=6
ID =841
scale = 1,1
facing=facing


[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1, 1
[State 200, 1]
type = PlaySnd
trigger1 = animelem=3
value = 200, 13
channel=0
[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElemtime(4) =5
value = 3, 4
channel=1

[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2) < 0
edge = 80,0

[State 810, Bind 2-4]
type = TargetBind
trigger1 = animelemtime(1) >= 0 && animelemtime(2)<0
pos = 44,0

[State 810, Bind 5]
type = TargetBind
trigger1 =animelemtime(2) >= 0 && animelemtime(3)<0
pos = 42,-97
[State 810, Bind 5]
type = TargetBind
trigger1 =animelemtime(3) >= 0 && animelemtime(4)<0
pos = 37,-82
[State 0, VelSet]
type = VelSet
trigger1 =animelem=4 
x = 3
y = -7
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(4)>0&&animelemtime(5)<0 
trigger2 =animelemtime(10)>0
y = .48
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 =animelem=5 
x = 0
y = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NT
animtype  = Medium
damage    = 25
guardflag = MA
pausetime = 6,6
sparkno = S7010+(random%4)
sparkxy = -10,-90
hitsound = S2,5
guard.sparkno= S7500
getpower=15,7 
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=ifelse(anim=205,10,13)
ground.hittime  = ifelse(anim=205,12,16)+(var(21)=2*4)
ground.velocity = -5.5
guard.velocity=-6
air.velocity = -2,-8
p2facing=1
air.hittime=99
fall.recovertime=99
air.fall=1
id=200
envshake.time = 8
envshake.ampl = 7
envshake.freq=85
yaccel=.48
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3
v = 11   
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6
v = 11   
value = 0
[State 210, 2]
type = HitDef
trigger1 = AnimElem =7
attr = S, NT
animtype  = Medium
damage    = 30
guardflag = MA
pausetime = 2,2
sparkno = S7010+(random%4)
sparkxy = -10,-15
hitsound = S2,5
guard.sparkno= S7500
getpower=15,7 
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=ifelse(anim=205,10,13)
ground.hittime  = ifelse(anim=205,12,16)+(var(21)=2*4)
ground.velocity = -5.5
guard.velocity=-6
air.velocity = 5,8
p2facing=-1
air.hittime=99
fall.recovertime=99
air.fall=1
id=202
envshake.time = 8
envshake.ampl = 7
envshake.freq=85
yaccel=.48
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = p2bodydist x +35
y =enemy,pos y +20
;ignorehitpause = 
;persistent = 
[State 0, Turn]
type = Turn
trigger1 = animelem=5
;ignorehitpause = 
;persistent = 
[State 0, TargetState]
type = TargetState
trigger1 =movehit
value =3003
ID = 202
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 

[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=6
trans = addalpha;, sub
alpha = 175,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=7
trans = addalpha;, sub
alpha = 150,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=8
trans = addalpha;, sub
alpha = 125,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=9
trans = addalpha;, sub
alpha = 100,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=10
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=11
trans = addalpha;, sub
alpha = 50,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=12
trans = addalpha;, sub
alpha = 25,250
[State 0, Trans]
type = Trans
trigger1 = animelemtime(4)=13
trans = addalpha;, sub
alpha = 10,250


[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 57
ctrl = 1
;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 811]
type    = S
movetype= A
physics = S
anim = 830
poweradd = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem=1
value = 5000,0
channel=0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =1
id =  840
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =1
id =  841
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -11
[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 812]
type    = S
movetype= A
physics = S
poweradd = 0
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 831

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -11
[State 810, State End]
type = selfState
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
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=811
value =812
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =time=9&&enemy,var(5)=1
trigger2=time=12&&enemy,var(5)=0
value = 820
elem = 2

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = enemy,stateno!=810&& enemy,stateno!=812
value = 5050
;----------------------------------------------------------------------
[Statedef 821]
type = A
movetype = H
physics = N
velset = -1.5,-7.25
poweradd = 40

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

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 45
trigger2 = FrontEdgeBodyDist < 45
value = 1
movecamera = 0,1

;ignorehitpause =
;persistent =

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1047

;anim =
;ignorehitpause = 
;persistent = 


[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = alive
triggerall =time >25&&var(19)=0
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value = 5210 ;HITFALL_AIRRECOVER

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


;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt

[Statedef 830]
type    = A
movetype= A
physics =A
juggle  = 0; 0;
ctrl = 0
anim = 850
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 20   
value = 0

            ;Force p2 into falling down
[State 800, 1]
type = HitDef
triggerall= p2statetype=A
Trigger1 = Time = 0
attr = A, NT         ;Attributes: Standing, Normal Throw         ;Affect only ground people who are not being hit
priority = 2    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2                      ;p2's sprite priority is set to 0 by default
p1facing = ifelse(command = "holdfwd",1,-1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 831      ;On success, KFM changes to state 810
p2stateno = 832       ;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   
id=800
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 =p2movetype=A
v = 5  
value = 1
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno=[140,155])||p2movetype=H
v = 5  
value = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno!=[140,155])&&p2movetype=I
v = 5  
value =0

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = ifelse(prevstateno=605,610,605)
ctrl = 0

;----------------------------------------------------------------------
[Statedef 831]
type = A
movetype= A
physics = N
anim = 851
velset=0,0
poweradd = 60

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 11    
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = (random<33*(enemy,AIlevel))&&var(5)=0&&(enemy,AIlevel)>0&&time=0
trigger2 = (random<53*(enemy,AIlevel))&&var(5)=2&&(enemy,AIlevel)>0&&time<3
v = 20   
value = 1
[State 0, ChangeState]
type = ChangeState
trigger1 =  (time=[1,21])&&((enemy,command="z")||(enemy,command="x"&&enemy,command="a")||(enemy,command="x"&&enemy,command="y")||(enemy,command="y"&&enemy,command="z"))&&var(5)=2&&enemy,AIlevel=0
trigger2 =(time=[1,13])&&((enemy,command="z")||(enemy,command="x"&&enemy,command="a")||(enemy,command="x"&&enemy,command="y")||(enemy,command="y"&&enemy,command="z"))&&var(5)=0&&enemy,AIlevel=0
trigger3 = var(20)=1&&(var(5)=0||var(5)=2)&&(enemy,AIlevel>0)&& time >7
value =835

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=9&&var(5)=1
trigger2= time=13&&var(5)=0
value = 851
elem = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =time=0
v =4     ;fv =
value = -6

[State 0, VarSet]
type = VarSet
trigger1 =var(16)<0
v =4    
value = 0
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = var(5)>=1
v = 19    
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = time >30
v = 21   
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 11   
value = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall =numexplod(840)<1
trigger1 =time=1 && var(5)=1
trigger2= (time=13) && var(5)=0
trigger3= (time=26) && var(5)=2
anim =840
ID =840
pos = 36,-73
postype = p1  ;p2,front,back,left,right
facing=facing
vfacing = 1
bindtime = -1
removetime=9
vel = 0,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=0
anim =842
ID =841
pos = 36,-73
postype = p1  ;p2,front,back,left,right
facing=facing
vfacing = 1
bindtime = -1
removetime=14
vel = 0,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=2
anim =841
ID =841
pos = 36,-73
postype = p1  ;p2,front,back,left,right
facing=facing
vfacing = 1
bindtime = -1
removetime=28
vel = 0,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[0,5]
ID =840
scale = 2-((time)*.12),2-((time)*.12)
facing=facing
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=6
ID =840
scale = 1,1
facing=facing

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[0,5]
ID =841
scale = 2-((time)*.12),2-((time)*.12)
facing=facing
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=6
ID =841
scale = 1,1
facing=facing
[State 810, Grab Sound]
type = PlaySnd
trigger1 = time = 0
value = 1, 1

[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(1) < 0
edge = 60,0

[State 810, SprPriority]
type = SprPriority
trigger1 = AnimElem =1
value = 2
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem=1
pos =49, -75

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem=2
pos = 80, -76
[State 200, 1]
type = PlaySnd
trigger1 = animelem=3
value = 200, 9
channel=0
[State 0, VarSet]
type = VarSet
trigger1 = animelem=6
v = 11   
value = 0
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NT
animtype  = Medium
damage    = 60
guardflag = MA
pausetime = 6,6
sparkno = S7010+(random%4)
sparkxy = -10,-90
hitsound = S2,5
guard.sparkno= S7500
getpower=15,7 
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=ifelse(anim=205,10,13)
ground.hittime  = ifelse(anim=205,12,16)+(var(21)=2*4)
ground.velocity = -5.5
guard.velocity=-6
air.velocity = -6,3
p2facing=1
air.hittime=ifelse(var(5)=1,150,45)
fall.recovertime=ifelse(var(5)=1,150,45)
air.fall=1
id=211
envshake.time = 8
envshake.ampl = 7
envshake.freq=85
yaccel=.48

[State 810, State End]
type = ChangeState
trigger1 =animtime=0
value = 57
ctrl=1
;----------------------------------------------------------------------
[Statedef 832]
type = A
movetype = H
physics = N
sprpriority = 1
velset=0,0
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 852
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=835
value =836
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = enemy,stateno!=831
value = 5050

;----------------------------------------------------------------------
[Statedef 841]
type = A
movetype = H
physics = N
velset = -5,-8
poweradd = 40

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

[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
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 833]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
triggerall = p2stateno!=3001
Trigger1 = Time = 0 && prevstateno!=[800,899]
value = 854
[State 820, 1]
type = ChangeAnim2
triggerall = p2stateno=3001
Trigger1 = Time = 0 
value = 1029
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = S,HP
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype=A&&p2stateno=810
x = -3
y = 7
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype!=A&&p2stateno=810
x = 6.5
y = -5
[State 0, HitVelSet]
type = HitVelSet
trigger1 =time=0 &&p2stateno!=810
x = 1
y = 1
[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=ifelse(anim=820,15,0)&& (time >10)
value = 834
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 834]
type    = L
movetype= H
physics = N

[State 0, VelSet]
type = VelSet
trigger1 =vel x =-5
x = -3
;ignorehitpause =
;persistent =

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

[State 0, VelSet]
type = VelSet
trigger1 =1
y = 0
[State 0, PosSet]
type = PosSet
trigger1 =1
y = 0

[State 0, VelMul]
type = VelMul
trigger1 =1
x = .95
[State 0, VelSet]
type = VelSet
trigger1 =time>31
x = 0


[State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=0  
triggerall = alive
trigger1 = time > 27 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 27 
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > 27
value =5201

[State 0, ChangeState]
type = selfState
trigger1 = time>67
value = ifelse(!alive, 5110,5120)

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 835]
type    = A
movetype= I
physics = A
anim = 853
poweradd = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem=1
value = 5000,3
channel=0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =1
id =  840
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =1
id =  841
;ignorehitpause =
;persistent =

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


;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 836]
type    = A
movetype= I
physics = N
poweradd = 0
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0
value = 5040

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -6
y=-5
[State 0, Gravity]
type = Gravity
trigger1 =1

[State 810, State End]
type = selfState
trigger1 = pos y>0
value = 52
ctrl = 1
;--------------------------------------------------------------------------------
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 0; 4
poweradd= 0
velset = 0,0
anim = 300
ctrl = 0
sprpriority = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -10
[State 0, LifeAdd]
type = LifeAdd
trigger1 = time=0 && var(10)=0 
value = -75
kill = 0
[State 0, Width]
type = Width
trigger1 = time=0
edge = 40,0
;value = 0,0
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 =  animelem=1
anim = 310
ID = 310
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = const(size.yscale),const(size.yscale)
ontop = 1
sprpriority = 9
shadow = 0,0,0
ownpal = 1
persistent = 0
removeongethit=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelemtime(2)>=0 
id = 310
;ignorehitpause = 
;persistent = 
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 7
channel=0
[State 0, Helper]
type = Helper
Trigger1 = animelem=1
helpertype = normal ;player
name ="Reppuken"
ID = 1001
stateno = 10001
pos = 27,-70
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=.225
size.yscale=.225


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

;anim =
;ignorehitpause = 
;persistent = 
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1001]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                     ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 301                 ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 1
[State 0, Width]
type = Width
trigger1 = time=0
edge =45,0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = -10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = -8
[State 0, Explod]
type = Explod
trigger1 =  animelem=3
anim = 311
ID = 310
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = const(size.yscale),const(size.yscale)
ontop = 1
sprpriority = 9
shadow = 0,0,0
ownpal = 1
persistent = 0
removeongethit=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelemtime(4)>=0 
id = 310
[State 0, Helper]
type = Helper
Trigger1 = animelem=3
helpertype = normal ;player
name ="Reppuken"
ID = 1002
stateno = 10001
pos = 27,-70
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=.225
size.yscale=.265

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 9
channel=0
[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1002]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                     ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0 
anim = 302
ctrl = 0
sprpriority = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = -10
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 12
channel=0
[State 0, Width]
type = Width
trigger1 = time=0
edge = 75,0
player =35,0
[State 0, Explod]
type = Explod
trigger1 =  animelem=2
anim = 310
ID = 310
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = const(size.yscale),const(size.yscale)
ontop = 1
sprpriority = 9
shadow = 0,0,0
ownpal = 1
persistent = 0
removeongethit=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelemtime(3)>=0 
id = 310
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
Trigger1 = animelem=2
helpertype = normal ;player
name ="Reppuken"
ID = 1002
stateno = 10001
pos = 27,-70
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=.265
size.yscale=.325


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

;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1003]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                     ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0; 0;1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0 
anim = 303
ctrl = 0
sprpriority = 1

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

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

;=========================================================================================================
; Kung Fu Palm
[Statedef 1005]
type    = A
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0

anim =315
ctrl = 0
sprpriority = 1

;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno=[600,699]
v = 21   ;v = 570
value = 0
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = -5
;ignorehitpause = 
;persistent = 


 
[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
anim =10000
ID =1005
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
removetime=-1
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0


;trans = 
;persistent =
;supermove = 0
;pausemove = 0


[State 0, Helper]
type = Helper
Trigger1 = animelem=3
helpertype = normal ;player
name ="overlay"
ID = 316
stateno = 316
pos = 27,-70
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale=const(size.yscale)
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=2
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S0,2

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

;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v = 58   
;value = 15
;ignorehitpause=1
;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v =15   
;value = 18-(numexplod(1001)*5)
;ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 24    
value = var(10)
;ignorehitpause = 
;persistent = 

[State 0, VarAdd]
type = VarAdd
trigger1 = animelem=2 && fvar(4)=0
v =10
value = -ifelse(var(10)>4,4,var(10))
[State 0, VarAdd]
type = VarAdd
trigger1 = animelem=2 && fvar(4)>0
v =10
value = -ifelse(var(10)>3,2,var(10)-1)
[State 0, Helper]
type = Helper
Trigger1 = animelem=3 && var(24)>0
helpertype = normal ;player
name ="Reppuken"
ID = 1005
stateno = 10005
pos = 27,-70
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=.3
size.yscale=.245
[State 113, VarSet]
type = VarSet
trigger1 =numexplod(1005)>2 && var(21)=2
v =21   ;v = 570
value =1
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A && var(24)>=4 
v =21   ;v = 570
value =2
[State 113, VarSet]
type = VarSet
trigger1 = var(21)=2
v =27  ;v = 570
value =1

;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =var(24)>=3
v = 19    
value = 1
ignorehitpause = 1
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype  = Medium
damage    =ifelse(var(24)>4,90,40+(var(24)*10))
guardflag = MA
priority=cond(var(24)<2,4,cond(var(24)=3,5,6))
pausetime = 6,6
sparkno = S7020+(random%4)
sparkxy = -10,-45
hitsound = S2, 3
guardsound = S6, 0
guard.sparkno= S7500
getpower=25,5
givepower=15,5
ground.type = High
p2facing=1
guard.ctrltime=16
ground.slidetime =15
ground.hittime  = 16
ground.velocity = -3,ifelse((var(24)>=4||var(24)=2&&var(21)>0),12,-3)
guard.velocity=-6
air.velocity =  -3,10
air.hittime=ifelse((var(21)>=1||var(19)),99,ceil(55))
fall.recovertime=ifelse((var(21)>=1||var(19)),99,ceil(55))
fall=1
id=ifelse((var(24)>=4||var(24)=2&&var(21)>0)&&numexplod(1005)<2,212,ifelse(var(24)=2,210,ifelse((var(24)=1||var(24)=0),999,211)))
yaccel=.47
[State 0, VarSet]
type = VarSet
trigger1 = var(24)=4||var(24)=2&&var(21)>0
 trigger1= movehit
v = 11    
value =1
ignorehitpause = 1

;persistent = 

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .45
[State 0, SelfState]
type = changeState
trigger1 =pos y>=0
value =52
;=========================================================================================================
; Kung Fu Palm
[Statedef 1006]
type    = A
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset=0,0
anim =313
ctrl = 0
sprpriority = 1

;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno=[600,699]
v = 21   ;v = 570
value = 0
[State 0, Width]
type = Width
trigger1 = 1
edge = 35,0
;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, PlayerPush]
type = PlayerPush
trigger1 =!movecontact 
value = 0
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = time=0
trigger1 = (command="holdback"|| command="back")
trigger2 = p2bodydist x <100 && pos y <-50 && AIlevel>0 && var(31)=0
value = 314

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =( backedgebodydist >15 && frontedgebodydist >15) && time=0 
value = anim
elem = 2
[State 0, Turn]
type = Turn
trigger1 = frontedgebodydist <15 && time=0
[State 0, PosSet]
type = PosSet
trigger1 = pos x <140*-facing && animelemtime(2)<0  &&(backedgebodydist <16|| frontedgebodydist <16)
x = 145*-facing

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time=0
id = 313
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 =time=0 && animelem=1
anim =10000
ID =313
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
 
[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
anim =10000
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1=animelem=4 && anim=314 && !numexplod(321)
trigger2=animelem=6 && anim=313&& !numexplod(321)
value = S0,2
volume = 255
channel = 1

[State 0, Explod]
type = Explod
trigger1=animelem=6 && anim=313&& !numexplod(321)
anim =321
ID =321
pos = 46,-17
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1=animelem=4 && anim=314 && !numexplod(321)
anim =322
ID =321
pos = 20,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = numexplod(321) 
ID =321
scale = ifelse(time%3=0,.4,.6),ifelse(time%3=0,.4,.6)
removeongethit = 0
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0



[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

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


[State 0, VelSet]
type = VelSet
trigger1 = animelem=6 && anim=313
trigger2 = animelem=4 && anim=314
x = (ifelse(anim=314,3.9,8)*fvar(6))+(numexplod(313)*1.5)
y = (9.5)+(numexplod(313)*2)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S0,2
volume = 255
channel = 1

;
;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v = 58   
;value = 15
;ignorehitpause=1
;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v =15   
;value = 18-(numexplod(1001)*5)
;ignorehitpause=1
 

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
animtype  = Medium
damage    =ceil(40)+(numexplod(313)*25)
guardflag = MA
pausetime = 6,6
sparkno = S7020+(random%4)
sparkxy = -10,-45
hitsound = S2, 3
guardsound = S6, 0
guard.sparkno= S7500
getpower=40,5
givepower=30,5
ground.type = High
p2facing=1
guard.ctrltime=16
ground.slidetime =15
ground.hittime  = 16
ground.velocity = -4,0
guard.velocity=-6
air.velocity =  -4,8
air.hittime=20
fall.recovertime=20
fall=1
id=ifelse(fvar(5)<=1,210,211)
yaccel=.47

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarSet]
type = VarSet
trigger1 = movehit && numexplod(313)
v = 19    
value = 1
;ignorehitpause = 
;persistent = 

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = pos y>=0 && animelemtime(3)>0
id = 321
;ignorehitpause = 
;persistent = 

[State 0, SelfState]
type = changeState
trigger1 =pos y>=0 && animelemtime(3)>0
value =52
ctrl=0
;=========================================================================================================
; Kung Fu Palm
[Statedef 1007]
type    = A
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset=0,0
anim =315
ctrl = 0
sprpriority = 1

;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno=[600,699]
v = 21   ;v = 570
value = 0

;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, PlayerPush]
type = PlayerPush
trigger1 =!movecontact 
value = 0
;ignorehitpause = 
;persistent = 





 
[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
anim =10000
ID =1007
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0



[State 0, Explod]
type = Explod
trigger1=animelem=5  && !numexplod(321)
anim =324
ID =321
pos = -10,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = numexplod(321) 
ID =321
scale = ifelse(time%3=0,.4,.6),ifelse(time%3=0,.4,.6)
removeongethit = 0
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0



[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

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


[State 0, VelSet]
type = VelSet
trigger1 = animelem=5 
y = (9.5)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=5  && !numexplod(321)
value = S0,2
volume = 255
channel = 1

;
;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v = 58   
;value = 15
;ignorehitpause=1
;[State 0, VarSet]
;type = VarSet
;trigger1 =time=0
;v =15   
;value = 18-(numexplod(1001)*5)
;ignorehitpause=1
 

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5 &&!movecontact
attr = S, SA
animtype  = Medium
damage    =ceil(35)
guardflag = MA
hitflag= MAFD
pausetime = 6,6
sparkno = S7020+(random%4)
sparkxy = -10,-45
hitsound = S2, 3
guardsound = S6, 0
guard.sparkno= S7500
getpower=40,5
givepower=30,5
ground.type = High
p2facing=1
guard.ctrltime=19
ground.slidetime =15
ground.hittime  = 19
guard.ctrltime=13
ground.velocity = -4,0
guard.velocity=-6
down.velocity=-4,0
down.hittime=15
air.velocity =  -2,8
air.hittime=80
fall.recovertime=80
air.fall=1
id=ifelse(fvar(5)<=1,210,440)
yaccel=.47

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = pos y>=0 && animelemtime(3)>0
id = 321
;ignorehitpause = 
;persistent = 

[State 0, SelfState]
type = changeState
trigger1 =pos y>=0 && animelemtime(3)>0
value =52
ctrl=0
;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1010]
type    = U
movetype= A
physics = N
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = ifelse(Var(21)=2,1,2)
persistent=0
ignorehitpause=1

 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1010)=1 && time=0
v = 21   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1  &&prevstateno=[200,1100]
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A && anim=1012
v =21   ;v = 570
value = 2
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2 || numexplod(1010)>1
trigger1 = p2movetype=A && var(2)!=3
v =21   ;v = 570
value = 1
[State 0, Explod]
type = Explod
trigger1 =var(21)=2 && movehit=1 
anim =10000
ID = 1010
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A)&& movehit 
anim =10000
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 0, Width]
type = Width
trigger1 =anim!=1003
edge = 45,0
;value = 0,0
;ignorehitpause = 
;persistent = 


;[State 1000, 1]
;type = PlaySnd
;trigger1 = time=0
;value = 200,9
;channel=0

;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = var(21)=1+(var(2)=2)
v =27    
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1




[State 0, VarSet]
type = VarSet
trigger1 = var(2)=3 && power <250 && time=1
v = 2    
value = 2
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
trigger1 = p2bodydist x<90 && p2statetype!=C|| numhelper(3011)>=0 ;|| var(31)>0||var(2)=0

v = 2   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
triggerall = numhelper(3011)=0
triggerall =  var(31)=0
trigger1 = p2bodydist x >90||p2statetype=C || p2statetype=A
v = 2   
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && p2bodydist x <70 && fvar(21)=[-45,65]
triggerall = numhelper(3011)=0
triggerall = power >=250&& (random<249 || p2movetype=A && p2statetype!=A)
triggerall = p2statetype=A && (p2movetype=H&&p2stateno!=[120,155])  || p2movetype=A
trigger1=time=0&&var(31)=0
v = 2   
value = 3

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
trigger1 = helper(10002),var(2)!=0
v = 2   
value =helper(10002),var(2)

;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  
value = ifelse(command = "QCB_y",1,ifelse(command="QCB_z",2,3))
[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(2)=3 && time=0
value = -250
[State 0, HitBy]
type = HitBy
trigger1 =  var(2)=3&&  movetype=A
value = A,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 2
;ignorehitpause = 
;persistent = 
[State 0, HitBy]
type = HitBy
trigger1 = var(2)>=2 && statetype=A
value = A,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = 999+var(2)
[State 0, Helper]
type = Helper
trigger1 = animelem=1 && anim=1002
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && statetype=A
value = anim
elem=2
[State 1010, 1]
type = PlaySnd
trigger1 = animelem=2
value = 0, 2
channel=1

[State 1010, 1]
type = PlaySnd
trigger1 = animelem=1
value = 200, 4+var(2)
channel=0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2&& anim!=1003
statetype = A       ;S,A,C,L
physics = N        ;A,C,S,N
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=2&& anim!=1003
x = ifelse(var(2)=1,1.5,ifelse(var(2)=2,3,4.5))
y = -ifelse(var(2)=1,5.5,ifelse(var(2)=2,7,5.5))
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <-5 && animelemtime(8)>=0&& anim!=1003
value = anim
elem = 8
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2)>0 && animelemtime(9)<0 && anim!=1003
y = ifelse(var(2)=1,.5,ifelse(var(2)=2,.56,.5))
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

 [State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=-5 && animelemtime(8)>=0&& animelemtime(9)<0 && anim!=1003
value = anim
elem = 9

[State 0, VelSet]
type = VelSet
trigger1 =animelem=9 
x = 0
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=9
statetype =S
movetype = I        ;I,A,H
physics = S
;ignorehitpause = 
;persistent = 

[State 0, PosSet]
type = PosSet
trigger1 = animelem=9
y = 0
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =  animelem=3
anim = 1005
ID = 1006
pos = -28,-50
postype = p1
facing = 1
vfacing = 1
bindtime = -1
scale =.5,.5
ontop = 1
sprpriority = 9
shadow = 0,0,0
ownpal = 1
persistent = 0
removeongethit=1

[State 1010, 6] ;Opponent near
type = HitDef
triggerall =anim=1000
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 50, 10
priority  = 4
hitflag=MAF
guardflag = MA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=10,5
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = ifelse(var(21)>0,28,15)
guard.ctrltime=15
down.hittime=20
ground.velocity = -ifelse(var(22)=1,1,ifelse(var(22)=2,5,3)),ifelse(var(22)=1,10,ifelse(var(22)=2,-5,0))
air.velocity = -1.75,ifelse(var(22)=1,10,ifelse(var(22)=2,-6,-5))
guard.velocity=-5
air.fall=1
air.hittime=40-((numexplod(1001))*9)
fall.recovertime=40-((numexplod(1001))*9)+(var(22)>0)*20
yaccel=.47
id=ifelse((var(22)>0||p2stateno=2000),1001,200)


;persistent = 



[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1001
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 75, 15
priority  = 4
hitflag=MAF
guardflag = HA
pausetime = 5,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=10,5
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -ifelse(var(22)=1,1,6),ifelse(var(22)=1,10,ifelse(var(22)=2,-5,-3))
air.velocity = -ifelse(var(22)=1,1,6),ifelse(var(22)=1,10,ifelse(var(22)=2,-5,6))
guard.velocity=-5
air.fall=1
air.hittime=75
fall.recovertime=75+(var(22)>0)*20
yaccel=.47
id=ifelse((var(22)>0||p2stateno=2000),1001,211)

;ignorehitpause = 
;persistent = 

[State 1010, 6] ;Opponent near
type = HitDef
triggerall =  anim=1002
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 35, 5
priority  = 5
hitflag=MAF
guardflag = HA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-67
hitsound =S2,3
getpower=20,10
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -3,-3.75
air.velocity = -1.5,5
down.velocity=-3,-12.8
guard.velocity=-5
fall=1
air.hittime=50
fall.recovertime=50
yaccel=.47
id=1010
envshake.time =8
envshake.ampl = 7
envshake.freq=55
[State 0, VarSet]
type = VarSet
trigger1 = var(22)>0 
trigger2 = var(2)=3
v = 19    
value = 1
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && numtarget(1010) && anim!=1003
value = 1003
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1 && anim=1003 
y = -10
;ignorehitpause = 
;persistent = 
[State 1010, 1]
type = PlaySnd
trigger1 = animelem=1&& anim=1003
value = 200, 10
channel=0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=1&& anim=1003
x = 0
y = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=2&& anim=1003
x = 0
y = 7
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <-5 && animelemtime(3)>=1&& animelemtime(4)<=0&&anim=1003
value =1003
elem = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=-5 &&animelemtime(3)>=1&& animelemtime(4)<=0&&anim=1003
value =1003
elem = 4
[State 0, VelSet]
type = VelSet
trigger1 = animelem=5&& anim=1003
x = 5
y = -4
 [State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <=20&& animelemtime(8)>=2&& animelemtime(9)<0&& anim=1003
value = anim
elem = 5
 [State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=20 && animelemtime(5)>=0&& animelemtime(9)<0 && anim=1003
value = anim
elem = 9

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2)>0 && animelemtime(4)<0 && anim=1003
trigger2 = animelemtime(5)>0 && animelemtime(9)<0 && anim=1003
y = .55
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =animelem=9 
x = 0
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=9
statetype =S
movetype = I        ;I,A,H
physics = S
;ignorehitpause = 
;persistent = 

[State 0, PosSet]
type = PosSet
trigger1 = animelem=9
y = 0
;ignorehitpause = 
;persistent = 





[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(1) >=0 && animelemtime(2)<0
id = 1010
pos =32,-61
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(2) >=0 && animelemtime(4)<0
id = 1010
pos =0,-7
[State 0, TargetBind]
type = TargetBind
trigger1 = animelem=4
id = 1010
pos =0,0
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=4
value = -60+(Var(21)=1)*35
ID = 1010
kill = 1
absolute = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = anim=1003
v = 19    
value = 1
;ignorehitpause = 
;persistent = 

[State 0, TargetState]
type = TargetState
trigger1 = animelem=4
value =1032
ID = 1010

[State 0, VelSet]
type = VelSet
trigger1 =animelem=4 &&anim=1003
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=4 &&anim=1003
y = 0
;ignorehitpause = 
;persistent = 


;[State 0, VarSet]
;type = VarSet
;trigger1 = movehit=1 && p2stateno=[300,305]
;v = 11    
;value = 1

 
[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1011]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = p2stateno!=1010
value = 5050
;------------------
; Wall bounce
[Statedef 1025]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1025

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1026

;------------------
; (a custom gethit state)
[Statedef 1026]
type    = A
movetype= H
physics = N

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

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1027

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 15) && time >15
value = 5100

;------------------
; (a custom gethit state)
[Statedef 1027]
type    = A
movetype= H
physics = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027

[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,0

[State 1027, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 1028

;------------------
; (a custom gethit state)
[Statedef 1028]
type    = A
movetype= H
physics = N

[State 0, SelfState]
type = SelfState
triggerall =enemy,var(19)=0  && alive
trigger1=(time=[1,20])&& command="recovery" 
trigger2 = (time=[1,20])&&var(16) = 1&& p1name="Training"
trigger3 = AILevel >0 && random<99 && enemy,stateno!= 3050 
value =5210

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6
[State 1028, Vel X]
type = VelSet
triggerall = anim!=5052
trigger1 = Time = 0
x = ifelse(p2stateno=3050&&p2bodydist x >90,6,1.6)

[State 1028, Vel X]
type = VelSet
triggerall = anim=5052
trigger1 = Time = 0
x = -ifelse(p2stateno=3050&&p2bodydist x >90,6,1.6)



[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062
[State 1028, Turn]
type = Turn
triggerall = anim!=5052
trigger1 = (Time = 0) && (BackEdgeDist < 30)
[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 15)
value = 5100

;---------------------------------------------------------------------------
; Trip/fast fall back down
[Statedef 1031]
type    = A
movetype= H
physics = N
poweradd= 0
ctrl = 0
sprpriority =-1
[State 0, Turn]
type = Turn
trigger1 =facing= enemy,facing 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& p2stateno=405 || enemy,prevstateno=405
value = 5070
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& anim!=5070 && p2stateno!=831
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = p2stateno!=405 && enemy,prevstateno!=405
trigger1 = time=2&& anim=5030
value = ifelse(selfanimexist(5161),5161,5160)

[State 0, VelSet]
type = VelSet
trigger1 = time=0 && anim=5030
y=15
x=0
[State 0, VelSet]
type = VelSet
trigger1 = time=0 && anim=852
y=10
x=-7
;ignorehitpause = 
;persistent = 
[State 0, HitVelSet]
type = HitVelSet
trigger1 =time=0 && anim=5070 
x = 1
y = 1
;ignorehitpause = 
;persistent =
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = ifelse(anim=5070,.75,.55)

;persistent =

[State 0, SelfState]
type = changeState
triggerall = time >ifelse(anim=5070,5,0)
trigger1 = pos y>=-5
value =1032


;---------------------------------------------------------------------------
; Ground bounce up
[Statedef 1032]
type    =L
movetype= H
physics = N
poweradd= 0
velset=0,0
ctrl = 0
sprpriority =-1
[State 0, PosSet]
type = PosSet
trigger1 =time=[0,4]
y = 0
;ignorehitpause =
;persistent =
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=0
value = SCA
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0  && selfanimexist(5101)
value = 5101
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0  && !selfanimexist(5101)
value = 5100

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 && (anim!=[5110,5111])&& !selfanimexist(5111)
value = 5110
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =  animtime=0 && (anim!=[5110,5111])&& selfanimexist(5111)
value = 5111
[State 0, EnvShake]
type = EnvShake
trigger1 =time=0 
time = 5
freq = 60
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 


[State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=0
triggerall = enemy,var(25)=0 
triggerall = alive
trigger1 = time > 27 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 27
trigger3 = AILevel >0 && enemy,stateno!= 3050 &&time > 28;&& random <110*AILevel 
value =5201

[State 0, SelfState]
type = SelfState
trigger1 = pos y>=0 && time>40
value =ifelse(!alive, 5110,5120)
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1033]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1


[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type

 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 1029
;---------------------------------------------------------------------------
; hitshakestae for trip or fast fall
; CNS difficulty: easy
[Statedef 1034]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type


 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 1031

;------------------
; Stagger
[Statedef 1035]
type    = S
movetype= H
physics = S

[State 0, HitVelSet]
type = HitVelSet
trigger1 =time=0
x = 1
y = 1
;ignorehitpause = 
;persistent =
[State 1025, Anim] ;Custom animation
type = ChangeAnim
triggerall = time=0
trigger1 = selfanimexist(5180)
value = 5180
[State 1025, Anim] ;STUPID PEOPLE WHO THOUGHT 5003 WAS A GOOD IDEA MUTEKI
type = ChangeAnim
triggerall = time=0
triggerall = anim!=5180
trigger1 = selfanimexist(5003)
value = 5003
[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 = time=0
triggerall = !selfanimexist(5003)
triggerall = !selfanimexist(5180)
value = 5300

[State 0, SelfState]
type = SelfState
trigger1 = !alive
value =5050
[State 1025, State]
type = selfstate
trigger1 =time > ceil(enemy,var(58)*1.45)
value = 0
ctrl=1
;---------------------------------------------------------------------------
; hitshakestae for trip or fast fall
; CNS difficulty: easy
[Statedef 1036]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-15
 ;5051 - 4 + type


 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 833

;---------------------------------------------------------------------------
; Ground Bounce
[Statedef 1029]
type    = A
movetype= H
physics = N
poweradd= 0
ctrl = 0
sprpriority =-1
facep2=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& p2stateno!=810
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=2&& p2stateno!=810
value = 5160

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

;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .55
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0 && p2stateno!=810
y = -40
ignorehitpause =1
;persistent =

[State 0, SelfState]
type = changeState
trigger1 = pos y>=-5
value =1030

;---------------------------------------------------------------------------
; Ground bounce up
[Statedef 1030]
type    = A
movetype= H
physics = N
poweradd= 0
ctrl = 0
velset=0,0
sprpriority =-1
[State 0, PosSet]
type = PosSet
trigger1 =time=[0,2]
y = 0
;ignorehitpause =
;persistent =

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0
value = 5100

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = time=5
value = 50061

[State 0, VelSet]
type = VelSet
trigger1 = time=3
y=-9.25
x=-1

[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .5

[State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=0  
triggerall = alive
trigger1 = time > 12 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time >12 
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > 12
value =5210


[State 0, SelfState]
type = SelfState
trigger1 = pos y>0 && time>20
value =5100  

;------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 1045]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = ifelse(enemy,var(11),1029,1025)
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && (enemy,var(11)||p2stateno=3051)
y = const(size.mid.pos.y)
[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1046

;------------------
; Hit by Fast Kung Fu Palm - flying through the air
; (a custom gethit state)
[Statedef 1046]
type    = A
movetype= H
physics = N

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

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

;ignorehitpause =
;persistent =

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1047

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0) && time >15
value = 5100

;------------------
; Hit by Fast Kung Fu Palm - hit wall
; (a custom gethit state)
[Statedef 1047]
type    = A
movetype= H
physics = N
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && (enemy,var(11)||p2stateno=3051)
y = -const(size.mid.pos.y)
[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)
[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1026
[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = time =[1,40]
value=1
[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3




[State 1027, State]
type = ChangeState
trigger1 =time> 25
value = 1048

;------------------
; Hit by Fast Kung Fu Palm - bounce off wall
; (a custom gethit state)
[Statedef 1048]
type    = A
movetype= H
physics = N
[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027
[State 0, SelfState]
type = SelfState
triggerall =enemy,var(19)=0  && alive 
trigger1=(time=[1,20])&& command="recovery" 
trigger2 = (time=[1,5])&&var(16) = 1&& p1name="Training"
trigger3 =(time=[1,5])&& AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 
value =5210


[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6

[State 1028, Vel X]
type = VelSet
triggerall = anim!=5052
trigger1 = Time = 0
x = .5

[State 1028, Vel X]
type = VelSet
triggerall = anim=5052
trigger1 = Time = 0
x = -.5


[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .48

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062
[State 1028, Turn]
type = Turn
triggerall = anim!=5052
trigger1 = (Time = 0) && (BackEdgeDist < 30)
[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 15)
value = 5100

;---------------------------------------------------------------------------
[Statedef 1050]
type    = S
movetype= A
physics = N
juggle  = 0; 4
poweradd=0
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
[State 1050, 1]
type = PlaySnd
trigger1 = Time = 0
value = 300,1
channel=2

 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1010)=1 && time=0
v = 21   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1  &&prevstateno=[200,1100]
v = 21   ;v = 570
value = 0
ignorehitpause =1

[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2 || numexplod(1010)>1
trigger1 = p2movetype=A && var(2)!=3
v =21   ;v = 570
value = 1
[State 0, Width]
type = Width
trigger1 = 1
edge = 30,0
;value = 0,0
;ignorehitpause = 
;persistent = 






;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1=animelem=1
trigger2=animelemtime(2)>=0 && animelemtime(4)<0 && time%3=0 && fvar(4)=0 && var(2)=1
trigger3=animelemtime(2)>=0 && animelemtime(5)<0 && time%3=0 && fvar(4)=0 && var(2)=2
trigger4=animelemtime(2)>=0 && animelemtime(6)<0 && time%3=0 && fvar(4)=0 && var(2)=3
anim = 8300
ID = 8306
pos = -24,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1=animelemtime(5)>=0 && animelemtime(7)<0 && time%3=0 && fvar(4)=0 && var(2)=2
anim = 8300
ID = 8306
pos = 10,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0



;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
trigger1 = p2bodydist x<140 && p2statetype!=S|| var(31)>0||var(2)=0|| numhelper(3011)>=0 
trigger2 =  ( var(31)>0) ||var(2)=0 && time=1
v = 2   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0 && fvar(4)=0
triggerall = numhelper(3011)=0
triggerall =  var(31)=0
trigger1 = (p2statetype=S||p2stateno=5120|| p2stateno=[5200,5210]) && p2bodydist x >120||var(2)=0
v = 2   
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
triggerall = numhelper(3011)=0
triggerall =  var(31)=0&& fvar(4)=0
triggerall = power>=250
trigger1 = p2statetype!=L&&p2movetype=H && p2stateno!=[120,155]
v = 2   
value =3

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
trigger1 = helper(10002),var(2)!=0
v = 2   
value =helper(10002),var(2)
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  
value = ifelse(command = "DP_y",1,ifelse(command="DP_a",3,2))

;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && var(2)>1
value = 1049+var(2)
[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(2)=3 && time=0
value = -250
[State 0, Helper]
type = Helper
trigger1 = animelem=1 && anim=1052
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 0, PosAdd]
type = PosAdd
triggerall = fvar(4)>0
trigger1 = animelemtime(1)=8 
x = 45 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1


;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=5 && anim=1051
x = 8
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = p2bodydist x < 65 && var(2)=2 && animelemtime(2)<0 && time >8 && fvar(4)=0
trigger2 = p2bodydist x < 45 && var(2)>2 && animelemtime(2)<0 && time >8 && fvar(4)=0
trigger3=fvar(4)>0 && time=8&& var(2)>=2 
value = anim
elem = 2
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 =  animelem=2 && fvar(4)>0 
x = 45
;ignorehitpause = 
;persistent = 

[State 0, Turn]
type = Turn
trigger1 = animelem=2 && p2bodydist x <-25 && fvar(4)>0 && var(2)=1
trigger2 = animelem=3 && p2bodydist x <-10 && fvar(4)>0 && var(2)=2
trigger3 = animelem=2 && p2bodydist x <-18 && fvar(4)>0 && var(2)=3
[State 0, VelSet]
type = VelSet
trigger1 = animelem=1
trigger2=animelem=2 && fvar(4)>0
x = 6.5
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1 
x = 13
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2&& anim!=1052
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3&& anim!=1052
x = 12
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4&& anim=1051
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4&& anim=1050
x = 14

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7&& anim=1050
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2 && anim=1052
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3 && anim=1052
x = -8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4 && anim=1052
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5 && anim=1052
x = 20
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6 && anim=1052
x = -20
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7 && anim=1052
x = -21
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8 && anim=1052
x = -13
[State 0, VelMul]
type = VelMul
trigger1 = animelem=3 && anim!=1052
trigger2 = animelem=2 && anim=1052
trigger3 = animelem=7 && anim=1051
x = .35
[State 0, VelSet]
type = VelSet
trigger1 = animelem=6&& anim=1050
trigger2 = animelem=8&& anim=1051
trigger3 = animelem=7&& anim=1052
x = 0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7 && anim!=1051
trigger2 = animelem=8&& anim=1051
movetype = I        ;I,A,H
physics = S
;ignorehitpause = 
;persistent = 

[State 0, HitBy]
type = HitBy
triggerall = var(2)=2 && fvar(4)=0
trigger1 = animelemtime(4)>=0 && animelemtime(9)<0 
value = SA,NP,SP,HP
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 

[State 0, AssertSpecial]
type = AssertSpecial
triggerall=fvar(4)>0
trigger1 = animelemtime(1)>=6&& animelemtime(2)<0
flag = invisible
[State 0, PlayerPush]
type = PlayerPush
trigger1 = fvar(4)>0 && animelemtime(1)>0 && animelemtime(2)<0
value = 0
;ignorehitpause = 
;persistent = 
[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelem=1 &&  fvar(4)>0
value = S3, 4
channel=2
[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelem=1 &&  anim=1050
value = 200, 9
channel=0
[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelem=1 &&  anim=1051
value = 200, 11
channel=0
[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelem=1 &&  anim=1052
value = 200, 11
channel=0


[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(1)=1
trans = addalpha;, sub
alpha = 175,250

[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(1)=2
trans = addalpha;, sub
alpha = 125,250
[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(1)=3
trans = addalpha;, sub
alpha = 100,250
[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(1)=4
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(1)=5
trans = addalpha;, sub
alpha = 45,250
[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(1)=6
trans = addalpha;, sub
alpha = 10,250


[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(2)=0
trans = addalpha;, sub
alpha = 10,250
[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(2)=1
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
triggerall=fvar(4)>0
trigger1 = animelemtime(2)=2
trans = addalpha;, sub
alpha = 150,250
[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelem=1 && fvar(4)>0
value = SCA
;value2 = S,NA
time = cond(var(2)=1,12,cond(var(2)=2,17,19))


[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = var(2)=1 && !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 55, 10
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = ifelse(var(21)=1,4,8),8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=20,10
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 24
guard.ctrltime=20
down.hittime=20
ground.velocity = 0
air.velocity = 1.5,-5
guard.velocity=-5
snap=55,0
forcenofall=1
air.hittime=22
fall.recovertime=17
forcenofall=1
yaccel=.47
id=207
envshake.time =8
envshake.ampl = 7
envshake.freq=85
[State 0, TargetState]
type = TargetState
trigger1 = movehit=1 && (p2stateno!=1101)
value =1101
ID =207
ignorehitpause =1
[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = var(2)=2 && !movecontact
attr = C, SA
air.animtype= up
animtype  = Hard
damage    = 65, 5
priority  = 5
hitflag=MAF
guardflag = LA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=30,15
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = 1,-10
air.velocity = 1,-10
guard.velocity=-5
fall=1
air.hittime=ifelse(var(21)=2,55,ifelse(var(21)=1,99,30))
fall.recovertime=ifelse(var(21)=2,55,ifelse(var(21)=1,99,30))
yaccel=.47
id=999

[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = var(2)=3 && !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ceil(55), 5
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=0,0
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -8,-6
air.velocity = -8,-6
guard.velocity=-5
fall=1
p2facing=1
air.hittime=ifelse(var(21)=1,99,28)
fall.recovertime=ifelse(var(21)=1,99,28)
yaccel=.47
id=215
[State 0, VarSet]
type = VarSet
trigger1 = var(2)=3 && movehit
v = 19    
value = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 



[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[3003,3005])
value =3003
ID =1100
ignorehitpause =0
[State 1200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl=1

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1051]
type    = A
movetype= H
physics = N
[State 0, Turn]
type = Turn
trigger1 = facing=enemy,facing&time=0
;ignorehitpause =
;persistent =
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 854

[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0
x = 1
y = 1
;ignorehitpause = 
;persistent =

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=20
value = 302
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1052]
type    = L
movetype= H
physics = N

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

[State 0, VelSet]
type = VelSet
trigger1 =1
y = 0
[State 0, PosSet]
type = PosSet
trigger1 =1
y = 0

[State 0, VelMul]
type = VelMul
trigger1 =1
x = .95
[State 0, VelSet]
type = VelSet
trigger1 =time>27
x = 0




[State 0, ChangeState]
type = selfState
trigger1 = time>48
value = ifelse(!alive, 5110,5120)
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1053]
type    = A
movetype= H
physics = N

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 1056
;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = selfState
trigger1 = p2stateno!=1050
value = 5050

;---------------------------------------------------------------------------
[Statedef 1060]
type    = A
movetype= A
physics = N
juggle  = 0; ifelse(prevstateno = 102,0,4)
poweradd= 120
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2

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

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = S3, 1
volume = 255

[State 1050, 5]
type = ChangeState
trigger1 = time = 4
value = 1061

;------------------
; Light Kung Fu Knee - jump

[Statedef 1061]
type    = A
movetype= A
physics = N
velset = 1,-9
anim = 1051

[State 0, Explod]
type = Explod
trigger1 = time =0
anim =1052
ID =1052
pos = -1,1
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 0

[State 1060, 4]
type = HitDef
trigger1 = animelem = 2
attr = A, SA
animtype  = Medium
damage    = 60, 4
priority  = 5
guardflag = MA
sparkno = S7005+(random%4)
guard.sparkno = S7014
pausetime = 12,12
sparkxy = -20,-70
hitsound   = S2,5
guardsound = S2, 7
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3,-7.5
guard.velocity = -7
air.velocity = -3,-7.5
fall = 1
fall.recover = 0



[State 1051, 1]
type = VelAdd
trigger1 = 1
y = .45

[State 1051, 3]
type = ChangeState
trigger1 = time = 14
value = 57
ctrl=0
;---------------------------------------------------------------------------
[Statedef 1063]
type    = A
movetype= A
physics = N
juggle  = 0; ifelse(prevstateno = 102,0,4)
poweradd= 120
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2

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

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = S3, 2
volume = 255

[State 3050, Super C]
type = AfterImageTime
triggerall = var(6)= 1
trigger1 = AnimElemTime(1) >= 0
time = 2

[State 1050, 5]
type = ChangeState
trigger1 =time = 4
value = 1064

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

[Statedef 1064]
type    = A
movetype= A
physics = N
velset = 1,-9
anim = 1051

[State 3050, Super C]
type = AfterImageTime
triggerall = var(6)= 1
trigger1 = AnimElemTime(1) >= 0
time = 2


[State 0, Explod]
type = Explod
trigger1 = time =0
anim =1052
ID =1052
pos = -0,1
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 0

[State 1060, 4]
type = HitDef
trigger1 = animelem = 2
attr = A, SA
animtype  = Medium
damage    = 30, 4
priority  = 5
guardflag = MA
pausetime = 6,6
sparkxy = -20,-70
sparkno = S7005+(random%4)
guard.sparkno = S7014
hitsound   = S2,4
guardsound = S2, 7
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -1.5,-7.5
guard.velocity = -7
air.velocity =-1.5,-7.5
fall = 1
fall.recover = 0

[State 1060, 4]
type = HitDef
trigger1 = animelem = 3
attr = A, SA
animtype  = Medium
damage    = 30, 4
priority  = 5
guardflag = MA
sparkno = S7005+(random%4)
guard.sparkno = S7014
pausetime = 6,6
sparkxy = -30,-70
hitsound   = S2,5
guardsound = S2,7
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3.5,-7.5
guard.velocity = -7
air.velocity = -3.5,-7.5
fall = 1
fall.recover = 0

[State 1051, 1] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1051, 3] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = time = 14
value = 57
ctrl=0




;---------------------------------------------------------------------------
[Statedef 1100]
type    = S
movetype= A
physics = N
juggle  = 0; ifelse(prevstateno = 102,0,5)
poweradd=0
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = ifelse(Var(21)=2,1,2)
persistent=0
ignorehitpause=1

;ignorehitpause = 
;persistent = 

 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1010)=1 && time=0
v = 21   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1  &&prevstateno=[200,1100]
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A && var(2)=3
v =21   ;v = 570
value = 2
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2 || numexplod(1010)>1
trigger1 = p2movetype=A && var(2)!=3
v =21   ;v = 570
value = 1
[State 0, Explod]
type = Explod
trigger1 =movehit=1 && var(2)=2&&animelemtime(10)>=0 
anim =10000
ID = 1101
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1 =var(21)=2 && movehit=1 
anim =10000
ID = 1100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1=animelem=2
trigger2=animelemtime(3)>=0 && animelemtime(5)<0  && var(2)=1 && time%3=0
trigger3=animelemtime(3)>=0 && animelemtime(4)<5  && var(2)=2 && time%2=0
anim = 8300
ID = 8300
pos = -5,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 1010, 1]
type = PlaySnd
trigger1 = animelem=3
value = 0, 2
channel=1
;[State 1000, 1]
;type = PlaySnd
;trigger1 = time=0
;value = 200,9
;channel=0
[State 0, Explod]
type = Explod
trigger1=animelem=3 && !numexplod(1102)&& !numexplod(1103)
anim = 1103
ID = 1102
pos = 60,-59
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .35,.35
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1=animelem=3 && !numexplod(1103)
anim = 1104
ID = 1103
pos = 70,-60
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1


;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1





;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = p2bodydist x<110 || var(31)>0||var(2)=0
trigger1 =  ( var(31)>0||p2movetype!=I) ||var(2)=0 && time=1
trigger2=  helper(10003),var(21)=1
v = 2   
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&&!helper(10003),var(21)
triggerall=time=0
triggerall =  var(31)=0
trigger1 = p2bodydist x >110||var(2)=0
v = 2   
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  
value = ifelse(command = "HCB_a",3,ifelse(command = "HCB_y",1,2))
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && var(2)>1
value = 1099+var(2)
[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(2)=3 && time=0
value = -250
;ignorehitpause = 
;persistent = 
;[State 0, VarSet]
;type = VarSet
;trigger1 = var(2)=3 && power <250 && time=1
;v = 2    
;value = 2

[State 0, Helper]
type = Helper
trigger1 = animelem=1 && anim=1102
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=5 && time < 18 && var(2)=1
trigger2 = animelem=5 && time < 30 && var(2)=2
trigger3 = animelem=5 && time < 22 && var(2)=3
value = anim
elem=3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && animelemtime(7)<0
value = anim
elem=7
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=7 
trigger2 = animelem=5
id = 1103
[State 0, VelSet]
type = VelSet
trigger1 = animelem=2
x = 7*(ifelse(fvar(6)>1,1.45,ifelse(fvar(6)=1,1,.75)))
;ignorehitpause = 
;persistent = 
[State 0, HitBy]
type = HitBy
trigger1 = var(2)=2&& time=0
value = SCA,NA,SA,HA,NT,ST,HT
;value2 = S,NA
time = 20
[State 0, Explod]
type = Explod
trigger1=animelem=10
anim = 1105
ID = 1104
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2 
x = 31
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3
x = -8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5
x = -23
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = 8

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x = 7
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10 && anim!=1102
x = -7
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10 && anim=1102
x = 14
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=12 && anim=1102
x = -21
[State 0, VelMul]
type = VelMul
trigger1 = animelem=5
x = .35
[State 0, VelSet]
type = VelSet
trigger1 = animelem=7
x = 0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
movetype = I        ;I,A,H
physics = S
;ignorehitpause = 
;persistent = 


[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ceil(ifelse(var(2)=1,25,45)*fvar(6)), 10
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=ifelse(var(2)=3,0,10),ifelse(var(2)=3,0,5)
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 30
guard.ctrltime=15
down.hittime=20
ground.velocity = 4
air.velocity = 1.5,-5
guard.velocity=-5
snap=65,0
forcenofall=1
air.hittime=17
fall.recovertime=17
forcenofall=1
yaccel=.47
id=207
[State 0, TargetState]
type = TargetState
trigger1 = movehit=1 && (p2stateno!=1101) && animelemtime(7)<0
value =1101
ID =207
ignorehitpause =1
[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = animelem=10 && var(2)=1
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ceil(40*fvar(6)), 5
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=10,5
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -5,-7
air.velocity = -5.5,-7
guard.velocity=-5
fall=1
air.hittime=ifelse(var(21)=1,99,28)
fall.recovertime=ifelse(var(21)=1,99,28)
yaccel=.47
id=ifelse(fvar(6)<=1,200,999)
[State 0, VarSet]
type = VarSet
trigger1 = fvar(6)>1 && anim=1100 && movehit
v = 11    
value = 1
;ignorehitpause = 
;persistent = 
[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = animelem=10 && var(2)=2 
attr = S, SA
air.animtype= up
animtype  = Hard
damage    =ceil(60*fvar(6)), 5
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = 4,4
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=10,5
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -8,-6
air.velocity = -8,-6
guard.velocity=-5
fall=1
air.hittime=ifelse(var(21)=1,99,20)
fall.recovertime=ifelse(var(21)=1,99,20)
yaccel=.47
id=ifelse(numexplod(1101)>=1,200,ifelse(fvar(6)<1&&fvar(5)<1,999,ifelse(fvar(6)<1 &&fvar(5)<=1,1100,20010)))
envshake.time =8
envshake.ampl = 7
envshake.freq=85

[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = animelem=10 && var(2)=3 
attr = S, SA
air.animtype= up
animtype  = Hard
damage    =ceil(65), 5
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = 4,4
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=0,0
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -2*fvar(6),-17
air.velocity = -2*fvar(6),-17
guard.velocity=-5
fall=1
air.hittime=ifelse(var(21)=1,99,67)
fall.recovertime=ifelse(var(21)=1,99,67)
yaccel=.54
id=ifelse(fvar(6)<=1,200,999)
envshake.time =8
envshake.ampl = 7
envshake.freq=85

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[3003,3005])
value =3003
ID =1100
ignorehitpause =0
[State 1200, 3]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = Animelem=7 && !movehit
value = 0
ctrl=1

;---------------------------------------------------------------------------
[Statedef 1101]
type    = S
movetype= H
physics = S
juggle  = 0; ifelse(prevstateno = 102,0,5)
poweradd=25
ctrl = 0
sprpriority = 2

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
[State 0, VelSet]
type = VelSet
trigger1 = 1
y = 0
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0
x = 1
;ignorehitpause = 
;persistent =

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = time=0
value = 5012

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = animelemtime(2)>0 && anim=5012
value = 5012
elem = 2
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = HitshakeOver  && (gethitvar(hittime)<8) && anim=5012
value = 5016

[State 1200, 3]
type = selfState
trigger1 = !alive
value = 5050
;persistent = 

[State 1200, 3]
type = selfState
trigger1 = hitover && anim=5016
value = 0
ctrl=1
;------------------
; Standing pinned
[Statedef 2000]
type    = U
movetype= H
physics = S
velset=0,0
facep2=1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = statetype=L
statetype = C      ;S,A,C,L
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11) && pos y <0
y = -const(size.mid.pos.y)-10
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = statetype!=A && pos y <0
trigger2= enemy,var(29) && enemy,pos y <0
statetype = A 
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemynear,var(18)=[-70,0]
value = 321
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =  enemynear,var(18)=[-99,-71]
value = 320
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =  enemynear,var(18)=[-125,-100]
value = 322
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =  enemynear,var(18)<=-126
value = 323
[State 0, PlayerPush]
type = PlayerPush
trigger1 = vel y !=0
value = 0
;ignorehitpause = 
;persistent = 

[State 0, PalFXWiz]
type = PalFX
trigger1 =1 
time = 1
add = 0,-200,0
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0
ignorehitpause =1 
;persistent = 

;ignorehitpause = 
;persistent = 

;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = pos y >0
y = 0
;ignorehitpause = 
;persistent = 

 [State 0, VelSet]
type = VelSet
trigger1 = vel x =0
x = 0
y = 0
;ignorehitpause = 
;persistent = 

[State 0: VelSet]
type = VelSet
trigger1 = enemy,var(29)
x = (p2bodydist x * 13) / (Exp(0.5*ln((p2bodydist x* p2bodydist x) + (-50* -50))))
y = ((p2bodydist y -50)* 13) / (Exp(0.5*ln((p2bodydist x * p2bodydist x) + (-50 * -50))))
;[State 0, ChangeState]
;type = ChangeState
;trigger1 = backedgebodydist <15  && enemy,numhelper(1002)=0 && enemy,numhelper(1003)=0 && !enemy,var(29)
;value =20013
;ctrl = 0
;anim =
;ignorehitpause = 
;persistent = 

[State 1025, State]
type = selfstate
triggerall = p2stateno!=3000
trigger1 =enemy,numhelper(1002)=0 && enemy,numhelper(1003)=0&& hitover
trigger2 = enemy,var(29) && hitover
value = ifelse(statetype=A ,ifelse(alive,5200,5050),0)
ctrl= statetype!=A

;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
; CNS difficulty: medium
; Notes: Notice that the HitDefs in supers have "getpower = 0". This makes
;        sure KFM doesn't recharge his super guage as he hits.
;        Also, the attributes for the HitDefs is "HA" for "hyper attack",
;        ie. "attr = S, HA".
;        Notice how the first HitDef is reused twice by allowing it to
;        trigger on two animation elements.
[Statedef 3000]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3000
sprpriority = 2

;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1 && p2movetype=H
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1 && p2movetype=H
v = 19   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

[State 0, HitBy]
type =HitBy
trigger1 =time=0
value = SCA,AA
;value2 = S,NA
time = 3


[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1
time = 2

;[State 200, 1]
;type = PlaySnd
;trigger1 = animelem=1
;value = 200, 17
;channel=0


;ignorehitpause = 
;persistent = 


;-------------------------------------------------
 
;persistent =
[State 0, SuperPause]
type = SuperPause
trigger1 = time=2
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = -350
unhittable = 1
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=2
value = S200,11
channel = 0
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=2
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,ifelse(GameHeight=180,.75,1)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=2
anim = 8002
ID =8002
pos = 9,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 3000, Super B]
type = AfterImage
trigger1 = time = 0
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1
time = 2

[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = animelem=23
attr = S, SA
air.animtype= up
animtype  = Hard
damage    =80, 10
priority  = 5
hitflag=MAF
guardflag = MA
pausetime = 4,4
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=0,0
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 30
guard.ctrltime=15
down.hittime=20
ground.velocity = -5,-9.5
air.velocity = -5,-9.5
down.velocity= -5,-9.5
guard.velocity=-5
snap=45,-15
fall=1
air.hittime=25
fall.recovertime=25
yaccel=.47
id=203

[State 0, Pause]
type = Pause
trigger1 = anim=3001
trigger1=animelemtime(4)<2
time = 2
movetime =2
pausebg = 1

[State 0, VelSet]
type = VelSet
trigger1=animelem=18
x = 6.5

[State 0, PosAdd]
type = Posadd
trigger1 = animelemtime(18)=7 && command!="holda"
x = p2bodydist x -40
[State 0, PosAdd]
type = Posset
trigger1 = animelemtime(18)=7 && command="holda"
x = p2bodydist x +55
[State 0, Turn]
type = Turn
trigger1 = animelemtime(18)=7&& command="holda"

;ignorehitpause = 
;persistent = 



[State 0, VelSet]
type = VelSet
trigger1=animelem=23
x = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = numtarget(203) && animelemtime(25)>0 && anim=3000 && movehit
value = 3001
;elem = 1
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=2 && anim=3001
value = S200,15
channel = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time=0
physics =N
;ignorehitpause = 
;persistent = 

[State 0, AssertSpecial]
type = AssertSpecial
triggerall=anim=3000
trigger1 = animelemtime(18)>=6&& animelemtime(19)<0
flag = invisible
[State 0, PlayerPush]
type = PlayerPush
trigger1 =animelemtime(18)>0 && animelemtime(19)<0
value = 0
;ignorehitpause = 
;persistent = 

[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelem=18
value = 3, 4
channel=0
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(18)=1
trans = addalpha;, sub
alpha = 175,250

[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(18)=2
trans = addalpha;, sub
alpha = 125,250
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(18)=3
trans = addalpha;, sub
alpha = 100,250
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(18)=4
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(18)=5
trans = addalpha;, sub
alpha = 45,250
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(18)=6
trans = addalpha;, sub
alpha = 10,250


[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(19)=0
trans = addalpha;, sub
alpha = 10,250
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(19)=1
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
triggerall=anim=3000
trigger1 = animelemtime(19)=2
trans = addalpha;, sub
alpha = 150,250
[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelem=18
value = SCA
;value2 = S,NA
time = 17


[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3001
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120

[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3002
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
supermovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3003
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3004
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3005
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3006
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3007
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3008
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3009
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3010
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3011
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, Helper]
type = Helper
triggerall = anim=3001
trigger1 = animelem  = 2
helpertype = normal ;player
name ="Reppuken"
ID = 3012
stateno = 30001
pos = 0,enemy,const(size.mid.pos.y)
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=120
[State 0, EnvShake]
type = EnvShake
triggerall = anim=3001
trigger1 = animelem  = 4
time = 8
freq = 80
ampl = 4
phase = 120
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=3001
trigger1 = animelem  = 4
value = S3,5
[State 1010, 8]
type = ChangeState
trigger1 =animtime=0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
; CNS difficulty: medium
; Notes: Notice that the HitDefs in supers have "getpower = 0". This makes
;        sure KFM doesn't recharge his super guage as he hits.
;        Also, the attributes for the HitDefs is "HA" for "hyper attack",
;        ie. "attr = S, HA".
;        Notice how the first HitDef is reused twice by allowing it to
;        trigger on two animation elements.
[Statedef 3010]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3010
sprpriority = 2

;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1 && p2movetype=H
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1 && p2movetype=H
v = 19   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

[State 0, HitBy]
type =HitBy
trigger1 =time=0
value = SCA,AA
;value2 = S,NA
time = 3


[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1
time = 2

[State 200, 1]
type = PlaySnd
trigger1 = time=2
value = 180, 5
channel=0


;ignorehitpause = 
;persistent = 


;-------------------------------------------------
 
;persistent =
[State 0, SuperPause]
type = SuperPause
trigger1 = time=2
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = -0
unhittable = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = time=2
v = 36    
value = power
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S200,11
channel = 0
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=2
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,ifelse(GameHeight=180,.75,1)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=2
anim = 8002
ID =8002
pos = 9,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 3000, Super B]
type = AfterImage
trigger1 = time = 0
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1
time = 2


[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =12
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = -9
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = 20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=11
x = -10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=12
x = -8
[State 0, Helper]
type = Helper
Trigger1 = animelem=10
helpertype = normal ;player
name ="Reppuken"
ID = 3010
stateno = 3001
pos = 27,-70
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1.2
size.yscale=1.2
supermovetime=60

[State 1010, 8]
type = ChangeState
trigger1 =animtime=0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.
[Statedef 3003]
type    = A
movetype= H
physics = N
poweradd = 0

[State 0, HitVelSet]
type = HitVelSet
triggerall = p2stateno!=3000
trigger1 = time=0
x = 1
y = 1

[State 0, TargetVelSet]
type = VelSet
triggerall = p2stateno=3000
trigger1 =time=0
x = -4
y = -5

;ignorehitpause = 
;persistent =
[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y =gethitvar(yaccel)






[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0 && (name="Ryuko 4rd"||name="ZeroRyuko" ||name="RYUKO2nd" )
value =3005
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0 && name!="Ryuko 4rd"&&name!="ZeroRyuko" 
value =3006
[State 821, 4] ;Hit ground
type = changeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -10
value = 3004 ;Hit ground
;---------------------------------------------------------------------------
[Statedef 3004]
type    = A
movetype= H
physics = N
poweradd = 0
velset=0,0
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&!selfanimexist(5121) && !selfanimexist(5122)
value = 3004
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&(selfanimexist(5121) || selfanimexist(5122))
value = 3003

[State 0, PosSet]
type = PosSet
trigger1 = animelem=1
y = 0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=2
x = -3
y = -8

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>0 
y = .5
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 821, 4] ;Hit ground
type = changeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -10
value = 3005 ;Hit ground
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 3005]
type    = L
movetype= H
physics = N

[State 0, VelSet]
type = VelSet
trigger1 =time=0
x = -4
;ignorehitpause =
;persistent =

[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0 && selfanimexist(5121)
value = 5101
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0 && !selfanimexist(5121)
value = 5100
[State 0, VelSet]
type = VelSet
trigger1 =1
y = 0
[State 0, PosSet]
type = PosSet
trigger1 =1
y = 0

[State 0, VelMul]
type = VelMul
trigger1 =1
x = .8
[State 0, VelSet]
type = VelSet
trigger1 =time>12
x = 0
[State 820, 1]
type = ChangeAnim
Trigger1 =  vel x =0&& selfanimexist(5121)
value = 5111
[State 820, 1]
type = ChangeAnim
Trigger1 = vel x =0&& !selfanimexist(5121)
value = 5110

[State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=0  
triggerall = alive
trigger1 = time > 15 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 15
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > 15
value =5201

[State 0, ChangeState]
type = selfState
trigger1 = time>47
value = ifelse(!alive, 5110,5120)

;---------------------------------------------------------------------------
[Statedef 3050]
type    = S
movetype= A
physics = N
juggle  = 0; 6
velset = 0,0
anim = 3050
ctrl = 0
sprpriority = 2







;[State 200, 1]
;type = PlaySnd
;trigger1 = animelem=1
;value = 200, 17
;channel=0


;ignorehitpause = 
;persistent = 


;-------------------------------------------------
 
;persistent =
[State 0, SuperPause]
type = SuperPause
trigger1 = time=0
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = -500
unhittable = 1
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S200,16
channel = 0
;abspan = 
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=0
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,ifelse(GameHeight=180,.75,1)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=2
anim = 8002
ID =8002
pos = 9,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = animelem=6
anim = 3051
ID =3051
pos =0,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
removetime=26
scale = .5,.5
sprpriority = 1
ontop =0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = animelem=6
anim = 3051
ID =3051
pos =0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
removetime=26
scale = .5,.5
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 3000, Super B]
type = AfterImage
trigger1 = time = 0
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
[State 0, VarAdd]
type = VarAdd
trigger1 = time%8=0
v = 10    ;fv = 
value = 1
;ignorehitpause = 
;persistent = 

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 1
time = 2
[State 0, Helper]
type = Helper
trigger1 = time=44
helpertype = normal ;player
name = "HUAAAAAAAAAAAAAARG"
ID = 4004
stateno = 4004
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 99
pausemovetime =99
[State 0, ChangeState]
type = changeState
trigger1 = animtime=0
value = 0
ctrl=1


;------------------
[Statedef 3051]
type    = A
movetype= A
physics = N
anim = 3051
velset=0,0
[State 0, Explod]
type = Explod
triggerall = time=0
triggerall = var(21)=1
triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 1200, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 0
[State 1050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 3, 1
volume = 255
[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2

;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1=animelem=3 
anim =320
ID = 8300
pos = -5,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1=animelem=1 
anim =3054
ID = 8302
pos = -0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 810, Bind 1]
type = TargetBind
triggerall = anim=3051
trigger1 = AnimElemtime(2)>=0 && animelemtime(3)<0
pos = -7,-67

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemtime(4)>=0 &&anim=3051
pos = -4,-70
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemtime(5)<0 &&anim=3052
pos = -4,-50
[State 810, Bind 1]
type = TargetBind
triggerall = anim=3051
trigger1 = AnimElemtime(1)>=0 && animelemtime(2)<0
pos =11,-67


[State 0, VelSet]
type = VelSet
trigger1 = animelem=3 && anim=3051
y = -8
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=4
value = S0,1
channel = 1
;lowpriority = -1
;abspan = 
;ignorehitpause = 
;persistent = 



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = screenpos y <-70 && anim=3051
value = 3052
[State 0, VelSet]
type = VelSet
trigger1 = animelem=1&& anim=3052
y = 13
[State 0, PosSet]
type = PosSet
trigger1 = animelem=1 && anim=3052
x = 0
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <0 && animelemtime(5)=0 && anim=3052
value = 3052
elem = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=0 && animelemtime(1)>=0 && animelemtime(5)<0 && anim=3052
value = 3052
elem =5

[State 0, Explod]
type = Explod
trigger1=animelem=1&& anim=3051
anim = 3058
ID = 8300
pos = -20,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=2
id = 8300
;ignorehitpause = 
;persistent = 

[State 0, SprPriority]
type = SprPriority
trigger1 = animelem=1
trigger2 = animelem=3&& anim=3051
trigger3 = animelem=4&& anim=3051
value = -4
[State 0, SprPriority]
type = SprPriority
trigger1 = animelem=5&& anim=3051
trigger2 = animelem=6&& anim=3051
trigger3 = animelem=2
value = 0
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(4)>=0 && anim=3051
trigger2=animelemtime(5)<0 && anim=3052 && pos y <-60
value = 1
movecamera = 0,0
[State 810, Bind 1]
type = TargetBind
triggerall = anim=3052
trigger1 = AnimElemtime(5)>=0 && animelemtime(6)<0
pos =-8,-16

[State 0, Explod]
type = Explod
trigger1=animelem=5&& anim=3052
anim = 3059
ID = 8300
pos = 28,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1=animelem=5&& anim=3052
anim = 3053
ID = 8301
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1=animelem=5&& anim=3052
anim = 3053
ID = 8301
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=6 
id = 8300
;ignorehitpause = 
;persistent = 

[State 0, PosSet]
type = PosSet
triggerall = anim=3052
trigger1 = animelem=5 
y = 0
[State 0, VelSet]
type = VelSet
triggerall = anim=3052
trigger1 = animelem=5 
x = 0
y = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=3052
trigger1 = animelem=5
value = S2,7
channel = 1
[State 0, TargetState]
type = TargetState
triggerall = anim=3052
trigger1 =animelem=5
value =3053
;ignorehitpause = 
;persistent = 
[State 0, TargetLifeAdd]
type = TargetLifeAdd
triggerall = anim=3052
trigger1 =animelem=5
value = -ceil((250+(ifelse(var(21)>0,50,0)))*ifelse(fvar(2)<=.5,.5,ifelse((enemy,gethitvar(hitcount)<2),1,.8)))
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6&& anim=3052
x = 2
y = -7.5
[State 0, Turn]
type = Turn
trigger1 = animelem=7&& anim=3052
;ignorehitpause = 
;persistent = 

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=5&& anim=3052
time = 15
freq = 60
ampl = 7
phase = 120
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(6)>0 && animelemtime(10)<0&& anim=3052
y = .47
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <-10 && animelemtime(10)=0 && anim=3052
value = 3052
elem =6

[State 0, PosSet]
type = PosSet
trigger1 = animelem=10&& anim=3052
y = 0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=10&& anim=3052
x = 0
y = 0
;ignorehitpause = 
;persistent = 

[State 1200, 3]
type = ChangeState
trigger1 = AnimTime = 0 && anim=3052
value = 0
ctrl=1

;------------------
; Light Kung Fu Knee - jump
[Statedef 3052]
type    = A
movetype=H
physics = N
sprpriority=-1

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value =3055
[State 820, 1]
type = ChangeAnim2
Trigger1 =enemy,anim=3052
value =3056
persistent=0
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = enemy,stateno!=3051
value = 5050
;------------------
; Light Kung Fu Knee - jump
[Statedef 3053]
type    = A
movetype=H
physics = N

[State 0, VelSet]
type = VelSet
trigger1 =animelem=2 
x = 2
y = -4
;ignorehitpause = 
;persistent = 

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value =3057
[State 820, 2]
type = SelfState
trigger1 = animelem=2
value = 5050
;---------------------------------------------------------------------------
[Statedef 3059]
type    = S
movetype= A
physics = S
juggle  = 0; 4
poweradd= 110
velset = 0,0
anim = 210
ctrl = 0
sprpriority = 0

[State 3050, Super A]
type = SuperPause
trigger1 = time = 0
pos = 0, -55
anim = S8000
sound = S100, 3
poweradd = -3000
time = 40
endcmdbuftime = 1
pausebg = 1


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

[State 0, VarSet]
type = VarSet
trigger1 = life < 300
v = 6    
value = 0


[State 0, VarSet]
type = VarSet
trigger1 = life >=300
v = 6    
value = 1



[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 1
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 160,20,20
palpostbright = 0,0,0

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 6

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, HT
hitflag = M-
animtype  = Medium
damage    = 0,90
guardflag = MA
pausetime = 12,12
getpower = 0
sparkno = S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10,-70
hitsound   = S2, 1
guardsound = S2, 7
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = 5.5
air.velocity = -2.5,-4
p1stateno = 3060

[State 1050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 3, 3
volume = 255

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = life < 300
flag = unguardable


[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =1
;-------------------------------------------------------------------
;---------------------------------------------------------------------------
[Statedef 3060]
type    = S
movetype= A
physics = S
juggle  = 0; 4
poweradd= 110
velset = 0,0
anim = 3060
ctrl = 0
sprpriority = 0

;-------------------------------------------------
[State 3000, Super A]
type = SuperPause
trigger1 = time = 1
pos = 0, -87
anim = -1
sound = S999, 0
poweradd = -1000
time = 45
movetime =45
unhittable =1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =1
flag = unguardable
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S200,25
channel = 0

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1 = time=0
anim = 8002
ID =8002
pos = 9,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State -2, Helper]
type = Helper
triggerall = !var(42)
trigger1 = time=0
triggerall = numhelper(3010)<1
helpertype = normal ;player
name = "CUT THAT SHIT OUT"
ID = 3010
stateno = 3100
pos = 160,ifelse(GameHeight=180,-70,-100)
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =9999
pausemovetime = 9999
size.yscale=ifelse(GameHeight=180,.7,1)
ignorehitpause = 1





[State 0, Helper]
type = Helper
trigger1 = animelem=2 && anim=3060
helpertype = normal ;player
name = "getem"
ID =30601
stateno =30601
pos = 25,-80
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
supermovetime=99
;[State 0, Helper]
;type = Helper
;trigger1 = time=0
;helpertype = normal ;player
;name = "streaks"
;ID =30012
;stateno =30011
;pos = 0,0
;postype = p1 ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause=1



;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

;scenes:
;
;1: got p2, shaking
;2: teleport and kick p2
;3: high speed attacks like roa but we're original lololo
;4: grab p2
;5: dissolve p2 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 && anim=3060
x = 20
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = p2stateno=3065 && anim=3060&& enemy,pos y<0
value = 3060
elem=6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7 && anim=3060
x = -20
[State 0, VarSet]
type = VarSet
trigger1 = p2stateno=3065 && enemy,pos y=0
v = 14   
value = 1
persistent =0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = p2stateno=3065 && enemy,pos y=0
value = S300,5
channel = 5
persistent=0
volumescale=90


[State 0, VarSet]
type = VarSet
trigger1 = var(14)>0
v = 28    
value = 1
[State 11009, dust]
type = Explod
trigger1 =var(14)=1 && !var(42)
anim = 4001
ID = 11009
postype =left
pos = 0,0
bindtime = -1
facing = 1
scale = .5,ifelse(GameHeight=180,.35,.5)
ownpal = 1
ignorehitpause =1
removetime=-1
ontop =0
sprpriority=-6
persistent=0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =var(14)=6 
id = 11009
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(14)=1 && anim=3060
value = 3061
;elem = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 




;========== scene 2
[State 0, VarSet]
type = VarSet
trigger1 =p2stateno=3065 && anim=3061&&var(14)=1
v = 14   
value = 2


[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(1)>=0&&animelemtime(1)<6&& anim=3061
trigger2= animelemtime(1)>=14&&animelemtime(1)<20&& anim=3061
x =4.5
[State 810, Grab Sound]
type = PlaySnd
trigger1 = animelem=1,2 
value = S3, 4
channel=2

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(2)>=0&&animelemtime(6)<0&& anim=3061
x =3.5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(6)>=0&&animelemtime(6)<5&& anim=3061
x =7.5

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(6)>=5&&animelemtime(7)<2&& anim=3061
x =2.5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=8&& anim=3061
value = S200,24
channel = 0

[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=8&& anim=3061
trigger2 = animelemtime(1)=14&& anim=3061
trigger3 = animelemtime(8)=43&& anim=3061
trans = addalpha;, sub
alpha = 10,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=7&& anim=3061
trigger2 = animelemtime(1)=15&& anim=3061
trigger3 = animelemtime(8)=42&& anim=3061
trans = addalpha;, sub
alpha = 75,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=6&& anim=3061
trigger2 = animelemtime(1)=16&& anim=3061
trigger3 = animelemtime(8)=41&& anim=3061
trans = addalpha;, sub
alpha = 115,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=5&& anim=3061
trigger2 = animelemtime(1)=17&& anim=3061
trigger3 = animelemtime(8)=40&& anim=3061
trans = addalpha;, sub
alpha = 150,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=4&& anim=3061
trigger2 = animelemtime(1)=18&& anim=3061
trigger3 = animelemtime(8)=39&& anim=3061
trans = addalpha;, sub
alpha = 180,255
[State 0, Trans]
type = Trans
trigger1 = animelemtime(1)=3&& anim=3061
trigger2 = animelemtime(1)=19&& anim=3061
trigger3 = animelemtime(8)=38&& anim=3061
trans = addalpha;, sub
alpha = 230,255
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(1)>=9 && animelemtime(1)<14&& anim=3061
trigger2 = animelemtime(8)=44&& anim=3061
flag = invisible

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(8)>=38&&animelemtime(9)<0&& anim=3061
x = 4.5

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(1)=13&& anim=3061
x = p2bodydist x -65
;ignorehitpause = 
;persistent = 
[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = animelem=6
attr = C, SA
air.animtype= up
animtype  = Hard
damage    = 0, 5
priority  = 5
hitflag=MAF
guardflag = LA
pausetime = 8,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 2
getpower=30,15
guardsound = S6, 0
ground.type = high
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = 1,-10
air.velocity = 1,-10
guard.velocity=-5
fall=1
air.hittime=ifelse(var(21)=2,55,ifelse(var(21)=1,99,30))
fall.recovertime=ifelse(var(21)=2,55,ifelse(var(21)=1,99,30))
yaccel=.47
id=3060

[State 0, TargetState]
type = TargetState
triggerall = NumTarget(3061)
trigger1 =movehit
value =3063
ID = 3060
persistent=0

[State 0, Pause]
type = Pause
trigger1 = movehit && animelemtime(9)<0 
trigger1 = time%3=0
time = 2
movetime = 2

;========scene 3
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(9)>=0&&var(14)=2
v = 14   
value = 3
[State 810, Grab Sound]
type = PlaySnd
trigger1 =  animelemtime(9)%4=0 && var(14)=3
value = S3, 4
channel=2

[State 0, Helper]
type = Helper
trigger1 = animelemtime(9)>=0&&animelemtime(9)<115&& var(14)=3
trigger1 = animelemtime(9)%4=0 && enemy,facing=-1
helpertype = normal ;player
name = "umm"
ID =6007
stateno =6007
pos = 0,-40
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8


[State 200, 1] ;201
type = HitDef
trigger1 = animelemtime(9)>=0&&animelemtime(9)<115
trigger1 = animelemtime(9)%4=0 && enemy,facing=-1
attr = S, HA
damage = 0
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 2, 4
sparkno = S7000+(random%4) 
guard.sparkno= S7510
sparkxy = -15+(random%35), -90-(random%40)
hitsound = -1;S2, 6
getpower = 0
guardsound = S6, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
air.hittime=99
ground.velocity=0,0
air.velocity=0,-2
air.type = High
air.animtype=up
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
kill = 0
fall=1
fall.recover=0
p2facing=-1*facing
id=3061
[State 200, 1] ;201
type = HitDef
trigger1 = animelemtime(9)>=0&&animelemtime(9)<115
trigger1 = animelemtime(9)%4=0&& enemy,facing=1
attr = S, HA
damage = 0
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 2, 4
sparkno = S7000+(random%4) 
guard.sparkno= S7510
sparkxy = -15+(random%35), -90-(random%60)
hitsound = -1
getpower = 0
guardsound = S6, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
guard.ctrltime =8
air.hittime=99
air.type = High
air.animtype=up
ground.velocity=0,0
air.velocity=0,4
yaccel=.5
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
fall.recover=0
kill = 0
p2facing=1*facing
id=3061
;======scene 4
[State 0, VarSet]
type = VarSet
trigger1 =anim=3061&& animelemtime(11)>=0&&var(14)=3
v = 14   
value = 4


;ignorehitpause = 
;persistent = 


[State 0, TargetState]
type = TargetState
triggerall = NumTarget(3061)
trigger1 =animelem=11&& anim=3061
value =3062
ID = 3061
[State 0, TargetFacing]
type = TargetFacing
trigger1 = animelem=11&& anim=3061
value = -1
ID = 3061
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = var(14)=4
fv = 10    
value = 1
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=11&& anim=3061
x = 0
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=11&& anim=3061
value = S200,27
channel = 0


[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(11)>=0  && animelemtime(12)<0  &&anim=3061 ;&& fvar(10)>0
id = 3061
pos = ceil(50*fvar(10)) ,ceil(-115*fvar(10)) 
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(12)>=0  && animelemtime(13)<0  &&anim=3061 ;&& fvar(10)>0
id = 3061
pos = ceil(37*fvar(10)) ,ceil(-100*fvar(10)) 

;======finale
[State 0, VarSet]
type = VarSet
trigger1 =p2stateno=3062&& anim=3061 && animelemtime(12)>=140&&var(14)=4
v = 14   
value = 5
persistent =0
[State 0, EnvShake]
type = EnvShake
trigger1 =  animelemtime(12)=200
time = 165
freq =126
ampl = 6
phase = 90
[State 0, EnvShake]
type = EnvShake
trigger1 =  animelemtime(12)=365
time = 20
freq =80
ampl = 5
phase = 120
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = animelemtime(12)>=200&&animelemtime(12)<365
trigger1 =  time%6=0
anim = 8301
ID = 8306
pos = -25,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -1.25,0
accel = 0,0
random = 0,0
scale = .25,.375
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = animelemtime(12)>=200&&animelemtime(12)<365
trigger1 =  time%6=0
anim = 8301
ID = 8306
pos = 35,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = -1.25,0
accel = 0,0
random = 0,0
scale = .25,.375
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1


[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30603
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8

[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30604
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30605
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30606
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30607
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30608
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=30
helpertype = normal ;player
name = "umm"
ID =30609
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8



[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=100
helpertype = normal ;player
name = "umm"
ID =30610
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8


[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=100
helpertype = normal ;player
name = "umm"
ID =30611
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8

[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=100
helpertype = normal ;player
name = "umm"
ID =30612
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=100
helpertype = normal ;player
name = "umm"
ID =30613
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=100
helpertype = normal ;player
name = "umm"
ID =30614
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=100
helpertype = normal ;player
name = "umm"
ID =30615
stateno =30603
pos = 0,32
postype = p2   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(12)=200
value = S3,6
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(12)=360
value = S3,5
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelemtime(12)=120
value = S200,28
channel = 0
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=200
helpertype = normal ;player
name = "umm"
ID =6004
stateno =6004
pos = 50,-52
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=200
helpertype = normal ;player
name = "umm"
ID =6004
stateno =6004
pos = 50,-52
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
size.xscale = .8
size.yscale=.8
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=365
helpertype = normal ;player
name = "streaks"
ID =6002
stateno =6005
pos = 50,-52
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 = animelemtime(12)=365
helpertype = normal ;player
name = "streaks"
ID =6003
stateno =6005
pos = 50,-52
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 =anim=3061 && animelemtime(12)>=368&&var(14)=5
v = 14   
value = 6


[State 11009, dust]
type = Explod
triggerall =!var(42)
trigger1 =var(14)=6
anim = 4002
ID = 11010
postype =left
pos = 0,0
bindtime = -1
facing = 1
scale = .5,ifelse(GameHeight=180,.35,.5)
ownpal = 1
ignorehitpause =1
ontop =0
sprpriority=-6
persistent=0




[State 0, ScreenBound]
type = ScreenBound
trigger1 = var(14)>0
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = var(14)=[1,5]
flag = nomusic
flag2= nobg
flag3=nofg
ignorehitpause=1




[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0 && anim=3061
value = 0
ctrl = 1

;----------------------------------------------------------------------
[Statedef 3061]
type = A
movetype=H
physics = N
poweradd = 60
[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0
x = 1
y = 1
;ignorehitpause = 
;persistent =
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 3063
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0


[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=0 && vel y >-1
value = 5050


;----------------------------------------------------------------------
[Statedef 3062]
type = A
movetype = H
physics = N
velset = 0,0
sprpriority = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0
;ignorehitpause =
;persistent =
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy,animelemtime(12)>365
flag = invisible

;[State 1002, 1]
;type = AfterImage
;trigger1 = enemy,animelemtime(12)=[280,365]
;time = 5
;framegap = 1
;length = 2
;PalAdd = 0, 0, 0
;PalMul = 1, 1, 1
;PalContrast = 255-((Time-355)*3), 255-((Time-355)*3), 255-((Time-355)*3)
;trans = Add

[State 0, Trans]
type = Trans
trigger1 = enemy,animelemtime(12)=[280,365]
trans = addalpha;, sub
alpha = 255-(enemy,animelemtime(12)-280)*3,255
[State 0, TargetState]
type = changeState
trigger1 =enemy,animelemtime(12)=365
value =3063
persistent = 0

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




;------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 3063]
type    = A
movetype= H
physics = N
velset = 0,0



[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 0
movecamera = 0,0
;ignorehitpause = 
;persistent = 
[State 0, LifeAdd]
type = LifeAdd
trigger1 =time =0
value = -99999
kill = 1
absolute = 0


;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = time =0
y = 2400
[State 0, SelfState]
type = SelfState
trigger1 =  time=0
value =5150

;------------------
[Statedef 2025]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1025

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 2026

;------------------
; Hit by Fast Kung Fu Palm - flying through the air
; (a custom gethit state)
[Statedef 2026]
type    = A
movetype= H
physics = N

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

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 2027

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;------------------
; Hit by Fast Kung Fu Palm - hit wall
; (a custom gethit state)
[Statedef 2027]
type    = A
movetype= H
physics = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027

[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,0

[State 1027, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 2028

;------------------
; Hit by Fast Kung Fu Palm - bounce off wall
; (a custom gethit state)
[Statedef 2028]
type    = A
movetype= H
physics = N

[State 1028, 1]
type = NotHitBy
trigger1 = 1
value = , NA, NP

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6

[State 1028, Vel X]
type = VelSet
trigger1 = Time = 0
x = 5

[State 1028, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100
;---------------------------------------------------------------------------
; Strong Kung Fu Upper
[Statedef 3071]
type    = S
movetype= A
physics = S
juggle  = 0; 0
poweradd= 0
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 0

[State 3000, Super A]
type = SuperPause
trigger1 = time = 0
pos = 1, -51
anim = S8000
sound = S100, 3
poweradd = -1000
time = 40
endcmdbuftime = 1
pausebg = 1



[State 3000, Super B]
type = AfterImage
trigger1 = AnimElem = 1
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0

[State 810, Width 2-11]
type = Width
triggerall = !winko
triggerall = movecontact
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(24) < 0
edge = 0,50
player = 0,50
value = 0,50

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(24) < 0
value = 0
ignorehitpause = 1

[State 810, Bind 2-4]
type = TargetBind
triggerall = movecontact
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(24) < 0
pos = 40, 0

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2


[State 1050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 3, 0
volume = 255

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, HA
damage = 20, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 4, 4
getpower = 0
sparkno = S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10, -76
hitsound = S2, 0
guardsound = S2, 7
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
kill = 0

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

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

[State 1050, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3, 1
volume = 255

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 6
attr = S, HA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 4, 4
getpower = 0
sparkno = S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10,-70
hitsound   = S2, 1
guardsound = S2, 7
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -5.5
air.velocity = -2.5,-4
kill = 0

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

[State 1050, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3, 2
volume = 255

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 10
attr = S, HA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 4, 4
sparkno = S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10,-70
hitsound   = S2, 1
guardsound =S2, 7
getpower = 0
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -5.5
air.velocity = -2.5,-4
kill = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 15
attr = S, HA
damage = 20, 0
animtype = Light
guardflag = MA
getpower = 0
hitflag = MAF
priority = 3, Hit
pausetime = 4, 4
sparkno =S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10, -76
hitsound = S2, 1
guardsound = S2, 7
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
kill = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 13
value = 0, 0
[State 1050, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3, 1
volume = 255
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 20
attr = S, HA
damage = 20, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
getpower = 0
pausetime = 10, 10
sparkno = S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10, -76
hitsound = S2, 2
guardsound = S2, 7
ground.type = low
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
kill = 0

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

[State 210, 1]
type = PlaySnd
trigger1 = animelem =21
value = 0, 1
[State 1050, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3, 0
volume = 255
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 24
attr = S, HA
animtype  = Medium
damage    = 70
guardflag = MA
getpower = 0
pausetime = 15, 15
sparkno = S7010+(random%4)
guard.sparkno = S7014
sparkxy = -10,-70
hitsound   = S2, 8
guardsound = S2, 7
ground.type = High
getpower = 0
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -7,-8
air.velocity = -7,-8
fall = 1
fall.recover = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(17) < 2
trigger1 = animelem = 17
value = 3000
elem = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = animelem = 1
v =17     ;fv =
value = 1
;ignorehitpause =
;persistent =



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

;---------------------------------------------------------------------------
[Statedef 4000]
type    = S
movetype= A
physics = S
juggle  = 0; 4
poweradd= 110
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 0

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

[State 1050, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3, 3
volume = 255

[State 3000, Super A]
type = SuperPause
trigger1 = time = 0
pos = 7, -47
anim = S8000
sound = S100, 3
poweradd = -1000
time = 40
endcmdbuftime = 1
pausebg = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 4
anim =1003
ID =1003
pos = -24,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .9,.8
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1



[State 0, Helper]
type = Helper
trigger1 = animelem  = 3
helpertype = normal ;player
name ="Reppuken"
ID = 1401
stateno = 1401
pos = 45,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1.2
size.yscale =1.2


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

;------------------
; Wall bounce
[Statedef 20010]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = ifelse(enemy,var(11)=1,1029,1025)

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value =20011

;------------------
; (a custom gethit state)
[Statedef 20011]
type    = A
movetype= H
physics = N

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

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -10
trigger1 = BackEdgeBodyDist < 75 || time >5
trigger2 = FrontEdgeBodyDist < 75|| time >5
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -10
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value =20012

;ignorehitpause = 
;persistent = 

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 15)
value = 5100

;------------------
; wall splat
[Statedef 20012]
type    = A
movetype= H
physics = N
velset=0,0

[State 0, PosAdd]
type = PosAdd
triggerall = pos y <-5
trigger1 = time=0 && anim=1028
y = -const(size.mid.pos.y)

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 90)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 10 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3
;[State 0, LifeAdd]
;type = LifeAdd
;trigger1 = animelem=2
;value = -15
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = 20
;ignorehitpause = 
;persistent = 

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 10250
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=2
time = 8
freq = 80
ampl = -4
phase = 90

[State 1027, State]
type = ChangeState
trigger1 = time >=25
value = 20013

;------------------
; (a custom gethit state)
[Statedef 20013]
type    = A
movetype= H
physics = N

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = 5




[State 1028, Vel X]
type = VelSet
trigger1 = Time = 0
x = 0


[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .41

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim2
trigger1 = Time = 0
value = 10251


[State 1028, Hit ground]
type =changestate
trigger1 = (Vel y > 0) && (Pos y >= 30)
value = 20014
;------------------
; (a custom gethit state)
[Statedef 20014]
type    = C
movetype= H
physics =C
velset=0,0


[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim2
trigger1 = Time = 0
value = 10252
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2
statetype = L       ;S,A,C,L
physics = C
;ignorehitpause = 
;persistent = 

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
;ignorehitpause = 
;persistent = 


[State 1028, Hit ground]
type = SelfState
trigger1 = animtime=0
value = 5110
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[statedef -2]
[State 0, VarSet]
type = VarSet
trigger1 = movetype!=A
v = 37    
value = 0
;ignorehitpause = 
;persistent = 
;at work less graphic intensive mode

;persistent = 


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2= nocrouchguard
flag3 = noairguard
ignorehitpause=1


;ignorehitpause = 
;persistent = 
[State 2, VarSet]
type = VarSet
trigger1 = stateno!=[1010,1100]
v = 2   
value = 0
[State 6, VarSet]
type = VarSet
trigger1 =statetype!=A 
trigger2= stateno=[5200,5210]
v = 6   
value = 0
[State 8, VarSet]
type = VarSet
trigger1 =statetype!=A 
trigger2= stateno=[5200,5210]
v = 8   
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 9   
value = enemy,lifemax/4
[State 10, VarSet]
type = VarSet
trigger1 =var(10)<0 
v = 10    
value = 0
ignorehitpause = 1
;persistent = 
[State 10, VarSet]
type = VarSet
trigger1 = roundstate!=2
v = 10    
value = 3
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H ||p2stateno=[202,203]
trigger2= p2stateno=1047
trigger3= p2stateno=1027
trigger4 = movehit && p2stateno=2000 
v = 11    
value = 0
ignorehitpause=1
[State 11, VarSet]
type = VarSet
trigger1 = p2stateno=[301,304]
v = 11    
value = 1

[State 18, VarSet];small
type = VarSet
trigger1 =1
v = 18
value =enemynear,const(size.head.pos.y)
[State 0, VarSet]
type = VarSet
trigger1 =var(21)>0 && movehit  && (stateno!=1005&&prevstateno!=[150,155])
v = 19   
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =var(21)=0 && movehit && (p2stateno=5080||p2stateno=[5000,5030]) && stateno!=[1005,1010]
trigger2= p2movetype!=H && stateno!=[1005,1010]
trigger3 = numexplod(1000)>2
trigger4 = numexplod(1010)>2
trigger5 = numexplod(1050)>2 && var(21)>0
trigger6 = numhelper(1002)>0 && var(21)=1
v = 19   
value = 0
ignorehitpause = 1

[State 113, VarSet]
type = VarSet
triggerall = numhelper(1002)=0
triggerall = var(21)!=2
triggerall = stateno!=1005
trigger1 = p2movetype=A 
v =21   ;v = 570
value = 1

[State 114, VarSet]
type = VarSet
trigger1 = p2movetype!=A&& movetype !=A && var(21)<2&& stateno!=1100; && (p2stateno!=[1025,1048])
trigger2= p2movetype!=H &&var(21)=2 && stateno!=1100
trigger3 = numhelper(1002)>0
v = 21   ;v = 570
value = 0
ignorehitpause=1
[State 22, VarSet]
type = VarSet
trigger1 = numhelper(1004)=0 
trigger1 = numhelper(1002)=0  
v = 22   
value = 0
ignorehitpause = 1 
[State 0, VarSet]
type = VarSet
trigger1 = p2stateno=2000
v =7   
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
trigger2 = p2stateno=[300,303]
v =7   
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
triggerall = stateno!=3051
trigger1 = var(21)>0 && movehit
v = 23   
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 23   
value = 0
[State 24, VarSet]
type = VarSet
triggerall = stateno!=1005
trigger1 = numhelper(1004)=0 
trigger1 = numhelper(1002)=0 
v = 24   
value = 0
ignorehitpause = 1 
[State 0, VarSet]
type = Varadd
triggerall = movehit=1
trigger1 = stateno=200
trigger2 = stateno=400
trigger3 = stateno=600
v = 25   
value = 2
ignorehitpause =0 

[State 0, VarSet]
type = Varadd
triggerall = movehit=1
trigger1 = stateno=410
v = 25   
value = 8
ignorehitpause =0 
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H || p2stateno=[5200,5210]
v = 25   
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =stateno!=[40,50] 
v = 26   
value = 0

[State 27, VarSet]
type = VarSet
trigger1 = movetype!=A
v = 27   
value = 0
[State 29, VarSet]
type = VarSet
trigger1 = numhelper(1002)=0 
v = 29  
value = 0
ignorehitpause = 1



;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = numhelper(1052)>0
trigger1 =  helper(1052),var(3)=2 &&helper(1052),movetype=A
anim =10000
ID = 10001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0

;ignorehitpause = 
;persistent =


[State 0, TargetState]
type = TargetState
trigger1 = movehit && anim=1002
value =1011
ID = 1010

;ignorehitpause = 
;persistent = 


[State 0, TargetState]
type = TargetState
triggerall = var(22)>0 
triggerall = p2stateno!=1051 && (p2stateno!=[1045,1048]) && p2stateno!=[302,303]
trigger1 =movehit
value = ifelse(var(22)>=2,1045,1051)
ID = 1001
ignorehitpause =1 
 
[State 0, TargetState]
type = TargetState
trigger1 =(var(22)>0 ||var(7)&& numhelper(1002)) && movehit && (p2stateno!=[201,203])
trigger2 = numhelper(1002)
trigger2 = var(7)
value =2000
ID =200
ignorehitpause =1
[State 0, TargetState]
type = TargetState
trigger1 =(var(22)>0 ||p2statetype= A) && movehit=1 && (p2stateno!=[201,203])
value =ifelse(var(22)>0,2000,201)
ID =200
ignorehitpause =1 
[State 0, TargetState]
type = TargetState
trigger1 =(var(22)>0 ||p2statetype= A) && movehit=1 && (p2stateno!=[1031,1034])
value =ifelse(var(22)>0||var(7)&&(numhelper(1002)||numhelper(1003)),2000,1034)
ID =440
ignorehitpause =ifelse(var(22)>0,1,0)
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[20010,20015]) 
value =20010
ID =20010
ignorehitpause=0

[State 0, TargetState]
type = TargetState
trigger1 =(var(22)>0 ||p2statetype!= A) && movehit=1 && (p2stateno!=1035)
value =ifelse(var(22)>0||var(7)&&(numhelper(1002)||numhelper(1003)),2000,1035)
ID =998
ignorehitpause =0
[State 0, TargetState]
type = TargetState
triggerall = (var(22)>0 ||p2statetype= A)
trigger1 = movehit && (p2stateno!=[1025,1055]) && p2stateno!=1033
value =ifelse(var(22)>0||var(7)&&(numhelper(1002)||numhelper(1003)),2000,1033)
ID =210
ignorehitpause=0
[State 0, TargetState]
type = TargetState
triggerall = (var(22)>0 ||p2statetype= A)
trigger1 = movehit && (p2stateno!=[1025,1055]) && (p2stateno!=[833,839]) && p2stateno!=1033
value =ifelse(var(22)>0||var(7)&&(numhelper(1002)||numhelper(1003)),2000,1036)
ID =211
ignorehitpause=1
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=1051) && (p2stateno!=[301,304]) && p2stateno!=1033
value =1051
ID =212
ignorehitpause=0
[State 0, TargetState]
type = TargetState
triggerall = (var(22)>0 ||p2statetype= A)
trigger1 = movehit &&(p2stateno!=[1025,1028]) 
value =ifelse(var(22)>0||var(7)&&(numhelper(1002)||numhelper(1003)),2000,1025)
ID =215
ignorehitpause=0
[State 0, TargetState]
type = TargetState
trigger1= (var(22)>0 ||p2statetype= A)&& movehit&& (p2stateno!=[301,303]) && p2stateno!=5201 && p2stateno!=[1025,1047]
value =ifelse(var(22)>0||var(7)&&(numhelper(1002)||numhelper(1003)),2000,301)
ID =999
ignorehitpause =1

;ignorehitpause = 
;persistent = 

[State 0, TargetState]
type = TargetState
triggerall=var(22)=0
trigger1 = movehit && (p2stateno!=[1045,1048])
value =1045
ID = 202
ignorehitpause =0




[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = var(28)=1
flag = nomusic


;ignorehitpause = 
;persistent = 


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(28)=1
flag = nobardisplay
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(28)=1
flag = nomusic
ignorehitpause=1

;[State 0, PosSet]
;type = PosSet
;triggerall = movetype !=H
;;triggerall = stateno = 102
;trigger1 =statetype =S || statetype = C
;y = 0



[State 0, VarSet]
type = VarSet
trigger1 = authorname= "Kamekaze" && p1name = "Belmont Trusdale"
v = 50    
value = 1
[State -2, Helper]
type = Helper
trigger1 = roundstate=2 && stateno!=3060 &&p2stateno!=[3060,3069]
triggerall = NumHelper(7000) < 1
helpertype = normal ;player
name = "shardcount"
ID = 7000
stateno = 7000
pos = 0,0
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 =numhelper(10003)=0
helpertype = normal ;player
name = "neutrality"
ID =  10003
stateno = 9999
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1

[State 0, Helper]
type = Helper
trigger1 =numhelper(10002)=0
helpertype = normal ;player
name = "SpAIder"
ID =  10002
stateno = 9998
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 =var(54)=0
v = 54   
value = palno
;ignorehitpause =
;persistent =
[State 0, 0] ;Change palette
type = RemapPal
trigger1 = numhelper(4001)>0
source = 1,1
dest = 1,var(54)
ignorehitpause=1
;persistent=1
[State 0, Pause]
type = Pause
trigger1 =numhelper(4001)>0
time = 2
movetime = 2

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1=p2stateno=1030 && enemy,time=1 && p2movetype=H
trigger2=p2stateno=1032 && enemy,time=1 && p2movetype=H
trigger3=p2stateno=1052&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=834&& enemy,time=1 && p2movetype=H
trigger5=p2stateno=303&& enemy,time=1 && p2movetype=H
trigger6=p2stateno=3004&& enemy,time=1 && p2movetype=H
anim = 8302
ID = 8302
pos = 0,5
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.7
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1=p2stateno=1030 && enemy,time=1 && p2movetype=H
trigger2=p2stateno=1032 && enemy,time=1 && p2movetype=H
trigger3=p2stateno=1052&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=834&& enemy,time=1 && p2movetype=H
trigger5=p2stateno=303&& enemy,time=1 && p2movetype=H
trigger6=p2stateno=3004&& enemy,time=1 && p2movetype=H
anim = 8303
ID = 8303
pos = -15,5
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.7
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
triggerall = !var(42)
trigger1=p2stateno=1030 && enemy,time=1 && p2movetype=H
trigger2=p2stateno=1032 && enemy,time=1 && p2movetype=H
trigger3=p2stateno=1052&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=834&& enemy,time=1 && p2movetype=H
trigger5=p2stateno=303&& enemy,time=1 && p2movetype=H
trigger6=p2stateno=3004&& enemy,time=1 && p2movetype=H
anim = 8303
ID = 8303
pos = 15,5
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.7
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =211
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !numhelper(10011) 
id = 307
;ignorehitpause = 
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !numhelper(10012) 
id = 308

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = stateno!=[1005,1007]
id = 321
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =610
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =400
ignorehitpause = 1


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1001
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1003
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1004
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1005
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1010
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1050
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1021
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1022
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1100
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
trigger2 =stateno!=1100&& (p2movetype!=H||p2statetype=L)
id =1101
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =stateno!=3051
id = 8300
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !numhelper(1052) && p2movetype!=H 
id =10001

;[State -2, 1]
;type = ChangeState
;triggerall = prevstateno=[120,155]
;triggerall = !alive
;triggerall = stateno !=171
;triggerall = pos y >=-12
;trigger1 = 1
;value = 171

;ignorehitpause = 
;persistent = 




[State 0, PlaySnd]
type = PlaySnd
trigger1 = p2stateno=834 && enemy,time=1
trigger2=p2stateno=302&& enemy,time=1 && p2movetype=H &&enemy,prevstateno=1051
trigger3=p2stateno=3005&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=1032&& enemy,time=1 && p2movetype=H
value = S2,5

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=303
trigger1 = enemy,time=1
value = S2,1
[State 0, VarRangeSet]
type = VarRangeSet
trigger1 =  p2movetype!=H
value = 0 ;fvalue = 0
first = 12
last = 14 ;39
;ignorehitpause = 
;persistent = 

[State 0, VarRangeSet]
type = VarRangeSet
trigger1 =  p2movetype!=H
value = 0 ;fvalue = 0
first = 40
last = 41

;ignorehitpause = 
;persistent = 
[State 0, EnvShake]
type = EnvShake
triggerall = enemy,time=1
trigger1 = p2stateno=3004&& p2movetype=H
time = 6
freq = 40
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1=(p2stateno=1030||p2stateno=834||p2stateno=20012||p2stateno=3004) && p2movetype=H
triggerall = enemy,time=1
value = S2,2
channel=2
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=1047 && p2movetype=H
trigger1 = enemy,time=1
value = S2,2
channel=2
[State -2, Helper]
type = Helper
;triggerall = !var(42)
trigger1 = winko && stateno = 3000
trigger2 = winko && stateno = [3050,3051]
triggerall = NumHelper(6000) < 1
helpertype = normal ;player
name = "winko"
ID = 6000
stateno = 6000
pos = 0,0
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermove =999
pausemove = 999
ignorehitpause = 1
persistent = 0

;-------buffer



;----------
;[State 0, VarSet]
;type = VarSet
;trigger1 = var(31)>0
;trigger2 = movetype=A
;v = 35    
;value = stateno
;ignorehitpause = 
;persistent = 

;[State 0, VarSet]
;type = VarSet
;trigger1 = var(31)=0
;v = 35   
;value = 0
;----AI reset grab time

[State 0, VarSet]
type = VarSet
trigger1 =p2stateno=5210 && enemy,time>6
v = 33    
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = p2statetype!=A
trigger2= stateno=[800,855] 
trigger3 = p2stateno=[1029,1031]
v = 33    
value = 0
;ignorehitpause = 
;persistent = 
;--------------------

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H || p2stateno=5210 || p2stateno=5201|| p2stateno=5110
trigger2 = stateno=[800,810]
trigger3 = var(31)=27 && statetype!=A
trigger4 = var(31)=164
trigger5 = (var(34)=211||var(34)=400||var(34)=405) && p2statetype=L
;trigger6 = var(31)=52
;trigger7 = var(31)=106
;trigger8 = var(31)=166
;trigger9 = var(31)=139
v = 31    
value = 0
ignorehitpause = 1



;ignorehitpause = 
;persistent = 
; Take more damage when mask off

;[State -2, DefenseMulSet]
;type = LifeAdd
;triggerall = Alive && MoveType = H &&  var(6)>0 ;&&!hitshakeover && time=1
;trigger1 = (FVar(8)-life)>0
;value = ifElse((FVar(8)-life)<life,-floor((FVar(8)-life)*fvar(3)),0)
;ignorehitpause=1
;persistent = 1
;ignorehitpause = 
;persistent = 
;[State 0, VarSet]
;type = VarSet
;trigger1 =1;hitshakeover
;fvar(8) = life
;ignorehitpause =1 
;persistent = 1


[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =1
text = "v34 = %d v30 = %f v31=%d \n v34 = %f v30 = %f v31=%d"
params = (numhelper(4001)),(fvar(21)),var(2),(var(7)),(p2bodydist x),(var(35))
ignorehitpause =1


;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]
[State 0, VarSet]
type = VarSet
trigger1 =1 
v = 42    
value = 0
ignorehitpause = 1

;ignorehitpause = 
;persistent = 

[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(13) && fvar(4)>0
value = 55
[State 0, VarSet]
type = VarSet
trigger1 = var(13)
v = 13    
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2name="Tristan Samroy" ||p2name="Ryuko 4rd" ||p2name="Edward Trusdale"  ||p2name="Richter Belmont FA" 
v = 41    
value = 1
;ignorehitpause = 
;persistent = 

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = !var(41)
value = random%5
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41) &&p2name="Edward Trusdale" 
value = 5
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41) && p2name="Tristan Samroy" 
value = 6
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41) && p2name="Ryuko 4rd"
value =7
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41) && p2name="Richter Belmont FA" 
value =8
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2 = nocrouchguard
flag3= noairguard



[State 0, VarSet]
type = VarSet
trigger1 = stateno!=[3061,3066]
fv = 21    
value = p2bodydist y -((const240p(const(size.mid.pos.y))+20)*var(11))
ignorehitpause =1 
;ignorehitpause = 
;persistent = 
;[State 0, AssertSpecial]
;type = AssertSpecial
;trigger1 = 1
;flag = noBG
;ignorehitpause=1



;[State 0, LifeAdd]
;type = LifeAdd
;trigger1 = numhelper(1002)
;trigger1 = helper(1002),var(30)
;value = 50+((fvar(4)>0)*35)
;ignorehitpause = 1
[State 0, VarRangeSet]
type = VarRangeSet
trigger1 = var(10)=0 && var(12)=0
fvalue = 1 ;fvalue = 0
first = 5
last = 6 ;39
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=[20012,20014]
trigger2 = numhelper(1002)
trigger2 = helper(1002),stateno=10003
value = 1
movecamera = 0,1
ignorehitpause =1

[State 0, VarSet]
type = Varadd
trigger1 = var(36)>0 && numhelper(3011)
v = 36    
value = -2

[State 0, VarSet]
type = VarSet
trigger1 = var(36)<0
v = 36   
value = 0
;ignorehitpause = 
;persistent = 



[State 0, PowerSet]
type = PowerSet
trigger1 = numhelper(3011)
value = var(36)
ignorehitpause =1 
persistent =1 

[State 0, VarSet]
type = VarSet
trigger1 =  !numhelper(10012)  && stateno!=[1001,1002]
v =12   
value = 0


[State 0, PlayerPush]
type = PlayerPush
triggerall = p2statetype!=A
triggerall = stateno!=[1035,1099]
trigger1 = statetype=A&&p2bodydist x =[-45,25] 
value = 0
ignorehitpause=0

[State 0, VarSet]
type = Varadd
trigger1 = movehit=1 && p2stateno!=[120,155]
v = 56   
value = 1
ignorehitpause = 0

[State 0, VarSet]
type = Varset
trigger1 = p2movetype!=H
v = 56   
value = 0
ignorehitpause =1
;[State 0, ParentVarSet]
;type = VarSet
;triggerall = numhelper(1002)>0
;trigger1 = helper(1002),movehit && (var(31)=0 ) && var(21)=1
;v = 31    ;fv = 
;value = 60
;ignorehitpause = 1
[State 0, ChangeState]
type = ChangeState
triggerall = power >=500 || (power>=350&& stateno=[1000,1006])
triggerall= stateno!=[3000,3051]
triggerall = AILevel=0 &&command="cancel" 
triggerall = stateno!=700
triggerall = var(2)!=3
triggerall = stateno!=[800,836]
trigger1 = movecontact
trigger2 = animelemtime(5)>0 && (stateno=1000||stateno=1001||stateno=1005)
trigger3 = animelemtime(4)<0 && stateno=1004
trigger4 = animelemtime(5)>0 && animelemtime(13)<0 && stateno=1002
trigger5= animelemtime(6)>2&&stateno=1006
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
[State 0, ChangeState]
type = ChangeState
triggerall = (stateno=[1000,1009])&&power >=350 || power>=500&&stateno!=[1000,1006]
triggerall= stateno!=[3000,3051]
triggerall = AILevel>0
triggerall = stateno!=700
triggerall = stateno!=[800,899]
trigger1= movehit && var(4)>16
triggerall = var(2)!=3
trigger2 = (animelemtime(5)=[1,4]) && (stateno=1001)  && (random<333&& p2movetype!=H||p2bodydist x <55 && p2movetype!=H) && p2statetype!=L
trigger3 = animelemtime(4)<0 && stateno=1004
trigger4 = animelemtime(5)=2 && stateno=1002
trigger5= animelemtime(6)>2&&stateno=1006
trigger6 = var(34)=4 && movecontact
trigger7 = var(34)=4 && numhelper(1001)>0
;trigger5= animelemtime(6)>2&&stateno=1006
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
;anim =

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(3)=1 && (stateno!=[800,899])&&stateno!=[3000,3099]
movetype = I        ;I,A,H

[State 0, VarSet]
type = VarSet
trigger1= var(4)>=ifelse(var(21)=2,22,17) 
v = 3    
value = 1
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
v =4    
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =fvar(4)<0
fv =4    
value = 0
;ignorehitpause =
;persistent =

[State 0, VarSet]
type = VarSet
trigger1 =var(4)=0
v =3   
value = 0

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
value = fvar(2)

[State 0, VarSet]
type = VarSet
triggerall = fvar(2)<.35
trigger1 =stateno=[3000,3050] 
fv = 2    
value = .35

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1= movehit=1
triggerall=stateno =200 || stateno=400 || stateno=600 
fv =2 
value = fvar(2)*.915
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1= movehit=1
triggerall=stateno =205 ||stateno=605|| stateno=405 
fv =2 
value = fvar(2)*.975
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=210||stateno=410||stateno=610
trigger1= movehit=1
fv =2 
value = fvar(2)*.98
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=211||stateno=212
trigger1= movehit=1
fv =2 
value = fvar(2)*.965
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=1010
trigger1= movehit=1
fv =2 
value = fvar(2)*.88
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=1050
trigger1= movehit=1
fv =2 
value = fvar(2)*.96
ignorehitpause=0


[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=700
trigger1= movehit=1
fv =2 
value = fvar(2)*.245
ignorehitpause=0

[State 0, VarSet]
type = parentVarSet
triggerall = numhelper(3011)>=1
triggerall = p2movetype = H&&(p2stateno!=[120,155])
trigger1= helper(3011),movehit=1
fv =2 
value = fvar(2)*.88
ignorehitpause=1
persistent=0

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype != H  || (p2stateno=[120,155])
fv = 2   
value = 1
ignorehitpause =  1
persistent =  1



[State -3, VarRandom]
type = VarRandom
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5030
trigger5 = stateno = 5050
trigger6 = stateno = 5070
trigger7 = stateno = 5080
v = 0
range = 0,60

[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [0,20]
trigger1 = Stateno = 5000
trigger2 = Stateno = 5010
value = 5000, 0
channel=0

[State -3, Hit1]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [21,30]
trigger1 = Stateno = 5000
trigger2 = Stateno = 5010
value = 5000, 1
channel=0




[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [31,35]
trigger1 = stateno = 5020
trigger2 = stateno = 5030
trigger3 = stateno = 5050
value = 5000, 2
channel=0
[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [36,40]
trigger1 = stateno = 5020
trigger2 = stateno = 5030
trigger3 = stateno = 5050
value = 5000, 3
channel=0


[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [41,50]
trigger1 = stateno = 5070
trigger2 = stateno = 5080
value = 5000, 4
channel=0

[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [51,60]
trigger1 = stateno = 5070
trigger2 = stateno = 5080
value = 5000, 5
channel=0




;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 = 40, 0
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 100 ;Jump land
trigger2 = stateno = 105 ;Run-back land
value = 40, 1