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

; var(0):= -3, 5900, 411, 1002, 1003, 1005, 1110, 1114, 1112, 1116, 1115, 3051, 3056, 4001, 9999
; var(1):= 53, 101, 183, 1921, 1931, 1033, 1110, 11110, 11111, 11112, 1115, 1150, 4001, 9999
; var(2):= 810, 1000, 1010, 1050, 1100, 53, 101, 1001, 1005, 1110, 11110, 1115, 9999
; var(3):= -3, 1001, 1110, 4001, 9999
; var(4):= 200, 205, 206, 210, 211, 220, 221, 400, 405, 410, 420, 600, 605, 610, 620, 831, 1050, 1060, 3000, 3050, -3, 4, 5, 6, 9999
; var(5):= 800, 830, 9999
; var(6):= -2, 45, 4000, 9999
; var(7):= 1150, 9999
; var(8):= -2, 55, 59, 1112, 9999
; var(9):= -2, 9999
;var(10):= 192, 1921, 11110, 1112, 4000, 9999
;var(11):= 831, 1074, -2, 1112, 4000, 9999
;var(12):= 221, 420, 1100, 3000, 9999
;var(13):= 1100, -2, 1150, 9999
;var(14):= 600, -2, 108, 9999
;var(15):= 1100, -2, 1112, 9999
;var(16):= 9999
;var(17):= -2, 9999
;var(18):= -2, -3, 5
;var(19):= 810, 831, 1050, -2, 9999
;var(20):= -2, 212, 411, 1001, 1005, 1110, 11110, 1114, 1113, 1112, 1116, 1115, 1111, 1117, 1150, 3051, 3057, 9999
;var(21):= 200, 205, 206, 210, 211, 220, 221, 400, 405, 410, 420, 600, 605, 610, 620, 700, 800, 1050, 1060, 1071, 1072, 1073, 1074, -2, 1005, 1020, 1021, 1022, 1110, 1114, 1113, 1112, 1116, 1111, 1117, 1062, 9999
;var(23):= -2, 1005, 1020, 1021, 1022, 1110, 1114, 1113, 1112, 1116, 1062
;var(25):= 420, -2, 9999
;var(26):= -2, 40, 45
;var(27):= 800, 810, 830, 831
;var(28):= -2
;var(30):= -2
;var(31):= -3, -1
;var(32):= -2
;var(33):= -2
;var(36):= 3061
;var(37):= 3061
;var(38):= -1
;var(39):= -2
;var(40):= 3061
;var(41):= -3
;var(42):= 9999
;var(46):= -3
;var(53):= 4001
;var(54):= 4001
;var(55):= -2, 5900
;var(57):= 7000
;var(58):= 1060, 1071, 1072, 1073, -2, 1005, 1110, 1113, 1112
;var(59):= -3, 190, 212, 411, 1001, 1005, 1110, 1114, 1113, 1111, 1117

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

; fvar(0):= 1001, 1150
; fvar(1):= 192, 193, 194
; fvar(2):= -3, 212, 411, 1001, 1005, 1110, 1114, 1113, 1116, 1111, 1117, 3051
; fvar(3):= 4000
; fvar(5):= 193, 194
; fvar(6):= -2
; fvar(7):= -2
;fvar(15):= -3, 1115



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

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 36 ;Player width (back, ground)
ground.front = 60    ;Player width (front, ground)
air.back = 36        ;Player width (back, air)
air.front = 36      ;Player width (front, air)
height = 175      ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = 40, -280   ;Approximate position of head
mid.pos = -10, -170   ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0   ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 6     ;Walk forward
walk.back = -5.55     ;Walk backward
run.fwd  = 15, -16   ;Run forward (x, y)
run.back = -13.5,-15.4 ;Hop backward (x, y)
jump.neu = 0,-25.8   ;Neutral jumping velocity (x, y)
jump.back = -10   ;Jump back Speed (x, y)
jump.fwd = 10.75     ;Jump forward Speed (x, y)
runjump.back = -8.25,-17  ;Running jump speeds (opt)
runjump.fwd = 7,-23.8     ;.
airjump.neu = 0,-23.8       ;.
airjump.back = -7.25     ;Air jump speeds (opt)
airjump.fwd = 7        ;.
air.gethit.groundrecover = -.45,-10.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = 1.5,.6     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-13.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -3       ;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 = -6         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 4.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 = 1.25        ;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 = .85   ;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 = 1.2               ;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 = .15

