;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

;------------------ DESHACER y hacer EFECTOS, blablalbla
[State 0, noboardenfatals]
type = AssertSpecial
triggerall = numpartner = 0 ; no en simul
trigger1 = prevstateno = [6050,6099]
trigger2 = enemynear,prevstateno = 607211
flag = nobardisplay
flag2 = noautoturn
ignorehitpause = 1

[State 0, deshaceefecto]
type = BGPalFX
trigger1 = prevstateno = 195 || prevstateno = 196
time = 1
add = 0,0,0

[State 0, deshaceefecto]
type = PalFX
trigger1 = prevstateno = 195 || prevstateno = 196
trigger1 = palno != 4
time = 1
add = 0,0,0

[State 0, notiemblaluegodeintro]
type = EnvShake
trigger1 = prevstateno = 195
time = 1
ampl = 0

[State 0, callagritoermac]
type = StopSnd
trigger1 = prevstateno = 194
trigger2 = prevstateno = 193
channel = 5

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

[State 20001, fantasma]
type = AfterImage
trigger1 = time = 0
triggerall = palno = 7 && prevstateno = 193
time = 99999
length = 18
framegap = 3
;palcolor = 3
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1
;------------------------------------
[State 0, sinmascarareptilesobapanza]
type = ChangeAnim
trigger1 = prevstateno = 6059
value = 70411

[State 0, nocamina]
type = AssertSpecial
trigger1 = var(16) != 0
flag = nobardisplay
;-------------------- Stand pose
[State 0, standdesubzero]
type = ChangeAnim
triggerall = var(21) != 1
triggerall = var(16) = 0
triggerall = prevstateno != 6056
triggerall = var(16) = 0
triggerall = var(20) = 1 || var(20) = 4 || var(20) = 7
triggerall = anim != 6014
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, standescorpionyermac]
type = ChangeAnim
triggerall = var(21) != 1
triggerall = var(16) = 0
triggerall = prevstateno != 6056
triggerall = var(16) = 0
triggerall = var(20) = 2 || var(20) = 6
triggerall = anim != 6014
trigger1 = Anim != 2 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 2

[State 0, standereptileysmoke]
type = ChangeAnim
triggerall = var(21) != 1
triggerall = var(16) = 0
triggerall = prevstateno != 6056
triggerall = var(16) = 0
triggerall = var(20) = 3 || var(20) = 5
triggerall = anim != 6014
trigger1 = Anim != 3 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 3

[State 0, randomCha]
type = VarRandom
triggerall = var(21) = 1
trigger1 = time = 0
v = 15
range = 0,3

[State 0, porsi1]
type = VarSet
trigger1 = time = 1
trigger1 = var(15) = 1
v = 15
value = 0

[State 0, Stacha]
type = ChangeAnim
triggerall = var(16) = 0
triggerall = prevstateno != 6056
triggerall = var(16) = 0
triggerall = var(21) = 1
triggerall = anim != 6014
trigger1 = Anim != 0 && Anim != 5 && Anim != 2 && Anim != 3
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = var(15)
;--------------------------------------
[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

;---------------------------------------
; turn
[Statedef 5]
type = U
physics = S
sprpriority = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = ifelse(statetype = S,5,6)

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

[State 0, ChangeState]
type = ChangeState
trigger1 = !animtime
value = ifelse(statetype = S,0,11)
ctrl = 1

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
ctrl = 1;0
anim = 10

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

[State 10, 2]
type = ChangeState
trigger1 = !AnimTime
ctrl = 1
value = 11
;---------------------------------------------------------------
[Statedef 6099]
type    = S
movetype= H
physics = S
velset = 0,0

[State end]
type = changeState
trigger1 = 1
value = 6099
;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
ctrl = 1;0
anim = 12

[State 12, 1]
type = ChangeState
trigger1 = !AnimTime
ctrl = 1
value = 0
;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = ifelse(anim != 41,42,47)

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

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

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

[State 52, 3]
type = null;changeanim
trigger1 = Time = 2
value = 47

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

[State 52, 4]
type = ChangeState
trigger1 = time = 4
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; DASH_FWD
[Statedef 100]
type    = S
physics = N
anim = 100
sprpriority = 1

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

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

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

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

[State ]
type = velset
trigger1 = animelem = 9
x = 0

[State 100, 4]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1

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

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

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106
;------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
;---------------------------------------------- AI
trigger3 = vel X != const(velocity.walk.back.x)
trigger2 = var(55) = 1 && random <= 500
trigger3 = var(55) = 1 && p2stateno = 7022 && numhelper(7021) && random <= 500
;----------------------------------------------Fin AI
trigger1 = !var(55)
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)+ifelse(!var(21),0,1)+ifelse(!fvar(2),0,3)

[State 20, 2]
type = VelSet
;---------------------------------------------- AI
trigger3 = vel X != const(velocity.walk.fwd.x)
trigger2 = var(55) = 1 && random <= 500
trigger3 = var(55) = 1 && p2stateno = 7022 && numhelper(7021) && random <= 500
;----------------------------------------------Fin AI
trigger1 = !var(55)
triggerall = command = "holdback"
x = const(velocity.walk.back.x)-ifelse(!var(21),0,1)-ifelse(!fvar(2),0,3)

[State 0, VarRandom]
type = VarRandom
triggerall = var(21) = 1
trigger1 = !time
v = 15
range = 1,3
;------------------------------------- camina  delante
[State 20, sunfwd]
type = ChangeAnim
triggerall = vel x > 0
triggerall = ((Anim != 20 && Anim != 22 && Anim != 24 && Anim != 5) || (Anim = 5 && !AnimTime))
trigger1 = var(21) = 0
trigger1 = var(20) = 1 || var(20) = 4 || var(20) = 7
trigger2 = var(21) != 0 && var(15) = 1
value = 20

[State 20, scorpioncaminadelanteyermac]
type = ChangeAnim
triggerall = vel x > 0
triggerall = ((Anim != 20 && Anim != 22 && Anim != 24 && Anim != 5) || (Anim = 5 && !AnimTime))
trigger1 = var(21) = 0
trigger1 = var(20) = 2 || var(20) = 6
trigger2 = var(21) != 0 && var(15) = 2
value = 22

[State 20, reptileysmokecaminadelante]
type = ChangeAnim
triggerall = vel x > 0
triggerall = ((Anim != 20 && Anim != 22 && Anim != 24 && Anim != 5) || (Anim = 5 && !AnimTime))
trigger1 = var(21) = 0
trigger1 = var(20) = 3 || var(20) = 5
trigger2 = var(21) != 0 && var(15) = 3
value = 24
;---------------------------------- camina atras
[State 20, subcaminaatras]
type = ChangeAnim
triggerall = vel x < 0
triggerall = ((Anim != 21 && Anim != 23 && Anim != 25 && Anim != 5) || (Anim = 5 && !AnimTime))
trigger1 = var(21) = 0
trigger1 = var(20) = 1 || var(20) = 4 || var(20) = 7
trigger2 = var(21) != 0 && var(15) = 1
value = 21

