[Data]
life = 1000
attack = 100
power = 3000
defence = 100
fall.defence_up = 50
liedown.time = 25
airjuggle = 999
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 255
IntPersistIndex = 40
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 20
ground.front = 20
air.back = 12
air.front = 12
height = 60
attack.dist = 160
proj.attack.dist = 90 
proj.doscale = 0
head.pos = 5, -115
mid.pos = 3, -85
shadowoffset = 1
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.5
walk.back = -2
run.fwd  = 8, 0 
run.back = -5,-3
jump.neu = 0,-10.5
hello.im.neu = 2
jump.back = -2.9
jump.fwd = 3.3 
runjump.back = -2.9,-10.5
runjump.fwd = 5.3,-15.5
airjump.neu = 0,-8.1
airjump.back = -2.55 
airjump.fwd = 2.5

[Movement]
airjump.num = 0 
airjump.height = 35
yaccel = .55
stand.friction = .85
crouch.friction = .82
;---------------------------------------------------------------------------
;hp
[Statedef 200]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = ifelse(prevstateno = 201 || prevstateno = 203,202,200)
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 1, 0
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 30,10
getpower = 200,100
givepower = 0,0
pausetime = 2,3
attr = S,NA
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,ifelse(!var(0),0,3)
guardsound = S0,6
ground.type = high
air.type = high
ground.slidetime = 10
ground.hittime = 14
ground.velocity = -5, 0
guard.velocity = -3.5
air.velocity = -3-fvar(1), -5+fvar(1)
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -7
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ò_ó]
type = Explod
trigger1 = movehit && p2statetype != A
persistent = 0
ignorehitpause = 1
anim = ceil(7009+fvar(8))
id = 7009
Postype = p2
facing = -1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
sprpriority = 1
ownpal = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;hp2
[Statedef 201]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 201
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 1, 0
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 30,10
getpower = 200,100
givepower = 20,10
pausetime = 2,3
attr = S,NA
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,ifelse(!var(0),0,3)
guardsound = S0,6
ground.type = high
air.type = high
ground.slidetime = 10
ground.hittime = 14
ground.velocity = -5, 0
guard.velocity = -3.5
air.velocity = -3-fvar(1), -5+fvar(1)
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -7
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ò_ó]
type = Explod
trigger1 = movehit && p2statetype != A
persistent = 0
ignorehitpause = 1
anim = ceil(7009+fvar(8))
id = 7009
Postype = p2
facing = -1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
sprpriority = 1
ownpal = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;lp
[Statedef 202]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = ifelse(prevstateno = 201 || prevstateno = 203,205,203)
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 1, 0
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 30,10
getpower = 20,10
givepower = 0,0
pausetime = 2,3
attr = S,NA
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,ifelse(!var(0),0,3)
guardsound = S0,6
ground.type = low
air.type = high
ground.slidetime = 10
ground.hittime = 14
ground.velocity = -5, 0
guard.velocity = -3.5
air.velocity = -3-fvar(1), -5+fvar(1)
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -7
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;lp2
[Statedef 203]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 204
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 1, 0
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 30,10
getpower = 200,100
givepower = 0,0
pausetime = 2,3
attr = S,NA
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,ifelse(!var(0),0,3)
guardsound = S0,6
ground.type = low
air.type = high
ground.slidetime = 10
ground.hittime = 14
ground.velocity = -5, 0
guard.velocity = -3.5
air.velocity = -3-fvar(1), -5+fvar(1)
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -7
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;shk
[Statedef 220]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 220
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 0, 9
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 85,30
getpower = 200,100
givepower = 0,0
pausetime = 8,8
attr = S,NA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 15
ground.hittime = 22
ground.velocity = -9, 0 
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -3.5
air.cornerpush.veloff = -10
ground.cornerpush.veloff = -10
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)


[State ]
type = Helper
trigger1 = movehit && !numhelper(7015)
helpertype = Normal
ID = 7015
name = "bleed?" 
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;slk
[Statedef 230]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 0, 9
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 80,25
getpower = 200,100
givepower = 0,0
pausetime = 8,8
attr = S,NA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,3
guardsound = S0,7
ground.type = low
air.type = high
ground.slidetime = 15
ground.hittime = 18
ground.velocity = -9, 0 
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -3.5
air.cornerpush.veloff = -10
ground.cornerpush.veloff = -10
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;backfist
[Statedef 208]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 207
sprpriority = 2

[State 0, brutality]
type = ChangeState
triggerall = !numpartner && !enemynear,numpartner
triggerall = prevstateno != 7022 && prevstateno != 60800 && movehit
triggerall = !var(4) && ((var(41) >= var(58)) || (var(58) = -1)) && enemynear,life = 1
triggerall = statetype = S
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "y"
value = 6080
ctrl = 0

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

[State ]
type = Hitdef
trigger1 = !time
damage = 60,30
getpower = 5,0
givepower = 0,0
pausetime = 8,8
attr = S,NA
guardflag = M
animtype = medium
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,1
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 11
guard.hittime = 15
ground.velocity = -2, 0
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -9.5
air.cornerpush.veloff = -10
ground.cornerpush.veloff = ifelse(prevstateno = 8000,-2,-10)
yaccel = .5
air.fall = 1
fall.recover = 0
envshake.time = 15
envshake.ampl = -2
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ]
type = posset
triggerall = !time
trigger1 = (prevstateno = 600 || prevstateno = 620)
y = 0
x = ifelse(enemynear,facing = 1,enemynear,pos x + 30,enemynear,pos x - 30)

[State turn]
type = turn
triggerall = (prevstateno = 600 || prevstateno = 620)
triggerall = (enemynear,facing = 1 && facing = 1) || (enemynear,facing = -1 && facing = -1)
trigger1 = !time && p2statetype != L

[State ]
type = Helper
trigger1 = movehit && !numhelper(7015)
helpertype = Normal
ID = 7015
name = "bleed?" 
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;knee
[Statedef 209]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 221
sprpriority = 2

[State 0, brutality]
type = ChangeState
triggerall = !numpartner && !enemynear,numpartner
triggerall = prevstateno != 7022 && prevstateno != 60800 && movehit
triggerall = !var(4) && ((var(41) >= var(58)) || (var(58) = -1)) && enemynear,life = 1
triggerall = statetype = S
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "y"
value = 6080
ctrl = 0

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

[State ]
type = Hitdef
trigger1 = !time
damage = 70,40
getpower = 200,100
givepower = 0,0
pausetime = 8,8
attr = S,NA
guardflag = M
animtype = medium
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,1
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 11
guard.hittime = 15
ground.velocity = -3, 0 
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -9.5
air.cornerpush.veloff = -10
ground.cornerpush.veloff = -10
forcestand = 1
yaccel = .5
air.fall = 1
fall.recover = 0
envshake.time = 15
envshake.ampl = -2
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ]
type = posset
triggerall = !time
trigger1 = (prevstateno = 600 || prevstateno = 620)
y = 0
x = ifelse(enemynear,facing = 1,enemynear,pos x + 30,enemynear,pos x - 30)

[State turn]
type = turn
triggerall = (prevstateno = 600 || prevstateno = 620)
triggerall = (enemynear,facing = 1 && facing = 1) || (enemynear,facing = -1 && facing = -1)
trigger1 = !time && p2statetype != L

[State ]
type = Helper
trigger1 = movehit && !numhelper(7015)
helpertype = Normal
ID = 7015
name = "bleed?" 
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;roundhouse
[Statedef 240]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !time
damage = 120,60
getpower = 50,20
givepower = 0,0
pausetime = 8,8
attr = S,NA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 17
ground.hittime = 17
ground.velocity = -5, -7 
air.velocity = -5-fvar(1), -5+fvar(1)
guard.velocity = -8
air.cornerpush.veloff = -15
ground.cornerpush.veloff = -15
yaccel = .5
fall = 1
fall.recover = 0
envshake.time = 15
envshake.ampl = -3
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State sound]
type = PlaySnd
trigger1 = !time
value = 0, 8

