; Common
;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0
velset = 0,0

[State 0, 0]
type = ChangeAnim
triggerall = Life <= 250
triggerall = Var(20) >= 0
triggerall = Var(59) <= 0
trigger1 = Anim != 1 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 1

[State 0, 0]
type = ChangeAnim
triggerall = Var(59) <= 0
trigger1 = Anim != 0 && Anim != 1 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
trigger3 = Life > 250
trigger3 = Anim != 0
value = 0

[State 0, 1]
type = ChangeAnim
triggerall = Var(59) > 0
trigger1 = Anim = 195
trigger2 = Anim = 196
trigger3 = Anim = 25
trigger4 = Anim = 26
value = 194
elem = 6

[State 0, 1]
type = ChangeAnim
triggerall = Var(59) > 0
trigger1 = Anim != 194 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 194

[State 0, 2]
type = ChangeState
trigger1 = !Alive
value = 5050

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type = C
physics = C

[State 10, 0]
type = ChangeState
trigger1 = Var(20) < 0
value = 0

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

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type = C
physics = C

[State 11, 0]
type = ChangeState
trigger1 = Var(20) < 0
value = 0

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim != 6
trigger1 = Anim != 11
trigger2 = Anim = 6 && AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type = S
physics = S

[State 12, 0]
type = ChangeState
trigger1 = Var(20) < 0
value = 0

[State 12, 1]
type = ChangeAnim
trigger1 = Anim != 12
value = 12

