;---------------------------------------------------------------------------
; VAR LIST
;---------------------------------------------------------------------------
;Var(1) = Groove Indicator
;var(2) = Shoot Kick Chain Var
;Var(4) = High Jump indicator
;Var(5) = Short Jump Indicator
;Var(6) = Kick Throw (speed)/Fairy Gift speed
;Var(7) = Kick Throw (Time)
;Var(10) = MAX Time
;Var(20-24) = Variables for Finest KO

;Fvar(10-25) reserved for Customization options
;FVar(36) reserved for Damage Dampener

; Lose by Time Over
[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
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181+(random%3)

;---------------------------------------------------------------------------
; Win pose 1
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3 
value = 1,1
channel = 0

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


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

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 4 && Anim = 182
value = 1,ifelse(random <500,5,0)
channel = 0

[State 200, 1]
type = Screenbound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, ]
type = VelSet
trigger1 = AnimElem = 4 && Anim = 182
x = 2
y = -9

[State 0, ]
type = VelAdd
trigger1 = AnimElemTime(4) >= 0 && Anim = 182
y = .98 



[State 0, ]
type = PosAdd
trigger1 = AnimElem = 3
x = 11 


[State 0, ]
type = ChangeAnim
triggerall = Anim = 182 && AnimElemtime(4) > 0
trigger1 = pos y >= 0 && vel Y > 0
value = 183
;elem = 
;ignorehitpause = 0
;persistent = 1



[State 0, ]
type = VelSet
trigger1 = Anim = 183
x = 0
y= 0

[State 810, Width 2-11]
type = Width
trigger1 = Anim = 183 && AnimElemtime(4)>=0
edge = 30,20

[State 0, ]
type = PosSet
trigger1 = Anim = 183
y = 0


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

; Win pose 1
[Statedef 183]
type = S
ctrl = 0
anim = 184
velset = 0,0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2 
value = 1,9
channel = 0

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

; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

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

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

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

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

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

;Razz/Chohatsu/Taunt/Whatever the fuck you wanna call it
[Statedef 195]
type = S
movetype = I
physics = S
ctrl = 0
anim = 195
velset = 0,0

[State 181, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1, 6
channel = 0

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

; Stand Light Punch
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 8                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
triggerall = !(enemynear, stateno = [5030,5040]) && !(enemynear, stateno =[154,155])
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 20, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 9, 9                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -84               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) := 0)                 ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 11             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -6            ;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 = -4,-5.25           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
air.fall = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3 && random <= 500
value = 2, 1+(random%2)
channel = 0

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Medium Punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (4) >= 0) && (AnimElemTime (7) < 0)
value = 15,0

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 1

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
triggerall = !(enemynear, stateno = [5030,5040]) && !(enemynear, stateno =[154,155])
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 55
guardflag = MA
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-79
hitsound   = -1 + 0 * (var(46) := 1)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25

[State 210, 3]
type = ChangeAnim
trigger1 = AnimElemTime(5) > 0 && AnimElemTime(6) <= 0
trigger1 = movecontact
ignorehitpause = 1
persistent = 0
value = 210
elem = 6

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

;Stand Hard Punch
[Statedef 220]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 220
sprpriority = -1

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (4) >= 0) && (AnimElemTime (5) < 0)
value = 20,0

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (5) >= 0) && (AnimElemTime (7) < 0)
value = 8,0

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 2
x = 28
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 3
x = 9
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 4
x = 7
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 5
x = 17
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 6
x = -1
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 7
x = -2
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 8
x = -12
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 9
x = -12
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = !AnimTime
x = -31
ignorehitpause = 1

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 2

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 5 & random <= 500
value = 2, ifelse(random%2=1,2,0)
channel = 0

[State 210, 2]
type = HitDef
triggerall = !(enemynear, stateno = [5030,5040]) && !(enemynear, stateno =[154,155])
trigger1 = AnimElem = 5
attr = S, NA
animtype  = Hard
damage    = 83
guardflag = MA
pausetime = ifelse(var(30),7,13), ifelse(var(30),7,13)
sparkno = 2
sparkxy = -10,-85
hitsound   = -1 + 0 * (var(46) := 2)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -11
air.velocity = -4,-5.25

[State 210, 4]
type = SprPriority
trigger1 = AnimElem = 6
value = 2

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

; Stand Light Kick
[Statedef 230]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 8                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 230                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef

trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = ifelse(var(30),5,9), ifelse(var(30),5,9)                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -86               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) := 3)                  ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 11             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -6            ;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 = -4,-5.25           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
air.fall = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3 && random <= 500
value = 2, 1+(random%2)
channel = 0

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Medium Kick
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

[State 210, Width]
type = Width
trigger1 = AnimElemTime(3)>=0 && AnimElemTime(5)<0
value = 20,0

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 4

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 4 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-72
hitsound   = -1 + 0 * (var(46) := 4)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25


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

; Step Side Kick
[Statedef 245]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 245
sprpriority = 2

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (4) >= 0) && (AnimElemTime (7) < 0)
value = 15,0

[State 0, ]
type = VelSet
trigger1 = AnimElemTime(2) >= 0 && AnimElemtime(9) < 0
x = 3 

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 10
value = 0, 4

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 10 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 10
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-72
hitsound   = -1 + 0 * (var(46) := 4)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25


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


;Stand Hard Kick
[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 250
sprpriority = 2

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (5) >= 0) && (AnimElemTime (6) < 0)
value = 29,0

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (6) >= 0) && (AnimElemTime (8) < 0)
value = 15,0

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 5

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, ifelse(random%2=1,2,0)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 91
guardflag = MA
pausetime = ifelse(var(30),7,13), ifelse(var(30),7,13)
sparkno = 2
sparkxy = -10,-75
hitsound   = -1 + 0 * (var(46) :=5)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = Low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -11
air.velocity = -4,-5.25


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

; Crouch Light Punch
[Statedef 400]
type    = C                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = C                      ;Physics: S-stand, C-crouch, A-air
juggle  = 8                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 400                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
triggerall = !(enemynear, stateno = [5030,5040]) && !(enemynear, stateno =[154,155])
trigger1 = AnimElem = 3
attr = C, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = ifelse(var(30),5,9), ifelse(var(30),5,9)                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -61              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) := 0)                 ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = Low               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 11             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -6            ;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 = -4,-5.25           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
air.fall = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3 && random <= 500
value = 2, 1+(random%2)
channel = 0

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

;---------------------------------------------------------------------------
; Crouch Medium Punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 410
sprpriority = -1


[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 1

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
triggerall = !(enemynear, stateno = [5030,5040]) && !(enemynear, stateno =[154,155])
trigger1 = AnimElem = 3
attr = C, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-63
hitsound   = -1 + 0 * (var(46) := 1)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25

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

;Crouch Hard Punch
[Statedef 420]
type    = C
movetype= A
physics = C
juggle  = 8
poweradd= 65
ctrl = 0
velset = 0,0
anim = 420
sprpriority = 2

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 3
x = 10
ignorehitpause = 1


[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, ifelse(random%2=1,2,0)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Hard
damage    = 83
guardflag = MA
pausetime = ifelse(var(30),7,13), ifelse(var(30),7,13)
sparkno = 2
sparkxy = -10,-80
hitsound   = -1 + 0 * (var(46) := 2)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = Low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -11
air.velocity = -4,-5.25

[State 210, 4]
type = SprPriority
trigger1 = AnimElem = 10
value = 1

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

; Crouch Light Kick
[Statedef 430]
type    = C                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = C                      ;Physics: S-stand, C-crouch, A-air
juggle  = 8                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 430                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

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

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = L                  ;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 = ifelse(var(30),5,9), ifelse(var(30),5,9)                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -6               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) := 3)                  ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = Low             ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 11             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -6            ;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 = -4,-5.25           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
air.fall = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3 && random <= 500
value = 2, 1+(random%2)
channel = 0

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

;---------------------------------------------------------------------------
; Crouch Medium Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 17
ctrl = 0
velset = 0,0
anim = 440


[State 210, Width]
type = Width
trigger1 = AnimElemTime(3)>=0 && AnimElemTime(4)<0
value = 20,0

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 4

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
animtype  = Medium
damage    = 57
guardflag = L
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-26
hitsound   = -1 + 0 * (var(46) := 4)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25


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

;Crouch Hard Kick
[Statedef 450]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 17
ctrl = 0
velset = 0,0
anim = 450
sprpriority = 2


[State 210, Width]
type = Width
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (4) < 0)
value = 15,0

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 5

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, ifelse(random%2=1,2,0)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
animtype  = Hard
damage    = 91
guardflag = L
pausetime = ifelse(var(30),7,13), ifelse(var(30),7,13)
sparkno = 2
sparkxy = -10,-18
hitsound   = -1 + 0 * (var(46) :=5)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = Trip
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -.7,-6.25
guard.velocity = -11
air.velocity = -.7,-6.25
yaccel = .5
fall = 1
fall.recover = 0
fall.envshake.time = 10


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

; Air Light Punch
[Statedef 600]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
juggle  = 8                      ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 600                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = HA                   ;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 = ifelse(var(30),5,9), ifelse(var(30),5,9)                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -61              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) := 0)                 ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 11             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -6            ;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 = -4,-5.25           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
air.fall = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2 && random <= 500
value = 2, 1+(random%2)
channel = 0

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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

;---------------------------------------------------------------------------
; Air Medium Punch
[Statedef 610]
type    = A
movetype= A
physics = N
juggle  = 8
poweradd= 17
ctrl = 0
anim = 610
sprpriority = -1


[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 1

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
animtype  = Medium
damage    = 57
guardflag = HA
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-48
hitsound   = -1 + 0 * (var(46) := 1)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25

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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

;Air Hard Punch
[Statedef 620]
type    = A
movetype= A
physics = N
juggle  = 8
poweradd= 65
ctrl = 0
anim = 620
sprpriority = 2



[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, ifelse(random%2=1,2,0)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
animtype  = Hard
damage    = 83
guardflag = HA
pausetime = ifelse(var(30),7,13), ifelse(var(30),7,13)
sparkno = 2
sparkxy = -10,-48
hitsound   = -1 + 0 * (var(46) := 2)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -11
air.velocity = -4,-5.25

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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

; Air Light Kick
[Statedef 630]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
juggle  = 8                      ;Number of air juggle points move takes
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 630                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = L                  ;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 = ifelse(var(30),5,9), ifelse(var(30),5,9)                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -32               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) := 3)                  ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = High             ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 11             ;Time that the opponent slides back
ground.hittime  = 11             ;Time opponent is in hit state
ground.velocity = -6            ;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 = -4,-5.25           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
air.fall = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 3 && random <= 500
value = 2, 1+(random%2)
channel = 0

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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

;---------------------------------------------------------------------------
; Air Meduim Kick
[Statedef 640]
type    = A
movetype= A
physics = N
juggle  = 2
poweradd= 17
ctrl = 0
anim = 640