[State ]
type = Helper
trigger1 = movehit && !numhelper(7018)
helpertype = Normal
ID = 7018
name = "what the bleed?" 
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7018
ownpal = 1
size.xscale = 1
size.yscale = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;sweep
[Statedef 250]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 250
sprpriority = -1

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 0, 9
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !time
damage = 66,20
getpower = 40,20
givepower = 0,0
pausetime = 4,4
attr = S,NA
guardflag = L
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,3
guardsound = S0,7
ground.type = trip
air.type = high
ground.slidetime = 17
ground.hittime = 17
ground.velocity = 0, 0
air.velocity = -3, -5
guard.velocity = -6
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = -16
yaccel = .5
fall = 1
fall.recover = 0
sprpriority = -1
p2stateno = ifelse(p2statetype != A && roundstate = 2,251,-1)
p2getp1state = ifelse(p2statetype != A,1,0)
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ]
type = SprPriority
trigger1 = AnimElem = 6
value = 2

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;tripped
[Statedef 251]
type    = S
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = name = "Juano`s Sub guy"
trigger2 = name = "Juano`s Kit girl"
triggerall = !time
value = S2,13

[State end]
type = posset
trigger1 = 1
y = 0

[State amination]
type = ChangeAnim
Trigger1 = 1
value = 5070+ifelse(name = "juano`s morph guy",var(20),0)

[State omega shang tsung]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
value = ifelse(!enemynear,fvar(20),5070,570+ceil(enemynear,fvar(20)))

[State is it over?]
type = ChangeState
Trigger1 = hitshakeover
value = 252
;----------------------------------------------------------------
;tripped
[Statedef 252]
type    = L
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State end]
type = selfstate
trigger1 = time = 23
value = 5110
;----------------------------------------------------------------
;uppah
[Statedef 400]
type    = C
movetype= A
physics = C
poweradd= 0
ctrl = 0
velset = 0,0
anim = 400
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = !time
value = 0, 8

[State ]
type = Hitdef
trigger1 = !time
damage = 130,60
getpower = 50,20
givepower = 0,0
pausetime = 1,1
attr = C,NA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 999, 999
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 10
guard.hittime = 15
ground.velocity = -2, -15
air.velocity = -2, -15
guard.velocity = -14
air.cornerpush.veloff = -30
ground.cornerpush.veloff = -30
yaccel = .5
fall = 1
fall.recover = 0
envshake.time = 15
envshake.ampl = -4
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ]
type = ChangeAnim
Trigger1 = movehit
persistent = 0
value = 401

[State 0, ovacionkhanarena]
type = PlaySnd
triggerall = movehit
trigger1 = var(22) = 5006
value = F9891,18
volume = 0
ignorehitpause = 1
channel = -1
persistent = 0
lowpriority = -1

[State ]
type = movehitreset
Trigger1 = time = 8

[State ]
type = Playsnd
trigger1 = movehit && random >= 750
persistent = 0
value = 3,var(5)
abspan = 1

[State ]
type = Helper
trigger1 = movehit && !numhelper(7018)
helpertype = Normal
ID = 7018
name = "what the bleed?" 
postype = p2
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7018
ownpal = 1
ignorehitpause = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------
;clp
[Statedef 410]
type    = C
movetype= A
physics = C
ctrl = 0
velset = 0,0
anim = 410
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 1, 0
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 35,15
getpower = 200,100
givepower = 0,0
pausetime = 5,5
attr = C,NA
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,4
guardsound = S0,6
ground.type = low
air.type = high
ground.slidetime = 10
ground.hittime = 15
ground.velocity = -6, 0
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -4
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -9
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 11
ctrl = 1
;----------------------------------------------------------------
;clk
[Statedef 420]
type    = C
movetype= A
physics = C
ctrl = 0
velset = 0,0
anim = 420
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 0, 9
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 45,25
getpower = 200,100
givepower = 0,0
pausetime = 5,5
attr = C,NA
guardflag = L
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,4
guardsound = S0,6
ground.type = low
air.type = high
ground.slidetime = 16
ground.hittime = 16
ground.velocity = -7, 0
air.velocity = -3-fvar(1), -5+fvar(1)
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -9
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 11
ctrl = 1
;----------------------------------------------------------------
;chk
[Statedef 430]
type    = C
movetype= A
physics = C
ctrl = 0
velset = 0,0
anim = 430
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 0, 9
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 45,20
getpower = 200,100
givepower = 0,0
pausetime = 5,5
attr = C,NA
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,4
guardsound = S0,6
ground.type = low
air.type = high
ground.slidetime = 16
ground.hittime = 20
ground.velocity = -9, 0
air.velocity = -3-fvar(1), -5+fvar(1)
air.cornerpush.veloff = -9
ground.cornerpush.veloff = -9
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)


[State end]
type = changestate
trigger1 = !animtime
value = 11
ctrl = 1
;----------------------------------------------------------------
;jump punch
[Statedef 600]
type    = A
movetype= A
physics = A
poweradd= 0
ctrl = 0
anim = 600
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 1, 0
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 60,30
getpower = 20,10
givepower = 0,0
pausetime = 8,8
attr = A,NA
guardflag = H
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,1
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -3, 0 
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
fall.recover = 0
p2facing = 1
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ]
type = velset
Trigger1 = movecontact
ignorehitpause = 1
persistent = 0
x = 0
y = 0

[State turn]
type = turn
triggerall = p2bodydist x <= -13 && (enemynear,backedgedist != 0)
trigger1 = !time

[State ]
type = ChangeAnim
Trigger1 = pos y >= -23 && vel y >= 1
persistent = 0
value = ifelse(!(vel x),41,42)
elem = ifelse(!(vel x),3,1)
;----------------------------------------------------------------
;jump kick
[Statedef 620]
type    = A
movetype= A
physics = A
poweradd= 0
ctrl = 0
anim = ifelse(!(vel x),621,620)
sprpriority = 2

[State sound]
type = PlaySnd
trigger1 = time = 1
value = 0, 9
[State sound]
type = PlaySnd
trigger1 = !time && random >= 450
value = 2, 7+var(0)
channel = 0

[State ]
type = Hitdef
trigger1 = !movecontact
damage = ifelse(anim = 621,70,92),ifelse(anim = 621,35,40)
getpower = 10,20
givepower = 0,0
pausetime = 8,8
attr = A,NA
guardflag = H
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,1
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -3, ifelse(anim = 621,0,-7) 
air.velocity = -3-fvar(1), -5+fvar(1)
guard.velocity = -5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
yaccel = .5
fall = ifelse(anim = 620,1,0)
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = 1
kill = var(4)
guard.kill = var(4)

[State ]
type = velset
Trigger1 = movecontact
ignorehitpause = 1
persistent = 0
x = 0
y = 0

[State turn]
type = turn
triggerall = p2bodydist x <= -13 && (enemynear,backedgedist != 0)
trigger1 = !time

[State ]
type = Helper
trigger1 = movehit && !numhelper(7015) && anim = 620 && p2statetype != A
helpertype = Normal
ID = 7015
name = "bleed?" 
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State ]
type = ChangeAnim
Trigger1 = pos y >= -23 && vel y >= 1
persistent = 0
value = ifelse(!(vel x),41,42)
elem = ifelse(!(vel x),3,1)
;----------------------------------------------------------------
;throw attempt
[Statedef 800]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
anim = 800
sprpriority = 2

