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

; var(0):= -3, 5900, 7001, 9999
; var(1):= 184, 131, 9999
; var(2):= 1021, 1020, 1010, 1011, 1015, 1050, 1100, 1003, 1022, 3010, 9999
; var(3):= -3, 9999
; var(4):= 200, 205, 206, 210, 211, 212, 400, 405, 410, 600, 605, 606, 610, 611, 831, 1020, 1010, 1015, 1050, 3000, 3050, 3051, -3, 4, 5, 1012, 1022, 9999
; var(5):= 800, 830, 9999
; var(6):= -2, 45, 9999
; var(7):= 9999
; var(8):= -2, 55, 59, 9999
; var(9):= -2, 9999
;var(10):= 1000, -2, 9999
;var(11):= 606, 1020, 1010, -2, 1012, 9999
;var(12):= -2, 9999
;var(13):= 1020, 9999
;var(14):= 600, 108, 9999
;var(15):= -2, 9999
;var(16):= -2, 9999
;var(17):= -3, 1001, 9999
;var(18):= 1011
;var(19):= 810, 831, 1020, -2, 9999
;var(20):= 800, 810, 830, 831, 9999
;var(21):= 200, 205, 206, 210, 211, 212, 400, 405, 410, 600, 605, 606, 610, 611, 700, 831, 1000, 1021, 1020, 1010, 1011, 1015, 1050, 1100, -2, 1001, 1002, 1003, 1013, 1022, 3010, 3011, 3012, 3013, 3014, 9999
;var(22):= 1020, 1010, 1015, 3060, 1002, 1003, 1012, 1013, 1022, 3010, 3011
;var(23):= -2
;var(24):= -2
;var(25):= 410, -2, 9999
;var(26):= -2, 40, 45
;var(27):= 1021, 1020, 1010, 1011, 1015, -2, 1012
;var(28):= 3061
;var(30):= -2
;var(31):= 810, 831, 3050, -2, -3, 1003, 1012, 1022, -1
;var(32):= -2
;var(33):= -2
;var(40):= -2
;var(41):= -3
;var(42):= 9999
;var(50):= 4001
;var(53):= 4001
;var(54):= -2, 4001
;var(55):= 5900
;var(56):= -3
;var(58):= 1010, 1012

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

; fvar(2):= 3051, -3, 1002, 1003, 1012, 1013, 1022, 3010, 3011, 3012, 3013, 3014
; fvar(4):= -3, 4004





[Data]
life = 940
attack = 100
power=1000
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 100
IntPersistIndex = 53
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 = 120    ;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, -90   ;Approximate position of head
mid.pos = -5, -65    ;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  = 4.5, 0    ;Run forward (x, y)
run.back = -5.5,-4.2 ;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 = "It was no mistake, you were struck down by a smooth criminal!"
victory2 = "This is no place for you, beat it!"
victory3 = "So eager to fight? Not everything is so black and white."
victory4 = "Perhaps before you place such malice you should look at the man in the mirror!"
victory5 = "My my! Now that was fun! It makes me want to scream! AHAHAHAHAAA!"
victory6 = "You seek death? Let me show you the way to go!"
victory7 = "You will be dead if you keep it up, better take it slow."
victory8 = "Not even one day in your life will you ever be able to defeat me!"
victory9 = "I told you, leave me alone before you get killed......"
victory10="You should just give up your search, I've never met your brother...."
victory11="Rott in hell you scum! Whatever sorcery you used won't work twice!"
victory12="You're an awful clown you know. You're lucky I'm wounded or you wouldn't be alive!"
;---------------------------------------------------------------------------
; 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 = 5950

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


[State 0, StopSnd]
type = StopSnd
trigger1 = time=[0,5]
channel = -1
[State 200, 1]
type = PlaySnd
trigger1 = time = 6
value = 11, 2
channel=0

[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 =5150
;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
triggerall=var(28)!=1
trigger1 = random<499
trigger1 = !matchover
value = 181
[State 180, 1]
type = ChangeState
triggerall=var(28)!=1
trigger1 = random>=499
trigger1 = !matchover
value = 182
[State 180, 1]
type = ChangeState
triggerall=var(28)!=1
trigger1 =  random<499
trigger1 = matchover
value = 183
[State 180, 1]
type = ChangeState
triggerall=var(28)!=1
trigger1 = random>=499
trigger1 = matchover
value = 184
;[State 180, 1]
;type = ChangeState
;triggerall=var(28)!=1
;trigger1 = matchover
;value = 185
[State 180, 1]
type = ChangeState
trigger1=var(28)=1
;trigger1 = matchover
value = 185



;---------------------------------------------------------------------------
; 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 =time=0
value = 200, 50
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=22
value = 200, 51
channel=0

[State 0, Width]
type = Width
trigger1 = 1
edge = 40,40 

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <320
flag = roundnotover


[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, 47
channel=0
[State 0, Width]
type = Width
trigger1 = 1
edge = 40,40 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <240
flag = roundnotover
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0
[State 200, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 49
channel=0
[State 0, Width]
type = Width
trigger1 = 1
edge = 40,40 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <240
flag = roundnotover
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0
[State 200, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 50
channel=0
[State 0, Width]
type = Width
trigger1 = 1
edge = 40,40 
[State -1]
Type = VarRandom
Trigger1 = Time = 0
V = 1
Range = 0,1

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 0
Trigger1 = Time = 0
Value = s200, 50
Channel = 0

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 1
Trigger1 = Time = 0
Value = s200, 59
Channel = 0

[State -1]
Type = ChangeAnim
Trigger1 = Var(1) = 0
Trigger1 = Time >= 165
Trigger2 = Var(1) = 1
Trigger2 = Time >= 75
Value = 185
Elem = 1

[State -1]
Type = AssertSpecial
Trigger1 = Var(1) = 0
Trigger1 = Time <= 220
Trigger2 = Var(1) = 1
Trigger2 = Time <= 125
Flag = RoundNotOver
;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 185]
type = S
ctrl = 0
anim = 186
velset = 0,0
[State 200, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 48
channel=0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic

ignorehitpause =1 
[State -1]
Type = Explod
Trigger1 = AnimElem = 2
ID = 187
PosType = P1
Pos = 0,0
Anim = 187
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 0
Persistent = 0
BindTime = -1
RemoveOnGetHit = 1


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <240
flag = roundnotover
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 186]
type = S
ctrl = 0
anim = 0
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 = nomusic
ignorehitpause =1 
[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 = S
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
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos = ceil(-ifelse(teamside=1,50,-60)*const(size.xscale)),ceil(-190*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=.5
size.yscale=.5
supermovetime=999
pausemovetime=999

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || AnimTime = 0|| AIlevel>0
id =12010

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


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=120
value = 191
[State 200, 1]
type = PlaySnd
trigger1 = time=1
value = 200, 45
channel=0

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0 && anim=191
value = 0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 192]
type = A
physics=N
ctrl = 0
anim = 192
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
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos = ceil(-ifelse(teamside=1,50,-60)*const(size.xscale)),ceil(-190*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=.5
size.yscale=.5
supermovetime=999
pausemovetime=999

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || AnimTime = 0|| AIlevel>0
id =12010
[State 200, 1]
type = PlaySnd
trigger1 = time=1
value = 200, 42
channel=0

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = roundstate=0
value = 193
;elem = 1
;ignorehitpause = 
;persistent = 

 [State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 1    ;fv = 10
value = pos x
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, Helper]
type = Helper
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos = ceil(-ifelse(teamside=1,50,-60)*const(size.xscale)),ceil(-190*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=.5
size.yscale=.5
supermovetime=999
pausemovetime=999

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || AnimTime = 0|| AIlevel>0
id =12010
[State 200, 1]
type = PlaySnd
trigger1 = animelem=5
value = 200, 7
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=9
value = 5000, 0
channel=0

[State 200, 1]
type = PlaySnd
trigger1 = animelem=18
value = 200, 31
channel=0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=9
x = 10
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=10
x =-abs(fvar(1)/12)
y =-10
[State 0, VelMul]
type = VelMul
trigger1 =animelemtime(10)>=0 && animelemtime(17)<0
x =  ifelse(abs(enemy,fvar(1))>70,.87,.9)
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(10)>=0 && animelemtime(17)<0
y = .47
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 01
movecamera = 0,0
ignorehitpause = 1
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=17 
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=17
x = fvar(1)
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=19
value = S999, 0
channel = 3
persistent=0
;abspan =
;ignorehitpause =
;persistent =

[State 0, Explod]
type = Explod
trigger1 = animelem=19
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
persistent=0
[State 0, Explod]
type = Explod
trigger1 = animelem=19
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
persistent=0

[State 0, Helper]
type = Helper
trigger1 = animelem=20 && time >=115
helpertype = normal ;player
name = "LIGHTNING"
ID =193
stateno =1931
pos = 0,0
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
persistent=0
;ignorehitpause = 
;persistent = 

;[State 191, 3] ;Change to stand state when done
;type = ChangeState
;trigger1 = AnimTime = 0 
;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 = animelem=6
value = 200, 22
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)
facep2=1



[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 200, 1]
type = HitDef
trigger1 = AnimElem =3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 15, 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         ;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 = 7             ;Time that the opponent slides back
ground.hittime  = ceil(ifelse(var(21)=1,9,ifelse(var(21)=2,10,9))-(var(27)))           ;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,-2.5           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime =ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,28,14))-var(27))             ;Time before opponent regains control in air
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,28,14))-var(27))
air.fall=1
id=200
yaccel=.47
[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=5
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(11)
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
triggerall = prevstateno!=10003
trigger1 = time>0
y = GetHitVar(yaccel)
[State 5030, 1]
type = VelAdd;Gravity
triggerall = prevstateno=10003
trigger1 = time>0
y =.47
[State 5030, 2]
type = HitVelSet
triggerall = prevstateno!=10003
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 2]
type = VelSet
triggerall = prevstateno=10003
trigger1 = Time = 0
x = -.75
y = -6

[State 5035, 4]
type=selfState
triggerall = time>2
trigger1= Pos Y >= 15
value = 5050 ;HITA_FALL

[State 0, SelfState]
type = SelfState
triggerall = alive
triggerall =canrecover && HitOver  && (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;.
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 0, PosAdd]
type = PosAdd
triggerall= enemy,var(11)
triggerall = alive
triggerall =HitOver && enemy,var(21)=0 && (time>gethitvar(hittime)) &&canrecover
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
y = -const(size.mid.pos.y)-10
[State 0, SelfState]
type = SelfState
triggerall= enemy,var(11)
triggerall = alive
triggerall =HitOver && enemy,var(21)=0 && (time>gethitvar(hittime)) &&canrecover
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210

