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

; var(0):= 1800, 7072, 7073, 9999
; var(1):= 1150, 3000, 1800, 7072, 7073, 7074, 9999
; var(2):= 1000, 1049, 1100, 1150, 3000, 1800, 1001, 1003, 1005, 1006, 3001, 7072, 7073, 9999, -1
; var(3):= -3, 1005, 1006, 3001, 7072, 7073, 9999
; var(4):= 810, -3, 1001, 1005, 3001, 7072, 7073, 9999
; var(5):= 810, -3, 7072, 7073, 9999
; var(6):= -3, 1001, 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):= -3, 7073, 9999
;var(12):= 9999
;var(13):= -3, 9999
;var(14):= 7072
;var(15):= 1001, 1003, 1006, 9999
;var(17):= -1
;var(18):= -1
;var(20):= 3000, 7073, 9999
;var(21):= 7073, 9999
;var(22):= 9999
;var(25):= 1001, 9999
;var(29):= 810
;var(30):= 9999
;var(31):= 9999
;var(39):= 9999
;var(40):= 9999
;var(41):= 9999
;var(42):= 9999
;var(45):= 1005, 1006, 3001, -1
;var(46):= 1005, 1006, 3001, -1
;var(48):= 1005, 1006, 3001
;var(52):= -3, 1003
;var(59):= -3

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

; fvar(1):= 1001, 1003
; fvar(5):= -3, 9999
;fvar(11):= 1904
;fvar(15):= 9999
;fvar(36):= 200, 210, 230, 240, 400, 410, 430, 440, -3










[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1001
power = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno =6000
guard.sparkno=6000
KO.echo = 0
volume = 100
IntPersistIndex = 50
FloatPersistIndex = 36

[Size]
xscale = 1.25          ;Horizontal scaling factor.
yscale = 1.0619469026548    
ground.back = 11    ;Player width (back, ground)
ground.front = 19    ;Player width (front, ground)
air.back = 8        ;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 = 0, -80   ;Approximate position of head
mid.pos = 0, -45    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 2.4     ;Walk forward
walk.back = -1.65    ;Walk backw?ard
run.fwd  = 5.2, -4   ;Run forward (x, y)
run.back = -4.95,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.5  ;Neutral jumping velocity (x, y)
jump.back = -2   ;Jump back Speed (x, y)
jump.fwd = 1.9     ;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 = .52       ;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 = "Please, don't get up"
victory2 = "The strong protect the weak!"
victory3 = "Ready to quit yet?"
;---------------------------------------------------------------------------
; Variable usage:
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(1)  - Used in kfm.cmd for combo condition (updated every tick)
; var(2)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;           held (remembered from state 800 through state 810).

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

;persistent = 

[State 100, 1]
type = VelSet
trigger1 = time=0
x = (const(velocity.run.fwd.x)*const(size.xscale))*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=70,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=70,helper(8084),var(1),0),0))/100))
y=const(velocity.run.fwd.y)

;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1 
value = F0,2
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


;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(3)<0
y = .46
[State 0, VelSet]
type = VelSet
trigger1 = animelem=3
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=3
y = 0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
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    =S
physics =N
anim =105
ctrl=0
sprpriority = 1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2
statetype = A      ;S,A,C,L

[State 100, 1]
type = VelSet
trigger1 = animelem=2
x = (const(velocity.run.back.x)*const(size.xscale))*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=70,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=70,helper(8084),var(1),0),0))/100))
y=const(velocity.run.back.y)
[State 0, NotHitBy]
type = NotHitBy
trigger1 =animelemtime(2)<1
value = SCA
;value2 = S,NA
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=2
value = F0,4
channel = 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

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
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, AssertSpecial]
type = AssertSpecial
trigger1 = matchover
flag = invisible



;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 281]
type = S
ctrl = 0
anim = 180+((helper(7000),var(56)>helper(7000),var(57)-2) && random %5>2)
velset = 0,0
facep2=1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && anim=181 && random%10=1
value =182
;ignorehitpause = 
;persistent = 


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0 ;&& anim=181
value = S180,random%3
channel = 0

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = (anim=181||anim=182) && animelem=5
value = anim
elem = 1
;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
sprpriority =5
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = (anim=181||anim=182) && animelem=5 && time <60
value = anim
elem = 1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=5 && anim=181
value = S180,3
channel = 0

[State 0, Helper]
type = Helper
triggerall = time <32
trigger1 =animelem=4 && anim=182
trigger2 =animelemtime(4)>1&&animelemtime(4)<8 && anim=182
trigger2= time%2=0
helpertype = normal ;player
name = "blade"
ID =  1801
stateno = 1800
pos = cond(random%2,-random%200,random%200),-100-random%100
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =.9
size.yscale =const(size.yscale)

[State 0, Helper]
type = Helper
trigger1 =animelem=4 && anim=182
helpertype = normal ;player
name = "blade"
ID =  1801
stateno = 1800
pos = 0,-110
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =.9
size.yscale =const(size.yscale)
persistent=0

[State 0, Helper]
type = Helper
trigger1 =animelem=4 && anim=181
helpertype = normal ;player
name = "blade"
ID =  1801
stateno = 1800
pos = 0,-110
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =.9
size.yscale =const(size.yscale)
persistent=0


[State 0, Helper]
type = Helper
trigger1 =animelem=4 && anim=181
helpertype = normal ;player
name = "blade"
ID =  1801
stateno = 1800
pos = 0,-140
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =.9
size.yscale =const(size.yscale)
persistent=0


[State 0, Helper]
type = Helper
trigger1 =animelem=4 && anim=181
helpertype = normal ;player
name = "blade"
ID =  1801
stateno = 1800
pos = 0,-180
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =.9
size.yscale =const(size.yscale)
persistent=0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim=181 && enemy,vel y=0
value = 0
movecamera = 1,0
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim=182 && enemy,vel y=0
value = 0
movecamera = 0,0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(8)>=0 && anim=181 && pos y >-320
y = -7
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(9)>=0 && anim=182 && frontedgebodydist >-110
x = 12
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=8 && (anim=181||anim=182)

value = S100,4
channel = 1

[State 0, ChangeState]
type = ChangeState
trigger1 =matchover 
value =0
persistent=0
ctrl=1
;------------------------------------------------------
[Statedef 191]
type = A
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=1905&& enemy,var(59)=13
value =1900
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1 && numhelper(7000)
trigger1 = enemy,var(59)=14
trigger2 =teamside=2
trigger2 = p2stateno=1901 && enemy,var(59)=14
value =1901
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1 && numhelper(7000)
trigger1 = enemy,var(59)=17
trigger2 =teamside=2
trigger2 = p2stateno=1903 && enemy,var(59)=17
value =1902
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy,var(59)=20 
value =1903
ctrl = 0
[State 0, ChangeState]
type = ChangeState
trigger1 =teamside=1 && numhelper(7000)
trigger1 = enemy,var(59)=23
trigger2 =teamside=2
trigger2 = p2stateno=1900 && enemy,var(59)=23
value =1904
ctrl = 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 -3, Hit0]
type = PlaySnd
trigger1= animelem=16

value =190,0
channel=0
persistent=0