[State grabby]
type = HitDef
triggerall = p2movetype != H
Trigger1 = !Time
attr = S, NT 
hitflag = M- 
priority = 1, Miss 
sparkno = -1 
sprpriority = -1
;hitsound = s2,1 
p1facing = 1
p2facing = 1 
p1stateno = 801 
p2stateno = 802
guard.dist = 0
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0

[State grabby]
type = HitDef
triggerall = p2movetype = H && p2stateno = 7003
Trigger1 = !Time
attr = S, NT 
hitflag = M 
priority = 1, Miss 
sparkno = -1 
sprpriority = -1
;hitsound = s2,1 
p1facing = 1
p2facing = 1 
p1stateno = 801 
p2stateno = 802
guard.dist = 0
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0

[State end] 
type = ChangeState
trigger1 = !AnimTime
value = 202
;---------------------------------------------------------------
;throwing
[Statedef 801]
type    = U
movetype= I
physics = N
poweradd= 80
velset = 0,0
ctrl = 0
anim = 801
sprpriority = 1

[State OMEGAPSYSHO]
type = VarSet
trigger1 = !time
var(15) = ifelse(numenemy = 1 && ((p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO")|| p2name = "juano`s morph guy"),15,0)
ignorehitpause = 1

[State anim sektor smoke]
type = ChangeAnim
trigger1 = !time && var(20) != 1 && prevstateno != 6013 && prevstateno != 6014
value = ifelse(var(20) = 2,807,806)

[State air trow]
type = ChangeAnim
trigger1 = !time
trigger1 = prevstateno = 6013 || prevstateno = 6014
value = 806

[State cae]
type = StateTypeSet
trigger1 = prevstateno = 6013 || prevstateno = 6014
trigger1 = time = 20
physics = A

[State ground]
type = StateTypeSet
trigger1 = var(20) != 1 && prevstateno != 6013
statetype = S      

[State camera freeze]
type = ScreenBound
trigger1 = anim = 801
value = 1
movecamera = 1,0

;-------- cyrax ------
[State Y sube]
type = VelSet
trigger1 = anim = 801 && animelemtime(3) = [0,10]
y = -10

[State Y baja]
type = VelAdd
trigger1 = anim = 801 && pos y < 0 && animelemtime(3) >= 10
y = .9

[State Y stop]
type = VelSet
trigger1 = anim = 801 && pos y > 0;ceil(const(size.yscale)*45)  
y = 0

[State Y ground]
type = PosSet
trigger1 = anim = 801 && !animtime 
y = 0

[State X atras]
type = VelSet
trigger1 = anim = 801 && animelemtime(3) > 0
x = -ifelse(animelemtime(3) < 10,1,3)

[State X stop]
type = VelSet
trigger1 = anim = 801 && pos y > 0;ceil(const(size.yscale)*45)  
x = 0

[State tiembla]
type = EnvShake 
trigger1 = anim = 801 && time = 41
time = 10
ampl = -6

[State tiembla]
type = PlaySnd
trigger1 = anim = 801 && time = 41
value = S2,2
freqmul = .7
volume = 255

[State agarra 1]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 801 && animelem = 3
pos = ceil(15*const(size.xscale)), ceil(-76*const(size.yscale))-var(15)

[State agarra 2]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 801 && animelem = 4
pos = ceil(-15*const(size.xscale))-(var(15)*2), ceil(-70*const(size.yscale))-(var(15)*0.5)

[State agarra 3]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 801 && animelem = 5
pos = ceil(-34*const(size.xscale))-var(15), ceil(-98*const(size.yscale))+(var(15)*2.5)

[State agarra 4]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 801 && animelem = 6
pos = ceil(-40*const(size.xscale))-(var(15)*0.5), ceil(-45*const(size.yscale))+(var(15)*2)

[State agarra 5]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 801 && animelem = 7
pos = ceil(-7*const(size.xscale))+var(15), ceil(-10*const(size.yscale))+(var(15)*2)

[State agarra 6]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 801 && animelem = 8
pos = ceil(10*const(size.xscale)), ceil(-20*const(size.yscale))+(var(15)*2)

;------------------- sektor
[State sale]
type = PlaySnd
trigger1 = anim = 807 && animelem = 1
value = 1,17

[State arroja]
type = PlaySnd
trigger1 = anim = 807 && animelem = 9
value = 1,19

[State agarra 1]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 1
Trigger1 = enemynear,name != "SHANG TSUNG" && enemynear,authorname != "OMEGAPSYCHO"
pos = ceil(20*const(size.xscale)), 0

[State agarra 2]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 8
pos = ceil(55*const(size.xscale)), ceil(-110*const(size.yscale))

[State agarra 3]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 9
pos = ceil(40*const(size.xscale)), ceil(-135*const(size.yscale))

[State agarra 4]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 10
pos = ceil(18*const(size.xscale)), ceil(-155*const(size.yscale))

[State agarra 5]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 11
pos = ceil(-16*const(size.xscale)), ceil(-163*const(size.yscale))

[State agarra 6]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 12
pos = ceil(-56*const(size.xscale)), ceil(-158*const(size.yscale))

[State agarra 7]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 13
pos = ceil(-95*const(size.xscale)), ceil(-139*const(size.yscale))

[State agarra 87]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 807 && animelem = 14
pos = ceil(-112*const(size.xscale)), ceil(-70*const(size.yscale))

[State p2cae]
type = TargetVelAdd
triggerall = numtarget > 0
trigger1 = anim = 807 && animelemtime(14) = 2
x = -1
y = 10

;------------------- smoke
[State agarra 1]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 1
pos = ceil(20*const(size.xscale)), 0

[State agarra 2]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 2
pos = ceil(38*const(size.xscale)), ceil(-90*const(size.yscale))

[State agarra 3]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 3
pos = ceil(13*const(size.xscale)), ceil(-113*const(size.yscale))

[State agarra 4]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 4
pos = ceil(8*const(size.xscale)), ceil(-129*const(size.yscale))

[State agarra 5]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 5
pos = ceil(35*const(size.xscale)), ceil(-120*const(size.yscale))

[State agarra 6]
type = Targetbind
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 6
pos = ceil(50*const(size.xscale)), ceil(-80*const(size.yscale))

[State gira]
type = Turn
trigger1 = anim = 806 && animelem = 4

[State camara]
type = ScreenBound
trigger1 = anim = 806
value = 0

[State p2cae]
type = TargetVelAdd
triggerall = numtarget > 0
trigger1 = anim = 806 && animelem = 7
y = 10

;--------------------- common
[State p2cae]
type = TargetVelAdd
trigger1 = anim = 801 && time = 47
y = 5

[State p2suelo]
type = Targetstate
trigger1 = anim = 801 && time = 47
trigger2 = anim = 806 && animelem = 7
trigger3 = anim = 807 && animelem = 14
value = 803

[State ouchy!]
type = targetlifeadd
trigger1 = anim = 801 && time = 45
trigger2 = anim = 806 && animelem = 7
trigger3 = anim = 807 && animelem = 14
absolute = 1
value = ifelse(var(2),-55,-90)
kill = var(4)

[State Don't miss]
type = Width
trigger1 = anim = 801 && animelem = 8
trigger2 = anim = 806 && animelem = 7
value = 0,80

[State end] 
type = ChangeState
trigger1 = !AnimTime && !pos y
ctrl = 1
value = 0

[State block] 
type = changeState
trigger1 = time <= 5 && target,command = "a" && !pos y 
value = 804

[State Sound]
type = PlaySnd
trigger1 = !time
value = ifelse(anim = 806,1,3),ifelse(anim = 806,14,9)
channel = 0
;---------------------------------------------------------------
;being thrown
[Statedef 802]
type    = L
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State amination]
type = ChangeAnim
Trigger1 = time <= 12 && enemynear,anim = 801
value = 5000+ifelse(name = "juano`s morph guy",var(20),0)

[State omega shang tsung]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger1 = !time
value = ifelse(!enemynear,fvar(20),5000,500+ceil(enemynear,fvar(20)))

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

[State don't hurt me]
type = nothitby
trigger1 = 1
time = 1
value = SCA

[State cyrax] 
type = ChangeAnim2
trigger1 = enemynear,anim = 801 && time >= 5 && anim != 803 && name != "juano`s morph guy"
Trigger1 = anim != 407+ceil(enemynear,fvar(20)) && anim != 500+ceil(enemynear,fvar(20))
value = 803

[State sektor]
type = ChangeAnim2
Trigger1 = anim != 407+ceil(enemynear,fvar(20)) && anim != 500+ceil(enemynear,fvar(20))
trigger1 = enemynear,anim = 807 && anim != 8020 && name != "juano`s morph guy"
value = 8020

[State smoke]
type = ChangeAnim2
trigger1 = enemynear,anim = 806 && anim != 802 && name != "juano`s morph guy"
Trigger1 = anim != 407+ceil(enemynear,fvar(20)) && anim != 500+ceil(enemynear,fvar(20))
value = 802


[State cyrax shang tsung mk2]
type = ChangeAnim
trigger1 = enemynear,anim = 801 && anim != 3801+var(20) && name = "juano`s morph guy"
value = 3801+var(20)

[State sektor shang tsung mk2]
type = ChangeAnim
trigger1 = enemynear,anim = 807 && anim != 3802+var(20) && name = "juano`s morph guy"
value = 3802+var(20)

[State smoke shang tsung mk2]
type = ChangeAnim
trigger1 = enemynear,anim = 806 && anim != 3803+var(20) && name = "juano`s morph guy"
value = 3803+var(20)

[State omega shang tsung]
type = ChangeAnim
Triggerall = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
trigger1 = enemynear,anim = 801 && time >= 5 && time <= 10 
trigger2 = enemynear,anim = 807 && anim != 407+ceil(enemynear,fvar(20)) && time >= 21
trigger3 = enemynear,anim = 806 && anim != 407+ceil(enemynear,fvar(20)) && time >= 4
value = 407+ceil(enemynear,fvar(20))
elem = 3

[State freeze]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger1 = anim = 407+ceil(enemynear,fvar(20)) && animelemtime(6) >= 0
value = anim
elem = 6

;---------------------------------------------------------------------------
;flying
[Statedef 803]
type    = A
movetype= H
physics = N
ctrl = 0
;velset = 6,-4

[State ]
type = VelAdd
trigger1 = !time
x = 6
y = -4

[State freeze]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG"
value = anim
elem = 6

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

[State BLAH, DAMN YOU!]
type = Veladd
trigger1 = 1
y = .55

[State weeeeeee!]
type = selfstate
trigger1 = (Vel Y > 0) && (Pos Y >= 0)
value = 5100
;----------------------------------------------------------------
;Tech hit my ass!
[Statedef 804]
type    = S
movetype= I
physics = S
juggle  = 0
poweradd= 0
velset = -4,0
ctrl = 0
anim = 804
sprpriority = -1

[State bitchass] 
type = Targetstate
trigger1 = !time
value = 805

[State ]
type = posset
trigger1 = 1
y = 0

[State ]
type = velset
trigger1 = 1
x = -2

[State Sound]
type = Playsnd
trigger1 = !time
value = 2, 6
channel = 0

[State end]
type = changestate
trigger1 = !animtime
;triggerall = statetype != A
value = 0
ctrl = 1

;----------------------------------------------------------------
;get down
[Statedef 805]
type    = S
movetype= I
physics = S
juggle  = 8
poweradd= 0
velset = -4,0
ctrl = 0
sprpriority = -1

[State look ma no hands] 
type = ChangeAnim2
trigger1 = !time 
value = 805

[State look ma no hands]
type = ChangeAnim
trigger1 = !time && authorname = "juano16"
value = 805+ifelse(name = "juano`s morph guy",var(20),0)

[State omega shang tsung]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger1 = !time
value = ifelse(!enemynear,fvar(20),5007,507+ceil(enemynear,fvar(20)))

[State ]
type = posset
trigger1 = 1
y = 0

[State ]
type = velset
trigger1 = 1
x = -2

[State end]
type = selfstate
trigger1 = time >= 18
value = 0
ctrl = 1
;-----------------------------------------------
;Dial-a-combo set 1
[Statedef 8000]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

[State MoveHitReset]
type = MoveHitReset
trigger1 = !time
ignorehitpause = 1

[State 0, brutality]
type = ChangeState
triggerall = !numpartner && !enemynear,numpartner
triggerall = prevstateno != 7022 && prevstateno != 60800 && movehit
triggerall = !var(4) && ((var(41) >= var(58)) || (var(58) = -1)) && enemynear,life = 1
triggerall = statetype = S
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "y"
value = 6080
ctrl = 0

[State golpe]
type = ChangeAnim
trigger1 = !time && prevstateno = 208
value = 208

[State patada]
type = ChangeAnim
trigger1 = !time && prevstateno = 209
value = 222

[State rodillazo]
type = ChangeAnim
trigger1 = !time && prevstateno = 8003 && anim = 207
value = 221

[State ]
type = posadd
trigger1 = animelem = 2
x = 5

[State ]
type = Helper
trigger1 = movehit && !numhelper(7015) && anim != 6006 && p2statetype != A
helpertype = Normal
ID = 7015
name = "bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 42,20
getpower = 20,10
givepower = 0,0
pausetime = 6,6
attr = S,SA
guardflag = M
animtype = medium
air.animtype = medium
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = 0, 0
guard.velocity = -3
air.velocity = -3, -5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
envshake.time = 15
envshake.ampl = -3
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;-----------------------------------------------
;Dial-a-combo set 2
[Statedef 8002]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

[State MoveHitReset]
type = moveHitReset
trigger1 = !time
ignorehitpause = 1

[State 0, brutality]
type = ChangeState
triggerall = !numpartner && !enemynear,numpartner
triggerall = prevstateno != 7022 && prevstateno != 60800 && movehit
triggerall = !var(4) && ((var(41) >= var(58)) || (var(58) = -1)) && enemynear,life = 1
triggerall = statetype = S
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "y"
value = 6080
ctrl = 0

[State ]
type = ChangeAnim
trigger1 = !time && prevstateno = 8000 && anim = 208
value = 221

[State ]
type = posadd
trigger1 = animelem = 2
x = 5

[State ]
type = Helper
trigger1 = movehit && !numhelper(7015) && anim != 6006 && p2statetype != A
helpertype = Normal
ID = 7015
name = "bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 40,20
getpower = 20,10
givepower = 0,0
pausetime = 6,6
attr = S,SA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
ground.hittime = 12
ground.velocity = 0, 0
guard.velocity = -3
air.velocity = -3, -5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
envshake.time = 15
envshake.ampl = -3
kill = var(4)
guard.kill = var(4)

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;-----------------------------------------------
;Dial-a-combo set 3
[Statedef 8003]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

[State MoveHitReset]
type = MoveHitReset
trigger1 = !time
ignorehitpause = 1

[State 0, brutality]
type = ChangeState
triggerall = !numpartner && !enemynear,numpartner
triggerall = prevstateno != 7022 && prevstateno != 60800 && movehit
triggerall = !var(4) && ((var(41) >= var(58)) || (var(58) = -1)) && enemynear,life = 1
triggerall = statetype = S
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "y"
value = 6080
ctrl = 0

[State ]
type = ChangeAnim
trigger1 = !time && anim = 221 && prevstateno = 8002
value = ifelse(var(20) = 1,207,222)

[State ]
type = posadd
trigger1 = animelem = 2
x = 5

[State ]
type = Helper
trigger1 = movehit && !numhelper(7015) && anim != 6006 && p2statetype != A
helpertype = Normal
ID = 7015
name = "bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 1
size.yscale = 1

[State ]
type = Hitdef
trigger1 = !movecontact
damage = 36,15
getpower = 20,10
givepower = 0,0
pausetime = 6,6
attr = S,SA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
ground.hittime = 12
ground.velocity = 0, 0
guard.velocity = -3
air.velocity = -3, -5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
envshake.time = 15
envshake.ampl = -3
kill = var(4)
guard.kill = var(4)

[State 0, END]
type = ChangeState
triggerall = movecontact
trigger1 = anim = 223 && ((command = "holdback" && command = "y") || (var(55) = 1 && random <= 350)) && time >= 10
trigger2 = anim = 224 && time >= 5 && ((command = "holdup" && command = "y") || (var(55) = 1 && random <= 350))
value = 8001

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;-----------------------------------------------
;Dial-a-combo end
[Statedef 8001]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

[State MoveHitReset]
type = MoveHitReset
trigger1 = !time
ignorehitpause = 1

[State golpe con giro]
type = ChangeAnim
trigger1 = !time && anim = 208 && prevstateno = 8000 && var(20) != 2 
trigger2 = !time && prevstateno = 8003 && anim = 222 && var(20) = 3 && command = "hold_a"
trigger3 = !time && anim = 222 && prevstateno = 8000 && command != "hold_y"
value = 209

[State uppercut]
type = ChangeAnim
trigger1 = !time && anim = 208 && prevstateno = 8000 && var(20) = 2
value = 210

[State I roundhouse]
type = ChangeAnim
trigger1 = !time && anim = 222 && prevstateno = 8000 && anim != 209 && var(20) != 1
trigger2 = !time && prevstateno = 8003 && anim = 222 && var(20) != 3
trigger3 = !time && anim = 221 && prevstateno = 8002 
value = 223

[State N roundhouse]
type = ChangeAnim
trigger1 = !time && anim = 222 && prevstateno = 8000 && anim != 209 && var(20) = 1
value = 224

[State patada alta]
type = ChangeAnim
trigger1 = !time && prevstateno = 8000 && anim = 221
trigger2 = !time && prevstateno = 209 && anim = 221
trigger3 = !time && anim = 209 && prevstateno = 8000 && var(20) = 3 && command = "hold_y"
value = 222

[State ]
type = Helper
trigger1 = movehit && !numhelper(7018) && p2statetype != A
helpertype = Normal
ID = 7018
name = "what the bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7018
ownpal = 1
size.xscale = 1
size.yscale = 1

[State ]
type = posadd
trigger1 = animelem = 3
x = 10

[State ]
type = Hitdef
trigger1 = !movecontact && anim != 210
damage = 90,40
getpower = 20,10
givepower = 0,0
pausetime = 8,8
attr = S,SA
hitflag = M
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -6, -5
guard.velocity = -10
air.velocity = -3, -5
air.cornerpush.veloff = -20
ground.cornerpush.veloff = -20
yaccel = .5
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
envshake.time = 15
envshake.ampl = -3
kill = var(4)
guard.kill = var(4)


[State uppercut]
type = Hitdef
trigger1 = !movecontact && anim = 210
damage = 50,20
getpower = 50,140
givepower = 0,0
pausetime = 2,2
attr = S,SA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -1.7, -14
guard.velocity = -20
air.velocity = -1.7, -14
air.cornerpush.veloff = -20
ground.cornerpush.veloff = -20
yaccel = .5
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
envshake.time = 15
envshake.ampl = -4
kill = var(4)
guard.kill = var(4)


[State 0, ovacionkhanarena]
type = PlaySnd
triggerall = movehit
trigger1 = var(22) = 5006
value = F9891,18
volume = 0
ignorehitpause = 1
channel = -1
persistent = 0
lowpriority = -1

[State ]
type = Playsnd
trigger1 = movehit && random >= 750
persistent = 0
value = 3,var(5)
abspan = 1

[State end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[statedef -2]
;=================================================================
;====================== MANEJO DE PALETAS ========================
;=================================================================
[State -2, cyrax]
type = VarSet
trigger1 = !var(20) && !fvar(6)
trigger1 = palno = 1 || palno = 4 || palno = 7 || palno = 10
trigger2 = fvar(6) = 1 && var(20) != 1
var(20) = 1

[State -2, sektor]
type = VarSet
trigger1 = !var(20) && !fvar(6)
trigger1 = palno = 2 || palno = 5 || palno = 8 || palno = 11
trigger2 = fvar(6) = 2 && var(20) != 2
var(20) = 2

[State -2, smoke]
type = VarSet
trigger1 = !var(20) && !fvar(6)
trigger1 = palno = 3 || palno = 6 || palno = 9 || palno = 12
trigger2 = fvar(6) = 3 && var(20) != 3
var(20) = 3

[State -2, parasonidosMKA]
type = VarSet
trigger1 = palno = [7,12]
var(27) = 1

;=================================================================
;-----------------------| STAGE ID |------------------------------
[state -2,STAGEFATALITY]
type = VarSet
triggerall = !fvar(5)
trigger1 = var(22) = 5005
trigger2 = var(22) = 5008
trigger3 = var(22) = 5010
trigger4 = var(22) = 5011
trigger5 = var(22) = 5014
trigger6 = var(22) = 5015
trigger7 = var(22) = 5017
trigger8 = var(22) = 5018
trigger9 = var(22) = 5019
trigger10 = var(22) = 5033
fvar(5) = 1
;----------|MORTAL KOMBAT 1|----------
[state CourtYard]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -1)
trigger1 = screenpos Y = 219
var(22) = 5030

[state PalaceGates]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -1)
trigger1 = screenpos Y = 217
var(22) = 5029

[state -2,Warriorshrine]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -1)
trigger1 = screenpos Y = 218
var(22) = 5031

[state pit 1]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -1)
trigger1 = screenpos Y = 211
var(22) = 5005

[state Throneroom Pitbotom]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -1)
trigger1 = screenpos Y = 221 || screenpos Y = 225
var(22) = 5032

