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

; var(0):= -3
; var(2):= 1000, 1050, 1100, 1150, 1200, 1250
; var(3):= 3100
; var(4):= 3100
; var(5):= 3100
; var(6):= -2, 45
; var(7):= 1101
; var(9):= -2
;var(10):= -2
;var(11):= -2
;var(12):= -2, 57
;var(13):= 3011
;var(14):= -2, 3011
;var(15):= 1101, 1102, 3011
;var(16):= 1101
;var(17):= 1102
;var(18):= 1102
;var(19):= 3001, 3002
;var(21):= 1101, 1102, 1103, 1104
;var(29):= 620, 621, 650, 3050, 101
;var(30):= -2
;var(31):= 620, 621, 650, 3050, 101
;var(35):= 810, 831, 841, -2
;var(50):= -2
;var(57):= 10000

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

; fvar(2):= -2

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

[Data]
life = 1000			;Amount of life to start with
power =5000		;Amount of maximum power
attack = 100		;attack power (more is stronger)
defence =120		;defensive power (more is stronger)
fall.defence_up = 50	;Percentage to increase defense everytime player is knocked down
liedown.time = 2		;Time which player lies down for, before getting up
airjuggle = 15		;Number of points for juggling
sparkno = 2			;Default hit spark number for HitDefs
guard.sparkno = 40	;Default guard spark number
KO.echo = 0			;1 to enable echo on KO
volume = 255			;Volume offset (negative for softer)
IntPersistIndex = 60	;Variables with this index and above will not have their values
FloatPersistIndex = 40  ;reset to 0 between rounds or matches. There are 60 int variables,
  				;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
  				;If omitted, then it defaults to 60 and 40 for integer and float
  				;variables repectively, meaning that none are persistent, i.e. all
  				;are reset. If you want your variables to persist between matches,
  				;you need to override state 5900 from common1.cns.


[Size]
xscale = .8333333333333333333333333333333
yscale = 1
ground.back = 15		;Player width (back, ground)
ground.front = 28		;Player width (front, ground)
air.back = 12		;Player width (back, air)
air.front = 12		;Player width (front, air)
height = 60			;Height of player (for opponent to jump over)
attack.dist = 160		;Default attack distance
proj.attack.dist = 90	;Default attack distance for projectiles
proj.doscale = 0		;Set to 1 to scale projectiles too   
head.pos = -5, -110	;Approximate position of head
mid.pos = -5, -70		;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.25		;Walk forward
walk.back = -2.0		;Walk backward
run.fwd  = 3.7, 0		;Run forward (x, y)
run.back = -4.5,-3.8	;Hop backward (x, y)
jump.neu = 0,-9.4		;Neutral jumping velocity (x, y)
jump.back = -3.35		;Jump back Speed (x, y)
jump.fwd =3.1		;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1;Running jump speeds (opt)
runjump.fwd = 4,-8.1	;.
airjump.neu = 0,-9	;.
airjump.back = -2.95	;Air jump speeds (opt)
airjump.fwd = 2.9		;.
runjump.back = -2.55,-8.1
air.gethit.groundrecover = -.15,-3.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5
[Movement]
airjump.num =0		;Number of air jumps allowed (opt)
airjump.height = 35	;Minimum distance from ground before you can air jump (opt)
yaccel = .55		;Vertical acceleration
stand.friction = .85	;Friction coefficient when standing
crouch.friction = .82	;Friction coefficient when crouching
air.gethit.groundlevel = 15          ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -20 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 10   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -1  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = .35    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 10      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 20            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = .4               ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 12          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .05
;==============================================================================;
[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "You fight valiantly, but you are no match for Colossus"
victory2 = "I see you have learned lessons from Professor X well."
victory3= "Be thankful I was pulling my punches!"
victory4 = "Now you know what it feels like to battle the X-Men!"
victory5 = "So, comrade... care to go another round?"
victory6 = "Rest, tovarisch. We will try again later."
;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0 ;&&!matchover
value =181
;
;[State 180, 1]
;type = ChangeState
;trigger1 = Time = 0 &&matchover
;value = ifelse(random<499,183,184)
;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, PlaySnd] ;Too Short!!
type = PlaySnd
trigger1 = animelem =4
value = S2,5
channel=0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 182]
type = S
ctrl = 0
anim = 180
velset = 0,0
[State 181, PlaySnd] ;Too Short!!
type = PlaySnd
trigger1 = animelem = 5
value = S2,5
channel=0


[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 183]
type = S
ctrl = 0
anim = 0
velset = 0,0

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



