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

; var(0):= -3, 5900, 1012, 3067, 4005, 7001, 9998, 9999
; var(1):= 3010, 3067, 4004, 4005, 9998, 9999
; var(2):= 1010, 1050, 1100, 1013, 1022, 4004, 9998, 9999
; var(3):= -3, 9999
; var(4):= 200, 205, 210, 211, 212, 400, 405, 410, 600, 605, 610, 831, 1004, 1005, 1006, 1010, 1050, 1100, 3000, 3050, 3051, 3055, -3, 4, 5, 1012, 1022, 4004, 9999
; var(5):= 800, 830, 4004, 4005, 9999
; var(6):= 1001, 1010, 1050, 3000, 3050, 3055, 45, 4004, 9999
; var(7):= 3000, 4004, 9999
; var(8):= -2, 55, 59, 4005, 9999
; var(9):= -2, 9999
;var(10):= -3, 1013, 9999
;var(11):= 211, 610, 1000, 1004, 1100, 3051, 3056, -2, 3010, 9999
;var(12):= -2, 9999
;var(13):= 3061, 9999
;var(14):= 600, 108, 9999
;var(15):= 212, 1010, 9999
;var(16):= -3, 9999
;var(17):= 3061, 9999
;var(18):= 9999
;var(19):= 810, 831, 1005, 1006, 1010, 3000, 3056, -2, 9999
;var(20):= 800, 810, 830, 831, 9999
;var(21):= 200, 205, 210, 211, 212, 400, 405, 410, 600, 605, 610, 700, 831, 1004, 1005, 1006, 1010, 1050, 1100, 3000, 3050, 3051, 3055, -2, 199, 1013, 1022, 3010, 3012, 3013, 3014, 9999
;var(22):= 1022
;var(23):= -2, 199
;var(24):= -2
;var(25):= -2, 9999
;var(26):= -2, 40, 45
;var(27):= 212, 1100, 199, 1012
;var(28):= 3061
;var(29):= -2
;var(30):= 9998, 9999
;var(31):= 1022, 3010
;var(32):= 4, 9998
;var(33):= -2
;var(34):= 9998
;var(35):= 9998
;var(36):= 205, 210, 211, 405, 410, -2
;var(40):= -2, 9999
;var(41):= -3
;var(42):= -3
;var(45):= -3
;var(46):= 9999
;var(50):= 4001, 9999
;var(52):= 154
;var(53):= 4001
;var(54):= -2, 190, 4001
;var(55):= 5900
;var(56):= -3
;var(58):= 1010, 1100
;var(59):= 190

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

; fvar(0):= -3, 4, 5, 3067
; fvar(1):= 3067
; fvar(2):= 3051, -3, 1012, 1013, 1022, 3010, 3012, 3013, 3014
; fvar(9):= 190
;fvar(20):= 3061
;fvar(21):= 3061, 9999
;fvar(22):= 9999
;fvar(30):= 3061































[Data]
life = 975
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 = 17    ;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  = 5.5, 0    ;Run forward (x, y)
run.back = -6.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]
victory0 = "Well aren't you just the least useful trash."
victory1 = "I expected a better fight than that. What I got was pitiful."
victory2 = "Just stay down and go home when I'm gone."
victory3 = "I wanted to say you worked up a sweat but it's just hot out here."
victory4 = "Man what an amazing show of strength, I could watch me all day!"
victory5 = "I skipped out for this? Man I was better off sleeping in class!"
victory6 = "I didn't think I'd find something more boring than homework but here you are..."
victory7 = "Huh? Were you trying to fight or was I just in your way?"
victory8 = "Worst warm up I've ever had."
victory9 = "How embarassing for you."
victory10 = "I don't think she trained you, you just watched. She could put up a fight, you just wasted my time." ;tr
victory11 = "I guess she finally learned how to do something right. Well played, Tristan..." ;tr
victory12 = "When are you going to take things seriously, I mean I'm not but you should Ryuko!" ;ry
victory13 = "Sheesh, always a big entrance with you. Well I guess that wasn't too boring." ;ry
victory14 = "I don't know what I've stumbled upon, but there's no way I'm letting you win!" ;ad
victory15 = "What a fine mess this is, my jacket is ruined!";wa
;---------------------------------------------------------------------------
; 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 = 183
;[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 = matchover
;value = 183
;;[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 = 181
;

;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0 && !var(28)
value = 181;+Random%2
[State 180, 1]
type = ChangeState
trigger1 = Time = 0 && var(28)
value = 183
;---------------------------------------------------------------------------
; Win pose 1
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S185, Random%14
volumescale = 100

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

;---------------------------------------------------------------------------
; Win pose 2
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 182, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 6
value = S182, Random%4
volumescale = 100

[State 182, 2]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 2
[Statedef 183]
type = S
ctrl = 0
anim = 187
velset = 0,0

[State 182, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 2
value = S185,12
volumescale = 100
channel=0
[State 0, Explod]
type = Explod
trigger1 =animelem=2
anim =188
ID =187
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,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1 =animelem=1
anim =189
ID =187
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,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <200
flag = roundnotover


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

;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 190+random%3
velset = 0,0

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

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy,var(59)=141
value =194
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy,var(59)=131
value =196
;anim =
;ignorehitpause = 
;persistent = 
[State 0, ChangeState]
type = ChangeState
trigger1 =enemy,var(59)=171
value =193
[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
id =12010
[State 0, Explod]
type = Explod
trigger1 = animelem =14 && anim=190
trigger2 = animelem =6 && anim=191
anim = 1091
ID = 1091
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 5,0
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 191, PlaySnd]
type = PlaySnd
trigger1 = AnimElem =2 && anim!=192
value = S190, Random%15
volumescale = 100
persistent=0
channel=0
[State 191, PlaySnd]
type = PlaySnd
trigger1 = AnimElem =7 && anim=192
value = S190, Random%15
volumescale = 100
persistent=0
channel=0
[State 191, PlaySnd]
type = PlaySnd
trigger1 = AnimElem =15&& anim=190
trigger2 = animelem = 7&& anim=191
value = S191, 0
persistent=0
channel=1
[State 191, PlaySnd]
type = PlaySnd
trigger1 = AnimElem =18&& anim=190
trigger2 = animelem =7 && anim=191
value = S191, 2
persistent=0
channel=1
[State 191, 3] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;---------------------------------------------------------------------------
; Introduction
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0
[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 192
[State 0, PosAdd]
type = Posset
trigger1 = time=0
x = 120*facing
[State 0, Turn]
type = Turn
trigger1 = time=0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =1
id =12010
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(4)>=0 && animelemtime(5)<0
x = 5

[State 0, VelSet]
type = VelSet
trigger1 = animelem=12
x = 3.5
y = -8
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(12)>0 && animelemtime(16)<0 
y = .45
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(16)>0 && animelemtime(27)<0 
y = .35
[State 0, Turn]
type = Turn
trigger1 = animelem=16
[State 0, VelSet]
type = VelSet
trigger1 = animelem=16
x = -3
y = -3
[State 0, VelSet]
type = VelSet
trigger1 = animelem=21
x = -1
[State 0, VelSet]
type = VelSet
trigger1 = animelem=26
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=26
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=26
physics = S
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=29
x = 16
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=34
x = 11
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=35
x =7
[State 0, VelSet]
type = VelSet
trigger1 = animelem=35
x = 5
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 =animelem=46
x = -9
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=36
x =4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=50
x =16
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=61
x =-4
;ignorehitpause = 
;persistent = 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=63
physics = N
;ignorehitpause = 
;persistent = 
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, VelSet]
type = VelSet
trigger1 =animelem=63
x = 4
y=-5
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(63)>0  
y = .55


[State 200, 1]
type = PlaySnd
trigger1 = animelem=3
value = 200,7
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=11
value = 200,1
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=17
value = 200,5
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=28
value = 200,3
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=35
value = 200,0
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=46
value = 181,0
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=51
value = 195,2
channel=0

[State 200, 1]
type = PlaySnd
trigger1 = animelem=63
value = 200,14
channel=0
;abspan = 
;ignorehitpause = 
;persistent = 
;---------------------------------------------------------------------------
; Introduction
[Statedef 193]
type = S
ctrl = 0
anim = 196
velset = 0,0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value =0
movecamera = 0,0
;ignorehitpause = 
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =Time = 0
id =12010
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time<2
flag = invisible
[State 200, 1]
type = PlaySnd
trigger1 =animelem=2,10&& anim!=20
value = 201,4
channel=0

[State 200, 1]
type = PlaySnd
trigger1 =animelem=11&& anim!=20
value = 200,49
channel=0

[State 200, 1]
type = PlaySnd
trigger1 =animelem=16&& anim!=20
value = 195,2
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = time =1
x = -15

[State 200, 1]
type = PlaySnd
trigger1 =animelem=15&& anim!=20
value = 300,0
channel=4
[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelem=15
time = 3
add =256,256,256
mul = 256,256,256
sinadd = 0,0,0,0
invertall = 0
color = 256
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(15)>0 && animelemtime(15)<8
x = -4

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(15)>=8 && animelemtime(16)<4 
x = -1

[State 200, 1]
type = PlaySnd
trigger1 =animelem=6&& anim!=20
value =999,0
channel=2
[State 0, Explod]
type = Explod
trigger1 = animelem=6&& anim!=20 && facing=-1
anim = 4000
ID =4000
pos = 0,0
postype =right ;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 = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelem=6&& anim!=20 && facing=1
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 = .5,ifelse(GameHeight=180,.75,1)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =animelem=6&& anim!=20
anim = 8002
ID =8002
pos = 0,-75
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=14&& anim!=20
anim = 7013
ID =8002
pos = 96,-54
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=14&& anim!=20
anim = 183
ID =8002
pos = 20,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, EnvShake]
type = EnvShake
trigger1 = animelem=14&& anim!=20
time = 8
freq = 60
ampl = -6
phase = 90
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(14)>10 && animelemtime(14)%2=0&& animelemtime(15)<0
x = 1
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(14)>10 && animelemtime(14)%4=0 && animelemtime(15)<0
x = -2
[State 200, 1]
type = PlaySnd
trigger1 =animelem=14&& anim!=20
value = 191, 1
channel=2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0&& anim!=20
value = 20
;elem = 1
[State 0, PosSet]
type = velset
trigger1 =anim=20
x = const(velocity.walk.fwd.x)
[State 0, PosSet]
type = PosSet
trigger1 = pos x >= fvar(9) && facing=1 && anim=20
trigger2 = pos x <= fvar(9) && facing=-1&& anim=20
x = fvar(9)
;ignorehitpause = 
;persistent = 

[State 191, 3] ;Change to stand state
type = ChangeState
trigger1 = pos x >= fvar(9) && facing=1 && anim=20
trigger2 = pos x <= fvar(9) && facing=-1&& anim=20
value = 0
;---------------------------------------------------------------------------
; Introduction
[Statedef 194]
type = S
movetype=A
ctrl = 0
anim = 197
velset = 0,0
[State 0, PosAdd]
type = PosAdd
trigger1 =time=0 
x = -150
;ignorehitpause = 
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =Time = 0
id =12010
[State 0, StopSnd]
type = StopSnd
trigger1 = time=0
channel = 0
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time=0
trigger2=time=16
value = S200,5+(random%3)
channel =0
[State 0, PlaySnd]
type = PlaySnd
trigger1=time=48
value = S200,13
channel =0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time=0
trigger2=time=16
trigger3=time=48
value = S2,2+(random%3)
channel =1
[State 0, EnvShake]
type = EnvShake
trigger1 =time=0
trigger2=time=16
trigger3=time=48
time = 8
freq = 60
ampl = -6
phase = 90
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1=animelem=2
value = S200,19
channel =0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=10
value = S190,13
channel =0
;abspan = 
;ignorehitpause = 
;persistent = 

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value =0
movecamera = 0,0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(2)>=0&&animelemtime(4)<0 
x =8

[State 0, PosSet]
type = PosSet
trigger1 =  animelem=4
x = fvar(9)

[State 610, 3]
type = HitDef
trigger1 = animelem=4
attr = S, NA
damage = 40
guardflag = MA
priority = 4
pausetime = 10,10
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -13,-53
hitsound = S2,4
getpower=0,0
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = 18
guard.ctrltime=20
ground.velocity = -8,-9
air.velocity = -8,-9.75
air.hittime=25
fall.recovertime=25
fall=1
id=202
yaccel=.47
 envshake.time = 6
envshake.ampl = 7
envshake.freq=85


[State 191, 3] ;Change to stand state
type = ChangeState
trigger1 =animtime=0
value = 0
;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 1950
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 195, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S195, Random%3
volumescale = 100
channel = 0

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



;---------------------------------------------------------------------------
[Statedef 196]
type    = S
physics =S
poweradd= 0
ctrl = 0
juggle=0
anim=198
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, StopSnd]
type = StopSnd
trigger1 = time=0
channel = 0
;ignorehitpause = 
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =Time = 0
id =12010
[State 195, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 2
value = S190, 5
volumescale = 100
channel = 0
[State 195, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 8
value = S4, 1
volumescale = 100
channel =1
[state 191, ????]
type = EnvShake
trigger1 = animelem = 8
time = 25
freq = 100
ampl = 7
phase = 80
[State 0, Explod]
type = Explod
trigger1=animelemtime(8)>=0 && animelemtime(20)<0
trigger1 = time%7=0
anim = 8300
ID = 8300
pos = 20,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = -1.25,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1=animelemtime(8)>=0&& animelemtime(20)<0
trigger1 = time%7=0
anim = 8300
ID = 8300
pos = -20,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 1.25,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1=animelem=8
anim =1055
ID = 8300
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 = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 191, 3] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0 
value = 0

;---------------------------------------------------------------------------
; 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
triggerall= anim=200
trigger1 = AnimElem =2
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 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 =8,8               ;Time attacker pauses, time opponent shakes
sparkno = Scond(var(42)=0,cond(var(42)=0,7000+(random%4),1),1)                     ;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=ceil(5*fvar(0))        ;Sound to play on hit
givepower=5,5
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,14,ifelse(var(21)=2,15,10)))           ;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,14,ifelse(var(21)=2,15,10)))             ;Time before opponent regains control in air
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,28,14))-var(25))
air.fall=1
forcenofall= p2statetype=C||p2stateno=1101
id=200

;[State 0, ChangeAnim]
;type = ChangeAnim
;trigger1 = command="x" && anim=200 && movecontact
;value = 201
;elem = 1
;ignorehitpause = 
;persistent = 


[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
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, (random%3)
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 0, Turn]
type = Turn
trigger1 =facing=enemy,facing
;ignorehitpause = 
;persistent = 


[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 >= Const240p(35)
value = 5100 ;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 >=35;.
value = 5100 ;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


;---------------------------------------------------------------------------
; 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)+10

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

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0&&prevstateno!=1051
x = 1
y =1

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0&&prevstateno=1051
x = 1
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&prevstateno=1051
y = -vel y
;ignorehitpause = 
;persistent = 

[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 && time>5
triggerall =HitOver && enemy,var(21)=0 && enemy,var(19)=0&& ((time>gethitvar(hittime))||p2stateno=831) &&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 && time>5
triggerall = p2stateno!=3061
triggerall =HitOver && enemy,var(21)=0 && enemy,var(19)=0&& (((time>gethitvar(hittime))||p2stateno=831)) &&canrecover
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210

[State 5035, 4]
type=changeState
triggerall = time>10
trigger1 = Pos Y >= const(size.mid.pos.y)+40&& vel y >0
value = 303 ;HITA_FALL

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 303]
type    = L
movetype= H
physics = N

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


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

[State 820, 1]
type = ChangeAnim2
Trigger1 = animtime=0 && anim=5100
value = 5110


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

[State 0, VelMul]
type = VelMul
trigger1 =1
x = .8
[State 0, VelSet]
type = VelSet
trigger1 =time=12
x = 0


[State 0, SelfState]
type = SelfState
trigger1 = time > 2
value =ifelse(alive,5201,5110)