[State 12, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type = S
physics = S

[State 20, 0]
type = ChangeState
trigger1 = Var(20) < 0
value = 0

[State 20, 1]
type = VelSet
triggerall = Var(59) <= 0
trigger1 = command = "holdfwd"
trigger1 = Anim != 5
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
triggerall = Var(59) <= 0
trigger1 = command = "holdback"
trigger1 = Anim != 5
x = const(velocity.walk.back.x)

[State 20, 4]
type = ChangeAnim
triggerall = Var(59) <= 0
triggerall = command = "holdfwd"
trigger1 = Anim != 20
value = 20

[State 20, 5]
type = ChangeAnim
triggerall = Var(59) <= 0
triggerall = command = "holdback"
trigger1 = Anim != 21
value = 21

[State 20, PlaySnd]
type = PlaySnd
triggerall = Anim = 20 || Anim = 21
trigger1 = AnimElem = 5
trigger2 = AnimElem = 10
value = 0, 0
channel = 5

[State 20, 1]
type = VelSet
triggerall = Var(59) > 0
trigger1 = command = "holdfwd"
trigger1 = Anim != 5
x = const(velocity.walk.fwd.x) / 2

[State 20, 2]
type = VelSet
triggerall = Var(59) > 0
trigger1 = command = "holdback"
trigger1 = Anim != 5
x = const(velocity.walk.back.x) / 2

[State 20, 4]
type = ChangeAnim
triggerall = Var(59) > 0
triggerall = command = "holdfwd"
trigger1 = Anim != 25
value = 25

[State 20, 5]
type = ChangeAnim
triggerall = Var(59) > 0
triggerall = command = "holdback"
trigger1 = Anim != 26
value = 26

[State 20, PlaySnd]
type = PlaySnd
triggerall = Anim = 25 || Anim = 26
trigger1 = AnimElem = 3
trigger2 = AnimElem = 6
value = 0, 0
channel = 5

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type = S
physics = S
velset = 0,0

[State 40, State]
type = ChangeState
trigger1 = Var(20) < 0
value = 0

[State 40, State]
type = ChangeState
trigger1 = Command = "holdback"
trigger2 = Command = "holdfwd"
value = 20
ctrl = 1

[State 40, State]
type = ChangeState
trigger1 = Command = "holddown"
value = 10
ctrl = 1

[State 40, State]
type = ChangeState
trigger1 = Command = "holdup"
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type = A
physics = N
ctrl = 0

[State 45, PosFreeze]
type = PosFreeze
trigger1 = 1

[State 45, 2]
type = ChangeAnim
trigger1 = 1
value = 41

[State 45, 3]
type = VarSet
trigger1 = Time <= 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time > 0
x = Vel X
y = const(velocity.airjump.y)

[State 45, 7]
type = ChangeState
trigger1 = Time > 0
value = 50
ctrl = 1

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

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

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != 41
trigger1 = Anim != 42
trigger1 = Anim != 43
value = ifelse((Vel X)=0, 41, ifelse((Vel X)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel Y >= 0
trigger1 = SelfAnimExist(Anim + 3)
trigger1 = Anim != Anim + 3
persistent = 0
value = Anim + 3

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type = A
physics = A

[State 51, Anim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != 41
trigger1 = Anim != 42
trigger1 = Anim != 43
value = ifelse((Vel X)=0, 41, ifelse((Vel X)>0, 42, 43))
elem = 2

[State 51, Anim]
type = ChangeAnim
trigger1 = Vel Y >= 0
trigger1 = SelfAnimExist(Anim + 3)
trigger1 = Anim != Anim + 3
persistent = 0
value = Anim + 3
elem = 2

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type = S
physics = S
velset = 0,0
ctrl = 0

[State 52, 1]
type = PosSet
trigger1 = Time <= 0
y = 0

[State 52, 2]
type = PlaySnd
trigger1 = Time <= 0
value = 0, 0
channel = 5

[State 52, 3]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 47
value = 47

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = Var(20) < 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Player Jump
[Statedef 55]
type = S
physics = S
velset = 0,0

[State 55, Ctrl]
type = CtrlSet
trigger1 = Time <= 0
value = 0

[State 55, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 40
value = 40

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

[State 55, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 55, 3]
type = null ;VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 55, 4]
type = VelSet
trigger1 = Time > 0
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 55, 5]
type = VelSet
trigger1 = Time > 0
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 55, PlaySnd]
type = PlaySnd
triggerall = Name = "Omega Inarabbita"
triggerall = AuthorName = "N-Mario"
trigger1 = AnimTime = 0
trigger1 = Time > 0
value = 0, 1
channel = 5

[State 55, 6]
type = ChangeState
trigger1 = Time > 0
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; CPU Jump
[Statedef 60]
type = A
physics = A
ctrl = 0

[State 60, StateType]
type = StateTypeSet
trigger1 = Var(20) < 0
trigger1 = Vel Y < 0
trigger1 = Time > 0
statetype = A
movetype = A
physics = A

[State 60, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 41
value = 41

[State 60, PlaySnd]
type = PlaySnd
triggerall = Name = "Omega Inarabbita"
triggerall = AuthorName = "N-Mario"
trigger1 = Anim = 41
trigger1 = AnimElem = 1
value = 0, 1
channel = 5

[State 60, VelSet]
type = VelSet
trigger1 = Anim = 41
trigger1 = AnimElem = 1
x = const(velocity.jump.fwd.x)
y = const(velocity.jump.y)

[State 60, Anim]
type = ChangeAnim
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = SelfAnimExist(Anim + 3)
trigger1 = Anim != Anim + 3
persistent = 0
value = Anim + 3

[State 60, State]
type = ChangeState
trigger1 = Time > 0
trigger1 = Vel Y > 0
value = 61

[State 60, StateType]
type = StateTypeSet
trigger1 = Var(20) >= 0
trigger2 = Vel Y >= 0
trigger2 = Time > 0
statetype = A
movetype = I
physics = A

;---------------------------------------------------------------------------
; CPU Air Jump
[Statedef 61]
type = A
physics = A
ctrl = 0

[State 60, StateType]
type = StateTypeSet
trigger1 = Var(20) < 0
trigger1 = Vel Y < 0
trigger1 = Time > 0
statetype = A
movetype = A
physics = A

[State 60, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 41
value = 41

[State 60, VelSet]
type = VelSet
trigger1 = Anim = 41
trigger1 = AnimElem = 1
x = Vel X
y = const(velocity.jump.y)

[State 60, Anim]
type = ChangeAnim
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = SelfAnimExist(Anim + 3)
trigger1 = Anim != Anim + 3
persistent = 0
value = Anim + 3

[State 60, StateType]
type = StateTypeSet
trigger1 = Var(20) >= 0
trigger2 = Vel Y >= 0
trigger2 = Time > 0
statetype = A
movetype = I
physics = A

;---------------------------------------------------------------------------
; CPU Jump
[Statedef 65]
type = A
physics = A
ctrl = 0

[State 65, StateType]
type = StateTypeSet
trigger1 = Var(20) < 0
trigger1 = Vel Y < 0
trigger1 = Time > 0
statetype = A
movetype = A
physics = A

[State 65, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 41
value = 41

[State 65, PlaySnd]
type = PlaySnd
triggerall = Name = "Omega Inarabbita"
triggerall = AuthorName = "N-Mario"
trigger1 = Anim = 41
trigger1 = AnimElem = 1
value = 0, 1
channel = 5

[State 65, VelSet]
type = VelSet
trigger1 = Anim = 41
trigger1 = AnimElem = 1
x = const(velocity.jump.fwd.x)
y = const(velocity.jump.y)

[State 65, Anim]
type = ChangeAnim
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = SelfAnimExist(Anim + 3)
trigger1 = Anim != Anim + 3
persistent = 0
value = Anim + 3

[State 65, State]
type = ChangeState
trigger1 = Time > 0
trigger1 = Vel Y > 0
value = 66

[State 65, StateType]
type = StateTypeSet
trigger1 = Var(20) >= 0
trigger2 = Vel Y >= 0
trigger2 = Time > 0
statetype = A
movetype = I
physics = A

;---------------------------------------------------------------------------
; CPU Air Jump Attack
[Statedef 66]
type = A
physics = A
ctrl = 0

[State 65, StateType]
type = StateTypeSet
trigger1 = Var(20) < 0
trigger1 = Vel Y < 0
trigger1 = Time > 0
statetype = A
movetype = A
physics = A

[State 65, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 41
value = 41

[State 65, VelSet]
type = VelSet
trigger1 = Anim = 41
trigger1 = AnimElem = 1
x = Vel X
y = const(velocity.jump.y)

[State 65, Anim]
type = ChangeAnim
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = SelfAnimExist(Anim + 3)
trigger1 = Anim != Anim + 3
persistent = 0
value = Anim + 3

[State 65, State]
type = ChangeState
trigger1 = Time > 0
trigger1 = Vel Y >= 0
value = 620

[State 66, StateType]
type = StateTypeSet
trigger1 = Var(20) >= 0
trigger2 = Vel Y >= 0
trigger2 = Time > 0
statetype = A
movetype = I
physics = A

;---------------------------------------------------------------------------
; Dash Forward
[Statedef 100]
type = S
physics = S
sprpriority = 1
ctrl = 0

[State 100, StateType]
type = StateTypeSet
trigger1 = Var(20) < 0
ignorehitpause = 1
statetype = S
movetype = A
physics = S

[State 100, Width]
type = Width
trigger1 = 1
value = ceil(5 * const(size.xscale)),0

[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, Turn]
type = Turn
trigger1 = Var(20) >= 0
trigger1 = Command != "holdfwd"
trigger1 = Command = "holdback"

[State 100, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 100
value = 100

[State 100, Explod]
type = Explod
trigger1 = Anim = 100
trigger1 = AnimElem = 1
sprpriority = 10
persistent = 0
scale = const(size.xscale), const(size.yscale)
postype = P1
ownpal = 1
ontop = 1
anim = 111
pos = 0,0
ID = 111

[State 100, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = PrevStateNo != 5000
time = 1
length = 12
framegap = 3
palcolor = 0

[State 100, 4]
type = PlaySnd
trigger1 = Anim = 100
trigger1 = AnimElem = 1
persistent = 0
value = 10, 5
channel = 1

[State 100, Smoke]
type = Explod
trigger1 = Time > 0
trigger1 = TimeMod = 5,0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = 0,0
vel = 0,0
accel = 0,0
postype = p1
facing = 1
ontop = 1

[State 100, 7]
type = ChangeState
triggerall = Time > 0
trigger1 = Var(20) >= 0
trigger1 = command != "holdfwd"
trigger1 = Command != "holdback"
trigger1 = command != "hold_z"
trigger2 = Var(55) <= 0
trigger2 = Var(44) > 30 || Time > 30
trigger3 = Var(55) > 0
trigger3 = Var(44) > 15 || Time > 15
value = 101

;---------------------------------------------------------------------------
; Dash Stop
[Statedef 101]
type = S
physics = S
sprpriority = 1
velset = 0,0
ctrl = 1

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

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

[State 100, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 101
value = 101

[State 100, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Dash Forward Attack
[Statedef 102]
type = S
physics = S
sprpriority = 1
ctrl = 0

[State 100, StateType]
type = StateTypeSet
trigger1 = Var(20) < 0
ignorehitpause = 1
statetype = S
movetype = A
physics = S

[State 100, Width]
type = Width
trigger1 = 1
value = ceil(5 * const(size.xscale)),0

[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, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 100
value = 100

[State 100, Explod]
type = Explod
trigger1 = Anim = 100
trigger1 = AnimElem = 1
sprpriority = 10
persistent = 0
scale = const(size.xscale), const(size.yscale)
postype = P1
ownpal = 1
ontop = 1
anim = 111
pos = 0,0
ID = 111

[State 100, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = PrevStateNo != 5000
time = 1
length = 12
framegap = 3
palcolor = 0

[State 100, 4]
type = PlaySnd
trigger1 = Anim = 100
trigger1 = AnimElem = 1
persistent = 0
value = 10, 5
channel = 1

[State 100, Smoke]
type = Explod
trigger1 = Time > 0
trigger1 = TimeMod = 5,0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = 0,0
vel = 0,0
accel = 0,0
postype = p1
facing = 1
ontop = 1

[State 100, 6]
type = ChangeState
triggerall = Time > 0
triggerall = PrevStateNo >= 2000
trigger1 = P2BodyDist X <= 10 * const(size.xscale)
trigger2 = Var(55) <= 0
trigger2 = Var(44) > 30 || Time > 30
trigger3 = Var(55) > 0
trigger3 = Var(44) > 15 || Time > 15
value = 2050

[State 100, 6]
type = ChangeState
triggerall = Time > 0
triggerall = PrevStateNo < 2000
trigger1 = P2BodyDist X <= 10 * const(size.xscale)
trigger2 = Var(55) <= 0
trigger2 = Var(44) > 30 || Time > 30
trigger3 = Var(55) > 0
trigger3 = Var(44) > 15 || Time > 15
value = 250

;---------------------------------------------------------------------------
; Jump Back
[Statedef 105]
type = A
movetype = I
physics = N
velset = 0,0
ctrl = 0

[State 105, 1]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 44
value = 44

[State 105, 2]
type = VelSet
trigger1 = Time <= 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State 105, 3]
type = VelAdd
trigger1 = Time > 0
y = 0.50

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

;---------------------------------------------------------------------------
; Jump Back Land
[Statedef 106]
type = S
physics = S
velset = 0,0
ctrl = 0

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

[State 106, 2]
type = PlaySnd
trigger1 = Time <= 0
value = 0, 0
channel = 5

[State 106, 3]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 47
value = 47

[State 106, 4]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = Var(20) < 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type = S
movetype = H
physics = N
velset = 0,0

[State 5000, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5000, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5000, PlaySnd]
type = PlaySnd
trigger1 = Time > 0
persistent = 0
value = 12, 0
channel = 0

[State 5000, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) <= 0
value = ifelse((GetHitVar(groundtype) = 1),5000,5010)

[State 5000, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = 1
value = ifelse((GetHitVar(groundtype) = 1),5001,5011) 

[State 5000, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) >= 2
value = ifelse((GetHitVar(groundtype) = 1),5002,5012) 

[State 5000, 2] ;Anim for HIT_BACK
type = null ;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 = null ;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 = Null ;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, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5002

[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

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type = S
movetype = H
physics = S

[State 5001, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5001, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5001, 1]
type = HitVelSet
trigger1 = Time <= 0
x = 1

[State 5001, 1]
type = VelSet
trigger1 = Time <= 0
trigger1 = Var(20) < 0
x = Vel X / 2

[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 = 0
ctrl = 1

[State 5001, 7]
type = ChangeState
trigger1 = Time > 0
trigger1 = HitShakeOver
value = 5002

;---------------------------------------------------------------------------
; HITA_SLIDE
[Statedef 5002]
type = A
movetype = H
physics = N
ctrl = 0

[State 5002, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5002, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5002, 1]
type = HitVelSet
trigger1 = Time <= 0
x = 1

[State 5002, 2]
type = VelSet
trigger1 = Time <= 0
y = -3

[State 5002, 2]
type = VelSet
trigger1 = Time <= 0
x = Vel X / 2
y = Vel Y / 2

[State 5002, 3]
type = Gravity
trigger1 = Time > 0
trigger1 = Pos Y < 0

[State 5002, 4]
type = PosSet
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
y = 0

[State 5002, 5]
type = VelSet
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
x = 0
y = 0

[State 5002, 6]
type = ChangeState
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Get Hit (Attack Freeze)
[Statedef 5005]
type = U
movetype = H
physics = N
velset = 0,0
ctrl = 0
hitcountpersist = 1

[State 5005, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5005, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5005, Anim]
type = ChangeAnim
trigger1 = Time <= 0
value = Var(41)
elem = Var(42)
ignorehitpause = 1

[State 5005, VelSet]
type = VelSet
trigger1 = Time > 0
x = FVar(30)
y = FVar(31)

[State 5005, State]
type = ChangeState
trigger1 = Time > 0
value = Var(40)
ctrl = Var(43)

;---------------------------------------------------------------------------
; Get Hit (Autoguard Freeze)
[Statedef 5006]
type = U
movetype = H
physics = N
ctrl = 0
hitcountpersist = 1

[State 5006, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5006, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5006, 1]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim < 5000
trigger1 = GetHitVar(animtype) <= 0
value = ifelse((GetHitVar(groundtype) = 1),5000,5010)

[State 5006, 1]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim < 5000
trigger1 = GetHitVar(animtype) = 1
value = ifelse((GetHitVar(groundtype) = 1),5001,5011) 

[State 5006, 1]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim < 5000
trigger1 = GetHitVar(animtype) >= 2
value = ifelse((GetHitVar(groundtype) = 1),5002,5012) 

[State 5006, Anim]
type = ChangeAnim
trigger1 = 1
ignorehitpause = 1
value = Anim
elem = AnimElemNo(0)

[State 5006, PozFreeze]
type = PosFreeze
trigger1 = HitShakeOver = 0

[State 5006, State]
type = ChangeState
trigger1 = Time > 0
value = 5007

;---------------------------------------------------------------------------
; Get Hit Move (Autoguard Move)
[Statedef 5007]
type = A
movetype = H
physics = N
ctrl = 0

[State 5007, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5007, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5007, 3]
type = Gravity
trigger1 = Time > 0
trigger1 = Pos Y < 0

[State 5007, 4]
type = PosSet
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
y = 0

[State 5007, 5]
type = VelSet
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
x = 0
y = 0

[State 5007, 6]
type = ChangeState
trigger1 = Time > 0
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type = C
movetype = H
physics = N
velset = 0,0

[State 5010, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5010, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5010, PlaySnd]
type = PlaySnd
trigger1 = Time > 0
persistent = 0
value = 12, 0
channel = 0

[State 5010, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) <= 0
value = ifelse((GetHitVar(groundtype) = 1),5000,5010)

[State 5010, 2]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = 1
value = ifelse((GetHitVar(groundtype) = 1),5001,5011) 

[State 5010, 3]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) >= 2
value = ifelse((GetHitVar(groundtype) = 1),5002,5012) 

[State 5010, 4] ;Freeze anim
type = null ;ChangeAnim
trigger1 = Time > 0
value = anim

[State 5010, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
triggerall = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITC_SLIDE

[State 5010, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5002

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type = A
movetype = H
physics = N
velset = 0,0

[State 5020, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5020, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5020, PlaySnd]
type = PlaySnd
trigger1 = Time > 0
persistent = 0
value = 12, 0
channel = 0

[State 5020, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) <= 0
value = ifelse((GetHitVar(groundtype) = 1),5000,5010)

[State 5020, 2]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = 1
value = ifelse((GetHitVar(groundtype) = 1),5001,5011) 

[State 5020, 3]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) >= 2
value = ifelse((GetHitVar(groundtype) = 1),5002,5012) 

[State 5020, 4] ;Freeze anim
type = null ;ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5002

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5025]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 5025, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5025, 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 5025, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5025, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5025, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5025, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5025, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type = A
movetype = H
physics = N
velset = 0,0

[State 5070, State]
type = SelfState
triggerall = Var(20) >= 0
trigger1 = !Alive
ignorehitpause = 1
value = 5151

[State 5070, State]
type = SelfState
triggerall = Var(20) < 0
trigger1 = !Alive
ignorehitpause = 1
value = 5155

[State 5070, PlaySnd]
type = PlaySnd
trigger1 = Time > 0
persistent = 0
value = 12, 0
channel = 0

[State 5070, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) <= 0
value = ifelse((GetHitVar(groundtype) = 1),5000,5010)

[State 5070, 2]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = 1
value = ifelse((GetHitVar(groundtype) = 1),5001,5011) 

[State 5070, 3]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) >= 2
value = ifelse((GetHitVar(groundtype) = 1),5002,5012) 

[State 5070, 4]
type = ChangeState
trigger1 = HitShakeOver
value = 5002

[State 5070, 5]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5085]
type = L
movetype = H
physics = N
velset = 0,0

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

[State 5085, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5085, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5085, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5085, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5085, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5086 ;HITL_SLIDE

[State 5085, 5]
type = SelfState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 5030 ;HITA_UP

;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5086]
type = L
movetype = H
physics = C

[State 5085, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5085, 2]
type = VelSet
trigger1 = HitOver
x = 0

[State 5085, 3] ;Don't show hit ground frame
type = VarSet
trigger1 = Time = 0
sysvar(0) = 1

[State 5085, 4]
type = SelfState
trigger1 = HitOver
value = 5110 ;HIT_LIEDOWN

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type = L
movetype = H
physics = N
sprpriority = -3
velset = 0,0

[State 5150, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
flag2 = Invisible

[State 5150, Anim]
type = ChangeAnim
trigger1 = Time <= 0
trigger1 = Anim != 5150
value = 5150

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

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

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

;---------------------------------------------------------------------------
; Player Death KO
[Statedef 5151]
type = U
movetype = H
physics = N
sprpriority = 0
velset = 0,0

[State 5151, 0]
type = VelSet
trigger1 = 1
x = 0
y = 0

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

[State 5150, Anim]
type = ChangeAnim
trigger1 = Time <= 0
value = ifelse((GetHitVar(groundtype) = 1),5000,5010)

[State 5150, PlaySnd]
type = PlaySnd
trigger1 = Time <= 0
persistent = 0
value = 12, 0
channel = 0

[State 5150, Sound]
type = PlaySnd
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
value = 11,10
channel = 5

;----- Explosions -----
[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = 0, (-35 * Const(size.yscale))
velocity = 0, (-2.5 * Const(size.yscale))
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = (5 * Const(size.xscale)), (-30 * Const(size.yscale))
velocity = (1.5 * Const(size.xscale)), (-1.5 * Const(size.yscale))
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = (10 * Const(size.xscale)), (-25 * Const(size.yscale))
velocity = (2.5 * Const(size.xscale)), 0
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = (5 * Const(size.xscale)), (-20 * Const(size.yscale))
velocity = (1.5 * Const(size.xscale)), (1.5 * Const(size.yscale))
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = 0, (-15 * Const(size.yscale))
velocity = 0, (2.5 * Const(size.yscale))
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = (-5 * Const(size.xscale)), (-20 * Const(size.yscale))
velocity = (-1.5 * Const(size.xscale)), (1.5 * Const(size.yscale))
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = (-10 * Const(size.xscale)), (-25 * Const(size.yscale))
velocity = (-2.5 * Const(size.xscale)), 0
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5

[State 5150, Projectile]
type = Projectile
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Time = 25
projanim = 6000
projhitanim = 6000
offset = (-5 * Const(size.xscale)), (-30 * Const(size.yscale))
velocity = (-1.5 * Const(size.xscale)), (-1.5 * Const(size.yscale))
projheightbound = -1000,1000
projedgebound = 1000
projstagebound = 1000
sprpriority = 5
;--------------------

[State 5150, StateTypeSet]
type = StateTypeSet
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Anim != 5000 && Anim != 5010
StateType = L

[State 5150, AssertSpecial]
type = AssertSpecial
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
trigger2 = Anim != 5000 && Anim != 5010
flag = NoShadow
flag2 = Invisible

[State 5150, Anim]
type = ChangeAnim
trigger1 = Anim = 5000 || Anim = 5010
trigger1 = AnimTime = 0
value = 5150

[state 5150, State]
type = ChangeState
trigger1 = Time >= 25
value = 5150

;---------------------------------------------------------------------------
; CPU Death KO Start (Pause)
[Statedef 5155]
type = U
movetype = H
physics = N
anim = 5000
sprpriority = 0
velset = 0,0

[State 5155, 0]
type = VelSet
trigger1 = 1
x = 0
y = 0

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

[State 5155, Anim]
type = ChangeAnim
trigger1 = Anim = 5000
value = 5000

[state 5155, State]
type = ChangeState
trigger1 = Time > 0
value = 5156

;---------------------------------------------------------------------------
; CPU Death KO
[Statedef 5156]
type = U
movetype = H
physics = N
anim = 5000
sprpriority = 0
velset = 0,0

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

[State 5155, Anim]
type = ChangeAnim
trigger1 = Anim = 5000
value = 5000

[State 5155, Sound]
type = PlaySnd
trigger1 = Time <= 0
value = 20,0
channel = 1

;----- Explode Lines -----
[State 5155, Helper]
type = Helper
triggerall = NumHelper(7000) <= 0
trigger1 = Time <= 0
helpertype = normal
name = "Line 1"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7000
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7000
keyctrl = 0
ownpal = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7001) <= 0
trigger1 = Time = 4
helpertype = normal
name = "Line 2"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7001
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7000
keyctrl = 0
ownpal = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7002) <= 0
trigger1 = Time = 34
helpertype = normal
name = "Line 3"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7002
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7000
keyctrl = 0
ownpal = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7003) <= 0
trigger1 = Time = 36
helpertype = normal
name = "Line 4"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7003
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7000
keyctrl = 0
ownpal = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7004) <= 0
trigger1 = Time = 52
helpertype = normal
name = "Line 5"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7004
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7000
keyctrl = 0
ownpal = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7005) <= 0
trigger1 = Time = 54
helpertype = normal
name = "Line 6"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7005
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7000
keyctrl = 0
ownpal = 1
;-------------------------

;----- Implosion -----
[State 5155, Helper]
type = Helper
triggerall = NumHelper(7010) <= 0
trigger1 = Time = 110
helpertype = normal
name = "Implosion"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7010
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7010
keyctrl = 0
ownpal = 1
;--------------------

;----- Explosions -----
[State 5155, Sound]
type = PlaySnd
trigger1 = Time = 165
value = 20,1
channel = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7020) <= 0
trigger1 = Time = 165
helpertype = normal
name = "Explosion"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 7020
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 7020
keyctrl = 0
ownpal = 1

[State 5155, Helper]
type = Helper
triggerall = NumHelper(7020) > 0
trigger1 = Time > 165
trigger1 = Time < 300
trigger1 = TimeMod = 5,0
helpertype = normal
name = "Explodes"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 6900
pos = 0, ceil(-25 * const(size.yscale))
postype = P1
stateno = 6900
keyctrl = 0
ownpal = 1
;-------------------------

;----- Explode Flash -----
[State 5155, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = Var(0) < 0
var(0) = 0

[State 5155, VarAdd]
type = VarAdd
triggerall = NumHelper(7020) > 0
trigger1 = Var(0) < 250
trigger1 = Time > 220
trigger1 = TimeMod = 4,0
var(0) = 10

[State 5155, VarAdd]
type = VarAdd
triggerall = NumHelper(7020) <= 0
triggerall = Var(0) > 0
trigger1 = Time > 220
trigger1 = TimeMod = 8,0
var(0) = -10

[State 5155, PalFX]
type = AllPalFX
trigger1 = Time > 220
time = 1
add = Var(0),Var(0),Var(0)
;-------------------------

[state 5155, Anim]
type = ChangeAnim
triggerall = NumHelper(7020) <= 0
trigger1 = Time > 200
value = 5150

[State 5155, AssertSpecial]
type = AssertSpecial
triggerall = NumHelper(7020) <= 0
trigger1 = Anim = 5150
trigger2 = Time > 200
flag = NoShadow
flag2 = Invisible

[State 5150, StateTypeSet]
type = StateTypeSet
triggerall = NumHelper(7020) <= 0
trigger1 = Anim = 5150
trigger2 = Time > 200
StateType = L

[State 5155, PosSet]
type = PosSet
triggerall = NumHelper(7020) <= 0
trigger1 = Anim = 5150
trigger2 = Time > 200
y = 0

[state 5155, 5]
type = ChangeState
triggerall = Var(0) <= 0
triggerall = NumHelper(7020) <= 0
trigger1 = Anim = 5150
trigger2 = Time > 200
value = 5150

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundno = 1
trigger1 = matchno = 1
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundno = 1
trigger1 = matchno = 1
fvalue = 0

[state 5900, 5] ;Intro
type = ChangeState
trigger1 = RoundNo = 1
trigger2 = RoundsExisted = 0
trigger2 = TeamMode = Turns
trigger2 = RoundNo > 1
value = 190

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

