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

; var(0):= 7072, 7073, 7074, 9999
; var(1):= 7072, 7073, 7074, 9999
; var(2):= 1000, 1050, 1100, 1150, 3000, 1001, 1003, 7072, 7073, 9999, -1
; var(3):= 1050, 1001, 1003, 7072, 7073, 9999
; var(4):= 1001, 1101, 7072, 7073
; var(5):= 7072, 7073
; var(6):= -3, 1001, 1101, 3001, 3002, 3003, 3004, 3005, 7072, 7073, 9999
; var(7):= -3, 7073, 9999
; var(8):= 7073, 9999
; var(9):= 7072, 7073
;var(10):= 7072, 7073, 9999
;var(11):= 3000, -3, 7073, 9999
;var(12):= 9999
;var(13):= 9999
;var(14):= 55, 7072, 9999
;var(15):= 1000, -3, 1001, 1003, 9999
;var(16):= 1050
;var(17):= 1050
;var(20):= 3000, 1001, 1003, 7073, 9999
;var(21):= 7073, 9999
;var(25):= 1001, 9999
;var(30):= 9999
;var(40):= 9999
;var(41):= 9999
;var(42):= 9999
;var(45):= 1003, -1
;var(46):= -1
;var(50):= 9999
;var(52):= 1003
;var(59):= -3

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

; fvar(1):= 1001, 1003
; fvar(2):= 1001, 1003
; fvar(5):= 9999
;fvar(15):= 9999
;fvar(16):= 1000
;fvar(17):= 1000
;fvar(20):= -3
;fvar(25):= 1003







[Data]
;Amount of life to start with
;体力ゲージの初期値
life =981
power = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = S6000
guard.sparkno=S6000  ; 2
KO.echo = 0
volume = 100
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, -80  ;Approximate position of head
mid.pos = 10, -55   ;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  = 3.45     ;Walk forward
walk.back = -3.35    ;Walk backward
run.fwd  = 4.6, -3.5   ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.1 ;Neutral jumping velocity (x, y)
jump.back = -2.2   ;Jump back Speed (x, y)
jump.fwd = 2.2     ;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 = "Fighting against someone without wings seems like a waste! Train yourself and challenge me again!"
victory2 = "Uhi uhi hihihi!! My face is so nice. Don't you like to look at my face?"
victory3 = "You have fought well, but you are not strong enough!"
;---------------------------------------------------------------------------
; 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).


;------------------------------------
;AirDash
[Statedef 55]
type = A
physics = N
anim = 50
ctrl = 0
velset=0,0
[State 0, StopSnd]
type = StopSnd
trigger1 = time=0 &&( prevstateno=600||prevstateno=630)
trigger1 = enemy,gethitvar(hittime)=0
channel = 1
;abspan =
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 14 ;fv = 10
value =1
;ignorehitpause =
;persistent =


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noairguard
[State 100, 1]
type = VelSet
trigger1 = time=0
x =ifelse(command="holdback"&&AIlevel=0 || helper(10003),var(15)&&AIlevel>0,-7.1,7.1)*(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 1000, 1]
type = PlaySnd
trigger1 = time=0 
value = 200, 20
channel=0

[State 100, 2]
type = ChangeState
trigger1 = animelem=4
value = 56

;------------------------------------
;AirDash
[Statedef 56]
type = A
physics = A
ctrl =1


[State 0, VelMul]
type = VelMul
trigger1 =time=0
x = .5
;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    =A
movetype=I
physics =N
anim =100
ctrl=0
sprpriority = 1

;persistent = 

[State 100, 1]
type = VelSet
trigger1 = animelem=1
x = (const(velocity.run.fwd.x)*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))
y=const(velocity.run.fwd.y)

;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = F0,1
channel = 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 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=9 && pos y <0
value = anim
elem = 8
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(1)>=0 &&animelemtime(9)<0
y = .33
[State 0, VelSet]
type = VelSet
trigger1 = animelem=9
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=9
y = 0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=9
statetype = S       ;S,A,C,L
movetype = I        ;I,A,H
physics =S

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0 
value =0
ctrl = !Helper(7000),var(34)
;anim =
;ignorehitpause = 
;persistent = 
;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 105]
type    = A
physics =N
anim =105
ctrl=0
sprpriority = 1

[State 100, 1]
type = VelSet
trigger1 = animelem=1
x = (const(velocity.run.back.x)*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))
y=const(velocity.run.back.y)
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=2
value = F0,4
channel = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 =animelemtime(4)<1
value = SCA
;value2 = S,NA
time = 1

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

;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 = time=0
;value = S100,0
;channel = 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 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=9 && pos y <0
value = anim
elem = 8
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(1)>=0 &&animelemtime(9)<0
y = .33
[State 0, VelSet]
type = VelSet
trigger1 = animelem=9
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=9
y = 0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=9
statetype = S       ;S,A,C,L
movetype = I        ;I,A,H
physics =S
;ignorehitpause = 
;persistent = 
[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0 
value =0
ctrl = !Helper(7000),var(34)
;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S
[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 281
;ignorehitpause = 
;persistent = 

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 281]
type = S
ctrl = 0
anim = 181
velset = 0,0
facep2=1
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=15 && anim!=[182,183]
trigger2 = animelem=1 && anim=[182,183]
value = S180,0
channel = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = anim=182
flag = nomusic



;---win
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =StageVar(info.name)="k"  && anim!=182 && (helper(7000),var(56)>helper(7000),var(57)-2)&&time=0
value = 182
elem = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=4 && anim=[182,183]
value = S180,1
channel = 1
[State 0, Explod]
type = Explod
trigger1 = animelem=1 && anim=182
anim =183
ID = 180
pos = 130,-165
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 0
vel = 0,7.5
accel = 0,0
random = 0,0
removetime=35
scale = const(size.xscale),const(size.yscale)
sprpriority =2
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
persistent=0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4)>=0
y = 1.5*-(sin(time/15))
;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = ChangeState
trigger1 =time =75  && !matchover
value =288
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 288]
type = S
ctrl = 0
velset = 0,0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = anim=182
flag = nomusic

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4)>=0
y = 1.5*-(sin(time/15))
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=32 && time <200
value = anim
elem = 4


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(32)<0 && time =220
value = anim
elem = 32
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=32&& anim=[182,183]
value = S100,0
channel = 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 レベル: 基本
[Statedef 191]
type = S
physics =N
ctrl = 0
anim = 190
velset = 0,0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1
trigger1 = enemy,var(59)=13 
trigger2 =teamside=2
trigger2 = p2stateno=1901 && enemy,var(59)=13
value =1901
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =numhelper(7000) && random%50=49 &&time=3
value =192
ctrl = 0