;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim =ifelse(fvar(22) <25,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 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 6+(random%3)
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && var(36)!=0
x = -var(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=1 
v = 36  
value = 0

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4 && anim=205 
x = 18
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4 && anim=205
v = 36   
value = 18
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5 && anim=205 
x = 11
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5 && anim=205
v = 36  
value = 29
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6&& anim=205 
x = -17
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6 && anim=205
v = 36  
value = 12
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7&& anim=205 
x = -12
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7 && anim=205
v = 36   
value = 0

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1&& anim=206
x = -24
[State 0, VarSet]
type = VarSet
trigger1 =animelem=1 && anim=206
v = 36   
value = -24
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2&& anim=206
x = 4
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2 && anim=206
v = 36  
value = -20
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3&& anim=206
x = -5
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3 && anim=206
v = 36  
value = -25
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4&& anim=206
x = -2
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4 && anim=206
v = 36  
value = -27
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5&& anim=206
x = 1
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5 && anim=206
v = 36  
value = -26
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6&& anim=206
x = -6
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6 && anim=206
v = 36   
value = -32
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7&& anim=206
x = 5
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7 && anim=206
v = 36   
value = -27
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8&& anim=206
x = 8
[State 0, VarSet]
type = VarSet
trigger1 =animelem=8 && anim=206
v = 36  
value = -19
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9&& anim=206
x = 12
[State 0, VarSet]
type = VarSet
trigger1 =animelem=9 && anim=206
v = 36
value = -7
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10&& anim=206
x = 7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=10 && anim=206
v = 36   
value = 0
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1
channel=1

;ignorehitpause = 
;persistent = 


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 30
guardflag = MA
pausetime = 12,12
sparkno = Scond(var(42)=0,7010+(random%4),1)
sparkxy = -10,ifelse(anim=205,-70,-57)
hitsound = S2, 1
guard.sparkno= S7500
getpower=ceil(15*fvar(0)),7 
guardsound = S6, 0
ground.type = High
givepower=20,5
ground.slidetime = 14
guard.ctrltime=12
ground.hittime  = 14+(var(21)>2*7)
ground.velocity = -5.5
guard.velocity=-6
air.velocity = -1.5,-2.5
p2facing=1
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,27,16)))
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,27,16))
air.fall=1
forcenofall= p2statetype=C||p2stateno=1101
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 && anim=205
trigger2 = animelem=6 && anim=206
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(fvar(22) <25,210,211)
sprpriority = 2
facep2=1
[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 = time=0 && var(36)!=0
x = -var(36)
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0
v = 36  
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2 && anim=210 
x = 9
[State 0, VarSet]
type = VarSet
trigger1 = animelem=2 && anim=210 
v = 36  
value = 9
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 && anim=210
x = 4
[State 0, VarSet]
type = VarSet
trigger1 = animelem=3 && anim=210 
v = 36  
value = 13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 && anim=210
x = -7
[State 0, VarSet]
type = VarSet
trigger1 = animelem=6 && anim=210 
v = 36  
value = 6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7 && anim=210
x = -6
[State 0, VarSet]
type = VarSet
trigger1 = animelem=7 && anim=210 
v = 36  
value = 0


[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2 && anim=211
x = 14
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2 && anim=211
v = 36  
value = 14
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 && anim=211
x = 20
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3 && anim=211
v = 36  
value = 34
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4 && anim=211
x = -7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4 && anim=211
v = 36  
value = 27
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& anim=211
x = -17
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5 && anim=211
v = 36  
value = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 && anim=211
x = 1
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6 && anim=211
v = 36  
value = 11
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7 && anim=211
x = 4
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7 && anim=211
v = 36  
value =15
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8 && anim=211
x = -10
[State 0, VarSet]
type = VarSet
trigger1 =animelem=8 && anim=211
v = 36  
value = 5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9 && anim=211
x = -5
[State 0, VarSet]
type = VarSet
trigger1 =animelem=9 && anim=211
v = 36  
value = 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 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 11+(random%3)
channel=0


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    =33
guardflag = MA
pausetime = 12,12
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-70
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=ceil(40*fvar(0)),20 
givepower=20,5
ground.type = High
p2facing=1
guard.ctrltime=13
ground.slidetime =15
ground.hittime  = 18
ground.velocity = -5.5
guard.velocity=-7
air.velocity = -1.5,-3
air.hittime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,26,22)))
fall.recovertime=ceil(ifelse(var(21)=1,99,ifelse(var(21)=2,26,22)))
air.fall=1
forcenofall= p2statetype=C||p2stateno=1101
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, Width]
type = Width
trigger1 = p2statetype=A && anim=210
player = 35,0
;value = 0,0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8&&anim=211
trigger2 = animelem=6 &&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 = 213
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

;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)

[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, PosAdd]
type = PosAdd
trigger1 =animelem=4 
x = 8
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4 
v = 36  
value = 8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5 
x = 10
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5 
v = 36  
value = 18
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = -7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6
v = 36  
value = 11
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7
x = 15
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7
v = 36  
value = 26
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8 
x = 2
[State 0, VarSet]
type = VarSet
trigger1 =animelem=8
v = 36  
value = 28
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x = 7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=9 
v = 36  
value = 35
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10 
x = 7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=10
v = 36  
value = 42
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=11
x = 20
[State 0, VarSet]
type = VarSet
trigger1 =animelem=11 
v = 36  
value = 62
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=12
x = -1
[State 0, VarSet]
type = VarSet
trigger1 =animelem=12
v = 36  
value = 61
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=13
x = -3
[State 0, VarSet]
type = VarSet
trigger1 =animelem=13
v = 36  
value = 58
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=14
x = -7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=14
v = 36  
value = 51
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=15
x = -15
[State 0, VarSet]
type = VarSet
trigger1 =animelem=15
v = 36  
value = 36
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=16
x = -17
[State 0, VarSet]
type = VarSet
trigger1 =animelem=16
v = 36  
value = 19
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=17
x = -19
[State 0, VarSet]
type = VarSet
trigger1 =animelem=17
v = 36  
value = 0
[State 210, 1]
type = PlaySnd
trigger1 = animelem=1
value = 0, 2
channel=1


;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(6)>0 &&animelemtime(7)<0 && time <40&& command ="holdz" && var(45)=0
trigger2 = animelemtime(6)>0 &&animelemtime(7)<0 && time <20
;trigger3 = animelemtime(6)>0 &&animelemtime(7)<0 && time <40 && (fvar(6)>120||p2statetype=L) && AIlevel>0 
value = anim
elem = 6
[State 0, Helper]
type = Helper
triggerall = var(42)=0
trigger1 = time=40 && animelemtime(5)>=0 && animelemtime(6)<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 200, 1]
type = PlaySnd
trigger1 = animelem=1
value = 200, 20
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=7
value = 200,23
channel=0

[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
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 = 7
attr = S, NA
animtype  = Medium
damage    =15
guardflag = HA
pausetime = 4,2
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-45
hitsound = S2, 1
guardsound = S6, 0
guard.sparkno= S7500
getpower=ceil(30*fvar(0)),5
givepower=20,5
ground.type = High
p2facing=1
guard.ctrltime=16
ground.slidetime =15
ground.hittime  = 14
ground.velocity =2
guard.velocity=-2
air.velocity =  1,5
air.hittime=55
fall.recovertime=30
air.fall=1
id=200


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time >40 && animelemtime(7)>0 && animelemtime(11)<0
flag = unguardable

[State 210, 2]
type = HitDef
trigger1 = AnimElem =9 
attr = S, NA
animtype  = Medium
damage    =40
guardflag = HA
pausetime = 6,6
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-80
hitsound = S2, 1
guardsound = S6, 0
guard.sparkno= S7500
getpower=ceil(30*fvar(0)),5 
givepower=20,5
ground.type = High
guard.ctrltime=16
ground.slidetime =16
ground.hittime  =25
ground.velocity = -7
guard.velocity=-4
air.velocity =  -3+((var(21)>=1)*2),12.5
air.hittime=ifelse(numexplod(211)<2&&var(21)>=1,75,25)
fall.recovertime=ifelse(numexplod(211)<2&&var(21)>=1,75,25)
air.fall=1
id=997
yaccel = .48


;ignorehitpause = 
;persistent = 
[State 0, MoveHitReset]
type = MoveHitReset
trigger1 = time >45
;ignorehitpause = 
;persistent = 


[State 210, 2]
type = HitDef
trigger1 = AnimElem =11 && !movecontact
attr = S, NA
animtype  = Medium
damage    =30
hitflag=MAFD
guardflag = MA
pausetime = 6,6
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-5
hitsound = S2, 2
guardsound = S6, 0
guard.sparkno= S7500
getpower=ceil(30*fvar(0)),5 
givepower=20,5
ground.type = High
guard.ctrltime=16
ground.slidetime =16
ground.hittime  =24
guard.ctrltime=20
ground.velocity = -1
guard.velocity=-5
air.velocity =  5-((var(21)=1)*4),-3-((var(21)=1)*6.5)
air.hittime=15
fall.recovertime=60
down.hittime=35
down.velocity=-6,0
air.fall=1
id=200
yaccel = ifelse(var(21)=1,.45,.55)
[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, VarSet]
type = VarSet
trigger1 = movehit && p2statetype=A
v = 11    ;fv = 10
value = 1
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=14
movetype = I

[State 210, 5]
type = ChangeState
trigger1 = animtime=0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; step kick
[Statedef 212]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 212
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 = time=0
x = -var(36)
;ignorehitpause = ,
;persistent = 
 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(212)>2 && time=0&& var(21)=2 
trigger2 = p2movetype=A && time <28
v = 21   ;fv = 10
value = 1
ignorehitpause=1
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A && time >=28
v =21   ;v = 570
value = 2
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 = 1
v =27   ;fv = 10
value = var(21)=2
;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 0, Width]
type = Width
trigger1 = 1
edge = 35,0
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4 
x = 12
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5 
x =5
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(5)>0 &&animelemtime(6)<0 && time <28 && command ="holdz" && var(45)=0 
trigger2 = animelemtime(5)>0 &&animelemtime(6)<0 && time <28 && (fvar(22)>120||p2statetype=L|| fvar(21)<-100) && AIlevel>0 
value = anim
elem = 5

[State 0, Helper]
type = Helper
triggerall = var(42)=0
trigger1 = time=28 && animelemtime(5)>=0 && animelemtime(6)<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, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8 
x = 8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10 
x = 28
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=11
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=12
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=13
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=14
x = -17
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=15
x = -16
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=16
x = -21

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(7)>=0 && animelemtime(9)<0 
x = 4
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(10)>=0 && animelemtime(11)<0 
x = 2
[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
anim =10000
ID =212
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 =time=0
v =15   ;fv = 10
value = (20+((time>28)*10)+((var(21)=1)*9)+((var(21)=2)*4))-(numexplod(212)*4)
ignorehitpause=1

[State 210, 2]
type = HitDef
trigger1 = AnimElem =7 
attr = S, NA
animtype  = Medium
damage    =40+((time>28)*20)
guardflag = MA
pausetime = 6,6
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-70
hitsound = S2, 1
guardsound = S6, 0
guard.sparkno= S7500
getpower=ceil(30*fvar(0)),5 
givepower=20,5
ground.type = High
guard.ctrltime=20+((time>27)*10)
ground.slidetime =15
ground.hittime  = 29+((time>27)*10)
ground.velocity = -cond((var(21)>0 || ((time>28)*10)),10,6),cond((var(21)>0 || ((time>28)*10)),-6,0)
guard.velocity=-6
air.velocity = -cond((var(21)>0 || ((time>28)*10)),10,5),cond((var(21)>0 || ((time>28)*10)),-6,-4)
air.hittime=20
fall.recovertime=20
fall=cond((var(21)>0 || ((time>28)*10)),1,0)
air.fall=1
id=20010
yaccel=.47


[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=14
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
channel=0
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 3+(random%3)
channel=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 0, Explod]
type = Explod
trigger1 =(p2statetype=A||p2statetype=L)&& movehit 
anim =10000
ID =400
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 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 9
priority  = 2
animtype  = Light
hitflag = MAF
guardflag = LA
pausetime = 8,8
givepower=5,5
sparkno = Scond(var(42)=0,7000+(random%4),1)
sparkxy = -10,-30
hitsound = S2, 0
guardsound = S6, 0
ground.type = Low
getpower=ceil(2*fvar(0)) 
guard.sparkno= S7500
guard.ctrltime=10
ground.slidetime =12
ground.hittime  = 10
fall.recovertime=12
down.hittime=12
air.hittime=12
ground.velocity = -4
guard.velocity=-4.5
down.velocity=-.5,-5
air.velocity = -1.5,-3
air.fall=1
forcenofall= 1
id=208
[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A||p2statetype=L) && movehit=1 && (p2stateno!=[201,203])
value =201
ID =208
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 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 = 405
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, 8+(random%3)
channel=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 0, VarSet]
type = VarSet
trigger1 =time=0
v = 36  
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2 
x = -20
[State 0, VarSet]
type = VarSet
trigger1 =animelem=2
v = 36  
value = -20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 
x = 2
[State 0, VarSet]
type = VarSet
trigger1 =animelem=3
v = 36  
value = -18
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -3
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4
v = 36  
value = -21
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6 
x = 1
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6
v = 36  
value = -19
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = 5
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7
v = 36  
value = -15
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x = 9
[State 0, VarSet]
type = VarSet
trigger1 =animelem=8
v = 36  
value = -6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = 6
[State 0, VarSet]
type = VarSet
trigger1 =animelem=10
v = 36  
value = 0
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage    = 28
animtype  = Medium
hitflag = MAF
guardflag = LA
pausetime = 8,8
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-8
guard.sparkno= S7500
hitsound = S2, 2
getpower=ceil(20*fvar(0)),10  
givepower=10,5
p2facing=1
guardsound = S6, 0
ground.type = low
guard.ctrltime=12
ground.slidetime =14
ground.hittime  = 14
fall.recovertime=ifelse(var(21)=1,99,ifelse(var(21)=2,35,20))
ground.velocity = -3
guard.velocity=-5.5
air.velocity = -3.5,-3
forcenofall=p2statetype=C
air.fall=1
yaccel=.49
id=200

[State 0, VarSet]
type = VarSet
trigger1 =time=0
v = 36  ;fv = 10
value =21
[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 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
velset=0,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, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4 
x = -12
[State 0, VarSet]
type = VarSet
trigger1 =animelem=4
v = 36  
value = -12
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5 
x = -6
[State 0, VarSet]
type = VarSet
trigger1 =animelem=5
v = 36  
value = -18
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = -5
[State 0, VarSet]
type = VarSet
trigger1 =animelem=6
v = 36  
value = -23
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = 12
[State 0, VarSet]
type = VarSet
trigger1 =animelem=7
v = 36  
value = -11
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x = 4
[State 0, VarSet]
type = VarSet
trigger1 =animelem=8
v = 36  
value = -7
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = 7
[State 0, VarSet]
type = VarSet
trigger1 =animelem=9
v = 36  
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=11
x = -4
[State 0, VarSet]
type = VarSet
trigger1 =animelem=11
v = 36  
value = -4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=12
x = -1
[State 0, VarSet]
type = VarSet
trigger1 =animelem=12
v = 36  
value = -5
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=13
x = 5
[State 0, VarSet]
type = VarSet
trigger1 =animelem=13
v = 36  
value = 0
;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, 14+(random%4)
channel=0
;This is the first hit, triggered on the 3rd element of animation.


[State 410, 2]
type = HitDef
trigger1 = AnimElem =8
attr = C, NA
damage    =32
animtype  = Medium
hitflag = MAF
guardflag = LA
pausetime = 8,8
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-10
guard.sparkno= S7500
hitsound = S2, 2
getpower=ceil(20*fvar(0)),10  
givepower=10,5
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 = -1,-6
guard.velocity=-5.5
air.velocity = -1,-6
air.fall=1
yaccel=.49
id=440



[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=10
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
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, (random%5)
channel=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 = Scond(var(42)=0,7000+(random%4),1)
sparkxy = -10,-58
hitsound = S2, 0
getpower=ceil(10*fvar(0)),5  
givepower=5,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(25)))
ground.velocity = -4
air.velocity = -2.3,ifelse(fvar(21) <=-30,-3,-5.5)
air.hittime=ceil(ifelse(var(21)=1,30,ifelse(var(21)=2,16,12)))
fall.recovertime=ceil(ifelse(var(21)=1,30,ifelse(var(21)=2,16,12)))
air.fall=1
forcenofall= p2statetype=C||p2stateno=1101
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 = 14
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
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 6+(random%6)
channel=0

[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 = 27
guardflag = HA
priority = 3
pausetime = 11,11
sparkno = Scond(var(42)=0,7010+(random%4),1)
sparkxy = -5,-50
hitsound = S2, 1
getpower=ceil(10*fvar(0)),10  
givepower=7,5
guardsound = S6, 0
ground.type = High
guard.sparkno= S7500
ground.slidetime = 9
ground.hittime  =ifelse(var(21)=1,35,ifelse(var(21)=2,24,17))
ground.velocity = -4
air.velocity = -2,-3.5
air.hittime=ceil(ifelse(var(21)=1,35,ifelse(var(21)=2,24,17)))
fall.recovertime=ceil(ifelse(var(21)=1,35,ifelse(var(21)=2,24,17)))
air.fall=1
forcenofall= p2statetype=C||p2stateno=1101
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, Width]
type = Width
trigger1 = 1
edge = 26,0


