; KFM's constants and state file.
; There are comments scattered through this file, so you may like to
; take a look if would like to learn more about the cns.

; これはKFMの定数と状態のファイルです。
; このファイルの中には注釈が散らされているので、CNSを習いたいお方は
; 読んでみたらいいです。
;var(40)= falcon punch counter during fatal
;numexplod(1010)= raptor boost counter during fatal
;numexplod(1050)= falcon kick counter during fatal
;
;---------------------- Integer variable list ----------------------

; var(0):= -3
; var(1):= 1001, 1002, 1003
; var(2):= 1010
; var(3):= -3
; var(4):= 200, 205, 210, 400, 405, 410, 600, 605, 610, 831, 1010, 1050, 3050, 3051, -3, 4, 5
; var(5):= 800, 830
; var(6):= 4000
; var(7):= 3061
; var(8):= 3061
; var(9):= -2
;var(10):= 4000
;var(11):= 4000
;var(12):= 1000, 1005, -2
;var(13):= 1010
;var(14):= 600, 108
;var(19):= 810, 831, 1000, 1005, 1050, -2
;var(20):= 800, 810, 830, 831
;var(21):= 200, 205, 210, 400, 405, 410, 600, 605, 610, 831, 1000, 1005, 1004, 1010, 1050, 3000, -2
;var(23):= -2
;var(24):= -2
;var(30):= -2
;var(31):= -2, -1
;var(32):= -2
;var(33):= -2
;var(40):= -2
;var(58):= 1010

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

; fvar(2):= 3051, -3
; fvar(3):= 3061, 4000









;
;
;
;
;
;
;
[Data]
life = 1000
attack = 100
power=1000
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 0
IntPersistIndex = 58
FloatPersistIndex = 40

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

[Velocity]
walk.fwd  = 2.4      ;Walk forward
walk.back = -2.2     ;Walk backward
run.fwd  = 5.5, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.8   ;Neutral jumping velocity (x, y)
jump.back = -2.55    ;Jump back Speed (x, y)
jump.fwd = 2.5       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.
air.gethit.groundrecover = -.15,-3.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5
[Movement]
airjump.num = 0     ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .5        ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching
air.gethit.groundlevel = 15          ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -20 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 10   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -1  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = .35    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 10      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 20            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = .4               ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 12          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .05

[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "This game's winner is, Captain Falcon!"
victory2 = "YES!"

;---------------------------------------------------------------------------
; 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
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=3
value = 200,18
channel=0
[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 171]
type = S
physics=S
ctrl = 0
anim = 171

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

[State 200, 1]
type = PlaySnd
trigger1 = time = 6
value = 11, 2

[State 0, StopSnd]
type = StopSnd
trigger1 = time=[0,5]
channel = -1


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


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

[State 0, ChangeState]
type = ChangeState
trigger1 =animtime = 0
value =5110
;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
triggerall=var(8)!=1
trigger1 = random<499
value = 181
[State 180, 1]
type = ChangeState
triggerall=var(8)!=1
trigger1 = random>=499
value = 182
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(8)=1
flag = nobg
flag2=nobardisplay
flag3=nofg
ignorehitpause=1
persistent=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = prevstateno=183
flag = invisible

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=3
value = 200, 26
channel=0
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=3
value = 200, 21
channel=0
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 183]
type = S
ctrl = 0
anim = 5150
velset = 0,0

[State 4003, win]
type=changestate
trigger1= time >= 90 ;&& prevstateno!=180
value=180
ctrl = 1


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


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(8)=1
flag = nobg
flag2=nobardisplay
flag3=nofg
ignorehitpause=1
persistent=1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 191]
type = A
physics=N
ctrl = 0
anim = 190
velset = 0,0

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


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=11
value = 42

[State 0, AngleDraw]
type = AngleDraw
trigger1 =time<20
scale = .25,.25
[State 0, Helper]
type = Helper
trigger1 = time=3
helpertype = normal ;player
name = "Blue Falcon"
ID =192
stateno =192
pos = -150,-60
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0


[State 0, VelSet]
type = VelSet
trigger1 =time=11
y = -25

[State 0, VelMul]
type = Veladd
trigger1 = anim=42
y = .57

[State 0, VelSet]
type = VelSet
trigger1 =anim=43
y = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 1
movecamera = 1,0
[State 0, PosSet]
type = PosSet
trigger1 = pos y>-10 && anim=43
y = 0
[State 0, PosAdd]
type = PosAdd
trigger1 =time=5
y = -30


[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=43
trigger1 =pos y>0 && anim=42 && time >12
value = 43
[State 200, 1]
type = PlaySnd
triggerall =anim=43
trigger1 = animelemtime(2)= 0
value = 300, 2
[State 200, 1]
type = PlaySnd
triggerall =anim=43
trigger1 = animelem= 8
value = 200, 24
channel=0

[State 0, EnvShake]
type = EnvShake
triggerall =anim=43
trigger1 = animelemtime(2)= 0
time = 15
freq = 60
ampl = -3
phase = 65
;ignorehitpause =
;persistent =

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0 && anim=43
value = 0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 193]
type = A
physics=N
ctrl = 0
anim = 190
velset = 0,0

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

[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name = "Blue Falcon2"
ID =194
stateno =194
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0


[State 0, VelSet]
type = VelSet
trigger1 =animelem=2&& anim=190
y = -12

[State 0, VelMul]
type = Veladd
trigger1 =animelemtime(2)>0 && anim=190
y = .57

[State 0, VelSet]
type = VelSet
trigger1 =anim=43
y = 0

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

[State 0, PosSet]
type = PosSet
trigger1 = pos y>0 && anim=192
y = 0

[State 0, SprPriority]
type = SprPriority
trigger1 = animelem= 5
value = 9
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=192
trigger1 =pos y>0 && anim=190 && time >12
value = 192

[State 200, 1]
type = PlaySnd
triggerall =anim=192
trigger1 = animelemtime(2)= 0
value = 40, 0



[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0 && anim=192
value = 0
;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2
[State 200, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 21
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                    ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 14, 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 =9,9                ;Time attacker pauses, time opponent shakes
sparkno = S7000+(random%4)                      ;Spark anim no (Def: set above)
sparkxy = -10, -76               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S2, 0
guard.sparkno= S7500       
getpower=0 
givepower=5,5        ;Sound to play on hit
guardsound = S6, 0                ;Sound to play on guard
ground.type = High     
p2facing=1          ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 9            ;Time opponent is in hit state
ground.velocity = -4
guard.velocity=-4.5            ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12             ;Time before opponent regains control in air
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,28,14))
air.fall=1
id=200
yaccel = .49
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4
movetype = I  
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 0
channel=0
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1



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




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

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

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



[State 5035, 4]
type=selfState
triggerall = time>2
trigger1= Pos Y >= 15*enemy,fvar(1)  ;.
value = 5050 ;HITA_FALL

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

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

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

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

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



[State 5035, 4]
type=selfState
triggerall = time>2
trigger1 = Pos Y >= 15*enemy,fvar(1)  ;.
value = 5050 ;HITA_FALL



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


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

 ;5051 - 4 + type

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

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

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

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

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


[State 5035, 4]
type=selfState
triggerall = time>2
trigger1 = Pos Y >= const(size.mid.pos.y)+40 && vel y >0
value = 5100 ;HITA_FALL
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = ifelse(p2bodydist x <25,205,206)
sprpriority =2
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 210, Width]
type = Width
trigger1 = anim=206
value = 29,0
edge=35,0
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200,1
channel=0
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 23
guardflag = MA
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -15,ifelse(anim=205,-65,-70)
hitsound = S2, 1
guard.sparkno= S7500
priority=4
getpower=20,10 
givepower=15,5
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
guard.ctrltime=ifelse(anim=205,10,16)
ground.hittime  = ifelse(anim=205,13,19)+(var(21)=2*4)
ground.velocity = -5.5
guard.velocity=-6
air.velocity = -2.5,-4
p2facing=1
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,50,25))
air.fall=1
id=200
yaccel = .49
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4
movetype = I  
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = ifelse(p2bodydist x <15,211,210)
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 210, Width]
type = Width
trigger1 = anim=211
value = 23,0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 2
channel=0
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    =40
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,ifelse(anim=210,-67,-74)
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=30,15 
priority=5
givepower=20,15  
ground.type = High
p2facing=1
guard.ctrltime=ifelse(anim=211,12,11)
ground.slidetime =14
ground.hittime  = ifelse(anim=211,18,16)
ground.velocity = -5.5
guard.velocity=-7
air.velocity = -2.5,-4
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,36,25))
air.fall=1
id=200
yaccel = .49
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4
movetype = I  
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 0;    5
poweradd=0
ctrl = 0
anim = 400
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 3
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 10
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,9
sparkno = S7000+(random%4)
sparkxy = -10,-52
hitsound = S2, 0
guardsound = S6, 0
ground.type = Low
getpower=0 

givepower=5,5 
guard.sparkno= S7500
guard.ctrltime=10
ground.slidetime =12
ground.hittime  = 12
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,26,13))
ground.velocity = -4
guard.velocity=-4.5
air.velocity = -1.5,-3
air.fall=1
id=200
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
movetype = I  
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 405]
type    = C
movetype= A
physics = C
juggle  = 0;    5
poweradd= 0
ctrl = 0
anim = 430
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 4
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    =20
animtype  = Light
hitflag = MAF
guardflag = L
guard.sparkno= S7500
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -10,-8
hitsound = S2, 1
guardsound = S6, 0
getpower=20,10 
priority=4
givepower=15,5  
ground.type = Low
guard.ctrltime=9
ground.slidetime =15
ground.hittime  = ifelse(var(21)=2,18,14)
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,34,16))
ground.velocity = -5
air.velocity = -2,-3
guard.velocity=-6
down.velocity = -5,0
down.hittime = 20
air.fall=1
id=200
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
movetype = I  
[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 0;    6
poweradd= 0
ctrl = 0
anim = 410
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 2
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 5
channel=0
;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage    = 45
animtype  = Medium
hitflag = MAF
guardflag = HA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,-60
guard.sparkno= S7510
hitsound = S2, 2
getpower=25,15 
givepower=15,10  
p2facing=1
priority=5
guardsound = S6, 0
ground.type = Low
guard.ctrltime=21
ground.slidetime =19
ground.hittime  = 29
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,45,35))
ground.velocity = -4
guard.velocity=-7
air.velocity = -3,-4
air.fall=1
id=200
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
movetype = I 
[State 0, Width]
type = Width
trigger1 =1
edge = 0,0
player = 25,0