[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "Could you be less loud? There's a sale and I want to hear it!"
victory2 = "This is no good, my blade is stuck in you. Give it back!"
victory3 = "Stick around, I've got uses for you yet!"
victory4 = "Make up? No this is my natural face. Aren't I gorgeous?"
victory5 = "What do you mean where do I keep them? Don't you have eyes?"
victory6 = "At first it was fun, but since you're dead it's got very boring. Next!"
victory7 = "Come on. Get up! Hey! Are you even paying attention?! Where's your head?!"
victory8 = "Don't worry, you'll have plenty of company where you're going."
victory9 = "Killing is no fun, I'd much rather recycle your soul...."
victory10= "That pesky soul of yours will just move to a new body, time to fix that!"
victory11 = "Don't touch my food! It's none of your business what's in that fridge!"
victory12= "I don't know who you're looking for! You see what you want to. Idiot!"  

;---------------------------------------------------------------------------
; 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 = time =0
value = 11, 2
[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 171]
type = S
physics=S
ctrl = 0
anim = ifelse(prevstateno=131,172,171)

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

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

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


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


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

[State 0, ChangeState]
type = ChangeState
trigger1 =time = 28
value =5110
;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
[Statedef 180]
type = S
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(37)=1
flag = nobardisplay
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(37)=1
flag = nomusic
ignorehitpause=1
[State 180, 1]
type = ChangeState
trigger1 = Time = 0 && var(37)=0
value = 181;+random%3

[State 180, 1]
type = ChangeState
trigger1 =  var(37)=1
value = 182

;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,-15

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [1,150]
flag = roundnotover
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(6)<0
y = 1.5
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 


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

[State -2, Helper]
type = Helper
trigger1 = animelem=6
helpertype = normal ;player
name = "BONE DRAGON"
ID = 183
stateno =183
pos = 0,-170
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

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

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

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

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


;lowpriority = -1



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


;---------------------------------------------------------------------------
; Introduction Decider
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0
[State 5900, 3] ;Change palette
type = RemapPal
trigger1 =var(54)=0
source = 1,1
dest = 1,palno
[State 5900, 3] ;Change palette
type = RemapPal
trigger1 =var(54)!=0
source = 1,1
dest = 1,var(54)

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


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

[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 =-200,-80*3
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=1.5
size.yscale=1.5
supermovetime=999
pausemovetime=999

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = -750
;ignorehitpause = 
;persistent = 


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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time =70
value = 41
;elem = 1
;ignorehitpause = 
;persistent = 


[State 0, VelSet]
type = VelSet
trigger1 =anim=41 
y = -6.5*var(20)
persistent = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = anim=41
y = .5*var(20)
;ignorehitpause = 
;persistent = 




[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >0 && anim=41
value = 47
[State 0, VelSet]
type = VelSet
trigger1 = anim=47
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = anim=47
y = 0
;ignorehitpause = 
;persistent = 


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || AnimTime = 0 && anim=47|| AIlevel>0
id =12010
[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
ignorehitpause=1

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0  && anim=47
value =0

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 192]
type = S
physics = N
movetype=A
ctrl = 0
anim = 190
velset = 0,0

[State 0, Helper]
type = Helper
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
triggerall = numexplod(13010)=1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos =-200,-80*3
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=1.5
size.yscale=1.5
supermovetime=999
pausemovetime=999
 [State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 1    ;fv = 10
value = pos x
[State 0, Explod]
type = Explod
triggerall = var(53)=0
trigger1 =time=0
anim =13010
ID =13010
pos = 0,0
postype = p1 ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
scale = 2,2
sprpriority = 1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, PosAdd]
type = PosAdd
trigger1 =time=1
x = 720
y = -550
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=191
trigger1 = animelemtime(2)<0 && RoundState != 0
value = S190,4
channel = 0
persistent=0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=191
trigger1 = animelem=6 && RoundState != 0 
value = S190,5
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=191
trigger1 = animelem=11 && RoundState != 0
value = S190,6
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=191
trigger1 = animelem=15 && RoundState != 0 
value = S190,0
channel = 0
[State 0, PosAdd]
type = PosAdd
triggerall = anim=191
trigger1 = animelem=11 && RoundState != 0
x = 250
[State 0, PosAdd]
type = PosAdd
triggerall = anim=191
trigger1 = animelem=15 && RoundState != 0
x = 250
[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 191
[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, VarSet]
type = Varadd
trigger1 = RoundState != 0 
v = 10    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = Varset
triggerall = RoundState != 0 
trigger1 = animelem=6
trigger2 = animelem=11
v = 10    ;fv = 10
value = 0
[State 0, Turn]
type = Turn
trigger1 = animelemtime(2)<0 && RoundState != 0 
persistent=0
[State 0, Turn]
type = Turn
trigger1 = animelem=6
trigger2 = animelem=11
trigger3 = animelem=15
[State 0, VelSet]
type = VelSet
trigger1 = RoundState != 0 && animelemtime(18)<0 
x = 30
y = (24.5)*(sin(0.095*var(10)))
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = RoundState != 0 && animelem=18 
x = 22
y = 4
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=20
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=21
x = abs(fvar(1)/18)
y = -18
[State 0, VelAdd]
type = Velmul
trigger1 = animelemtime(21)>0 && pos y < 0
x = ifelse(abs(fvar(1))>70,.86,.9)
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(21)>0 && pos y < 0 && anim!=47
y = 1.5

;ignorehitpause = 
;persistent = 

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 12
attr = S, NA
animtype  = Medium
damage    =0
guardflag = MA
hitflag=MAF
pausetime = 4,3
sparkno =S7000+(random%4)   
sparkxy = -15,-55*var(20)
hitsound = S2,3
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
getpower=0
guard.ctrltime=15
ground.hittime  = 8
guard.ctrltime=8
ground.velocity = 0
guard.velocity=-5*var(20)
air.velocity = -4*var(20),-3.5*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -5*var(20),0
fall=0
air.hittime=ifelse(var(21)>0,46,27)
fall.recovertime=ifelse(var(21)>0,46,27)
id=200
yaccel=.42*var(20)
p1stateno=1922
p2stateno=5000

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1
;persistent = 
[State -2, Helper]
type = Helper
trigger1 = animelem=8 
helpertype = normal ;player
name = "ITEM"
ID =1921
stateno = 1921
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 0, PosSet]
type = PosSet
trigger1 =AnimTime = 0
y = 0
x= fvar(1)
[State 0, VelSet]
type = VelSet
trigger1 = AnimTime = 0
x = 0
;ignorehitpause = 
;persistent = 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || animelemtime(20)>0|| AIlevel>0
id =13010
[State 0, VelSet]
type = VelSet
trigger1 = anim=47
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = posset
trigger1 = anim=47
y = 0
[State 52, 4]
type = Changeanim
trigger1 = AnimTime = 0&& anim!=47
value = 47
[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0 && anim=47
value = 0
;------------------
; Wall bounce
[Statedef 1922]
type    = A
movetype= I
physics = N
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =time=0
id =13010
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 
y = -const(size.mid.pos.y)-370
[State 0, VelMul]
type = VelMul
trigger1 = time=0
x = 1.4
y = 1
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S190,7
channel = 0

[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 = time=0
value = 1028
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1

;ignorehitpause = 
;persistent = 

[State 1025, State]
type = ChangeState
trigger1 = (helper(1921),parentdist x) < 135
value =1923
;------------------
; wall splat
[Statedef 1923]
type    = A
movetype= I
physics = N
velset=0,0

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1

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

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0 
x = -15*var(20) 
y = 150


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S2,6
channel = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = time=0
time = 8
freq = 80
ampl = -4
phase = 90


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


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

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


[State 1028, Hit ground]
type =changestate
trigger1 = (Vel y > 0) && (Pos y >= 30)
value = 1924

;------------------
; wall splat
[Statedef 1924]
type    = A
movetype=I
physics = N
velset=0,0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
x = fvar(1)
y = 0
;ignorehitpause = 
;persistent = 

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1
[State 1028, Hit ground]
type =changeanim
trigger1 = time=0
value = 5111
[State 1028, Hit ground]
type =changeanim
trigger1 = time=40
value = 5121


[State 1028, Hit ground]
type =changestate
trigger1 = animtime=0 && anim=5121
value = 0



;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 193]
type = S
physics = N
movetype=A
ctrl = 0
anim = 192
velset = 0,0

[State 0, Helper]
type = Helper
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
triggerall = numexplod(13010)=1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos =-200,-80*3
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=1.5
size.yscale=1.5
supermovetime=999
pausemovetime=999
 [State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 1    ;fv = 10
value = pos x
 [State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 5    ;fv = 10
value = enemy,pos x
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(53)=0
trigger1 =time=0
anim =13010
ID =13010
pos = 0,0
postype = p1 ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
scale = 2,2
sprpriority = 1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0
ignorehitpause = 1
;persistent = 

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

[State 210, 2]
type = HitDef
trigger1 =animelem=2
attr = S, NA
animtype  = Medium
damage    =0
hitflag=MAF
guardflag = MA
pausetime = 3,4
sparkno = -1;S7020+(random%4)
sparkxy = -60,-30
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=15
ground.type = High
guard.ctrltime=22
ground.slidetime =19
ground.hittime  = 26
ground.velocity = 1.5*var(20),-7*var(20)
guard.velocity=-4*var(20)
air.velocity = 1.25*var(20),-7*var(20)
air.hittime=ifelse(var(21)>0,85,60)
down.velocity=-5*var(20) ,-4.5*var(20)      ;Time before opponent regains control in air 
fall=1
fall.recover=0
id=201
p2stateno=201
envshake.time = 5
envshake.ampl = 5
envshake.freq=100
yaccel=.52*var(20)
[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,-105
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=2 
value = S190,2
channel = 0
volumescale=75
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=7
value = S120,2
channel = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=2
x = -abs(fvar(1)/18)
y = -48


;ignorehitpause = 
;persistent = 


[State 0, VelAdd]
type = Velmul
trigger1 = animelemtime(2)>0 && pos y < 0
x = ifelse(abs(fvar(1))>70,.86,.9)
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(2)>0 && pos y < 0
y = 1

;ignorehitpause = 
;persistent = 
[State 0, AngleDraw]
type = AngleDraw
trigger1 =  animelemtime(2)>=0 && animelemtime(3)<0
value = -45*time
ignorehitpause =1 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=3
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=3
x = fvar(1)
y = 0
;ignorehitpause = 
;persistent = 
[State -2, Helper]
type = Helper
trigger1 = animelem=1 
helpertype = normal ;player
name = "BAIT"
ID =1931
stateno = 1931
pos =-100,0
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || animtime=0|| AIlevel>0
id =13010
[State 1028, Hit ground]
type =changestate
trigger1 = animtime=0
value = 0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 194]
type = S
physics = N
movetype=A
ctrl = 0
anim = 194
velset = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = roundstate=0
value = 194
[State 0, Helper]
type = Helper
triggerall = var(53)=0
trigger1= command="start"
triggerall = numhelper(4001)<1
triggerall = numexplod(13010)=1
helpertype = normal ;player
name ="system Direction"
ID =4001
stateno =4001
pos =-200,-80*3
postype = p1    ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
keyctrl = 0
ownpal = 1
size.xscale=1.5
size.yscale=1.5
supermovetime=999
pausemovetime=999
 [State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 1    ;fv = 10
value = pos x
 [State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 5    ;fv = 10
value = enemy,pos x
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = var(53)=0
trigger1 =time=0
anim =13010
ID =13010
pos = 0,0
postype = p1 ;p2,front,back,left,right
facing = ifelse(facing=-1,-1,1)
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
scale = 2,2
sprpriority = 1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0
ignorehitpause = 1
[State 0, Helper]
type = Helper
trigger1 =animelem=4 && anim!=105
helpertype = normal ;player
name = "heavyspark"
ID = 101
stateno = 1941
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 200, 1]
type = PlaySnd
trigger1 =  animelem=6&& anim!=105
value = 4, 0
channel=1
[State 0, Helper]
type = Helper
trigger1 = animelem=6&& numhelper(1002+(enemy,gethitvar(hitcount)))=0&& anim!=105
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  120,-105
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, PosSet]
type = PosSet
trigger1 = animelem=16
x = fvar(5)-40
y = -800
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 =animelem=16 
y = 30
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=17
trigger2 = animelem=9 && anim=105
y = 0
x=0
[State 0, PosSet]
type = PosSet
trigger1 =  animelem=17
trigger2 = animelem=9 && anim=105
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=9 && anim=105
x = fvar(1)
;ignorehitpause = 
;persistent = 
[State 200, 1]
type = PlaySnd
trigger1 =  animelem=2&& anim!=105
value = S180, 1
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =  animelem=15&& anim!=105
value = S200, 5
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =  animelem=23&& anim!=105
value = S200, 16
channel=0
[State 0, Helper]
type = Helper
trigger1 =animelem=15
helpertype = normal ;player
name = "heavyspark"
ID = 101
stateno = 101
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause=1
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1
;persistent = 

[State 210, 2]
type = HitDef
trigger1 =animelem=16
attr = S, NA
animtype  = Medium
damage    =0
hitflag=MAF
guardflag = MA
pausetime = 0,0
sparkno = S7000+(random%4) 
sparkxy = -0,-40
hitsound = S2, 5
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=15
ground.type = High
guard.ctrltime=22
ground.slidetime =19
ground.hittime  = 26
ground.velocity = 1.5*var(20),-7*var(20)
guard.velocity=-4*var(20)
air.velocity = 1.25*var(20),-7*var(20)
air.hittime=60
down.velocity=-5*var(20) ,-4.5*var(20)      ;Time before opponent regains control in air 
fall=1
fall.recover=0
id=1942
p2stateno=1942
envshake.time = 5
envshake.ampl = 5
envshake.freq=100
yaccel=.52*var(20)

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 && anim!=105
value = 105
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=1&& anim=105
x = -abs(fvar(1)/8)
y = -15

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(1)>0&&animelemtime(9)<0 && anim=105
y = 1.45
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = Velmul
trigger1 = animelemtime(2)>0 && pos y < 0&& anim=105
x = ifelse(abs(fvar(1))>70,.9,.94)
[State 1028, Hit ground]
type =changestate
trigger1 = animtime=0 && anim=105
value = 0
;------------------
; Wall bounce
[Statedef 1942]
type    = A
movetype= I
physics = N

[State 0, VelMul]
type = Velset
trigger1 = time=0
x = 0
y = enemy,vel y
;ignorehitpause = 
;persistent = 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S5000,4
channel = 0

[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 = time=0
value = 5080
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1

;ignorehitpause = 
;persistent = 

[State 1025, State]
type = ChangeState
trigger1 = pos y>=0
value =1943
;------------------
; Wall bounce
[Statedef 1943]
type    = L
movetype= I
physics = N
velset=0,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S2,3
channel = 0
[State 0, EnvShake]
type = EnvShake
trigger1 = time=0 
time = 6
freq = 90
ampl = -3
phase = 90


[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
x= enemy,fvar(5)
;ignorehitpause = 
;persistent = 

[State 1025, Anim] ;Custom animation
type = ChangeAnim
trigger1 = time=0
value = 5110
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause=1

;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=100
value = 5120
;elem = 1
;ignorehitpause = 
;persistent = 

[State 1025, State]
type = selfState
trigger1 = animtime=0 && anim=5120
value =0
ctrl=0
;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

;ignorehitpause =
;persistent =


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S52,0+random%2
volume = 255
channel = 0
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0
;abspan =
;ignorehitpause =
;persistent =


[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle =0;  = 0                    ;Number of air juggle =0; points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 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)

;elem = 1
;ignorehitpause = 
;persistent = 


[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1



[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3 && anim=200
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 15, 0                    ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime =8,8                ;Time attacker pauses, time opponent shakes
sparkno = S7000+(random%4)                      ;Spark anim no (Def: set above)
sparkxy = -30,-71*var(20)            ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S2, 0
guard.sparkno= S7500                ;Sound to play on hit
guardsound = S6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5  
getpower=0           ;Time that the opponent slides back
ground.hittime  = 14            ;Time opponent is in hit state
guard.ctrltime=14
ground.velocity = -4.5*var(20)
guard.velocity=-13.5            ;Velocity at which opponent is pushed
airguard.velocity = -5.7,-2.4    ;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 = -4.2,-4.5*var(20)          ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
fall.recovertime=ifelse(var(21)>0,17,14) 
air.hittime= ifelse(var(21)>0,17,14)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
id=200



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


[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value =1, 0
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1 
value = 200, 0
channel=0


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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=7 && anim=201
trigger2 = animelem=4 && anim=200
movetype = I     


[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, PlaySnd]
type = PlaySnd
trigger1 = p2stateno=193 && time=0
value = S5000,3
channel = 0

;abspan = 
;ignorehitpause = 
;persistent = 


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

 ;5051 - 4 + type

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

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0 &&  p2stateno!=193
x = 1
y = 1
[State 0, VelSet]
type = VelSet
trigger1 = Time = 0 &&  p2stateno=193
x = cond(selfanimexist(5121),-abs(enemy,fvar(5)/12),-abs(enemy,fvar(5)/11))
y =-38
[State 0, VelMul]
type = VelMul
trigger1 = p2stateno=193
x =  ifelse(abs(enemy,fvar(5))>70,.9,.94)
;ignorehitpause = 
;persistent = 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =p2stateno=193
flag = intro
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=193
value = 1
movecamera = 0,0
;ignorehitpause = 
;persistent = 


[State 0, PosSet]
type = PosSet
trigger1 =  Pos Y >=30  && p2stateno=193
x = enemy,fvar(5)
[State 5035, 4]
type=selfState
triggerall = time>2
trigger1= Pos Y >= 30;.
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 0, VelMul]
type = VelMul
trigger1 = p2stateno=193
x =  ifelse(abs(enemy,fvar(5))>70,.86,.9)
[State 0, PosSet]
type = PosSet
trigger1 =  Pos Y >= 30 && p2stateno=193;
x = enemy,fvar(5)
;ignorehitpause = 
;persistent = 

[State 5035, 4]
type=selfState
triggerall = time>2
trigger1 = Pos Y >= 30 ;.
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)

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


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

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

[State 5035, 4]
type=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*enemy,var(20)
;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;  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = ifelse(fvar(6) >=35,206,205)
sprpriority =2

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

[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5&& anim=206
attr = S, NA
animtype  = Medium
damage    =50
guardflag = HA
hitflag=MAF
pausetime = 10,10
sparkno =S7000+(random%4)   
sparkxy = -15,ifelse(anim=205,-45,-20)*var(20)
hitsound = S2,3
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
getpower=20
guard.ctrltime=15
ground.hittime  = 18
ground.velocity = -ifelse(anim=206,6.5,5.5)*var(20)
guard.velocity=-5*var(20)
air.velocity = -3.5*var(20),7*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -5*var(20),0
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
air.hittime=ifelse(var(21)>0,26,ifelse(numexplod(10101)=1,25,17))
fall.recovertime=ifelse(var(21)>0,26,19)
id=998
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =301
ID =998
ignorehitpause =1 
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4 && anim=205
attr = S, NA
animtype  = Medium
damage    =40
guardflag = MA
hitflag=MAF
pausetime = 10,10
sparkno =S7000+(random%4)   
sparkxy = -15,ifelse(anim=205,-45,-20)*var(20)
hitsound = S2,3
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
getpower=20
guard.ctrltime=15
ground.hittime  = 17
ground.velocity = -ifelse(anim=206,6.5,5.5)*var(20)
guard.velocity=-5*var(20)
air.velocity = -ifelse(numexplod(10101)=1,2.5,7.5),-10
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -5*var(20),0
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
air.hittime=ifelse(var(21)>0,26,ifelse(numexplod(10101)=1,25,17))
fall.recovertime=ifelse(var(21)>0,26,ifelse(numexplod(10101)=1,25,17))
id=200
;[State 0, Helper]
;type = Helper
;trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
;helpertype = normal ;player
;name = "midspark"
;ID = 1002 +(enemy,gethitvar(hitcount))
;stateno = 1002
;pos = -15,ifelse(anim=205,-216,-180)
;postype = p2    ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;supermovetime = 0
;pausemovetime = 25
;ignorehitpause=1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5&& anim=205
trigger2 = animelem=7&& anim=206
movetype = I 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2&& anim=206
x = -28
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2&& anim=205
x = -31

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3&& anim=206
x = -42
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4&& anim=206
trigger2 = animelem=6&& anim=206
x = -7
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6&& anim=205
x = 8
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7&& anim=205
x = -25

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& anim=206
x = 91

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8&& anim=206
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9&& anim=206
x = -3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10&& anim=206
trigger1 = animelem=3&& anim=205
x = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = animtime=0&& anim=206
x = -9


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


[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 206]
type    = S
movetype= A
physics = S
juggle =0;  = 0;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 207
sprpriority =2

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value =0, 1
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200,2+(random%2)
channel=0
[State 0, Width]
type = Width
trigger1 = animelem=5
edge = 80,0

;value = 0,0
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1



;[State 0, Helper]
;type = Helper
;trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
;helpertype = normal ;player
;name = "midspark"
;ID = 1002 +(enemy,gethitvar(hitcount))
;stateno = 1002
;pos = -15,ifelse(anim=205,-216,-180)
;postype = p2    ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;supermovetime = 0
;pausemovetime = 25
;ignorehitpause=1


[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = 105
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=8 && time <26
value = anim
elem = 5
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
trigger2 = AnimElem = 6
trigger3 = AnimElem = 7
attr = S, NA
animtype  = Medium
damage    =8
guardflag = MA
hitflag=MAF
pausetime = 4,3
sparkno =S7000+(random%4)   
sparkxy = -15,-55*var(20)
hitsound = S2,3
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
getpower=20
guard.ctrltime=15
ground.hittime  = 21
guard.ctrltime=18
ground.velocity = -4*var(20),-1*var(20)
guard.velocity=-5*var(20)
air.velocity = -4*var(20),-3.5*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -5*var(20),0
fall=1
air.hittime=ifelse(var(21)>0,46,25)
fall.recovertime=ifelse(var(21)>0,46,25)
id=200
yaccel=.42*var(20)
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x = -64

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = -31

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(5)>0&& animelemtime(8)<0
x = 6.5*var(20)
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(8)>0&& animelemtime(10)<0
x = 3*var(20)

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

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


[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;  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1



;ignorehitpause =
;persistent =

[State 210, 1]
type = PlaySnd
trigger1 = animelem=4
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = animelem=4
value = 200, 1
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1


[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos = -30,-120
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = -36
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -16
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = -15
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = -13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8&& time <27
x = 13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8&& time >27
x = 25
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = 15
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10
x = 9

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=11
x = 28
[State 0, MoveHitReset]
type = MoveHitReset
trigger1 = animelem=7
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem=8 && time <27
value =anim
elem = 6
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 210
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=-1
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 210, 2]
type = HitDef
trigger1 = AnimElem =6 && anim=210
attr = S, NA
animtype  = Medium
damage  =20
hitflag=MAF
guardflag = MA
pausetime = 6,6
sparkno = -1;-1;S7020+(random%4)
sparkxy = -30,-120
hitsound = S4, 1
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=15
ground.type = High
guard.ctrltime=cond(p2statetype=A,16,22)
ground.slidetime =19
ground.hittime  = 26
ground.velocity = -1,-6*var(20)
guard.velocity=-19
air.velocity = 1,-6.5*var(20)
air.fall=1
air.hittime=ifelse(var(21)>0,80,60)-(numexplod(210)*12)
fall.recovertime=ifelse(var(21)>0,80,60)-(numexplod(210)*12)
id=200
envshake.time = 6
envshake.ampl = 5
envshake.freq=100
yaccel=.56*var(20)

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


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8&& 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;  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 211
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1





;ignorehitpause =
;persistent =

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


[State -2, Helper]
type = Helper
trigger1 = animelem=7
helpertype = normal ;player
name = "FIRE"
ID = 212
stateno =212
pos = 127,-134
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State -2, Helper]
type = Helper
trigger1 = animelem=7
helpertype = normal ;player
name = "FIRE"
ID = 213
stateno =212
pos = 127,-143
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State -2, Helper]
type = Helper
trigger1 = animelem=7
helpertype = normal ;player
name = "FIRE"
ID = 214
stateno =212
pos = 127,-143
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
;[State 0, VarSet]
;type = VarSet
;trigger1 =anim=211
;v = 58   ;fv = 10
;value = 26
;ignorehitpause=1





;persistent = 

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

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

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

;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 220]
type    = S
movetype= A
physics = S
juggle =0;  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0

sprpriority = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =230
;
;[State -3]
;type = HitOverride
;trigger1 =animelemtime(6)<0
;;trigger1 = PrevStateNo != 9000
;time = 1
;slot = 7
;attr = SA, NA, SA,NP,SP
;stateno = 9000
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

;value = 0,0
;ignorehitpause = 
;persistent = 




;ignorehitpause =
;persistent =

[State 210, 1]
type = PlaySnd
trigger1 = animelem=4
trigger2 = animelem=12
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = animelem=3
value = 200, 5
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelem=11
value = 200, 4
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
 [State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 220
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=-1
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0


[State 0, VarSet]
type = VarSet
trigger1 = numexplod(220)>=3
v =21   ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
animtype  = Medium
damage    =70
guardflag = MA
pausetime = 10,10
sparkno = -1;S7020+(random%4)
sparkxy = -30,-120
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=25
ground.type = High
guard.ctrltime=22
ground.slidetime =19
ground.hittime  = 26
ground.velocity = -9*var(20),-6*var(20)
guard.velocity=-19
air.velocity = -9*var(20),-6*var(20) 
fall=1
fall.recovertime=ifelse(var(21)>0,32,24)
id=211
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 12
attr = S, NA
animtype  = Medium
damage    =35
guardflag = MA
pausetime = 5,5
sparkno = -1;S7020+(random%4)
sparkxy = -30,-120
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=15
ground.type = High
guard.ctrltime=16
ground.slidetime =19
ground.hittime  = 26
ground.velocity = 9*var(20),-2*var(20)
guard.velocity=-19
air.velocity = 9*var(20),-2*var(20) 
fall=1
fall.recovertime=ifelse(var(21)>0,32,24)
id=212
envshake.time = 5
envshake.ampl = 5
envshake.freq=100

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = AIlevel = 0 &&command="holda" && animelem=8
trigger2 = AIlevel > 0 && (fvar(6)<140||var(21)>0) && random > 35*AIlevel && animelemtime(8) >=0 && animelemtime(9)<0
value = anim
elem = 11
;ignorehitpause = 
;persistent = 



[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,-220
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(5)>=0 && animelemtime(7)<0
x = 5*var(20)
[State 0, PosAdd]
type = PosAdd
trigger1 = animelemtime(7)>=0 && animelemtime(7)<6
x = 2.5*var(20)
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = 72

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x = -21

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x = -23

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = -28
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10
x = 20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=11
x = 7
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=12
x = -58
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1

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

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0 
trigger2 = animelemtime(10)=3
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 221]
type    = S
movetype= A
physics = S
juggle =0;  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 231
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1


[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 221
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



;ignorehitpause =
;persistent =

[State 210, 1]
type = PlaySnd
trigger1 = animelem=4
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = animelem=4
value = 200, 5
channel=0
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = animelem=14
value = 200, 4
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 410, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage    =55
animtype  = Medium
hitflag = MAF
guardflag = LA
pausetime = 5,5
sparkno = -1;S7020+(random%4)
sparkxy = -30,-60
guard.sparkno= S7510
hitsound = S4, 0
guardsound = S6, 0
ground.type =trip
guard.ctrltime=20
ground.slidetime =32
ground.hittime  =30
down.hittime=20
getpower=20
ground.velocity = 1*var(20),-8*var(20)
guard.velocity=-5*var(20)
air.velocity = 1*var(20),7*var(20)
down.velocity=-5*var(20),0
yaccel=.75*var(20) 
fall=1
fall.recovertime=99
id=410

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 15
attr = S, NA
animtype  = Medium
damage    =35
guardflag = MA
pausetime = 5,5
sparkno = -1;S7020+(random%4)
sparkxy = -30,-120
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=15
ground.type = High
guard.ctrltime=25
ground.slidetime =19
ground.hittime  = 31
ground.velocity = 2*var(20),-10*var(20)
guard.velocity=7*var(20)
air.velocity = 2*var(20),-10*var(20) 
fall=1
fall.recovertime=ifelse(var(21)>0,80,60)
id=200
envshake.time = 5
envshake.ampl = 5
envshake.freq=100
yaccel=.4*var(20)
[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,cond(animelemtime(12)>=0,-200,-40)
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = command="holda" && animelem=9 && AIlevel=0
trigger2 = AIlevel >0 && random >45*AILEVEL && movehit && animelemtime(9)>=0&& animelemtime(10)<0
value = anim
elem = 14

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x = -18
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x = 8

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = 25

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x = -30

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=9
x = -20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=10
x = 17
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=11
x = 13
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=12
x = 20

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=15
x = -52
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=16
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=17
x = -9
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=18
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=19
x = 43

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=20
x = 46
[State 0, TargetState]
type = TargetState
triggerall = animelemtime(7)<0
trigger1 =p2statetype= A && movehit && (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=10
trigger2 = animelem=17
movetype = I 

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0 
trigger2 = animelemtime(13)=1
value = 0
ctrl = 1

;-------------------------------------------------------------------------
[Statedef 400]
type    = C
movetype= A
physics = C
juggle =0;  = 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 =1, 0
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 0
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 13
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = MA
pausetime = 8,8
sparkno = S7000+(random%4)
sparkxy = -10,-45*var(20)
hitsound = S2,0
guardsound = S6, 0
ground.type = Low
guard.sparkno= S7500
guard.ctrltime=10
getpower=0 
ground.slidetime =12
ground.hittime  = 14
ground.velocity = -3*var(20)
guard.velocity=-4.5*var(20)
air.velocity = -1.5*var(20),-3*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0,16,12)
id=200

[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, PosAdd]
type = PosAdd
trigger1 = animelem=1
x = -91
;ignorehitpause = 
;persistent = 
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x = 91
 [State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x = -48
 [State 0, PosAdd]
type = PosAdd
trigger1 = animtime=0
x = 48
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5
movetype = I 


[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
[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;  = 0;    5
poweradd= 0
ctrl = 0
anim = 405
sprpriority = 2

[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, 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
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 7
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 430, 2]
type=Hitdef
trigger1=Time=0
attr=C,NA
Damage=45
animtype=medium
hitflag=MAF
guardflag=LA
guard.sparkno=S7500
pausetime=10,10
sparkno=S7000+(random%4)
sparkxy= -10,-25*var(20)
hitsound=S2,2
guardsound=S6,0
getpower=20
ground.type=Low
guard.ctrltime=12
ground.slidetime=16
ground.hittime=17
fall.recover=ifelse(var(21)>0,0,1)
ground.velocity =-4.5*var(20)
air.velocity=-3.5*var(20),-4.5*var(20)
down.velocity=-3*var(20),-5*var(20)
down.hittime=ifelse(var(21)>0,20,1)
air.hittime=ifelse(var(21)>0,20,17)
forcenofall=ifelse(var(21)>0,0,1)
fall.recovertime=ifelse(var(21)>0,20,17)
air.fall=1
fall=ifelse(p2statetype=L,1,0)
id=200

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1 
x =-92
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2 
x =-5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3 
x =27
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4 
x =16
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x =-7
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7 
x =10
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=8
x =25
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x =26
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
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;  = 0;    6
poweradd= 0
anim=410
ctrl = 0
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1


[State 410, 1]
type = PlaySnd
trigger1 =animelem=5
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =animelem=1
value = 200, 6
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(4)>0 &&animelemtime(5)<0 && time <25 && command ="holdz" && AIlevel=0
trigger2 = animelemtime(4)>0 &&animelemtime(5)<0 && time <15 
trigger3 = animelemtime(4)>0 &&animelemtime(5)<0 && time <25 && (fvar(6)>120||p2statetype=L) && AIlevel>0 
value = anim
elem = 4
;ignorehitpause = 
;persistent = 

[State -2, Helper]
type = Helper
trigger1 = animelem=5
helpertype = normal ;player
name = "BONE DRAGON"
ID = 411
stateno =411
pos = 127,0
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
;This is the first hit, triggered on the 3rd element of animation.

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1
x = -54
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2
x = -45
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3
x = 1
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4
x = -9
persistent=0
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5
x = 25
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6
x = 107
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7
x = -28
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
movetype = I 


[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
[Statedef 420]
type    = C
movetype= A
physics = C
juggle =0;  = 0;    6
poweradd= 0
ctrl = 0
anim = 430
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 410, 1]
type = PlaySnd
trigger1 = animelem=4
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
trigger1 =animelem=3
value = 200, 17
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

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

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage    =60
animtype  = Medium
hitflag = MAFD
guardflag = LA
pausetime = 5,5
sparkno = -1;S7020+(random%4)
sparkxy = -30,-60
guard.sparkno= S7510
hitsound = S4, 0
guardsound = S6, 0
ground.type =trip
guard.ctrltime=20
ground.slidetime =32
ground.hittime  =30
down.hittime=20
getpower=40
ground.velocity = 1*var(20),-8*var(20)
guard.velocity=-5*var(20)
air.velocity = 1*var(20),-8*var(20)
down.velocity=-5*var(20),0
yaccel=.75*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0,45,31)
id=410
[State 0, VarSet]
type = VarSet
trigger1 = movehit && animelem=95
v = 12    ;fv = 10
value = 1+(random%8)
[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,-60
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1

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

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=1
x = -77
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2
x = 19
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4
x = 44
[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=8
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=9
x = 16
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=10
x = -44
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=11
x = -19
[State 0, PosAdd]
type = PosAdd
trigger1 =animtime=0
x = 77
[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;  = 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 =1, 0
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =time=1
value = 200, 7
channel=0

;value = 0,0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = Varadd
trigger1 = movehit && p2statetype=A
v = 14    ;fv = 10
value = 1
ignorehitpause =1
persistent =0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    =13
guardflag = HA
priority = 3
pausetime = 7,7
sparkno = S7000+(random%4)
sparkxy = -40,-20*var(20)
hitsound = S2, 0
guardsound = S6, 0
guard.sparkno= S7500
ground.type = High
ground.slidetime =5
ground.hittime  = 11
getpower=0 
ground.velocity = -4*var(20)
air.velocity = -1.3*var(20),-1.35*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
air.hittime=ifelse(var(21)>0,20,16)
fall.recovertime=ifelse(var(21)>0,20,16)
id=200

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

[State 600, 3]
type = changestate
trigger1 =animtime=0
value = 57
ctrl=1
;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 605]
type    = A
movetype= A
physics = A
juggle =0;  = 0;    1
poweradd= 0
ctrl = 0
anim = 605
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value =0, 2
channel=1
[State 0, Width]
type = Width
trigger1 = 1
edge = 160,0
player =100,0
ignorehitpause=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =time=1
value = 200,3
channel=0
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)>0
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(var(21)=2,ifelse(teamside=1,12002,12003),ifelse(teamside=1,12000,12001))
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 630, 2]
type = HitDef
trigger1 = animelem=5
trigger2 = animelem=6
trigger3 = animelem=7
attr = A, NA
damage = 8
guardflag = HA
priority = 3
pausetime = 3,2
sparkno = S7000+(random%4)
sparkxy = -5,-40*var(20)
hitsound = S2, 1
guardsound = S6, 0
getpower=3
ground.type = High
guard.sparkno= S7510
ground.slidetime =11
ground.hittime  = 16
ground.velocity = -3*var(20)
air.velocity = -1.5*var(20),-4.5*var(20)
air.fall=1
fall.recovertime=ifelse(var(21)>0,45,25)
id=201

yaccel=.48*var(20)

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


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


[State 600, 3]
type = changestate
trigger1 =animtime=0
value = 57
ctrl=1
;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = N
juggle =0;  = 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 = animelem=5&& anim=610
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =animelem=5&& anim=610
value = 200, 17
channel=0

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2 && var(15)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, VelAdd]
type = VelAdd
trigger1 = pos y <-15&& anim=610
y = .49*var(20)
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& anim=610
y = -204
persistent=0

;scale = 
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <-15*var(20) && animelem=6&& anim=610
value = 610
elem = 5

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(5)<0 && pos y >=-0 && anim=610
physics = A         ;A,C,S,N
;ignorehitpause = 
;persistent = 

;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=-15*var(20) && animelem=6&& anim=610 && command="holdz"
trigger2 = AIlevel >0 && (random <55*AILEVEL || var(31)>0)&& animelem=6&& anim=610
value = 410
elem = 4
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =animelem=5&& anim=410
value = 200, 6
channel=0
[State 0, AngleDraw]
type = AngleDraw
trigger1 =  animelemtime(5)>=0 && animelemtime(6)<0&& anim=610
value = -45*time
ignorehitpause =1 

;persistent = 

[State 610, 3]
type = HitDef
triggerall = animelemtime(5)>=0 && animelemtime(6)<0 && pos y <-20*var(20)
trigger1 =  time%5=0
attr = A, NA
damage = 15
guardflag = HA
priority = 4
pausetime = 2,2
sparkno = -1;S7020+(random%4)
sparkxy = -13,-53*var(20)
hitsound = S4, 1
guardsound = S6, 0
guard.sparkno= S7510
animtype = Med
getpower=5
ground.type = High
ground.slidetime = 10
ground.hittime  =22
ground.velocity = -1.5*var(20)
air.velocity = -1*var(20),cond((vel y <-3||pos y >-25),-2,5.75)*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.hittime=ifelse(var(21)=2,34,26)
air.fall=1
fall.recovertime=ifelse(var(21)=2,34,26)
id=200
yaccel=.49*var(20)

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 6
attr = S, NA
animtype  = Medium
damage    =35
guardflag = MA
hitflag=MAFD
pausetime = 6,6
sparkno =S7000+(random%4)   
sparkxy = -15,-20*var(20)
hitsound = S4,0
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
getpower=15
ground.hittime  = 21
guard.ctrltime=18
ground.velocity = -7*var(20),7*var(20)
guard.velocity=-5*var(20)
air.velocity = -3.5*var(20),7.5*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -5*var(20),0
forcenofall=ifelse(p2stateno=1103,1,0)  
fall=1
air.hittime=40
fall.recovertime=40
id=210
 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=6&& anim=610
trigger2 = animelem=4&& anim=410
y = 0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6&& anim=610
trigger2 = animelem=4&& anim=410
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=6&& anim=610
trigger2 = animelem=4&& anim=410
time = 8
freq = 70
ampl = 4
phase = 90

[State 610, 2]
type = PlaySnd
trigger1 = animelem=6 && anim=610
trigger2 = animelem=4&& anim=410
value =2, 6
channel=2
volumescale=40

[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -13,-45*var(20)
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1

[State -2, Helper]
type = Helper
trigger1 = animelem=5 && anim=410
helpertype = normal ;player
name = "BONE DRAGON"
ID = 411
stateno =411
pos = 127,0
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

;This is the first hit, triggered on the 3rd element of animation.

[State 0, Width]
type = Width
trigger1 = anim=410
player = 65,0
;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, Width]
type = Width
trigger1 = 1
player = 110,0
;value = 0,0
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4&& anim=410
x = -9
persistent=0
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5&& anim=410
x = 25
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=6&& anim=410
x = 107
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=7&& anim=410
x = -28

[State 600, 3]
type = changestate
trigger1 =animtime=0
value = 0
ctrl=1
;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = N
juggle =0;  = 0;    1
poweradd= 0
ctrl = 0
anim = 620
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2 && var(15)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 200, 1]
type = PlaySnd
trigger1 =animelem=2
value = 200, 9
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 620
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=750
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 610, 3]
type = HitDef
trigger1 =  animelem = 4
trigger2 =  animelem = 5
trigger3 =  animelem = 6
trigger4 =  animelem = 7
trigger5 =  animelem = 8
trigger6 =  animelem = 9
trigger7 =  animelem = 10
attr = A, NA
damage = 13
guardflag = HA
priority = 4
pausetime = 2,2
sparkno = -1;S7020+(random%4)
sparkxy = -13,-53
hitsound = S4, 1
guardsound = S6, 0
guard.sparkno= S7510
animtype = Med
getpower=4
ground.type = High
ground.slidetime = 10
ground.hittime  =22
ground.velocity = -1*var(20),-4*var(20)
fall=1
air.velocity = -1*var(20),-4.75*var(20)
air.fall=1
fall.recovertime=ifelse(var(21)>0&&numexplod(620)<3,55,40)
id=200
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animelem=12 && time <42
value = anim
elem = 4
;ignorehitpause = 
;persistent = 

[State 610, 2]
type = PlaySnd
trigger1 = animelem=4
trigger2 = animelem=7
value =1, 1
channel=1 

[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -13,-70*var(20)
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>=0 && animelemtime(11)<0 
y = .075*var(20)
[State 0, VelSet]
type = VelSet
trigger1 =animelem=3 
y = -4
;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;  = 0;    4
poweradd= -350
ctrl = 0
velset = 0,0
anim = 700
sprpriority =2
[State pal, *]
type = PalFX
trigger1 = time = 0
time = 8
add = 128,128,128
sinadd = -128,-128,-128,16
invertall = 0
color = 256
ignorehitpause = 1


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



[State 210, 2]
type = HitDef
trigger1 =!movecontact
attr = S, NA
animtype  = Medium
damage    = 5
guardflag = MA
pausetime = 7,7
getpower=0,0 
sparkno = S7500+random%4
sparkxy = -15,-150
hitsound = S2,4
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 14
guard.ctrltime=16
ground.hittime  = 20
ground.velocity = -8.5*var(20),-5.5*var(20)
guard.velocity=-3
air.velocity = -7.5*var(20),-5.5*var(20)
p2facing=1
air.hittime=26
fall.recovertime=26
air.fall=1
id=200

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

[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=2 
x = -18
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=3
x = -27

[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=4 
x = -5
[State 0, PosAdd]
type = PosAdd
trigger1 =animelem=5 
x = 50
[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;    0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2
[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 = time=0
v = 27   ;fv = 10
value = 0

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

[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 =p2movetype=A
v = 5  ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno=[140,155])||p2movetype=H
v = 5  ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno!=[140,155])&&p2movetype=I
v = 5  ;fv = 10
value =0

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

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

[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 = 27  ;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=8&&var(5)=1
trigger2= time=13&&var(5)=0
value = 810
elem = 2
[State 0, VarSet]
type = VarSet
trigger1 =1 
v = 2    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = var(5)>=1
v = 19    ;fv = 10
value = 1
;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 = 43*var(20),-73*var(20)
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*var(20),2*var(20)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=0
anim =842
ID =841
pos = 43*var(20),-73*var(20)
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*var(20),2*var(20)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=2
anim =841
ID =841
pos =43*var(20),-73*var(20)
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*var(20),2*var(20)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[0,5]
ID =840
scale = (2-((time)*.12))*var(20),(2-((time)*.12))*var(20)
facing=facing
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=6
ID =840
scale = 1*var(20),1*var(20)
facing=facing

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

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(2)<0  
pos = 50*var(20), 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem=2
pos =70*var(20),-0

;ignorehitpause =
;persistent =

[State 200, 1]
type = PlaySnd
trigger1 =animelem=2
value = 200, 10
channel=0
[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(3) < 0   &&anim=810
edge = 80*var(20),0


[State 210, 2]
type = HitDef
trigger1 =!movecontact
attr = S, NA
animtype  = Medium
damage    =65
hitflag=MAF
guardflag = MA
pausetime = 2,2
sparkno = -1;S7020+(random%4)
sparkxy = -60,-30
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=15
ground.type = High
guard.ctrltime=22
ground.slidetime =19
ground.hittime  = 26
ground.velocity = -1.5*var(20),-15*var(20)
guard.velocity=-4*var(20)
air.velocity = -1.5*var(20),-15*var(20)
air.hittime=ifelse(var(19)>0,185,35)
down.velocity=-5*var(20) ,-4.5*var(20)      ;Time before opponent regains control in air 
fall=1
fall.recovertime=ifelse(var(19)>0,185,35)
air.hittime=ifelse(var(19)>0,185,35)
id=200
envshake.time = 5
envshake.ampl = 5
envshake.freq=100
yaccel=.43*var(20)

[State -2, Helper]
type = Helper
trigger1 = animelem=5
helpertype = normal ;player
name = "spinny"
ID = 801
stateno =801
pos = -170,-255
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 + (enemy,gethitvar(hitcount))
stateno = 1003
pos = -10,-65*var(20)
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
;ignorehitpause =
;persistent =

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

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

;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -14*var(20)
[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 820]
type    = S
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=811
value =812
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =time=9&&enemy,var(5)=1
trigger2=time=13&&enemy,var(5)=0
value = 820
elem = 2


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

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = enemy,stateno!=810&& enemy,stateno!=812
value = 5050
;----------------------------------------------------------------------
[Statedef 821]
type = A
movetype = H
velset = -2,-11
poweradd = 40

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

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

[State 3545, 1]
type = ChangeAnim
trigger1 = selfanimexist(5061) && time = 0
value = 5061

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

[State 3545, 1]
type = ChangeAnim2
trigger1 = !selfanimexist(5061) && time = 0
value = 1104


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

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

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = ifelse(p2stateno=3050,1028,1025)

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0 && anim=1028
y = const(size.mid.pos.y)



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

;------------------
; (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*enemy,var(20)

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

;ignorehitpause =
;persistent =

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 60
trigger2 = FrontEdgeBodyDist <= 60
trigger3 = pos x >= enemy,fvar(15)-70 && enemy,fvar(15)!=.133545 && facing=-1
trigger4 = pos x <= enemy,fvar(15)+70 && enemy,fvar(15)!=.133545 && facing=1
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, Stop moving]
type = PosFreeze
trigger1 = time =[1,30]
value=1
[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0 && enemy,fvar(15)=.133545
x = 15*enemy,var(20) - BackEdgeBodyDist
[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0 && enemy,fvar(15)!=.133545
x = 15*enemy,var(20) -(enemy,fvar(15) -pos x)
[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;&& enemy,fvar(15)!=.133545
anim = F72
pos = -80, const(size.mid.pos.y)
postype = p1
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 1028, 1]
type = HitBy
trigger1 = 1
value = SCA, NA, NP,HA,SP,HP
[State 0, SelfState]
type = SelfState
triggerall =enemy,var(19)=0  && alive
trigger1=(time=[1,5])&& command="recovery" 
trigger2 = (time=[1,5])&&var(16) = 1&& p1name="Training"
trigger3 =(time=[1,5])&& AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 
value =5210

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6*enemy,var(20)


[State 1028, Vel X]
type = VelSet
triggerall = anim!=[5052,5062]
trigger1 = Time = 0
x = .5*enemy,var(20)
[State 1028, Vel X]
type = VelSet
triggerall = anim=5052
trigger1 = Time = 0
x = -.5*enemy,var(20)


[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .48*enemy,var(20)

[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 < 110)
[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 45)
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 = -14*enemy,var(20)
[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;  = 0;
ctrl = 0
anim = 850
sprpriority = 2

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

[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 =p2movetype=A
v = 5  ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno=[140,155])||p2movetype=H
v = 5  ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall=time=0
trigger1 = (p2stateno!=[140,155])&&p2movetype=I
v = 5  ;fv = 10
value =0

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = ifelse(random<499,605,610)
ctrl = 0

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 831]
type    = A
movetype= A
physics = N
velset=0,0
anim = 851
poweradd =50
[State 0, MoveHitReset]
type = MoveHitReset
trigger1 = time=0
;ignorehitpause = 
;persistent = 

[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 = 27   ;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(5)>=1
v = 19    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 =var(4)<0
v =4    ;fv = 10
value = 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 = 49*var(20),-103*var(20)
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*var(20),2*var(20)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=0
anim =842
ID =841
pos = 49*var(20),-103*var(20)
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*var(20),2*var(20)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 =time=1 && var(5)=2
anim =841
ID =841
pos = 49*var(20),-103*var(20)
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*var(20),2*var(20)
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time=[0,5]
ID =840
scale = (2-((time)*.12))*var(20),(2-((time)*.12))*var(20)
facing=facing
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time>=6
ID =840
scale = 1*var(20),1*var(20)
facing=facing

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

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = S3, 3
channel=1
[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S200, 8
channel=0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2)<0
pos =193,-295
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3)<0
pos =193,-253
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4)<0
pos =104,-237
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5)<0
pos =101,-228
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 5 
pos =160,-145
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = 2
;ignorehitpause =
;persistent =
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=3
value = -2
[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
edge = 90,0
[State 0, TargetState]
type = TargetState
trigger1 =animelem=5
value = 860
;ignorehitpause = 
;persistent = 
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=5
value = -55
absolute = 0
;ignorehitpause = 
;persistent = 

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


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


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

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 852
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =enemy,time=10&&enemy,var(5)=1
trigger2= enemy,time=14&&enemy,var(5)=0
value = anim
elem = 2
[State 0, TargetState]
type = changeState
trigger1 =p2stateno=835
value =836

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time%2=0 && animelemtime(4)>=0 && animelemtime(5)<0
value = 5
[State 0, AngleDraw]
type = AngleDraw
trigger1 = time%2=0  && animelemtime(4)>=0 && animelemtime(5)<0
value = -5
;scale = 
;ignorehitpause = 
;persistent = 

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NT
;value2 = S,NA
time = 1
;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 = enemy,stateno!=831
value = 5050
;---------------------------------------------------------------------------
; hitshakestae for trip or fast fall
; CNS difficulty: easy
[Statedef 1036]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1

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


 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 833
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 833]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0 && !selfanimexist(5121)
value = 854
[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0 && selfanimexist(5121)
value = 856
[State 0, VelSet]
type = VelSet
trigger1 =p2stateno=810 && time=0
x = -6*enemy,var(20)
y=-4*enemy,var(20)
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&(p2stateno=[830,831])
x = -5*enemy,var(20)
y = 7*enemy,var(20)
[State 0, VelSet]
type = VelSet
trigger1 =time=0 &&(p2stateno=1100)
x = -4.5*enemy,var(20)
y = -5*enemy,var(20)
[State 0, HitVelSet]
type = HitVelSet
trigger1 =time=0 &&p2stateno!=810
x = 1
y = 1
[State 0, Turn]
type = Turn
trigger1 =Time = 0 && !selfanimexist(5121) 
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent =
[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5*enemy,var(20)
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=0&& (time >5)
value = 834
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 834]
type    = L
movetype= H
physics = N
;facep2=1
[State 0, VelSet]
type = VelSet
trigger1 =vel x =-5*enemy,var(20)&& !selfanimexist(5121)
x = -3*enemy,var(20)
[State 0, VelSet]
type = VelSet
trigger1 =p2stateno=211&&time=0&& !selfanimexist(5121)
x = -5.5*enemy,var(20)
[State 0, VelSet]
type = VelSet
trigger1 =vel x =-5*enemy,var(20)&& selfanimexist(5121)
x = 3*enemy,var(20)
[State 0, VelSet]
type = VelSet
trigger1 =p2stateno=211&&time=0&& selfanimexist(5121)
x = 5.5*enemy,var(20)
;ignorehitpause =
;persistent =

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0&& !selfanimexist(5121)
value = 855
[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0&& selfanimexist(5121)
value = 5081
[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 820, 1]
type = ChangeAnim
Trigger1 = Time = 35&& selfanimexist(5121)
value = 5111
 [State 0, SelfState]
type = SelfState
triggerall=enemy,var(19)=0
triggerall = alive
trigger1 = time > 40 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 40 
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > 40
value =5201


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

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

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

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -5*var(20)
y=-4*var(20)


;---------------------------------------------------------------------------
;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*enemy,var(20)
y=-5*enemy,var(20)
[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
velset = -41,20
[State 0, Turn]
type = Turn
trigger1 = time=0
;ignorehitpause = 
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = time >4
value = 1
movecamera = 0,1
;ignorehitpause = 
;persistent = 


[State 810, State End]
type = changeState
trigger1 = frontedgebodydist < 90
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*.85
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 1028
;elem = 1
;ignorehitpause = 
;persistent = 

[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*1.55
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 =.75
;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 > -30 && vel y >0
value = 303
;---------------------------------------------------------------------------
;THE BEES
[Statedef 1000]
type    =U
movetype= I
physics = N
juggle =0;  = 0;    4
poweradd= 0
;velset = 0,0
anim = 1000+(statetype=A)
ctrl = 0
sprpriority = 0

[State 0, VarSet]
type = VarSet
triggerall = AILevel =0
trigger1 =time=0 
v = 2   ;fv = 10
value = ifelse(command="QCB1"&&power>=250,2,ifelse(command="QCB3" ,1,0))


;elem = 1
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& var(31)=0
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1=  p2statetype!=A && (p2statetype!=L|| p2stateno=5120 && fvar(6)>55) || p2statetype=A && fvar(7) >-40
v = 2   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && var(31)=0
triggerall=time=0
trigger1 = (fvar(6) =[50,175])&& p2statetype=A && fvar(7) <-40 
v = 2   ;fv = 10
value =1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && power>=250
triggerall=time=0
trigger1 = ( fvar(6) <=50&&p2statetype=L)
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1= var(2)=2 && power <250
v = 2   ;fv = 10
value = 0
 [State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 12
channel=0


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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)=2 && statetype!=A&&time=0
value = 1003
;elem = 1
;ignorehitpause = 
;persistent = 



[State 0, Helper]
type = Helper
triggerall = var(2)=2
trigger1 = time=0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1057
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3&& statetype!=A
x =-24

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4&& statetype!=A
x =-5

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5&& statetype!=A
x =3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6&& statetype!=A
x =26
[State 0, VelSet]
type = VelSet
trigger1 = animelem=1 && statetype=A
x = 0
y = -6*var(20)

[State 0, VelSet]
type = VelSet
trigger1 = statetype!=A
x = 0
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>=0  &&pos y <0
y = .55*var(20)
;ignorehitpause = 
;persistent = 



;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 

[State -2, Helper]
type = Helper
trigger1 = animelem=4&& statetype!=A
trigger2 = animelem=3&& statetype=A
helpertype = normal ;player
name = "BEES"
ID = 1005+var(2)
stateno = 1005
pos = cond(statetype=A,83,46),cond(statetype=A,-346,-321)
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
persistent=0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5
movetype = I 
[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = cond(statetype=A,57,0)
ctrl = 1




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

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

[State 0, VelSet]
type = VelSet
trigger1 = time=0
y=15*enemy,var(20)
x=-2*enemy,var(20)

;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .55*enemy,var(20)

;persistent =

[State 0, SelfState]
type = changeState
trigger1 = pos y>=-5*enemy,var(20)
value =1030

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

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

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

[State 0, VelSet]
type = VelSet
trigger1 = time=5
y=-8*enemy,var(20)
x=-.25*enemy,var(20)

[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .35*enemy,var(20)

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

[State 0, SelfState]
type = SelfState
trigger1 = pos y>0 && time>20
value =5100
;---------------------------------------------------------------------------
; Ground Bounce
[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=221|| p2stateno=420)
value = 5070
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& anim!=5070
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = p2stateno!=221 && p2stateno!=420
trigger1 = time=2&& anim=5030
value = 5160

[State 0, VelSet]
type = VelSet
trigger1 = time=0 && anim=5030
y=15*enemy,var(20)
x=-.15*enemy,var(20)

;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)*enemy,var(20)

;persistent =

[State 0, SelfState]
type = changeState
triggerall = time >ifelse(anim=5070,5,0)
trigger1 = pos y>=-5*enemy,var(20)
value =1032
;------------------
; 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
;---------------------------------------------------------------------------
; 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 = 5100

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


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

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




 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 1029
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1034]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1




 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 1031
;---------------------------------------------------------------------------
; Stomp da ground
; CNS difficulty: medium
[Statedef 1010]
type    = U
movetype= A
physics = N
juggle =0;  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel =0
trigger1 =time=0 
v = 2   ;fv = 10
value = ifelse(command="rupper_xy"&&power>=250,2,ifelse(command="rupper_y" ,1,0))


[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&&  prevstateno!=420
triggerall=time=0 && numhelper(1001)=0
triggerall = p2stateno!=[1031,1035]
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1= numhelper(1002)>0 && p2statetype!=L
trigger2= p2stateno=834 && fvar(6)<=30
v = 2   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 
triggerall=time=0
trigger1 =(fvar(6)=[70,170])&&  p2movetype=H
trigger2= numhelper(1001)>0
trigger3 = prevstateno=420
trigger4= fvar(6)>150&& prevstateno=[200,405]
v = 2   ;fv = 10
value =1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && power>=250
triggerall=time=0&& numhelper(1003)=0
trigger1 =  random<149
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1= var(2)=2 && power <250
v = 2   ;fv = 10
value = 0

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time=0 && var(2)=2
value = -250
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0 && var(2)>0
value = 1010+var(2)


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



[State 0, Helper]
type = Helper
triggerall = var(2)=2
trigger1 = time=0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1057
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =-53

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x =-23

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x =-3
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x =23
[State 0, VelSet]
type = VelSet
trigger1 = animelem=1 && statetype=A
x = 0
y = -8*var(20)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <-30  && animelem=8
value = anim
elem = 7

;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>=0 && animelemtime(8)<=0 &&pos y <-30
y = .85*var(20)
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
x =4
persistent=0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=8
x =-14

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=13
x =51




;ignorehitpause = 
;persistent = 


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

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

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=8
time = 5
freq = 60
ampl = 2
phase = 90

;ignorehitpause = 
;persistent = 

[State -2, Helper]
type = Helper
trigger1 = animelem=8 && numhelper(1001+var(2))=0
helpertype = normal ;player
name = "FIRE"
ID = 1001+var(2)
stateno = 1001
pos = 150,0
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=11
movetype = I 

[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*enemy,var(20)

[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 <= 60
trigger2 = FrontEdgeBodyDist <= 60
trigger3 = pos x >= enemy,fvar(15)-70 && enemy,fvar(15)!=.133545 && facing=-1
trigger4 = pos x <= enemy,fvar(15)+70 && enemy,fvar(15)!=.133545 && facing=1
value = ifelse(enemy,numtarget(2000),20012,1027)
[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 >= 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 && enemy,fvar(15)=.133545
x = ((15*enemy,var(20)) - BackEdgeBodyDist)*facing
[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0 && enemy,fvar(15)!=.133545
x = (15*enemy,var(20) -(enemy,fvar(15) -pos x))*facing
[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;&& enemy,fvar(15)!=.133545
anim = F72
pos = -80, const(size.mid.pos.y)
postype = p1
sprpriority = 3

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



[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,5])&& command="recovery" 
trigger2 = (time=[1,5])&&var(16) = 1&& p1name="Training"
trigger3 =(time=[1,5])&& AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 
value =5210


[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -8.6*enemy,var(20)

[State 1028, Vel X]
type = VelSet
triggerall = anim!=5052
trigger1 = Time = 0
x = 4*var(20);((p2dist x/3)/5)
[State 1028, Vel X]
type = VelSet
triggerall = anim=5052
trigger1 = Time = 0
x = 4*var(20);((p2dist x/3)/5)
;[State 0, VelMul]
;type = VelMul
;trigger1 =time <15
;x = .88


[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .55*enemy,var(20)

[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

;---------------------------------------------------------------------------
;MY POWER IS GREAT
[Statedef 1050]
type    = S
movetype= A
physics =S
juggle =0;  = 0;    0
ctrl = 0
anim =1050
poweradd=45
sprpriority = 2

[State 0, Width]
type = Width
trigger1 =animelem=4 
player = 60,0
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 = movehit=1 && var(2)=2
anim =10000
ID = 1051
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
trigger1 =animelem=3
value = 200, 15
channel=0
[State 0, VarSet]
type = VarSet
triggerall = AILevel =0
trigger1 =time=0 
v = 2   ;fv = 10
value = ifelse(command="upper_xy"&&power>=250,2,ifelse(command="upper_y" ,1,0))
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& var(31)=0&& prevstateno!=200
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1=  p2movetype=A 
v = 2   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && var(31)=0 && prevstateno!=200
triggerall=time=0
trigger1 = p2movetype=H
v = 2   ;fv = 10
value =1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && power>=250&& var(31)=0 
triggerall=time=0
trigger1 =  random<149 && p2movetype=H && p2stateno!=[120,150]
trigger2= prevstateno=200
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1= var(2)=2 && power <250
v = 2   ;fv = 10
value = 0
[State 0, PowerAdd]
type = PowerAdd
trigger1 = time=0 && var(2)=2
value = -250
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0 && var(2)>0
value = 1050+var(2)



[State 0, Helper]
type = Helper
triggerall = var(2)=2
trigger1 = time=0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1057
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, SA
animtype  = Medium
damage    =60
guardflag = MA
hitflag=MAF
pausetime = 4,cond(var(2)=2,13,cond(var(2)=1,12,4))
guard.pausetime=4,4
sparkno = S7010
sparkxy = -15*var(20),-140*var(20)
hitsound = S2, 4
guard.sparkno= S7510
guardsound = S6, 0
getpower=0
ground.type = High
ground.slidetime = 12
guard.ctrltime=15
ground.hittime  = 21
ground.velocity = -3.5*var(20),-8*var(20)
guard.velocity=-5
air.velocity = ifelse(var(2)=2,4.5,ifelse(var(2)!=1,1.5,-1))*var(20),ifelse(var(2)!=2,-8.5,3.5)*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -7*var(20),-3
fall=1
fall.recovertime=ifelse(var(21)=1,65,35)-(numexplod(1051)*7)*(var(2)=2)
id=200+(12 *(var(2)=2))

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

[State 0, VarSet]
type = VarSet
trigger1 = movehit && var(2)=2
v = 19   ;fv = 10
value = 1
ignorehitpause = 1
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = var(21)<2
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4&& var(2)=1
statetype = A       ;S,A,C,L
physics = N
;ignorehitpause = 
;persistent = 

[State 0, PosAdd]
type = velset
trigger1 = animelemtime(5)>=0 && var(2)=1
x = 15*var(20)
y = -15*var(20)
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 =  AnimTime = 0&& var(2)=1
y = -6
x = 4
;ignorehitpause = 
;persistent = 

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = ifelse(statetype=A,57,0)
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1055]
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)
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*enemy,var(20)
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=20
value = 302
;---------------------------------------------------------------------------
;THIS MILK SUCKS
[Statedef 1060]
type    = S
movetype= A
physics =S
juggle =0;  = 0;    0
ctrl = 0
anim =1051
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=2
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12002,12003)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0
[State 0, Explod]
type = Explod
trigger1 = animelem=5
anim =10000
ID = 1061
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 = movehit=1
anim =10000
ID = 1060
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1.5,1.5
sprpriority = 5
removetime=-1
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

[State 0, VarSet]
type = VarSet
trigger1 = numexplod(1060)>3 && var(21)=2
v = 21   ;fv = 10
value =1
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1=animelem=8
anim = 1052
ID = 1052
pos = -50,100
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
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1
persistent=0
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 58    ;fv = 10
value = ifelse(var(21)>0,39,27)
;ignorehitpause = 
;persistent = 
[State -2, Helper]
type = Helper
trigger1 = animelem=8
helpertype = normal ;player
name = "FIRE"
ID = 1004
stateno = 1004
pos = -49,-224
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 200, 1]
type = PlaySnd
trigger1 =animelem=7
value = 200, 14
channel=0
[State 0, Width]
type = Width
trigger1 =animelem=8
player = 60,0
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 8
attr = S, SA
animtype  = Medium
damage    =95,10
guardflag = HA
hitflag=MAF
pausetime = 4,4

sparkxy = -15,-50
hitsound = S2,5
sparkno = S7010
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
guard.ctrltime=50
getpower=70
ground.hittime  = 60
ground.velocity = -3*var(20)
guard.velocity=-7*var(20)
air.velocity = -7.5,-12
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -7*var(20),-3
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=17
id=200
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(10)<0 && var(25)=1 && p2stateno=5120
movetype = A
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=10
movetype = I 
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=8 
time = 5
freq = 60
ampl = 2
phase = 90

[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= S||p2statetype=C) && movehit=1 && (p2stateno!=1035)
value =1035
ID =200
ignorehitpause =0 
[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A) && movehit=1 && (p2stateno!=[1029,1031])
value =1029
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 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = ifelse(statetype=A,57,0)
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 1070]
type    =S
movetype= A
physics = S
juggle =0;  = 0;    5
poweradd=0
velset = 0,0
anim =1060
ctrl = 0
sprpriority =-1


[State 0, ReversalDef]
type = ReversalDef
trigger1 = animelem=3
reversal.attr = SCA,AA           ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
pausetime = 0,0
;sparkxy = 0,0 ;offset
p1stateno =1073



[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 
value =  0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 1071]
type    =S
movetype= A
physics = S
juggle =0;  = 0;    5
poweradd=0
velset = 0,0
anim =1061
ctrl = 0
sprpriority =-1

[State 0, SuperPause]
type = SuperPause
trigger1 = time=0
time =25
anim =-1 
movetime =25
darken = 1
p2defmul = 1
unhittable = 1
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 =animelem=5
player = 95,0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 10
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 58    ;fv = 10
value = 20

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype  = Medium
damage    =95
guardflag = MA
hitflag=MAFD
pausetime = 4,4
sparkno = -1
sparkxy = -15,-150
hitsound = S4,1
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
getpower=50
ground.slidetime = 12
guard.ctrltime=50
ground.hittime  = 60
ground.velocity = -3*var(20)
guard.velocity=-7*var(20)
air.velocity = -7.5,-12
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -7*var(20),-3
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=17
id=200

[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -15,-190
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= S||p2statetype=C) && movehit=1 && (p2stateno!=1035)
value =1035
ID =200
ignorehitpause =0 

[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A) && movehit=1 && (p2stateno!=[1031,1034])
value =1034
ID =200
ignorehitpause =1
[State 0, VarSet]
type = VarSet
triggerall = var(21)<2 
trigger1 = time=0 && var(21)=1
v = 21   ;v = 570
value = 0
ignorehitpause =1


[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 
value =  0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 1072]
type    =S
movetype= A
physics = S
juggle =0;  = 0;    5
poweradd=0
velset = 0,0
anim =1062
ctrl = 0
sprpriority =-1

[State 0, SuperPause]
type = SuperPause
trigger1 = time=0
time =25
anim =-1 
movetime =25
darken = 1
p2defmul = 1
unhittable = 1
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 =animelem=5
player = 95,0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 15
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 58    ;fv = 10
value = 20

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 6
attr = S, SA
animtype  = Medium
damage    =95
guardflag = MA
hitflag=MAFD
pausetime = 12,12
sparkno = S7010
sparkxy = -15,-210
getpower=50
hitsound = S2,5
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
guard.ctrltime=50
ground.hittime  = 60
ground.velocity = -11*var(20),-5*var(20)
guard.velocity=-7*var(20)
air.velocity = -11*var(20),-5*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -7*var(20),-3
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=17
id=200
envshake.time = 16
envshake.ampl = 7
envshake.freq=100

[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype=A) && movehit=1 && (p2stateno!=[1045,1050])
value =1045
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 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 
value =  0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 1073]
type    =S
movetype= A
physics = S
juggle =0;  = 0;    5
poweradd=0
velset = 0,0
anim =1063
ctrl = 0
sprpriority =-1
[State 0, ChangeState]
type = ChangeState
triggerall = AILevel=0
triggerall = command="holdx" || command="holdy" || command="holda" && power >=250
trigger1 = time=0
value =ifelse(command="holdx",1071,ifelse(command="holda"&&power>=250,1074,1072))
ctrl = 0
[State 0, ChangeState]
type = ChangeState
triggerall = AILevel>0
triggerall = fvar(6)=[41,90]
trigger1 = time=0
value =1071
ctrl = 0
[State 0, ChangeState]
type = ChangeState
triggerall = AILevel>0
triggerall = fvar(6)=[0,40]
trigger1 = time=0
value =1072
ctrl = 0
[State 0, SuperPause]
type = SuperPause
trigger1 = time=0
time =25
anim =-1 
movetime =25
darken = 1
p2defmul = 1
unhittable = 1
;ignorehitpause = 
;persistent = 
[State 0, NotHitBy]
type = HitBy
trigger1 =time=0 
value = SCA,NP,SP,HP
;value2 = S,NA
time = 30
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 =animelem=5
player = 95,0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 18
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12000,12001)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 58    ;fv = 10
value = 20


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 8
attr = S, NA
animtype  = Medium
damage    =85
guardflag = MA
pausetime = 10,10
sparkno = -1;S7020+(random%4)
sparkxy = -30,-120
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=50
ground.type = High
guard.ctrltime=22
ground.slidetime =19
ground.hittime  = 26
ground.velocity = -10*var(20),-6*var(20)
guard.velocity=-19
air.velocity = -10*var(20),-6*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0,32,24)
id=200
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,-220
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, VelSet]
type = VelSet
trigger1 =animelem=5 
x = 3*var(20)


[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=1036&&p2stateno!=[833,1032])
value =ifelse(var(21)>0,1025,1036)
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 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0 
value =  0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 1074]
type    =S
movetype= A
physics = N
juggle =0;  = 0;    5
poweradd=-250
velset = 0,0
anim =1058
ctrl = 0
sprpriority =-1

[State 0, SuperPause]
type = SuperPause
trigger1 = time=0
time =25
anim =-1 
movetime =25
darken = 1
p2defmul = 1
unhittable = 1
;ignorehitpause = 
;persistent = 
[State 0, NotHitBy]
type = HitBy
trigger1 =time=0 
value = SCA,NP,SP,HP
;value2 = S,NA
time = 30
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=2
statetype = A       ;S,A,C,L
;persistent = 

[State 0, Width]
type = Width
trigger1 =animelem=3
player = 95,0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=2
value = 200, 6
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=2
triggerall = var(23)=0
trigger1=numexplod(7611)<1
anim = ifelse(teamside=1,12002,12003)
ID = 7611
pos = ifelse(teamside=1,60,540),360
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 = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
persistent=0

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



[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype  = Medium
damage    =70
guardflag = MA
pausetime = 5,5
sparkno = -1;S7020+(random%4)
sparkxy = -30,-120
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
getpower=0
ground.type = High
guard.ctrltime=22
ground.slidetime =19
ground.hittime  = 26
ground.velocity = -1*var(20),12*var(20)
guard.velocity=-19
air.velocity = -1*var(20),12*var(20) 
fall=1
fall.recovertime=ifelse(var(21)>0,175,99)
id=200
envshake.time = 10
envshake.ampl = 7
envshake.freq=100
[State 0, VarSet]
type = VarSet
trigger1 =movehit 
v = 11    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 = movehit=1 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -13,-20*var(20)
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, VelSet]
type = VelSet
trigger1 =animelem=2
x = (p2bodydist x+(20*var(20)))
y=-3*var(20)
[State 0, VelMul]
type = VelMul
trigger1 =1 
x = .67
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2)>0 &&animelemtime(4)<0
y = .47*var(20)
[State 0, VelSet]
type = VelSet
trigger1 = animelem=4
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = animelem=4
y = 0
;ignorehitpause = 
;persistent = 



[State 0, TargetState]
type = TargetState
trigger1 =movehit=1 && (p2stateno!=[301,304])
value =1055
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 1010, 8]
type = ChangeState
trigger1 =animtime=0
value =  0
ctrl = 1
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1054]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = ifelse(p2statetype=A,1106,1101)

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =(enemy,animelemtime(1)<155) && ((enemy,var(16)=0)||gethitvar(hitcount)=1) && (enemy,time =[15,155]) 
value = ifelse(p2statetype=A,1106,1101)
elem = 2


[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
;ignorehitpause = 
;persistent = 
 
[State 0, SelfState]
type = SelfState
trigger1 =p2stateno!=1053
value =5050
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1055]
type    = A
movetype= H
physics = N
velset = -5,-5

[State 0, VelAdd]
type = VelAdd
trigger1 =1 
y = .65
[State 0, ChangeAnim2]
type = ChangeAnim2
triggerall = p2statetype=A
trigger1 =animelemtime(3)<0
value = 1106
elem = 3
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

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

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

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

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5
[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >=0&& (time >5||p2statetype=A)
value = 1052
;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 1052]
type    = L
movetype= H
physics = N
facep2=1
[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, VelSet]
type = VelSet
trigger1 =p2stateno=211&&time=0
x = -5.5*enemy,var(20)
[State 0, VelMul]
type = VelMul
trigger1 =1
x = .95
[State 0, VelSet]
type = VelSet
trigger1 =time>20
x = 0


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



[State 0, ChangeState]
type = selfState
trigger1 = time>38
value = ifelse(!alive, 5110,5120)
;---------------------------------------------------------------------------
; Item Throw
; CNS difficulty: medium
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle =0;  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
triggerall = AILevel =0
trigger1 =time=0 
v = 2   ;fv = 10
value = ifelse(command="QCF4"&&power>=250,2,ifelse(command="QCF3" ,1,0))
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0&& var(31)=0&& prevstateno!=200
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1=  var(12)!=3 || random<149
v = 2   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && var(31)=0 && prevstateno!=200
triggerall=time=0
trigger1 = var(12)=3 && random<149
v = 2   ;fv = 10
value =1
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0 && power>=250&& var(31)=0 
triggerall=time=0
trigger1 =  random<149 && p2movetype=H
v = 2   ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall=time=0
;trigger1 =  ( var(31)>0||p2movetype!=I) ;||var(2)=0 && time=1
trigger1= var(2)=2 && power <250
v = 2   ;fv = 10
value = 0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0
value = 1100+var(2)

 [State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = S200, 11
channel=0
[State 0, PowerAdd]
type = PowerAdd
trigger1 = time=0 && var(2)=2
value = -250

[State 0, VarSet]
type = VarSet
trigger1 = time=0 && var(2)=1
v = 12    ;fv = 10
value = 1+random%8
[State 0, VarSet]
type = VarSet
trigger1 = time=0 && (var(2)=0||var(2)=2)
v = 12    ;fv = 10
value = cond(var(12)=8,1,var(12)+1)


[State 0, Helper]
type = Helper
triggerall = var(2)=2
trigger1 = time=0
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1057
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.height=200
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =-16

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x =-22

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
x =22
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
x =16

;fridge/;-maniquinn
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=1
trigger2 = var(12)=6
v = 13    ;fv = 10
value = 180
;tanuki
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=5
v = 13    ;fv = 10
value = 300
;pantsu
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=4
v = 13    ;fv = 10
value = 45

[State 0, VarSet]
type = Varset
trigger1 =var(12)=3 && animelem=4
v = 15   ;fv = 10
value =cond(numhelper(1113),2,1)


;-blob
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=3
v = 13    ;fv = 10
value = 5

;sickle
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=7
v = 13    ;fv = 10
value = 240
;-mini sickle
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=2
v = 13    ;fv = 10
value =60

[State 0, VarSet]
type = VarSet
trigger1 = var(2)=2
v = 13    ;fv = 10
value =220
;-mini axe
[State 0, VarSet]
type = VarSet
trigger1 = var(12)=8
v = 13    ;fv = 10
value =110
[State -2, Helper]
type = Helper
trigger1 = animelem=4 && var(12)!=3
helpertype = normal ;player
name = "ITEM"
ID =1110
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
persistent=0
[State -2, Helper]
type = Helper
trigger1 = animelem=4&& var(12)=3
helpertype = normal ;player
name = "ITEM"
ID = 1112+var(15)
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelem=4 && var(2)=2
v = 12    ;fv = 10
value = cond(var(12)=8,1,var(12)+1)
[State 0, VarSet]
type = Varset
trigger1 = animelem=4 && var(2)=2&& var(12)=3
v = 15   ;fv = 10
value = cond(numhelper(1113),2,1)

[State -2, Helper]
type = Helper
trigger1 = animelem=4&& var(2)=2&& var(12)!=3
helpertype = normal ;player
name = "ITEM"
ID =1110
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State -2, Helper]
type = Helper
trigger1 = animelem=4&&var(2)=2&& var(12)=3
helpertype = normal ;player
name = "ITEM"
ID = 1112+var(15)
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelem=4&& var(2)=2
v = 12    ;fv = 10
value = 1+random%8
[State 0, VarSet]
type = Varset
trigger1 = animelem=4 && var(2)=2&& var(12)=3
v = 15   ;fv = 10
value =cond(numhelper(1113),2,1)
[State -2, Helper]
type = Helper
trigger1 = animelem=4&& var(2)=2&& var(12)!=3
helpertype = normal ;player
name = "ITEM"
ID =1110
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State -2, Helper]
type = Helper
trigger1 = animelem=4&&var(2)=2&& var(12)=3
helpertype = normal ;player
name = "ITEM"
ID = 1112+var(15)
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State -2, Helper]
type = Helper
trigger1 = animelem=4
helpertype = normal ;player
name = "ITEM GAUGE"
ID = 1150
stateno = 1150
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5
movetype = I 
[State 0, ChangeState]
type = ChangeState
trigger1 =animtime=0 
value =0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 1101]
type    = A
movetype= H
physics = N
sprpriority = 0


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

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

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = -8*enemy,var(20)
y = -6*enemy,var(20)

[State 0, VelAdd]
type = VelAdd
trigger1 = time >=0
y =.5*enemy,var(20)
ignorehitpause=1
persistent = 1

[State 1050, 5]
type = ChangeState
trigger1 = pos y >=5
value = 1102
;---------------------------------------------------------------------------
[Statedef 1102]
type    = L
movetype= H
physics = S
sprpriority = 0
velset=0,0
anim = 5080
facep2=1

[State 0, PosSet]
type = PosSet
trigger1 =1
y = 0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
;value2 = S,NA
time = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animtime = 0 && anim = 5080
value = 5110


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time= 13
value = 5120


[State 1050, 5]
type = ChangeState
trigger1 =animtime = 0 && anim = 5120
value = 1103

;---------------------------------------------------------------------------
[Statedef 1103]
type    = S
movetype= H
physics = S
sprpriority = 0
anim = 5300




[State 1050, 5]
type = selfState
trigger1 =time = 80
value = 0
ctrl = 1


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

;ignorehitpause =
;persistent =

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

[State 0, SuperPause]
type = SuperPause
trigger1 = time=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
trigger1 = time=0
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 3,ifelse(GameHeight=180,2.25,3)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 8002
ID =8002
pos = 0,-210
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 = 3,3
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
[State 3000, Super B]
type = AfterImage
trigger1 = time = 1
time = 2
timegap = 1
framegap = 10
trans = add1
length = 30
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0

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


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





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


[State 0, VarSet]
type = VarSet
trigger1 = animelem=4
trigger2 = animelem=6 
v = 12    ;fv = 10
value = cond(var(12)=8,1,var(12)+1)
[State 0, VarSet]
type = VarSet
trigger1 = animelem=8 
trigger2 = animelem=10 
trigger3 = animelem=12
v = 12    ;fv = 10
value = 1+(random%8)

[State 0, VarSet]
type = VarSet
triggerall=var(12)=3
trigger1 = animelem=4
trigger2 = animelem=6 
trigger3 = animelem=8 
trigger4 = animelem=10 
trigger5 = animelem=12
v = 12    ;fv = 10
value = ifelse(random<499,2,4)
[State -2, Helper]
type = Helper
trigger1 = animelem=4 
trigger2 = animelem=6
trigger3 = animelem=8 
trigger4 = animelem=10 
trigger5 = animelem=12
helpertype = normal ;player
name = "ITEM"
ID = 1110
stateno = 1109+var(12)
pos =49,-116
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =-16

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
trigger2 = animelem=6
trigger3 = animelem=8 
trigger4 = animelem=10 
trigger5 = animelem=12
x =-22

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=5
trigger2 = animelem=7
trigger3 = animelem=9
trigger4 = animelem=11
trigger5 = animelem=13
x =22
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=14
x =16


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



;---------------------------------------------------------------------------
;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
y = const(size.mid.pos.y)-30
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time=0
value = SCA
;value2 = S,NA
time = 8
;ignorehitpause = 
;persistent = 



[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    = A
movetype= H
physics = N
poweradd = 0
velset=0,0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&!selfanimexist(5121) && !selfanimexist(5122)
value = 3005
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0&&(selfanimexist(5121) || selfanimexist(5122))
value = 3004

[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 && enemy,stateno!= 3050 &&time > 15
value =5201

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

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

[Statedef 3050]
type    = U
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle =0;=2
anim = 3001+statetype=A
ctrl = 0
sprpriority = 2
;ignorehitpause =
;persistent =

;ignorehitpause =
;persistent =

[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 0, SuperPause]
type = SuperPause
trigger1 = time=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
trigger1 = time=0
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 3,ifelse(GameHeight=180,2.25,3)
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
;ignorehitpause =
;persistent =
[State 0, Explod]
type = Explod
trigger1 = time=0 
anim = 8002
ID =8002
pos = cond(statetype!=A,35,2),-204
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 = 3,3
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

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

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

[State 200, 1]
type = PlaySnd
trigger1 =animelem=2
value = 200, 15
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=6
value = 200, 10
channel=0


[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 4000
ID =4000
pos = 0,0
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime=99
pausemovetime=99
scale = 3,3
sprpriority = -4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
;ignorehitpause =
;persistent =


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

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


[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3
x =-16

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4
x =-22

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=6
trigger2 = animelem=8
trigger3 = animelem=10
trigger4 = animelem=12
trigger5 = animelem=14
trigger6 = animelem=16
trigger7 = animelem=18
trigger8 = animelem=20
trigger9 = animelem=22
x =1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=7
trigger2 = animelem=9
trigger3 = animelem=11
trigger4 = animelem=13
trigger5 = animelem=15
trigger6 = animelem=17
trigger7 = animelem=19
trigger8 = animelem=21
x =-1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=23
x =27

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=24
x =3

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=25
x =3

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=26
x =28

[State -2, Helper]
type = Helper
trigger1 = time%2=0 && animelemtime(5)>=0&&animelemtime(23)<0 && anim=3001
trigger2 = time%2=0 && animelemtime(4)>=0&&animelemtime(20)<0 && anim=3002
helpertype = normal ;player
name = "ITEM"
ID = 3051
stateno = 3051
pos =cond(anim=3002,2,63),cond(anim=3002,-196,-201)
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 =animtime=0 
value =ifelse(statetype=A,57,0)
ctrl = 1

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

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


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




[State 1050, 5]
type = selfState
trigger1 = pos y >0 && time >5
value = 5050
;---------------------------------------------------------------------------
;FLY TO WALL
[Statedef 3053]
type    = A
movetype= H
physics =N
juggle =0;  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 3

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

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

[State 0, AngleDraw]
type = AngleDraw
trigger1 =1
value = -45*enemy,var(36)
ignorehitpause =1 
[State 1050, 5]
type = selfState
trigger1 = p2stateno!=[3050,3062]
value = 5050
;---------------------------------------------------------------------------
;HIT THE WALL
[Statedef 3055]
type    = S
movetype= H
physics = S
juggle =0;  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 3

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

[State 0, EnvShake]
type = EnvShake
trigger1 = time=0
time = 5
freq = 60
ampl = 5
phase = 120

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



[State 1050, 5]
type = selfState
trigger1 = p2stateno!=[3050,3062]
value = 5050
;---------------------------------------------------------------------------
;HIT STRAIGHT UP
[Statedef 3054]
type    = A
movetype= H
physics = N
juggle =0;  = 0;    0
velset = 0,-15*enemy,var(20)
ctrl = 0
sprpriority = 0
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 50061
ignorehitpause = 1
persistent = 1


[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5*enemy,var(20)
;ignorehitpause = 
;persistent = 
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,HT
;value2 = S,NA
time = 1
;ignorehitpause = 
;persistent = 

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0
;ignorehitpause =
;persistent =
[State 0, PosSet]
type = PosSet
trigger1 =time > 30 && enemy,vel x =0 && enemy,animelemtime(4)<0
x = enemy,pos x +80
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = time > 30 && enemy,vel x =0 
y = 7*enemy,var(20)
persistent = 0

[State 0, PosFreeze]
type = PosFreeze
trigger1 = time > 30 && enemy,animelemtime(2)<0
value = 1
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemy,animelem=8
value = 3060
;elem = 1
;ignorehitpause = 
;persistent = 


[State 1050, 5]
type = selfState
trigger1 =pos y >=0 && time >5
value = 5050
;------------------
; Wall Stick
[Statedef 3059]
type    = A
movetype= H
physics = N
velset = -24,-15

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


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

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

[State 1025, State]
type = ChangeState
trigger1 = pos y >=0
value = 3074
;---------------------------------------------------------------------------
[Statedef 3074]
type    = S
movetype= H
physics = S
juggle =0;  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 0

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


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

[State 0, LifeAdd]
type = LifeAdd
trigger1 = time=0
value = -99999
kill = 1
absolute = 0
;ignorehitpause = 
;persistent = 


;abspan = 
;ignorehitpause = 
;persistent = 


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

[State 0, SelfState]
type = changeState
trigger1 =1
value =5150
;---------------------------------------------------------------------------
[Statedef 3060]
type    = S
movetype= A
physics = S
poweradd= 0
velset = 0,0
ctrl = 0
juggle =0;=0
anim = 3050
sprpriority = 2
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 =time=0
time = 1

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


[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 180, 1
channel=0
[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 8002
ID =8002
pos = 0,-210
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 = 3,3
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

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

;[State 1000, 1]
;type = PlaySnd
;trigger1 = animelemtime(4)=5 && movehit
;value = 200,25
[State 1000, 1]
type = PlaySnd
trigger1 =animelem=9
value = 5000, 0
channel=0


[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = !movecontact
attr = S, HA
animtype  = Hard
damage    = 0, 4
priority  = 5
guardflag = M
pausetime = 15,15
sparkno = -1
guard.sparkno= S7510
sparkxy = -18,-80*var(20)
hitsound = S4,0
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -9,-7
air.velocity = -9,-7
p2stateno=3054
p1stateno=3061
envshake.time = 25
envshake.ampl = 7
envshake.freq=126
snap=82,-156
id=3060



[State 0, VelSet]
type = VelSet
trigger1 =animelem=9 
x = 0
y = -9.5
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(9)>0 
y = 1.5
;ignorehitpause = 
;persistent = 

[State 1050, 5]
type = changeState
trigger1 = pos y >0 && animelemtime(9)>0
value = 5050
;---------------------------------------------------------------------------
[Statedef 3061]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle =0;=0
anim = 3051
sprpriority = 5

[State 0, Helper]
type = Helper
trigger1 = time=0 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,-250
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 11009, dust]
type = Explod
trigger1 =time=0 && numexplod(6003)=0
anim =6003
ID = 6003
postype =p1
pos = 0,0
bindtime = -1
facing = 1
sprpriority = 3
scale = 2,2
ownpal = 1
ignorehitpause =1
ontop =1
pausemovetime = 999
supermovetime = 9999
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelemtime(15)>100 && anim=3084
id =11009

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S999,4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S999,4
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =1
flag = nobardisplay
ignorehitpause=1
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x <600
triggerall = anim=3051

trigger1 = time=0
x =  -5*var(20)
y = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x >765
triggerall = anim=3051
trigger1 = time=0
x =  5*var(20)
y = 0

[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x >190
triggerall = anim=3051
trigger1 = time=0
x =  -5*var(20)
y = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x <190
triggerall = anim=3051
trigger1 = time=0
x =  5*var(20)
y = 0


[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = anim=3051 && animelemtime(2)<0
trigger1 =screenpos x=[200,215]
x = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = anim=3051 && animelemtime(2)<0
trigger1 = screenpos x>=765
x = 0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,1
[State 1000, 1]
type = PlaySnd
trigger1 =animelem=8
value = 200,9
channel=0
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=8
value = S3,4
channel=3
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=3051 && animelemtime(3)<0
trigger1 =vel x!=0  || enemy,vel y <3
value = 3051
elem=1

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=23
value = 200,2
channel=0
volumescale=70
;[State 0, Helper]
;type = Helper
;trigger1 = animelem=20
;helpertype = normal ;player
;name = "powerup"
;ID =3068
;stateno =3068
;pos = 0,0
;postype = p1    ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 0


;persistent = 

;[State 0, TargetBind]
;type = TargetBind
;trigger1 = animelemtime(1)>=0 && animelemtime(2)<0
;pos = -7,-400
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=8 
value = S4,1
channel = 1
ignorehitpause=1
persistent=0
;abspan = 
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = Helper
trigger1 =animelem=8 && numhelper(1002+(enemy,gethitvar(hitcount)))=0
helpertype = normal ;player
name = "heavyspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1003
pos =  -30,-0
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
persistent=0

[State 0, VarSet]
type = Varadd
trigger1 = var(16)<120 && animelemtime(8)>=0 && animelemtime(14)<0
v = 16   ;fv = 10
value = 1
[State 0, Explod]
type = Explod
trigger1 = var(16)=[21,118]
trigger1 = vel x >0
trigger1 = time%8=0
anim = 8301
ID = 8300
pos = -21,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -4,0
accel = 0,0
random = 5,0
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, EnvShake]
type = EnvShake
trigger1 = var(16)=20
time = 80
freq = 90
ampl = -2
phase = 100
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 = var(16)=[21,118]
trigger1 = vel x <0
trigger1 = time%8=0
anim = 8301
ID = 8300
pos = 21,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = -4,0
accel = 0,0
random = 5,0
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =animelem=14 && var(16)<120 
value = anim
elem = 8
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=9
value = S1,1
;channel = 2
ignorehitpause=1
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = var(16)=[21,118]
x = (6.5)*(sin(0.095*time))

[State 0, SprPriority]
type = SprPriority
trigger1 =animelem= 10
trigger2 =animelem= 17
value = -1
;ignorehitpause = 
;persistent = 
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem= 13
value = 6
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem= 19
value = 3

[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=22
time = 6
freq = 120
ampl = -8
phase = 100

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(8)>=0 && animelemtime(9)<0
pos = 287,-288
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(9)>=0 && animelemtime(10)<0
pos = 100,-273
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(10)>=0 && animelemtime(11)<0
pos =-191,-272
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(11)>=0 && animelemtime(12)<0
pos =-234,-267
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(12)>=0 && animelemtime(13)<0
pos =7,-277
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(13)>=0 && animelemtime(14)<0
pos =224,-267
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(14)>=0 && animelemtime(15)<0
pos =238,-276
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(15)>=0 && animelemtime(16)<0
pos =-23,-286
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(16)>=0 && animelemtime(17)<0
pos =-86,-223
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(17)>=0 && animelemtime(18)<0
pos =-111,-297

[State 0, TargetBind]
type = TargetBind
trigger1 = animelem=18 
pos =-159,-169

[State 0, VelSet]
type = VelSet
trigger1 =animelem=25
x = -20
y = 14
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 



[State 0, PosSet]
type = PosSet
triggerall = numhelper(3056)
trigger1 = animelem=26
x = helper(3056),pos x 
y = helper(3056),pos y
 

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = animelem=26
attr = S, HT
animtype  = Hard
damage    = 0, 0
priority  = 5
guardflag = M
pausetime = 0,0
numhits=0
sparkno = -1
guard.sparkno= S7510
sparkxy = -18,-80*var(20)
hitsound =-1
guardsound = S6, 0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -9,-7
air.velocity = -9,-7
p2stateno=3053
id=3059
nochainid=3059


[State -2, Helper]
type = Helper
trigger1 = animelem=19
helpertype = normal ;player
name = "spinny"
ID = 3056
stateno =3056
pos = -170,-255
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

[State 0, VarSet]
type = Varset
triggerall =animelemtime(19)>=0
trigger1 = var(40)=0 || var(40)>10 || time%2=0&& var(40)=[1,10]
v = 36   ;fv = 10
value = cond(var(36)=5,0,var(36)+1)
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=26
value = S190,2
channel =0
ignorehitpause=1
persistent=0
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y <-90 && animelem=27 
value = anim
elem = 26
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(40)%9=0
value = S1,0
channel = 2
ignorehitpause=1
[State 0, VarSet]
type = Varadd
trigger1 =animelemtime(26)>0 &&animelemtime(27)<0
v = 40    ;fv = 10
value = 1
[State 0, Pause]
type = Pause
trigger1 = time%3=0 &&animelemtime(26)>0 &&animelemtime(27)<0 && var(40)<10
time = 2
;endcmdbuftime = 0
;pausebg = 1
;ignorehitpause = 
;persistent = 

[State 0, Trans]
type = Trans
trigger1 =var(40)=5
trans = addalpha;, sub
alpha = 235,250
[State 0, Trans]
type = Trans
trigger1 =var(40)=4
trans = addalpha;, sub
alpha = 195,250
[State 0, Trans]
type = Trans
trigger1 =var(40)=3
trans = addalpha;, sub
alpha = 155,250
[State 0, Trans]
type = Trans
trigger1 = var(40)=2
trans = addalpha;, sub
alpha = 75,250
[State 0, Trans]
type = Trans
trigger1 = var(40)=1
trans = addalpha;, sub
alpha = 25,250
[State 0, Trans]
type = Trans
trigger1 = var(40)=0 && animelemtime(26)>=0&&animelemtime(27)
trans = addalpha;, sub
alpha = 0,250
[State 0, AngleDraw]
type = AngleDraw
trigger1= animelemtime(26)>=0 && animelemtime(27)<0
value = -60*var(36)
ignorehitpause =1 

[State 0, TargetBind]
type = TargetBind
triggerall = animelemtime(26)>=0 && animelemtime(27)<0
trigger1 = var(36)=0
pos = -69,84
id=3059
[State 0, TargetBind]
type = TargetBind
triggerall = animelemtime(26)>=0 && animelemtime(27)<0
trigger1 = var(36)=1
pos = -128,-108
id=3059
[State 0, TargetBind]
type = TargetBind
triggerall = animelemtime(26)>=0 && animelemtime(27)<0
trigger1 = var(36)=2
pos = 75,-180
id=3059
[State 0, TargetBind]
type = TargetBind
triggerall = animelemtime(26)>=0 && animelemtime(27)<0
trigger1 = var(36)=3
pos = 199,-30
id=3059
[State 0, TargetBind]
type = TargetBind
triggerall = animelemtime(26)>=0 && animelemtime(27)=0
trigger1 = var(36)=4
pos = 125,141
id=3059
[State 0, TargetBind]
type = TargetBind
triggerall = animelemtime(26)>=0 && animelemtime(27)<0
trigger1 = var(36)=5
pos = -56,181
id=3059
[State 0, TargetBind]
type = TargetBind
trigger1 = animelem=27 
pos = 212,-88
id=3059

[State 0, VelSet]
type = VelSet
trigger1 = animelem=26 && var(40)>5
x = -1
y = 4
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=27
y = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelem=27
x = 0
y = 0
;ignorehitpause = 
;persistent = 






[State 0, TargetState]
type = TargetState
trigger1 =animelemtime(44)=1
value =3059
ignorehitpause =1 
;persistent = 



[State 11009, dust]
type = Explod
trigger1 = time = 0
anim = 4001
ID = 4001
postype =left
pos = 0,0
bindtime = -1
facing = 1
sprpriority = -2
scale = 1.5,ifelse(GameHeight=180,1.17,1.62)
ownpal = 0
ignorehitpause =1
removetime=-1
ontop =0
pausemovetime = 999
supermovetime = 9999

[State 0, ModifyExplod]
type = removeexplod
trigger1 = animelem= 27,25
ID =4001
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=27
value = S46,0
channel = 2
ignorehitpause=1
persistent=0
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=27
time = 8
freq = 140
ampl = -16
phase = 100

;[State 0, Pause]
;type = Pause
;trigger1 = animelemtime(27)>0 && animelemtime(27)<15 && time%2=0 
;time = 1
;endcmdbuftime = 0
;pausebg = 1
;ignorehitpause = 
;persistent = 

;persistent =
;supermove = 0
;pausemove = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=31
value = S190,3
channel = 0
ignorehitpause=1
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=42
value = S999,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=27,18
value = S46,2
channel = 1
ignorehitpause=1
persistent=0
[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=27,25
time = 8
freq = 140
ampl = -8
phase = 100
[State 0, Pause]
type = Pause
trigger1 =  animelem=27,25
time = 20
;endcmdbuftime = 0
;pausebg = 1
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 = animelem=27,15
anim = 411
ID =411
pos = 235,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.85,2.4
sprpriority = 4
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, TargetState]
type = TargetState
trigger1 = animelem=27
value = 1030
ID = 3059
;ignorehitpause = 
;persistent = 
[State 0, TargetState]
type = TargetState
trigger1 = animelem=27,25
value = 3074
ID = 3059
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=27
time = 8
freq = 90
ampl = -4
phase = 90
;ignorehitpause = 
;persistent = 


;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
trigger1 =1
v = 37    ;fv = 10
value = 1

[State -2, Helper]
type = Helper
trigger1 = animelem=27,30
helpertype = normal ;player
name = "winko"
ID = 3065
stateno = 3063
pos = 235,-450
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime  =999
pausemovetime = 999
ignorehitpause = 1
size.xscale=4
size.yscale=4
[State -2, Helper]
type = Helper
trigger1 = animelem=27,30
helpertype = normal ;player
name = "winko"
ID = 3063
stateno = 3063
pos = 235,-375
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime  =999
pausemovetime = 999
ignorehitpause = 1
size.xscale=4
size.yscale=4
[State -2, Helper]
type = Helper
trigger1 = animelem=27,30
helpertype = normal ;player
name = "winko"
ID = 3063
stateno = 3063
pos = 235,-300
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime  =999
pausemovetime = 999
ignorehitpause = 1
size.xscale=4
size.yscale=4

[State -2, Helper]
type = Helper
trigger1 = animelem=27,30
helpertype = normal ;player
name = "winko"
ID = 3063
stateno = 3063
pos = 235,-450
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime  =999
pausemovetime = 999
ignorehitpause = 1
size.xscale=4
size.yscale=4

[State -2, Helper]
type = Helper
trigger1 = animelem=31
helpertype = normal ;player
name = "winko"
ID = 3063
stateno = 3057
pos = 127,-143
postype = p1  ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime  =999
pausemovetime = 999
ignorehitpause = 1

[State -2, Helper]
type = Helper
trigger1 =animelem= 27,25
triggerall = NumHelper(6000) < 1
helpertype = normal ;player
name = "winko"
ID = 6000
stateno = 6000
pos = 0,0
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime  =999
pausemovetime = 999
ignorehitpause = 1
[State 0, SelfState]
type = changeState
trigger1 =animtime=0
value = 0
ctrl=1

;ignorehitpause =
;persistent =



;------------------
; Wall bounce
[Statedef 20010]
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 =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*enemy,var(20)

[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 >= 0)
value = 5100

;------------------
; wall splat
[Statedef 20012]
type    = A
movetype= H
physics = N
velset=0,0

[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, 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, Pos]
type = PosAdd
trigger1 = Time = 0 && enemy,fvar(15)=.133545
x = 15*enemy,var(20) - BackEdgeBodyDist
[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0 && enemy,fvar(15)!=.133545
x = 15*enemy,var(20) -(enemy,fvar(15) -pos x)


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

[State 1027, Spark]
type = Explod
trigger1 = Time = 0;&& enemy,fvar(15)!=.133545
anim = F72
pos = -80, const(size.mid.pos.y)
postype = p1
sprpriority = 3
;[State 0, LifeAdd]
;type = LifeAdd
;trigger1 = animelem=2
;value = -15
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = 60
;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 >=19
value = 20013

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

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




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


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

[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 1028, Anim 5050] ;Self falling animation
type = ChangeAnim2
trigger1 = Time = 0
value = 10252
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
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, Helper]
type = Helper
trigger1 =numhelper(10003)=0
helpertype = normal ;player
name = "neutrality"
ID =  10003
stateno = 9999
pos = 61,-37
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
size.xscale =1*const(size.xscale)
size.yscale =1*const(size.yscale)
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2= nocrouchguard
flag3 = noairguard

;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = !numhelper(1150) && stateno!=1100
v = 13    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1=numhelper(1005)>0
trigger1 = (helper(1005),var(8)=1)
anim =10000
ID = 1005
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime=-1
scale = 1.5,1.5
sprpriority = 5
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 = numhelper(1006)>0
trigger1= helper(1006),var(8)=1
anim =10000
ID = 1006
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime=-1
scale = 1.5,1.5
sprpriority = 5
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1=numhelper(1007)>0
trigger1 = helper(1007),var(8)=1
anim =10000
ID = 1007
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime=-1
scale = 1.5,1.5
sprpriority = 5
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall = numhelper(411)=1
trigger1 = helper(411),var(3)=1
anim =10000
ID = 411
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime=-1
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0
[State 0, Explod]
type = Explod
triggerall = numhelper(212)=1
trigger1 = helper(212),var(0)=1
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
removetime=-1
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=0
[State 0, Explod]
type = Explod
trigger1=numhelper(1001)>0
trigger1 = (helper(1001),var(3)=1)
trigger2 = numhelper(1002)>0
trigger2= helper(1002),var(3)=1
trigger3=numhelper(1003)>0
trigger3 = helper(1003),var(3)=1
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
removetime=-1
scale = 1.5,1.5
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 =stateno!= 1100 && stateno!=9000
v = 28   ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = !numhelper(1113)
v = 15    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H ||(p2stateno=[1025,1028])||(p2stateno=[1045,1048])||p2stateno=[202,203]
v = 11    ;fv = 10
value = 0
;persistent = 
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=[20012,20013]
value = 1
movecamera = 0,1
;ignorehitpause = 
;persistent = 



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

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1031,1034])
value =1034
ID =410
ignorehitpause =1 
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit && (p2stateno!=1036&&p2stateno!=[833,1032]) && enemy,hitshakeover
value =1036
ID =212
ignorehitpause =0
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit && (p2stateno!=[833,1032])
value =1025
ID =211
ignorehitpause =1
[State 0, TargetState]
type = TargetState
triggerall = p2statetype=A
trigger1 = movehit && (p2stateno!=[1025,1055]) && p2stateno!=1033
value =1033
ID =210
ignorehitpause=0
[State 0, VarSet]
type = VarSet
trigger1 = p2bodydist x !=0
fv = 6   ;fv = 10
value = p2bodydist x/3
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =p2bodydist x  =0
fv = 6   ;fv = 10
value = 0
ignorehitpause = 1
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = p2bodydist y !=0
fv = 7   ;fv = 10
value = p2bodydist y/3
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = p2bodydist y =0
fv = 7   ;fv = 10
value = 0
ignorehitpause = 1
;same move detection reset
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =numhelper(1005)=0
trigger2= numhelper(1005)>0
trigger2= helper(1005),var(8)=0
id = 1005
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =numhelper(1006)=0
trigger2= numhelper(1006)>0
trigger2= helper(1006),var(8)=0
id = 1006
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =numhelper(1007)=0
trigger2= numhelper(1007)>0
trigger2= helper(1007),var(8)=0
id = 1007
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id = 411
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id = 10101
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id = 221
ignorehitpause = 1
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id = 620
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id = 210
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 = 220
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1051
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155] 
id =1060
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = stateno!=1000 && stateno!=1060
id =1061
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H || p2stateno=[120,155]
id =1001
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =var(21)>0 && stateno!=[800,899]
v = 19   ;fv = 10
value = 1
;---------------------
;idiot proofing
[State 0, VarSet]
type = VarSet
trigger1 =var(55)>4
v = 55    ;fv = 10
value = 4

[State 0, VarSet]
type = VarSet
trigger1 =var(55)<1
v = 55    ;fv = 10
value = 1
[State 0, 0] ;Change palette
type = RemapPal
trigger1 = numhelper(4001)>0 && AIlevel=0
source = 1,1
dest = 1,var(54)
ignorehitpause=1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =roundstate=2
id =12000

[State 0, VarSet]
type = VarSet
trigger1 =var(21)=0 && movehit && (p2stateno=5080||p2stateno=[5000,5030]) 
trigger2= p2movetype!=H
trigger3 = numexplod(1000)>2
trigger4 = numexplod(1010)>2
trigger5 = numexplod(1050)>2 && var(21)>0
v = 19  
value = 0
ignorehitpause = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(37)=1
flag = nobardisplay
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(37)=1
flag = nomusic
ignorehitpause=1


[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
trigger2= p2stateno=5120
v = 25   ;fv = 10
value = 0
ignorehitpause = 1
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =stateno!=[40,50] 
v = 26   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =var(31)=0
v = 18   ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 =enemy,anim=5300 
v = 17    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
v = 17    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = var(21)>0 && movehit
v = 23   ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 


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


[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 20   ;fv = 10
value = 960/320
;ignorehitpause = 
;persistent = 
 

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


[State 113, VarSet]
type = VarSet
trigger1 = var(21)!=2
trigger2 = (stateno!=1060)
trigger2 = stateno!=212  
trigger2 = stateno!=1074 
triggerall = p2movetype=A 
v =21   ;v = 570
value = 1
;[State 113, VarSet]
;type = VarSet
;triggerall = (stateno=212||stateno=[1060,1100]) && stateno!=1010
;triggerall = stateno!=[1070,1073]  
;trigger1 = p2movetype=A 
;v =21   ;v = 570
;value = 2
[State 114, VarSet]
type = VarSet
trigger1 = p2movetype!=A && var(21)<2 && (p2stateno!=[1025,1048]) && enemy,hitshakeover
trigger1= p2movetype!=H &&var(21)=2 && movetype !=A
trigger2= p2stateno=5120
trigger3= p2movetype=I
v = 21   ;v = 570
value = 0
ignorehitpause=1


;-------buffer
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=21)   && (p2statetype=L||stateno=1000)
v = 32    ;fv = 10
value =13;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 =(var(31)=21)   && (p2statetype=L||stateno=1000)
v = 32    ;fv = 10
value =13;-wait 34 ticks before proceeding 
ignorehitpause = 1
[State 0, VarSet]
type = Varadd
trigger1 = var(32)>0
v =32    ;fv = 10
value = -1

[State 0, VarSet]
type = Varset
trigger1 = var(32)=0 && p2movetype!=H
v =32    ;fv = 10
value = -1
;----------------------------
;----AI reset grab time
[State 0, VarSet]
type = VarSet
trigger1 = var(31)>0
trigger2 = movetype=A
v = 39    ;fv = 10
value = stateno
;ignorehitpause = 
;persistent = 

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

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

[State -2, 1]
type = ChangeState
triggerall = prevstateno=[120,155]
triggerall = !alive
triggerall = stateno !=171
triggerall = pos y >=-36
trigger1 = 1
value = 171
[State 0, VarSet]
type = VarSet
trigger1 =statetype!=A
v = 6   ;fv = 10
value = 0
;ignorehitpause =
;persistent =

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


[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
trigger2 = var(31)<4 && p2statetype=L
trigger3 = fvar(7)>-20 &&var(31)=[22,23]
;trigger2 = stateno=[800,810]
v = 31    ;fv = 10
value = 0
ignorehitpause = 1

;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 9   ;fv = 10
value = enemy,lifemax/4
;ignorehitpause =
;persistent =
[State 0, PlaySnd]
type = PlaySnd
trigger1 = p2stateno=834 && enemy,time=1
trigger2=p2stateno=3005&& enemy,time=1 && p2movetype=H
value = S2,5
channel=3

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 14    ;fv = 10
value = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=303
trigger1 = enemy,time=1
value = S2,1

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=862||p2stateno=1047|| p2stateno=1030||p2stateno=1032||p2stateno=20012||p2stateno=3004
trigger1 = enemy,time=1
value = S2,2
channel=3

[State 0, PlaySnd]
type = PlaySnd
triggerall =p2stateno=861||p2stateno=1102
trigger1 = enemy,time=1
value = S2,0
channel=3

[State 0, Explod]
type = Explod
triggerall= numexplod(8302)=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 = 1.5,2.1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall= numexplod(8303)=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 =1.5,2.1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State 0, Explod]
type = Explod
triggerall= numexplod(8304)=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 = 8304
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 = 1.5,2.1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1
[State -2, Helper]
type = Helper
trigger1 = winko && stateno = 3000
trigger2 = winko && stateno = 3050

triggerall = NumHelper(6000) < 1
helpertype = normal ;player
name = "winko"
ID = 6000
stateno = 6000
pos = 0,0
postype = left   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =999
pausemovetime = 999
ignorehitpause = 1

 [State 0, VarSet]
type = VarSet
trigger1 = statetype = A
trigger2 = movetype=H && stateno!=[120,155]
trigger3= prevstateno=40
trigger4= (p2stateno=[5090,5119]) &&(p2stateno=[5121,5899])
trigger5 = (prevstateno=52 ||prevstateno=5120) && p2statetype=A && var(31)=0
trigger6 = fvar(6) <55 && frontedgebodydist >150 && p2statetype!=L
trigger7 = numhelper(10003) &&enemy,hitdefattr!=SC,AT 
trigger7=helper(10003),var(8)>0 
trigger8 = stateno=212
v=30
value = 0

[State 0, VarSet]
type = VarSet
triggerall = statetype != A
triggerall = roundstate=2 
triggerall = stateno!=1100
triggerall = (helper(10003),var(8)<=0)
triggerall = (p2stateno!=10003)
triggerall = random <149|| p2movetype=A&& fvar(6)  >100|| p2stateno=4999 && fvar(6) >40||enemy,hitdefattr=SC,AT || var(31)>0||var(33)
trigger1= enemy,hitdefattr=SC,AT && ctrl
trigger2 = fvar(6)>130 && ctrl && movetype!=H&&(p2movetype!=H) && var(31)=0 
trigger3 = stateno=200 && movehit && p2statetype=A
trigger4 = var(33)
;trigger7 =  var(31)=
v = 30   ;fv = 10
value = 1


[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =1
text = "fvar(2) = %f  Evar(4) = %d var(30)=%d var(30)=%d counter= %d febd = %d "
params =fvar(7),(var(19)),(var(21)),(enemy,var(31)),(var(21)),(var(19))
ignorehitpause =1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]
;[State 0, AssertSpecial]
;type = AssertSpecial
;trigger1 = 1
;flag = noBG
;flag2 = noFG
;ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 = roundsexisted = 0 && roundstate < 2
trigger1 = !AILevel && (enemy, AILevel = 0) && power = powermax && (enemy, power = enemy,powermax)
v = 35  ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 


[State 0, Helper]
type = Helper
trigger1 = var(35)
trigger1 =numhelper(10005)=0
helpertype = normal ;player
name = "training"
ID =  10005
stateno = 10000
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, VictoryQuote]
type = VictoryQuote
trigger1 = !var(41)
value = random%9
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = var(41)>0
value = var(41); 1~99

[State 0, VarSet]
type = VarSet
triggerall = enemy,authorname="Kamekaze"
trigger1 = p2name="Alcott" ||p2name="Edward Trusdale"  || p2name="Tristan Samroy"
v = 41    ;fv = 10
value = 11
[State 0, VarSet]
type = VarSet
triggerall = enemy,authorname="Kamekaze"
trigger1 = p2name="Micheal Roa Valdamjong" 
v = 41    ;fv = 10
value = 10


[State 0, ParentVarSet]
type = VarSet
trigger1 = !numhelper(1110) && fvar(15)=0
fv = 15    ;fv = 
value = .133545
;ignorehitpause = 
;persistent = 
[State 18, VarSet];small''[
type = VarSet
trigger1 =1
v = 18
value =ceil(enemynear,const(size.head.pos.y)*.334)
[State 0, VarSet]
type = Varadd

trigger1 = movehit=1 && p2stateno!=[120,155]
v = 59   ;fv = 10
value = 1
ignorehitpause = 0

[State 0, VarSet]
type = Varset
triggerall = roundstate=2
trigger1 = p2movetype!=H
v = 59   ;fv = 10
value = 0
ignorehitpause =1

[State 0, VarSet]
type = VarSet
trigger1 =var(31)=6
trigger2 =var(31)=25
trigger3= p2movetype!=H 
v = 31    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(37)=1
flag = nobardisplay
ignorehitpause=1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =var(37)=1
flag = nomusic
ignorehitpause=1
[State -2]
type = VarSet
trigger1 = Life > 1
trigger1 = StateNo != 9000
var(46) = StateNo
ignorehitpause = 1



[State 0, ChangeState]
type = ChangeState
triggerall = power >=500 && stateno!=1100 ||  power >=250 && stateno=1100 
triggerall= stateno!=[3000,3051]
triggerall= stateno!=[800,821]
triggerall = AILevel=0
triggerall = stateno!=700
trigger1 =command="cancel" && movecontact 
trigger2= command="cancel" && (stateno=1100 &&  animelemtime(4)>0)
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0


[State 0, ChangeState]
type = ChangeState
triggerall = power >=500
triggerall= stateno!=[3000,3051]
triggerall = AILevel>0
trigger1=stateno=206 && moveguarded  && time >24
trigger2= stateno=220 && moveguarded && animelemtime(12)>0
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0
;anim =
[State 0, StateTypeSet]
type = StateTypeSet
triggerall = p2statetype=A &&(p2stateno!=[120,155])
trigger1 = var(3)=1 && ((stateno!=[800,899])&& (stateno!=[1050,1055]))
movetype = I 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(25)=1 && stateno!=1060 && stateno!=212
movetype = I         ;I,A,H
[State 0, VarSet]
type = VarSet
trigger1= var(4)>=14 && stateno!=[3000,4000]
v = 3    ;fv = 10
value = 1
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H||(p2stateno=[120,155])
v =4    ;fv = 10
value = 0
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =var(4)=0
v =3   ;fv = 10
value = 0
[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
time = 1
value = fvar(2)

[State 0, VarSet]
type = VarSet
triggerall = fvar(2)<.5
trigger1 =stateno=[3000,3050] 
fv = 2    ;fv = 10
value = .35
;ignorehitpause = 
;persistent = 


[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1= movehit=1
triggerall=stateno=405 ||stateno =205  || stateno=600 
fv =2 ;fv = 10
value = fvar(2)*.97
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno =200 || stateno=400||stateno=610
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.98
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 =  stateno=420
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.9
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 =  stateno=221||stateno=220
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.93
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno=605||stateno=206
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.97
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno=620 ||stateno=210
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.95
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno=1050
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.98
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno=1060
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.985
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno=[1071,1073]
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.98
ignorehitpause=0
[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
triggerall =  var(59)>0
trigger1 = stateno=1100
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.92
ignorehitpause=0

[State 0, VarSet]
type = VarSet
triggerall = p2movetype = H&&(p2stateno!=[120,155])
;triggerall =  var(59)>0
trigger1 = stateno=1074
trigger1= movehit=1
fv =2 ;fv = 10
value = fvar(2)*.87
ignorehitpause=0
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype != 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,10]
triggerall = random<499
trigger1 = anim = 5000
trigger2 = anim= 5010
trigger3 = anim= 5020
value = 5000, 0
channel=0
[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [11,20]
triggerall = random<499
trigger1 = anim = 5000
trigger2 = anim= 5010
trigger3 = anim= 5020
value = 5000, 1
channel=0
[State -3, Hit1]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = random<499
triggerall = Var(0) = [21,30]
trigger1 = anim = 5001
trigger2 = anim = 5011
trigger3 = anim= 5021
trigger4 = stateno = 5030
trigger5 = stateno = 5050
value = 5000, 2
channel=0
[State -3, Hit1]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = random<499
triggerall = Var(0) = [31,40]
trigger1 = anim = 5001
trigger2 = anim = 5011
trigger3 = anim= 5021
trigger4 = stateno = 5030
trigger5 = stateno = 5050
value = 5000, 3
channel=0

[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = random<499
triggerall = Var(0) = [41,60]
trigger1 = anim = 5002
trigger2 = anim = 5012
trigger3 =anim = 5022
trigger4 = stateno = 5070
trigger5 = stateno = 5080
value = 5000, 4
channel=0



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