;===============================================================
;-------------------- TEAM FATALITY HELPER ----------------------
[Statedef 9999]
type    = A
movetype= I
physics = N
velset = 0,0
anim = 9999
ctrl = 0
sprpriority = 3

[State ]
type = VarSet
trigger1 = 1
var(15) = 15

[State noPartner]
type = VarSet
trigger1 = !time
var(0) = ifelse(!root,numpartner,150,250)
[State noPartner]
type = VarSet
trigger1 = !time
var(1) = ifelse(!root,numpartner,250,350)

[State 0, ovacionkhanarena]
type = PlaySnd
trigger1 = root,time = var(0) && root,stateno = 180 && !root,winperfect
trigger2 = root,time = var(1) && root,stateno = 180 && root,winperfect
triggerall = root,var(22) = 5006
value = F9891,18
volume = 0
ignorehitpause = 1
channel = -1
persistent = 0
lowpriority = -1

[State 0 ,fatal sonidoMKSM]
type = PlaySnd
trigger1 = root,time = var(0) && root,stateno = 180 && !root,winperfect
trigger2 = root,time = var(1) && root,stateno = 180 && root,winperfect
abspan = 0
value = 15,15
volume = 200
channel = 4
[State 0 ,fatal sonidoMKSM]
type = PlaySnd
trigger1 = root,time = var(0) && root,stateno = 180 && !root,winperfect
trigger2 = root,time = var(1) && root,stateno = 180 && root,winperfect
abspan = 0
value = 15,16
volume = 200
channel = -1

[State fatal seņal]
type = Explod
triggerall = !numexplod(70288)
trigger1 = root,time >= var(0) && root,stateno = 180 && !root,winperfect
trigger2 = root,time >= var(1) && root,stateno = 180 && root,winperfect
id = 70288
anim = ifelse(!root,var(21),70280,7028)
postype = left
pos = 160,60
bindtime = 9999
removetime = 9999
ownpal = 1
ontop = 1

;----------------------------------------------- GOTAS DE FATALITY mk2
[State gotas]
type = helper
triggerall = !root,pos Y
triggerall = !(time%7) && !root,var(21)
trigger1 = root,time >= var(0)+46 && root,stateno = 180 && !root,winperfect
trigger2 = root,time >= var(1)+46 && root,stateno = 180 && root,winperfect
helpertype = Normal
;ID = 70464
name = "Gota"
postype = p1
pos = floor(ScreenPos X),95-floor(ScreenPos Y)
stateno = 70464
ownpal = 1
;-----------------------------------------------

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = root,time <= 620+var(0) && root,stateno = 180 && root,winperfect
trigger2 = root,time <= 520+var(0) && root,stateno = 180 && !root,winperfect
flag = roundnotover

[State ]
type = assertspecial
trigger1 = root,win = 1 && roundno != 1
flag = nomusic
flag2 = timerfreeze

[State 0, DestroySelf]
type = DestroySelf
trigger1 = enemynear,alive 

;========================================================================
;------------------------ FINISH SEŅAL ----------------------------------
[Statedef 9998]
type = S
movetype = A
physics = S
anim = 7019
velset = 0,0
ctrl = 0