[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name = "launch"
ID = 185
stateno =185
pos = 105,-10
postype = p1    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 1
supermovetime = 40
pausemovetime = 40
ignorehitpause=1
persistent=0;pe
[State 181, PlaySnd] ;Too Short!!
type = PlaySnd
trigger1 = animelem = 2 && anim=183
value = S2,8
channel=0
[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

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

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



[State 0, Helper]
type = Helper
trigger1 = time=0
helpertype = normal ;player
name = "launch"
ID = 185
stateno =185
pos = 105,-10
postype = p1    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 1
supermovetime = 40
pausemovetime = 40
ignorehitpause=1
persistent=0;pe

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;--------------------------------------------------------------------------------
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(12)<0
y = .85
;ignorehitpause =
;persistent =

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

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

[State 0, PosSet]
type = PosSet
trigger1 =time=0
y = -250
[State 0, PosSet]
type = PosSet
trigger1 =animelem=12
y = 0
[State 0, VelSet]
type = VelSet
trigger1 =animelem=12
x = 0
y = 0
;ignorehitpause =
;persistent =



[State 1052, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = animelem=12
value =S1, 3

[State 1052, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = animelem=15
value = S2, 2
channel=0

[State 0, EnvShake]
type = EnvShake
trigger1 =animelem=12
time = 10
freq = 85
ampl = 4
phase = 90


[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = animtime = 0 
value = 0

;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 190, PlaySnd] ;Lock on!
type = PlaySnd
trigger1 = animelem = 7
value = S2,0


[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing Light Punch
; CNS difficulty: easy
[Statedef 200]
type    = S
movetype= A
physics = S
juggle  =0; 1
ctrl = 0
poweradd = 13
sprpriority = 2
hitcountpersist = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =200
[State 0, VelSet]
type = VelSet
trigger1 = vel x <0
x = 0
;ignorehitpause = 
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0

[State 200, 1]
type = HitDef
trigger1 = Time = 0
trigger1 = anim = 200
attr = S, NA
;damage = 23, 0
damage =43
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 9, 9
sparkno = S8100+(random%4)
guard.sparkno = S7009
sparkxy = -10, -80
givepower=13,7
getpower=13,13
hitsound = S1, 0
guardsound = S3, 1
ground.type = High
ground.slidetime = 5
ground.hittime  = 8
ground.velocity = -3.5
guard.velocity = -3
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 10
forcenofall=1
yaccel=.67
id=200
nochainid=200

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,0
channel = 1
;abspan = 
;ignorehitpause = 
;persistent = 


[State 200, 5]
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

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
triggerall = selfanimexist(5061)
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5061
[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim2
triggerall = !selfanimexist(5061)
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 50061
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

;[State 5020, 4] ;Freeze anim
;type = ChangeAnim
;trigger1 = Time > 0
;value = anim
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=3100
value = 1
movecamera = 0,1
ignorehitpause = 1
;persistent = 

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = ifelse((p2stateno=1000||enemy,prevstateno=1000||p2stateno=3050||enemy,prevstateno=3050)&&enemy,movehit,1001,ifelse((p2stateno=1202||enemy,prevstateno=1202)&&enemy,movehit,1203,202))

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 202]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)
[State 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=3100
value = 1
movecamera = 0,1
ignorehitpause = 1
[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 3]
type = selfState
triggerall = !HitFall
trigger1 = HitOver && (time>gethitvar(hittime)) 
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = selfState
triggerall = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 10  ;.
value = 5110 ;HITA_FALL

[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 0, ScreenBound]
type = ScreenBound
trigger1 = p2stateno=3100
value = 1
movecamera = 0,1
ignorehitpause = 1
[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5061)
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5061

[State 5035, 1]
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5061)
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 50061


[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = selfState
triggerall = !HitFall
trigger1 = HitOver && (time>gethitvar(hittime)) 
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040  ;HITA_RECOV

[State 5035, 4]
type=selfState
triggerall = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 10  ;.
trigger2 = Anim != 5061 ;.
value = 5110 ;HITA_FALL
;-------------------------------
;---------------------------------------------------------------------------
; Standing Medium Punch
; CNS difficulty: easy
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  =0; 4
poweradd=22
ctrl = 0

sprpriority=2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =205
[State 0, Width]
type = Width
trigger1 = 1
player = 26,17
;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
;damage = 23, 0
damage = 64
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = S7000+(random%4)
guard.sparkno = S7009
sparkxy = -10, -70
hitsound = S1, 4
guardsound = S3, 1
ground.type = High
ground.slidetime = 10
ground.hittime  = 14
givepower=22,14
getpower=22,22
guard.velocity = -3
ground.velocity = -7.5
air.velocity = -2.5,-5
air.hittime = 14
forcenofall=1
yaccel=.67
id=204
ground.cornerpush.veloff=-9
nochainid=204

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


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,1
channel = 1
[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; Standing Strong Punch
; CNS difficulty: easy
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  =0; 4
poweradd=50
ctrl = 0
sprpriority=1

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =210
[State 0, VelSet]
type = VelSet
trigger1 = vel x <0
x = 0
[State 0, Width]
type = Width
trigger1 =animelemtime(6)>=0 && animelemtime(10)<0
player = 35,12
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 30, 0
damage = 114			;Damage that move inflicts, guard damage
animtype =heavy			;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 = 12, 12			;Time attacker pauses, time opponent shakes
sparkno = S7005+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -15, -70		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 2 	;Sound to play on hit
guardsound = S3, 1		;Sound to play on guard
ground.type = low		;Type: High, Low, Trip (def: Normal)
givepower=50,25
getpower=50,50
ground.slidetime = 13		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.cornerpush.veloff=-13.5
ground.velocity = -8		;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8	;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High			;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3		;X-velocity at which opponent is pushed,					;Y-velocity at which opponent is pushed
air.hittime = 16			;Time before opponent regains control in air
p2facing = 1
yaccel=.67
id=205
nochainid=205
[State 0, PalFXWiz]
type = PalFX
trigger1 =animelemtime(6)=0 
time = 2
add = -50,-50,-50
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 =animelemtime(7)=0 
time = 20
add = -25,-25,-25
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 =animelemtime(8)=0 
time = 20
add = 25,25,25
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFX]
type = PalFX
trigger1 = animelemtime(9)=0 
time = 20
add = 75,75,75
mul = 256,256,256
;sinadd = 0,0,0,10
invertall = 0
color = 256
[State 0, PalFX]
type = PalFX
trigger1 = animelemtime(10)=0 
time = 3
add = 150,150,150
mul = 256,256,256
;sinadd = 0,0,0,10
invertall = 0
color = 256

[State 0, Explod]
type = Explod
trigger1 =animelem= 7
anim =211
ID = 615
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
pausemovetime =99
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=6
value = S0,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=6
value = S2,4
channel = 0
[State 645 , dust]
type = Makedust
trigger1 = p2bodydist x > 10
trigger1 = prevstateno = 100
trigger1 = time > 0; && vel x
pos = -5,-2
spacing = 3

[State 220, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 211]
type    = A
movetype= H
physics = N
juggle  =0;0; 0
velset=-10,6
poweradd= 59
ctrl = 0
sprpriority = 2
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .69
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0
value = 1202
[State 0, NotHitBy]
type = NotHitBy
trigger1 =anim!=1202
value = SCA
;value2 = S,NA
time = 1

;ignorehitpause =
;persistent =

[State 0, ChangeAnim2]
type = ChangeAnim2
triggerall = anim!=5160
trigger1 =pos y>=0 && anim=1202 && time>3
value = 5160
[State 0, PosSet]
type = PosSet
trigger1 = anim=5160 && animelem=1
y = 0
[State 0, VelSet]
type = VelSet
trigger1 =animelemtime(1)=1 && anim=5160
x = -4
y = -6

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = alive
trigger1 = animelemtime(1)>7 && anim!=5200 && anim=5160
value = 5200
[State 0, SelfState]
type = SelfState
trigger1 =pos y >=0 &&anim=5200  &&alive
value =52
ctrl=1
[State 0, SelfState]
type = SelfState
trigger1 =pos y >=0 &&!alive  && time>5
value =5100
ctrl=1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 212]
type    = A
movetype= H
physics = N
juggle  =0; 0
velset=-8,-4
poweradd= 59
ctrl = 0
sprpriority = 2
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .6
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0
value = 1202
[State 0, NotHitBy]
type = NotHitBy
trigger1 =anim!=1202
value = SCA
;value2 = S,NA
time = 1

;ignorehitpause =
;persistent =

[State 0, ChangeAnim2]
type = ChangeAnim2
triggerall = anim!=5160
trigger1 =pos y>=0 && anim=1202 && time>3
value = 5160

[State 0, VelSet]
type = VelSet
trigger1 =animelemtime(1)=1 && anim=5160
x = -4
y = -6

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = alive
trigger1 = animelemtime(1)>7 && anim!=5200 && anim=5160
value = 5200
[State 0, SelfState]
type = SelfState
trigger1 =pos y >=0 &&anim=5200  &&alive
value =52
ctrl=1
[State 0, SelfState]
type = SelfState
trigger1 =pos y >=0 &&!alive  && time>5
value =5100
ctrl=1
;---------------------------------------------------------------------------
; Standing Light Kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  =0; 4
poweradd = 13
ctrl = 0

sprpriority=2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =230
[State 0, VelSet]
type = VelSet
trigger1 = vel x <0
x = 0
[State 0, Width]
type = Width
trigger1 = 1
player = 23,0
;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0

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

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
;damage = 23, 0
damage = 48
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = S8100+(random%4)
guard.sparkno = S7009
sparkxy = -10, -60
hitsound = S1, 0
guardsound = S3, 1
givepower=13,7
getpower=13,13
ground.type = High
ground.slidetime = 7
ground.hittime  = 8
ground.velocity = -3.5
guard.velocity = -3
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 10
yaccel=.67
forcenofall=1
id=200

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

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

[State 230, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing Medium Kick
; CNS difficulty: easy
[Statedef 235]
type    = S
movetype= A
physics = S
juggle  =0; 5
poweradd=22
ctrl = 0

sprpriority=2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =235
[State 0, Width]
type = Width
trigger1 = animelemtime(5)<0
player = 22,0
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
;damage = 23, 0
damage =  64
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = S7000+(random%4)
guard.sparkno = S7009
sparkxy = -10, -70
hitsound = S1, 1
guardsound = S3, 1
ground.type = High
givepower=22,14
getpower=22,22
ground.slidetime = 10
ground.hittime  = 14
guard.velocity = -3
ground.velocity = -7.5
air.velocity = -2.5,-5
air.hittime = 14
yaccel=.67
forcenofall=1
id=235
ground.cornerpush.veloff=-11.5
nochainid=235

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,1
channel = 1
[State 240, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Strong Kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  =0; 5
poweradd=50
ctrl = 0

sprpriority=2
hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =240
[State 0, VelSet]
type = VelSet
trigger1 = vel x <0
x = 0
[State 0, Width]
type = Width
trigger1 = animelemtime(5)<0
player = 24,0
[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
[State 250, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 37, 14
damage =114			;Damage that move inflicts, guard damage
animtype = up			;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 = 10,10			;Time attacker pauses, time opponent shakes
sparkno = S7005+(random%4)
guard.sparkno = S7009				;Spark anim no (Def: set above)
sparkxy = -20, -80		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 2 	;Sound to play on hit
guardsound = S3, 1		;Sound to play on guard
ground.type = High		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 19		;Time that the opponent slides back
ground.hittime  = 70		;Time opponent is in hit state
givepower=50,25
getpower=50,50
ground.velocity = 0,-16	;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8	;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))			;Type: High, Low, Trip (def: same as ground.type)
air.velocity = 0,-12		;X-velocity at which opponent is pushed,					;Y-velocity at which opponent is pushed
air.hittime = 70
p2facing = 1			;Time before oppo
yaccel=0.65
id=410
nochainid=410


[State 0, Helper]
type = Helper
trigger1 = movehit
helpertype = normal ;player
name = "launch"
ID = 7011
stateno =7011
pos = 77,-103
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 40
pausemovetime = 40
ignorehitpause=1
persistent=0



[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3
value = S0,2
channel = 1

[State 0, TargetState]
type = TargetState
trigger1 =movehit
value = 411
ID = 410
ignorehitpause =0
persistent=0
;persistent =
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3
value = S2,1
channel = 0
[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl =1
;---------------------------------------------------------------------------
; Standing Medium Kick
; CNS difficulty: easy
[Statedef 251]
type    = S
movetype= A
physics = S
juggle  =0; 5
poweradd=50
ctrl = 0
anim =251
hitcountpersist = 1

[State 0, VelSet]
type = VelSet
trigger1 = time=0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0
[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
;damage = 23, 0
damage = 83
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = S7000+(random%4)
guard.sparkno = S7009
sparkxy = -10, -70
hitsound = S1, 1
guardsound = S3, 1
ground.type = High
ground.slidetime = 16
ground.hittime  = 18
givepower=50,25
getpower=50,50
guard.velocity = -3
ground.velocity = -7.5
air.velocity = -2.5,-5
air.hittime = 14
yaccel=.67
forcenofall=1
id=200
ground.cornerpush.veloff=-16.5
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,2
channel = 1
[State 240, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Crouching Light Punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning the
;     player will get hit instead of trading hits with the opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  =0; 5
poweradd = 13
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
trigger2= time=1 && anim!=400
value =400
[State 0, VelSet]
type = VelSet
trigger1 = vel x <0
x = 0
[State 0, Width]
type = Width
trigger1 = 1
player = 22,17
[State 210, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 21, 9
damage =48		;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 = S8100+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -10, -55		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 0		;Sound to play on hit
guardsound = S3, 1		;Sound to play on guard
givepower=13,7
getpower=13,13
ground.type = low		;Type: High, Low, Trip (def: Normal)
ground.slidetime =5
ground.hittime  = 8
ground.velocity = -3.5
guard.velocity = -3
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 10
forcenofall=1
yaccel=.67
id=200
nochainid=200
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,0
channel = 1
[State 400, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Medium Punch
[Statedef 405]
type    = C
movetype= A
physics = C
juggle  =0; 6
poweradd=22
ctrl = 0
hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000 
trigger2= time=1 && anim!=405
value =405
[State 305, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 29, 14
damage = 64		;Damage that move inflicts, guard damage
animtype = medium			;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 = 10,10			;Time attacker pauses, time opponent shakes
sparkno = S7000+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -10, -40		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 4			;Sound to play on hit
guardsound = S3, 1	;Sound to play on guard
givepower=22,14
getpower=22,22
ground.type = low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10
ground.hittime  = 14
guard.velocity = -3
ground.velocity = -6
air.velocity = -2.5,-5
air.hittime = 14
forcenofall=1
yaccel=.67
id=405
ground.cornerpush.veloff=-10.5
nochainid=405

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =405
ignorehitpause =1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,1
channel = 1
[State 410, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 411]
type    = A
movetype= H
physics = N
juggle  =0;0; 8
velset=-.95,-15.35
poweradd= 59
ctrl = 0
sprpriority = 2
[State 0, VelAdd]
type = VelAdd
trigger1 =time >1
y = .73


[State 0, ChangeAnim2]
type = ChangeAnim
triggerall = anim!=5160
trigger1 =time=0
value = 5051



[State 0, SelfState]
type = SelfState
trigger1 =time>=30
value =5040
ctrl=1
;---------------------------------------------------------------------------
; Crouching Strong Punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  =0; 6
poweradd=50
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =410
[State 0, Width]
type = Width
trigger1 = animelemtime(5)<0
player = 24,0
[State 305, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 37, 14
damage =135		;Damage that move inflicts, guard damage
animtype =heavy			;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 = 10,10			;Time attacker pauses, time opponent shakes
sparkno = S7005+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -10, -60		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 2 	;Sound to play on hit
guardsound = S3, 1		;Sound to play on guard
ground.type = High		;Type: High, Low, Trip (def: Normal)		;Time opponent is in hit state
ground.slidetime = 16
ground.hittime  = 18
givepower=50,25
getpower=50,50
guard.velocity = -3
ground.velocity = -7.5
air.velocity = -2.5,-5
air.hittime = 14
yaccel=.67
forcenofall=1
id=210
ground.cornerpush.veloff=-16.5
nochainid=210

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=2
value = S2,1
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=2
value = S0,2
channel = 1

[State 420, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; Crouching Light Kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  =0; 0
poweradd = 13
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =430
[State 0, VelSet]
type = VelSet
trigger1 = vel x <0
x = 0
[State 210, 1]
type = HitDef
triggerall = p2stateno!=5110
trigger1 = time = 0
attr =C, NA			;Attribute: Standing, Normal Attack
;damage = 18, 9
damage = 48			;Damage that move inflicts, guard damage
animtype = light			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = LA			;Flags on how move is to be guarded against
hitflag = MAFD		;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 = S8100+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -10, -20		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 0		;Sound to play on hit
guardsound = S3, 1		;Sound to play on guard
givepower=13,7
getpower=13,13
ground.type = low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 7
ground.hittime  =8
ground.velocity = -3.5
guard.velocity = -3
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 13
down.hittime=13
forcenofall=1
id=200
down.cornerpush.veloff=-8
nochainid=200
[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A||p2stateno=5080) && movehit=1 && (p2stateno!=[201,203])
value =201
ID =200
ignorehitpause =1 

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

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

;---------------------------------------------------------------------------
; Crouching Medium Kick
; CNS difficulty: easy
[Statedef 435]
type    = C
movetype= A
physics = C
juggle  =0; 5
poweradd= 22
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =435
[State 320, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 26, 14
damage = 64		;Damage that move inflicts, guard damage
animtype =medium			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = LA			;Flags on how move is to be guarded against
hitflag = MAFD			;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 = 10,11			;Time attacker pauses, time opponent shakes
sparkno = S7000+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -10, -20		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 1		;Sound to play on hit
guardsound = S3, 1	;Sound to play on guard
givepower=22,14
getpower=22,22
ground.type = low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10
ground.hittime  = 14
guard.velocity = -3
ground.velocity = -6
air.velocity = -2.5,-5
air.hittime = 14
forcenofall=1
yaccel=.67
id=435
ground.cornerpush.veloff=-11.5
nochainid=435

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =435
ignorehitpause =1 
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,1
channel = 1
[State 440, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  =0; 7
poweradd=50
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =440
[State 325, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA			;Attribute: Standing, Normal Attack
;damage = 31, 14
damage =114	;Damage that move inflicts, guard damage
animtype = Hard			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = LA			;Flags on how move is to be guarded against
hitflag = MAFD			;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 = S7005+(random%4)
guard.sparkno = S7009			;Spark anim no (Def: set above)
sparkxy = -10, -10		;X-offset for the "hit spark" rel. to p2,					;Y-offset for the spark rel. to p1
hitsound = S1, 2		;Sound to play on hit
guardsound = S3, 1	;Sound to play on guard
givepower=50,25
getpower=50,50
ground.type = trip		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5		;Time that the opponent slides back
ground.hittime  = 9		;Time opponent is in hit state
ground.velocity = 0,-3		;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8	;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = Trip			;Type: High, Low, Trip (def: same as ground.type)
air.velocity = 0,-3		;X-velocity at which opponent is pushed,					;Y-velocity at which opponent is pushed
air.hittime = 10			;Time before oppo
p2facing = 1
id=440
nochainid=440
guard.velocity=-10
guard.cornerpush.veloff=-13
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S2,1
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,2
channel = 1
[State 450, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 441]
type    = A
movetype=H
physics = N
velset =0,-2.3
poweradd = 40
anim=5070


[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .44
[State 0, NotHitBy]
type = NotHitBy
trigger1 = anim=5070
value = SCA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =


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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =anim=5100|| anim=614|anim=612
statetype = L      ;S,A,C,L

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = selfanimexist(5100)
trigger1 = pos y>=0 && (anim=5070) && time>3
value = 5100
[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = !selfanimexist(5100)
trigger1 = pos y>=0 &&(anim=5070) && time>3
value = 614
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=614&& animtime=0
value = 612
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=5100 && animtime=0
value = 612

[State 0, PosSet]
type = PosSet
trigger1 =anim=5100 || anim=612 ||anim=614
y = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = anim=5100 || anim=612||anim=614
x = 0
y = 0
;ignorehitpause =
;persistent =
[State 0, ChangeState]
type = selfState
triggerall = alive
triggerall = anim=612 && animelemtime(1)>1
trigger1 = command="x"||command="y"||command="z"||command="a"||command="b"||command="c"
trigger2= AIlevel >0 && random<111
value =5120
ctrl = 0
[State 0, SelfState]
type = SelfState
trigger1 =animelemtime(1)=15 && anim=612
value =ifelse(alive,5120,5150)
ctrl=0
;---------------------------------------------------------------------------
; Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics =N
juggle  =0; 2
poweradd = 13
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =600
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A  
[State 600, 2]
type = HitDef
trigger1 = time = 0
attr = A, NA
;damage  = 20
damage = 48
animtype = light
guardflag = HA
priority = 3
pausetime = 9,9
sparkno = S8100+(random%4)
guard.sparkno = S7009
sparkxy = -10,-58
hitsound   = S1,0
guardsound = S3,1
givepower=13,7
getpower=13,13
ground.type = High
ground.slidetime =6
ground.hittime = 12
air.hittime = 9
ground.velocity = -4
air.velocity = -.2,-6.5
yaccel=.8
forcenofall=1
id=600
nochainid=600
[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =600
ignorehitpause =1 

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

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

[State 0, ChangeState]
type = ChangeState
trigger1 =pos y >=0
value = 52
;---------------------------------------------------------------------------
; Jump Medium Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics =N
juggle  =0; 4
poweradd=22
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =610
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A
[State 600, 2]
type = HitDef
trigger1 = time = 0
attr = A, NA
;damage    = 32
damage =  64
animtype = medium
guardflag = HA
priority = 3
pausetime = 11,11
sparkno = S7000+(random%4)
guard.sparkno = S7009
sparkxy = -10,-58
hitsound = S1, 4
guardsound = S3, 1
ground.type = High
ground.slidetime = 9
ground.hittime = 14
guard.ctrltime = 14
givepower=22,14
getpower=22,22
ground.velocity = -4
air.velocity =-.2,-7
air.hittime=15
yaccel=.7
forcenofall=1
id=610
nochainid=610

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =610
ignorehitpause =1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,1
channel = 1


[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0
value = 57
ctrl = 1
[State 0, ChangeState]
type = ChangeState
trigger1 =pos y >=0
value = 52
;---------------------------------------------------------------------------
; Jump Strong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics =N
juggle  =0; 4
poweradd=50
ctrl = 0
anim = ifelse(random<499,620,621)
hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =ifelse(random<499,620,621)
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0 
value = S2,1
channel = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A
[State 600, 2]
type = HitDef
trigger1 = !movecontact
attr = A, NA
;damage = 43
damage = 114
animtype = Hard
guardflag = HA
priority = 3
pausetime = 12,12
sparkno = S7005+(random%4)
guard.sparkno = S7009
sparkxy = -25,-58
hitsound = S1, 2
guardsound = S3, 1
givepower=50,25
getpower=50,50
ground.type = High
ground.slidetime =15
ground.hittime  = 18
ground.velocity = -7.5
air.velocity = -2.5,15
id=ifelse(var(9)=1&&p2movetype=H,640,641)
nochainid=ifelse(var(9)=1&&p2movetype=H,640,641)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit &&p2statetype=A   && var(9)
value = 622

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = p2bodydist x <75 && p2statetype!=A && anim=622
physics = A  

[State 0, ScreenBound]
type = ScreenBound
triggerall = anim=622 && frontedgebodydist > 0
trigger1 = 1
value =cond(frontedgebodydist <15,1,0)
movecamera=cond(frontedgebodydist <15,1,0),0
[State 600, 3]
type = changestate
 triggerall =prevstateno= [600,640]
trigger1 = p2statetype=L&&var(31)=19 && var(29)=1
value = 101

[State 0, VarSet]
type = Varadd
trigger1 =var(29)=1
v = 31    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = p2statetype=A   && var(9)
 triggerall =prevstateno= [600,640]
triggerall = pos x <40&&facing=1|| pos x>-40&&facing=-1
trigger1 = pos y < -250 && enemy,pos y >-10 &&movehit
v = 29    ;fv = 10
value = 1

[State 0, VelSet]
type = VelSet
triggerall =  var(9)
 triggerall =prevstateno= [600,640]
triggerall = pos x <40&&facing=1|| pos x>-40&&facing=-1
trigger1 = movehit  &&  pos y < -250
x = 0
y = 0
[State 600, 3]
type = changestate
triggerall =  ((pos y >= -240)|| (pos x >=40&&facing=1|| pos x<=-40&&facing=-1))  ||(!movehit)
trigger1 = animtime=0
value = 57
ctrl=1
[state 9000, End]
type = ChangeState
trigger1 = Pos Y >= 0
value = 52
;---------------------------------------------------------------------------
; Jump Strong Punch
; CNS difficulty: easy
[Statedef 621]
type    = A
movetype= A
physics =N
juggle  =0; 4
poweradd=50
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =ifelse(random<499,625,626)
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,2
channel = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0 
value = S2,1
channel = 0
[State 600, 2]
type = HitDef
trigger1 = !movecontact
attr = A, NA
;damage = 43
damage = 114
animtype = Hard
guardflag = HA
priority = 3
pausetime = ifelse(p2statetype!=A,12,5),ifelse(p2statetype!=A,12,2)
sparkno = S7005+(random%4)
guard.sparkno = S7009
sparkxy = -25,-58
hitsound = S1, 2
guardsound = S3, 1
givepower=50,25
getpower=50,50
ground.type = High
ground.slidetime =15
ground.hittime  = 18
ground.velocity = -8.5
air.velocity = -2.5,15
id=ifelse(var(9)=1&&p2movetype=H,640,641)
nochainid=ifelse(var(9)=1&&p2movetype=H,640,641)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit &&p2statetype=A   && var(9)
value = 627

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = p2bodydist x <75 && p2statetype!=A && anim=627
physics = A         ;A,C,S,N
;ignorehitpause = 
;persistent = 

[State 0, ScreenBound]
type = ScreenBound
triggerall = anim=627 && frontedgebodydist > 0
trigger1 = 1
value =cond(frontedgebodydist <15,1,0)
movecamera=cond(frontedgebodydist <15,1,0),0
[State 600, 3]
type = changestate
 triggerall =prevstateno= [600,640]
trigger1 = p2statetype=L&&var(31)=19 && var(29)=1
value = 101

[State 0, VarSet]
type = Varadd
trigger1 =var(29)=1
v = 31    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = p2statetype=A   && var(9)
 triggerall =prevstateno= [600,640]
triggerall = pos x <40&&facing=1|| pos x>-40&&facing=-1
trigger1 = pos y < -250 && enemy,pos y >-10 &&movehit
v = 29    ;fv = 10
value = 1

[State 0, VelSet]
type = VelSet
triggerall =  var(9)
 triggerall =prevstateno= [600,640]
triggerall = pos x <40&&facing=1|| pos x>-40&&facing=-1
trigger1 = movehit  &&  pos y < -250
x = 0
y = 0
[State 600, 3]
type = changestate
triggerall =  ((pos y >= -240)|| (pos x >=40&&facing=1|| pos x<=-40&&facing=-1))  ||(!movehit)
trigger1 = animtime=0
value = 57
ctrl=1
[state 9000, End]
type = ChangeState
trigger1 = Pos Y >= 0
value = 52
;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 10613]
type    = A
movetype= H
physics = N
juggle  =0;0; 0
velset=-13,13
poweradd= 59
ctrl = 0
sprpriority = -2
[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .67
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0
value = 1202

[State 0, ChangeAnim2]
type = ChangeAnim2
triggerall = anim!=51601
trigger1 =pos y>=0 && anim=1202 && time>3

value = 51601
[State 0, PosSet]
type = PosSet
trigger1 = anim=51601&& animelem=1
y = 0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = statetype=L
value = SCA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =
[State 0, VelSet]
type = VelSet
trigger1 =animelemtime(1)=1 && anim=51601
y = -7
x=0
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,1
;ignorehitpause =
;persistent =

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =anim=51601
statetype = L      ;S,A,C,L

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = selfanimexist(5101)
trigger1 = pos y>=0 && anim=51601 && animelemtime(1)>10
value = 5101
[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = !selfanimexist(5101)
trigger1 = pos y>=0 && anim=51601 && animelemtime(1)>10
value = 614
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=614&& animtime=0
value = 612
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=5101 && animtime=0
value = 612

[State 0, PosSet]
type = PosSet
trigger1 =anim=5101 || anim=612 ||anim=614
y = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = anim=5101 || anim=612||anim=614
x = 0
y = 0
;ignorehitpause =
;persistent =

[State 0, SelfState]
type = SelfState
trigger1 =animelemtime(1)=20 && anim=612
value =ifelse(alive,5120,5110)
ctrl=0
;---------------------------------------------------------------------------
; Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics =N
juggle  =0; 3
poweradd = 13
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =630
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A
[State 600, 2]
type = HitDef
trigger1 = time = 0
attr = A, NA
;damage = 23
damage =48
animtype = light
guardflag = HA
priority = 3
pausetime = 9,9
sparkno = S8100+(random%4)
guard.sparkno = S7009
sparkxy = -10,-58
hitsound = S1, 0
guardsound = S3,1
givepower=13,7
getpower=13,13
ground.type = High
ground.slidetime = 6
ground.hittime = 12
air.hittime = 11
ground.velocity = -4
air.velocity = -.2,-7.5
yaccel=.8
forcenofall=1
id=630
nochainid=630

[State 0, TargetState]
type = TargetState
trigger1 =p2statetype= A && movehit=1 && (p2stateno!=[201,203])
value =201
ID =630
ignorehitpause =1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,0
channel = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0
value = 57
ctrl = 1
[State 0, ChangeState]
type = ChangeState
trigger1 =pos y >=0
value = 52
;---------------------------------------------------------------------------
; Jump Medium Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = N
juggle  =0; 4
poweradd=22
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =640
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A
[State 620, 2]
type = HitDef
trigger1 = time = 0
attr = A, NA
;damage = 31
damage = 64
animtype = medium
guardflag = HA
priority = 3
pausetime = 11,11
sparkno = S7000+(random%4)
guard.sparkno = S7009
sparkxy = -15,-45
hitsound = S1, 1
guardsound = S3,1
givepower=22,14
getpower=22,22
ground.type = High
ground.slidetime =8
ground.hittime = 14
air.hittime =15
ground.velocity = -4
air.velocity = -.2,-6.35
yaccel=.8
forcenofall=1
id=635
nochainid=635

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

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


[State 0, ChangeState]
type = ChangeState
trigger1 = animtime=0
value = 57
ctrl = 1
[State 0, ChangeState]
type = ChangeState
trigger1 =pos y >=0
value = 52
;---------------------------------------------------------------------------
; Jump Strong Kick
; CNS difficulty: easy
[Statedef 650]
type    = A
movetype= A
physics = N
juggle  =0; 4
poweradd=50
ctrl = 0

hitcountpersist = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =650

[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
x = 0
y = .62
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S0,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0 
value = S2,1
channel = 0
[State 625, 2]
type = HitDef
trigger1 = !movecontact
attr = A, NA
;damage = 39
damage =114
animtype = Hard
guardflag = HA
priority = 3
pausetime = 12,12
sparkno = S7005+(random%4)
guard.sparkno = S7009
sparkxy = -25,-70
hitsound = S1, 2
guardsound = S3,1
ground.type = High
pausetime = ifelse(p2statetype!=A,12,5),ifelse(p2statetype!=A,12,2)
sparkno = S7005+(random%4)
guard.sparkno = S7009
sparkxy = -25,-58
givepower=50,25
getpower=50,50
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -8.5
air.velocity = -2.5,15
id=ifelse(var(9)=1&&p2movetype=H,640,641)
nochainid=ifelse(var(9)=1&&p2movetype=H,640,641)


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movehit &&p2statetype=A   && var(9) && animtime=0
value = 651


[State 0, ScreenBound]
type = ScreenBound
triggerall = anim=651&& frontedgebodydist > 0
trigger1 = 1
value =cond(frontedgebodydist <15,1,0)
movecamera=cond(frontedgebodydist <15,1,0),0
[State 600, 3]
type = changestate
 triggerall =prevstateno= [600,640]
trigger1 = p2statetype=L&&var(31)=19 && var(29)=1
value = 101

[State 0, VarSet]
type = Varadd
trigger1 =var(29)=1
v = 31    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = p2statetype=A   && var(9)
 triggerall =prevstateno= [600,640]
triggerall = pos x <40&&facing=1|| pos x>-40&&facing=-1
trigger1 = pos y < -250 && enemy,pos y >-10 &&movehit
v = 29    ;fv = 10
value = 1

[State 0, VelSet]
type = VelSet
triggerall =  var(9)
 triggerall =prevstateno= [600,640]
triggerall = pos x <40&&facing=1|| pos x>-40&&facing=-1
trigger1 = movehit  &&  pos y < -250
x = 0
y = 0
[State 600, 3]
type = changestate
triggerall =  ((pos y >= -240)|| (pos x >=40&&facing=1|| pos x<=-40&&facing=-1))  ||(!movehit)
trigger1 = animtime=0 && (!movehit || !var(9))
value = 57
ctrl=1
[state 9000, End]
type = ChangeState
trigger1 = Pos Y >= 0
value = 52
;---------------------------------------------------------------------------
[Statedef 702]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 5,0
ctrl = 0
anim = 702
sprpriority = -1

[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 10
add = 0,0,0
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 256



[State 8300, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 8300, VelSet]
type = VelSet
trigger1 =time > 35
x = 0

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

[State 8300, NotHitBy]  ;Can't get hit while rolling
type = NotHitBy
trigger1 = time < 35
value = SCA
time = 1

[State 8300, ChangeState]
type = ChangeState
trigger1 = time = 35
value = 11
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 703]
type    = C
movetype= I
physics = N
poweradd= 0
velset = -5,0
ctrl = 0
anim = 703
sprpriority = -1



[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 10
add = 0,0,0
mul = 256,256,256
sinadd = 0,0,0,10
invertall = 0
color = 256

[State 8300, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 8300, VelSet]
type = VelSet
trigger1 = time > 35
x = 0

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

[State 8300, NotHitBy]  ;Can't get hit while rolling
type = NotHitBy
trigger1 = time < 35
value = SCA
time = 1

[State 8300, ChangeState]
type = ChangeState
trigger1 = time = 35
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; Throw - Attempt
; CNS difficulty: medium-advanced

[Statedef 800]
type    = S
movetype= A
physics = S
juggle  =0; 15
velset = 0,0
ctrl = 0
anim = 800

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents the player from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
sprpriority = 1       ;Draw in front of p2
hitsound = S800, 0
p1facing = ifelse (command = "holdfwd", -1, 1) ;Turn if holding forwards
p2facing = 1          ;Force p2 to face player
p1stateno = 810       ;On success, player changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in player's cns
fall = 1              ;Force p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value =210
ctrl = 0
;-------------------------------------------------------------
[Statedef 801]
type = A
movetype= A
physics = N
juggle = 0
ctrl = 0
velset=0,0
anim = 801
[State 0, Turn]
type = Turn
trigger1 = facing = enemy,facing&&time=0
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S5100,12
channel = 1
;[State 0, PosAdd]
;type = PosAdd
;trigger1 =time =0 && prevstateno=831 
;y = -(enemynear,const(size.head.pos.y))+83
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =anim=5040
y = .5
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 =time=1 
value =5040
[State 0, PlayerPush]
type = PlayerPush
trigger1 =1 
value =0
[State 0, VelSet]
type = VelSet
trigger1 =time=1 
x = -4.5
y = -2.5
[State 0, ChangeAnim]
type = selfstate
trigger1 =pos y>=0 && anim=5040&& time>3
value =52
ctrl=0
;-------------------------------------------------------------
[Statedef 802]
type = A
movetype= A
physics = N
juggle = 0
ctrl = 0
velset=0,0
[State 0, Turn]
type = Turn
trigger1 = facing = enemy,facing&&time=0
[State 0, NotHitBy]
type = NotHitBy
trigger1 =1 
value = SCA
;value2 = S,NA
time = 1
[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = enemy,pos y
;ignorehitpause = 
;persistent = 
[State 0, VelAdd]
type = VelAdd
trigger1 =anim=5040
y = .5


[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 =time=0 
value = 801
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 =time=1 
value =5040
[State 0, PlayerPush]
type = PlayerPush
trigger1 =1 
value =0
[State 0, VelSet]
type = VelSet
trigger1 =time=1 
x = -4.5
y = -2.5
[State 0, ChangeAnim]
type = selfstate
trigger1 =pos y>=0 && anim=5040 && time>3
value =52
ctrl=0
;---------------------------------------------------------------------------
; Throwing the opponent
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810


[State 0, VarSet]
type = VarSet
trigger1 = random<33*AIlevel&&AIlevel>0&&time=0
v = 35   ;fv = 10
value = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = p2stateno=802 
value =801

[State 0, ChangeState]
type = targetState
triggerall = time =[1,4] 
trigger1= (enemy,command="z" || enemy,command="y" || enemy,command="b")&& AILevel=0
trigger2 =  var(35)=1
value =802
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=6
value = S2,1
channel =0
[State 0, Width]
type = Width
trigger1 = 1
edge = 0,70
player = 0,0
;value = 0,0
;ignorehitpause = 
;persistent = 

[State 810, Bind 1]
type = TargetBind
trigger1 =  AnimElemTime(1) >= 0 && AnimElemTime(3) < 0
pos = 75,0
[State 810, Bind 1]
type = TargetBind
trigger1 =  AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos = 77,-65

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

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = 12,-91

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElemTime(6) >= 0 && AnimElemTime(7) < 0
pos = -16,-103

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElem =7
pos = -110,-114


[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem=7
value = 56
;ignorehitpause = 
;persistent = 

[State -3, Wall Hit Sound]
type = PlaySnd
triggerall = enemy,backedgebodydist <10
trigger1=enemy,anim=820
trigger1= p2stateno=821
value = S1,3
volume = 255
ignorehitpause = 1
persistent = 0

[State -3, Wall Hit Spark]
type = Explod
triggerall = enemy,backedgebodydist <10
trigger1=enemy,anim=820
trigger1= p2stateno=821
anim = 6000
ID = 9049
pos = -20, -0
postype = p2
bindtime = 1
facing = -1
removetime = -2
scale = 0.5, 0.5
sprpriority = 4
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=7
value = -114
kill = 1
absolute = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
[State 0, TargetState]
type = TargetState
trigger1 = animelemtime(8)=0
value = 821

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Opponent Thrown
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by the throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820
[State 0, AngleDraw]
type = AngleDraw
trigger1 = animelemtime(4)=[1,2]
value = -90
;scale = 
;ignorehitpause = 
;persistent = 


[State 820, SelfState]
type = SelfState
trigger1 = p2stateno!=810
value = 5050
;---------------------------------------------------------------------------
; Opponent 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 821]
type    = A
movetype= H
physics = N
poweradd =56
velset=7,-3.1


[State 0, Turn]
type = Turn
trigger1 = animelem=6 && anim=820
;ignorehitpause = 
;persistent = 



;ignorehitpause =
;persistent =


[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .77
[State 0, NotHitBy]
type = NotHitBy
trigger1 = statetype!=L
value = SCA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =


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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =anim=5100|| anim=614|anim=612
statetype = L      ;S,A,C,L

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = selfanimexist(5100)
trigger1 = pos y>=-15 && (anim=820|| anim=1156||anim=3121) && time>3
value = 5100
[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = !selfanimexist(5100)
trigger1 = pos y>=0 &&(anim=820|| anim=1156||anim=3121) && time>3
value = 614
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=614&& animtime=0
value = 612
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=5100 && animtime=0
value = 612

[State 0, PosSet]
type = PosSet
trigger1 =anim=5100 || anim=612 ||anim=614
y = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = anim=5100 || anim=612||anim=614
x = 0
y = 0
;ignorehitpause =
;persistent =

;ignorehitpause = 
;persistent = 
[State 0, ChangeState]
type = selfState
triggerall = alive
triggerall = anim=612 && animelemtime(1)>1
trigger1 = command="x"||command="y"||command="z"||command="a"||command="b"||command="c"
trigger2= AIlevel >0 && random<94*AIlevel && animelemtime(1)=1
value =5120
ctrl = 0
[State 0, SelfState]
type = SelfState
trigger1 =animelemtime(1)=18 && anim=612
value =ifelse(alive,5120,5110)
ctrl=0

;---------------------------------------------------------------------------
; Throw - Attempt
; CNS difficulty: medium-advanced

[Statedef 830]
type    = S
movetype= A
physics = S
juggle  =0; 15
velset = 0,0
ctrl = 0
anim = 800

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents the player from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
sprpriority = 1       ;Draw in front of p2
hitsound = S800, 0
p1facing = ifelse (command = "holdfwd", 1, -1) ;Turn if holding forwards
p2facing = 1          ;Force p2 to face player
p1stateno = 831      ;On success, player changes to state 810
p2stateno = 832       ;If hit, p2 changes to state 820 in player's cns
fall = 1              ;Force p2 into falling down

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

;---------------------------------------------------------------------------
; Throwing the opponent
[Statedef 831]
type    = S
movetype= A
physics = N
anim = 830

[State 0, VarSet]
type = VarSet
trigger1 = random<33*AIlevel&&AIlevel>0&&time=0
v = 35   ;fv = 10
value = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = p2stateno=802 
value =801

[State 0, ChangeState]
type = targetState
triggerall = time =[1,4] 
trigger1= (enemy,command="z" || enemy,command="y" || enemy,command="b")&& AILevel=0
trigger2 =  var(35)=1
value =802
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=5
value = S2,2
channel = 0
[State 0, Width]
type = Width
trigger1 = 1
edge = 45,0
;value = 0,0
;ignorehitpause = 
;persistent = 


[State 810, Bind 1]
type = TargetBind
trigger1 =  AnimElemTime(1) >= 0 && AnimElemTime(3) < 0
pos = 89,0
[State 810, Bind 1]
type = TargetBind
trigger1 =  AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos = 67,-72

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

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElemTime(5) >= 0 && AnimElemTime(7) < 0
pos = -66,-122

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

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElemTime(8) >= 0 && AnimElemTime(10) < 0
pos =66,-5
[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElem=10
pos =66,-10

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem=10
value = 56

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=10
value = -111
kill = 1
persistent=0

[State 0, Explod]
type = Explod
trigger1 =animelem=5
anim =832
ID =832
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 = 1
removeongethit = 1
ignorehitpause =1
persistent=0
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6 
x = 4
y = -8.6
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(6)>0&&animelemtime(10)<0 && pos y <0
y = .61
;ignorehitpause = 
;persistent = 

;ignorehitpause = 
;persistent = 


[State 0, VelSet]
type = VelSet
trigger1 = animelem=10
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=10
y = 0
;ignorehitpause = 
;persistent = 


[State 3304, EnvShake]
type = EnvShake
Trigger1 = animelem=10
freq = 90
ampl = 4
phase = 20
time = 10
persistent=0

[State 0, Explod]
type = Explod
trigger1 =animelem=10
anim =6006
ID =8002
pos = 0,0
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause =1
persistent=0

[State 3303, PlaySnd]
type = PlaySnd
Trigger1 = animelem=10
value = S1,3
volume = 255
channel = 1
persistent=0

[State 0, TargetState]
type = TargetState
trigger1 = animelemtime(10)=15
value = 10001
persistent=0

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value =0
ctrl =1
;---------------------------------------------------------------------------
; Opponent Thrown
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by the throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 832]
type    = A
movetype= H
physics = N
velset = 0,0

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

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


[State 820, SelfState]
type = SelfState
trigger1 = p2stateno!=831
value = 5050
;---------------------------------------------------------------------------
; Opponent 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 833]
type    = A
movetype= H
physics = N
poweradd = 40
velset=0,0

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -const(size.head.pos.y)

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


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0
value = 5110
;ignorehitpause = 
;persistent = 


[State 0, SelfState]
type = SelfState
trigger1 =time=20 
value =ifelse(alive,5120,5110)
;---------------------------------------------------------------------------
; Throw - Attempt
; CNS difficulty: medium-advanced

[Statedef 840]
type    = A
movetype= A
physics = N
juggle  =0; 15
ctrl = 0
anim = 802
[state 9000, VelAdd]
type = VelAdd
trigger1 = numexplod(56)
y = .62
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =  !numexplod(56)
physics = A  
; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents the player from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = A, NT          ;Attributes: Standing, Normal Throw
hitflag = A-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
sprpriority = 1       ;Draw in front of p2
hitsound = S800, 0
p1facing = ifelse (command = "holdfwd", 1, -1) ;Turn if holding forwards
p2facing = 1          ;Force p2 to face player
p1stateno = 841      ;On success, player changes to state 810
p2stateno = 842       ;If hit, p2 changes to state 820 in player's cns
fall = 1              ;Force p2 into falling down

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

;---------------------------------------------------------------------------
; Throwing the opponent
[Statedef 841]
type    = A
movetype= A
physics = N
anim = 840
poweradd = 56
velset=0,0
[State 0, VarSet]
type = VarSet
trigger1 = random<33*AIlevel&&AIlevel>0&&time=0
v = 35   ;fv = 10
value = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = p2stateno=802 
value =801

[State 0, ChangeState]
type = targetState
triggerall = time =[1,4] 
trigger1= (enemy,command="z" || enemy,command="y" || enemy,command="b")&& AILevel=0
trigger2 =  var(35)=1
value =802



;persistent =
[State 810, Bind 1]
type = TargetBind
trigger1 =  AnimElemTime(1) >= 0 && AnimElemTime(2) < 0 &&anim=840
pos = -5,-98

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElemTime(2) >= 0 &&anim=840
pos = 64,-7
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=0 && anim!=830 
value = 830
elem = 10

[State 810, Bind 2-4]
type = TargetBind
trigger1 =  AnimElem=10&& anim=830
pos =66,-10

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem=10&& anim=830
value = 56

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=10&& anim=830
value = -111
kill = 1
persistent=0

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(3)>0 && anim=840
y = .61
[State 0, VelSet]
type = VelSet
trigger1 = animelem=10 && anim=830
x = 0
y = 0
;ignorehitpause = 
;persistent = 
[State 0, PosSet]
type = PosSet
trigger1 = animelem=10&& anim=830
y = 0
;ignorehitpause = 
;persistent = 


[State 3304, EnvShake]
type = EnvShake
Trigger1 = animelem=10&& anim=830
freq = 90
ampl = 4
phase = 20
time = 10
persistent=0

[State 0, Explod]
type = Explod
trigger1 =animelem=10&& anim=830
anim =6006
ID =8002
pos = 0,0
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause =1
persistent=0

[State 3303, PlaySnd]
type = PlaySnd
Trigger1 = animelem=10&& anim=830
value = S1,3
volume = 255
channel = 1
persistent=0

[State 0, TargetState]
type = TargetState
trigger1 = animelemtime(10)=15&& anim=830
value = 10001
persistent=0

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0&& anim=830
value =0
ctrl =1
;---------------------------------------------------------------------------
; Opponent Thrown
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by the throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 842]
type    = A
movetype= H
physics = N
velset = 0,0

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

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


;ignorehitpause = 
;persistent = 

[State 820, SelfState]
type = SelfState
trigger1 = p2stateno!=841
value = 5050
;===============================[SPECIAL ATTACKS]==============================;
;===============
;[Giant swing]
;===============
[Statedef 1000]
type    = U
movetype= A
physics = N
juggle  =0; 1
ctrl = 0


poweradd = 56
sprpriority = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =1000+((statetype=A)*10)
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command = "QCF_x",1,2)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(2)=2 && time=0&& prevstateno!=9000
value = 1001+((statetype=A)*10)

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = statetype!=A
statetype = S      ;S,A,C,
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=9000 &&time=0
x = 0
y = 0
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = time=0 
trigger1=statetype=A
trigger2 = prevstateno=251 || prevstateno=440
trigger3 =p2bodydist x >90
v = 2  ;fv = 10
value = 2
[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = time=0 
triggerall =statetype!=A 
triggerall = prevstateno!=251 && prevstateno!=440
trigger1= p2bodydist x <90
v = 2  ;fv = 10
value = 1
[State 0, Explod]
type = Explod
triggerall = statetype=A
trigger1 =time=0
anim =5334
ID =1001
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause =1
persistent=0


[State 0, Explod]
type = Explod
triggerall = statetype!=A
trigger1 = animelem = 1
anim =8000
ID =8002
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause =1

;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = animelem=4
x = 5.5
[State 0, VelSet]
type = Velmul
trigger1 = animelemtime(4)>ifelse(var(2)<2,5,10)
x = .94
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5)=4 && statetype!=A
x =0
[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)>0 && statetype=A
y = .47
;ignorehitpause = 
;persistent = 


[State 2200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S2,0
volume = 255
channel=0

[State 2200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S0,4
volume = 255
channel = 1



[State 1060, 4]
type = HitDef
trigger1 =!movecontact
attr = S, SA
animtype  =up
damage    = 0,5
guardflag = MA
hitflag=MAF
guard.pausetime = 4,4
priority=5
sparkno = S7005+(random%4)
guard.sparkno = S7009
sparkxy = -19,-64
hitsound   = S800,0
guardsound = S3,1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity =-9.5,-8.5
air.velocity = -9.5,-8.5
getpower=35,35
fall.recover=0
fall=1
p2facing=1
p1stateno=1001
p2stateno=1002
ground.cornerpush.veloff=0
id=1000
ignorehitpause=1



[State 2200, ChangeState]
type = ChangeState
trigger1 =animtime=0 && statetype!=A
trigger2= statetype=A && pos y >=0
value =0
ctrl = 1
;---------------------------------------------------------------------------
;Gou Shoryuken - start
[Statedef 1001]
type    = U
movetype= A
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
anim =1002+((statetype=A)*10)
ctrl = 0
sprpriority = 2
[State 0, TargetState]
type = TargetState
trigger1 =p2stateno!=1002 && time=0
value =1002
;ignorehitpause = 
;persistent = 

;9: 1,4,11,20,26
;-9: 2,8,18,24,29

;[State 200, 1]
;type = PlaySnd
;trigger1 = animelem=2 && anim = 10012
;trigger2 = animelem=4 && anim = 10012
;trigger3= animelem=6 && anim = 10012
;trigger4 = animelem=24 && anim = 10012
;value = S4,3
;channel=0
;[State 200, 1]
;type = PlaySnd
;trigger1 = animelem=2 && anim = 10012
;trigger2 = animelem=9 && anim = 10012
;trigger3= animelem=18 && anim = 10012
;trigger4 = animelem=24 && anim = 10012
;value = S4,5
;channel=0



[State 810, Bind 1]
type = TargetBind
triggerall = anim=1002
trigger1 = AnimElemTime(1) >= 0&&animelemtime(8)<0
pos = ((enemynear,const(size.mid.pos.y))-ceil((enemynear,const(size.mid.pos.y)/10)))-40,-86

[State 0, Turn]
type = Turn
triggerall = anim=1002
trigger1 = animelem=2
trigger2 = animelem=3
trigger3 = animelem=4
trigger4 = animelem=5
trigger5 = animelem=6
trigger6 = animelem=7
[State 200, 1]
type = PlaySnd
triggerall = anim=1002
trigger1 = animelem=2
trigger2 = animelem=3
trigger3 = animelem=4
trigger4 = animelem=5
trigger5 = animelem=6
trigger6 = animelem=7
value = S3,0
channel=1

[State 200, 1]
type = PlaySnd
trigger1 = animelem=12&& anim=1002
trigger2 = animelem=9&& anim=1012
value = S2,4
channel=0
[State 200, 1]
type = PlaySnd
trigger1 = animelemtime(10)<0 && command="360" && anim=1002&&time%2=0
trigger2 = animelemtime(7)<0 && command="360" && anim=1012&&time%2=0
value = S3,0
channel=1
[State 0, Turn]
type = Turn
trigger1 = animelemtime(10)<0 && command="360" && anim=1002&&time%2=0
trigger2 = animelemtime(7)<0 && command="360" && anim=1012&&time%2=0
;ignorehitpause = 
;persistent = 
[State 200, 1]
type = PlaySnd
triggerall = anim=1012
trigger1 = animelem=1
trigger2 = animelem=3
trigger3 = animelem=5
trigger4 = animelem=7
trigger5 = animelem=9
value = S3,0
channel=1
[State 0, VarSet]
type = VarSet
trigger1 =time=0 
fv = 3   ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = Varadd
triggerall = AILevel=0
triggerall = fvar(3)<.5
triggerall =command = "360"
trigger1 = animelemtime(10)<0  && anim=1002
trigger2 = animelemtime(7)<0  && anim=1012
fv =3 ;fv = 10
value = .0625
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = time=0
v = 3   ;fv = 10
value = facing
;ignorehitpause = 
;persistent = 

[State 0, Turn]
type = Turn
trigger1 = anim=1002
trigger1 = animelem=10 && facing!=var(3)
trigger2 = anim=1012
trigger2 = animelem=7 && facing!=var(3)

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(8) >= 0&&animelemtime(9)<0 && anim=1002
trigger2 = AnimElemTime(10) >= 0&&animelemtime(11)<0&& anim=1002
trigger3 = AnimElemTime(1) >= 0&&animelemtime(2)<0 && anim=1012
trigger4 = AnimElemTime(3) >= 0&&animelemtime(4)<0&& anim=1012
trigger5 = AnimElemTime(5) >= 0&&animelemtime(6)<0 && anim=1012
trigger6 = AnimElemTime(7) >= 0&&animelemtime(8)<0&& anim=1012
pos = ((enemynear,const(size.mid.pos.y))-ceil((enemynear,const(size.mid.pos.y)/8))),-79
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(9) >= 0&&animelemtime(10)<0&& anim=1002
trigger2 = AnimElemTime(12) >= 0&&animelemtime(13)<0&& anim=1002
trigger3 = AnimElemTime(2) >= 0&&animelemtime(3)<0 && anim=1012
trigger4 = AnimElemTime(4) >= 0&&animelemtime(5)<0&& anim=1012
trigger5 = AnimElemTime(6) >= 0&&animelemtime(7)<0 && anim=1012
trigger6 = AnimElemTime(9) >= 0&&animelemtime(10)<0 && anim=1012
pos = -((enemynear,const(size.mid.pos.y))-ceil((enemynear,const(size.mid.pos.y)/10)))+55,-92
[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(11) >= 0&&animelemtime(12)<0&& anim=1002
trigger2 = AnimElemTime(8) >= 0&&animelemtime(9)<0&& anim=1012
pos = ((enemynear,const(size.mid.pos.y))-ceil((enemynear,const(size.mid.pos.y)/10)))+100,-99

[State 810, Bind 1]
type = TargetBind
trigger1 =animelem=13&& anim=1002
trigger2 =animelem=10&& anim=1002
pos = -((enemynear,const(size.mid.pos.y))-ceil((enemynear,const(size.mid.pos.y)/10)))+45,-89

;ignorehitpause =
;persistent =

[State 0, Width]
type = Width
trigger1 =time=0
edge = 90,90

[State 0, VelSet]
type = VelSet
trigger1 =animelem=8 && anim=1002
y = -8.5
[State 0, VelSet]
type = VelSet
trigger1 =animelem=1 && anim=1012
y = -.5
[State 0, VelSet]
type = VelSet
trigger1 =animelem=10&& anim=1002
trigger2 =animelem=11&& anim=1002
y = 0

[State 0, VelAdd]
type = VelAdd
trigger1 =animelemtime(15)>0&& anim=1002
trigger2 =animelemtime(12)>0&& anim=1012
y = .43

;ignorehitpause =
;persistent =

[State 0, TargetVelSet]
type = TargetVelSet
trigger1 =animelem=13&& anim=1002
trigger2 =animelem=10&& anim=1012
x = -11
y = -14.5
id=1000
[State 0, TargetState]
type = TargetState
trigger1 =animelem=13&& anim=1002
trigger2 =animelem=10&& anim=1012
value =10001

;ignorehitpause = 
;persistent = 

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


[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =animelem=13&& anim=1002
trigger2 =animelem=10&& anim=1012
value = -ceil(170*(1+fvar(3)))
[State 0, Width]
type = Width
trigger1 =1
edge = 90,0
;value = 0,0
;ignorehitpause =
;persistent =


[State 0, Helper]
type = Helper
trigger1 = animelem=1 
helpertype = normal ;player
name ="Hadouken"
ID = 1005
stateno = 1005
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.yscale=1.15
[State 0, Helper]
type = Helper
trigger1 = animelem=1 
helpertype = normal ;player
name ="Hadouken"
ID = 1006
stateno = 1005
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
size.yscale=1.15
[State 1051, 3] ;Change state when KFM is close to ground
type = Changestate
trigger1 = pos y>=0&& animelemtime(15)>0 && anim=1002
trigger2= pos y>=0&& animelemtime(12)>0 && anim=1012
value = ifelse(backedgebodydist <0,101, 52)
ctrl=0
;---------------------------------------------------------------------------
;Gou Shoryuken - start
[Statedef 1002]
type    = A
movetype= H
physics = N
sprpriority = -2
[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
;ignorehitpause =
;persistent =

;ignorehitpause =
;persistent =
[State 0, SelfState]
type = SelfState
trigger1 = p2stateno!=1001
value =5050

[State 0, AngleDraw]
type = AngleDraw
triggerall=enemy,anim=1002
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
trigger2 = animelemtime(3)>=0&&animelemtime(4)<0
trigger3 = animelemtime(5)>=0&&animelemtime(6)<0
trigger4 = animelemtime(7)>=0&&animelemtime(8)<0

value = -90
[State 0, AngleDraw]
type = AngleDraw
triggerall=enemy,anim=1012
trigger1 = animelemtime(8)>=0&&animelemtime(9)<0
value = 90

[State 0, AngleDraw]
type = AngleDraw
triggerall=enemy,anim=1002
trigger1 = animelemtime(9)>=0&&animelemtime(10)<0
trigger2 = animelemtime(11)>=0&&animelemtime(12)<0
value = 90
;scale = 
;ignorehitpause = 
;persistent = 
[State 0, Turn]
type = Turn
triggerall = enemy,anim=1002
trigger1 = facing!=enemy,facing && animelemtime(2)>=0 && animelemtime(3)<0
trigger2 = facing!=enemy,facing && animelemtime(4)>=0 && animelemtime(5)<0
trigger3 = facing!=enemy,facing && animelemtime(6)>=0 && animelemtime(7)<0
trigger4 = facing!=enemy,facing && animelemtime(8)>=0 && animelemtime(9)<0

[State 0, Turn]
type = Turn
triggerall = enemy,anim=1012
trigger1 = facing=enemy,facing && animelemtime(2)>=0 && animelemtime(3)<0
trigger2 = facing=enemy,facing && animelemtime(4)>=0 && animelemtime(5)<0
trigger3 = facing=enemy,facing && animelemtime(6)>=0 && animelemtime(7)<0
[State 0, Turn]
type = Turn
trigger1 = facing=enemy,facing && animelemtime(9)>=0 && animelemtime(10)<0&&enemy,anim=1002
trigger2 = facing!=enemy,facing && animelemtime(7)>=0 && animelemtime(8)<0&&enemy,anim=1012
trigger3 = facing=enemy,facing && animelemtime(8)>=0 && animelemtime(9)<0&&enemy,anim=1012
[State 0, Turn]
type = Turn
triggerall = enemy,anim=1002
trigger1 = facing=enemy,facing && animelemtime(1)>=0 && animelemtime(2)<0
trigger2 = facing=enemy,facing && animelemtime(3)>=0 && animelemtime(4)<0
trigger3 = facing=enemy,facing &&animelemtime(5)>=0 && animelemtime(6)<0
trigger4 = facing=enemy,facing && animelemtime(7)>=0 && animelemtime(8)<0
[State 0, Turn]
type = Turn
triggerall = enemy,anim=1012
trigger1 = facing!=enemy,facing && animelemtime(1)>=0 && animelemtime(2)<0
trigger2 = facing!=enemy,facing && animelemtime(3)>=0 && animelemtime(4)<0
trigger3 = facing!=enemy,facing &&animelemtime(5)>=0 && animelemtime(6)<0
;ignorehitpause = 
;persistent = 

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = time=0
value = 1003+((p2statetype=A)*10)
;---------------------------------------------------------------------------
; Opponent 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 10001]
type    = A
movetype= H
physics = N
poweradd = 56

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time=0 && (prevstateno!=[800,899])&& prevstateno!=[1000,1049]
value = 1202

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = prevstateno=842 && time=0
value = 831
elem = 6
;elem = 1
;ignorehitpause = 
;persistent = 
[State 0, HitVelSet]
type = VelSet
trigger1 = time=0&& prevstateno=[800,899]
x = -3
y = -12
[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0&& prevstateno!=[800,899]
x = 1
y = 1
;ignorehitpause = 
;persistent =

;ignorehitpause =
;persistent =
[State 0, PosAdd]
type = PosAdd
trigger1 =time = 0 && prevstateno=[800,899]
y = -15


[State 0, VelAdd]
type = VelAdd
trigger1 =1
y = .86
[State 0, NotHitBy]
type = NotHitBy
trigger1 = statetype!=L &&p2stateno!=[3000,3100]

value = SCA
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =


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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =anim=5100|| anim=614|anim=612
statetype = L      ;S,A,C,L

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = selfanimexist(5100)
trigger1 = ((pos y>=-10 && anim=[1000,1202]) ||pos y>=15 && anim=[800,899]) && time>3
value = 5100
[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = !selfanimexist(5100)
trigger1 = pos y>=0 &&((pos y>=-10 &&anim=[1000,1202])||pos y>=15 && anim=[800,899]) && time>3
value = 614
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=614&& animtime=0
value = 612
[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = pos y>=0 && anim=5100 && animtime=0
value = 612

[State 0, PosSet]
type = PosSet
trigger1 =anim=5100 || anim=612 ||anim=614
y = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = anim=5100 || anim=612||anim=614
x = 0
y = 0
;ignorehitpause =
;persistent =

;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = selfState
triggerall = p2stateno!=3000 && (p2stateno!=1001&&enemy,prevstateno!=1001)&&p2stateno!=1003
triggerall = alive
triggerall = anim=612 && animelemtime(1)>1
trigger1 = command="x"||command="y"||command="z"||command="a"||command="b"||command="c"
trigger2= AIlevel >0 && random<249
value =5120
ctrl = 0
;anim =
;ignorehitpause = 
;persistent = 


[State 0, SelfState]
type = SelfState
trigger1 =animelemtime(1)=ifelse((prevstateno=[800,899]),5,17) && anim=612
value =ifelse(alive,5120,5110)
ctrl=0
;==============
;[CANNON SPIKE]
;==============
[Statedef 1050]
type    = U
movetype= A
physics = N
juggle  =0; 1

ctrl = 0

poweradd = 20
sprpriority = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =1050

[State 0, Explod]
type = Explod
triggerall = statetype!=A
trigger1 = animelem = 1
anim =8000
ID =8002
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause =1
[State 0, VelSet]
type = VelSet
trigger1 = prevstateno!=9000 &&time=0
x = 0
y = 0
;ignorehitpause = 
;persistent = 

[State 0, Explod]
type = Explod
trigger1 = movehit && p2movetype=H
anim =5334
ID=1050
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
persistent=0
ignorehitpause=1
[State 0, VarSet]
type = VarSet
triggerall = AILevel=0&& prevstateno!=9000
trigger1 = time=0
v = 2  ;fv = 10
value = ifelse(command = "QCF_a",1,2)

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
trigger1= time=0  
v = 2  ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
triggerall = AILevel>0
triggerall = time=0 
trigger1 =p2bodydist y <-30 && statetype!=A
trigger2= p2bodydist y >15 && statetype=A 
v = 2  ;fv = 10
value = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = (var(2)=2|| statetype=A) && time=0  && prevstateno!=9000
value = 1051
[State 2200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S2,1
volume = 255
channel=0

[State 2200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S0,2
volume = 255
channel = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3&& anim=1051 && statetype!=A
statetype = A       ;S,A,C,L

[State 0, VelSet]
type = VelSet
trigger1 = animelem=3
trigger2 = prevstateno = 9000 && animelemtime(5)<0
x =10

[State 0, VelSet]
type = VelSet
trigger1 = animelem=3&& anim!=1050 && var(2)=2
trigger2 = prevstateno = 9000 && animelemtime(5)<0 && anim!=1050 && var(2)=2
y = ifelse(var(6),10,-10)

[State 0, VelSet]
type = VelSet
trigger1 = anim=1050
trigger2= pos y>=0 && animelemtime(3)>=0 && anim=1051 &&var(6) 
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = anim=1050
trigger2= pos y>=0 && animelemtime(3)>=0 && anim=1051 &&var(6) 
y = 0
;ignorehitpause = 
;persistent = 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y>=0 && animelemtime(5)>=0 && anim=1051&&var(6) 
trigger2= movecontact && statetype!=A && animelemtime(5)<0
value = 1050
elem = 5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=1051 && movecontact && pos y <-10 && animelemtime(5)<0
value = 1051
elem = 5

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)>0 && statetype=A
y = .315
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=5  && statetype=A
x = 1.5
y=0
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1=pos y>=0 && animelemtime(4)>=5 && anim=1051&&var(6)        ;A,C,S,N
statetype=S
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5 && statetype!=A
physics = S         ;A,C,S,N
statetype=S
;ignorehitpause = 
;persistent = 


[State 2200, Hitdef]
type = HitDef
triggerall = numexplod(1050)=0
Trigger1 = time = 0
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = up
air.animtype = up
damage    = 177
guardflag = MA
pausetime = 18,18
sparkno = S7005+(random%4)
guard.sparkno = S7009
hitsound = S1, 1
guardsound = S3, 1
sparkxy = -10,-50
ground.type = high
ground.hittime  = 30
air.hittime = 30
ground.velocity = -10,-22
air.velocity = -10,-22
down.velocity=-9,-4
yaccel = .9
givepower=22,14
getpower=35,35
id=1050
nochainid=1050
ground.cornerpush.veloff=0
forcenofall=1
envshake.freq = 90
envshake.ampl = 4
envshake.phase = 20
envshake.time = 16

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=5
movetype = I        ;I,A,H


[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A) && movehit=1 && (p2stateno!=[201,203])
value =201
ID =1050
ignorehitpause =0 
[State 2200, ChangeState]
type = ChangeState
trigger1 =animtime=0 &&statetype!=A
trigger2 =pos y>=-5 &&statetype=A && animelemtime(5)>2
value =0
ctrl = 1



;===============================[HYPER ATTACKS]==============================;
;[TORPEDO]
;====================
[Statedef 3000]
type    = U
movetype= A
physics =N
juggle  =0; 1
poweradd =0
velset = 0,0
ctrl = 0
sprpriority = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =3000
[State 3000, Super A]
type = SuperPause
trigger1 = animelem=2 && anim=3000
poweradd = -1000
anim = -1
time = 48
movetime=48
sound=S3001,0
p2defmul=1
unhittable=1
darken=0


[State 2100, PlaySnd]
type = PlaySnd
triggerall = animelem=3 && anim=3000
trigger1 = anim=3000
value = S3,3
channel=0


;endcmdbuftime = 0
;pausebg = 1
;ignorehitpause = 
;persistent = 


[State 0, Explod]
type = Explod
trigger1 =animelemtime(2) = 4 && statetype!=A && anim=3000
anim =8000
ID =8002
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
supermovetime = 4
pausemovetime  = 4

[State 3000, Hyperbg]
type = Explod
trigger1 = animelem=2 && anim=3000
anim = 6004
ID = 6001
pos = -2,-19
postype = p1
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime = 90
pausemovetime  = 90
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
supermovetime = 90
pausemovetime  = 90

[State 3000, Hyperbg]
type = Explod
trigger1 = animelem=3
anim = 6005
ID = 6001
pos = 0,0
postype = left
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime =-1
supermovetime = 90
pausemovetime  = 90
scale = .5,ifelse(GameHeight = 180,.4,.5)
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1



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



[State 3000, helper]
type = Helper
trigger1 = animelem=2 && anim=3000
pos = 0,-240
postype = back
id = 4000
name = "Hyperportrait"
stateno = 4001
ownpal = 1
size.xscale = 1
size.yscale = 1.25
supermovetime = 90
pausemovetime  = 90


[State 0, VelSet]
type = VelSet
triggerall = anim=3000
trigger1 =animelem=3 
y =-9.5


[State 3000, Hitdef]
type = HitDef
trigger1 = animelemtime(4)>=0 && animelemtime(32)<0 && !movecontact
attr = A,HA
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = hard
damage    = 71,14
guardflag = MA
pausetime = 12,12
sparkno = S7005+(random%4)
guard.sparkno = S7009
hitsound = S1, 2
guardsound = S3, 1
sparkxy = -10,-30
ground.type = high
getpower=0
givepower=10,5
ground.hittime  =30
air.hittime = 30
ground.velocity = -2,12
air.velocity = -4,12
down.velocity=-5,-4
yaccel = .9
id=3000
nochainid=3000
forcenofall=1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim=3000
triggerall = animelemtime(11)>=0 && !var(6) ||animelemtime(6)>=0 && var(6)
trigger1 = animelemtime(32)<0 && command="holddown" && (command="a"|| command="b"|| command="c"|| command="x"|| command="y"|| command="z")
value = 3000
elem = 32
;ignorehitpause = 
;persistent = 
[State 2100, PlaySnd]
type = PlaySnd
triggerall = animelem=32 && anim=3000
trigger1 = anim=3000
value = S2,4
channel=0
[State 0, MoveHitReset]
type = MoveHitReset
trigger1 = animelem=32
;ignorehitpause = 
;persistent = 

[State 3000, Hitdef]
type = HitDef
trigger1 = animelemtime(32)>=0  && !movecontact
attr = A,HA
hitflag = MAFD
guardflag = MA
animtype = hard
air.animtype = hard
damage    =284,35
guardflag = MA
pausetime = 18,18
getpower=0
givepower=10,5
sparkno = S7005+(random%4)
guard.sparkno = S7009
hitsound = S1, 2
guardsound = S3, 1
sparkxy = -10,-30
ground.type = high
ground.hittime  =30
air.hittime = 30
ground.velocity = -2,18
air.velocity = -4,18
down.velocity=-5,-4
yaccel = .9
id=3001
nochainid=3001
forcenofall=1




[State 0, PlaySnd]
type = PlaySnd
trigger1 =animelem=6
value = S0,4
volume = 255
ignorehitpause = 1
persistent = 0


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

;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=32
x =14
y = 19



;ignorehitpause = 
;persistent = 


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >=-5 && animelemtime(32)>0 &&anim!=3002
value = 3002
[State 0, AssertSpecial]
type = AssertSpecial
trigger1=anim!=3002 && animelemtime(2)>=0
flag = noFG
flag2=nobg
ignorehitpause=1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 =anim=3002
statetype = S      ;S,A,C,L
movetype = I 
[State 0, PosSet]
type = PosSet
trigger1 = anim=3002
y = 0
;ignorehitpause = 
;persistent = 
[State 0, VelSet]
type = VelSet
trigger1 = anim=3002
x = 0
y = 0


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=3002
;trigger3= 
movetype = I        ;I,A,H
;ignorehitpause = 
;persistent = 

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =anim=3002
id =6001
[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A) && movehit=1 && (p2stateno!=10001)
value =10001
ID =3000
ignorehitpause =0 
[State 0, TargetState]
type = TargetState
trigger1 =(p2statetype= A) && movehit=1 && (p2stateno!=10001)
value =10001
ID =3001
ignorehitpause =0 
[State 3304, EnvShake]
type = EnvShake
Trigger1 = animelem=1 && anim=3002
freq = 90
ampl = 8
phase = 20
time = 10
persistent=0
[State 2200, ChangeState]
type = ChangeState
trigger1 =animtime=0 && anim=3002
value =0
ctrl = 1
;=============================================================================
;=============================================================================
;=============================================================================
;[ARMOR UP]
;====================
[Statedef 3050]
type    = S
movetype= A
physics = S
juggle  =0; 1
poweradd =0
velset = 0,0
ctrl = 0
sprpriority = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =3050
[State 3000, Super A]
type = SuperPause
trigger1 = animelemtime(1)=3&& prevstateno!=9000
poweradd = -1000
anim = -1
time = 48
movetime=48
p2defmul=1
unhittable=1
darken=0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =animelemtime(4)<0
flag = noFG
flag2=nobg
ignorehitpause=1

;endcmdbuftime = 0
;pausebg = 1
;ignorehitpause = 
;persistent = 

[State 2100, PlaySnd]
type = PlaySnd
triggerall = animelem=3&& prevstateno!=9000
trigger1 = anim=3050
value = S2,2
channel=0
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =3&& prevstateno!=9000
value = S3001,0
[State 0, Explod]
type = Explod
trigger1 =animelemtime(1)=8&& prevstateno!=9000
anim =8000
ID =8002
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
supermovetime = 88
pausemovetime  = 88


[State 3000, Hyperbg]
type = Explod
trigger1 =animelemtime(1)=3&& prevstateno!=9000
anim = 6004
ID = 6001
pos = -2,-19
postype = p1
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime = 90
pausemovetime  = 90
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
supermovetime = 90
pausemovetime  = 90

[State 3000, Hyperbg]
type = Explod
trigger1 = time = 49
anim = 6005
ID = 6001
pos = 0,0
postype = left
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime =-1
supermovetime = 90
pausemovetime  = 90
scale = .5,ifelse(GameHeight = 180,.4,.5)
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause=1

[State 3000, helper]
type = Helper
trigger1 = time = 3 && prevstateno!=9000
pos = 0,-240
postype = back
id = 4000
name = "Hyperportrait"
stateno = 4001
ownpal = 1
size.xscale = 1
size.yscale = 1.25
supermovetime = 90
pausemovetime  = 90
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=4 
id =6001
[State 3000, helper]
type = Helper
trigger1 = time = 48&& prevstateno!=9000
pos = 0,-240
postype = back
id = 4001
name = "activate"
stateno = 4000
ownpal = 1
size.xscale = 1
size.yscale = 1.25
supermovetime = 0
pausemovetime  = 0

[State 0, ChangeAnim]
type = Changestate
trigger1 = animtime=0 
value = 0
ctrl=1
;=============================================================================
;====================
[Statedef 3051]
type    = U
movetype= A
physics = N
juggle  =0; 1
poweradd =0
velset = 0,0
ctrl = 0
sprpriority = 2
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0 && prevstateno!=9000
value =3100+((statetype=A)*4)
[State 3000, Super A]
type = SuperPause
trigger1 = animelemtime(1)=2
poweradd = -1000
anim = -1
time = 48
movetime=48
p2defmul=1
unhittable=1
darken=0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =animelemtime(1)>=2 && animelemtime(43)<0
flag = noFG
flag2=nobg
ignorehitpause=1

;endcmdbuftime = 0
;pausebg = 1
;ignorehitpause = 
;persistent = 

[State 2100, PlaySnd]
type = PlaySnd
trigger1 = animelem=4 && time >0
value = S2,7
channel=0
persistent=0

[State 3304, EnvShake]
type = EnvShake
Trigger1 = animelem=4
freq = 90
ampl = 4
phase = 20
time = 100
persistent=0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(1)=2
value = S3001,0
[State 0, Explod]
type = Explod
trigger1 =animelemtime(1)=8 && statetype!=A
anim =8000
ID =8002
pos = 1,-11
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
supermovetime = 88
pausemovetime  = 88


[State 3000, Hyperbg]
type = Explod
trigger1 =animelemtime(1)=3
anim = 6004
ID = 6001
pos = -2,-19
postype = p1
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
supermovetime = 90
pausemovetime  = 90
scale = 1,ifelse(GameHeight = 180,.75,1)
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
supermovetime = 90
pausemovetime  = 90

[State 3000, Hyperbg]
type = Explod
trigger1 = time = 49
anim = 6005
ID = 6001
pos = 0,0
postype = left
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime =-1
supermovetime = 90
pausemovetime  = 90
scale = .5,ifelse(GameHeight = 180,.4,.5)
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause=1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(43)>0 && (p2stateno=10001 || p2statetype=L) && anim=3100
trigger2 = animelemtime(5)>0 &&(p2stateno=10001 || p2statetype=L)  && anim=3104
value = 0
movecamera = 0,0
;ignorehitpause = 
;persistent = 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =animelem=43 && anim=3100
trigger2 =time=129 && anim=3104
id =6001
[State 3000, helper]
type = Helper
trigger1 = animelemtime(1) = 3
pos = 0,-240
postype = back
id = 4000
name = "Hyperportrait"
stateno = 4001
ownpal = 1
size.xscale = 1
size.yscale = 1.25
supermovetime = 90
pausemovetime  = 90
[State 3000, helper]
type = Helper
trigger1 = animelemtime(1) = 3&& numhelper(3001)=0
pos = 10,-69
postype = p1
id = 3001
name = "activate"
stateno = 3001
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)
supermovetime = 99
pausemovetime  = 99





[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)>0 && statetype=A
y = .315
;ignorehitpause = 
;persistent = 

[State 0, VelSet]
type = VelSet
trigger1 = animelem=5  && statetype=A
x = 1.5
y=0
[State 1051, 3] ;Change state when KFM is close to ground
type = Changestate
trigger1 = p2statetype=L && p2stateno=10001 && anim=3104
value=101
[State 1051, 3] ;Change state when KFM is close to ground
type = Changestate
trigger1 = pos y >=0 && anim=3104 && animelemtime(5)>0
value=0
ctrl=1
[State 1051, 3] ;Change state when KFM is close to ground
type = Changestate
trigger1 = animtime=0 && anim=3100
value = ifelse(backedgebodydist <0,101, 0)
ctrl=ifelse(backedgebodydist <0,0, 1)

;---------------------------------------------------------------------------
[Statedef 9000]
type = U
movetype = H
physics = U

;ignorehitpause =
;persistent =



[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, CtrlSet]
type = CtrlSet
triggerall = prevstateno!=20
trigger1 = (floor(gethitvar(hittime) * 0.8)<time ) || !alive
value = 1



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

[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 = ifelse(statetype=A,5020,5000)
ctrl=0


[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 <3
value = SCA
;value2 = S,NA
time = 1
[State 0, VelSet]
type = VelSet
triggerall = Alive
triggerall = fvar(11)!=0
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
y = fvar(11)
[State 0, ChangeState]
type = ChangeState
triggerall = Alive
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
trigger1 = pos y >0 && stateno=[1050,1051]
value =52
[State 9000, End]
type = ChangeState
triggerall = Alive
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
value = var(46)
ctrl = ifelse(stateno<=105,1,0)


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

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =p2movetype!=H 
id = 1050
;ignorehitpause = 
;persistent = 

[State 0, Width]
type = Width
trigger1 = stateno=20
edge = 38,0
;value = 0,0
;ignorehitpause = 
;persistent = 
[State 0, TargetState]
type = TargetState
trigger1 =movehit && p2stateno!=212&&enemy,hitshakeover
value =212
ID = 205
ignorehitpause=1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = p2movetype!=H
id = 1001
;ignorehitpause = 
;persistent = 

[State 0, TargetState]
type = TargetState
triggerall = numtarget(1000)
trigger1 =(p2statetype= A) && movehit=1 && (p2stateno!=[201,203])
value =201
ID =1000
ignorehitpause =1 
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 =  1
text = " fvar1= %d  pos x = %d explod= %f facing=%f"
params  =numexplod(6001),(var(13)),p2bodydist y,(p2bodydist x)
ignorehitpause=1
[State 0, VarSet]
type = VarSet
trigger1 =p2movetype!=H 
v =35   ;fv = 10
value = 0
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = numhelper(6000)
flag = nokoslow
[State 0, TargetState]
type = TargetState
trigger1 =movehit &&p2statetype=A && p2stateno!=211 
value =211
ID = 641
ignorehitpause=1
[State 0, TargetState]
type = TargetState
trigger1 =movehit &&p2statetype=A && p2stateno!=10613  
value =10613
ID = 640
ignorehitpause=0
[State 0, TargetState]
type = TargetState
trigger1 =movehit&&enemy,stateno!=441
value = 441
ID = 440
ignorehitpause =0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =statetype!=A 
id = 56
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =p2movetype!=H
id = 635
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =p2movetype!=H
id = 630
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =p2movetype!=H
id = 605
;ignorehitpause = 
;persistent = 
[State 0, VarSet]
type = VarSet
trigger1 = statetype=A && time<2 && stateno=1050
trigger2 = statetype=A && time<2 && stateno=3000
v = 6    ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = stateno!=1050
trigger1 = stateno!=3000
v = 6    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 =  p2stateno=411
v = 9   ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
trigger1 = p2movetype!=H || p2statetype=L && p2stateno=10613
v =9   ;fv = 10
value = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = enemynear,movetype=H
triggerall = enemynear,anim!=5160
trigger1 =enemynear,pos y>=0 && enemynear,anim=1202 && enemynear,time>3
trigger2 = enemynear,stateno=1030 && enemynear,time=1
value = S15,0





;ignorehitpause =
;persistent =
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = stateno !=360
id =  7011
;ignorehitpause =
;persistent =




[State -2, Helper]
type = Helper
trigger1 = winko && (stateno = [3000,3100]) &&movehit
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
persistent=0



[State 0, VarSet]
type = VarSet
trigger1 = authorname= "Kamekaze" && p1name = "MVC2 Colossus"
v = 50    ;fv = 10
value = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
time = 1
value = fvar(2)
ignorehitpause = 1
persistent = 1

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H
triggerall = enemy,gethitvar(hitcount) >2
triggerall = fvar(2)>.024
trigger1 =1
fv =2 ;fv = 10
value = 1-((enemy,gethitvar(hitcount)) *.033 )

[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype = H
triggerall = fvar(2)<=.024
trigger1 =1
fv =2 ;fv = 10
value = .024
ignorehitpause=1
[State 0, VarSet]
type = VarSet
triggerall = enemy,movetype != H || (p2stateno=[120,155])
trigger1 =1
fv =2 ;fv = 10
value = 1
[State 0, VarSet]
type = VarSet
triggerall = movehit && (!var(9))
triggerall=p2movetype =H  && ((p2stateno != [120,199])||(enemy,prevstateno!=[120,199]))
trigger1 = 1
v = 12  ;fv = 10
value = enemy,gethitvar(hitcount)
ignorehitpause=1

[State 0, VarSet]
type = VarSet
triggerall = (enemy,gethitvar(hitcount) > 2)
triggerall = movehit
trigger1 = statetype = A && (var(9))
v = 12  ;fv = 10
value = 999

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype != H || p2stateno=10613  ||((p2stateno = [120,199])||(enemy,prevstateno=[120,199]))
trigger2 = lose||winko
v = 12    ;fv = 10
value = 0
ignorehitpause=1
persistent=1


[State 0, VarSet]
type = VarSet
trigger1 =life <= 300
v = 14   ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 =life > 300
v = 14   ;fv = 10
value = 0


 [State 0, VarSet]
type = VarSet
trigger1 = statetype= A
trigger2=(p2stateno=821||p2stateno=841||p2stateno=821||p2stateno=1001||p2stateno=1203)
v=30
value = 0

[State 0, VarSet]
type = VarSet
triggerall = statetype != A
triggerall = ctrl
triggerall = random <29
trigger1= enemy,hitdefattr=SC,AT
trigger2= p2stateno=5120 || p2stateno=5110&& enemy,time >2
v = 30   ;fv = 10
value = 1

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

[State 0, VarSet]
type = VarSet
trigger1 = movecontact && (!moveguarded)
v = 10   ;fv = 10
value = 0

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

[State 0, VarSet]
type = VarSet
trigger1 = enemy,movecontact && (!enemy,moveguarded)
v = 11  ;fv = 10
value = 0

[State 0, Helper]
type = Helper
triggerall = roundno = 1
trigger1 = numhelper(3004) < 1 && var(10) = 0 && var(11) = 1
helpertype = normal ;player
name ="FA"
ID = 3004
stateno = 3010
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = numhelper(3006) < 1 && var(14) = 1
helpertype = normal ;player
name ="danger"
ID = 3006
stateno = 3012
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing =1
keyctrl = 0
ownpal = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = enemynear,anim!=5160
triggerall = enemynear,movetype=H
trigger1 =enemynear,pos y>=0 && enemynear,anim=1202 && enemynear,time>3
trigger2 = enemynear,stateno=1030 && enemynear,time=1
trigger3 =enemynear,pos y>=0 && enemynear,anim=841 && enemynear,time>3
trigger4 =enemynear,pos y>=0 && enemynear,anim=1120 && enemynear,time>3
trigger5 =enemynear,pos y>=0 && enemynear,anim=1121 && enemynear,time>3
;trigger6 =enemynear,pos y>=0 && enemynear,anim=821 && enemynear,time>3 && p2stateno=821
trigger6= enemynear,anim=612 && enemynear,animelemtime(1)=1&& p2stateno=10001
value = S15,0
[State 3304, EnvShake]
type = EnvShake
triggerall = enemynear,anim!=5160
triggerall = enemynear,movetype=H
trigger1 =enemynear,pos y>=0 && enemynear,anim=1202 && enemynear,time>3
trigger2 = enemynear,stateno=1030 && enemynear,time=1
trigger3 =enemynear,pos y>=0 && enemynear,anim=841 && enemynear,time>3
trigger4 =enemynear,pos y>=0 && enemynear,anim=1120 && enemynear,time>3
trigger5 =enemynear,pos y>=0 && enemynear,anim=1121 && enemynear,time>3
;trigger6 =enemynear,pos y>=0 && enemynear,anim=821 && enemynear,time>3 && p2stateno=821
trigger6= enemynear,anim=612 && enemynear,animelemtime(1)=1 && p2stateno=10001
freq = 90
ampl = 4
phase = 20
time = 10
[State 0, Explod]
type = Explod
triggerall = enemynear,movetype=H
triggerall = enemynear,anim!=5160
trigger1 =enemynear,pos y>=0 && enemynear,anim=1202 && enemynear,time>3
trigger2 = enemynear,stateno=1030 && enemynear,time=1
trigger3=  enemynear,anim=612 && enemynear,animelemtime(1)=1&& p2stateno=10001
;trigger =enemynear,pos y>=0 && enemynear,anim=821 && enemynear,time>3 && p2stateno=821
anim =6006
ID =8002
pos = 0,0
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 2
vel = 0,0
accel = 0,0
random = 0,0
scale = 1,1
sprpriority = 2
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause =1


[State 0, Helper]
type = Helper
triggerall=(p2stateno!=[120,155])
triggerall = var(12)>1
trigger1 = numhelper(3005) < 1 &&(enemy,gethitvar(hitcount) >2)
helpertype = normal ;player
name ="combo"
ID = 3005
stateno = 3011
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing =1
keyctrl = 0
ownpal = 0

[State -3, Wall Hit Sound]
type = PlaySnd
triggerall = enemynear,movetype=H
triggerall = !NumExplod(9050)
trigger1 = ((enemy, stateno = 1027) && (enemy,time = 1));&& Enemy, frontEdgeDist < 25
value = S1,3
volume = 255
ignorehitpause = 1
persistent = 0

[State -3, Wall Hit Spark]
type = Explod
triggerall = enemynear,movetype=H
triggerall = !NumExplod(9050)
trigger1 = ((enemy, stateno = 1027) && (enemy,time = 1));&& Enemy, frontEdgeDist < 25
anim = 6000
ID = 9050
pos = -20, -60
postype = p2
bindtime = 1
facing = -1
removetime = -2
scale = 0.5, 0.5
sprpriority = 4
ownpal = 1
ignorehitpause = 1
persistent = 0

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

[Statedef -3]




;[State 0, PalFX]
;type = PalFX
;triggerall =numhelper(4001)=0
;trigger1 = gametime%150=0
;time = 11
;add = 150,150,150
;mul = 256,256,256
;sinadd =25,25,25,20
;invertall = 0
;color = 256

[State 0, VarSet]
type = VarSet
trigger1 = stateno!=9000 && gametime%80=0 && movetype!=H
v = 13   ;fv = 10
value = 0
;ignorehitpause =
;persistent =
[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 = 33    ;fv = 10
value = animelemno(0)
ignorehitpause = 1


[State 0, PalFXWiz]
type = PalFX
trigger1= numhelper(4001)=1
trigger1= helper(4001),var(0)=1
trigger1= gametime%60=0
time = 60
add = -50,-50,-50
mul = 256,256,256
sinadd =150,150,150,120
invertall = 0
color = 256

[State -3]
type = HitOverride
trigger1= numhelper(4001)=1
trigger1= helper(4001),var(0)=1
triggerall =Statetype!= L
triggerall = Anim != 5300

triggerall = StateNo != [120,159]
;triggerall = gethitvar(animtype)<3
;trigger1 = PrevStateNo != 9000
time = 2
slot = 7
attr = SCA,SA,SP,HP,HA, NA, NP, SP
stateno = 9000

[State -3, Landing Dust]
type = Explod
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
anim = 48
ID = 48
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
scale = 1,1
ownpal = 1
sprpriority = 3
removeongethit = 0

[State -2: Helper]
type = Helper
triggerall = numhelper(10000) < 1
trigger1 = roundstate!=2
helpertype = Normal
name = "choice"
id = 10000
pos = 0,0
postype = p1
facing = 0
stateno = 10000
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 99999
ignorehitpause = 1


[State -3, Wall Hit Sound]
type = PlaySnd
triggerall = enemynear,movetype=H
triggerall = !NumExplod(9049)
triggerall =  Enemy, BackEdgeDist < 5
trigger1 = ((enemy, stateno = 5030) && (time = 1))
trigger2 = ((enemy, stateno = 5050) && (time = 1))
trigger3 = (enemy, stateno = 5020)
trigger4=enemy,anim=1106
trigger5=enemy,anim=5061

value = S1,3
volume = 255
ignorehitpause = 1
persistent = 0

[State -3, Wall Hit Spark]
type = Explod
triggerall = enemynear,movetype=H
triggerall = !NumExplod(9049)
triggerall =  Enemy, BackEdgeDist < 5
trigger1 = ((enemy, stateno = 5030) && (time = 1))
trigger2 = ((enemy, stateno = 5050) && (time = 1))
trigger3 = (enemy, stateno = 5020)
trigger4=enemy,anim=1106
trigger5=enemy,anim=5061

anim = 6000
ID = 9049
pos = -20, -60
postype = p2
bindtime = 1
facing = -1
removetime = -2
scale = 0.5, 0.5
sprpriority = 4
ownpal = 1
ignorehitpause = 1
persistent = 0





[State -2, RemoveExplod]    ;remove hyper bg
type = RemoveExplod
trigger1 = (stateno != 3000 && time >= 0)
trigger1 = stateno !=3100 && time >= 0
trigger1 = stateno !=3050 && time >= 0
trigger1 = stateno !=3051 && time >= 0
trigger1 = stateno !=9000 && time >= 0
trigger2 = Winko
id = 6001

;[State 0, StopSnd]
;type = StopSnd
;trigger1 = movetype = H && time = 0
;channel = -1



[State -2, RemoveExplod]    ;remove hyper bg
type = RemoveExplod
trigger1 = stateno != 100 && time >= 0
trigger1 = stateno != 101 && time >= 0
id = 7000

[State -2, RemoveExplod]    ;remove hyper bg
type = RemoveExplod
trigger1 = stateno != 105 && time >= 0
id = 7001



[State -3, VarRandom]
type = VarRandom
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5030
trigger5 = stateno = 5050
trigger6 = stateno = 5070
trigger7 = stateno = 5080
v = 0
range = 0,60
;--------------------
[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [0,20]
trigger1 = Stateno = 5000
trigger2 = Stateno = 5010
value = 5000, 0
channel=0
[State -3, Hit1]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [21,30]
trigger1 = Stateno = 5000
trigger2 = Stateno = 5010
value = 5000, 1
channel=0
;----------------------
[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [31,40]
trigger1 = stateno = 5020
trigger2 = stateno = 5030
trigger3 = stateno = 5050
value = 5000, 1
channel=0
[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [41,50]
trigger1 = stateno = 5070
trigger2 = stateno = 5080
value = 5000, 0
channel=0
[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [51,60]
trigger1 = stateno = 5070
trigger2 = stateno = 5080
value = 5000, 1
channel=0
;----------------------

[State -2, RemoveExplod]    ;remove hyper bg
type = RemoveExplod
trigger1 = stateno!=3000
trigger1 = stateno!=3100
id = 6005


[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