[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 600
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0
[State 0, VarSet]
type = Varadd
trigger1 = movehit && p2statetype=A
v = 14    ;fv = 10
value = 1
ignorehitpause =1
persistent =0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    =10
guardflag = HA
priority = 3
pausetime = 9,9
sparkno = S7000+(random%4)
sparkxy = -10,-58
hitsound = S2, 0
getpower=10,5  
getpower=0 
givepower=5,5 
guardsound = S6, 0
guard.sparkno= S7500
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
air.velocity = -1.3,ifelse(p2bodydist y <=-30,-1,-3.5)
fall.recovertime=ifelse(var(21)=1,15,ifelse(var(21)=2,20,10))
air.fall=1
id=200
yaccel = .49
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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



[State 600, 3]
type = changestate
trigger1 = Time = 17
value = 57
ctrl=1
;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 605]
type    = A
movetype= A
physics = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 605
sprpriority = 2
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 16
guardflag = HA
priority = 4
pausetime = 11,11
sparkno = S7010+(random%4)
sparkxy = -5,-50
hitsound = S2, 1
getpower=15,5  
guardsound = S6, 0
ground.type = High
guard.sparkno= S7500
ground.slidetime =9
ground.hittime  = 14
ground.velocity = -4
air.velocity = -2,ifelse(p2bodydist y <=-40,-.5,-3.5)
fall.recovertime=ifelse(var(21)=1,27,ifelse(var(21)=2,25,20))
air.fall=1
id=200
yaccel = .49
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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



[State 600, 3]
type = changestate
trigger1 =animtime=0
value = 57
ctrl=1
;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 610
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 37
guardflag = HA
priority = 5
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -13,-53
hitsound = S2, 2
getpower=20,10 
givepower=15,5  
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -5
air.velocity = -3,ifelse(p2bodydist y <=-30,-.5,-3.5)
fall.recovertime=ifelse(var(21)=1,45,ifelse(var(21)=2,55,36))
air.fall=1
id=200
yaccel = .49
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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







[State 600, 3]
type = changestate
trigger1 =animtime=0
value = 57
ctrl=1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 700]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= -350
ctrl = 0
velset = 0,0
anim = 700
sprpriority =2


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

[State pal, *]
type = PalFX
trigger1 = time = 0
time = 8
add = 128,128,128
sinadd = -128,-128,-128,16
invertall = 0
color = 256
ignorehitpause = 1


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

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7
movetype = I  
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt

[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0;    0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2
;[State 0, HitBy]
;type = HitBy
;trigger1 =1 
;value = SCA
;;value2 = S,NA
;time = 1
;ignorehitpause = 
;persistent = 

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

[State 800, 1]
type = HitDef
triggerall = p2bodydist x <=36
Trigger1 = Time = 1
attr = S, NT         ;Attributes: Standing, Normal Throw         ;Affect only ground people who are not being hit
priority = 2    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2                      ;p2's sprite priority is set to 0 by default
p1facing = ifelse(command = "holdfwd",1,-1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 =var(21)>0
v = 5  ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno=[140,155])||p2movetype=H
v = 5  ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno!=[140,155])&&p2movetype=I
v = 5  ;fv = 10
value =0
[State 200, 1]
type = PlaySnd
trigger1 = time=5
value = S200, 22
channel=0
[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 80

[State 0, VarSet]
type = VarSet
trigger1 = (random<50*(enemy,AIlevel))&&var(5)=0&&(enemy,AIlevel)>0&&time=0
trigger2 = (random<62*(enemy,AIlevel))&&var(5)=2&&(enemy,AIlevel)>0&&time<3
v = 20   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 



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

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

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

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 3
[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S200, 22
channel=0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 40, 0
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = -2
;ignorehitpause =
;persistent =

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

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

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    =90
guardflag = MA
pausetime = 16,16
sparkno = S7020+(random%4)
sparkxy = -10,-70
hitsound = S2,3
getpower=45
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -17,-8
air.velocity = -9,-7
fall=1
id=801

[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1045,1048])
value =1045
ID = 801
ignorehitpause =0
;persistent =


[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 = 830
poweradd = 0

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

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -11
[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=811
value =812
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =time=9&&enemy,var(5)=1
trigger2=time=13&&enemy,var(5)=0
value = 820
elem = 2
;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&& p2stateno!=812
value = 5050
;------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 1045]
type    = A
movetype= H
physics = N
velset = 0,0

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

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

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

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

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

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

;ignorehitpause =
;persistent =

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

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

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

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)
[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1026
[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

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

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




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

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


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

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

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


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

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

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

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

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062
[State 1028, Turn]
type = Turn
triggerall = anim!=5052
trigger1 = (Time = 0) && (BackEdgeDist < 30)
[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 15)
value = 5100
;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 812]
type    = S
movetype= A
physics = S
poweradd = 0
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 831

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -11
[State 810, State End]
type = selfState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt

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

[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 20   ;fv = 10
value = 0
       ;Force p2 into falling down

[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 =p2movetype=A
v = 5  ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno=[140,155])||p2movetype=H
v = 5  ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno!=[140,155])&&p2movetype=I
v = 5  ;fv = 10
value =0
[State 800, 1]
type = HitDef
triggerall= p2statetype=A
Trigger1 = Time = 0
attr = A, NT        ;Attributes: Standing, Normal Throw         ;Affect only ground people who are not being hit
priority = 2    ;Throw has low priority, must be miss or dodge type.
sparkno = -1    
;hitflag=A      ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2                      ;p2's sprite priority is set to 0 by default
p1facing = ifelse(command = "holdfwd",1,-1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 831       ;On success, KFM changes to state 810
p2stateno = 832       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1       
[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = ifelse(random<499,605,610)
ctrl = 0
;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 831]
type    = A
movetype= A
physics = N
velset=0,0
anim = 851
poweradd =80

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

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

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

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

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

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 3
[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S200, 22
channel=0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 40, -63
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = 2
;ignorehitpause =
;persistent =

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

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

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = A, NA
animtype  = Medium
damage    =75
guardflag = MA
pausetime = 7,7
sparkno = S7020+(random%4)
sparkxy = -10,-70
getpower=40
hitsound = S2,3
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -11,-8
air.velocity = -9,-7
fall=1
p2stateno=1036
id=800


[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 57
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 832]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 852
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=835
value =836

;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!=831
value = 5050
;---------------------------------------------------------------------------
; hitshakestae for trip or fast fall
; CNS difficulty: easy
[Statedef 1036]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1

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


 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 833
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 833]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype=A
x = -5
y = 7
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype!=A
x = -4.5
y = -5

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=0&& (time >5||p2statetype=A)
value = 834
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 834]
type    = L
movetype= H
physics = N

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

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

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

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


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

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

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

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

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


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

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

[State 810, State End]
type = selfState
trigger1 = pos y>0
value = 52
ctrl = 1
;---------------------------------------------------------------------------
; Kung Fu Palm
[Statedef 1000]
type    = U
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
;velset = 0,0
anim = ifelse(statetype=A,1030,1000)
ctrl = 0
sprpriority = 1


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

[State 0, VelSet]
type = VelSet
triggerall = anim=1000
trigger1 =animelemtime(1)>0&&animelemtime(3)<0
x = 0
y = 0

[State 0, VelSet]
type = VelSet
triggerall = anim=1050
trigger1 =animelemtime(2)>5&&animelemtime(4)<0
x = 0
y = 0
;ignorehitpause =
;persistent =
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2
trigger1 = p2movetype=A && animelemtime(3)>=0 
v =21   ;v = 570
value = 1
 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1000)=1 && time=0
v = 21   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1  &&prevstateno=[200,1100]
v = 21   ;v = 570
value = 0
ignorehitpause =1


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



[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=12

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12002,12003)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State -2, Helper]
type = Helper
trigger1 = movehit&&numhelper(11009)<1
helpertype = normal ;player
name = "trail"
ID = 11009
stateno = 7000
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1= 1
flag = unguardable
[State 0, VelSet]
type = VelSet
triggerall = anim=1030
trigger1 =animelemtime(3)>0&&animelemtime(4)<0
;x = 0
y = 0

[State 0, VarSet]
type = VarSet
trigger1 =movehit && statetype!=A
v = 12   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =movehit && statetype=A
v = 19   ;fv = 10
value = 1

;ignorehitpause =
;persistent =

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 0
value = 200, 12
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=4 && anim=1000
trigger2 = animelem=3 && anim=1030
value = 200, 20
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=5&& anim=1000
trigger2=  animelem=4 && anim=1030
value = 300, 1
[State 0, Explod]
type = Explod
trigger1 = animelem=2 && anim=1030
trigger2 = animelem=3 && anim=1000
anim = 1003
ID =1003
pos = ifelse(anim=1000,-27,-30),ifelse(anim=1000,-84,-98)
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 = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
;ignorehitpause =
;persistent =
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=4 && anim=1030
trigger2= anim=1011
id =1003

[State 0, Helper]
type = Helper
trigger1 = animelem=5&&anim=1000
helpertype = normal ;player
name = "FALCON"
ID =1001
stateno =1001
pos = 72,-68
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0

