;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
facep2 = 1
sprpriority = 1

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

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd" && Var(15) = 0
trigger2 = Var(15) != 0
sysvar(1) = 1

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

[State 0, VarSet]
type = VarSet
trigger1 = Time = 0
v = 3
value = 0

[State 0, VarSet]
type = VarSet
trigger1 = Time = 3 && !Var(15)
trigger1 = Command = "holdup"
v = 3
value = 1
[State 0, VarSet AI Short Hops]
type = VarSet
trigger1 = Time = 3 && Var(15)
v = 3
value = ifelse(EnemyNear,StateNo < 5100 && EnemyNear,StateType != A,0,1)

[State 40, 4]
type = VelSet
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 = ifelse(var(3)=0, -5, const(velocity.jump.y))

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

[State 0, AfterImage]
type = AfterImage
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
time = 20
length = 4
palcolor = 256
palbright = 0,0,0
palcontrast = 255,255,255
paladd = -64,-32,-32
palmul = 0.66,0.66,0.66
timegap = 2
framegap = 2

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 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 = Var(3) = 1
trigger1 = Time = 0
trigger1 = PrevStateNo != 45
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = Var(3) = 0
trigger2 = PrevStateNo = 45
value = 49

[State 0, Snd]
type = PlaySnd
trigger1 = Time = 0
value = S5,0
;channel = 0
[State 0, Snd]
type = PlaySnd
trigger1 = Time = 0
value = S41,0
channel = 1

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

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

[State 0, Snd]
type = PlaySnd
trigger1 = Time = 0
value = S5,1
;channel = 0
[State 0, Snd]
type = PlaySnd
trigger1 = Time = 0
value = S47,0
channel = 1

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

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

;---------------------------------------------------------------------------
; Run F
[Statedef 100]
type    = S
physics = S
anim = 100
ctrl = 0
sprpriority = 1

[State 100, 2]
type = AssertSpecial
trigger1 = 1
flag = NoWalk
flag2 = NoAutoTurn

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 5
value = S5,8
;channel = 1
[State 0, PlaySnd Sickman]
type = PlaySnd
trigger1 = Time = 4
value = S100,0
channel = 1
loop = 1

[State 100, 4]
type = ChangeState
;triggerall = Time >= 5
trigger1 = (command = "holdup" || command = "up") && Var(15) = 0
value = 40

[State 100, 4]
type = ChangeState
triggerall = Time > 10
trigger1 = command != "holdfwd" && Var(15) = 0
trigger2 = Var(15) && P2BodyDist X < 8
value = 101

;---------------------------------------------------------------------------
; Run Stop
[Statedef 101]
type    = S
physics = S
anim = 101
ctrl = 0
sprpriority = 1

[State 0, VelMul]
type = VelMul
trigger1 = 1 
x = 0.825

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 1
value = s101, 0;S5,11
channel = 1

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

;---------------------------------------------------------------------------
; Dash B
[Statedef 105]
type    = S
physics = N
ctrl = 0
anim = 105
sprpriority = 1

[State 105, Vel Dashing]
type = VelSet
trigger1 = Time = 5
x = -20
[State 0, VelMul]
type = VelMul
trigger1 = 1
x = 0.8
[State 105, Vel Dashing]
type = VelSet
trigger1 = Time = 18
x = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 4
value = S5,4
channel = 1
[State 0, PlaySnd Retreat!]
type = PlaySnd
trigger1 = Time = 4
value = S105,0
channel = 8

[State 0, NotHitBy]
type = NotHitBy
trigger1 = !Time
value = ,NA,SA,HA,NP,SP,HP
time = 4

[State 0, Explod]
type = Explod
trigger1 = Time = 4
anim = 106
ID = 106
pos = 0,0
postype = p1
vel = -1,0
removetime = -2
sprpriority = -1
removeongethit = 1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = Time = 16
value = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 24
value = 0
elem = 2

[State 105, 3]
type = ChangeState
trigger1 = Time = 24
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Dash B (Unused)
[Statedef 109]
type    = U
physics = N
ctrl = 0
anim = 109
sprpriority = 1

[State 105, Vel Dashing]
type = VelSet
trigger1 = AnimElem = 2
trigger2 = AnimElem = 7
x = -7

[State 0, VelMul]
type = VelMul
trigger1 = AnimElemNo(0) = [3,4]
trigger2 = AnimElemNo(0) = 8
x = 0.9

[State 0, Vel Stopping]
type = VelSet
trigger1 = AnimElem = 4, 1
trigger2 = AnimElem = 12
x = 0

[State 0, VelMul]
type = VelMul
trigger1 = AnimElemNo(0) = [9,11]
x = 0.7

[State 0, Snd Stop]
type = PlaySnd
trigger1 = AnimElem = 4
value = S2,4
;channel = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 36
value = 0
elem = 2

[State 105, 3]
type = ChangeState
trigger1 = Time = 36
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Dodge Roll
[Statedef 110]
type    = S
physics = S
ctrl = 0
anim = 110
velset = 0,0
sprpriority = 1

[State 0, VarSet]
type = VarSet
trigger1 = Time = 3
trigger2 = Time = 23
v = 5
value = 66
[State 0, VarSet]
type = VarSet
trigger1 = Time = 5
trigger2 = Time = 21
v = 5
value = 50
[State 0, VarSet]
type = VarSet
trigger1 = Time = 7
trigger2 = Time = 19
v = 5
value = 42
[State 0, VarSet]
type = VarSet
trigger1 = Time = 9
trigger2 = Time = 17
v = 5
value = 38
[State 0, VarSet]
type = VarSet
trigger1 = Time = 11
trigger2 = Time = 15
v = 5
value = 36
[State 0, VarSet]
type = VarSet
trigger1 = Time = 13
v = 5
value = 35

[State 0, AngleDraw]
type = AngleDraw
trigger1 = Time > 3 && Time < 24
value = 0
scale = ifelse(Anim=110,0.01*(Var(5)),0.01*(200-Var(5))),ifelse(Anim=110,0.01*(200-Var(5)),0.01*(Var(5)))

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = GameTime%2 = 0
trigger1 = Time > 2 && Time < 25
flag = invisible

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = command = "holdback"
value = 115

[State 0, PlayerPush]
type = PlayerPush
trigger1 = Time > 2 && Time < 25
value = 0
[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time > 2 && Time < 25
value = ,NA,SA,HA,NP,SP,HP
time = 1

[State 105, 1]
type = VelSet
triggerall = Anim = 110
trigger1 = Time > 2 && Time < 25
x = 3.5
[State 105, 1]
type = VelSet
triggerall = Anim = 115
trigger1 = Time > 8 && Time < 25
x = -3.25

[State 0, VelSet]
type = VelSet
trigger1 = Time = 25
x = 0

[State 0, Snd DH]
type = PlaySnd
trigger1 = Time = 0
value = S110,ifelse(Anim=110,0,1)
channel = 1

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

;---------------------------------------------------------------------------
; Intro
[Statedef 190]
type = S
ctrl = 0
anim = 11900
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 190, 3]
type = ChangeState
trigger1 = !Time
trigger1 = RoundsExisted != 0
value = 0

[State 190, 3]
type = ChangeState
triggerall = RoundsExisted = 0
trigger1 = TeamMode = Turns && RoundNo > 1
trigger2 = Random < 100
value = 11600+(10*(random%3))
[State 190, 3]
type = ChangeState
trigger1 = 1
value = 11600+(10*(random%6))

;---------------------------------------------------------------------------
; Intro - Clone
[Statedef 11600]
type = S
ctrl = 0
anim = 11600
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 128
flag = invisible
flag2 = nobardisplay

[State 0, Explod Clone]
type = Explod
trigger1 = Time = 0
anim = 11601
ID = 11601
pos = 88,-64
postype = p1
facing = -1
bindtime = 1
vel = -0.5,0
removetime = 126
scale = 1,1
sprpriority = 1
shadow = -1
ownpal = 1
[State 0, Explod TM Run]
type = Explod
trigger1 = Time = 0
anim = 100
ID = 100
pos = -1860,0
postype = p1
facing = 1
bindtime = 1
vel = 15,0
removetime = 122
scale = 1,1
sprpriority = 2
shadow = -1
[State 0, Explod TM Upper]
type = Explod
trigger1 = Time = 122
anim = 11600
ID = 11600
pos = -32,0
postype = p1
facing = 1
bindtime = 1
vel = 12,0
accel = -3,0
removetime = 6
scale = 1,1
sprpriority = 2
shadow = -1
[State 0, HitSpark]
type = Explod
trigger1 = Time = 124
anim = 8010
ID = 8010
pos = 40,-88
postype = p1
facing = ifelse(Random<500,1,-1)
vfacing = ifelse(Random<500,1,-1)
bindtime = 1
removetime = -2
pausemovetime = 99999
supermovetime = 666
scale = 1.5,1.5
sprpriority = 9
ontop = 1
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = Time = 124
name = "Clone"
ID = 11601
stateno = 11601
pos = 40,-80
postype = p1
ownpal = 1

[State 0, Snd Run]
type = PlaySnd
trigger1 = Time = 80
value = S160,1
channel = 1
[State 0, Snd Run]
type = PlaySnd
trigger1 = Time = 86
value = S160,1
channel = 2
pan = facing
[State 0, Snd Smash]
type = PlaySnd
trigger1 = Time = 125
value = S1,4
channel = 1
[State 0, Snd Clone]
type = PlaySnd
trigger1 = Time = 127
value = S160,0
[State 0, Snd Iori]
type = PlaySnd
trigger1 = Time = 70
value = S160,2+random%2
channel = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = Time = 125
time = 5
freq = 90
ampl = -8
phase = 90

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 122
value = 11600
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 11600
trigger1 = AnimTime = 0
value = 0

[State 190, 3]
type = ChangeState
trigger1 = Time = 160
value = 0

;---------------------------------------------------------------------------
; H - Clone
[Statedef 11601]
type    = A
movetype = I
physics = N
ctrl = 0
velset = 0,0
anim = 11602

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = Time*-48
scale = 1-(Time*0.033),1-(Time*0.033)

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = 2
y = -24
[State 0, VelMul]
type = VelMul
trigger1 = Time < 16
y = 0.9
[State 0, VelAdd]
type = VelAdd
trigger1 = 1 
x = -0.02
y = 0.5

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 32

;---------------------------------------------------------------------------
; Intro - LiuKang
[Statedef 11610]
type = S
ctrl = 0
anim = 11610
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 188
flag = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 168
flag = invisible
flag2 = nobardisplay

