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

; var(0):= 1001, 3001, 6101, 6200, 7000, 7001, 9997, 9999, 40
; var(1):= 3001, 6200, 9997, 9999
; var(2):= 1000, 1050, 1100, 1200, 3000, 3100, 3500, 1001, 10011, 3001, 6200, 9997, 9998, 9999
; var(3):= 9997, 9999
; var(4):= 6101, 9997, 9998, 9999
; var(5):= 705, 9997, 9999
; var(6):= -2, 9997, 9999
; var(7):= -2, 9997, 9999
; var(8):= 9997, 9999
; var(9):= 9999
;var(10):= 6000, 6001, 6101, 9997, 9999, 10000
;var(11):= 6000, 6001, 6101, 9997, 9999, 10000
;var(12):= 1001, 10011, 3001
;var(13):= 9999
;var(14):= 9999
;var(15):= 9999
;var(18):= 1001, 10011, 3001
;var(19):= 9999
;var(20):= 810, 6000, 9997, 9999
;var(21):= 6000, 9997, 9999
;var(22):= 9997, 9998
;var(23):= 9997, 9999
;var(24):= 9997
;var(25):= 1002, 9997, 9999
;var(26):= 9997
;var(27):= 9997
;var(28):= 9997
;var(29):= 9997
;var(30):= 6101, 9997, 9998, 9999
;var(31):= 9997, 9999
;var(32):= 9997
;var(33):= 9997
;var(34):= 9997, 9998
;var(35):= 6000, 9997, 9998
;var(36):= 200, 210, 211, 230, 240, 400, 410, 430, 440, -3, 9997, 9999
;var(37):= 9997, 9999
;var(38):= 9997
;var(39):= 9999
;var(40):= 6000, 6200, 9997, 9999
;var(41):= 9997, 9999
;var(42):= 9997, 9999
;var(43):= 9997
;var(44):= 9997
;var(45):= 9997, 9998
;var(46):= 9997, 9998
;var(47):= 9997
;var(48):= 9997, -1
;var(49):= 9997, -1
;var(50):= 9997
;var(51):= 9997
;var(52):= 9997
;var(54):= 9999
;var(55):= 9997, 9999
;var(56):= 9997
;var(57):= 9997
;var(58):= -3, 9997, 9999
;var(59):= 705, 710, 3100, 3500, 4000, 6000, 9997, 5211

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

; fvar(1):= 1001, 10011, 3001
; fvar(2):= 9999
; fvar(5):= 9999
; fvar(6):= -2
;fvar(10):= 6000, 6001, 6101, 10000
;fvar(15):= 6000, 9999
;fvar(30):= 9997





[Data]
;Amount of life to start with
life = 1000
;attack power (more is stronger)
attack = 100
;defensive power (more is stronger)
defence = 100
power=3000
;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50
;Time which player lies down for, before getting up
liedown.time = 60
;Number of points for juggling
airjuggle=0; = 15
;Default hit spark number for HitDefs
sparkno =-1; 2
;Default guard spark number
guard.sparkno =-1; 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 0

IntPersistIndex = 58
FloatPersistIndex = 40

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = -10, -90   ;Approximate position of head
mid.pos = -5, -60    ;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). Recommended 0,0

[Velocity]
walk.fwd  = 2.4      ;Walk forward
walk.back = -1.9    ;Walk backward
run.fwd  =5.1, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-8.4    ;Neutral jumping velocity (x, y)
jump.back = -2.55    ;Jump back Speed (x, y)
jump.fwd = 2.5       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.
air.gethit.groundrecovery = -.15,-3.5  ;Velocity for ground recoveryy state (x, y) **MUGEN 1.0**
air.gethit.airrecovery.mul = .5,.2     ;Multiplier for air recoveryy velocity (x, y) **MUGEN 1.0**
air.gethit.airrecovery.add = 0,-4.5    ;Velocity offset for air recoveryy (x, y) **MUGEN 1.0**
air.gethit.airrecovery.back = -1       ;Extra x-velocity for holding back during air recoveryy **MUGEN 1.0**
air.gethit.airrecovery.fwd = 0         ;Extra x-velocity for holding forward during air recoveryy **MUGEN 1.0**
air.gethit.airrecovery.up = -2         ;Extra y-velocity for holding up during air recoveryy **MUGEN 1.0**
air.gethit.airrecovery.down = 1.5      ;Extra y-velocity for holding down during air recoveryy **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 = .44          ;Vertical acceleration
stand.friction = .9  ;Friction coefficient when standing
crouch.friction = .88 ;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.groundrecovery.ground.threshold = -20 ;Y-position below which falling player can use the recoveryy command **MUGEN 1.0**
air.gethit.groundrecovery.groundlevel = 10   ;Y-position at which player in the ground recoveryy state touches the ground **MUGEN 1.0**
air.gethit.airrecovery.threshold = -1  ;Y-velocity above which player may use the air recoveryy command **MUGEN 1.0**
air.gethit.airrecovery.yaccel = .35    ;Vertical acceleration for player in the air recoveryy 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         ;If the player's speed drops below this threshold while lying down, stop his movement **MUGEN 1.0**

;Default language victory quotes (optional).  **MUGEN 1.0**
;If this section is included, the default language victory quotes must be in English.
[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "I get a little rough and you fold like a dollar bill!"
victory2 = "You're a complete washout! You redefine \"tyro\"."
victory3 = "Greenhorn! You're ten years too early to take me on!"
victory4 = "The strength I pursue is beyond good and evil! You can't win as long as you stick to trivial ideals!"
victory5 = "Pathetic! Your kicks can't harm me! Try putting some weight behind your moves! "


;---------------------------------------------------------------------------
; 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).


;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[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
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181+random%3
[State 180, 1]
type = ChangeState
trigger1 = Time = 0 && var(19)
value = 184
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = S181,1
channel = 0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = S181,0
channel = 0
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = -9
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -7
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = -6

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = -8
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=6
value = S182,1
channel = 0
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = S182,0
channel = 0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0
[State 0, ChangeState]
type = ChangeState
trigger1 = random%2 && time=0
value =192
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

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

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;
;; You can delete the following two controllers if you're building your own
;; character using KFM. These are the wood pieces that KFM kicks.
;[State 191, Wood 1]
;type = Explod
;trigger1 = RoundState != 0
;persistent = 0
;anim = 191
;postype = p1
;pos = 260, -90
;velocity = -4.2, -7
;accel = 0, .32
;removetime = 48
;
;[State 191, Wood 2]
;type = Explod
;trigger1 = AnimElemTime(7) = 1
;anim = 192
;postype = p1
;pos = 60, -70
;velocity = 2, -4
;accel = 0, .32
;removetime = 35

; You can delete the following two controllers if you're building your own
; character using KFM. These play back the sounds of the wood block being
; broken.
[State 0, PlaySnd]
type = PlaySnd
trigger1 = roundstate!=0
value = S190,0
channel = 0
persistent=0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 192]
type = S
ctrl = 0
anim = 191
velset = 0,0

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

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