[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 4

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, 1+(random%2)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
animtype  = Medium
damage    = 57
guardflag = HA
pausetime = ifelse(var(30),6,11), ifelse(var(30),6,11)
sparkno = 1
sparkxy = -10,-32
hitsound   = -1 + 0 * (var(46) := 4)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.5
air.velocity = -4,-5.25


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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

;Air Hard Kick
[Statedef 650]
type    = A
movetype= A
physics = N
juggle  = 8
poweradd= 17
ctrl = 0
anim = 650
sprpriority = 2


[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 5

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 3 & random <= 500
value = 2, ifelse(random%2=1,2,0)
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
animtype  = Hard
damage    = 91
guardflag = HA
pausetime = ifelse(var(30),7,13), ifelse(var(30),7,13)
sparkno = 2
sparkxy = -10,-60
hitsound   = -1 + 0 * (var(46) :=5)
guardsound = -1 + 0 * (var(47) :=0)
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -11
air.velocity = -4,-5.25
yaccel = .5


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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52


;Throw attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[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
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p2facing = 1          ;Force p2 to face KFM
p1stateno = 801       ;On success, KFM changes to state 810
p2stateno = 805       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 5

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3, 0
channel = 0

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

;---------------------------------------------------------------------------
;Body Slam 
[Statedef 801]
type    = S
movetype= A
physics = N
anim = 801
poweradd = 60

[State TECH HIT]
type = ChangeState
trigger1 = numtarget(5)&& time < 13
trigger1 = (target(5), command = "holdfwd" || target(5), command = "holdback")
trigger1 = (target(5), command = "b" || target(5), command = "c" || target(5), command = "y" || target(5), command = "z")
value = 898

[State 810, Holding fwd?]
type = VarSet
trigger1 = !Time 
var(3) = command = "holdback"

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 6

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 2, 1
channel = 0

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = (ifelse(fvar(21),15,5)), 2

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = 7, 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 40, ifelse(target, const(size.head.pos.y) > -40,-66, 0)
ID = 5

[State 810, Width 2-11]
type = Width
trigger1 = AnimElem = 5
edge = 90,20

[State 810, Bind 5]
type = Turn
trigger1 = AnimElem = 2 && var(3)


[State 810, Bind 5]
type = TargetFacing
trigger1 = AnimElem = 2  
value = 1
ID = 5

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

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
pos = 33, -86
ID = 5

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

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem = 5
pos = 73, 0
ID = 5

[State 1475, 10]
type = TargetState
trigger1 = AnimElem = 5
value = 806
ID = 5

[State 1950, 5]
type = TargetLifeAdd
trigger1 = animelem = 5
value = ceil(-150*(.01*const(data.attack)))
ID = 5

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 4
x = 23
ignorehitpause = 1
persistent = 1

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Thrown by Body Slam
[Statedef 805]
type    = A
movetype= H
physics = N
velset = 0,0



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



[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 805+(const(size.head.pos.y) > -40)

[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

; Throw (hit by, into air)
[Statedef 806]
type    = A
movetype= H ;Get hit
physics = N
velset = 0,0
ctrl = 0

[State 0, 1]
type = PosSet
trigger1 = time = 6
y = 0

[State 192, 0]
type = GameMakeAnim
trigger1 = time = 0
pos = -5,0
value = 62

[State 1485, 1]
type = Velset
trigger1 = Time = 6
x= 3
y = -6

[State 1485, 1]
type = ChangeAnim
trigger1 = Time = 6
value = 5160

[State 1486, 2] ;Gravity
type = VelAdd
trigger1 = Time > 7
y = .49

[State 1486, 3]
type = EnvShake
trigger1 = time = 0
time = 20


[State 1486, 5] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground

;Throw attempt
[Statedef 810]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[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
numhits = 0
p1sprpriority = 1     ;Draw p1's sprite in front of p2
p1facing = ifelse(command = "holdback",-1,1)
p2facing = 1          ;Force p2 to face KFM
p1stateno = 811       ;On success, KFM changes to state 810
p2stateno = 815       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 5

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3, 0
channel = 0

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

;---------------------------------------------------------------------------
;Tsukami Hiza Kick 
[Statedef 811]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State TECH HIT]
type = ChangeState
trigger1 = numtarget(5)&& time < 5
trigger1 = (target(5), command = "holdfwd" || target(5), command = "holdback")
trigger1 = (target(5), command = "b" || target(5), command = "c" || target(5), command = "y" || target(5), command = "z")
value = 898

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 6

[State 810, Bind 1]
type = TargetBind
trigger1 = 1
pos = 30, ifelse(target, const(size.head.pos.y) > -40,-83, 0)
ID = 5

[State 0, ]
type = VarSet
trigger1 = !time
var(6) = 0

[State 0, ]
type = VarSet
trigger1 = !time
var(7) = 80

[State 810, Width 2-11]
type = Width
trigger1 = 1
edge = 50,0

[State 0, ]
type = VarAdd
trigger1 = !AILevel && var(6) < 2 && command = "tap"
var(6) = 1

[State 0, ]
type = VarSet
trigger1 = AILevel 
var(6) = 2

[State 810, State End]
type = ChangeState
triggerall = AnimTime = 0 
trigger1 = target, life < 30 || target, const(size.head.pos.y) > -40
value = 813

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 812

;Knee Bashes 
[Statedef 812]
type    = S
movetype= A
physics = N
poweradd = 60

[State Knee Speed]
type = ChangeAnim
trigger1 = !Time
value = 811+ Var(6)

[State 0, ]
type = VarSet
trigger1 = !time
var(6) = 0

[State 810, Width 2-11]
type = Width
trigger1 = 1
edge = 50,0

[State 0, ]
type = VarAdd
trigger1 = !AILevel && var(6) < 2 && command = "tap"
var(6) = 1

[State 0, ]
type = VarSet
trigger1 = AILevel
var(6) = 2

[State 0, ]
type = VarAdd
trigger1 = var(7) > 0 && target, command = "tap"
var(7) = -3

[State 0, ]
type = VarAdd
trigger1 = var(7) > 0 
var(7) = -1

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2, 2
channel = 0

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = (ifelse(fvar(21),15,5)), 5
channel = 8

[State 810, Bind 2-4]
type = TargetBind
trigger1 = 1
pos = 30, 0
ID = 5

[State 810, Shake]
type = EnvShake
trigger1 = numtarget(5) && animelem = 3 && fvar(10) = 2
time = 14
ampl = 4

[State 810,Explod]
type = Explod
trigger1 = AnimElem = 3
anim = f2
pos = 55,-71
postype = P1
sprpriority = 3
bindtime = 1
ownpal = 1

[State 1475, 10]
type = TargetState
trigger1 = AnimElem = 3
value = 816
ID = 5

[State 1950, 5]
type = TargetLifeAdd
trigger1 = animelem = 3
value = ceil(-30*(.01*const(data.attack)))
kill = 0
ID = 5

[State 1950, 5]
type = HitAdd
trigger1 = animelem = 3
value = 1

[State 810, State End]
type = ChangeState
triggerall = AnimTime = 0 
trigger1 = var(7) <= 0 || target(5), life < 30
value = 813

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0 && var(7) > 0
value = 812

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0 && var(7) <= 0
value = 813

;Finishing Knee 
[Statedef 813]
type    = A
movetype= A
physics = N
anim = 814

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2, 0

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = (ifelse(fvar(21),15,5)), 5
channel = 8

[State 810, Shake]
type = EnvShake
trigger1 = AnimElem = 3 && fvar(10) = 2
time = 14
ampl = 4

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 1
pos = 30, ifelse(target, const(size.head.pos.y) > -40,-83, 0)
ID = 5

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemNo(0) = 2
pos = 30, ifelse(target, const(size.head.pos.y) > -40,-66, 0)
ID = 5

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 3
x = 10
;y = 
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = VelSet
trigger1 = AnimElem = 3
x = 2
y = -6
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = VelAdd
trigger1 = AnimElemtime(3)>0
y = .45
;ignorehitpause = 0
;persistent = 1



[State 0, ]
type = Width
trigger1 = AnimElemTime(3)>= 0
edge = 30,0


[State 810,Explod]
type = Explod
trigger1 = AnimElem = 3
anim = f3
pos = 35,-71
postype = P1
sprpriority = 3
bindtime = 1
ownpal = 1

[State 1475, 10]
type = TargetState
trigger1 = AnimElem = 3
value = 817
ID = 5

[State 1950, 5]
type = TargetLifeAdd
trigger1 = animelem = 3
value = ceil(ifelse(target, const(size.head.pos.y) > -40,-125, -50)*(.01*const(data.attack)))
ID = 5


[State 1950, 5]
type = HitAdd
trigger1 = animelem = 3
value = 1

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

[State 810, State End]
type = ChangeState
triggerall = AnimElemtime(3) > 1
trigger1 = vel y > 0 && pos Y >= 0
value = 52


;---------------------------------------------------------------------------
;Thrown by Body Slam
[Statedef 815]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 815+(const(size.head.pos.y) > -40)

[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

;Thrown by Body Slam
[Statedef 816]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 820, 1]
type = ChangeAnim2
Trigger1 = !Time 
value = 817

[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

; Throw (hit by, into air)
[Statedef 817]
type = A
movetype = H
physics = N
velset = 0,0
anim = 5050

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

[State 0, ]
type = VelSet
trigger1 = time = 4
x = -4
y = -7

[State 0, ]
type = VelAdd
trigger1 = time > 3
y = .40

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

[State 0, ]
type = SelfState
trigger1 = time > 3
trigger1 = vel Y > 0 && pos Y >= 0
value = 5100

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

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = A, NT          ;Attributes: Standing, Normal Throw
hitflag = AF          ;Affect only ground people who are not being hit
priority = 2, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p2facing = 1          ;Force p2 to face KFM
p1stateno = 851       ;On success, KFM changes to state 810
p2stateno = 855       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 5

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3, 0
channel = 0

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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

;---------------------------------------------------------------------------
;Body Slam
[Statedef 851]
type    = A
movetype= A
physics = N
anim = 851
poweradd = 60

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


[State 810, Holding fwd?]
type = VarSet
trigger1 = !Time
var(3) = command = "holdback"

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 6

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 10
channel = 0

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = (ifelse(fvar(21),15,5)), 2

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = 7, 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = -2, -86
ID = 5

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemNo(0)=2
pos = -28, -84
ID = 5

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemNo(0)=3
pos = -50, -64
ID = 5

[State 810, Width 2-11]
type = Width
trigger1 = AnimElem = 3
edge = 50,50

[State 810, Bind 5]
type = Turn
trigger1 = AnimElem = 1 && !var(3)


[State 810, Bind 5]
type = TargetFacing
trigger1 = time <=1 && !var(3)
value = -1
ID = 5

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

[State 0, ]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 852

;Body Slam
[Statedef 852]
type    = S
movetype= A
physics = S
anim = 852
velset = 0,0
poweradd = 60

[State 0, PosSet]
type = PosSet
trigger1 = !time
y = 0

[State 810, Throw Sound]
type = PlaySnd
trigger1 = !time
value = ifelse(fvar(21),15,5), 2

[State 810, Throw Sound]
type = PlaySnd
trigger1 = time!
value = 7, 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) < 0
pos = -55, -6
ID = 5

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


[State 1475, 10]
type = TargetState
trigger1 = !time
value = 856
ID = 5

[State 1950, 5]
type = TargetLifeAdd
trigger1 = !time
value = ceil(-160*(.01*const(data.attack)))
ID = 5

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

;---------------------------------------------------------------------------
;Thrown by Body Slam
[Statedef 855]
type    = A
movetype= H
physics = N
velset = 0,0



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



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

[State 820, 2]
type = SelfState
trigger1 = time > 100
value = 5050

; Throw (hit by, into air)
[Statedef 856]
type    = A
movetype= H ;Get hit
physics = N
velset = 0,0
ctrl = 0

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

[State 0, 1]
type = PosAdd
trigger1 = Time = 6
x = -(const(size.mid.pos.y))-10

[State 0, 1]
type = PosSet
trigger1 = time = 6
y = 0

[State 192, 0]
type = GameMakeAnim
trigger1 = time = 0
pos = -5,0
value = 62

[State 1485, 1]
type = Velset
trigger1 = Time = 6
x= 3
y = -6

[State 1485, 1]
type = ChangeAnim
trigger1 = Time = 6
value = 5160

[State 1486, 2] ;Gravity
type = VelAdd
trigger1 = Time > 7
y = .49

[State 1486, 3]
type = EnvShake
trigger1 = time = 0
time = 20

[State 1486, 5] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground



;Tech Hit
[Statedef 898]
type    = S
movetype= I
physics = N
anim    = 5945
ctrl    = 0
velset  = 0,0
sprpriority = 1

[State 0, 1]
type = AllPalFX
trigger1 = time = 0
time = 4
invertall = 2
color = 0

[State 0, 1]
type = EnvShake
trigger1 = time = 0
time = 20

[State 0, ]
type = TargetBind
trigger1 = !time && numtarget(5)
pos = 0,0

[State 0, ]
type = TargetState
trigger1 = !time && numtarget(5)
value = 899

[State 0, ]
type  = TargetFacing
trigger1 = !time && numtarget(5)
value = -1

[State 0, ]
type = PosSet
trigger1 = !time
y = 0

[State 0, ]
type = VelMul
trigger1 = 1
x = .95

[State 0, ]
type = VelSet
trigger1 = time = 2
x = -4


[State 0, ]
type = PlaySnd
trigger1 = AnimElem = 2
value = 9,8


[State 0, 1]
type = ChangeState
trigger1 = time >= 25
value = 0
ctrl = 1


;Opponent Tech Hit
[Statedef 899]
type       = S
movetype   = I
physics    = N
ctrl       = 0
velset     = 0,0
sprpriority= 1

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

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

[State 0, ]
type = PosSet
trigger1 = !time
y = 0

[State 0, ]
type = VelMul
trigger1 = 1
x = .95

[State 0, ]
type = VelSet
trigger1 = time = 2
x = -4

[State 0, ];Use Tech Hit Anim
type = ChangeAnim
trigger1 = !time
value = ifelse(SelfAnimExist(5945),5945,130)

[State 0, ];Use Guard Break Anim
type = ChangeAnim
trigger1 = !time && !SelfAnimExist(5945) && SelfAnimExist(5910)
value = 5910

[State 0, ]
type = ChangeAnim
trigger1 = time >= 20 && anim = 130
value = 140


[State 0, ]
type = SelfState
trigger1 = time >= 25
value = 0
ctrl = 1

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


;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = !time
sysvar(1) = 0

[State 40, 1];Super Jump Var
type = VarSet
trigger1 = !time
var(4) = 0

[State 40, 1];Short Jump Var
type = VarSet
trigger1 = !time
var(5) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd" && !AILevel
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback" && !AILevel
sysvar(1) = -1

[State 40, 4]
type = VarSet
triggerall = !time && !AILevel
trigger1 = (PrevStateNo = 100 || PrevStateNo = 101) && sysvar(1) = 1
trigger2 = Command = "sjump"
trigger3 = Command = "sjump" && (Command = "holdfwd" || Command = "holdback")
var(4) = 1

[State 40, 4]
type = VarSet
trigger1 = Command != "holdup" && !AILevel
var(5) = 1

[State 40, Direction (AI)]
type = VarSet
trigger1 = AILevel
sysvar(1) = ifElse((EnemyNear, MoveType != A || BackEdgeBodyDist <= 10), 1, ifElse((EnemyNear, MoveType = A), -1, 0))

[State 40, High Jump (AI)]
type = VarSet
trigger1 = !Time && AILevel
var(4) = ifElse((P2BodyDist x >= 160 || Random < (125 * (AILevel ** 2 / 64.0))), 1, 0)

[State 40, Low Jump (AI)]
type = VarSet
trigger1 = AILevel 
var(5) = ifElse((EnemyNear, StateType = C) && Random < 500, 1, 0)


[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0 && !var(4)
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0 && var(4)
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.runjump.fwd.x), const(velocity.runjump.back.x)))

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
y = ifelse(var(4) && !sysvar(1),const(velocity.jump.y)*1.2,const(velocity.jump.y))*ifelse(var(5),.75,1)

[State 40, Position]
type = PosAdd
trigger1 = Var(4) && Vel X
x = -Vel X

[State 40, 5]
type = PlaySnd
trigger1 = AnimTime = 0
value = 9, var(4)
channel = 20


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

; Jump Up
[Statedef 50]
type    = A
physics = N

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

[State 810, AfterImage]
type = Afterimage
trigger1 = !time && var(4) && !var(30)
time = 20
length = 12
timegap=1
framegap=3
palbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = add1

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

[State 4030, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47+var(5)
facep2 = 1

[State -3, Landing Sound]
type = GameMakeAnim
trigger1 = !Time 
value = 60
pos = 0,0
under = 1

[State 40, 5]
type = PlaySnd
trigger1 = !Time 
value = 9, 2
channel = 20

[State 52, 1]
type = VelSet
trigger1 = !Time 
y = 0

[State 52, 2]
type = PosSet
trigger1 = !Time 
y = 0

[State 52, RemoveAfterImage]
type = AfterImageTime
trigger1 = !Time && !var(30)
time = 0

[State 52, 3]
type = CtrlSet
triggerall = prevstateno !=[600,699]
trigger1 = Time = 1
value = 1

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


; Running Forward
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State 100, Effect]
type = PlaySnd
trigger1 = AnimElem = 2 || AnimElem = 5
value = 10,0+(AnimElem = 5)
channel = 20

[State 100, 4]
type = ChangeState
trigger1 = command = "holdup"
value = 40

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
triggerall = AnimElemTime(2) >= 1
trigger1 = !AIlevel && command != "holdfwd"
trigger2 = AIlevel && p2dist x <= 90
value = 101

;Run Stop
[Statedef 101]
type = S
physics = N
ctrl = 0
anim = 101

[State 100, 4]
type = ChangeState
trigger1 = command = "holdup"
value = 40

[State 100, 1]
type = VelMul
trigger1 = 1
x = .9

[State 100, 1]
type = VelSet
trigger1 = animtime = 0
x = 0

[State 100, Effect]
type = PlaySnd
trigger1 = AnimElem = 1
value = 0,6
channel = 20

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

; Hop Backwards
[Statedef 105]
type    = A
physics = N
ctrl = 0
anim = 105
sprpriority = 1

[State 52, Effect]
type = PlaySnd
trigger1 = Time = 1
value = 9, 0
channel = 20

[State 105, 1]
type = VelSet
trigger1 = AnimElem = 2
x = -6.5
y = -4.5

[State 105, 1]
type = VelMul
trigger1 = AnimElemTime(2) > 0
x = .98

[State 105, 1]
type = VelAdd
trigger1 = AnimElemTime(2) > 0
y = .65

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;---------------------------------------------------------------------------
; Hop Backwards(end)
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 106

[State -3, Landing Sound]
type = GameMakeAnim
trigger1 = !Time 
value = 60
pos = 0,0
under = 1

[State 52, Effect]
type = PlaySnd
trigger1 = Time = 1
value = 9, 2
channel = 20

[State 106, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 106, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 0
ctrl = 1

;Guard Start
[StateDef 120]
type = U
physics = U
anim = 120 + (StateType = C) + (StateType = A) * 2

[State 120, StateTypeSet: Standing]
type = StateTypeSet
trigger1 = !Time && StateType = S
physics = S

[State 120, StateTypeSet: Crouching]
type = StateTypeSet
trigger1 = !Time && StateType = C
physics = C

[State 120, StateTypeSet: Jumping]
type = StateTypeSet
trigger1 = !Time && StateType = A
physics = A

[State 120, VelSet]
type = VelSet
trigger1 = !Time && StateType != A
x = 0
y = 0

[State 120, Stand to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = AILevel && StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 120, Crouching to Stand]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = AILevel && StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

[State 120, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 120, Change to Guard State]
type = ChangeState
trigger1 = !AnimTime || AILevel
value = 130 + (StateType = C) + (StateType = A) * 2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = (!AILevel && command != "holdback")
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140


;Standing Guard
[StateDef 130]
type = S
physics = S

[State 130, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 130
value = 130

[State 130, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 130, Standing to Crouch]
type = ChangeState
trigger1 = !AILevel && command = "holddown"
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = (!AILevel && command != "holdback")
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140

[State 130, Landing Sound]
type = PlaySnd
trigger1 = !Time
trigger1 = PrevStateNo = 132 || (PrevStateNo = [154,155])
value = 52,0

[State 130, Landing Dust Expod]
type = Explod
trigger1 = !Time
trigger1 = PrevStateNo = 132 || (PrevStateNo = [154,155])
anim = 8102
sprpriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1


;Crouch Guarding
[StateDef 131]
type = C
physics = C

[State 131, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 131
value = 131

[State 131, Crouching to Standing]
type = ChangeState
trigger1 = !AILevel && command != "holddown"
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
value = 130

[State 131, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 131, Stop Guarding]
type = ChangeState
trigger1 = (!AILevel && command != "holdback")
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140


;Air Guard
[StateDef 132]
type = A
physics = N

[State 132, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 132
value = 132

[State 132, VelAdd]
type = VelAdd
trigger1 = 1
y = const(movement.yAccel)

[State 132, VarSet]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0 && vel y > 0)

[State 132, VelSet]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, PosSet]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 132, Jumping to Standing]
type = ChangeState
trigger1 = sysvar(0) && InGuardDist
trigger1 = (!AILevel && command = "holdback") || AILevel
value = 130

[State 132, Change to Falling]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = (!AILevel && command != "holdback")
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140


;Guard End
[StateDef 140]
type = U
physics = U
ctrl = 1

[State 140, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 140 + (StateType = C) + (StateType = A) * 2

[State 140, StateTypeSet: Standing]
type = StateTypeSet
trigger1 = !Time && StateType = S
physics = S

[State 140, StateTypeSet: Crouching]
type = StateTypeSet
trigger1 = !Time && StateType = C
physics = C

[State 140, StateTypeSet: Jumping]
type = StateTypeSet
trigger1 = !Time && StateType = A
physics = A

[State 140, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 140, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

[State 140, End]
type = ChangeState
trigger1 = !AnimTime
value = (StateType = C) * 11 + (StateType = A) * 51


;Hit while Guarding (Standing)
[StateDef 150]
type = S
movetype = H
physics = N
velSet = 0,0

[State 150, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, End]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2 * ((!AILevel && command = "holddown") || (AILevel && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)))

[State 150, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
stateType = C
physics = C

[State 150, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = AIlevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S


;Knocked Back while Guarding (Standing)
[StateDef 151]
type = S
moveType = H
physics = S
anim = 150

[State 151, HitVelSet]
type = HitVelSet
trigger1 = !Time
x = 1

[State 151, VelSet]
type = VelSet
trigger1 = Time = GetHitVar(SlideTime)
trigger2 = HitOver
x = 0

[State 151, CtrlSet]
type = CtrlSet
trigger1 = time = GetHitVar(CtrlTime)
value = 1

[State 151, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 151, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

[State 151, End]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = 1


;Hit while Guarding (Crouching)
[StateDef 152]
type = C
moveType = H
physics = N
velSet = 0,0

[State 152, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 151

[State 152, End]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2 * ((!AILevel && command = "holddown") || (AILevel && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)))

[State 152, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && statetype = S && command = "holddown"
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 152, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S


;Knocked Back while Guarding (Crouching)
[StateDef 153]
type = C
moveType = H
physics = C
anim = 151

[State 153, HitVelSet]
type = HitVelSet
trigger1 = !Time
x = 1

[State 153, VelSet]
type = VelSet
trigger1 = Time = GetHitVar(SlideTime)
trigger2 = HitOver
x = 0

[State 153, CtrlSet]
type = CtrlSet
trigger1 = Time = GetHitVar(CtrlTime)
value = 1

[State 153, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 153, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

[State 153, End]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = 1


;Hit while Guarding (Jumping)
[StateDef 154]
type = A
moveType = H
physics = N
velSet = 0,0

[State 154, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, End]
type = ChangeState
trigger1 = HitShakeOver
value = 155


;Knocked Back while Guarding (Jumping)
[StateDef 155]
type = A
moveType = H
physics = N
anim = 152

[State 155, HitVelSet]
type = HitVelSet
trigger1 = !Time
x = 1
y = 1

[State 155, VelAdd]
type = VelAdd
trigger1 = 1
y = const(movement.yAccel)

[State 155, CtrlSet]
type = CtrlSet
trigger1 = Time = GetHitVar(CtrlTime)
value = 1

[State 155, VarSet]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0 && vel y > 0)

[State 155, VelSet]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, PosSet]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, End]
type = ChangeState
trigger1 = sysvar(0) && InGuardDist
trigger1 = (!AILevel && command = "holdback") || AILevel
value = 130

[State 155, End]
type = ChangeState
trigger1 = sysvar(0)
value = 52


;Parry effect
[Statedef 179] 
type     = A
movetype = I
physics  = N
ctrl     = 0
sprpriority = 4

[State 0,1]
type = DestroySelf
trigger1 = parent, movetype = H

[State 0, 1]
type = ChangeAnim
trigger1 = selfanimexist(parent, Anim)
value = parent, Anim
elem = parent, animelemno(0)

[State 0, ]
type = Palfx
trigger1 = 1
add = ceil(-(time*.01)*2000),ceil(-(time*.01)*2000),ceil(-(time*.01)*2000)
time = 1
ignorehitpause = 1
removeongethit = 1
persistent = 1

[State 0, ]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

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

[State 0,1]
type = Trans
trigger1 = 1
trans = add

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

[State 0,1]
type = AngleDraw
trigger1 = 1
scale = 1+(time*.03),1+(time*.03)

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

[State 0,1]
type = DestroySelf
trigger1 = Time = 20


; Max
[Statedef 196]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 196
ctrl = 0
sprpriority = 2



[State 0, ]
type = Explod
trigger1 = AnimElem = 4
anim = 6196
pos = -3,-84
postype = p1
scale = .5, .5
sprpriority = 4
ownpal = 1



[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 2, 6
channel = 0

[State 860, 4]
type = PowerAdd
trigger1 = time = 6
value = -1000

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 21, 0

[State 8000, Timer Bar]
type = Helper
triggerall = floor(fvar(15)) != 2
trigger1 = AnimElem = 4
helpertype = normal
ID = 8000
name = "Max Timer"
pos = ifelse(teamside=2,240,80),228
postype = left
stateno = 8001
scale = 1,1
keyctrl = 0
ownpal = 1
sprpriority = 5
pausemovetime = 999999999
supermovetime = 999999999
facing = facing

[State 700, Effect]
type = Helper
trigger1 = AnimElem = 3 
name = "Effect"
stateno = 8000
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 700, Effect]
type = Helper
trigger1 = AnimElem = 3 && !fvar(19)
name = "Effect"
stateno = 8002
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 8000]
type = Varset
trigger1 = AnimElem = 4
var(10) = 675

[State 8000, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;Burst Anim
[Statedef 8000]
type     = A
movetype = I
physics  = N
ctrl     = 0
sprpriority = 4
anim = 6197

[State 0,1]
type = DestroySelf
trigger1 = parent, movetype = H

[State 0, ]
type = Palfx
trigger1 = 1
add = ceil(-(time*.02)*2000),ceil(-(time*.02)*2000),ceil(-(time*.02)*2000)
time = 1
ignorehitpause = 1
removeongethit = 1
persistent = 1

[State 0, 1]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

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

[State 0,1]
type = Trans
trigger1 = 1
trans = add

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

[State 0,1]
type = AngleDraw
trigger1 = 1
scale = 1,1+(time*.05)

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

[State 0,1]
type = DestroySelf
trigger1 = Time = 10
;---------------------------------------------------------------------------
; POW - Helper
[Statedef 8001]
type = S
movetype = I
physics = N
ctrl = 0
anim = 9997
sprpriority = 0



[State 0, ]
type = Turn
trigger1 = facing = -1
;ignorehitpause = 0
;persistent = 1

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 2,1
dest = 2,3

[State -2, 1]
type = BindtoParent
trigger1 = 1
pos = 0,0
time = 3
ignorehitpause = 1

[State -2, 1]
type = VarSet
trigger1 = !time
var(0) = power
ignorehitpause = 1

[State -2, 1]
type = PowerSet
trigger1 = power > var(0)
value = var(0)
ignorehitpause = 1

[State 8001]
type = Explod
triggerall =  parent, fvar(15) = 0
trigger1 = NumExplod(8001) < 1
anim = 9100
ID = 8000
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = ifelse(teamside=2,320-floor(parent,fvar(16)),floor(parent,fvar(16))),floor(parent,fvar(17))
postype = left
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15) = 0
trigger1 = NumExplod(8001) < 1
anim = 9101
ID = 8001
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = ifelse(teamside=2,311-floor(parent,fvar(16)),floor(parent,fvar(16))-9),floor(parent,fvar(17))-4
postype = left
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15)
trigger1 = NumExplod(8001) < 1
anim = 9100
ID = 8000
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = 0,0
postype = p1
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15)
trigger1 = NumExplod(8001) < 1
anim = 9101
ID = 8001
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = -9,-4
postype = p1
ownpal = 1

[State 8001]
type = ModifyExplod
trigger1 = NumExplod(8001) = 1
ID = 8001
scale = (parent, var(10)/675.0)*.5, .5
sprpriority = 6
facing = 1

[State 8001]
type = RemoveExplod
trigger1 = parent, var(10) <= 0
trigger1 = NumExplod(8000) > 0
trigger2 = roundstate !=2
ID = 8000

[State 8001]
type = RemoveExplod
trigger1 = parent, var(10) <= 0
trigger1 = NumExplod(8001) > 0
trigger2 = roundstate !=2
ID = 8001

[State -2, Cap]
type = Destroyself
trigger1 = parent, var(10) <= 0
trigger1 = NumExplod(8001) = 0
trigger2 = roundstate !=2
; Max effect 3
[Statedef 8002]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 0, 1]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,11
channel = 3
pan = 0

[State 3510, 4]
type = explod
trigger1 = !time 
anim = 6198
pos = 0,-70
postype = p1
facing = facing
sprpriority = 7
scale = .35,.35
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State adjust 1 ]
type = ModifyExplod
trigger1 = time
ID = 9996
scale = .35+(.05*(time)), .4+(.05*(time))


[State 0, ]
type = RemoveExplod
trigger1 = time = 15
ID = 9996


[State 7001, 2]
type = DestroySelf
trigger1 = time = 15


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

; Excel Timer
[Statedef 8004]
type = S
movetype = I
physics = N
ctrl = 0
anim = 9997
sprpriority = 0


[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 2,1
dest = 2,1

[State 0, ]
type = Turn
trigger1 = facing = -1
;ignorehitpause = 0
;persistent = 1



[State -2, 1]
type = BindtoParent
trigger1 = 1
pos = 0,0
time = 3
ignorehitpause = 1

[State -2, 1]
type = VarSet
trigger1 = !time
var(0) = power
ignorehitpause = 1

[State -2, 1]
type = PowerSet
trigger1 = power > var(0)
value = var(0)
ignorehitpause = 1

[State 8001]
type = Explod
triggerall =  parent, fvar(15) = 0
trigger1 = NumExplod(8001) < 1
anim = 9100
ID = 8000
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = ifelse(teamside=2,320-floor(parent,fvar(16)),floor(parent,fvar(16))),floor(parent,fvar(17))
postype = left
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15) = 0
trigger1 = NumExplod(8001) < 1
anim = 9101
ID = 8001
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = ifelse(teamside=2,311-floor(parent,fvar(16)),floor(parent,fvar(16))-9),floor(parent,fvar(17))-4
postype = left
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15)
trigger1 = NumExplod(8001) < 1
anim = 9100
ID = 8000
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = 0,0
postype = p1
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15)
trigger1 = NumExplod(8001) < 1
anim = 9101
ID = 8001
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = -9,-4
postype = p1
ownpal = 1