[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
channel=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 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, 11+(random%9)
channel=0
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 40
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -13,-53
hitsound = S2, 2
getpower=ceil(20*fvar(0)),15 
givepower=10,5
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(25)))
guard.ctrltime=19
ground.velocity = -5
air.velocity = -3,8.75
air.hittime=35
fall.recovertime=35
air.fall=1
forcenofall= p2statetype=C||p2stateno=1101
id=999
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, VarSet]
type = VarSet
trigger1 = movehit=1 && p2statetype=A
v = 11    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 






[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
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200,26
channel=0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=1
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2
x = -6
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = 34

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = -13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = -23
[State 210, 2]
type = HitDef
trigger1 =!movecontact
attr = S, NA
animtype  = Medium
damage    = 5
guardflag = MA
pausetime = 7,7
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -10,-85
hitsound = S2, 2
guard.sparkno= S7500
getpower=0,0 
givepower=5,5
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 = fvar(22) <=41
Trigger1 = Time = 1
attr = S, NT         ;Attributes: Standing, Normal Throw         ;Affect only ground people who are not being hit
priority = 1   ;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
id=800
[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 = S5000,1
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 = S0, 2
[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S200,7
channel=0
[State 0, Width]
type = Width
trigger1 = 1
edge = 60,0
player = 0,0
;value = 0,0
[State 810, SprPriority]
type = SprPriority
trigger1 = AnimElem =1
value = 0
[State 810, SprPriority]
type = SprPriority
trigger1 = AnimElem =4
value = 2

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemtime(1)>= 0&&animelemtime(2)<0
pos = 43,0



;ignorehitpause = 
;persistent = 

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 =  animelem=4 
attr = S, NA
animtype  = Hard
hitflag=MAFD
damage    = 40, 5
priority  = 5
guardflag = MA
pausetime = 7,7
getpower=0
sparkxy = 0,-65
sparkno = S7010
guard.sparkno= S7510
hitsound = S2, 4
guardsound = S6, 0
ground.type = high
ground.slidetime = 32
ground.hittime  = 20
guard.ctrltime=20
ground.velocity = -6,-4
air.velocity = -5.5,-4
guard.velocity=-8
fall=1
fall.recovertime=10
down.velocity=-8,-6
down.hittime=10
yaccel=.55
air.hittime=30
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
id=9999
snap=80,0
[State 0, TargetState]
type = TargetState
trigger1= p2statetype=A && movehit&& (p2stateno!=[301,303]) && p2stateno!=5201&& (p2stateno!=[3002,3004])
value =3003
ID =9999
ignorehitpause =1

[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 = 5000,0
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 = p2stateno!=810&& p2stateno!=812
value = 5050
;----------------------------------------------------------------------
[Statedef 821]
type = A
movetype = H
physics = N
velset = -1.5,-7.25
poweradd = 40

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

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 45
trigger2 = FrontEdgeBodyDist < 45
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

;anim =
;ignorehitpause = 
;persistent = 


[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = alive
triggerall =time >25&&var(19)=0
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 20
value = 5100 ;Hit ground
;------------------
; 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 = ifelse(p2stateno=3051,1029,1025)
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && (enemy,var(11))
y = -const(size.mid.pos.y)+10
[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 && time >15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

;ignorehitpause =
;persistent =

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

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

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

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

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

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




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

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


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

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

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


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

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

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

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

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

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

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

[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 20   ;fv = 10
value = 0
[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
            ;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 = 1    ;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   
id=800
air.velocity=-1,11.5
yaccel=.48


[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = ifelse(prevstateno=605,610,605)
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

;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 
[State 0, Width]
type = Width
trigger1 = 1
edge = 80,0
player = 0,0
;value = 0,0
;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, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 3
[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S200,39
channel=0
[State 0, VelSet]
type = VelSet
trigger1 =animelem=2 
x = 3
y = -7.5


;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y < 20 && animelem=6
value = anim
elem = 5
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y > 20 && animelemtime(6)<0 && animelemtime(5)>0
value = anim
elem = 6
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>0&&animelemtime(6)<0 
y = .56
[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=6
y = 0



[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = -2
;ignorehitpause =
;persistent =
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=2
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(2) < 0
pos = 33,-68
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
pos =-8,-92
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos =-10,-128
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) < 0
pos =30,-85
[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos =57,-43
[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElem= 6
pos =66,-2
[State 0, TargetState]
type = TargetState
trigger1 =animelem=6
value =1051
ignorehitpause =1 
[State 0, Explod]
type = Explod
trigger1=animelem=6
anim = 8302
ID = 8302
pos = 60,5
postype = p1  ;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=animelem=6
anim = 8303
ID = 8303
pos = 45,5
postype = p1  ;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 200, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = S2,4
channel=1
[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElem = 6
time =4
freq = 110
ampl = 5
phase = 90
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 6
value = -55
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1=animelem=6
anim = 8303
ID = 8303
pos = 75,5
postype = p1  ;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, ChangeState]
type = ChangeState
trigger1 =animtime=0 
value =0
ctrl = 1
;anim =
;ignorehitpause = 
;persistent = 


;---------------------------------------------------------------------------
;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, ChangeAnim]
type = ChangeAnim2
trigger1 =time=9&&enemy,var(5)=1
trigger2=time=13&&enemy,var(5)=0
value = anim
elem = 2
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=835
value =836
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1 
value = 1
movecamera = 1,0

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = p2stateno!=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    = L
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
triggerall = p2stateno!=3001
Trigger1 = Time = 0 && prevstateno!=[800,899]
value = 854
[State 820, 1]
type = ChangeAnim2
triggerall = p2stateno=3001
Trigger1 = Time = 0 
value = 1029
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type

;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype=A&&p2stateno=810
x = -3
y = 7
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&p2statetype!=A&&p2stateno=810
x = 6.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 >=15&& (time >5)
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 > 27 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 27 
trigger3 = AILevel >0 && random <100*AILevel && p2stateno!= 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 = 5000,3
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

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 860]
type    = A
movetype= H
physics = N
[State 0, HitVelSet]
type =VelSet
trigger1 = time=0
x = -gethitvar(xvel)
y = gethitvar(yvel)
;ignorehitpause = 
;persistent =

;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 854
[State 0, ScreenBound]
type = ScreenBound
trigger1 = time >4
value = 1
movecamera = 0,1
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10

[State 810, State End]
type = changeState
trigger1 = backedgebodydist < 30
value = 861
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 861]
type    = A
movetype= H
physics = N
[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = front
sprpriority = 3
[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,0
[State 0, VelSet]
type = VelSet
trigger1 =time=0 
x= -vel x*.3
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 1028
;elem = 1
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = const(size.mid.pos.y)-10
[State 0, EnvShake]
type = EnvShake
trigger1 = time=0
time =4
freq = 70
ampl = 4
phase = 90


[State 810, State End]
type = changeState
trigger1 = pos y > -10 
value = 862
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 862]
type    = A
movetype= H
physics = N

;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 =time=0 
y = -vel y*4.5
x=vel x*.15
;ignorehitpause = 
;persistent = 
[State 0, EnvShake]
type = EnvShake
trigger1 = time=0
time =6
freq = 70
ampl = 4
phase = 90

[State 0, VelAdd]
type = VelAdd
trigger1 =1 
y =.25
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
triggerall= enemy,var(11)
triggerall = alive
triggerall =HitOver && enemy,var(19)=0 && time >5
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 = p2stateno!=3061
triggerall =HitOver && enemy,var(19)=0  && time >5
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210

[State 810, State End]
type = changeState
trigger1 = pos y > -10 && vel y >0
value = 303
;---------------------------------------------------------------------------
; Kung Fu Palm
[Statedef 1000]
type    = S
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim =300+(var(6)=300)*2
ctrl = 0
sprpriority = 1
[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, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=3 && var(6)<300
trigger2=animelemtime(5)>=0 && animelemtime(7)<0  && time%4=0&& var(6)<300
trigger3=animelem=7 && var(6)=300
trigger4=animelemtime(9)>=0 && animelemtime(11)<0  && time%4=0&& var(6)=300
anim = 8300
ID = 8300
pos =10,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, PosAdd]
type = PosAdd
triggerall = var(6)<300
trigger1 = animelemtime(3)>=0 && animelemtime(5)<0
x = 3.5
[State 0, PosAdd]
type = PosAdd
triggerall = var(6)<300
trigger1 = animelemtime(5)>=0 && animelemtime(7)<0
x = 5.5+(var(6)*.01)
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
triggerall = var(6)<300
trigger1 = animelemtime(7)>=0 && animelemtime(9)<0
x = 2.75
[State 0, PosAdd]
type = PosAdd
triggerall = var(6)=300
trigger1 = animelemtime(7)>=0 && animelemtime(11)<0
x = 11.5
[State 0, EnvShake]
type = EnvShake
triggerall = var(6)=300
trigger1 = animelem=7
time = 4
freq = 40
ampl = -7
phase = 90

[State 0, NotHitBy]
type = HitBy
trigger1 = animelemtime(7)>=0&&animelemtime(12)<2 && var(6)=300
value = C,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =movehit=1 && var(6)=300
anim =10000
ID = 1006
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, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S200,14
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =3 && var(6)=300
value = S3,6
persistent=11
channel = 3
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3 && var(6)<300
trigger2 = animelem = 7 && var(6)=300
value = S4,6
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3 && var(6)<300
trigger2 = animelem = 7 && var(6)=300
value = S4,5
channel = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3 && var(6)<300
trigger2 = animelem=7 && var(6)=300
x = 5
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7 && var(6)<300
trigger2 = animelem=11 && var(6)=300
x = -5
[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = cond(var(6)<300,37,65)
guardflag = MA
priority = 4
pausetime = 12,12
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -13,-73
hitsound = S2, 2
getpower=ceil(20*fvar(0)),15 
givepower=10,5
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = 21+((var(21)=1)*8)
guard.ctrltime=20
ground.velocity = -3,cond(var(6)<300,0,-6.55)
air.velocity = -3,-6.55
air.hittime=cond(var(6)<300,25+((var(21)=1)*8),35)-(numexplod(1006)*10)
fall.recovertime=cond(var(6)<300,25+((var(21)=1)*8),35)-(numexplod(1006)*10)
forcenofall=var(6)<300
fall=var(6)=300
id=cond(var(6)=300,999,217)
yaccel=.47
 envshake.time = 6
envshake.ampl = 7
envshake.freq=85
[State 0, VarSet]
type = VarSet
trigger1 = movehit && var(6)=300
v = 11   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=11 && var(6)<300
trigger2 = animelem=15 && var(6)<300
movetype = I        ;I,A,H
;ignorehitpause = 
;persistent = 

[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0 
value = 0
ctrl = 1
;=========================================================================================================
; Kung Fu Palm
[Statedef 1001]
type    = S
movetype= I
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim = 905
ctrl = 0
sprpriority = 1
[State 0, AttackDist]
type = AttackDist
trigger1 =1 
value =0
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S200,24
channel = 0


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =1
value = S3,6
persistent=11
channel = 1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 = animelem =1
anim = 901
ID = 901
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,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 = animelem=2
trigger2 = animelem=6,10
trigger3 = animelem=6,22
anim = 903
ID = 903
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,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
ignorehitpause=1
persistent=12
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 = animelem=2
trigger2 = animelem=5
trigger3 = animelem=6,10
trigger3 = animelem=6,25
anim = 902
ID = 902
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,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
ignorehitpause=1
persistent=8

;anim =
;ignorehitpause = 
;persistent = 
[State 0, VarAdd]
type = VarAdd
trigger1 = animelem=6 
v = 6    ;fv = 
value = 100


[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;=========================================================================================================
; Kung Fu Palm
[Statedef 1002]
type    = S
movetype= I
physics = S
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim =951
ctrl = 0
sprpriority = 1


[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(2)<0 
x = -2
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(9)=1 && time <20 
value =951
elem =6
;ignorehitpause = 
;persistent =
;SUPER COOL AFTER IMAGE FLICKER EFFECT 
;[State 3000, Super B]
;type = AfterImage
;trigger1 = time = 0
;time = 2
;palcolor= 256
;palinvertall= 0
;palbright =  25, 45, 25
;palcontrast = 120,120,220
;palpostbright = 0,0,0
;paladd = 248,-30,-30
;palmul = 1,1,1
;timegap = 2
;framegap  = 3
;trans = add1
;ignorehitpause = 
;persistent =

[State 3000, Super B]
type = AfterImage
trigger1 = time = 0
time = 2
length=8
palcolor= 256
palinvertall= 0
palbright =  25, 45, 25
palcontrast = 120,120,220
palpostbright = 0,0,0
paladd = 32,32,225
palmul = 1,1,1
timegap = 4
framegap  = 3


[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(2)>0
time = 2
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S4,4
channel = 1
[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(2)>=0 
x = 6
[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(2)>0
value = 0
ignorehitpause = 1
;persistent = 
[State 0, CtrlSet]
type = CtrlSet
trigger1 =time=18 && var(6)>=200 
value = 1
;ignorehitpause = 
;persistent = 
[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0 
value = 0
ctrl =1
;=========================================================================================================
; Kung Fu Palm
[Statedef 1003]
type    = U
movetype= I
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim = 950+((statetype=A)*10)
ctrl = 0
sprpriority = 1

;ignorehitpause = 
;persistent = 
[State 3000, Super B]
type = AfterImage
trigger1 = time = 0
time = 2
length=15
palcolor= 256
palinvertall= 0
palbright =  25, 45, 25
palcontrast = 120,120,220
palpostbright = 0,0,0
paladd = 32,32,225
palmul = 1,1,1
timegap = 4
framegap  = 3
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S4,3
channel = 1

;abspan = 
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=4
anim =952
ID =952
pos = -15,-45
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =3
scale = .75,.75
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=4
anim =953
ID =952
pos = -15,-45
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime =3
scale = .75,.75
sprpriority = -1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(2)>0
time = 2
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4 && anim=950
statetype = A       ;S,A,C,L

[State 1028, Vel X]
type = VelSet
trigger1 = animelem=4
x = ((p2dist x)/9)
y = -5
;ignorehitpause = 
;persistent = 
[State 0, VelMul]
type = VelMul
trigger1 =1
x = .9
[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem=6
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(4)>0 
y = .47
;ignorehitpause = 
;persistent = 


[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 57
ctrl =1
;=========================================================================================================
; Kung Fu Palm
[Statedef 1004]
type    = A
movetype= A
physics = A
juggle  = 0;    4
poweradd= 0
facep2=1
anim =301
ctrl = 0
sprpriority = 1
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(5)<0
time = 2

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno=[600,699]
v = 21   ;v = 570
value = 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 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 2
persistent=0
ignorehitpause=1

;elem = 1
;ignorehitpause = 
;persistent = 

[State 630, 1]
type = PlaySnd
trigger1 = animelem=1
value = S200, 18
channel=0

[State 630, 1]
type = PlaySnd
trigger1 = animelem=3
value = 0, 2
channel=1
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =movehit=1 
anim =10000
ID = 1004
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
triggerall = var(21)=2
trigger1 = time=0 && var(21)=2 && numexplod(1004)>0
v = 21   ;v = 570
value =1
ignorehitpause =1

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



[State 610, 3]
type = HitDef
trigger1 = animelem=4
attr = S, NA
damage = 55
guardflag = HA
priority = 4
pausetime = 10,10
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -13,-53
hitsound = S2,4
getpower=ceil(25*fvar(0)),10 
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = 26
guard.ctrltime=20
ground.velocity = -2,8.75
air.velocity = -2.5,9.75
air.hittime=ifelse(numexplod(1004)<2,35,25)
fall.recovertime=ifelse(numexplod(1004)<2,35,25)
air.fall=1
id=997
yaccel=.47
 envshake.time = 6
envshake.ampl = 7
envshake.freq=85

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


;=========================================================================================================
; Kung Fu Palm
[Statedef 1005]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
facep2=1
anim =954
ctrl = 0
sprpriority = 1
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(5)<0
time = 2

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno=[600,699]
v = 21   ;v = 570
value = 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 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 3
persistent=0
ignorehitpause=1

;elem = 1
;ignorehitpause = 
;persistent = 

[State 630, 1]
type = PlaySnd
trigger1 = animelem=2
value = S200, 33
channel=0

[State 630, 1]
type = PlaySnd
trigger1 = animelem=2
value = 0, 2
channel=1
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =movehit=1 
anim =10000
ID = 1003
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
triggerall = var(21)=2
trigger1 = time=0 && var(21)=2 && numexplod(1004)>0
v = 21   ;v = 570
value =1
ignorehitpause =1

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(3)<0 
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1
x = -24
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = -1
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7
x = -6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8
x = 5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x =8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10
x = 12
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=11
x = 7
[State 610, 3]
type = HitDef
trigger1 = animelem=4
attr = S, NA
damage = 30
guardflag = MA
priority = 4
pausetime = 10,10
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -13,-53
hitsound = S2,4
getpower=ceil(25*fvar(0)),10 
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = 26
guard.ctrltime=20
ground.velocity = ifelse(var(21)=1,-1,-7),ifelse(var(21)=1,-10,0)
air.velocity = -1.5,-8.75
air.hittime=ifelse(numexplod(1003)<cond(var(21)=2,2,1),50,35)
fall.recovertime=ifelse(numexplod(1003)<cond(var(21)=2,2,1),50,35)
air.fall=1
id=200
yaccel=.47
 envshake.time = cond(var(21)=1,6,2)
envshake.ampl = 7
envshake.freq=85

[State 0, VarSet]
type = VarSet
trigger1 =numexplod(1003)<=1&& movehit && p2statetype=A
v = 19    ;fv = 10
value = 1
ignorehitpause = 1

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =1
;=========================================================================================================
; Kung Fu Palm
[Statedef 1006]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= 0
facep2=cond(frontedgebodydist <30,0,1)
anim =955
ctrl = 0
sprpriority = 1
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(5)<0
time = 2

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno=[600,699]
v = 21   ;v = 570
value = 0
[State 0, Width]
type = Width
trigger1 = 1
edge = 26,0
;value = 0,0
;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 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

;elem = 1
;ignorehitpause = 
;persistent = 

[State 630, 1]
type = PlaySnd
trigger1 = animelem=2
value = S200,19
channel=0

[State 630, 1]
type = PlaySnd
trigger1 = animelem=2
value = 0, 2
channel=1
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =movehit=1 
anim =10000
ID = 1005
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
triggerall = var(21)=2
trigger1 = time=0 && var(21)=2 && numexplod(1005)>0
v = 21   ;v = 570
value =1
ignorehitpause =1

[State 0, PosAdd]
type = PosAdd
trigger1 =animelemtime(5)<0 
x = 5.5

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5
x = 16
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7
x = -3
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x =-5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10
x = 13

[State 610, 3]
type = HitDef
trigger1 = animelem=4
attr = S, NA
damage = 35
guardflag = MA
priority = 4
pausetime = cond(var(21)=1,17,10),cond(var(21)=1,17,10)
sparkno = Scond(var(42)=0,7020+(random%4),1)
sparkxy = -13,-53
hitsound = S2,4
getpower=ceil(25*fvar(0)),10 
guardsound = S6, 0
guard.sparkno= S7500
animtype = Med
ground.type = High
ground.slidetime = 9
ground.hittime  = 18
guard.ctrltime=20
ground.velocity = -8,-9
air.velocity = -8,-9.75
air.hittime=25
fall.recovertime=25
fall=1
id=202
yaccel=.47
 envshake.time = 6
envshake.ampl = 7
envshake.freq=85
[State 0, VarSet]
type = VarSet
trigger1 =numexplod(1005)<=1&& movehit && p2statetype=A
v = 19    ;fv = 10
value = 1
ignorehitpause = 1
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
[State 2200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =1
;---------------------------------------------------------------------------
; Ground Bounce
[Statedef 1029]
type    = L
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=-1

;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11)
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type
[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-( prevstateno=1051)
x=-1

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

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


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



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


[State 0, VarSet]
type = Varadd
trigger1 = time=0 && (prevstateno=1100)
v = 6  ;fv = 10
value = -100

;ignorehitpause = 
;persistent = 


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


;ignorehitpause = 
;persistent = 



[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=250
triggerall = random<299 || prevstateno=1010 && var(2)=1
triggerall=time=0&&var(34)<=0
triggerall = AIlevel <6 ||p2stateno!=[120,155]
triggerall = fvar(22) >60  || prevstateno=1010 && var(2)=1
;trigger1 = var(4)=0 && (var(21)=0&&p2movetype=H&&(p2stateno!=[120,155])&&prevstateno=210)
trigger1 = prevstateno=1010&& var(2)=1  ;&& var(2)=2
trigger2  = var(6)>=200 && p2movetype=A && random <149
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0&&( prevstateno=1010 && var(2)=0)
triggerall =  var(34)<=0
trigger1 =  p2statetype=C  && var(2)<1
trigger2= prevstateno=1010  && var(2)=0
v = 2   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0 && prevstateno!=1010
triggerall =  var(34)<=0
trigger1 =  p2statetype=A  ;||var(2)=0
trigger2 = (prevstateno=210 || prevstateno=410) ;&& var(2)=0
v = 2   ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
triggerall =AILevel>0
trigger1=time=0 && cond(numhelper(10002),helper(10002),var(2)!=-1,0) 
trigger1 = var(2) < helper(10002),var(2) || prevstateno!=1010
v = 2   ;fv = 10
value = helper(10002),var(2)

[State 0, VarSet]
type = VarSet
triggerall = time =0
triggerall = AIlevel >0 && helper(10002),var(2)>-1
trigger1 = var(2)> helper(10002),var(2) && prevstateno=1010
v = 2   ;fv = 10
value = cond(var(2)<2,var(2)+1,2)
;ignorehitpause = 
;persistent = 

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

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = var(2)=2 && time =0
value = -250
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0
value = 1000+(var(2))+((var(6)=300)*5)


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =time=0 && var(21)=1  &&prevstateno!=1010&&prevstateno=[200,1100]
trigger2 = var(19)=1 && time = 0 && p2movetype=H && prevstateno!=1010
v = 21   ;v = 570
value = 0
ignorehitpause =1

[State 0, VarSet]
type = VarSet
trigger1 =numexplod(1010)<2&&var(2)=2 && movehit && var(6)>=200
trigger2 =numexplod(1010)<1&&var(21)=0&&var(2)=1 && movehit && p2statetype=A&& var(6)=[200,299]
trigger3 =numexplod(1010)<2&&var(21)=2&&var(2)=1 && movehit && p2statetype=A&& var(6)=[200,299]
v = 19    ;fv = 10
value = 1
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =time=0 && var(2)!=1&&prevstateno!=1010  &&prevstateno=[200,1100]
trigger2 =numexplod(1010)>2&&time=0
trigger3 =numexplod(1010)>0&&time=0&&var(21)=0&&var(2)=1
trigger4= var(21)<2
trigger4 = var(19)=1 && time = 0 && p2movetype=H && prevstateno!=1010 && var(6)<200
v = 19  ;v = 570
value = 0
ignorehitpause =1
[State 113, VarSet]
type = VarSet
trigger1 = numexplod(1010)>2 && time=0&& var(21)=2 && prevstateno!=1010
trigger2 = p2movetype=A 
trigger3= var(21)!=2 || numexplod(1010)>2
trigger3 = p2movetype=A && var(2)!=0
v =21   ;v = 570
value = 1


;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
trigger1 =(p2statetype=A||var(21)=2)&& movehit && var(2)=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 0, Explod]
type = Explod
trigger1 =(p2statetype!=A)&& movehit && prevstateno!=1010
anim =10000
ID =1011
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, 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, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=3 && var(2)=0&&var(6)=[100,299]
anim =1010
ID =1008
pos = -10,0
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 = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=3 && var(2)=0&&var(6)=300
anim =1010
ID =1008
pos = -10,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 4
vel = 2,-4
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=4&& var(2)=1&&var(6)=[100,299]
anim =1011
ID =1008
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 = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=4&& var(2)=1&&var(6)=300
anim =1015
ID =1008
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 = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=6&& var(2)=2&&var(6)=300
anim =1012
ID =1008
pos = 69,-66
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 3
vel = 0,0
accel = 0,0
random = 0,0
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Helper]
type = Helper
trigger1 = animelem=6&& anim=1007&&var(6)=300
helpertype = normal ;player
name ="Haoh-ken"
ID = 1012
stateno = 1012
pos =69,-66
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale=const(size.xscale)
size.yscale=const(size.xscale)
[State 1010, 1]
type = PlaySnd
trigger1 = animelem=1 && var(2)=0
value = 0, 2
channel=1
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=1 && var(2)=0
value = 200,40
channel=0
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)=1
value = 200,41
channel=0

[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)>=2
value = 200,49+random%2
channel=0

[State 0, Helper]
type = Helper
triggerall = var(42)=0
triggerall = var(2)=2
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, Width]
type = Width
trigger1 = 1
edge = 25,0
;value = 0,0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =time=0
v =15   ;fv = 10
value = 36-(numexplod(1001)*7)
ignorehitpause=1

[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=1
trigger2=animelemtime(2)>=0 && animelemtime(4)<0  && var(2)=0 && time%4=0
anim = 8300
ID = 8300
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 = .6,.6
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

;[State 0, VelSet]
;type = posadd
;trigger1 =animelemtime(3)>=0 && animelemtime(6)<0  && var(2)=1
;x = 15

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(1)>=0 && animelemtime(4)<0  && var(2)=0
x = cond(var(6)>=200,7.25,cond((var(6)=[100,199]),5.25,4.5))
;ignorehitpause = 
;persistent = 

;[State 0, VelSet]
;type = VelSet
;trigger1 = animelemtime(3)>=0 && animelemtime(5)<0  && var(2)=2
;x = 9.5
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3)>=0 && animelemtime(5)<0  && var(2)=2
x = 4
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(7)>=0 && animelemtime(8)<0  && var(2)=2
x = 8


;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = posadd
trigger1 =animelem=2 && var(2)=0
x = 23
[State 0, VelSet]
type = posadd
trigger1 =animelem=3&& var(2)=0
x = -6
[State 0, VelSet]
type = posadd
trigger1 =animelem=5&& var(2)=0
x = -1
[State 0, VelSet]
type = posadd
trigger1 =animelem=6&& anim=1000
trigger2 =animelem=4&& var(2)=1
x = 2
[State 0, VelSet]
type = posadd
trigger1 =animelem=7&& anim=1000
x = -8
[State 0, VelSet]
type = posadd
trigger1 =animelem=8&& anim=1000
x = -10

[State 0, VelSet]
type = posadd
trigger1 =animelem=6&& anim=1005
x = 5
[State 0, VelSet]
type = posadd
trigger1 =animelem=7&& anim=1005
trigger2= animelem=11&& anim=1006
x = -4
[State 0, VelSet]
type = posadd
trigger1 =animelem=9&& anim=1006
x = 2

[State 0, VelSet]
type = posadd
trigger1 =animelem=3&& var(2)=1
trigger2=animelem=2&& var(2)=2
x =7

[State 0, VelSet]
type = posadd
trigger1 =animelem=5&& var(2)=1
x = -9
[State 0, VelSet]
type = posadd
trigger1 =animelem=6&& anim=1001
x = 9
[State 0, VelSet]
type = posadd
trigger1 =animelem=7&& anim=1001
x = 32
[State 0, VelSet]
type = posadd
trigger1 =animelem=9&& var(2)=1
x =2

[State 0, VelSet]
type = posadd
trigger1 =animelem=11&& anim=1001
x = -36

[State 0, VelSet]
type = posadd
trigger1 =animelem=6&& anim=1006
x = 40
[State 0, VelSet]
type = posadd
trigger1 =animelem=7&& anim=1006
x = 1

[State 0, VelSet]
type = posadd
trigger1 =animelem=12&& anim=1006
x = -32





[State 0, VelSet]
type = posadd
trigger1 =animelem=3 && var(2)=2
trigger2 =animelem=10&& var(2)=1
x = -7

[State 1010, 6] ;Opponent near
type = HitDef
triggerall = var(2)=0
trigger1 = !movecontact
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = 30, 10
priority  = 4
hitflag=MAF
guardflag = MA
pausetime = 5,5
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 5
getpower=ceil(25*fvar(0)),10
givepower=20,5
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 22-(numexplod(1001)*3)
guard.ctrltime=20
down.hittime=20
ground.velocity =cond(anim=1005,-3,-4.5),cond(anim=1005,-5.7,0)
air.velocity =cond(anim=1005,-3,-3.25),-5.75
down.velocity=-3,-12.8
guard.velocity=-5
air.fall=1
fall=cond(anim=1005,1,0)
forcenofall=ifelse(p2statetype!=A&&anim=1000,1,0)
fall.recovertime=cond(var(21)>=1,40,28)
air.hittime=cond(var(21)>=1,40,28)
down.hittime=50
yaccel=.47
id=200
envshake.time = 5
envshake.ampl = 7
envshake.freq=85

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

[State 0, VarSet]
type = VarSet
trigger1 =time=0 && var(2)=1
v =58   ;fv = 10
value = 37-(numexplod(1010)*5)
ignorehitpause=1
[State 1010, 7] ;Opponent near
type = HitDef
triggerall = var(2)=1
trigger1 = animelem=5
attr = S, SA
air.animtype=up
animtype  = Hard
damage    =45, 15
priority  = 5
guardflag = HA
pausetime = 5,5
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -16,-47
hitsound =S2, 5
getpower=ceil(35*fvar(0)),15
givepower=25,5
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 29+((p2statetype=C)*6) - (4*(numexplod(1011)))
guard.ctrltime=22
ground.velocity =cond(anim=1006,-8,-2),cond(anim=1006,-6,0)
air.velocity =cond(anim=1006,-8,-2),cond(anim=1006,-6,7.5)
fall.recovertime=35
guard.velocity=-4
air.fall=1
yaccel=.47
id=ifelse(anim=1001,210,202)
envshake.time =8
envshake.ampl = 5
envshake.freq=85



[State 1010, 8] ;Opponent near
type = HitDef
triggerall = var(2)>=2
trigger1 = animelem=7
attr = S, SA
air.animtype= up
animtype  = Hard
damage    = cond(var(6)<300,50,35), 30
priority  =6
guardflag = MA
pausetime = 5,8
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -16,-47
getpower=0,0
givepower=5,5
hitsound =S2, 5
guardsound = S6, 0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 12
guard.ctrltime=12
ground.velocity = -7,-5
air.velocity = -7,-5
guard.velocity=-5
air.fall=1
fall.recover=0
yaccel=.47
id=215
envshake.time =8
envshake.ampl = 9
envshake.freq=85


[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && ((p2stateno!=[833,834])&&p2stateno!=1036&&p2stateno!=[1025,1030])
value =cond(anim=1007,20010,cond(var(6)=200,1025,1036))
ID =215
ignorehitpause =0
persistent=0

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])&& var(21)=0&&var(2)!=0
value =201
ID =998
ignorehitpause =1 
persistent=0
;
[State 0, TargetState]
type = TargetState
trigger1 =movehit=1 && (p2stateno!=1035) &&p2statetype!=A && var(21)=2 && numexplod(1010)<2
value =1035
ID =210
ignorehitpause =1 
persistent=0
 
[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -cond(p2stateno=3056,4,6)


[State 1028, Vel X]
type = VelSet
triggerall = anim!=5052 && p2stateno=3056
trigger1 = Time = 0
x = (p2dist x*((1*1.0)/(12*1.0)))
[State 1028, Vel X]
type = VelSet
triggerall = anim=5052&& p2stateno=3056
trigger1 = Time = 0
x = -(p2dist x*((1*1.0)/(12*1.0)))

[State 1028, Vel X]
type = VelSet
triggerall = anim!=5052&& p2stateno!=3056
trigger1 = Time = 0
x = ifelse(p2stateno=3056&&fvar(22) >60,7,1.6)

[State 1028, Vel X]
type = VelSet
triggerall = anim=5052&& p2stateno!=3056
trigger1 = Time = 0
x = -ifelse(p2stateno=3056&&fvar(22) >60,7,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    = A
movetype= H
physics = N
poweradd= 0
ctrl = 0
sprpriority =-1
[State 0, Turn]
type = Turn
trigger1 =facing= enemy,facing 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& 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!=405 && enemy,prevstateno!=405
trigger1 = time=2&& anim=5030
value = ifelse(selfanimexist(5161),5161,5160)

[State 0, VelSet]
type = VelSet
trigger1 = time=0 && anim=5030
y=10
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 && p2stateno!= 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


[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 = 1029
;---------------------------------------------------------------------------
; hitshakestae for trip or fast fall
; CNS difficulty: easy
[Statedef 1034]
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 = 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 = S
juggle  = 0;    5
poweradd=0
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
;facep2=1
[State 0, VarSet]
type = Varadd
trigger1 = time=0 && (prevstateno=1010)
v = 6  ;fv = 10
value = -100


[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5 
x = -10
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6 
x = 24
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7
x = 9
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x = -1
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10
x = -8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=11
x = -9

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=12
x = -15


[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A  && var(2)=3
v =21   ;v = 570
value = 2


[State 113, VarSet]
type = VarSet
triggerall = var(21)!=2
trigger1 = p2movetype=A  && var(2)<3
v =21   ;v = 570
value = 1

 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1050)>=2 && 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]
trigger2 = p2movetype!=A && animelemtime(5)<0
v = 21   ;v = 570
value = 0
ignorehitpause =1

[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=4
anim =1061+var(2)
ID =1008
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 = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 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 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command = "DP_y",0,ifelse(command="DP_z",1,2));

    ;S,A,C,L
;ignorehitpause = 
;persistent = 


;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0||var(2)=0
triggerall = fvar(22)<50 || p2stateno=[120,155]
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 =  (p2movetype=A) 
v = 2   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && prevstateno!=410
triggerall=time=0
trigger1 =  p2statetype=A &&p2stateno!=5201 && root,fvar(22)>60 || p2stateno=5201 && enemy,time>13
trigger2= p2movetype!=A
trigger3 = ((prevstateno=210||prevstateno=430||prevstateno=205)||p2movetype=I) && fvar(22)>50
v = 2   ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = power >=250
triggerall =  var(31)=0
triggerall = random<499 
triggerall = p2stateno!=5201 || enemy,time >13
triggerall=time=0
trigger1 = (var(21)=0&&p2movetype=H&&prevstateno=[200,410])
trigger2 = p2movetype=A
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
trigger1=time=0 && cond(numhelper(10002),helper(10002),var(2)!=-1,0) && AILevel>0
v = 2   ;fv = 10
value = helper(10002),var(2)
[State 0, VarSet]
type = VarSet
trigger1 = var(2)=2 && power <250 && time=0
v = 2    ;fv = 10
value =1

[State 1000, 1]
type = PlaySnd
trigger1 = time=6

value = 0, 2
channel=1

[State 1000, 1]
type = PlaySnd
trigger1 = time=0
value = 200, 42+var(2)
channel=0


[State 0, Helper]
type = Helper
triggerall = var(42)=0
triggerall = var(2)=2
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, Width]
type = Width
trigger1 = 1
edge = 25,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)>0 && time=0
value = 1050+var(2)

[State 0, PowerAdd]
type = PowerAdd
triggerall=anim=1052 && animelemtime(1)=1
trigger1 = var(2)=2
value = -250
[State 0, EnvShake]
type = EnvShake
triggerall = var(2)=2
trigger1 = animelem=7
time =4
freq = 110
ampl = 5
phase = 90
[State 0, Helper]
type = Helper
trigger1 = animelem=7
helpertype = normal ;player
name = "impact"
ID =1013
stateno =1013
pos = 44,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale=cond(var(2)=0,.42,.5)
size.yscale=cond(var(2)=0,.4,.5)


[State 1010, 8]
type = ChangeState
trigger1 = animtime=0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;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 0, PosAdd]
type = PosAdd
trigger1 = time=0 && enemy,var(11) && p2stateno!=610
y = -const(size.mid.pos.y)-10
 ;5051 - 4 + type
[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 >=20
value = cond(p2stateno=831,1030,302)
;---------------------------------------------------------------------------
;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)
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1053]
type    = A
movetype= H
physics = N

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 1056
;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = selfState
trigger1 = p2stateno!=1050
value = 5050
;---------------------------------------------------------------------------
; Kung Fu Palm
[Statedef 1100]
type    = A
movetype= A
physics = N
juggle  = 0;    4
poweradd= 0
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 1


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


[State 113, VarSet]
type = VarSet
trigger1 = p2movetype=A && (anim=1101)
v =21   ;v = 570
value =2
[State 0, VarSet]
type = VarSet
trigger1 = (anim=1101)
v =27   ;fv = 10
value = var(21)=2

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 =  numexplod(1100)<2&&time=5 && var(6)=200&& var(18)=0
trigger2 =p2movetype=A && (anim!=1101) && numexplod(1100)=0
v = 21   ;v = 570
value = 1
ignorehitpause =1
 [State 0, VarSet]
type = VarSet
trigger1 = numexplod(1100)=2 && 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,640]
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelemtime(2)>=0&&animelemtime(3)<0
anim =1110
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelemtime(3)>=0&&animelemtime(4)<0
anim =1111
ID =1008
pos = -5,-15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelemtime(4)>=0&&animelemtime(5)<0
anim =1112
ID =1008
pos = -10,-10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelemtime(5)>=0&&animelemtime(6)<0
anim =1113
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelemtime(6)>=0&&animelemtime(7)<0
anim =1114
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 =var(21)>=1 && movehit 
anim =10000
ID = 1100
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
trigger1 =(p2statetype=A||p2statetype=L)&& movehit  && var(2)=2
anim =10000
ID =1001
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

;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
triggerall=var(2)!=2
triggerall = AILevel>0 && var(31)=0
triggerall = p2statetype!=L
triggerall=time=0||var(2)=0 || anim=1102
trigger1= (((fvar(22)/ fvar(21)) > 0.5 && (fvar(22) / fvar(21)) <= 1.24) && fvar(22) > 0) 
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=var(2)!=2
triggerall=time=0|| anim=1101
trigger1 = ((fvar(22) / fvar(21)) > 0.2 && (fvar(22) / fvar(21)) <= 1.75 && fvar(22) > 0)
trigger2 =  FrontEdgeBodyDist < 60 && fvar(22) <= (FrontEdgeBodyDist - 30)
trigger3 = p2statetype=L
triggerall =  var(34)<=0
v = 2   ;fv = 10
value = 1

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 =animelemtime(7)<0&&prevstateno=[1000,1009]
time = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0|| anim=1100
triggerall = p2statetype!=L
trigger1 = (((fvar(22) / fvar(21)) > .4 && (fvar(22) / fvar(21)) <= 1.25) && fvar(22) > 0) 
trigger2= FrontEdgeBodyDist < 40 && fvar(22) <= (FrontEdgeBodyDist - 10)
v = 2   ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1=time=0 && cond(numhelper(10002),helper(10002),var(2)!=-1,0) && AILevel>0
v = 2   ;fv = 10
value = helper(10002),var(2)
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command="QCB_y",0,ifelse(command = "QCB_z",1,2))


[State 1000, 1]
type = PlaySnd
trigger1 = animelem=2 &&anim=[1050,1052]
value = 0, 2
channel=1
[State 1000, 1]
type = PlaySnd
trigger1 = animelem=5
value = 0, 2
channel=1
[State 1000, 1]
type = PlaySnd
trigger1 = time=0 && var(2)!=1
value = 200, 16
channel=0

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

[State 0, Helper]
type = Helper
triggerall = var(42)=0
triggerall = var(2)=2
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 =  time=0
value = 1100+var(2)

[State 0, PowerAdd]
type = PowerAdd
triggerall=anim=1102&&time=0
trigger1 = var(2)=2
value = -250



[State -1]
Type = VelSet
Trigger1 = AnimElem = 2
X = -.5
y=-ifelse(var(2)=0,1,ifelse((var(2)=1),4,2))
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>=0&&animelemtime(5)<0 
y = .35
[State -1]
Type = VelSet
Trigger1 = AnimElem = 7
X = ifelse(var(2)=0,9.5,ifelse((var(2)=1),10.25,13.25))
y=ifelse(var(2)=0,8.5,ifelse((var(2)=1),10,14.5))
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
statetype = A 



;ignorehitpause = 
;persistent = 


[State 1050, 4]
type = HitDef
trigger1 = animelem=7&& anim=1100
attr = A, SA
animtype  = Medium
damage    =45, 5
priority  = 5
guardflag = MA
pausetime = 6,6
guard.sparkno= S7510
sparkno = Scond(var(42)=0,7020+(random%4),1)
getpower=ifelse(var(2)=3,0,8),ifelse(var(2)=3,0,5) 
givepower=5,5
sparkxy = -10,-55
hitsound = S2, 4
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = ifelse(var(21)=1,40,ifelse(var(21)=2,31,25))
ground.velocity = cond(var(21)=0,-1,-5),cond(var(21)=0,9.5,-3)
air.velocity = -cond(var(21)=0,1,7),9.5
airguard.velocity=-1.25,-6
fall = 1
nochainid=201
fall.recover=0
guard.velocity=-4
nochainID = 999
yaccel=.47
id=201
persistent=0
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[201,204])&& (p2stateno!=1036&&p2stateno!=[833,834])
value =cond(var(21)=1,1036,201)
ID =201
ignorehitpause=0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y < 10 && animelem=8
value = anim
elem = 7
ignorehitpause=1
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(7)>=0&&animelemtime(8)<0 
y = .55
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelemtime(7)>=0&&animelemtime(8)<0
anim =1115
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 1050, 4]
type = HitDef
trigger1 = animelem=7&& anim=1101
attr = A, SA
animtype  = Medium
damage    =55, 5
priority  = 5
guardflag = HA
hitflag= MAFD
pausetime = 5,5
guard.sparkno= S7510
sparkno = Scond(var(42)=0,7020+(random%4),1)
getpower=ifelse(var(2)=3,0,20),ifelse(var(2)=3,0,5) 
givepower=5,5
sparkxy = -10,-55
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
nochainid=202
ground.velocity = -7.5,9.5
air.velocity = -1.5,11
airguard.velocity=-1.5,-4
air.hittime=ifelse(numexplod(1100)<=1&&(var(21)>0||var(6)>=200),90,35)
fall = 1
fall.recovertime=ifelse(numexplod(1100)<=1&&(var(21)>0||var(6)>=200),90,35)
guard.velocity=-4
yaccel=.47
id=cond(p2statetype=A&&statetype=A&&(p2stateno!=[20010,20014]),208,209)
persistent=0
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1029,1033])&& (p2stateno!=[860,863])
value =1033
ID =209
ignorehitpause=1
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[1029,1032])&& (p2stateno!=1051&& p2stateno!=[301,303])
value =1051
ID =208
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 = movehit=1 && ((p2stateno=[860,863])||p2stateno=[300,305])
v = 11    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = movehit=1 && p2stateno=[1020,1035]
v = 11    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1 =time=0 && var(2)=2
v =58   ;fv = 10
value = 35-(numexplod(1001)*5)
ignorehitpause=1
 
[State 1050, 4]
type = HitDef
trigger1 = animelem=7&& anim=1102
attr = A, SA
animtype  = Medium
damage    = 45, 5
priority  = 5
guardflag = MA
pausetime = 5,cond(p2statetype=A,45-(numexplod(1001)*5),5)
guard.sparkno= S7510
sparkno = Scond(var(42)=0,7020+(random%4),1)
getpower=0,0
sparkxy = -10,-55
givepower=5,5
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4.5
air.velocity = -3,10
airguard.velocity=-1.5,-4
air.fall = 1
fall.recovertime=ifelse((var(21)>0),130,50)
air.hittime=ifelse((var(21)>0),130,50)
guard.velocity=-4
yaccel=.47
id=1100
persistent=0
[State 0, VarSet]
type = VarSet
trigger1 =var(2)=3
v = 11   ;fv = 10
value = 1
[State 0, TargetState]
type = TargetState
trigger1 = movehit=1 && (p2stateno!=1035) && p2statetype!=A
value =1035
ID =1100
ignorehitpause=1
[State 0, TargetState]
type = TargetState
trigger1 = movehit=1 && (p2stateno!=[1029,1034]) && p2statetype=A 
value =1034
ID =1100
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=8
anim = 8301
ID = 8300
pos = -15,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -1.25,0
accel = 0,0
random = 0,0
scale = .4,.55
sprpriority =5
ontop =1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 200, 1]
type = PlaySnd
trigger1 =animelem=8 && var(2)>0
value = 191, 1
channel=2
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=8 && var(2)>0
time =5
freq = 60
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=8
anim =1120
ID =1008
pos = 10,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
statetype = S 
movetype=I      ;S,A,C,L
[State 0, MoveHitReset]
type = MoveHitReset
trigger1 =  animelem=8
;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

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

[State -1]
Type = VelSet
Trigger1 = AnimElem = 8
X = 0
y=0

[State 0, PosSet]
type = PosSet
trigger1 = Animelemtime(8)>= 0
y = 0
;ignorehitpause = 
;persistent = 

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 1101]
type    = S
movetype= H
physics = S
juggle  = 0; ifelse(prevstateno = 102,0,5)
poweradd=25
ctrl = 0
sprpriority = 2

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

;ignorehitpause = 
;persistent = 

[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0
x = 1
;ignorehitpause = 
;persistent =

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

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = animelemtime(2)>0 && anim=5012
value = 5012
elem = 2
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = HitshakeOver  && (gethitvar(hittime)<12) && anim=5012
value = 5016


;persistent = 

[State 1200, 3]
type = selfState
trigger1 = (gethitvar(hittime)<=0) && anim=5016
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 = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=2
anim = 3050
sprpriority = 2

;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1 && p2movetype=H
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1 && p2movetype=H
v = 19   ;v = 570
value = 0
ignorehitpause =1
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1



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

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


;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=6 && time <42
value = anim
elem = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(6)<0 && time >44
value = anim
elem = 6
;-------------------------------------------------
 
;persistent =
[State 0, SuperPause]
type = SuperPause
trigger1 = time=1
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = -500
unhittable = 1
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 = time=2
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
triggerall = var(42)=0
trigger1 = time=2
anim = 8002
ID =8002
pos = 0,-75
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

;ignorehitpause = 
;persistent = 

[State 0, VarAdd]
type = VarAdd
trigger1 = time=3
v =  6   ;fv = 
value = 200
;ignorehitpause = 
;persistent = 
[State 0, VarAdd]
type = Varset
trigger1 = time=3
v =  7   ;fv = 
value = var(6)
[State 1010, 8]
type = ChangeState
trigger1 =animtime=0
value = 0
ctrl = 1

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




[State 200, 1]
type = PlaySnd
trigger1 = animelem=9
value = 200, 19
channel=0

[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, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =animelem=2
value =-ceil(45*fvar(2))
kill=0
[State 0, TargetBind]
type = TargetBind
trigger1 = time=0
pos = 63,-37
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 =animelem=9
anim = 3076
ID = 8300
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -.45,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 -2, Helper]
type = Helper
trigger1 = animelem=9
helpertype = normal ;player
name = "KABOOM"
ID = 3010
stateno = 3010
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
ignorehitpause = 1
persistent=0
size.yscale=.7
size.xscale=.7
[State 1010, 8]
type = ChangeState
trigger1 =time>110
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 3002]
type    = A
movetype= H
physics = N
velset = .5,-6.35


[State 0, VelAdd]
type = VelAdd
trigger1 =1 
y = .2
;ignorehitpause = 
;persistent = 

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

;ignorehitpause = 
;persistent = 

[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 =pos y >=0
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
poweradd = 40

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


[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0 && (p2stateno=810 || p2stateno=610)
y = const(size.mid.pos.y)+10



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

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

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

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

;ignorehitpause = 
;persistent = 

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

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

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

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

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

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

;---------------------------------------------------------------------------
[Statedef 3050]
type    =S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=2
anim = 3000
sprpriority = 1
;for juggles only
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = Varadd
trigger1 = time=0 && (prevstateno=[1010,1100])
v = 6  ;fv = 10
value = -100

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

;ignorehitpause = 
;persistent = 



[State 0, SuperPause]
type = SuperPause
trigger1 = animelem=3 && statetype!=A
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = -500
unhittable = 1


[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 = animelem=3
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
triggerall = var(42)=0
trigger1 = animelem=3
anim = 8002
ID =8002
pos = 0,-27
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
triggerall = var(42)=0
trigger1 = animelem=6
anim = 8301
ID = 8300
pos = 10,15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 1.25,0
accel = 0,0
random = 0,0
scale = .45,.55
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1=animelem=6
anim = 8301
ID = 8300
pos = -10,15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -1.25,0
accel = 0,0
random = 0,0
scale = .45,.55
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 182, 2]
type = notHitBy
trigger1 = animelem=2
value = SCA
time = 3
[State 182, 2]
type = notHitBy
trigger1 = animelem=5
value = SCA
time = cond(var(6)<100,6,cond((var(6)=[100,199]),7,cond((var(6)=[200,299]),8,10)))

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


[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(3)>=0 
time = 2
;-------------------------------------------------


;abspan =
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype=A
v =21   ;fv = 10
value = 1
[State 0, Helper]
type = Helper
trigger1 = movehit
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 1050, 4]
type = HitDef
trigger1 = animelem=5
attr =A, HA
animtype  = Medium
damage    =35, 5
priority  = 5
guardflag = MA
pausetime = 6,6
guard.sparkno= S7510
sparkno = Scond(var(42)=0,7020+(random%4),1)
getpower=0,0
givepower=20,20
sparkxy = -10,-55
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 25
ground.velocity = -1,-9
air.velocity = -1,-9
airguard.velocity=-1.25,-6
fall = 1
fall.recovertime=65
guard.velocity=-4
nochainID = 999
yaccel=.42
id=201
p2facing = 1
forcestand=1
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =201
ignorehitpause =1 

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 6
x = 2
y=-10
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(6)>0 
y = .5
;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = ChangeState
trigger1 =movehit && animelemtime(11)>0 && enemy,alive
value =3051
;anim =
;ignorehitpause = 
;persistent = 


[State 200, 1]
type = PlaySnd
trigger1 = animelem=2
value = 201, 5
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=5
value = 3, 3
channel=1

[State -2, Helper]
type = Helper
triggerall = var(42)=0
trigger1 = animelem=8
helpertype = normal ;player
name = "kickfx"
ID = 3011
stateno = 3011
pos = -30,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 0
persistent=0
size.yscale=const(size.xscale)*.5
size.xscale=const(size.yscale)*.5

[State 2200, end]
type = ChangeState
trigger1 = pos y >=0 && animelemtime(6)>0
value = 52
ctrl =0
;---------------------------------------------------------------------------
[Statedef 3051]
type    = A
movetype= A
physics = N
poweradd= 0
ctrl = 0
juggle=0
anim = 3001
sprpriority = 2
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype=A
v =21   ;fv = 10
value = 1
[State 0, Helper]
type = Helper
trigger1 = movehit
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
trigger1 =1
v =4    ;fv = 10
value = 0
;ignorehitpause =
;persistent =
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = 1
time = 2

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


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

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 1
value = 0, 2
channel=1
volumescale=75

;ignorehitpause = 
;persistent = 


[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = vel x*.35
y = vel y*.25
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1=animelem=3
anim =3011
ID =1008
pos = 28,-64
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
vel=3,0
bindtime = 12
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 200, 1] ;201
type = HitDef
trigger1 = animelem=3
attr = S, HA
damage = 100
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 5, 5
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -15, -75
hitsound = S2, 6
getpower = 0
givepower=0,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=-14,-2
air.velocity=-14,-2
yaccel=.4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
p2facing=1
fall.recovertime=100
id=202
kill = cond(var(6)<100,1,0)
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <10 && animelem=14 && var(6)<100
value = anim
elem = 13
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(6)>0 && animelemtime(14)<0
y = .3
[State 2200, end]
type = ChangeState
trigger1 = pos y >=0 && animelemtime(10)>0 && var(6)<100
value = 52
ctrl = 0
;---second follow up 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <10 && animelem=9 && var(6)>=100
value = anim
elem = 14
[State 200, 1]
type = PlaySnd
trigger1 = animelem = 15
value = 200,24
channel=0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 15
value = 0, 2
channel=1
volumescale=75
[State 1028, Vel X]
type = VelSet
trigger1 = animelem=15
x = ((p2dist x)/15)
y = -5

;ignorehitpause = 
;persistent = 
[State 0, VelMul]
type = VelMul
trigger1 =animelemtime(14)>0 && animelemtime(17)<0
x = .95
;ignorehitpaus
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(15)>0 && animelemtime(18)<0
y = .5
;ignorehitpause = 
;persistent = 


[State 200, 1] ;201
type = HitDef
trigger1 = animelem=18
attr = S, HA
damage = 65
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 12, 12
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -15, -75
hitsound = S2, 6
getpower = 0
givepower=0,0
guardsound = S6, 0
ground.type = High
ground.slidetime = 99
ground.hittime  = 30
guard.ctrltime =8
air.hittime=30
air.type = High
air.animtype=up
ground.velocity=-3,7
air.velocity=-3,8.5
yaccel=.5
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
p2facing=1
fall.recovertime=30
id=997
kill = cond((var(6)=[100,199]),1,0)
envshake.time = 10
envshake.ampl = 5
envshake.freq=100

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <10 && animelem=19 
value = anim
elem = 18
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(15)>0 && animelemtime(18)<0
y = .5
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=10  && animelemtime(18)>0 && animelemtime(19)<0 && var(6)>=100
value = anim
elem = 19
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=19 && var(6)<300
statetype =S
movetype = I
physics =S
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=19 && var(6)<300
statetype =S
movetype = A
physics =S
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=19
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=19
y = 0

[State -2, Helper]
type = Helper
trigger1 = animelem=19 && var(6)>=200
helpertype = normal ;player
name = "pillar"
ID = 3011
stateno = 3013
pos = 60,-10
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 0
persistent=0
;size.yscale=const(size.xscale)*.5
;size.xscale=const(size.yscale)*.5
;---final follow up
[State 200, 1]
type = PlaySnd
trigger1 = animelem = 29
value = 200,34
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem = 31
value = 201,0
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem = 30
value = 0, 2
channel=1
volumescale=75
[State 0, SuperPause]
type = SuperPause
trigger1 = animelem=29
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = 0
unhittable = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = facing=1 && screenpos x >200 && animelemtime(29)>=0&&animelemtime(30)<0
trigger2 = facing=-1 && screenpos x <120 && animelemtime(29)>=0&&animelemtime(30)<0
x = -3
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 =  animelemtime(30)>=0&&animelemtime(32)<4
x = 15
[State 0, PosAdd]
type = PosAdd
trigger1 =  animelemtime(32)>=4&&animelemtime(35)<0
x = 2
[State 0, Explod]
type = Explod
trigger1 = animelem=29
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 = animelem=29
anim = 8002
ID =8002
pos = 0,-75
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
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1=animelem=31
anim =3002
ID =1008
pos = 28,-64
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
vel=5,0
bindtime = 12
scale = .5,.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, VelSet]
type = posadd
trigger1=animelem=27
x =7

[State 0, VelSet]
type = posadd
trigger1 =animelem=28 
x = -7

[State 200, 1] ;201
type = HitDef
trigger1 = animelem=32
attr = S, HA
damage = 35
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 10, 15
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -15, -75
hitsound = S2, 6
getpower = 0
givepower=0,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=-14,-2
air.velocity=-14,-2
yaccel=.4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
p2facing=1
fall.recover=0
id=1100
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
;----------------------------



;[State -2, Helper]
;type = Helper
;trigger1 = animelem=3&& anim!=3012
;helpertype = normal ;player
;name = "kickfx"
;ID = 3011
;stateno = 3011
;pos = -30,-10
;postype =p1   ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;ignorehitpause = 0
;persistent=0
;size.yscale=const(size.xscale)*.5
;size.xscale=const(size.yscale)*.5
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[3003,3005])
value =3003
ID =1100

;ignorehitpause = 
;persistent = 



[State 1050, 5]
type = ChangeState
trigger1 =animtime = 0 && var(6)=300
trigger2 = animelem=25 && var(6)<300
value = 0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 3052]
type    = A
movetype=H
physics = N
poweradd= 0
ctrl = 0
juggle=0

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

[State 0, SelfState]
type = SelfState
trigger1 = p2stateno!=3051
value =5050
;anim =
;ctrl =
;ignorehitpause = 0
;persistent = 1
;elem = 1
;ignorehitpause = 
;persistent = 
;---------------------------------------------------------------------------
[Statedef 3055]
type    =S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=2
anim = 3020
sprpriority = 1
;for juggles only
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -var(36)
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = Varadd
trigger1 = time=0 && (prevstateno=[1010,1100])
v = 6  ;fv = 10
value = -100


;ignorehitpause = 
;persistent = 



[State 0, SuperPause]
type = SuperPause
trigger1 = animelem=2 
time = 45
anim = -1
sound = S999,0
pos = 0,0
movetime =45
p2defmul = 1
darken=0
poweradd = -500
unhittable = 1

[State 0, Explod]
type = Explod
triggerall = var(42)=0
trigger1 = animelem=2
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
triggerall = var(42)=0
trigger1 = animelem=2
anim = 8002
ID =8002
pos =-10,-27
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
triggerall = var(42)=0
trigger1 = animelem=4
anim = 8301
ID = 8300
pos = 10,15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 1.25,0
accel = 0,0
random = 0,0
scale = .45,.55
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
supermovetime=45


[State 182, 2]
type = notHitBy
trigger1 = animelem=16
trigger2= movehit
value = SCA
time = 4
ignorehitpause=1
[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(5)>0 && animelemtime(18)<0
value = 0
;ignorehitpause = 
;persistent = 
;JUST IN CASE YOU NEVER KNOW WITH FUCKING MUGEN AMIRITE
[State 182, 2]
type = notHitBy
trigger1 = animelemtime(2)>0 && animelemtime(16)<0
value = SCA
time = 4
[State 3000, Super B]
type = AfterImage
trigger1 = animelem=2
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0


[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelemtime(3)>=0 
time = 2
;-------------------------------------------------
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(3)>0&&animelemtime(11)<0 
x = 2
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = Posset
trigger1 = animelem=11
x = enemy,pos x -(57*facing)
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(12)>0&&animelemtime(15)<0 
x = 1.5
;abspan =
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype=A
v =21   ;fv = 10
value = 1
[State 0, Helper]
type = Helper
trigger1 = movehit
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 1050, 4]
type = HitDef
trigger1 = animelem=20
attr = S, HA
animtype  = Medium
damage    =40, 5
priority  = 5
guardflag = LA
pausetime = 10,10
guard.sparkno= S7510
sparkno = Scond(var(42)=0,7020+(random%4),1)
getpower=0,0
givepower=20,20
sparkxy = -10,-55
hitsound = S2, 6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 25
guard.ctrltime=12
ground.velocity = -1
air.velocity = -1,0
airguard.velocity=-1.25,-6
forcenofall=1
guard.velocity=-4
nochainID = 999
yaccel=.42
id=2011
p2facing = 1
forcestand=1
envshake.time = 7
envshake.ampl = 5
envshake.freq=100
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=16 
x = -24
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=17 
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=18
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=19 
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=20
x = -6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=23 
x = 11
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=24
x = 9
[State 0, TargetState]
type = TargetState
trigger1 = movehit=1 && (p2stateno!=3057)
value =3057
ID =2011
ignorehitpause =1 


;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = ChangeState
trigger1 =movehit  && enemy,alive
value =3056
;anim =
;ignorehitpause = 
;persistent = 


[State 200, 1]
type = PlaySnd
trigger1 = animelem=2
value = 201, 7
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=18
value = 3, 3
channel=1



[State 2200, end]
type = ChangeState
trigger1 = animtime=0
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3056]
type    =S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
sprpriority = 1
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 11    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 10000
ID = 1021
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -1
removeongethit = 0
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0
[State 0, PlayerPush]
type = PlayerPush
trigger1 = pos y !=0
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =animelemtime(20)<0 && var(19)=0
v = 19    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =animelemtime(20)>0 
v = 19    ;fv = 10
value = 0
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=16 && anim=3020
x = -24
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=17 && anim=3020
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=18&& anim=3020
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=19 && anim=3020
x = 6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=20&& anim=3020
x = -6
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=23 && anim=3020
x = 11
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=24&& anim=3020
x = 9
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 3021
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3&& anim=3021
trigger2 = animelem=9&& anim=3021
trigger3 = animelem=22&& anim=3021
value = S0,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3&& anim=3021
value = S200,22
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=22&& anim=3021
value = S200,19
channel = 0

;abspan = 
;ignorehitpause = 
;persistent = 

[State 200, 1] ;201
type = HitDef
trigger1 = animelem=5
attr = S, HA
damage = 35
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 12, 12
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -15, -60
hitsound = S2, 6
getpower = 0
givepower=0,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=-14,-5
air.velocity=-14,-5
yaccel=.4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
p2facing=1
fall.recovertime=100
id=215
kill =0
envshake.time = 10
envshake.ampl = 5
envshake.freq=100

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1025,1030])
value =1025
ID =215
ignorehitpause =1 
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1&& anim=3021
trigger2 =animelem=4&& anim=3021
x = 12
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2&& anim=3021
x = -4
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3&& anim=3021
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5&& anim=3021
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6&& anim=3021
trigger2 =animelem=7&& anim=3021
x = 1
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8&& anim=3021
x = -26

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = fvar(22)>55 ;;&& enemy,facing =-1||enemy,vel x>0 && enemy,facing =1)
trigger1 = animelem=9&& anim=3021
value = anim
elem = 8
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=9&& anim=3021
value = S200,17
channel = 0
;ignorehitpaus,e = 
;persistent = 
[State 200, 1] ;201
type = HitDef
trigger1 = animelem=10
attr = S, HA
damage = 40
animtype = medium
guardflag = MA
hitflag = MAFD
priority = 7, Hit
pausetime = 12, 12
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -15, -65
hitsound = S2, 6
getpower = 0
givepower=0,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=-3,-9
air.velocity=-3,-9
yaccel=.4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
p2facing=1
snap=45,-20
fall.recovertime=100
id=200
kill =0
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9&& anim=3021
x = 11
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10&& anim=3021
x = -2
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=12&& anim=3021
x = -8
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=13&& anim=3021
x = -10

[State 1028, Vel X]
type = VelSet
trigger1 = animelem=14&& anim=3021
x = ((p2dist x)/14)
y = -9
[State 200, 1] ;201
type = HitDef
trigger1 = animelem=25
attr = S, HA
damage = 60+((var(21)>0)*75)
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 12, 12
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -15, -65
hitsound = S2, 6
getpower = 0
givepower=45
guardsound = S6, 0
ground.type = High
ground.slidetime = 99
air.hittime=ifelse(numexplod(1021)<2,95,45)
fall.recovertime=ifelse(numexplod(1021)<2,95,45)
id=997
guard.ctrltime =8
air.type = High
air.animtype=up
ground.velocity=-3,10
air.velocity=-3,10
yaccel=.55
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
forcestand =1
fall=1
p2facing=1
fall.recovertime=100
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
;ignorehitpause = 
;persistent = 
[State 0, VelMul]
type = VelMul
trigger1 =animelemtime(14)>0 && animelemtime(17)<0&& anim=3021
x = .95

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(14)>0&&animelemtime(26)<0&& anim=3021
y = .47
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(26)>=0&&animelemtime(31)<0&& anim=3021
y = -.08
[State 0, VelSet]
type = VelSet
trigger1 = animelem=31
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=31
y = 0
 
[State 2200, end]
type = ChangeState
trigger1 = animtime=0&& anim=3021
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3057]
type    = S
movetype= H
physics = N
juggle  = 0;    0
ctrl = 0
sprpriority = 0
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 =time <40
value = 5012
;elem = 1
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
;ignorehitpause = 
;persistent = 

[State 0, SelfState]
type = SelfState
trigger1 =animtime=0
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
facep2=1
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 =time=0
time = 1

;-------------------------------------------------
[State 3000, Super A]
type = SuperPause
trigger1 = time = 1
pos = 0, -87
anim = -1
sound = S999, 0
poweradd = -1000
time = 45
movetime =45
unhittable =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 0, AssertSpecial]
type = AssertSpecial
trigger1 =time <48
flag = unguardable



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


[State 0, Explod]
type = Explod
trigger1=animelem=8
anim = 8303
ID = 8300
pos = 10,0
postype = p1  ;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, EnvShake]
type = EnvShake
trigger1 = animelem=8
time = 5
freq = 60
ampl = -6
phase = 90
;ignorehitpause = 
;persistent = 

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=8
value = 4, 6
channel=1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
statetype = A       ;S,A,C,L
physics = N
[State 0, VelSet]
type = VelSet
trigger1 = animelem=8
x = 7
y = -4
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(8)>0&& animelemtime(10)<0 
y = .43
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=10
x = vel x*.7
y=0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=10
y = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=10
statetype = S       ;S,A,C,L
physics = S
;ignorehitpause = 
;persistent = 



[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, HA
animtype  = Hard
damage    = 0, 4
priority  = 5
guardflag = MA
hitflag=MAFD
pausetime = 1,1
guard.pausetime=5,5
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -18,-70
hitsound = S2,6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = 0,0
air.velocity = 0,0
p2stateno=3062
p1stateno=3061
envshake.time = 25
envshake.ampl = 7
envshake.freq=126
id=3062
yaccel=.47

;ignorehitpause = 
;persistent = 

[State -3, Landing Sound]
type = PlaySnd
trigger1 = animelem=10
value = 40, 0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = p2stateno=3062
flag = nomusic
flag2= nobg
flag3=nofg

[State 1050, 5]
type = changeState
trigger1 = animtime=0
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3061]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim=3061
sprpriority = 3
[State 1000, 1]
type = PlaySnd
trigger1 =time=0
value = 300, 11
channel=5

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


;ignorehitpause = 
;persistent = 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(67)<0
flag= nobg
flag2=nofg
flag3=nobardisplay
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 28    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
ignorehitpause=1
[State 11009, dust]
type = Explod
trigger1 = animelem=1
anim = 4001
ID = 4001
postype =left
pos = 0,0
bindtime = -1
facing = 1
scale = .5,ifelse(GameHeight=180,.35,.5)
ownpal = 1
ignorehitpause =1
removetime=-1
ontop =0
sprpriority=-3

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

;[State 0, RemoveExplod]
;type = RemoveExplod
;trigger1 =var(17)=114&& var(13)=5 
;id = 11009
;ignorehitpause = 
;persistent = 
[State 0, AngleDraw]
type = AngleDraw
trigger1 =1 
value = 0
scale = fvar(30),fvar(30)
ignorehitpause = 1
;persistent = 




[State 0, ChangeAnim]
type = ChangeAnim
trigger1=animelem=2 && facing=1
trigger1 = pos y <8 && screenpos x !=[115,119.5]
trigger2=animelem=2 && facing=-1
trigger2 = pos y <8 && screenpos x !=[220.5,225.5]
value = anim;
elem = 1
;ignorehitpause = 
;persistent = 

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

[State 0, PosAdd]
type = PosAdd
trigger1 = screenpos x >=120 && animelemtime(2)<0&& facing=1
trigger2 = screenpos x <=221 && animelemtime(2)<0&& facing=-1
x = -3
[State 0, PosAdd]
type = PosAdd
trigger1 = screenpos x <=115 && animelemtime(2)<0&& facing=1
trigger2 = screenpos x >=225 && animelemtime(2)<0&& facing=-1
x = 3
;ignorehitpause = 
;persistent = 

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


;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 
[State 0, TargetState]
type = TargetState
trigger1 =animelem=2
value =3063
;ignorehitpause = 
;persistent = 
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=2
time = 6
freq = 80
ampl = -4
phase = 90


[State 0, PosSet]
type = PosSet
trigger1 = animelem=2
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2
physics =S
;===scene 1 hit and then they fly away
[State 0, VarSet]
type = VarSet
trigger1 =animelem=1
v = 13    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=5
value = S201,2
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=7
value = S300,2
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=7
value = S300,3
channel = 2
[State 0, Explod]
type = Explod
trigger1 =animelem=7
anim =4107
ID =4107
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = 1,1
removetime=-1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelem=7
anim =1055
ID =4107
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime=-1
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(17)<126 && var(13)=1 && animelem=26 
value = anim
elem = 10
;ignorehitpause = 
;persistent = 

;====scene 2 dash after them and do stuff
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=26
id = 4107
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = animelem=26
v = 13    ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
trigger1 = var(13) =2
v = 17    ;fv = 10
value = 85
persistent =0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =var(13)=2
physics =N
[State 0, VarSet]
type = VarSet
trigger1 = var(13)=2;&& facing=1
fv = 20    ;fv = 10
value =cond(facing=-1,-90,90)
persistent=0
[State 0, VarSet]
type = VarSet
trigger1 = var(13)=2;&& facing=1
fv = 21    ;fv = 10
value = -120

[State 0, PosSet]
type = PosSet
trigger1 = animelem=34
x = fvar(20)+(90*facing)
y = fvar(21)
[State 0, Turn]
type = Turn
trigger1 = animelem=34
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = var(17)<130 && animelemtime(33)>=0  && var(13)=2
x = 5
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=35
value = S200,51
channel = 0
[State 1000, 5] ;Opponent near
type = HitDef
trigger1 =animelem=39
attr = A, HA
animtype  = Hard
damage    = 0, 4
priority  = 5
guardflag = MA
hitflag=MAFD
pausetime = 1,1
guard.pausetime=5,5
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -18,-20
hitsound = S2,6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = 0,0
air.velocity = 0,0
p2stateno=3065
envshake.time =15
envshake.ampl = 9
envshake.freq=126
id=3062
yaccel=.47
[State 0, PosAdd]
type = PosAdd
trigger1 =  animelemtime(39)>=0 && animelemtime(42)<0 
x = -8/fvar(30)
y = -8/fvar(30)


[State 0, VarSet]
type = VarSet
trigger1 = var(17)>=218 && var(13)=2
fv = 30    ;fv = 10
value = 1-((var(17)-217)*.05)

;===scene 3 kick them again
[State 0, VarSet]
type = VarSet
trigger1 = animelem=39
v = 13    ;fv = 10
value = 3
[State 0, VarSet]
type = VarSet
trigger1 = var(13) =3
v = 17    ;fv = 10
value = 0
persistent =0
[State 0, VelSet]
type = VelSet
trigger1 = var(13) =3
x = 0
y = 0
persistent =0
;persistent = 


[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(42)<2 && var(13)=3
fv = 30    ;fv = 10
value = -.05
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(42)>=8 && var(13)=3 && fvar(30)<1 && animelemtime(46)<0
fv = 30    ;fv = 10
value = .05
[State 0, VarSet]
type = Varset
trigger1 = animelem=46
fv = 30    ;fv = 10
value = 1
[State 0, PosSet]
type = PosSet
trigger1 = animelem=43
x = 140*facing
y = 110
[State 0, Turn]
type = Turn
trigger1 = animelem=43
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(43)>0 &&animelemtime(46)<0&& var(13)=3
x = 10
y = -10
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=44
value = S200,51
channel = 0
[State 1000, 5] ;Opponent near
type = HitDef
trigger1 =animelem=46
attr = A, HA
animtype  = Hard
damage    = 0, 4
priority  = 5
guardflag = MA
hitflag=MAFD
pausetime = 1,1
guard.pausetime=5,5
sparkno = Scond(var(42)=0,7020+(random%4),1)
guard.sparkno= S7510
sparkxy = -18,-80
hitsound = S2,6
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = 0,0
air.velocity = 0,0
p2stateno=3065
envshake.time =15
envshake.ampl = 9
envshake.freq=126
id=3066
yaccel=.47

[State 0, PosAdd]
type = PosAdd
trigger1 =  animelemtime(46)>=0 && animelemtime(47)<0
x = -8
y = 8

[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(46)>0 && var(13)=3
fv = 30    ;fv = 10
value = -.015
;======= scene 4 lets appear and grab em m8
[State 0, VarSet]
type = VarSet
trigger1 = animelem=47
v = 13    ;fv = 10
value = 4
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(47)>=0 && var(13)=4 && fvar(30)<1 && animelemtime(53)<0
fv = 30    ;fv = 10
value = .035
[State 0, VarSet]
type = VarSet
trigger1 = var(13) =3
v = 17    ;fv = 10
value = 0
persistent =0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=48
x = enemy, pos x -20
y = enemy, pos y +50
[State 0, TargetState]
type = TargetState
trigger1 = animelem=53
value =3062
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(53)>=15 && var(13)=4 && animelemtime(54)<0 
fv = 30    ;fv = 10
value = -.0205
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(53)>=0&&animelemtime(54)<0
pos = -ceil(22*fvar(30)),-ceil(94*fvar(30))
[State 0, TargetBind]
type = TargetBind
trigger1 =animelemtime(54)>=0&&animelemtime(55)<0
pos = -ceil(23*fvar(30)),-ceil(116*fvar(30))
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(55)>=0&&animelemtime(56)<0
pos = ceil(11*fvar(30)),-ceil(83*fvar(30))



;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animelem=57 && pos y <0 
value = anim
elem = 56
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(56)>=0 && var(13)=4 && fvar(30)<1 && var(17)>160
fv = 30    ;fv = 10
value = .025
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(56)>=0&&animelemtime(57)<0
pos = ceil(43*fvar(30)),-ceil(38*fvar(30))
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(56)>=0&&animelemtime(57)<0
x =cond(screenpos x >140,-.5,.5)
y = 1


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


[State 0, TargetBind]
type = TargetBind
trigger1 = animelem=57
pos = ceil(52*fvar(30)),-ceil(23*fvar(30))

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=52
value = S200,46
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=57
value = S300,10
channel = 2
[State 1000, 5] ;Opponent near
type = HitDef
trigger1 =animelem=57
attr = A, HA
animtype  = Hard
damage    = 0, 4
priority  = 5
guardflag = MA
hitflag=MAFD
pausetime = 1,1
guard.pausetime=5,5
sparkno = -1
guard.sparkno= S7510
sparkxy = -18,-80
hitsound = -1
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = 0,0
air.velocity = 0,0
p2stateno=3066
envshake.time =20
envshake.ampl = 9
envshake.freq=126
id=3066
yaccel=.47
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=57
value = S300,2
channel = 1
;abspan = 
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = animelem=57
v = 17    ;fv = 10
value = 0
persistent =0
[State 0, Explod]
type = Explod
trigger1 =animelem=57
anim =4110
ID =4410
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = 1.5,.85
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1

[State 0, ModifyExplod]
type = ModifyExplod
triggerall =  var(13)=4
trigger1 = var(17)=[10,12]
trigger2 = var(17)=[16,17]
trigger3 = var(17)=[22,23]
trigger4 = var(17)=[26,27]
trigger5 = var(17)=[31,32]
ID =4410
scale = 1.7,1.05

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


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=58 && var(13)=4
value = anim
elem = 57
;======== Almost done, lets kick the shit out of them one last time
[State 0, VarSet]
type = VarSet
trigger1 =  var(13)=4 && enemy,time>25 && animelemtime(57)>0
v = 13    ;fv = 10
value = 5

[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(58)>=0 && var(13)=5 && animelemtime(60)<0
fv = 30    ;fv = 10
value = -.01

[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(60)>=10 && animelemtime(61)<3
fv = 30    ;fv = 10
value = .035
 [State 0, PosSet]
type = PosSet
trigger1 = animelem=60
x = -180*facing
y = -275
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(60)>=0 &&animelemtime(60)<22
x = 8
y = 12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=61
value = S300,6
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=66
value = S300,8
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=66
value = S300,10
channel = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(13)=5 && animelem=67
value = anim
elem = 66

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(17)=35 && var(13)=5
value = S201,6
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(17)=230&& var(13)=5
value = S201,9
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(17)=220&& var(13)=5
value = S2,7
channel = 3
;abspan = 
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 =animelemtime(61)>=0&&animelemtime(62)<0
anim =1110
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5*fvar(30),.5*fvar(30)
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelemtime(62)>=0&&animelemtime(63)<0
anim =1111
ID =1008
pos = -5,-15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5*fvar(30),.5*fvar(30)
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelemtime(63)>=0&&animelemtime(64)<0
anim =1112
ID =1008
pos = -10,-10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5*fvar(30),.5*fvar(30)
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelemtime(64)>=0&&animelemtime(65)<0
anim =1113
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5*fvar(30),.5*fvar(30)
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelemtime(65)>=0&&animelemtime(66)<0
anim =1114
ID =1008
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
scale = .5*fvar(30),.5*fvar(30)
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =  animelem=66
flag = invisible

[State 0, Helper]
type = Helper
trigger1 = animelem=66
helpertype = normal ;player
name = "symbols"
ID =3090
stateno =3067
pos = 50,-45
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=0
size.xscale =.65
size.yscale=.65
persistent=0
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(66)>=0 &&var(17)<150
x = 0
y = -.5*(1/fvar(30))
[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(66)>=0 && animelemtime(66)<1&&var(17)<125
fv = 30    ;fv = 10
value = -.015


[State 0, AllPalFX]
type = AllPalFX
trigger1 = var(17)=270 
time = 50
add = 0,0,0
mul = 256,256,256
sinadd = 255,255,255,110
;invertall = 0
;color = 256
;ignorehitpause = 
;persistent = 

;======== finished. lets land with grace.
[State 0, VarSet]
type = VarSet
trigger1 =  var(13)=5 && var(17)=300
v = 13    ;fv = 10
value = 6
[State 0, VarSet]
type = Varset
trigger1 = var(13)=6
fv = 30    ;fv = 10
value = 1

;ignorehitpause = 
;persistent = 


[State 0, PosSet]
type = PosSet
trigger1 = animelem=67
x = -100*facing
y = 0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=67
x = 15
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=67,10
physics = S



;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  var(13)=6 
physics = S       ;A,C,S,N
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 =animelemtime(67)=[5,10]
trigger1 = time%4=0
anim = 183
ID =8002
pos = 20,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 200, 1]
type = PlaySnd
trigger1 =animelem=67 
value = 191, 1
channel=2
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=67 
time =30
freq = 60
ampl = -2
phase = 90
;ignorehitpause = 
;persistent = 

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
ignorehitpause = 1
;persistent = 
[State 0, VarSet]
type = Varadd
trigger1 = 1
v = 17    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = var(13) =5
v = 17    ;fv = 10
value = 0
persistent =0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelemtime(67)>=0 
id = 4001
[State 0, TargetState]
type = TargetState
trigger1 =animtime=0 
value =3064
persistent=0

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



;ignorehitpause =
;persistent =

;---------------------------------------------------------------------------
[Statedef 3062]
type    = A
movetype= H
physics = N
juggle  = 0;    0
ctrl = 0
sprpriority = 0
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0 && enemy,animelemtime(53)<0
value = 3062
;elem = 1
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0 && enemy,animelemtime(53)>=0
value = 3063
persistent=0
[State 0, AngleDraw]
type = AngleDraw
trigger1 =1 
value = 0
scale = (enemy,fvar(30)),(enemy,fvar(30))
ignorehitpause = 1
[State 0, SelfState]
type = SelfState
trigger1 =p2stateno!=3061
value =5050
;anim =
;ctrl =
;ignorehitpause = 0
;persistent = 1
;------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 3064]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, VelSet]
type = VelSet
trigger1 = time=30
x =12
y = 16
;ignorehitpause = 
;persistent = 

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

[State 0, PosSet]
type = PosSet
trigger1 =time=0
x = -180*enemy,facing 
y = -260
;ignorehitpause = 
;persistent = 

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = time=0
value =1028

[State 0, PlaySnd]
type = PlaySnd
trigger1 = pos y >0 
value = S5000,3
channel = 0
;abspan = 
;ignorehitpause = 
;persistent = 


[State 0, EnvShake]
type = EnvShake
trigger1 = pos y >0 
time = 15
freq =120
ampl = -8
phase = 90
;ignorehitpause = 
;persistent = 
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value =0
ignorehitpause = 1
;persistent = 


[State 0, VelSet]
type = VelSet
trigger1 = pos y >0 
y = -vel y
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
ignorehitpause = 1
;persistent = 

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

[State 0, PosSet]
type = PosSet
trigger1 = time>=120
y = 2400
x=0
[State 0, SelfState]
type = SelfState
trigger1 =time>=120
value =5150
;---------------------------------------------------------------------------
[Statedef 3063]
type    = A
movetype= H
physics = N
juggle  = 0;    0
velset = -7,-4
ctrl = 0
sprpriority = 0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 =time=0
value =1028


;ignorehitpause = 
;persistent = 

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

[State 0, PosSet]
type = PosSet
trigger1 = enemy,var(13)=2 && enemy,animelemtime(33)>=0
x = enemy,fvar(20)
y = enemy,fvar(21)
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = backedgebodydist <-100 && enemy,var(13)!=3
trigger2 = enemy,var(13)=3
x = 0
y = 0


;ignorehitpause = 
;persistent = 

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



[State 0, AngleDraw]
type = AngleDraw
trigger1 =1 
value = 0
scale = (enemy,fvar(30)),(enemy,fvar(30))
ignorehitpause = 1
;elem = 1
;ignorehitpause = 
;persistent = 


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

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 =time=0
value =1028

;ignorehitpause = 
;persistent = 

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

[State 0, PosAdd]
type = PosAdd
triggerall = hitshakeover
triggerall =enemy,animelemtime(46)<0
trigger1 = enemy,facing =-1 &&screenpos x >140 && time =[5,30]
trigger2 = enemy,facing =1 &&screenpos x <140 && time =[5,30]
x = -4
y = 2
[State 0, PosAdd]
type = PosAdd
triggerall = hitshakeover;&& enemy,facing=-1
triggerall =enemy,animelemtime(46)<0
trigger1 = screenpos x >140 && time =[0,4]
trigger2 =screenpos x >140 && time =[31,35]
x = -8
y = 4

[State 0, PosAdd]
type = PosAdd
triggerall = hitshakeover
triggerall =enemy,animelemtime(46)>=0
trigger1 = time =[5,30]
x = -.75
y = -1
[State 0, PosAdd]
type = PosAdd
triggerall = hitshakeover
triggerall =enemy,animelemtime(46)>=0
trigger1 =  time =[0,4]
trigger2 = time =[31,33]
x = -6
y = -4


;---------------------------------------------------------------------------
;additional hitstate
[Statedef 3066]
type    = A
movetype= H
physics = N
juggle  = 0;    0
velset =0,0
ctrl = 0
sprpriority = 0
[State 0, AngleDraw]
type = AngleDraw
trigger1 =1 
value = 0
scale = (enemy,fvar(30)),(enemy,fvar(30))
ignorehitpause = 1
;ignorehitpause = 
;persistent = 
[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 =selfanimexist(5061) && time < 25
value =5061
[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = !selfanimexist(5061)&& time < 25
value =5061

[State 0, PosAdd]
type = PosAdd
trigger1 =time < 25
y = -9

[State 0, PosSet]
type = PosSet
trigger1 = time = 35
y = 100
[State 0, PosAdd]
type = PosAdd
trigger1 = time =[35,55] 
y = -7
[State 0, PosAdd]
type = PosAdd
trigger1 = time =[50,55] 
y = -3

[State 0, PosAdd]
type = PosAdd
trigger1 = time =[60,75] 
y = .35

[State 0, PosAdd]
type = PosAdd
trigger1 = enemy,animelemtime(60)>=0 && enemy,animelemtime(63)<0
x = -8
y = 8

[State 0, PosAdd]
type = Posset
trigger1 = enemy,var(17)=150
x = 180*enemy,facing
y = 100
[State 0, PosAdd]
type = PosAdd
trigger1 = enemy,var(17)=[150,220]
x = 1.5
y = -1
[State 0, EnvShake]
type = EnvShake
trigger1 =enemy,var(17)=220
time = 5
freq = 60
ampl = -12
;phase = 90
;ignorehitpause = 
;persistent = 

[State 0, EnvShake]
type = EnvShake
trigger1 =enemy,var(17)=225
time = 200
freq = 60
ampl = -2
phase = 90
[State 0, LifeAdd]
type = LifeAdd
trigger1 =enemy,var(17)=280
value = -99999
kill = 1
absolute = 0 

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy,var(17)>=280
flag = invisible

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


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

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = ifelse(enemy,var(11)=1,1029,1025)

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

;------------------
; (a custom gethit state)
[Statedef 20011]
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 < -10
trigger1 = BackEdgeBodyDist < 75 || time >5
trigger2 = FrontEdgeBodyDist < 75|| time >5
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -10
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value =20012
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(10) = %d  vel x = %f"
params =(numtarget(2000)),vel x
;ignorehitpause = 
;persistent = 

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

;------------------
; wall splat
[Statedef 20012]
type    = A
movetype= H
physics = N
velset=0,0
[State 0, SelfState]
type = SelfState
triggerall =enemy,var(19)=0  && alive && enemy,numexplod(212)>2
trigger1=(time=[1,10])&& command="recovery" 
trigger2 = (time=[1,20])&&var(16) = 1&& p1name="Training"
trigger3 = AILevel >0 && random<99 && p2stateno!= 3050 && time>0
value =5210
[State 0, PosAdd]
type = PosAdd
triggerall = pos y <-5
trigger1 = time=0 && anim=1028
y = -const(size.mid.pos.y)

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

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 10 - 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 0, LifeAdd]
;type = LifeAdd
;trigger1 = animelem=2
;value = -15
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = 20
;ignorehitpause = 
;persistent = 

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 10250
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=2
time = 8
freq = 80
ampl = -4
phase = 90

[State 1027, State]
type = ChangeState
trigger1 = time >=(enemy,var(15))+4
value = 20013

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

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


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

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


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

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim2
trigger1 = Time = 0
value = 10251


[State 1028, Hit ground]
type =changestate
trigger1 = (Vel y > 0) && (Pos y >= 30)
value = 20014
;------------------
; (a custom gethit state)
[Statedef 20014]
type    = C
movetype= H
physics =C
velset=0,0

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



[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim2
trigger1 = Time = 0
value = 10252
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2
statetype = L       ;S,A,C,L
physics = C
;ignorehitpause = 
;persistent = 

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


[State 1028, Hit ground]
type = SelfState
trigger1 = animtime=0
value = 5110
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------


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

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =1
text = "17 = %d 19 = %d pos=%f \n p2dx=%d p2dy=%d =%d"
params = (numexplod(1010)),(p2dist x*((1*1.0)/(12*1.0))),(fvar(21)),(screenpos x),(var(21)),(var(19))
ignorehitpause =1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =movetype!=A 
v = 36   ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

;anim =
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy,pos y>=0 && enemy, vel y >0 && p2stateno=3064
value = S2,6
channel = 2
persistent=0
[State 0, Explod]
type = Explod
trigger1 =enemy,pos y>=0 && enemy, vel y >0 && p2stateno=3064
anim =3070
ID =3070
pos = 0,8
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = -1
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2= nocrouchguard
flag3 = noairguard
;ignorehitpause = 
;persistent = 

;[State 0, VarSet]
;type = VarSet
;trigger1 = stateno!=[1010,1100]
;trigger1 = var(34)<=0
;v = 2   ;fv = 10
;value = 0

[State 0, VarSet]
type = VarSet
trigger1 =statetype!=A
trigger2= stateno=[5200,5210]
v = 8   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 9   ;fv = 10
value = enemy,lifemax/4
[State 0, VarSet]
type = VarSet
trigger1 =enemy,anim=[1028,1029]
trigger1= p2movetype=H 
v = 11    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H ||(p2stateno=[202,203])||p2stateno=[20010,20014]
trigger2 = p2stateno=[1045,1048]
trigger3 = p2stateno=[1025,1028]
trigger4 = p2movetype!=H 
v = 11    ;fv = 10
value = 0
[State 0, VarRangeSet]
type = VarRangeSet
trigger1 =  p2movetype!=H
value = 0 ;fvalue = 0
first = 12
last = 14 ;39
[State 0, VarSet]
type = VarSet
trigger1 =var(21)>0 && movehit  && (prevstateno!=[150,155])
v = 19   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =var(21)=0 && movehit && (p2stateno=5080||p2stateno=[5000,5030]) && stateno!=1010
trigger2= p2movetype!=H
trigger3 = numexplod(1010)>2 && stateno=1010 && var(2)=2
trigger4 = numexplod(1050)>2 && var(21)>0
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 113, VarSet]
type = VarSet
triggerall = var(21)!=2
triggerall = (stateno!=[1010,1100]) && stateno!=212
trigger1 = p2movetype=A 
v =21   ;v = 570
value = 1

[State 114, VarSet]
type = VarSet
trigger1 = p2movetype=I && var(21)<2&& stateno!=[1050,1100]; && (p2stateno!=[1025,1048])
trigger2= p2movetype!=H &&var(21)=2 && stateno!=[1050,1100]
v = 21   ;v = 570
value = 0
ignorehitpause=1
[State 0, VarSet]
type = VarSet
triggerall = stateno!=3051
trigger1 = var(21)>0 && movehit
v = 23   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 23   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 24    ;fv = 10
value =0
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H || p2stateno=[5200,5210]
v = 25   ;fv = 10
value = 0

[State 0, VarSet]
type = Varadd
triggerall = movehit=1
trigger1 = stateno=200
trigger2 = stateno=400
trigger3 = stateno=600
v = 25   ;fv = 10
value = 2
ignorehitpause =0 
[State 0, VarSet]
type = Varadd
triggerall = movehit=1
trigger1 = stateno=410
v = 25   ;fv = 10
value = 8
ignorehitpause =0
[State 0, VarSet]
type = VarSet
trigger1 =stateno!=[40,50] 
v = 26   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2statetype!=C && stateno!=211 
v = 29    ;fv = 10,
value = 0

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



;persistent =



;ignorehitpause = 
;persistent = 



 
;persistent = 



;ignorehitpause = 
;persistent = 

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


;ignorehitpause = 
;persistent = 


[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, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1031,1034])
value =1031
ID =440
ignorehitpause =0
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[20010,20015]) 
value =20010
ID =20010
ignorehitpause=0
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype!= A && movehit=1 && (p2stateno!=1035)
value =1035
ID =998
ignorehitpause =0
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[1025,1055]) && (p2stateno!=1036&&p2stateno!=[833,839])
value =ifelse(var(19)>0,1029,1036)
ID =210
ignorehitpause=0
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[1025,1055]) && (p2stateno!=[833,839])
value =1029
ID =211
ignorehitpause=0
[State 0, TargetState]
type = TargetState
trigger1= p2statetype=A && movehit&& (p2stateno!=[301,303]) && p2stateno!=5201&& (p2stateno!=[3002,3004])
value =cond(var(21)>=1,3003,301)
ID =999
ignorehitpause =1
[State 0, TargetState]
type = TargetState
trigger1= p2statetype=A && movehit&& (p2stateno!=[301,303]) && p2stateno!=1051 && p2stateno!=5201
value =1051
ID =997
ignorehitpause =0
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1045,1048])
value =1045
ID = 202
ignorehitpause =0
[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=1101)
value =1101
ID = 217
ignorehitpause =1
[State 0, Helper]
type = Helper
trigger1 =numhelper(4004)=0 && roundstate=2
helpertype = normal ;player
name = "gauge base"
ID =  4004
stateno = 4004
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
supermovetime=999
[State 0, Helper]
type = Helper
trigger1 =numhelper(10002)=0 ;&& roundstate=2
helpertype = normal ;player
name = "SpAIder"
ID =  10002
stateno = 9998
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1
[State 0, Helper]
type = Helper
trigger1 =numhelper(10003)=0 ;&& roundstate=2
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, Explod]
type = Explod
triggerall = var(42)=0
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
trigger5=p2stateno=303&& enemy,time=1 && p2movetype=H
trigger6=p2stateno=3004&& 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
triggerall = var(42)=0
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
trigger5=p2stateno=303&& enemy,time=1 && p2movetype=H
trigger6=p2stateno=3004&& 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
triggerall = var(42)=0
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
trigger5=p2stateno=303&& enemy,time=1 && p2movetype=H
trigger6=p2stateno=3004&& 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, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =211
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =212
ignorehitpause = 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 =400
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 =1003
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 =1011
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1001
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1004
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1005
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1006
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1050
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1100
ignorehitpause = 1