[State 20, scorpioncaminaatrasyermac]
type = ChangeAnim
triggerall = vel x < 0
triggerall = ((Anim != 21 && Anim != 23 && Anim != 25 && Anim != 5) || (Anim = 5 && !AnimTime))
trigger1 = var(21) = 0
trigger1 = var(20) = 2 || var(20) = 6
trigger2 = var(21) != 0 && var(15) = 2
value = 23

[State 20, reptileysmokecaminatras]
type = ChangeAnim
triggerall = vel x < 0
triggerall = ((Anim != 21 && Anim != 23 && Anim != 25 && Anim != 5) || (Anim = 5 && !AnimTime))
trigger1 = var(21) = 0
trigger1 = var(20) = 3 || var(20) = 5
trigger2 = var(21) != 0 && var(15) = 3
value = 25
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;variables
;var(0) = jabsound                                                 fvar(0) = damage scaling
;var(1) = shao                                                     fvar(1) = juggle
;var(2) = freezelimit                                              fvar(2) =
;var(3) = ow
;var(4) = fatal bitch


;var(41) = wincount
;var(58) = max wins
;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 20001, fantasma]
type = AfterImage
trigger1 = !time
triggerall = palno = 7
time = 99999
length = 18
framegap = 3
;palcolor = 3
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1

[State 0, PalFXWiz]
type = PalFX
triggerall = name = "nohayefectohoy"
trigger1 = time = 0
trigger1 = var(15) = 0
trigger1 = palno = 7
time = 99999
add = 0,50,240
mul = 120,224,150
sinadd = 85,55,110,10
invertall = 0
color = 0
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 15
range = 0,1

[State 0, intro 1 - normal]
type = ChangeState
trigger1 = var(15) = 0
value = 192
ctrl = 0

[State 0, intro - especiales]
type = ChangeState
trigger1 = var(15) = 1
value = 199
ctrl = 0

;----------------------- Intros Speciales
[Statedef 199]
type = S
ctrl = 0
velset = 0,0

[State 0, cham]
type = VarRandom
trigger1 = !time
triggerall = var(21) = 1
v = 15
range = 1,6

[State 0, intro - especial - subzero]
type = ChangeState
trigger1 = var(20) = 1 && !var(21)
trigger2 = var(21) = 1 && time = 1 && var(15) = 1
value = 193
ctrl = 0

[State 0, intro - especial - ermac]
type = ChangeState
trigger1 = var(20) = 6 && !var(21)
trigger2 = var(21) = 1 && time = 1 && var(15) = 6
value = 194
ctrl = 0

[State 0, intro - especial - smoke]
type = ChangeState
trigger1 = var(20) = 5 && !var(21)
trigger2 = var(21) = 1 && time = 1 && var(15) = 5
value = 195
ctrl = 0

[State 0, intro - especial - noob]
type = ChangeState
trigger1 = var(20) = 4 && !var(21)
trigger2 = var(21) = 1 && time = 1 && var(15) = 4
value = 196
ctrl = 0

[State 0, intro - especial - scorpion]
type = ChangeState
trigger1 = var(20) = 2 && !var(21)
trigger2 = var(21) = 1 && time = 1 && var(15) = 2
value = 197
ctrl = 0

[State 0, intro - especial - reptile]
type = ChangeState
trigger1 = var(20) = 3 && !var(21)
trigger2 = var(21) = 1 && time = 1 && var(15) = 3
value = 198
ctrl = 0
;-------------------------------------
;intro 1
[Statedef 192]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 191, subynoob]
type = ChangeAnim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = !RoundState
value = 190

[State 191, scorpionyermac]
type = ChangeAnim
triggerall = var(20) = 2 || var(20) = 6
trigger1 = !RoundState
value = 191

[State 191, reptilsmoke]
type = ChangeAnim
triggerall = var(20) = 3 || var(20) = 5
trigger1 = !RoundState
value = 192

[State 191, rain]
type = ChangeAnim
triggerall = var(20) = 7
trigger1 = !RoundState
value = 197

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


[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = !AnimTime
value = 0

;====================================================
;intro 2 - subzero
[Statedef 193]
type = S
ctrl = 0
;anim = 70322
velset = 0,0

[State 0, cualsera]
type = VarRandom
trigger1 = !time
v = 15
range = 0,1
;--------------------------------------------- INTRO 1
[State 0, kitapal7]
type = AfterImage
trigger1 = palno = 7 && time = 0
time = 1

[State 0,estatuabrillante]
type = Explod
triggerall = var(15) = 0
trigger1 = time = 1
anim = 7032
Postype = p1
sprpriority = 2
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
ownpal = 1
bindtime = -2
removetime = 226

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(15) = 0
trigger1 = time = 1
value = 70322

[State 0, snow]
type = Explod
triggerall = var(15) = 0
trigger1 = (time%10) = 1
trigger1 = time = [1,120]
triggerall = !numhelper(7019)
anim = 7030
pos = -200*2*const(size.xscale)*(1+fvar(2)),-30*2*const(size.yscale)*(1+fvar(2))
postype = p1
vel = 6, -.1
random = 0, 100*2*const(size.yscale)*(1+fvar(2))
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
sprpriority = 9
ownpal = 1

[State 191, viento]
type = PlaySnd
triggerall = var(15) = 0
trigger1 = time = 10
value = 1,12
channel = 5

[State 191, hielocruje]
type = PlaySnd
triggerall = var(15) = 0
trigger1 = animelem = 100
value = 1,3
persistent = 0

[State 191, hielosuena]
type = PlaySnd
triggerall = var(15) = 0
trigger1 = animelem = 85
value = 1,13
persistent = 0

[State 191, hielosuena]
type = PlaySnd
triggerall = var(15) = 0
trigger1 = animelem = 50
value = 1,14
persistent = 0

[State 191, hieloexplota]
type = PlaySnd
triggerall = var(15) = 0
trigger1 = animelem = 129
value = 1,10
persistent = 0

[State 191, 2.3]
type = AllPalFX
triggerall = var(15) = 0
trigger1 = animelem = 129
time = 10
add = 250, 250, 250
ignorehitpause = 1
persistent = 0

[State -3, vapor]
type = Explod
trigger1 = var(15) = 0
trigger1 = !numhelper(7019)
anim = 70342
name = "Steam"
pos = 0, -70*const(size.yscale)*(1+fvar(2))
postype = p1
vel = 0, -2
random = 40*2*const(size.xscale)*(1+fvar(2)),100*2*const(size.yscale)*(1+fvar(2))
removetime = -2
sprpriority = 9
ownpal = 1
shadow = 0
removeongethit = 0
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
;---------------------------------------------- INTRO 2
[State 0, stand]
type = ChangeAnim
triggerall = var(15) = 1
trigger1 = time = 1
value = 6989

[State 0, congelandose]
type = ChangeAnim
triggerall = var(15) = 1
trigger1 = time = 140
value = 6988

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(15) = 1
trigger1 = time = 132 || time = 158
trigger2 = time = 137 || time = 163
trigger3 = time = 142 || time = 168
trigger4 = time = 147 || time = 173
trigger5 = time = 152 || time = 178
value = S1,3
volume = -100
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(15) = 1
trigger1 = time = 120 || time = 146
trigger2 = time = 125 || time = 151
trigger3 = time = 130 || time = 156
trigger4 = time = 135 || time = 161
trigger5 = time = 140 || time = 166
value = S1, 14
volume = -250
channel = 0

[State 0, congelado]
type = ChangeAnim
triggerall = var(15) = 1
trigger1 = (time = [210,500]) && anim != 6985 && anim != 0
value = 6988
elem = 1

[State -3, vapor]
type = Explod
trigger1 = var(15) = 1
trigger1 = anim = 6988
anim = 70342
name = "Steam"
pos = 50*2*const(size.xscale)*(1+fvar(2)),-70*2*const(size.yscale)*(1+fvar(2))
postype = p1
;bindtime = -1
vel = 0, -2
random = 40*2*const(size.xscale)*(1+fvar(2)),100*2*const(size.yscale)*(1+fvar(2))
removetime = -2
sprpriority = 9
ownpal = 1
shadow = 0
removeongethit = 0
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State 0, hielo congela]
type = Explod
triggerall = var(15) = 1
trigger1 = time = 120
trigger2 = time = 125
trigger3 = time = 130
trigger4 = time = 135
trigger5 = time = 140
anim = 6987
ID = 6987
sprpriority = 2
;removetime = 180
shadow = 0
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = 0,-80*2*const(size.yscale)*(1+fvar(2))