[State 0, Explod TM Run]
type = Explod
trigger1 = Time = 40
anim = 100
ID = 100
pos = -1860,0
postype = p1
facing = 1
bindtime = 1
vel = 15,0
removetime = 122
scale = 1,1
sprpriority = 2
shadow = -1
[State 0, Explod TM Kick]
type = Explod
trigger1 = Time = 162
anim = 11610
ID = 11610
pos = -32,0
postype = p1
facing = 1
bindtime = 1
vel = 12,0
accel = -3,0
removetime = 6
scale = 1,1
sprpriority = 2
shadow = -1
[State 0, HitSpark]
type = Explod
trigger1 = Time = 165
anim = 8010
ID = 8010
pos = 72,-72
postype = p1
facing = ifelse(Random<500,1,-1)
vfacing = ifelse(Random<500,1,-1)
bindtime = 1
removetime = -2
pausemovetime = 99999
supermovetime = 666
scale = 1.5,1.5
sprpriority = 9
ontop = 1
ownpal = 1

[State 0, Explod LiuDance]
type = Explod
trigger1 = Time = 0
anim = 11611
ID = 11611
pos = 48,0
postype = p1
facing = -1
bindtime = 1
removetime = 166
scale = 0.825,0.825
sprpriority = 1
shadow = -1
ownpal = 1
[State 0, Explod LiuDance]
type = Explod
trigger1 = Time = 166
anim = 11612
ID = 11612
pos = 56,0
postype = p1
facing = -1
bindtime = 1
vel = 8,-4
accel = -0.025,0.66
removetime = 64
scale = 0.825,0.825
sprpriority = 1
ownpal = 1

[State 0, Snd Run]
type = PlaySnd
trigger1 = Time = 120
value = S160,1
channel = 1
[State 0, Snd Run]
type = PlaySnd
trigger1 = Time = 126
value = S160,1
channel = 2
pan = facing
[State 0, Snd Smash]
type = PlaySnd
trigger1 = Time = 165
value = S1,4
channel = 1
[State 0, Snd Liu]
type = PlaySnd
trigger1 = Time = 166
value = S161,20+random%2
[State 0, Snd Iori]
type = PlaySnd
trigger1 = Time = 110
value = S160,2+random%2
channel = 0
[State 0, Snd Music]
type = PlaySnd
trigger1 = Time = 0
value = S161,0
channel = 5
abspan = 0
[State 0, StopSnd]
type = StopSnd
trigger1 = Time = 166
channel = 5

[State 0, EnvShake]
type = EnvShake
trigger1 = Time = 165
time = 8
freq = 90
ampl = -8
phase = 90

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 162
value = 11610
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 11610
trigger1 = AnimTime = 0
value = 0

[State 190, 3]
type = ChangeState
trigger1 = Time = 200
value = 0

;---------------------------------------------------------------------------
; Intro - Bruin
[Statedef 11620]
type = S
ctrl = 0
anim = 11620
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nomusic
flag3 = nobardisplay

[State 0, Explod Curtain Idle]
type = Explod
trigger1 = Time = 0
anim = 11622
ID = 11622
pos = 160,120
postype = left
bindtime = 666
removetime = 48
scale = 1,1
sprpriority = 9
ontop = 1
ownpal = 1
[State 0, Explod Curtain Raise]
type = Explod
trigger1 = Time = 48
anim = 11622
ID = 11622
pos = 160,120
postype = left
bindtime = 1
removetime = 300
scale = 1,1
vel = 0,-1.5
sprpriority = 9
ontop = 1
ownpal = 1
[State 0, Explod Dark]
type = Explod
trigger1 = Time = 0
anim = 11621
ID = 11621
pos = 0,-56
postype = p1
bindtime = 666
removetime = -2
scale = 2,2
sprpriority = 8
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time < 346
value = 11620
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 11620
trigger1 = AnimTime = 0
value = 0

[State 0, Snd Music]
type = PlaySnd
trigger1 = Time = 24
value = S162,0
channel = 1
abspan = 0
[State 0, Snd Voice]
type = PlaySnd
trigger1 = Anim = 11620
trigger1 = AnimElem = 5, 24
value = S162,1
channel = 0

[State 190, 3]
type = ChangeState
trigger1 = Time = 460
value = 0

;---------------------------------------------------------------------------
; Intro - Taz
[Statedef 11630]
type = S
ctrl = 0
anim = 666 ;11630
velset = 0,0

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

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
;flag2 = nomusic

[State 0, Offset]
type = Offset
trigger1 = Time < 200
;x = 32*sin(gametime*0.25)
y = 16*cos(gametime*0.75)

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 0 
x = -240
[State 0, PosAdd]
type = PosAdd
trigger1 = Time = [100,159] 
x = 12
[State 0, PosAdd]
type = PosAdd
trigger1 = Time = [200,239] 
x = -12

[State 0, Explod Spinny]
type = Explod
triggerall = Time = [100,239]
trigger1 = Anim = 11630
trigger1 = Time%4 = 0
anim = 2502
ID = 2502
facing = ifelse(random<500,1,-1)
bindtime = 666
removetime = -2
pausemovetime = 666
scale = 1,1;+(Random*0.00025)
sprpriority = 3
shadow = -1
removeongethit = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 100
value = 11630
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 240
value = 11631
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 11631
trigger1 = AnimTime = 0
value = 0

[State 0, Snd Spin]
type = PlaySnd
trigger1 = Time = 100
value = S163,0
channel = 0
[State 0, StopSnd]
type = StopSnd
trigger1 = Time = 240
channel = 0
[State 0, Snd Tada]
type = PlaySnd
trigger1 = Anim = 11631
trigger1 = AnimElem = 3
value = S163,1
channel = 0

[State 0, Helper]
type = Helper
trigger1 = Time = [0,2]
name = "DoomEnemy"
ID = 11631
stateno = 11631
pos = 32+random%276,0
postype = back
ownpal = 1
[State 0, Helper]
type = Helper
trigger1 = Time = [0,2]
name = "DoomEnemy"
ID = 11631
stateno = 11631
pos = 32+random%276,0
postype = back
ownpal = 1
[State 0, Helper]
type = Helper
trigger1 = Time = [0,3]
name = "DoomEnemy"
ID = 11631
stateno = 11631
pos = 32+random%276,0
postype = back
ownpal = 1

[State 190, 3]
type = ChangeState
trigger1 = Time = 330
value = 0

;---------------------------------------------------------------------------
; H - Enemy
[Statedef 11631]
type    = A
movetype = I
physics = N
ctrl = 0
velset = 0,0
anim = 666

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

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 0
scale = ifelse(Vel X >= 0,-1.25-(Pos Y*0.0075),1.25+(Pos Y*0.0075)),1.25+(Pos Y*0.0075)

[State 0, VarSet]
type = VarSet
trigger1 = !time
v = 5
value = ifelse(random>50,random%5,8+random%4)

[State 0, ChangeAnim D]
type = ChangeAnim
triggerall = Anim != 10605+(Var(5)*10)
triggerall = Anim != 10600+(Var(5)*10)
trigger1 = Vel X <= 0.75 && Vel X >= -0.75
trigger1 = Vel Y > 0
value = 10600+(Var(5)*10)
elem = animelemno(0)
[State 0, ChangeAnim Diag D]
type = ChangeAnim
triggerall = Anim != 10605+(Var(5)*10)
triggerall = Anim != 10601+(Var(5)*10)
trigger1 = Vel Y > 0
trigger1 = (Vel X > 0.75 && Vel X < 1.5) || (Vel X < -0.75 && Vel X > -1.5)
value = 10601+(Var(5)*10)
elem = animelemno(0)
[State 0, ChangeAnim L / R]
type = ChangeAnim
triggerall = Anim != 10605+(Var(5)*10)
triggerall = Anim != 10602+(Var(5)*10)
trigger1 = Vel X >= 1.5 || Vel X <= -1.5
value = 10602+(Var(5)*10)
elem = animelemno(0)
[State 0, ChangeAnim Diag U]
type = ChangeAnim
triggerall = Anim != 10605+(Var(5)*10)
triggerall = Anim != 10603+(Var(5)*10)
trigger1 = Vel Y < 0
trigger1 = (Vel X > 0.75 && Vel X < 1.5) || (Vel X < -0.75 && Vel X > -1.5)
value = 10603+(Var(5)*10)
elem = animelemno(0)
[State 0, ChangeAnim U]
type = ChangeAnim
triggerall = Anim != 10605+(Var(5)*10)
triggerall = Anim != 10604+(Var(5)*10)
trigger1 = Vel Y < 0
trigger1 = Vel X <= 0.75 && Vel X >= -0.75
value = 10604+(Var(5)*10)
elem = animelemno(0)

[State 0, VelSet]
type = VelSet
triggerall = Anim != 10605+(Var(5)*10)
trigger1 = random < 50
trigger2 = Time = 0
x = sin(gametime*id)*10*0.2
y = cos(gametime*id)*10*0.1

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = Ceil(Pos Y)

[State 0, VelSet]
type = VelSet
triggerall = Anim != 10605+(Var(5)*10)
trigger1 = Vel Y > 0
trigger1 = Pos Y > 16
trigger2 = Vel Y < 0
trigger2 = Pos Y < -16
y = Vel Y * -1.1
[State 0, VelSet]
type = VelSet
triggerall = Anim != 10605+(Var(5)*10)
trigger1 = Vel X < 0
trigger1 = Pos X < -160
trigger2 = Vel X > 0
trigger2 = Pos X > 160
x = Vel X * -1.1

; - - - GET HIT
[State 0, ChangeAnim Dead]
type = ChangeAnim
triggerall = Anim != 10605+(Var(5)*10)
trigger1 = Parent,Pos X*Facing > Pos X*Facing
trigger1 = id%2 = 1 || Pos X < -80 && Parent,Time < 150
trigger2 = Parent,Time >= 200
trigger2 = Parent,Pos X*Facing < Pos X*Facing
trigger2 = id%2 = 0
trigger3 = Parent,Time >= 240
value = 10605+(Var(5)*10)

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 10605+(Var(5)*10)
x = 0
y = 0

[State 0, HitSpark]
type = Explod
triggerall = Anim = 10605+(Var(5)*10)
trigger1 = AnimElem = 1,1
anim = 8010
ID = 8010
pos = 0,-40
postype = p1
facing = ifelse(Random<500,1,-1)
vfacing = ifelse(Random<500,1,-1)
bindtime = 1
removetime = -2
pausemovetime = 99999
supermovetime = 666
scale = 1.5,1.5
sprpriority = 9
ontop = 1
ownpal = 1

[State 0, Fly Away]
type = Explod
triggerall = Anim = 10605+(Var(5)*10)
trigger1 = AnimElem = 1,1
anim = 10605+(Var(5)*10)
ID = 10605
facing = ifelse(Random<500,1,-1)
vel = sin(gametime*id)*24,-abs(cos(gametime*id)*24)
removetime = 48
pausemovetime = 99999
supermovetime = 666
scale = 1.125,1.125
sprpriority = 0
ownpal = 1

[State 0, Snd Idle]
type = PlaySnd
trigger1 = Random < 10
value = S11631,0+(Var(5)*10)
channel = 0
[State 0, Snd See]
type = PlaySnd
trigger1 = Time = 4
value = S11631,2+(Var(5)*10)
channel = 0
[State 0, Snd Death]
type = PlaySnd
triggerall = Anim = 10605+(Var(5)*10)
trigger1 = AnimElem = 1,1
value = S11631,1+(Var(5)*10)
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = Anim = 10605+(Var(5)*10)
trigger1 = AnimElem = 1,1
value = S1,1
channel = 1