[state Goroliar]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -1)
trigger1 = screenpos Y = 210
var(22) = 5034


;----------|MORTAL KOMBAT 2|----------
[state deadpool]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 205
var(22) = 5008

[state -2, kombatTomb]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 221
var(22) = 5011

[state wasteland]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 218 
var(22) = 5013

[state the tower]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 224
var(22) = 5009

[state living forest]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 219
var(22) = 5007

[state THE PIT2]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 206
var(22) = 5010

[state armory]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 222
var(22) = 5012

[state portal]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 226
var(22) = 5016

[state KHAN ARENA]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -2)
trigger1 = screenpos Y = 225
var(22) = 5006


;----------|MORTAL KOMBAT 3|----------
[state Balcony]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 221
var(22) = 5023

[state belltower]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 197
var(22) = 5018

[state Bridge]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 226
var(22) = 5024

[state graveyard]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 224
var(22) = 5027

[state pit3]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 194
var(22) = 5014

[state Roof PortalMK3 Desert]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 217 || screenpos Y = 200
var(22) = 5021

[state SoulChamber Blue]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 222 || screenpos Y = 201
var(22) = 5025

[state TheStreet]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 218
var(22) = 5020

[state subway]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 219
var(22) = 5017

[state Temple]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 223
var(22) = 5026