[State 190,subzero]
type = Helper
triggerall = var(15) = 1
trigger1 = time = 300
helpertype = normal
name = "Subzero"
ID = 70455
stateno = 70455
pos = -70,0
postype = p1
facing = 1
ownpal = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 0, congelado]
type = ChangeAnim
triggerall = var(15) = 1
trigger1 = numhelper(704550) = 1
value = 6985
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(15) = 1
trigger1 = time = 529
value = 0

;---------------------------------------------------- FIN INTROS
[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = time >= 430 && anim = 70322
trigger2 = anim = 0 && time >= 530 && numhelper
value = 0

;====================================================
;intro 3 - ermac
[Statedef 194]
type = S
ctrl = 0
anim = 9999
sprpriority = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
trigger2 = time = 169
value = 1,41

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !(time%23)
trigger1 = time < 170
value = 1,28

[State 0, VarRandom]
type = VarRandom
trigger1 = time = 169
v = 15
range = 0,2

[State 0, voz]
type = PlaySnd
trigger1 = time = 200
value = 1,42+var(15)

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time = 169
ID = 70811
accel = 0,-40
scale = const(size.xscale)*(2+fvar(2)),(const(size.yscale)*(2+fvar(2)))

[State -3, luz1]
type = Explod
trigger1 = !(time%1)
trigger1 = time < 170
anim = 70811
id = 70811
name = "LIGHT1"
vel = ifelse(!(time%2),2,-2),ifelse(!(time%2),2,-2)
accel = ifelse(!(time%2),-.3,.3),ifelse(!(time%2)&& time < 130,-.3,ifelse(time >= 130,-.3,.3))
pos = 0, -ifelse(time >= 75,60*(const(size.yscale)*(1+fvar(2))),30*(const(size.yscale)*(1+fvar(2))))
postype = p1
scale = const(size.xscale)*(1+fvar(2)),(const(size.yscale)*(1+fvar(2)))
random = ceil(const(size.yscale))*70*2*(const(size.yscale)*(1+fvar(2))),ceil(const(size.yscale))*ifelse(time >= 75,90,30)*2*(const(size.yscale)*(1+fvar(2)))
sprpriority = ifelse(!(time%2),-1,5)
ownpal = 1
shadow = 0
scale = const(size.xscale),const(size.yscale)

[State 0, Trans]
type = Trans
trigger1 = time < 170
trans = addalpha
alpha= (time),256;(256-(time-60))*12

[State -3, chameleonrept]
type = PalFX
trigger1 = time < 170
time = 1
add = 0,256-ifelse(time >= 100,(time-100)*2,0),0
mul = ifelse(time >= 100,256,0),256-ifelse(time >= 100,(time-100)*2,0),ifelse(time >= 100,256,0)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 60
value = 196

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

[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = time >= 260
value = 0

;====================================================
;intro 4 - smoke
[Statedef 195]
type = S
ctrl = 0
anim = 3
;velset = 0,9

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 9999

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

[State 0, invicible]
type = AssertSpecial
trigger1 = time < 150
flag = invisible

[State 195, oscuro]
type = BGPalfx
trigger1 = time = 0
;invertall = 1
;supermove = 1
time = 170
add = -250,-250,-250
sinadd = 180,100,100,50

[State 195, oscuro]
type = BGPalfx
trigger1 = time = 100
;invertall = 1
;supermove = 1
time = 70
add = -250,-250,-250
sinadd = 180,100,100,25

[State 0, salehumo]
type = Explod
trigger1 = time = [30,150]
anim = 7040
ID = 7040
name = "Humo"
pos = 0, -50*const(size.yscale)*(1+fvar(2))
postype = p1
bindtime = -1
vel = 0, -2
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
random = 40*2*const(size.xscale)*(1+fvar(2)),100*2*const(size.yscale)*(1+fvar(2))
sprpriority = 9
ownpal = 1
shadow = 0

[State 195,explosion]
type = explod
trigger1 = time = 150
anim = 7038
postype = p1
sprpriority = 9
ownpal = 1
pos = -10*2*const(size.xscale)*(1+fvar(2)),10*2*const(size.yscale)*(1+fvar(2))
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State 0, explosion]
type = PlaySnd
trigger1 = time = 150
value = 1,22
volume = 200
channel = 2

[State 0, ruidohumo]
type = PlaySnd
trigger1 = time = 30
trigger2 = time = 40
trigger3 = time = 50
trigger4 = time = 60
trigger5 = time = 70
trigger6 = time = 80
trigger7 = time = 90
trigger8 = time = 100
trigger9 = time = 110
trigger10 = time = 120
trigger11 = time = 130
trigger12 = time = 140
trigger13 = time = 150
value = 6,1
volume = 200

[State 0, tiembla]
type = EnvShake
trigger1 = time = 30
time = 120
freq = 60
ampl = -4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 150
value = 1922

[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = time >= 193 && anim = 1922
value = 0

;====================================================
;intro 5 - noob
[Statedef 196]
type = S
ctrl = 0
anim = 0
;velset = 0,9

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

[State 0, invicible]
type = null;AssertSpecial
trigger1 = time < 100
flag = invisible

[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = time > 150
value = 0

[State 195, oscuro]
type = Palfx
trigger1 = time = 0
time = 9999
add = -250,-250,-250

[State 195, oscuro]
type = BGPalfx
trigger1 = time = 0
time = 9999
add = -250,-250,-250

;----------------- BAJa luz fondo
[State 195, luz1]
type = BGPalfx
trigger1 = time = 100
time = 300
add = -200,-200,-200

[State 195, luz2]
type = BGPalfx
trigger1 = time = 105
time = 300
add = -175,-175,-175

[State 195, luz3]
type = BGPalfx
trigger1 = time = 110
time = 300
add = -150,-150,-150

[State 195, luz4]
type = BGPalfx
trigger1 = time = 115
time = 300
add = -125,-125,-125

[State 195, luz5]
type = BGPalfx
trigger1 = time = 120
time = 300
add = -100,-100,-100

[State 195, luz6]
type = BGPalfx
trigger1 = time = 125
time = 300
add = -75,-75,-75

[State 195, luz7]
type = BGPalfx
trigger1 = time = 130
time = 300
add = -50,-50,-50

[State 195, luz8]
type = BGPalfx
trigger1 = time = 135
time = 5
add = -25,-25,-25

;----------------- BAJa luz personaje
[State 195, luz1]
type = Palfx
trigger1 = time = 100 && palno != 4
time = 300
add = -200,-200,-200

[State 195, luz2]
type = Palfx
trigger1 = time = 105 && palno != 4
time = 300
add = -175,-175,-175

[State 195, luz3]
type = Palfx
trigger1 = time = 110 && palno != 4
time = 300
add = -150,-150,-150

[State 195, luz4]
type = Palfx
trigger1 = time = 115 && palno != 4
time = 300
add = -125,-125,-125

[State 195, luz5]
type = Palfx
trigger1 = time = 120 && palno != 4
time = 300
add = -100,-100,-100

[State 195, luz6]
type = Palfx
trigger1 = time = 125 && palno != 4
time = 300
add = -75,-75,-75

[State 195, luz7]
type = Palfx
trigger1 = time = 130 && palno != 4
time = 300
add = -50,-50,-50

[State 195, luz8]
type = Palfx
trigger1 = time = 135 && palno != 4
time = 5
add = -25,-25,-25

;====================================================
;intro 6 - scorpion
[Statedef 197]
type = S
ctrl = 0
;anim = 193

[State 0, invicible]
type = AssertSpecial
trigger1 = 1
flag = intro

[State 0, cualsera]
type = VarRandom
trigger1 = !time
trigger2 = anim = 1952 && time = 100
v = 15
range = 0,1
;-----------------------------  ESPECIAL 1 -------
[State 0, animacion]
type = ChangeAnim
triggerall = var(15) = 0
trigger1 = time = 1
value = 193

[State 0, musica]
type = PlaySnd
trigger1 = animelem = 13 && anim = 193
value = S1,17
persistent = 0

[State 0, voz]
type = PlaySnd
trigger1 = animelem = 14 && anim = 193
value = 3,var(5)
abspan = 1
channel = 2
persistent = 0

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

;----------------------------- ESPECIAL 2 -----------
[State 0, animMK1stand]
type = ChangeAnim
triggerall = var(15) = 1
trigger1 = time = 1
value = 195
[State 0, animMK1jalado]
type = ChangeAnim
triggerall = anim = 195
trigger1 = time = 90 && anim != 1952
value = 1952
[State 0, tiembla1]
type = PosAdd
trigger1 = !(time%2)
trigger1 = anim = 1952 && time = [90,140]
x = -1
[State 0, tiembla2]
type = PosAdd
trigger1 = (time%2) = 1
trigger1 = anim = 1952 && time = [90,140]
x = 1
[State 0, ouch1]
type = PlaySnd
trigger1 = animelem = 1 && anim = 1952
value = 2,var(3)
channel = 1
[State 0, arreglapos]
type = Posadd
trigger1 = anim = 1952
trigger1 = time = 141
x = 1

[State 1001, comehere]
type = Playsnd
triggerall = var(15) = 0
trigger1 = anim = 1952
trigger1 = time = 130
value = 1,19

[State 1001, getoverhere]
type = Playsnd
triggerall = var(15) = 1
trigger1 = anim = 1952
trigger1 = time = 130
value = 1,20

[State 1010, sonidocuerda]
type = Playsnd
trigger1 = anim = 195 && time = 50
value = 1,18
[State 0, cuerdavolando]
type = Explod
trigger1 = anim = 195 && time = 50
anim = 7045
ID = 7045
removetime = 41
sprpriority = -1
vel = 8,0
shadow = 0
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = (-340)*2*(ceil(const(size.xscale))),-95*2*const(size.yscale)*(1+fvar(2))
[State 0, puntajalando]
type = Explod
trigger1 = animelem = 1 && anim = 1952
anim = 1953
ID = 1953
sprpriority = 4
vel = 0,0
shadow = 0
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = const(size.xscale)*2*(1+fvar(2)),-95*2*const(size.yscale)*(1+fvar(2))
[State 0, cuerdajalando]
type = Explod
trigger1 = animelem = 1 && anim = 1952
anim = 1954
ID = 1954
sprpriority = 3
vel = 0,0
shadow = 0
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = const(size.xscale)*2*(1+fvar(2)),-95*2*const(size.yscale)*(1+fvar(2))
[State 0, cuerdajalando2]
type = Explod
trigger1 = animelem = 1 && anim = 1952
anim = 1954
ID = 19542
sprpriority = 3
vel = 0,0
shadow = 0
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = -30*2*const(size.xscale)*(1+fvar(2)),-95*2*const(size.yscale)*(1+fvar(2))
[State 0, cuerdajalando3]
type = Explod
trigger1 = animelem = 1 && anim = 1952
anim = 1954
ID = 19543
sprpriority = 3
vel = 0,0
shadow = 0
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = -60*2*const(size.xscale)*(1+fvar(2)),-95*2*const(size.yscale)*(1+fvar(2))
[State 0, encima]
type = SprPriority
trigger1 = time > 90
value = 2

[State 0, tiemblagolpes]
type = EnvShake
triggerall = anim = 1952
trigger1 = time = 200
trigger2 = time = 210
trigger3 = time = 220
trigger4 = time = 230
trigger5 = time = 260
trigger6 = time = 290
time = 10
ampl = -4

[State 0, ouch2]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 200
trigger2 = time = 210
value = 2,var(3)
;freqmul = 1.2
channel = 1
volume = -180
[State 0, ouch3]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 220
trigger3 = time = 230
value = 2,var(3)
channel = 1
volume = -180
[State 0, ouch4]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 260
value = 11,0
channel = 1
volume = -180
[State 0, ouch5]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 310
value = 4+var(23),5
;freqmul = 1.2
channel = 1
volume = -140

[State 0, golpe]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 200
trigger2 = time = 210
value = 0,ifelse(!var(0),0,3)
channel = 2
volume = -180
[State 0, golpe2]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 220
trigger3 = time = 230
value = 0,ifelse(!var(0),0,3)
channel = 2
volume = -180
[State 0, golpe3]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 260
value = 0,2
channel = 2
volume = -180
[State 0, golpe4]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 270
value = 1,17;0,2
channel = 2
volume = -180
[State 0, golpe5]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 300
value = 1,22
channel = 3
volume = -180
[State 0, golpe5]
type = PlaySnd
triggerall = anim = 1952
trigger1 = time = 350
value = 4, 10
;channel = 2
volume = -100

[State 0, AllPalFX]
type = BGPalFX
triggerall = anim = 1952
trigger1 = time = 300
time = 20
add = 240,50,0
mul = 250,224,120
sinadd = 110,55,85,10
invertall = 0
color = 0

[State 0, scorpioncaminando]
type = Explod
trigger1 = anim = 1952 && time = 350
anim = 1955
ID = 1955
sprpriority = 3
removetime = 80
vel = const(velocity.walk.fwd.x),0
;shadow = 1
ownpal = 0
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
pos = (-200)*2*(ceil(const(size.xscale))),2*ceil(const(size.yscale))


;-------------------------- TERMINA EL INTRO
[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = !AnimTime
trigger1 = anim = 193  ;especial 1
trigger2 = anim = 1952 ;especial 2
trigger2 = time >= 430
value = 0

;====================================================
;intro 7 - reptile
[Statedef 198]
type = S
ctrl = 0
anim = 194

[State 0, carareptile]
type = Explod
trigger1 = anim = 194 && time = 1
anim = 1942
ID = 1942
sprpriority = 1
shadow = 0
ownpal = 1
bindtime = -2
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State 0, invicible]
type = AssertSpecial
trigger1 = 1
flag = intro

[State 0, fondo]
type = PlaySnd
trigger1 = animelem = 25
value = 3,var(5)
persistent = 0

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

[State 0, musica]
type = PlaySnd
trigger1 = animelem = 15
value = 17,4
channel = 2
persistent = 0

[State 191, 3]
type = ChangeState
triggerall = !numhelper(7019)
trigger1 = time >= 205
value = 0

;---------------------------------------------------------------------------
; Lose by Time Over inicio
[Statedef 170]
type = S
ctrl = 0
;anim = 0
velset = 0,0

[State endWins]
type = varset
trigger1 = !time
triggerall = name = "Juano`s Sub guy"
ignorehitpause = 1
var(57) = 0

[State findeflawles]
type = varset
trigger1 = !time
triggerall = name = "Juano`s Sub guy"
ignorehitpause = 1
var(42) = 0

[State 0, VarRandom]
type = VarRandom
trigger1 = !time
v = 15
range = 2,3

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 1
value = 170+var(15)
ctrl = 0

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

; Lose by Time Over shao
[Statedef 170]
type = S
ctrl = 0
anim = 172
velset = 0,0

[State -3, Helper]
type = Helper
triggerall = BackEdgebodyDist > 80
;triggerall = command = "start" ;test
trigger1 = time = 0
trigger1 =  Vel X = 0 && pos Y = 0
triggerall = !numhelper(7040)
helpertype = normal
name = "Kunglao"
ID = 7040
stateno = 7040
pos = (ceil(const(size.xscale)))*(-80),(ceil(const(size.yscale)))*(-400)
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State -3, Helper]
type = Helper
triggerall = BackEdgebodyDist < 80
;triggerall = command = "start" ;prueba
trigger1 = time = 0
trigger1 =  Vel X = 0 && pos Y = 0
triggerall = !numhelper(7040)
helpertype = normal
name = "kunglao"
ID = 7040
stateno = 7040
pos = (ceil(const(size.xscale)))*80,(ceil(const(size.yscale)))*(-400)
postype = p1
facing = -1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State ]
type = Helper
trigger1 = time = 60
helpertype = Normal
ID = 70451
name = "Sangre"
postype = p1
ignorehitpause = 1
pos = const(size.head.pos.x)-10,ceil(const(size.head.pos.y)*const(size.yscale))
stateno = 70451
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 60
triggerall = numhelper(7042) = 1
value = 1793

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 9
trigger2 = animelem = 3
triggerall = anim = 1793
time = 10
ampl = -4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 9
trigger2 = animelem = 3
triggerall = anim = 1793
value = S2,1
volume = 200
channel = 1

;---------------------------------------------------------------------------
; Lose by Time Over kung
[Statedef 173]
type = S
ctrl = 0
anim = 171
velset = 0,0

[State -3, Helper]
type = Helper
triggerall = BackEdgebodyDist > 80
;triggerall = command = "start" ;test
trigger1 = time = 0
trigger1 =  Vel X = 0 && pos Y = 0
triggerall = !numhelper(7042)
helpertype = normal
name = "Kunglao"
ID = 7042
stateno = 7042
pos = (ceil(const(size.xscale)))*(-80),(ceil(const(size.yscale)))*(-400)
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State -3, Helper]
type = Helper
triggerall = BackEdgebodyDist < 80
;triggerall = command = "start" ;prueba
trigger1 = time = 0
trigger1 =  Vel X = 0 && pos Y = 0
triggerall = !numhelper(7042)
helpertype = normal
name = "kunglao"
ID = 7042
stateno = 7042
pos = (ceil(const(size.xscale)))*80,(ceil(const(size.yscale)))*(-400)
postype = p1
facing = -1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State ]
type = Helper
trigger1 = time = 60
helpertype = Normal
ID = 70451
name = "Sangre"
postype = p1
ignorehitpause = 1
pos = const(size.head.pos.x)-10,ceil(const(size.head.pos.y)*const(size.yscale))
stateno = 70451
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 60
triggerall = numhelper(7042) = 1
value = 1793

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 9
trigger2 = animelem = 3
triggerall = anim = 1793
time = 10
ampl = -4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 9
trigger2 = animelem = 3
triggerall = anim = 1793
value = S2,1
volume = 200
channel = 1
;---------------------------------------------------------------------------
; Lose by Time Over kitana
[Statedef 172]
type = S
ctrl = 0
;anim = 171
velset = 0,0
sprpriority = 5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
;triggerall = BackEdgebodyDist < 80
value = 171