[State 0, EnvShake]
type = EnvShake
triggerall = Anim = 10605+(Var(5)*10)
trigger1 = AnimElem = 1,1
time = 3
freq = 120
ampl = -8
phase = 120

[State 0, DestroySelf]
type = DestroySelf
triggerall = Anim = 10605+(Var(5)*10)
trigger1 = AnimElem = 1,1

;---------------------------------------------------------------------------
; Intro - Lemm
[Statedef 11640]
type = S
ctrl = 0
anim = 666
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nomusic
[State 190, 2]
type = AssertSpecial
trigger1 = Time < 192 + 9
flag = nobardisplay

[State 0, Explod Lemm]
type = Explod
trigger1 = Time = 0
anim = 11640
ID = 11640
postype = p1
pos = -188,0
removetime = 192
scale = 2,2
vel = 1,0
sprpriority = 3
ownpal = 1
[State 0, Explod Trap]
type = Explod
trigger1 = Time = 192
anim = 11642
ID = 11642
removetime = -2
scale = 2,2
sprpriority = 3
ownpal = 1
[State 0, Explod Death]
type = Explod
trigger1 = Time = 192
anim = 11641
ID = 11641
removetime = -2
scale = 2,2
sprpriority = 3
ownpal = 1

[State 0, Explod GroundWave B]
type = Explod
trigger1 = Time = 192 + 12
anim = 8200;8215
ID = 8215
removetime = -2
sprpriority = 0
scale = 1.5,1
ownpal = 1
;[State 0, Explod GroundWave F]
;type = Explod
;trigger1 = Time = 192 + 12
;anim = 8210
;ID = 8210
;removetime = -2
;sprpriority = 5
;scale = 1.5,1
;ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 192 + 27
value = 11643

[State 0, Offset]
type = Offset
trigger1 = Time = 192 + 27
trigger2 = Time = 192 + 28
trigger3 = Time = 192 + 29
trigger4 = Time = 192 + 36
trigger5 = Time = 192 + 37
trigger6 = Time = 192 + 38
y = -8
[State 0, Offset]
type = Offset
trigger1 = Time = 192 + 30
trigger2 = Time = 192 + 31
trigger3 = Time = 192 + 32
y = -16
[State 0, Offset]
type = Offset
trigger1 = Time = 192 + 33
trigger2 = Time = 192 + 34
trigger3 = Time = 192 + 35
y = -12
[State 0, Offset]
type = Offset
trigger1 = Time = 192 + 39
trigger2 = Time = 192 + 40
trigger3 = Time = 192 + 41
y = -4

[State 0, Snd Music]
type = PlaySnd
trigger1 = Time = 0
value = S164,10+random%3
channel = 0
abspan = 0
[State 0, Snd Lemm]
type = PlaySnd
trigger1 = Time = 192
value = S164,1
channel = 0
[State 0, Snd Crush]
type = PlaySnd
trigger1 = Time = 192 + 6
value = S164,0
channel = 1
[State 0, Snd Hit]
type = PlaySnd
trigger1 = Time = 192 + 9
value = S1,4
;channel = 1
[State 0, Snd Complete]
type = PlaySnd
trigger1 = Time = 192 + 64
value = S163,1

[State 0, Smashed 1]
type = AngleDraw
trigger1 = Time = 192 + 27
trigger2 = Time = 192 + 28
trigger3 = Time = 192 + 29
value = 0
scale = 1.25,0.05
[State 0, Smashed 2]
type = AngleDraw
trigger1 = Time = 192 + 30
trigger2 = Time = 192 + 31
trigger3 = Time = 192 + 32
value = 0
scale = 1.05,0.25
[State 0, Smashed 3]
type = AngleDraw
trigger1 = Time = 192 + 33
trigger2 = Time = 192 + 34
trigger3 = Time = 192 + 35
value = 0
scale = 0.80,0.60
[State 0, Smashed 4]
type = AngleDraw
trigger1 = Time = 192 + 36
trigger2 = Time = 192 + 37
value = 0
scale = 0.60,1.00
[State 0, Smashed 5]
type = AngleDraw
trigger1 = Time = 192 + 38
trigger2 = Time = 192 + 47
value = 0
scale = 0.55,1.05
[State 0, Smashed 6]
type = AngleDraw
trigger1 = Time = 192 + 39
value = 0
scale = 0.50,1.10
[State 0, Smashed 7]
type = AngleDraw
trigger1 = Time = 192 + 40
trigger2 = Time = 192 + 46
value = 0
scale = 0.475,1.125
[State 0, Smashed 8]
type = AngleDraw
trigger1 = Time = 192 + 41
trigger2 = Time = 192 + 45
value = 0
scale = 0.463,1.1375
[State 0, Smashed 9]
type = AngleDraw
trigger1 = Time = 192 + 42
trigger2 = Time = 192 + 43
trigger3 = Time = 192 + 44
value = 0
scale = 0.45,1.15
[State 0, Smashed 10]
type = AngleDraw
trigger1 = Time = 192 + 48
value = 0
scale = 0.90,1.00
[State 0, Smashed 11]
type = AngleDraw
trigger1 = Time = 192 + 49
trigger2 = Time = 192 + 54
value = 0
scale = 1.10,0.90
[State 0, Smashed 12]
type = AngleDraw
trigger1 = Time = 192 + 50
trigger2 = Time = 192 + 52
value = 0
scale = 1.15,0.85
[State 0, Smashed 13]
type = AngleDraw
trigger1 = Time = 192 + 51
value = 0
scale = 1.175,0.825
[State 0, Smashed 14]
type = AngleDraw
trigger1 = Time = 192 + 53
value = 0
scale = 1.125,0.875
[State 0, Smashed 15]
type = AngleDraw
trigger1 = Time = 192 + 55
value = 0
scale = 1.05,0.95

[State 0, EnvShake]
type = EnvShake
trigger1 = Time = 192 + 9
time = 4
freq = 90
ampl = -8
phase = 90

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 304
value = 0

;---------------------------------------------------------------------------
; Intro - Phone
[Statedef 11650]
type = S
ctrl = 0
anim = 11650
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, VarSet]
type = VarSet
trigger1 = !Time
v = 5
value = random%2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time < 12
value = 11650
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) = 0
trigger1 = Time = 280
trigger2 = Var(5) = 1
trigger2 = Time = 112
value = 11651

[State 0, Explod Phone]
type = Explod
triggerall = Anim = 11651
trigger1 = AnimElem = 11, 0
trigger2 = AnimElem = 11, 1
anim = 11652
ID = 11652
pos = 44,-56
vel = 10,12
accel = 0,0.5
removetime = 5
sprpriority = 0
shadow = -1
ownpal = 1
[State 0, Explod HitSpark]
type = Explod
triggerall = Anim = 11651
trigger1 = AnimElem = 11, 4
anim = 8000
ID = 8000
pos = 92,0
removetime = -2
sprpriority = 3
ownpal = 1

[State 0, Snd Voice]
type = PlaySnd
trigger1 = Time = 8
value = S165,var(5)
channel = 0
[State 0, Snd Hangup]
type = PlaySnd
triggerall = Anim = 11651
trigger1 = AnimElem = 1, 1
value = S165,10
channel = 0
[State 0, Snd Throw]
type = PlaySnd
triggerall = Anim = 11651
trigger1 = AnimElem = 10
value = S0,2
;channel = 1
[State 0, Snd Voice]
type = PlaySnd
triggerall = Anim = 11651
trigger1 = AnimElem = 11
value = S165,11+random%2
channel = 0
[State 0, Snd Hit]
type = PlaySnd
triggerall = Anim = 11651
trigger1 = AnimElem = 11, 5
value = S1,0
channel = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim = 11651
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Lose
[Statedef 170]
type = S
ctrl = 0
anim = 11700
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = S170,Random%2
channel = 0

[State 0, Trans]
type = Trans
trigger1 = Time <= 420
trans = addalpha
alpha = 256-Floor(Time*0.609),Floor(Time*0.609)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time <= 440
flag = roundnotover
flag2 = noshadow
flag3 = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time >= 419
flag = invisible
flag2 = noshadow
flag3 = nomusic

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

;---------------------------------------------------------------------------
; Win Decider
[Statedef 180]
type = S
ctrl = 0
velset = 0,0

[State 0, ChangeState]
type = ChangeState
trigger1 = 1
value = 11800+(10*(random%6))

;---------------------------------------------------------------------------
; Win - Saki
[Statedef 11800]
type = S
ctrl = 0
anim = 11800
velset = 0,0

[State 0, Snd Laugh1 Saki]
type = PlaySnd
trigger1 = Time = 12
value = S181,0
channel = 0
[State 0, Snd Laugh2 Saki]
type = PlaySnd
trigger1 = Time = 84
value = S181,1
channel = 0
[State 0, Snd Laugh3 Saki]
type = PlaySnd
trigger1 = Time = 208
value = S181,2
channel = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 95
value = 11801
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 210
value = 11802

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time < 340
flag = roundnotover

;---------------------------------------------------------------------------
; Win - Olof
[Statedef 11810]
type = S
ctrl = 0
anim = 11801
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 36
value = S182,0
channel = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 38
value = 11803

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 11803
value = 0

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time < 200
flag = roundnotover

;---------------------------------------------------------------------------
; Win - CREATURE
[Statedef 11820]
type = S
ctrl = 0
anim = 11810
velset = 0,0

[State 0, Snd Voice]
type = PlaySnd
trigger1 = Time = 0
value = S184,0
channel = 0
[State 0, Snd Boom]
type = PlaySnd
triggerall = Anim != 666
trigger1 = Time%11 = 8
value = S5,16+random%2
channel = 1+floor(0.1*(Time%30))

[State 0, Snd Stop]
type = StopSnd
triggerall = Anim != 666
trigger1 = Time > 128+GameTime%88
channel = 1
[State 0, Snd Stop]
type = StopSnd
triggerall = Anim != 666
trigger1 = Time > 128+GameTime%88
channel = 2
[State 0, Snd Stop]
type = StopSnd
triggerall = Anim != 666
trigger1 = Time > 128+GameTime%88
channel = 3
[State 0, Snd cjflo]
type = PlaySnd
triggerall = Anim != 666
trigger1 = Time > 128+GameTime%88
value = S184,1
channel = 0

[State 0, PalFX]
type = PalFX
triggerall = Anim != 666
trigger1 = Time%11 = 7
add = 255,255,255
time = 3

[State 0, Explod Flash]
type = Explod
triggerall = Anim != 666
trigger1 = Time%11 = 9
anim = 11811
ID = 11811
pos = 160,0
postype = left
bindtime = 666
removetime = -2
scale = 4,4
sprpriority = 9
ownpal = 1
[State 0, Explod Pillar]
type = Explod
triggerall = Anim != 666
trigger1 = Time%11 = 5
anim = 2020
ID = 11811
pos = sin(Time*GameTime)*64, cos(Time*GameTime)*12
facing = ifelse(Random<500,1,-1)
postype = p1
removetime = -2
sprpriority = ceil(cos(Time*GameTime)*3)
scale = 1,1.5
ownpal = 1