[State 0, Helper]
type = Helper
trigger1 = animelem=4&&anim=1030
helpertype = normal ;player
name = "FALCON"
ID =1001
stateno =1003
pos = 72,-68
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, SA
animtype  = Hard
damage    = 90, 52
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -18,-70
getpower=45
givepower=30  
sparkno = S7020+(random%4)
guard.sparkno= S7510
hitsound = S2, 3
guardsound = S6, 0
ground.type = Low
ground.slidetime = 32
ground.hittime  = 28
ground.velocity = -9,-7
air.velocity = -9,-7
guard.velocity=-12
;fall = 1
id=ifelse(statetype=A,1029,1025)
p2facing=ifelse(facing=-1,1,1)
envshake.time = 25
envshake.ampl = 7
envshake.freq=126

[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1025,1030])
value = ifelse(statetype=A,1029,1025)
ID =ifelse(statetype=A,1029,1025)
ignorehitpause =0
;persistent =


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

[State 0, VelSet]
type = VelSet
triggerall = anim=1030
trigger1 =animelem=4
x = ifelse(vel x <0,-4,4)
y = 6
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =anim=1011
statetype = C       ;S,A,C,L
movetype = I        ;I,A,H
physics = C        ;A,C,S,N
;ignorehitpause =
;persistent =

[State 0, Gravity]
type = Gravity
trigger1 =animelemtime(5)>0 && anim=1030
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)<=0&& anim=1030
y = .33

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(anim=1011,11,0)
ctrl = 1

[State 1050, 5]
type = Changeanim
triggerall =anim=1030
triggerall = animelemtime(2)>0
trigger1 = pos y>=-10
value = 1011
[State 0, PosSet]
type = PosSet
trigger1 =anim=1011
y = 0
[State 0, VelSet]
type = VelSet
trigger1 =anim=1011
y = 0


[State 0, VelMul]
type = VelMul
trigger1 =anim=1011
x = .85
[State 0, HitOverride]
type = HitOverride
trigger1 = animelemtime(3)>=18&&animelemtime(5)<0  &&anim=1000
attr = SCA,NA,SA      ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 1004
time = 1

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 && anim=1011
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Kung Fu Palm
[Statedef 1005]
type    = U
movetype= A
physics = N
juggle  = 0;    4
poweradd= -250
;velset = 0,0
anim = ifelse(statetype=A,1031,1004)
ctrl = 0
sprpriority = 1

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

[State 0, VelSet]
type = VelSet
triggerall = anim=1004
trigger1 =animelemtime(1)>0&&animelemtime(3)<0
x = 0
y = 0

;persistent =
[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
;ignorehitpause =
;persistent =
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A 
v =21   ;v = 570
value =ifelse((prevstateno!=[150,155]) ,2, 1)
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall =var(21)!=0

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)+(var(21)*(var(21)=2))
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1


[State -2, Helper]
type = Helper
trigger1 = movehit&&numhelper(11009)<1
helpertype = normal ;player
name = "trail"
ID = 11009
stateno = 7000
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1


[State 0, VelSet]
type = VelSet
triggerall = anim=1031
trigger1 =animelemtime(3)>0&&animelemtime(4)<0
;x = 0
y = 0

[State 0, VarSet]
type = VarSet
trigger1 =movehit
v = 12   ;fv = 10
value = 1
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =movehit && statetype=A
v = 19   ;fv = 10
value = 1
[State 1000, 1]
type = PlaySnd
trigger1 = Time = 0
value = 200, 14
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=4 && anim=1004
trigger2 = animelem=3 && anim=1031
value = 200, 20
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=5&& anim=1004
trigger2=  animelem=4 && anim=1031
value = 300, 1
[State 0, Explod]
type = Explod
trigger1 = animelem=2 && anim=1031
trigger2 = animelem=3 && anim=1004
anim = 1006
ID =1003
pos = ifelse(anim=1004,-27,-30),ifelse(anim=1004,-84,-98)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = .35,.35
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause =1
;persistent =
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=4 && anim=1031
trigger2= anim=1011
trigger3 = animelem=5 && anim=1004
id =1003

[State 0, Helper]
type = Helper
trigger1 = animelem=5&&anim=1004
helpertype = normal ;player
name = "FALCON"
ID =1001
stateno =1001
pos = 72,-68
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0

[State 0, Helper]
type = Helper
trigger1 = animelem=4&&anim=1031
helpertype = normal ;player
name = "FALCON"
ID =1001
stateno =1003
pos = 72,-68
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, SA
animtype  = Hard
damage    = ifelse(((prevstateno=[130,132])||(prevstateno=[150,155])),155,95), 12
priority  = 6
guardflag = MA
pausetime = 15,15
guard.pausetime=10,10
sparkxy = -18,-70
sparkno = S7020+(random%4)
guard.sparkno= S7510
hitsound = S2, 3
getpower=0
givepower=30
guardsound = S6, 0
ground.type = Low
ground.slidetime = 32
ground.hittime  = 20
ground.velocity = -9,-7
air.velocity = -9,-7
guard.velocity=-12
;fall = 1
id=1003
p2facing=ifelse(facing=-1,1,1)
envshake.time = 25
envshake.ampl = 7
envshake.freq=126
[State 0, VarSet]
type = VarSet
trigger1 = movehit && prevstateno!=[150,155]
v = 19    ;fv = 10
value = 1
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=1036&&p2stateno!=[833,834])&& (p2stateno!=[1051,1052])
value = 1036
ID =1003
ignorehitpause =0
;persistent =


[State 0, NotHitBy]
type = NotHitBy
trigger1 =animelemtime(4)>=0 && animelemtime(6)<0
value = SCA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =
[State 0, VelSet]
type = VelSet
triggerall = anim=1004
trigger1 =animelem=5
x =12

[State 0, VelSet]
type = VelSet
triggerall = anim=1004
trigger1 =animelem=6
x =0
[State 0, VelSet]
type = VelSet
triggerall = anim=1031
trigger1 =animelem=4
x =4
y = 6

[State 0, Gravity]
type = Gravity
trigger1 =animelemtime(5)>0 && anim=1031
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)<=0&& anim=1031
y = .33

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(anim=1011,11,0)
ctrl = 1

[State 1050, 5]
type = Changeanim
triggerall =anim=1031
triggerall = animelemtime(2)>0
trigger1 = pos y>=-10
value = 1011
[State 0, PosSet]
type = PosSet
trigger1 =anim=1011
y = 0
[State 0, VelSet]
type = VelSet
trigger1 =anim=1011
y = 0


[State 0, VelMul]
type = VelMul
trigger1 =anim=1011
x = .85


[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 && anim=1011
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Kung Fu Palm
[Statedef 1004]
type    = U
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
ctrl = 0
sprpriority = 1
[State 0, Pause]
type = Pause
trigger1 =time=0
time = 8
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=1
value = 1005
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A 
v =21   ;v = 570
value = 2
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=2

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12002,12003)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 1000, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 3
[State -2, Helper]
type = Helper
trigger1 = movehit&&numhelper(11009)<1
helpertype = normal ;player
name = "trail"
ID = 11009
stateno = 7000
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1
;ignorehitpause =
;persistent =
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =1
flag = unguardable


[State 1000, 1]
type = PlaySnd
trigger1 = time=2
value = 200, 20
[State 1000, 1]
type = PlaySnd
trigger1 = time=2
value = 300, 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =time>0
id =1003

[State 0, Helper]
type = Helper
trigger1 = animelem=2
helpertype = normal ;player
name = "FALCON"
ID =1001
stateno =1001
pos = 72,-68
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, SA
animtype  = Hard
damage    = 165, 4
priority  = 7
guardflag = MA
pausetime = 15,15
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -18,-70
hitsound = S2,3
getpower=90 
givepower=35 
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -9,-7
air.velocity = -9,-7
fall = 1
;fall = 1
id=ifelse(statetype=A,1029,1025)
p2facing=ifelse(facing=-1,1,1)
envshake.time = 25
envshake.ampl = 7
envshake.freq=126

[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1025,1030])
value = ifelse(statetype=A,1029,1025)
ID =ifelse(statetype=A,1029,1025)
[State 0, Pause]
type = Pause
trigger1 =p2stateno=1025&&enemy,time=1
time = 7


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



;---------------------------------------------------------------------------
; Ground Bounce
[Statedef 1029]
type    = A
movetype= H
physics = N
poweradd= 0
ctrl = 0
sprpriority =-1
[State 0, Turn]
type = Turn
trigger1 =facing= enemy,facing 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=2
value = 5160

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

;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .55
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0
y = -40
ignorehitpause =1
;persistent =

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

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

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

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

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

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

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

[State 0, SelfState]
type = SelfState
trigger1 = pos y>0 && time>20
value =5100  
;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1010]
type    = S
movetype= A
physics = S
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
anim = 1020
ctrl = 0
sprpriority = 2
[State 0, PowerAdd]
type = PowerAdd
triggerall=time=2
trigger1 = var(2)=3
value = -250
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = ifelse(Var(21)=2,1,3)
persistent=0
ignorehitpause=1

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