[State 0, Turn]
type = Turn
trigger1 = time = 96
triggerall = BackEdgebodyDist >= 80

[State -3, Helper]
type = Helper
triggerall = BackEdgebodyDist >= 80
;trigger1 = command = "start" ;test
trigger1 = time = 0
trigger1 =  Vel X = 0 && pos Y = 0
triggerall = !numhelper(7041)
helpertype = normal
name = "Kitana"
ID = 7041
stateno = 7041
pos = (ceil(const(size.xscale)))*(-50),(ceil(const(size.yscale)))*(-400)
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State -3, Helper]
type = Helper
triggerall = BackEdgebodyDist < 80
;trigger1 = command = "start" ;prueba
trigger1 = time = 0
trigger1 =  Vel X = 0 && pos Y = 0
triggerall = !numhelper(7041)
helpertype = normal
name = "kitana"
ID = 7041
stateno = 7041
pos = (ceil(const(size.xscale)))*50,(ceil(const(size.yscale)))*(-400)
postype = p1
facing = -1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 140
triggerall = numhelper(7041) = 1
value = 171
ctrl = 0

;---------------------------------------------------------------------------
; Lose by Time Over explota
[Statedef 171]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 30
time = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 123
value = S4,5

[State 0, gemido]
type = PlaySnd
Trigger1 = time = 30
value = 2,12
volume = 200
channel = 4

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time > 124
flag = invisible

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

