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

; var(0):= 19031, 7072, 7073, 9999, 5900, 6984, 6985, 6995, 6996, 6997, 6999, 7000, 7001, 7002, 7003, 7004, 7014, 7015, 7016, 7049, 7050, 7051, 7061, 7062, 7063, 7059, 7160, 7060, 7065, 7066, 7067, 7080, 7500, 7501, 7502, 7503, 7504, 7505, 7507, 8001, 8080, 8081, 8082, 8090, 8095, 8096, 8097, 8098, 9997
; var(1):= 19031, 7072, 7073, 9999, 6984, 6995, 6996, 6998, 6999, 7000, 7001, 7002, 7003, 7014, 7015, 7016, 7049, 7050, 7061, 7062, 7063, 7059, 7160, 7060, 7066, 7080, 7502, 7505, 7507, 8001, 8081, 8082, 8090, 8095, 8096, 8097, 8098, 9997
; var(2):= 1000, 1050, 1100, 3000, 1001, 7072, 7073, 9999, 6984, 6985, 6996, 7000, 7002, 7003, 7004, 7014, 7015, 7016, 7049, 7050, 7061, 7062, 7063, 7059, 7160, 7060, 7065, 7066, 7080, 7502, 7507, 8081, 8082, 8090, 8095, 8096, 8097, 8098, 9997
; var(3):= 1050, -3, 1001, 1003, 7072, 7073, 9999, 6985, 7000, 7002, 7003, 7014, 7015, 7016, 7049, 7050, 7051, 7061, 7062, 7063, 7059, 7160, 7060, 7065, 7066, 7067, 7080, 8080, 8081, 8082, 8095, 8097, 9997
; var(4):= 1001, 1003, 7072, 7073, 6985, 7000, 7002, 7003, 7014, 7015, 7016, 7051, 7061, 7062, 7063, 7160, 7060, 7066, 7067, 7080, 7507, 8080, 8081, 8096, 9997, -2
; var(5):= 7072, 7073, 6984, 6985, 6998, 7000, 7002, 7003, 7062, 7063, 7160, 7065, 7507, 8001, 8081, 8082, 8090, 8095, 8096, 8097, 8098, 9997
; var(6):= -3, 1001, 7072, 7073, 9999, 6985, 7000, 8001, 8096, 9997, -2
; var(7):= -3, 7073, 9999, 6985, 7000, 8001, 8080, 8096, 9997
; var(8):= 7073, 9999, 6985, 7000, 8080, 9997, -2
; var(9):= 7072, 7073, 7000, 7049, 7059, 7160, 7065, -2
;var(10):= 7072, 7073, 9999, 6985, 7000, 7002, 7065, 7067, 7080, 7500, 7507, 8001, 8090, 8095, 8096, 9997
;var(11):= -3, 7073, 9999, 7000, 7067, 8001, 9997, -2
;var(12):= 9999, 7000, 7002, 7065, 10000
;var(13):= 9999, 7000, 7065, 10000
;var(14):= 7072, 6985, 7000, 7065, 7067
;var(15):= 1000, -3, 1001, 7000, 7002, 7003, 7065
;var(16):= 7000
;var(17):= 7000, 9997
;var(18):= 9997
;var(19):= 7067, 8083, 9997
;var(20):= 7073, 9999, 7000, 7004, 7059, 7067, 8080, 8082, 8083, 9997
;var(21):= 7073, 9999, 7004, 8080, 8083, 9997
;var(22):= 9999, 7500, 9997
;var(23):= 9997
;var(24):= 8083, 9997
;var(25):= 1001, 1003, 9999, 7000, 8081, 9997, -2
;var(26):= 5900, 7000, 9997
;var(27):= 7000, 9997
;var(28):= 9999, 7000, 9997
;var(29):= 7000, 9997
;var(30):= 9999, 7000, 7003, 7004, 7049, 7065, 9997
;var(31):= 9997
;var(32):= 9997
;var(33):= 7000, 9997
;var(34):= 7000, 9997
;var(35):= 5900, 6999, 7000, 7049, 9997
;var(36):= 7000, 9997
;var(37):= 200, 210, 230, 240, 400, 410, 430, 440, 7000, 9997
;var(38):= 1999, 6999, 7000, 7049, 9997
;var(39):= 7000, 7004
;var(40):= 9999, 7000, 7004, 7049, 7500, 8080, 9997
;var(41):= 9999, 5900, 7000, 8080, 9997
;var(42):= 9999, 8080, 9997
;var(43):= 7000, 8080, 9997, -2
;var(44):= 7000, 8080, 9997, -2
;var(45):= 7000, 9997
;var(46):= 9997
;var(47):= 7000, 9997
;var(48):= 7000, 9997
;var(49):= 9997
;var(50):= 7000, 9997
;var(51):= 1999, 5900, 5942, 9997
;var(52):= 1003, 9997
;var(53):= 5900
;var(54):= 7000
;var(55):= 5900, 7000, 7500, 9997
;var(56):= 5900, 7000, 7500, 9997
;var(57):= 7000, 7500, 7506, 9997
;var(58):= 5900, 7000, 8000, 8001
;var(59):= -3, 7000, 8000, 8001, 8082, 9997

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

; fvar(0):= 5900, 6998, 7000, 7004, 7014, 7015, 7016, 7500
; fvar(1):= 1001, 1003, 7000
; fvar(2):= 7000
; fvar(3):= -2
; fvar(5):= 9999
; fvar(6):= -2
;fvar(10):= 7000, 7001
;fvar(11):= 5900
;fvar(15):= 9999, 8001
;fvar(36):= 7000, 7059
;fvar(37):= 190, 5900, -2
;fvar(39):= 7000









[Data]
;Amount of life to start with
;???Q?[?W?????l
life = 1001
power = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 6000
guard.sparkno=6000
KO.echo = 0
volume = 3
IntPersistIndex = 50
FloatPersistIndex = 36

[Size]
xscale = 1.25          ;Horizontal scaling factor.
yscale = 1.0619469026548    
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 16       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = 10, -70   ;Approximate position of head
mid.pos = 10, -45    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 2.8      ;Walk forward
walk.back = -1.8    ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.5  ;Neutral jumping velocity (x, y)
jump.back = -3   ;Jump back Speed (x, y)
jump.fwd = 3     ;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      ;Extra y-velocity for holding down during air recovery **MUGEN 1.0**
[Movement]
airjump.num = 0      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .515       ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .85 ;Friction coefficient when crouching
stand.friction.threshold = 2          ;If player's speed drops below this threshold while standing, stop his movement **MUGEN 1.0**
crouch.friction.threshold = .05       ;If player's speed drops below this threshold while crouching, stop his movement **MUGEN 1.0**
air.gethit.groundlevel = 25           ;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 = 15      ;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]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "Compared to my powers, everybody else is too weak."
victory2 = "I'm happy because I'll be able to finish my invention much sooner."
victory3 = "My carelessness almost cost me the match!"
;---------------------------------------------------------------------------
; Variable usage:
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(1)  - Used in kfm.cmd for combo condition (updated every tick)
; var(2)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;           held (remembered from state 800 through state 810).

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

[State 100, 1]
type = VelSet
trigger1 = time=0
x = (4.5*(const(size.xscale)))*(1+(cond(numhelper(8083),cond((helper(8083),var(0)=72||helper(8083),var(0)=70),helper(8083),var(1),0),cond(numhelper(8084),cond((helper(8084),var(0)=72||helper(8084),var(0)=70),helper(8084),var(1),0),0))/100.0))

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4)=4
x = 0
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
trigger2=animelemtime(4)=4
value = F0, 1
channel = 1
[State 100, 1]
type = VelSet
trigger1 =animelem=6
x = (3.15*(const(size.xscale)))*(1+(cond(numhelper(8083),cond((helper(8083),var(0)=72||helper(8083),var(0)=70),helper(8083),var(1),0),cond(numhelper(8084),cond((helper(8084),var(0)=72||helper(8084),var(0)=70),helper(8084),var(1),0),0))/100.0))