[state Bank Cave]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 225
var(22) = 5022

[state scorpion lair]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 216
var(22) = 5015

[state WaterFront]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -3)
trigger1 = screenpos Y = 215
var(22) = 5028

;-------------|ORIGINAL|--------------
[state ElderGods]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -4)
trigger1 = screenpos Y = 199
var(22) = 5033

[state subwayMKA]
type = VarSet
triggerall = !var(22) && Floor(Pos Z = -4)
trigger1 = screenpos Y = 190
var(22) = 5019


;=================================================================
[State -2, green Blood]
type = VarSet
triggerall = !fvar(8) && !enemynear,numpartner && !fvar(15) && roundstate = 2
trigger1 = enemynear,name = "Juano`s Sub guy" 
trigger1 = (enemynear,var(20) = 3 && !enemynear,fvar(6)) || enemynear,fvar(6) = 3
trigger2 = enemynear,name = "reptile by binho"
fvar(8) = 10000

[State -2, oil Blood]
type = VarSet
triggerall = !fvar(8) && !enemynear,numpartner && !fvar(15) && roundstate = 2
trigger1 = enemynear,name = "juano`s cyborg guy"
fvar(8) = 20000

;--------------------------- Omegapsysho Shang Tsung modes
[State unmorph]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = !var(31) && !var(32) && !var(33) && !var(34) && !var(35) 
trigger1 = !var(36) && !var(37) && !var(38) && !var(39)
fvar(20) = 0