[State 0, Helper]
type = Helper
trigger1 = time = 33
helpertype = normal
name = "explosion"
ID = 7039
stateno = 7039
postype = p1
scale = const(size.xscale),const(size.yscale)
;---------------------------------------------------------------------------
; Win pose - FUCK YOU!
[Statedef 180]
type = S
ctrl = 0
;anim = 180
velset = 0,0

[State 0, VardefatalesA0]
type = VarSet
trigger1 = time = 5
v = 16
value = 0
;-------------------------------------
;desaparece noobsaibot
[State 23, trans]
type = Trans
triggerall = var(20) = 4 && anim = 180
trigger1 = animelemtime(4) >= 0
trans = addalpha
;alpha=ceil(256-4*(animelemtime(4))),ceil(0+4*(animelemtime(4)))
alpha=ceil(256-4*(time-57)),ceil(0+4*(time-57))
;--------------------
[State 0, ganachameleon]
type = changeanim
triggerall = enemynear,prevstateno != 60840
triggerall = var(21) = 1
trigger1 = var(16) = 0 || var(16) = 7 || var(16) = 5
trigger1 =  !time && anim != 6014
triggerall = anim != 183  && anim != 7080 && anim != 7090
value = 183

[State subYnoob]
type = changeanim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = var(16) = 0 || var(16) = 7 || var(16) = 5
triggerall =  !time && anim != 6014
trigger2 = var(16) = 5
triggerall = anim != 180 && anim != 7080 && anim != 7090 && anim != 183
value = 180
elem = ifelse(anim = 7091,4,1)