[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = animtime=0
value =0
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
physics = N
ctrl = 0
anim = 105
sprpriority = 1

[State 100, 1]
type = VelSet
trigger1 = time=0
x = (-3*(const(size.xscale)))*(1+(cond(numhelper(8083),cond((helper(8083),var(0)=72||helper(8083),var(0)=70),helper(8083),var(1),0),cond(numhelper(8084),cond((helper(8084),var(0)=72||helper(8084),var(0)=70),helper(8084),var(1),0),0))/100.0))

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4)=4
x = 0
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
trigger2=animelemtime(4)=4
value = F0, 1
channel = 1
[State 100, 1]
type = VelSet
trigger1 =animelem=6
x = (-3.25*(const(size.xscale)))*(1+(cond(numhelper(8083),cond((helper(8083),var(0)=72||helper(8083),var(0)=70),helper(8083),var(1),0),cond(numhelper(8084),cond((helper(8084),var(0)=72||helper(8084),var(0)=70),helper(8084),var(1),0),0))/100.0))
[State 0, NotHitBy]
type = NotHitBy
trigger1 =animelemtime(2)<1
value = SCA
;value2 = S,NA
time = 1



[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 =animtime=0
value =0
ctrl = !Helper(7000),var(34)
;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS ???x??: ??{
[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 ???x??: ??{
[Statedef 180]
type = S


[State 180, 1]
type = ChangeState
trigger1 = Time = 0 
value =171
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS ???x??: ??{
[Statedef 281]
type = S
ctrl = 0
anim = cond(helper(7000),var(56)>helper(7000),var(57)-2,181,182)
velset = 0,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0 && anim=182
trigger2 = animelem=13 && anim=181
value = S180,0
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(1)>=0&&animelemtime(13)<0&& anim=181
value = F0,0
channel = 1

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


;---april
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = enemy,var(59)=5 && anim!=183 && helper(7000),var(56)>1 && time=0
value = 183
elem = 1


[State 0, ChangeState]
type = ChangeState
trigger1 =time =75 
value =288
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS ???x??: ??{
[Statedef 288]
type = S
ctrl = 0
velset = 0,0

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

[State 0, ChangeState]
type = ChangeState
trigger1 =matchover 
value =0
persistent=0
ctrl=1
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS ???x??: ??{
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1
trigger1 = enemy,var(59)=16
trigger2 =teamside=2
trigger2 = p2stateno=1900 && enemy,var(59)=16
value =1901
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1
trigger1 = enemy,var(59)=5
trigger2 =teamside=2
trigger2 = p2stateno=1903 && enemy,var(59)=5
value =1902
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1
trigger1 = enemy,var(59)=2
trigger2 =teamside=2
trigger2 = p2stateno=1904 && enemy,var(59)=2
value =1903
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1 && numhelper(7000)
trigger1 = enemy,var(59)=10
trigger2 =teamside=2
trigger2 = p2stateno=1900&& enemy,var(59)=10
value =1904
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1 && numhelper(7000)
trigger1 = enemy,var(59)=1
trigger2 =teamside=2
trigger2 = p2stateno=1906&& enemy,var(59)=1
value =1905
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1 && numhelper(7000)
trigger1 = enemy,var(59)=4
trigger2 =teamside=2
trigger2 = p2stateno=1909&& enemy,var(59)=4
value =1906
ctrl = 0
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0|| time=0
value = 190

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, ChangeState]
type = ChangeState
trigger1=enemy,var(59)!=16 && enemy,var(59)!=0
trigger1 = numhelper(7000)&& random<499  && enemy,var(59)!=16&& enemy,var(59)!=0 && time=2
value =192
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(16)>=0&&animelemtime(28)<0&& anim=190
value = F0,0
channel = 1


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

; You can delete the following two controllers if you're building your own
; character using KFM. These are the wood pieces that KFM kicks.
; ????KFM???R?????l??BKFM??CNS??M??~L????????p???A?????A
; ???????~R???g?????[???????????l??B
;------------------------------------------------------
[Statedef 192]
type =S
physics=N
ctrl = 0
anim =191
velset = 0,0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 1901
ID = 190
pos = 180,25
postype =back  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = const(size.xscale),const(size.yscale)
sprpriority =-1
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 1900
ID = 191
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
removetime=-1
scale = const(size.xscale),const(size.yscale)
sprpriority =-2
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1

[State 0, PosSet]
type = PosSet
trigger1 =time=0 && !var(40)
x =220*facing
y=-140
;[State 0, Helper]
;type = Helper
;trigger1 =time=0
;helpertype = normal ;player
;name = "blade"
;ID =  1920
;stateno = 1920
;pos = 0,0
;postype = p1    ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;size.xscale =const(size.xscale)
;size.yscale =const(size.yscale)

[State 0, Turn]
type = Turn
trigger1 = time=0
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  anim!=0
trigger1 = animelem=2 && pos x  >20 && facing=-1
trigger2 = animelem=2 && pos x  <-20 && facing=1
value =anim
elem = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(2)<0 && roundstate!=0&& anim!=0
x = 7
y=.75
[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  anim!=0
trigger1 =  animelemtime(2)<0  && pos x  <20 && roundstate!=0 && facing=-1
trigger2 =  animelemtime(2)<0  && pos x  >-20 && roundstate!=0 && facing=1
value =anim
elem = 2

[State 0, Explod]
type = Explod
trigger1 = time%4=0 && roundstate!=0 && animelemtime(2)<0&& anim!=0
anim = 1902
ID = 191
pos = 17,-77
postype =p1  ;p2,front,back,left,right
facing =1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = const(size.xscale),const(size.yscale)
sprpriority =-2
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=2 && anim!=0
id = 191
[State 0, VelSet]
type = VelSet
trigger1 =animelem=2 && anim!=0
x = 4.75
y = 3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=4 && pos y  <0&& anim!=0
value =anim
elem = 3

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0&& anim!=0
y = .47
;ignorehitpause = 
;persistent = 

[State 0, Turn]
type = Turn
trigger1 = animelem=4&& anim!=0
;ignorehitpause = 
;persistent = 


[State 0, VelSet]
type = VelSet
trigger1 = animelem=4&& anim!=0
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=4&& anim!=0
x = helper(7000),pos x
y = 0


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=4 && anim!=0
value = F7,0

[State 0, EnvShake]
type = EnvShake
trigger1 =  animelem=4 && anim!=0
time = 6
freq = 60
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =  animelem=4 && anim!=0
anim = 1903
ID = 190
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 = const(size.xscale),const(size.yscale)
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 =  animelem=4 && anim!=0
anim = 1904
ID = 190
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 = const(size.xscale),const(size.yscale)
sprpriority =-3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0

;------------------------------------------------------
[Statedef 1901]
type =S
physics=N
ctrl = 0
anim =0
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0|| time=0
value = 192
[State 0, PosAdd]
type = PosAdd
trigger1 =  numhelper(7000)  && !var(40)
x = -50
persistent=0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, VelSet]
type = VelSet
trigger1 = anim=192
trigger1 = animelem=2
x = 1.5
y = -10
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=192
trigger1 = animelem=8&&pos y <0 && vel y <-1
value = anim
elem =4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim=192
trigger1 = animelem=4
value = F0,1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=192
trigger1 = animelem=10&&pos y <0
value = anim
elem = 9
;ignorehitpause = 
;persistent = 


[State 0, VelAdd]
type = VelAdd
trigger1 = anim=192
trigger1 =animelemtime(2)>=0 && animelemtime(10)<0 
y = .45

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

[State 0, PosSet]
type = PosSet
trigger1 = animelem=10
x = helper(7000),pos x
y = 0
;ignorehitpause = 
;persistent = 


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;------------------------------------------------------
[Statedef 1902]
type =S
physics=N
ctrl = 0
anim =193
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, Explod]
type = Explod
trigger1 = animelem=5&& anim!=0
anim = 1905
ID = 190
pos = -2,-2
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 =2
ontop = 1
shadow = 0,0,0
ownpal = 0
removetime=36
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0

;------------------------------------------------------
[Statedef 1903]
type =S
physics=N
ctrl = 0
anim =194
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = roundstate=0|| time=0
value = 194
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 =time=1  && !var(40)
x = -35

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=5 && anim=194&&time <94
value = 194
elem = 3 
;persistent = 0
[State 0, Helper]
type = Helper
trigger1 =time=0
helpertype = normal ;player
name = "april"
ID =  19030
stateno = 19030
pos = 58,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =const(size.xscale)
size.yscale =const(size.yscale)

[State 0, Helper]
type = Helper
trigger1 =time=0
helpertype = normal ;player
name = "table"
ID =  19031
stateno = 19031
pos = 68,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =const(size.xscale)
size.yscale =const(size.yscale)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0 && anim=194
trigger2 = animtime=0 && anim=20
trigger2 = pos x < helper(7000),pos x && facing=1&& anim!=0
trigger3 = animtime=0 && anim=20
trigger3 = pos x > helper(7000),pos x && facing=-1&& anim!=0
value = 20
[State 0, PosSet]
type = PosSet
trigger1 =  anim=0
x = helper(7000),pos x
[State 0, PosAdd]
type = PosAdd
trigger1 =anim=20 
x = 4.5
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0 && anim=[0,20]
trigger2 = pos x > helper(7000),pos x && facing=1&& anim=20
trigger3 = pos x < helper(7000),pos x && facing=-1&& anim=20
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;------------------------------------------------------
[Statedef 1904]
type =S
physics=N
ctrl = 0
anim =195
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = ( animelem=20)&&pos y <0
value = 195
elem=19
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = ( animelem=18)&&pos y <0
value = 195
elem=17
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = ( animelem=22)&&pos y <0
value = 195
elem=21
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = ( enemy,animelem=8)
value = 195
elem=19
[State 0, PosAdd]
type = PosAdd
trigger1 =  time=0
x = 55
persistent=0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, Explod]
type = Explod
trigger1 = animelem=4
anim = 3001
ID = 194
pos = 46,-64
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 4,6
accel = 0,0
random = 0,0
removetime = 2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop =1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = animelem=4,2
anim = 3002
ID = 194
pos = 40,-73
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 1,-9
accel = 0,0
random = 0,0
removetime = 25
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = animelem=24
anim = 3002
ID = 194
pos = 0,-220
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,9
accel = 0,.55
random = 0,0
removetime = 10
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=195
trigger1 = animelem=3
trigger2 = animelem=7
trigger3 = animelem=10
trigger4 = animelem=16
value = F0,1
channel=1
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=195
trigger1 = animelem=19
value = F5,3
channel=1
persistent=0
[State 0, EnvShake]
type = EnvShake
triggerall = anim=195
trigger1 = animelem=19
time = 7
freq = 60
ampl = -4
phase = 90

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=195
trigger1 = animelem=19
value = 5000,0
channel=0
persistent=0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=195
trigger1 = animelem=20
trigger2 = animelem=22
value = F7,0
channel=1

[State 0, VelSet]
type = VelSet
trigger1 = animelem=15
x = 2
y = -3.5
persistent=0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=19 
x = -3
y = -5.5
persistent=0
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(19)>=0 && animelemtime(20)<0
trigger2 = animelemtime(21)>=0 && animelemtime(22)<0
trigger3 = animelemtime(15)>=0 && animelemtime(18)<0
y = .45

[State 0, PosSet]
type = PosSet
trigger1 = animelem=20
trigger2 = animelem=22
trigger3 = animelem=18
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=20
trigger2 = animelem=22
trigger3 = animelem=18
x = 0
y = 0



[State 0, VelSet]
type = VelSet
trigger1 = animelem=21
x = -1
y = -2.5
persistent=0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=22
x = helper(7000),pos x
y = 0
;ignorehitpause = 
;persistent = 


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;------------------------------------------------------
[Statedef 1905]
type =S
physics=N
ctrl = 0
anim =196
velset = 0,0

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0|| time=0
value = 196
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro


[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = animelem=3 && enemy,animelemtime(2)<0 && anim!=0
value = 196
elem=1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;------------------------------------------------------
[Statedef 1906]
type =S
physics=N
ctrl = 0
anim =197
velset = 0,0

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0|| time=0
value = 197
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro


[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = time<10&&animelem=3 && anim!=0
value = anim
elem=1
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = time<50&&animelem=5 && anim!=0
value = anim
elem=3
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0

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

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

[State 195, 2]
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;ifelse(var(8)=1,0,15); 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)
                  ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA 
kill=0                                      
damage = 28, 0
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = (random%4)
guard.sparkno=6                 
sparkxy = -10, -65               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 0         
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 10         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -4,ifelse(var(8)=1,-9,0)             ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 0
channel = 1
[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 202]
type    = A
movetype= H
physics = N
ctrl = 0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0


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

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = time>0
y = .46

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



[State 5030, 3]
type = selfState
trigger1= pos y >=0 && time >2
value = ifelse(!alive,5050,52)
;---------------------------------------------------------------------------
; Standing strong punch
; CNS difficulty: easy
; Note the width controller. It makes KFM's push box larger, so he doesn't
; stand so close to the opponent. Hit Ctrl-C and look at the red bar at his
; feet.
; The sprpriority for this state is at -1, instead of the usual 2 for
; attacks. This makes KFM appear behind the opponent initially.
; The SprPriority controller in [State 210, 4] brings KFM to the front when
; his arm has swung over.
; To stop KFM from pausing in his swing frame, there is a ChangeAnim in
; [State 210, 3] that detects if the hit has come in contact with the
; opponent during that frame, and switches to the next animation element
; (notice the elem=6 parameter). If you don't see what I mean, try commenting
; out that controller, then hit someone with this attack.
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 4
 
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 1

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (3) >= 0) && (AnimElemTime (4) < 0)
value = 35,0

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 0, PosAdd]
type = PosAdd
triggerall = anim=211
trigger1=animelem=2 
x = 20
 [State 0, PosAdd]
type = PosAdd
triggerall = anim=211
trigger1=animtime=0
x = -20

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 1
channel = 1
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
kill=0                    
damage    =55
guardflag = MA
pausetime = 14,14 
sparkno = 10+(random%4)
priority = 3, Hit
guard.sparkno=6      ; 1
sparkxy = -10,-50
hitsound = F5, 1        
guardsound = F6,1
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33 
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-7 
air.hittime=99
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = movehit && p2statetype=A && !enemy,hitfall 
movetype = I        ;I,A,H


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 8
attr = S, NA
animtype  = Medium
kill=0                    
damage    = 55
guardflag = MA
pausetime = 14,14
priority = 3, Hit  
sparkno = 10+(random%4)
guard.sparkno=6 
sparkxy = -10,-70
hitsound = F5, 1        
guardsound = F6, 1
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = low
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-7 
air.hittime=99
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;=ifelse((life<=lifemax/5),114,28)   
ctrl = 0
velset = 0,0
anim = ifelse(p2bodydist x <15,230,231)
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 2
channel = 1
[State 230, 2]
type = HitDef
triggerall = anim=230
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0                    
damage    = 31
guardflag =M
pausetime = 8,8    
priority = 2, Hit
sparkno = (random%4)
guard.sparkno=6   ; 0
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
sparkxy = -10,-25
hitsound = F5, 2         
guardsound = F6,2
ground.type = Low
ground.slidetime = 7           
ground.hittime  = 10         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -4,ifelse(var(8)=1,-9,0)             ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 230, 2]
type = HitDef
triggerall = anim=231
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0                    
damage    = 28
guardflag = MA
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
priority = 2, Hit
pausetime =8,8 
sparkno = (random%4)
guard.sparkno=6    ; 0
sparkxy = -10,-70
hitsound = F5, 2         
guardsound = F6,2
ground.type = Low
ground.slidetime = 7           
ground.hittime  = 10         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -4,ifelse(var(8)=1,-9,0)             ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 5
 
ctrl = 0
velset = 0,0
anim = ifelse(p2bodydist x <25,240,241)
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 240, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 3
channel = 1
[State 210, 2]
type = HitDef
triggerall =anim=240
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0                    
damage    =64
guardflag = MA
priority = 3, Hit
pausetime = 14,14 
sparkno = 10+(random%4)
guard.sparkno=6 
sparkxy = -10,-75
hitsound = F5, 3         
guardsound = F6, 2
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
guard.velocity =-5.5
air.velocity = -3.45,-7 
air.hittime=99
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
[State 210, 2]
type = HitDef
triggerall =anim=241
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0                    
damage    = 71
guardflag = MA
pausetime = 14,14
priority = 3, Hit
sparkno = 10+(random%4)
guard.sparkno=6 
sparkxy = -10,-95
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
hitsound = F5, 3        
guardsound = F6,2
ground.type = low
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
guard.velocity =-5.5
air.velocity = -3.45,-7 
air.hittime=99
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
;Crouching light punch

[Statedef 400]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 5
  
ctrl = 0
anim = 400
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale);*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 0
channel = 1
[State 400, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype = Light
kill=0                    
damage = 26, 0                  ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit               ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = (random%4)
guard.sparkno=6   ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -40           ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 0         
guardsound = F6, 0
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 4           
ground.hittime  = 10         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -4,ifelse(var(8)=1,-9,0)             ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 6
 
ctrl = 0
anim = 410
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 410, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 1
channel = 1
;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
kill=0                    
damage    =67
guardflag = MA
pausetime = 14,14
priority = 3, Hit
sparkno = 10+(random%4)
guard.sparkno=6 
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkxy = -10,-65
hitsound = F5, 1       
air.hittime=99  
guardsound = F6, 1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-7 
air.hittime=99
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]

[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 5
  
ctrl = 0
anim = 430
sprpriority = 2

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1
x = 14*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=1
v = 37    ;fv = 10
value = 14
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2
x = 11*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2 
v = 37    ;fv = 10
value = 25
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4
x = -11*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4 
v = 37    ;fv = 10
value = 14
[State 0, PosAdd]
type = PosAdd
trigger1 =animtime=0 
x = -14*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animtime=0  
v = 37    ;fv = 10
value = 0
[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 2
channel = 1
[State 430, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
animtype  = Medium
kill=0                    
damage    = 24
guardflag = L
pausetime = 8,8    
priority = 2, Hit
sparkno = (random%4)
guard.sparkno=6    ; 0
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
sparkxy = -5,-10
hitsound = F5, 2         
guardsound = F6, 2
ground.type = Low
ground.slidetime = 4        
ground.hittime  = 10         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -4,ifelse(var(8)=1,-9,0)             ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0


[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
;Crouch Strong Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 7
 
ctrl = 0
anim = 440
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(37)!=0
x = -var(37)*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 37    ;fv = 10
value = 0
[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = F0, 3
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=2
x = 17*const(size.xscale)

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=3
x = 3*const(size.xscale)

 [State 0, PosAdd]
type = PosAdd
trigger1=animelem=4
x = -9*const(size.xscale)
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=6
x = 6*const(size.xscale)

 [State 0, PosAdd]
type = PosAdd
trigger1=animtime=0
x = -17*const(size.xscale)

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4)>=0 && animelemtime(5)<0
x = 4.45
[State 0, VelSet]
type = VelSet
trigger1 = animelem=5
x = 0
y = 0
;ignorehitpause = 
;persistent = 


[State 440, 3]
type = HitDef
trigger1 =!movecontact&&!movereversed
attr = C, NA
kill=0                    
damage    =67
hitflag = MAF
guardflag = L
pausetime = 14,14
priority = 3, Hit
sparkno = 10+(random%4)
guard.sparkno=6 
sparkxy = -5,-10
hitsound = F5, 3         
guardsound = F6, 2
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = Trip
ground.slidetime = 19
ground.hittime  = 16
guard.ctrltime=ifelse(p2statetype=A,99,16)
ground.velocity = -2.5,-6.8
air.velocity = -1.2,-6.5
guard.velocity = -5
fall = 1
id=440
yaccel=.47
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 440, 3]
type = HitDef
triggerall =cond(numhelper(8083),helper(8083),var(0)=68,0) || cond(numhelper(8084),helper(8084),var(0)=68,0) || cond(numhelper(8083),helper(8083),var(0)=87,0) || cond(numhelper(8084),helper(8084),var(0)=87,0) 
trigger1 = !movecontact&&!movereversed&& (p2statetype=L ||cond(numhelper(8083),helper(8083),var(0)=87,0) || cond(numhelper(8084),helper(8084),var(0)=87,0))
attr = C, NA
kill=0
hitflag = MFD
damage    =67
guardflag = L
pausetime = 14,14
priority = 3, Hit
sparkno = 10+(random%4)
guard.sparkno=6 
sparkxy = -5,-10
hitsound = F5, 3         
guardsound = F6, 2
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = Trip
ground.slidetime = 19
ground.hittime  = 16
guard.ctrltime=ifelse(p2statetype=A,99,16)
ground.velocity = -2.5,-6.8
air.velocity = -1.2,-6.5
guard.velocity = -5
fall = 1
id=200
yaccel=.47
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  =0;ifelse(var(8)=1,0,15); 2
  
ctrl = 0
anim = ifelse(((command="holddown" &&AIlevel=0) || ((p2bodydist x<-5||p2statetype=A)&&AIlevel>0)),601,600)
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 0
channel = 1
[State 0, Width]
type = Width
trigger1 = 1
edge = 25,0
[State 600, 2]
type = HitDef
triggerall = anim=601
trigger1= !movecontact&&!movereversed
attr = A, NA
kill=0                    
damage    = 26
guardflag = HA
priority = 2, Hit
pausetime = 8,8          
sparkno = (random%4)
guard.sparkno=6  ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -45             ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 0         
guardsound = F6, 0
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
[State 600, 2]
type = HitDef
triggerall = anim=600
trigger1 =!movecontact&&!movereversed
attr = A, NA
kill=0                    
damage    = 31
guardflag = HA
priority = 2
pausetime =8,8         
sparkno = (random%4)
guard.sparkno=6    ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -46               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 0         
guardsound = F6, 0
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]



;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  =0;ifelse(var(8)=1,0,15); 4
 
ctrl = 0
anim = 610
sprpriority = 2

[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = F0, 1
channel = 1
[State 610, 3]
type = HitDef
trigger1 = !movecontact&&!movereversed
attr = A, NA
animtype  = Medium
kill=0                    
damage    =71
priority = 3, Hit
guardflag = HA
pausetime = 14,14
sparkno = 10+(random%4)
guard.sparkno=7 
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkxy = -10,-20
hitsound = F5, 1        
guardsound = F6,1
ground.type = High
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]


;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  =0;ifelse(var(8)=1,0,15); 3
  
ctrl = 0
anim = ifelse(vel x=0,630,631)
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 2
channel = 1
[State 630, 2]
type = HitDef
triggerall = anim=630
trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0                    
damage =32
guardflag = HA
priority = 2, Hit
pausetime = 8,8         
sparkno = (random%4)
guard.sparkno=6    ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -66               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 2         
guardsound = F6, 2
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
[State 630, 2]
type = HitDef
triggerall = anim=631
trigger1 =!movecontact&&!movereversed
attr = A, NA
kill=0                    
damage = 26
guardflag = HA
priority = 3
pausetime =8,8        
sparkno = (random%4)
guard.sparkno=6   ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -30              ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,28) 
givepower=0
hitsound = F5, 2        
guardsound = F6, 2
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]

;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  =0;ifelse(var(8)=1,0,15); 4
 
ctrl = 0
anim = ifelse(vel x=0,640,641)
sprpriority = 2

[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 3
channel = 1
[State 640, 3]
type = HitDef
triggerall = anim=640
trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0                    
damage    = 68
guardflag = HA
pausetime = 14,14
sparkno = 10+(random%4)
guard.sparkno=6 
priority = 3, Hit
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkxy = -10,-85
hitsound = F5,3       
guardsound = F6, 2
ground.type = High
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)         ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]

[State 640, 3]
type = HitDef
triggerall = anim=641
trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0                    
damage    = 61
guardflag = HA
pausetime = 14,14 
sparkno = 10+(random%4)
guard.sparkno=6 
priority = 3, Hit
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33 
sparkxy = -10,-40
hitsound = F5, 3         
guardsound = F6,2
ground.type = High
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14
ground.velocity = -6.5
air.velocity = -3.45,-7 
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]