[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 <35,205,206)
sprpriority =2
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[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, Width]
type = Width
trigger1 = anim=206
value = 29,0
edge=35,0
[State 0, VelSet]
type = VelSet
trigger1 =animelem=1&&anim=205
x = 4.5 
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 25
guardflag = MA
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -10,ifelse(anim=205,-38,-57)
hitsound = S2, 1
guard.sparkno= S7500
getpower=15,7 
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=ifelse(anim=205,14,18)
ground.hittime  = ifelse(anim=205,16,21)+(var(21)=2*4)
ground.velocity = -5.5
guard.velocity=-6
air.velocity = -2.5,-4
p2facing=1
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,50,20))-(var(27)/2))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,50,20))-(var(27)/2))
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 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 206]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 207
sprpriority =2
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[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,7
channel=0
[State 0, VelSet]
type = VelSet
trigger1 =animelem=3
x = 4.5 
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 25
guardflag = HA
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -10,-45
hitsound = S2, 1
guard.sparkno= S7500
getpower=25,7 
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=15
ground.hittime  = 20+((var(21)>=1)*5)
ground.velocity = -3.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
[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 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 <30,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, PosAdd]
type = PosAdd
trigger1 = animelem=2 && anim=211
x = 5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 && anim=211
x = 2
[State 0, VelSet]
type = VelSet
trigger1 =animelem=1&&anim=210 
x = 6 
[State 0, VelSet]
type = VelSet
trigger1 =animelem=1&&anim=211 
x = 4.5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2 && anim=210
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 && anim=210
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4 && anim=210
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5 && anim=210
x = 1
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7&& anim=210
x = 7
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8 && anim=210
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9 && anim=210
x = 23
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10 && anim=210
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=11 && anim=210
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=12 && anim=210
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=13 && anim=210
x =-8
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=14 && anim=210
x =-4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=15 && anim=210
x =-7
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
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, 6
channel=0
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4 && anim=211
attr = S, NA
animtype  = Medium
damage    =40
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,-60
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=30,20 
ground.type = High
p2facing=1
guard.ctrltime=16
ground.slidetime =16
ground.hittime  = 18
ground.velocity = -5.5
guard.velocity=-7
air.velocity = -2.5,-4
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,36,23))-(var(27)/2))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,36,23))-(var(27)/2))
air.fall=1
id=200
yaccel=.47

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4 && anim=210
attr = S, NA
animtype  = Medium
damage    =25
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,-67
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=20,10  
ground.type = High
p2facing=1
guard.ctrltime=13
ground.slidetime =12
ground.hittime  = 17
ground.velocity = -5.5
guard.velocity=-7
air.velocity = -2.5,-4.5
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,36,25))-(var(27)/2))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,36,25))-(var(27)/2))
air.fall=1
id=200
yaccel=.47
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 11 && anim=210
attr = S, NA
animtype  = Medium
damage    =20
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,-77
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=20,10 
ground.type = High
p2facing=1
guard.ctrltime=13
ground.slidetime =18
ground.hittime  = 22
ground.velocity = -5.5
guard.velocity=-7
air.velocity = -2.5,-4.5
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,36,25))-(var(27)/2))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,36,25))-(var(27)/2))
air.fall=1
id=200
yaccel=.47
[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 &&anim=211
trigger2 = animelem=13 &&anim=210
movetype = I  
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 211]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 212
sprpriority =2
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[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,5
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = 18
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = 3
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID =211
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 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 35
guardflag = MA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,-85
hitsound = S2, 2
guard.sparkno= S7500
getpower=20,13 
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=15
ground.hittime  = ceil(ifelse(var(21)=1,25,ifelse(var(21)=2,23,20))-(var(27)))
ground.velocity = -3.5
guard.velocity=-6
air.velocity = -2.5,-4
p2facing=1
air.hittime=ceil(ifelse(var(21)=1,99,16)-(var(27)/3))
fall.recovertime=ceil(ifelse(var(21)=1,99,16)-(var(27)/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=7
movetype = I  
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 212]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 213
sprpriority =2
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[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,3
channel=0

[State 0, Explod]
type = Explod
trigger1=animelem=4
anim = 215
ID = 219
pos = -5,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,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 6
attr = S, NA
animtype  = Medium
damage    = 30
guardflag = LA
pausetime = 6,6
sparkno = S7020+(random%4)
sparkxy = -10,-35
hitsound = S2, 2
guard.sparkno= S7500
getpower=15,7 
guardsound = S6, 0
ground.type = High
ground.slidetime = 17
guard.ctrltime=13
ground.hittime  = 20
ground.velocity = -.75,-6
guard.velocity=-3
air.velocity = -2.5,-4.5
p2facing=1
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,30,18))
fall=1
id=200
yaccel=.55
[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=8
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, 2
channel=0
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 13
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = MA
pausetime = 10,10
sparkno = S7000+(random%4)
sparkxy = -10,-52
hitsound = S2, 0
guardsound = S6, 0
ground.type = Low
getpower=0 
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=4
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,1
channel=0
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 25
animtype  = medium
hitflag = MAF
guardflag = LA
guard.sparkno= S7500
pausetime = 12,12
sparkno = S7010+(random%4)
sparkxy = -10,-8
hitsound = S2, 1
guardsound = S6, 0
getpower=15,7
ground.type = Low
guard.ctrltime=9
ground.slidetime =13
ground.hittime  = ifelse(var(21)=2,17,16)
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=4
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
[State 0, VarSet]
type = VarSet
trigger1 = movehit && fvar(4)=0
v = 25   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
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 0, VelSet]
type = VelSet
trigger1 = animelem=3
x = 6
[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = 0
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 50
animtype  = Medium
hitflag = MAF
guardflag = LA
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -10,-60
guard.sparkno= S7510
hitsound = S2, 2
getpower=20,10  
p2facing=1
guardsound = S6, 0
ground.type = low
guard.ctrltime=16
ground.slidetime =16
ground.hittime  = 16
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,45,35))
ground.velocity = -2,-6
guard.velocity=-5.5
air.velocity = -3,-6
air.fall=1
yaccel=.49
id=200

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1031,1034])
value =ifelse(fvar(4)>0,201,1034)
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=5
movetype = I 

[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, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
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  
guardsound = S6, 0
guard.sparkno= S7500
ground.type = High
ground.slidetime = 5
ground.hittime  = ceil(ifelse(var(21)=1,20,ifelse(var(21)=2,12,10))-(var(27)))
ground.velocity = -4
air.velocity = -1.3,ifelse(p2bodydist y <=-30,-1,-3.5)
air.hittime=ceil(ifelse(var(21)=1,20,ifelse(var(21)=2,12,10))-(var(27)))
fall.recovertime=ceil(ifelse(var(21)=1,20,ifelse(var(21)=2,12,10))-(var(27)))
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 600, 3]
type =ctrlset
trigger1 = Time = 17
value=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, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
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 = 17
guardflag = HA
priority = 3
pausetime = 11,11
sparkno = S7010+(random%4)
sparkxy = -5,-50
hitsound = S2, 1
getpower=15,10  
guardsound = S6, 0
ground.type = High
guard.sparkno= S7500
ground.slidetime = 9
ground.hittime  = 17
ground.velocity = -4
air.velocity = -2,ifelse(p2bodydist y <=-30,-.5,-3.5)
air.hittime=ceil(ifelse(var(21)=1,27,ifelse(var(21)=2,24,17))-(var(27)/2))
fall.recovertime=ceil(ifelse(var(21)=1,27,ifelse(var(21)=2,24,17))-(var(27)/2))
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 600, 3]
type =ctrlset
trigger1 =animtime=0
value =1
;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 606]
type    = A
movetype= A
physics = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 606
sprpriority = 2
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
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 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 5
channel=0
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 1020
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, VarSet]
type = VarSet
trigger1 = numexplod(1020)>=2 && time=0 && var(21)=2 
v = 21   ;fv = 10
value = 1
[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 23
guardflag = HA
priority = 3
pausetime = 11,11
sparkno = S7010+(random%4)
sparkxy = -5,-50
hitsound = S2, 1
getpower=20,10  
guardsound = S6, 0
ground.type = High
guard.sparkno= S7500
ground.slidetime = 9
ground.hittime  = 10
ground.velocity = -4
air.velocity = -2,-6.5
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,35,15))
air.fall=1
id=200
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])&& var(21)=0
value =201
ID =200
ignorehitpause =1 
[State 0, VarSet]
type = VarSet
trigger1 = movehit=1 && p2stateno=[300,305]
v = 11    ;fv = 10
value = 1

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[301,303]) && var(21)>0
value =301
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 =ctrlset
trigger1 =animtime=0
value =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, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = movehit=1 
anim =10000
ID = 610
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 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 4
channel=0
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 40
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -13,-53
hitsound = S2, 2
getpower=20,15 
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = ceil(ifelse(var(21)=1,23,ifelse(var(21)=2,21,19))-(var(27)))
guard.ctrltime=19
ground.velocity = -5
air.velocity = -3,-2.75
air.hittime=ifelse(var(21)=1,34,ifelse(var(21)=2,38-((numexplod(610)>4)*7),38-((numexplod(610))*3)))
fall.recovertime=ifelse(var(21)=1,34,ifelse(var(21)=2,38-((numexplod(610)>4)*7),38-((numexplod(610))*3)))
air.fall=1
id=200
yaccel=.47
[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 611]
type    = A
movetype= A
physics = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 611
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, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID =611
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 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 40
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S7020+(random%4)
sparkxy = -13,-53
hitsound = S2, 2
getpower=30,20  
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = 20
ground.velocity = -5
air.velocity = -5,6.5
fall.recovertime=ifelse(var(21)=1,45,ifelse(var(21)=2,55,36))
air.fall=1
id=210

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=2 && numexplod(611)>0
v = 21   ;v = 570
value = 1
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 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, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200,7
channel=0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = 18
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = 3


[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
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=23
fall.recovertime=23
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, VarSet]
type = VarSet
trigger1 = time=0
v = 20   ;fv = 10
value = 0

[State 800, 1]
type = HitDef
triggerall = p2bodydist x <=38
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=8
value = S200, ifelse(random<499,18,19)
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
[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 = 1
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 = 1
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 = 1
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, 23
channel=0

[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = -2
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 48, 0

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

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(4) < 0
pos = 43,-98
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(7) < 0
pos = -33,-105

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0
pos = -30,-109
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElem=8
pos =53,-51
[State 0, VarSet]
type = VarSet
trigger1 = var(19)=1
v = 31   ;fv = 10
value = 180
;ignorehitpause = 
;persistent = 

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem=8
value = -60
kill = 1


[State 0, TargetState]
type = TargetState
trigger1 = animelem=8
value =1029
ignorehitpause =0
;persistent =

[State 0, Turn]
type = Turn
trigger1 = animelem=4


[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=12&&enemy,var(5)=0
value = 820
elem = 2

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

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = enemy,stateno!=810&& enemy,stateno!=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) && time >10
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,20])&& command="recovery" 
trigger2 = (time=[1,5])&&var(16) = 1&& p1name="Training"
trigger3 =(time=[1,5])&& AILevel >0 && random <100*AILevel && enemy,stateno!= 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 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          ;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 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, 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, VarSet]
type = VarSet
trigger1 = var(19)=1
v = 31   ;fv = 10
value = ifelse(fvar(4)>0,170,31)
;ignorehitpause = 
;persistent = 