[State 1010, 1]
type = PlaySnd
trigger1 = Time = 9
value = 0, 3
[State 1000, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 8
[State 1000, 1]
type = PlaySnd
triggerall = anim=1020
trigger1 = animelem=4
value = 300, 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command = "HCF2",1,ifelse(command="HCF3",2,3))
[State 0, VarSet]
type = VarSet
trigger1 =movehit
v = 13    ;fv = 10
value = 1
;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1+(var(2)!=3)

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)+ifelse(var(2)!=3,2,0)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State -2, Helper]
type = Helper
trigger1 = movehit&&numhelper(11009)<1
helpertype = normal ;player
name = "trail"
ID = 11009
stateno = 7000
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = var(2)=3 && power <250 && time=1
v = 2    ;fv = 10
value = 2
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = p2bodydist x<70 
trigger1 = ((prevstateno=210||prevstateno=410||prevstateno=430||prevstateno=205)||p2movetype=I)
trigger2 = time>=2&& var(2)=0 && (var(21)=0||var(31)>0)
v = 2   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0&& (var(21)>0||var(31)!=0)
triggerall = random <499 || (power<=500 ) || var(31)!=0
trigger1 =  (p2movetype!=I)
trigger2 = time>=2&& var(2)=0 && (var(21)!=0)
trigger3= var(31)>0 && p2bodydist x >70
v = 2   ;fv = 10
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=450
triggerall = random<499
triggerall=time=0&&var(31)=0&&p2statetype!=A
trigger1 = var(4)=0 && (var(21)=0&&p2movetype=H&&(p2stateno!=[120,155])&&prevstateno=[200,440])
v = 2   ;fv = 10
value = 3
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 58   ;fv = 10
value = ifelse(var(21)=0,25,30)-(ifelse(numexplod(1010)>1,numexplod(1010)*10,0))

[State 0, Helper]
type = Helper
triggerall = var(2)=3
trigger1 = time=0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1021
triggerall = var(2)=1
trigger1 = !movecontact
attr = S, SA
animtype  = Hard
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 15,25
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-57
hitsound = S2, 5
getpower=20,10 
givepower=15,5
guardsound = S6, 0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 30
guard.ctrltime=24
ground.velocity = -7,0
air.velocity = -1.5,ifelse(var(2)=1,-7.35,ifelse(var(2)=2,-9,-11))
fall = ifelse(var(2)=1,0,1)
fall.recovertime=55
guard.velocity=-6.5
air.fall=1
nochainID = 998
id=998
yaccel=.48
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1021
triggerall = var(2)>1
trigger1 = !movecontact
attr = S, SA
animtype  = hard
air.animtype= up
damage    =ifelse(var(2)=1,40,ifelse(var(2)=2,55,65)), 4
priority  = 6
guardflag = MA
getpower= ifelse(var(2)=3,0,55)
pausetime = 15,18
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-57
hitsound = S2, 5
guardsound = S6, 0
getpower=ifelse(var(2)=3,0,30),ifelse(var(2)=3,0,15)
givepower=10,5
ground.type = Low
ground.slidetime = 25
ground.hittime  = ifelse(var(2)=2,27,15)
guard.ctrltime=26
ground.velocity = ifelse(var(2)=1||(var(21)=0&&var(2)<3),-6.5,ifelse(var(2)=2&&var(21)>0,-.5,-1.5)),ifelse(var(2)=1||(var(21)=0&&var(2)<3),0,ifelse(var(2)=2&&var(21)>0,-10.5,-14.25))
air.velocity = -1.5,ifelse(var(2)=1,-5.5,ifelse(var(2)=2,-8.5,-12.5))
air.fall=1
fall = ifelse((var(21)=0&&var(2)<3),0,1)
fall.recovertime=ifelse(var(21)>0,85,ifelse(var(2)=3,85,55))
guard.velocity=-8
nochainID = 998
yaccel=.44

id=998
[State 0, TargetState]
type = TargetState
triggerall = enemy,alive  && ((var(2)<=2&&var(21)=0)||(var(21)>0&&var(2)=1))
trigger1 =p2statetype!= A && movehit=1 && (p2stateno!=1035)
value =1035
ID =998
ignorehitpause =0 

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =998
ignorehitpause =1 

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


[State 0, NotHitBy]
type = HitBy
trigger1 = animelem =5 && anim=1020
value = SCA,AA,NT,ST,HT
;value2 = S,NA
time = 10
;ignorehitpause = 
;persistent = 

[State 0, NotHitBy]
type = HitBy
trigger1 = anim=1021
value = SCA,AA,AP,AT
;value2 = S,NA
time = 1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4 && anim=1021
movetype = I 

[State 0, VelSet]
type = VelSet
triggerall = anim=1020
trigger1 =animelemtime(3)>0
x = 12

[State 0, VelSet]
type = VelSet
trigger1 = anim=1021
x = 0




[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=1021
triggerall = animelemtime(5)>0
trigger1 = time > ifelse(var(2)=1,11,20) || p2bodydist x <20
value = 1021


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



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

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

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

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

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

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

[State 0, SelfState]
type = SelfState
trigger1 = !alive
value =5050
[State 1025, State]
type = selfstate
trigger1 =time > ceil(enemy,var(58)*1.45)
value = 0
ctrl=1
;---------------------------------------------------------------------------
; Kung Fu Knee
[Statedef 1050]
type    =U
movetype= A
physics = N
juggle  = 0;    5
poweradd=0
velset = 0,0
anim = ifelse(statetype=A,1050,1010)
ctrl = 0
sprpriority = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5
statetype = C      ;S,A,C,L
;ignorehitpause =
;persistent =



[State 1000, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 11
[State 0, VarAdd]
type = VarAdd
triggerall = anim=1050
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, VarAdd]
type = VarAdd
triggerall = anim=1010
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 2
persistent=0
ignorehitpause=1
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=2 &&anim=1050
value = 300, 2
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=4 &&anim=1010
value = 300, 2
[State 0, VelSet]
type = VelSet
triggerall =anim=1050
trigger1 = animelem=3
x = 10.5
y = 10.5
[State 0, Helper]
type = Helper
trigger1 = animelem=5 &&anim=1010
helpertype = normal ;player
name = "FALCON"
ID =1001
stateno =1001
pos = 16,-40
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0
 [State -2, Helper]
type = Helper
trigger1 = movehit&&numhelper(11009)<1
helpertype = normal ;player
name = "trail"
ID = 11009
stateno = 7000
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1
[State 0, Helper]
type = Helper
trigger1= animelem=2 &&anim=1050
helpertype = normal ;player
name = "FALCON"
ID =1002
stateno =1002
pos = 16,-40
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.xscale=.5
size.yscale=.5
ignorehitpause=0

[State 0, VelSet]
type = VelSet
triggerall =anim=1010
trigger1 = animelem=5
x = 12
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2
trigger1 = p2movetype=A  
v =21   ;v = 570
value = 1

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


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

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

[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)>=1

triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 1050, 4]
type = HitDef
trigger1 = !movecontact     && (p2stateno!=834 &&p2stateno!=1052)
attr = A, SA
animtype  = Medium
damage    = ifelse(anim=1050,75,95), 4
priority  = 5
guardflag = MA
pausetime = 12,12
guard.sparkno= S7510
sparkno = S7020+(random%4)
getpower=40,15  
sparkxy = -10,ifelse(anim=1050,-25,-4)
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -3.5,ifelse(anim=1050,-9,-10.5)
air.velocity = -3.5,ifelse(anim=1050,9,-9.5)
fall = 1
fall.recovertime=ifelse(var(21)>0,95,60)
guard.velocity=-11
nochainID = 999
yaccel=ifelse(var(21)>0,.24,.36)
id=ifelse(statetype=A&&p2statetype=A,997,ifelse(p2statetype=A,995,999))
p2facing = 1

[State 1050, 4]
type = HitDef
trigger1 = !movecontact  && (p2stateno=834 ||p2stateno=1052||p2stateno=[30003,30005])&& anim=1050
attr = A, SA
animtype  = Medium
damage    = ifelse(anim=1050,75,95), 4
priority  = 5
guardflag = MA
hitflag=MAFD
pausetime = 12,12
guard.sparkno= S7510
sparkno = S7020+(random%4)
sparkxy = -10,ifelse(anim=1050,-25,-4)
hitsound = S2, 6
guardsound = S6, 0
getpower=30,15
givepower=20,10
ground.type = Low
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -3.5,ifelse(anim=1050,-7,-9.5)
air.velocity = -3.5,ifelse(anim=1050,9,-10.5)
fall =ifelse(var(21)>0,1,0)
forcenofall=ifelse(var(21)>0,0,1)
fall.recovertime=ifelse(var(21)>0,15,40)
guard.velocity=-11
nochainID = ifelse(p2stateno=834,997,999)
id=800
yaccel=.48
[State 0, VarSet]
type = VarSet
trigger1 = numtarget(800)=1
v = 19   ;fv = 10
value = 1
ignorehitpause = 1
;persistent = 


[State 1050, 5]
type = Changeanim
triggerall =anim=1010
triggerall= anim!=1012
trigger1 = time=35
value = 1012
[State 0, PlayerPush]
type = PlayerPush
trigger1 = statetype!=A
value = 0
;ignorehitpause =
;persistent =
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=1011 ||anim=1012
movetype = I        ;I,A,H
;ignorehitpause = 
;persistent = 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=1011 &&animelem=2 ||anim=1012
movetype = I        ;I,A,H
statetype=S
[State 1050, 5]
type = Changeanim
triggerall =anim=1050
triggerall= anim!=1011
trigger1 = pos y >30
value = 1011
[State 0, PosSet]
type = PosSet
trigger1 =anim=[1011,1012]
y = 0
[State 0, VelSet]
type = VelSet
trigger1 =anim=[1011,1012]
y = 0


[State 0, VelMul]
type = VelMul
trigger1 =anim=[1011,1012]
x = .85

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 && (anim=[1011,1012])
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1051]
type    = A
movetype= H
physics = N
velset = 0,0
[State 0, Turn]
type = Turn
trigger1 = facing=enemy,facing&time=0
;ignorehitpause =
;persistent =

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

[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype=A
x = -5
y = 7
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype!=A
x = -5
y = -5

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=0&& (time >5||p2statetype=A)
value = 1052
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1052]
type    = L
movetype= H
physics = N

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

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

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




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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = statetype=A&& time=0
value = 3050
elem = 2
;ignorehitpause =
;persistent =