[State 0, PlaySnd]
type = PlaySnd
trigger1 = p2stateno=834 && enemy,time=1
trigger2=p2stateno=302&& enemy,time=1 && p2movetype=H &&enemy,prevstateno=1051
trigger3=p2stateno=3005&& enemy,time=1 && p2movetype=H
value = S2,5

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

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

[State 0, PlaySnd]
type = PlaySnd
trigger1=(p2stateno=1030||p2stateno=834||p2stateno=20012||p2stateno=3004) && 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 = 3000
trigger2 = winko && stateno = [3050,3057]
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



;----------

;----AI reset grab time

[State 0, VarSet]
type = VarSet
trigger1 =p2stateno=5210 && enemy,time>6
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 = 
;--------------------



;ignorehitpause = 
;persistent = 
; Take more damage when mask off

;[State -2, DefenseMulSet]
;type = LifeAdd
;triggerall = Alive && MoveType = H &&  var(6)>0 ;&&!hitshakeover && time=1
;trigger1 = (FVar(8)-life)>0
;value = ifElse((FVar(8)-life)<life,-floor((FVar(8)-life)*fvar(3)),0)
;ignorehitpause=1
;persistent = 1
;ignorehitpause = 
;persistent = 
;[State 0, VarSet]
;type = VarSet
;trigger1 =1;hitshakeover
;fvar(8) = life
;ignorehitpause =1 
;persistent = 1

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