;--------------|msg|-------------
[State mujer]
type = VarSet
trigger1 = p2name = "leela"
trigger2 = p2name = "Juano`s Kit girl"
trigger3 = p2name = "kula_new"
trigger5 = p2name = "Shermie"
trigger6 = p2name = "morrigan"
trigger7 = p2name = "morrigan by ryokucha"
trigger8 = P2name = "felicia"
trigger9 = P2Name = "psylocke by Qkrtkf!"
trigger10 = P2Name = "psylocke"
trigger11 = P2Name = "viuda negra"
trigger12 = P2Name = "chun li"
trigger13 = P2Name = "elastigirl"
trigger14 = p2name = "cammy"
trigger15 = P2name = "Sakura Kasugano"
trigger16 = p2name = "R.mika"
trigger17 = P2name = "Karin Kanzuki"
trigger18 = p2name = "juli" 
trigger19 = p2name = "juni" 
trigger20 = p2name = "rose"
trigger21 = p2name = "Chunli" 
trigger22 = p2name = "Chun-Li" 
trigger23 = p2name = "Mika"  
trigger24 = P2name = "SF3 Chun Li" 
trigger25 = P2Name = "SSF2Cammy"
trigger26 = P2Name = "cvscammy" 
trigger27 = P2Name = "J_Rose" 
trigger28 = P2Name = "sakura"
trigger29 = P2name = "Morrigan Aensland" 
trigger30 = p2name = "Lilith" 
trigger31 = P2name = "Hinata Wakaba" 
trigger32 = P2name = "Mariah"
trigger33 = p2name = "MIDLER"  
trigger34 = P2name = "Mai"
trigger35 = P2Name = "svcathena" 
trigger36 = p2name = "cvsathena"   
trigger37 = p2name = "cvsvice"
trigger38 = P2name = "B.Jenet" 
trigger39 = P2name = "ARINA" 
trigger40 = p2name = "Hikari Reiko"
trigger41 = p2name = "Yuki Morikawa"
trigger42 = P2Name = "dizzy" 
trigger43 = P2name = "Raiya Mikazuchi" 
trigger44 = P2name = "MysP"
trigger45 = P2name = "roomi" 
trigger46 = p2name = "Blue Mary"
trigger47 = p2name = "Mai Shiranui" 
trigger48 = p2name = "cvsfelicia" 
trigger49 = p2name = "Nanashi Kimura" 
trigger50 = p2name = "Wonder Woman Reloaded" 
trigger51 = p2name = "Felicia MvC2 Style by MGBenz" 
trigger52 = p2name = "SHIRANUI MAI" 
trigger53 = p2name = "She-ra"  
trigger54 = p2name = "Cammy_MVC2" 
trigger55 = p2name = "Red Snake" 
trigger56 = p2name = "Blair Dame" 
trigger57 = p2name = "Blair Dame MvsC" 
trigger58 = p2name = "athena-rkn" 
trigger59 = p2name = "Kelly Blender(Elektra) by AHRIMANES" 
trigger60 = p2name = "B.ORCHID BY AHRIMANES"  
trigger61 = p2name = "Tiazinha"  
trigger62 = p2name = "Sailor Jupiter"  
trigger63 = p2name = "Maxine" 
trigger64 = p2name = "cvsyoko"
var(10) = 1

[State womanKomp]
type = VarSet
trigger1 = numenemy = 1
trigger1 = enemynear,selfanimexist(9108119)
trigger2 = numenemy = 2
trigger2 = (enemynear(0),alive && enemynear(0),selfanimexist(9108119) && !enemynear(1),alive) || (enemynear(1),alive && enemynear(1),selfanimexist(9108119) && !enemynear(0),alive) 
var(10) = 1

[State HER msg]
type = Explod
trigger1 = !time && var(10)
anim = 70292
id = 70292 
postype = left
pos = 160,60
bindtime = 9999
ownpal = 1
ontop =1

[State HER snd]
type = PlaySnd
trigger1 = !time && var(10)
value = 4, 13
volume = 200
abspan = 1

[State HIM msg]
type = Explod
trigger1 = !time && !var(10)
anim = 7029
id = 70292
postype = left
pos = 160,60
bindtime = 9999
ownpal = 1
ontop =1

[State HIM snd]
type = PlaySnd
trigger1 = !time && !var(10)
value = 4, 0
abspan = 1
;------------------------ effect msg
[State msg scale]
type = ModifyExplod
trigger1 = 1
ID = 70292
scale = fvar(10),fvar(10)

[State scale agranda]
type = VarAdd
trigger1 = !fvar(11) && fvar(10) <= 1
fvar(10) = .02

[State scale achica]
type = VarAdd
trigger1 = fvar(11) = 1
fvar(10) = -.02

[State retrae]
type = Varset
trigger1 = fvar(12) >= 1
fvar(11) = 1

[State tiempo retrae]
type = Varadd
trigger1 = fvar(10) >= 1
fvar(12) = .03
;--------------------------------

[State ]
type = AssertSpecial
trigger1 = 1
flag = unguardable
flag2 = nomusic
flag3 = nobardisplay
ignorehitpause = 1

[State normal]
type = HitDef
trigger1 = anim = 7019
trigger1 = P2StateType != A
attr = S, NA
hitflag = -M
sparkno = -1
p2stateno = 9997
numhits = 0

[State ]
type = ParentVarSet
trigger1 = !movecontact
var(4) = 1

[State ]
type = Posadd
trigger1 = 1
x = P2BodyDist x

[State suelo]
type = PosSet
trigger1 = 1
y = 0

[State Inofensivo]
type = ChangeAnim
triggerall = anim != 9999
trigger1 = movecontact
value = 9999
ignorehitpause = 1

[State Ofensivo]
type = ChangeAnim
triggerall = anim = 9999 && root,win != 1 && p2stateno != 5150 && root,lose != 1 && enemynear,alive
trigger1 = !p2stateno
trigger2 = enemynear,ctrl
value = 7019
ignorehitpause = 1

;---------------------------------------------------------------
;----------------- mareado - dizzy -----------------------------
[Statedef 9997]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
sprpriority = 3