;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time=0
id = 801
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 = numexplod(801)=0 && (helper(10006), var(0)&258) > 0
anim = 10000
ID = 801
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
removetime = -1
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
[State 800, 1]
type = HitDef
Trigger1 = p2stateno=5901
attr = S, NT         ;Attributes: Standing, Normal Throw
hitflag = MAF         ;Affect only ground people who are not being hit
priority = 1   ;Throw has low priority, must be miss or dodge type.
sparkno =-1
guard.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"&&AIlevel=0||enemy,backedgebodydist <70&&AIlevel>0),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  
numhits=0
[State 800, 1]
type = HitDef
triggerall = p2movetype!=H || p2stateno=[120,140]
Trigger1 = animelem=2 && p2stateno!=[150,155]
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno =-1
guard.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"&&AIlevel=0||enemy,backedgebodydist <70&&AIlevel>0),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             ;Force p2 into falling down

           ;Force p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = cond(numexplod(801)>0,210,240)

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

[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd=0; = 60
facep2=1
; Here a variable, var(2), is used to remember whether or not the
; player was holding forward at the start of the state. This variable
; is checked later on to turn KFM around if necessary.

[State 0, Explod]
type = Explod
trigger1 = numexplod(810)=0
anim = 10000
ID = 810
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
removetime = -1
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0

[State 640, 2]
type = PlaySnd
trigger1 = animelem=3
value =100, 0
channel = 0

[State 810, Width 2-11]
type = Width
trigger1 = time=0
edge = 60,50

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2) < 0
pos = -30, 0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos = -35, -53
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos = -2, -63
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 4 
pos = 85, -60

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElemtime(4) = 8
value = -ceil(75*fvar(1))
kill=0
[State 0, PosAdd]
type = PosAdd
trigger1 =(frontedgebodydist <40||backedgebodydist<40)  &&time=0 
x = -15