[State 8001]
type = ModifyExplod
trigger1 = NumExplod(8001) = 1
ID = 8001
scale = (parent, var(30)/180.0)*.5, .5
sprpriority = 6
facing = 1

[State 8001]
type = RemoveExplod
trigger1 = parent, var(30) <= 0
trigger1 = NumExplod(8000) > 0
trigger2 = roundstate !=2
ID = 8000

[State 8001]
type = RemoveExplod
trigger1 = parent, var(30) <= 0
trigger1 = NumExplod(8001) > 0
trigger2 = roundstate !=2
ID = 8001

[State -2, Cap]
type = Destroyself
trigger1 = parent, var(30) <= 0
trigger1 = NumExplod(8001) = 0
trigger2 = roundstate !=2

; RAGE Meter
[Statedef 8005]
type = S
movetype = I
physics = N
ctrl = 0
anim = 9997
sprpriority = 0

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 2,1
dest = 2,2

[State 0, ]
type = Turn
trigger1 = facing = -1
;ignorehitpause = 0
;persistent = 1



[State -2, 1]
type = BindtoParent
trigger1 = 1
pos = 0,0
time = 3
ignorehitpause = 1

[State 8001]
type = Explod
triggerall =  parent, fvar(15) = 0
trigger1 = NumExplod(8001) < 1
anim = 9102
ID = 8000
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = ifelse(teamside=2,320-floor(parent,fvar(16)),floor(parent,fvar(16))),floor(parent,fvar(17))
postype = left
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15) = 0
trigger1 = NumExplod(8001) < 1
anim = 9101
ID = 8001
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = ifelse(teamside=2,311-floor(parent,fvar(16)),floor(parent,fvar(16))-9),floor(parent,fvar(17))-4
postype = left
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15)
trigger1 = NumExplod(8001) < 1
anim = 9102
ID = 8000
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = 0,0
postype = p1
ownpal = 1

[State 8001]
type = Explod
triggerall = parent, fvar(15)
trigger1 = NumExplod(8001) < 1
anim = 9101
ID = 8001
ontop = 1
bindtime = -1
supermove = 1
pausemovetime = -1
facing = 1
scale =.5,.5
pos = -9,-4
postype = p1
ownpal = 1

[State 8001]
type = ModifyExplod
trigger1 = NumExplod(8001) = 1
ID = 8001
scale = (parent, fvar(31)/7200.0)*.5, .5
sprpriority = 6
facing = 1

[State 8001]
type = RemoveExplod
trigger1 = parent, movetype !=H && time >= 60 && parent, fvar(15)
trigger1 = !(parent, var(19))
trigger1 = !(parent, stateno = [920,923])
trigger2 = (parent, stateno = [3000,3999]) && parent, fvar(15)
trigger3 = roundstate !=2
ID = 8000

[State 8001]
type = RemoveExplod
trigger1 = parent, movetype !=H && time >= 60 && parent, fvar(15)
trigger1 = !(parent, var(19))
trigger1 = !(parent, stateno = [920,923])
trigger2 = (parent, stateno = [3000,3999]) && parent, fvar(15)
trigger3 = roundstate !=2
ID = 8001

[State -2, Cap]
type = Destroyself
trigger1 = parent, movetype !=H && time >= 60 && parent, fvar(15)
trigger1 = !(parent, var(19))
trigger1 = !(parent, stateno = [920,923])
trigger2 = (parent, stateno = [3000,3999]) && parent, fvar(15)
trigger3 = roundstate !=2 

;Dodge
[Statedef 197]
type = S
physics = S
movetype = I
anim = 197
velset = 0, 0
ctrl = 0
sprpriority = -1

[State 0, ]
type = PlaySnd
trigger1 = time = 1
value = 2,3+(Random<500)
channel = 0

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

[State 710, HB]
type = HitBy
trigger1 = 1
value = SCA, AT
time = 1

[State 710, Attack]
type = changestate
trigger1 = (time = [15, 25])
trigger1 = command = "x" || command = "y" || command = "z" || command = "a" || command = "b" || command = "c"
value = ifelse((command = "x" || command = "y" || command = "z"), 220, 240)


[State 810, AfterImage]
type = Afterimage
trigger1 = AnimElem = 2 && !var(30)
time = 20
length = 12
timegap = 1
framegap = 3
palbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = add1

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

;Roll Backwards
[Statedef 198]
type = S
physics = N
movetype= I
anim = 198
ctrl = 0
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = time = 1
value = 2,3+(Random<500)
channel = 0

[State 0, ]
type = PlaySnd
trigger1 = time = 1
value = 9,3

[State 810, Velocity]
type = VelSet
trigger1 = AnimElem = 2
x = -5.9

[State 810, Velocity]
type = VelSet
trigger1 = AnimElem = 7
x = 0

[State 810, HitBy]
type = HitBy
trigger1 = time <= 20
value = SCA, NT,ST,HT

[State 810, Push]
type = PlayerPush
trigger1 = AnimElemTime(2) > 0
value = 0

[State 810, AfterImage]
type = Afterimage
trigger1 = AnimElem = 2 && !var(30)
time = 20
length = 12
timegap = 1
framegap = 3
palbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = add1

[State 810, StateChange]
type = Changestate
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;Roll Dodge
[Statedef 199]
type = S
physics = N
movetype= I
anim = 199
ctrl = 0
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = time = 1
value = 2,3+(Random<500)
channel = 0

[State 0, ]
type = PlaySnd
trigger1 = time = 1
value = 9,3

[State 810, Velocity]
type = VelSet
trigger1 = AnimElem = 2
x = 5.9

[State 810, Velocity]
type = VelSet
trigger1 = AnimElem = 7
x = 0

[State 810, HitBy]
type = HitBy
trigger1 = time <= 20
value = SCA, NT,ST,HT

[State 810, Push]
type = PlayerPush
trigger1 = AnimElemTime(2) > 0
value = 0

[State 810, AfterImage]
type = Afterimage
trigger1 = AnimElem = 2 && !var(30)
time = 20
length = 12
timegap = 1
framegap = 3
palbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = add1

[State 810, StateChange]
type = Changestate
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Counter Dodge
[Statedef 900]
type = S
physics = N
movetype= I
ctrl = 0
velset = 0,0

[State 700, Effect]
type = Helper
trigger1 = !time
name = "Effect"
stateno = 179
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 1100, Effect]
type = PlaySnd
trigger1 = Time = 1
value = 9,8
channel = 1

[State 902, Shock]
type = PalFX
trigger1 = Time = 0
time = 2
invertall = 1
mul = 0,0,0

[State 190, 4]
type = ChangeAnim
trigger1 = time <= 12
value = anim

[State 190, 4]
type = ChangeAnim
trigger1 = time = 13
value = 199

[State 199, 5]
type = HitBy
trigger1 = time <= 32
value = SCA, NT,ST,HT