[State paraBosses]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
value2 = S,NA
time = 9999

[State 0, AfterImage]
type = AfterImage
trigger1 = !time
time = 1
length = 1
ignorehitpause = 1

[State 1]
type = LifeSet
trigger1 = time < 720
value = 1

[State mareado]
type = ChangeAnim
trigger1 = !time && anim != 5300
value = 5300

[State ]
type = posset
trigger1 = !time
y = 0

[State ]
type = assertspecial
trigger1 = 1
flag = timerfreeze

[State ]
type = lifeset
trigger1 = time = 720
value = 0

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 720
channel = -1

[State 0, LifeAdd]
type = LifeAdd
trigger1 =  time = 720
value = -9999
kill = 1

[State 0, SelfState]
type = SelfState
trigger1 =  time = 720
value = 5050

;---------------------------------------------------------- empy
[Statedef 9996]
type = S
movetype = A
physics = S
anim = 9999
velset = 0,0
ctrl = 0

[State kill]
type = ParentVarSet
trigger1 = p2stateno = 9997
var(4) = 1



;==============================================
;------------ enemy stop -------------
[Statedef 90010]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
sprpriority = 6

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

[State paraBosses]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
value2 = S,NA
time = 9999

[State amination]
type = ChangeAnim
Trigger1 = anim != 5300
value = anim
elem = animelemno(0)

[State end]
type = changeState
trigger1 = time = 150
value = 9997
ctrl = 1

;=============================================================
;Team fatality 3 > Noob + Cyber Smoke
[Statedef 9006]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0

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

[State ]
type = AssertSpecial
trigger1 = 1
flag = unguardable

[State stand]
type = ChangeAnim
trigger1 = !time
value = 9001
elem = ifelse(var(20) = 1,1,2)

[State stop]
type = HitDef
trigger1 = anim = 9001
attr = S,NA
hitflag = M-
sparkno = -1
p2stateno = 90010
numhits = 0
persistent = 0

[State done]
type = ChangeState
triggerall = p2bodydist X > ceil(40*const(size.xscale)) && p2bodydist X < ceil(70*const(size.xscale)) 
triggerall = movecontact && time >= 30 && p2stateno = 90010 && facing = partner,facing
trigger1 = partner,stateno = 9006 
trigger2 = partner,stateno = 90060  
value = 90060

[State end]
type = ChangeState
triggerall = time >= 120 && partner,stateno != 90060 && partner,stateno != 9006
trigger1 = p2bodydist X < ceil(40*const(size.xscale)) 
trigger2 = p2bodydist X > ceil(70*const(size.xscale)) 
value = 0
ctrl = 1

;--------------------------------------
;Smoke bomb
[Statedef 90060]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim = 1
sprpriority = 0

[State garra]
type = ChangeAnim
trigger1 = time >= 45 && partner,stateno = 90060 && anim != 6013
value = 6013

[State partner]
type = HitDef
trigger1 = !movecontact && animelem = 1 && anim = 6013 
attr = S,NA
hitflag = MAFD
sparkno = -1
p2stateno = 90061
affectteam = F
numhits = 0

[State reset]
type = MoveHitReset
trigger1 = animelem = 5 && anim = 6013 

[State reset]
type = TargetDrop
trigger1 = animelem = 5 && anim = 6013 
excludeID = -1

[State enemy]
type = HitDef
trigger1 = !movecontact && animelem = 6 && anim = 6013 
attr = S,NA
hitflag = MAFD
sparkno = -1
p2stateno = 90062
numhits = 0

[State amigo]
type = TargetBind
trigger1 = numtarget
trigger1 = anim = 6013 && animelemtime(6) < 0
time = 20
pos = 0,0

[State enemigo]
type = TargetBind
trigger1 = numtarget
trigger1 = anim = 6013 && animelemtime(6) >= 0
time = 20
pos = target,const(size.xscale)*120,0

[State infla]
type = TargetState
trigger1 = partner,stateno = 90061 && partner,var(15) = 1 && target,stateno != 90063 && target,stateno = 90062 && target,time > 75
value = 90063

[State regresa]
type = ChangeAnim
trigger1 = partner,anim = 43 && anim != 60130 && anim != 1
value = 60130

[State stand]
type = ChangeAnim
trigger1 = anim = 60130 && !animtime
value = 1

[State win]
type = ChangeAnim
trigger1 = anim = 1 && !animtime
value = 181

[State fatality]
type = VarSet
trigger1 = anim = 181
var(16) = 7

