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

; var(0):= -3, 5900, 1005, 1002, 1003, 4001
; var(1):= 1033, 4001
; var(2):= 810, 1010
; var(3):= -3, 4001
; var(4):= 200, 205, 210, 211, 212, 220, 221, 400, 405, 410, 420, 600, 605, 610, 620, 831, 1050, 1060, 1100, 3000, 3050, -3, 4, 5, 6
; var(5):= 800, 830
; var(6):= -2, 45, 4000
; var(8):= -2, 55, 59
; var(9):= 9000, -2
;var(10):= 4000
;var(11):= 1074, -2, 4000
;var(12):= -2
;var(13):= -2
;var(14):= 600, -2, 108
;var(15):= 605, -2
;var(17):= -2
;var(18):= -2, 5
;var(19):= 220, 810, 831, 1050, -2, 1001
;var(20):= -2
;var(21):= 200, 205, 210, 211, 212, 220, 221, 400, 405, 410, 420, 600, 605, 700, 800, 1050, 1060, 1071, 1072, 1073, 1074, 1100, 3000, 3050, -2, 1001, 1020, 1021, 1022, 1060, 1061, 1062
;var(22):= -2
;var(23):= -2, 1001, 1020, 1021, 1022, 1060, 1061, 1062
;var(24):= -2
;var(25):= 420, -2
;var(26):= -2, 40, 45
;var(27):= 800, 810, 830, 831
;var(28):= 1100, -2
;var(30):= -2
;var(31):= -3, -1
;var(32):= -2
;var(33):= -2
;var(34):= -3
;var(35):= 211, -2
;var(36):= 3061
;var(37):= 3061
;var(38):= -1
;var(39):= -2
;var(46):= -3
;var(53):= 4001
;var(54):= -2, 4001
;var(55):= -2, 5900
;var(57):= -2, 7000
;var(58):= 211, 212, 1060, 1071, 1072, 1073, -2
;var(59):= -3

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

; fvar(2):= -3, 1001
; fvar(3):= 4000
; fvar(5):= 9000
; fvar(6):= -2
; fvar(7):= -2
;fvar(10):= 9000
;fvar(11):= 9001






[Data]
life = 1075
attack = 100
power=1000
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 0
IntPersistIndex = 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 = 225       ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = -5, -378   ;Approximate position of head
mid.pos = 25, -260   ;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  = 2.75     ;Walk forward
walk.back = -2.45     ;Walk backward
run.fwd  = 7, 0    ;Run forward (x, y)
run.back = -8.5,-9.4 ;Hop backward (x, y)
jump.neu = 0,-23.8   ;Neutral jumping velocity (x, y)
jump.back = -8   ;Jump back Speed (x, y)
jump.fwd = 7.75     ;Jump forward Speed (x, y)
runjump.back = -7.25,-23.8  ;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 = "Ya gonna spend all day down there?"
victory2 = "Hey that was pretty fun! You ok there guy?"
victory3 = "I get the feeling you coulda done better ya know..."
victory4 = "Oy, I wish Saburo-chan could have saw that one!"
victory5 = "This axe is pretty sharp! You gotta be more careful."
victory6="That one was for you Saburo-chan...Hopefully you're smiling above!"

;---------------------------------------------------------------------------
; 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,0

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


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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S1,2
channel = 1
;lowpriority = -1
;abspan =
;ignorehitpause =
;persistent =


[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,225]
flag = roundnotover

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 11
value = S120,1
volume = 255
channel = 0
;lowpriority = -1
[State 0, Helper]
type = Helper
trigger1 = animelem=6
helpertype = normal ;player
name = "Walls"
ID =183
stateno =183
pos = 448,-30
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0


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


;---------------------------------------------------------------------------
; Introduction Decider
; CNS difficulty: basic
[Statedef 190]
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 0, VarSet]
type = VarSet
trigger1 = AIlevel>0 && time=0
v =54    ;fv = 10
value = (random%32)+1
[State 5900, 3] ;Change palette
type = RemapPal
trigger1 =var(54)!=0
source = 1,1
dest = 1,var(54)

[State 0, VarSet]
type = VarSet
trigger1 = p2name = "Caligula" && enemy,authorname="Kamekaze"
v = 59  ;fv = 10
value = 121
[State 0, ChangeState]
type = ChangeState
trigger1 =var(59)=121
value = 191
;anim =
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = var(53)=0&& AIlevel =0
trigger1 =time=0
anim =13010
ID =12010
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 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 190, 0
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =time=128
value =5000, 1
channel=0
[State 0, Explod]
type = Explod
trigger1 = animelem = 1
anim = 191
ID = 213
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause=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, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || AnimTime = 0
id =12010
[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

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



;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim = 192
velset = 0,0
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 1   ;fv = 10
value = pos x 
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
triggerall = var(53)=0
trigger1 =time=0
anim =13010
ID =12010
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 200, 1]
type = PlaySnd
trigger1 =animelem=1 && anim=192
value = S200, 20
channel=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, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0 && anim=192 
value = 20

[State 0, VelSet]
type = VelSet
trigger1 = anim=20
x = const(velocity.walk.fwd.x)
;ignorehitpause = 
;persistent = 
[State 0, Explod]
type = Explod
trigger1 = animelem = 1 && anim!=20
anim = 193
ID = 213
pos = 90,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause=0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem=6 
id = 213
;ignorehitpause = 
;persistent = 

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =command="start" || anim=20
id =12010
;ignorehitpause =
;persistent =


;[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 190, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0 && time >300
value = 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                    ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(command="holdfwd"&&AIlevel=0,201,200)                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)
[State 0, ChangeAnim]
type = ChangeAnim
triggerall=time=0
trigger1 = prevstateno=200 && p2statetype=A && AILEvel>0
value = 201
;elem = 1
;ignorehitpause = 
;persistent = 

[State 0, Width]
type = Width
trigger1 = anim=200
player = 40,0
[State 0, Width]
type = Width
trigger1 = anim=201
player = 80,0
[State 0, Width]
type = Width
trigger1 = anim=201 && animelem=5
player = 80,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 200, 1]
type = HitDef
trigger1 = AnimElem = 3 && anim=200
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 13, 0                    ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime =9,9                ;Time attacker pauses, time opponent shakes
sparkno = S7000+(random%4)                      ;Spark anim no (Def: set above)
sparkxy = -30,-272             ;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 = -16.5
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,-9           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
fall.recovertime=ifelse(var(21)>0,17,12) 
air.hittime= ifelse(var(21)>0,17,12)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
id=200
yaccel=.46*var(20)
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5&& anim=201
attr = S, NA
animtype  = up
damage    =25
guardflag = MA
hitflag=MAF
pausetime = 12,12
sparkno = S7000+(random%4)  
sparkxy = -45,-210
hitsound = S2, 3
guard.sparkno= S7500
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
guard.ctrltime=15
ground.hittime  = 21
guard.ctrltime=19
ground.velocity = -1*var(20),-10*var(20)
guard.velocity=-15
air.velocity = -1*var(20),-10*var(20)
air.hittime=ifelse(var(21)>0,20,16)
yaccel=.55*var(20)
fall=1
fall.recovertime=ifelse(var(21)>0,20,16)
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 200, 1]
type = PlaySnd
trigger1 = Time = 1
value =1, 0
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1 &&anim=200
value = 200, 0
channel=0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1&&anim=201
value = 200, 7
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, 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
x = 1
y = 1



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

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

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

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

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

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



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