[State 0, ]
type = PlaySnd
trigger1 = time = 14
value = 2,3+(Random<500)
channel = 0

[State 0, ]
type = PlaySnd
trigger1 = time = 14
value = 9,3

[State 810, Velocity]
type = VelSet
triggerall = anim = 199
trigger1 = AnimElem = 2
x = 5.9

[State 810, Velocity]
type = VelSet
triggerall = anim = 199
trigger1 = AnimElem = 7
x = 0

[State 810, Push]
type = PlayerPush
trigger1 = AnimElemTime(2) > 0
value = 0

[State 810, AfterImage]
type = Afterimage
trigger1 = AnimElem = 2
time = 20
length = 12
timegap = 1
framegap = 3
palbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = add1

[State 810, StateChange]
type = Changestate
triggerall = Anim = 199
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Counter Retreat
[Statedef 901]
type    = A
physics = N
ctrl = 0
sprpriority = 1
velset = 0,0
poweradd = -1000

[State 700, Effect]
type = Helper
trigger1 = !time
name = "Effect"
stateno = 179
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 1100, Effect]
type = PlaySnd
trigger1 = Time = 1
value = 9,8
channel = 1

[State 902, Shock]
type = PalFX
trigger1 = Time = 0
time = 2
invertall = 1
mul = 0,0,0

[State 190, 4]
type = ChangeAnim
trigger1 = time <= 12
value = anim

[State 190, 4]
type = ChangeAnim
trigger1 = time = 13
value = 105

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

[State 810, AfterImage]
type = Afterimage
triggerall = anim = 105
trigger1 = AnimElem = 2
time = 20
length = 12
timegap = 1
framegap = 3
palbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = add1

[State 52, Effect]
type = PlaySnd
trigger1 = Time = 14
value = 9, 0
channel = 20

[State 105, 1]
type = VelSet
triggerall = anim = 105
trigger1 = AnimElem = 2
x = -6.5
y = -4.5

[State 105, 1]
type = VelMul
triggerall = anim = 105
trigger1 = AnimElemTime(2) > 0
x = .98

[State 105, 1]
type = VelAdd
triggerall = anim = 105
trigger1 = AnimElemTime(2) > 0
y = .65

[State 105, 3]
type = ChangeState
triggerall = anim = 105
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;Heel Kick (counter version)
[Statedef 910]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
ctrl = 0
velset = 0,0
sprpriority = 2

[State 1100, Effect]
type = PlaySnd
trigger1 = Time = 1
value = 9,8
channel = 1

[State 902, Shock]
type = PalFX
trigger1 = Time = 0
time = 2
invertall = 1
mul = 0,0,0

[State 190, 4]
type = ChangeAnim
trigger1 = time <= 12
value = anim

[State 190, 4]
type = ChangeAnim
trigger1 = time = 13
value = 910

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

[State 0, ]
type = VelSet
trigger1 = AnimElemTime(3) >= 0 && AnimElemtime(11) < 0
x = 5 

[State 0, ]
type = VelSet
trigger1 = AnimElem = 12
x = 0 

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 12 
value = 0, 5

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 12 
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 4                   ;Damage that move inflicts, guard damage
animtype = Back 
air.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 = 13, 13                 ;Time attacker pauses, time opponent shakes
sparkno = 3                      ;Spark anim no (Def: set above)
sparkxy = -10, -40
;Y-offset for the spark rel. to p1
hitsound  = s(ifelse(fvar(21),15,5)), 5                  ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = Low               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 20             ;Time that the opponent slides back
ground.hittime  = 20             ;Time opponent is in hit state
ground.velocity = -4,-7            ;Velocity at which opponent is pushed
airguard.velocity = -3,-3     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -4,-4           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 11                 ;Time before opponent regains control in air
givepower = 35, 35
guard.velocity = -11
envshake.time = 10
envshake.ampl = 3
fall = 1
fall.recover = 0
air.fall = 1
air.recover = 0
yaccel = .49
kill = 0

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

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Standing Just Defense
[Statedef 920]
type = S
movetype = I
physics = S
anim = 150
velset = 0,0
ctrl = 0

[State 500, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 500, VarAdd]
type = VarAdd
triggerall = fVar(10) = 1
trigger1 = !Time && !var(19)
fvar(31) = 600

[State 500, LifeAdd]
type = LifeAdd
trigger1 = Time = 0
value = 25

[State 500, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 9,13

[State 500, Pause]
type = Pause
trigger1 = Time = 0
time = 3

[State 700, Effect]
type = Helper
trigger1 = !time && !fvar(19)
name = "Effect"
stateno = 925
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 900
pos = 0,0
sprpriority = 3
ownpal = 1
scale = 1,1
pausemovetime = -1
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 905
pos = 0,-65
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 906
pos = 0,-65
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1

[State 500, ChangeState]
type = ChangeState
trigger1 = Var(9) <= 2
value = 130
ctrl = 1

;----------------------------------------------------------------------------------
; Crouching Just Defense
[Statedef 921]
type = C
movetype = I
physics = C
anim = 151
velset = 0,0
ctrl = 0

[State 510, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 700, Effect]
type = Helper
trigger1 = !time && !fvar(19)
name = "Effect"
stateno = 925
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 510, VarAdd]
type = VarAdd
triggerall = fVar(10) = 1
trigger1 = !Time && !var(19)
fvar(31) = 600

[State 510, LifeAdd]
type = LifeAdd
trigger1 = Time = 0
value = 25

[State 510, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 9,13

[State 510, Pause]
type = Pause
trigger1 = Time = 0
time = 3

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 901
pos = 0,0
sprpriority = 3
ownpal = 1
scale = 1,1
pausemovetime = -1
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 905
pos = 0,-45
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 906
pos = 0,-45
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1


[State 510, ChangeState]
type = ChangeState
trigger1 = Var(9) <= 2
value = 131
ctrl = 1

;----------------------------------------------------------------------------------
; Aerial Just Defense
[Statedef 922]
type = A
movetype = I
physics = N
anim = 152
velset = 0,0
ctrl = 0

[State 520, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 700, Effect]
type = Helper
trigger1 = !time && !fvar(19)
name = "Effect"
stateno = 925
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 520, VarAdd]
type = VarAdd
triggerall = fVar(10) = 1
trigger1 = !Time && !var(19)
fvar(31) = 600

[State 520, LifeAdd]
type = LifeAdd
trigger1 = Time = 0
value = 25

[State 520, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 9,13

[State 520, Pause]
type = Pause
trigger1 = Time = 0
time = 3

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 902
pos = 0,0
sprpriority = 3
ownpal = 1
scale = 1,1
pausemovetime = -1
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 905
pos = 0,-55
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 906
pos = 0,-55
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1


[State 520, ChangeState]
type = ChangeState
trigger1 = Var(9) <= 2
value = 923
ctrl = 1

;----------------------------------------------------------------------------------
; Aerial Just Defense Fall
[Statedef 923]
type = A
physics = N
velset = -1.5,-5.3
ctrl = 1
anim = 44

[State 530, Gravity]
type = Gravity
trigger1 = 1

[State 530, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52


;Just Defended
[Statedef 925]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 0, 1]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,9
channel = 3
pan = 0

[State 3510, 4]
type = explod
trigger1 = !time
anim = 907
pos = 0,ifelse(parent,stateno=921,-45,-65)
postype = p1
facing = facing
sprpriority = 7
scale = .495,.495
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State adjust 1 ]
type = ModifyExplod
trigger1 = time
ID = 9996
scale = .495+(.005*(time)), .495+(.005*(time))


[State 0, ]
type = RemoveExplod
trigger1 = time = 19
ID = 9996


[State 7001, 2]
type = DestroySelf
trigger1 = time = 19


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


;Parrying (Window)
[Statedef 936]
type = A
movetype = I
physics = N
anim = 9997
velset = 0,0
ctrl = 0

[State 0, ]
type = BindToParent
trigger1 = 1
time = 1
pos = 0,0

[State 0, 1]
type = ParentVarSet
trigger1 = !Time
var(12) = 6
ignorehitpause = 1

[State 0, ]
type = DestroySelf
trigger1 = parent, command != "holdfwd"



;----------------------------------------------------------------------
;Succesful Parry (Air)
[Statedef 937]
type = A
movetype= I
physics = N
anim = 937
ctrl = 0
poweradd = 78
facep2 = 1
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority = 2

[State 700, blueflash]
type=palfx
trigger1= !time && !var(14)
add=0,64,255
sinadd=0,-64,-255,60
time=15

[State 700, blueflash]
type=palfx
trigger1= !time && var(14)
add=255,0,0
sinadd=-255,0,0,60
time=15

[State 0, 2]
type = StateTypeSet
trigger1 = !time
movetype = H

[State 0, 3]
type = Null
trigger1 = (!Time)
trigger1 = (Var(12) := 0) && (Var(13) := 1) 
trigger2 = (Command = "holdfwd") && (Var(12) = 0) && (Var(13) = 0)
trigger2 = (Var(12) := 5)

[State 0, 1]
type = VarSet
trigger1 = !Time
fvar(0) = Vel X

[State 0, 4]
type = StateTypeSet
trigger1 = (!Time)
movetype = I

[State 0, 2]
type = PlaySnd
trigger1 = Time = 3
value = 8,0+var(14)
volume = 255

[State 0, 2]
type = PlaySnd
trigger1 = Time = 3
value = 2,4
volume = 255

[State 0, 2]
type = NotHitBy
trigger1 = (Time < 13)
value = SCA
time = 2

[State 0, 2]
type = Pause
trigger1 = time = 3
time = 15
movetime = 11

[State 7005:	VelSet]
type = VelSet
trigger1 = (!Time)
x = 0
y = 0

[State 7005:	VelSet]
type = VelSet
trigger1 = (Time = 12)
y = -2

[State 7005:	VelSet]
type = VelSet
trigger1 = (Time = 13)
x = FVar(0)

[State 7005:	VelAdd]
type = VelAdd
trigger1 = (Time > 12)
y = 0.54

[State 0, ]
type = Explod
trigger1 = AnimElem = 2
anim = 935+(var(14))
id = 98
pos = 27,-85
postype = p1
bindtime = 1
vel = 0,0
pausemovetime = 20
scale	= .5,.5
sprpriority	= 5
ownpal = 1

[State 0, 1]
type = EnvShake
trigger1 = AnimElem = 2 && var(14)
time = 10

[State 0, 3]
type = PosAdd
trigger1 = (AnimElem = 2, = 0) || (AnimElem = 2, = 4) || (AnimElem = 2, = 8)
x = 2

[State 0, 3]
type = PosAdd
trigger1 = (AnimElem = 2, = 1) || (AnimElem = 2, = 5) || (AnimElem = 2, = 9)
x = -2

[State 0, 6]
type = StopSnd
trigger1 = !Time
channel = -1

[State 0, 8]
type = CtrlSet
trigger1 = (Time > 10)
value	= 1

[State 0, 9]
type = ChangeState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value	= 52

;Succesful Parry (Ground)
[Statedef 938]
type = C
movetype= I
physics = N
anim = 938
velset = 0,0
ctrl = 0
poweradd = 78
facep2 = 1
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority	= 2

[State 700, blueflash]
type=palfx
trigger1= !time && !var(14)
add=0,64,255
sinadd=0,-64,-255,60
time=15

[State 700, blueflash]
type=palfx
trigger1= !time && var(14)
add=255,0,0
sinadd=-255,0,0,60
time=15

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

[State 0, 2]
type = StateTypeSet
trigger1 = !time
movetype = H

[State 0, 3]
type = Null
trigger1 = (!Time)
trigger1 = (Var(12) := 0) && (Var(13) := 1) 
trigger2 = (Command = "holdfwd") && (Var(12) = 0) && (Var(13) = 0)
trigger2 = (Var(12) := 4)

[State 0, 4]
type = StateTypeSet
trigger1 = (!Time)
movetype = I

[State 0, 2]
type = PlaySnd
trigger1 = Time = 3
value = 8,0+(var(14))
volume = 255

[State 0, 1]
type = EnvShake
trigger1 = AnimElem = 2 && var(14)
time = 10

[State 0, 2]
type = PlaySnd
trigger1 = Time = 3
value = 2,4
volume = 255

[State 0, 2]
type = NotHitBy
trigger1 = (Time < 13)
value = SCA
time = 2

[State 0, 2]
type = Pause
trigger1 = time = 3
time = 15
movetime = 11

[State 0, 3]
type = PosAdd
trigger1 = (AnimElem = 2, = 0) || (AnimElem = 2, = 4) || (AnimElem = 2, = 8)
x = 2

[State 0, 3]
type = PosAdd
trigger1 = (AnimElem = 2, = 1) || (AnimElem = 2, = 5) || (AnimElem = 2, = 9)
x = -2

[State 0, ]
type = Explod
trigger1 = AnimElem = 2
anim = 935+(var(14))
id = 98
pos = 44,-36
postype = p1
bindtime = 1
vel = 0,0
pausemovetime = 20
scale	= .5,.5
sprpriority	= 5
ownpal = 1

[State 0, 6]
type = StopSnd
trigger1 = (!Time)
channel = -1

[State 0,7]
type = HitOverride
triggerall = (Var(12) > 0) && (Command = "holdfwd")
trigger1 = (Command != "holddown") && (Command != "holdback")
attr = SA,NA,SA,HA,NP,SP,HP
slot = 2
stateno = 99
ignorehitpause = 1

[State 0, 8]
type = CtrlSet
trigger1 = (Time > 10)
value	= 1

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



;Succesful Parry (Ground)
[Statedef 939]
type = S
movetype= I
physics = N
anim = 939
velset = 0,0
ctrl = 0
poweradd = 78
facep2 = 1
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority	= 2

[State 700, blueflash]
type=palfx
trigger1= !time && !var(14)
add=0,64,255
sinadd=0,-64,-255,60
time=15

[State 700, blueflash]
type=palfx
trigger1= !time && var(14)
add=255,0,0
sinadd=-255,0,0,60
time=15
[State 0, 1]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 0, 2]
type = StateTypeSet
trigger1 = !time
movetype = H

[State 0, 3]
type = Null
trigger1 = (!Time)
trigger1 = (Var(12) := 0) && (Var(13) := 1) 
trigger2 = (Command = "holdfwd") && (Var(12) = 0) && (Var(13) = 0)
trigger2 = (Var(12) := 4)

[State 0, 4]
type = StateTypeSet
trigger1 = (!Time)
movetype = I

[State 0, 2]
type = PlaySnd
trigger1 = Time = 3
value = 8,0+var(14)
volume = 255

[State 0, 2]
type = PlaySnd
trigger1 = Time = 3
value = 2,4
volume = 255

[State 0, 1]
type = EnvShake
trigger1 = AnimElem = 2 && var(14)
time = 10

[State 0, 2]
type = NotHitBy
trigger1 = (Time < 13)
value = SCA
time = 2

[State 0, 2]
type = Pause
trigger1 = time = 3
time = 15
movetime = 11

[State 0, 3]
type = PosAdd
trigger1 = (AnimElem = 2, = 0) || (AnimElem = 2, = 4) || (AnimElem = 2, = 8)
x = 2

[State 0, 3]
type = PosAdd
trigger1 = (AnimElem = 2, = 1) || (AnimElem = 2, = 5) || (AnimElem = 2, = 9)
x = -2

[State 0, ]
type = Explod
trigger1 = AnimElem = 2
anim = 935+var(14)
id = 98
pos = 44,-53
postype = p1
bindtime = 1
vel = 0,0
pausemovetime = 20
scale	= .5,.5
sprpriority	= 5
ownpal = 1

[State 0, 6]
type = StopSnd
trigger1 = (!Time)
channel = -1

[State 0,7]
type = HitOverride
triggerall = (Var(12) > 0) && (Command = "holdfwd")
trigger1 = (Command != "holddown") && (Command != "holdback")
attr = SA,NA,SA,HA,NP,SP,HP
slot = 2
stateno = 99
ignorehitpause = 1

[State 0, 8]
type = CtrlSet
trigger1 = (Time > 10)
value	= 1

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

;Rage Flicker
[Statedef 950]
type    = S
physics = N
ctrl = 0
velset = .1*(-2+random%3),.1*(-2+random%3)
sprpriority = 3*(-1+random%3)

[State 2, ]
type = NotHitBy
trigger1 = time >= 0
value = SCA,AA
value2 = SCA,AP