[State 0, EnvShake]
type = EnvShake
triggerall = Anim != 666
trigger1 = Time%11 = 8
time = 8
freq = 120
ampl = -12
phase = 120
[State 0, EnvShake]
type = EnvShake
triggerall = Anim != 666
trigger1 = Time > 128+GameTime%88
time = 1
freq = 1
ampl = 1

[State 0, RemoveExplod]
type = RemoveExplod
triggerall = Anim != 666
trigger1 = Time > 128+GameTime%88
id = 11811

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time > 128+GameTime%88
value = 666

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time < 240
flag = roundnotover

;---------------------------------------------------------------------------
; Win - Scout
[Statedef 11830]
type = S
ctrl = 0
;anim = 11804
velset = 0,0

[State 0, Snd Laugh1]
type = PlaySnd
trigger1 = Time = 12
value = S183,0
channel = 0
[State 0, Snd Laugh2]
type = PlaySnd
trigger1 = Time = 76
value = S183,1
channel = 0
[State 0, Snd Laugh3]
type = PlaySnd
trigger1 = Time = 178
value = S183,3
channel = 0

[State 0, EnvShake]
type = EnvShake
triggerall = Time > 180
trigger1 = Time%8 = 0
trigger2 = Time%8 = 1
time = 2
freq = 120
ampl = -16
phase = gametime%120
[State 0, EnvShake]
type = EnvShake
triggerall = Time > 180
trigger1 = Time%8 = 2
trigger2 = Time%8 = 3
time = 2
freq = 100
ampl = -12
phase = gametime%100
[State 0, EnvShake]
type = EnvShake
triggerall = Time > 180
trigger1 = Time%8 = 4
trigger2 = Time%8 = 5
time = 3
freq = 90
ampl = -8
phase = gametime%90

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 12
value = 11804
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 87
value = 11805
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 180
value = 11802

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time < 460
flag = roundnotover

;---------------------------------------------------------------------------
; Win - Mandra
[Statedef 11840]
type = S
ctrl = 0
anim = 11820
velset = 0,0
sprpriority = 6

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

[State 0, PosAdd]
type = PosAdd
triggerall = Anim = 11820
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
trigger4 = AnimElem = 5
trigger5 = AnimElem = 6
trigger6 = AnimElem = 7
trigger7 = AnimElem = 8
trigger8 = AnimElem = 9
x = 8

[State 0, VelSet]
type = VelSet
triggerall = Anim = 11820
trigger1 = AnimElem = 4
x = (-64-(Pos X*facing))*0.025
y = -4.675*2
[State 0, VelAdd]
type = VelAdd
triggerall = Anim = 11820
trigger1 = AnimElemNo(0) > 5
y = 0.3*2

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 11820
trigger1 = Time > 40
trigger1 = Vel Y + Pos Y >= 0
value = 11821

[State 0, PosSet]
type = PosSet
triggerall = Anim = 11821
trigger1 = Vel Y != 0
y = 0
[State 0, VelSet]
type = VelSet
triggerall = Anim = 11821
trigger1 = Vel Y != 0
x = 0
y = 0

[State 0, Snd Iori]
type = PlaySnd
trigger1 = Time = 8
value = S3102,0
channel = 0
[State 0, Snd Jump]
type = PlaySnd
triggerall = Anim = 11820
trigger1 = AnimElem = 4
value = S5,0
[State 0, Snd Land]
type = PlaySnd
triggerall = Anim = 11821
trigger1 = AnimElem = 1,1
value = S5,1

[State 0, Explod Arm]
type = Explod
triggerall = Anim = 11821
trigger1 = AnimElem = 8
anim = 11822
ID = 11822
pos = 0,0
postype = p1
bindtime = 666
removetime = 64
scale = 1,1
sprpriority = 5
[State 0, Explod Flash]
type = Explod
trigger1 = Time = 126
anim = 11824
ID = 11824
pos = 160,0
postype = left
bindtime = 666
removetime = -2
scale = 4,4
sprpriority = 9
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time = 128
id = 11822

[State 0, SprPriority]
type = SprPriority
triggerall = Anim = 11821
trigger1 = AnimElem = 5
value = 1

[State 0, PalFX]
type = PalFX
trigger1 = Time = 128
time = 66666
add = 64,64,60
mul = 248,256,240
sinadd = 0,0,0,1
invertall = 0
color = 0

[State 0, Helper]
type = Helper
trigger1 = Time = 0
name = "Mandra"
ID = 11841
stateno = 11841
pos = 0,0
postype = back
ownpal = 1

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time < 320
flag = roundnotover

;---------------------------------------------------------------------------
; H - Mandra
[Statedef 11841]
type    = A
movetype = I
physics = N
ctrl = 0
velset = 0,0
sprpriority = 3
anim = 666

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 1
value = 11825
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Time < 128
trigger1 = Parent,Anim = 11821
trigger1 = Anim != 11826
value = 11826

[State 0, PosSet]
type = PosSet
trigger1 = Time = 0
x = (-0.125*((-128*Facing)+Parent,Pos X))
y = 0
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 3
time = 1
pos = 56,0
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 4
time = 2
pos = 59,-32
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 5
time = 2
pos = 60,-51
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 6
time = 2
pos = 61,-76
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 7
time = 2
pos = 62,-94
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 8
time = 2
pos = 66,-111
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 9
time = 2
pos = 66,-122
[State 0, BindToParent]
type = BindToParent
trigger1 = Parent,Anim = 11821
trigger1 = Parent,AnimElem = 10
time = 2
pos = 69,-130

[State 0, Snd Yell]
type = PlaySnd
trigger1 = Anim = 11826
trigger1 = AnimElem = 11
value = 185,1
channel = 0

[State 0, Helper]
type = Helper
trigger1 = Parent,Time = 128
name = "Mandra Exp1"
ID = 11842
stateno = 11842
pos = 0,0
postype = p1
ownpal = 1
[State 0, Helper]
type = Helper
trigger1 = Parent,Time = 129
name = "Mandra Exp2"
ID = 11843
stateno = 11843
pos = 0,0
postype = p1
ownpal = 1
[State 0, Helper]
type = Helper
trigger1 = Parent,Time = 130
name = "Mandra Exp4"
ID = 11845
stateno = 11845
pos = 0,0
postype = p1
ownpal = 1
[State 0, Helper]
type = Helper
trigger1 = Parent,Time = 131
name = "Mandra Exp3"
ID = 11844
stateno = 11844
pos = 0,0
postype = p1
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Parent,Time = 129
value = 666

;---------------------------------------------------------------------------
; H - Mandra Exp1
[Statedef 11842]
type    = A
movetype = I
physics = N
ctrl = 0
sprpriority = 9
anim = 666

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

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 192-(Time*12),64+(Time*12)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1 
value = 11827
elem = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 0
scale = 1.25+(Time*0.15),1.25+(Time*0.15)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 15

;---------------------------------------------------------------------------
; H - Mandra Exp2
[Statedef 11843]
type    = A
movetype = I
physics = N
ctrl = 0
sprpriority = 9
anim = 666

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

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-(Time*8),Time*8

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1 
value = 11827
elem = 2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time%9 = 2
trigger2 = Time%9 = 3
trigger3 = Time%9 = 4
trigger4 = Time%9 = 7
trigger5 = Time%9 = 8
flag = invisible

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 0
scale = 1+(Time*0.05),1+(Time*0.05)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 31


;---------------------------------------------------------------------------
; H - Mandra Exp3
[Statedef 11844]
type    = A
movetype = I
physics = N
ctrl = 0
sprpriority = 9
anim = 666

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

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-(Time*8),Time*8

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1 
value = 11827
elem = 3

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time%7 = 4
trigger2 = Time%7 = 7
flag = invisible

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 0
scale = 1.25+(Time*0.1),1.25+(Time*0.1)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 32

;---------------------------------------------------------------------------
; H - Mandra Exp4
[Statedef 11845]
type    = A
movetype = I
physics = N
ctrl = 0
sprpriority = 9
anim = 666

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

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-(Time*8),Time*8

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1 
value = 11827
elem = ifelse(Time%4<=1,4,5)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time%4 = 1
trigger2 = Time%4 = 3
flag = invisible

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 0
scale = 0.8+(Time*0.1),0.8+(Time*0.1)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 32

;---------------------------------------------------------------------------
; Win - Legion
[Statedef 11850]
type = S
ctrl = 0
;anim = 11830
velset = 0,0
sprpriority = 6

[State 0, AngleDraw]
type = AngleDraw
trigger1 = Time = [8,47]
value = -1+random%3
scale = 0.80,1.125
[State 0, AngleDraw]
type = AngleDraw
trigger1 = Time = [48,79]
value = -2+random%5
scale = 0.66,1.33
[State 0, AngleDraw]
type = AngleDraw
trigger1 = Time = [80,112]
value = -3+random%7
scale = 0.5,1.75

[State 0, Offset]
type = Offset
trigger1 = Time = [8,47]
x = -1+random%3
y = -1+random%3
[State 0, Offset]
type = Offset
trigger1 = Time = [48,79]
x = -2+random%5
y = -2+random%5
[State 0, Offset]
type = Offset
trigger1 = Time = [80,112]
x = -3+random%7
y = -3+random%7

[State 0, Snd pain1]
type = PlaySnd
trigger1 = Time = 6
value = S186,0
channel = 0
[State 0, Snd pain2]
type = PlaySnd
trigger1 = Time = 46
value = S186,1
channel = 0
[State 0, Snd pain3]
type = PlaySnd
trigger1 = Time = 78
value = S186,2
channel = 0

[State 0, Snd crack1]
type = PlaySnd
trigger1 = Time = 8
value = S186,10
channel = 1
[State 0, Snd crack2]
type = PlaySnd
trigger1 = Time = 48
value = S186,11
channel = 1
[State 0, Snd crack3]
type = PlaySnd
trigger1 = Time = 80
value = S186,12
channel = 1

[State 0, Turn]
type = Turn
trigger1 = Time = 46
trigger2 = Time = 78

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 8
trigger2 = Time = 48
trigger3 = Time = 80
value = 11830
elem = random%21
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time <= 112
value = anim
elem = animelemno(0)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 112
value = 666

[State 0, Explod Exp1]
type = Explod
trigger1 = Time = 110
anim = 2207;817
ID = 2207;817
pos = -4,-88
facing = -1
postype = p1
removetime = -2
sprpriority = 5
scale = 1.5,1.5
ownpal = 1
[State 0, Explod Exp2]
type = Explod
trigger1 = Time = 110
anim = 2208;818
ID = 2208;818
pos = -4,-88
facing = -1
postype = p1
removetime = -2
sprpriority = 5
scale = 1.5,1.5
ownpal = 1