[Statedef -3]
[State 0, VarSet]
type = VarSet
trigger1 =1 
v = 42    
value =0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = AIlevel >0
v = 45    ;fv = 10
value = cond(enemy,AIlevel>0,8,AIlevel)
;ignorehitpause = 
;persistent = 




[State 0, VarSet]
type = VarSet
triggerall = command!="holddown"
trigger1 = command="a" && var(45)=0 &&stateno=1002 && time >2
v = 16    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = command="holddown"
trigger1 = command="a" && var(45)=0 &&stateno=1002 && time >2
v = 16    ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
trigger1 = stateno!=1002
v = 16    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2name="Tristan Samroy" ||p2name="Captain Falcon" ||p2name="Edward Trusdale" 
v = 41    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, PlayerPush]
type = PlayerPush
triggerall = p2statetype!=A && prevstateno!=[1003,1004]
triggerall = stateno!=[1035,1099]
triggerall = pos y <-25
trigger1 = statetype=A&&p2bodydist x =[-45,25] 
value = 0
ignorehitpause=0
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = !var(41)
value = random%10
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41)
value = 11 ; 1~99
;ignorehitpause =
;persistent =

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H 
fv = 0    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype=H && (stateno=1010 ||stateno=1050) && movehit=1 && var(2)=3
fv = 0    ;fv = 10
value = .55
 ;"none","add1","sub"