[State 0, SelfState]
type = SelfState
triggerall = alive
triggerall =canrecover && HitOver  && (time>gethitvar(hittime)) 
trigger1 = command="recovery"
trigger2= AIlevel >0 && random <100*AILevel
trigger3 = var(16) = 1&& p1name="Training"
value =5210
;---------------------------------------------------------------------------
; 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;    4
poweradd= 0
ctrl = 0
velset = 0,0
anim = ifelse(fvar(6) >=40,205,206)
sprpriority =2

[State 210, Width]
type = Width
trigger1 = anim=206
value =80,0
[State 210, Width]
type = Width
trigger1 = anim=205
value =110,0
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value =0, 1
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 = 4&& anim=205
trigger2 = AnimElem = 3 && anim=206
attr = S, NA
animtype  = Medium
damage    =30
guardflag = MA
hitflag=MAFD
pausetime = 12,12
sparkno =-1; S7010
sparkxy = -15,ifelse(anim=205,-216,-183)
hitsound = S4, 1
guard.sparkno= S7510
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
getpower=20
guard.ctrltime=15
ground.hittime  = 21
guard.ctrltime=19
ground.velocity = -19.5
guard.velocity=-15
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=4&& anim=206
movetype = I 





[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 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 210, Width]
type = Width
trigger1 = anim=210
value = 45,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, 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 210, 2]
type = HitDef
trigger1 = AnimElem = 5 && anim=210
attr = S, NA
animtype  = Medium
damage    =65
hitflag=MAFD
guardflag = HA
pausetime = 10,10
sparkno = -1;-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 = -22
guard.velocity=-19
air.velocity = -7.5,-12
down.hittime=ifelse(var(21)>0,22,15)
down.velocity=-5*var(20),0
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
air.hittime=ifelse(var(21)>0,32,24)
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,-120
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=5 
time = 3
freq = 60
ampl = 2
phase = 90

[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, TargetState]
type = TargetState
trigger1 =(p2statetype= A||p2statetype= L && var(21)=2) && movehit=1 && (p2stateno!=[1029,1033])
value =ifelse(var(21)>0,1033,1034)
ID =200
ignorehitpause =1 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6&& anim=210
trigger2 = animelem=4&& anim=211
movetype = I 

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

;--;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 211]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 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&& anim=211
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1&& anim=211
value = 200, 5
channel=0

[State 210, 1]
type = PlaySnd
trigger1 = animelem=5&& anim=211
value =46, 0
channel=1 
[State 210, 1]
type = PlaySnd
trigger1 = animelem=4 && anim=212
value =1, 2
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = animelem=2&& anim=212
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 210, 2]
type = HitDef
trigger1 = AnimElem = 5 && anim=211
attr = S, NA
animtype  = Medium
damage    =20
guardflag = MA
hitflag=MAFD
pausetime = 10,10
sparkno = -1;S7020+(random%4)
sparkxy = -30,-50
hitsound = S4, 1
guardsound = S6, 0
guard.sparkno= S7510
priority=4
ground.type = High
guard.ctrltime=22
getpower=10
ground.slidetime =19
ground.hittime  = 26
ground.velocity = -5*var(20)
guard.velocity=-4*var(20)
air.velocity = -7.5,-12
down.hittime=ifelse(var(21)>0,24,16)
down.velocity=-3*var(20),0
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
air.hittime=ifelse(var(21)>0,32,24)
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&& anim=211
helpertype = normal ;player
name = "midspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1002
pos = -30,-50
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 =anim=211
v = 58   ;fv = 10
value = 26
ignorehitpause=1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=211 && animelemtime(5)>0 && animelemtime(9)<0
trigger1 = command="z" && AIlevel=0
trigger2= AIlevel >0 && var(31)!=[110,118]
value = 212
;elem = 1

[State 0, MoveHitReset]
type = MoveHitReset
trigger1 =anim=212 && animelemtime(1)=1 
;ignorehitpause = 
;persistent = 

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4 && anim=212
attr = S, NA
animtype  = Medium
damage    =20
hitflag=MAFD
guardflag = LA
pausetime = 10,10
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 = -13*var(20)
guard.velocity=-4*var(20)
air.velocity = -4.5*var(20),-3*var(20)
air.hittime=ifelse(var(21)>0,30,15)
down.velocity=-5*var(20) ,-4.5*var(20)      ;Time before opponent regains control in air
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0,30,15)
id=201
envshake.time = 10
envshake.ampl = 5
envshake.freq=100

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

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=5 && anim=211
time = 3
freq = 90
ampl = 2
phase = 90

[State 0, TargetState]
type = TargetState
triggerall =enemy,hitshakeover
trigger1 =(p2statetype= S||p2statetype=C) && movehit=1 && (p2stateno!=[1029,1035]) && anim=211 && var(21)>0
value =1035
ID =200
ignorehitpause =1 

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1029,1034]) && anim=211
value =1034
ID =200
ignorehitpause =1

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


[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= L && movehit=1 && (p2stateno!=834) && anim=212 && var(35)=0
value =1052
ID =201
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=9&& anim=211
trigger2 = animelem=6&& anim=212
movetype = I 

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 212]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd=0
ctrl = 0
velset = 0,0
anim = 213
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 210, Width]
type = Width
trigger1 =1
value = 55,0

;ignorehitpause = 
;persistent = 



;ignorehitpause =
;persistent =

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200, 8
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, VarSet]
type = VarSet
trigger1 =!movecontact
v = 58   ;fv = 10
value = ifelse(var(21)>0 && p2stateno!=1035,50,30)
ignorehitpause=1
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 8 
attr = S, NA
animtype  = Medium
damage    =120
guardflag = LA
hitflag=MAFD
pausetime = 5,5
sparkno = -1;S7020+(random%4)
sparkxy = -30,-40
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
priority=4
ground.type = High
guard.ctrltime=22
getpower=70
ground.slidetime =19
ground.hittime  = ifelse(var(21)>0,31,20)
ground.velocity = -15
guard.velocity=-13
air.velocity = -7.5,12
down.velocity=-2*var(20),0
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,-40
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= A && movehit=1 && (p2stateno!=[1029,1032]) && anim=211
value =1031
ID =200
ignorehitpause =1

[State 0, TargetState]
type = TargetState
triggerall = enemy,hitshakeover
trigger1 =(p2statetype= S||p2statetype=C) && movehit=1 && (p2stateno!=[1029,1035])
value =1035
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=9&& anim=213 && p2statetype!=L
trigger2 = animelem=17&& anim=213 && p2statetype=L
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;    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
[State 0, Width]
type = Width
trigger1 = animelem=6
player = 60,0
;value = 0,0
;ignorehitpause = 
;persistent = 




;ignorehitpause =
;persistent =

[State 210, 1]
type = PlaySnd
triggerall = prevstateno!=9000 || animelemtime(4)<1
trigger1 = animelem=4
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499&&prevstateno!=9000
trigger1 = Time = 1
value = 200, 8
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 = 19    ;fv = 10
value = 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 = 7
attr = S, NA
animtype  = Medium
damage    =75
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=35
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=210
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, 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=9
movetype = I 

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 221]
type    = S
movetype= A
physics = S
juggle  = 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 210, Width]
type = Width
trigger1 = 1
value = 55,0