[State 0, Explod MK Blood]
type = Explod
trigger1 = Time = [110,114]
anim = 10800
ID = 10800
pos = 4+random%9,-32-random%64
facing = ifelse(random<500,1,-1)
postype = p1
removetime = -2
sprpriority = 9
scale = 1,1
ownpal = 1
[State 0, Explod MK Gore L]
type = Explod
trigger1 = Time = [110,119]
anim = 10801+random%5
ID = 10801
pos = -8+random%9,-32-random%96
facing = -1
postype = p1
vel = -1-random%8,-2-random%8
accel = 0,0.25
removetime = 96
sprpriority = 6
scale = 1,1
ownpal = 1
[State 0, Explod MK Gore R]
type = Explod
trigger1 = Time = [110,119]
anim = 10801+random%5
ID = 10801
pos = 8-random%9,-32-random%96
facing = 1
postype = p1
vel = 1+random%8,-2-random%8
accel = 0,0.25
removetime = 96
sprpriority = 6
scale = 1,1
ownpal = 1

[State 0, AllPalFX]
type = AllPalFX
trigger1 = Time = 112
trigger2 = Time = 116
trigger3 = Time = 120
trigger4 = Time = 128 
add = 255,255,255
time = 2

[State 0, EnvShake Stretch1]
type = EnvShake
trigger1 = Time = [8,16] 
time = 4
freq = 120
ampl = (-16+(Time))
phase = 120+(Time%2*120)
[State 0, EnvShake Stretch2]
type = EnvShake
trigger1 = Time = [48,56] 
time = 4
freq = 120
ampl = (-56+(Time))*2
phase = 120+(Time%2*120)
[State 0, EnvShake Stretch3]
type = EnvShake
trigger1 = Time = [80,88] 
time = 4
freq = 120
ampl = (-88+(Time))*3
phase = 120+(Time%2*120)

[State 0, EnvShake Boom]
type = EnvShake
trigger1 = Time = [112,136] 
time = 4
freq = 120
ampl = (-136+(Time))*4
phase = 120+(Time%2*120)

[State 0, Helper 1]
type = Helper
trigger1 = Time = [113,117] 
name = "Miniori"
ID = 11851
stateno = 11851
pos = 0,-32-random%96
postype = p1
ownpal = 1
size.xscale = 1.5
size.yscale = 1.5
[State 0, Helper 2]
type = Helper
trigger1 = Time = [113,117] 
name = "Miniori"
ID = 11851
stateno = 11851
pos = 0,-32-random%96
postype = p1
ownpal = 1
size.xscale = 1.5
size.yscale = 1.5

[State 0, Snd Burst]
type = PlaySnd
trigger1 = Time = 112
value = S5,17
channel = 1

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time < 400
flag = roundnotover

;---------------------------------------------------------------------------
; H - Miniori
[Statedef 11851]
type    = A
movetype = I
physics = N
ctrl = 0
anim = 10811

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

[State 0, VarSet]
type = VarSet
trigger1 = Time = 0
fv = 4
value = 0.1*(-80+random%161)

[State 0, Offset]
type = Offset
trigger1 = fvar(4) != 0
y = fvar(4)
[State 0, SprPriority]
type = SprPriority
trigger1 = Time = 1
value = floor(fvar(4))

; INITIAL JUMP AND GRAVITY
[State 0, Vel Init]
type = VelSet
trigger1 = Time = 0
x = -8+random%17
y = -3-random%7
[State 0, Vel Grav]
type = VelAdd
trigger1 = Vel Y != 0 || Pos Y + Vel Y < 0
y = 0.5

; LANDING
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Pos Y + Vel Y > 0
value = 10819
[State 0, PosSet]
type = PosSet
trigger1 = Anim = 10819 && Pos Y != 0
trigger2 = Pos Y > 0
y = 0
[State 0, Vel Land]
type = VelSet
trigger1 = Anim = 10819 && Vel Y != 0
x = 0
y = 0 
[State 0, SFX Land]
type = PlaySnd
triggerall = Random < 500
trigger1 = Anim = 10819 && AnimElem = 1, 1
value = S10811,11
channel = 1

;AUTO JUMP
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = AnimTime = 0 && Random < 200
trigger1 = Anim = 10819 || Anim = 10816
trigger2 = (GameTime*ID)%16 = 0 && Random < 200
trigger2 = Anim = 10812
value = 10811
[State 0, VelSet]
type = VelSet
trigger1 = Anim = 10811
trigger1 = Vel Y = 0 && Pos Y > -8
x = ifelse(random<500,2+random%5,-2-random%5)
y = -5-random%8
[State 0, Voice Leap]
type = PlaySnd
trigger1 = ifelse(Time = 0,random < 100,Random < 500)
trigger1 = Anim = 10811 && AnimElem = 1, 1
value = S10811,random%5
channel = 0
[State 0, SFX Jump]
type = PlaySnd
triggerall = Random < 500
trigger1 = Anim = 10811 && AnimElem = 1, 1
value = S10811,10
channel = 1

;RANDOM RUN
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = (GameTime*ID)%16 = 0 && Random < 333
trigger1 = Pos Y = 0
trigger1 = Anim = 10810 || Anim = 10815 || (Anim = 10814 && AnimElemNo(0) = 9)
trigger2 = AnimTime = 0 && Random < 750
trigger2 = Anim = 10819 || Anim = 10816
value = 10812
[State 0, Vel Run]
type = VelSet
trigger1 = Anim = 10812
trigger1 = Vel X = 0
x = ifelse(random<500,6+random%4,-6-random%4)
[State 0, Voice Run]
type = PlaySnd
trigger1 = Random < 333
trigger1 = Anim = 10812 && AnimElem = 1, 1
trigger2 = Time = 0 && Random < 500
value = S10812,random%9
channel = 0
[State 0, SFX Run]
type = PlaySnd
triggerall = Random < 250
trigger1 = Anim = 10812 && AnimElem = 1, 1
value = S10812,10
channel = 1

;AUTO STANCE
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 10819 || Anim = 10816
trigger2 = (GameTime*ID)%16 = 0 && Random < 50
trigger2 = Anim = 10812
value = 10810

;RANDOM STANDING MOTION
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = (GameTime*ID)%16 = 0 && Random < 150
trigger1 = Pos Y = 0 && Anim != 10810 && Anim != 10813 && Anim != 10814 && Anim != 10816
value = ifelse(random<500,10815,ifelse(random<400,10816,ifelse(random<500,10813,10814)))

;ROAR
[State 0, Voice Roar]
type = PlaySnd
trigger1 = Anim = 10815 && AnimElem = 1, 1
value = S10815,random%2
channel = 0

;MOON
[State 0, Voice Moon]
type = PlaySnd
trigger1 = Anim = 10814 && AnimElem = 7
value = S10814,random%3
channel = 0

;LAUGH
[State 0, Voice Laugh 1]
type = PlaySnd
trigger1 = Anim = 10813 && AnimElem = 1, 1
value = S10813,0
channel = 0
[State 0, Voice Laugh 2]
type = PlaySnd
trigger1 = Anim = 10813 && AnimElem = 10
value = S10813,1
channel = 0
[State 0, Voice Laugh 3]
type = PlaySnd
trigger1 = Anim = 10813 && AnimElem = 21
value = S10813,2
channel = 0

;FIREBALL
[State 0, Explod FireOver]
type = Explod
trigger1 = Anim = 10816 && AnimElem = 2, 1
anim = 10817
ID = 10817
removetime = -2
scale = 1.5,1.5
sprpriority = floor(fvar(4))
ownpal = 1
[State 0, Explod FireGround]
type = Explod
trigger1 = Anim = 10816 && AnimElem = 3
anim = 10818
ID = 10818
postype = p1
pos = 16,fvar(4)
removetime = 80
vel = 6,0
scale = 1.5,1.5
sprpriority = floor(fvar(4))
ownpal = 1
[State 0, Voice Fireball]
type = PlaySnd
trigger1 = Anim = 10816 && AnimElem = 1, 1
value = S10816,random%2
channel = 0
[State 0, SFX Fireball]
type = PlaySnd
trigger1 = Anim = 10816 && AnimElem = 2, 1
value = S10816,10
channel = 1

;AUTO STOP
[State 0, Vel Land]
type = VelSet
triggerall =  Vel X + Vel Y != 0
trigger1 = Anim = 10810
trigger2 = Anim = 10813
trigger3 = Anim = 10814
trigger4 = Anim = 10815
trigger5 = Anim = 10816
x = 0
y = 0 

[State 0, EnvShake Small]
type = EnvShake
trigger1 = Anim = 10815 || Anim = 10819
trigger1 = AnimElem = 1, 1
trigger2 = Anim = 10816
trigger2 = AnimElem = 3
time = 3
freq = 90
ampl = -4
phase = 90

;AUTO TURN
[State 0, VelSet]
type = VelSet
trigger1 = FrontEdgeDist < 0 
trigger2 = (GameTime*ID)%16 = 0 && Random < 75
trigger2 = Pos Y = 0 && Vel X != 0
x = -Vel X
[State 0, Turn]
type = Turn
trigger1 = Facing = 1 && Vel X < 0
trigger2 = Facing = -1 && Vel X < 0
[State 0, PosSet]
type = PosAdd
trigger1 = FrontEdgeDist < 0
x = FrontEdgeDist * 1.1

;---------------------------------------------------------------------------
; Taunt Temp
[Statedef 199]
type = S
movetype = I
physics = S
anim = 11900
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
Triggerall = Command = "hold_s"
triggerall = Var(2) < 12
triggerall = Var(15) != 1
trigger1 = command = "fwd" || command = "up"
v = 2
value = 1

[State 0, VarAdd]
type = VarAdd
Triggerall = Command = "hold_s"
triggerall = Var(2) > 1
triggerall = Var(15) != 1
trigger1 = command = "back" || command = "down"
v = 2
value = -1

[State 0, DisplayToClipboard]
type = RemapPal
Trigger1 = Command = "hold_s"
source = 1,1
dest = 1,Var(2)

[State 195, 2]
type = ChangeState
trigger1 = command != "hold_s"
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; n, Taunt
[Statedef 195]
type = S
movetype = I
physics = S
anim = 11950
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = Var(40) = 0
v = 40
value = 1+random%20

[State 0, Bubble]
type = Explod
trigger1 = Time = 20
anim = 11951
pos = ifelse(facing=1,20,-4),-104
facing = ifelse(facing=1,1,-1)
bindtime = 666
removetime = -2
ownpal = 1

[State 0, Snd Voice]
type = PlaySnd
trigger1 = AnimElem = 9
value = S195,ifelse(Random<100,0,random%3)
;channel = 0

[State 0, Helper]
type = Helper
trigger1 = Time = 0
trigger1 = !NumHelper(11950)
name = "ChatName"
ID = 11950
stateno = 11950
pos = 0,0
postype = back
facing = facing
ownpal = 1
supermovetime = 66666
pausemovetime = 66666

[State 0, CtrlSet]
type = CtrlSet
trigger1 = Time = 64
value = 1

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