[State 0, TargetVelSet]
type = TargetVelSet
trigger1 = AnimElemtime(4) =8
x =4
y = 3
;ignorehitpause = 
;persistent = 
[State 810, Throw 11]
type = TargetState
trigger1 = AnimElemtime(4) = 8
value = 10612


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

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820*(cond(var(59)=24,9,1))
[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 = p2stateno!=810
value = 5050


;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
[Statedef 830]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 0
velset = 0,0
ctrl = 0
anim = 829
sprpriority = 2

[State 800, 1]
type = HitDef
triggerall = p2movetype!=H || p2stateno=[120,140]
Trigger1 =animelem=2 && p2stateno!=[150,155]
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 2, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno =-1
guard.sparkno=-1 
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = ifelse((command="holdfwd"&&AIlevel=0||enemy,backedgebodydist <70&&AIlevel>0),-1,1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 840      ;On success, KFM changes to state 810
p2stateno = 850      ;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 = 0             ;Force p2 into falling down
forcenofall=1
numhits=0
   [State 800, 1]
type = HitDef
Trigger1 = p2stateno=5901||cond(numhelper(8083),helper(8083),var(0)=69,0) || cond(numhelper(8084),helper(8084),var(0)=69,0) 
attr = S, NT         ;Attributes: Standing, Normal Throw
hitflag = MAF         ;Affect only ground people who are not being hit
priority = 2   ;Throw has low priority, must be miss or dodge type.
sparkno =-1
guard.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 = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 840      ;On success, KFM changes to state 810
p2stateno = 850      ;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
forcenofall=1         ;Force p2 into falling down
numhits=0
[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl=!Helper(7000),var(34)

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

[Statedef 840]
type    = S
movetype= A
physics = N
anim = 830
poweradd=0; = 60
facep2=1
; Here a variable, var(2), is used to remember whether or not the
; player was holding forward at the start of the state. This variable
; is checked later on to turn KFM around if necessary.
[State 0, PosAdd]
type = PosAdd
trigger1 =(frontedgebodydist <40||backedgebodydist<40) &&time=0 
x = -15
[State 0, Explod]
type = Explod
trigger1 = numexplod(810)=0
anim = 10000
ID = 810
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
removetime = -1
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0

[State 640, 2]
type = PlaySnd
trigger1 = animelem=2
value =100, 0
channel = 0

[State 810, Width 2-11]
type = Width
trigger1 = time=0
edge = 45,45

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(3) < 0
pos = 46,0


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NT
animtype  = Medium
kill=0                    
damage    =69
guardflag = MA
pausetime = 14,14
sparkno = 10+(random%4)
guard.sparkno=-1  ; 1
sparkxy = -10,-60
hitsound = F5, 1        
guardsound = F6,1
getpower = 0
givepower=0 
ground.type = High
ground.slidetime = 19
ground.hittime  = 22
ground.velocity = -6.5,ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-7 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=1
envshake.time = 16
envshake.freq = 80
envshake.ampl = -3
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
;phase = 90


;abspan = 
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 
[State 810, Throw 11]
type = TargetState
trigger1 = movehit=1 && p2life =1
value = 441


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

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 850]
type    = S
movetype= H
physics = N
velset = 0,0
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 831*(cond(var(59)=24,9,1))

;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!=840
value = 5050


;---------------------------------------------------------------------------
; Kung Fu Palm
; CNS difficulty: medium
; Description: This is like a standard attack, but with some differences.
;   There are two HitDefs in this attack. One is triggered when the
;   opponent is near (using a p2bodydist trigger), and the other
;   when the opponent is farther away. The main differences between
;   the near and far versions of the HitDefs is that the near version
;   has a "fall" parameter set to 1, causing the opponent to be knocked
;   down. Other minor differences are the kill=0                    
;damage, and the velocity to
;   give the opponent.
;   The line "attr = S, SA" line means this is a Standing, Special Attack.
;   It is important you have the attr parameter set correctly for all
;   you HitDefs.
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 0
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 15    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0 && var(2)!=2
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((helper(10006), var(0)&129) > 0,0,1)
;

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   
value = ifelse(helper(10003),var(20),0,1)
[State 0, VarSet]
type = VarSet
triggerall = cond(numhelper(8083),helper(8083),var(0)!=78,1) && cond(numhelper(8084),helper(8084),var(0)!=78,1) 
triggerall = AILevel=0 &&  var(45) 
trigger1 = time=0
v = 2   
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 && random <249
triggerall =  (helper(10003),var(22))
trigger1 = time=0
v = 2   ;fv = 10
value =2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0&& var(2)>0
value = 1010+(var(2)=2)
[State 0, PalFXWiz]
type = PalFX
trigger1 = time <10 && var(2)=2
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =100, 2
channel = 0

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=3
value = F0, 1
channel=1
[State 1000, Helper]
type = Helper
trigger1 = animelem=1 && var(2)=2
helpertype = normal
name = "Fireballstart"
ID = 1010
stateno = 1010
pos =0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale = const(size.yscale)
pausemovetime=99
[State 0, Helper]
type = Helper
trigger1 =animelem=4
helpertype = normal ;player
name = "blade"
ID =  1001
stateno = 1001
pos = 36,5
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)

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)