[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 1.5
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=16
y = 0
[State 0, PosSet]
type = velSet
trigger1 = animelem=16
y = 0


[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;------------------------------------------------------
[Statedef 1900]
type = A
physics=N
ctrl = 0
anim = 191
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 = Posadd
trigger1 =time=0  && !var(40)
x = 240
;y=-25

[State 0, PosSet]
type = Posset
trigger1 =time=0 
y=-215
;ignorehitpause = 
;persistent = 
[State 0, Turn]
type = Turn
trigger1 = time=0

[State 0, VelSet]
type = VelSet
trigger1 = roundstate!=0 && pos y <0
y = 9
x=9
[State 0, VelSet]
type = VelSet
trigger1 = time =[16,38]
x = 0
y = 0
[State 0, AllPalFX]
type = PalFX
trigger1 = time =[16,38]
time = 1
add = 50,50,50
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=3 && pos y <0 && anim!=0
value = anim
elem = 1

[State 0, Explod]
type = Explod
trigger1 =time=0 && !var(40)
anim = 1056
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
pausemovetime = 0
removetime=-1
scale = const(size.xscale),const(size.yscale)
sprpriority =3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
persistent=0
ignorehitpause=1



;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=3&& anim!=0
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 =  animelem=3&& anim!=0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3 && anim!=0
value = F7,1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=3 && anim!=0
time = 8
freq = 60
ampl = -8
phase = 90
;ignorehitpause = 
;persistent = 

;[State 0, VelAdd]
;type = VelAdd
;trigger1 =animelemtime(1)>=0&&animelemtime(3)<0  && anim!=0
;y = .47
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=3&& anim!=0
x = helper(7000),pos x
y = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=3&& anim!=0
id = 190
;ignorehitpause = 
;persistent = 


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 0
[State 0, Turn]
type = Turn
trigger1 = anim=0 
persistent=0
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;------------------------------------------------------
[Statedef 1901]
type = A
physics=N
ctrl = 0
anim = 192
velset = 0,0
[State 0, ChangeState]
type = ChangeState
trigger1 = time>enemy,time && teamside=2
value =1901
ctrl = 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 =(animelemtime(1)>=0&&animelemtime(2)<0||animelemtime(3)>=0&&animelemtime(4)<0||animelemtime(5)>=0&&animelemtime(6)<0||animelemtime(7)>=0&&animelemtime(8)<0)&& anim!=0 && !var(40)
trigger1= time%3=0
x = (random%120)*cond(random%2,1,-1)
y=-random%140

[State 0, PosSet]
type = Posset
trigger1 = animelem=2 && anim!=0
trigger2 = animelem=4 && anim!=0
x = (random%100)*cond(random%2,1,-1)
y=-random%140
[State 0, PosSet]
type = Posset
trigger1 = animelem=8 && anim!=0
trigger2= animelem=6 && anim!=0
x = (random%80)*cond(random%2,1,-1)
y=-60
[State 0, PosSet]
type = Posset
trigger1 = animelem=8 && anim!=0
x = (random%80)*cond(random%2,1,-1)
y=0

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

[State 0, Explod]
type = Explod
trigger1 =(animelemtime(1)>=0&&animelemtime(2)<0||animelemtime(3)>=0&&animelemtime(4)<0||animelemtime(5)>=0&&animelemtime(6)<0||animelemtime(7)>=0&&animelemtime(8)<0)&& anim!=0
trigger1= time%3=0
trigger2 = animelem=2 && anim!=0
trigger3 = animelem=4 && anim!=0
trigger4 = animelem=6 && anim!=0
trigger5 = animelem=8 && anim!=0
anim = 1900+cond(animelemtime(4)=0,2,cond(animelemtime(6)=0,4,cond(animelemtime(8)=0,6,random%8)))
ID = 1050
pos = 0,-50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 0
removetime=cond(animelemtime(4)=0||animelemtime(6)=0||animelemtime(8)=0,15,4)
scale = const(size.xscale),const(size.yscale)
sprpriority =0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =(animelemtime(1)>=0&&animelemtime(2)<0||animelemtime(3)>=0&&animelemtime(4)<0||animelemtime(5)>=0&&animelemtime(6)<0||animelemtime(7)>=0&&animelemtime(8)<0)&& anim!=0
trigger1= time%3=0
trigger2 = animelem=2 && anim!=0
trigger3 = animelem=4 && anim!=0
trigger4 = animelem=6 && anim!=0
trigger5 = animelem=8 && anim!=0
anim = 1901+cond(animelemtime(4)=0,2,cond(animelemtime(6)=0,4,cond(animelemtime(8)=0,6,random%8)))
ID = 1050
pos = 0,-50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 0
removetime=cond(animelemtime(4)=0||animelemtime(6)=0||animelemtime(8)=0,15,4)
scale = const(size.xscale),const(size.yscale)
sprpriority =0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause=1



;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

;[State 0, VelAdd]
;type = VelAdd
;trigger1 =animelemtime(1)>=0&&animelemtime(3)<0  && anim!=0
;y = .47
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=9&& anim!=0
x = helper(7000),pos x
y=-210
persistent=0
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(9)>=0&&animelemtime(10)<0&& anim!=0
y = .6
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=10&& anim!=0
x = 0
y = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =  animelem=10&& anim!=0
value = F40,0 
channel=1
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 =  animelem=10&& anim!=0
y = 0

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = roundstate!=0 
value = 193
persistent=0

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 =time=0  && !var(40)
x = 17
[State 0, VelSet]
type = VelSet
trigger1 =animelem=6 && anim!=0
x = -1
y = -2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=193 && animelem=7 && pos y <0
value = anim
elem = 6
;ignorehitpause = 
;persistent = 



[State 0, VelSet]
type = Veladd
trigger1 =animelemtime(6)>=0&&animelemtime(7)<0 && anim!=0
y = .45
[State 0, VelSet]
type = VelSet
trigger1 = animelem=7&& anim!=0
x = 0
y = 0
;ignorehitpause = 
;persistent = 

[State 0, PosSet]
type = PosSet
trigger1 = animelem=7&& anim!=0
x =  helper(7000),pos x
y = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=7&& anim!=0
value = F40,0
channel = 1


[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, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 0

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = roundstate!=0 
value = 194
persistent=0

[State 0, PosAdd]
type = PosAdd
trigger1 =time=0
y = -45
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=194 && animelem=3 && pos y <0
value = anim
elem = 2
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(1)>=0&&animelemtime(3)<0 && roundstate!=0&& anim!=0
y = 24
;ignorehitpause = 
;persistent = 


[State 0, PosSet]
type = PosSet
trigger1 = animelem=3&& anim!=0
y = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3&& anim!=0
value = F7,1
channel = 1
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=3 && anim!=0
time = 8
freq = 60
ampl = -7
phase = 90
[State 0, Explod]
type = Explod
trigger1 = animelem=10 && anim!=0
anim = 1908
ID = 190
pos = 25,-54
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 =5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1

[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, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 0

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

;------------------------------------------------------
[Statedef 1904]
type = A
physics=N
ctrl = 0
anim =195
velset = 0,0


[State 0, PosAdd]
type = Posset
trigger1 =time=0
y = 0
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=4 && anim!=0
time = 40
freq = 60
ampl = -7
phase = 90
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=195 && animelem=6 &&enemy,anim=194
value = anim
elem = 4
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && !var(40)
x = -35



[State 1000, 1]
type = PlaySnd
trigger1 =animelem=4 && anim!=0
value = 100, 1
channel=3
[State 0, Explod]
type = Explod
trigger1 = animelem=4 && anim!=0
anim = 1909
ID = 190
pos = 25,-77
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 =5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1 = animelem=5 && anim!=0
anim = 1910
ID = 191
pos = 69,-77
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime=58
scale = const(size.xscale),const(size.yscale)
sprpriority =5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1 = time=87&& anim!=0
anim = 1911
ID = 192
pos = 93,-77
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime=56
scale = 1.05,.7
sprpriority =6
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, VarSet]
type = Varadd
trigger1 = numexplod(191) && time <87
fv = 11    ;fv = 10
value = ((time-83)*.35)
;ignorehitpause = 
;persistent = 

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = numexplod(191) && time <95
ID =191
scale = 1+fvar(11),const(size.yscale)



[State 0, AllPalFX]
type = AllPalFX
trigger1 = time=125
time = 20
add = 0,0,0
mul = 256,256,256
sinadd = 256,256,256,60
invertall = 0
color = 256
;ignorehitpause = 
;persistent = 

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

[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, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 0

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time = 160
value = 0
;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

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

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !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 = 200                       ;Change animation (Def: no change)
                  ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)



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

[State 0, VarSet]
type = VarSet
trigger1 =time=1 
fv = 36    ;fv = 10
value = 0

[State 200, 1]
type = HitDef
triggerall = anim=200
trigger1 = AnimElem = 2
attr = S, NA   
kill=0                                 
damage =35, 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          
sparkno = (random%4)
guard.sparkno=6                
sparkxy = -10, -65               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 0         
guardsound = F6, 0              
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10             ;Time that the opponent slides back
ground.hittime  = 10          ;Time opponent is in hit state
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -6,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,-7+(enemy,hitfall*3)          ;X-velocity at which opponent is pushed,
air.hittime = 99               
yaccel=.47
id=200
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=821) || p2stateno=5901
fall = p2stateno=821 
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
;ignorehitpause = 
;persistent = 


[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 0, NotHitBy]
type = NotHitBy
trigger1 = pos y >=0 && time >2 && alive
value = SCA,NT,ST,HT
;value2 = S,NA
time = 8
;ignorehitpause = 
;persistent = 

[State 5030, 3]
type = selfState
trigger1= pos y >=0 && time >2
value = ifelse(!alive,5050,52)

;---------------------------------------------------------------------------
; Standing strong punch

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 4
 
ctrl = 0
velset = 0,0
anim = 220;ifelse(fvar(15) <50,210,211)
sprpriority = 1
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=1 
fv = 36    ;fv = 10
value = 0

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


[State 0, VarSet]
type = VarSet
trigger1 =animelem=6 
fv = 36    ;fv = 10
value = 16*const(size.xscale)
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=6
x = 5*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7 
fv = 36    ;fv = 10
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=7
x = -16*const(size.xscale)
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 1
channel = 1

[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/3),114,28)   
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 36    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

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



[State 230, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
kill=0                 
damage = 36
guardflag = MA
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
priority =2, Hit 
pausetime = 8,8  
sparkno = (random%4)
guard.sparkno=6 ; 0
sparkxy = -10,-75
hitsound = F5, 2         
guardsound = F6, 0  
ground.type = Low
ground.slidetime = 8             ;Time that the opponent slides back
ground.hittime  = 10 
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -6,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,-7+(enemy,hitfall*3)
yaccel=.47
id=200

forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=821) || p2stateno=5901
fall = p2stateno=821
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 5
 
ctrl = 0
velset = 0,0
anim = 250
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 36    ;fv = 10
value = 0
[State 240, 1]
type = PlaySnd
trigger1 = Time = 2
value = F0, 3
channel = 1

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=1 
x = 6*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=1 
fv = 36    ;fv = 10
value = 6*const(size.xscale)

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=3 
x = 5*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3
fv = 36    ;fv = 10
value = 11*const(size.xscale)



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

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=5 
x = -3*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5
fv = 36    ;fv = 10
value = 8*const(size.xscale)

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=6 
x = -8*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6
fv = 36    ;fv = 10
value = 0

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

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

[Statedef 400]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 5
  
ctrl = 0
anim = 400
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 36    ;fv = 10
value = 0


[State 0, PosAdd]
type = PosAdd
trigger1=animelem=2 && anim=405
x = 9*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2 && anim=405
fv = 36    ;fv = 10
value = 9*const(size.xscale)

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=3 && anim=405
x = 2*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3 && anim=405
fv = 36    ;fv = 10
value = 11*const(size.xscale)
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=5 && anim=405
x = 14*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5 && anim=405
fv = 36    ;fv = 10
value = 25*const(size.xscale)

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=6 && anim=405
x = -9*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6 && anim=405
fv = 36    ;fv = 10
value = 16*const(size.xscale)
[State 0, PosAdd]
type = PosAdd
trigger1=animtime=0 && anim=405
x = -16*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animtime=0 && anim=405
fv = 36    ;fv = 10
value = 0
[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 0
channel = 1

[State 400, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
kill=0                 
damage = 39, 0    
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority =2, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 8,8        
sparkno = (random%4)
guard.sparkno=6  ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -44           ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57)
givepower=18   
hitsound = F5, 0         
guardsound = F6, 0  
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 6             ;Time that the opponent slides back
ground.hittime  = 10           ;Time opponent is in hit state
guard.ctrltime=ifelse(p2statetype=A,99,8)
ground.velocity = -6,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,-7+(enemy,hitfall*3)
;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!=821) || p2stateno=5901
fall = p2stateno=821
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 6
 
ctrl = 0
anim = 410
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 36    ;fv = 10
value = 0
[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0, 1
channel = 1


[State 0, PosAdd]
type = PosAdd
trigger1=animelem=2 
x = 9*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2 
fv = 36    ;fv = 10
value = 9*const(size.xscale)
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
animtype  = Medium
kill=0                 
damage =70
guardflag = MA
pausetime = 14,14
sparkno = 10+(random%4)
guard.sparkno=6  ; 1
getpower =  ifelse((life<=lifemax/5),143,72)
givepower=33
sparkxy = -10,-55
hitsound = F5, 1        
guardsound = F6,1 
getpower =  ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
guard.ctrltime=ifelse(p2statetype=A,99,15)
ground.velocity = -7.5,ifelse(var(8)=1,-9,0)
air.velocity = -3.45,-7 
air.hittime=99
yaccel=.47
id=200
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]
;value = 0,0
;ignorehitpause = 
;persistent = 


[State 0, PosAdd]
type = PosAdd
trigger1=animelem=3 
x = 10*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3 
fv = 36    ;fv = 10
value = 19*const(size.xscale)
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=5 
x = 6*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5 
fv = 36    ;fv = 10
value = 25*const(size.xscale)

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=6 
x = -9*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6 
fv = 36    ;fv = 10
value = 16*const(size.xscale)
[State 0, PosAdd]
type = PosAdd
trigger1=animtime=0 
x = -16*const(size.xscale)
[State 0, VarSet]
type = VarSet
trigger1 =animtime=0 
fv = 36    ;fv = 10
value = 0
;This is the first hit, triggered on the 3rd element of animation.

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

;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 5
  
ctrl = 0
anim = 430
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 36    ;fv = 10
value = 0
;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 = 36
guardflag = M
pausetime = 8,8  
sparkno = (random%4)
guard.sparkno=6 ; 0
priority =2, Hit 
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
sparkxy = -5,-35
hitsound = F5, 2         
guardsound = F6, 0  
ground.type = Low
ground.slidetime = 10             ;Time that the opponent slides back
ground.hittime  = 10  
guard.ctrltime=ifelse(p2statetype=A,99,8)          ;Time opponent is in hit state
ground.velocity = -6,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,-7+(enemy,hitfall*3)
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!=[1025,1045]) || p2stateno=5901
fall = p2stateno=[1025,1045]