;ignorehitpause =
;persistent =
 

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -500
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time = 0
value = S999, 0
channel = 3
;abspan =
;ignorehitpause =
;persistent =

[State 0, Pause]
type = Pause
trigger1 =  time = 0
time = 20
pausebg = 1

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



[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 8002
ID =8002
pos = ifelse(animelemtime(1)=0,-5,8),ifelse(animelemtime(1)=0,-53,-77)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 1,ifelse(GameHeight=180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 3000, Super B]
type = AfterImage
trigger1 = time = 1
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0

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

[State 3000, Super D]
type = HitBy
trigger1 = AnimElem = 1
value = S, AA
time = 11

[State 0, VelSet]
type = VelSet
trigger1 =animelemtime(1)=1
x = 7
y = -11
[State 0, VelMul]
type = VelMul
trigger1 =animelemtime(4)>0
x = .97
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time=3
value = S200,14
channel=0
[State 0, Gravity]
type = Gravity
trigger1 =animelemtime(1)>0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =p2stateno!=[150,155]
flag = unguardable

[State 1050, 4]
type = HitDef
triggerall = var(4)<ifelse(var(21)=2,22,14) 
triggerall =anim = 3050 &&p2statetype=A
triggerall = p2stateno!=[150,155]
trigger1 = !movecontact
attr = A, HA
animtype  = Medium
damage    =0,0
priority  = 7
guardflag = MA
guard.pausetime = 3, 8
sparkxy = -10,-62
sparkno = -1
guard.sparkno= S11004
hitsound   = -1
guardsound = S5,0
ground.type = Low
getpower =0
ground.slidetime = 99
ground.hittime  = 99
guard.ctrltime=17
ground.velocity = -0
guard.velocity = -3
airguard.velocity = -4,-2
air.velocity = -.5,-2
air.hittime = 22
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall.animtype = back
p1stateno = 3001
p2stateno = 3002
kill = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = statetype!=A && animelemtime(2)>=0
statetype = A       ;S,A,C,L

[State 3000, 7]
type = ChangeState
trigger1 = pos y >=0&& animelemtime(3)>0
value = 52
ctrl = 0
;---------------------------------------------------------------------------
[Statedef 3001]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim =  3051
sprpriority = 2
[State 0, Explod]
type = Explod
triggerall = time=0
triggerall = var(21)=1
triggerall = p2movetype=H
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,20,180),120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime =30
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2
[State 0, VelSet]
type = VelSet
trigger1 =animelem=2
x = -3
y = -7
[State 0, EnvShake]
type = EnvShake
triggerall = enemynear,life>225
trigger1 = animelem=2
time = 20
freq = 126
ampl = 7
phase = 126

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(1) >= 0 && animelemtime(2) <0
pos = 41,-67

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =animelem=2
value =-ceil((165+(ifelse(var(21)>0,35,0)))*ifelse(fvar(2)<=.5,.5,ifelse((enemy,gethitvar(hitcount)<2),1,.8)))
[State 0, TargetState]
type = TargetState
trigger1 = animelem=2
value =3003
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time=0
value = S800,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelemtime(1)=17
value = S200,26
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=2
value = S300,2
[State 0, Pause]
type = Pause
triggerall = p2life >225
triggerall = time=[18,35]
trigger1 =time%2=0
time = 1

[State -2, Helper]
type = Helper
trigger1 = animelem=2&&numhelper(11009)<1
helpertype = normal ;player
name = "trail"
ID = 11009
stateno = 7000
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = animelem=2
anim = 3054
ID =3054
pos = 20,-60
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =animelem=2        ;I,A,H
physics = A         ;A,C,S,N
;ignorehitpause =
;persistent =

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 3002]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 3052
[State 0, Turn]
type = Turn
trigger1 = facing=enemy,facing
;ignorehitpause =
;persistent =


;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = p2stateno!=3001
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 recover by
;     hitting his recovery command when he is falling.
[Statedef 3003]
type    = A
movetype= H
physics = N
velset = -4,-8
poweradd = 40

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

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

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