[State ]
type = Helper
trigger1 = p2stateno = 6072
helpertype = Normal
name = "splat"
postype = p2
pos = 0,ceil(enemynear,const(size.mid.pos.y)*enemynear,const(size.yscale))
stateno = 7029
ownpal = 1
persistent = 0

[State end 1]
type = ChangeState
trigger1 = numenemy = 1 && enemynear,stateno = 5150 && enemynear,time >= 60
value = 0
ctrl = 1

[State end 2]
type = ChangeState
triggerall = numenemy = 2
trigger1 = enemynear(0),prevstateno = 90063 && enemynear(0),time >= 60 && !enemynear(1),alive
trigger2 = enemynear(1),prevstateno = 90063 && enemynear(1),time >= 60 && !enemynear(0),alive
value = 0
ctrl = 1

;------------------------------------
;noob part custom
[Statedef 90061]
type    = A
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 0
sprpriority = 1

[State puta camara]
type = ScreenBound
trigger1 = 1
value = 0

[State reset]
type = VarSet
trigger1 = !time
var(15) = 0

[State colgado]
type = ChangeAnim
trigger1 = !time
value = 8010
numhits = 0

[State arriba]
type = Posadd
trigger1 = anim = 8010 && animelem = 6
x = ceil(118*partner,const(size.xscale))
y = ceil(-150*partner,const(size.yscale))

[State abajo]
type = AngleDraw
trigger1 = anim = 80100 
trigger2 = anim = 8010 && animelemtime(6) >= 10  
value = -90

[State dispara]
type = ChangeAnim
trigger1 = anim = 8010 && animelemtime(6) = 10 
value = 80100

[State nube]
type = Helper
trigger1 = anim = 80100 && animelem = 4
helpertype = normal
name = "killer nube"
stateno = 90061
id = 90061
pos = const(size.xscale)*30,const(size.yscale)*20
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State golpeo]
type = ChangeAnim
trigger1 = !numhelper(90061) && anim = 80100 && animelemtime(4) > 0
trigger1 = animelemtime(7) <= 4
value = 80100
elem = 5
persistent = 0

[State golpeo]
type = VarSet
trigger1 = anim = 80100 && animelem = 5
var(15) = 1

;--------------------
[State salta]
type = ChangeAnim
trigger1 = anim = 80100 && animelemtime(7) > 4
value = 43
elem = 2

[State salta vel]
type = VelSet
trigger1 = anim = 43
x = const(velocity.jump.back.x)*.9
y = const(velocity.jump.y)*.8
persistent = 0

[State voz]
type = PlaySnd
trigger1 = anim = 43
value = 2, ifelse(var(20)=6,29,ifelse(!var(21),39,9))
channel = 0
persistent = 0

[State cae]
type = VelAdd
trigger1 = anim = 43
y = .3

[State suelo]
type = PosSet
trigger1 = pos y > -5
y = 0

[State suelo]
type = VelSet
trigger1 = pos y > -5
x = 0
y = 0

[State suelo]
type = ChangeAnim
trigger1 = anim = 43 && pos y > -5
value = 40

[State stand]
type = ChangeAnim
trigger1 = anim = 40 && !animtime 
value = 0

[State suelo]
type = PlaySnd
trigger1 = anim = 40
value = 3, 0
persistent = 0

[State lanza]
type = SelfState
trigger1 = !anim && var(15) = 1 && partner,anim = 181 
value = 90065

;---------------------------------
;p2 nube en boca
[Statedef 90062]
type    = S
movetype= H
physics = N
sprpriority = 2

[State anim]
type = ChangeAnim
trigger1 = !selfanimexist(9108121)
trigger2 = selfanimexist(9108121) && !time
value = ifelse(!selfanimexist(9108121),5001,9108121)

[State tiembla]
type = PosAdd
trigger1 = time >= 57 && time <= 72
trigger1 = time%2 = 1
y = 2

[State tiembla]
type = PosAdd
trigger1 = time >= 57 && time <= 72
trigger1 = time%3 = 1
y = -3

;---------------------------------
;p2 infla
[Statedef 90063]
type    = S
movetype= H
physics = N
sprpriority = 2

[State infla komp]
type = ChangeAnim
trigger1 = selfanimexist(9108094) && time = 15
value = 9108094

[State no komp]
type = ChangeAnim2
trigger1 = time = 15 && !selfanimexist(9108094) 
value = 60152

[State ]
type = EnvShake
trigger1 = time = 175
time = 15
ampl = -5

[State ]
type = AssertSpecial
trigger1 = time >= 175
flag = invisible

[State ]
type = null;LifeSet
trigger1 = time = 200
value = 0

[State ]
type = changestate
trigger1 = time = 175
value = 6072
anim = 0




 