[State 0, PosSet]
type = PosSet
trigger1 =time=0 
y = -240
;ignorehitpause = 
;persistent = 

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 190
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 1,0
ignorehitpause = 1
;persistent = 

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, PlaySnd]
type = PlaySnd
trigger1 =roundstate!=0
value = S180,0
channel = 0
persistent=0
[State 0, PosAdd]
type = posadd
triggerall = anim=190
trigger1 =roundstate!=0 && animelemtime(9)<0&& pos y <-60
y =6
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=190 && time%8=0
trigger1 =roundstate!=0 && animelemtime(1)>=0&&animelemtime(17)<0
value = F0,0
channel =2
persistent=0
[State 0, Explod]
type = Explod
triggerall = anim=190 && time%3=0
trigger1 =roundstate!=0 && animelemtime(9)<0&& pos y >=-75
trigger2 =roundstate!=0 && animelemtime(9)>=0&&animelemtime(17)<0&& pos y =[-60,-10]
anim = 1900
ID = 190
pos = 8,-ceil(pos y)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 8,0
accel = 0,0
random = 0,0
scale = const(size.xscale),const(size.yscale)
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = anim=190 && time%3=0
trigger1 =roundstate!=0 && animelemtime(9)<0&& pos y >=-60
trigger2 =roundstate!=0 && animelemtime(9)>=0&&animelemtime(17)<0&& pos y =[-60,-10]
anim = 1900
ID = 190
pos = -8,-ceil(pos y)
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = -8,0
accel = 0,0
random = 0,0
scale = const(size.xscale),const(size.yscale)
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, PosAdd]
type = posadd
triggerall = anim=190
trigger1 =roundstate!=0 && animelemtime(9)<0&& pos y >=-60
y =2
;persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=190
trigger1 = anim!=0 && animelem=9 && pos y <-40
value = anim
elem = 1
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = posadd
triggerall = anim=190
trigger1 =roundstate!=0 && animelemtime(9)>=0&&animelemtime(17)<0&& pos y =[-60,-10]
y =2

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(18)>=0 && animelemtime(19)<0 && anim=190
y = .52

[State 0, VelSet]
type = VelSet
trigger1 = animelem=19&& anim=190
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 =  animelem=19 && anim=190
y = 0

[State 0, EnvShake]
type = EnvShake
trigger1 =  animelem=19 && anim=190
time = 8
freq = 60
ampl = -4
phase = 90


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=21 && anim=190
value = F7,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=19 && anim=190
value = S5000,0
channel=0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0;&& anim!=5120
value = 5120
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 ;&& anim=5120
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 =time=160
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が蹴る木の板です。KFMのCNSを貴方のキャラに利用しているなら、
; 下にる二つのコントロラーを消したらいいです。
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 192]
type = S
physics=n
ctrl = 0
anim = 191
velset = 0,0
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 191
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, PosSet]
type = PosSet
trigger1 =time=0 
y = 45
x=-80 *facing


[State 0, PosSet]
type = PosSet
trigger1 =animelem=6&& anim!=0
y = -190
x=-200*facing
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=6 && anim=191
value = F0,1
[State 0, Explod]
type = Explod
trigger1 =roundstate!=0
anim = 191
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
removetime=60
scale = const(size.xscale),const(size.yscale)
sprpriority =2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 0, VelSet]
type = posadd
trigger1 = animelemtime(5)>=0&&animelemtime(6)<0&& anim!=0
x = -12
[State 0, VelSet]
type = VelSet
trigger1 = animelem=6&& anim!=0
x = 6
y = 5.5
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=7 && pos y <0 && anim!=0
value = anim
elem = 6
;ignorehitpause = 
;persistent = 



[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(6)>=0&&animelemtime(7)<0  && anim!=0
y = .47
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=7&& anim!=0
x = helper(7000),pos x
y = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=7&& anim!=0
x = 0
y = 0
;ignorehitpause = 
;persistent = 



[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=10 && anim=191
value = S180,0
channel=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 ;&& anim=5120
value = 0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 1901]
type = S
physics=n
ctrl = 0
anim = 192
velset = 0,0

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

[State 0, PosSet]
type = PosSet
trigger1 =time=0 
y = -190
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = time=35
y = 1.25
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=4 && pos y <0 && anim!=0
value = anim
elem = 3
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>=0&&animelemtime(4)<0  && anim!=0
y = .47
;ignorehitpause = 
;persistent = 
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=4 && anim=192
time = 8
freq = 60
ampl = -4
phase = 90
[State 0, VelSet]
type = VelSet
trigger1 = animelem=4&& anim!=0
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 =  animelem=4&& anim!=0
y = 0
;ignorehitpause = 


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=4 && anim=192
value = F7,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=4 && anim=192
value = S5000,0
channel=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0;&& anim!=5120
value = 5120
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 ;&& anim=5120
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 =!helper(7000),var(34)


;---------------------------------------------------------------------------
; 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 = ifelse(p2bodydist x <30,200,201)                     ;Change animation (Def: no change)
                  ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)



[State 200, 1]
type = HitDef
triggerall = anim=200
trigger1 = AnimElem = 2
attr = S, NA                     ;Attribute: Standing, Normal Attack
kill=0
damage    = 27, 0                   ;Damage that move inflicts, guard damage
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                             
sparkxy = -10, -65               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
sparkno = (random%4)
guard.sparkno=6  
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=5901
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;
[State 200, 1]
type = HitDef
triggerall = anim=201
trigger1 = AnimElem = 2
attr = S, NA                     ;Attribute: Standing, Normal Attack
kill=0
damage    = 21, 0                   ;Damage that move inflicts, guard damage
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 = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8        
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
sparkno = (random%4)
guard.sparkno=6                      
sparkxy = -10, -65               ;X-offset for the "hit spark" rel. to p2,
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=5901
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;

;[State 0, ChangeState]
;type = ChangeState
;trigger1 = animelemtime(3)>=3 && command="holdup" && anim=200
;trigger2= animelemtime(3)>=3 && AIlevel > 6 && moveguarded && anim=200
;trigger3 = animelemtime(4)>=3 && command="holdup" && anim=201
;trigger4= animelemtime(4)>=3 && AIlevel > 6 && moveguarded && anim=201
;value =40
;ctrl = 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 = ifelse(Fvar(15) <30,211,210)
sprpriority = 1

[State 0, PosAdd]
type = PosAdd
triggerall = anim=210
trigger1=animelem=3 
x = 20
 [State 0, PosAdd]