;---------------------------------------------------------------------------
; H - HexenText N (Old)
[Statedef 66666] ;11950
type    = A
movetype = I
physics = N
velset = 0,0
anim = 666
sprpriority = 666

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1 
value = 0
scale = 0.55,0.55

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 666
value = 11952
elem = parent,var(40)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = PrevStateNo = 11951
value = 11953
elem = random%1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time > 0
value = anim
elem = animelemno(0)

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 0
y = (Var(31) - ScreenPos Y * -0.075)
[State 0, PosAdd]
type = PosAdd
trigger1 = Parent,StateNo = 195
trigger1 = Parent,Time = 22
y = -7
[State 0, PosSet]
type = PosSet
trigger1 = 1
x = -82

[State 0, Trans]
type = Trans
trigger1 = Time = [254,256]
trans = addalpha
alpha = 40,216
[State 0, Trans]
type = Trans
trigger1 = Time = [252,253]
trans = addalpha
alpha = 80,176
[State 0, Trans]
type = Trans
trigger1 = Time = [250,251]
trans = addalpha
alpha = 120,136
[State 0, Trans]
type = Trans
trigger1 = Time = [248,249]
trans = addalpha
alpha = 160,96
[State 0, Trans]
type = Trans
trigger1 = Time = [246,247]
trans = addalpha
alpha = 200,56
[State 0, Trans]
type = Trans
trigger1 = Time = [244,245]
trans = addalpha
alpha = 240,16

[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 256

;---------------------------------------------------------------------------
; H - HexenText M
[Statedef 66666] ;11951
type    = A
movetype = I
physics = N
velset = 0,0
anim = 666
sprpriority = 666

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 0
value = 11950

;---------------------------------------------------------------------------
; H - Chat Manager
[Statedef 11950] 
type    = A
movetype = I
physics = N
velset = 0,0
anim = 666
sprpriority = 666

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = StageVar(info.name) = "sktestroom"
text = "%d . %d . %d  -  %d . %d . %d"  ;%d %f
params = var(1),var(11),var(21),var(2),var(12),var(22) ;, FVar(11)
ignorehitpause = 1

; MESSAGE'S TIME
[State 0, Set Time 5]
type = VarSet
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger1 = Var(15) = 666
trigger1 = Var(14) != 666
trigger1 = Var(13) != 666
trigger1 = Var(12) != 666
trigger1 = Var(11) != 666
v = 5
value = 242
[State 0, Set Time 4]
type = VarSet
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger1 = Var(14) = 666
trigger1 = Var(13) != 666
trigger1 = Var(12) != 666
trigger1 = Var(11) != 666
v = 4
value = 242
[State 0, Set Time 3]
type = VarSet
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger1 = Var(13) = 666
trigger1 = Var(12) != 666
trigger1 = Var(11) != 666
v = 3
value = 242
[State 0, Set Time 2]
type = VarSet
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger1 = Var(12) = 666
trigger1 = Var(11) != 666
v = 2
value = 242
[State 0, Set Time 1]
type = VarSet
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger1 = Var(11) = 666
v = 1
value = 242

[State 0, Reduce Time 1]
type = VarAdd
trigger1 = Var(1) > 0
v = 1
value = -1
[State 0, Reduce Time 2]
type = VarAdd
trigger1 = Var(2) > 0
v = 2
value = -1
[State 0, Reduce Time 3]
type = VarAdd
trigger1 = Var(3) > 0
v = 3
value = -1
[State 0, Reduce Time 4]
type = VarAdd
trigger1 = Var(4) > 0
v = 4
value = -1
[State 0, Reduce Time 5]
type = VarAdd
trigger1 = Var(5) > 0
v = 5
value = -1

; MESSAGE'S ANIMATION
[State 0, Init Anim 1]
type = VarSet
trigger1 = !Time
trigger2 = Var(1) = 0 && var(11) != 666
v = 11
value = 666
[State 0, Init Anim 2]
type = VarSet
trigger1 = !Time
trigger2 = Var(2) = 0 && var(12) != 666
v = 12
value = 666
[State 0, Init Anim 3]
type = VarSet
trigger1 = !Time
trigger2 = Var(3) = 0 && var(13) != 666
v = 13
value = 666
[State 0, Init Anim 4]
type = VarSet
trigger1 = !Time
trigger2 = Var(4) = 0 && var(14) != 666
v = 14
value = 666
[State 0, Init Anim 5]
type = VarSet
trigger1 = !Time
trigger2 = Var(5) = 0 && var(15) != 666
v = 15
value = 666

[State 0, Set Anim 1]
type = VarSet
trigger1 = Var(1) = 241
v = 11
value = random%58
[State 0, Set Anim 2]
type = VarSet
trigger1 = Var(2) = 241
v = 12
value = random%58
[State 0, Set Anim 3]
type = VarSet
trigger1 = Var(3) = 241
v = 13
value = random%58
[State 0, Set Anim 4]
type = VarSet
trigger1 = Var(4) = 241
v = 14
value = random%58
[State 0, Set Anim 5]
type = VarSet
trigger1 = Var(5) = 241
v = 15
value = random%58

; MESSAGE'S POSITION
[State 0, Init YPos 1]
type = VarSet
trigger1 = Var(1) = 241
v = 21
value = floor(Root,Var(31) + 1)
[State 0, Init YPos 2]
type = VarSet
trigger1 = Var(2) = 241
v = 22
value = floor(Root,Var(31) + 1)
[State 0, Init YPos 3]
type = VarSet
trigger1 = Var(3) = 241
v = 23
value = floor(Root,Var(31) + 1)
[State 0, Init YPos 4]
type = VarSet
trigger1 = Var(4) = 241
v = 24
value = floor(Root,Var(31) + 1)
[State 0, Init YPos 5]
type = VarSet
trigger1 = Var(5) = 241
v = 25
value = floor(Root,Var(31) + 1)

[State 0, Set YPos 1]
type = VarAdd
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger2 = Enemy(0),StateNo = 195 && Enemy(0),AnimElem = 9 && Enemy(0),Name = "Our Trouble Man Marches On"
trigger3 = cond(TeamMode = Simul,Enemy(1),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
trigger4 = cond(TeamMode = Simul,Enemy(2),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
v = 21
value = -6
[State 0, Set YPos 2]
type = VarAdd
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger2 = Enemy(0),StateNo = 195 && Enemy(0),AnimElem = 9 && Enemy(0),Name = "Our Trouble Man Marches On"
trigger3 = cond(TeamMode = Simul,Enemy(1),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
trigger4 = cond(TeamMode = Simul,Enemy(2),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
v = 22
value = -6
[State 0, Set YPos 3]
type = VarAdd
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger2 = Enemy(0),StateNo = 195 && Enemy(0),AnimElem = 9 && Enemy(0),Name = "Our Trouble Man Marches On"
trigger3 = cond(TeamMode = Simul,Enemy(1),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
trigger4 = cond(TeamMode = Simul,Enemy(2),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
v = 23
value = -6
[State 0, Set YPos 4]
type = VarAdd
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger2 = Enemy(0),StateNo = 195 && Enemy(0),AnimElem = 9 && Enemy(0),Name = "Our Trouble Man Marches On"
trigger3 = cond(TeamMode = Simul,Enemy(1),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
trigger4 = cond(TeamMode = Simul,Enemy(2),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
v = 24
value = -6
[State 0, Set YPos 5]
type = VarAdd
trigger1 = Root,StateNo = 195 && Root,AnimElem = 9
trigger2 = Enemy(0),StateNo = 195 && Enemy(0),AnimElem = 9 && Enemy(0),Name = "Our Trouble Man Marches On"
trigger3 = cond(TeamMode = Simul,Enemy(1),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
trigger4 = cond(TeamMode = Simul,Enemy(2),StateNo = 195 && Enemy(1),AnimElem = 9 && Enemy(1),Name = "Our Trouble Man Marches On",0)
v = 25
value = -6

; MESSAGE'S EXPLODS
[State 0, Explod Name 1]
type = Explod
trigger1 = Var(11)!=666
trigger1 = Var(1) >= 1
anim = 11999+Parent,Var(40)
ID = 12000
pos = 75,var(21)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(1)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0
[State 0, Explod Text 1]
type = Explod
trigger1 = Var(11)!=666
trigger1 = Var(1) >= 1
anim = 13000+Var(11)
ID = 13000
pos = 75,var(21)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(1)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0

[State 0, Explod Name 2]
type = Explod
trigger1 = Var(12)!=666
trigger1 = Var(2) >= 1
anim = 11999+Parent,Var(40)
ID = 12000
pos = 75,var(22)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(2)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0
[State 0, Explod Text 2]
type = Explod
trigger1 = Var(12)!=666
trigger1 = Var(2) >= 1
anim = 13000+Var(12)
ID = 13000
pos = 75,var(22)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(2)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0

[State 0, Explod Name 3]
type = Explod
trigger1 = Var(13)!=666
trigger1 = Var(3) >= 1
anim = 11999+Parent,Var(40)
ID = 12000
pos = 75,var(23)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(3)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0
[State 0, Explod Text 3]
type = Explod
trigger1 = Var(13)!=666
trigger1 = Var(3) >= 1
anim = 13000+Var(13)
ID = 13000
pos = 75,var(23)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(3)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0

[State 0, Explod Name 4]
type = Explod
trigger1 = Var(14)!=666
trigger1 = Var(4) >= 1
anim = 11999+Parent,Var(40)
ID = 12000
pos = 75,var(24)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(4)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0
[State 0, Explod Text 4]
type = Explod
trigger1 = Var(14)!=666
trigger1 = Var(4) >= 1
anim = 13000+Var(14)
ID = 13000
pos = 75,var(24)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(4)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0

[State 0, Explod Name 5]
type = Explod
trigger1 = Var(15)!=666
trigger1 = Var(5) >= 1
anim = 11999+Parent,Var(40)
ID = 12000
pos = 75,var(25)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(5)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0
[State 0, Explod Text 5]
type = Explod
trigger1 = Var(15)!=666
trigger1 = Var(5) >= 1
anim = 13000+Var(15)
ID = 13000
pos = 75,var(25)
postype = back
facing = 1
bindtime = 666
removetime = ifelse(Var(5)>1,1,-2)
scale = 0.55,0.55
sprpriority = 666
ontop = 1
ownpal = 1
removeongethit = 0

;---------------------------------------------------------------------------
; b, Taunt
[Statedef 197]
type = S
movetype = I
physics = S
anim = 11970
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, Explod Text]
type = Explod
trigger1 = AnimElem = 4
anim = 11971
ID = 11971
pos = 8+(16*Facing),-104
postype = p1
facing = ifelse(facing = 1,1,-1)
removetime = -2
ownpal = 1
sprpriority = 3
removeongethit = 1
[State 0, Explod Sneeze]
type = Explod
trigger1 = AnimElem = 6
anim =11972
ID = 11972
pos = 16,-64
postype = p1
vel = 0.25,0.5
removetime = -2
ownpal = 1
sprpriority = 3
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 4
value = S197,0
channel = 0

[State 0, HitDef]
type = HitDef
trigger1 = !MoveContact && !MoveReversed
attr = S,SP
hitflag = MAF
guardflag = H
animtype = light
priority = 1,Miss
damage = 5,0
pausetime = 0,8
sparkno = s8000
guard.sparkno = s8100
sparkxy = -56+Floor(P2Dist X*0.75),-72
hitsound = S1,2
guardsound = S2,0 
ground.type = High
ground.slidetime = 18
ground.hittime = 18
guard.slidetime = 8
guard.hittime = 8
air.hittime = 18
;guard.dist = 320
yaccel = 0.5
ground.velocity = -2
guard.velocity = -2
air.velocity = -2,-2 
getpower = 72,36
givepower = 18,9
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 7
movetype = A
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 8
movetype = I

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

;---------------------------------------------------------------------------
; WallBounce (Hit Shake)
[Statedef 960]
type    = A
movetype= H ;Get hit
physics = N

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1;Time > 16
movecamera = 0,0

[State 940, 0]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 941, 1]
type = ChangeAnim2
Trigger1 = 1
value = 5030

[State 940, 4]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 961

;---------------------------------------------------------------------------
; WallBounce (Flying)
[Statedef 961]
type    = A
movetype= H ;Get hit
physics = N

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

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1;Time > 16
movecamera = 0,0

[State 943, 1]
type = VelAdd
trigger1 = 1
y = ifelse(GetHitVar(yaccel)<1,0.2,0.6)

[State 941, 1]
type = ChangeAnim
Trigger1 = Time = 0
value = ifelse(SelfAnimExist(5052),5052,5050)

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

[State 943, 5]
type = SelfState
trigger1 = Pos Y >= 0
trigger1 = Vel Y > 0
value = 5100
ctrl = 0

[State 941, 5]
type = ChangeState
triggerall = GetHitVar(yaccel) < 1
trigger1 = backedgedist <= 5
trigger2 = frontedgedist <= 5
value = 962

;---------------------------------------------------------------------------
; WallBounce (Hit Wall)
[Statedef 962]
type    = A
movetype= H ;Get hit
physics = N

[State 941, 1]
type = ChangeAnim
Trigger1 = Time >= 0
value = 5010

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

[State 942, 4]
type = EnvShake
Trigger1 = Time = 0
time = 8
ampl = -12
freq = 90
phase = 90

[State 942, 6]
type = ChangeState
trigger1 = Time = 4
value = 963

;---------------------------------------------------------------------------
; WallBounce (Fall)
[Statedef 963]
type    = A
movetype= H ;Get hit
physics = N

[State 943, 0]
type = ChangeAnim
Trigger1 = Time = 0
value = 5070

[State 0, VelSet]
type = VelSet
trigger1 = Time = 0
x = ifelse(GetHitVar(yaccel) < 1,1,0)
y = ifelse(GetHitVar(yaccel) < 1,-8,0)

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

[State 0, VelMul]
type = VelMul
trigger1 = Pos Y > 5
trigger1 = Vel Y > 0
x = 0.3

[State 943, 5]
type = SelfState
trigger1 = Pos Y > 5
trigger1 = Vel Y > 0
value = 5100
ctrl = 0

;---------------------------------------------------------------------------
; GroundBounce (HitShake)
[Statedef 980]
type    = A
movetype= H ;Get hit
physics = N
velset = 0,0

[State 940, 0]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 940, 3]
type = ChangeAnim
Trigger1 = Time = 0
trigger1 = Pos Y <= -32
value = 5030
[State 940, 3]
type = ChangeAnim
Trigger1 = Time = 0
trigger1 = Pos Y > -32
value = 5100

[State 0, PosSet]
type = PosSet
trigger1 = Pos Y > -32 && Pos Y != 0
y = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = GetHitVar(yaccel) > 0.6
value = 1
movecamera = 1,0

[State 940, 4]
type = ChangeState
trigger1 = HitShakeOver = 1
value = ifelse(Anim=5030,981,983)

; GroundBounce (Flying)
[Statedef 981]
type    = A
movetype= H ;Get hit
physics = N

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5060)
value = 5060

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5061)
value = 5061

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

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

[State 0, ScreenBound]
type = ScreenBound
trigger1 = GetHitVar(yaccel) > 0.6
value = 1
movecamera = 1,0

[State 941, 5]
type = ChangeState
trigger1 = Pos Y >= 0
value = 982

; GroundBounce (Hit Ground)
[Statedef 982]
type    = A
movetype= H ;Get hit
physics = N
velset = 0,0

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 0

[State 942, 0]
type = PlaySnd
Trigger1 = Time = 0
value = F5, 4

[State 942, 2]
type = ChangeAnim
Trigger1 = Time = 0
value = 5100

[State 942, 4]
type = EnvShake
Trigger1 = Time = 0
time = 8
ampl = -12
freq = 90
phase = 90

[State 5100, 8]
type = Explod
trigger1 = Time = 1
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)

[State 943, 5]
type = SelfState
trigger1 = !Alive
trigger1 = Time = 4
value = 5110
ctrl = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = GetHitVar(yaccel) > 0.6
value = 1
movecamera = 1,0

[State 942, 6]
type = ChangeState
trigger1 = Alive
trigger1 = Time = 4
value = 983

; GroundBounce (Bounce)
[Statedef 983]
type    = A
movetype= H ;Get hit
physics = N

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

[State 0, VelSet]
type = VelSet
trigger1 = Time = 0
x = Vel X*0.2
y = Vel Y*-0.75

[State 943, 0]
type = ChangeAnim
Trigger1 = Time = 0
value = 5160

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 0, ScreenBound]
type = ScreenBound
trigger1 = GetHitVar(yaccel) > 0.6
value = 1
movecamera = 1,0

[State 943, 5]
type = SelfState
trigger1 = Pos Y >= 0
trigger1 = Vel Y > 0
value = 5110
ctrl = 0

;---------------------------------------------------------------------------
; GroundBounce (Used)
[Statedef 984]
type    = A
movetype= H ;Get hit
physics = N
velset = 0,0

[State 940, 0]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 940, 3]
type = ChangeAnim
Trigger1 = Time = 0
trigger1 = Pos Y <= -32
value = 5030
[State 940, 3]
type = ChangeAnim
Trigger1 = Time = 0
trigger1 = Pos Y > -32
value = 5100

[State 940, 4]
type = ChangeState
trigger1 = HitShakeOver = 1
trigger1 = Anim = 5030
value = 985
[State 940, 4]
type = SelfState
trigger1 = HitShakeOver = 1
value = 5100

; GroundBounce (Used - Flying)
[Statedef 985]
type    = A
movetype= H ;Get hit
physics = N

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5060)
value = 5060

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5061)
value = 5061

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

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