[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 = 1
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 = 1
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 = 1
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, 24
channel=0

[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = 2
;ignorehitpause =
;persistent =
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=3
value = -2
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=6
value = 2
[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
edge = 60,0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) < 0
pos = 39,-83
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos = 17,-57
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) < 0
pos =-21,-78
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos =-13,-88
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElem= 6
pos = 58,-28
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem=6
value = -60
kill = 1

[State 0, TargetState]
type = TargetState
trigger1 = animelem=6
value =1031
ignorehitpause =0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = -1.25
y = -4
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
physics = A         ;A,C,S,N
;ignorehitpause = 
;persistent = 

[State 810, State End]
type = ctrlset
trigger1 = animelem=9
value = 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
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =time=9&&enemy,var(5)=1
trigger2=time=13&&enemy,var(5)=0
value = 852
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 = enemy,stateno!=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&&p2stateno=810
x = -5
y = 7
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype!=A&&p2stateno=810
x = -4.5
y = -5
[State 0, HitVelSet]
type = HitVelSet
trigger1 =time=0 &&p2stateno!=810
x = 1
y = 1
[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 && enemy,stateno!= 3050 &&time > 27
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,1005+(var(10)>-1),1000+((var(10)>-1)*4))
ctrl = 0
sprpriority = 1

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
triggerall =( anim=1000|| anim=1007)|| anim=1005
triggerall = var(10)=-1 
trigger1 =  animelemtime(3)<0
v = 10    ;fv = 10
value =ifelse(command="holdback",3,ifelse(command="holddown",2,ifelse(command="holdfwd",1,0)))
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall =( anim=1000|| anim=1007)|| anim=1005
triggerall = var(10)=-1 
triggerall = p2bodydist x <120

triggerall = p2movetype=A || random<499
triggerall = prevstateno!=[405,611]
trigger1 =  time=0
v = 10    ;fv = 10
value= ifelse(enemy,backedgebodydist <30,1,ifelse((enemy,pos x=[-40,40]),2,ifelse((p2bodydist x <40 &&p2statetype=L),3,0)))
ignorehitpause = 1
[State 0, VarSet]
type =VarSet
triggerall = AILevel>0
triggerall =( anim=1000|| anim=1007)|| anim=1005
triggerall = var(10)=-1 
triggerall =(p2stateno=[1031,1034])||p2bodydist x >110 &&p2movetype!=A|| p2bodydist x >90 && statetype=A || p2bodydist x >120 ||prevstateno=211||prevstateno=[410,611]
trigger1 =  time=0
v = 10    ;fv = 10
value= 0
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelem=4 && var(10)=-1
v = 10    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

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

[State 0, VelSet]
type = VelSet
triggerall =(anim=1000||anim=1007)||anim=1004
trigger1 =1
x = 0
y = 0
[State 0, VelSet]
type = VelSet
triggerall =(anim=1005||anim=1008)||anim=1006
trigger1 =animelem=1
x = ifelse(vel x =0,0,vel x/4)
y =ifelse(vel y =0,0,vel y/4)
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(6)<0&&anim=1006
trigger1 = animelemtime(8)<0&&(anim=1005||anim=1008)
triggerall =pos y >-1
y = 0

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


[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 1000, 1]
type = PlaySnd
trigger1 = time=0 && (anim=1000||anim=1007)
value = 200,39
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && (anim=1005||anim=1008)
value = 200, 41
channel=0 




[State 0, ChangeAnim]
type = ChangeAnim
triggerall = fvar(4)=0
trigger1 = time <2 && var(10)=0 && numhelper(1001)=0
value = 1007+statetype=A


[State 0, Helper]
type = Helper
triggerall = numhelper(1001)=0
trigger1 = animelem=6&&(anim=1000||anim=1007)
trigger2 = animelem=5&&(anim=1005||anim=1008)
helpertype = normal ;player
name = "LIGHTNING"
ID =1001
stateno =1001
pos = 0,-15
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0




[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8 && (anim=1005||anim=1008)
trigger2 = animelem=6 && anim=1006
movetype = I        ;I,A,H
physics = A         ;A,C,S,N


[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 && ((anim=1000||anim=1007)||anim=1004)
value = 0
ctrl = 1

;---------------------------------------------------------------------------------------------------
[Statedef 10003]
type    = A
movetype= H
physics = N
juggle  = 8
poweradd= 0
velset=0,0
ctrl = 0
sprpriority = -2
[State 0, VelSet]
type = VelSet
trigger1 =time=20
x = -3
y = -10
;ignorehitpause =
;persistent =
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =selfanimexist(9010)&&selfanimexist(7696)&&time=0
value = ifelse(random<499,9010,7696)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =selfanimexist(9010)&&!selfanimexist(7696)&&time=0
value = 9010
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =!selfanimexist(9010)&&selfanimexist(7696)&&time=0
value = 7696
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1= !selfanimexist(7696)&&!selfanimexist(9010)&&time=0
value = 5030

[State 0, VelAdd]
type = VelAdd
trigger1 = time>20
y = .48

[State 0, PalFXWiz]
type = PalFX
trigger1 = anim!=9010&&anim!=7696&&time%20=0
time = 20
add = 25,-200,40
mul = 150,0,150
sinadd = -75,0,-75,10
invertall = 0
color = 256


[State 0, SelfState]
type = changestate
trigger1 = time=20
value =202


[State 0, SelfState]
type = SelfState
trigger1 = pos y >0 && time>20
value =5100


;---------------------------------------------------------------------------
; Ground Bounce
[Statedef 1029]
type    = A
movetype= H
physics = N
poweradd= 0
ctrl = 0
sprpriority =-1
facep2=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& p2stateno!=810
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=2&& p2stateno!=810
value = 5160

[State 0, VelSet]
type = VelSet
trigger1 = time=0
y=12
x=-ifelse(prevstateno=820,1,6)

;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .55
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0 && p2stateno!=810
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
velset=0,0
sprpriority =-1
[State 0, PosSet]
type = PosSet
trigger1 =time=[0,2]
y = 0
;ignorehitpause =
;persistent =

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

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

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

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

[State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=0 && enemy,fvar(4)<=0
triggerall = alive
trigger1 = time > 24 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 24 
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > 24 
value =5210
[State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=1 || enemy,fvar(4)>=0
triggerall = alive
trigger1 = time > (40-((enemy,numexplod(1021))**2) ) && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > (40-((enemy,numexplod(1021))**3) )
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > (40-((enemy,numexplod(1021))**3) )
value =5210

[State 0, SelfState]
type = SelfState
trigger1 = pos y>0 && time>20
value =5100  
;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1021]
type    = S
movetype= A
physics = N
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
anim = 10020
ctrl = 0
sprpriority =0




 [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
triggerall = var(21)!=2
trigger1 = p2movetype=A && var(2)!=2 && anim=1021
v =21   ;v = 570
value = 1


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

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

[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 27, VarSet]
type = VarSet
trigger1 = var(21)=1+(var(2)=2)
v =27    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[State 20, VarSet]
type = VarSet
trigger1 = var(2)=3 && power <100 && time=1
v = 2    ;fv = 10
value = 2
;ignorehitpause =
;persistent =
[State 1, VarSet]
type = VarSet
triggerall = AILevel>0&&var(31)=0
triggerall=time=0||var(2)=0&&var(31)=0
triggerall = p2bodydist x=[65,105]
trigger1 =  p2statetype=L || random<499 && power<200
v = 2   ;fv = 10
value = 1
[State 2, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0&&(var(31)=0||var(31)=171||var(31)=116)||var(2)=0&&(var(31)=0||var(31)=171||var(31)=116)
triggerall = (random >499&& power<200) &&p2statetype!=L
trigger1 =  (p2movetype!=I)
;trigger2 = time>=2&& var(2)=0 && (var(21)!=0)
v = 2   ;fv = 10
value = 2

[State 3, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=100
triggerall = random<499 || var(31)>0
triggerall=time=0&&(var(31)=0||var(31)=163||var(31)=170)||var(2)=0&&(var(31)=0||var(31)=163||var(31)=170)
trigger1 =  prevstateno=210|| random>=499 && power<500
v = 2   ;fv = 10
value = 3
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = 10020+(var(2)-1)

[State 0, PowerAdd]
type = PowerAdd
triggerall=time=2
trigger1 = var(2)=3
value = -100
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)!=3
value = 200,38
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=3
value = 200, 14
channel=0

[State 0, Helper]
type = Helper
trigger1 = animelem=6
helpertype = normal ;player
name = "LIGHTNING"
ID =1022
stateno =1022
pos = ifelse(frontedgedist >50,125,75),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale=.75

[State 0, Helper]
type = Helper
trigger1 = animelem=12&&anim=10022
helpertype = normal ;player
name = "LIGHTNING"
ID =1022
stateno =1022
pos = ifelse(frontedgedist >50,75,10),0
postype = p1    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale=.75

[State 0, Explod]
type = Explod
triggerall = numhelper(1022)>0
trigger1 = helper(1022),movehit && var(2)!=2
anim =10000
ID = 1021
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 = numhelper(1022)>0
trigger1 = helper(1022),movehit && var(2)=2
anim =10000
ID = 1022
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, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
movetype = I 

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

;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1020]
type    = S
movetype= A
physics = N
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 = 1
persistent=0
ignorehitpause=1

 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1020)>=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)=2
v =21   ;v = 570
value = 2
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2
trigger1 = p2movetype=A && var(2)!=2 && anim=1021
v =21   ;v = 570
value = 1
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 1020
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, VarSet]
type = VarSet
trigger1 = movehit=1 && p2stateno=[300,305]
v = 11    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 


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

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



;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = var(21)=1+(var(2)=2)
v =27    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1



;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = var(31)!=20
triggerall=time=0||var(2)=0
triggerall = p2bodydist x<85 || prevstateno=211 && p2stateno=[120,155]
trigger1 =  (p2movetype!=I || var(31)=7)
trigger2 = p2movetype=A && p2statetype=A
v = 2   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = p2bodydist x>130 && p2statetype=A 
triggerall =var(31)=0
trigger1 =  (p2movetype!=I)
trigger2 = time>=2&& var(2)=0 && (var(21)!=0)
v = 2   ;fv = 10
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=250
triggerall = random<499 || var(31)>0
triggerall=time=0
trigger1 = var(4)=0 && (var(21)=0&&p2movetype=H&&(p2stateno!=[120,155])&&prevstateno=[200,440]) && var(31)=0
trigger2= var(31)=20
v = 2   ;fv = 10
value = 3


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = ifelse(var(2)=2,1021,1023)
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=1
value = 200, 29
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=2
value = 200, 30
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=3
value = 200, 31
channel=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 0, VarSet]
type = VarSet
trigger1 =movehit
v = 13    ;fv = 10
value = 1

[State -1]
Type = Explod
triggerall = anim=1022||anim=1020
Trigger1 = AnimElem = 6
ID = 1024
PosType = P1
Pos = 2,-24
Anim = 1024
Scale = 0.8,0.8
Ownpal = 1
SprPriority = 5
Persistent = 0
BindTime = 10
removeongethit=1
[State -1]
Type = Explod
triggerall = anim=1023
Trigger1 = AnimElem = 14
ID = 1024
PosType = P1
Pos = 2,-24
Anim = 1024
Scale = 1,1
Ownpal = 1
SprPriority = 5
Persistent = 0
BindTime = 10
removeongethit=1

[State 0, Explod]
type = Explod
triggerall = anim=1023
trigger1=animelem=6
anim = 215
ID = 1024
pos = -5,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,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, VelSet]
type = VelSet
triggerall = anim=1023
trigger1=animelem=6
trigger2=animelem=12
x = 8
[State 0, VelSet]
type = VelSet
triggerall = anim=1023
trigger1=animelem=8
trigger2=animelem=14
x = 0
[State 0, VarSet]
type = Varadd
trigger1=var(2)=1
trigger1 = numexplod(1020)>0 && time=0 && var(21)=0
v = 27    ;fv = 10
value = 19
;ignorehitpause = 
persistent = 0

[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1022||anim=1020
triggerall = var(2)=1
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ifelse(var(2)=1,55,80), 5
priority  = 5
guardflag = MA
pausetime = 5,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -10,-57
hitsound = S2, 5
getpower=20,10
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = ifelse(var(2)=2,16,22)
guard.ctrltime=ifelse(var(2)=2,14,18)
ground.velocity = -ifelse(var(2)=2&&var(21)>0,1,8),ifelse(var(2)=2&&var(21)>0,-9,0)
air.velocity = -1.5,-7.5
fall.recovertime=ifelse(var(21)>0,45,ceil(20-(var(27))))
air.hittime=ifelse(var(21)>0,45,ceil(20-(var(27))))
guard.velocity=-8
air.fall=1
yaccel=.48
nochainID = ifelse(var(21)>0,997,998)
id=ifelse(var(21)>0,997,998)
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=ifelse(var(2)=2,17,21)

[State 0, VarSet]
type = VarSet
trigger1=var(2)=1
trigger1 =movehit 
v = 22  ;fv = 10
value =ifelse(var(2)=2,17,21)
ignorehitpause = 1
[State 0, Helper]
type = Helper
triggerall = numhelper(7001)=0
trigger1 = movehit=1
helpertype = normal ;player
name = "Counter I guess"
ID =7001
stateno =7001
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1022||anim=1020
triggerall = var(2)=2
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ifelse(var(2)=1,55,80), 5
priority  = 5
guardflag = M
pausetime = 5,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -10,-57
hitsound = S2, 5
getpower=40,30
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = ifelse(var(2)=2,17,21)
guard.ctrltime=ifelse(var(2)=2,14,18)
ground.velocity = -ifelse(var(2)=2&&var(21)>0,1,8),ifelse(var(2)=2&&var(21)>0,-9,0)
air.velocity = -1.5,-7.5
fall.recovertime=35
guard.velocity=-8
air.fall=1
yaccel=.48
nochainID = 998
id=ifelse(var(21)>0,997,998)
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=ifelse(var(2)=2,17,21)
[State 0, VarSet]
type = VarSet
trigger1=var(2)=2
trigger1 =movehit 
v = 22  ;fv = 10
value =ifelse(var(2)=2,17,21)
ignorehitpause = 1
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1023
trigger1 =animelem=8
attr = S, SA
animtype  = hard
air.animtype= up
damage    =40, 4
priority  = 5
guardflag = MA
getpower= ifelse(var(2)=3,0,55)
pausetime = 5,5
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -10,-37
hitsound = S2, 5
guardsound = S6, 0
getpower=0,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 15
guard.ctrltime=10
ground.velocity = -1.5,-5.5
air.velocity = -1.5,-4.5
fall = 1
fall.recovertime=ifelse(var(21)>0,35,25)
guard.velocity=-7
nochainID = 998
id=998
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=ifelse(var(21)>0,35,25)

[State 0, VarSet]
type = VarSet
trigger1=anim=1023
trigger1 =movehit 
v = 22  ;fv = 10
value =ifelse(var(21)>0,35,25)
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = anim=1023 && numexplod(1020)=1&& movehit
v = 19   ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = anim=1023 && numexplod(1020)>1&& time=1
v = 19   ;fv = 10
value = 0
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = anim=1023
trigger1 =animelem=15
attr = S, SA
animtype  = hard
air.animtype= up
damage    =ceil(40*(1/fvar(2))), 4
priority  = 5
guardflag = MA
getpower= ifelse(var(2)=3,0,55)
pausetime = 5,5
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -10,-57
hitsound = S2, 5
guardsound = S6, 0
getpower=0,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 15
guard.ctrltime=10
ground.velocity = -8,-6.5
air.velocity = -8,-4.5
fall = 1
fall.recovertime=99
guard.velocity=-7
yaccel=.43
nochainID = 999
id=999
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=65
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1025,1029])
value =1025
ID =999
ignorehitpause =0 

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

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[301,303]) && var(21)>0
value =301
ID =997
ignorehitpause =1