[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&!animexist(5061)
value = 3053
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&animexist(5061)
value = 5061
[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.
[Statedef 30003]
type    = A
movetype= H
physics = N
poweradd = 40

[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0
x = 1
y = 1
;ignorehitpause = 
;persistent =
[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y =gethitvar(yaccel)






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

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

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

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

;ignorehitpause = 
;persistent = 

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

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

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

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

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

[State 0, ChangeState]
type = selfState
trigger1 = time>47
value = ifelse(!alive, 5110,5120)
;---------------------------------------------------------------------------
[Statedef 3050]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=2
anim = 3000
sprpriority = 2

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(4)>=0
statetype = A       ;S,A,C,L
movetype = A       ;I,A,H
physics = N
[State 182, 2]
type = NotHitBy
trigger1 = Time = 8
value = SCA
time = 8

[State 0, HitBy]
type = HitBy
trigger1 =anim=3000 && time >=5
value = SCA,HP,SA,SP
;value2 = S,NA
time = 1
[State 0, HitBy]
type =notHitBy
trigger1 =anim=3000 && time <5
value = SCA
;value2 = S,NA
time = 1
[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1
time = 2

[State 200, 1]
type = PlaySnd
trigger1 = animelem=2&&anim=3000
value = 200, 21

;-------------------------------------------------
[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -500
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time = 0
value = S999, 0
channel = 3
;abspan =
;ignorehitpause =
;persistent =

[State 0, Pause]
type = Pause
trigger1 =  time = 0
time = 45
pausebg = 1
movetime=6

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

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


[State 0, VelSet]
type = VelSet
triggerall = anim=3000
trigger1 = animelem = 4
x = 10.25
y=-4.25

[State 0, VelAdd]
type = VelAdd
triggerall = anim=3000
trigger1 = animelemtime(4) >0
y = .45
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
triggerall = anim=3001
trigger1 = 1
y=0

[State 0, VelSet]
type = posSet
triggerall = anim=3001
trigger1 =1
y=0

;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = Changeanim
triggerall = anim!=3001
trigger1 = pos y >= 0 && animelemtime(4) >0
value =3001
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=3001 && animelem=1
statetype = S        ;I,A,H
physics = S
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=3001 && animelem=3
movetype=I
[State 1050, 4]
type = HitDef
triggerall =anim = 3000
trigger1 = !movecontact
attr = A, HA
animtype  = Medium
damage    =0,0
priority  = 7
guardflag = MA
pausetime = 2,2
guard.pausetime = 3, 8
sparkxy = -10,-62
sparkno = -1
guard.sparkno= S11004
guard.sparkno= S7500
hitsound   = -1
guardsound = S6,0
ground.type = Low
getpower =0
ground.slidetime = 99
ground.hittime  = 99
guard.ctrltime=15
ground.velocity = -0
guard.velocity = -3
airguard.velocity = -4,-2
air.velocity = -.5,-2
air.hittime = 22
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall.animtype = back
p1stateno = 3051
p2stateno = 3052
kill = 0
p2facing=1

    ;I,A,H
;ignorehitpause = 
;persistent = 
[State 3000, 7]
type = ChangeState
trigger1 = animtime=0&&anim=3001
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 3051]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim =  3002
sprpriority = 2
[State 0, VarSet]
type = VarSet
trigger1 =1
v =4    ;fv = 10
value = 0
;ignorehitpause =
;persistent =


[State 0, HitBy]
type = HitBy
trigger1 =1
value = SCA,HP,HA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =

[State 0, VarSet]
type = Varset
trigger1 =fvar(2)<.4  
fv = 2   ;fv = 10
value = .4
ignorehitpause = 1
persistent = 1

[State 0, EnvColor]
type = EnvColor
trigger1 =time = 0
value = 255,255,255
time = 2



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

[State 0, TargetBind]
type = TargetBind
triggerall = anim=3002
trigger1 = animelemtime(1) > 0 && animelemtime(50) <0
pos = 55,0

;[State 0, TargetBind]
;type = TargetBind
;triggerall = anim=3002
;trigger1 = animelemtime(63) = 0
;pos = 15,-7

[State 0, Width]
type = Width
triggerall = anim=3002
trigger1 =animelemtime(61)<0
edge = 55,35
player = 0,0

[State 0, Width]
type = Width
triggerall = anim=3002
trigger1 =animelemtime(61)>=0
edge = 25,35
player = 0,0

[State 200, 1]
type = PlaySnd
trigger1 = animelem =62
value = 200, 6

[State 200, 1]
type = PlaySnd
triggerall = anim=3002
trigger1 = animelem =1
trigger2= animelem =5
trigger3= animelem =11
trigger4= animelem =16
trigger5= animelem =26
trigger6= animelem =33
trigger7= animelem =43
trigger8= animelem =48
value = 200, 0+(random%6)


[State 200, 1] ;201
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 13
attr = S, HA
damage = 20
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -12, -76
hitsound = S2, 0
getpower = 0
givepower=5
guardsound = S5, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
air.type = High
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
kill = 0
p2stateno=3053

[State 200, 1] ;201
type = HitDef
trigger1 = animelem=6
trigger2 = animelem=34
attr = S, HA
damage =20
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -18, -65
hitsound = S2, 2
getpower = 0
givepower=5
guardsound = S5, 0
ground.type = low
ground.slidetime = 99
ground.hittime  = 99
air.type = High
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
forcestand =1
kill = 0
p2stateno=3052


[State 200, 1] ;210
type = HitDef
trigger1 = animelem=18
attr = S, HA
damage = 20
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -19,-60
hitsound = S2, 3
getpower = 0
givepower=5
guardsound = S5, 0
ground.type = low
ground.slidetime = 99
ground.hittime  = 99
air.type = High
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
forcestand =1
kill = 0
p2stateno=3052
[State 210, 2];205
type = HitDef
trigger1 = animelem=27
attr = S, HA
animtype  = Medium
damage =20
guardflag = MA
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-71
getpower = 0
givepower=5
hitsound   = S2,5
guardsound =  S5, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
ground.velocity = 0
air.velocity = -2.5,-4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
forcestand =1
kill = 0
p2stateno=3053
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =1
flag = unguardable

[State 210, 2] ;206
type = HitDef
trigger1 = animelem=44
attr = S, HA
animtype  = Medium
damage =20
guardflag = MA
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-60
hitsound   = S2,4
guardsound =  S5, 0
getpower =0
givepower=5
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
ground.velocity = 01
air.velocity = -2.5,-4
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
kill = 0
p2stateno=3053

[State 210, 2];1201
type = HitDef
trigger1 = animelem=50
attr = S, HA
animtype  = Medium
damage =20
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-57
hitsound   = S2,3
guardsound =  S5, 0
ground.type = Low
getpower = 0
givepower=5
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -.65,-12
air.velocity = -.65,-12
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
kill = 0
p2stateno=3054

[State 0, StateTypeSet]
type = StateTypeSet
triggerall = anim = 3000
trigger1 = animelemtime(61)>=0
statetype = A       ;S,A,C,L


[State 0, VelSet]
type = VelSet
trigger1 = animelem=61
y = -11
[State 0, VelSet]
type = Veladd
trigger1 =(animelemtime(61) >=0)
y = .5


[State 0, VelSet]
type = VelSet
trigger1 =  animelem=61
x = 4


[State 1050, 4] ;1051
type = HitDef
trigger1 = animelem = 63
attr = A, HA
animtype  = Medium
damage    =ifelse(var(21)=1,125,85)
priority  = 9
guardflag = MA
pausetime = 18,18
sparkxy = -5,-75
sparkno =S7020+(random%4)
guard.sparkno= S11004
hitsound   = S2,6
guardsound = S5,0
ground.type = Low
getpower = 0
givepower=35
ground.slidetime = 99
ground.hittime  = 99
ground.velocity = -2,-5
guard.velocity = -3
airguard.velocity = -.5,-2
air.velocity = -8,-5
air.hittime = 22
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
envshake.time = ifelse(ceil(enemynear,life <55*fvar(1)),1,25)
envshake.ampl = 7
envshake.freq=126
palfx.time=20
palfx.add = 100,100,180
palfx.mul = 256,256,256
palfx.sinadd = -80,-80,-80,5
fall=1
fall.recover=0


[State 1050, 5]
type = Changeanim
triggerall =anim=3002
triggerall = animelemtime(62)>0
triggerall = anim!=1011
trigger1 = pos y>=-10
value = 1011
[State 0, PosSet]
type = PosSet
trigger1 =anim=1011
y = 0
[State 0, VelSet]
type = VelSet
trigger1 =anim=1011
y = 0
[State 0, PlayerPush]
type = PlayerPush
trigger1 =animelemtime(61)<0
value = 0


[State 0, VelMul]
type = VelMul
trigger1 =anim=1011
x = .85

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 && anim=1011
value = 11
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 3052]
type    = S
movetype= H
physics = S
juggle  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 5010
ignorehitpause = 1
persistent = 1
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time>=5
value = 5010
elem=2
ignorehitpause = 1
persistent = 1


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



[State 1050, 5]
type = selfState
trigger1 = p2stateno!=[3051,3062]
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3053]
type    = S
movetype= H
physics = S
juggle  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 5000
ignorehitpause = 1
persistent = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time>=3
value = 5000
elem=2
ignorehitpause = 1
persistent = 1

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



[State 1050, 5]
type = selfState
trigger1 = p2stateno!=[3051,3062]
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3054]
type    = A
movetype= H
physics = N
juggle  = 0;    0
velset = -.65,-12
ctrl = 0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =  selfanimexist(5061) && time = 0
value = 5061
ignorehitpause = 1
persistent = 1
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =  !selfanimexist(5061) && time = 0
value = 1104
ignorehitpause = 1
persistent = 1
[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .35


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



[State 1050, 5]
type = selfState
trigger1 = pos y >= 0  &&time>20
value = 5100
;---------------------------------------------------------------------------
[Statedef 3060]
type    = S
movetype= A
physics = S
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 1000
sprpriority = 2
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 =time=0
time = 1

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =1
flag = unguardable


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

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

[State 1000, 1]
type = PlaySnd
trigger1 = animelemtime(4)=5 && movehit
value = 200,25

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, SA
animtype  = Hard
damage    = 0, 4
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -18,-70
hitsound = S2,3
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -9,-7
air.velocity = -9,-7
p2stateno=3062
p1stateno=3061
envshake.time = 25
envshake.ampl = 7
envshake.freq=126

[State 1050, 5]
type = changeState
trigger1 = animtime=0
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3061]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3080
sprpriority = 2

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelemtime(15)>100 && anim=3084
id =11009

[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x <265
triggerall = anim=3080
trigger1 = time=0
x =  -3
y = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x >260
triggerall = anim=3080
trigger1 = time=0
x =  3
y = 0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x >75
triggerall = anim=3080
trigger1 = time=0
x =  -3
y = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x <70
triggerall = anim=3080
trigger1 = time=0
x =  3
y = 0

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

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

[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = anim=3080
trigger1 =screenpos x=[70,75]
x = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = anim=3080
trigger1 = screenpos x=[260,265]
x = 0


[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=3080
trigger1 =vel x!=0
value = 3080
[State 200, 1] ;201
type = HitDef
triggerall = anim=3080
trigger1 = animelem=3
attr = S, HA
damage =20
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -18, -65
hitsound = S2, 2
getpower = 0
guardsound = S5, 0
ground.type = low
ground.slidetime = 99
ground.hittime  = 99
air.type = High
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
forcestand =1
kill = 0
p2stateno=3052


[State 210, 2] ;206
type = HitDef
triggerall = anim=3080
trigger1 = animelem=13
attr = S, HA
animtype  = Medium
damage =20
guardflag = MA
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-60
hitsound   = S2,4
guardsound =  S5, 0
getpower =0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
ground.velocity = 01
air.velocity = -2.5,-4
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
kill = 0
p2stateno=3053

[State 210, 2];1201
type = HitDef
triggerall = anim=3080
trigger1 = animelem=19
attr = S, HA
animtype  = Medium
damage =20
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-57
hitsound   = S2,3
guardsound =  S5, 0
ground.type = Low
getpower = 0
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -.65,-12
air.velocity = -.65,-12
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
kill = 0
fall=1
fall.recover=0
yaccel=.45
p2stateno=3065
[State 210, 2];1201
type = HitDef
triggerall = anim=3081
triggerall =p2stateno!=3063
trigger1 = animelem=9
attr = S, HA
animtype  = Medium
damage =20
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-57
hitsound   = S2,3
guardsound =  S5, 0
ground.type = Low
getpower = 0
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -.65,-12
air.velocity = -.65,-12
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
kill = 0
fall=1
fall.recover=0
p2stateno=3063
[State 200, 1] ;201
type = HitDef
triggerall = anim=3084
trigger1 = animelem=15
attr = S, HA
damage =9999
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 6, 6
sparkno = S7020+(random%4)
guard.sparkno= S11004
sparkxy = -18,-70
hitsound = S200, 17
getpower = 0
guardsound = S5, 0
ground.type = low
ground.slidetime = 99
ground.hittime  = 99
air.type = High
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
forcestand =1
kill =0
p2stateno=3064
[State 0, TargetBind]
type = TargetBind
trigger1 =animelem=15 && anim=3084
pos = 103,-62

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=8&&anim=3080
value = 200, 7
channel=0
[State 0, Pause]
type = Pause
triggerall = animelemtime(1)>=0&&anim=3081&&animelemtime(9)<0
trigger1=time%3=0
time = 2
movetime = 2


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime=0&&anim=3080
value = 3081
elem = 1

[State 0, VelSet]
type = VelSet
trigger1 =anim=3081&&animelem=1
x = -1.15
y = -10
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(1)>=0&&anim=3081&&animelemtime(9)<0
y = .45
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9&&anim=3081
x = -70
[State 0, VelSet]
type = VelSet
trigger1 =anim=3081&&(animelemtime(9)=[0,3])
x = 20
y = 0

[State 0, Helper]
type = Helper
trigger1 = animelem=3&&anim=3081
helpertype = normal ;player
name = "Blue Falcon2"
ID =194
stateno =4000
pos = -190,60
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, PosSet]
type = PosSet
triggerall = facing=1
trigger1 = enemy,time= 230
x = -110
y=30
[State 0, PosSet]
type = PosSet
triggerall = facing=-1
trigger1 = enemy,time= 230
x = 110
y=30
[State 0, AngleDraw]
type = AngleDraw
trigger1 =enemy,time>=230
scale =fvar(3),fvar(3)
[State 0, VarSet]
type = VarSet
trigger1 =time=0
fv = 3    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =enemy,time=[230,350]
fv = 3    ;fv = 10
value = .3
[State 0, VarSet]
type = VarSet
trigger1 =enemy,time=[350,420]
fv = 3    ;fv = 10
value =  .3+((enemy,time-350)*.01)
[State 0, VarSet]
type = VarSet
triggerall = p2stateno=3063
trigger1 =enemy,time>=420
fv = 3    ;fv = 10
value =  1
[State 0, AngleDraw]
type = AngleDraw
triggerall = p2stateno=3063
trigger1 =enemy,time>=420
scale =  1,1
[State 0, VelSet]
type = VelSet
triggerall = p2stateno=3063
trigger1 =enemy,time>230
x = .12
y = -3
[State 1000, 1]
type = PlaySnd
triggerall = p2stateno=3063
trigger1 =enemy,time=301
value = 200, 14
channel=0
[State 1000, 1]
type = PlaySnd
triggerall = p2stateno=3063
trigger1 =enemy,time=350
value = 200, 27
channel=0
[State 1000, 1]
type = PlaySnd
triggerall = p2stateno=3063
trigger1 =animelem=15&&enemy,time>200
value = 200, 20
channel=0
[State 1000, 1]
type = PlaySnd
triggerall = p2stateno=3063
trigger1 =animelemtime(15)=1&&enemy,time>200
value = 200, 16

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = enemy,time=300 && anim!=3084
value = 3084

[State 0, PosAdd]
type = PosAdd
trigger1 =enemy,time=303
y =-20
x=-10

[State 0, PosAdd]
type = PosAdd
trigger1 =enemy,time=[350,400]
y =-1.1
x=-.5
[State 0, VelSet]
type = VelSet
trigger1 = enemy,time>240
y = 0


[State 0, Explod]
type = Explod
trigger1 = animelem=13 && anim=3084
anim = 3090
ID =3091
pos = ceil(-24*fvar(3)),ceil(-82*fvar(3))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =fvar(3),fvar(3)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, VelSet]
type = VelSet
trigger1 =animelemtime(13)>0
x = 0
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =animelemtime(13)>=0 && animelemtime(13)<100 && anim=3084
ID = 3091
postype = p1
pos = ceil(-24*fvar(3)),ceil(-82*fvar(3))
scale =1*fvar(3),1*fvar(3)
;ignorehitpause =
persistent =1
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(13)>=100 && animelemtime(15)<0
v = 7 ;fv = 10
value = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =animelemtime(13)>=100 && anim=3084 && animelemtime(15)<0
ID = 3091
postype = p1
pos = ceil(-24*fvar(3)),ceil(-82*fvar(3))
scale =.5-(var(7)*.2),.5-(var(7)*.2)
removetime=32
;ignorehitpause =
persistent =1
;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=2 && anim=3084
anim = 3091
ID =3092
pos = 102,-67
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =1.5,1.5
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, Pause]
type = Pause
triggerall = anim=3084
trigger1 =animelemtime(15)=1
time = 20
[State 0, Pause]
type = Pause
triggerall = anim=3084
triggerall =animelemtime(15)>=1&&animelemtime(15)<60
trigger1=time%3=0
time = 2
[State 0, EnvShake]
type = EnvShake
triggerall = anim=3084
trigger1 = animelemtime(15)=2
time = 40
freq = 126
ampl = 7
phase = 126

[State 1000, 1]
type = PlaySnd
triggerall = anim=3084
trigger1 = animelemtime(15)=2
value = 200, 13
[State 0, AllPalFX]
type = AllPalFX
triggerall = anim=3084
trigger1 =animelemtime(15)=2&&anim=3084
time = 160
add = 0,0,0
mul = 256,256,256
sinadd = 256,256,256,280
invertall = 0
color = 256
ignorehitpause=0

[State 0, AllPalFX]
type = AllPalFX
trigger1 =animelemtime(15)=55&&anim=3084
time = 50
add = 256,256,256
mul = 256,256,256
sinadd = 256,256,256,1
invertall = 0
color = 256
ignorehitpause=0

[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=100 && anim=3084
anim = 8100
ID =8100
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =.5,ifelse(GameHeight=180,.39,.5)
sprpriority = -2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1




[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =animelemtime(15)>=55
flag = invisible
flag2=nobardisplay
ignorehitpause=1
persistent=1
[State -2, Helper]
type = Helper
trigger1 = time=0
triggerall = numhelper(6001)<1
helpertype = normal ;player
name = "CUT THAT SHIT OUT"
ID = 6001
stateno = 6001
pos = 0,0
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =9999
pausemovetime = 9999
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=102 && anim=3084
anim = 3092
ID =3094
pos = 83,-0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=130
scale =1,ifelse(GameHeight=180,.7,1)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(15)>102
v = 7 ;fv = 10
value = 1
[State 0, VarSet]
type = Varset
trigger1 = animelemtime(15)=101
v = 7 ;fv = 10
value = 0
[State 1000, 1]
type = PlaySnd
triggerall = anim=3084
trigger1 = animelemtime(15)=102
value = 200, 10
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =animelemtime(15)>102
ID = 3094
scale = .25+(var(7)*.04),.25+(var(7)*.04)

[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=232 && anim=3084
anim = 8101
ID =8101
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =.5,ifelse(GameHeight=180,.39,.5)
sprpriority = -2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 11009, dust]
type = Explod
trigger1 = time = 0
anim = 4001
ID = 11009
postype =left
pos = 0,-10
bindtime = -1
facing = 1
sprpriority = -2
scale = .5,ifelse(GameHeight=180,.39,.54)
ownpal = 0
ignorehitpause =1
removetime=-1
ontop =0
pausemovetime = 999
supermovetime = 9999
[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=232 && anim=3084
anim = 3093
ID =3092
pos = 160,ifelse(GameHeight=180,90,120)
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =1.5,ifelse(GameHeight=180,1.35,1.5)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, AllPalFX]
type = AllPalFX
triggerall = anim=3084
trigger1 = animelemtime(15)=241 && anim=3084
time = 80
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,280
invertall = 0
color = 256
ignorehitpause=0
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =animelemtime(15)=240
value =-9999
kill = 1
absolute = 0
;ignorehitpause =
;persistent =

[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=232 && anim=3084
anim = 8101
ID =8101
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =.5,ifelse(GameHeight=180,.39,.5)
sprpriority = -2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 =animelemtime(15)=350
ID = 8101
sprpriority = 7


[State 0, Explod]
type = Explod
trigger1 = animelemtime(15)=400 && anim=3084
anim = 8102
ID =8101
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale =.5,ifelse(GameHeight=180,.39,.5)
sprpriority = 8
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 1000, 1]
type = PlaySnd
trigger1 =animelemtime(15)=400 && anim=3084
value = 200, 25
channel=0
[State 0, SelfState]
type = changeState
trigger1 =animelemtime(15)=400 && anim=3084
value = 183

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

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

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 5010
ignorehitpause = 1
persistent = 1
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time>=5
value = 5010
elem=2
ignorehitpause = 1
persistent = 1
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x <160
trigger1 = time=0
x =  -3
y = 0
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x >160
trigger1 = time=0
x =  3
y = 0

[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x >160
trigger1 = time=0
x =  -3
y = 0
 [State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x <160
trigger1 = time=0
x =  3
y = 0


[State 0, VelSet]
type = VelSet
trigger1 = pos x = [-5,5]
x = 0
;---------------------------------------------------------------------------
[Statedef 3063]
type    = S
movetype= H
physics = N
juggle  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 0
[State 0, Pause]
type = Pause
trigger1 =time=0
time =3

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

[State 0, PosSet]
type = PosSet
trigger1 = time = 100
x = 0
y = ifelse(GameHeight=180,-91,-140)
[State 0, VelSet]
type = VelSet
trigger1 =time=100
x = 0
y = 0
[State 1040, Pos]
type = Angleadd
trigger1 = time<100
value = 45

[State 1040, Pos]
type = Angleadd
trigger1 = time=[100,202]
value = 45-((time-100)*.4789)

[State 1040, Pos]
type = Angleset
trigger1 = time>=202
value = 125

[State 1040, Pos]
type = AngleDraw
trigger1 = time<221

[State 0, AngleDraw]
type = AngleDraw
trigger1 =time=[220,240]
scale =  1-((time-220)*.04),1-((time-220)*.04)
;ignorehitpause =
;persistent =
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0


[State 0, AngleDraw]
type = AngleDraw
trigger1 =time=[240,350]
scale =  .3,.3

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

[State 0, VelSet]
type = VelSet
trigger1 =time = 230
x = 0
y = 0

[State 0, VelSet]
type = VelSet
trigger1 =time>231
x = -.008
y = ifelse(GameHeight=180,.04,.18)
;ignorehitpause =
;persistent =

[State 0, AngleDraw]
type = AngleDraw
trigger1 =time=[350,420]
scale =  .3+((time-350)*.01),.3+((time-350)*.01)

[State 0, AngleDraw]
type = AngleDraw
trigger1 =time>=420
scale =  1,1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 3083
ignorehitpause = 1
persistent = 1
;---------------------------------------------------------------------------
[Statedef 3064]
type    = S
movetype= H
physics = S
juggle  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 3083
ignorehitpause = 1
persistent = 1


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =time>40
flag = invisible
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0


[State 0, PosSet]
type = PosSet
trigger1 =p2stateno=183
y = 800

[State 0, SelfState]
type = changeState
trigger1 =p2stateno=183
value =5150
;---------------------------------------------------------------------------
[Statedef 3065]
type    = A
movetype= H
physics = N
juggle  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 0


[State 0, VelSet]
type = VelSet
trigger1 =time=0
y = -12
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .45

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&!animexist(5061)
value = 3053
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&animexist(5061)
value = 5061
[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground

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


;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[statedef -2]
[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, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2= nocrouchguard
flag3 = noairguard
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1025,1030]) && anim=1050  && (p2stateno!=[1051,1052])
value = 1029
ID =800
ignorehitpause=0
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1025,1030]) && anim=1050 && (p2stateno!=[1051,1052])
value = 1051
ID =995
ignorehitpause=0
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[30003,30005]) && numtarget(997)
value = 30003
ID =997
ignorehitpause=0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1000
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1010
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1050
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H ||p2stateno=[202,203]
v = 15    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =var(21)>0 && movehit  && (stateno!=1005&&prevstateno!=[150,155])
v = 19   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =var(21)=0 && movehit && (p2stateno=5080||p2stateno=[5000,5030])
trigger2= p2movetype!=H
trigger3 = numexplod(1000)>1
trigger4 = numexplod(1010)>2
trigger5 = numexplod(1050)>1
v = 19   ;fv = 10
value = 0
ignorehitpause = 1
[State -2, 1]
type = ChangeState
triggerall = prevstateno=[120,155]
triggerall = !alive
triggerall = stateno !=171
triggerall = pos y >=-12
trigger1 = 1
value = 171
[State 0, VarSet]
type = VarSet
trigger1 = var(21)>0 && movehit
v = 23   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 24    ;fv = 10
value =0

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


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

[State 114, VarSet]
type = VarSet
trigger1 = p2movetype!=A&& movetype !=A && var(21)<2; && (p2stateno!=[1025,1048])
trigger2= p2movetype!=H &&var(21)=2 && movetype!=A
v = 21   ;v = 570
value = 0
ignorehitpause=1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =1
text = "fvar(2) = %f  Evar(4) = %d var(30)=%d var(21)=%d evar(21)=%d"
params = (fvar(2)),var(21),(var(31)),(helper(10003),var(37)),(enemy,var(32))
ignorehitpause =1
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 9   ;fv = 10
value = enemy,lifemax/4
;ignorehitpause =
;persistent =
[State 0, PlaySnd]
type = PlaySnd
triggerall = (p2stateno=834||p2stateno=30005)&& p2movetype=H
trigger1 = enemy,time=1
value = S2,5
[State 0, Explod]
type = Explod
triggerall =  enemy,time=1 && p2movetype=H
trigger1=p2stateno=1030 
trigger2=p2stateno=1032 
trigger3=p2stateno=1052
trigger4=p2stateno=834
trigger5=p2stateno=30004
anim = 8302
ID = 8302
pos = 0,5
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.7
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall =  enemy,time=1 && p2movetype=H
trigger1=p2stateno=1030 
trigger2=p2stateno=1032 
trigger3=p2stateno=1052
trigger4=p2stateno=834
trigger5=p2stateno=30004
anim = 8303
ID = 8303
pos = -15,5
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.7
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall =  enemy,time=1 && p2movetype=H
trigger1=p2stateno=1030 
trigger2=p2stateno=1032 
trigger3=p2stateno=1052
trigger4=p2stateno=834
trigger5=p2stateno=30004
anim = 8303
ID = 8303
pos = 15,5
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.7
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, VarRangeSet]
type = VarRangeSet
trigger1 =  p2movetype!=H
value = 0 ;fvalue = 0
first = 12
last = 15 ;39
;ignorehitpause = 
;persistent = 

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


[State 0, PlaySnd]
type = PlaySnd
triggerall = p2movetype=H
triggerall = p2stateno=1047||p2stateno=30004 ||  p2stateno=1030
trigger1 = enemy,time=1
value = S2,2

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


[State -2, Helper]
type = Helper
trigger1 = winko && stateno = 3001
trigger2 = winko && stateno = 3051
triggerall = NumHelper(6000) < 1
helpertype = normal ;player
name = "winko"
ID = 6000
stateno = 6000
pos = 0,0
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1
;persistent = 

;-------buffer
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=74||var(31)=78||var(31)=10)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =12;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=3)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =20;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=21||var(31)=32)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =19;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=25||var(31)=32)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =13;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=44||var(31)=50)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =4;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=30||var(31)=36)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =20 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=32)  &&stateno=52 &&time=1 
v = 32    ;fv = 10
value =7 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=7)  &&stateno=1050  
v = 32    ;fv = 10
value =6 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=29)  &&stateno=1050  
v = 32    ;fv = 10
value =7 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=91)  &&stateno=1050  
v = 32    ;fv = 10
value =15 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=93)   && stateno=50 &&time<3 
v = 32    ;fv = 10
value =7 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=90)   && stateno=50 &&time<3
v = 32    ;fv = 10
value =4 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=94)   && stateno=605 &&movehit=1 
v = 32    ;fv = 10
value =10 ;-wait 34 ticks before proceeding 
ignorehitpause = 1
;persistent = 
[State 0, VarSet]
type = Varadd
trigger1 = var(32)>0
v =32    ;fv = 10
value = -1 ; subtract as soon as its not 0
;----------