[State 2,aft ]
type = AfterImage
trigger1 = time = 0
time = 100000
length = 10
palcolor = 1
palinvertall = 0
palbright = 20,20,20
palcontrast = 220,160,120
palpostbright = 0,-120,-250
paladd = 20,10,10
palmul = .75,.55,.55
timegap = 1
framegap = 2
trans = addalpha
alpha = 128,256
ignorehitpause = 1

[State 2,as ]
type = AssertSpecial
trigger1 = time >= 0
flag = noshadow

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 128-time*40, 256-time*4


[State 2,anim ]
type = ChangeAnim
trigger1 = time >= 0
value = parent, anim
elem =  parent, animelemno(1)
ignorehitpause = 1

[State 2,ds ]
type = DestroySelf
;trigger1 = parent, power != 3000
trigger1 = parent, movetype = H
trigger2 = time = 3

; Max effect 3
[Statedef 951]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 0, 1]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,12
channel = 3
pan = 0

[State 3510, 4]
type = explod
trigger1 = !time
anim = 10004
pos = 0,-70
postype = p1
facing = facing
sprpriority = 7
scale = .35,.35
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State adjust 1 ]
type = ModifyExplod
trigger1 = time
ID = 9996
scale = .35+(.05*(time)), .4+(.05*(time))


[State 0, ]
type = RemoveExplod
trigger1 = time = 15
ID = 9996


[State 7001, 2]
type = DestroySelf
trigger1 = time = 15


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

; Standby
[Statedef 952]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 7001, 2]
type = DestroySelf
trigger1 = !(parent, var(56))

[State 0, 1]
type = ChangeState
trigger1 = roundstate = 2
value = 953

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

; Oversoul effect
[Statedef 953]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 0, 1]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,16
channel = 3
pan = 0

[State 0, 1]
type = BGPalFX
trigger1 = time < 14
time = 15
add = -75,-75,-75
sinadd = 75,75,75,60
ignorehitpause = 1

[State 500, Explod]
type = Explod
trigger1 = !Time
anim = 906
pos = 0,-70
sprpriority = 3
ownpal = 1
scale = .5,.5
pausemovetime = -1
ignorehitpause = 1

[State 3510, 4]
type = explod
trigger1 = !time
anim = 10007
pos = 0,-70
postype = p1
facing = facing
sprpriority = 7
scale = .35,.35
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State adjust 1 ]
type = ModifyExplod
trigger1 = time
ID = 9996
scale = .35+(.05*(time)), .4+(.05*(time))


[State 0, ]
type = RemoveExplod
trigger1 = time = 15
ID = 9996


[State 7001, 2]
type = DestroySelf
trigger1 = time = 15


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


;Excel Activation (ground)
[Statedef 960]
type=S
physics=S
movetype=A
anim=960
velset=0,0
ctrl=0
sprpriority=2
poweradd=-1000

[State 8000, Timer Bar]
type = Helper
triggerall = floor(fvar(15)) != 2
trigger1 = time = 6
helpertype = normal
ID = 8000
name = "Max Timer"
pos = ifelse(teamside=2,240,80),228
postype = left
stateno = 8004
scale = 1,1
keyctrl = 0
ownpal = 1
sprpriority = 5
pausemovetime = 999999999
supermovetime = 999999999
facing = facing


[State 900, nhb]
type=nothitby
trigger1= !time
value=SCA
time=58
[State 900, stop]
type=posfreeze
trigger1= 1
value=1
[State 900, var]
type=varset
trigger1= time>=4
var(30)=200

[State 900, unguardable]
type=varset
trigger1= time=4 && numenemy
trigger1= (enemynear,stateno!=[120,155])
var(17)=30

[State 900, Snd]
type=playsnd
trigger1= time=4
value=1,8
channel=0

[State 900, Super Pause FX]
type=helper
trigger1= time=4
helpertype=normal
stateno=969
ID=969
name="Excel Charge"
postype=p1
pos=-6,-79
supermovetime=255
size.xscale=1
size.yscale=1
ownpal=1

[State 900, Super Pause]
type=superpause
trigger1= time=4
time=50
movetime=50
anim=-1
sound=s21,2
p2defmul=1
darken=0

[State 3000, AfterImage]
type = AfterImage
trigger1 = time = 4
time = 999
TimeGap  = 1
FrameGap = 4
length = 13
PalBright = 0,0,0
PalContrast = 32, 160, 160
PalAdd = 0,0,0
PalMul = .75,.75,.75
trans = addalpha
alpha = 256, 160

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


;Excel Activation (aerial)
[Statedef 965]
type=A
physics=N
movetype=A
anim=965
ctrl=0
sprpriority=2
poweradd=-1000

[State 8000, Timer Bar]
type = Helper
triggerall = floor(fvar(15)) != 2
trigger1 = time = 6
helpertype = normal
ID = 8000
name = "Max Timer"
pos = ifelse(teamside=2,240,80),228
postype = left
stateno = 8004
scale = 1,1
keyctrl = 0
ownpal = 1
sprpriority = 5
pausemovetime = 999999999
supermovetime = 999999999
facing = facing

[State 905, nhb]
type = nothitby
trigger1 = !time
value = SCA
time = 58
[State 905, stop]
type= posfreeze
trigger1 = 1
value = 1

[State 905, var]
type = varset
trigger1 = time>=4
var(30) = 200

[State 905, unguardable]
type=varset
trigger1= time=4 && numenemy
trigger1= (enemynear,stateno!=[120,155])
var(17)=30

[State 905, Snd]
type=playsnd
trigger1= time=4
value=1,8
channel=0

[State 905, Super Pause FX]
type=helper
trigger1= time=4
helpertype=normal
stateno=969
ID=969
name="Excel Charge"
postype=p1
pos=1,-77
supermovetime=255
size.xscale=1
size.yscale=1
ownpal=1

[State 905, Super Pause]
type=superpause
trigger1= time=4
time=50
movetime=50
anim=-1
sound=s21,2
p2defmul=1
darken=0

[State 3000, AfterImage]
type = AfterImage
trigger1 = time = 4
time = 999
TimeGap  = 1
FrameGap = 4
length = 13
PalBright = 0,0,0
PalContrast = 32, 160, 160
PalAdd = 0,0,0
PalMul = .75,.75,.75
trans = addalpha
alpha = 256, 160

[State 905, End]
type=changestate
trigger1= !animtime
value=966
ctrl=1


[Statedef 966]
type=A
physics=N
movetype=I
anim=44
ctrl=1
[State 906, grav]
type=gravity
trigger1= 1
[State 906, Land]
type=changestate
trigger1= vel y>0 && pos y>=0
value=52

;Excel Effect
[Statedef 969]
type    = A
movetype= I
physics = N
anim = 9997
velset = 0,0
ctrl = 0

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 4,1
dest = 4,4

[State 0, 1]
type = BGPalFX
trigger1 = !time
time = 20
sinadd = -255,-50,-50,80
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = [20,47]
time = 3
add = -255,-50,-50
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = 48
time = 20
add = -255,-50,-50
sinadd = 255,50,50,80
ignorehitpause = 1

[State 0, 1]
type = PalFX
trigger1 = !time
time = 1
add = 0,0,0

[State 0, ]
type = Explod
trigger1 = !Time
anim = 9130
id = 9130
pos = 0,0
postype = P1
sprpriority = 5
supermove = 1
bindtime = -1
ownpal = 0
persistent = 0
scale = .5,.5
pausemovetime = 999999
Supermovetime = 999999

[State 3510, 4]
type = explod
trigger1 = !time && !(parent, fvar(19))
anim = 9131
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9131
ignorehitpause = 1
ownpal = 0

[State 0, ]
type = Explod
trigger1 = !Time
anim = 9120
id = 9120
pos = 0,0
postype = P1
sprpriority = 5
supermove = 1
bindtime = -1
scale = 0,0
ownpal = 0
persistent = 0
pausemovetime = 999999
Supermovetime = 999999
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = Time = 10
anim = 9120
id = 9121
pos = 0,0
postype = P1
sprpriority = 5
supermove = 1
bindtime = -1
scale = 0,0
ownpal = 0
persistent = 0
pausemovetime = 999999
Supermovetime = 999999
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = Time = 20
anim = 9120
id = 9122
pos = 0,0
postype = P1
sprpriority = 5
supermove = 1
bindtime = -1
scale = 0,0
ownpal = 0
persistent = 0
pausemovetime = 999999
Supermovetime = 999999
scale = .5,.5


[State adjust 2 ]
type = ModifyExplod
trigger1 = time >= 0
ID = 9131
scale = .75-(.01*time), .755-(.01*time)
;sprpriority = 0
;ontop = 0
;shadow = 0,0,0
;ownpal = 0
;removeongethit = 0
;ignorehitpause = 0
;persistent = 1

[State 0, 1]
type = ModifyExplod
trigger1 = Time >= 1
anim = 9120
ID = 9120
sprpriority = 5
vel=0,0
scale =.5*(Time*0.05) ,.5*(Time*0.05)

[State 0, 1]
type = ModifyExplod
trigger1 = Time >= 10
ID = 9121
sprpriority = 5
vel=0,0
scale =.5*((Time-10)*0.05) ,.5*((Time-10)*0.05)

[State 0, 1]
type = ModifyExplod
trigger1 = Time >= 20
ID = 9122
sprpriority = 5
vel=0,0
scale =.5*((Time-20)*0.05) ,.5*((Time-20)*0.05)


[State -2, RemoveExplod]
type = RemoveExplod
trigger1 = time = 50
id = 9110

[State 1150, ChangeState]
type = DestroySelf
trigger1 = time = 50

;Alpha Counter
[Statedef 970]
type = S
physics = S
movetype = I
anim = 970
velset = 0, 0
ctrl = 0
sprpriority = 2
poweradd = ifelse(var(56),-500,-1000)
facep2 = 1

[State 750, Button]
type = varset
trigger1 = !time && !AILevel
var(1) = (command = "AC2")
ignorehitpause = 1

[State 750, Button]
type = varset
trigger1 = !time && AILevel
var(1) = (Enemynear, statetype != A)
ignorehitpause = 1

[State 750, NHB]
type = nothitby
trigger1 = 1
value = SCA
time = 1

[State 750, Stop]
type = posfreeze
trigger1 = 1
value = 1

[State 750, Snd]
type = playsnd
trigger1 = !time
value = 4, 0
channel = 0

[State 750, SuperPause FX]
type = helper
trigger1 = !time
helpertype = normal
stateno = 979
ID = 979
name = "AC FX"
postype = p1
pos = 29, -68
supermovetime = 255
ownpal = 1

[State 750, Super Pause]
type = superpause
trigger1 = !time
time = 20
movetime = 20
p2defmul = 1
anim = -1
sound = s0, 750
darken = 0

[State 750, End]
type = changestate
trigger1 = time >= 20
value = ifelse(var(1) = 1, 972, 971)

;Punch Counter
[Statedef 971]
type    = S
movetype= A
physics = S
juggle  = 8
ctrl = 0
velset = 0,0
anim = 971
sprpriority = -1

[State 170, 1]
type = NotHitBy
trigger1 = AnimElemtime(5) < 0
value = SCA
time = 3

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (4) >= 0) && (AnimElemTime (5) < 0)
value = 20,0

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (5) >= 0) && (AnimElemTime (7) < 0)
value = 8,0

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 2
x = 28
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 3
x = 9
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 4
x = 7
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 5
x = 17
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 6
x = -1
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 7
x = -2
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 8
x = -12
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = AnimElem = 9
x = -12
ignorehitpause = 1

[State 0, ]
type = PosAdd
trigger1 = !AnimTime
x = -31
ignorehitpause = 1

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 2

[State 210, 1]
type = PlaySnd
trigger1 = AnimElem = 5 
value = 2, 6
channel = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
hitflag = MAF
guardflag = M
priority = 4, Hit
damage =42, 7
getpower = 0, 0
givepower = 36, 36
pausetime = 20, 20
guard.pausetime = 20, 20
animtype = Diagup
air.animtype = Diagup
fall.animtype = Diagup
ground.type = Low
air.type = Low
ground.hittime = 18
ground.slidetime = 18
guard.hittime = 18
air.hittime = 120
ground.velocity = -6, -6
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.cornerpush.veloff = 0
air.velocity = -6, -6
air.cornerpush.veloff = 0
yaccel = 0.58
fall = 1
fall.recover = 1
fall.recovertime = 120
forcestand = 1
hitsound = -1 + 0 * (var(46) :=8)
guardsound = -1 + 0 * (var(47) :=0)
sparkno = 3
sparkxy = -10 ,-85
palfx.time = 12 
palfx.add = 255, 255, 255
palfx.sinadd = -255, -255, -255, 48
envshake.time = 24
envshake.ampl = 4
envshake.freq = 120
kill = 0

[State 210, 4]
type = SprPriority
trigger1 = AnimElem = 6
value = 2

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

;Kick Counter
[Statedef 972]
type    = S
movetype= A
physics = S
juggle  = 4
anim = 972
ctrl = 0
velset = 0,0
sprpriority = 2

[State 170, 1]
type = NotHitBy
trigger1 = AnimElemtime(12) < 0
value = SCA
time = 3

[State 0, ]
type = VelSet
trigger1 = AnimElemTime(3) >= 0 && AnimElemtime(11) < 0
x = 7

[State 0, ]
type = VelSet
trigger1 = AnimElem = 12
x = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 12
value = 0, 5

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 12
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 7                   ;Damage that move inflicts, guard damage
animtype = Hard
air.animtype = DiagUp                ;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 = 20, 20                 ;Time attacker pauses, time opponent shakes
sparkno = 3                      ;Spark anim no (Def: set above)
sparkxy = -10, -40
;Y-offset for the spark rel. to p1
hitsound  = -1 + 0 * (var(46) :=8)              ;Sound to play on hit
guardsound = -1 + 0 * (var(47) :=0)                ;Sound to play on guard
ground.type = Low               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 20             ;Time that the opponent slides back
ground.hittime  = 20             ;Time opponent is in hit state
air.hittime = 120
ground.velocity = -20
guard.velocity = -12
guard.cornerpush.veloff = 0
air.velocity = -6, -6
air.cornerpush.veloff = 0
yaccel = 0.58
givepower = 35, 35
guard.velocity = -11
palfx.time = 12
palfx.add = 255, 255, 255
palfx.sinadd = -255, -255, -255, 48
envshake.time = 24
envshake.ampl = 4
envshake.freq = 120
kill = 0
air.fall = 1
air.recover = 0
p2stateno = 975


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

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Stand get-hit (shaking)
[Statedef 975]
type    = U
movetype= H
physics = N
velset = 0,0

[State 5000, 7]
type = SelfState
trigger1 = statetype = A
value = 5030

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

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 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 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 976 ;Stand get-hit (knocked back)

[State 5000, 7]
type = SelfState
trigger1 = HitShakeOver
value = 5030

;---------------------------------------------------------------------------
; Stand get-hit (knocked back)
[Statedef 976]
type    = S
movetype= H
physics = S

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = ChangeState
trigger1 = HitOver
value = 977

;YOU GOT KNOCKED THE FUCK OUT!!
[Statedef 977]
type = S
physics = S
movetype = I
anim = 5300
velset = 0,0
sprpriority = 2
ctrl = 0

[State 0]
type = posset
trigger1 = !time
y = 0


[State 2103, 3]
type = SelfState
trigger1 = time >= 50
value = 0
ctrl = 1

;Alpha Counter FX
[Statedef 979]
type    = A
movetype= I
physics = N
anim = 9997
velset = 0,0
ctrl = 0

[State 0, 1]
type = BGPalFX
trigger1 = 1
time = 3
add = -255,-255,0
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = Time = 1
value = 9, 14

[State 0, ]
type = AssertSpecial
trigger1 = time = [0,20]
flag= noFG
flag2 = NoBarDisplay

[State 3510, 4]
type = explod
trigger1 = !time
anim = 979
pos = 0,0
postype = left
sprpriority = -3
under = 1
supermove = 1
bindtime = 9999
removetime = 20
ignorehitpause = 1
ownpal = 0
scale = .5,ifelse(parent, var(18),.375,.5)

[State 0, ]
type = Explod
trigger1 = !Time
anim = 9120
id = 9120
pos = 0,0
postype = P1
sprpriority = 5
supermove = 1
bindtime = -1
scale = 0,0
ownpal = 0
persistent = 0
pausemovetime = 999999
Supermovetime = 999999


[State 0, 1]
type = ModifyExplod
trigger1 = Time >= 1
anim = 9120
ID = 9120
sprpriority = 5
vel=0,0
scale =Time*0.1 , Time*0.1


[State -2, RemoveExplod]
type = RemoveExplod
trigger1 = time = 20
id = 9120