[State KANO]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(31) = 1
fvar(20) = 11000

[State LIU KANG]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(32) = 1
fvar(20) = 12000

[State RAYDEN]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(33) = 1
fvar(20) = 13000

[State CAGE]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(34) = 1
fvar(20) = 14000

[State SCORPION]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(35) = 1
fvar(20) = 15000

[State SUBZERO]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(36) = 1
fvar(20) = 16000

[State SONYA]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(37) = 1
fvar(20) = 17000

[State REPTILE]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(38) = 1
fvar(20) = 18000

[State ERMAC]
type = VarSet
trigger1 = numenemy = 1 && p2name = "SHANG TSUNG" && enemynear,authorname = "OMEGAPSYCHO"
trigger1 = enemynear,var(39) = 1
fvar(20) = 19000

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

[state -2, invisible]
type = AssertSpecial
trigger1 = var(17) = 1
trigger2 = numexplod(180)
trigger3 = numexplod(18099)
trigger4 = numexplod(6051)
flag = invisible
[State -2, dejainviciblealsergolpeadooganar]
type = VarSet
triggerall = var(17) = 1
trigger1 = movetype = H
trigger2 = win = 1 && !numexplod(6051)
var(17) = 0

[State -2.hypersa0]
type = VarSet
trigger1 = var(6) > 0 && StateNo != 3011 && StateNo != 3012 && StateNo != 3013 && StateNo != 3014
var(6) = 0

[State noinfinite]
type = VarSet
trigger1 = stateno = 0 && time = 15 && enemynear,movetype != H
trigger2 = var(12) > 0 && enemynear,ctrl && enemynear,statetype != L && enemynear,statetype != A && p2bodydist x != [-40,40]
;trigger3 = enemynear,numpartner != 0
var(12) = 0

[State 0, VarSet]
type = VarSet
trigger1 = var(6) = 3
var(12) = -1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = p2stateno = 60723
flag = noautoturn

[State 0,nadaalfrentePIT2]
type = AssertSpecial
triggerall = var(22) = 5010
trigger1 = stateno = 6077
trigger2 = p2stateno = 607712
flag = noFG

[State -2, noboardenfatals]
type = AssertSpecial
trigger1 = stateno != 6077 && stateno = [6050,6098]
trigger2 = stateno != 6080 && stateno = [60801,60805]
trigger3 = stateno = 6077 && var(22) != 5008 ;&& var(22) != 5005
trigger4 = stateno = 60806 || stateno = [60877,60887]
trigger5 = stateno = 6075
trigger6 = fvar(15)
flag = nobardisplay
ignorehitpause = 1

[State -2, nomusicaenbrutality]
type = AssertSpecial
trigger1 = stateno = 60806 || stateno = [60877,60887]
flag = nomusic
ignorehitpause = 1

[State -2, yo]
type = DisplayToClipboard
trigger1 = 1
text = "StageID:%d backedgebodydist:%d distP2:%d Hara-Kiri:%f Blood:%f"
params = var(22),backedgebodydist,floor(p2bodydist X),fvar(15),fvar(8)

[State -2]
type = varset
triggerall = roundstate <= 2;= 2
trigger1 = 1
ignorehitpause = 1
fvar(0) = ifelse((enemynear,gethitvar(hitcount) = [1,4]),.22,ifelse((enemynear,gethitvar(hitcount) = [5,7]),.35,ifelse((enemynear,gethitvar(hitcount) = [8,19]),.40,ifelse((enemynear,gethitvar(hitcount) >= 20),.48,0))))

[State -2]
type = attackmulset
trigger1 = roundstate <= 2
ignorehitpause = 1
value = ifelse(p2movetype != H,1,1-fvar(0))

[State -2]
type = varset
triggerall = roundstate <= 2
trigger1 = p2movetype = H && enemynear,gethitvar(hitcount) >= 5
ignorehitpause = 1
fvar(1) = ((enemynear,gethitvar(hitcount))/5.0)-1

[State -2]
type = varset
triggerall = roundstate <= 2
trigger1 = p2movetype != H
ignorehitpause = 1
fvar(1) = 0

[State -3, blar]
type = VarRandom
trigger1 = 1
ignorehitpause = 1
v = 5
range = 1,5
[State 0, VarAdd]
type = VarAdd
triggerall = var(27) = 1
trigger1 = var(5) = [1,5]
var(5) = 10

[State -2]
type = varset
triggerall = roundstate <= 2
trigger1 = p2movetype != H
ignorehitpause = 1
var(2) = 0

[State ow]
type = Playsnd
trigger1 = !time && movetype = H
trigger1 = random >= 300 && (stateno = 5000 || stateno = 5010 || stateno = 5020 || stateno = 5080 || stateno = 60800 || stateno = 6069 || stateno = 7002 || stateno = 6004 || stateno = 60800 || stateno = 6008 || stateno = 60510 || stateno = 60541)
trigger2 = enemynear,stateno = 6068 && enemynear,time = 90 && stateno = 7022
trigger3 = stateno = 60541 && time > 30 && (time%70) = 1
trigger4 = stateno = 90052 && (time = 93 || !time)
trigger5 = (stateno = 607214 && time = 1) || (stateno = 60521 && time = 90)
trigger6 = stateno = 60921 && !time && movetype = H
value = 2,3
channel = 0

[State -2]
type = assertspecial
trigger1 = 1
ignorehitpause = 1
flag = noairguard

[State -2]
type = assertspecial
trigger1 = movetype != H
ignorehitpause = 1
flag = nokoslow

[State -2]
type = assertspecial
trigger1 = roundstate = 4
ignorehitpause = 1
flag = nobardisplay

[State ]
type = varset
triggerall = !fvar(7)
triggerall = roundstate != 1
trigger1 =  !(var(41) >= var(58)) && var(58) != -1 || numpartner >= 1 || enemynear,numpartner >= 1 || var(58) = -2
var(4) = 1
ignorehitpause = 1

[State ]
type = Helper
triggerall = !fvar(7) && !numpartner && !enemynear,numpartner
triggerall = !numhelper(7021) && roundstate != 1  && !var(4) && ((var(41) >= var(58)) || (var(58) = -1))
trigger1 = enemynear,life <= 2
trigger1 = (p2statetype != A && p2movetype != H) || (p2statetype = L && p2movetype = H)
helpertype = Normal
ID = 7021
name = "Finish" 
postype = p2
pos = 0,0
stateno = 7021
ownpal = 1