;---------------------------------------------------------------------------
; Kung Fu Knee

[Statedef 1050]
type    = S
movetype= A
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 110
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2



;persistent = 
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =100, 1
channel = 0

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0 && var(2)!=2
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse(var(3)=1,0,1)
[State 0, VarSet]
type = VarSet
triggerall = cond(numhelper(8083),helper(8083),var(0)!=78,1) && cond(numhelper(8084),helper(8084),var(0)!=78,1) 
triggerall = AILevel=0 && (var(3)=3||var(45))  && helper(7000),var(2)>0
trigger1 = time=0
v = 2   
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((prevstateno!=[200,430]),0,1)
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && helper(7000),var(2)>0  && p2stateno!=5040&& (random <65*AIlevel || AIlevel >6 && var(4)>3)
trigger1 = time=0 && (prevstateno=410 || prevstateno=430 || prevstateno=200||prevstateno=400||prevstateno=430||p2statetype=A&& enemy,hitfall|| p2stateno=[120,155])
v = 2   ;fv = 10
value = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=1 &&p2statetype=A
movetype = I        
[State 0, StateTypeSet]
type = StateTypeSet
triggerall = p2statetype!=A  && var(3)<3
trigger1 = var(4)=0|| p2stateno=5120 || p2stateno=5901 || var(3)<3 ||var(2)=2 
movetype = A



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0&& var(2)>=1
value = 1051+(var(2)=2)