[State 1150, ChangeState]
type = DestroySelf
trigger1 = time = 20

; Counter effect
[Statedef 980]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 4,1
dest = 3,3

[State 0, 1]
type = BindToParent
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 8,2
channel = 3
pan = 0

[State 0, Shake]
type = EnvShake
trigger1 = !time && parent, stateno < 800
time = 14
ampl = 4

[State 3510, 4]
type = explod
trigger1 = !time
anim = 10008
pos = 0,-60
postype = p2
facing = facing
sprpriority = 7
scale = .35,.35
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State 0, ]
type = Explod
trigger1 = !Time
anim = 9120
id = 9120
pos = 0,-60
postype = p2
sprpriority = 5
supermove = 1
bindtime = -1
scale = 0,0
removetime = 15
ownpal = 0
persistent = 0
pausemovetime = 999999
Supermovetime = 999999
scale = .5,.5

[State adjust 1 ]
type = ModifyExplod
trigger1 = time
ID = 9996
scale = .35+(.05*(time)), .4+(.05*(time))

[State 0, 1]
type = ModifyExplod
trigger1 = Time >= 0
anim = 9120
ID = 9120
sprpriority = 5
vel=0,0
scale =.5*(Time*0.1) ,.5*(Time*0.1)

[State 0, ]
type = RemoveExplod
trigger1 = time = 15
ID = 9996


[State 7001, 2]
type = DestroySelf
trigger1 = time = 15


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

; Manual Rage Burst
[Statedef 981]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 196
ctrl = 0
sprpriority = 2

[State 0, SuperPause]
type = SuperPause
trigger1 = !time
time = 20
anim = -1
movetime = 20
p2defmul = 0
unhittable = 1

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = !time
source = 3,2
dest = 4,3

[State 0, ]
type = Explod
trigger1 = AnimElem = 4
anim = 6196
pos = -3,-84
postype = p1
scale = .5, .5
sprpriority = 4
ownpal = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 2, 5
channel = 0

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 9, 10

[State 700, Effect]
type = Helper
trigger1 = AnimElem = 3
name = "Effect"
stateno = 8000
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 700, Effect]
type = Helper
trigger1 = AnimElem = 3 && !fvar(19)
name = "Effect"
stateno = 951
ID = 194
pos = 0,0
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 8000]
type = Varset
trigger1 = AnimElem = 4
var(19) = 1

[State 8000, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;Power Charge Effect
[Statedef 996]
type = S
anim = 9997
velset = 0, 0
ctrl = 0

[State 8330, Bind]
type = bindtoroot
trigger1 = (root, stateno = 998)
pos = -10, 0
[State 8330, Snd]
type = playsnd
trigger1 = !time
value = 21,1
channel = 0

[State 8330, Aura]
type = explod
trigger1 = !numexplod(10000)
ID = 10000
anim = 10000
sprpriority = 3
postype = p1
bindtime = -1
removetime = -1
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 8330, End]
type = changestate
trigger1 = root, stateno != 998
value = 997


;Power Charge Effect(End)
[Statedef 997]
type = S
anim = 9997
velset = 0, 0
ctrl = 0

[State 8330, End]
type = removeexplod
trigger1 = !time

[State 8330, Aura]
type = explod
trigger1 = !numexplod(10000)
ID = 10000
anim = 10001
sprpriority = 3
postype = p1
bindtime = -1
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1



[State 8330, End]
type = stopsnd
trigger1 = !time
channel = 0
[State 8330, End]
type = destroyself
trigger1 = time = 6


;I'mma Chargin' Mah.... Powerbar
[Statedef 998]
type = S
physics = S
movetype = I
anim = 998
velset = 0, 0
ctrl = 0

[State 730, Power]
type = poweradd
triggerall = power < const(data.power) && power < powermax
trigger1 = 1
value = (2 + ifelse(time < 30, 0, (time -30) / 10))*(ifelse(var(56),7,1))


[State 730, shake]
type=envshake
trigger1= !(time%4)
time=4
ampl=2

[State 730, Snd]
type = playsnd
trigger1 = !time
value = 2, 11
channel = 0

[State 730, Flash]
type = palfx
trigger1 = 1
time = 1
add = 0, 15 + ceil(sin(time / 6.0 * pi) * 15), 75 + ceil(sin(time / 6.0 * pi) * 75)

[State 900, particulas]
type = Explod
trigger1 = !(time%4)
anim = 10002
pos = 0,-5
random = 80,10
sprpriority = 5
ownpal = 1
vel = ceil(1-random/500),-ceil(2+random/333)
accel = 0,.15
facing = -1+(random<500)*2
scale = .5,.5

[State 900, particulas]
type = Explod
trigger1 = !(time%4)
anim = 10002
pos = 0,-65
random = 50,80
sprpriority = -5
ownpal = 1
vel = 0, -1.9
scale = .5,.5


[State 730, FX]
type = helper
trigger1 = !numhelper(996)
helpertype = normal
stateno = 996
ID = 996
name = "Power Charge"
postype = p1
pausemovetime = 65535
supermovetime = 65535
ownpal = 1

[State 730, End]
type = changestate
trigger1 = power >= const(data.power) || power >= powermax || roundstate != 2
trigger2 = !AILevel && (command != "holdz" || command != "holdc")
trigger3 = AIlevel && (inguarddist || p2movetype = A || p2dist x < 160)
value = 999
ctrl = 1


;Charge End
[Statedef 999]
type = S
physics = S
movetype = I
anim = 999
velset = 0, 0
ctrl = 1
[State 731, Snd]
type = stopsnd
trigger1 = !time
channel = 0
[State 730, Snd]
type = playsnd
trigger1 = !time && power >= const(data.power)
value = 1, 6
channel = 0
persistent = 0
[State 730, End]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = S
movetype= I
physics = N
anim = 5200
velset = 0,0

[State -3, Landing Sound]
type = GameMakeAnim
trigger1 = !Time 
value = 60
pos = 0,0
under = 1

[State 0, ]
type = PlaySnd
trigger1 = time = 1
value = 9,3

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = !Time 
trigger1 = p2dist X < -5

[State 5201, 2]
type = VelSet
trigger1 = !Time 
x = -6

[State 5201, 2]
type = VelSet
trigger1 = vel X > -.1
x = 0

[State 5201, 2]
type = VelMul
trigger1 = 1
x = .95