[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0

value = 11
ctrl = !Helper(7000),var(34)

;---------------------------------------------------------------------------
;Crouch Strong Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  =0;ifelse(var(8)=1,0,15); 7
 
ctrl = 0
anim = 440
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 36    ;fv = 10
value = 0
[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = F0, 3
channel = 1


[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3
x = 15
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3
fv = 36    ;fv = 10
value = 15

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = -15
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6
fv = 36    ;fv = 10
value = 0





[State 440, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
kill=0                 
damage = 75
hitflag = MAF
guardflag = L
pausetime = 14,14
sparkno = 10+(random%4)
priority =3, Hit 
guard.sparkno=6 ; 1
sparkxy = -5,-15
hitsound = F5, 3         
guardsound = F6, 1  
getpower =  ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = low
ground.slidetime = 10
ground.hittime  = 21
guard.ctrltime=ifelse(p2statetype=A,99,16)
ground.velocity = -2.23,-6.8
air.velocity = -2.23,-6.8
guard.velocity = -7
fall = 1
id=440
yaccel=.43
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 = 2 && (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 = 75
guardflag = L
pausetime = 14,14
sparkno = 10+(random%4)
priority =3, Hit 
guard.sparkno=6 ; 1
sparkxy = -5,-15
hitsound = F5, 3         
guardsound = F6, 1  
getpower =  ifelse((life<=lifemax/5),143,72)
givepower=33
ground.type = low
ground.slidetime = 10
ground.hittime  = 21
guard.ctrltime=ifelse(p2statetype=A,99,16)
ground.velocity = -2.23,-6.8
air.velocity = -2.23,-6.8
guard.velocity = -7
fall = 1
id=200
yaccel=.43
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 = 600
sprpriority = 2

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

[State 600, 2]
type = HitDef
triggerall = anim=600
trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0                 
damage =35+(var(12)&&prevstateno=1049)*35
guardflag = HA
priority = 2
pausetime =8,8        
sparkno = (random%4)
guard.sparkno=6  ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -46               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 0         
guardsound = F6, 0  
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14 
ground.velocity = -6.5
air.velocity = -3,-7+(enemy,hitfall*3)
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)
;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!=821) || p2stateno=5901
fall = p2stateno=821
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 = 620
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 =72+(var(12)&&prevstateno=1049)*35
guardflag = HA
pausetime =14,14
sparkno = 10+(random%4)
priority =3, Hit 
guard.sparkno=6 ; 1
getpower =  ifelse((life<=lifemax/5),143,72)
givepower=33 
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,-7+(enemy,hitfall*3)
air.hittime = 99 
yaccel=.47
id=200

forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=821) || p2stateno=5901
fall = p2stateno=821
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 = 630
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno=1049  && time=0
y = 0
[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = F0,2
channel = 1
[State 630, 2]
type = HitDef
trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0                 
damage =36+(var(12)&&prevstateno=1049)*35
guardflag = HA
priority = 2
pausetime =8,8        
sparkno =(random%4)
guard.sparkno=6 ; 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -36               ;X-offset for the "hit spark" rel. to p2,
getpower=ifelse((life<=lifemax/5),114,57) 
givepower=18
hitsound = F5, 2         
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,-7+(enemy,hitfall*3)
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)
;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!=821) || p2stateno=5901
fall = p2stateno=821
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 = 650
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno=1049  && time=0 
y = 0
[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value =F0,3
channel = 1
[State 640, 3]
type = HitDef

trigger1 = !movecontact&&!movereversed
attr = A, NA
kill=0                 
damage = 72+(var(12)&&prevstateno=1049)*35
guardflag = HA
pausetime =14,14
priority =3, Hit 
sparkno = 10+(random%4)
guard.sparkno=6  ; 1
getpower =  ifelse((life<=lifemax/5),143,72)
givepower=33 
sparkxy = -10, -36   
hitsound = F5, 3         
guardsound = F6, 1  
ground.type = High
ground.slidetime = 5
ground.hittime  =14 
guard.ctrltime=14 
ground.velocity = -6.5
air.velocity = -3,-7+(enemy,hitfall*3)
air.hittime = 99 
yaccel=.47
id=200

forcestand=ifelse(var(8)=1,1,0)
forcenofall=(!enemy,hitfall &&  p2stateno!=821) || p2stateno=5901
fall = p2stateno=821
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0

;---------------------------------------------------------------------------
;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 = p2bodydist x <32
triggerall = p2statetype=S ||p2statetype=C
Trigger1 = p2stateno=1008 || p2stateno=1007 ||p2stateno=5901 ||cond(numhelper(8083),helper(8083),var(0)=69,0) || cond(numhelper(8084),helper(8084),var(0)=69,0) 
attr = S, NT         ;Attributes: Standing, Normal Throw
hitflag = MAF         ;Affect only ground people who are not being hit
priority = 2   ;Throw has low priority, must be miss or dodge type.
sparkno =-1
guard.sparkno=-1         ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 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 = p2bodydist x <32
triggerall = p2movetype!=H || p2stateno=[120,140]
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         ;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 = 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 = 0
ctrl = !Helper(7000),var(34)

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

[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd=ifelse((life<=lifemax/5),114,57) 
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, VarSet]
type = VarSet
trigger1 = time=0
v =5  ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0
[State 810, Width 2-11]
type = Width
trigger1 = time=0
edge = 50,50

[State 0, PosAdd]
type = PosAdd
trigger1 =(frontedgebodydist >270)  &&time=0
x = 35

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

[State 0, PosAdd]
type = PosAdd
trigger1=animelem=1
x = 5
[State 0, PosAdd]
type = PosAdd
trigger1=animelem=2
x = -5

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

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2) < 0
pos = 32,0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos = 43,-102
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(5) < 0
pos = 34,-102
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 5
pos = 34,-78


;[State 810, Hurt 11]
;type = TargetLifeAdd
;trigger1 = AnimElem = 5
;value = -ceil(80*fvar(1))
;kill=0
[State 0, VarSet]
type = VarSet
trigger1 = animelem=5
v =29    ;fv = 10
value = ceil(80*fvar(1))
;ignorehitpause = 
;persistent = 


[State 640, 2]
type = PlaySnd
trigger1 = animelem=2
value =100, 0
channel = 0
[State 0, VarSet]
type = Varset
trigger1 =animelem=5
v = 4   ;fv = 10
value =2
ignorehitpause=0

[State 640, 2]
type = PlaySnd
trigger1 = animelem=5
value =F5, 1
channel = 1
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=5 
time =5
freq = 60
ampl = -4
phase = 90



[State 0, TargetVelSet]
type = TargetVelSet
trigger1 = AnimElem =5,2
x =-11.8
y = -2
[State 0, TargetState]
type = TargetState
trigger1 = animelem=5,2
value =821
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =  animelem=5
anim = F10+(random%4)
ID = 899
pos = 60,-64
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 = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause=1


[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
;trigger2 =var(0)=2&& animelem=4,26 
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 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




[State 5040, 2]
type = ChangeAnim
triggerall =alive
trigger1 = AnimTime = 0
trigger1 = Anim != 5040*(cond(var(59)=24,9,1))
trigger2 = Time = 0
trigger2 = Anim != 5035*(cond(var(59)=24,9,1))
value = 5040*(cond(var(59)=24,9,1))
[State 5040, 2]
type = ChangeAnim
triggerall =!alive
trigger1 = AnimTime = 0
trigger1 = Anim != 5040*(cond(var(59)=24,9,1))
trigger2 = Time = 0
trigger2 = Anim != 5035*(cond(var(59)=24,9,1))
value = 5050*(cond(var(59)=24,9,1))
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = -const(size.head.pos.y)
[State 0, ChangeState]
type = ChangeState
trigger1 = time =0 && !alive
value =10613
ctrl = 0
;anim =
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

[State 0, NotHitBy]
type = NotHitBy
trigger1 = pos y <0
value = SCA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =
[State 0, NotHitBy]
type =HitBy
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = SCA,AA,AP
;value2 = S,NA
time = 3
[State 5040, 5]
type = VelAdd
trigger1 = 1
y = .47

[State 5040, 6]
type = selfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND
;---------------------------------------------------------------------------
;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 = p2bodydist x <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 
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = ifelse((command="holdfwd"&&AIlevel=0||enemy,backedgebodydist <70&&AIlevel>0),-1,1)
p2facing =-1          ;Force p2 to face KFM
p1stateno = 840      ;On success, KFM changes to state 810
p2stateno = 850      ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
numhits=0
   [State 800, 1]
type = HitDef
triggerall = p2bodydist x <32
triggerall = p2statetype=S ||p2statetype=C
Trigger1 =p2stateno=1008 ||p2stateno=1007 || p2stateno=5901 ;||var(0)=0 
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 = 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 = cond(numexplod(801)>0,210,240)

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

[Statedef 840]
type    = S
movetype= A
physics = N
anim = 830
poweradd=ifelse((life<=lifemax/5),75,37) 
facep2=1
sprpriority =2
; 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 =(backedgebodydist<20) &&animelem=5
x = 45

;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=5,25
value =200, 0
channel = 0
;[State 0, VarSet]
;type = VarSet
;trigger1 = 1
;v = 11    ;fv = 10
;value = 2

[State 0, VelSet]
type = VelSet
trigger1 = animelem=5
y = -12.5
[State 0, VelSet]
type = VelSet
trigger1 = animelem=5,18
y = 0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
y = 13.5

[State 0, VelSet]
type = VelSet
trigger1 = pos y >0 && animelemtime(6)>0 && animelemtime(7)<=0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = pos y >0 && animelemtime(6)>0&& animelemtime(7)<=0
y = 0
[State 0, Turn]
type = Turn
trigger1 = animelem=8
;ignorehitpause = 
;persistent = 

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

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


[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(5)>0 && animelemtime(8)<0 &&  teammode!=simul
value = 1
movecamera = 1,0
ignorehitpause = 1
;persistent = 

[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 =47,-81
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos = 29,-98
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
trigger2 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = -6,-116
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) < 0
pos = -6,-111
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(7) < 0
pos = -6,5

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 7
pos =-5,0



[State 0, TargetVelSet]
type = TargetVelSet
trigger1 = AnimElemtime(7)=1 && enemy,vel x =0
x =-3.5
y = -9.5
;ignorehitpause = 
;persistent = 
[State 810, Throw 11]
type = TargetState
trigger1 = AnimElemtime(7)=1
value = 851
[State 810, Hurt 11]
type = targetLifeAdd
trigger1  =animelem=7 
value = -ceil(85*fvar(1))
persistent=0
kill=0
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=7 
time = 20
freq = 60
ampl = -4
phase = 90
[State 5100, 8]
type = Explod
trigger1 = animelem=7
anim = F60
pos = 0, 0
scale=2,2
postype=p1
sprpriority = -3
;ignorehitpause = 
;persistent = 
[State 1000, 1]
type = PlaySnd
trigger1 =animelem=7 
value = F7, 0
channel=3
[State 0, Pause]
type = Pause
trigger1 = animelemtime(7)>=0 && animelemtime(9)<=0
trigger1 = time%2=0
time = 1
pausebg=1
[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, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0
;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = p2stateno!=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 = .42
;ignorehitpause = 
;persistent = 


[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = backedgebodydist <30
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    = S
movetype= A
physics = S
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 0
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && fvar(36)!=0
x = -fvar(36)
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0&& var(2)!=2
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((helper(10006), var(0)&129) > 0,0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((helper(10003),var(20)),0,1)


[State 0, VarSet]
type = VarSet
triggerall = cond(numhelper(8083),helper(8083),var(0)!=78,1) && cond(numhelper(8084),helper(8084),var(0)!=78,1) 
triggerall = AILevel=0 &&var(17)
trigger1 = time=0
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 &&( random <249 || var(4)>=4&&AIlevel >6)
triggerall =  helper(10003),var(22)
trigger1 = time=0
v = 2   ;fv = 10
value =2
[State 0, PalFXWiz]
type = PalFX
trigger1 = time <10 && var(2)=2
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0&& var(2)>0 
value = 1000+(10*var(2))


[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =200, 1
channel = 0
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3
x = 6



[State 0, PosAdd]
type = PosAdd
trigger1 =animtime=0
x = -6
[State 0, Width]
type = Width
trigger1 = animelemtime(4)<0 
player = 25,0
;value = 0,0
;ignorehitpause = 
;persistent = 

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

[State 0, Helper]
type = Helper
trigger1 =animelem=2
helpertype = normal ;player
name = "blade"
ID =  1001
stateno = 1001
pos = ceil(33*const(size.xscale)),ceil(-74 *const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =const(size.xscale)
size.yscale =const(size.yscale)

;ignorehitpause = 
;persistent = 


;anim =
;ignorehitpause = 
;persistent = 

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

[Statedef 1049]
type    = S
movetype= I
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 110
velset = 0,0
anim = 1051
ctrl = 0
sprpriority = 2
[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(18)
trigger1 = time=0
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 && random <249
triggerall =  p2movetype=H || p2stateno=5120
trigger1 = time=0
v = 2   ;fv = 10
value =2
[State 0, VarSet]
type = VarSet
trigger1 = var(2)=2
v = 12    ;fv = 10
value = 1


[State 0, PalFXWiz]
type = PalFX
trigger1 = time <10 && var(2)=2
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2&& anim=1051
statetype = A       ;S,A,C,L
;ignorehitpause = 
;persistent = 
[State 1000, 1]
type = PlaySnd
trigger1 =time=0
value = 100, 2
channel=1

[State 0, VelSet]
type = VelSet
trigger1 = animelem=2 && anim=1051
y = -7
[State 0, VelSet]
type = VelSet
trigger1 = animtime=0 && anim=1051
x = 0
y = 0
[State 0, Explod]
type = Explod
trigger1 =time=0 && var(2)=2
anim = 1057
ID = 1000
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 =-1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 && anim=1051
value = 1052

[State 0, VelSet]
type = VelSet
trigger1 = anim=1052 && AIlevel=0
trigger1 = command="holdup"||command="holddown"
y = cond((pos y<-110),0,cond(command="holddown",2.7,-2.7))
[State 0, VelSet]
type = VelSet
trigger1 = anim=1052&& AIlevel=0
trigger1 = command="holdfwd"||command="holdback"
x = cond(command="holdfwd",4.6,-4.6)*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71||helper(8083),var(0)=70,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71||helper(8084),var(0)=70,helper(8084),var(1),0),0))/100.0))

[State 0, VelSet]
type = VelSet
trigger1 = anim=1052 && AIlevel>0
trigger1 = p2bodydist y <-20
y = cond((pos y<-110),0,cond(p2bodydist y >60 && (p2movetype!=A),2.7,-2.7))
[State 0, VelSet]
type = VelSet
trigger1 = anim=1052&& AIlevel>0
trigger1 = p2movetype=A || p2bodydist x >35
x = cond(p2bodydist x >35&&(p2movetype!=A||p2statetype=C||enemy,numproj>0),4.6,-4.6)

[State 0, VelAdd]
type = VelAdd
trigger1= anim=1052
trigger1 = vel x !=0 || vel y !=0
x = cond(vel x >0,-.3,.3)
y = cond(vel y >0,-.3,.3)
[State 0, VelSet]
type = VelSet
trigger1= anim=1052
x = cond((vel x =[-.4,.4]),0,vel x)
y = cond((vel y =[-.4,.4]),0,vel y)
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 = vel y !=0 
y = cond(vel y >0,-.3,.3)
;ignorehitpause = 
;persistent = 
[State 0, Turn]
type = Turn
trigger1 =  p2bodydist x <-10


[State 0, PosSet]
type = PosSet
trigger1 = pos y <-110
y = -110
[State 0, PosSet]
type = PosSet
trigger1 = pos y >0
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 =time>=180
value =57
ctrl = !Helper(7000),var(34)

[State 0, ChangeState]
type = ChangeState
trigger1 =pos y =0 && anim=1052 
value =52
ctrl = 0
;anim =
;ignorehitpause = 
;persistent = 

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

[Statedef 1050]
type    = A
movetype= A
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 110
velset = 0,0
anim = 1050+(var(12))*5
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 || p2stateno=5901 ||var(2)=2 
movetype = A
[State 1000, 1]
type = PlaySnd
trigger1 =time=0
value = F0, 1
channel=1
[State 640, 2]
type = PlaySnd
trigger1 = animelem=1
value =200, 2
channel = 0
[State 0, PalFXWiz]
type = PalFX
trigger1 = time <10 && var(12)
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =animelem=2&& var(12)
anim = 1056
ID = 1050
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 0
removetime=-1
scale = const(size.xscale),const(size.yscale)
sprpriority =3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
persistent=0
ignorehitpause=1



[State 0, VelSet]
type = VelSet
trigger1 =animelem=1 && anim=1055 
y = -6
x=1.5*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2)<0 && anim=1055
y = .75
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=2
x = 7.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));+((var(0)>0)*.9)
y= 4.95;+((var(0)>0)*.9)

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

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>0 && animelemtime(4)<0 
y = .56

;w 15 s=18 h=22
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=4
id = 1050

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

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = p2statetype=C && anim=1055
flag = unguardable

[State 0, HitBy]
type = HitBy
trigger1 =  anim=1055 && statetype=A
value = SA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 


[State 1000, 1]
type = PlaySnd
trigger1 = animelem=4
value = F40, 0
channel=2
[State 210, 2]
type = HitDef
trigger1 =animelem=2 && !movecontact&& !movereversed
attr = A, SA
animtype  = Medium
kill=0                 
damage =cond(anim=1055,105,80)
guardflag = M
pausetime = 16,16
;guard.pausetime=20,20
sparkno = 20+(random%4)
guard.sparkno=7  ; 1
sparkxy = -10,-32
priority=4
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33 
hitsound = F5, 1        
guardsound = F6,1 
ground.type = High
ground.slidetime = 24
ground.hittime  = 24;-((var(0)=2&&var(2)=0)*5)
guard.ctrltime=14
ground.velocity = -1.78,-7.3 ;34
air.velocity = -1.78,-7.3
yaccel=.47
fall=1
fall.recover=0
id=202
envshake.time = 8
envshake.freq = 60
envshake.ampl = -4
envshake.phase = 90
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = moveguarded
value = -ceil(20*fvar(1))
ID = 202
kill = 0
persistent=0
;[State 200, 1]
;type = PlaySnd
;trigger1 = animelem=7 
;value = 0, 4
;channel = 1

;ignorehitpause = 
;persistent = 



[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4
statetype = S
movetype = I 
physics =S


      ;I,A,H
[State 1050, 5]
type = ChangeState
trigger1 = AnimTime  = 0
value = 0
ctrl=1


;---------------------------------------------------------------------------
; Light Kung Fu Upper
; CNS difficulty: easy
[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, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=1
movetype = I        
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(4)=0|| p2stateno=5120 || p2stateno=5901 ||var(2)=2 
movetype = A
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((helper(10006), var(0)&129) > 0,0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((fvar(15)=[0,75]),0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0 && (prevstateno=205 || prevstateno=405 ||prevstateno=235||prevstateno=435)
v = 2   ;fv = 10
value = 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(17)
trigger1 = time=0
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 && random <249
triggerall = p2movetype=A
trigger1 = time=0
v = 2   ;fv = 10
value =2
[State 0, PalFXWiz]
type = PalFX
trigger1 = time <10 && var(2)=2
trigger1 = time%3=0
time = 2
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,80,40,1
invertall = 0
color = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0 
value = 1100+var(2)
    ;S,A,C,L
;ignorehitpause = 
;persistent = 

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


[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(2)=2 && time =0
value = SCA
;value2 = S,NA
time =13
;ignorehitpause = 
;persistent = 

;[State 0, NotHitBy]
;type = HitBy
;trigger1 = var(2)=2 && time =0
;value = SA,AA
;time =9

[State 1000, Helper]
type = Helper
trigger1 = animelem=2 && var(2)=2
helpertype = normal
name = "Fireballstart"
ID = 1053
stateno = 1012
pos =6,-52
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale = const(size.yscale)
pausemovetime=99

[State 1000, 1]
type = PlaySnd
trigger1 = animelem=4
value = 0, 2
channel=1
persistent=0
;ignorehitpause = 
;persistent = 



[State 0, ChangeAnim]
type = ChangeAnim
triggerall =  var(2)=1
trigger1 =animelem=4 
value = anim
elem = 2
persistent=0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animelem=7 &&!movecontact
value = anim
elem = 5
persistent=0
[State 640, 2]
type = PlaySnd
trigger1 = animelem=4
value =200, 0
channel = 0

[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=4
x = 26*const(size.xscale)
[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=5
x = 18*const(size.xscale)
persistent=0
[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=7
x = -1*const(size.xscale)

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


[State 0, PosAdd]
type = PosAdd 
trigger1 =animelemtime(5)>=0 && animelemtime(7)<0 
x =cond(var(2)=0,4.25,cond(var(2)=1,7,11.55))*(1+(cond(numhelper(8083),cond(helper(8083),var(0)=71,helper(8083),var(1),0),cond(numhelper(8084),cond(helper(8084),var(0)=71,helper(8084),var(1),0),0))/100.0))

[State 0, PosAdd]
type = PosAdd 
trigger1 =animelemtime(7)>=0 
x =cond(var(2)=0,2.25,cond(var(2)=1,3,4.25))*(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 1100, 2]
type = HitDef
trigger1 =animelem=5 && !movecontact&& !movereversed
attr = S, SA
animtype  = Med
kill=0                 
damage = cond(var(2)=0,75,cond(var(2)=1,90,105))
priority  = 4
guardflag = M
pausetime = 10,10
getpower = ifelse((life<=lifemax/5),143,72)
givepower=33 
sparkxy = 0,-65
sparkno =20+(random%4)
priority=4
guard.sparkno=7 ; 
hitsound = F5, 1        
guardsound = F6,1 
ground.type = Low
ground.slidetime = 12
ground.hittime  = 24
guard.ctrltime=13
ground.velocity = -1.78,-7.3 ;34
air.velocity = -1.78,-7.3
guard.velocity= -6 
yaccel=.44
fall=1
ground.cornerpush.veloff=0;
air.cornerpush.veloff=0
guard.cornerpush.veloff=0;=-10
airguard.velocity = -4,-4.5
fall.recover=0
id=202
;ignorehitpause = 
;persistent = 
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = moveguarded
value = -ceil(21*fvar(1))
ID = 202
kill = 0
persistent=0
[State 1100, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = !Helper(7000),var(34)


;---------------------------------------------------------------------------
; Light Kung Fu Upper
; CNS difficulty: easy
[Statedef 1150]
type    = S
movetype= I
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=0;= 110
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((helper(10006), var(0)&129) > 0,0,1)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1 = time=0
v = 2   ;fv = 10
value = ifelse((p2statetype=A && enemy,vel x >0 ||p2statetype!=L&&fvar(15)=[0,45]),0,1)
[State 0, VarSet]
type = VarSet
triggerall = AILevel>6 &&p2stateno!=[120,155]
trigger1 = time=0 && (prevstateno=205 || prevstateno=405 ||prevstateno=235||prevstateno=435)
v = 2   ;fv = 10
value =0



[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(17)
trigger1 = time=0
v = 2   ;fv = 10
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& helper(7000),var(2)>0 && random <249
triggerall =p2statetype=A ||p2movetype=H && p2stateno=[5000,5901]
trigger1 = time=0
v = 2   ;fv = 10
value =2

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

[State 0, Null]
type = Null
triggerall =!ishelper
trigger1 = var(2)=0 || numexplod(1149)>0&&time=0 && var(2)!=2
trigger1 = var(1):=70
trigger2 = var(2)=1  && numexplod(1149)=0&&time=0
trigger2 = var(1):=100
trigger3 = var(2)=2 
trigger3 = var(1):=160
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 = animelemtime(5)<0 
player = 25,0
;value = 0,0
;ignorehitpause = 
;persistent = 

;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0
[State 0, Explod]
type = Explod
trigger1 = var(2)=2 && p2stateno=1007
anim = 10000
ID = 1150
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
persistent=0

[State 0, Explod]
type = Explod
trigger1 = var(2)=1 && p2stateno=1007
anim = 10000
ID = 1149
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
persistent=0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = var(2)!=2&& numexplod(1150)>1
id = 1150

[State 0, Helper]
type = Helper
trigger1 =animelem=4
helpertype = normal ;player
name = "breathe"
ID =  1005
stateno = 1005
pos = ceil(24*const(size.xscale)),ceil(-73*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =const(size.xscale)
size.yscale =const(size.yscale)


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

;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
; CNS difficulty: medium
; Notes: Notice that the HitDefs in supers have "getpower = 0". This makes
;        sure KFM doesn't recharge his super guage as he hits.
;        Also, the attributes for the HitDefs is "HA" for "hyper attack",
;        ie. "attr = S, HA".
;        Notice how the first HitDef is reused twice by allowing it to
;        trigger on two animation elements.
[Statedef 3000]
type    = S
movetype= A
physics = N
juggle  =0;ifelse(var(8)=1,0,15); 4
poweradd=-1000
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = 1
movetype = A
ignorehitpause = 1
;persistent = 
;[State 0, VarSet]
;type = VarSet
;trigger1 = (helper(7000),var(2)>1 &&command="y")
;v = 2   ;fv = 10
;value = 2

[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, Helper]
type = Helper
trigger1 =time=1
helpertype = normal ;player
name = "blade"
ID =  30000
stateno = 30000
pos =-4, -60
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
movetime=10
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 640, 2]
type = PlaySnd
trigger1 = time=0
value =S3000, 0
channel = 0

[State 0, PalFXWiz]
type = PalFX
trigger1 = time <25  &&  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, NotHitBy]
type = NotHitBy
trigger1 = time =10
trigger3 = animelemtime(4)>=0&& p2movetype=H && p2stateno!=[120,155]
value = SCA
;value2 = S,NA
time = cond(var(2)=2,13,10)
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 =animelem=4
helpertype = normal ;player
name = "breathe"
ID =  1003
stateno = 3001
pos = ceil(24*const(size.xscale)),ceil(-73*const(size.yscale))
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, VarSet]
type = VarSet
trigger1 = time=0
v = 1   ;fv = 10
value =150
;ignorehitpause = 
;persistent = 

[State 1000, Helper]
type = Helper
trigger1 = animelem=8 && var(2)=2
helpertype = normal
name = "Fireballstart"
ID = 1053
stateno = 1012
pos =6,-52
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale = const(size.yscale)
pausemovetime=99

[State 230, 2]
type = HitDef
trigger1 = AnimElem =11
attr = S, HA
animtype  = Medium
kill=0                 
damage = 0,22
guardflag =M
pausetime = 12, 12   
sparkno = 10+(random%4)
priority=6
guard.sparkno=S6001  ; 0
getpower=0
givepower=0
sparkxy = -10,-25
hitsound = F5,1        
guardsound = S3,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 24
guard.ctrltime=14
ground.velocity = 0
air.velocity =-3,6
yaccel=.47
id=215
forcestand=1
forcenofall=ifelse(p2statetype=A,0,1)
air.fall=1
[State 0, TargetState]
type = TargetState
trigger1 =movehit 
value = 21010
ID = 215
persistent = 0



;w 15 s=18 h=22


;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=11
physics =N


[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=7&& p2stateno=1007
x =-22*const(size.xscale)
[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=8
x = -4*const(size.xscale)

[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=10
x = 26*const(size.xscale)
[State 0, PosAdd]
type = PosAdd 
trigger1 =animelem=11
x = 18*const(size.xscale)
persistent=0
[State 0, Width]
type = Width
trigger1 = animelem=10
player = 32,0
;value = 0,0
;ignorehitpause = 
;persistent = 

;[State 640, 2]
;type = PlaySnd
;trigger1 = animelem=1
;value =100+var(0), 3
;channel = 0

[State 1000, 1]
type = PlaySnd
trigger1 = animelem=11
value = F0, 2
channel=1

;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(20)<2 && animelem=13
value = anim
elem = 11
;ignorehitpause = 
;persistent = 
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(11)>=0 && animelemtime(13)<0
id = 215
pos = 51,-58
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =time=0
v = 20    ;fv = 10
value = 0

[State 0, PosAdd]
type = PosAdd 
trigger1 =animelemtime(11)>=0 && animelemtime(13)<0 
x =12

[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(11)>=0 && animelemtime(13)<0 
value = 0
movecamera = 0,0
[State 0, VarSet]
type = VarSet
trigger1 = frontedgebodydist <-110 && var(2)=2
v = 20    ;fv = 10
value = 1
persistent = 0
[State 1000, 1]
type = PlaySnd
trigger1 = var(20)=1
value = 100, 4
channel=1
persistent=0

[State 0, Turn]
type = Turn
trigger1 = var(20)=1
persistent = 0
[State 0, PosAdd]
type = PosAdd
trigger1 =var(20)=1 
y = -60
persistent = 0

[State 0, VarSet]
type = VarSet
trigger1 = frontedgebodydist <-110 && (var(20)=1|| var(2)!=2)
v = 20    ;fv = 10
value = 2
persistent = 0
[State 1000, 1]
type = PlaySnd
trigger1 = var(20)=2
value = 100, 4
channel=1
persistent=0

[State 0, PosAdd]
type = Posset
trigger1 =var(20)=2  && animelemtime(4)>0
y = -285
x=0
persistent = 0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=13
y= 14
[State 640, 2]
type = PlaySnd
trigger1 = animelem=13
value =S3000, 1
channel = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=14&& pos y <0
value = anim
elem = 13

[State 0, PosSet]
type = PosSet
trigger1 = pos y >0 && animelemtime(13)>0 && animelemtime(15)<0
y = 0
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = pos y >0 && animelemtime(13)>0 && animelemtime(15)<0
y = 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(13) >= 0 && AnimElemTime(14) < 0
id=215
pos = -6,5

[State 810, Bind 1]
type = TargetBind
trigger1 =  AnimElemTime(14) >= 0 && AnimElemTime(14) < 2
pos =-5,0



[State 0, TargetVelSet]
type = TargetVelSet
trigger1 = AnimElemtime(14)=2 && enemy,vel x =0
x =-3.5
y = -9.5
persistent=0
;persistent = 
[State 810, Throw 11]
type = TargetState
trigger1 = AnimElemtime(14)=1
value = 851
[State 0, HitAdd]
type = HitAdd
trigger1 = animelem=14 
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =animelem=14&& var(2)=2
anim = 3005
ID = 1000
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 =-2
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1

[State 810, Hurt 11]
type = targetLifeAdd
trigger1  =animelem=14 
value = -ceil(cond(var(2)!=2,285,390)*fvar(1))
persistent=0
kill=0
[State 5100, 8]
type = Explod
trigger1 = animelem=14 
anim = F60
pos = 0, 0
scale=2,2
postype=p1
sprpriority = -3
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=14 
time = 20
freq = 60
ampl = -4
phase = 90
[State 1000, 1]
type = PlaySnd
trigger1 =animelem=14
value =F7, 0
channel=3
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=15
x = -2
y = -7

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(15)>=0 && animelemtime(18)<0 
y = .4
[State 0, Pause]
type = Pause
trigger1 = animelemtime(14)>=0 && animelemtime(16)<=0
trigger1 = time%2=0
time = 1
pausebg=1
[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(16)>=0 && animelemtime(18)<0
value = 1
movecamera = 1,0

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

;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=18
x = 0
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=18
statetype = S
movetype = I       ;I,A,H
physics =S
[State -3, Landing Sound]
type = PlaySnd
trigger1 = animelem=18
value = F40, 0
channel=5
[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = animelem=7 && p2stateno!=1007
value = 0
ctrl = !Helper(7000),var(34)

;------------------------------------------------------
[Statedef 21010] ; beginning tag 
type    = A
movetype= H
physics = N
juggle  = 0
ctrl = 0
sprpriority = -2

;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = enemy,animelemtime(13)<0
value = 3001*(cond(var(59)=24,9,1))
elem = 1
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value =0
movecamera = 0,0
;ignorehitpause = 
;persistent = 
[State 0, Turn]
type = Turn
trigger1 = facing=enemy,facing
;ignorehitpause = 
;persistent = 

[State 310,3]
type = selfstate
trigger1 = !gethitvar(isbound)
value = 0
ctrl =1

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


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

[Statedef -3]

[State 0, VarSet]
type = VarSet
trigger1 = statetype!=A && stateno!=1049 
v = 12    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = 1
fv = 20    ;fv = 10
value = gametime
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = var(4)<2 && p2stateno=1007
v = 4    ;fv = 10
value = 2
;ignorehitpause = 
;persistent = 
;[State 0, VarSet]
;type = VarSet
;trigger1 =command="???"  && stateno=10190
;v = 52   ;fv = 10
;value = 1
;[State 5900, 3] ;Change palette
;type = RemapPal
;trigger1 = var(52) && ((stateno=[1900,1999])||(stateno=[190,199]))
;source = 1,1
;dest = 1,8

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H ||p2statetype=L || moveguarded
id = 1150
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H ||p2statetype=L || moveguarded
id = 1149
;ignorehitpause = 
;persistent = 

[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(58) && (var(56)=-1&& enemy,var(56)!=0||var(56) && enemy,var(56)=-1) && numhelper(7509)=0 && stateno=5151
value = -1000
kill = 1


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


[State 1000, 1]
type = PlaySnd
triggerall = p2statetype!=L
triggerall = stateno!=3000 || animelemtime(10)>0
trigger1 = p2stateno!=1007 && var(3)=1
value = 100, 6
channel=5


[State 0, VarSet];is frozen
type = VarSet
trigger1 = p2stateno!=1007 && numhelper(1002)=0
;trigger2 =  numhelper(1002)
;trigger2 = !helper(1002),movehit
v = 3    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 13    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = movetype=I
fv = 36    ;fv = 10
value = 0


[State 0, VarSet]
type = VarSet
trigger1 = enemy,vel x !=0 && roundstate=2 
fv = 5  ;fv = 10
value =  ifelse(enemy,vel x >0,(-enemy,vel x),(enemy,vel x))*(1.05+(1.45*(var(0)=0)))
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
fv =5    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v =5  ;fv = 10
value = 0




[State 0, VarSet]
type = VarSet
trigger1 = (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 = 40, 0
channel=5

;[State -3, Hit0]
;type = PlaySnd
;triggerall = Alive
;triggerall = Time = 0
;triggerall = random<499
;trigger1 =stateno = 5000
;trigger2 =stateno = 5010
;trigger3 =stateno = 5020
;value = 5000, 0
;channel=0

;-------------------------stun
[State 0, VarSet]
type = Varadd
triggerall =stateno=600 || stateno=630
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 40
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = stateno=230|| stateno=400 ||stateno=200 || stateno=430
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 35
ignorehitpause=1

[State 0, VarSet]
type = Varadd
triggerall = stateno=640|| stateno=610
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =64
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=1055
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =100
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall = anim=1050
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =65
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall =anim=1100
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =55
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall =anim=1101
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =60
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall =anim=1102
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value =65
ignorehitpause=1
[State 0, VarSet]
type = Varadd
triggerall =  stateno=410||  stateno=210 ||stateno=240
trigger1 = enemy,gethitvar(hitshaketime)=2 && movehit
v = 6   ;fv = 10
value = 50
ignorehitpause=1

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





[State 1000, 1]
type = PlaySnd
triggerall = p2statetype!=L
triggerall = stateno!=3000 || animelemtime(10)>0
trigger1 = p2stateno!=1007 && var(3)=1
value = 100, 6
channel=5
[State 0, Explod]
type = Explod
triggerall = stateno!=3000 || animelemtime(10)>0
trigger1 = p2stateno!=1007 && var(3)=1
triggerall = numexplod(7600)<3
anim = 1204
ID = 7600
pos = 0,cond((p2stateno=[10612,10613]),-30,(enemy,const(size.head.pos.y)))
postype = p2
facing = 1
vfacing = 1
bindtime = 1
vel = -4+(random%4),-5+(random%4)
accel = 0,.55
random = 0,0
pausemovetime =30
removetime=65
scale = 1,1
sprpriority = -3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0


[State 0, VarSet];is frozen
type = VarSet
trigger1 = p2stateno!=1007 && numhelper(1002)=0
;trigger2 =  numhelper(1002)
;trigger2 = !helper(1002),movehit
v = 3    ;fv = 10
value = 0