[State 0, PalFXWiz]
type = PalFX
trigger1 = time <20 && var(2)=2
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
[State 0, Explod]
type = Explod
trigger1 =animelem=3&& var(2)=2
trigger2 =animelem=6&& var(2)=2
trigger3 =animelem=9&& var(2)=2
trigger4 =animelem=12&& var(2)=2
trigger5 =animelem=15&& var(2)=2
trigger6 =animelem=18&& var(2)=2
trigger7 =animelem=21&& var(2)=2
anim = 1007
ID = 1105
pos = 10,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -2,0
accel = -.67,0
random = 0,0
pausemovetime = 0
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 =animelem=4&& var(2)=2
trigger2 =animelem=7&& var(2)=2
trigger3 =animelem=10&& var(2)=2
trigger4 =animelem=13&& var(2)=2
trigger5 =animelem=16&& var(2)=2
trigger6 =animelem=19&& var(2)=2
anim = 1007
ID = 1105
pos = 11,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -2,0
accel = -.67,0
random = 0,0
pausemovetime = 0
scale = const(size.xscale),const(size.yscale)
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 1000, Helper]
type = Helper
trigger1 = animelem=3 && var(2)=2
helpertype = normal
name = "Fireballstart"
ID = 1010
stateno = 1010
pos =0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale = const(size.yscale)
pausemovetime=99

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(2)!=2
trigger1 = animelem=14 && ( var(3)=var(2)+1)
value =anim
elem = 6
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = animelem=10;&& time >40
trigger2= var(2)=2
trigger3 =time=0
v = 3  ;fv = 10
value = 0



[State 1000, 1]
type = PlaySnd
trigger1 = animelem=2
trigger2 = animelem=5
trigger3 = animelem=8
trigger4 = animelem=10
trigger5 = animelem=12
value = F0, 1
channel=1

[State 0, MoveHitReset]
type = MoveHitReset
triggerall = var(2)!=2
trigger1 = animelem=5
trigger2 = animelem=8
trigger3 = animelem=10
trigger4 = animelem=12
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
triggerall = animelemtime(3)>0 && var(2)!=2&& vel x =0
trigger1 =command="holdfwd" && AILEvel =0
trigger2 =(p2bodydist x >50|| movehit) && AILEvel >0 && p2movetype!=A
x = 1*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))
[State 0, VelSet]
type = VelSet
triggerall = animelemtime(3)>0 && var(2)!=2 && vel x =0
trigger1 =command="holdback"&& AILEvel =0
trigger2 =(p2bodydist x >70 || moveguarded) && AILEvel >0 && p2movetype=A 
x = -1*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))
[State 0, VelSet]
type = VelSet
trigger1 = command!="holdback" &&command!="holdfwd"  && var(2)!=2
x = 0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = posadd
triggerall = animelemtime(3)>0 && var(2)=2
trigger1 =animelemtime(18)<0
x =3

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

[State 210, 2]
type = HitDef
triggerall = var(2)!=2
trigger1 = !movecontact&&!movereversed
attr = S, SA
animtype  = Medium
kill=0                    
damage    =cond(var(2)=0,43,67)
guardflag = M
pausetime = ifelse(var(2)=0,8,14),ifelse(var(2)=0,8,14)
sparkno = 20+(random%4)
priority=4
guard.sparkno=7 ; 
sparkxy = -10,-60
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33 
hitsound = F5, 1        
guardsound = F6, 1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=15
ground.velocity = -7.25,-ifelse(var(8),9,0)
air.velocity = -4.45,-ifelse(var(8),9,ifelse(var(2),8.75,7.35))
ground.cornerpush.veloff=-10
yaccel=.52
air.fall=1
fall.recover=0
forcenofall= p2stateno=5901
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 210, 2]
type = HitDef
triggerall = var(2)=2
trigger1 = animelem=3
trigger2 = animelem=6
trigger3 = animelem=9
trigger4 = animelem=11
trigger5 = animelem=14
trigger6 = animelem=17
attr = S, SA
animtype  = Medium
kill=0                    
damage    =17
guardflag = M
pausetime = 3,3
sparkno = 20+(random%4)
priority=4
guard.sparkno=7 ; 
sparkxy = -10,-40
getpower = ifelse((life<=lifemax/5),43,22)
givepower=33 
hitsound = F5, 1        
guardsound = F6, 1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=18
ground.velocity = -1.5,-ifelse(var(8),9,0)
air.velocity = -2.45,-2
ground.cornerpush.veloff=-3
yaccel=.52
air.fall=1
fall.recover=0
forcenofall= p2stateno=5901
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 210, 2]
type = HitDef
triggerall = var(2)=2
trigger1 = animelem=19
attr = S, SA
animtype  = Medium
kill=0                    
damage    =32
guardflag = M
pausetime = 14,14
sparkno = 20+(random%4)
priority=4
guard.sparkno=7 ; 
sparkxy = -10,-60
getpower = ifelse((life<=lifemax/5),57,32)
givepower=33 
hitsound = F5, 1        
guardsound = F6, 1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=18
ground.velocity = -4.5,-5
air.velocity = -4.45,-6.6
ground.cornerpush.veloff=-10
yaccel=.52
fall=1
fall.recover=0
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = moveguarded=1
value = -ceil(7*fvar(1))
ID = 200
kill = 0

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)


