;===========================================================================
;===========================================================================
;BasicsStateFile
;===========================================================================
;===========================================================================
;VAR
;1=Used
;2=HiJump
;3=AirDash
;4=0
;5=Walking
;6=Transformation
;13=kiblast combo limit (statedef 1300)
;20 charge attacks
; FVARS
; 10-13=DAMAGE DAMPNER
;30-40 = Cell jr's
;SoundChannelsinuse:

;1=AttackFX
;2=Voice
;3=Walk
;4=Powerup

;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
anim = 180 + Var(6)
velset = 0,0

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

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

[State 0, 0]
type = ChangeState
Triggerall = !MatchOver = 1
trigger1 = !Time
value = Ifelse (random < 500, 181, 182)

[State 0, 0]
type = ChangeState
trigger1 = MatchOver = 1
value = 182

;---------------------------------------------------------------------------
; Win pose 1 (flying into sky)
[Statedef 181]
type = S
ctrl = 0
anim = 180 + Var(6)
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 280
flag = RoundNotOver
ignorehitpause = 1
persistent = 1

[State 0: VelSet]
type                    = VelSet
trigger1                = AnimElem = 4
y                       = -.5

[State 0: VelSet]
type                    = VelSet
trigger1                = AnimElem = 5
y                       = 0

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



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

[State 0:       GroundWaves]
type                    = Explod
trigger1                = AnimElem = 4
anim                    = 7025
ID                      = 7011
pos                     = 0,5
removetime              = -1
sprpriority             = -999
ownpal                  = 1
removeongethit          = 1


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

;---------------------------------------------------------------------------
; Win pose 2 - Hahaha
[Statedef 182]
type = S
ctrl = 0
anim = 181 + Var(6)
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 160
flag = RoundNotOver
ignorehitpause = 1
persistent = 1

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

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



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

;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 0, ]
type = ChangeState
trigger1 = !time
value = Ifelse (random<500, 191, 193)
;---------------------------------------------------------------------------
; PREINTRO - Intro 1 WAITING
[Statedef 191]
type = S
movetype = I
physics = N
anim = 191 + Var(6)
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 0
facep2 = 0
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority = 1
;---------------

[State 0, Intro]
type = AssertSpecial
trigger1 = (1)
flag = Intro
ignorehitpause = 1

[State 0, ]
type = ChangeState
trigger1 = ID < Enemy,ID
value = 192

[State 0, ]
type = ChangeState
trigger1 = Enemy, stateno = 0
value = 192

;---------------------------------------------------------------------------
; Intro teleport fly down
[Statedef 192]
type = A
movetype = I
physics = N
anim = 192 + Var(6)
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 0
facep2 = 0
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority = 1

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

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

[State 193, bound]
type = screenbound
trigger1 = anim = 192 && animelemtime(2) < 0
value = 1
movecamera = 1, 0

[State 193, Pos]
type = posset
trigger1 = !time
y = -120

[State 0: Explod]
type                    = Explod
trigger1                =  anim = 192 && AnimElem = 2
anim                    = 193
pos                     = -40,0
postype                 = p1
vel                     = 4,0
ownpal                  = 1

[State 0: Explod]
type                    = Explod
trigger1                =  anim = 192 && AnimElem = 2
anim                    = 193
pos                     = 40,0
postype                 = p1
vel                     = -4,0
ownpal                  = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 =  anim = 192 && animelemtime(1) = 50
value = S205,0
channel = 1


[State 193, fadein]
type = trans
trigger1 = anim = 192 && animelemtime(2) = [0, 10]
trans = addalpha
alpha = 25 * (animelemtime(2)), ceil(256 -25 * (animelemtime(2)))

[State 193, Vel]
type = veladd
trigger1 = anim = 192 && animelemtime(2) >= 10 && time >= 100 && vel y < 5
y = 0.025


[State 193, Anim]
type = changeanim
trigger1 = anim = 192 && animelemtime(2) >= 10 && pos y >= 0
value = 194
;elem = 3
persistent = 0

[State 193, Stop]
type = posset
trigger1 = anim = 194
y = 0

[State 193, Stop]
type = velset
trigger1 = anim = 194
y = 0

[State 0, Sigh,I'll do it]
type = PlaySnd
trigger1 = anim = 192 && animelemtime(2) = 2
value = S190,4
channel = 2

[State 0, Land]
type = PlaySnd
trigger1 = pos y >= 0
value = S52,0
channel = 1
persistent = 0


[State 0, ]
type = Explod
trigger1 = pos y >= 0
anim = 8100
ID = 8100
pos = -45,0
facing = 1
scale = .5,.5
postype = p1
sprpriority = 5
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, ]
type = Explod
trigger1 = pos y >= 0
anim = 8100
ID = 8100
pos = 45,0
facing = -1
scale = .6,.6
postype = p1
sprpriority = 5
ownpal = 1
ignorehitpause = 1
persistent = 0


 
[State 0, End]
type = ChangeState
trigger1 = anim = 194 && !animtime
value = 0
ctrl = 1

;--------------------------------------------------------------------------
; PREINTRO - Intro 1 WAITING
[Statedef 193]
type = S
movetype = I
physics = N
anim = 195 + Var(6)
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 0
facep2 = 0
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority = 1
;---------------

[State 0, Intro]
type = AssertSpecial
trigger1 = (1)
flag = Intro
ignorehitpause = 1

[State 0, ]
type = ChangeState
trigger1 = ID < Enemy,ID
value = 194

[State 0, ]
type = ChangeState
trigger1 = Enemy, stateno = 0
value = 194

;---------------------------------------------------------------------------
;Waking cell up
[Statedef 194]
type = S
movetype = I
physics = N
anim = 196 + Var(6)
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 0
facep2 = 0
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority = 1
;---------------