[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, 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 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
animtype  = Medium
damage    =50
guardflag = LA
hitflag=MAFD
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 = 3*var(20),-7.75*var(20)
guard.velocity=-19
air.velocity = 3.15*var(20),-7.75*var(20)
down.velocity= 3.45*var(20),-8.25*var(20)
fall=1
air.hittime=ifelse(numexplod(221)<ifelse(var(21)=2,3,1),ifelse(var(21)>0,65,37),20)
fall.recovertime=ifelse(numexplod(221)<ifelse(var(21)=2,3,1),ifelse(var(21)>0,65,37),20)
id=200
yaccel=.45*var(20)
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,-40
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1

[State 0, PlayerPush]
type = PlayerPush
trigger1 =animelemtime(5)>0 && movehit
value = 0



[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=7
movetype = I 

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

;-------------------------------------------------------------------------
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 0;    5
poweradd=0
ctrl = 0
anim = 400
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value =1, 0
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 = Time = 1
value = 200, 4
channel=0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = 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    = 10
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = LA
pausetime = 10,9
sparkno = S7000+(random%4)
sparkxy = -10,-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 = -4*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, Width]
type = Width
trigger1 = 1
player = 20,0
;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3
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;    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, 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 430, 2]
type=Hitdef
trigger1=Time=0
attr=C,NA
Damage=25
animtype=medium
hitflag=MAF
guardflag=MA
guard.sparkno=S7500
pausetime=12,12
sparkno=-1
sparkxy= -10,-8
hitsound=S4,1
guardsound=S6,0
getpower=20
ground.type=Low
guard.ctrltime=13
ground.slidetime=19
ground.hittime=19
fall.recover=ifelse(var(21)>0,0,1)
ground.velocity =-5.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, 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,-130
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=6
movetype = I 


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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =410

[State -3]
type = HitOverride
trigger1 =animelemtime(6)<0
;trigger1 = PrevStateNo != 9000
time = 1
slot = 7
attr = SC, NA, SA,NP,SP
stateno = 9000

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1&& prevstateno!=9000
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =animelem=1&& prevstateno!=9000
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 0, Explod]
type = Explod
trigger1 = movehit=1
anim =10000
ID = 410
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
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 = 6
attr = C, NA
damage    = 55
animtype  = Medium
hitflag = MAFD
guardflag = MA
pausetime = 12,12
sparkno = -1;S7020+(random%4)
sparkxy = -30,-90
guard.sparkno= S7510
hitsound = S4, 0
guardsound = S6, 0
ground.type = Low
guard.ctrltime=20
ground.slidetime =32
ground.hittime  =ifelse(numexplod(410)<ifelse(var(21)=2,4,2),26,20)
air.hittime=ifelse(var(21)>0,27,21)
down.hittime=20
getpower=20
down.velocity=-5*var(20),0
ground.velocity = -7.5*var(20)
guard.velocity=-5*var(20)
air.velocity = -2*var(20),-9*var(20)
yaccel=.52*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0,27,21)
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 =  -30,-90
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= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
[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;    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, 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 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    =65
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=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 =  -30,-60
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= A && movehit=1 && (p2stateno!=[1031,1034])
value =1034
ID =200
ignorehitpause =1 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
movetype = I 


[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 600
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value =1, 0
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =time=1
value = 200, 3
channel=0
[State 0, VarSet]
type = Varadd
trigger1 = movehit && p2statetype=A
v = 14    ;fv = 10
value = 1
ignorehitpause =1
persistent =0
[State 0, Explod]
type = Explod
triggerall = movehit=1
triggerall = var(21)=1
triggerall = 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    =11
guardflag = HA
priority = 3
pausetime = 7,7
sparkno = S7000+(random%4)
sparkxy = -40,-70*var(20)
hitsound = S2, 0
guardsound = S6, 0
guard.sparkno= S7500
ground.type = High
ground.slidetime =5
ground.hittime  = 12
getpower=0 
ground.velocity = -4*var(20)
air.velocity = -1.3*var(20),-2.35*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
air.hittime=ifelse(var(21)>0,18,14)
fall.recovertime=ifelse(var(21)>0,18,14)
id=200
yaccel=.47*var(20)
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=4
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 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
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;    1
poweradd= 0
ctrl = 0
anim = 605
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value =0, 2
channel=1
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =time=1
value = 200, 10
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=4
attr = A, NA
damage = ifelse(var(21)=1,120,50)
guardflag = HA
priority = 3
pausetime = 16,16
sparkno = S7010
sparkxy = -5,-210
hitsound = S2, 5
guardsound = S6, 0
getpower=60
ground.type = High
guard.sparkno= S7510
ground.slidetime = 9
ground.hittime  = 5
ground.velocity = -10*var(20),-11*var(20)
air.velocity = -10*var(20),-11*var(20)
fall=1
fall.recovertime=ifelse(var(21)>0,70,40)
yaccel=.55*var(20)
id=201
envshake.time = 16
envshake.ampl = 7
envshake.freq=100
[State 630, 2]
type = HitDef
trigger1 = animelem=5
attr = A, NA
damage = 35
guardflag = HA
priority = 3
pausetime = 16,16
sparkno = S7000+(random%4)
sparkxy = -5,-210
hitsound = S2, 1
getpower=20
guardsound = S6, 0
ground.type = High
guard.sparkno= S7500
ground.slidetime =ifelse(var(21)>0,20,14)
ground.hittime  = ifelse(var(21)>0,20,14)
ground.velocity = -4*var(20)
air.velocity = -2*var(20),-3*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0,23,16)
id=200
nochainid=201

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])&& (p2stateno!=[1045,1048])
value =ifelse(var(21)>0&&var(15)<1,1045,201)
ID =201
ignorehitpause =1 
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 
[State 0, VarSet]
type = Varadd
trigger1 =movehit=1 && var(21)=2 
v = 15    ;fv = 10
value = 1
ignorehitpause =0 
;persistent = 


[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 = A
juggle  = 0;    1
poweradd= 0
ctrl = 0
anim = 610
sprpriority = 2
[State 0, VarAdd]
type = VarAdd
trigger1 =movehit && p2statetype=A
v =4     ;fv =
value = 1
persistent=0
ignorehitpause=1
[State 610, 2]
type = PlaySnd
trigger1 = animelem=5
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
triggerall = random <499
trigger1 =animelem=5
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 610, 3]
type = HitDef
trigger1 =  animelem = 7
attr = A, NA
damage = 60
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = -1;S7020+(random%4)
sparkxy = -13,-53*var(20)
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
animtype = Med
getpower=25
ground.type = High
ground.slidetime = 10
ground.hittime  =22
ground.velocity = -4*var(20)
air.velocity = -1*var(20),-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

[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,-73*var(20)
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= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 


[State 600, 3]
type = changestate
trigger1 =animtime=0
value = 57
ctrl=1
;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = N
juggle  = 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 610, 2]
type = PlaySnd
trigger1 = animelem=55 && anim=620
value =1, 2
channel=1 
[State 200, 1]
type = PlaySnd
trigger1 =animelem=5 && anim=620
value = 200, 11
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=-1
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 = 6
attr = A, NA
damage = 70
guardflag = HA
priority = 4
pausetime = 2,2
sparkno = -1;S7020+(random%4)
sparkxy = -13,-53
hitsound = S4, 0
guardsound = S6, 0
guard.sparkno= S7510
animtype = Med
getpower=30
ground.type = High
ground.slidetime = 10
ground.hittime  =22
ground.velocity = -4*var(20)
fall=1
air.velocity = -1*var(20),-5.75*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)>0&&numexplod(620)<5,35,27)
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 =  -13,-93
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
[State 0, EnvShake]
type = EnvShake
trigger1 = anim=621 && animelemtime(1)=1
time = 8
freq = 70
ampl = 4
phase = 90