;---------------------------------------------------------------------------
; Light Kung Fu Upper
; CNS difficulty: easy
; Description: This is a simple special attack that can hit twice. Notice
;     the use of the Width controller to keep opponents from getting too
;     close to KFM during his uppercut (press Ctrl-C, and look at the
;     yellow bar at KFM's feet during the move).
;     The second HitDef has some interesting parameters. fall.recovertime
;     is used to prevent the opponent (p2) from recovering immediately
;     after being hit (eg. press x+y with KFM to recover). This gives the
;     attacking KFM a chance to follow up with an extra attack, such as
;     a Kung Fu Knee. The yaccel parameter, set at 0.4, makes p2 fall at a
;     greater value of acceleration than the default, which is 0.35.
[Statedef 1100]
type    = S
movetype= A
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 110
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0&& var(2)!=2
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((helper(10006), var(0)&2064) > 0,0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse(p2bodydist x <=150||p2movetype=A,0,1)
[State 0, VarSet]
type = VarSet
triggerall = cond(numhelper(8083),helper(8083),var(0)!=78,1) && cond(numhelper(8084),helper(8084),var(0)!=78,1) 
triggerall = AILevel=0 && var(46) 
trigger1 = time=0
v = 2   
value = 2
[State 0, VarSet]
type = VarSet
triggerall = p2bodydist y >-55 || AIlevel<6
triggerall = AILevel>0 && helper(7000),var(2)>0 && fvar(15)<35 && p2stateno!=5040 && (random <299 || AIlevel >6 && var(4)>3)
trigger1 = time=0 && (p2statetype=A||p2movetype=A) && p2stateno!=[800,899]
v = 2   ;fv = 10
value = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = enemy,anim=5120 || enemy,anim=5300 || p2stateno=52 && movetype=I
movetype =A
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0&& var(2)>0
value = 1100+var(2)
[State 0, PalFXWiz]
type = PalFX
trigger1 = time <12 && var(2)=2
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0


[State 0, VelSet]
type = VelSet
trigger1 = command!="holdback" &&command!="holdfwd"  
x = 0
[State 0, VelSet]
type = VelSet
triggerall = (animelemtime(11)<0 && var(2)=0||animelemtime(28)<0&& var(2)=1) && vel x =0
triggerall = animelemtime(4)>0
trigger1 =command="holdfwd" && AILEvel =0
trigger2 =p2bodydist x >70 && AILEvel >0 && p2movetype!=A
x = 2*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))
[State 0, VelSet]
type = VelSet
triggerall = (animelemtime(11)<0 && var(2)=0||animelemtime(28)<0&& var(2)=1) && vel x =0
triggerall = animelemtime(4)>0
trigger1 =command="holdback" && AILEvel =0
trigger2 =(p2bodydist x <50|| p2movetype=A) && AILEvel >0 
x = -2*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(4)>=0&&animelemtime(14)<0 && var(2)=2
x = 5.5*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))
;ignorehitpause = 
;persistent = 
[State 1000, Helper]
type = Helper
trigger1 = animelem=4 && var(2)=2
helpertype = normal
name = "Fireballstart"
ID = 1010
stateno = 1010
pos =0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale = const(size.yscale)
pausemovetime=99
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =100, 3
channel = 0

[State 1000, 1]
type = PlaySnd
trigger1 = animelem=4
trigger2 = animelem=8
trigger3 = animelem=12&& anim=1101
trigger4 = animelem=16&& anim=1101
trigger5 = animelem=20&& anim=1101
trigger6 = animelem=24&& anim=1101
trigger7 = animelem=28&& anim=1101
value = F0, 1
channel=1

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=13 && (anim=1100 || anim=1102)
trigger2=animelem=30 && anim=1101 
x = 16

[State 0, VelSet]
type = VelSet
trigger1 =animelem=11 && (anim=1100 || anim=1102)
trigger2=animelem=28 && anim=1101 
x = 0
;ignorehitpause = 
;persistent = 


[State 0, NotHitBy]
type = notHitBy
trigger1 = time = 0
value = S,AA
time =cond(var(2)=0,24,16)

[State 0, HitBy]
type = HitBy
trigger1 =time = 0
value = C,AA,AP,AT
time = cond(var(2)=0,24,16)
[State 0, HitBy]
type = HitBy
trigger1 = time=0 && var(2)=2
value = SCA,HA,HT,HP
time =16

;ignorehitpause = 
;persistent = 
[State 0, MoveHitReset]
type = MoveHitReset
triggerall = moveguarded
trigger1 = animelem=9
trigger2 = animelem=13
trigger3 = animelem=17
trigger4 = animelem=21
trigger5= animelem=26
[State 1100, 2]
type = HitDef
trigger1 =!movecontact
attr = S, SA
animtype  = Med
kill=0                    
damage    =85
guardflag = M
pausetime = 14,14
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33 
sparkxy = 0,-55
sparkno = 20+(random%4)
priority=4
guard.sparkno=7 
hitsound = F5, 1         
guardsound = F6,1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 18
guard.velocity = -6
ground.velocity = -cond(var(2)=2,1.5,2.5),-ifelse(var(8),9,ifelse(var(2),7.75,7.35))
air.velocity = -cond(var(2)=2,1.5,3.45),-ifelse(var(8),9,ifelse(var(2),7.75,7.35))
yaccel=.49
airguard.velocity = -4,-4.5
fall=1
fall.recover=0
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0


;ignorehitpause = 
;persistent = 


[State 1100, 2]
type = HitDef
trigger1 =animelem=15 && var(2)=2
attr = S, SA
animtype  = Med
kill=0                    
damage    =45
guardflag = M
pausetime = 14,14
getpower = ifelse((life<=lifemax/5),77,14)
givepower=22
sparkxy = 0,-55
sparkno = 20+(random%4)
priority=4
guard.sparkno=7 
hitsound = F5, 1         
guardsound = F6,1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=10
guard.velocity = -6
ground.velocity = -3.5,-ifelse(var(8),9,0)
air.velocity = -3.45,-ifelse(var(8),9,ifelse(var(2),5.75,5.35))
yaccel=.49
airguard.velocity = -4,-4.5
air.fall=1
fall.recover=0
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
;ignorehitpause = 
;persistent = 

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = moveguarded=1
value = -ceil(11*fvar(1))
ID = 200
kill = 0

[State 1100, 5]
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 3000]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=-1000
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)!=1
movetype =A
ignorehitpause=1
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =100, 3
channel = 0

[State 0, VarSet]
type = VarSet
triggerall = time=1
triggerall = cond(numhelper(8083),helper(8083),var(0)!=78,1) && cond(numhelper(8084),helper(8084),var(0)!=78,1) 
triggerall = ((helper(7000),var(2)>1 || life=lifemax && helper(7000),var(3)>0))
trigger1 = AIlevel=0&&((helper(10006), var(38)) >0)
trigger2 = AIlevel>0
trigger2= p2life <400 || p2movetype=A
v = 2   ;fv = 10
value = 2

[State 0, Helper]
type = Helper
trigger1 =time=1
helpertype = normal ;player
name = "blade"
ID =  30000
stateno = 30000
pos =-4, -44
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime=36
pausemovetime=36
size.xscale=2
size.yscale=2
[State 3000, Super A]
type = SuperPause
trigger1 =time=1 ;&& var(0)=2
pos = 4, -44
anim = -1;00
sound = 20, var(2)=2
poweradd = -1000
p2defmul=1
time=35
movetime=12
unhittable=1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time =0
value = SCA
;value2 = S,NA
time =1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=5
value = SCA
;value2 = S,NA
time = cond(var(2)=2,18,14)
;ignorehitpause = 
;persistent = 