[State 0, Explod]
type = Explod
trigger1 = animelem  =8
anim =1015
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem  =8
anim =1016
ID =1001
pos =0,5
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =-1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem  =8
value = S5100,0
channel = 3
[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;
;; You can delete the following two controllers if you're building your own
;; character using KFM. These are the wood pieces that KFM kicks.
;[State 191, Wood 1]
;type = Explod
;trigger1 = RoundState != 0
;persistent = 0
;anim = 191
;postype = p1
;pos = 260, -90
;velocity = -4.2, -7
;accel = 0, .32
;removetime = 48
;
;[State 191, Wood 2]
;type = Explod
;trigger1 = AnimElemTime(7) = 1
;anim = 192
;postype = p1
;pos = 60, -70
;velocity = 2, -4
;accel = 0, .32
;removetime = 35

; You can delete the following two controllers if you're building your own
; character using KFM. These play back the sounds of the wood block being
; broken.
;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 = roundstate!=0
;value = S190,0
;channel = 0
;persistent=0

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S195,0
channel = 0


[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


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

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,0
channel=0
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage =floor(24*fvar(2)), 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 6,6 
sparkno =-1; -1                      ;Spark anim no (Def: set above)
guard.sparkno=S6550
sparkxy = -10, -cond(anim=201,58,79)              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S2, 0                  ;Sound to play on hit
guardsound = S3, 0                ;Sound to play on guard
getpower=ceil(helper(6000),fvar(15)*26)
givepower=0
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 8             ;Time that the opponent slides back
ground.hittime  = 11            
guard.ctrltime=11
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -3.5             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3.1      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
yaccel=.46
p2facing=1
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6500+random%4
ID = 12000
pos = 10,-cond(anim=201,58,79)-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
;Y-velocity at which opponent is pushed          
[State 200, 2]
type = PlaySnd
trigger1 = Time = 1
value = S0, 0

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;--------|Custom States|----------------
;---------------------------------------------------------------------------
[Statedef 202]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [0,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = selfanimexist(anim)
trigger1 = Time > 0
value = anim
 
[State 5020, 4] ;Freeze anim
type = ChangeAnim2
trigger1 = !selfanimexist(anim)
trigger1 = Time > 0
value = anim

[State 5070, 1]
type = ChangeAnim
trigger1 = p2stateno=440&&anim!=5070
value = 5070


[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=3501 
value = 1
movecamera=1,0
[State 0, HitBy]
type = HitBy
trigger1 = p2stateno=3049 
value = SCA,HA
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 203

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 203]
type    = A
movetype= H
physics = N
ctrl = 0
[State 5035, 1]
type = ChangeAnim2
trigger1 =anim!=205 && anim=[5000,5029]
value = 205
[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)
[State 0, HitBy]
type = HitBy
trigger1 = p2stateno=3049 
value = SCA,HA
;value2 = S,NA
time = 1
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=3501 
value = 1
movecamera=1,0
[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1
[State 40, 2]
type = VarSet
trigger1=time=0
sysvar(1) = 0
[State 40, 2]
type = VarSet
triggerall = AIlevel =0
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State 40, 2]
type = VarSet
triggerall = AIlevel >0
trigger1 = random > 450
trigger1= backedgebodydist <35
sysvar(1) = 1
[State 40, 2]
type = VarSet
triggerall = AIlevel >0
trigger1 = random > 450
trigger1= backedgebodydist >75
sysvar(1) = -1
[State 40, 2]
type = VarSet
triggerall = AIlevel =0
trigger1 = command = "holdback"
sysvar(1) = -1
[State 0, VelSet]
type = VelSet
triggerall = alive &&pos y<-40&& !enemy,var(55)
triggerall= command="recovery" || name="Training"&&var(16)||AIlevel >0 && random < (250*(AILevel**2/64.0)) 
trigger1 = HitOver  &&canrecover
x = ifelse(sysvar(1)=0,0,ifelse(sysvar(1)=1,3.5,-3.5))
y = -4

;ignorehitpause = 
;persistent = 

[State 5030, 3]
type = selfState
triggerall =  alive &&pos y<-40 && !enemy,var(55)
triggerall= (vel x =0 || vel x =3.5 || vel x =-3.5)&&vel y=-4 
trigger1 = HitOver &&canrecover
value = 5210;HITA_RECOV
;ignorehitpause = 
;persistent = 
[State 0, SelfState]
type = SelfState
trigger1= Pos Y >= 20&& vel y >0 ;.
trigger1 =enemy,var(55)=2
value =5100

[State 5030, 4]
type = changeState
trigger1= Pos Y >= 20&& vel y >0 ;.
value = cond(enemy,numtarget(206),51001,51000) ;HITA_FAL


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

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


[State 5035, 1]
type = ChangeAnim2
trigger1 =anim!=205
value = 205

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

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 40, 2]
type = VarSet
triggerall = AIlevel =0
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 2]
type = VarSet
triggerall = AIlevel =0
trigger1 = command = "holdback"
sysvar(1) = -1
[State 0, VelSet]
type = VelSet
triggerall = alive &&pos y<-40&& !enemy,var(55)
triggerall= command="recovery" || name="Training"&&var(16)||AIlevel >0 && random < (250*(AILevel**2/64.0)) 
trigger1 = HitOver  &&canrecover
x = ifelse(sysvar(1)=0,0,ifelse(sysvar(1)=1,3.5,-3.5))
y = -4

;ignorehitpause = 
;persistent = 

[State 5030, 3]
type = selfState
triggerall = alive && pos y<-40 && !enemy,var(55)
triggerall= (vel x =0 || vel x =3.5 || vel x =-3.5)&&vel y=-4 
trigger1 = HitOver &&canrecover
value = 5210;HITA_RECOV

;ignorehitpause = 
;persistent = 

[State 0, SelfState]
type = SelfState
trigger1= Pos Y >= 20&& vel y >0 ;.
trigger1 =enemy,var(55)=2
value =5100

[State 5030, 4]
type = changeState
trigger1= Pos Y >= 20&& vel y >0 ;.
value = cond(enemy,numtarget(206),51001,51000) ;HITA_FAL

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

[Statedef 210]
type    = S
movetype= A
physics = S
juggle=0;  = 4
poweradd= 0
ctrl = 0

anim = cond(fvar(15)<10,211,210) 
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0


[State 800, 1]
type = HitDef
triggerall=prevstateno!=[200,440]
Triggerall = Time = 1 
trigger1= (helper(10006),command="holdfwd"||helper(10006),command="holdback") && AIlevel =0
trigger2 = AILevel >0
trigger2 = random <= (499* (AIlevel ** 2 / 64.0))
trigger2 = statetype = S
trigger2 = p2statetype != A && (!var(4) || p2movetype!=A)
trigger2 = p2statetype!=L
trigger2= p2bodydist X < 35 && p2dist y <= 0
trigger2 = (p2stateno =[120,150]) ||  (p2MoveType != H)
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; -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((helper(10006),command="holdfwd"&&AIlevel=0||enemy,backedgebodydist <70&&AIlevel>0),1,-1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
[State 200, 2]
type = PlaySnd
trigger1 = Time =1
value = S500,1
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = animelem=4 && anim=210
v = 36    ;fv = 10
value = 12
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4 && anim=210
x = 12
[State 0, VarSet]
type = VarSet
trigger1 = animelem=8 && anim=210
v = 36    ;fv = 10
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8 && anim=210
x = -12

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

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = floor(cond(anim=211,78,66)*fvar(2))
guardflag = MA
pausetime = 11,11
sparkno =-1; 1
sparkxy = -10, -cond(anim=210,75,70)  
guard.sparkno=S6550
hitsound   = S2,1
guardsound = S3,0
ground.type = High
ground.slidetime = 12
ground.hittime  = cond(anim=210,16,20)
guard.ctrltime=15
air.hittime=14
getpower=ceil(helper(6000),fvar(15)*125)
givepower=0
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -2.75
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-cond(anim=210,75,70)-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

[Statedef 211]
type    = S
movetype= A
physics = S
juggle=0;  = 4
poweradd= 0
ctrl = 0

anim =215
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0
[State 800, 1]
type = HitDef
triggerall=prevstateno!=[200,440]
Triggerall = Time = 1 
trigger1= (helper(10006),command="holdfwd"||helper(10006),command="holdback") && AIlevel =0
trigger2 = AILevel >0
trigger2 = random <= (499* (AIlevel ** 2 / 64.0))
trigger2 = statetype = S
trigger2 = p2statetype != A && (!var(4) || p2movetype!=A)
trigger2 = p2statetype!=L
trigger2= p2bodydist X < 35 && p2dist y <= 0
trigger2 = (p2stateno =[120,150]) ||  (p2MoveType != H)
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; -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((helper(10006),command="holdfwd"&&AIlevel=0||enemy,backedgebodydist <70&&AIlevel>0),1,-1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1    
[State 200, 2]
type = PlaySnd
trigger1 = Time =1
value = S500,1
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = animelem=2
v = 36    ;fv = 10
value = 11
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = 11
[State 0, VarSet]
type = VarSet
trigger1 = animelem=8 
v = 36    ;fv = 10
value =17
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8 
x = 6
[State 0, VarSet]
type = VarSet
trigger1 = animelem=10
v = 36    ;fv = 10
value =14
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10 
trigger2 = animelem=11 
x = -3
[State 0, VarSet]
type = VarSet
trigger1 = animelem=11
v = 36    ;fv = 10
value =11

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=12 
x = -4
[State 0, VarSet]
type = VarSet
trigger1 = animelem=12
v = 36    ;fv = 10
value =0
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = S0, 1

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 7
attr = S, NA
animtype  = Medium
damage    =floor(43*fvar(2))
guardflag = HA
pausetime = 10,10
sparkno =-1; 1
sparkxy = -10, -70 
guard.sparkno=S6550
hitsound   = S2,1
guardsound = S3,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 20
guard.ctrltime=15
getpower=ceil(helper(6000),fvar(15)*66)
givepower=0
ground.velocity = -2.75
air.velocity = -2.5,-4
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit &&animelemtime(8)<0
anim = 6510+random%4
ID = 12000
pos = 5,-70-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, MoveHitReset]
type = MoveHitReset
trigger1 =  AnimElem = 8
;ignorehitpause = 
;persistent = 

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 8
attr = S, NA
animtype  = Medium
damage    =floor(28*fvar(2))
guardflag = MA
pausetime = 10,10
sparkno =-1; 1
sparkxy = -10, -55
guard.sparkno=S6550
hitsound   = S2,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 20
guard.ctrltime=15
getpower=ceil(helper(6000),fvar(15)*66)
givepower=0
ground.velocity = -2.75
air.velocity = -2.5,-4
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit &&animelemtime(8)>=0
anim = 6510+random%4
ID = 12000
pos = 5,-55-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle=0;  = 4
poweradd= 0
ctrl = 0

anim =230; cond(fvar(15)<15,230,231)
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = animelem=3 && anim=230
v = 36    ;fv = 10
value = 9
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3  && anim=230
x = 9
[State 0, VarSet]
type = VarSet
trigger1 = animelem=5 && anim=230
v = 36    ;fv = 10
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5 && anim=230
x = -9
[State 0, VarSet]
type = VarSet
trigger1 = animelem=3 && anim=231
v = 36    ;fv = 10
value = 17
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3  && anim=231
x = 17
[State 0, VarSet]
type = VarSet
trigger1 = animelem=5 && anim=231
v = 36    ;fv = 10
value =0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5  && anim=231
x = -17
[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = S0, 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,3
channel=0
[State 230, 2]
type = HitDef
trigger1 =animelem=3
attr = S, NA
animtype  = Medium
damage    = floor(23*fvar(2))
guardflag = MA
pausetime = 6,6
sparkno =-1; 0
sparkxy = -10, -67
guard.sparkno=S6550
hitsound   = S2,2
guardsound =S3,0
ground.type = Low
getpower=ceil(helper(6000),fvar(15)*26)
givepower=0
ground.slidetime = 6
ground.hittime  = 10             
guard.ctrltime=10
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -2.3
air.velocity = -1.4,-2.7      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6500+random%4
ID = 12000
pos = 5,-67-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle=0;  = 5
poweradd= 0
ctrl = 0

anim = 240
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)

[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,2
channel=0
[State 0, VarSet]
type = VarSet
trigger1 = animelem=3
v = 36    ;fv = 10
value = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 
x = 10
[State 0, VarSet]
type = VarSet
trigger1 = animelem=5
v = 36    ;fv = 10
value = 6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5 
x = -4
[State 0, VarSet]
type = VarSet
trigger1 = animelem=6
v = 36    ;fv = 10
value =0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 
x = -6
[State 240, 1]
type = PlaySnd
trigger1 = Time = 2
value = S0,1

[State 240, 2]
type = HitDef
trigger1 = animelem=4
attr = S, NA
animtype  = Medium
damage    =floor(58*fvar(2)) 
guardflag = MA
pausetime = 11,11
sparkno =-1; 1
sparkxy = -10, -cond(animelemtime(5)<0,100,90)
guard.sparkno=S6550
hitsound   = S2,3
guardsound = S3,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 16
guard.ctrltime=16
air.hittime=14
getpower=ceil(helper(6000),fvar(15)*125)
givepower=0
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -2.75
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-cond(animelemtime(5)<0,100,90)-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning
;     KFM will get hit instead of trading hits with his opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle=0;  = 5
poweradd= 0
ctrl = 0
anim = 400
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = S0, 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,0
channel=0
[State 400, 2]
type = HitDef
trigger1 = animelem=2
attr = C, NA
damage    = floor(24*fvar(2)) 
priority  = 3
animtype  = Light
hitflag = MAFD
guardflag = MA
pausetime = 6,6
sparkno =-1; 0
sparkxy = -10, -57
guard.sparkno=S6550
hitsound = S2, 0                  ;Sound to play on hit
guardsound = S3, 0                ;Sound to play on guard
getpower=ceil(helper(6000),fvar(15)*26)
givepower=0
ground.type = Low
ground.slidetime=6
ground.hittime  = 10            
guard.ctrltime=10
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -2.33
air.velocity = -1.4,-3.2      
down.velocity=-2,-3
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6500+random%4
ID = 12000
pos = 10,-57-ceil(p2bodydist y)
postype = p2  ;p2,front,back,le,.ft,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl=1
;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
[Statedef 410]
type    = C
movetype= A
physics = C
juggle=0;  = 6
poweradd= 0
ctrl = 0
anim = 410
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = S0, 1
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,1
channel=0
;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    =  floor(58*fvar(2)) 
animtype  = Medium
hitflag = MAFD
guardflag = MA
pausetime = 12,12
sparkno =-1; 1
sparkxy = -10, -55
guard.sparkno=S6550
hitsound   = S2,1
guardsound = S3,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 16
guard.ctrltime=16
air.hittime=14
getpower=ceil(helper(6000),fvar(15)*125)
givepower=0
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -2.33
down.velocity=-2,-3
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-55-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle=0;  = 5
poweradd= 0
ctrl = 0
anim = 430
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = S0, 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,3
channel=0
[State 430, 2]
type = HitDef
trigger1 = animelem=2
attr = C, NA
damage    = floor( 24*fvar(2)) 
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 6,6
sparkno =-1; 0
sparkxy = -10, -5
guard.sparkno=S6550
hitsound   = S2,2
guardsound =S3,0
getpower=ceil(helper(6000),fvar(15)*26)
givepower=0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 10            
guard.ctrltime=10
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
ground.velocity = -2.33
down.velocity=-2,-3
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6500+random%4
ID = 12000
pos = 5,-5-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 440]
type    = C
movetype= A
physics = C
juggle=0;  = 7
poweradd= 0
ctrl = 0
anim = 440
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
v = 36    ;fv = 10
value = 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,2
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = 13
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2
v = 36    ;fv = 10
value = 13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =3
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3
v = 36    ;fv = 10
value = 16
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = -16
[State 0, VarSet]
type = VarSet
trigger1 =animelem=9
v = 36    ;fv = 10
value = 0
[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = S0, 1

[State 440, 3]
type = HitDef
trigger1 = animelem=5
attr = C, NA
damage    = floor( 70*fvar(2)) 
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno =-1; 1
sparkxy = -10, -5
guard.sparkno=S6550
hitsound   = S2,3
guardsound = S3,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 16
guard.ctrltime=16
getpower=ceil(helper(6000),fvar(15)*125)
givepower=0
down.velocity=-2,-3
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -2.9
fall = 1
fall.xvelocity = 0
fall.yvelocity = -3.2
id=200
p2facing=1
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 6510+random%4
ID = 12000
pos = 5,-5-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle=0;  = 2
poweradd= 0
ctrl = 0
anim = cond(vel x,601,600)
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = S0, 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,0
channel=0
[State 600, 2]
type = HitDef
trigger1 = animelem=3
attr = A, NA
damage    = floor( 27*fvar(2)) 
guardflag = HA
priority = 3
pausetime = 6,6
sparkno =-1; 0
sparkxy = -10, -cond(anim=600,77,58)
guard.sparkno=S6550
hitsound = S2, 0                  ;Sound to play on hit
guardsound = S3, 0                ;Sound to play on guard
getpower=ceil(helper(6000),fvar(15)*26)
givepower=0
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
guard.ctrltime=10
ground.velocity = -2.33
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46-((helper(10003),var(55))*.24)
p2facing=1
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6500+random%4
ID = 12000
pos = 5,-cond(anim=600,77,58)-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1

;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle=0;  = 4
poweradd= 0
ctrl = 0
anim = 610
sprpriority = 2

[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = S0, 1
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,1
channel=0
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = floor( 78*fvar(2)) 
guardflag = HA
priority = 4
pausetime = 11,11
sparkno =-1; 1
sparkxy = -10, -55
guard.sparkno=S6550
hitsound   = S2,1
guardsound = S3,0
animtype = Med
ground.type = High
ground.slidetime =8
ground.hittime  = 15
guard.ctrltime=15
ground.velocity = -3.5
air.hittime=14
getpower=ceil(helper(6000),fvar(15)*125)
givepower=0
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-55-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle=0;  = 3
poweradd= 10
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = S0, 0
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,3
channel=0
[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage =floor( 27*fvar(2)) 
guardflag = HA
priority = 3
pausetime = 6,6
sparkno =-1; 1
sparkxy = -5, -37
guard.sparkno=S6550
hitsound   = S2,2
guardsound =S3,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
guard.ctrltime=10
getpower=cond(helper(6000),fvar(15),10,26)
givepower=0
ground.velocity = -2.33
air.hittime=14
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6500+random%4
ID = 12000
pos = 5,-37-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = A
juggle=0;  = 4
poweradd= 0
ctrl = 0
anim = 640
sprpriority = 2

[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value = S0, 1
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,2
channel=0
[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    =floor( 78*fvar(2)) 
guardflag = HA
priority = 4
pausetime = 11,11
sparkno =-1; 1
sparkxy = -10,-40
guard.sparkno=S6550
hitsound   = S2,3
guardsound = S3,0
animtype = Med
ground.type = High
ground.slidetime =8
ground.hittime  = 15
guard.ctrltime=15
ground.velocity = -4.08
air.hittime=14
getpower=ceil(helper(6000),fvar(15)*125)
givepower=0
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-40-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 641]
type    = A
movetype= A
physics = N
juggle=0;  = 4
poweradd= 0
ctrl = 0
anim = 645
velset=0,0
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = animelem=5
x = 7.5
y = 9


[State 200, 2]
type = PlaySnd
trigger1 = Time = 1
value = S500, 4
channel=0
[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value = S0, 2

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    =floor( 78*fvar(2)) 
guardflag = HA
priority = 4
pausetime = 11,11
sparkno =-1; 1
guard.sparkno=S6550
sparkxy = -10,-40
hitsound   = S2,3
guardsound = S3,0
animtype = Med
ground.type = High
ground.slidetime =8
ground.hittime  = 15
guard.ctrltime=15
ground.velocity = -7
air.hittime=14
getpower=0
givepower=0
fall.recovertime=14*(1+(helper(10003),var(55)*45))
air.fall=1
air.velocity = -1.4,-3.2      
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
yaccel=.46
p2facing=1
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6510+random%4
ID = 12000
pos = 5,-40-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=7 && pos y<10
value =anim
elem = 5

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

[State 0, VelSet]
type = posSet
trigger1 = animelem=7
y = 0
[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
; CNS difficulty: medium-advanced
; Description: Throws are not difficult to make, although then can be
;     tedious at times. Throw attempt states have a HitDef of a
;     special format. The key parameters in a throw are p1stateno
;     and p2stateno. If the HitDef successfully connects, then
;     the attacker will change to the state number specified by
;     p1stateno, and the opponent will be change to the state
;     number assigned to p2stateno. The special thing about p2stateno
;     is that the opponent will be temporarily brought into the
;     attacker's state file. In this case, no matter who the
;     opponent is, he will be taken to state 820 of this file (kfm.cns)
;     and remain here until the end of the throw (look at his debug
;     information when he is being thrown; the text changes to yellow
;     to mean that he is in another player's state file).
[Statedef 800]
type    = S
movetype= A
physics = S
juggle=0;  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents KFM from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
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; -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 p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
; Description: In this state, KFM throws the opponent by binding him to
;     various offsets based on his current frame of animation. For
;     example, [State 810, Bind 1] binds the opponent to an offset of
;     28 pixels in front of KFM. That puts him around where KFM's hand
;     is at. Is is important to keep the opponent bound using a
;     TargetBind controller at all times, until you let him go. This
;     is especially important if your player has a Clsn2 box that
;     allows him to get hit while throwing someone. Each time a player
;     gets hit, all his bound targets will be set to a fall state. If
;     the opponent is not bound, then he may get stuck in his thrown
;     state when his attacker is knocked out of the throw halfway.
; Notes: There is a TargetLifeAdd controller to decrease the opponent's
;     life, and a TargetState controller to change his state to a
;     falling state when KFM lets go of him.
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd =0
velset=0,0
; 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 = (random<33*(enemy,AIlevel))&&(enemy,AIlevel)>0&&time=0
v = 20   
value = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = (time=[0,6])&&((enemy,command="z")||(enemy,command="x"&&enemy,command="a")||(enemy,command="y")||(enemy,command="y"&&enemy,command="b"))&&enemy,AIlevel=0
trigger2 = var(20)=1&&(enemy,AIlevel>0)&& time =0
value =811

[State 810, Holding fwd?]
type = VarSet
trigger1 = Time = 0
sysvar(3) = command = "holdfwd"

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1, 1

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = S0, 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =3
value = S801,0
channel = 0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 40,0
[State 810, PosAdd]
type = posadd
trigger1 = animelem = 2 || animelem = 4
x = 5

[State 810, PosAdd]
type = posadd
trigger1 = animelem = 5 || animelem = 9 || animelem = 10
x = 10
[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(12) < 0
edge = 60,0

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos = 25,0

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos =20,-81

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) < 0
pos = 14,-90
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos =17,-87
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(7) < 0
pos =20,-84
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0
pos =39,-67
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(8) >= 0 && AnimElemTime(9) < 0
pos =36,-35
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem=9
pos =34,-15
[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem=10
pos =45,0

[State 0, TargetFacing]
type = TargetFacing
trigger1 = animelem=9
value = 1 
;persistent = 
[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = S0, 2
;[State 810, holdfwd - Pos 6] ;If was holding fwd before, move a little
;type = PosAdd
;trigger1 = var(2)
;trigger1 = AnimElem = 6
;x = -37

;[State 810, holdfwd - Turn Target 6] ;If was holding fwd before, turn target too
;type = TargetFacing
;trigger1 = sysvar(3)
;trigger1 = AnimElem = 6
;value = -1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 10
time =4
freq = 60
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 

[State 810, HitSpark]
type = explod
trigger1 = animelem = 10
pos = 50,0
postype = p1
sprpriority = -5
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
ownpal = 1
[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 10
value = S5100,0
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 10
time =4
freq = 60
ampl = -4
phase = 90
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =12
value = S801,1
channel = 0
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 16
time =8
freq = 60
ampl = -4
phase = 90
[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 13
value = S0, 2
[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 16
value = S2,1
[State 0, Explod]
type = Explod
trigger1 =animelem=16
anim = 6510+random%4
ID = 12000
pos = 5,-0
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 8
trigger2= AnimElem = 16
value = -39
[State 0, PowerAdd]
type = PowerAdd
trigger1 = AnimElem = 8
value = 44
[State 0, PowerAdd]
type = PowerAdd
trigger1 = AnimElem = 16
value = 45
;ignorehitpause = 
;persistent = 

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 16
value = 821



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

[State 200, 1]
type = PlaySnd
trigger1 = animelem=1
value = 5000,0
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0 
x = -20
[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = S800, 0
channel=1
[State 0, Explod]
type = Explod
trigger1 = animelem  =1
anim =850
ID =850
pos = 40,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .75,.75
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = time=[1,5)
x = -5.5
[State 0, PosAdd]
type = PosAdd
trigger1 = time=[5,7]
x = -1.5
[State 810, State End]
type = ChangeState
trigger1 =Time = 18
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 812]
type    = S
movetype= A
physics = S
poweradd = 0
facep2=1
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0 
x = -20
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 5910



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

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=811
value =812
;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

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

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


[State 821, 4] ;Hit ground
type = changeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 51000 ;Hit ground
;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
; Description: In this state, KFM throws the opponent by binding him to
;     various offsets based on his current frame of animation. For
;     example, [State 810, Bind 1] binds the opponent to an offset of
;     28 pixels in front of KFM. That puts him around where KFM's hand
;     is at. Is is important to keep the opponent bound using a
;     TargetBind controller at all times, until you let him go. This
;     is especially important if your player has a Clsn2 box that
;     allows him to get hit while throwing someone. Each time a player
;     gets hit, all his bound targets will be set to a fall state. If
;     the opponent is not bound, then he may get stuck in his thrown
;     state when his attacker is knocked out of the throw halfway.
; Notes: There is a TargetLifeAdd controller to decrease the opponent's
;     life, and a TargetState controller to change his state to a
;     falling state when KFM lets go of him.
[Statedef 830]
type    = S
movetype= A
physics = N
anim = 830
poweradd = 0

; 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 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1, 1

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 800, 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 30,0

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

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos =-28,-91

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos =10,-96

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

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem=5
pos =85,-47


;[State 810, holdfwd - Pos 6] ;If was holding fwd before, move a little
;type = PosAdd
;trigger1 = var(2)
;trigger1 = AnimElem = 6
;x = -37

;[State 810, holdfwd - Turn Target 6] ;If was holding fwd before, turn target too
;type = TargetFacing
;trigger1 = sysvar(3)
;trigger1 = AnimElem = 6
;value = -1

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 5
value = -78

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 5
value = 821



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

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

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

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

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

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


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

;-----------------------------
;Evasive Roll
[StateDef 700]
type = S
movetype= I
physics = N
juggle=0; =0;  = 1
velset = 0,0
ctrl = 0
anim = 300
poweradd = 0
sprpriority = 2


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

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

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem = 1
time =20
length =10
palcolor = 256
palinvertall = 0
PalBright = 1,1,50
PalContrast = 1, 50, 150
PalAdd = 0,0,0
PalMul = .5,.5,.5
timegap = 1
framegap = 3
;trans = add1 ;"none","add1","sub"
;ignorehitpause =
;persistent =



;[State 0, PosAdd]
;type = PosAdd
;trigger1 = animelem = 7
;x = 10
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(3)<5
x = 4.5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(3)>=5 && animelemtime(4)<0
x = 1.5

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S700,0
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S701,0
channel = 0



[State 4000, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-----------------------------
;Evasive Roll
[StateDef 701]
type = S
movetype= I
physics = N
juggle=0; =0;  = 1
velset = 0,0
ctrl = 0
anim = 301
poweradd = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
value = S700,1
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
value = S701,0
channel = 0

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

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem = 1
time =34
length =10
palcolor = 256
palinvertall = 0
PalBright = 1,1,50
PalContrast = 1, 50, 150
PalAdd = 0,0,0
PalMul = .5,.5,.5
timegap = 1
framegap = 3
;trans = add1 ;"none","add1","sub"
;ignorehitpause =
;persistent =

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(11)<0
time = 2

;[State 0, PosAdd]
;type = PosAdd
;trigger1 = animelem = 7
;x = 10
;ignorehitpause =
;persistent =
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
statetype = A       ;S,A,C,L
physics = N
[State 0, VelSet]
type = VelSet
trigger1 =animelem=6
x = 2.5
y = -6

[State 0, NotHitBy]
type =HitBy
trigger1 = animelemtime(5)>=0&&animelemtime(10)<0
value = SA,AA,AT,AP
;value2 = S,NA
time =1

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(6)>=0&&animelemtime(12)<0
y = .37
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  animelem = 12
statetype =S       ;S,A,C,L
physics = N
[State 0, PosSet]
type = PosSet
trigger1 = animelem = 12
y = 0
[State 0, PosSet]
type = velSet
trigger1 = animelem = 12
y = 0
x=0


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




[State 4000, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-----------------------------
;Evasive Roll
[StateDef 702]
type = A
movetype= I
physics = N
juggle=0; =0;  = 1
velset = 0,0
ctrl = 0
anim = 302
poweradd = 0
sprpriority = 2


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

;[State 0, VarAdd]
;type = VarAdd
;trigger1 = animelem = 1
;v = 37    ;fv =
;value = -1
;ignorehitpause =
;persistent =
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S40,1
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S701,0
channel = 0
[State 0, AfterImage]
type = AfterImage
trigger1 = animelem = 1
time =2
length =10
palcolor = 256
palinvertall = 0
PalBright = 1,1,50
PalContrast = 1, 50, 150
PalAdd = 0,0,0
PalMul = .5,.5,.5
timegap = 1
framegap = 3
;trans = add1 ;"none","add1","sub"
;ignorehitpause =
;persistent =

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(8)<0
time = 2
;ignorehitpause = 
;persistent = 


;[State 0, PosAdd]
;type = PosAdd
;trigger1 = animelem = 7
;x = 10
;ignorehitpause =
;persistent =

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7
physics = A         ;A,C,S,N


[State 0, NotHitBy]
type =HitBy
trigger1 = time = 0
value = C,AA,AT,AP
;value2 = S,NA
time =12

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time>11
movetype = A

;[State 0, PlaySnd]
;type = PlaySnd
;trigger1 = animelem = 12
;value = F40,0
;volume = 255
;channel = -1
;
;
;
;
;[State 4000, end]
;type = ChangeState
;trigger1 = AnimTime = 0
;value = 0
;ctrl = 1

;-----------------------------
;Evasive Roll
[StateDef 705]
type = U
movetype= I
physics = N
juggle=0; =0;  = 1
velset = 0,0
ctrl = 0
poweradd = 0
sprpriority = 2

[State 0, PalFXWiz]
type = PalFX
trigger1 = !hitshakeover
time = 10
add = 256,256,256
mul = 256,256,256
sinadd = -256,-256,-256,30
invertall = 0
color = 0
ignorehitpause=1
persistent=0

[State 0, VarSet]
type = Varadd
trigger1 = time=0
v = 59    ;fv = 10
value = -10000
;ignorehitpause = 
;persistent = 

[State 0, Pause]
type = Pause
trigger1 = time=[0,15]
time = 3
movetime = 3
[State 810, Throw Sound]
type = PlaySnd
trigger1 =time=0
value = S700, 3
channel=3
[State 200, 2]
type = PlaySnd
trigger1 = Time =0
value = S500,1
channel=0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
;value2 = S,NA
time = 4
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 5   ;fv = 10
value =  gethitvar(hittime)
;ignorehitpause = 
;persistent = 


[State 4000, end]
type = ChangeState
triggerall=time>=15
trigger1 = var(5)<13
trigger1 = time >=(var(5)-cond(p2statetype=A,2,4))
trigger2 = var(5)=[13,24]
trigger2 = time >=(var(5)-cond(p2statetype=A,5,0))
trigger3 = var(5)>=25
trigger3 = time >=(var(5)-cond(p2statetype=A,17,10))
value = 140
;-----------------------------
;Evasive Roll
[StateDef 710]
type =U
movetype= A
physics = S
juggle=0; =0;  = 1
;velset = 0,0
ctrl = 0
anim = cond(statetype!=A,303,305)
poweradd = -1000
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0 && statetype!=A
x = 0
[State 0, VarAdd]
type = VarAdd
trigger1 = time=0
v = 59    ;fv = 
value = -10000
;ignorehitpause = 
;persistent = 

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

[State 0, Helper]
type = Helper
trigger1 = animelem  =1
helpertype = normal ;player
name ="Haoh-ken"
ID = 6210
stateno = 6210
pos =-8,-60
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2&&statetype!=A
x = 15

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = statetype=A
physics = A         ;A,C,S,N


;[State 0, PosAdd]
;type = PosAdd
;trigger1 = animelem = 7
;x = 10
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10&&statetype!=A
x = 30
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S6000,0
channel = 2


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

[State 240, 2]
type = HitDef
trigger1 = animelem=5 && statetype=A
attr = A, NA
animtype  = heavy
damage    = 0
pausetime = 11,cond(p2statetype=A,16,11)
sparkno =-1; 1
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 16
guard.ctrltime=16
ground.velocity = -3.5
air.velocity = -2.2,-8.2
fall.xvelocity = 0
fall.yvelocity = -3.2
fall=1
yaccel=.43
id=cond(p2statetype=A,710,206)

[State 240, 2]
type = HitDef
trigger1 = animelem=6 && statetype!=A
attr = S, NA
animtype  = heavy
damage    = 0
pausetime = 11,cond(p2statetype=A,11,16)
sparkno =-1; 1
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 16
guard.ctrltime=16
ground.velocity = -3.5
air.velocity = -2.2,8.2
fall.xvelocity = 0
fall.yvelocity = -3.2
fall=1
yaccel=.43
id=cond(p2statetype=A,206,710)
[State 0, TargetState]
type = TargetState
triggerall = NumTarget(710)
trigger1 =movehit && p2stateno!=711
value =711
ID = 710
ignorehitpause = 1
;persistent = 



[State 4000, end]
type = ChangeState
trigger1 = AnimTime = 0 &&statetype!=A
value = 0
ctrl = 1

;----------------------------------------------------------------------
[Statedef 711]
type = A
movetype = H
physics = N
velset = 0,0
poweradd = 40

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = selfanimexist(5102) && !hitshakeover
value = 350
elem = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !selfanimexist(5102) && !hitshakeover
value = 351
elem = 1
[State 0, VelSet]
type = VelSet
trigger1 = hitshakeover
x = -1
y = -6.5
persistent = 0

[State 1421, 1] ;Gravity
type = VelAdd
Trigger1 = hitshakeover
y = .2


[State 1421, 4] ;Hit ground
type = changeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15
value = 51000 ;Hit ground

;-----------------------------
;Advancing attack
[StateDef 715]
type = S
movetype= A
physics = S
juggle=0; =0;  = 1
velset = 0,0
ctrl = 0
anim = 304
poweradd = -1000
sprpriority = 2


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(5)<0
flag = noBG
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 =time=0
helpertype = normal ;player
name = "gauges"
ID =  6100
stateno = 6100
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(1)>=0&&animelemtime(5)<0
x = 12.5


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

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


[State 240, 2]
type = HitDef
trigger1 = animelem=4
attr = S, NA
animtype  = Medium
damage    =16
pausetime = 10,10
hitflag= MAF
guardflag =MA
sparkno =-1; 1
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 12
guard.ctrltime=11
ground.velocity = -1.78
air.velocity = -2.2,-3.2
fall.xvelocity = 0
fall.yvelocity = -3.2
air.hittime=12
fall.recovertime=(var(0)*999)+14
air.fall=1
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2

[State 4000, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; 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;  = 4
poweradd= 0
;velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 8
value = 0, 3
[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0  &&AIlevel=0
v = 2    ;fv = 10
value =   (helper(10006), var(0)&258) > 0;command="QCF_y"

[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0
v = 2    ;fv = 10
value = helper(10003),var(21) || p2bodydist x >90 && var(4)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 &&var(4)
value = 1010+var(2)
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 
x = cond(anim=1000,25,18)
[State 0, Width]
type = Width
trigger1 = animelem=6
player = 25,0



[State 0, Explod]
type = Explod
trigger1 = animelem  =6&& anim=[1010,1011]
anim =1015
ID =1001
pos = 40,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem  =6&& anim=[1010,1011]
anim =1016
ID =1001
pos = 40,5
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =-1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem  =6&& anim=[1010,1011]
time = 6
freq = 60
ampl = -4
phase = 90

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem  =6&& anim=[1010,1011]
value = S5100,0
channel = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1 && anim=[1010,1011]
value = S501,(random%2)
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5 && anim!=[1010,1011]
value = S501,9
channel = 0
[State 0, Helper]
type = Helper
trigger1 = animelem  =6 && anim!=[1010,1011]
helpertype = normal ;player
name ="Haoh-ken"
ID = 1001
stateno = 1001
pos =60,-79
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=.5
size.yscale=.5
[State 0, Helper]
type = Helper
trigger1 = animelem  =5 && anim=[1010,1011]
helpertype = normal ;player
name ="Haoh-ken"
ID = 1010
stateno = 1010
pos =70,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x = -25
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7
movetype = I   

  [State 1200, 2]
type = HitDef
triggerall = anim=[1010,1011]
trigger1 = animelem=5
attr = S, SA
animtype  = hard
air.animtype=diagup
damage    = floor( cond(var(2),62,88)*fvar(2)), 12
priority  = 5
guardflag = MA
pausetime =18,18
sparkxy = 0,-65
hitsound   = S2,9
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 18
guard.ctrltime=18
ground.velocity = -cond(var(2),9,7)
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -9,-1
fall=var(2)
air.fall=1
yaccel=.46
fall.recovertime=25
envshake.ampl = 3
envshake.time = 12
ground.cornerpush.veloff = 0
id=205
[State 0, Explod]
type = Explod
trigger1 = movehit 
anim = 6520+random%4
ID = 12000
pos = 5,-75-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
; Kung Fu Knee
; CNS difficulty: medium
; Description: Like the Kung Fu Palm, this is a special attack. This attack
;     begins on the ground, launches KFM into the air, then ends when KFM
;     lands on the ground. To achieve this, we use three states. The first
;     has KFM starting on the ground (note that type = S in the Statedef).
;     The ChangeState controller brings KFM into the second state (state
;     1051) when his ground animation ends. The second state controls KFM's
;     movement into the air and back towards the ground. The last state
;     (state 1052) stops KFM from moving when he touches the ground, and
;     brings him back to his stand state (state 0) when the animation is
;     over. More details are given in comments before each of the following
;     states.
[Statedef 1050]
type    = S
movetype= A
physics = S
juggle=0;  = 4
poweradd= 0
;velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0  &&AIlevel=0
v = 2    ;fv = 10
value =(helper(10006), var(0)&258) > 0

[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0
v = 2    ;fv = 10
value = p2bodydist x > 30 || prevstateno=[200,440]  
[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0 && helper(10002),var(2)!=-1 
v = 2    ;fv = 10
value = helper(10002),var(2) 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2) && time=0
value = 1051
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S501,2+(random%2)
channel = 0

[State 0, NotHitBy]
type = HitBy
trigger1 = time = 0 &&!var(2)
value = SC,NA,SA,HA,NP,SP,HP
;value2 = S,NA
time = 6
[State 0, NotHitBy]
type = notHitBy
trigger1 = time = 0 &&var(2)
value = SCA
;value2 = S,NA
time = 7


[State 0, PalFXWiz]
type = PalFX
trigger1 = movecontact=1
trigger1 = helper(10003),var(9)
time = 10
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,200,200,30
invertall = 0
color = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1 = animelem=5&& !var(2)
trigger2 = animelem=8&& var(2)
anim = 7053
ID = 8302
pos = 0,2
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -.4,0
accel = 0,0
random = 0,0
scale = .5,.4
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, VelSet]
type = VelSet
trigger1 = animelem=5&& !var(2)
trigger2 = animelem=8&& var(2)
x =cond(var(2),3.5,2.5)
y = -cond(var(2),9,7.5)
persistent = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& !var(2)
trigger2 = animelem=8&& var(2)
x = 15
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5&& !var(2)
trigger2 = animelem=8&& var(2)
statetype = A       ;S,A,C,L
physics = N



[State 200, Idle]
type= statetypeset
trigger1= animelemtime(7)>=0 && !var(2)
trigger2= animelemtime(10)>=0 && var(2)
movetype= I




[State 0, VelSet]
type = VelSet
trigger1 = animelem=7&& !var(2)
trigger2 = animelem=10&& var(2)
x = 0
;ignorehitpause =
;persistent =

[State 2501, 1]
type = HitDef
trigger1 = animelem=4&& !var(2)
trigger2 = animelem=7&& var(2)
attr = S, SA
damage = floor( cond(var(2),88,58)*fvar(2)) , 4
animtype = heavy
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = 12, 12
sparkno =-1; 2
sparkxy = -10, -75
guard.sparkno=S6550
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=ceil(helper(6000),fvar(15)*118)
givepower=0
ground.slidetime = 5
ground.hittime  = 25
guard.ctrltime=25
ground.velocity = -2, -8
airguard.velocity = -1.9,-.8
down.velocity=-2,-3
air.type = High
air.velocity = -2,-cond(p2statetype=L,3,9)
fall=1
yaccel=.46
fall.recovertime=((var(0)||var(4)&&numexplod(1050)=0)*999)+25
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0

;[State 0, MoveHitReset]
;type = MoveHitReset
;trigger1 =  animelem=8&& var(2)
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 = movehit &&animelemtime(5)<0 && !var(2) ;&& enemy,gethitvar(hitshaketime)>0
trigger2 = movehit &&animelemtime(8)<0 && var(2) ;&& enemy,gethitvar(hitshaketime)>0
anim = 6520+random%4
ID = 12000
pos = 5,-75-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 2501, 1]
type = HitDef
trigger1 = animelem=5&& !var(2)
trigger2 = animelem=8&& var(2)
attr = A, SA
damage = floor( cond(var(2),39,58)*fvar(2)), 4
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 12, 12
sparkno =-1; 2
sparkxy = -10, -95
guard.sparkno=S6550
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 25
guard.ctrltime=25
ground.velocity = -2, -8
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -2,-cond(p2statetype=L,3,9)
getpower=ceil(helper(6000),fvar(15)*66)
givepower=0
fall=1
yaccel=.46
fall.recovertime=(var(0)*999)+25
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
nochainid=200*!var(2)
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
[State 0, Explod]
type = Explod
trigger1 = movehit &&animelemtime(5)>=0 && !var(2) && enemy,gethitvar(hitshaketime)>0
trigger2 = movehit &&animelemtime(8)>=0 && var(2) && enemy,gethitvar(hitshaketime)>0
anim = 6520+random%4
ID = 12000
pos = 5,-95-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && !var(2) && var(4)
trigger1 = animelem=5
value = 1055
persistent = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=1&& !var(2) && anim=1055
x =2.5
y = -4.5
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && var(2) && var(4)
trigger1 = animelem=8,9
value = 1056
persistent = 0
[State 2501, 1]
type = HitDef
triggerall = anim=1056
trigger1 = animelem=5&& var(2)
attr = A, SA
damage = floor( 36*fvar(2)), 4
animtype = heavy
air.animtype=diagup
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 12, 12
sparkno =-1; 2
sparkxy = -10, -55
guard.sparkno=S6550
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 25
guard.ctrltime=25
ground.velocity = -2, -8
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -2,9
getpower=0
givepower=0
fall=1
yaccel=.46
envshake.ampl = 3
envshake.time = 10
fall.recovertime=(var(0)*999)+25
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
nochainid=200*!var(2)
id=206
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
trigger1 = movehit &&anim=1056&& enemy,gethitvar(hitshaketime)>0
anim = 6520+random%4
ID = 12000
pos = 5,-55-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = anim=1056
trigger1 = animelemtime(5)>0&& var(2) && movehit
anim = 10000
ID = 1051
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
persistent=0
[State 0, Explod]
type = Explod
triggerall = anim=1055
trigger1 = animelem=1
anim = 10000
ID = 1050
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S0,2
channel =1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=[1050,1051]
trigger1 = animelem=11&& !var(2)&& pos y <0 
trigger2 = animelem=14&& var(2)&& pos y <0 
value = anim
elem = cond(var(2),13,10)
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=[1055,1056]
trigger1 = animelem=6&& !var(2)&& pos y <0 
trigger2 = animelem=10&& var(2)&& pos y <0 
value = anim
elem = cond(var(2),9,5)

[State 0, VelAdd]
type = VelAdd
triggerall = anim=[1050,1051]
trigger1 = animelemtime(5)>=0 && animelemtime(11)<0&& !var(2)
trigger2 = animelemtime(8)>=0 && animelemtime(14)<0&& var(2)
y = .55

[State 0, VelAdd]
type = VelAdd
triggerall = anim=[1055,1056]
trigger1 = animelemtime(1)>=0 && animelemtime(6)<0&& !var(2)
trigger2 = animelemtime(2)>=0 && animelemtime(10)<0&& var(2)
y = .55

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=11&& !var(2) && anim=[1050,1051]
trigger2 = animelem=14&& var(2)&& anim=[1050,1051]
trigger3 = animelem=6&& !var(2) && anim=[1055,1056]
trigger4 = animelem=10&& var(2)&& anim=[1055,1056]
statetype = S     ;S,A,C,L
movetype=I
physics = S

[State 0, VelSet]
type = VelSet
trigger1 = animelem=11&& !var(2) && anim=[1050,1051]
trigger2 = animelem=14&& var(2)&& anim=[1050,1051]
trigger3 = animelem=6&& !var(2) && anim=[1055,1056]
trigger4 = animelem=10&& var(2)&& anim=[1055,1056]
x = 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = animelem=11&& !var(2) && anim=[1050,1051]
trigger2 = animelem=14&& var(2)&& anim=[1050,1051]
trigger3 = animelem=6&& !var(2) && anim=[1055,1056]
trigger4 = animelem=10&& var(2)&& anim=[1055,1056]
y = 0
[State 0, Explod]
type = Explod
trigger1 = animelem=11&& !var(2) && anim=[1050,1051]
trigger2 = animelem=14&& var(2)&& anim=[1050,1051]
trigger3 = animelem=6&& !var(2) && anim=[1055,1056]
trigger4 = animelem=10&& var(2)&& anim=[1055,1056]
anim = 7051
ID = 8302
pos = -10,2
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .3,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = animelem=11&& !var(2) && anim=[1050,1051]
trigger2 = animelem=14&& var(2)&& anim=[1050,1051]
trigger3 = animelem=6&& !var(2) && anim=[1055,1056]
trigger4 = animelem=10&& var(2)&& anim=[1055,1056]
anim = 7051
ID = 8302
pos = 10,2
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .3,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 2509, end]
type = ChangeState
trigger1 = AnimTime = 0 
value = 0
ctrl = 1


;------------------
; Light Kung Fu Knee - land
; Description: This is KFM's landing state. There is a velset in the
;     Statedef to stop KFM from moving. Since KFM's y-position can be any
;     number greater than -10 upon entering this state (see the ChangeState
;     controller in State 1051), we need to reset it to 0, the ground
;     level. That is what controller 1052,1 is for.
[Statedef 1052]
type    = S
movetype= I
physics = S
anim = 1052
sprpriority = 1
velset = 0,0

[State 1052, 1] ;Reset y-position to ground level
type = PosSet
trigger1 = Time = 0
y = 0

[State 1052, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = Time = 0
value = 40, 0

[State 1052, 3] ;Give KFM back control early
type = CtrlSet
trigger1 = AnimElem = 3, -1
value = 1

[State 1052, 4] ;Move KFM back a little
type = PosAdd
trigger1 = AnimElem = 4
x = -15

[State 1052, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



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

[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0  &&AIlevel=0
v = 2    ;fv = 10
value =  (helper(10006), var(0)&4128) > 0

[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0
v = 2    ;fv = 10
value = p2bodydist x > 100 || p2statetype!=A&&prevstateno=[200,440]  
[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0 && helper(10002),var(2)!=-1 
v = 2    ;fv = 10
value = helper(10002),var(2) 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2) && time=0
value = 1101
[State 0, PalFXWiz]
type = PalFX
trigger1 = movecontact=1
trigger1 = helper(10003),var(9)
time = 10
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,200,200,30
invertall = 0
color = 0
ignorehitpause=1
persistent=0

[State 1100, 1]
type = PlaySnd
trigger1 = AnimElem = 3&& anim=[1100,1101]
value = S0, 2
channel=1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =3&& anim=[1100,1101]
value = S501,4
channel = 0

[State 0, Explod]
type = Explod
trigger1 = animelem=3&& anim=[1100,1101]
anim = 7053
ID = 8302
pos = 0,2
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -.4,0
accel = 0,0
random = 0,0
scale = .5,.3
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(3)>=0 && animelemtime(6)<0 && anim=[1100,1101]
trigger2 =animelemtime(1)>=0 && animelemtime(3)<0 && anim=1105
x = cond(var(2),8.5,5.5)+(2.35)*var(4)
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
statetype = A       ;S,A,C,L
physics = N
[State 0, HitBy]
type = HitBy
trigger1 = animelemtime(3)>=0 && animelemtime(6)<0
value = SCA,NA,SA,HA,NP,SP,HP
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 


[State 1100, 2]
type = HitDef
trigger1 = animelem=4
attr = A, SA
animtype  = Med
damage    = floor( cond(var(2),50,66)*fvar(2)), 4
priority  = 3
guardflag = MA
pausetime = 12,12
sparkxy = -10, -45
guard.sparkno=S6550
hitsound   = S2,6
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 25
guard.ctrltime=25
getpower=ceil(helper(6000),fvar(15)*cond(!var(2),118,66))
givepower=0
ground.velocity = -cond(var(2),2,cond(var(4),1,2.9)),cond(var(2),0, -5)
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -cond(var(2),2,5),-5
fall=!var(2)
air.fall=1
yaccel=.46
fall.recovertime=cond(p2statetype=A,(var(0)*999)+25,999)
envshake.ampl = 3
envshake.time = 10
down.velocity=-2,-3
ground.cornerpush.veloff = 0
id=200 
fall.xvelocity = 0
fall.yvelocity = -3.2 
[State 0, Explod]
type = Explod
trigger1 = movehit &&anim!=1105 
anim = 6520+random%4
ID = 12000
pos = 5,-45-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && (var(2)||var(4)) 
value = 1105
elem = 1
persistent = 0
[State 1100, 1]
type = PlaySnd
trigger1 = AnimElem = 2&& anim=1105
value = S0, 2
channel=1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =1&& anim=1105
value = S501,5
channel = 0
;[State 0, MoveHitReset]
;type = MoveHitReset
;trigger1 = animelem=1&&anim=1105
;ignorehitpause = 
;persistent = 

[State 1100, 3]
type = HitDef
trigger1 = AnimElem = 5 && anim=1105
attr = S, SA
animtype  = Up
damage    = floor( 54*fvar(2)), 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10, -55
guard.sparkno=S6550
hitsound   = S2,6
guardsound = S3,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 25
guard.ctrltime=25
getpower=ceil(helper(6000),fvar(15)*66)
givepower=0
ground.velocity = -cond(var(2),1,8),cond(var(2),-8, -4)
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -cond(var(2),1,8),cond(var(2),-8, -4)
fall=1
yaccel=.42
fall.recovertime=cond(p2statetype=A,(var(0)*999)+25,999)
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=cond(var(2),200,201)  
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
trigger1 = movehit &&anim=1105 && enemy,gethitvar(hitshaketime)>0
anim = 6520+random%4
ID = 12000
pos = 5,-55-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = anim=1105
trigger1 = animelemtime(5)>0 && movehit
anim = 10000
ID = 1101
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
persistent=0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7 && anim=1105
trigger2 = animelem=6 && anim!=1105
statetype = S       ;S,A,C,L
physics = N
[State 1100, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;
;---------------------------------------------------------------------------
; Light Kung Fu Blow
; CNS difficulty: easy
; Notes: This uses the EnvShake controller to shake the screen. It makes the
;        move look stronger.
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle=0;  = 4
poweradd=0
;velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0
x = 0

[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0  &&AIlevel=0
v = 2    ;fv = 10
value = (helper(10006), var(0)&258) > 0
[State 0, StateTypeSet]
type = StateTypeSet
triggerall=movetype=I && (p2movetype!= H ||p2stateno=5120)
trigger1 = anim=[1200,1201]
movetype =A
[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0
v = 2    ;fv = 10
value = power>1000 ||p2statetype=A&&prevstateno!=440 
[State 0, VarSet]
type = VarSet
trigger1 = time=0  && AIlevel>0 && helper(10002),var(2)!=-1 
v = 2    ;fv = 10
value = helper(10002),var(2) 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2) && time=0
value = 1201
[State 1200, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 3
[State 0, PosSet]
type = Posadd
trigger1 = animelem=6 && anim=[1200,1201]
x =9

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2) &&animelem=18&&anim=1201;&& time<45
value = 1201
elem=6
persistent=0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =movehit=1&&anim=[1200,1201];&& time<45
value = 1205
persistent=0
[State 0, PalFXWiz]
type = PalFX
trigger1 = movecontact=1
trigger1 = helper(10003),var(9)
time = 10
add = 0,-200,-200
mul = 256,256,256
sinadd = 40,200,200,30
invertall = 0
color = 0
ignorehitpause=1
persistent=0

[State 0, Explod]
type = Explod
triggerall = anim=[1200,1201]
trigger1 = animelemtime(7)>=0&&animelemtime(17)<0
trigger1= time%5=0
anim = 7050
ID = 8302
pos =-7,3
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -1,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 1100, 1]
type = PlaySnd
triggerall = anim=[1200,1201]
trigger1 = animelemtime(7)>=0&&animelemtime(17)<0
trigger1= time%5=0
value = S0, 2
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=[1200,1201]
trigger1 = animelem =5
value = S501,6
channel = 0
[State 1200, 2]
type = HitDef
triggerall = anim=[1200,1201]
trigger1 = animelemtime(7)>=0&&animelemtime(17)<0
trigger1= time%3=0
attr = S, SA
animtype  = Hard
damage    = 0, 6
priority  = 5
guardflag = MA
pausetime = 2,2
sparkxy = 0,-65
guard.sparkno=S6550
hitsound   = S2,8
guardsound = S3,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 18
guard.ctrltime=18
getpower=ceil(helper(6000),fvar(15)*66)
givepower=0
guard.velocity =-3.5
ground.velocity = -0, 0
airguard.velocity = -1.9,-4
air.type = High
air.velocity = 0,0
fall=1
yaccel=.42
fall.recovertime=cond(p2statetype=A,(var(0)*999)+25,999)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
id=1250 
snap=55,-5 
[State 0, Explod]
type = Explod
triggerall = anim=[1200,1201]
trigger1 = movehit
anim = 6520+random%4
ID = 12000
pos = 5,-65-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 1200, 2]
type = HitDef
triggerall = anim=1205
trigger1=time%5=0
attr = S, HA
animtype  = Hard
damage    = 0, 6
priority  = 5
guardflag = MA
pausetime = 1,1
sparkxy = 0,-65
hitsound   =S2,8
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 18
guard.ctrltime=18
ground.velocity = -0, 0
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -0,0
fall=1
yaccel=.42
fall.recovertime=cond(p2statetype=A,(var(0)*999)+25,999)
ground.cornerpush.veloff = 0
id=1250
[State 0, Explod]
type = Explod
triggerall = anim=1205
trigger1 = time%5=0
anim = 6520+random%4
ID = 12000
pos = 5,-cond(animelemtime(10)<0,45,cond(animelemtime(19)<0,70,95))
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, TargetState]
type = TargetState
triggerall=p2statetype!=L
triggerall = NumTarget(1250)&&p2stateno!=1201
trigger1 =movehit
value =1201
ID = 1250
ignorehitpause = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0&&anim=1205&&var(4);&& time<45
value = 1208
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0&&anim=1205;&& time<45
value = 1206+var(2)
persistent=0

[State 0, MoveHitReset]
type = MoveHitReset
triggerall = (anim=[1206,1207]) 
trigger1 = animelem=1
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=1206
trigger1 = animelem =1
value = S501,8
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=1207
trigger1 = animelem =1
value = S501,7
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=1208
trigger1 = animelem =1
value = S501,5
channel = 0
[State 1100, 1]
type = PlaySnd
trigger1 = anim=1206
trigger1 = animelem=3
trigger2 = anim=1207
trigger2 = animelem=2
trigger2 = anim=1208
trigger2 = animelem=2
value = S0, 2
[State 0, PosAdd]
type = PosAdd
triggerall = anim=1206
trigger1 = animelem=3
x = 10
[State 0, PosAdd]
type = PosAdd
triggerall = anim=1206
trigger1 = animelem=4
x = 8
[State 0, PosAdd]
type = PosAdd
triggerall = anim=1206
trigger1 = animelem=9
x = -18
 [State 1200, 2]
type = HitDef
triggerall = anim=1206
trigger1 = animelem=5
attr = S, SA
animtype  = Hard
damage    =floor( 82*fvar(2)), 6
priority  = 5
guardflag = MA
pausetime =12,12
sparkxy = 0,-65
hitsound   = S2,9
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 18
guard.ctrltime=18
getpower=ceil(helper(6000),fvar(15)*86)
givepower=0
ground.velocity = -6, -3
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -cond(var(4),10,6), -3
fall=1
yaccel=.42
fall.recovertime=999
envshake.ampl = 3
envshake.time = 12
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
id=cond(var(4),205,201)

;ignorehitpause = 
;persistent = 

  [State 1200, 2]
type = HitDef
triggerall = anim=1207
trigger1 = animelem=5
attr = S, SA
animtype  = Hard
damage    = floor( 101*fvar(2)), 6
priority  = 5
guardflag = MA
pausetime =18,18
sparkxy = 0,-65
hitsound   = S2,9
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 18
guard.ctrltime=18
getpower=ceil(helper(6000),fvar(15)*86)
givepower=0
ground.velocity = -1, -10
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -1, -10
fall=1
yaccel=.46
fall.recovertime=(var(0)*999)+25
envshake.ampl = 3
envshake.time = 12
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
id=200
[State 0, PosAdd]
type = PosAdd
triggerall = anim=1208
trigger1 = animelem=4
x = 9
[State 0, PosAdd]
type = PosAdd
triggerall = anim=1206
trigger1 = animelem=6
x = -9
[State 2501, 1]
type = HitDef
triggerall = anim=1208
trigger1 = animelem=4
attr = A, SA
damage = floor( 90*fvar(2)), 4
animtype = diagup
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 12, 12
sparkno =-1; 2
sparkxy = -10, -46
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 25
guard.ctrltime=25
ground.velocity = -2, -8
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -2,9
fall=1
yaccel=.46
fall.recovertime=(var(0)*999)+25
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.cornerpush.veloff=0
airguard.cornerpush.veloff=0
nochainid=200*!var(2)
id=206
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
triggerall = anim=[1206,1208]
trigger1 = movehit && enemy,gethitvar(hitshaketime)>0
anim = 6520+random%4
ID = 12000
pos = 5,-cond(anim=1207,85,cond(anim=1208,40,65))-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = anim=1208
trigger1 = animelemtime(4)>0 && movehit
anim = 10000
ID = 1201
pos = 160,120
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 99
supermovetime=99
scale = .5,.5
sprpriority = -8
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
persistent=0
[State 1200, 3]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = animelem=10 && anim=1206 &&var(4)
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Strong Kung Fu Blow
; CNS difficulty: easy
[Statedef 1201]
type    = A
movetype= H
physics = N
juggle=0;  = 4
poweradd= 5
velset = 0,0
ctrl = 0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 1203

[State 0, PosAdd]
type = PosAdd
trigger1 =enemy,anim=1205 || p2stateno=3501 &&enemy,animelemtime(99)<0
y = -.25
[State 0, SelfState]
type = SelfState
trigger1 =p2stateno!=[1200,1210]
trigger1=p2stateno!=3501
value =5050

;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle=0;  = 4
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0  &&AIlevel=0
v = 2    ;fv = 10
value =  (helper(10006), var(0)&258) > 0
[State 0, VarSet]
type = VarSet
trigger1 = time=0  &&AIlevel>0
v = 2    ;fv = 10
value = p2bodydist x >50
[State 0, RemapPal]
type = RemapPal
trigger1 =time=0&& !var(4)
source = 5,0
dest = 5,0

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superfx"
ID = 6211
stateno = 6211
pos =-1,-67
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superbg"
ID = 6201
stateno = 6201
pos =-1,-67
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
;[State 0, Explod]
;type = Explod
;trigger1 = time=0 && !var(4)
;anim = 13000
;ID = 12020
;pos = 160,120
;postype = back  ;p2,front,back,left,right
;facing = 1
;vfacing = 1
;bindtime = -1
;vel = 0,0
;accel = 0,0
;random = 0,0
;removetime = 51
;pausemovetime = 99
;supermovetime=99
;scale = .5,.5
;sprpriority = -8
;ontop = 0
;shadow = 0,0,0
;ownpal = 1
;removeongethit = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = S502,0
channel = 0
[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 25, -57
anim = -1;100
sound = S3000, 0
poweradd = -1000
movetime=30
time=30
p2defmul=1
unhittable=1

;ignorehitpause = 
;persistent = 

[State 3000, Super B]
type = AfterImage
trigger1 =time=0
time = 2

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0 &&animelemtime(11)<0
time = 2




[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=10,3 && anim=3000 && time <65 && var(4)
value = 3010
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=6&& anim=3010 && time >=65
value = 3000
elem=10
persistent=0
[State 3000, 2]
type = PosAdd
trigger1 = AnimElem = 2&&anim=3000
x = 20

[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 4&&anim=3000
trigger2 = AnimElem = 2&&anim=3010
x = -15


[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 9&&anim=3000
trigger2 = AnimElem = 5&&anim=3010
x = 12
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 11&&anim=3000
trigger2 = AnimElem = 1&&anim=3010
x = -12
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 5&&anim=3000
trigger2 = AnimElem = 4&&anim=3010
x = 15
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=7 && time <30&&anim=3000
value = anim
elem = 5
[State 0, Explod]
type = Explod
trigger1 = animelem  =9&&anim=3000
anim =3001
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem  =9&&anim=3000
anim =3002
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=9&&anim=3000
value = S502,1
channel = 0
[State 0, Helper]
type = Helper
trigger1 = animelem  =9&&anim=3000
trigger2 = animelem  =5&&anim=3010
helpertype = normal ;player
name ="Haoh-ken"
ID = 3001
stateno = 3001
pos =50,-79
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=.5
size.yscale=.5

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

;---------------------------------------------------------------------------
; Smash Kung Fu Upper (hyper)
; CNS difficulty: medium
; Description: This is very similar to KFM's Strong and Light Kung Fu Uppers.
;     There is just one HitDef, for a screen-shaking hit. The envshake
;     parameters are used to make this effect. You can find out more about
;     each parameter in the CNS documentation.
;     The fall.recovery parameter is set at 0, meaning that p2 cannot recovery
;     from the fall by entering his recoveryy command (for KFM, that is x+y).
;     This gives the attacking KFM a chance to follow up with another attack,
;     such as the Fast Kung Fu Palm.
;     Note that there is a ChangeState controller used to make KFM change to
;     a success state if he hits. The success state has KFM hold his arm
;     up longer for a dramatic effect.
[Statedef 3050]
type    = S
movetype= A
physics = S
juggle=0;  = 4
velset = 0,0
anim = 3050
ctrl = 0
sprpriority = 2
[State 0, RemapPal]
type = RemapPal
trigger1 =time=0
source = 5,0
dest = 5,0

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superbg"
ID = 6201
stateno = 6201
pos =-1,-67
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=24
trigger2 = animelem=14 && !movehit
id = 12020
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = S502,9
channel = 0

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superfx"
ID = 6211
stateno = 6211
pos =-1,-47
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 25, -57
anim = -1100
sound = S3000, 0
poweradd = -1000
movetime=2
time=30
p2defmul=1
unhittable=1

[State 3000, Super B]
type = AfterImage
trigger1 =time=0
time = 2

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0 &&animelemtime(29)<0
time = 2


[State 3050, Super D]
type = HitBy
trigger1 = AnimElem = 1
value = SCA,AP
time = 13

[State 3050, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = S0, 2
channel=1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=23
value = S502,7
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=23
value = S3001,2
channel = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit && animelemtime(11)<0
value =anim
elem = 11
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 =animelem=23 
x = 2.5
y = -11
[State 0, Explod]
type = Explod
trigger1 = animelem=23
anim = 7053
ID = 8302
pos = 0,2
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -.4,0
accel = 0,0
random = 0,0
scale = .5,.4
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=29 && pos y <0
value = anim
elem = 28
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(23)>=0&&animelemtime(29)<0 
y = .46
[State 0, PosSet]
type = PosSet
trigger1 = animelem=29
y = 0

[State 0, PosSet]
type = velSet
trigger1 = animelem=29
y = 0
x=0


[State 0, Explod]
type = Explod
trigger1 = animelem  =23
anim =3051
ID =1001
pos = -5,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 12
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem  =23
anim =3052
ID =1001
pos = -5,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =12
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 2501, 1]
type = HitDef
trigger1 = animelem=7
attr = S, HA
damage = floor( 32*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = 25, 25
sparkno =-1; 2
sparkxy = -10, -85
guard.sparkno=S6550
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  =25
guard.ctrltime=25
ground.velocity = -.58
airguard.velocity = -1.9,-.8
down.velocity=-2,-3
air.type = High
air.velocity = -.5,-5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
trigger1 = movehit; && animelem=7
anim = 6520+random%4
ID = 12000
pos = 5,-85-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(4)
trigger1 = animelemtime(21)=0
anim = 6520+random%4
ID = 12000
pos = 5,-85-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 2501, 1]
type = HitDef
triggerall = var(4)
trigger1 = animelem=21||animelem=22
attr = S, HA
damage = floor( 40*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = 25, 25
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 7
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  =25
guard.ctrltime=25
ground.velocity = -.58
airguard.velocity = -1.9,-.8
down.velocity=-2,-3
air.type = High
air.velocity = -.5,-5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 6
envshake.time = 12
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
snap=40
[State 0, Explod]
type = Explod
triggerall = var(4)
trigger1 = animelemtime(22)=1
anim = 6520+random%4
ID = 12000
pos = 5,-85-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 2501, 1]
type = HitDef
trigger1 = animelem=23
trigger2 = animelemtime(23)>0&&animelemtime(24)<0
trigger2 = time%2=0
attr = A, HA
damage = floor( 25*fvar(2)) , 4
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 1, 1
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = -1,-6
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,-6.5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
triggerall = p2statetype!=L
trigger1 = animelemtime(23)=0&&movehit && enemy,gethitvar(hitshaketime)>0 && !var(4)
trigger2 = animelemtime(23)>0&&animelemtime(24)<0
trigger2 = time%2=0&&movehit ;&& enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-85-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 2501, 1]
type = HitDef
trigger1= animelemtime(23)=13
attr = A, HA
damage = floor( 27*fvar(2)) , 4
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 4, 4
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = F3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = -2
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-6
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
trigger1 = animelemtime(23)=13&&movehit && enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-85-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 3050, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2= animelem=14 && !movehit
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
[Statedef 3100]
type    = S
movetype= A
physics = S
juggle=0;  = 4
velset = 0,0
anim = 3100
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, RemapPal]
type = RemapPal
trigger1 =time=0
source = 5,0
dest = 5,1

[State 0, VarSet]
type = Varadd
trigger1 = time=0
v = 59   ;fv = 10
value = -20000
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superbg"
ID = 6201
stateno = 6201
pos =-1,-56
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=25 
id = 12020
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=0
value = SCA
;value2 = S,NA
time =8
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superfx"
ID = 6211
stateno = 6211
pos =-1,-67
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 25, -57
anim = -1;100
sound = S3000,1
poweradd = 0
movetime=4
time=30
p2defmul=1
unhittable=1
[State 3000, Super B]
type = AfterImage
trigger1 =time=0
time = 2

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0 &&animelemtime(11)<0
time = 2

[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 20
x = 20
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 21
x = 15
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 23
x = 15
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 25
x = 19
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 26
x = 14
[State 3000, 3]
type = PosAdd
trigger1 = AnimElem = 27
x = 11

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=5
value = S502,2
channel = 0
[State 2501, 1]
type = HitDef
trigger1 = animelem=7
attr = S, HA
damage = floor( 62*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 25, 25
sparkno =-1; 2
sparkxy = -10, -76
guard.sparkno=S6550
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = -2
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
snap=45
[State 0, Explod]
type = Explod
trigger1 = animelemtime(7)=0&&movehit ;&& enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-76-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
supermovetime=99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=11
value = S501,5
channel = 0
[State 2501, 1]
type = HitDef
trigger1 = animelem=16
attr = S, HA
damage = floor( 62*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 25, 25
sparkno =-1; 2
sparkxy = -10, -65
guard.sparkno=S6550
hitsound = S2, 5
guardsound = S3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = -2
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
trigger1 = animelemtime(16)=0&&movehit && p2statetype!=A ;&& enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-65-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=20
value = S501,7
channel = 0
[State 2501, 1]
type = HitDef
trigger1 = animelem=23
attr = S, HA
damage = floor( 62*fvar(2)) , 8
animtype = diagup
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 25, 25
sparkno =-1; 2
sparkxy = -10, -60
guard.sparkno=S6550
hitsound = S2, 7
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = -6,-5
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -6,-5
fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=201
fall.xvelocity = 0
fall.yvelocity = -3.2
[State 0, Explod]
type = Explod
trigger1 = animelemtime(23)=0&&movehit&& p2statetype!=A ;&& enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-60-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Triple Kung Fu Palm (hyper)
[Statedef 3500]
type    = S
movetype= A
physics = S
juggle=0;  = 4
velset = 0,0
anim = 3500
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time=0 
v = 2    ;fv = 10
value = 0
[State 0, RemapPal]
type = RemapPal
trigger1 =time=0
source = 5,0
dest = 5,2

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superbg"
ID = 6201
stateno = 6201
pos =-1,-48
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=9&&anim=3500
id = 12020
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=11
value = S502,4+(random%2)
channel = 0

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superfx"
ID = 6211
stateno = 6211
pos =-1,-67
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99
[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 25, -57
anim = -1;100
sound = S3000,2
poweradd = -3000
movetime=30
time=30
p2defmul=1
unhittable=1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=0
value = SCA
;value2 = S,NA
time = 42
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time<25&& animelem=7
value = anim
elem =5


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

[State 3000, Super B]
type = AfterImage
trigger1 =time=0
time = 2

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0 &&animelemtime(11)<0
time = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
statetype = A       ;S,A,C,L
physics =N

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

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(8)>=0&&animelemtime(9)<0
y = .25
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=9
statetype = S      ;S,A,C,L
movetype=I
physics =S
[State 0, VelSet]
type = VelSet
trigger1 =  animelem=9
x = 0
y = 0


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

[State 2501, 1]
type = HitDef
trigger1 = animelem=8 && anim=3500
attr = S, HA
damage = 0, 12
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime =1,1
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=2001
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0

[State 0, TargetState]
type = TargetState
triggerall = NumTarget(2001)
trigger1 =movehit=1
value =3502
ID = 2001
;ignorehitpause = 
;persistent = 


;======hit
[State 0, ChangeAnim]
type = Changestate
trigger1 = movehit=1
value = anim+1



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

[Statedef 3501]
type = S
movetype=A
physics =N
anim=3501
[State 0, AllPalFX]
type = AllPalFX
trigger1 = time=0
time = 2
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=120&&anim=3501
id = 12020

[State 0, PosSet]
type = PosSet
trigger1 = animelem=1
y = 0
[State 0, PosSet]
type = velSet
trigger1 = animelem=1
y = 0
x=0
[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name ="superbg"
ID = 6201
stateno = 6201
pos =-1,-48
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=1
pausemovetime=99
supermovetime=99


[State 2501, 1]
type = HitDef
trigger1 = animelem=2&& anim=3501
attr = S, HA
damage = floor( 32*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
down.velocity=-2,-3
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelemtime(2)=0&&movehit ;&& enemy,gethitvar(hitshaketime)>0 
trigger2 = animelem=5&& anim=3501
trigger3 = animelem=32&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-70-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 2501, 1]
type = HitDef
trigger1 = animelem=5&& anim=3501
trigger2 = animelem=32&& anim=3501
attr = S, HA
damage = floor( 16*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0

[State 2501, 1]
type = HitDef
trigger1 = animelem=11&& anim=3501
attr = S, HA
damage = floor( 22*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -20
hitsound = S2, 5
guardsound = S3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=11&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-25-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 2501, 1]
type = HitDef
trigger1 = animelem=17&& anim=3501
trigger2 = animelem=50&& anim=3501
attr = S, HA
damage = floor( 32*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=17&& anim=3501
trigger2 = animelem=50&& anim=3501 ;&& enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-75-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 2501, 1]
type = HitDef
trigger1 = animelem=23&& anim=3501
attr = S, HA
damage = floor(28*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -65
hitsound = S2, 5
guardsound = S3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=23&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-70-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 2501, 1]
type = HitDef
trigger1 = animelem=28&& anim=3501
trigger2 = animelem=56&& anim=3501
attr = S, HA
damage = floor(18*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -60
hitsound = S2, 5
guardsound = S3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=28&& anim=3501
trigger2 = animelem=56&& anim=3501 ;&& enemy,gethitvar(hitshaketime)>0 
anim = 6520+random%4
ID = 12000
pos = 5,-55-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 2501, 1]
type = HitDef
trigger1 = animelem=35&& anim=3501
attr = S, HA
damage = floor( 25*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -55
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=35&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-65-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 2501, 1]
type = HitDef
trigger1 = animelem=42&& anim=3501
attr = S, HA
damage = floor( 42*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=42&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-85-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 2501, 1]
type = HitDef
trigger1 = animelem=63&& anim=3501
attr = S, HA
damage = floor( 40*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2, 2
sparkno =-1; 2
sparkxy = -10, -60
hitsound = S2, 5
guardsound = S3, 0
ground.type = low
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-5
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
forcenofall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=63&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-60-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=67
x = 26


[State 1200, 2]
type = HitDef
triggerall = animelemtime(73)>=0&&animelemtime(99)<0
trigger1=time%5=0
attr = S, HA
animtype  = Hard
damage    = 0, 6
priority  = 5
guardflag = MA
pausetime = 1,1
sparkxy = 0,-65
hitsound   =S2,8
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 18
guard.ctrltime=18
ground.velocity = -1, -8
airguard.velocity = -1.9,-4
air.type = High
air.velocity = -1,-8
fall=1
yaccel=.42
envshake.ampl = 3
envshake.time = 10
fall.recovertime=cond(p2statetype=A,(var(0)*999)+25,999)
ground.cornerpush.veloff = 0
id=1200
[State 0, Explod]
type = Explod
triggerall = animelemtime(73)>=0&&animelemtime(99)<0
trigger1 = time%5=0
anim = 6520+random%4
ID = 12000
pos = 5,-cond(animelemtime(80)<0,45,cond(animelemtime(99)<0,70,95))
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, TargetState]
type = TargetState
triggerall = NumTarget(1200)&&p2stateno!=1201
trigger1 =movehit
value =1201
ID = 1200
ignorehitpause = 1

[State 2501, 1]
type = HitDef
trigger1 = animelem=104&& anim=3501
attr = S, HA
damage = floor( 50*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8,8
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -2,-13.5
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 10
ground.cornerpush.veloff = 0
id=200
fall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=0
[State 0, Explod]
type = Explod
trigger1 = animelem=104&& anim=3501
anim = 6520+random%4
ID = 12000
pos = 5,-80-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=107
x = 17
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=111
x = -15
[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(112)>=0&&animelemtime(114)<0 ;&& frontedgebodydist <50
x = -3.5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=115
x = 15
[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 112
value = S199, 1
channel=3
[State 0, Explod]
type = Explod
trigger1 = animelem  =112
anim =3510
ID =1001
pos = 32,-56
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem  =112
anim =3511
ID =1001
pos = 32,-56
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=112
value = S3001,0
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=110
value = S502,8
channel = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animelem=114 && time <255
value = anim
elem = 112

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=116
value = S3001,1
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=116
value = S502,6
channel = 0
[State 0, Explod]
type = Explod
trigger1 = animelem  =116
anim =3515
ID =1001
pos =52,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime=-1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem  =116
anim =3515
ID =1001
pos = 52,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
removetime=-1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelemtime(117)=60
id = 1001
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 =  animelemtime(117)=60
anim =3520
ID =1001
pos =52,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1

vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =  animelemtime(117)=60
anim =3521
ID =1001
pos = 52,-68
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =-1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 2501, 1]
type = HitDef
trigger1 = animelem=117&& anim=3501
trigger2 = animelemtime(117)>=2&&animelemtime(117)<60
trigger2= time%2=0
attr = S, HA
damage = floor( 15*fvar(2)) , 8
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 2,4
sparkno =-1; 2
sparkxy = -10, -76
hitsound = S2, 5
guardsound = S3, 0
ground.type = High
getpower=0
givepower=0
ground.slidetime = 5
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = 0
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -7,4
air.fall=1
yaccel=.46
fall.recover=0
envshake.ampl = 3
envshake.time = 4
ground.cornerpush.veloff = 0
id=201
fall=1
fall.xvelocity = 0
fall.yvelocity = -3.2
kill=animelemtime(117)>56
[State 0, Explod]
type = Explod
trigger1 = animelem=117&& anim=3501
trigger2 = animelemtime(117)>=2&&animelemtime(117)<60
trigger2= time%2=0
anim = 6520+random%4
ID = 12000
pos = 5,-60-ceil(p2bodydist y)
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 99
scale =.5,.5
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=119
value = S502,3
channel = 0
[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 3502]
type = S
movetype=H
physics =N
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0
value =5002


[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
[State 3000, 7]
type = selfState
trigger1 = Time = 40
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;hard knock down.
[Statedef 20005]
type    = A
movetype= H
physics = N
[State 0, Turn]
type = Turn
trigger1 = facing=enemy,facing
;ignorehitpause =
;persistent =

[State 820, 1]
type = ChangeAnim2
Trigger1 = hitshakeover
value = 6100
persistent=0

[State 5030, 2]
type = VelSet
trigger1 = hitshakeover
x = gethitvar(xvel)*facing
y = gethitvar(yvel)
persistent=0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=3100 
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 


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

[State 5100, 8]
type = Explod
trigger1 = pos y >=10&& (time >5)
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=10&& (time >5)
value =20006
;---------------------------------------------------------------------------

[Statedef 20006]
type    = L
movetype= H
physics = N
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = F7,2
channel = 2
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 6014

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

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

;[State 0, ChangeAnim]
;type = ChangeAnim
;triggerall = selfanimexist(5111)
;trigger1 = animtime=0 && anim=6014
;value =5101
[State 0, ChangeAnim]
type = ChangeAnim
;triggerall = !selfanimexist(5111)
trigger1 = animtime=0 && anim=6014
value =5100
;
;[State 0, ChangeAnim]
;type = ChangeAnim
;triggerall = selfanimexist(5111)
;trigger1 = animtime=0 && anim=5101
;value =5111
[State 0, ChangeAnim]
type = ChangeAnim
;triggerall = !selfanimexist(5111)
trigger1 = animtime=0 && anim=6014
value =5110



[State 0, ChangeState]
type = selfState
trigger1 = time>47 && p2stateno!=3100
value = ifelse(!alive, 5110,5120)
;------------------
; Wall bounce
[Statedef  20040]
type    = A
movetype= H
physics = N
velset = 0,0
[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 = selfanimexist(5030)
value = 5030

[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 = selfanimexist(5051)
value = 5051


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

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

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

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

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1
;[State 0, PosAdd]
;type = PosAdd
;trigger1 = time=0 && prevstateno=821
;y = -const(size.mid.pos.y)

[State 1026, Hit wall]
type = ChangeState
;triggerall = Pos y < -5
trigger1 = BackEdgeBodyDist <= 0
trigger2 = FrontEdgeBodyDist <= 0
value = 20042


;------------------
; (a custom gethit state)
[Statedef 20042]
type    = A
movetype= H
physics = N
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = F7,0
channel = 2
;
;[State 0, EnvShake]
;type = EnvShake
;trigger1 =time=0 
;time = 5
;freq = 60
;ampl = -4
;phase = 90
;ignorehitpause = 
;persistent = 

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

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

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

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

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

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

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

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






;[State 1028, Vel X]
;type = VelSet
;trigger1 = Time = 0
;x = ((p2dist x)/12)*((anim=5052)*-1)

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


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

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


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

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = time=0
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 =time=0
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062
;[State 1028, Turn]
;type = Turn
;triggerall = anim!=5052
;trigger1 = (Time = 0) && (BackEdgeDist < 30)
[State 0, VelSet]
type = VelSet
triggerall = alive &&pos y<-40&& !enemy,var(55)
triggerall= command="recovery" || name="Training"&&var(16)
trigger1 = HitOver && (time>gethitvar(hittime)) &&canrecover
x = ifelse(sysvar(1)=0,0,ifelse(sysvar(1)=1,3.5,-3.5))
y = -4

;ignorehitpause = 
;persistent = 

[State 5030, 3]
type = selfState
triggerall = pos y<-40 && !enemy,var(55)
triggerall= command="recovery"|| name="Training"&&var(16)
trigger1 = HitOver && (time>gethitvar(hittime)) &&canrecover
value = 5210;HITA_RECOV
;ignorehitpause = 
;persistent = 

[State 5030, 4]
type = changeState
trigger1= Pos Y >= 20&& vel y >0 ;.
value = cond(enemy,var(55)=2,5100,51000) 

;---------------------------------------------------------------------------
; longFollow
[Statedef 40000]
type    = S
physics = S
;anim = 40
ctrl = 0
sprpriority = 1

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =40
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value =S40,2



[State 1220, Afterimage]
type = AfterImage
trigger1 = animelem = 1
length = 13
PalBright   =  30, 30, 30
PalContrast =  70, 70, 70
PalAdd      = -10,-10,-10
PalMul      = .55,.55,.55
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 11



[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
;value2 = S,NA
time = 1



[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x =const(velocity.runjump.fwd.x)
y = -10







[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50000
ctrl = 1

;---------------------------------------------------------------------------
;LauncherFollowUp
[Statedef 50000]
type    = A
physics = A
anim=50
[State 0, MakeDust]
type = MakeDust
trigger1 = time = 1
trigger2 = time = 4
trigger3 = time = 7
pos = 0,5
;pos2 =
spacing = 1
;ignorehitpause =
;persistent =

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0



[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3
;---------------------------------------------------------------------------

[Statedef 51000]
type    = L
movetype= H
physics = N
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = F7,0
channel = 2
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0
trigger1= selfanimexist(5101) && (anim=5052 ||anim=5062 || anim=350)
value = 5101
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0
trigger1= !selfanimexist(5101) || anim!=5062 &&anim!=5101
value = 5100

[State 5100, 8]
type = Explod
trigger1 = Time = 0
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 1 && anim=5101
trigger1= selfanimexist(5161)
value = 5161
[State 820, 1]
type = ChangeAnim
Trigger1 = Time =1 && anim!=5161
value = 5160

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

[State 0, VelSet]
type = VelSet
trigger1 =time=3
y = -5.2
x =vel x*.4
[State 0, VelAdd]
type = VelAdd
trigger1 = time>=3
y = .6


[State 0, PosAdd]
type = PosAdd
trigger1 = vel y >0 && time >3 && pos y >-10
y = 20

[State 820, 1]
type = ChangeAnim
triggerall = selfanimexist(5062) && anim=5161
Trigger1 = vel y >0 && time >3 && pos y >-10
value = 5062
[State 0, ChangeState]
type = selfState
trigger1 = vel y >0 && time >3 && pos y >-10
value = 5100
;---------------------------------------------------------------------------

[Statedef 51001]
type    = A
movetype= H
physics = N
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = F7,0
channel = 2
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0
trigger1= selfanimexist(5101) && (anim=5052 ||anim=5062 || anim=350)
value = 5101
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0
trigger1= !selfanimexist(5101) || anim!=5062 &&anim!=5101
value = 5100

[State 5100, 8]
type = Explod
trigger1 = Time = 0
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)

[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 1 && anim=5101
trigger1= selfanimexist(5161)
value = 5161
[State 820, 1]
type = ChangeAnim
Trigger1 = Time =1 && anim!=5101 && anim!=5161
value = 5160
[State 0, VelSet]
type = VelSet
trigger1 =time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 =time=0
y = 0

[State 0, VelSet]
type = VelSet
trigger1 =time=3
y = -8.2
x =vel x*.4
[State 0, VelAdd]
type = VelAdd
trigger1 = time>=3
y = .6

[State 40, 2]
type = VarSet
trigger1=time=0
sysvar(1) = 0
[State 40, 2]
type = VarSet
triggerall = AIlevel =0
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State 40, 2]
type = VarSet
triggerall = AIlevel >0
trigger1 = random > 450
trigger1= backedgebodydist <35
sysvar(1) = 1
[State 40, 2]
type = VarSet
triggerall = AIlevel >0
trigger1 = random > 450
trigger1= backedgebodydist >75
sysvar(1) = -1
[State 40, 2]
type = VarSet
triggerall = AIlevel =0
trigger1 = command = "holdback"
sysvar(1) = -1
[State 0, VelSet]
type = VelSet
triggerall = alive&& !enemy,var(55) &&(!enemy,var(4)||enemy,numexplod(1051)>1||enemy,numexplod(1101)>1||enemy,numexplod(1201)>1)
triggerall= command="recovery" || name="Training"&&var(16)||AIlevel >0 && random < (750*(AILevel**2/64.0)) 
trigger1 = HitOver && (time>5) ;&&canrecover
x = ifelse(sysvar(1)=0,0,ifelse(sysvar(1)=1,3.5,-3.5))
y = -4

;ignorehitpause = 
;persistent = 

[State 5030, 3]
type = selfState
triggerall = alive &&!enemy,var(55)&&(!enemy,var(4)||enemy,numexplod(1051)>1||enemy,numexplod(1101)>1||enemy,numexplod(1201)>1)
triggerall= (vel x =0 || vel x =3.5 || vel x =-3.5)&&vel y=-4 
trigger1 = HitOver && (time>5) ;&&canrecover
value = 5210;HITA_RECOV


[State 0, PosAdd]
type = PosAdd
trigger1 = vel y >0 && time >3 && pos y >-10
y = 20
[State 820, 1]
type = ChangeAnim
triggerall = selfanimexist(5062)&& anim=5161
Trigger1 = vel y >0 && time >3 && pos y >-10
value = 5062

[State 0, ChangeState]
type = selfState
trigger1 = vel y >0 && time >3 && pos y >-10
value = 5100
;---------------------------------------------------------------------------

[Statedef 52000]
type    = S
movetype= I
physics = N
anim=310
velset=0,0
[State 0, Turn]
type = Turn
triggerall = time=0
trigger1 = helper(10006), command="holdback"&&AIlevel=0
trigger2 = AIlevel > 0 && (frontedgebodydist <120|| p2bodydist x <100)
;ignorehitpause = 
;persistent = 

[State 0, PalFXWiz]
type = PalFX
trigger1 = time=0
time = 10
add = 256,256,256
mul = 256,256,256
sinadd = -256,-256,-256,30
invertall = 0
color = 0
ignorehitpause=1
persistent=0

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem = 1
time =20
length =10
palcolor = 256
palinvertall = 0
PalBright = 1,1,50
PalContrast = 1, 50, 150
PalAdd = 0,0,0
PalMul = .5,.5,.5
timegap = 1
framegap = 3
;trans = add1 ;"none","add1","sub"
;ignorehitpause =
;persistent =

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

;[State 0, PosAdd]
;type = PosAdd
;trigger1 = animelem = 7
;x = 10
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(3)<5
x = 4.5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(3)>=5 && animelemtime(4)<0
x = 1.5


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

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S700,0
channel = 2
[State -3, Hit0]
type = PlaySnd
trigger1 =Time = 0
value = S5120, random%3
channel=0
[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

[Statedef 4000]
type    = S
movetype= I
physics = N
anim=0
velset=0,0
poweradd=-1000
ctrl=0
[State 0, VarAdd]
type = VarAdd
trigger1 = time=0
v = 59    ;fv = 
value = -10000
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S502,8
channel = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=9
value =4000
elem = 1

[State 0, Pause]
type = Pause
trigger1 = 1
time = 3
movetime = 3
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
;value2 = S,NA
time = 6
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 =time=0
helpertype = normal ;player
name = "install gauge"
ID =  6100
stateno = 6101
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=99
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 =time=9
anim =4001
ID =1001
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority =-1
pausemovetime=99
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

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

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && (projhit1000=1|| movehit=1) && (p2stateno!=51000&&p2stateno!=[202,204])
value =202
ID =200
ignorehitpause =1 
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && (projhit1000=1|| movehit=1) && (p2stateno!=51001&&p2stateno!=[202,204])
value =202
ID =206
ignorehitpause =1 
 [State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A &&(projhit1000=1|| movehit=1)  && (p2stateno!=51000&&p2stateno!=[20005,20006])
value =20005
ID =201
ignorehitpause =0
 [State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A &&(projhit1000=1|| movehit=1)  && (p2stateno!=51000&&p2stateno!=[20005,20006])
value =20040
ID =205
ignorehitpause =0
[State -2, AirPushbox]
type = PlayerPush
triggerall = StateType = A
triggerall = (StateNo != [1000,3999])
triggerall = movetype != H
trigger1 = P2BodyDist Y + (24 * Const(size.xscale)) > Enemy, Const(Size.Height)
value = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,ctrl||p2movetype!=H || p2stateno=[120,155]
id = 1050
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,ctrl||p2movetype!=H || p2stateno=[120,155]
id = 1051
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,ctrl||p2movetype!=H || p2stateno=[120,155]
id = 1050

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,ctrl||p2movetype!=H || p2stateno=[120,155]
id = 1101
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,ctrl||p2movetype!=H || p2stateno=[120,155]
id = 1201
[State -1, Stand Light Punch]
type = selfState
value = 5211
triggerall = !IsHelper(10006) ;Always add this as well!
triggerall = numhelper(10006)
triggerall = roundstate=2
triggerall = AIlevel=0
triggerall = stateno!=[5000,5199]
triggerall = stateno!=[120,155]
triggerall = stateno!=[5200,5399]
triggerall =pos y <-20 && numhelper(6000)
triggerall = (helper(10006), var(0)&516) > 0 && var(59)>=10000
trigger1 = statetype=A &&hitshakeover&&helper(6000),var(40)=2
;---------------------------------------------------------------------------
;Stand Light Punch
[State -1, Stand Light Punch]
type = selfState
value = 5211
triggerall = !IsHelper(10006) ;Always add this as well!
triggerall = numhelper(10006)
triggerall = roundstate = 2
triggerall = stateno!=[120,155]
triggerall = stateno!=[5000,5199]
triggerall =pos y <-20&& alive
triggerall = stateno!=[5210,5211]
triggerall =  var(59)>=10000 && numhelper(6000)
triggerall = random <=(cond(life<lifemax*.4,299,75) * (AIlevel ** 2 / 64.0))
trigger1 = statetype=A &&hitshakeover&&helper(6000),var(40)=2 
trigger1 = gethitvar(hittime)%4=0


[State -1, Stand Light Punch]
type = ChangeState
value = 5211
triggerall = !IsHelper(10006) ;Always add this as well!
triggerall = numhelper(10006)
triggerall = roundstate=2
triggerall = AIlevel=0
triggerall = stateno=[5000,5199]
triggerall = stateno!=[120,155]
triggerall = stateno!=[5200,5399]
triggerall =pos y <-20 && numhelper(6000)
triggerall = (helper(10006), var(0)&516) > 0  && var(59)>=10000
trigger1 = statetype=A &&hitshakeover&&helper(6000),var(40)=2
;---------------------------------------------------------------------------
;Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 5211
triggerall = !IsHelper(10006) ;Always add this as well!
triggerall = numhelper(10006)
triggerall = roundstate = 2
triggerall = stateno!=[120,155]
triggerall = stateno=[5000,5199]
triggerall =pos y <-20&& alive
triggerall = stateno!=[5210,5211]
triggerall =  var(59)>=10000 && numhelper(6000)
triggerall = random <=(cond(life<lifemax*.4,299,75) * (AIlevel ** 2 / 64.0))
trigger1 = statetype=A &&hitshakeover&&helper(6000),var(40)=2 
trigger1 = gethitvar(hittime)%4=0



;
[state -2] ;Target friction cancel -Inktrebuchet
type = targetveladd
trigger1 = numtarget
trigger1 = enemy(0),movetype = H
trigger1 = enemy(0),statetype = S || enemy(0),statetype = C
trigger1 = enemy(0),vel x != 0
x = (enemy(0),vel x / cond(enemy(0),statetype = S, enemy(0),const(movement.stand.friction), enemy(0),const(movement.crouch.friction))) - enemy(0),vel x

[state -2] ;Target friction cancel -Inktrebuchet
type = targetveladd
triggerall = numenemy>1
trigger1 = numtarget
trigger1 = enemy(1),movetype = H
trigger1 = enemy(1),statetype = S || enemy(1),statetype = C
trigger1 = enemy(1),vel x != 0
x = (enemy(1),vel x / cond(enemy(1),statetype = S, enemy(1),const(movement.stand.friction), enemy(1),const(movement.crouch.friction))) - enemy(1),vel x

;;================================================================================
 ;;------- CAP Cornerpush System by Inktrebuchet --------
;;===============================================================================
[state slidetime]
type = null
triggerall = numtarget
trigger1 = target,gethitvar(hitshaketime)=1
trigger1 = fvar(6) := target,gethitvar(slidetime)
trigger1 = fvar(7):=target,gethitvar(xvel)
ignorehitpause = 1
; 


[State -2, Push]
type = PosAdd
triggerall = roundstate = 2
;triggerall = !var(43)
triggerall = stateno!=[3000,3999]
triggerall = numtarget >= 1
triggerall = target,statetype=S || target,statetype=C
triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
trigger1 = Statetype != A ; No Aerial attacks have cornerpush
trigger1 = HitPauseTime = 0
trigger1 = target,Hitshakeover
x = cond(fvar(6)>0 ,(fvar(7)*-facing),0 * (fvar(6) := 0))
[state slide timer]
type = null
triggerall = numtarget
trigger1 = HitPauseTime = 0
trigger1 = target,Hitshakeover
trigger1 = fvar(6) > 0
trigger1 = fvar(6) := fvar(6) - 1

[State -2, Drop]
type = VarSet
triggerall=stateno!=[3000,3999]
triggerall = fvar(6)
trigger1 = !numtarget
trigger2 = numhelper(1001)
trigger2 = helper(1001), numtarget
trigger3 = hitpausetime >1
fvar(6) = 0
ignorehitpause =1

[State -2, TargetDrop]
type = TargetDrop
triggerall=stateno!=[3050,3999]
trigger1 = numhelper(1001)
trigger1 = helper(1001), numtarget
trigger2 = numhelper(3001)
trigger2 = helper(3001), numtarget

;[State -2, Superpause Check]
;type = VarAdd
;triggerall=stateno!=[3000,3999]
;trigger1 = Var(43)
;var(43) = -1
;
;[State -2, Reset Time counter]
;type = VarSet
;triggerall=stateno!=[3000,3999]
;trigger1 = movecontact = 1
;var(44) = 0
;
;[State -2, Accel]
;type = VarSet
;triggerall=stateno!=[3000,3999]
;triggerall = roundstate = 2
;triggerall = var(43) <= 0
;triggerall = numtarget >= 1
;trigger1 = target, hitshakeover
;fvar(6) = (target, gethitvar(xvel)*exp((-0.1886)*((var(44)))))
;
;[State -2, Push]
;type = PosAdd
;triggerall = roundstate = 2
;triggerall = !var(43)
;triggerall = stateno!=[3000,3999]
;triggerall = numtarget >= 1
;triggerall = (target, BackEdgeBodyDist <= 0) || (target, FrontEdgeBodyDist <= 0)
;triggerall = stateno != [900,949]
;triggerall = stateno != [956,979]
;;triggerall = target,statetype != A
;triggerall = target,statetype != L
;trigger1 = Statetype != A
;x = ifelse(facing = -1,fvar(6),-fvar(6))
;
;[State -2, Increase]
;type = VarSet
;triggerall=stateno!=[3000,3999]
;triggerall = numtarget >= 1
;triggerall = target, hitshakeover
;trigger1 = var(43) <= 0
;trigger1 = var(44)
;var(44) = var(44)+1
;
;[State -2, Time counter]
;type = VarSet
;triggerall=stateno!=[3000,3999]
;trigger1 = !var(44)
;trigger1 = fvar(6)
;var(44) = 1
;
;[State -2, Freeze Pos During Superpause]
;type = PosFreeze
;;triggerall=stateno!=3000
;trigger1 =var(43)
;value = 1
;


[State 0, Explod]
type = Explod
trigger1=p2stateno=20006 && enemy,time=1 && p2movetype=H
anim = 7053
ID = 8302
pos = 0,5
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State -2, Tiny Buffering Helper]
type = Helper
trigger1 = !NumHelper(10006)
name = "Tiny Buffer(head.pos)"
StateNo = 9997
ID = 10006
;pos = 0,0
posType = p1
facing = 1
keyctrl = 1
ownpal = 1
supermoveTime = 65535
pausemoveTime = 65535



[State -2, Debug Info];Attack strength, # of hits, juggle=0; count, projectile flag
type = DisplayToClipboard
trigger1 = 1
text = "Attack = %f Hits = %d 5 = %d juggle = %d Tiger?! = %f"
params= fvar(7),( (helper(10006), Var(59)) ), (helper(10006), Var(59)&(2**12)),((helper(10006), var(0))),fvar(6)
ignoreHitPause = 1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]
[State 0, CtrlSet]
type = CtrlSet
trigger1 = stateno=105
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=100 && time=0 
trigger1= stateno=[200,3500]
trigger1=time=1
x = 0
y = 0


[State 0, VarSet];training mode
type = VarSet
trigger1 = roundsexisted = 0 && roundstate < 2 && roundno=1
trigger1 = !AILevel && (enemy, AILevel = 0) && power =  powermax && (enemy, power = enemy,powermax)
v = 58
value = 1
;[State 0, VarSet]
;type = VarSet
;trigger1 = var(58)=0
;v = 58    ;fv = 10
;value = 1000
;
;[State 0, VarSet]
;type = VarSet
;trigger1 = var(58)=0
;v = 57    ;fv = 10
;value = enemy,lifemax
[State 0, VarSet]
type = VarSet
trigger1 = stateno!=[200,440]
v = 36    ;fv = 10
value = 0


;persistent = 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(55)=2
trigger1=p2stateno!=[5120,5299]
movetype = I        ;I,A,H


[State 0, VarSet]
type = VarSet
trigger1 = stateno!=[200,440]
trigger1= movetype=I
v = 36    ;fv = 10
value =0

[State 0, Helper]
type = Helper
trigger1 =numhelper(10000)=0
helpertype = normal ;player
name = "gauges"
ID =  10000
stateno = 10000
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=99999
supermovetime=99999
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 =numhelper(6000)=0
helpertype = normal ;player
name = "gauges"
ID =  6000
stateno = 6000
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=99999
supermovetime=99999
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 =numhelper(6200)=0
helpertype = normal ;player
name = "UItext"
ID =  6200
stateno = 6200
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime=99999
supermovetime=99999
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1

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

[State 0, Helper]
type = Helper
trigger1 =numhelper(10002)=0
helpertype = normal
name = "spAIder"
ID =  10002
stateno = 9998
pos = 61,-37
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1
size.yscale =1



;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