[State 610, 2]
type = PlaySnd
trigger1 = anim=621 && animelemtime(1)=1
value =2, 6
channel=2

[State 0, VelSet]
type = VelSet
trigger1 = animelem=3&& anim=620
x =.75*var(20)
y = -5.5*var(20)

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>0&& anim=620
y =.45*var(20)


[State 0, VelSet]
type = VelSet
trigger1 = animelem=5&& anim=620
x =0*var(20)
y = 13*var(20)

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=0 && anim=620 && animelemtime(5)>0
value = 621

[State 0, VelSet]
type = VelSet
trigger1 = anim=621
x = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = anim=621
y = 0
;ignorehitpause = 
;persistent = 

[State 600, 3]
type = changestate
trigger1 =animtime=0 &&  anim=621
value = 0
ctrl=1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 700]
type    = S
movetype= A
physics = S
juggle  = 0;    4
poweradd= -350
ctrl = 0
velset = 0,0
anim = 700
sprpriority =2
[State pal, *]
type = PalFX
trigger1 = time = 0
time = 8
add = 128,128,128
sinadd = -128,-128,-128,16
invertall = 0
color = 256
ignorehitpause = 1


[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1
[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 200,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 = -1
sparkxy = -15,-150
hitsound = S4,2
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, 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,-200
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= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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


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

[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0;    0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2
[State 0, VarSet]
type = VarSet
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(27)=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, VarSet]
type = VarSet
trigger1 = var(5)=2
v = 19    ;fv = 10
value = 0
[State 0, Explod]
type = Explod
triggerall =numexplod(840)<1
trigger1 =time=1 && var(5)=1
trigger2= (time=13) && var(5)=0
trigger3= (time=26) && var(5)=2
anim =840
ID =840
pos = 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 = 40*var(20), 0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2)>=0 &&animelemtime(3)<0  
pos = 180,-503
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3)>=0 &&animelemtime(4)<0  
pos = 242,-454
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(4)>=0 &&animelemtime(5)<0  
pos = 122,-234
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(5)>=0 &&animelemtime(6)<0  
pos = 29,-257
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(6)>=0 &&animelemtime(7)<0  
pos = -23,-261
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(7)>=0 &&animelemtime(8)<0  
pos = -43,-263
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(8)>=0 &&animelemtime(9)<0  
pos =80,-274
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem=9
pos =396,-287
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=4
value = -2
;ignorehitpause =
;persistent =

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