[State 0, PalFXWiz]
type = PalFX
trigger1 = time <20  && var(2)=2
trigger1 = time%3=1
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2  
x =-2
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3  
x =18
[State 0, Explod]
type = Explod
trigger1 =time=0 && var(2)=2
anim = 3005
ID = 3005
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
pausemovetime = 12
supermovetime=12
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0


[State 0, Helper]
type = Helper
triggerall = anim=3000
trigger1 =animelem=4; && var(2)=2
helpertype = normal ;player
name = "you gon die"
ID =  3002
stateno = 3002
pos =70,-76
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)

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(3002) && anim=3000
trigger1 =animelem=5 && helper(3002),stateno=3002
value = anim
elem = 4
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(3002) && anim=3000
trigger1 =animelem=6 && (helper(3002),moveguarded||helper(3002),stateno=3003)
value = anim
elem = 5
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(3002)&& anim=3000
trigger1 = helper(3002),stateno=3004 || p2stateno=21010
value = 3003+(var(2)=2)
[State 0, NotHitBy]
type = NotHitBy
trigger1 = anim!=3000
value = SCA
;value2 = S,NA
time = 1
ignorehitpause = 1
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(3002)
trigger1 = animelem=7 &&helper(3002),stateno=3004&& anim!=3000
trigger1 = p2bodydist x >35
value = anim
elem = 1
[State 200, 1]
type = PlaySnd
triggerall = anim!=3000
trigger1 = animelem=1 
trigger2=animelemtime(4)=4
value = F0, 1
channel = 1
[State 0, VelSet]
type = VelSet
triggerall = anim!=3000
trigger1 = animelemtime(1)>=0 && animelemtime(6)<0
x = 6.5

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 8 && anim!=3000
attr = S, HA                     
kill=0                    
damage = 0, 0                   ;kill=0                    
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -65               ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 1         
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 20         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -0             ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;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 = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
snap = 60,0


[State 200, 1]
type = HitDef
trigger1 = AnimElem = 12 && anim!=3000
attr = S, HA                     
kill=0                    
damage = 0, 0                   ;kill=0                    
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -45               ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 3       
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 20         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = 0            ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = low                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=1
;ignorehitpause = 
;persistent = 

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 16 && anim!=3000
attr = S, HA                     
kill=0                    
damage = 0, 0                   ;kill=0                    
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -5               ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 3       
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 20         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = 0            ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = low                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=1

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 19 && anim!=3000
attr = S, HA                     
kill=0                    
damage = 0, 0 
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -5              ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 3       
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 20         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = 0            ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = low                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=1


[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  anim=3004
trigger1 =animelem=32 
value = anim
elem = 24
persistent=0
[State 1000, Helper]
type = Helper
trigger1 = animelem=24 && var(2)=2
helpertype = normal
name = "Fireballstart"
ID = 1010
stateno = 1010
pos =0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale = const(size.yscale)
pausemovetime=99
persistent=0

[State 0, VelSet]
type = VelSet
triggerall =  anim=3004
trigger1 = animelemtime(24)>=0 && animelemtime(32)<0 
x = 4.5


[State 200, 1]
type = HitDef
trigger1 = AnimElem = 26 && anim=3004
trigger2 = AnimElem = 30&& anim=3004
attr = S, HA                     
kill=0                    
damage = 0, 0
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -40              ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 3       
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 80         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity =-5.5           ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = low                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=1

;ignorehitpause = 
;persistent = 


[State 0, Explod]
type = Explod
trigger1 =animelem=38&& var(2)=2
anim = 3007
ID = 3004
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
pausemovetime = 0
removetime=-1
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 26 && anim=3003
trigger2 = AnimElem = 41 && anim=3004
attr = S, HA                     
kill=0                    
damage = 0, 0
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -45               ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 1       
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 40         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity =-5           ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = low                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=1


[State 200, 1]
type = HitDef
trigger1 = AnimElem = 28 && anim=3003
attr = S, HA                     
kill=0                    
damage = 235, 0
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8           
sparkno = 20+(random%4)
guard.sparkno=6                 
sparkxy = -10, -45               ;X-offset for the "hit spark" rel. to p2,
getpower=0
givepower=11
hitsound = F5, 1       
guardsound = F6, 0               
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7           
ground.hittime  = 20         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity =-5,-11           ;Velocity at which opponent is pushed
airguard.velocity = -2,-5     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = low                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.45,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 99                 ;Time before opponent regains control in air
yaccel=.47
id=200
fall=1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(3002) && anim=3004
trigger1 =animelem=37 
value = anim
elem = 36

[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  anim=3003
trigger1 =animelem=30 && (p2bodydist y <-30 || enemy, vel y <0)
value = anim
elem = 28
[State 0, Width]
type = Width
trigger1 =1 
edge = 45,0



[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  anim=3004
trigger1 =animelem=45 && (p2bodydist y <-30 || enemy, vel y <0)
value = anim
elem = 43
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=45
id = 3004

[State 0, Helper]
type = Helper
trigger1 =animelem=40 && var(2)=2
helpertype = normal ;player
name = "you gon die"
ID =  3001
stateno = 3001
pos =70,45
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)

[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)


;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------




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

[Statedef -3]
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H
id = 810
[State 0, VarSet] ; char id
type = VarSet
trigger1 =1 
v = 59    ;fv = 10
value = 3
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 7   ;fv = 10
value = 620
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 20    ;fv = 10
value = gametime
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =stateno!=[200,440]
v = 37    ;fv = 10
value = 0
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(58) && (var(56)=-1&& enemy,var(56)!=0||var(56) && enemy,var(56)=-1) && numhelper(7509)=0 && stateno=5151
value = -1000
kill = 1

[State 0, VarSet]
type = VarSet
triggerall = AIlevel <6 && var(2)!=2
triggerall =(helper(10006), var(0)&8772) < 8700 
trigger1 = (helper(10006), var(0)&129)>0
v =3    ;fv = 10
value =1
[State 0, VarSet]
type = VarSet
triggerall = AIlevel <6&& var(2)!=2
triggerall =(helper(10006), var(0)&8772) < 8700
trigger1 = (helper(10006), var(0)&258)>0
v = 3   ;fv = 10
value =2
[State 0, VarSet]
type = VarSet
triggerall = AIlevel <6
triggerall =(helper(10006), var(0)&8772) < 8700
trigger1 = (helper(10006), var(0)&387)>258 || var(45) && var(3)>0
v =3   ;fv = 10
value =3
;[State 0, VarSet]
;type = VarSet
;trigger1 = stateno=5120 && time =1
;trigger2 = time=1 && stateno=1050
;trigger3 = time%20=0 && var(3)!=0 && stateno!=1050
;v = 3    ;fv = 10
;value =0

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



[State 0, VarSet]
type = VarSet
trigger1 = numhelper(1001)=0 && stateno!=1000
v = 15    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
trigger1 = (stateno=810)
v = 11    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 11    ;fv = 10
value = 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 = F40, 0
channel=4


;-------------------------stun
[State 0, VarSet]
type = Varadd
triggerall = stateno=200 ||stateno=400
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 24;100
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall =stateno=840
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 77;260
ignorehitpause=1

[State 0, VarSet]
type = Varadd
triggerall =stateno=440  || stateno=240
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 60;260
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=600 ||anim=601
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 18;45
ignorehitpause=1

[State 0, VarSet]
type = Varadd
triggerall = anim=1051 
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =77;275
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=1050
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 45;100
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=1052
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 35;100
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = stateno=1100 ||stateno=640
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 62;160
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = stateno=210 ||stateno=610||stateno=410
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 77;275
ignorehitpause=1

[State 0, VarSet]
type = Varadd
triggerall = stateno=230 ||stateno=630||stateno=430
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 21;91
ignorehitpause=1