[State 0, Intro]
type = AssertSpecial
trigger1 = (1)
flag = Intro
ignorehitpause = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S190,6
channel = 1


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



;---------------------------------------------------------------------------
;taunt
[statedef 198, Taunt]
type = S
ctrl = 0
movetype = I
anim = 198 + Var(6)
physics = S
Sprpriority = 2


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




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

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

;Stand Lp 
[StateDef 200]
type = S
movetype= A
physics = S
juggle = 2
velset = 0,0
ctrl = 0
anim = 200+var(6)
poweradd = 0;20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,0
volume = 255

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,0
volume = 255


[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 28
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -19, -78
hitsound = S300, 0
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type = High
ground.slidetime = 7
ground.hittime  = 12
ground.velocity = -2.3
air.type = High
air.hittime = 12
air.velocity = -3,-3
airguard.velocity = -2,0
getpower = 20
givepower = 10



[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;--------------------------------------------------------------------------
;Stand Lp (Close)
[StateDef 201]
type = S
movetype= A
physics = S
juggle = 2
velset = 0,0
ctrl = 0
anim = 201+var(6)
poweradd = 0;20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,0
volume = 255

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = ifelse(random > 500,210,0),ifelse(random > 500,210,1)
volume = 255

[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 26
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 9, 9
sparkno = S8000
guard.sparkno = S8020+(random%2)
sparkxy = -19, -78
hitsound = S301, 0
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type = High
ground.slidetime = 7
ground.hittime  = 12
ground.velocity = -2.56778
air.type = High
air.hittime = 12
air.velocity = -1,-1
airguard.velocity = -2,0
getpower = 20
givepower = 10

[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;--------------------------------------------------------------------------
;Stand Hp
[StateDef 202]
type = S
movetype= A
physics = S
juggle = 3
velset = 0,0
ctrl = 0
anim = 202+var(6)
poweradd = 30
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,4
volume = 255


[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,3
volume = 255

[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 60
animtype = back
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 11,12
sparkno = S8000
guard.sparkno = S8020+(random%2)
sparkxy = -23, -79
hitsound = S300, 2
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -9
air.type = Low
air.hittime = 15
air.velocity = -7,-3
airguard.velocity = -2,0
getpower = 20
givepower = 10
fall = 0
yaccel		            = 0.655

[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;--------------------------------------------------------------------------
; Energy Shield Launcher
[Statedef 204]
type                    = S
movetype                = A
physics                 = S
anim                    = 204
ctrl                    = 0
poweradd                = 0
juggle                  = 4
velset			        = 0, 0
facep2                  = 0
hitdefpersist           = 0
movehitpersist          = 0
hitcountpersist         = 0
sprpriority             = 2

[State 0:       PlaySND]
type                    = PlaySnd
trigger1                = !Time
value                   = 3003, 0
channel	                = 1

[State 0:       PlaySND]
type                    = PlaySnd
trigger1                = !Time
value                   = 210, 7
channel	                = 3


[State 0: 	BGPalFX]
type		    = BGPalFX
trigger1                = !Time
time		    = 19
add	              = 0,0,0
mul		    = 154,154,154
sinadd		    = 85,85,85,25
invertall		    = 0
color	              = 256

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 8141
ID = 8141
pos =0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
supermove=999
pausemove=999
scale = 1,1
sprpriority = 3
removeongethit = -1

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 7040
ID = 7040
pos =0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -1
supermove=999
pausemove=999
scale = 1,1
sprpriority = 3
removeongethit = -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !animtime
id = 7040
;ignorehitpause = 
;persistent = 

[State 0: Helper]
type                    = Helper
trigger1                = animelem = 3
helpertype              = normal
name                    = "Energy Shield"
ID                      = 8332
pos                     = 0,-50
stateno                 = 8332
ownpal                  = 1
size.xscale             = .6 
size.yscale             = .6

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


[State 0:       PunchSound]
type                    = PlaySnd
trigger1                = !time
value                   = 250, IfElse ((Random > 500), 2, -1)
channel                 = -1



[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;------------------------------------------
;Stand Hp (Close)
[StateDef 205]
type = S
movetype= A
physics = S
juggle = 3
velset = 0,0
ctrl = 0
anim = 205+var(6)
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = AnimElem = 3
value = 205,0
volume = 255
channel = 2

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 600
value = ifelse(random > 500,210,210),ifelse(random > 500,4,2)
volume = 255
channel = 2



[State 0, Explod]
type = Explod
trigger1 = Animelem = 1
anim = 1012
ID = 6062
pos =  -10,-84
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
removetime = 12
supermove=999
pausemove=999
scale = .06,.15
sprpriority = 3
removeongethit = -1

[State 0, Explod]
type = Explod
trigger1 = Animelem = 2
anim = 1012
ID = 6063
pos =20,-79
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = 3
supermove=999
pausemove=999
scale = .06,.17
sprpriority = 3
removeongethit = -1

[State 0, Explod]
type = Explod
trigger1 = Animelem = 3
anim = 1012
ID = 6064
pos =82,-79
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = 17
supermove=999
pausemove=999
scale = .19,.1
sprpriority = 3
removeongethit = -1

[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 64
animtype = hard
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 12
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -39, -86
hitsound = S300, 3
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = high
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -8
Air.Fall = 0
air.type = Low
air.hittime = 15
air.velocity = -3,-4
airguard.velocity = -3,-1
getpower = 20
givepower = 10

[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;--------------------------------------------------------------------------
; Stand - Lk
[Statedef 207]
type                    = S
movetype                = A
physics                 = S
anim                    = 207
ctrl                    = 0
poweradd                = 0
juggle                  = 4
velset		    = 0, 0
facep2                  = 0
hitdefpersist           = 0
movehitpersist          = 0
hitcountpersist         = 0
sprpriority             = 2

[State 0:     KickSound]
type                    = PlaySnd
trigger1                = (!Time)
value                   = 200,2

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,1
volume = 255

;---------------
;Hit Details
;---------------

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NA    
damage                  = 27
animtype                = Light
guardflag               = M
hitflag                 = MA
priority                = 3, Hit
pausetime               = 7, 8
sparkno                 = S8000+(random%2)
guard.sparkno           = S8020+(random%2)
sparkxy                 = -25, -92
hitsound                = S300, 0
guardsound              = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type             = low
ground.slidetime        = 9
ground.hittime          = 9
ground.velocity         = -2
airguard.velocity       = -3.9,-1
air.type                = low
air.velocity            = -3,-3
air.hittime             = 12
getpower                = 55
givepower		        = 0
yaccel		            = 0.5

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;---------------------------------------------------------------------------
; Stand Lk (Close)
[Statedef 208]
type                    = S
movetype                = A
physics                 = S
anim                    = 208
ctrl                    = 0
poweradd                = 100
juggle                  = 4
velset	              = 0, 0
facep2                  = 0
hitdefpersist           = 0
movehitpersist          = 0
hitcountpersist         = 0
sprpriority             = 2

[State 230:     KickSound]
type                    = PlaySnd
trigger1                = (!Time)
value                   = 200,2
channel                 = -1

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,3
volume = 255

;---------------
;Hit Details
;---------------

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NA    
damage                  = 26
animtype                = Light
guardflag               = M
hitflag                 = MA
priority                = 3, Hit
pausetime               = 7, 8
sparkno                 = S8000+(random%2)
guard.sparkno           = S8020+(random%2)
sparkxy                 = -37, -72
hitsound                = S300, 1
guardsound              = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type             = low
ground.slidetime        = 9
ground.hittime          = 9
ground.velocity         = -2
airguard.velocity       = -3.9,-1
air.type                = Low
air.velocity            = -3,-3
air.hittime             = 12
getpower                = 55
givepower		        = 0
yaccel		            = 0.5

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;---------------------------------------------------------------------------
; Stand Hk (Spear Kick)
[Statedef 209]
type                    = S
movetype                = A
physics                 = S
anim                    = 210
ctrl                    = 0
poweradd                = 0
juggle                  = 4
velset			        = 0, 0
facep2                  = 0
hitdefpersist           = 0
movehitpersist          = 0
hitcountpersist         = 0
sprpriority             = 2

[State 0:     KickSound]
type                    = PlaySnd
trigger1                = (!Time)
value                   = 200,3
channel                 = -1

[State 0:       Sound]
type                    = PlaySnd
trigger1                = !time
value                   = 250, IfElse ((Random > 500), 1, -1)
channel                 = -1

;---------------
;Hit Details
;---------------

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NA    
damage                  = 64
animtype                = Heavy
guardflag               = M
hitflag                 = MA
priority                = 3, Hit
pausetime               = 11, 12
sparkno                 = S8000+(random%2)
guard.sparkno           = S8020+(random%2)
sparkxy                 = -45, -84
hitsound                = S300, 2
guardsound              = S400, 0
ground.type             = High
ground.slidetime        = 12
ground.hittime          = 12
ground.velocity         = -5
airguard.velocity       = -3.9,-1
air.type                = High
air.velocity            = -5,-3
air.hittime             = 12
getpower                = 95
givepower		        = 0
yaccel		            = 0.5

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;---------------------------------------------------------------------------
; Stand - Hk
[Statedef 210]
type                    = S
movetype                = A
physics                 = S
anim                    = 208
ctrl                    = 0
poweradd                = 0
juggle                  = 4
velset			        = 0, 0
facep2                  = 0
hitdefpersist           = 0
movehitpersist          = 0
hitcountpersist         = 0
sprpriority             = 2

[State 0:     KickSound]
type                    = PlaySnd
trigger1                = (!Time)
value                   = 200,3
channel                 = -1

[State 0:       Sound]
type                    = PlaySnd
trigger1                = !time
value                   = 250, IfElse ((Random > 500), 2, -1)
channel                 = -1

;---------------
;Hit Details
;---------------

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NA    
damage                  = 60
animtype                = Heavy
guardflag               = M
hitflag                 = MA
priority                = 3, Hit
pausetime               = 11, 12
sparkno                 = S8000+(random%2)
guard.sparkno           = S8020+(random%2)
sparkxy                 = -37, -72
hitsound                = S300, 2
guardsound              = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type             = low
ground.slidetime        = 12
ground.hittime          = 12
ground.velocity         = -9
airguard.velocity       = -3.9,-1
air.type                = High
air.velocity            = -5,-3
air.hittime             = 12
getpower                = 95
givepower		        = 0
yaccel		            = 0.5

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;---------------------------------------------------------------------------
; Stand - Hk (Spin Kick)
[StateDef 211]
type = S
movetype= A
physics = S
juggle = 4
velset = 0
ctrl = 0
anim = 211+var(6)
poweradd = 0;20
sprpriority =2


[State 0, ]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,4
volume = 255

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,4
volume = 255

[State 0: PosAdd]
type                    = PosAdd
trigger1                = AnimElem = 1
trigger2                = AnimElem = 2
x                       = 15

[State 0, ]
type = HitDef
trigger1 = !time
attr = A, NA
damage = 64
animtype = Hard
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 11, 12
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -29, -86
hitsound = S300, 3
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -9,0
Air.Fall = 0
fall = 0
air.type = High
air.hittime = 15
air.velocity = -6,-3
airguard.velocity = -4,-2


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

;--------------------------------------------------------------------------
; Kick Launcher
[Statedef 212]
type                    = S
movetype                = A
physics                 = S
anim                    = 209
ctrl                    = 0
poweradd                = 0
juggle                  = 4
velset		    = 0, 0
facep2                  = 0
hitdefpersist           = 0
movehitpersist          = 0
hitcountpersist         = 0
sprpriority             = 2

[State 0:     	Sound]
type                    = PlaySnd
trigger1                = (!Time)
value                   = 200,3
channel                 = -1

[State 0:       Sound]
type                    = PlaySnd
trigger1                = !time
value                   = 250, IfElse ((Random > 500), 2, -1)
channel                 = -1

;---------------
;Hit Details
;---------------

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NA    
damage                  = Ceil(IfElse(Var(15) >= 5, IfElse((55*(24-Var(15)+5)/24) > 0, 55*(24-Var(15)+5)/24,10),55)), 0
animtype                = Heavy
guardflag               = MA
hitflag                 = MA
priority                = 3, Hit
pausetime               = 11, 12
sparkno                 = S IfElse(random<500,IfElse(random<500,7100,7101),IfElse(random<500,7102,7103))
guard.sparkno           = S7112
sparkxy                 = 0, -70
hitsound                = S300, 3
guardsound              = S400, 0
ground.type             = High
ground.slidetime        = 12
ground.hittime          = 12
ground.velocity         = 0, -10
airguard.velocity       = -3, -5
air.type                = High
air.velocity            = 0, -12
air.hittime             = 22
getpower                = 95
givepower		        = 0
yaccel		            = 0.5

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;-------------------------------------------------------------------------------------------------
; Stand - Hk (Spin Kick)
[StateDef 220]
type = S
movetype= A
physics = S
juggle = 4
velset = 0
ctrl = 0
anim = 211+var(6)
poweradd = 0;20
sprpriority =2


[State 0, ]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,4
volume = 255

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,4
volume = 255

[State 0: PosAdd]
type                    = PosAdd
trigger1                = AnimElem = 1
trigger2                = AnimElem = 2
x                       = 15

[State 0, ]
type = HitDef
trigger1 = !time
attr = A, NA
damage = 64
animtype = Hard
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 15, 15
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -29, -86
hitsound = S300, 3
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -14,-4
p2stateno = 6000
Air.Fall = 0
Fall = 1
fall.recover = 0
air.type = Low
air.hittime = 35
air.velocity = -14,-4
airguard.velocity = -4.5,0
getpower = 0;30
envshake.time = 15
envshake.freq = 120
envshake.ampl = 6
yaccel = .3


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

;--------------------------------------------------------------------------
;Meteo Start 1 (Ground)
[StateDef 300]
type = S
movetype= A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
anim = 300
poweradd = -250;30
sprpriority = -1

[State 0, VarAdd]
type = VarAdd
trigger1 = !time && var(3) <= 2
v = 3
value = 4


[State 0, ]
type = AfterImage
trigger1 = AnimElem = 2
time = 60
length = 4
palbright = 10,10,10
palcontrast = 120,120,120
paladd = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 1
trans = Add

[State 0, Pause]
type = Pause
trigger1 = (time%2)
time = 1
movetime = 1
pausebg = 0
ignorehitpause= -1
;persistent =

[State 0, EnvColor]
type = EnvColor
trigger1 = !time
value = 255,255,255
time = 2

[State 0, Explod Dust]
type = Explod
trigger1 = AnimElem = 1,1
anim = 8140
ID =   8140
pos = 0,0
scale = 1, 1
postype = p1
bindtime = 1
sprpriority = -1
ownpal = 1
removetime = -2
supermovetime = 999
pausemovetime = 999
ontop = 0

[State 0, Explod Dust twirl]
type = Explod
trigger1 = AnimElem = 1,1
anim = 8141
ID =   8141
pos = 0,0
scale = .7, .7
postype = p1
bindtime = 1
sprpriority = 4
ownpal = 1
removetime = -2
supermovetime = 999
pausemovetime = 999
ontop = 0

[State 0: Helper]
type                    = Helper
trigger1                = time = 0
helpertype              = normal
ID                      = 8000
pos                     = ifelse(random>500,3,ifelse(random>500,-5,15)),0
postype                 = p1
facing                  = 1
stateno                 = 8000
ownpal                  = 1
size.xscale             = .8
size.yscale             = 1.0
supermovetime = 999
pausemovetime = 999


[State 0, ]
type = Explod
trigger1 = AnimElem = 2
anim = 8100
ID = 8100
pos = -20,0
facing = 1
scale = 1,1
postype = p1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 0, Voice]
type  = PlaySnd
trigger1 = !Time
value = ifelse(random > 500,210,-1),ifelse(random > 500,5,6)
channel = 0
volume = 255

[State 0, Dash]
type = PlaySnd
trigger1 = !Time
value = 240, 0

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

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, Width]
type = Width
trigger1 = 1
edge = -10,-10
player = 0,0


[State 0: VelSet]
type = VelSet
trigger1 = AnimELem = 2,>1
x = ifelse(P2Dist X < 0,13, 12+abs(P2Dist x*.1))
y = 0


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y < 0
statetype = A       ;S,A,C,L
physics = A         ;A,C,S,N
;ignorehitpause =
;persistent =

[State 0, ChangeState]
type = ChangeState
trigger1 = P2Dist x < -30-Vel X
value = 301
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 60
value = 101
ctrl = 1


;--------------------------------------------------------------------------
;Meteo Attack 1
[StateDef 301]
type = C
movetype= A
physics = C
juggle  = 0
;velset = 3,0
ctrl = 0
anim = 301
poweradd = 0;20
sprpriority = -1

[State 0, Turn]
type = Turn
trigger1 = !time

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 50,1
volume = 255
channel = 1

[State 0, PlayerPush]
type = PlayerPush
trigger1 = time < 4
value = 0

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = ifelse(random > 500,210,-1),ifelse(random > 500,0,ifelse(random > 500,1,2))
volume = 255
channel = 2

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "Shockwave"
ID = 8200
stateno = 8200
pos = 0,-40
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 999
pausemovetime = 999
ignorehitpause = 1
persistent = 0

[State 0, ]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage = 40, 8
animtype = Up
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 15, 15
sparkno = S8014-(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = 0, -55
hitsound = S300, 4
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = Low
ground.slidetime = 10
ground.hittime  = 17
ground.velocity = 0,-13
fall = 1
air.type = Low
air.hittime = 17
air.velocity = 0,-13
airguard.velocity = -2,0
getpower = 0;20
envshake.time = 15
envshake.freq = 120
envshake.ampl = 6

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

;--------------------------------------------------------------------------
;Meteo Start 2 (up)
[StateDef 302]
type = S
movetype= A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 302
poweradd = -250;30
sprpriority = -1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y < 0
statetype = A
physics = A

[State 0, ]
type = AfterImage
trigger1 = AnimElem = 2
time = 60
length = 4
palbright = 10,10,10
palcontrast = 120,120,120
paladd = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 1
trans = Add

[State 0, Pause]
type = Pause
trigger1 = (time%2)
time = 1
movetime = 1
pausebg = 0
ignorehitpause= -1
;persistent =

[State 0, EnvColor]
type = EnvColor
trigger1 = !time
value = 255,255,255
time = 2

[State 0, Explod Dust]
type = Explod
trigger1 = AnimElem = 1,1
anim = 8140
ID =   8140
pos = 0,0
scale = 1, 1
postype = p1
bindtime = 1
sprpriority = -1
ownpal = 1
removetime = -2
supermovetime = 999
pausemovetime = 999
ontop = 0

[State 0, Explod Dust twirl]
type = Explod
trigger1 = AnimElem = 1,1
anim = 8141
ID =   8141
pos = 0,0
scale = .7, .7
postype = p1
bindtime = 1
sprpriority = 4
ownpal = 1
removetime = -2
supermovetime = 999
pausemovetime = 999
ontop = 0


[State 0, ]
type = Explod
trigger1 = AnimElem = 2
anim = 8100
ID = 8100
pos = -20,0
facing = 1
scale = 1,1
postype = p1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 0, Voice]
type  = PlaySnd
trigger1 = !Time
value = ifelse(random > 500,210,-1),ifelse(random > 500,5,6)
channel = 0
volume = 255

[State 0, Dash]
type = PlaySnd
trigger1 = !Time
value = 240, 0

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

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, Width]
type = Width
trigger1 = 1
edge = -10,-10
player = 0,0



[State 0: VelSet]
type = VelSet
trigger1 = AnimELem = 2,>1
x = 0
y = ifelse(P2Dist Y < 0,-12, -12-abs(P2Dist Y*.1))

[State 0, ChangeState]
type = ChangeState
triggerall = AnimELem = 2,>1
trigger1 = P2Dist Y-10 > 0 + Vel Y
value = 303
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 60
value = 101
ctrl = 1

;--------------------------------------------------------------------------
;Meteo Attack 2
[StateDef 303]
type = A
movetype= A
physics = A
juggle  = 0
;velset = 3,0
ctrl = 0
anim = 303
poweradd = 0;20
sprpriority = 2

[State 0, VelMul]
type = VelMul
trigger1 = AnimElem = 4,<1
x = 1
y = .9
;ignorehitpause =
;persistent =


[State 0, ]
type = PlaySnd
trigger1 = !time
value = 50,1
volume = 255
channel = 1

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = ifelse(random > 500,210,-1),ifelse(random > 500,0,ifelse(random > 500,1,2))
volume = 255
channel = 2

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "Shockwave"
ID = 8200
stateno = 8200
pos = 0,-40
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 999
pausemovetime = 999
ignorehitpause = 1
persistent = 0

[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 48, 9
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 15, 15
sparkno = S8010
guard.sparkno = S8022+(random%2)
sparkxy = -10, -47
hitsound = S203, 1
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type = Low
ground.slidetime = 35
ground.hittime  = 35
ground.velocity = -14,-4
p2stateno = 6000
Fall = 1
air.type = Low
air.hittime = 35
air.velocity = -14,-4
airguard.velocity = -4.5,0
getpower = 0;30
envshake.time = 15
envshake.freq = 120
envshake.ampl = 6
yaccel = .2

;--------------------------------------------------------------------------
;Meteo Start 3 (Air)
[StateDef 304]
type = A
movetype= A
physics = A
juggle = 0
velset = 0,0
ctrl = 0
anim = 300
poweradd = -250;30
sprpriority = -1

[State 0, ]
type = AfterImage
trigger1 = AnimElem = 2
time = 60
length = 4
palbright = 10,10,10
palcontrast = 120,120,120
paladd = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 1
trans = Add

[State 0, Pause]
type = Pause
trigger1 = (time%2)
time = 1
movetime = 1
pausebg = 0
ignorehitpause= -1
;persistent =

[State 0, EnvColor]
type = EnvColor
trigger1 = !time
value = 255,255,255
time = 2

[State 0, Explod Dust]
type = Explod
trigger1 = AnimElem = 1,1
anim = 8140
ID =   8140
pos = 0,0
scale = 1, 1
postype = p1
bindtime = 1
sprpriority = -1
ownpal = 1
removetime = -2
supermovetime = 999
pausemovetime = 999
ontop = 0

[State 0, Explod Dust twirl]
type = Explod
trigger1 = AnimElem = 1,1
anim = 8141
ID =   8141
pos = 0,0
scale = .7, .7
postype = p1
bindtime = 1
sprpriority = 4
ownpal = 1
removetime = -2
supermovetime = 999
pausemovetime = 999
ontop = 0



[State 0, ]
type = Explod
trigger1 = AnimElem = 2
anim = 8100
ID = 8100
pos = -20,0
facing = 1
scale = 1,1
postype = p1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 0, Voice]
type  = PlaySnd
trigger1 = !Time
value = ifelse(random > 500,210,-1),ifelse(random > 500,5,6)
channel = 0
volume = 255

[State 0, Dash]
type = PlaySnd
trigger1 = !Time
value = 240, 0

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

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, Width]
type = Width
trigger1 = 1
edge = -10,-10
player = 0,0


[State 0: VelSet]
type = VelSet
trigger1 = AnimELem = 2,>1
x = ifelse(P2Dist X < 0,14, 12+abs(P2Dist x*.1))
y = target, Vel Y


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y < 0
statetype = A       ;S,A,C,L
physics = A         ;A,C,S,N
;ignorehitpause =
;persistent =

[State 0, ChangeState]
type = ChangeState
trigger1 = P2Dist x < -30-Vel X
value = 305
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 60
value = 101
ctrl = 1


;--------------------------------------------------------------------------
;Meteo Attack 3
[StateDef 305]
type = A
movetype= A
physics = A
juggle  = 0
;velset = 3,0
ctrl = 0
anim = 305
poweradd = 0;20
sprpriority = -1

[State 0, VelMul]
type = VelMul
trigger1 = AnimElem = 3,>1
x = .85
y = 1

[State 0, VelSet]
type = VelSet
trigger1 = movehit
x = 0



[State 0, Turn]
type = Turn
trigger1 = !time

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 50,1
volume = 255
channel = 1

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = ifelse(random > 500,210,-1),ifelse(random > 500,0,ifelse(random > 500,1,2))
volume = 255
channel = 2

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "Shockwave"
ID = 8200
stateno = 8200
pos = 0,-40
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 999
pausemovetime = 999
ignorehitpause = 1
persistent = 0

[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 48, 9
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 30, 15
sparkno = S8010
guard.sparkno = S8022+(random%2)
sparkxy = -10, -47
hitsound = S203, 1
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type = Low
ground.slidetime = 35
ground.hittime  = 35
ground.velocity = -2,14
p2stateno = 6000
Fall = 1
air.type = Low
air.hittime = 35
air.velocity = -2,14
airguard.velocity = -2,0
getpower = 0;30
envshake.time = 15
envshake.freq = 120
envshake.ampl = 6

[State 0, ChangeState]
type = ChangeState
trigger1 = !animtime
value = 50
ctrl = 1
;anim =
;ignorehitpause = 
;persistent = 

;--------------------------------------------------------------------------
;Crouch light punch
[StateDef 400]
type = C
movetype= A
physics = C
juggle = 2
velset = 0,0
ctrl = 0
anim = 405
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,0
volume = 255
channel = 1

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = ifelse(random > 500,210,-1),ifelse(random > 500,0,ifelse(random > 500,1,2))
volume = 255
channel = 2

[State 0, ]
type = HitDef
trigger1 = !time
attr = C, NA
damage = 26
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 6, 8
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -25, -55
hitsound = S300, 0
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type = low
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -1.4
air.type = Low
air.hittime = 12
air.velocity = -1,1
airguard.velocity = -2,0
getpower = 20
givepower = 10

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

;--------------------------------------------------------------------------
;Crouch - Hp (Shoulder Charge)
[StateDef 401]
type = C
movetype= A
physics = C
juggle = 2
velset = 0,0
ctrl = 0
anim = 212
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,4
volume = 255
channel = 1

[State 0, ]
type = PlaySnd
trigger1 = !time && random < 600
value = ifelse(random > 500,210,210),ifelse(random > 500,4,2)
volume = 255
channel = 2

[State 0, ]
type = HitDef
trigger1 = !time
attr = S, NA
damage = 60
animtype = hard
guardflag = H
hitflag = MAF
priority = 3, Hit
pausetime = 10, 12
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -9, -46
hitsound = S300, 3
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = high
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -2,4
Air.Fall = 0
Fall = 1
air.type = Low
air.hittime = 15
air.velocity = -3,-4
airguard.velocity = -3,-1
getpower = 20
givepower = 10

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

;--------------------------------------------------------------------------
;Crouch Light Kick 
[StateDef 402]
type = C
movetype= A
physics = C
juggle = 4
velset = 0,0
ctrl = 0
anim = 401
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,2
volume = 255
channel = 1

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,4
volume = 255


[State 0, ]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage = 27
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -19, -15
hitsound = S300, 1
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type             = low
ground.slidetime        = 9
ground.hittime          = 9
ground.velocity         = -1.4
air.type = Low
air.hittime = 12
air.velocity = -1,1
airguard.velocity = -2,0


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

;-------------------------------------------------------------------------
;Slide Kick
[StateDef 403]
type = C
movetype= A
physics = C
juggle = 4
velset = 0,0
ctrl = 0
anim = 402
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,4
volume = 255
channel = 1

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,4
volume = 255


[State 0, ]
type = HitDef
trigger1 = !time
attr = C, NA
damage = 58
animtype = Light
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 11, 8
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -19, -15
hitsound = S300, 2
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type             = trip
ground.slidetime        = 9
ground.hittime          = 9
ground.velocity         = -1,-4
air.type = Low
air.hittime = 12
air.velocity = -1,1
airguard.velocity = -2,0
yaccel = 0.41


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

;--------------------------------------------------------------------------
;Jump - Lp
[StateDef 600]
type = A
movetype= A
physics = A
juggle = 0
;velset = 0,0
ctrl = 0
anim = 600
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,0
volume = 255
channel = 1

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,0
volume = 255

[State 0, ]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
damage = 28
animtype = Light
guardflag = HA
hitflag = MAF
priority = 3, Hit
pausetime = 7, 8
sparkno = S8000+(random%2)
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
guard.sparkno = S8020+(random%2)
sparkxy = -20, -42
hitsound = S300, 0
guardsound = S2,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
air.type = High
air.hittime = 12
air.velocity = -1,Vel Y
airguard.velocity = -2,0
getpower = 20
givepower = 10

[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1
;--------------------------------------------------------------------------
;Jump - Hp
[StateDef 601]
type = A
movetype= A
physics = A
juggle = 0
;velset = 0,0
ctrl = 0
anim = 620
poweradd = 20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,4
volume = 255
channel = 1

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,1
volume = 255

[State 0, ]
type = HitDef
trigger1 = !time
attr = A, NA
damage = 62
animtype = Heavy
guardflag = HA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 12
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = 0, -35
hitsound = S300, 3
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = High
ground.slidetime = 15
ground.hittime  = 16
ground.velocity = -6
Fall = 0
Air.Fall = 1
fall.recover = 0
air.type = Low
air.hittime = 16
air.velocity = -8,7
airguard.velocity = -2,0


[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1

;-------------------------------------------------------------------------------
;Jump - Lk
[StateDef 602]
type = A
movetype= A
physics = A
juggle = 0
;velset = 0,0
ctrl = 0
anim = 615
poweradd = 0;20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,3
volume = 255

 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,5
volume = 255


[State 0, ]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage = 26
animtype = Hard
guardflag      = HA
hitflag = MAF
priority = 4, Hit
pausetime = 7,8
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -15, -25
hitsound = S300, 1
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -7
air.type = High
air.hittime = 20
air.velocity = -1,Vel Y
airguard.velocity = -2,0
getpower = 20
givepower = 10

[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1

;--------------------------------------------------------------------------
;Jump - Hk
[StateDef 603]
type = A
movetype= A
physics = A
juggle = 0
;velset = 0,0
ctrl = 0
anim = 610
poweradd = 0;20
sprpriority = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 200,3
volume = 255


 [State 0, ]
type = PlaySnd
trigger1 = !time && random < 400
value = 210,7
volume = 255


[State 0, ]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage = 60
animtype = Heavy
guardflag      = HA
hitflag = MAF
priority = 4, Hit
pausetime = 11,12
sparkno = S8000+(random%2)
guard.sparkno = S8020+(random%2)
sparkxy = -15, -35
hitsound = S300, 2
guardsound = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 0, 1))
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3
air.type = High
air.hittime = 20
air.velocity = -1,-1
airguard.velocity = -2,0
getpower = 20
givepower = 10
fall = 0

[State 0, ]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1
;--------------------------------------------------------------------------
; Grab Attack
[Statedef 800]
type 			        = S
movetype		        = A
physics		            = N
juggle		            = 1
anim			        = 800
ctrl			        = 0
poweradd		        = 0
velset			        = 0, 0
facep2		            = 0
hitdefpersist	        = 0
movehitpersist	        = 0
hitcountpersist	        = 0
sprpriority		        = 2

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

[State 0:       Sound]
type                    = PlaySnd
trigger1                = !time
value                   = 800, 0
channel                 = -1

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

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NT
damage                  = 0, 0
snap                    = 20, 0
animtype                = Light
hitflag                 = MA
priority                = 3, Hit
pausetime               = 5, 25
guard.pausetime         = 15,3
sparkno                 = S8000+(random%2)
guard.sparkno           = S6005
sparkxy                 = 0, IfElse ((Random > 500), -77, IfElse ((Random > 500), -82, -72))
hitsound                = S600, 0
guardsound              = S400, Ifelse (Random < 500, 0, Ifelse (Random < 500, 1, 2))
ground.type             = Low
ground.type             = Low
air.type                = Low
ground.slidetime        = 7
ground.hittime          = 7
air.hittime             = 7
ground.velocity         = 0
air.velocity            = 0,0
airguard.velocity       = 0,0
getpower                = 55
givepower		        = 20
p1stateno               = 801
yaccel		            = 0.5

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;---------------------------------------------------------------------------
; Grab Attack - Kick
[Statedef 801]
type 			        = S
movetype		        = A
physics		            = N
juggle		            = 1
anim			        = 801
ctrl			        = 0
poweradd		        = 0
velset			        = 0, 0
facep2		            = 0
hitdefpersist	        = 0
movehitpersist	        = 0
hitcountpersist	        = 0
sprpriority		        = -1

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

[State 0: Turn]
type                    = Turn
trigger1                = !Time

[State 0:       Sound]
type                    = PlaySnd
trigger1                = AnimElem = 2
value                   = 200, 3
channel                 = -1

[State 0: VelSet]
type                    = VelSet
Trigger1                = AnimElem = 1, > 0 &&  AnimElem = 4, < 0
x                       = -10

[State 0: PlayerPush]
type                    = PlayerPush
trigger1                = AnimElem = 1, > 0 &&  AnimElem = 4, < 0
value                   = 0

[State 0: VelSet]
type                    = VelSet
Trigger1                = AnimElem = 4, > 0
Trigger2                = MoveContact
x                       = 0
y                       = 0

[State 0: SprPriority]
type                    = SprPriority
trigger1                = AnimElem = 4, > 0
value                   = 2

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

[State 0, ]
type                    = HitDef
trigger1                = !time
attr                    = S, NA    
damage                  = 150
animtype                = Hard
guardflag               = MA
hitflag                 = MA
priority                = 3, Hit
pausetime               = 7, 8
sparkno                 = S8000+(random%2)
guard.sparkno           = S6005
sparkxy                 = -43,-80
hitsound                = S300, 3
guardsound              = S400, IfElse ((Random > 500), 0, 1)
ground.type             = Low
air.type                = Low
ground.slidetime        = 14
ground.hittime          = 14
air.hittime             = 14
ground.velocity         = -12,-4
air.velocity            = -12,0
airguard.velocity       = -3.9,0
ground.cornerpush.veloff = -25
air.cornerpush.veloff   = -25
getpower                = 55
givepower		        = 20
fall                     = 1
yaccel		            = 0.3
p2facing                = 1

[State 0:     End]
type                    = ChangeState
trigger1                = (!AnimTime)
value                   = 0
ctrl		            = 1

;---------------------------------------------------------------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 6000]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 6000, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 6001

;------------------
; Hit by Fast Kung Fu Palm - flying through the air
; (a custom gethit state)
[Statedef 6001]
type    = A
movetype= H
physics = N

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

[State 6001, Gravity]
type = VelAdd
trigger1 = 1
y = gethitvar(yaccel)

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

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

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

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

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

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

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

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

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

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

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

[State 0, ]
type = EnvShake
trigger1 = !Time
time = 16
freq = 100
ampl = -6

[State 6002, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 6003

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

[State 6003, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -7

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

[State 6003, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 6003, Gravity]
type = VelAdd
trigger1 = 1
y = .35

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

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

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

[State 6003, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

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

;---------------------------------------------------------------------------
;statedef - 2
[statedef -2]

[State -2, ]
type = DisplayToClipboard
trigger1 = numhelper(1315) > 0
text = "Var13 = %d, numtarget = %d"
params = var(13), helper(1315), numtarget
ignorehitpause = 1


[State -2, ]
type = DisplayToClipboard
trigger1 = 1
text = "%d, %d, %d"
params = numhelper(9001), numhelper (9002), numhelper (9003)
ignorehitpause = 1


;---------------------------------------------------------------------------
[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = var(25) = 1
trigger2 = enemy,Authorname = "Neocide" && var(25) = 1
flag = invisible


;--------------------------------------------------------------------------
[State 0, VarSet]
type = VarSet
trigger1 = palno = 3
v = 27    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 
;-------------------------------------------------------------------------
[State 0, ResetZanzouken]
type = VarSet
triggerall = Var(3) != 0 && stateno != [2100,2114]
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, movetype != H
v = 3
value = 0

;---------------------------------------------------------------------------
[State 0, Resetkiblast]
type = VarSet
triggerall = Var(13) != 0 && stateno != [1300,1305]
trigger1 = numhelper(1310)
trigger1 = helper(1310), NumTarget = 0
trigger2 = numhelper(1315)
trigger2 = helper(1315), NumTarget = 0
trigger3 = !numhelper(1310) && !numhelper(1315)
v = 13
value = 0
;=============================DAMAGE DAMPENER===============================
;---------------------------------------------------------------------------
[State -2, DamageDampener-Reset]
type = VarSet
triggerall = FVar(10) != 1
trigger1 = !NumTarget
trigger2 = NumTarget && Target, StateNo >= 5100
fvar(10) = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
[State -2, DamageDampener-Increase]
type = VarAdd
trigger1 = MoveType = A
trigger1 = MoveHit = 1
trigger1 = FVar(10) < 31
trigger1 = NumTarget
fv = 10
value = 1
persistent = 0
;---------------------------------------------------------------------------
[State -2, DamageDampener-Calculus]
type = VarSet
trigger1 = 1
fvar(11) = (31-FVar(10))/28
ignorehitpause = 1
;---------------------------------------------------------------------------
[State -2, CvS2DamageScaling-Power&Life]
type = VarSet
trigger1 = 1
fvar(12) = (.85+.06*(power>=1000)+.05*(power>=2000)+.04*(power>=3000)+.05*(life<=250))
ignorehitpause = 1
;---------------------------------------------------------------------------
[State -2, DamageScaling-FinalFormula-Common]
type = VarSet
trigger1 = 1
fvar(13) = FVar(12) * IfElse(FVar(10) < 3, 1, FVar(11))
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
value = fvar(13)
ignorehitpause = 1

;==============================COMBO DAMPENER===============================

[State 0, Stopchargesnd]
type = StopSnd
trigger1 = stateno != 2020
channel = 21


[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = (stateno != 212)
trigger2 = (stateno = 212 && AnimElem = 3)
id  = 8450
ignorehitpause = 1
;persistent =
;---------------------------------------------------------------------------
;statedef - 3
[Statedef -3]

[State -3, back to camera!]
type = ChangeState
trigger1 = (BackEdgeDist <0) && (StateNo != 100) && (ctrl) && (statetype = S)
value =  100
ctrl = 0

[State 0, Stopchargesnd]
type = StopSnd
trigger1 = stateno != 2001
channel = 7

[State 0, Stopchargesnd]
type = StopSnd
trigger1 = stateno != 2001
channel = 11

[State 0, Stopchargesnd]
type = StopSnd
trigger1 = stateno != 2001
channel = 12

[State 0, Stopchargesnd]
type = StopSnd
trigger1 = stateno != 2001
channel = 13


[State 0, StopSnd]
type = StopSnd
trigger1 = stateno = 0 
channel = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = stateno = 0 
channel = 2

[State 0, StopSnd]
type = StopSnd
trigger1 = stateno = 0 
channel = 3

[State 0, StopSnd]
type = StopSnd
trigger1 = stateno != 4001
channel = 8

[State 0, StopSnd]
type = StopSnd
trigger1 = stateno = 0 || movetype = h
channel = 5