[State 941, 5]
type = SelfState
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4]
type = VarSet
trigger1 = Time = 0
var(4) = 0

[State 5050, 4]
type = VarSet
trigger1 = Vel Y > 0
trigger1 = (Vel Y + Pos Y) >= -32
trigger1 = command = "recovery"
var(4) = 1

[State 5050, 6]
type = ChangeState
triggerall = CanRecover
trigger1 = Time > 0
trigger1 = Vel Y + Pos Y >= 0
trigger1 = var(4)
trigger1 = Life > 0
value = 5201

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y + Pos Y >= 0
value = 5100 ;HIT_BOUNCE

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type    = A
movetype= H
physics = N

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

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4]
type = VarSet
trigger1 = Time = 0
var(4) = 0

[State 5050, 4]
type = VarSet
trigger1 = Vel Y > 0
trigger1 = (Vel Y + Pos Y) >= -32
trigger1 = command = "recovery"
var(4) = 1

[State 5050, 6]
type = ChangeState
trigger1 = Time > 0
trigger1 = Vel Y + Pos Y >= 0
trigger1 = var(4)
trigger1 = Life > 0
value = 5201

[State 5071, 3] ;Hit ground
trigger1 = Vel Y + Pos Y >= 0
type = ChangeState
value = 5100

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, Explod]
type = Explod
trigger1 = !time && (sysvar(1) >= 14)
anim = 8210
pos = 0,0
postype = p1  ;p2,front,back,left,right
sprpriority = 2

[State 5100, Explod]
type = Explod
trigger1 = !time && (sysvar(1) >= 14)
anim = 8215
pos = 0,0
postype = p1  ;p2,front,back,left,right
sprpriority = 0
ownpal = 1

[State 5100, Explod]
type = Explod
trigger1 = !time && (sysvar(1) < 14)
anim = 8200
pos = 0,0
postype = p1  ;p2,front,back,left,right
sprpriority = -4
ownpal = 1

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = S5,9
persistent = 0

[State 5100, 11]
type = PosFreeze
trigger1 = 1

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

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = Null;PosSet
trigger1 = Time = 0
y = 20

[State 5101, 4]
type = VelSet
trigger1 = Time = 0
y = -3

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = time > 0
y = gethitvar(yaccel)

[State 5101, 6] ;Hit ground
trigger1 = Pos Y + Vel Y >= 0
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N
[State 5110, 0]
type = ChangeState
trigger1 = 1
value = 5111

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5111]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = S5,5
channel = 1

[State 5100, Explod]
type = Explod
trigger1 = !time && (sysvar(1) < 14)
anim = 8200
pos = 0,0
postype = p1  ;p2,front,back,left,right
sprpriority = -4
ownpal = 1

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 11] ;If just died
type = ChangeState
trigger1 = time = const(data.liedown.time) + 4*(anim=5111||anim=5112)
value = 5120

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

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

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = PrevStateno != 5950
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

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

; DOWN IN A HOLE
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Pos Y > 8
flag = noshadow
flag2 = invisible
[State 0, ScreenBound]
type = ScreenBound
trigger1 = Pos Y > 8
value = 0
movecamera = 0,0

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = S
movetype= H
physics = N
anim = 5200

[State 1300, PlaySnd]
type = PlaySND
trigger1 = animelem = 1
value = 5200,0

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, VelSet]
type = VelSet
trigger1 = !time
x =-11.5
y = 0

[State 5201, VelSet]
type = VelSet
trigger1 = time = 1
x = -7.921875

[State 5201, VelMul]
type = VelMul
trigger1 = 1
x = 0.8125

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

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

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

[State 705, 1]
type = SelfState
trigger1 = Animtime = 0
value = 0
ctrl = 1

;----------------------------------------------------------------------------------
; Cheap KO
[Statedef 5950]
physics = S
movetype = H
ctrl = 0
velset = 0,0

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

[State 5950, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State -3, Pain S Sound]
type = PlaySnd
trigger1 = Time = 1
value = S5000, random%9
channel = 0
[State 0, Snd Voice]
type = PlaySnd
trigger1 = Anim = 5950
trigger1 = AnimElem = 2
value = S11,1
channel = 0

[State 5950, 4]
type = NotHitBy
trigger1 = 1
value = SCA

[State 5950, 4]
type = ChangeAnim
trigger1 = !HitOver
value = ifElse(FVar(1)=0,5010,5020)