[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

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

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = !Time 
time = 3
mul = 600,600,600

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

[State 5201, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State CONFIG]
type = Helper
triggerall = !NumHelper(12345) && roundstate = 0
trigger1 = roundsexisted = 0
;trigger2 = enemynear, teammode = turns
stateno = 12345
name = "Configuration Options"
pos = 0,0
postype = p1
pausemovetime = 999999
supermovetime = 999999
id = 12345

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 1,1
dest = 1,palno+(var(55)*12)

[State 5900, 3] ;Intro for round 1
type = ChangeState
trigger1 = roundsexisted = 0
value = 190

;Death by Cheese
[Statedef 5950]
type = S
movetype = H
physics =S
anim = 5950
velset = 0,0

[State 5950, NHB]
type = NotHitBy
trigger1 = 1
value = SCA

[State 5950, Pos]
type = PosSet
trigger1 = 1
y = 0

[State 5950, KO Snd]
type = assertspecial
trigger1 = 1
flag = NoKOSnd

[State 5950, KO Snd]
type = StopSnd
trigger1 = !time && !alive
channel = 0

[State 5950, KO Snd]
type = PlaySnd
trigger1 = AnimElem =2 && !alive
value = 11,1

[State 5981, Snd]
type = PlaySnd
trigger1 = AnimElem = 6
value = f7,0

[State 5981, FX]
type = Explod
trigger1 = AnimElem=6
anim = f60
postype = p1
pos = 0,0
sprpriority = -3

[State 5950, End]
type = ChangeState
trigger1 = !animtime
value = ifelse(alive,5110,5150)

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

[Statedef -2]

[State 860, 1]
type = Explod
triggerall = !var(55) && roundstate < 2 && palno < 13
trigger1 = Command = "ColorR"
trigger2 = command = "ColorL"
trigger3 = (facing = 1) && Command = "RandomR"
trigger4 = (facing = -1) && command = "RandomL"
anim = 9899
pos = 0,-70
postype = p1
ontop = 1
bindtime = -1
removetime = 60
facing = facing
ownpal = 1
ID = 8420
persistent = 0
pausemovetime = -1
scale = .5,.5

[State 200, 3]
type = PlaySnd
triggerall = !var(55) && roundstate < 2 && palno < 13
trigger1 = Command = "ColorR"
trigger2 = command = "ColorL"
trigger3 = (facing = 1) && Command = "RandomR"
trigger4 = (facing = -1) && command = "RandomL"
value = 60,1

[State Color Code]
type = VarSet
triggerall = !var(55) && roundstate < 2 && palno < 13
trigger1 = (facing = 1) && Command = "ColorR"
trigger2 = (facing = -1) && command = "ColorL"
var(55) = 1

[State Color Code]
type = VarSet
triggerall = !var(55) && roundstate < 2 && palno < 7
trigger1 = (facing = 1) && Command = "ColorL"
trigger2 = (facing = -1) && command = "ColorR"
var(55) = 2

[State Color Code]
type = VarSet
triggerall = !var(55) && roundstate < 2 
trigger1 = (facing = 1) && Command = "RandomR"
trigger2 = (facing = -1) && command = "RandomL"
var(55) = 3

[State 5900, 3] ;Change palette
type = RemapPal
triggerall = var(55)= [1,2]
trigger1 = roundstate < 2
source = 1,1
dest = 1, ifelse(var(55)=2,palno+24,palno+12)

[State 5900, 3] ;Change palette
type = RemapPal
triggerall = (var(55)=3)
trigger1 = !(gametime%8)
source = 1,1
dest = 1,1+random%30
ignorehitpause = 1

;----------[Oversouled Blair]------------------
[State Oversoul]
type = VarSet
trigger1 = roundstate = 0 && !var(56)
var(56) = (fvar(10)=69)

[State Survival Oversoul]
type = VarSet
triggerall = roundstate < 2 && AILevel && Teammode = Turns
trigger1 = roundno > 25
var(56) = 1

[State Set to X-Groove]
type = VarSet
trigger1 = var(56) && fvar(10) !=2
fvar(10) = 2

;----------[Final Attack]------------------
[State One Win]
type = VarSet
trigger1 = Win
var(53) = 1

[State Set to X-Groove]
type = VarSet
trigger1 = roundstate = 2
var(54) = (enemynear, life<=lifemax*.25) && (var(53))

;----------[Combo Check for Trial Mode]------------------
[State Detect Screen Ratio]
type = VarSet
trigger1 = roundstate < 1
var(18) = (GameWidth/GameHeight>1.34)

[State Trial Mode]
type = Helper
triggerall = !fVar(22) && !NumHelper(20000)
trigger1 = roundsexisted = 0 && roundstate < 2
trigger1 = !AILevel && (enemy, AILevel = 0) && power = powermax && (enemy, power = powermax)
trigger1 = (teammode = single) && (enemy, teammode = single)
ID = 20000
facing = facing
pos = 0,0
postype = p1
stateno = 20000
helpertype = normal
name = "Trial Mode"
ownpal = 1
shadow = 0,0,0
sprpriority = 1
ontop = 1
size.xscale = .5
size.yscale = .5
supermovetime = 999999999999999999999999999999999999999999999999999999999
pausemovetime = 999999999999999999999999999999999999999999999999999999999

[State Manual Groove Select]
type = Helper
triggerall = (fVar(10) != [0,2]) && !NumHelper(9996)
trigger1 = (roundstate = 0)
ID = 9996
facing = facing
pos = 0,0
postype = p1
stateno = 11111
helpertype = normal
name = "Style Select"
ownpal = 1
shadow = 0,0,0
sprpriority = 1
ontop = 1
size.xscale = .5
size.yscale = .5

[State Manual Groove Select]
type = Helper
triggerall = var(56) && !NumHelper(952)
trigger1 = (roundstate = 0)
ID = 952
facing = facing
pos = 0,0
postype = p1
stateno = 952
helpertype = normal
name = "Oh Shit. I'm Screwed."
ownpal = 1
shadow = 0,0,0
sprpriority = 1
ontop = 1
size.xscale = .5
size.yscale = .5

;----------[Combo Check for Trial Mode]------------------
[State COMBO]
type = VarSet
triggerall = NumEnemy
trigger1 = (enemynear, movetype = H)
trigger2 = (enemynear,gethitvar(hitcount)>0)
var(50) = 1
ignorehitpause = 1

[State NOT A COMBO]
type = VarSet
trigger1 = NumEnemy
trigger1 = (enemynear, movetype != H)
trigger2 = !numenemy
var(50) = 0
;----------[Super FX color]------------------
[State 0, VarSet]
type = VarSet
trigger1 = var(49) && (stateno !=[3000,3999])
var(49) = 0

[State 0, VarSet]
type = VarSet
trigger1 = var(49) > 3
var(49) = 3

;~~~~~~~~~~[Finest KO stuff]~~~~~~~~~~
;Thanks to Warusaki
;State detection for Blair
[State IDLE]
type = VarSet
triggerall = movetype != H && roundstate = 2
trigger1 = (stateno = [0,199]) 
var(20) = 0
[State NORMAL]
type = VarSet
triggerall = movetype != H && roundstate = 2
trigger1 = (stateno = [200,999])
var(20) = 1
[State SPECIAL]
type = VarSet
triggerall = movetype != H && roundstate = 2
trigger1 = (stateno = [1000,2999])
var(20) = 2
[State SUPER]
type = VarSet
triggerall = movetype != H && roundstate = 2
trigger1 = stateno = 3000 || (stateno = [3010,3014]) 
var(20) = 3
[State MAX SUPER]
type = VarSet
triggerall = movetype != H && roundstate = 2
trigger1 = (stateno = [3002,3003]) || (stateno = [3030,3034]) || ((stateno = [3050,3060]) && fvar(10)!= 2) || (stateno = [3070,3074]) || (stateno = [3100,3109])
var(20) = 4
;State detection for Blair's Opponent
[State IDLE]
type = VarSet
triggerall = P2movetype != H && roundState = 2
trigger1 = (P2stateno = [0,199]) && p2stateno !=195
var(21) = 0
[State NORMAL]
type = VarSet
triggerall = P2movetype != H && roundState = 2
trigger1 = p2stateno = [200,999]
var(21) = 1
[State SPECIAL]
type = VarSet
triggerall = P2movetype != H && roundState = 2
trigger1 = P2stateno = [1000,2999]
var(21) = 2
[State SUPER]
type = VarSet
triggerall = P2movetype != H && roundState = 2
trigger1 = P2stateno = [3000,3999]
var(21) = 3
[State TAUNTING]
type = VarSet
triggerall = P2movetype != H && roundState = 2
trigger1 = P2stateno = 195
var(21) = 4

[State Not a Finest KO]
type = VarSet
trigger1 = !numtarget
var(22) = 0
ignorehitpause = 1

[State Finest KO]
type = VarSet
trigger1 = var(20) = 2 && var(21) = 3       ;Special counters Super
trigger2 = var(20) = 3 && var(21) = 3       ;Super counters Super
trigger3 = var(20) = 4 && var(21) = [2,4]   ;MAX Super counters special, Super, or Taunt
var(22) = 1
ignorehitpause = 1

;~~~~~~~~~~[Alternate Hitsound System]~~~~~~~~~~
;Thanks to PotS
[State -2, Hit Detection]
type = VarSet
trigger1 = MoveContact = 1 && var(45) < 0
var(45) = HitPauseTime
ignoreHitPause = 1

[State -2, Hit Sound]
type = PlaySnd
trigger1 = MoveContact = 1 && var(45) = HitPauseTime
trigger1 = MoveHit = 1 && var(46) >= 0
value = ifelse(fvar(21)&&var(46)<6,15,5), var(46)
channel = 8
volume = 255
ignoreHitPause = 1

[State -2, Guard Sound]
type = PlaySnd
trigger1 = MoveContact = 1 && var(45) = HitPauseTime
trigger1 = MoveGuarded = 1 && var(47) >= 0
value = 6, var(47)
channel = 8
volume = 255
ignoreHitPause = 1

[State -2, Counter FX]
type = Helper
trigger1 = MoveHit = 1 && var(45) = HitPauseTime && !fvar(19)
trigger1 = NumEnemy && var(48)
trigger1 = !(HitDefAttr = SCA, AT) && (EnemyNear, MoveReversed != 1)
helperType = Normal
stateNo = 980
ID = 980
name = "Counter FX"
posType = P2
pos = 0,40
facing = 1
ownPal = 1
pauseMoveTime = 255
superMoveTime = 255
ignoreHitPause = 1

[State -2, Counter Flag]
type = VarSet
trigger1 = NumEnemy
var(48) = ((var(21) = [2,3]) && (EnemyNear, MoveType != H))
ignoreHitPause = 1

[State -2, Hit Detection]
type = VarSet
trigger1 = 1
var(45) = -1

[State -2, Hit Detection]
type = VarRangeSet
trigger1 = MoveType = I
trigger2 = MoveType = H && Time
first = 45
last = 47
value = -1
ignoreHitPause = 1


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

[State 0,1]
type = Helper
triggerall = fvar(13) !=3
triggerall = (WinKO) && (Var(51) !=1) && !NumHelper(9994)
trigger1 = (stateno = [3000,3999]) && (fvar(13)=[0,1])
trigger2 = var(22) || var(30)
pos = 999, 0
postype = left
stateno = ifelse(fvar(28),9992,ifelse(var(22),9995,ifelse((stateno=[3100,3109]),9996,9993+floor(fvar(13)))))
supermovetime = 999999999999999999999999999999999999999999999999999999999
pausemovetime = 999999999999999999999999999999999999999999999999999999999
helpertype = normal
name = "Super Finish BG"
keyctrl = 0
ownpal = 1
ID = 9994
ignorehitpause = 1

[State 0, 1]
type = AssertSpecial
trigger1 = movetype != H
trigger1 = (stateno = [3000,3999]) || var(22) || var(30)
ignorehitpause = 1
flag = NoKoSlow
ignorehitpause = 1

[State 0, 1]
type = AssertSpecial
trigger1 =  NumHelper(9994) 
ignorehitpause = 1
flag = NoFG
flag2 = NoBarDisplay

[State -2, 1]
type = EnvShake
trigger1 = (WinKO) && (Var(51) !=1) 
time = 10
ignorehitpause = 1
persistent = 0

[State -2, Super Var 2]
type = VarSet
trigger1 = (WinKO) && (Var(51) !=1) 
v = 51
value = 1
ignorehitpause = 1

[State CvS1 Style Block]
type = Explod
triggerall = !fvar(12)
trigger1 = (stateno = 150 || stateno = 152 || stateno = 154) && !numexplod(150)
anim = ifelse(stateno = 150,155,ifelse(stateno = 152,156,157))
id = 150
Postype = p1
pos = 0,0
bindtime = -1
sprpriority = 1
ignorehitpause = 1
ownpal = 1

[State Cvs1 style block]
type = RemoveExplod
trigger1 = stateno != 150 && stateno != 152 && stateno !=154
ignorehitpause = 1
id = 150

[State Damage]
type = PlaySnd
triggerall = random < 500 && time = 1 && alive
trigger1 = StateNo = 5000 || StateNo = 5010 || StateNo = 5020 || StateNo = 5070 || StateNo = 5100
value = 3, ifelse (StateNo = 5100 || GetHitVar(animtype) = 2, 2, ifelse (GetHitVar(animtype) = 1, 2, 0+(random%2)))
channel = 1

;N-Groove stuff
[State -2, 1]
type = Varadd
trigger1 = var(10)
var(10) = -1
ignorehitpause = 1

[State -2, 1]
type = PalFX
triggerall = roundstate = 2
trigger1 = (GameTime%8)=0
trigger1 = var(10)
time = 4
mul = 430,390,255
ignorehitpause = 1

[State -2]
type = AfterImageTime
triggerall = !var(30)
trigger1 = MoveType = H
trigger2 = StateNo = [0,49]
trigger3 = StateNo = [100,189]
trigger4 = StateNo = 195
trigger5 = StateNo = [200,799]
trigger6 = StateNo = [850,859]
trigger7 = (StateNo = [900,1799]) && stateno !=1006
time = 0

;~~~~~~~~~~[Damage dampener]~~~~~~~~~~
;Thanks to PotS for the quick code
;Thanks to Buktooth for the CvS damage scaling formula

[State DAMAGE SCALER]
type = VarSet
trigger1 = NumEnemy && !var(30)
fvar(36) = ifelse(enemynear,gethitvar(hitcount)<5, 24, ifelse(enemynear,gethitvar(hitcount)>=24, 2, 24-(enemynear,gethitvar(hitcount)-5))) / 24.0
ignorehitpause=1

[State DAMAGE SCALER]
type = VarSet
trigger1 = NumEnemy && var(30)
fvar(36) = 0.65 * (10 - ifelse(enemynear,gethitvar(hitcount) >= 10, 9, enemynear,gethitvar(hitcount))) / 10.0
ignorehitpause=1

[State RESET]
type = VarSet
trigger1 = NumEnemy
trigger1 = (enemynear, movetype != H)
trigger2 = !numenemy
fvar(36) = 1

[State DAMAGE ADJUSTMENT]
type = AttackMulSet
trigger1 = 1
value = ifelse(var(10),fvar(36)*1.2,ifelse(var(19)||var(56),fvar(36)*(ifelse((stateno=[3000,3999]),1.25,1.35)),fvar(36)))
ignorehitpause=1

;~~~~~~~~~~[K-Groove/Just Defense]~~~~~~~~~~
;Thanks to Warusaki, Jesuszilla, 

;Just Defense Input
[State -2, VarAdd]
type = VarAdd
trigger1 = 1
var(8) = 1
ignorehitpause = 1

[State -2, JD]
type = VarSet
triggerall = fVar(10) = 1
triggerall = Var(8) > 14
trigger1 = !AILevel && (Command = "justdef")
trigger2 = AILevel && random < (ifelse(life < (lifemax * 0.35),400,25) * (AIlevel ** 2 / 64.0))
var(8) = 0

;----------------------------------------------------------------------------------
;Returns ShakeTime for Just Defense
[State -2, WTF]
type = VarAdd
trigger1 = Var(9)
var(9) = -1
ignorehitpause = 1

[State -2, WTF2]
type = VarSet
trigger1 = StateNo = 150 || StateNo = 152 || StateNo = 154
trigger1 = Time = 0
var(9) = GetHitVar(hitshaketime)
ignorehitpause = 1

;Standing Just Defense
[State -2, 3]
type = ChangeState
triggerall = fVar(10) = 1
triggerall = StateNo = 150
triggerall = !Time
trigger1 = Var(8) <= 5
value = 920

;Crouching Just Defense
[State -2, 3]
type = ChangeState
triggerall = fvar(10) = 1
triggerall = StateNo = 152
triggerall = !Time
trigger1 = Var(8) <= 5
value = 921

;Aerial Just Defense
[State -2, 3]
type = ChangeState
triggerall = fvar(10) = 1
triggerall = StateNo = 154
triggerall = !Time
trigger1 = Var(8) <= 5
value = 922

[State -2, Combo]
type = VarAdd
triggerall = fVar(10) = 1
triggerall = !Var(19)
triggerall = roundstate = 2
triggerall = fvar(31) < 7200
trigger1 = (FVar(8) - Life) > 0
fvar(31) = ceil((FVar(8)-Life)*14*(10+Var(41))/10)
ignorehitpause = 1

[State -2, Combo]
type = PowerAdd
triggerall = Var(56)
triggerall = roundstate = 2
trigger1 = (FVar(8) - Life) > 0
value = ceil((FVar(8)-Life)*7*(10+Var(41))/10)
ignorehitpause = 1

[State -2, 1]
type = VarSet
trigger1 = fvar(31) > 7200
fvar(31) = 7200

[State -2, 1]
type = VarSet
trigger1 = fvar(31) = 7200
var(19) = 1

[State -2, 1]
type = VarSet
trigger1 = fvar(31) <= 1 && ((StateNo != [3000,3999]) || roundstate != 2)
var(19) = 0

[State -2, 1]
type = VarSet
trigger1 = var(19) = 1 && roundstate > 2
fvar(31) = 0

[State 0, BGPalFX]
type = BGPalFX
triggerall = roundstate = 2 && !fvar(20)
trigger1 = fvar(31) && Var(19)
time = 4
add = -76,-76,-76
ignorehitpause = 1


[State 860, 1]
type = Explod
trigger1 = fvar(31) = 7200 && !NumExplod(8420)
anim = 6196
pos = 0,-70
postype = p1
spriority = 3
bindtime = -1
ownpal = 1
ID = 8420
persistent = 0
pausemovetime = -1
scale = .5,.5

[State 200, 3]
type = PlaySnd
trigger1 = fvar(31) = 7200
value = 9,10

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = fvar(31) = 7200
source = 3,2
dest = 4,3

[State 700, Effect]
type = Helper
trigger1 = fvar(31) = 7200 && !fvar(19)
name = "Effect"
stateno = 951
ID = 194
pos = 0,-70
keyctrl = 0
postype = p1
supermovetime = 99999999
pausemovetime = 99999999
ownpal = 1

[State 8000, Timer Bar]
type = Helper
triggerall = roundstate = 2
triggerall = floor(fvar(15)) != 2
triggerall = fvar(10) = 1 && !numhelper(8005)
trigger1 = Var(19)
trigger1 = fvar(31) > 0
trigger2 = Movetype = H
trigger3 = stateno = [920,923]
trigger4 = !fvar(15)
helpertype = normal
ID = 8005
name = "RAGE Meter"
pos = ifelse(teamside=2,240,80),228
postype = left
stateno = 8005
scale = 1,1
keyctrl = 0
ownpal = 1
sprpriority = 5
pausemovetime = 999999999
supermovetime = 999999999
facing = facing

[State -2, 1]
type = VarAdd
triggerall = fvar(10) = 1
triggerall = Var(19)
trigger1 = fvar(31) > 0
fvar(31) = -7.2
ignorehitpause = 1

[State -2, 1]
type = PalFX
triggerall = roundstate = 2
triggerall = fvar(10) = 1
trigger1 = fvar(31) && Var(19)
trigger1 = (GameTime%4)=0
time = 2
add = 80,-80,-80
ignorehitpause = 1

[State 9630:	Explod]
type = Explod
triggerall = roundstate = 2 && !fvar(20)
triggerall = fvar(10) = 1
trigger1 = fvar(31) && Var(19)
trigger1 = ((GameTime%6) = 0)
anim = 10005
id = 10002
pos = 0,-20
postype	= p1
vel= 0,-1-((random%6)*.33)
random	= 35,55
scale	= 0.25,0.5
sprpriority= 3
ownpal	= 1

[State -2, 1]
type = PalFX
triggerall = roundstate = 2
trigger1 = var(56)
trigger1 = (GameTime%8)=0
time = 2
add = -80,40,80
ignorehitpause = 1

[State 9630:	Explod]
type = Explod
triggerall = roundstate = 2 && !fvar(20)
triggerall = var(56)
trigger1 = ((GameTime%6) = 0)
anim = 10002
id = 10002
pos = 0,-20
postype	= p1
vel= 0,-1-((random%6)*.33)
random	= 35,55
scale	= 0.5,0.5
sprpriority= 3
ownpal	= 1

[State -2, 1]
type = DefenceMulSet
triggerall = fvar(10) = 1
trigger1 = fvar(31) && Var(19)
value = 0.775

[State -2, 1]
type = DefenceMulSet
trigger1 = Var(56)
value = 0.575

[State -2, 1]
type = DefenceMulSet
trigger1 = !var(19) && !var(56)
value = 1

[State -2, Combo]
type = VarSet
trigger1 = 1
fvar(8) = life
ignorehitpause = 1

[State -2, Power2]
type = VarSet
triggerall = RoundState = 2
trigger1 = (100*life/const(data.life))<=100
trigger1 = (100*life/const(data.life))>30
var(41) = 0

[State -2, Power3]
type = VarSet
triggerall = RoundState = 2
trigger1 = (100*life/const(data.life))<=30
trigger1 = (100*life/const(data.life))>15
var(41) = 2

[State -2, Power4]
type = VarSet
triggerall = RoundState = 2
trigger1 = (100*life/const(data.life))<=15
trigger1 = (100*life/const(data.life))>0
var(41) = 4

;~~~~~~~~~~[Excel Mode]~~~~~~~~~~
;Thanks to Warusaki, Jesuszilla,
[State -2, Excel End]
type=varset
trigger1= var(30)<0 || roundstate>3 || movetype=H || (stateno = [3000,3999])
var(30)=0
ignorehitpause=1
[State -2, Excel Timer]
type=varadd
triggerall= var(30)>0
trigger1 = ifelse(var(56),gametime%3!=0,1)
var(30)=-1
ignorehitpause=1
[State -2, Excel Juggle]
type=assertspecial
trigger1= var(30)>0
trigger2= roundstate!=2
flag=nojugglecheck
ignorehitpause=1
[State -2, Excel Asserts]
type=assertspecial
trigger1= var(30)>0
flag= nostandguard
flag2=nocrouchguard
flag3=noairguard
ignorehitpause=1
[State -2, 1]
type = PalFX
trigger1 = (GameTime%8)=0
trigger1 = var(30)
time = 4
mul = 255,560,560
ignorehitpause = 1

[State -2, Prevent Guard]
type=assertspecial
trigger1= var(17)>0
trigger1= var(17):=(var(17)-1)
flag=unguardable
ignorehitpause=1



[State -2, 0]
type = Null
trigger1 = (!Time) && (Var(13) = 0)
trigger1 = ((Command = "holdfwd" || (Var(57) && Random < 600)) && (StateNo = [0,20])) ^^ ((Command = "holddown" || (AILevel && Random < 300)) && (StateNo = [0,12]))
trigger1 = (Var(12) := 5)
trigger2 = (Command != "holdfwd") && (Command != "holddown") && (Var(13) = 1)
trigger2 = (Var(13) := 0)
trigger3 = (Var(12) = 0)
trigger3 = ((Command = "holdfwd") && (StateNo = [160,165])) ^^ ((Command = "holddown") && (StateNo = [160,165]))
trigger3 = (Var(12) := 5)
trigger4 = (Var(12) < 0) && (StateNo != [160,165])
trigger4 = (Var(12) := 0)
trigger5 = (StateNo = [150,165])
trigger5 = (Var(14) := 1)
trigger6 = (StateNo != [150,165]) && (StateNo != [97,99]) && (Var(14) = 1)
trigger6 = (Var(14) := 0)
ignorehitpause = 1

[State -2, 0]
type = VarAdd
trigger1 = (Var(12) > 0)
var(12) = -1
ignorehitpause = 1

[State -2, 0]
type = Helper
triggerall = fvar(10) = 2
trigger1 = ((StateNo = 50 && ctrl) || (StateNo = 937)) && (Command = "holdfwd") && (NumHelper(96) = 0)
helpertype = Normal
name = "Air Parry"
id = 96
pos = 0,0
postype = p1
facing = 0
stateno = 936
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
ignorehitpause = 1

[State -2, 1]
type = HitOverride
triggerall = fvar(10) = 2
triggerall 	= (StateType != A) && (Ctrl) && (Var(12) > 0)
trigger1 = (Command != "holddown") && (Command != "holdback")
attr = SA,NA,SA,HA,NP,SP,HP
slot = 0
stateno = 939
ignorehitpause = 1

[State -2, 1]
type 	= HitOverride
triggerall = fvar(10) = 2
triggerall = (StateType != A) && (StateNo = 161) && (Var(12) > 0)
trigger1 = (Command != "holddown") && (Command != "holdback")
attr 	= SA,NA,SA,HA,NP,SP,HP
slot 	= 1
stateno = 939
ignorehitpause = 1

[State -2, 1]
type = HitOverride
triggerall = fvar(10) = 2
triggerall = (StateType != A) && (Ctrl) && (Var(12) > 0) && (StateType = C)
trigger1 = (Command != "holdfwd") && (Command != "holdback")
attr = C,NA,SA,HA
slot = 0
stateno = 938
ignorehitpause = 1

[State -2, 1]
type = HitOverride
triggerall = fvar(10) = 2
triggerall = (StateType != A) && (StateNo = 163) && (Var(12) > 0) && (StateType = C)
trigger1 = (Command != "holdfwd") && (Command != "holdback")
attr = C,NA,SA,HA
slot = 1
stateno = 938
ignorehitpause = 1

[State -2, 1]
type = HitOverride
triggerall = fvar(10) = 2
triggerall = ((StateNo = 50 && ctrl) || (StateNo = 937) || (StateNo = 165)) && (Var(12) > 0)
trigger1 = (Command != "holddown") && (Command != "holdback")
attr = SCA,NA,SA,HP,NP,SP,HP
slot = 0
stateno = 937
ignorehitpause = 1

[State -2, Debug]
type = displaytoclipboard
trigger1 = 1
text = "p2bodydist X = %f, p2dist Y = %f"
params = p2bodydist X, p2dist Y;, var(15)
ignorehitpause = 1

[State -2, Debug]
type = appendtoclipboard
trigger1 = 1
text = "\nBy dampir - Programmed by XCB - http://piiym-net.com"
ignorehitpause = 1

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

[Statedef -3]

[State Rage Flicker]
type = Helper
triggerall = roundstate = 2 && !fvar(20)
trigger1 = fvar(31) && Var(19)
trigger1 = (numhelper(950) = 0) && (ishelper = 0);&& timemod = 7,0
name = "aura"
ID = 950
pos = -2+random%4,-2+random%4
stateno = 950
ownpal = 1
supermovetime = 0
pausemovetime = 0


[State Morrigan Palette sparkles]
type = Explod
triggerall = (palno = 8 && var(55)=1) || palno = 20
trigger1 = statetype != A && movetype != H
trigger1 = (stateno !=[190,194]) && !(gametime%15) && numexplod(600) < 6
anim = 3060+(random%3)
ID = 600
sprpriority = ifelse(random < 250 , -1, 3)
postype = p1
pos = 0, 0
random = 40,5
vel = 0, -1.2
removetime = -2
scale = 0.5, 0.5
ownpal = 1
;~~~~~~~~~~[Cheap KO]~~~~~~~~~~

[State THE CHEEZIEST]
type = ChangeState
trigger1 = !alive && (stateno = [5000,5010])
trigger1 = (prevstateno=[130,131]) || (prevstateno=[140,141]) || (prevstateno=[150,153])
value = 5950
ignorehitpause = 1

[State DANGEROUSLY CHEESY]
type = AssertSpecial
trigger1 = (stateno=[5000,5010])
trigger1 = (prevstateno =[130,131]) || (prevstateno =[140,141]) || (prevstateno =[150,153])
flag = NoKOSnd
ignorehitpause=1

[State -3, Chain Reset]
type=varset
trigger1= 1
var(26)=0
ignorehitpause=1

[State -3, Chain Check]
type=varset
trigger1= var(30) && (stateno=[200,699]) && movecontact
trigger2= var(30) && (stateno=[1000,2999]) && statetype!=A && (movecontact)
var(26)=1
ignorehitpause=1

; Super Finish Effect (Weird Version)
[Statedef 9992]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = !time
source = 3,1
dest = 4,1+(random%4)

[State 0, 1]
type = BGPalFX
trigger1 = !time
time = 20
sinadd = -150,-150,-150,80
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = [20,57]
time = 3
add = -150,-150,-150
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = 58
time = 20
add = -150,-150,-150
sinadd = 150,150,150,80
ignorehitpause = 1

[State 3510, 4]
type = explod
trigger1 = !time
anim = 11205
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
removetime = 60
ignorehitpause = 1
ownpal = 0
scale = .5,ifelse(parent, var(18),.375,.5)

[State 0, ]
type = VarSet
trigger1 = roundstate <4
var(1) = 400

[State 0, ]
type = VarAdd
trigger1 = var(1) > 0  && roundstate = 4
var(1) = -1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = var(1) && Roundstate = 4
flag = RoundNotOver

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

[State 0, ]
type = PlaySnd
trigger1 = !(parent, NumHelper(12000))
trigger1 = roundstate = 4 && var(1) = 399
value = 65,5
pan = 0
abspan = 0
channel = 1
volume = 255

[State 0, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoFG
flag2 = NoBarDisplay
flag3 = NoMusic


[State 3510, 4]
type = explod
trigger1 = !time
anim = 11008
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State adjust 2 ]
type = ModifyExplod
trigger1 = 1
ID = 9996
scale = .425+(.001*(time-(var(2)-10))), .425+(.001*(time-(var(2)-10)))

[State 0, ]
type = Pause
trigger1 = roundstate < 4
trigger1 = time%3=0
time = 1
movetime = 1
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1

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


; Super Finish Effect
[Statedef 9993]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4


[State 0, ]
type = VarSet
trigger1 = !time
var(1) = 1

[State Finish By Mirage Combo Kick]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3010,3039]
var(1) = 3