type = PosAdd
triggerall = anim=210
trigger1=animelem=7
x = -20

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 1
channel = 1
[State 210, 2]
type = HitDef
triggerall =anim=210
trigger1 = AnimElem =4
attr = S, NA
animtype  = Medium
kill=0
damage    =74
guardflag = MA
pausetime = 14,14 
priority = 3, Hit
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
sparkxy = -10,-60
hitsound = F5, 1        
guardsound = F6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
air.hittime=99
ground.velocity = -5.5,ifelse(var(8)=1,-9,0)
air.velocity = -3,-7+(enemy,hitfall*1.5)
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-11
[State 210, 2]
type = HitDef
triggerall =anim=211
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
kill=0
damage    = 63
guardflag = MA
pausetime = ifelse(p2statetype=A,8,16), ifelse(p2statetype=A,8,16)  
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7 
priority = 3, Hit 
sparkxy = -10,-60
hitsound = F5, 1        
guardsound = F6, 1
ground.type = low
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
air.hittime=99
ground.velocity = -5.5,ifelse(var(8)=1,-9,0)
air.velocity = -3,-7+(enemy,hitfall*1.5)
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-11
[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 = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 2
channel = 1
[State 230, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0
damage    = 31
guardflag = MA
pausetime = 8,8   
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
priority = 2, Hit
sparkno = (random%4)
guard.sparkno=6  
sparkxy = -10,-50
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) 
air.velocity = -2.5,-7.5
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=5901


[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 = 240
sprpriority = 2

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

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

[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
velset=0,0
ctrl = 0
anim = 400
sprpriority = 2

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

[State 0, Explod]
type = Explod
trigger1 = time=4
anim = 401
ID = 401
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
scale = const(size.xscale),const(size.yscale)
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0

[State 400, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
kill=0
damage    = 26, 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 = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8         
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
priority = 2, Hit
sparkno = (random%4)
guard.sparkno=6  
sparkxy = -10, -50         ;X-offset for the "hit spark" rel. to p2,
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 = -5.5,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
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
;[State 0, ChangeState]
;type = ChangeState
;trigger1 = animelemtime(3)>=3 && command="holdup"
;value =40
;ctrl = 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
 velset=0,0
ctrl = 0
anim = 410
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 1
channel = 1
;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0
damage    =68
guardflag = MA
pausetime = 14,14 
priority = 3, Hit
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
sparkxy = -10,-50
hitsound = F5, 1         
guardsound = F6, 1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
air.hittime=99
ground.velocity = -5.5,ifelse(var(8)=1,-9,0)
air.velocity = -3,-7+(enemy,hitfall*1.5)
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-11.5
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901

[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
  velset=0,0
ctrl = 0
anim = 430
sprpriority = 2

;ignorehitpause = 
;persistent = 

[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    = 27
guardflag = L
pausetime = 8,8  
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
priority = 2, Hit
sparkno = (random%4)
guard.sparkno=6  
sparkxy = -5,-22
hitsound = F5, 2         
guardsound = F6, 2
ground.type = Low
ground.slidetime = 7           
ground.hittime  = 10         
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -5,ifelse(var(8)=1,-9,0) 
air.velocity =-3.45,-7 
yaccel=.47
id=200
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-8
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901

;[State 0, ChangeState]
;type = ChangeState
;trigger1 = animelemtime(2)>=3 && command="holdup"
;value =40
;ctrl = 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
 velset=0,0
ctrl = 0
anim = 440
sprpriority = 2

[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = F0, 3
channel = 1

;ignorehitpause = 
;persistent = 
[State 240, 1]
type = PlaySnd
trigger1 = animelem=6
trigger2 = animelem=10
value = F0, 3
channel = 1
[State 440, 3]
type = HitDef
trigger1 = AnimElem = 3
trigger2 = animelem=7
trigger3 = animelem=11
attr = C, NA
kill=0
damage    = 74
priority = 3, Hit
hitflag = MAF
guardflag = L
pausetime = 14,14 
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
sparkxy = -5,-10
hitsound = F5, 3         
guardsound = F6, 2 
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 = AnimElem = 7 && (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    = 74
priority = 3, Hit
guardflag = L
pausetime = 14,14 
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
sparkxy = -5,-10
hitsound = F5, 3         
guardsound = F6, 2 
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((p2bodydist x!=0),601,600)
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 0
channel = 1
[State 600, 2]
type = HitDef
triggerall = anim=601
trigger1=!movecontact&&!movereversed
attr = A, NA
kill=0
damage    = 27
guardflag = HA
priority = 2
pausetime = 8,8          
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
sparkno = (random%4)
guard.sparkno=6  
sparkxy = -10, -35             ;X-offset for the "hit spark" rel. to p2,

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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[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        
sparkxy = -13, -52              ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
sparkno = (random%4)
guard.sparkno=6  
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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0



;---------------------------------------------------------------------------
;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    =67
priority = 3, Hit
guardflag = HA
pausetime = 14,14 
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
sparkxy = -10,-46
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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0


;---------------------------------------------------------------------------
;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    =28
guardflag = HA
priority = 2
pausetime = 8,8         
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
sparkno = (random%4)
guard.sparkno=6  
sparkxy = -10, -36               ;X-offset for the "hit spark" rel. to p2,
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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 630, 2]
type = HitDef
triggerall = anim=631
trigger1 =!movecontact&&!movereversed
attr = A, NA
kill=0
damage    = 28
guardflag = HA
priority = 2
pausetime = 8,8         
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18
sparkno = (random%4)
guard.sparkno=6  
sparkxy = -10, -30              ;X-offset for the "hit spark" rel. to p2,
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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
;---------------------------------------------------------------------------
;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 = F0, 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 
priority = 3, Hit
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 640, 3]
type = HitDef
triggerall = anim=641
trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0
damage    = 68
guardflag = HA
pausetime = 14,14 
priority = 3, Hit
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33
sparkno =10+ (random%4)
guard.sparkno=7  
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 
air.hittime = 99 
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
;---------------------------------------------------------------------------
;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
triggerall = fvar(15)<32
Trigger1 = p2stateno=5901||(p2stateno=[1007,1008]);|| var(10) && p2stateno=[120,155]
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 = fvar(15)<32
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
[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, VelSet]
type = VelSet
trigger1 =1
x = 0
y = 0
;[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

[State 0, Explod]
type = Explod
trigger1 = time=7
anim = 811
ID = 811
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 = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 = animelem=6
anim = 812
ID = 811
pos = 0,0
postype = p2  ;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 = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0


[State 810, Width 2-11]
type = Width
trigger1 = time=0
edge = 60,50
[State 640, 2]
type = PlaySnd
trigger1 = animelem=2
value =100, 0
channel = 0
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =F0, 0
channel = 0
[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(12) < 0
edge = 60,0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2) < 0
pos = 38,0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos = 52,-57
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos = 16,-105
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) < 0
pos =-33,-105
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = -4,-90
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 6
pos = 72,0
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=6
time = 16
freq = 60
ampl = -2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=6
value = F7,0
channel = 1
[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElemtime(6) = 1
value = -ceil(80*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(6) =16
x =3
y = -3.5
;ignorehitpause = 
;persistent = 
[State 810, Throw 11]
type = TargetState
trigger1 = AnimElemtime(6) = 18
value =10612


[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =!helper(7000),var(34)

;---------------------------------------------------------------------------
;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 0, VelSet]
type = VelSet
trigger1 =1
x = 0
y = 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 = 0
movecamera = 0,0
;ignorehitpause = 
;persistent = 

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

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 824]
type    = A
movetype= H
physics = N



;ignorehitpause = 
;persistent = 

[State 0, TargetVelSet]
type =VelSet
trigger1 = time=0
x =-3.5
y = -9.5
[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0 && anim!=5040
value = 5040*(cond(var(59)=24,9,1))

[State 0, NotHitBy]
type = NotHitBy
trigger1 = pos y <0
value = SCA
;value2 = S,NA
time =3
;ignorehitpause =
;persistent =
[State 0, NotHitBy]
type =HitBy
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = SCA,AA,AP
;value2 = S,NA
time = 1
[State 5040, 5]
type = VelAdd
trigger1 = 1
y = .37
[State 0, SelfState]
type = SelfState
trigger1 = life =1
value =10613
[State 5040, 6]
type = selfState
triggerall = time >5
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND
;---------------------------------------------------------------------------
;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]
triggerall = fvar(15)<32&& p2stateno!=[150,155]
Trigger1 =animelem=2
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 = 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 = 1              ;Force p2 into falling down
numhits=0

   [State 800, 1]
type = HitDef
triggerall = fvar(15)<32
Trigger1 = p2stateno=5901||(p2stateno=[1007,1008])||cond(numhelper(8083),helper(8083),var(0)=69,0) || cond(numhelper(8084),helper(8084),var(0)=69,0) 
Trigger1 = animelem=2
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
fall = 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
velset=0,0
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 810, Width 2-11]
type = Width
trigger1 = time=0
edge = 60,50
[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(18)<0
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =animelemtime(12)<0
x = 0
y = 0
;e = 
;persistent = 

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2) < 0
pos = 38,0
[State 0, BindToTarget]
type = BindToTarget
trigger1 =AnimElemTime(2) >= 0 && AnimElemTime(12) < 0 
pos = -5,(enemynear,const(size.head.pos.y))+35
[State 0, BindToTarget]
type = BindToTarget
trigger1 =AnimElem=12
pos = -5,(enemynear,const(size.head.pos.y))+35
;ignorehitpause = 
;persistent =
;ignorehitpause = 
;persistent = 
[State 640, 2]
type = PlaySnd
trigger1 = AnimElem = 5
trigger2 = AnimElem = 7
trigger3 = AnimElem = 9
trigger4 = AnimElem = 11
value =200, 3
channel = 0

[State 0, HitAdd]
type = HitAdd
trigger1 = AnimElem = 5
trigger2 = AnimElem = 7
trigger3 = AnimElem = 9
value = 1
[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 5
trigger2 = AnimElem = 7
trigger3 = AnimElem = 9

value = -ceil(cond(p2life >17*fvar(1),16*fvar(1),0)) 
kill= 0 

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 11
value = -ceil(16*fvar(1)) 
kill= 0

;persistent = 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=13
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = N
;ignorehitpause = 
;persistent = 

[State 0, TargetVelSet]
type =VelSet
trigger1 = AnimElem=12 
x =-3.5
y = -8.5


;ignorehitpause = 
;persistent = 

[State 0, TargetVelSet]
type = TargetVelSet
trigger1 = AnimElem=12,1
x =-3.5
y = -ifelse(p2life=1,3.5,5.5)
;ignorehitpause = 
persistent = 0
[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem=12
value = ifelse(p2life=1,10612,824)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animelem=26 && pos y <0  
value = anim
elem = 25
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(12)>0 && animelemtime(19)<0
y = .44

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(19)>0 && animelemtime(26)<0
y = .355
[State 0, VelSet]
type = VelSet
trigger1 = animelem=26
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=26
y = 0
;ignorehitpause = 
;persistent = 


[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =!helper(7000),var(34)

;---------------------------------------------------------------------------
;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    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 831*(cond(var(59)=24,9,1))
[State 0, VelSet]
type = VelSet
trigger1 =1
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
;ignorehitpause = 
;persistent = 
[State 810, Width 2-11]
type = Width
trigger1 = enemy,animelemtime(18)<0
edge = 60,50
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 0
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!=840
value = 5050

;---------------------------------------------------------------------------
;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 851]
type    = A
movetype= H
physics = N

[State 0, VelAdd]
type = VelAdd
trigger1 =1 
y = .44
;ignorehitpause = 
;persistent = 
;[State 0, PosAdd]
;type = PosAdd
;trigger1 =animelem=8 
;y = -const(size.mid.pos.y)
;ignorehitpause = 
;persistent = 

[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 = changeState
trigger1 = pos y >20 && time >10
value = 10612

;---------------------------------------------------------------------------
; 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 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    = A
movetype= A
physics =N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 0
anim = 1000
ctrl = 0
sprpriority = 2
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 16 ;fv = 10
value = vel x
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 17  ;fv = 10
value = vel y
[State 0, VelSet]
type = VelSet
trigger1 =time=0 
x = 0
y = 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 = 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   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 15    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse(((fvar(15) / p2bodydist y) > .45 && (fvar(15) /p2bodydist y) <= 1.75),0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 && (random <41*AIlevel|| vel y <-2) && statetype!=A
triggerall = ((fvar(15) / p2bodydist y) > .45 && (fvar(15) /p2bodydist y) <= 1.8)
triggerall = p2movetype= A && p2statetype!=A || p2stateno=5120 || p2movetype= H && p2statetype!=L||enemy,numproj >0
trigger1 = time=0
v = 2   ;fv = 10
value =2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0 
value = cond(var(2)=0,1000,cond(var(2)=1,1010,1011))
[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 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =100, 1
channel = 0


[State 0, Helper]
type = Helper
trigger1 =animelem=6
helpertype = normal ;player
name = "blade"
ID =  1001
stateno = 1001
pos = 55,-37
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, VelSet]
type = VelSet
trigger1 = animtime=0
x = fvar(16)
y = fvar(17)

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


;---------------------------------------------------------------------------
; 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
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=1
movetype = I        
[State 0, StateTypeSet]
type = StateTypeSet
triggerall = statetype!=S
trigger1 = var(4)=0|| p2stateno=5120
movetype = A
[State 1000, 1]
type = PlaySnd
trigger1 =time=0
value = 0, 1
channel=1
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 16  ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 17  ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = p2statetype=A && !movecontact
v = 3    ;fv = 10
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = p2statetype!=A && !movecontact
v = 3    ;fv = 10
value =0
ignorehitpause = 1
;persistent = 


;[State 0, VarSet]
;type = VarSet
;triggerall = AILevel=0
;trigger1 = time=0
;v = 2   ;fv = 10
;value = ifelse(command= "upper_x",0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse(p2statetype=A,0,1)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0&& var(2)=1
value = 1051
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=4
x = ifelse(var(2)=0,3.55,9.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))
y= -ifelse(var(2)=0,8.65,12)
[State 0, VelSet]
type = VelSet
trigger1 = animelem=8 && var(2)=0
trigger2 = animelem=12 && var(2)=1
x = 0


[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(4)>0 && animelemtime(18)<0 && var(2)=0 
trigger2 =animelemtime(4)>0 && animelemtime(21)<0 && var(2)=1
y = .48

[State 0, PosSet]
type = PosSet
trigger1 = animelem=18&& var(2)=0
trigger2 = animelem=21 && var(2)=1
y = 0
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=18&& var(2)=0
trigger2 = animelem=21 && var(2)=1
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 4
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4
statetype = A

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = 20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = 5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=18 && var(2)=0
trigger2 = animelem=21 && var(2)=1
x = -15
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=3
value = 0, 1
channel=1
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=18 && var(2)=0
trigger2 = animelem=21 && var(2)=1
value = 40, 0
channel=2

[State 210, 2]
type = HitDef
trigger1 = !movecontact
attr = A, SA
animtype  = Medium
kill=0
damage    =181,40
guardflag = M
pausetime = 8,8
guard.pausetime=8,8
sparkno = S6001
guard.sparkno=S6001  ; 1
sparkxy = -10,-42
getpower = ifelse((life<=lifemax/5),143,32)
givepower=0 
hitsound = F5, 1        
guardsound = F6, 1
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=18
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-ifelse(var(8),9,ifelse(var(2),9.75,9.35))
yaccel=.49
fall=1
fall.recover=0
id=200
[State -3, Landing Sound]
type = PlaySnd
trigger1 = animelem=18 && var(2)=0
trigger2 = animelem=21 && var(2)=1
value = 40, 0
channel=5
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=18 && var(2)=0
trigger2 = animelem=21 && var(2)=1
statetype = S
movetype = I       ;I,A,H
physics =S
[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl=1


;---------------------------------------------------------------------------
; 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 = S
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 110
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2
[State 0, StopSnd]
type = StopSnd
trigger1 = time=0 &&( prevstateno=200||prevstateno=230||prevstateno=400||prevstateno=430)
trigger1 = enemy,gethitvar(hittime)=0
channel = 1
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 2   ;fv = 10
value = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=1
movetype = I        
[State 0, StateTypeSet]
type = StateTypeSet
;triggerall = statetype!=S
triggerall = anim=1100
trigger1 = var(4)=0|| p2stateno=5120 || p2stateno=5901 || p2statetype!=A
movetype = A
[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 && (helper(10006), var(30) > 0||var(45))   && helper(7000),var(2)>0
trigger1 = time=0
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 && random <40*AIlevel && fvar(15)<65
;triggerall =  p2statetype!=A
triggerall = prevstateno=210|| prevstateno=240 || prevstateno=410||p2movetype=A||var(4)>=3
trigger1 = time=0
v = 2   ;fv = 10
value =2
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4)>=0 && animelemtime(6)<0 && anim=1100
x =cond(var(2)=2,7,5.75)*(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, 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 = animelem=6 && anim=1100
x =0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(2)=2&& time=0
value = SCA
;value2 = S,NA
time = 8
;ignorehitpause = 
;persistent = 

[State 1000, 1]
type = PlaySnd
trigger1 = animelem=2 && anim=1100
value = F0, 1
channel=1

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


[State 1100, 2]
type = HitDef
trigger1 =!movecontact && anim=1100&& !movereversed
attr = S, SA
animtype  = Med
kill=0
damage    =45;, 10
priority  = 4
guardflag = M
pausetime = 12,12
getpower = ifelse((life<=lifemax/5),143,32)
givepower =33
sparkxy = 0,-50
sparkno = 20+(random%4)
guard.sparkno=7 ;
hitsound = F5, 1         
guardsound = F6,1
ground.type = Low
ground.slidetime = 14
ground.hittime  = 18
guard.ctrltime=16
guard.velocity = -6
ground.velocity = -9,ifelse(var(8)=1,-9,0)
air.velocity = -2.45,-ifelse(var(8),9,ifelse(var(2),9.75,4.35))
yaccel=.49
airguard.velocity = -4,-4.5
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-15
fall.recover=0
air.fall=1
id=200

[State 0, Explod]
type = Explod
trigger1 =animelem=4 && var(2)=2&& anim=1100
anim = 1105
ID = 1105
pos =70,-45
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = -3,0
accel = -.5,0
random = 0,0
pausemovetime = 0
scale = const(size.xscale),const(size.yscale)
sprpriority = 3
removetime=-1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelem=4 && var(2)=2&& anim=1100
anim = 1106
ID = 1105
pos =70,-45
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = -3,0
accel = -.5,0
random = 0,0
pausemovetime = 0
removetime=-1
scale = const(size.xscale),const(size.yscale)
sprpriority = 4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim!=1100 || animelem=6
id = 1105
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=1100 &&animelemtime(4)>0&&animelemtime(5)<0  && var(2)!=2&& movecontact
trigger1 =  AIlevel =0 &&( (helper(10006), var(0)&129) > 0 ||  (helper(10006), var(0)&258) > 0 )
trigger2 = AIlevel > 0 &&((AIlevel <6 && random<35*AIlevel) ||(moveguarded || p2statetype=A))
value = 1101

[State 0, ChangeAnim]
type = ChangeAnim
triggerall =anim=1100 && animelemtime(4)>0&&animelemtime(5)<0  && var(2)!=2&& movecontact
trigger1 =  AIlevel =0 && ( (helper(10006), var(0)&2064) > 0 ||  (helper(10006), var(0)&4128) > 0 )
trigger2 = AIlevel > 0 &&((AIlevel <6 && random<35*AIlevel)||p2movetype= H && !moveguarded&&p2statetype!=A)
value = 1102

[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  anim=1100 && animelemtime(4)>0&&animelemtime(5)<0 && var(2)=2
trigger1 =AIlevel =0 && ((helper(10006), var(0)) > 127 )
trigger2 = AIlevel > 0 &&((AIlevel <6 && random<35*AIlevel) ||(p2movetype=A && fvar(15)<60 && AIlevel>6)||p2movetype= H && p2stateno!=[120,150])
value = 1103

;-----1101
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2  && anim=1101
statetype = A       ;S,A,C,L
physics = N
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1 && anim=1101
x = 25
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =animelem=2 && anim=1101
x = -1.5
y = -4.5
;ignorehitpause = 
;persistent = 



[State 0, ChangeAnim]
type = ChangeAnim
triggerall =animelem=10 &&anim=1101
trigger1 = pos y <0
value = anim
elem=9

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(4)>0 && animelemtime(10)<0&& anim=1101
y =.35
;ignorehitpause = 
;persistent = 

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

[State 0, PosSet]
type = PosSet
trigger1 = animelem=10&& anim=1101
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=10&& anim=1101
statetype = S      ;S,A,C,L
physics = N
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 = animelem=4 &&anim=1101
anim = 3002
ID = 3002
pos =14,-42
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)*.75,const(size.yscale)*.75
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 =animelem=4&& anim=1101
helpertype = normal ;player
name = "you gon die"
ID =  1101
stateno = 1101
pos = 4,-52
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =const(size.xscale)*.75
size.yscale =const(size.yscale)*.75


;---1102

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3  && anim=1102
statetype = A       ;S,A,C,L
physics = N
;ignorehitpause = 
;persistent = 
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1 && anim=1102
value =180, 0
channel = 0
persistent=0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1 && anim=1102
x = 35
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =animelem=3 && anim=1102
x = 3.5
y = -6.5
;ignorehitpause = 
;persistent = 
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=1 && anim=1102
trigger2 = animelem=4 && anim=1102
trigger3 = animelem=8 && anim=1102
value = F0, 1
channel=1


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


[State 1100, 2]
type = HitDef
trigger1 =animelem=6&& anim=1102
attr = S, SA
animtype  = Med
kill=0
damage    =25;, 10
priority  =4
guardflag = M
pausetime = 12,12
getpower = ifelse((life<=lifemax/5),45,10)
sparkxy = 0,-50
sparkno = 20+(random%4)
guard.sparkno=7 ;
hitsound = F5, 1         
guardsound = F6,1
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
guard.velocity = -6
ground.velocity =-2,-5.5
air.velocity = -2,-5.5
yaccel=.49
airguard.velocity = -4,-4.5
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-15
fall.recover=0
air.fall=1
id=200

[State 1100, 2]
type = HitDef
trigger1 =animelem=10&& anim=1102
attr = S, SA
animtype  = Med
kill=0
damage    =25;, 10
priority  =4
guardflag = M
pausetime = 12,12
getpower = ifelse((life<=lifemax/5),45,10)
sparkxy = 0,-50
sparkno = 20+(random%4)
guard.sparkno=7 ;
hitsound = F5, 1         
guardsound = F6,1
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
guard.velocity = -6
ground.velocity =-4,-6.5
air.velocity = -4,-6.5
yaccel=.47
airguard.velocity = -4,-4.5
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-15
fall.recover=0
air.fall=1
id=200

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = moveguarded=1
value = -ceil(10*fvar(1))
ID = 200
kill = 0
[State 0, ChangeAnim]
type = ChangeAnim
triggerall =animelem=14 &&anim=1102
trigger1 = pos y <0
value = anim
elem=13

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>0 && animelemtime(14)<0&& anim=1102
y =.45
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=14&& anim=1102
x = 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = animelem=14&& anim=1102
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=14&& anim=1102
statetype = S      ;S,A,C,L
physics = N

;-----1101
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2  && anim=1103
statetype = A       ;S,A,C,L
physics = N
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1 && anim=1103
x = 25
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 =  animelem=1 && anim=1103
x = 0
y = 0
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(2)>=0 && animelemtime(4)<0&& anim=1103
y = -4.5
;ignorehitpause = 
;persistent = 

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


[State 0, ChangeAnim]
type = ChangeAnim
triggerall =animelem=27 &&anim=1103
trigger1 = pos y <0
value = anim
elem=26
[State 0, PlayerPush]
type = PlayerPush
trigger1 = anim=1103
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(24)>0 && animelemtime(27)<0&& anim=1103
y =.35
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=27&& anim=1103
x = 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = animelem=27&& anim=1103
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=27&& anim=1103
statetype = S      ;S,A,C,L
physics = N
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 = animelem=4 &&anim=1103
trigger2 = animelem=20 &&anim=1103
anim = 3002
ID = 3002
pos =14,-42
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)*.75,const(size.yscale)*.75
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 = animelem=12 &&anim=1103
anim = 3002
ID = 3002
pos =-14,-42
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)*.75,const(size.yscale)*.75
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 = animelem=4 &&anim=1103
trigger2= animelem=12 &&anim=1103
trigger3 = animelem=20 &&anim=1103
helpertype = normal ;player
name = "you gon die"
ID =  1101
stateno = 1101
pos = cond(animelemtime(12)=0,-4,4),-52
postype = p1    ;p2,front,back,left,right
facing = cond(animelemtime(12)=0,-1,1)
keyctrl = 0
ownpal = 1
size.xscale =const(size.xscale)*.75
size.yscale =const(size.yscale)*.75

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


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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=1 
movetype = I        
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=0|| p2stateno=5120
movetype = A


[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 = 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   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse(((fvar(15) / p2bodydist y) > .35 && (fvar(15) /p2bodydist y) <= 1.45),0,1)
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 &&( random <249 || var(4)>3 && AIlevel >6 )
triggerall =  (p2statetype=A && var(4)>3|| p2statetype=C)
trigger1 = time=0
v = 2   ;fv = 10
value =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, ChangeAnim]
type = ChangeAnim
trigger1 =time=0&& var(2)>0
value = cond(var(2)=2,1153,1151)

[State 0, VelSet]
type = VelSet
trigger1 =animelem=5  && anim!=1152
x = ifelse(var(2)=0,4.8,7)*(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))
y =ifelse(var(2)=0,6.5,5.5)

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)>0&& anim!=1152
y = -.12

[State 0, PosSet]
type = PosSet
trigger1 = pos y >20 && var(2)>0 && time >25
y = 20

[State 0, Explod]
type = Explod
trigger1 =animelemtime(5)>=0 && var(2)=2 && !movecontact && time%2=0
anim = 1155
ID = 1105
pos =0,-69
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -2,-2
accel = -.5,-.45
random = 50,0
pausemovetime = 0
scale = const(size.xscale),const(size.yscale)
sprpriority = 4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1

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

[State 610, 3]
type = HitDef
trigger1 =var(2)!=2 &&!movecontact&& !movereversed
attr = A, SA
animtype  = heavy
kill=0
damage    = 65
guardflag = M
priority = 4
pausetime =14,14
sparkno = 20+(random%4)
guard.sparkno=7 ;
getpower = ifelse((life<=lifemax/5),143,32)
givepower =33
sparkxy = -10,-46
hitsound = F5, 1        
guardsound = F6,1
ground.type = High
ground.slidetime = 19
ground.hittime  =18
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -cond(var(2)=2,3,7.5),ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-9 
air.hittime = 99 
yaccel=.47
id=200
air.fall=1
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901

[State 610, 3]
type = HitDef
trigger1 =var(2)=2 &&!movecontact&& !movereversed
attr = A, SA
animtype  = heavy
kill=0
damage    = 65
guardflag = H
priority = 4
pausetime =14,14
sparkno = 20+(random%4)
guard.sparkno=7 ;
getpower = ifelse((life<=lifemax/5),143,32)
givepower =33
sparkxy = -10,-46
hitsound = F5, 1        
guardsound = F6,1
ground.type = High
ground.slidetime = 19
ground.hittime  =18
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -cond(var(2)=2,3,7.5),ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-9 
air.hittime = 99 
yaccel=.47
id=200
air.fall=1
forcestand=ifelse(var(8)=1,1,0)
forcenofall=!enemy,hitfall || p2stateno=5901
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = moveguarded=1
value = -ceil(9*fvar(1))
ID = 200
kill = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movecontact && anim!=1152
value = 1152
ignorehitpause=0

[State 0, VelSet]
type = VelSet
trigger1 = anim=1152
x = -cond(var(2)=2,.75,2)
y = 5
;elem = 1



[State 0, ChangeState]
type = ChangeState
trigger1 = time=ifelse(var(2)=0,38,48) || pos y >25 || pos y >=0 && anim=1152
value =52

;---------------------------------------------------------------------------
; 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    = U
movetype= A
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=-1000
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2



[State 640, 2]
type = PlaySnd
trigger1 = time=2
value =100, 2
channel = 0
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 20    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = movehit
movetype =A
ignorehitpause=1
[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|| var(4)=4
v = 2   ;fv = 10
value = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)<4 || var(2)=2 || movehit
movetype = A
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && anim=3000
value = 3003+(var(2)=2)*2
[State 0, Helper]
type = Helper
trigger1 =time=1
helpertype = normal ;player
name = "blade"
ID =  30000
stateno = 30000
pos =4, -54
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
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=0
value = SCA
;value2 = S,NA
time = 1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=1
value = SCA
;value2 = S,NA
time = cond(var(2)=2,14,12)
;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, VelSet]
type = VelSet
trigger1 =animelem=5 && anim=3000
x =7
y =6.25

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)>0&& anim=3000
y = -.12


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=6 && !movecontact && anim=3000 
value =3000
elem=5
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=6 && anim=3000
id = 1105
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=8 && pos y <0 && anim=3000 
value =3000
elem=7

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6 && anim=3000 
x = -3
y = -7.5

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(6)>=0&&animelemtime(8)<0&& anim=3000 
y = .47
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =animelem=8&& anim=3000 
statetype =S
[State 0, PosSet]
type = PosSet
trigger1=animelem=8&& anim=3000 
y = 0

[State 0, VelSet]
type = VelSet
trigger1 =animelem=8&& anim=3000 
y = 0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >10 && !movecontact && anim=3000 && animelem=5
value = 47

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=47
statetype =S
[State 0, PosSet]
type = PosSet
trigger1 = anim=47
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim=47
y = 0
;ignorehitpause = 
;persistent = 


[State 1100, 2]
type = HitDef
trigger1 =!movecontact && anim=3000 && !var(8)
attr = S, SA
animtype  = Med
kill=0
damage    = 0
priority  = 5
guardflag = M
pausetime = 12,12
getpower = 0
givepower =0
sparkxy = 0,-50
sparkno = 20+(random%4)
guard.sparkno=7 ;
hitsound = F5, 1         
guardsound = F6,1
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
guard.velocity = -6
ground.velocity = -9,8
air.velocity = -3.45,8
yaccel=.49
airguard.velocity = -4,-4.5
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-15
fall.recover=0
fall=1
id=205

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

[State 0, TargetState]
type = TargetState
triggerall = NumTarget(205) && p2stateno!=30011 
trigger1 = movehit 
value =30011
ID = 205 
persistent = 0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)=0 && (anim = 3003 || anim=3005)&& animelem=2
value = 3003+(var(2)=2)*2
elem = 1
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =animelem=5&& var(2)=2 && anim=3000
anim = 3011
ID = 1105
pos =9,-28
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = -2,-2
accel = -.5,-.45
random = 50,0
pausemovetime = 0
removetime=-1
scale = const(size.xscale),const(size.yscale)
sprpriority = 4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=0
persistent=0



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)=1 && (anim = 3003 || anim=3005) && pos y <0 && animelem=3
value = 3003+(var(2)=2)*2
elem = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)=1 && (anim = 3005) && vel y <0 && animelem=8
value = anim
elem = 7

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)=2 && (anim = 3005) && pos y<0 && animelem=9
value = anim
elem = 8
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(2)>=0 && animelemtime(3)<0 && (anim=3005)
id = 205
pos =-10,0

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(3)>=0 && animelemtime(4)<0 && (anim=3005)
id = 205
pos =-7,0

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(6)>=0 && animelemtime(7)<0 && (anim=3005)
id = 205
pos =50,-59

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(7)>=0 && animelemtime(8)<0 && (anim=3005)
id = 205
pos =-29,-107

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(1)>=0 && animelemtime(2)<0 && (anim=3003 || anim=3005)
id = 205
pos =30,-48

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(2)>=0 && animelemtime(3)<0 && anim=3003
trigger2 = animelemtime(8)>=0 && animelemtime(9)<0 && anim=3005
id = 205
pos =14,-8

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(3)>=0 && animelemtime(4)<0 && anim=3003
trigger2 = animelemtime(9)>=0 && animelemtime(10)<0 && anim=3005
id = 205
pos =5,-9

[State 0, TargetBind]
type = TargetBind
trigger1 = animelem=4 && anim=3003
trigger2 = animelem=10 && anim=3005
id = 205
pos =0,0

[State 0, VelAdd]
type = VelAdd
triggerall = var(20)=0
trigger1 = anim=3003 || anim=3005
trigger1 = animelemtime(2)<0 
y = -.75
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = var(20)= 0 && frontedgebodydist <-120 
trigger2 = var(20)= 0 && pos y <-300 && animelemtime(7)>0 && anim=3005
v =20   ;fv = 10
value = 1

[State 0, PosSet]
type = PosSet
trigger1 = var(20)  
x = 0
y = -320
persistent =0 
[State 0, VelSet]
type = VelSet
trigger1 = var(20) 
y = 13
x=0
persistent = 0
[State 0, VelSet]
type = VelSet
trigger1 = var(20) && animelem=7 && anim=3005
y = -13
x=0
persistent = 0
[State 0, VarSet]
type = VarSet
trigger1 = var(20) && pos y <-300 && animelemtime(7)>=0 && anim=3005
v = 20    ;fv = 10
value = 2
persistent = 0

[State 640, 2]
type = PlaySnd
trigger1 = var(20) 
value =F0, 1
channel = 1
persistent = 0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim=[3003,3005]
value = 0
movecamera = 0,0
ignorehitpause = 1
;persistent = 


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)=1 && (anim = 3003) && pos y <0 && animelem=10
value = anim
elem = 8

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)=1 && (anim = 3005) && pos y <0 && animelem=16
value = anim
elem = 14

[State 0, HitAdd]
type = HitAdd
trigger1 = animelem=3,1&&  (anim=3003 || anim=3005)
trigger2 = animelem=9,1&& anim=3005
value = 1
[State 640, 2]
type = PlaySnd
trigger1 = animelem=8 && var(20)=2
value =100, 0
channel = 0
persistent=0
[State 640, 2]
type = PlaySnd
trigger1 = animelem=3 && anim=3005
value =180, 0
channel = 0
persistent=0
[State 0, VelSet]
type = VelSet
trigger1 = var(20)=2 && animelemtime(8)>=0
y = 13
x=0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=4 && anim=3003
trigger2 = animelem=10 && anim=3005
x = 2
y = -5.5


[State 0, TargetState]
type = TargetState
trigger1 = animelem=4 && anim=3003
trigger2 = animelem=10 && anim=3005
value =851
ID = 205
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = targetVelSet
trigger1 = animelem=4,1 && anim=3003
trigger2 = animelem=10,1 && anim=3005
x = 3
y = -5.5
[State 0, VarSet]
type = VarSet
trigger1 = animelem=4,1 && anim=3003
trigger2 = animelem=10,1 && anim=3005
v = 11   ;fv = 10
value = 1
[State 0, Explod]
type = Explod
trigger1 = animelem=4,1 && anim=3003
trigger2 = animelem=10,1 && anim=3005
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

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(4)>=0&& animelemtime(10)<0 && anim=3003 
trigger2 =animelemtime(10)>=0&& animelemtime(16)<0 && anim=3005
y = .47
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=10&& anim=3003 
trigger2 = animelem=3&& (anim=3003 || anim=3005)
trigger3 = animelem=16&& anim=3005
trigger4 = animelem=9&& anim=3005
y = 0
[State 810, Hurt 11]
type = targetLifeAdd
trigger1 = animelem=3&&  (anim=3003 )
trigger2 = animelem=9&& anim=3005
value = -ceil(cond(var(2)!=2,285,390)*fvar(1))
persistent=0
kill=0

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=3&&  (anim=3003 || anim=3005)
trigger2 = animelem=9&& anim=3005
time =14
freq = 60
ampl = -8
phase = 90
;ignorehitpause = 
;persistent = 

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=3 && var(2)=2&& anim=3005
trigger2 = animelem=8 && var(2)=2&& anim=3000
id = 1105
;ignorehitpause = 
;persistent = 

[State 640, 2]
type = PlaySnd
trigger1 = animelem=3&&  (anim=3003 || anim=3005)
trigger2 = animelem=9&& anim=3005
value =F7, 0
channel = 1


[State 0, PosSet]
type = velSet
trigger1 = animelem=10&& anim=3003
trigger2 = animelem=3&&  (anim=3003 || anim=3005)
trigger3 = animelem=16&& anim=3005
trigger4 = animelem=9&& anim=3005
y = 0
x=0

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



;---------------------------------------------------------------------------
;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 30011]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = (3004 +(enemy,var(2)=2)*2)*(cond(var(59)=24,9,1))
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 0
movecamera = 1,0

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = animelem=2 &&enemy,animelem=1 && (anim=3004*(cond(var(59)=24,9,1)) || anim=3006*(cond(var(59)=24,9,1)))
value =anim
elem = 1
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = animelem=3 &&enemy,animelem=2 && (anim=3004*(cond(var(59)=24,9,1)) || anim=3006*(cond(var(59)=24,9,1)))
value =anim
elem = 2

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemy,animelem=3&& (anim=3004*(cond(var(59)=24,9,1)) || anim=3006*(cond(var(59)=24,9,1)))
value = anim
elem =3
persistent=0


[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = animelem=8 &&enemy,animelem=7 && anim=3006*(cond(var(59)=24,9,1))
value =anim
elem = 7

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = animelem=9 &&enemy,animelem=8 && anim=3006*(cond(var(59)=24,9,1))
value =anim
elem = 8

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemy,animelem=3&& anim=3006*(cond(var(59)=24,9,1))
value = anim
elem =3
persistent=0

[State 0, VelAdd]
type = VelAdd
trigger1 = vel y !=0 && !gethitvar(isbound)
y = .45
;ignorehitpause = 
;persistent = 


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

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

[Statedef -3]
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(10) = %d  vel x = %f"
params = helper(10003),var(16),pos y
;ignorehitpause = 
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =stateno!=3000
id = 1105
[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, 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,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 20    ;fv = 10
value = gametime
ignorehitpause = 1







[State 0, VarSet] ; char id
type = VarSet
trigger1 =1 
v = 59    ;fv = 10
value = 7
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 7   ;fv = 10
value = 610


[State 0, PosSet]
type = PosSet
trigger1 = stateno=[200,440]
trigger2 = anim=1100
trigger3 = stateno=40
trigger4 = stateno=120 && statetype!=A
trigger5 = stateno=10
trigger6 = stateno=12
trigger7 =statetype!=A&&time=1&& prevstateno=[5000,5010]
y = 0
;ignorehitpause = 
;persistent = 

;[State 0, VarSet]
;type = VarSet
;trigger1 = movecontact && stateno=1150 && enemy,backedgebodydist <20&& var(2)!=2
;v = 16    ;fv = 10
;value = 1
;;ignorehitpause = 
;;persistent = 
;[State 0, VarSet]
;type = VarSet
;trigger1 = p2movetype!=H || enemy,gethitvar(hittime)<4 || p2statetype=A
;v = 16    ;fv = 10
;value = 0
;
;[State 0, PosAdd]
;type = PosAdd
;trigger1 = var(16)=1 && statetype!=A && (p2statetype=S || p2statetype=C) 
;x = -4.25
[State 0, 2]
type = VelSet
triggerall = stateno!=[1900,1999]
triggerall = stateno!=5151 && stateno!=[191,199]
triggerall = stateno!=[180,189]
triggerall = stateno!=[281,288]
triggerall = stateno!=[800,899]
trigger1 = movetype=I && statetype!=A
y = .5*-(sin(time/10))


[State 0, VarSet]
type = VarSet
trigger1 = numhelper(1001)=0
v = 15    ;fv = 10
value = 0
;[State 0, VarSet]
;type = VarSet
;trigger1 =  var(17)=1 
;v = 16    ;fv = 10
;value = 0
;ignorehitpause =1 
;[State 0, VarSet]
;type = VarSet
;trigger1 =var(16)>0 && command!="holdback" &&var(17)=0 &&AILevel=0
;trigger2=var(16)>0 &&(vel x =0&&movetype=I&&ctrl && statetype=S||(vel x >0&&statetype!=A&&movetype!=A)||stateno=[800,899])&&AILEvel>0&&var(17)=0  
;v = 17    ;fv = 10
;value =7
;ignorehitpause =1 
;[State 1, VarSet]
;type = Varadd
;;triggerall = var(17)=0
;trigger1 = command="holdback"&&AILevel=0 && stateno!=[800,899] 
;trigger2 = (vel x <0||statetype=A||(vel x =0 && movetype=A)||(statetype=C))&&AILevel>0&&stateno!=[800,899] 
;v = 16    ;fv = 10
;value = 1
;ignorehitpause = 1
;[State 2, VarSet]
;type = VarSet
;trigger1 = var(16)>0 && command="holdback"&&AILevel=0
;trigger2 = var(16)>0 &&(vel x <0||statetype=A||(vel x =0 && movetype=A))&&AILevel>0&&stateno!=[800,899] 
;v = 17    ;fv = 10
;value = 0
;[State 3, VarSet]
;type = Varadd
;trigger1 =var(17)>0 && command!="holdback" &&AILevel=0
;trigger2 =var(17)>0 && (vel x =0&&movetype=I&&ctrl||(vel x >0&&statetype!=A&&movetype!=A)||stateno=[800,899])&&AILEvel>0 
;v = 17    ;fv = 10
;value = -1

;[State 0, VarSet]
;type = VarSet
;trigger1 =  var(19)=1 
;v = 18    ;fv = 10
;value = 0
;ignorehitpause =1 
;[State 0, VarSet]
;type = VarSet
;trigger1 =var(18)>0 && command!="holddown" &&var(19)=0 &&AILevel=0
;trigger2=var(18)>0 &&(statetype=S&&movetype=I&&ctrl||(vel x >0&&statetype!=A&&movetype!=A)||stateno=[800,899])&&AILEvel>0&&var(19)=0  
;v = 19    ;fv = 10
;value =7
;ignorehitpause =1 
;[State 0, VarSet]
;type = Varadd
;;triggerall = var(17)=0
;trigger1 = command="holddown"&&AILevel=0 && stateno!=[800,899] 
;trigger2 = (statetype=C||statetype=A||(movetype=A)||statetype=L||stateno=105)&&AILevel>0&&stateno!=[800,899] 
;v = 18    ;fv = 10
;value = 1
;ignorehitpause = 1
;[State 0, VarSet]
;type = VarSet
;trigger1 = var(18)>0 && command="holddown"&&AILevel=0
;trigger2 =var(18)>0 &&(statetype=C||statetype=A||(movetype=A)||statetype=L)&&AILevel>0&&stateno!=[800,899] 
;v = 19    ;fv = 10
;value = 0
;[State 0, VarSet]
;type = Varadd
;trigger1 =var(19)>0 && command!="holddown" &&AILevel=0
;trigger2 =var(19)>0 &&(statetype=S&&movetype=I&&ctrl||(vel x >0&&statetype!=A&&movetype!=A)||stateno=[800,899])&&AILEvel>0&&AILEvel>0 
;v = 19    ;fv = 10
;value = -1
 

[State 0, VarSet]
type = VarSet
trigger1 = (stateno=810||stateno=840)
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=5


;-------------------------stun
[State 0, VarSet]
type = Varadd

triggerall = stateno=200 ||stateno=400
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 18;100
ignorehitpause=1

;[State 0, VarSet]
;type = Varadd
;
;triggerall = 
;trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
;v = 6   ;fv = 10
;value =78;210
;ignorehitpause=1
[State 0, VarSet]
type = Varadd

triggerall = stateno=440||stateno=640 ||stateno=610
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =85;210
ignorehitpause=1
[State 0, VarSet]
type = Varadd

triggerall = anim=600 ||anim=601||stateno=430 
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 19;45
ignorehitpause=1

[State 0, VarSet]
type = Varadd

triggerall = stateno=1050 ||stateno=210||stateno=410
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 98;275
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=1100|| stateno=240
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 39;77
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=1102
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 18;77
ignorehitpause=1
[State 0, VarSet]
type = Varadd

triggerall = stateno=1150
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 65;150
ignorehitpause=1

[State 0, VarSet]
type = Varadd

triggerall = stateno=230 ||stateno=630
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 24;91
ignorehitpause=1