[State 0, ganascorpionErmac]
type = changeanim
trigger1 = var(20) = 2 || var(20) = 6
trigger1 = var(16) = 0 || var(16) = 7 || var(16) = 5
triggerall =  !time && anim != 6014
trigger2 = var(16) = 4
triggerall = anim != 181 && anim != 7080 && anim != 7090 && anim != 183
value = 181
elem = ifelse(anim = 7091,3,1)

[State 0, ganareptileysmoke]
type = changeanim
trigger1 = var(20) = 3 || var(20) = 5
trigger1 = var(16) = 0 || var(16) = 7 || var(16) = 5
triggerall =  !time && anim != 6014
trigger2 = var(16) = 3
triggerall = anim != 182  && anim != 7080 && anim != 7090 && anim != 183
value = 182
elem = ifelse(anim = 7091,4,1)

[State 0, ganaRain]
type = changeanim
trigger1 = var(20) = 7
trigger1 = var(16) = 0 || var(16) = 7 || var(16) = 5
triggerall =  !time && anim != 6014 && anim != 184
triggerall = anim != 184  && anim != 7080 && anim != 7090 && anim != 183
value = 184
elem = ifelse(anim = 7091,4,1)

[State 0, sinmascarascorpion]
type = ChangeAnim
trigger1 = var(16) = 1
value = 7035
elem = 10

[State 0, sinmascarareptile]
type = ChangeAnim
trigger1 = var(16) = 2
value = 70411
elem = 16

[State ]
type = varadd
trigger1 =  !time
ignorehitpause = 1
var(41) = 1