[State Finish By Dame Special]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3040,3049]
var(1) = 4

[State Finish By Shuttle Combination]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3070,3079]
var(1) = 5

[State Finish By Excel Combo]
type = VarSet
trigger1 = !time
trigger1 = parent, var(30)
var(1) = 6

[State Finish By Spin Side Shoot]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3050,3060]
var(1) = 2

[State Finish By Fairy Gift]
type = VarSet
trigger1 = !time
var(2) = ifelse(var(1)=2,110,ifelse(var(1)=3,150,ifelse(var(1)=4 || var(1)=6,130,ifelse(var(1)=5,200,170))))



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

[State 0, ]
type = PlaySnd
trigger1 = time >=20 && time < var(2)-5
trigger1 = time%10=0
value = 9,5
channel = 3
abspan = 0


[State 0, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoFG
flag2 = NoBarDisplay
flag3 = NoKoSlow

[State 0, 1]
type = BGPalFX
trigger1 = !time
time = 10
sinadd = -128,-128,-128,40
ignorehitpause = 1

[State 0, 1]
type = AllPalFX
trigger1 = time = [10,var(2)]
time = 3
mul = 128,128,128
ignorehitpause = 1
;color = 0

[State 0, 1]
type = PalFX
trigger1 = time = [10,var(2)-10]
time = 1
mul = 512,512,512
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = var(2)+1
time = 10
add = -128,-128,-128
sinadd =128,128,128,40
ignorehitpause = 1


[State 0, ]
type = SuperPause
trigger1 = !time
time = var(2)
movetime = var(2)
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1


[State 3510, 4]
type = explod
trigger1 = time = 20
anim = 11100+var(1)
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9995
ignorehitpause = 1
ownpal = 0

[State 3510, 4]
type = explod
trigger1 = time = var(2)-10
anim = 11000+var(1)
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0





[State adjust 1 ]
type = ModifyExplod
trigger1 = time >=20
ID = 9995
scale = 2-(.2*(time%10)), 2-(.2*(time%10))

[State adjust 2 ]
type = ModifyExplod
trigger1 = time >= var(2)-10
ID = 9996
scale = .425+(.001*(time-(var(2)-10))), .425+(.001*(time-(var(2)-10)))
;sprpriority = 0
;ontop = 0
;shadow = 0,0,0
;ownpal = 0
;removeongethit = 0
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = RemoveExplod
trigger1 = roundstate = 4
ID = 9995

[State 0, ]
type = RemoveExplod
trigger1 = roundstate = 4
ID = 9996
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = Pause
trigger1 = time >= var(2) && time%3=0
time = 1
movetime = 1
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1

[State 7001, 2]
type = DestroySelf
trigger1 = roundstate = 4


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

; Super Finish Effect (Short Version)
[Statedef 9994]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 0, 1]
type = BGPalFX
trigger1 = !time
time = 20
sinadd = -150,-150,-150,80
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = [20,57]
time = 3
add = -150,-150,-150
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = 58
time = 20
add = -150,-150,-150
sinadd = 150,150,150,80
ignorehitpause = 1

[State 3510, 4]
type = explod
trigger1 = !time
anim = 11205
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
removetime = 60
ignorehitpause = 1
ownpal = 0
scale = .5,ifelse(parent, var(18),.375,.5)

[State 0, ]
type = VarSet
trigger1 = !time
var(1) = 1

[State Finish By Mirage Combo Kick]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3010,3039]
var(1) = 3

[State Finish By Dame Special]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3040,3049]
var(1) = 4

[State Finish By Dame Special]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3070,3079]
var(1) = 5

[State Finish By Excel Combo]
type = VarSet
trigger1 = !time
trigger1 = parent, var(30)
var(1) = 6

[State Finish By Spin Side Shoot]
type = VarSet
trigger1 = !time
trigger1 = parent, stateno = [3050,3060]
var(1) = 2

[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,15
pan = 0
abspan = 0
;ignorehitpause = 0
;persistent = 1

[State 0, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoFG
flag2 = NoBarDisplay


[State 3510, 4]
type = explod
trigger1 = !time
anim = 11000+var(1)
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0

[State adjust 2 ]
type = ModifyExplod
trigger1 = 1
ID = 9996
scale = .425+(.001*(time-(var(2)-10))), .425+(.001*(time-(var(2)-10)))

[State 0, ]
type = Pause
trigger1 = time%3=0
time = 1
movetime = 1
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1

[State 7001, 2]
type = DestroySelf
trigger1 = roundstate = 4
trigger2 = time >= 68

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

; Finest KO effect
[Statedef 9995]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 3510, 4]
type = explod
trigger1 = !time
anim = 11205
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
removetime = 100
ignorehitpause = 1
ownpal = 0
scale = .5,ifelse(parent, var(18),.375,.5)


[State Finish By Fairy Gift]
type = VarSet
trigger1 = !time
var(2) = 135



[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,6
pan = 0
abspan = 0
;ignorehitpause = 0
;persistent = 1



[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,7
pan = 0
abspan = 0

[State 0, ]
type = PlaySnd
trigger1 = time >=15 && time < var(2)-5
trigger1 = time%15=0
value = 9,5
channel = 3
pan = 0


[State 0, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoFG
flag2 = NoBarDisplay
flag3 = NoKoSlow

[State 0, 1]
type = BGPalFX
trigger1 = !time
time = 10
sinadd = -128,-128,-128,40
ignorehitpause = 1

[State 0, 1]
type = AllPalFX
trigger1 = time = [10,var(2)]
time = 3
mul = 128,128,128
ignorehitpause = 1
color = 0

[State 0, 1]
type = PalFX
trigger1 = time = [10,var(2)-10]
time = 1
mul = 512,512,512
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = var(2)+1
time = 10
add = -128,-128,-128
sinadd =128,128,128,40
ignorehitpause = 1


[State 0, ]
type = SuperPause
trigger1 = !time
time = var(2)
movetime = var(2)
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1


[State 3510, 4]
type = explod
trigger1 = time = 15
anim = 11107
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9995
ignorehitpause = 1
ownpal = 0

[State 3510, 4]
type = explod
trigger1 = time = var(2)-10
anim = 11007
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0





[State adjust 1 ]
type = ModifyExplod
trigger1 = time >=15
ID = 9995
scale = 3-(.2*(time%15)), 3-(.2*(time%15))

[State adjust 2 ]
type = ModifyExplod
trigger1 = time >= var(2)-10
ID = 9996
scale = .425+(.001*(time-(var(2)-10))), .425+(.001*(time-(var(2)-10)))
;sprpriority = 0
;ontop = 0
;shadow = 0,0,0
;ownpal = 0
;removeongethit = 0
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = RemoveExplod
trigger1 = roundstate = 4
ID = 9995

[State 0, ]
type = RemoveExplod
trigger1 = roundstate = 4
ID = 9996
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = Pause
trigger1 = time >= var(2) && time%3=0
time = 1
movetime = 1
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1

[State 7001, 2]
type = DestroySelf
trigger1 = roundstate = 4


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

; Finishing Move Effect
[Statedef 9996]
type = S
ctrl = 0
anim = 9997
velset = 0,0
sprpriority = 4

[State 3510, 4]
type = explod
trigger1 = !time
anim = 11205
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
removetime = 100
ignorehitpause = 1
ownpal = 0
scale = .5,ifelse(parent, var(18),.375,.5)


[State Finish By Fairy Gift]
type = VarSet
trigger1 = !time
var(2) = 160



[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,6
pan = 0
abspan = 0
;ignorehitpause = 0
;persistent = 1



[State 0, ]
type = PlaySnd
trigger1 = !time
value = 9,7
pan = 0
abspan = 0

[State 0, ]
type = PlaySnd
trigger1 = time >=20 && time < var(2)-5
trigger1 = time%10=0
value = 9,5
channel = 3
abspan = 0


[State 0, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoFG
flag2 = NoBarDisplay
flag3 = NoKoSlow

[State 0, 1]
type = BGPalFX
trigger1 = !time
time = 10
sinadd = -128,-128,-128,40
ignorehitpause = 1

[State 0, 1]
type = AllPalFX
trigger1 = time = [10,var(2)]
time = 3
mul = 128,128,128
ignorehitpause = 1
color = 0

[State 0, 1]
type = PalFX
trigger1 = time = [10,var(2)-10]
time = 1
mul = 512,512,512
ignorehitpause = 1

[State 0, 1]
type = BGPalFX
trigger1 = time = var(2)+1
time = 10
add = -128,-128,-128
sinadd =128,128,128,40
ignorehitpause = 1


[State 0, ]
type = SuperPause
trigger1 = !time
time = var(2)
movetime = var(2)
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1


[State 3510, 4]
type = explod
trigger1 = !time
anim = 11010
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9998
ignorehitpause = 1
ownpal = 0

[State 3510, 4]
type = explod
trigger1 = time = 20
anim = 11109
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9995
ignorehitpause = 1
ownpal = 0

[State 3510, 4]
type = explod
trigger1 = time = var(2)-10
anim = 11009
pos = 160,ifelse(parent, var(18),90,120)
postype = left
sprpriority = 7
ontop = 1
supermove = 1
bindtime = 9999
ID = 9996
ignorehitpause = 1
ownpal = 0


[State adjust 1 ]
type = ModifyExplod
trigger1 = time < 10
ID = 9998
scale = 4.5-(.4*time), 4.5-(.4*time)

[State adjust 2 ]
type = ModifyExplod
trigger1 = time >=10
ID = 9998
scale = .5-(.001*(time-(var(2)-10))), .5-(.001*(time-(var(2)-10)))


[State adjust 1 ]
type = ModifyExplod
trigger1 = time >=20
ID = 9995
scale = 2-(.2*(time%10)), 2-(.2*(time%10))

[State adjust 2 ]
type = ModifyExplod
trigger1 = time >= var(2)-10
ID = 9996
scale = .425+(.001*(time-(var(2)-10))), .425+(.001*(time-(var(2)-10)))
;sprpriority = 0
;ontop = 0
;shadow = 0,0,0
;ownpal = 0
;removeongethit = 0
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = RemoveExplod
trigger1 = roundstate = 4
ID = 9995

[State 0, ]
type = RemoveExplod
trigger1 = roundstate = 4
ID = 9996
;ignorehitpause = 0
;persistent = 1

[State 0, ]
type = Pause
trigger1 = time >= var(2) && time%3=0
time = 1
movetime = 1
anim = -1
darken = 0
ignorehitpause = 0
persistent = 1

[State 7001, 2]
type = DestroySelf
trigger1 = roundstate = 4


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

;Style Select
[Statedef 11111]
type = S
movetype = I
anim = 9997
sprpriority = 5

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

[State 0, 1]
type = VarSet
trigger1 = parent, fvar(10) <0 || parent, fvar(10) >2
var(0) = random%3

[State -2, Reset]
type = ParentVarSet
trigger1 = parent, fvar(10) <0 || parent, fvar(10) >2
fv = 10
value = var(0)


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent, fvar(10) = 0 && anim !=8000
value = 8000

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent, fvar(10) = 1 && anim !=8001
value = 8001

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent, fvar(10) = 2 && anim !=8002
value = 8002

[State -2, Reset]
type = ParentVarSet
trigger1 = parent, command = "down"
fv = 10
value = ifelse(parent,fVar(10)=2,0,parent,fvar(10)+1)

[State -2, Reset]
type = ParentVarSet
trigger1 = parent, command = "up"
fv = 10
value = ifelse(parent, fVar(10)=0,2,parent,fvar(10)-1)

[State -2, Groove Select]
type = PlaySnd
trigger1 = parent, Command = "up"
trigger2 = parent, Command = "down"
value = 60,0
channel = 7

[State 7001, 2]
type = ChangeState
trigger1 = roundstate = 2 || parent, command = "start"
value = 11112

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

;Style Select
[Statedef 11112]
type = S
movetype = I
sprpriority = 5

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

[State -2, Groove Select]
type = PlaySnd
trigger1 = !time
value = 60,1
channel = 7

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-(time*17),time*17
;ignorehitpause =
;persistent =


[State 0,1]
type = AngleDraw
trigger1 = 1
scale = 1+(time*.05),1+(time*.05)

[State 7001, 2]
type = DestroySelf
trigger1 = time > 15

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

;-------------------
;MEE Template Files
;   provided by
;  Kitsune Sniper
;       ***
; Thanks, Kitsune!
;-------------------