[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem=9
value = -70
kill = 1



[State 0, TargetState]
type = TargetState
trigger1 =AnimElem=9 && p2stateno!=[833,835]
value = 833
;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 <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1047

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

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

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

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

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




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

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

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027
[State 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;
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 = var(5)=2
v = 19    ;fv = 10
value = 0
[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(27)=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 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = S200, 9
channel=0
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos =181,-403
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem=3 
pos =181,-130
[State 0, SprPriority]
type = SprPriority
trigger1 =animelem=1
value = 2
;ignorehitpause =
;persistent =

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


[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = A, NT
animtype  = Medium
damage    =45
guardflag = MA
pausetime = 12,12
sparkno = -1;S7020+(random%4)
sparkxy = -10,-70
hitsound = S2,3
guardsound = S6, 0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -11*var(20),-5*var(20)
air.velocity = -11*var(20),-5*var(20)
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
p2stateno=1045
id=800
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
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, TargetState]
type = changeState
trigger1 =p2stateno=835
value =836
[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

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 854
[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
;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)
x = -3*enemy,var(20)
[State 0, VelSet]
type = VelSet
trigger1 =p2stateno=211&&time=0
x = -5.5*enemy,var(20)

;ignorehitpause =
;persistent =

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

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

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


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


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

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

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

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = -5*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
;---------------------------------------------------------------------------
;command dash
[Statedef 1000]
type    =S
movetype= I
physics = S
juggle  = 0;    4
poweradd= 0
;velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 0
[State 0, PowerAdd]
type = PowerAdd
triggerall  =(prevstateno=212||prevstateno=221||prevstateno=201||prevstateno=1050||prevstateno=1010 ||prevstateno=1100 ||prevstateno=1060&&numexplod(1061)=1||prevstateno=[1071,1073])
trigger1 = time = 0
value = -250
;ignorehitpause = 
;persistent = 

[State pal, *]
type = PalFX
triggerall  =(prevstateno=212||prevstateno=221||prevstateno=201||prevstateno=1050||prevstateno=1010 ||prevstateno=1100 ||prevstateno=1060&&numexplod(1061)=1 ||prevstateno=[1071,1073])
trigger1 = time = 0
time = 6
add = 32,32,248
sinadd = 64,64,128,16
invertall = 0
color = 256
ignorehitpause = 1

[State 0, ScreenBound]
type = ScreenBound
triggerall = p2movetype=H
trigger1 = p2stateno=[1025,1028] 
value = 1
movecamera = 0,1

[State 0, PlayerPush]
type = PlayerPush
trigger1 =animelemtime(5)<0 
value = 0
;ignorehitpause = 
;persistent = 


[State 0, Explod]
type = Explod
triggerall  =(prevstateno=212||prevstateno=221||prevstateno=201||prevstateno=1050||prevstateno=1010 ||prevstateno=1100  ||prevstateno=1060&&numexplod(1061)=1||prevstateno=[1071,1073])
trigger1 = time = 0
anim =8049
ID =8049
pos = 9,-170
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
scale = 3,3
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 1
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3)>=0 && animelemtime(5)<0 
x = 6.5*var(20)

[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(5)<0 && p2statetype=A
value = 0
;ignorehitpause = 
;persistent = 


[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem=6
value = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nostandguard
flag2 = nocrouchguard
flag3= noairguard
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag= nowalk
[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 16
channel=0
[State 0, Width]
type = Width
trigger1 = animelemtime(4)>0
player = 90,0
[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1




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

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

[State 0, VelSet]
type = VelSet
trigger1 = time=0
y=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
triggerall = alive
trigger1 = time > 20 && alive && command = "recovery"&& p2stateno!=3050
trigger2 = var(16) = 1&& p1name="Training"&&time > 20 
trigger3 = AILevel >0 && random <100*AILevel && enemy,stateno!= 3050 &&time > 20 
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=420
value = 5070
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&& anim!=5070
value = 5030

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = 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>40
value =ifelse(!alive, 5110,5120)
;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 1033]
type    = A
movetype= H
physics = N
velset = 0,0
facep2=1




 ;5051 - 4 + type

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0 && selfanimexist(5030)
value = 5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim2
trigger1 = Time = 0 && !selfanimexist(5030)
value = 5030
[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 1029
;---------------------------------------------------------------------------
; 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    = S
movetype= A
physics = S
juggle  = 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="QCF4"&&power>=250,2,ifelse(command="QCF3" ,1,0))
[State 0, VarSet]
type = VarSet
triggerall = AILevel >0
trigger1 =time=0 
v = 2   ;fv = 10
value = ifelse((var(31)=30||var(31)=45||var(31)=120||var(31)=150)&&power>=250,2,ifelse(fvar(6)>130 &&var(31)!=111&&var(31)!=122 ,1,0))

[State 0, Width]
type = Width
trigger1 = animelem=7&& anim!=1024 && anim!=212
player = 220,0
[State 0, Width]
type = Width
trigger1 = animelem=6&& anim!=1024 && anim!=212
edge= 100*var(20),0
[State 0, VarSet]
type = VarSet
trigger1 = time=0 && var(31)=152
v = 31    ;fv = 10
value = 153
;ignorehitpause = 
;persistent = 

 [State 200, 1]
type = PlaySnd
trigger1 =animelem=1&& anim!=1024 && anim!=212
value = 200, 17
channel=0
[State 0, PowerAdd]
type = PowerAdd
trigger1 = time=0 && var(2)=2
value = -250
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0 && var(2)=1
value = 1020
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =time=0 &&var(2)=2
value = 1021
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = AILevel=0
trigger1 =command="push"&&var(2)=2 && animelemtime(7)>0 && animelemtime(8)<5 && anim!=1024 && anim!=212
value = 1024

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = AILevel>6
trigger1 =(var(31)=121||var(31)=151)&&var(2)=2 && animelemtime(7)>0 && animelemtime(8)<5 && anim!=1024 && anim!=212
value = 1024
[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, ChangeAnim]
type = ChangeAnim
trigger1 =animelemtime(5)>0&& anim=1024
value = 212
[State 210, 1]
type = PlaySnd
trigger1 = animelem=4 && anim=212
value =1, 2
channel=1
[State 200, 1]
type = PlaySnd
trigger1 = animelem=2&& anim=212
value = 200, 6
channel=0
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3&& anim!=1024 && anim!=212
x = 20
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=4&& anim!=1024 && anim!=212
x = 10

[State -2, Helper]
type = Helper
triggerall = var(2)<2&& anim!=1024 && anim!=212
trigger1 = animelem=7
helpertype = normal ;player
name = "FIRE"
ID = 1001
stateno = 1001
pos = 350,0
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal =1
ignorehitpause = 1

[State -2, Helper]
type = Helper
triggerall =var(2)=2&& anim!=1024 && anim!=212
trigger1 = animelem=7
helpertype = normal ;player
name = "FIRE"
ID = 1010
stateno = 1001
pos = 350,0
postype =p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=7 && anim!=1024 && anim!=212
time = 5
freq = 60
ampl = 2
phase = 90

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=10&& anim!=1024 && anim!=212
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 <= 20
trigger2 = FrontEdgeBodyDist <= 20
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
x = 15*enemy,var(20) - BackEdgeBodyDist

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

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

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

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

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

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

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

[State 0, SelfState]
type = SelfState
triggerall =enemy,var(19)=0  && alive
trigger1=(time=[1,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 = ((p2dist x/3)/5)
[State 1028, Vel X]
type = VelSet
triggerall = anim=5052
trigger1 = Time = 0
x = -((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
ctrl = 0
anim =1050
poweradd=-250
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 200, 1]
type = PlaySnd
trigger1 =animelem=3
value = 200, 13
channel=0
[State 0, Explod]
type = Explod
trigger1 = animelem=4
anim = 1110
ID = 1110
pos = 130,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 3,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = animelem=4
anim = 1110
ID = 1110
pos = 90,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -3,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = animelem=4
anim = 1110
ID = 1110
pos = -130,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = -3,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Explod]
type = Explod
trigger1 = animelem=4
anim = 1110
ID = 1110
pos = -90,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 3,0
accel = 0,0
random = 0,0
scale = 2,2
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, Helper]
type = Helper
trigger1 = animelem=4
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
animtype  = Medium
damage    =115
guardflag = HA
hitflag=MAFD
pausetime = 4,4
sparkno = S7010
sparkxy = -15,-40
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 = -19.5
guard.velocity=-15
air.velocity = -2.5*var(20),-12*var(20)
down.hittime=ifelse(var(21)>0,18,14)
down.velocity = -7*var(20),-3
fall=1
forcenofall=ifelse(p2stateno=1103,1,0)  
air.fall=1
fall.recovertime=ifelse(var(21)=1,35,17)
id=200

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=6
movetype = I 
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem=4 
time = 5
freq = 60
ampl = 2
phase = 90
[State 0, VarSet]
type = VarSet
trigger1 = movehit
v = 19   ;fv = 10
value = 1
ignorehitpause = 1
;persistent = 

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[1029,1030])
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
;---------------------------------------------------------------------------
;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
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;    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;    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;    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;    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;    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)
;---------------------------------------------------------------------------
; Manly punch
; CNS difficulty: medium
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 0;    ifelse(command="HCF4",3,6)
poweradd= 0
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =1100

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

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

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

[State 0, Width]
type = Width
trigger1 = animelem=8
player = 125,0
edge=350,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
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 113, VarSet]
type = VarSet
trigger1 = p2movetype=A 
v =21   ;v = 570
value = ifelse(var(28)>30,2,1)

[State 0, NotHitBy]
type = NotHitBy
trigger1 =animelem=8 
value = SCA
;value2 = S,NA
time = 1
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(28)<40
trigger1 = animelemtime(3)>0&&animelemtime(4)<0 && command="holdy"
trigger2 =animelemtime(3)>0&&animelemtime(4)<0 && (p2movetype=A||fvar(6)>45)&& AIlevel>0
value = 1100
elem = 3


[State 0, VarSet]
type = Varadd
trigger1 = animelemtime(3)>=0&&animelemtime(4)<0 && command="holdy" && var(28)<40
trigger2= animelemtime(3)>=0&&animelemtime(4)<0 && AIlevel>0&& var(28)<40
trigger2 = p2movetype!=A
v =28   ;fv = 10
value = 1
[State -3]
type = HitOverride
trigger1 =animelemtime(3)>=0&&animelemtime(7)<0&& var(28)>20
;trigger1 = PrevStateNo != 9000
time = 1
slot = 7
attr = SA, NA, SA,NP,SP
stateno = 9000
[State 0, Helper]
type = Helper
trigger1 = animelem=4 && var(28)>=30
helpertype = normal ;player
name = "powerup"
ID =1056
stateno =1056
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(5)>0 && var(28)<30&& prevstateno!=9000
trigger2 = animelemtime(9)>0&& var(28)>=30&& prevstateno!=9000
trigger3= time =0 && prevstateno!=9000
v = 28  ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 


[State 610, 3]
type = HitDef
trigger1 =  animelem = 8
attr = S, SA
damage = ifelse(var(21)>0,105,65)+var(28)
guardflag = MA
priority = 4
pausetime = 12,12
sparkno = S7010
sparkxy = -13,-240
hitsound = S2, 5
guardsound = S6, 0
guard.sparkno= S7510
getpower=50

animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -ifelse(var(7)>30,11,5)*var(20),-5*var(20)
air.velocity = -ifelse(var(7)>30,11,5)*var(20),-5*var(20)
fall=1
fall.recover=0
p2facing=1
id=1100
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(8)<0 && p2stateno=5120
movetype = A
[State 0, VelSet]
type = VelSet
trigger1 =animelem=8 
x = 4*var(20)

[State 0, TargetState]
type = TargetState
triggerall = animelemtime(9)<0 && enemy,alive
trigger1 = movehit && (p2stateno!=[201,203]) && (p2stateno!=[1101,1103])&& (p2stateno!=[1045,1048])
value =ifelse(var(21)>0&&var(17)=0,ifelse(var(28)>30,1101,1045),ifelse(var(28)>30,1045,201))
ID = 1100
;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
[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;    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, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -500
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time = 0
value = S999, 0
channel = 3
;abspan =
;ignorehitpause =
;persistent =

[State 0, Pause]
type = Pause
trigger1 =  time = 0
time = 50
movetime=50
pausebg = 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 0, HitBy]
type = HitBy
trigger1 = time=50
value = SCA,HA,HP,HT
;value2 = S,NA
time = 3
;ignorehitpause =
;persistent =
[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 20
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=7
value = 200, 21
channel=0





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



[State 0, Width]
type = Width
trigger1 = animelem=8
player = 185,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
persistent=0

[State 610, 3]
type = HitDef
trigger1 =  animelem = 8
attr = S, HA
damage = 100
guardflag = MA
priority = 4
pausetime = 12,12
sparkno = S7010
sparkxy = -13,-240
hitsound = S2, 5
guardsound = S6, 0
getpower=0
guard.sparkno= S7510
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -5*var(20),-5*var(20)
air.velocity = -5*var(20),-5*var(20)
fall=1
fall.recover=0
p2facing=1
id=1100
envshake.time = 10
envshake.ampl = 5
envshake.freq=100
[State 0, VelSet]
type = VelSet
trigger1 =animelem=8 
x = 4*var(20)

[State 0, TargetState]
type = TargetState
triggerall = animelemtime(9)<0
trigger1 = movehit && (p2stateno!=[201,203]) && (p2stateno!=[1101,1103])
value =ifelse(var(21)=1&&var(17)=0&&enemy,alive,1101,201)
ID = 1100
;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
[State 0, ChangeState]
type = ChangeState
trigger1 =animtime=0 
value =0
ctrl = 1

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

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2
[State 0, VelSet]
type = VelSet
trigger1 =animelem=2
x = -3
y = -7
[State 0, EnvShake]
type = EnvShake
triggerall = enemynear,life>225
trigger1 = animelem=2
time = 20
freq = 126
ampl = 7
phase = 126

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

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =animelem=2
value =-225
[State 0, TargetState]
type = TargetState
trigger1 = animelem=2
value =3003
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time=0
value = S800,0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelemtime(1)=17
value = S200,26
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=2
value = S300,2
[State 0, Pause]
type = Pause
triggerall = p2life >225
triggerall = time=[18,35]
trigger1 =time%2=0
time = 1

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

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

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


;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = enemy,stateno!=3001
value = 5050

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

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

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

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


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

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

[Statedef 3050]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=2
anim = 3001
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, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -500
[State 0, PlaySnd]
type = PlaySnd
trigger1 =time = 0
value = S999, 0
channel = 3
;abspan =
;ignorehitpause =
;persistent =

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


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


[State 200, 1]
type = PlaySnd
trigger1 =animelem=1
value = 200, 22
channel=0
[State 200, 1]
type = PlaySnd
trigger1 =animelem=12
value = 200, 23
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 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,ifelse(GameHeight=180,2.25,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 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=12
value =  S0, 4
channel = 1



[State 0, Width]
type = Width
trigger1 = animelem=8
player = 125,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
persistent=0

[State 610, 3]
type = HitDef
trigger1 =  animelem = 14
attr = S, HA
damage = 225
guardflag = MA
priority = 4
pausetime = 2,12
sparkno = -1;S7020+(random%4)
sparkxy = -13,-165
hitsound = S4, 0
guardsound = S6, 0
getpower=0
guard.sparkno= S7510
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -9*var(20),-10*var(20)
air.velocity = -9*var(20),-10*var(20)
fall=1
fall.recover=0
p2facing=1
id=1100
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 = "chopspark"
ID = 1002 +(enemy,gethitvar(hitcount))
stateno = 1005
pos =  -40,-185
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 25
ignorehitpause=1
;persistent = 

[State 0, TargetState]
type = TargetState
trigger1 = movehit && (p2stateno!=[1045,1050])
value =1045
ID = 1100
ignorehitpause =0 
;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, VarSet]
type = VarSet
triggerall = var(21)=2
trigger1 = time= 0 
v = 21   ;v = 570
value = 0
ignorehitpause =1
[State 0, ChangeState]
type = ChangeState
trigger1 =animtime=0 
value =0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 3052]
type    = A
movetype= H
physics = N
juggle  = 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    = S
movetype= H
physics =N
juggle  = 0;    0
velset = 0,0
ctrl = 0
sprpriority = 3
[State 0, EnvShake]
type = EnvShake
trigger1 = time=0
time = 5
freq = 60
ampl = 5
phase = 120
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value = 3007
ignorehitpause = 1
persistent = 1
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = -270
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = !hitshakeover
x = 0
y =0
[State 0, VelSet]
type = VelSet
trigger1 = hitshakeover
x = -36
y =0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
;ignorehitpause = 
;persistent = 


[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
velset = 0,0
ctrl = 0
sprpriority = 3

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0
value =3008
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
velset = 0,0
ctrl = 0
sprpriority = 0
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = !hitshakeover
value = 5010
ignorehitpause = 1
persistent = 1
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = hitshakeover && anim!=50061
value = 50061
ignorehitpause = 1
persistent = 1
[State 0, VelSet]
type = VelSet
trigger1 = !hitshakeover
x = 0
y =0
[State 0, VelSet]
type = VelSet
trigger1 = hitshakeover && anim=50061 && animelemtime(1)=1
x = 0
y =-40
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = time =50
x = 0
y =0
[State 0, VelAdd]
type = VelAdd
trigger1 = hitshakeover && anim=50061&& enemy,animelemtime(18)>0
y = .95




[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
;ignorehitpause =
;persistent =
[State 0, VelSet]
type = VelSet
triggerall = time >50
triggerall = facing=-1
triggerall = screenpos x <130*enemy,var(20)
trigger1 = time>=40
x =  -3*enemy,var(20)

[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0
[State 0, VelSet]
type = VelSet
triggerall = time >50
triggerall = facing=-1
triggerall = screenpos x >130*enemy,var(20)
trigger1 = time>=40
x =  3*enemy,var(20)


[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = time >50
triggerall = screenpos x >130*enemy,var(20)
trigger1 = time>=40
x =  -3

 [State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = time >50
triggerall = screenpos x <130*enemy,var(20)
trigger1 = time>=40
x =  3*enemy,var(20)




[State 1050, 5]
type = selfState
trigger1 = pos y >= 0  &&time>90
value = 5100
;------------------
; 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
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 =time>40
flag = invisible
[State 0, ScreenBound]
type = ScreenBound
trigger1 =1
value = 0
movecamera = 0,0


[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
anim = 3002
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, 0
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=5
value = 200, 0
channel=0

[State 0, Width]
type = Width
trigger1 = 1
player = 110,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 = S7010
guard.sparkno= S7510
sparkxy = -18,-80*var(20)
hitsound = S2,3
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

[State 1050, 5]
type = changeState
trigger1 = animtime=0
value = 0
ctrl =1
;---------------------------------------------------------------------------
[Statedef 3061]
type    = S
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
juggle=0
anim = 3003
sprpriority = 5
[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 <260*var(20)
triggerall = anim=3003

trigger1 = time=0
x =  -3*var(20)
y = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = screenpos x >260*var(20)
triggerall = anim=3003
trigger1 = time=0
x =  3*var(20)
y = 0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x >70
triggerall = anim=3003
trigger1 = time=0
x =  -3*var(20)
y = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = screenpos x <70
triggerall = anim=3003
trigger1 = time=0
x =  3*var(20)
y = 0

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

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

[State 0, VelSet]
type = VelSet
triggerall = facing=1
triggerall = anim=3003
trigger1 =screenpos x=[60,75]
x = 0
[State 0, VelSet]
type = VelSet
triggerall = facing=-1
triggerall = anim=3003
trigger1 = screenpos x=[765,785]
x = 0


[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=3003
trigger1 =vel x!=0
value = 3003
elem=1

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=24
value = 200, 1
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
[State 200, 1] ;201
type = HitDef
triggerall = anim=3003
trigger1 = animelem=25
attr = S, HA
damage =0
animtype = medium
guardflag = MA
hitflag = MAF
priority = 7, Hit
pausetime = 6, 6
getpower = 0
sparkno = S7010
sparkxy = -13,-240
hitsound = S2, 5
guardsound = S6, 0
guard.sparkno= S7510
ground.type = low
ground.slidetime = 99
ground.hittime  = 99
air.type = High
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2facing=1
forcestand =1
kill = 0
p2stateno=3053
envshake.time = 10
envshake.ampl = 6
envshake.freq=100
id=2005

;persistent = 

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=30
value = 200,22
channel=0
volumescale=70
[State 1000, 1]
type = PlaySnd
trigger1 =animelem=43
value = 200,2
channel=0
volumescale=70

[State 0, Helper]
type = Helper
trigger1 = animelem=36
helpertype = normal ;player
name = "axe"
ID =3067
stateno =3067
pos = 17,-469
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
scale=2.5,2.5
ownpal = 0

[State 210, 2] ;206
type = HitDef
triggerall = anim=3003
trigger1 = animelem=44
attr = S, HA
animtype  = Medium
damage =9999
guardflag = MA
pausetime = 1, 6
sparkno = -1;S7020+(random%4)
guard.sparkno= S11004
sparkxy = -15,-60
hitsound   = S4,0
guardsound =  S5, 0
getpower =0
ground.type = High
ground.slidetime = 99
ground.hittime  = 99
ground.velocity = 1
air.velocity = -7.5,-12
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
envshake.time = 10
envshake.ampl = 6
envshake.freq=100
p2facing=1
kill = 1
p2stateno=3059

[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 = animelemtime(44)>=5
ID =4001

;persistent =
;supermove = 0
;pausemove = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=42
value = S999,2
channel = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =animelemtime(44)>=25 && animelemtime(47)<0
flag = noBG
flag2 = noFG
ignorehitpause=1
[State 0, Explod]
type = Explod
trigger1 =animelem=42
anim = 3004
ID =3004 
pos =675,80
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 8
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
[State 0, VarSet]
type = Varadd
trigger1 = numexplod(3004)>0
trigger2 = numexplod(3005)>0
v = 36   ;fv = 10
value = 1
ignorehitpause = 1
;persistent = 

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = var(36)>0 
ID =3004
scale = .025*(var(36)*6.25),.015*(var(36)*8)
ignorehitpause = 1

[State 0, VarSet]
type = Varset
trigger1 = animelem=43
v = 36   ;fv = 10
value = 0
[State 0, Explod]
type = Explod
trigger1 =animelem=43
anim = 3005
ID =3005
pos =0,80
postype = p2  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 9
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
;trans = 
;persistent =
;supermove = 0
;pausemove = 0
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = var(36)>0 
ID =3005
scale = 1-((var(36)*7)*.01),1+((var(36)*3)*.01)
ignorehitpause =1
[State 0, Explod]
type = Explod
trigger1 =animelem=44
anim = 3006
ID =3006
pos =0,-250
postype = left ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
pausemovetime = 0
scale = 2,2.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1

[State 1000, 1]
type = PlaySnd
trigger1 =animelem=10
value = 200, 15
channel=0
volumescale=70
[State 0, Helper]
type = Helper
trigger1 = animelem=12&&anim=3003
helpertype = normal ;player
name = "Wall1"
ID =3061
stateno =3062
pos = 700,0
postype = p1    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = animelem=12&&anim=3003
helpertype = normal ;player
name = "Walls"
ID =3061
stateno =3063
pos = 750,0
postype = p1    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 0
[State 0, Helper]
type = Helper
trigger1 = animelem=12&&anim=3003
helpertype = normal ;player
name = "Walls"
ID =3061
stateno =3064
pos = 780,0
postype = p1    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 0


[State 0, AllPalFX]
type = AllPalFX
trigger1 =animelem=44 && anim=3003
time = 50
add = 256,256,256
mul = 256,256,256
sinadd = -256,-256,-256,36
invertall = 0
color = 256
 ignorehitpause=0

[State 0, AllPalFX]
type = AllPalFX
trigger1 =animelemtime(44)=5 && anim=3003
time = 40
add = 256,256,256
mul = 256,256,256
sinadd = -256,-256,-256,1
invertall = 0
color = 256
ignorehitpause=0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(44)=[0,60]
flag = noshadow
[State 0, AllPalFX]
type = AllPalFX
trigger1 =animelemtime(44)=30 && anim=3003
time = 20
add = -256,-256,-256
mul = 256,256,256
sinadd = 256,256,256,60
invertall = 0
color = 256
ignorehitpause=0
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 37    ;fv = 10
value = 1


[State 0, PosSet]
type = PosSet
trigger1 = animelemtime(44)=30
x = 0
y = 0


[State -2, Helper]
type = Helper
trigger1 = animelemtime(44)=30 && anim=3003
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 =


;---------------------------------------------------------------------------
[Statedef 9000]
type = U
movetype = H
physics = U
ctrl=0
[State 0, VarSet]
type = VarSet
trigger1 =time=0
v = 9   ;fv = 10
value = 1
;ignorehitpause =
;persistent =

[State 9000, PalFX]
type = PalFX
trigger1 = Alive
trigger1 = !Time
trigger2 = Time = 1
trigger3 = Time = 5
trigger4 = Time = 9
trigger5 = Time = 13
time = 2
add = 240,50,0
mul = 250,224,120
color = 128
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = prevstateno = 3000
trigger1 =1
flag = noBG
flag2=noFG
ignorehitpause=1

[State 0, VarSet]
type = VarSet
trigger1 =time=0
fv = 10   ;fv = 10
value = vel x

[State 0, VarSet]
type = VarSet
trigger1 =time=0
fv = 11   ;fv = 10
value = vel y
;ignorehitpause =
;persistent =



[State 9000, ChangeAnim]
type = ChangeAnim
trigger1 =1
value = Anim
elem  = var(34)

[State 0, VelAdd]
type = VelAdd
triggerall = vel x=0
trigger1 =(floor(gethitvar(hittime) * 0.5)<time ) || !alive
x = ifelse(statetype=A,0,fvar(5))
persistent=0

[State 0, VelSet]
type = posadd
triggerall = alive
triggerall =floor(gethitvar(hittime) * 0.5)<time
trigger1=time%3=0
x = 9
[State 0, VelSet]
type = posadd
triggerall = alive
triggerall =floor(gethitvar(hittime) * 0.5)<time
trigger1=time%2=0
x =-9
[State 0, VelSet]
type = VelSet
triggerall = alive
trigger1 = time=0
x = 0
y=0
[State 0, VelSet]
type = VelSet
triggerall = alive
trigger1 = statetype=A
trigger2= prevstateno=100
x = 0
y=0
;ignorehitpause =
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 = time=0
fv = 5    ;fv = 10
value = hitvel x*.75
;ignorehitpause =
;persistent =

;ignorehitpause =
;persistent =


;ignorehitpause =
;persistent =

[State 9000, End]
type = ChangeState
trigger1 = !Alive
value = 5050


[State 0, VelSet]
type = VelSet
triggerall = Alive
triggerall = fvar(10)!=0
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
x = fvar(10)
[State 0, NotHitBy]
type = NotHitBy
trigger1 =time=0
value = SCA
;value2 = S,NA
time = 4
[State 0, VelSet]
type = VelSet
triggerall = Alive
triggerall = fvar(11)!=0
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
y = fvar(11)
[State 9000, End]
type = ChangeState
triggerall = Alive
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
value = var(46)
;------------------
; 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, Pos]
type = PosAdd
trigger1 = Time = 0
x = 30 - BackEdgeBodyDist

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

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

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3
;[State 0, LifeAdd]
;type = LifeAdd
;trigger1 = animelem=2
;value = -15
[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = 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, VarSet]
type = VarSet
trigger1 =stateno!= 1100 && stateno!=9000
v = 28   ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H
v = 15    ;fv = 10
value = 0
[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, AssertSpecial]
type = AssertSpecial
trigger1 =movetype=A 
flag = nostandguard
flag2= nocrouchguard
flag3 = noairguard
[State 0, Explod]
type = Explod
triggerall = numhelper(1001)>0
trigger1 = helper(1001),movehit=1 && var(2)=0 && helper(1001),movetype=A
anim =10000
ID = 10101
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


[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit && (p2stateno!=1036&&p2stateno!=[833,1032])
value =ifelse(var(21)>0,1025,1036)
ID =210
ignorehitpause =1
[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 = p2movetype!=H || p2stateno=[120,155] 
id = 410
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 = 220
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, VarSet]
type = VarSet
trigger1 =var(21)>0 && movehit 
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(54)=0
v = 54   ;fv = 10
value = palno
[State 0, VarSet]
type = VarSet
trigger1 =var(21)=0 && movehit && (p2stateno=5080||p2stateno=[5000,5030])
trigger2= p2movetype!=H
trigger3= numexplod(620)>=6
trigger4= numexplod(410)>=4
trigger5= numexplod(221)>=4
v = 19   ;fv = 10
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 =numhelper(1001)=0
v = 22    ;fv = 10
value = 0
[State 0, VarSet]
type = Varset
trigger1 =numhelper(1001)=0
v = 24   ;fv = 10
value = 0
[State 0, VarSet]
type = Varadd
triggerall = var(2)=1
trigger1 =numhelper(1001)>0
v = 22    ;fv = 10
value = 1
[State 0, VarSet]
type = Varadd
triggerall =var(24)<5
triggerall = var(22)>0
trigger1 = var(22)%8=0
trigger2 = var(22)%16=0
trigger3 = var(22)%24=0
trigger4 = var(22)%32=0
v = 24    ;fv = 10
value = 1

[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 = 35   ;fv = 10
value = 0 

[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&& movetype !=A && var(21)<2 && (p2stateno!=[1025,1048])
trigger2= p2movetype!=H &&var(21)=2 && movetype !=A
trigger3= p2stateno=5120
trigger4= 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, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =1
text = "fvar(2) = %d  Evar(4) = %d var(30)=%d var(30)=%d counter= %d febd = %d "
params =(frontedgedist),var(31),(enemy,var(31)),(var(54)),pos y,(enemy,var(38))
ignorehitpause =1
;persistent =
[State 0, VarSet]
type = VarSet
trigger1 =1
v = 9   ;fv = 10
value = enemy,lifemax/4
;ignorehitpause =
;persistent =
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2stateno=834
trigger1 = enemy,time=1
value = S2,5
channel=3
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 12    ;fv = 10
value = 0
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H
v = 13    ;fv = 10
value = 0
[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=1047|| p2stateno=1030||p2stateno=1032||p2stateno=20013
trigger1 = enemy,time=1
value = S2,2
channel=3
[State 0, PlaySnd]
type = PlaySnd
triggerall =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
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
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
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
supermove =999
pausemove = 999
ignorehitpause = 1

;ignorehitpause =
;persistent =

;ignorehitpause =
;persistent =
 [State 30, VarSet]
type = VarSet
trigger5 = statetype = A
triggerall = p2statetype=L||p2stateno!=5120
trigger1= enemynear,hitdefattr = SA,NA,SA,HA
trigger2=(p2stateno=[1029,1030])
trigger3=(p2stateno=[1045,1049]) && p2movetype=H
trigger4= p2statetype=S && p2movetype=I && fvar(6) <110
v=30
value = 0

[State 30, VarSet]
type = VarSet
triggerall =  (p2movetype=H||p2statetype=A )
triggerall = AILevel>0
triggerall = p2statetype !=L ||p2stateno=5120
triggerall = statetype != A
triggerall = var(2)!=3
triggerall = stateno!=1000&&stateno!=1050
trigger1 =p2statetype = C && (fvar(6) = [10,155]) && ctrl && random <99
trigger2 = p2stateno=5120&& fvar(6) >90&& ctrl
trigger3= stateno=410 && movehit && p2statetype=A
trigger4= anim=201 && movehit && p2statetype=A
trigger5 = var(33)=1 && ctrl
v = 30    ;fv = 10
value = 1
ignorehitpause=1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]
[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = random%3 =0
triggerall =movetype=H
trigger1 = Stateno = 1025
trigger2 = Stateno = 1045
trigger3 = Stateno = 1033
trigger4 = Stateno = 1034
trigger5 = Stateno = 1035
trigger6 = Stateno = 1036
value = S5000, random%4
channel=0
[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = !var(41)
value = random%5
[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="Caligula" 
v = 41    ;fv = 10
value = 6

[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, VarSet]
type = VarSet
trigger1 =movetype !=H ||stateno=9000
v = 34    ;fv = 10
value = animelemno(0)
ignorehitpause = 1


[State 0, ChangeState]
type = ChangeState
triggerall = power >=500
triggerall= stateno!=[3000,3051]
triggerall= stateno!=[800,821]
triggerall =stateno!=1005
triggerall = AILevel=0
triggerall = stateno!=700
trigger1 =command="cancel" && movecontact &&(stateno!=[1050,1060])
trigger2= command="cancel" && (stateno=1100 && movecontact)
trigger3= command="cancel" && stateno=1010 && animelemtime(7)>0 && (var(2)!=1 || var(24)>0)
trigger4 = command="cancel" &&(moveguarded||(movehit&&stateno=1060))
value =ifelse(statetype!=A,4,5)
ctrl = 0
ignorehitpause=0


[State 0, ChangeState]
type = ChangeState
triggerall = power >=500
triggerall= stateno!=[3000,3051]
triggerall = AILevel>0
triggerall =stateno!=1005
triggerall= movehit
triggerall = var(2)!=3
trigger1=var(31)=93 && statetype=A
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)<.35
trigger1 =stateno=[3000,3050] 
fv = 2    ;fv = 10
value = .35
;ignorehitpause = 
;persistent = 


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

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H&&(p2stateno!=[120,155])
triggerall =  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 = enemy,movetype = 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 = enemy,movetype = 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 = enemy,movetype = 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 = enemy,movetype = 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 = enemy,movetype != H ||(p2stateno=[120,155])
fv = 2   ;fv = 10
value = 1
ignorehitpause =  1
persistent =  1

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

[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [0,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