;----AI reset grab time

[State 0, VarSet]
type = VarSet
trigger1 =p2stateno=5210 && enemy,time>14
v = 33    ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = p2statetype!=A
trigger2= stateno=[800,855] 
v = 33    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
;--------------------

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
trigger2 = stateno=[800,810]
trigger3 = var(31)=13
trigger4 = var(31)=33
trigger5 = var(31)=32 && power<500 && animelemtime(5) >9
trigger6 = var(31)=52
trigger7 = var(31)=62 
trigger8 = var(31)=83
trigger9 = var(31)=99
v = 31    ;fv = 10
value = 0
ignorehitpause = 1

 [State 30, VarSet]
type = VarSet
triggerall = enemy,hitdefattr != SC,AT
trigger1 = (((p2bodydist x = [0,40])||(p2bodydist x =[110,169]))||p2statetype=L) && var(31)=0
trigger2= enemynear,hitdefattr = SA,NA,SA,HA
trigger3 = statetype = A
trigger4=(p2stateno=[1029,1030])
trigger5=(p2stateno=[1045,1049]) && p2movetype=H
trigger6= p2statetype=S && p2movetype=I
trigger7=(var(31)!=3 && var(31)!=10 &&var(31)!=21 &&var(31)!=25  &&var(31)!=44&&var(31)!=50&&var(31)!=57 &&var(31)!=47&&var(30)!=60&&var(31)!=74&&var(31)!=78&&var(31)!=90&&var(31)!=93&&var(31)!=95) 
trigger8= p2stateno=[1051,1052]
trigger9= var(31)=0 && var(33)=0
v=30
value = 0