[State ]
type = Helper
triggerall = !numhelper(7026) && roundstate != 1
trigger1 = !time
helpertype = Normal
ID = 7026
name = "Control MK"
postype = left
pos = 0,0
stateno = 7026
ownpal = 1

[State ]
type = varset
trigger1 = !var(58)
persistent = 0
var(58) = 1

[State -2, VarRandom]
type = VarRandom
trigger1 = 1
v = 23
range = 0,2
ignorehitpause = 1
;=========================================================
;========== HELPER BONUS  Siempre necesario ==============
;=========================================================
[State 0, Helper]
type = Helper
trigger1 = !numhelper(70999) && stateno = 5900
helpertype = normal
name = "Bonus State"
ID = 70999
stateno = 70999
postype = left
persistent = 0

[State ID]
type = Helper
trigger1 = !numhelper(70998) && stateno = 5900
helpertype = normal
name = "CharID"
ID = 70998
stateno = 70998
postype = left
persistent = 0

[State 0, nogirabonus]
type = AssertSpecial
trigger1 = fvar(4) = 1
flag = noautoturn

[State 0, posZscale]
type = VarSet
trigger1 = floor(pos Z = -120)
fvar(2) = -.47

[State -125, posZscale]
type = VarSet
trigger1 = floor(pos Z = -125)
fvar(2) = -.5
;----------------------------------------- kHAMELEON ATACK COLORS
[State -3, cyr]
type = PalFX
triggerall = var(21) = 1
trigger1 = numexplod(2100) = 1 && !numexplod(6013)
trigger1 = prevstateno != 60821 ; no eternal ice
time = 70
add = 50,50,0
mul = 150,150,0
sinadd = 0,0,0,1
invertall = 0
color = 0
ignorehitpause = 1

[State -3, sek]
type = PalFX
triggerall = var(21) = 1
trigger1 = numexplod(2101) = 1 && !numexplod(6013)
trigger1 = prevstateno != 60821 ; no eternal ice
time = 70
add = 100,0,0
mul = 120,20,20
sinadd = 0,0,0,1
ignorehitpause = 1

[State -3, smk]
type = PalFX
triggerall = var(21) = 1
trigger1 = numexplod(2102) = 1 && !numexplod(6013)
trigger1 = prevstateno != 60821 ; no eternal ice
time = 70
mul = 100,100,150
sinadd = 0,0,0,1
invertall = 0
color = 0
ignorehitpause = 1
;------------------------------------------ CHAMELEON RANDOM COLORS
[State 0, Chameleon]
type = Explod
triggerall = anim != 6988 && anim != 6989 && anim != 70322 && anim != 195 && anim != 1952 && anim != 6985
triggerall = stateno != [6050,6074]
triggerall = stateno != 6076 && stateno != [6078,6079]
triggerall = stateno != [6082,6083]
triggerall = stateno != [6085,6098]
triggerall = var(21) = 1
triggerall = numexplod(2100+var(9)) < 6
trigger1 = (time%(ifelse(stateno = 180,10,30))) = 1
anim = 9999
ID = 2100+var(9)
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = var(59) = 1
v = 21
value = 1

[State 0, Trans]
type = Trans
trigger1 = stateno != [191,199]
trigger1 = var(21) = 1
trans = addalpha
alpha= 256,50

[State 0, VarRandom]
type = VarRandom
trigger1 = var(21) = 1
triggerall = !(time%5)
v = 9
range = 0,2

[State -1,ON sound]
type = playsnd
trigger1 = !var(59)
Trigger1 = (stateno = [191,199]) && (numhelper(7019) = 1 && roundno = 1)
Trigger2 = ((stateno = 5900 && roundno != 1 && time < 3) || (time = 2 && stateno = [191,199]))
trigger2 = command = "AI36"
triggerall = var(21) = 1
channel = -1
value = 16,ifelse(!var(27),3,13)
volume = 255
persistent = 0

[State -3, Landing Sound]
type = PlaySnd
trigger1 = (time = 1 && stateno = 52) 
value = 3, 0

[State -3, blar]
type = VarRandom
trigger1 = 1
ignorehitpause = 1
v = 0
range = 0,1

[State -2]
type = defencemulset
trigger1 = movetype != H
value = 1

[State callacarga]
type = StopSnd
trigger1 = !time && prevstateno = 3002 && movetype = H
channel = 3

[State ]
type = Helper
trigger1 = !numhelper(7019) && command = "start" && !var(55) && !win && !lose && (stateno = 5900 || (numhelper(7021) && ctrl) || stateno = [190,199])
helpertype = Normal
ID = 7019
name = "das menu" 
postype = back
pos = 0,0
stateno = 7019
ownpal = 1

[State -3, homodesmokedepie]
type = Explod
triggerall = !numexplod(18099) && !numexplod(6051) && !var(17)
triggerall = lose != 1
triggerall = stateno != 170 && !numexplod(7014)
triggerall = statetype != C && !numhelper(7019)
triggerall = var(17) != 1 && !numexplod(180)
triggerall = anim != 6028 && stateno != 195 && anim != 195 && anim != 1952
trigger1 = TimeMod = 4,0
trigger2 = stateno = 9830 && stateno != 191
triggerall = anim != 9410 && stateno != 199
triggerall = anim != 5110 && stateno != 6070
triggerall = anim != 5808 && stateno != 170
triggerall = anim != 5150 && stateno != 171
triggerall = anim != 5060 && stateno != 172
triggerall = anim != 5050 && stateno != 173
triggerall = anim != 5808 && anim != 7080
triggerall = stateno != 1005
triggerall = stateno != 11005
triggerall = anim != 5140 && life > 1
triggerall = var(20) = 3 || var(21) = 1
anim = 7040
name = "Humo"
pos = 0, ceil(-70*const(size.yscale)*(1+fvar(2)))
postype = p1
vel = (vel X)*(1+fvar(2)), -1 + vel Y/10
accel = -(vel X)*.05*(1+fvar(2))
random = ceil(40*const(size.xscale)*(1+fvar(2))),ceil(45*const(size.yscale)*(1+fvar(2)))
removetime = -2
sprpriority = ifelse(!(time%8),5,-1)
ownpal = 1
shadow = 0
removeongethit = 0
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State -3, homodesmokeagachado]
type = Explod
triggerall = !numexplod(18099) && !numexplod(6051) && !var(17)
triggerall = lose != 1
triggerall = stateno != 170 && !numexplod(7014)
triggerall = statetype = C && !numhelper(7019)
triggerall = var(17) != 1 && !numexplod(180)
triggerall = anim != 6028 && stateno != 195 && anim != 195 && anim != 1952
trigger1 = TimeMod = 4,0
trigger2 = stateno = 9830 && stateno != 191
triggerall = anim != 9410 && stateno != 199
triggerall = anim != 5110 && stateno != 6070
triggerall = anim != 5808 && stateno != 170
triggerall = anim != 5150 && stateno != 171
triggerall = anim != 5060 && stateno != 172
triggerall = anim != 5050 && stateno != 173
triggerall = anim != 5808 && anim != 7080
triggerall = stateno != 1005
triggerall = stateno != 11005
triggerall = anim != 5140 && life > 1
triggerall = var(20) = 3 || var(21) = 1
anim = 7040
name = "Humo"
pos = 0, ceil(-25*const(size.yscale)*(1+fvar(2)))
postype = p1
vel = 0, -2
random = ceil(40*const(size.xscale)*(1+fvar(2))),ceil(45*const(size.yscale)*(1+fvar(2)))
removetime = -2
ontop = 1
ownpal = 1
shadow = 0
removeongethit = 0
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))