[State 0, VarSet]
type = VarSet
triggerall = prevstateno=[200,499]
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=8 && anim=1020
trigger2 = animelem=6 && anim=1021
trigger3 = animelem=7&& anim=1022
trigger4 = animelem=16 && anim=1023
movetype = I 

[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(4)>0 && command="holdz"
value = 0
ignorehitpause=1


[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=1021
triggerall = animelem=5
trigger1 = command!="holdz"
value = 1022
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(1)=1 && anim=1022
x = 0

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = [8,9]
X = 8

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = [10,11]
X = 6

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = [12,13]
X = 5

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = [14,15]
X = 4

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = [16,17]
X = 3

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = [18,19]
X = 2

[State -1]
Type = PosAdd
triggerall = anim=1020
Trigger1 = Time = 20
X = 1

[State -1]
Type = PosAdd
Trigger1 = Anim = 1021
Trigger1 = AnimElem = 3, = [0,1]
X = 5

[State -1]
Type = PosAdd
Trigger1 = Anim = 1021
Trigger1 = AnimElem = 3, = [2,3]
X = 6
[State 0, VelSet]
type = VelSet
trigger1 =animelem=4 && anim=1021
x = 5.5

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6&& anim=1021
physics = S
;ignorehitpause = 
;persistent = 




[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 1, = [0,1]
X = 4

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 2, = [0,1]
X = 2

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 1, = [2,3]
X = 2

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 3, = [0,1]
X = 8

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 4, = [0,1]
X = 6

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 5, = [0,1]
X = 5

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 6, = [0,1]
X = 4

[State -1]
Type = PosAdd
TriggerAll = Anim = 1022
Trigger1 = AnimElem = 6, = 2
Trigger2 = AnimElem = 7
X = 3

[State -1]
Type = PosAdd
Trigger1 = Anim = 1022
Trigger1 = AnimElem = 7, = [1,2]
X = 2

[State -1]
Type = PosAdd
Trigger1 = Anim =1022
Trigger1 = AnimElem = 7, = 3
X = 1




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

;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1010]
type    = S
movetype= A
physics = N
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

[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 = movehit=1 && p2stateno=[300,305]
v = 11    ;fv = 10
value = 1

 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1010)=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 113, VarSet]
type = VarSet
trigger1 = p2movetype=A && var(2)=2
v =21   ;v = 570
value = 2
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2 || numexplod(1010)>2
trigger1 = p2movetype=A && var(2)!=2
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,9
channel=0

;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = var(21)=1+(var(2)=2)
v =27    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
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<110 || var(31)>0||var(2)=0
trigger1 =  ( var(31)>0||p2movetype!=I) ||var(2)=0 && time=1
trigger2=  helper(10003),var(21)=1
v = 2   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&&!helper(10003),var(21)
triggerall=time=0
triggerall =  var(31)=0
trigger1 = p2bodydist x >110||var(2)=0
v = 2   ;fv = 10
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=250
triggerall = p2statetype=S && (p2movetype!=H||p2stateno=[120,155]) 
trigger1=time=0&&var(31)=0
v = 2   ;fv = 10
value = 3

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command = "QCB_y",1,ifelse(command="QCB_z",2,3))
[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 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = ifelse(var(2)=2,1011,1012)
[State -1]
Type = PosAdd
Trigger1 = var(2)=1&&Time = [11,15]
Trigger2 =var(2)=3&& Time = [8,12]
X = 37

[State -1]
Type = PosAdd
Trigger1=anim=1011&&var(2)=2&& Time = [27,31]
X = 43

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = AIlevel=0
trigger1 = var(2)=2 && command="holdz" && animelemtime(10)>=0&&animelemtime(12)<=0&&anim=1011
value = 1019
[State 0, PowerAdd]
type = PowerAdd
triggerall=time=2
trigger1 = var(2)=3
value = -250
[State -1]
Type = Explod
Trigger1 = AnimElem = 2
ID = 1013
PosType = P1
Pos = 0,0
Anim = ifelse(var(2)=3,1018,ifelse(var(2)=2,1014,1013))
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
BindTime = ifelse(var(2)=2,23,11)
RemoveOnGetHit = 1

[State -1]
Type = Explod
Trigger1 = AnimElem = 7 &&(anim=1010||anim=1012)
Trigger2 = AnimElem = 12 &&anim=1011
ID = 1013
PosType = Back
Pos = 127,Ceil(ScreenPos Y)
Anim = 1015
Ownpal = 1
SprPriority = 5
BindTime = -1
IgnoreHitPause = 1
Persistent = 0
RemoveOnGetHit = 1

[State -1]
Type = Explod
Trigger1 = AnimElem = 8&&(anim=1010||anim=1012)
Trigger2 = AnimElem = 13&&anim=1011
ID = 1013
PosType = P1
Pos = 0,0
Anim = 1016
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
BindTime = -1
RemoveOnGetHit = 1

[State -1]
Type = Explod
Trigger1 = (anim=1010||anim=1012)&&AnimElem = 8, = 2
Trigger2 = anim=1011&&AnimElem = 13, = 2 
ID = 1013
PosType = P1
Pos = 0,0
Anim = 1017
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
BindTime = -1
RemoveOnGetHit = 1

[State 0, PlayerPush]
type = PlayerPush
Trigger1 = var(2)=1&&Time = [11,15]
Trigger2 =var(2)=3&& Time = [8,12]
Trigger3=anim=1011&&var(2)=2&& Time = [27,31]
value = 0

;stagger time
[State 0, VarSet]
type = VarSet
trigger1 =movehit=1
v = 58   ;fv = 10
value = ifelse(var(21)>0,27,ifelse(numexplod(1010)<2,ifelse(var(2)=2,13,22),16))
ignorehitpause=1

[State 1010, 6] ;Opponent near
type = HitDef
triggerall = var(2)=1
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 55, 5
priority  = 5
hitflag=MAFD
guardflag = MA
pausetime = 5,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S300, 0
getpower=20,10
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
down.hittime=20
ground.velocity = -0,-3.75
air.velocity = -1.5,5
down.velocity=-3,-12.8
guard.velocity=-5
fall=1
fall.recovertime=ifelse(var(56)<4&&var(25)=0,50,20)
down.hittime=ifelse(var(56)<4&&var(25)=0,50,20)
yaccel=.65
nochainID =ifelse(p2statetype=L,998,202)
id=ifelse(p2statetype=L,998,202)
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=ifelse(var(56)<4&&var(25)=0,50,20)

[State 0, VarSet]
type = VarSet
trigger1=var(2)=1
trigger1 =movehit 
v = 22  ;fv = 10
value =ifelse(var(56)<4&&var(25)=0,50,20)
ignorehitpause = 1
[State 0, Helper]
type = Helper
triggerall = numhelper(7001)=0
trigger1 = movehit=1
helpertype = normal ;player
name = "Counter I guess"
ID =7001
stateno =7001
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = var(2)=2
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ifelse(var(2)=1,55,70), 5
priority  = 5
guardflag = MA
pausetime = 5,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S300, 0
getpower=45,35
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = ifelse(var(2)=2,19,30)
guard.ctrltime=ifelse(var(2)=2,19,30)
ground.velocity = -8,0
air.velocity = -1.5,-7.5
fall.recovertime=35
guard.velocity=-8
air.fall=1
nochainID = 998
id=998
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=20

[State 0, VarSet]
type = VarSet
trigger1=var(2)=2
trigger1 =movehit 
v = 22  ;fv = 10
value =20
ignorehitpause = 1
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = var(2)=3
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ceil(65*(1/fvar(2))), 5
priority  = 5
guardflag = LA
pausetime = 5,8
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound = S300, 0
getpower=0,0
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 15
guard.ctrltime=15
ground.velocity = -0,-5
air.velocity = -1.5,5
guard.velocity=-5
air.fall=1
fall=1
fall.recover=0
yaccel=.65
nochainID =202
id=202
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=17
[State 0, VarSet]
type = VarSet
trigger1=var(2)=3
trigger1 =movehit 
v = 22  ;fv = 10
value =17
ignorehitpause = 1
[State 0, TargetState]
type = TargetState
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])&& var(21)=0&&var(2)!=1
value =201
ID =998
ignorehitpause =1 

[State 0, TargetState]
type = TargetState
trigger1 =movehit=1 && (p2stateno!=[1034,1036]) &&p2statetype!=L
value =1034
ID =202
ignorehitpause =1 
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[301,303]) && var(21)>0
trigger2= p2statetype=L && movehit=1&& (p2stateno!=[301,303]) &&var(2)=1
value =301
ID =998
ignorehitpause =1
 
[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1011]
type    = S
movetype= A
physics = N
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
anim = 10010
ctrl = 0
sprpriority = 2

[State 0, PowerAdd]
type = PowerAdd
triggerall=time=2
trigger1 = var(2)=3
value = -100

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

 [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)=2