;================ CHAR WINS ==============
[State 180 , subzero wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall = var(20) = 1
trigger1 = !time
abspan = 1
value = 4, 8

[State 180 ,scorpion wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall = var(20) = 2
trigger1 = !time
abspan = 1
value = 16,1
volume = 250

[State 180 ,reptile wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall = var(20) = 3
trigger1 = !time
abspan = 1
value = 16,2
volume = 200

[State 180 ,noobsaibot wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall = var(20) = 4
trigger1 = !time
abspan = 1
value = 16,3
volume = 250

[State 180 ,smoke wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall = var(20) = 5
trigger1 = !time
abspan = 1
value = 16,0
volume = 200

[State 180 ,ermac wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall =var(20) = 6
trigger1 = !time
abspan = 1
value = 16,4
volume = 200

[State 180 ,Rain wins]
type = PlaySnd
triggerall = var(21) != 1
triggerall = var(20) = 7
trigger1 = !time
abspan = 1
value = 16,7
volume = 200

[State 180 ,chameleon wins]
type = PlaySnd
triggerall = var(21) = 1
trigger1 = !time
abspan = 1
value = 16,5
volume = 200
;----------------------- MARCADOR DE VICTORIAS
[State ]
type = varadd
trigger1 =  !time
ignorehitpause = 1
var(57) = 1

[State Marcador]
type = Helper
triggerall = stateno = 180
trigger1 = !time
helpertype = Normal
name = "Num wins"
postype = left
pos = 160
stateno = 704515
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State -1,ospc]
type = playsnd
Triggerall = var(57) >= 20 && var(21) = 0
trigger1 = time = 450 && winperfect
trigger2 = time = 350 && !winperfect
channel = -1
value = 5,1
volume = -255
;==========================================
;------------- FLAWLESS VICTORY -----------
[State snd]
type = PlaySnd
trigger1 = time = 110 && winperfect
abspan = 1
value = 4, ifelse(root,anim = 6014,12,9)

[State 0, mensajeFlawwles]
type = Explod
triggerall = var(42) < 2
trigger1 = time = 110 && winperfect
anim = 6995
pos = 160,100
postype = left
removetime = -1
shadow = 0
persistent = 0
ontop = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State 0, mensajedobleFlawwles]
type = Explod
triggerall = var(42) >= 2
trigger1 = time = 110 && winperfect
anim = 6994
pos = 160,100
postype = left
removetime = -1
shadow = 0
persistent = 0
ontop = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State 0, increiblewinning]
type = explod
triggerall = var(42) > 2
trigger1 = time = 20 && winperfect
ignorehitpause = 1
anim = 6992
pos = 160,220
facing = 1
postype = left
bindtime = -1
ownpal = 1
ontop = 1
persistent = 0
removetime = 120
scale = const(size.xscale),const(size.yscale)

[State cantidaddeflawles]
type = varadd
trigger1 = !time && winperfect
ignorehitpause = 1
var(42) = 1

[State findeflawles]
type = varset
trigger1 = !time && !winperfect
ignorehitpause = 1
var(42) = 0

;---------------------------------------
[State sound]
type = null;PlaySnd
trigger1 = animelemtime(7) = 2
value = 4, 6

[State ]
type = assertspecial
triggerall = winperfect
trigger1 = time <= 300
ignorehitpause = 1
flag = roundnotover

[State ]
type = assertspecial
trigger1 = helper(7021),var(0) = 1 && (time <= 480 && winperfect || time <= 380 && !winperfect)
triggerall = numhelper(7021)
ignorehitpause = 1
flag = roundnotover

;[State ]
;type = varset
;triggerall = var(58) != -1 && var(58) != -2 && var(41) >=2
;trigger1 = matchover && var(41) > var(58)
;persistent = 0
;var(58) = var(41) -1

;[State ]
;type = varset
;triggerall = var(58) != -2  && !(var(41) >= 2)
;trigger1 = matchover && var(41) = 1
;persistent = 0
;var(58) = -1
;----------------------------------------------------------------
;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0 && prevstateno != 20 && prevstateno != 40
value = 120 + (statetype = C) + (statetype = A)*2

[State 120, 1]
type = ChangeAnim
triggerall = !Time && anim != 1302
trigger1 = prevstateno = 20
trigger2 = prevstateno = 40
value = 130

[State 120, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, Stop Guarding]
type = ChangeState
triggerall = command != "hold_z"
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

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

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
value = 131

[State 130, Stop Guarding]
type = ChangeState
triggerall = command != "hold_z" && time >= 8
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

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

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
value = 130

[State 131, Stop Guarding]
type = ChangeState
triggerall = (command != "hold_z" && command != "holddown") || command != "hold_z"
triggerall = time >= 8
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

;[State 140, 5] ;Implemented within engine
;type = ChangeState
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

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

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 150, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

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

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

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 151, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 151, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

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

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

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

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 152, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 152, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151

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

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

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

[State 153, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 153, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

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

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

[State 190, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(190)
value = 190

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 191

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

[State 0, ChangeState]
type = ChangeState
trigger1 = name != "Juano`s Sub guy"
value = 6099

[State -3, Helper]
type = Helper
triggerall = var(21) = 0
trigger1 = teamside = 1 && (p2name = "Juano`s Sub guy"  || p4name = "Juano`s Sub guy")
trigger2 = p2name != "Juano`s Sub guy"  && p4name != "Juano`s Sub guy"
triggerall = !time
triggerall = random < 75
helpertype = normal
name = "chapulin"
ID = 70420
stateno = 70420
pos = 170,-400
postype = left
facing = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State 0, PalFXWiz]
type = PalFX
triggerall = name = "nohayefectohoy"
trigger1 = time = 0
trigger1 = palno = 7
time = 99999
add = 0,50,240
mul = 120,224,150
sinadd = 85,55,110,10
invertall = 0
color = 0
ignorehitpause = 1

[State 20001, fantasma]
type = AfterImage
trigger1 = time = 0
triggerall = palno = 7
time = 99999
length = 18
framegap = 3
;palcolor = 3
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1

[State 190, porsiscorpionyermac]
type = ChangeAnim
trigger1 = anim !=2
trigger1 = anim = 0
trigger1 = var(20) = 2 || var(20) = 6
value = 2

[State 190, porsireptysmoke]
type = ChangeAnim
trigger1 = anim !=3
trigger1 = anim = 0
triggerall = var(20) = 3 || var(20) = 5
value = 3

[State 0, VarSet]
type = VarSet
triggerall = var(57) < 20
trigger1 = roundno = 1
trigger2 = RoundsExisted = 0 && TeamMode = Turns && RoundNo > 0
v = 59
value = 0

[State -2, sifatalanobonus]
type = varset
triggerall = var(58) = -2
trigger1 = roundno = 1
trigger2 = RoundsExisted = 0 && TeamMode = Turns && RoundNo > 0
var(58) = 0

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundno = 1
trigger2 = RoundsExisted = 0 && TeamMode = Turns && RoundNo > 0
value = 0
first = 0
last = 50

[State 5900, 2] ;Clear all float variables
type = varRangeSet
trigger1 = roundno = 1
trigger2 = RoundsExisted = 0 && TeamMode = Turns && RoundNo > 0
fvalue = 0

[State 5900, 3] ;Intro
type = ChangeState
trigger1 = roundno = 1
trigger2 = RoundsExisted = 0 && TeamMode = Turns && RoundNo > 0
value = 191
;---------------------------------------------------------------------------
; 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, 5]; Recover in mid air
type = ChangeState
triggerall = Vel Y > -1 && alive && CanRecover
trigger1 = time >= 8
value = 5040

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE
;---------------------------------------------------------------------------
; 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
;trigger1 = GetHitVar(fall.yvel) = 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, 8]
type = GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

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

[State 5100, 10]
type = PlaySnd
trigger1 = !Time
value = 2, 1

[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_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[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 = anim = 5070
value = 5071

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

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = !time && (anim != [5070,5071])
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 && (anim != [5070,5071])
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 5110, 6]
type = PlaySnd
trigger1 = !Time
value = 2, 2-alive

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[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]) || anim = 5071
value = 5150

[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_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

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

[State 0, comolevantarse]
type = VarRandom
trigger1 = !time
v = 15
range = 0,1

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 1
triggerall = prevstateno != 6037
trigger1 = anim = 5071
trigger2 = var(15) = 0
value = 5120
;----------------------------------------
[State 5120, 1a] ;Get up anim (luego de legrab)
type = ChangeAnim
triggerall = time = 1
trigger1 = anim != 5120
trigger2 = prevstateno = 6037
value = 7072

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

[State 0, PosAdd]
type = PosAdd
trigger2 = anim = 7072
trigger1 = prevstateno = 6037
triggerall = anim = 7072
triggerall = animelem = 3
x = ceil(40*2*const(size.xscale));40
;---------------------------------

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

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

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; HIT_LIEDEAD
;[Statedef 5150]
type    = L
movetype= H
physics = N
;sprpriority = -3

[State endWins]
type = varset
trigger1 = !time
triggerall = name = "Juano`s Sub guy"
ignorehitpause = 1
var(57) = 0

[State findeflawles]
type = varset
trigger1 = !time
triggerall = name = "Juano`s Sub guy"
ignorehitpause = 1
var(42) = 0

[State caesinbrazos]
type = PlaySnd
trigger1 = anim = 70781 && animelem = 11
value = 2, 2

[State 0, caesinbrazos]
type = EnvShake
trigger1 = anim = 70781 && animelem = 11
time = 8
ampl = -4
;------------------------------ BAJA EN KOMBATTOMB Y BELLTOWER
[State 0, altosibelltower]
type = VelSet
trigger1 = prevstateno = 607721
trigger2 = prevstateno = 607714 ;kombat tomb
trigger2 = pos Y < -260 || pos Y > -20
y = 0
[State 0, bajaBelltower]
type = PosAdd
triggerall = !(time%2)
trigger1 = random < 100 && prevstateno = 607721 ;BELLTOWER
trigger2 = prevstateno = 607714 && pos Y < -260 ;kombat tomb
trigger2 = enemynear,command = "holddown" && random < 200
y = 1
[State 0, CaeTomb]
type = gravity
triggerall = prevstateno = 607714
trigger1 = pos Y >= -260 && pos Y < -20
[State 0, tiemblaalCAER]
type = EnvShake
triggerall = prevstateno = 607714
trigger1 = pos Y = [-20,1]
time = 10
ampl = -4
persistent = 0
;--------------------------------------
[State 0, SprPriority]
type = null;SprPriority
trigger1 = name = "Peter Griffin2"
value = 5

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = prevstateno = 607211
flag = noautoturn

[State 0, ScreenBound]
type = ScreenBound
trigger1 = prevstateno = 607211
value = 0

[State 5150, decapitado] ;peter decapitado
type = null;ChangeAnim
triggerall = PrevStateNo != 60532
triggerall = prevstateno = 60722
trigger3 = name = "Leela"
trigger2 = name = "Homero J Simpson"
trigger1 = name = "Peter Griffin"
value = 91232
elem = 2

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = anim != 9108108 && anim != 70883 && anim != 9108095
triggerall = prevstateno != 607723 && prevstateno != 607713
triggerall = prevstateno != 607721
triggerall = prevstateno != 607719
triggerall = prevstateno != 607211
triggerall = prevstateno != 607714; kombat tomb
triggerall = anim != 9108104 && anim != 9108105;babality
triggerall = anim != 607713 && anim != 607715; por si cayo del pit 2
triggerall = anim != 912332 && anim != 91231 ;no si esta decapitado peketo
triggerall = PrevStateNo != 60532 && PrevStateNo != 607211 && PrevStateNo != 607212
triggerall = prevstateno != 6076 && prevstateno != 60770 && prevstateno != 60780
triggerall = prevstateno != 6053 && prevstateno != 60723
triggerall = prevstateno != [6061,6062]
triggerall = !Time && anim != 5071 && prevstateno != 60726
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
triggerall = anim != 9108108 && anim != 70883 && anim != 9108095
triggerall = prevstateno != 607723 && prevstateno != 607713
triggerall = prevstateno != 607721
triggerall = prevstateno != 607719
triggerall = prevstateno != 607211
triggerall = prevstateno != 607714; kombat tomb
triggerall = anim != 9108104 && anim != 9108105;babality
triggerall = anim != 607713 && anim != 607715; por si cayo del pit 2
triggerall = anim != 912332 && anim != 91231 ;no si esta decapitado peketo
triggerall = PrevStateNo != 60532 && PrevStateNo != 607211 && PrevStateNo != 607212
triggerall = prevstateno != 6076 && prevstateno != 60770 && prevstateno != 60780
triggerall = prevstateno != 6053 && prevstateno != 60723 && prevstateno != 60726
triggerall = prevstateno != [6061,6062]
trigger1 = !Time && anim != 5071
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
triggerall = anim != 9108108 && anim != 70883 && anim != 9108095
triggerall = prevstateno != 607723 && prevstateno != 607713
triggerall = prevstateno != 607721
triggerall = prevstateno != 607719
triggerall = prevstateno != 607211
triggerall = prevstateno != 607714; kombat tomb
triggerall = anim != 9108104 && anim != 9108105;babality
triggerall = anim != 607713 && anim != 607715; por si cayo del pit 2
triggerall = anim != 912332 && anim != 91231 ;no si esta decapitado peketo
triggerall = PrevStateNo != 60532 && PrevStateNo != 607211 && PrevStateNo != 607212
triggerall = prevstateno != 6076 && prevstateno != 60770 && prevstateno != 60780
triggerall = prevstateno != 6053 && prevstateno != 60723
triggerall = prevstateno != [6061,6062]
trigger1 = MatchOver = 1 && anim != 5071 && prevstateno != 60726
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
triggerall = anim != 9108108 && anim != 70883 && anim != 9108095
triggerall = prevstateno != 607723 && prevstateno != 607713
triggerall = prevstateno != 607721
triggerall = prevstateno != 607719
triggerall = prevstateno != 607211
triggerall = prevstateno != 607714; kombat tomb
triggerall = anim != 9108104 && anim != 9108105;babality
triggerall = anim != 607713 && anim != 607715; por si cayo del pit 2
triggerall = anim != 912332 && anim != 91231 ;no si esta decapitado peketo
triggerall = PrevStateNo != 60532 && PrevStateNo != 607211 && PrevStateNo != 607212
triggerall = prevstateno != 6076 && prevstateno != 60770 && prevstateno != 60780
trigger1 = !Time && anim != 5071
triggerall = prevstateno != 6053 && prevstateno != 60723 && prevstateno != 60726
triggerall = prevstateno != [6061,6062]
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 0, noesta]
type = ChangeAnim2
triggerall = anim != 9108104 && anim != 9108105;babality
triggerall = PrevStateNo != 60532 && PrevStateNo != 607211 && PrevStateNo != 607212
triggerall = prevstateno != 6076 && prevstateno != 60770 && prevstateno != 60726
trigger1 = name = "Juano`s Sub guy"
trigger1 = palno = 7
trigger1 = prevstateno = 6062 || prevstateno = 6058 || prevstateno = 6064
value = 7049

[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

[State -2]
type = assertspecial
trigger14 = prevstateno = 60860 ;pos Si hell hand
trigger13 = prevstateno = 607723 ; subway MKA
trigger12 = prevstateno = 607719 ; subway
trigger11 = prevstateno = 607717 ;scorpion liar
trigger10 = prevstateno = 607716 ; the pit 3
trigger9 = prevstateno = 60840 && anim != 9108104 && anim != 9108105;babality
trigger8 = prevstateno = [607213,607214];fatality compatibles
trigger7 = prevstateno = 91231 && name = "Juano`s Sub guy" ;por si peketo
trigger6 = prevstateno = 607212 || prevstateno = 607210 ;por si peketo 2
trigger5 = (prevstateno = [6050,6080]) ;|| (prevstateno = [60722,60729])
trigger4 = prevstateno = 60779
trigger3 = prevstateno = 60727
trigger2 = prevstateno = 60726
trigger1 = prevstateno = 6053 || prevstateno = 6055  || prevstateno = 6058 || (prevstateno = [6061,6099]) || (prevstateno = 60811)
triggerall = prevstateno != 6076 && prevstateno != 60770
ignorehitpause = 1
flag = invisible

[State 0, camaranosemuevesisatagefatality]
type = ScreenBound
trigger1 = prevstateno = 60770
trigger2 = prevstateno = 607713
trigger3 = prevstateno = 607717
trigger4 = prevstateno = 60840
trigger5 = prevstateno = 607719
value = 0

[State 0, PIT2 noFGBG]
type = AssertSpecial
trigger1 = prevstateno = 607713
flag = noBG
flag2 = noFG

[State 0,porsistagefatalitypicos]
type = assertspecial
trigger1 = prevstateno = 60770
trigger2 = prevstateno = 607714
trigger3 = prevstateno = 607719
trigger4 = prevstateno = 607721
trigger5 = prevstateno = 607211
flag = noKOsnd
flag2 = noshadow

[State ]
type = PosSet
trigger1 = prevstateno != 60770 && prevstateno != 607711 && prevstateno != 607713 && prevstateno != 607714 && prevstateno != 607716 && prevstateno != 607717 && prevstateno != 607719 && prevstateno != 607721 && prevstateno != 607211
y = 0

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = alive = 0
time = 0
ignorehitpause = 1

[State 0, fisicaOFF]
type = StateTypeSet
trigger1 = prevstateno = 607711
trigger2 = prevstateno = 607713
trigger3 = prevstateno = 607714
trigger4 = prevstateno = 607715 || prevstateno = 607716
trigger5 = prevstateno = 607719
trigger6 = prevstateno = 607721
trigger7 = anim = 9108095 ;brazos arrancados
statetype = A
movetype = H
physics = N