[State 190, 4]
type = ChangeAnim
trigger1 = HitOver
value = 5950
persistent = 0

[State 1100, ChangeState]
type = ChangeState
trigger1 = AnimElem = 8, 8
value = 5150

;----------------------------------------------------------------------------------
; Fake KO
[Statedef 5850]
type = L
physics = N
movetype = H
ctrl = 0
velset = 0,0

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 5110
ID = 5850
pos = 0,0
postype = p1
bindtime = 1
removetime = 666666
scale = const(size.xscale),const(size.yscale)
sprpriority = -3
shadow = -1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = 1
value = 666

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

;[State 0, PosSet]
;type = PosAdd
;trigger1 = P2BodyDist X < -64
;trigger2 = P2BodyDist X > 4
;x = P2BodyDist X * 0.25

[State 0, ChangeState]
type = ChangeState
;trigger1 = P2BodyDist X > -4 && P2BodyDist X < 4
trigger1 = 1
value = 5150
ctrl = 0

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]


;==============
; DEBUG
;==============
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = StageVar(info.name) = "sktestroom"
text = "%f * %f * %f \n %f * %f * %f"  ;%d %f
params = fvar(10),fvar(11),fvar(12),fvar(13),fvar(14),fvar(15) ;, FVar(11)
ignorehitpause = 1

;==============
; HITTIME
;==============
[State 0, HitTime Add]
type = VarAdd
trigger1 = MoveContact && !MoveReversed
v = 8
value = 1
ignorehitpause = 1
[State 0, HitTime Reset]
type = VarSet
trigger1 = 1
v = 8
value = 0

;==============
; COUNTER
;==============
[State 0, Counter Check]
type = VarSet
trigger1 = MoveType = A
v = 9
value = ifelse(EnemyNear,MoveType = A,1,0)
;ignorehitpause = 1
[State 0, Counter Test]
type = PalFX
triggerall = MoveHit && !MoveReversed
trigger1 = Var(8) = 1 && Var(9) != 0
time = 2
add = 128,128,128
mul = 256,256,256
invertall = 0
color = 0
ignorehitpause = 2

[State 0, Counter Move]
type = VarSet
trigger1 = Var(8) && MoveHit && !MoveReversed
trigger1 = Var(9)
v = 10
value = StateNo
ignorehitpause = 1
[State 0, Counter Move Reset]
type = VarSet
triggerall = Var(10)
trigger1 = EnemyNear,Ctrl = 1
trigger2 = EnemyNear,MoveType != H
v = 10
value = 0
ignorehitpause = 1

;==============
; DAMAGE OUTPUT
;==============

;[State 0, Dampen Reset]
;type = VarSet
;trigger1 = RoundState != 2
;trigger2 = EnemyNear,Ctrl
;fv = 11
;value = 1
;[State 0, Dampen - Basics]
;type = VarSet
;triggerall = !MoveGuarded && !MoveReversed 
;triggerall = Var(8) = 1
;trigger1 = StateNo = [200,800)
;fv = 11
;value = IfElse(FVar(11)*0.8 <= FVar(11)-0.05,FVar(11)*0.8,FVar(11)-0.05)
;ignorehitpause = 1
;[State 0, Dampen Minimal 11]
;type = VarSet
;trigger1 = FVar(11) <= 0.00
;fv = 11
;value =  0.00
;[State 0, Dampen Output]
;type = VarSet
;trigger1 = 1
;fv = 10
;value = FVar(11)+((Var(9)!=0)*0.4)

;[State 0, Dampening Reset]
;type = VarRangeSet
;triggerall = EnemyNear,Ctrl || RoundState < 2
;trigger1 = FVar(14) != 0 || RoundState < 2
;trigger2 = Var(9) != 0 && FVar(10) = 1
;trigger3 = Var(9) = 0 && FVar(10) > 1
;fvalue = 1
;first = 10
;last = 13
[State 0, Dampening Reset]
type = VarSet
trigger1 = RoundState != 2
trigger2 = EnemyNear,Ctrl
fv = 15
value = 1
[State 0, HitCount Reset]
type = VarSet
trigger1 = RoundState != 2
trigger2 = EnemyNear,Ctrl
fv = 14
value = 0
[State 0, HitCount Increase]
type = VarAdd
triggerall = UniqHitCount = 1
trigger1 = !MoveGuarded && !MoveReversed 
trigger1 = Var(8) = 1
fv = 14
value = 1
ignorehitpause = 1

[State 0, Dampening Begin]
type = VarSet
trigger1 = !MoveGuarded && !MoveReversed 
trigger1 = Var(8) = 1
trigger1 = FVar(14) >= 2
fv = 15
value = ifelse(FVar(14)=2,0.75,ifelse(FVar(14)=3,0.60,ifelse(FVar(14)=4,0.50,0.60-(FVar(14)*0.05))))
ignorehitpause = 1
[State 0, Dampening Minimal]
type = VarSet
trigger1 = FVar(15) < 0
fv = 15
value = 0
ignorehitpause = 1

[State 0, Minimum Dampening - Basics]
type = VarSet
trigger1 = StateNo = [200,3999]
fv = 10
value = 0.025 + (0.975 * FVar(15)) + ((Var(9)!=0)*0.6)
[State 0, Minimum Dampening - Specials]
type = VarSet
trigger1 = StateNo = [200,3999]
fv = 11
value = 0.10 + (0.90 * FVar(15)) + ((Var(9)!=0)*0.4)
[State 0, Minimum Dampening - EX]
type = VarSet
trigger1 = StateNo = [200,3999]
fv = 12
value = 0.25 + (0.75 * FVar(15)) + ((Var(9)!=0)*0.4)
[State 0, Minimum Dampening - Hyper]
type = VarSet
trigger1 = StateNo = [200,3999]
fv = 13
value = 0.40 + (0.60 * FVar(15)) + ((Var(9)!=0)*0.3)


;==============
; GUNSLINGER COMBO COUNT
;==============
[State 0, Dampen Reset]
type = VarSet
trigger1 = EnemyNear,Ctrl
v = 11
value = 1

;==============
; GROUNDBOUNCE COMBO
;==============
[State 0, Dampen Reset]
type = VarSet
trigger1 = EnemyNear,StateNo = [980,983]
trigger1 = EnemyNear,MoveType = H
v = 12
value = 0
[State 0, Dampen Reset]
type = VarSet
trigger1 = EnemyNear,Ctrl
v = 12
value = 1

;==============
; TRAILBLAZER
;==============
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = Time < 1
trigger1 = MoveType = H
time = 1
ignorehitpause = 1

;==============
; DROP THAT SHIT
;==============
;[State 0, TargetDrop]
;type = TargetDrop
;trigger1 = StateNo = 1301
;trigger1 = Time = 28
;trigger2 = PrevStateNo = 1301
;trigger2 = Time <= 1

;==============
; TORNADE
;==============
[State 0, Helper Seether Tornado]
type = Helper
trigger1 = Cond(Var(16)!=0,PlayerID(Var(16)),StateNo = 1422 && PlayerID(Var(16)),Anim = 5000,0)
trigger1 = NumHelper(1430) = 0
name = "Can't Fight The Seether"
ID = 1430
stateno = 1430
pos = 0,0
postype = p1
ownpal = 1

[State 0, Snd Victim HitWall]
type = PlaySnd
trigger1 = Var(16) != 0
trigger1 = Cond(Var(16)!=0,PlayerID(Var(16)),Anim = 1423 && PlayerID(Var(16)),AnimTime = -3,0)
value = S1,4
;channel = 1

[State 0, Drop Seether Target]
type = VarSet
trigger1 = Var(16) != 0
trigger1 = Cond(Var(16)!=0,PlayerID(Var(16)),StateNo > 1422,0)
v = 16
value = 0
[State 0, Var Combo Reset]
type = VarSet
trigger1 = NumTarget = 0
trigger2 = EnemyNear,ctrl = 1 || EnemyNear,MoveType != H
v = 17
value = 0
[State 0, Var Combo Reset]
type = VarSet
trigger1 = NumTarget = 0
trigger2 = EnemyNear,ctrl = 1 || EnemyNear,MoveType != H
v = 19
value = 0

;==============
; MAKE THE VOICES STOP
;==============

[State 0, StopSnd]
type = StopSnd
triggerall = StateNo != 100
triggerall = Time <= 1
trigger1 = PrevStateNo = 100 
channel = 1
ignorehitpause = 1

[State 0, RemoveExplod Horn]
type = RemoveExplod
trigger1 = StateNo >= 2000
trigger1 = Time <= 1
trigger1 = PrevStateNo = 1100
id = 1100
ignorehitpause = 1

;==============
; WHEN NOBODY LOVES YOU
;==============

[State -3, Pain S Sound]
type = PlaySnd
triggerall = Time = 1
triggerall = gethitvar(animtype) <= 1
triggerall = random < 500
triggerall = Life > 0
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = (anim = [5000,5001]) && (stateno != [5000,5999]) && AnimElem = 1, 1
trigger5 = (anim = [5010,5011]) && (stateno != [5000,5999]) && AnimElem = 1, 1
trigger6 = (anim = [5020,5021]) && (stateno != [5000,5999]) && AnimElem = 1, 1
value = S5000, random%9
channel = 3

[State -3, Pain L Sound]
type = PlaySnd
triggerall = Time = 1
triggerall = gethitvar(animtype) > 1
triggerall = Life > 0
trigger1 = Random < 450
trigger1 = stateno = 5000
trigger2 = Random < 550
trigger2 = stateno = 5010
trigger3 = Random < 600
trigger3 = stateno = 5020
trigger4 = stateno = 5070
trigger5 = (anim = 5002) && (stateno != [5000,5999]) && AnimElem = 1, 1
trigger6 = (anim = 5012) && (stateno != [5000,5999]) && AnimElem = 1, 1
trigger7 = (anim = 5022) && (stateno != [5000,5999]) && AnimElem = 1, 1
value = S5001, random%8
channel = 3

[State 0, GetUp Sound]
type = PlaySnd
trigger1 = Time = 1
trigger1 = StateNo = 5120
value = S5120,random%18
channel = 3

;==============
; Cheap K.O. system By Warusaki3
;==============
[State -2, 3]
type = ChangeState
trigger1 = !Alive
trigger1 = PrevStateNo = 130 || PrevStateNo = 131 || PrevStateNo = [150,153]
trigger1 = Stateno = [5000,5050]
value = 5950

[State -2,KO]
type = Varset
triggerall = StateNo = [120,159]
trigger1 = StateType = S
ignorehitpause = 1
fvar(1) = 0

[State -2,KO]
type = Varset
triggerall = StateNo = [120,159]
trigger1 = StateType = C
ignorehitpause = 1
fvar(1) = 1

[State -2,KO]
type = Varset
triggerall = StateNo = [120,159]
trigger1 = StateType = A
ignorehitpause = 1
fvar(1) = 2

[State 0, VarSet]
type = VarSet
trigger1 = !Alive
trigger1 = Var(32) = 0
v = 32
value = 1

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