v =21   ;v = 570
value = 2
[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2
trigger1 = p2movetype=A && var(2)!=2 && anim=1021
v =21   ;v = 570
value = 1
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 1020
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 && var(2)!=3
value = 200, 37
channel=0

[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=3
value = 200, 16
channel=0

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

[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



;ignorehitpause =
;persistent =

;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1



;ignorehitpause =
;persistent =
[State 1, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = p2bodydist x<80
trigger1 =  (power >=200&&random<249) || ((prevstateno=430||prevstateno=205) || (power<=200 && random<499 ))
trigger2 = time>=2&& var(2)=0 && (var(21)=0||power >=500&&random<249||var(31)>90)
v = 2   ;fv = 10
value = 1
[State 2, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||(var(21)>0|| var(2)=0)
triggerall = p2bodydist x>=80
triggerall = (random=[250,499]) &&power>=200 || (power<=200 && random>=499 ) || var(31)!=0
trigger1 =  (p2movetype!=I)
trigger2 = time>=2
v = 2   ;fv = 10
value = 2

[State 3, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=100
triggerall = random>=499
trigger1=time=0&&var(31)=0
v = 2   ;fv = 10
value = 3
[State 2, VarSet]
type = VarSet
trigger1 = var(2)=3 && power <100 && time=1
v = 2    ;fv = 10
value = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = 10010+(var(2)-1)
[State 0, VarSet]
type = VarSet
trigger1 = var(21)=1+(var(2)=2)
v =27    ;fv = 10
value = 1
[State 0, Helper]
type = Helper
triggerall = var(2)!=3
trigger1 = animelem=3 && var(2)=1
trigger2 = animelem=6 && var(2)=2
helpertype = normal ;player
name = "LIGHTNING"
ID =1012
stateno =1012
pos = 26,-40
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale=ifelse(var(2)=2,1.15,.95)

[State 0, Helper]
type = Helper
triggerall = anim!=[10015,10019]
triggerall = var(2)=3
trigger1 = animelem=6
helpertype = normal ;player
name = "LIGHTNING"
ID =1022
stateno =1013
pos = ifelse(frontedgebodydist <30,0,35),-55
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale=1.15
size.yscale=1.45

[State -1]
Type = Explod
triggerall = var(2)>1
triggerall = anim=10015
Trigger1 = AnimElem = 4
ID = 10017
PosType = P1
Pos = 0,0
Anim = 10016
Ownpal = 1
SprPriority = 5
BindTime = 1
IgnoreHitPause = 1
Persistent = 0
RemoveOnGetHit = 1

[State -1]
Type = Explod
triggerall =  var(2)>1
triggerall = anim=10015
Trigger1 = AnimElem = 7
ID = 10017
PosType = P1
Pos = 0,0
Anim = 1016
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
BindTime = -1
RemoveOnGetHit = 1


[State 0, PosSet]
type = PosSet
triggerall = var(2)=2
triggerall = anim=10015
trigger1 = animelem=7
x = enemy,pos x -15

[State 0, PosSet]
type = PosSet
triggerall = var(2)=3
triggerall = anim=10015
trigger1 = animelem=7
x = enemy,pos x -ifelse(var(18)=1 && enemy,backedgebodydist >30,-50,15)

[State 0, PosSet]
type = PosSet
triggerall = var(2)=3
triggerall = anim=10017
trigger1 = animelem=7
x = ifelse(enemy,backedgebodydist <25,enemy,pos x-55,enemy,pos x)
y = -85
[State 0, PlayerPush]
type = PlayerPush
triggerall = anim=10015||anim=10017
trigger1 = animelemtime(9)<0
value = 0
;ignorehitpause = 
;persistent = 

[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(7)>=0
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 


;elem = 1
[State 0, VarSet]
type = VarSet
triggerall = var(2)=3
triggerall = random <334
triggerall = AIlevel>0
triggerall = anim!=[10015,10019]
triggerall = helper(1022),moveguarded
triggerall = enemy,backedgebodydist <30
trigger1 = numhelper(1022)
v = 18    ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = var(2)=3
triggerall = random <249 ||helper(1022),movehit
triggerall = AIlevel>0
triggerall = anim!=[10015,10019]
triggerall = helper(1022),movecontact
triggerall = enemy,backedgebodydist >30
trigger1 = numhelper(1022)
v = 18   ;fv = 10
value = ifelse(random<129,1,0)
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=[10015,10019]
triggerall = animelemtime(8)>0 && animelemtime(11)<0
triggerall = var(2)=3
triggerall = helper(1022),movecontact
trigger1 =var(18)=[0,1]
value = 10015
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=[10015,10019]
triggerall = animelemtime(8)>0 && animelemtime(11)<0
triggerall = var(2)=3
triggerall = helper(1022),movecontact
trigger1 = var(18)=2
value = 10017
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=[10015,10019]
triggerall = animelemtime(7)>0 && animelemtime(8)<0
triggerall = var(2)=2
triggerall = AIlevel=0
triggerall = helper(1012),movecontact
triggerall = command!="holdup"
trigger1 = command="holdfwd"||command="holddown"
value = 10015
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=[10015,10019]
triggerall = animelemtime(7)>0 && animelemtime(8)<0
triggerall = var(2)=2
triggerall = random<499 || var(31)>0
triggerall = helper(1012),movecontact
trigger1 = AIlevel>0
value = 10015
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(13)>0 && anim=10017
statetype = A       ;S,A,C,L
physics = A         ;A,C,S,N


[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelemtime(18)>0&& anim=10017
value = 1

;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
triggerall = var(2)=3
triggerall = AIlevel=0
triggerall = anim!=[10015,10019]
trigger1 = command="holdup"
v = 18    ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = var(2)=3
triggerall = AIlevel=0
triggerall = anim!=[10015,10019]
trigger1 = command="holddown"
v = 18    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = var(2)=3
triggerall = AIlevel=0
triggerall = anim!=[10015,10019]
trigger1 = command="holdfwd"
v = 18   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
movetype = I 

[State 1010, 8]
type = ChangeState
triggerall = statetype!=A
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1015]
type    = A
movetype= A
physics = A
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
anim = 1030
ctrl = 0
sprpriority = 2

[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(1020)=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
triggerall = var(21)!=2
trigger1 = p2movetype=A 
v =21   ;v = 570
value = 1
[State 0, Explod]
type = Explod
trigger1 =var(21)=2 && movehit=1 && var(2)!=3
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


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

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = p2movetype!=A
trigger1 = var(31)>0 
trigger2 = var(31)=0
v = 2   ;fv = 10
value = ifelse(random<499,1,2)
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power>=250
triggerall=time=0
triggerall =  var(31)=0 || p2life <=55
trigger1 = time=0&& var(2)=0 
v = 2   ;fv = 10
value = 3






[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = ifelse(var(2)=2,1031,1032)

[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)!=3
value = 200,8
channel=0

[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=3
value = 200,15
channel=0
[State 0, PowerAdd]
type = PowerAdd
triggerall=time=2
trigger1 = var(2)=3
value = -250
[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelemtime(6)<0 && var(2)=3
value = SCA
;value2 = S,NA
time = 1
;ignorehit
[State -1]
Type = AttackDist
Trigger1 = 1
Value = 0
Persistent = 1
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = var(21)=1+(var(2)=2)
v =27    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1




[State -1]
Type = Explod
Trigger1 = AnimElem = 4
ID = 1033
PosType = P1
Pos = 8,2
Anim = 1033
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 0
Persistent = 0
BindTime = -1
RemoveOnGetHit = 1


[State 1010, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 300, 3
channel=1
[State -1]
Type = VelSet
Trigger1 = animelemtime(ifelse(var(2)=2,12,8))<0
Y = 0
x=0

[State 1010, 6] ;Opponent near
type = HitDef
triggerall = var(2)!=2
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = ceil(ifelse(var(2)=1,40,(55*(1/fvar(2))))), 5
priority  = 5
guardflag = M
pausetime = 5,5
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound = S300, 0
getpower=25,15
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = ifelse(var(2)=2,14,22)-var(27)
ground.velocity = -2
air.velocity = -1.5,-ifelse(var(2)=3,13,9)
fall.recovertime=ifelse(var(21)>0,ifelse(var(2)=3,85,55),25)
guard.velocity=-8
yaccel=.5
air.fall=1
nochainID = 998
id=998
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=ifelse(var(2)=2,14,27)

[State 0, VarSet]
type = VarSet
trigger1=var(2)!=2
trigger1 =movehit 
v = 22  ;fv = 10
value =ifelse(var(2)=2,14,27)
ignorehitpause = 1
[State 0, Helper]
type = Helper
triggerall = numhelper(7001)=0
trigger1 = movehit=1
helpertype = normal ;player
name = "Counter I guess"
ID =7001
stateno =7001
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 1010, 6] ;Opponent near
type = HitDef
triggerall = var(2)=2
trigger1 = animelem=6
trigger2 = animelem=8
trigger3 = animelem=10
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 25, 5
priority  = 5
guardflag = M
pausetime = 5,7
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound = S300, 0
getpower=0,0
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = ifelse(var(2)=2,19,30)
guard.ctrltime=20
ground.velocity = -1.5,-3
air.velocity = -3.5,-7.5
fall.recovertime=20
guard.velocity=-8
air.fall=1
yaccel=.5
fall=1
id=998
palfx.add = 25,-200,40
palfx.mul = 150,0,150
palfx.sinadd = -75,0,-75,10
palfx.color=256
palfx.time=ifelse(var(2)=2,19,30)
[State 0, VarSet]
type = VarSet
trigger1=var(2)!=2
trigger1 =movehit 
v = 22  ;fv = 10
value =ifelse(var(2)=2,19,30)
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=11&& var(2)=2
trigger2= animelem=7 && var(2)!=2
movetype = I        ;I,A,H
[State 0, CtrlSet]
type = CtrlSet
triggerall =fvar(4)>0
trigger1 = animelem=11&& var(2)=2
trigger2= animelem=7 && var(2)!=2
value = 1
;ignorehitpause = 
;persistent = 

[State 0, PlayerPush]
type = PlayerPush
trigger1 = movetype=A
value = 0

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =998
ignorehitpause =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 && enemy,stateno!= 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

;---------------------------------------------------------------------------
; Trip/fast fall back down
[Statedef 1031]
type    = L
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&& p2stateno=410 || enemy,prevstateno=410
value = 5070
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& anim!=5070 && p2stateno!=831
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = p2stateno!=410 && enemy,prevstateno!=410
trigger1 = time=2&& anim=5030
value = ifelse(selfanimexist(5161),5161,5160)

[State 0, VelSet]
type = VelSet
trigger1 = time=0 && anim=5030
y=15
x=0
[State 0, VelSet]
type = VelSet
trigger1 = time=0 && anim=852
y=10
x=-7
;ignorehitpause = 
;persistent = 
[State 0, HitVelSet]
type = HitVelSet
trigger1 =time=0 && anim=5070 
x = 1
y = 1
;ignorehitpause = 
;persistent =
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = ifelse(anim=5070,.75,.55)

;persistent =

[State 0, SelfState]
type = changeState
triggerall = time >ifelse(anim=5070,5,0)
trigger1 = pos y>=-5
value =1032

;---------------------------------------------------------------------------
; Ground bounce up
[Statedef 1032]
type    =L
movetype= H
physics = N
poweradd= 0
velset=0,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  && selfanimexist(5101)
value = 5101
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0  && !selfanimexist(5101)
value = 5100

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 && (anim!=[5110,5111])&& !selfanimexist(5111)
value = 5110
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =  animtime=0 && (anim!=[5110,5111])&& selfanimexist(5111)
value = 5111
[State 0, EnvShake]
type = EnvShake
trigger1 =time=0 
time = 5
freq = 60
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 


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

[State 0, SelfState]
type = SelfState
trigger1 = pos y>=0 && time>40
value =ifelse(!alive, 5110,5120)
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1033]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1




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




 ;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 = 1031

;------------------
; 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    =S
movetype= A
physics = N
juggle  = 0;    5
poweradd=0
velset = 0,0
anim = ifelse(statetype=A,1060,1050)
ctrl = 0
sprpriority = 2




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


[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)>=1 && 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, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>=1
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

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



;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = p2bodydist x<60
triggerall =  var(31)=0
triggerall = p2stateno!=5201
trigger1 =  (power >=500&&random<249||var(21)=0) && ((prevstateno=210||prevstateno=410||prevstateno=430||prevstateno=205)||p2movetype=I)
trigger2 = time>=2&& var(2)=0 && (var(21)=0||power >=500&&random<249||var(31)>90)
trigger3 =  (p2movetype!=I) 
v = 2   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
triggerall =  var(31)>0
triggerall = (power<=500 ) || var(31)!=0
trigger1 =  p2statetype=A &&p2movetype=A|| p2stateno=5201 && enemy,time>13
trigger2 = time>=2&& var(2)=0 
v = 2   ;fv = 10
value = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=250
triggerall = random<499
triggerall = p2stateno!=5201 || enemy,time >13
triggerall=time=0&&var(31)=0
trigger1 = var(4)=0 && (var(21)=0&&(p2movetype=H||p2statetype=A)&&(p2stateno!=[120,155])&&prevstateno=[200,440])
trigger2 = p2movetype=A
v = 2   ;fv = 10
value = 3

[State 0, VarSet]
type = VarSet
trigger1 = var(2)=3 && power <250 && time=1
v = 2    ;fv = 10
value = 2

[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 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)!=3
value = 200, 11
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=3
value = 200, 12
channel=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 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>1 && time=0
value = ifelse(var(2)=2,1051,ifelse(fvar(4)>0,1055,1052))

[State 0, PowerAdd]
type = PowerAdd
triggerall=anim=1052 && animelemtime(1)=1
trigger1 = var(2)=3
value = -ifelse(fvar(4)>0,100,250)

[State -1]
Type = PlaySnd
Trigger1 = AnimElem = 3 
Trigger2 = AnimElem = 4&& anim=1051
Trigger3 = AnimElem = 5
Trigger4 = AnimElem = 6&& anim=1051
Trigger5 = AnimElem = 7&& anim=1051
Trigger6 = AnimElem = 8&& anim=1051
Value = s300, 3
Channel = 1
IgnoreHitPause = 1

[State -1]
Type = Explod
Trigger1 = time=0
ID = 1051
PosType = P1
Pos = -8,0
Anim = ifelse(Var(2)=2,1054,1053)
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 0
Persistent = 0
BindTime = -1
RemoveOnGetHit = 1


[State -1]
Type = VelSet
Trigger1 = AnimElem = 3
X = ifelse(var(2)=1,3.5,ifelse((var(2)=2||fvar(4)>0),5.5,4.25))
y=-ifelse(var(2)=1,8.5,ifelse((var(2)=2||fvar(4)>0),10.5,9.5))

[State -1]
Type = VelSet
triggerall = fvar(4)=0
Trigger1 = AnimElem = 8
X = ifelse(var(2)=3,.75,2)
[State -1]
Type = VelSet
triggerall = fvar(4)>0
Trigger1 = AnimElem = 11
X = ifelse(var(2)=3,.75,2)
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time<=4 && var(2)!=2
value = SCA
;value2 = S,NA
time = 1



[State -1]
Type = StateTypeSet
Trigger1 = AnimElem = 3
StateType = A
IgnoreHitPause = 1

[State 0, VelAdd]
type =gravity
trigger1 = animelemtime(3)>0


[State 1050, 4]
type = HitDef
trigger1 = animelem=3
trigger2= animelem=5 && (anim=1051||anim=1055)
trigger3= animelem=7 && (anim=1051||anim=1055)
trigger4 = animelem=4&& anim=1052
attr = A, SA
animtype  = Medium
damage    =20, 5
priority  = 5
guardflag = MA
pausetime = 6,6
guard.sparkno= S7510
sparkno = S7020+(random%4)
getpower=ifelse(var(2)=3,0,8),ifelse(var(2)=3,0,5) 
sparkxy = -10,-55
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -1,-5.5
air.velocity = -1,-3.5
airguard.velocity=-1.25,-6
fall = 1
nochainid=202
fall.recover=0
guard.velocity=-4
nochainID = 999
yaccel=.47
id=201
p2facing = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = var(2)>2 && p2statetype=A
flag = unguardable


[State 1050, 4]
type = HitDef
trigger1 = animelem=5&& (anim=1050||anim=1052)
trigger2 = animelem=8&& (anim=1051||anim=1055)
attr = A, SA
animtype  = Medium
damage    = ifelse(var(2)=3,10,35)+((fvar(4)>0)*15), 5
priority  = 5
guardflag = MA
pausetime = 10,10
guard.sparkno= S7510
sparkno = S7020+(random%4)
getpower=ifelse(var(2)=3,0,8),ifelse(var(2)=3,0,5) 
sparkxy = -10,-55
hitsound = S300, 0
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
nochainid=202
ground.velocity = -3.5,-9.5
air.velocity = -ifelse(var(2)=3,.5,3.5),-ifelse(var(2)=3&&fvar(4)=0,7.5,ifelse(fvar(4)>0,6.5,9.5))
airguard.velocity=-1.5,-4
fall = 1
fall.recovertime=ifelse((numexplod(1050)=1&&var(21)=2||fvar(4)>0),60,35)
guard.velocity=-4
yaccel=.47
id=201
p2facing = 1
[State 0, TargetState]
type = TargetState
triggerall = movetype=A
trigger1 = movehit && (p2stateno!=[1025,1030]) && (p2stateno!=[201,204])
value =201
ID =201
ignorehitpause=1


[State 1050, 4]
type = HitDef
trigger1 = animelem=12&& anim=1052
trigger2 = animelem=17&& anim=1055
attr = A, SA
animtype  = Medium
damage    = ceil(40*(1/fvar(2))), 5
priority  = 5
guardflag = MA
pausetime = 10,10
guard.sparkno= S7510
sparkno = S7020+(random%4)
getpower=0
sparkxy = -10,-55
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3.5,-3.5
air.velocity = -3.5,8.5
airguard.velocity=-3.5,-45
fall = 1
fall.recovertime=35
guard.velocity=-4
yaccel=.47
nochainid=202
id=ifelse(p2statetype!=A,201,202)
p2facing = 1
[State 0, TargetState]
type = TargetState
triggerall = movetype=A
trigger1 = movehit && (p2stateno!=[1025,1055]) && (p2stateno!=[201,204])
value =ifelse(fvar(4)>0,1033,1051)
ID =202
ignorehitpause=0
;persistent =
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6 && anim=1050
trigger2 = animelem=9 && anim=1051
trigger3 = animelem=13 && anim=1052
movetype = I        ;I,A,H
;ignorehitpause = 
;persistent = 


[State 1010, 8]
type = ChangeState
trigger1 = pos y>=0 && vel y>0
value = 52
ctrl = 0

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1051]
type    = A
movetype= H
physics = N
[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, HitVelSet]
type = HitVelSet
trigger1 = time=0
x = 1
y = 1
;ignorehitpause = 
;persistent =

[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)
;---------------------------------------------------------------------------
; Kung Fu Palm
[Statedef 1100]
type    = S
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim = ifelse(fvar(4)>0,1110,1100)
ctrl = 0
sprpriority = 1

[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command="DD_x",2,ifelse(command = "DD_y",1,ifelse(command="DD_z",0,3)))
[State 1000, 1]
type = PlaySnd
trigger1 = Time = 8
value = 0, 3
[State 1000, 1]
type = PlaySnd
triggerall=random<333
trigger1 = time=0 && fvar(4)=0
value = 200, 32
channel=0
[State 1000, 1]
type = PlaySnd
triggerall=random=[334,666]
trigger1 = time=0 && fvar(4)=0
value = 200, 33
channel=0
[State 1000, 1]
type = PlaySnd
triggerall = random>666
trigger1 = time=0 && fvar(4)=0
value = 200, 34
channel=0

[State 1000, 1]
type = PlaySnd
triggerall=random<499
trigger1 = time=0 && fvar(4)>0
value = 200, ifelse(random<499,40,35)
channel=0


[State 0, PowerAdd]
type = PowerAdd
triggerall=time=1
triggerall = fvar(4)=0
trigger1 = var(2)=3
value = -250
[State 0, Helper]
type = Helper
triggerall = var(2)=3
triggerall = fvar(4)=0
trigger1 = time=1
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 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






;ignorehitpause =
;persistent =

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
trigger1 =  var(31)>0 || p2statetype=A || prevstateno=210 || var(2)=[1,2]
trigger2 = time=0&&fvar(4)>0 && p2bodydist x =[90,125]
v = 2   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = var(2)=3 && power <250 && time=0&&fvar(4)=0 && anim!=1100
v = 2    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& var(31)=0 
triggerall = helper(10003),var(9)=0
triggerall = power >=250 || fvar(4)>0|| anim=1101
triggerall = random<499|| anim=1101
triggerall=time=0&&(var(31)=0&&fvar(4)=0 || anim=1101||fvar(4)>0)
trigger1 = (p2stateno=5120 && p2bodydist x >120|| anim=1101)&&fvar(4)=0
trigger2= (p2bodydist x >130|| anim=1101)&&fvar(4)=0
trigger3 = time=0&&fvar(4)>0 && p2bodydist x =[215,255]
v = 2   ;fv = 10
value = 3
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = fvar(4)=0
trigger1 = var(2)=3 && time=0
value = 1101
[State 0, Helper]
type = Helper
trigger1 = animelem=6&&(anim=1100||fvar(4)>0)
trigger2 = animelem=9&&anim=1101
helpertype = normal ;player
name = "LIGHTNING"
ID =1003
stateno =1003
pos = ifelse(fvar(4)=0,0,ifelse(var(2)=3,270,140)),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7 &&(anim=1100||fvar(4)>0)
trigger2 = animelem=10 && anim=1101
movetype = I        ;I,A,H


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

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

[State 0, HitBy]
type =notHitBy
trigger1 =time=0
value = SCA
;value2 = S,NA
time = 45
[State remove, *]
type = RemoveExplod
trigger1 = time = 0
id = 1024
[State remove, *]
type = RemoveExplod
trigger1 = time = 0
id = 1013
;ignorehitpause = 
;persistent = 
[State remove, *]
type = RemoveExplod
trigger1 = time = 0
id = 1024
[State remove, *]
type = RemoveExplod
trigger1 = time = 0
id = 1033
[State remove, *]
type = RemoveExplod
trigger1 = time = 0
id = 1051
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

[State 182, 2]
type = NotHitBy
trigger1 = Time = 35
value = SCA
time = 4


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

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

;-------------------------------------------------
[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=35

[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 = 0
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(2) >= 1
time = 2




[State 0, Helper]
type = Helper
trigger1 = animelem=4
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3010
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0


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

;---------------------------------------------------------------------------
[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((200+(ifelse(var(21)>0,65,0)))*ifelse(fvar(2)<=.5,.5,ifelse((var(56)<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 = 1
supermove =999
pausemove = 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 = 1
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 = enemy,stateno!=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

;---------------------------------------------------------------------------
[Statedef 3050]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=2
anim = 3050
sprpriority = 1

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

[State 182, 2]
type = NotHitBy
trigger1 = Time = 8
value = SCA
time = 8

[State 0, HitBy]
type = HitBy
trigger1 =anim=3050 && time >=5
value = SCA,HP,SA,SP
;value2 = S,NA
time = 1
[State 0, HitBy]
type =notHitBy
trigger1 =anim=3050 && time <5
value = SCA
;value2 = S,NA
time = 1


[State 200, 1]
type = PlaySnd
trigger1 = animelem=2&&anim=3050
value = 200, 27
channel=0

;-------------------------------------------------
[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=45

[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 = 0
time = 20
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, Explod]
type = Explod
trigger1 = animelem=3
anim = 3051
ID =3051
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
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem=3
anim = 3052
ID =3051
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
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = -2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, VarSet]
type = VarSet
trigger1 = var(31)>0
v = 31    ;fv = 10
value = 160
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 = time=44
helpertype = normal ;player
name = "HUAAAAAAAAAAAAAARG"
ID = 4004
stateno = 4004
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 99
pausemovetime =99


[State 1050, 5]
type = ChangeState
trigger1 =animtime = 0 
value = 0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 3051]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3010
sprpriority = 4

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

[State 182, 2]
type = NotHitBy
trigger1 = Time = 8
value = SCA
time = 8

[State 0, HitBy]
type =notHitBy
trigger1 =anim=3050 && time <5
value = SCA
;value2 = S,NA
time = 1


[State 200, 1]
type = PlaySnd
trigger1 = animelem=2
value = 200, 25
channel=0
;-------------------------------------------------
[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=45


[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
removetime=50
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 = 3,-35
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 = AnimElemTime(51) >= 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


;ignorehitpause = 
;persistent = 
[State 0, Helper]
type = Helper
trigger1 = movehit=1
triggerall = var(21)>0
triggerall = p2movetype=H
triggerall= numhelper(199)=0
helpertype = normal ;player
name = "Counter I guess"
ID =199
stateno =199
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(51) >= 1
time = 2



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


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



[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(63) = 0
;pos = 15,-7

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

[State 0, BGPalFX]
type = BGPalFX
trigger1 = time>49 &&animelemtime(50)<0
time = 1
add = -256,-256,-256
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 256
ignorehitpause =1 
;persistent = 

[State 0, PalFX]
type = PalFX
trigger1 = time>49&&animelemtime(50)<0
time = 1
add = -256,-256,-256
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 256
ignorehitpause =1 
persistent =1 

[State 0, BGPalFX]
type = BGPalFX
trigger1 = animelem=50
time = 30
add = -256,-256,-256
mul = 256,256,256
sinadd = 256,256,256,95
invertall = 0
color = 256
ignorehitpause =1 

[State 0, PosSet]
type = PosSet
trigger1 = animelem=38
x = enemy,pos x

[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(19)>=0 &&animelemtime(79)<0
value =0
;ignorehitpause = 
;persistent = 
[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(79)>=0
value =1


[State 200, 1]
type = PlaySnd
trigger1 = animelem =62
value = 200, 26
channel=0

[State 200, 1]
type = PlaySnd
triggerall = anim=3002
trigger1 = animelem = 27
trigger2 = animelem = 29
trigger3 = animelem = 31
trigger4 = animelem = 33
trigger5 = animelem = 35
trigger6 = animelem = 37
value = 300, 1


[State 200, 1] ;201
type = HitDef
trigger1 = animelem = 27
trigger2 = animelem = 31
trigger3 = animelem = 35
attr = S, HA
damage = ceil(30*(1/fvar(2)))
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 2, 9
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -15+(random%35), -60-(random%40)
hitsound = S2, 6
getpower = 0
guardsound = S6, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
air.hittime=99
ground.velocity=0,-3
air.velocity=0,-7
air.type = High
air.animtype=up
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
kill = 0
fall=1
fall.recover=0
p2facing=1
[State 200, 1] ;201
type = HitDef
trigger1 = animelem = 29
trigger2 = animelem = 33
trigger3 = animelem = 37
attr = S, HA
damage = ceil(30*(1/fvar(2)))
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 2, 9
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -15+(random%35), -60-(random%60)
hitsound = S2, 6
getpower = 0
guardsound = S6, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
guard.ctrltime =8
air.hittime=99
air.type = High
air.animtype=up
ground.velocity=0,-3
air.velocity=0,-7
yaccel=.5
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
fall.recover=0
kill = 0
p2facing=-1

[State -1]
Type = AttackDist
Trigger1 = animelemtime(37)<0
Value = 320
Persistent = 1;S,A,C,L

[State 0, Pause]
type = Pause
triggerall = p2stateno!=[120,155]
trigger1 = time%4=0
triggerall = animelemtime(38)>=0 && animelemtime(64)<0
time = 3
movetime = 3
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=64
value = S200,10
channel = 4
[State 0, Helper]
type = Helper
trigger1 = animelem=64
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3012
pos = -45,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0

[State 0, Helper]
type = Helper
trigger1=animelem=66
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3012
pos = -20,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1=animelem=68
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3012
pos = 20,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[State 0, Helper]
type = Helper
trigger1=animelem=70
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3012
pos = 45,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, Helper]; sprpriority=0
type = Helper
trigger1=animelem=72
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3014
pos =20,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, Helper] ; sprpriority=0
type = Helper
trigger1=animelem=74 
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3014
pos =-20,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0

[State 0, Helper] ; sprpriority=0
type = Helper
trigger1=animelem=76
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3014
pos = 20,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1

[State 0, Helper] ; sprpriority=0
type = Helper
trigger1 = animelem=78
helpertype = normal ;player
name = "LIGHTNING"
ID =3010
stateno =3013
pos = -45,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
[State 1050, 5]
type = ChangeState
trigger1 =animtime = 0 
trigger2 = animelemtime(61)>0 && (p2statetype!=A||p2movetype!=H || p2stateno=[120,155])
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 3060]
type    = S
movetype= A
physics = S
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3060
sprpriority = 2
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 =time=0
time = 1
[State 0, NotHitBy]
type = HitBy
trigger1 = animelem=4
value = SCA,AA
;value2 = S,NA
time = 18
;ignorehitpause = 
;persistent = 

;-------------------------------------------------
[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 = 1
supermovetime =9999
pausemovetime = 9999
size.yscale=ifelse(GameHeight=180,.7,1)
ignorehitpause = 1



[State 1000, 1]
type = PlaySnd
trigger1 = Time = 0
value = 200, 58
channel=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=6
value = S200,10
channel = 4


[State 0, Explod]
type = Explod
trigger1 = animelem=5
anim = 10013
ID =10013
pos =  26,-40
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.6,1.2
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 1000, 5] ;Opponent near
type = HitDef
triggerall = (p2stateno!=[40,50]) ||(enemy,vel y >0) 
trigger1 = animelem=6
attr = S, SA
animtype  = Hard
damage    = 0, 4
priority  = 5
guardflag = MA
hitflag=MAFD
pausetime = 5,15
guard.pausetime=5,5
sparkno = S7020+(random%4)
guard.sparkno= S7510
sparkxy = -18,-70
hitsound = S300,0
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -9,-7
air.velocity = -9,-7
p2stateno=3062
envshake.time = 25
envshake.ampl = 7
envshake.freq=126
id=3062
[State 0, BGPalFX]
type = BGPalFX
trigger1 = p2stateno=3062
time = 80
add = 0,0,0
mul = 256,256,256
sinadd = -256,-256,-256,240
invertall = 0
color = 256
ignorehitpause =1 
persistent = 0
[State 0, PosSet]
type = PosSet
trigger1 = p2stateno=3062
x = -80*facing
y = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =p2stateno=3062
v = 22  ;fv = 10
value =220
ignorehitpause = 1
[State 0, Helper]
type = Helper
triggerall = numhelper(7005)=0
trigger1 = p2stateno=3062
helpertype = normal ;player
name = "Counter I guess"
ID =7005
stateno =7001
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = p2stateno=3062
value = S300,5
channel = 3
persistent=0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = p2stateno=3062
flag = nomusic


[State 1050, 5]
type = changeState
trigger1 = animtime=0
value = ifelse(p2stateno=3062,3061,0)
ctrl =ifelse(p2stateno=3062,0,1)
;---------------------------------------------------------------------------
[Statedef 3061]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3061
sprpriority = 3

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

ignorehitpause =1 
;persistent = 


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time<1100
flag = nobardisplay
flag2= nobg
flag3=nofg
ignorehitpause =1 

[State 0, AllPalFX]
type = AllPalFX
trigger1 =time=1085
time = 50
add = 256,256,256
mul = 256,256,256
sinadd = -256,-256,-256,250
;invertall = 0
color = 256
;ignorehitpause = 
;persistent = 

;----sound
[State 1000, 1]
type = PlaySnd
trigger1 = Time = 0
value = 200, 53
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = time=0
value = S200, 28
channel=4
[State 1000, 1]
type = PlaySnd
trigger1 = animelemtime(1)=1 && anim=3062
value = 200, 54
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=450 && anim=3063
value = 200, 44
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = animelemtime(1)=1 && anim=3064
value = 200, 55
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = animelemtime(1)=1 && anim=3065
value = 200, 57
channel=0
;----------
;----anims
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time >220 && anim=3061
value = 3062

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time >420 && anim=3062
value = 3063
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time >620 && anim=3063
value = 3064

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time >910 && anim=3064
value = 3065

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time >1100 && anim=3065
value = 3066
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y>=0&& anim=3066
value = 3067
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time=480
value = S200,13
channel = 4

;-------------
;----vels
[State 0, VelSet]
type = VelSet
trigger1 = time=428
y = -9.6

[State 0, VelSet]
type = VelSet
trigger1 = time= 520
y = -.35

;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 = anim=3066
y = .53
[State 0, VelSet]
type = VelSet
trigger1 = anim=3067 || time=465  || anim=3064
x = 0
y = 0
;ignorehitpause = 
;persistent = 

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

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1;anim=3063 && time <465 || anim=3067||anim=3064 || anim=3065|| anim=3066
value = 0
movecamera = 0,0
ignorehitpause = 1
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = anim=3063 && time <425
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim=3063 && time >520
x = -1.5*((time-520)*.012)
[State 0, VelSet]
type = VelSet
trigger1 = anim=3064
x = 0
;----------
;---pos
[State 0, PosSet]
type = PosSet
trigger1 = time=0
x = -70*facing
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=465 
x = -105*facing
y = -45
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = time=620 
x = -127*facing
y = -28

[State 0, PosSet]
type = PosSet
trigger1 = time=620 
x = -127*facing
y = -28
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =time=[1045,1100] 
flag= invisible


[State 0, PosSet]
type = Posadd
trigger1 = time=1100
y = -400
[State 0, PosSet]
type = Posset
trigger1 = time=1100
x = 0


;-------
;-----sizing

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time=[520,580]
value = 1
scale = ifelse(GameHeight=180,.75,1)-((time-520)*ifelse(GameHeight=180,.00675,.009)),ifelse(GameHeight=180,.75,1)-((time-520)*ifelse(GameHeight=180,.00675,.009))
;ignorehitpause = 
;persistent = 
[State 0, AngleDraw]
type = AngleDraw
trigger1 = time=[580,620]
value = 1
scale = ifelse(GameHeight=180,.225,.3),ifelse(GameHeight=180,.225,.3)


[State 0, AngleDraw]
type = AngleDraw
trigger1 = time>=620 && anim!=[3066,3067]
value = 1
scale =ifelse(GameHeight=180,.75,1),ifelse(GameHeight=180,.75,1)
;----------
;---explodes
[State 0, Explod]
type = Explod
trigger1 =time =621 
anim = 3100
ID =3100
pos =  -48,-ifelse(GameHeight=180,41,54)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=-1
supermovetime=99
pausemovetime=99
scale = ifelse(GameHeight=180,.57,.76),ifelse(GameHeight=180,.525,.7)
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time=1045
id = 3100
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =time =15
anim = 3087
ID =3087
pos =  -55,-14
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 = 1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 =time =1050
anim = 3099
ID =3099
pos =  -0,-0
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = .5,.5
sprpriority = 6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time =220 
anim = 3088
ID =3088
pos =  0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=-1
supermovetime=99
pausemovetime=99
scale = 1,1
sprpriority = 4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim=3063
id = 3088

[State 0, Explod]
type = Explod
trigger1 =time =220
anim = 3084
ID =3095
pos =  75,20
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime=-1
supermovetime=99
pausemovetime=99
scale = 1.65,2
sprpriority = 4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time=1075
id = 3095
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[520,580]
ID =3095
scale =1.65-((time-520)*.014),2
ignorehitpause=1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=580
ID =3095
scale =.495,2
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0

[State 0, Explod]
type = Explod
trigger1 =time =1060
anim = 3101
ID =3101
pos =  160,ifelse(GameHeight=180,180,240)
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 = .5,ifelse(GameHeight=180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time =1035
anim = 3102
ID =3101
pos =  160,ifelse(GameHeight=180,180,240)
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
;----------
;----helpers
[State 0, Helper]
type = Helper
trigger1 = time =215
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3063
pos = 50,-45
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)
;--reverse spin
[State 0, Helper]
type = Helper
trigger1 = time =215
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3064
pos = 50,-45
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)
[State 0, Helper]
type = Helper
trigger1 = time =220
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3066
pos = 50,-ifelse(GameHeight=180,128,170)
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =1
size.yscale=ifelse(GameHeight=180,.75,1)
;--regular spin
[State 0, Helper]
type = Helper
trigger1 = time =220
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3065
pos = 50,-ifelse(GameHeight=180,128,170)
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)


[State 0, Helper]
type = Helper
trigger1 = time =225
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3067
pos = 240,-ifelse(GameHeight=180,128,170)
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)
[State 0, Helper]
type = Helper
trigger1 = time =230
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3068
pos = 240,-ifelse(GameHeight=180,128,170)
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)
[State 0, Helper]
type = Helper
trigger1 = time =235
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3069
pos = 240,-45
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)
[State 0, Helper]
type = Helper
trigger1 = time =235
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3059
pos = 240,-45
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=ifelse(GameHeight=180,.75,1)
;---p2
[State 0, Helper]
type = Helper
trigger1 = time =220
helpertype = normal ;player
name = "p2"
ID =3070
stateno =3070
pos = 0,0
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
;---sky
[State 0, Helper]
type = Helper
trigger1 = time =580
helpertype = normal ;player
name = "p2"
ID =3071
stateno =3071
pos = 160,-ifelse(GameHeight=180,92,122)
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=1
size.yscale=ifelse(GameHeight=180,.375,.5)
ignorehitpause=0
;---sky
[State 0, Helper]
type = Helper
trigger1 = time =1045
helpertype = normal ;player
name = "lightning"
ID =3072
stateno =3072
pos = 160,-ifelse(GameHeight=180,180,240)
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1
size.yscale=ifelse(GameHeight=180,.75,1)
ignorehitpause=0
[State 0, Helper]
type = Helper
trigger1 = time =1045
helpertype = normal ;player
name = "lightning"
ID =3073
stateno =3073
pos = 160,-ifelse(GameHeight=180,120,150)
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =ifelse(GameHeight=180,.75,1)
size.yscale=1
ignorehitpause=0

[State 0, Helper]
type = Helper
trigger1 = time =1055
helpertype = normal ;player
name = "lightning"
ID =3074
stateno =3074
pos = 0,-ifelse(GameHeight=180,250,280)
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1
size.yscale=2
ignorehitpause=0
[State 0, Helper]
type = Helper
trigger1 = time =1055
helpertype = normal ;player
name = "lightning"
ID =3074
stateno =3074
pos = 320,-ifelse(GameHeight=180,250,280)
postype = left   ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 1
size.xscale =1
size.yscale=2
ignorehitpause=0
;-------------
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 28    ;fv = 10
value = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=2 && anim=3067
value = S40,0
channel = 1

;abspan = 
;ignorehitpause = 
;persistent = 

[State 0, SelfState]
type = changeState
trigger1 =animtime=0 && anim=3067
value =0
ctrl=1



;ignorehitpause =
;persistent =

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

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
x=-80*facing
;ignorehitpause = 
;persistent = 
[State 0, PalFXWiz]
type = PalFX
trigger1 = time=0
time = 1125
add = 25,-200,40
mul = 150,0,150
sinadd = -75,0,-75,10
invertall = 0
color = 256


[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = time=0
value = 5010
ignorehitpause = 1
persistent = 1
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = time>=5 && enemy,time<=220
value = 5010
elem=2
ignorehitpause = 1
persistent = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time>=220 && anim!=3071
value = 3071
ignorehitpause = 1
persistent = 1
[State 0, PosAdd]
type = PosAdd
trigger1=time=220
y = const(size.mid.pos.y)+10
;ignorehitpause = 
;persistent = 

;----vels
[State 0, VelSet]
type = VelSet
trigger1 = enemy,time=220
y = -1.2
x=.95
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
trigger1 = pos x =[8,10]
trigger2 =enemy,time=335
x = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=1
trigger2 =enemy,time=335
trigger1 = pos x =[-10,-8]
x = 0
[State 0, VelSet]
type = VelSet
trigger1 =enemy,time=295
trigger2 =enemy,time=425
trigger3=enemy,time=580
y = 0


[State 0, VelSet]
type = VelSet
trigger1 =enemy,time=375
y = -9
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = enemy,time= 520
y = -1
;---------------
;---pos
[State 0, PosSet]
type = PosSet
trigger1 =  enemy,time=465 
x = ifelse(facing=-1,6,-8)
y = -65
;ignorehitpause = 
;persistent = 



;-------
;-----sizing

[State 0, AngleDraw]
type = AngleDraw
trigger1 = enemy,time=[520,580]
value = 1
scale = ifelse(GameHeight=180,.75,1)-(( enemy,time-520)*ifelse(GameHeight=180,.00675,.009)),ifelse(GameHeight=180,.75,1)-(( enemy,time-520)*ifelse(GameHeight=180,.00675,.009))
;ignorehitpause = 
;persistent = 
[State 0, AngleDraw]
type = AngleDraw
trigger1 = enemy,time>=580
value = 1
scale = ifelse(GameHeight=180,.225,.3),ifelse(GameHeight=180,.225,.3)
;----------
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0

[State 0, LifeAdd]
type = LifeAdd
trigger1 = enemy,time=1065
value = -99999
kill = 1
absolute = 0

;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = enemy,time>=1073
y = 2400
[State 0, SelfState]
type = SelfState
trigger1 =enemy,time=1075
value =5150
;anim =
;ctrl =
;ignorehitpause = 0
;persistent = 1
;ignorehitpause = 
;persistent = 


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


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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(28)=1
flag = nobardisplay
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(28)=1
flag = nomusic
ignorehitpause=1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2= nocrouchguard
flag3 = noairguard
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[1025,1055]) && (p2stateno!=[833,839])
value =ifelse(var(21)>0,1033,1036)
ID =210
ignorehitpause=0
[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, VarSet]
type = VarSet
trigger1 =var(54)=0
v = 54   ;fv = 10
value = palno
;ignorehitpause =
;persistent =
[State 0, 0] ;Change palette
type = RemapPal
trigger1 = numhelper(4001)>0
source = 1,1
dest = 1,var(54)
ignorehitpause=1
;persistent=1
[State 0, Pause]
type = Pause
trigger1 =numhelper(4001)>0
time = 2
movetime = 2
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 25   ;fv = 10
value = 0
[State 0, Explod]
type = Explod
trigger1=p2stateno=1030 && enemy,time=1 && p2movetype=H
trigger2=p2stateno=1032 && enemy,time=1 && p2movetype=H
trigger3=p2stateno=1052&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=834&& enemy,time=1 && p2movetype=H
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
trigger1=p2stateno=1030 && enemy,time=1 && p2movetype=H
trigger2=p2stateno=1032 && enemy,time=1 && p2movetype=H
trigger3=p2stateno=1052&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=834&& enemy,time=1 && p2movetype=H
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
trigger1=p2stateno=1030 && enemy,time=1 && p2movetype=H
trigger2=p2stateno=1032 && enemy,time=1 && p2movetype=H
trigger3=p2stateno=1052&& enemy,time=1 && p2movetype=H
trigger4=p2stateno=834&& enemy,time=1 && p2movetype=H
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, VarSet]
type = VarSet
trigger1= numhelper(1001)=0 && stateno!=1000
v = 10    ;fv = 10
value =-1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =610
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 =1020
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1021
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1022
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1050
ignorehitpause = 1
[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)>2
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 ||p2stateno=[202,203]
v = 11    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 23   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =stateno!=[40,50] 
v = 26   ;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
v = 21   ;v = 570
value = 0
ignorehitpause=1


;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 9   ;fv = 10
value = enemy,lifemax/4
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =statetype!=A
trigger2= stateno=[5200,5210]
v = 6   ;fv = 10
value = 0
;ignorehitpause =
;persistent =

[State 0, VarSet]
type = VarSet
trigger1 =statetype!=A
v = 8  ;fv = 10
value = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=834
trigger1 = enemy,time=1
value = S2,5


[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, VarSet]
type = Varadd
triggerall = movehit=1
trigger1 = stateno=200
trigger2 = stateno=400
trigger3 = stateno=600
v = 27   ;fv = 10
value = 2
ignorehitpause =0 

[State 0, VarSet]
type = Varadd
triggerall = movehit=1
trigger1 = stateno=410
v = 27   ;fv = 10
value = 8
ignorehitpause =0 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H || p2stateno=[5200,5210]
v = 27   ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1=p2stateno=834 && p2movetype=H
trigger2 = p2stateno=1030 && p2movetype=H
triggerall = enemy,time=1
value = S2,2
channel=2
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=1047 && p2movetype=H
trigger1 = enemy,time=1
value = S2,2
channel=2
[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 = 1
supermove =999
pausemove = 999
ignorehitpause = 1
persistent = 0

;-------buffer

[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=2||var(31)=22||var(31)=73)  &&stateno=50 &&time=1 

v = 32    ;fv = 10
value =5;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=164)  &&stateno=1021 &&animtime=0 

v = 32    ;fv = 10
value =8;-wait 34 ticks before proceeding 
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=79)  &&stateno=50 &&time=1 
v = 32    ;fv = 10
value =28;-wait 34 ticks before proceeding 
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=82)  &&stateno=50 &&time=1 
v = 32    ;fv = 10
value =32;-wait 34 ticks before proceeding 
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=161)  &&stateno=50 &&time=1 
v = 32    ;fv = 10
value =16;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = Varadd
trigger1 = var(32)>0
v =32    ;fv = 10
value = -1 ; subtract as soon as its not 0
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=32)  &&animtime=0&& stateno=1010 
v = 32    ;fv = 10
value =3;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = Varadd
trigger1 =stateno=610 && movehit=1
v = 15    ;fv = 10
value = 1
ignorehitpause=0
[State 0, VarSet]
type = Varadd
trigger1 =stateno=605&& movehit=1
v = 16    ;fv = 10
value = 1
ignorehitpause=0

[State 0, VarRangeSet]
type = VarRangeSet
trigger1 = statetype!=A || p2movetype!=H
value = 0 ;fvalue = 0
first = 15
last =16 ;39
ignorehitpause = 1
;persistent = 

;----------

;----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] 
trigger3 = p2stateno=[1029,1031]
v = 33    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
;--------------------

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
trigger2 = stateno=[800,810]
trigger3 = var(31)=12
trigger4 = var(31)=30
trigger5 = var(31)=173
trigger6 = var(31)=123
trigger7 = var(31)=52
trigger8 = var(31)=106
trigger9 = var(31)=166
trigger10 = var(31)=139
v = 31    ;fv = 10
value = 0
ignorehitpause = 1

 [State 0, VarSet]
type = VarSet
trigger1 = statetype = A
trigger2 = movetype=H && stateno!=[120,155]
trigger3= prevstateno=40
trigger4= (p2stateno=[5090,5119]) &&(p2stateno=[5121,5899])
trigger6 = (prevstateno=52 ||prevstateno=5120) && p2statetype=A && var(31)=0
trigger7 = p2bodydist x <55 && frontedgebodydist >50 && p2statetype!=L
trigger8 = var(31)=6 || var(31)=12 || var(31)=21 || var(31)=45  || var(31)=85|| var(31)=83||var(31)=40 ||var(31)=80
trigger9=helper(10003),var(8)>0
trigger10 = p2stateno!=10003&& var(31)=0
trigger11 = helper(10003),var(19)>0 && var(31)=0
trigger12 = var(33)=1 && p2bodydist y <-50 && p2bodydist x >=30
trigger13 = stateno=1100
trigger14= stateno=200
trigger15= (p2stateno=10003)
v=30
value = 0

[State 0, VarSet]
type = VarSet
triggerall = statetype != A
triggerall = roundstate=2 && helper(10003),var(19)=0
triggerall = stateno!=1100
triggerall = var(31)!=[43,46]
triggerall = var(31)!=80 &&var(31)!=83
triggerall = (helper(10003),var(8)<=0)
triggerall = (p2stateno!=10003)
triggerall = p2stateno =5120||random <149|| p2movetype=A&& p2bodydist x >100|| p2stateno=4999 && p2bodydist x >40||enemy,hitdefattr=SC,AT || var(31)>0
trigger1= enemy,hitdefattr=SC,AT && ctrl
trigger2 = p2bodydist x >130 && ctrl && movetype!=H&&(p2movetype!=H) && var(31)=0 
trigger3 = stateno=211 && movehit && p2statetype=A && p2bodydist x <55
trigger4 = stateno=605&& movehit && p2statetype=A && var(31)>0
trigger5 = stateno=1020&& movehit && var(31)>0 && var(2)!=3 
trigger6 = var(33)=1 && (p2bodydist y >-50|| p2bodydist x <30)
;trigger7 =  var(31)=
v = 30   ;fv = 10
value = 1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =1
text = "17 = %f  19 = %f 31=%d 31=%d"
params = (p2bodydist x),(p2bodydist y),(var(30)),var(31)
ignorehitpause =1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------



[Statedef -3]
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = !var(41)
value = random%9
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41)>0
value = var(41); 1~99

[State 0, VarSet]
type = VarSet
trigger1 = p2name="Edward Trusdale" 
v = 41    ;fv = 10
value = 10
[State 0, VarSet]
type = VarSet
trigger1 = p2name="Richter Belmont FA" 
v = 41    ;fv = 10
value = 11
[State 0, VarSet]
type = VarSet
trigger1 = p2name="Caligula" 
v = 41    ;fv = 10
value = 12
[State 0, VarSet]
type = VarSet
trigger1 = numhelper(1001)=0
v = 17    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = Varadd
trigger1 = movehit=1 && p2stateno!=[120,155]
v = 56   ;fv = 10
value = 1
ignorehitpause = 0

[State 0, VarSet]
type = Varset
trigger1 = p2movetype!=H
v = 56   ;fv = 10
value = 0
ignorehitpause =1
[State 0, ParentVarSet]
type = VarSet
triggerall = numhelper(1002)>0
trigger1 = helper(1002),movehit && (var(31)=0 ) && var(21)=1
v = 31    ;fv = 
value = 60
ignorehitpause = 1
[State 0, ChangeState]
type = ChangeState
triggerall = power >=ifelse(fvar(4)>0,250,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 >=ifelse(fvar(4)>0,250,500)
triggerall= stateno!=[3000,3051]
triggerall = AILevel>0
triggerall = stateno!=700
triggerall =stateno!=1000&&stateno!=1005
triggerall= movecontact
triggerall = var(2)!=3
trigger1= var(31)=161 && animelem=10
trigger2 = stateno=1010 && var(2)=2 && var(21)!=2 && random < 15*AIlevel && p2bodydist x <55
trigger3 = stateno=1020 && p2statetype!=A && var(21)!=2 && random < 15*AIlevel  && p2bodydist x <55
trigger4 = stateno=1050 && moveguarded && random < 10*AIlevel && power >600
trigger5 = stateno=1010 && var(2)=1 && moveguarded && random < 10*AIlevel&& power >700 && p2bodydist x <55
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,16) 
v = 3    ;fv = 10
value = 1
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
v =4    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =fvar(4)<0
fv =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 =  var(56)>1
trigger1= movehit=1
triggerall=stateno =200 || stateno=400 || stateno=600 ||stateno=611
fv =2 ;fv = 10
value = fvar(2)*.91
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1= movehit=1
triggerall=stateno=405 ||stateno =205 ||stateno =206 ||stateno=605||stateno=606
fv =2 ;fv = 10
value = fvar(2)*.975
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=210||stateno=410||stateno=610||stateno=211||stateno=212
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 =  var(56)>1
trigger1 = stateno=1010||stateno=1015
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.95
ignorehitpause=0

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

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=1020
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.925
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=700
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.245
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
channel=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
channel=0




[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
channel=0


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


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

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0