;ignorehitpause = 
;persistent =
[State 0, AfterImage]
type = AfterImage
trigger1 = p2movetype=H && (stateno=1010 ||stateno=1050) && movehit=1 && var(2)=3
time= 2
length=8
palcolor= 256
palinvertall= 0
palbright =  25, 45, 25
palcontrast = 120,120,220
palpostbright = 0,0,0
paladd = 32,32,248
palmul = 1,1,1
timegap = 4
framegap  = 3
trans = add1 ;"none","add1","sub"


[State 0, AfterImageTime]
type = AfterImageTime
triggerall = stateno!=[1002,1003]
trigger1 = fvar(0)!=1 && p2stateno!=[5100,5120]
time = 2
;ignorehitpause = 
;persistent = 

;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=[20011,20014]
trigger2 = p2stateno=[860,863]
trigger3 = p2stateno=[1045,1048]
value = 1
movecamera = 0,1
ignorehitpause =1
[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, ChangeState]
type = ChangeState
triggerall = power >=500 
triggerall= stateno!=[3000,3051]
triggerall = AIlevel =0&&command="cancel" 
triggerall = stateno!=700
triggerall = var(2)!=3
triggerall = stateno!=[800,836]
trigger1 = movecontact
trigger2 = animelemtime(7)>0 && animelemtime(8)<8 && (stateno=1050)
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
[State 0, ChangeState]
type = ChangeState
triggerall = power >=550
triggerall= stateno!=[3000,3051]
triggerall = var(45)>0
triggerall = AIlevel >0
triggerall = stateno!=700
triggerall = stateno!=[800,899]
trigger1= movehit && var(4)>15
triggerall = var(2)!=2
trigger2 = movehit&& (stateno=405)  && var(31)=35
trigger3 =stateno=1010&&  moveguarded && random <15*var(45) && var(2)=3
trigger4 = stateno=1006 && moveguarded&& random <15*var(45)
trigger5=  animelemtime(7)>0 && animelemtime(8)<8 && (stateno=1050)&& random <20*var(45)
;trigger5= animelemtime(6)>2&&stateno=1006
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
;anim =

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 10    ;fv = 10
value = ifelse(var(21)=2,25,19)
[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)>=var(10) 
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 =var(4)=0
v =3   ;fv = 10
value = 0

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 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])
trigger1 = stateno =211 
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.97
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
trigger1 = stateno=1004 ||stateno=1000
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.94
ignorehitpause=0
[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 
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= movehit=1
triggerall=stateno =205 ||stateno=605|| stateno=405 
fv =2 ;fv = 10
value = fvar(2)*.974
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=410|| stateno=1006
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.93
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=210||stateno=610|| stateno=1100
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.955
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=1010 && var(2)=3 
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.94
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  var(56)>1
trigger1 = stateno=1010 && var(2)!=3&& prevstateno!=1010 
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.87
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)*.1
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, (random%7)
channel=0



[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [20,35]
trigger1 = stateno = 5020
trigger2 = stateno = 5030
trigger3 = stateno = 5050
value = 5000, 7+(random%7)
channel=0
[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [35,50]
trigger1 = stateno = 5020
trigger2 = stateno = 5030
trigger3 = stateno = 5050
value = 5020,(random%6)
channel=0


[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [51,60]
trigger1 = stateno = 5070
trigger2 = stateno = 5080
value = 5020, 6+(random%5)
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
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 100 ;Jump land
trigger2 = stateno = 105 ;Run-back land
value = 40, 1