;=========================================================
;=================== REMOVE EXPLODS ======================
[State 0, brillos]
type = RemoveExplod
trigger1 = anim != 6011 && anim != 6014
id = 6011

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


;=========================================================
;==== ESPECIALES PARA FATALITYS y ATAQUES SOUL NINJA =====
;---------------------------------------------------------
[State screamFalling]
type = null;PlaySnd
trigger1 =  time = 60
trigger1 = stateno = 607710 || stateno = 607712 || stateno = 607715 || stateno = 607720
value = 17,3

[State Screamlaunching]
type = PlaySnd
triggerall = time = 1
trigger1 = stateno = 60770 || stateno = 60779 || stateno = 607714 || stateno = 607717 || stateno = 607718 || stateno = 607722
trigger2 = stateno = 607721 || stateno = 607711 || stateno = 607716
value = 4+var(23),5
volume = 255
channel = 1

[State gritomuere]
type = PlaySnd
trigger1 = stateno = 60891 && !time ;congelado aliento
trigger2 = stateno = 60860 && time = 1 ;hellhand
trigger3 = stateno = 6074 && time = 90 ;ice bomb
trigger4 = stateno = 6072 && time = 1 && prevstateno != 60891 ;explota
trigger5 = (stateno = 607719  || stateno = 607723) && time = 100 ;subways
trigger6 = stateno = 607213 && time = 1;mid cut
Trigger7 = stateno = 60870 && time = 1 ;le arrancan el corazon
trigger8 = stateno = 60510 && (time = 1 || time = 145) ;staff impale
trigger9 = stateno = 60521 && time = 300 ; kiss of death
trigger10 = stateno = 90052 && time = 145 ;team fatality 2
trigger11 = stateno = 6072 && !time && prevstateno = 60873 ;electro
trigger12 = stateno = 6058 && enemynear,time = 90 && enemynear,var(21) = 1 ;toasty
trigger13 = stateno = 60501 && time = 40 ;quemado sektor
trigger14 = stateno = 60531 && time = 10 ;helichopper
trigger15 = stateno = 60901 && (time = 1 || time = 86) ;ice pike
trigger16 = stateno = 60911 && time = 140 ;ice smash
trigger17 = stateno = 91230 && !time ;head rip
trigger18 = stateno = 6072 && !time && prevstateno = 60921 ;animality scorpion
trigger19 = stateno = 60502 && !time ;shang kintaro moprh
value = 4+ifelse(stateno = 6058 && enemynear,var(21) = 1,1,var(23)),5
volume = 255
channel = 0

[State RESBALA]
type = PlaySnd
trigger1 = stateno = 6008 && anim = 9108109 && !animelemtime(9108109)
value = 2,var(3)
volume = 255
channel = 0

[State infla]
type = PlaySnd
trigger1 = stateno = 607214 && time = 11
trigger2 = stateno = 60521 && time = 100
value = 2,12
volume = 255

[State dizzy elec]
type = PlaySnd
triggerall = anim = 5300 ;&& random < 400
trigger1 = animelem = 2
trigger2 = animelem = 4
trigger3 = animelem = 6
trigger4 = animelem = 8
trigger5 = animelem = 9
trigger6 = animelem = 11
trigger7 = animelem = 13
trigger8 = animelem = 15
value = 1,1+var(0)
volume = -255
channel = 0

[State incadoSND]
type = PlaySnd
trigger1 = (anim = 9108112 || anim = 9108091) && (animelem = 3 || animelem = 6)
trigger2 = stateno = 607211 && (time = 54+55 || time = 54+97)
trigger3 = stateno = 607212 && (time = 95 || time = 137)
trigger4 = stateno = 6074 && (time = 90+55 || time = 90+97)
trigger5 = stateno = 91230 && (time = 55 || time = 97)
trigger6 = stateno = 60502 && (time = 55 || time = 97)
value = 2, 1

[State incadoSHAKE]
type = EnvShake
trigger1 = (anim = 9108112 || anim = 9108091) && (animelem = 1 || animelem = 3 || animelem = 6)
trigger2 = stateno = 607211 && (time = 54 || time = 109 || time = 151)
trigger3 = stateno = 607212 && (time = 40 || time = 95 || time = 137)
trigger4 = stateno = 6074 && (time = 90 || time = 90+55 || time = 90+97)
trigger5 = stateno = 91230 && (time = 0 || time = 55 || time = 97)
trigger6 = stateno = 60502 && (time = 0 || time = 55 || time = 97)
time = 15
ampl = -3

[State pit2GOLPE]
type = PlaySnd
trigger1 = stateno = 607713 && time = 121
trigger2 = stateno = 60543 && !time ;dragon bite
value = S1,26
volume = 255
channel = 2

;==============================================================
;------------------- PUTO TEAM FATALITY------------------------

[State nogira]
type = AssertSpecial
trigger1 = numhelper(9999)
flag = noautoturn

[State Enemykill]
type = TargetLifeAdd
triggerall = numtarget
triggerall = !var(4) && !moveguarded && !animelemtime(animelemno(0))
trigger1 =  movetype = A
trigger1 = p2life <= 30
value = -1 ;ifelse(movehit,-10,-5)
kill = 0

[State Partner Komp]
type = VarSet
triggerall = !fvar(4) && numpartner = 1
triggerall = alive && partner,alive
trigger1 = partner,name = "Juano`s Sub guy"
trigger2 = partner,name = "Juano`s Kit girl"
trigger3 = partner,name = "reptile by binho"
trigger4 = partner,name = "juano`s cyborg guy"
fvar(7) = 1

[State TEAM FATALITY OFF]
type = VarSet
triggerall = !fvar(4) && numpartner = 1
trigger1 = !partner,alive || !alive
fvar(7) = 0

[State TeamFatality P2 kill ON]
type = VarSet
triggerall = !var(4) && fvar(7) && !numhelper(9998)
trigger1 = var(58) = -2
trigger2 = numenemy = 2
trigger2 = enemynear(0),alive && enemynear(1),alive
trigger3 = (!alive && partner,alive) || (alive && !partner,alive)
var(4) = 1

[State TeamFatality P2 kill OFF]
type = varset
triggerall = var(4) && fvar(7) && !numhelper(9998) && var(58) != -2 && p2stateno != 9997 && !fvar(4)
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = ((enemynear(0),alive && !enemynear(1),alive) || (!enemynear(0),alive && enemynear(1),alive))
var(4) = 0
ignorehitpause = 1

[State Finish]
type = Helper
triggerall = !var(4) && !numhelper(9998) && fvar(7)
trigger1 = numenemy = 1 && p2life = [1,20]
trigger2 = numenemy = 2
trigger2 = (!enemynear(0),alive && enemynear(1),life = [1,20]) || (!enemynear(1),alive && enemynear(0),life = [1,20])
helpertype = Normal
ID = 9998
name = "Finish Team"
postype = p2
stateno = ifelse((id = 56 && teamside = 1) || (id = 58 && teamside = 2),9998,9996)



;============================================================
;----------------------\Hara - Kiri/-------------------------
[State no move]
type = CtrlSet
trigger1 = enemynear,authorname = "juano16" && enemynear,fvar(15) = 1
value = 0

[State si move]
type = CtrlSet
trigger1 = enemynear,authorname = "juano16" && enemynear,fvar(15) = 2
trigger1 = enemynear,stateno = 5150 && enemynear,time = 60 && !stateno
value = 1

[State stand]
type = ChangeState
trigger1 = enemynear,authorname = "juano16" && enemynear,fvar(15) = 1 && stateno != 0 && statetype != A
value = 0