[State 30, VarSet]
type = VarSet
triggerall =  (p2movetype=H||p2statetype=A )
triggerall = AILevel>0
triggerall = statetype != A
triggerall = var(2)!=3
triggerall = stateno!=1000&&stateno!=1050&&(stateno!=[200,640])
trigger1 =p2statetype = C && (p2bodydist x = [10,65]) && ctrl&& var(31)=0
trigger2=  movehit&&stateno=1010 && var(2)!=3 && (p2statetype=A)&& var(31)=0
trigger3 = (p2stateno=[833,834]) &&p2movetype=H&& p2bodydist x <90&& ctrl&& var(31)=0
trigger4 = (p2stateno=[1051,1052])&&p2movetype=H  && p2bodydist x <70 && ctrl&& var(31)=0
trigger5 = (p2stateno=[30004,30005])&&p2movetype=H  && p2bodydist x <100 && ctrl&& var(31)=0
trigger6= p2stateno=5040 && ctrl && var(31)=0
trigger7= (var(31)=3|| var(31)=10|| var(31)=21|| var(31)=25||var(31)=44 ||var(31)=50||Var(31)=57 ||var(31)=47||(var(31)=60&&p2statetype=A)||var(31)=74||var(31)=78||var(31)=90||var(31)=93||var(31)=95) && statetype!=A
trigger8 = var(33)=1 && ctrl
trigger9 = p2statetype=L && ctrl && var(31)=0 && p2stateno=5120
trigger10 = enemy,hitdefattr = SC,AT && ctrl 
v = 30    ;fv = 10
value = 1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------



[Statedef -3]
[State 0, PlayerPush]
type = PlayerPush
triggerall = p2statetype!=A

trigger1 = statetype=A&&p2bodydist x =[-45,25] 
value = 0
ignorehitpause=0
[State 0, ChangeState]
type = ChangeState
triggerall = power >=500
triggerall= stateno!=[3000,3051]
triggerall =stateno!=1000&&stateno!=1005
triggerall = AILevel=0
triggerall = stateno!=700
triggerall = stateno!=[830,836]
triggerall = (stateno=810 && animelemtime(5)>=0) || stateno!=810
trigger1 =command="cancel" && movecontact
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
[State 0, ChangeState]
type = ChangeState
triggerall = power >=500
triggerall= stateno!=[3000,3051]
triggerall = AILevel>0
triggerall = stateno!=700
triggerall =stateno!=1000&&stateno!=1005
triggerall= movehit
triggerall = var(2)!=3
trigger1= var(4)>=ifelse(var(21)=2,17,13) && stateno!=1050 && stateno!=1010
trigger2= stateno=1010 && var(2)=1 && random <249 && var(31)=0 && p2statetype!=A
trigger3= statetype=A && stateno=1050   && (p2stateno=[833,834])&& random <349
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
;anim =
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(3)=1 && (stateno!=[800,899])&&stateno!=[3000,3099]
movetype = I        ;I,A,H
[State 0, VarSet]
type = VarSet
trigger1= var(4)>=ifelse(var(21)=2,22,14) 
v = 3    ;fv = 10
value = 1
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
v =4    ;fv = 10
value = 0
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =var(4)=0
v =3   ;fv = 10
value = 0
[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
time = 1
value = fvar(2)
[State 0, VarSet]
type = VarSet
triggerall = fvar(2)<.35
trigger1 =stateno=[3000,3050] 
fv = 2    ;fv = 10
value = .35
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1= movehit=1
triggerall=stateno =200 || stateno=400 || stateno=600 
fv =2 ;fv = 10
value = fvar(2)*.91
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1= movehit=1
triggerall=stateno=405 ||stateno =205 ||stateno=605
fv =2 ;fv = 10
value = fvar(2)*.97
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1 = stateno=210||stateno=410||stateno=610
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.98
ignorehitpause=0


[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1 = stateno=1000
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.93
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1 = stateno=1005
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.945
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1 = stateno=1050
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.91
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  enemy,gethitvar(hitcount)>1
trigger1 = stateno=1010
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.86
ignorehitpause=0



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

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

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


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




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


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


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

;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
