;   =============================================
;   =                FATALITY CNS               =
;   = ------------------------------------------=


;-------------------------------
;        FINISH HIM            :
;-------------------------------

[Statedef 9000]
type    = S
movetype= I
physics = S
juggle  = 4
ctrl = 1
velset = 0,0,0

[State 9000, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,8

; Finish Him como Helper
[State 9000, 1]
type = Helper
trigger1 = Time = 0
trigger1 = NumHelper(9010) = 0
ID = 9010
pos = 160, -140
postype = left
stateno = 9010
helpertype = normal
name = "Finish Him!!"
keyctrl = 0
ownpal = 1


; Voltando ao state inicial
[State 9000, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0 
ctrl = 1

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

; Helper: Finish Him!! (invisível)
[Statedef 9010]
type = S
movetype = A
physics = S
anim = 9010
velset = 0,0
ctrl = 1

; Finish Him acerta a tela toda e tonteia o inimigo
[State 9010, 3]
type = HitDef
trigger1 = AnimElem = 1
trigger1 = P2StateType != A
attr = S, SP
damage = 0,0
animtype = Heavy
getpower = 10
givepower = 25
hitflag = MF
guardflag = A 
priority = 7
pausetime = 0,2
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
fall = 0
p2stateno = 003
numhits = 0


[state 9000, 3]
type = Helper
triggerall = time = 0
trigger1 = NumHelper(9011) = 0 
id = 9011  
stateno = 9011
pos = 160, -140
postype = left
helpertype = normal
keyctrl = 0

; Finish Him se vai quando P2 morrer
[State 9010, 3]
type = null;DestroySelf
trigger1 = P2Life <= 0

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

[Statedef 9011]
type    = S
movetype= I
physics = S
juggle  = 1
velset = 0,0
anim = 9011
ctrl = 0


[State 9000, 2]
type = PlaySnd
trigger1 = Time = 0
value = 4,7

[state 9011, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 9011, 3]
type = Destroyself
trigger1 = AnimTime = 0 


;----------------------
; CUSTOM STATES DO P2 :
;----------------------

;Dizzy com tempo . Antes do fatality.

[Statedef 003]
type    = S
movetype= H
physics = S
juggle  = 2
ctrl = 0
velset = 0,0

[State 003, 1]
type = LifeSet
trigger1 = 1
value = 1

[State 003, 1]
type = TargetLifeAdd
trigger1 = P2life <= 1
value = 1

[State 003, 1]
type = LifeSet
trigger1 = P2StateNo != [8000,8999] 
trigger1 = Time = 600
value = 0


[State 003, 1]
type = SelfState
trigger1 = P2StateNo != [8000,8999] 
trigger1 = Time = 600
value = 5050
ctrl = 0

[State 003, 1]
type = ChangeState
trigger1 = P2StateNo = [8000,8999] 
value = 004
ctrl = 0

[State 003, 2]
type = ChangeAnim 
trigger1 = AnimExist(5300)
trigger1 = Anim != 5300
value = 5300


; Dizzy sem tempo

[Statedef 004]
type    = S
movetype= H
physics = S
juggle  = 2
ctrl = 0
velset = 0,0,0

[State 004,1.1]; forsar a ver al oponente
type = Turn
trigger1 = 1
trigger1 = p2dist X < -5

[State 004, 1]
type = ChangeState
trigger1 = P2StateNo = 8551
value = 50005 ;-> Custom State para onde P2 vai após sua personagem iniciar os golpes.
ctrl = 0 

[State 004, 2]
type = ChangeAnim 
trigger1 = AnimExist(5300)
trigger1 = Anim != 5300
value = 5300


;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;-------------------------------------
;        ARRANCANDO CABEÇAS          :
;-------------------------------------

[Statedef 8000]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0

[State 8000, Andando]
type = ChangeAnim
trigger1 = time = 0
value = 21

[State 8000, Vel]
type = VelSet
trigger1 = P2bodydist x <= 25
x = -1

[State 8000, Decapitando]
type = ChangeAnim
trigger1 = time = 20
value = 6500

[State 8000, Hit]
type = HitDef
trigger1 = Stateno = 6500 || AnimElem = 3
attr = S,SP
animtype = Hard
damage  = 0,0
getpower = 30
givepower = 30
hitflag = MAF
guardflag = MF
sparkno = -1
pausetime = 0, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
air.animtype = Back
ground.velocity = 0,0
air.velocity = 0,0
p2stateno = 60020

[State 8000, SP]
type = SuperPause
trigger1 = time = 40
sound = S4,4
darken = 0
Time = 60
Anim = -1

[state 8000, Escuridão Total]
type = AllPalFx
trigger1 = Time = 40
add = 0,0,0
mul = 256,256,256
sinadd = -255,-255,-255,300
time = 100

[State 8000, sem A]
type = AssertSpecial
trigger1 = Time > 50
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1

[State 8000, sem B]
type = AssertSpecial
trigger1 = Time > 50
flag = invisible
flag2 = noshadow
flag3 = nokosnd

[State 8000, 2]
type = PosSet
trigger1 = time = 85
y = 9999

; Helper
[State 8000, 1]
type = Helper
trigger1 = Time = 200
trigger1 = NumHelper(8001) = 0
ID = 8001
pos = 155,-170
postype = left
facing = 1
stateno = 8001
helpertype = normal
name = "FatalityLT"
keyctrl = 0
ownpal = 1

[State 8000, 4]
type = ChangeState
trigger1 = Time = 200
value = 0
ctrl = 1

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

[Statedef 8001]
type = S
movetype = A
physics = N
anim = 7502
velset = 0,0
ctrl = 1
sprpriority = 9999

[State 8001, SND]
type = PlaySnd
trigger1 = Time = 300
value = 3,9
volume = 255

[State 8001, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1

[state 8001, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

;====================
; P2 Custom States  *
;====================

;P2 Perde cabeça

[Statedef 60020]
type    = S
movetype= H
physics = S
juggle  = 1
velset = 0,0
anim = 5000
ctrl = 0

[State 60020, sem A]
type = AssertSpecial
trigger1 = Time > 50
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1


[State 60020, sem A]
type = AssertSpecial
trigger1 = Time > 50
flag = nokosnd
ignorehitpause = 1


[State 60020, 2]
type = PosSet
trigger1 = time = 30
y = 9999

[State 60020, 4]
type = LifeSet
trigger1 = time = 50
value = 0

[State 60020, 9]
type = SelfState
trigger1 = Life = 0 
value = 5150





;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;========================================================;
;    ARRANCANDO CABESAS DE PERSONAJES ACOPLADOS          ;
;                    BY AHRIMANES                        ;
; NOTA: PARA LA REALIZACION DE ESTE FATALITY SE TUBIERON ;
; QUE MODIFICAR LOS SIGIENTES STATES:                    ;
;                                                        ;
; SUBZERO.CNS/[Statedef 181]+[State 181, anim]           ;
; COMMON.CNS/[State 0, 1]                                ;
;                                                        ;
; TAMBIEN SON REQUERIDAS LAS SIGUIENTES ACTIONID:        ;
; P2:                                                    ;
;    22002 > ANIMACION DEL CUERPO SIENDO DECAPTIADO      ;
;    22003 > ANIMACION DEL ESTADO FINAL DEL CUERPO       ;
;            1 SPRITE O MAS                              ;        
;            EJEMPLO:                                    ;
;                    B.ORCHID BY AHRIMANES               ;
;                    SUBZERO BY BINHO                    ;
;    22004 - 22008 > ANIMACION DE LA CABEZA              ;
;                    (MINIMO 3 SPRITES)                  ;
; P1:                                                    ;
;    6504  > ANIMACION DEL PERSONAJE ARRANCANDO LA       ;
;            CABEZA, VEASE SUBSERO BY BINHO              ;
;========================================================;

[Statedef 8005]
type    = S
movetype= A
physics = S
velset = 0,0
sprpriority = 0
ctrl = 0

[State 8005, Andando]
type = ChangeAnim
trigger1 = time = 0
value = 21

[state 8005, Escuridão media]
type = bgPalFx
trigger1 = Time = 1
add = 0,0,0
mul = 256,256,256
sinadd = -155,-155,-155,300
time = 200

[state 8005, Escuridão media]
type = bgPalFx
trigger1 = Time >= 100
add = -155,-155,-155
time = 99999999


[State 60021, SND] ;sonido de chin cha chaaaaaannnnnnnnnnnnnnnnnnn
type = PlaySnd
trigger1 = time = 1
value = 4,0
volume = 255

[State 8005, Vel]
type = VelSet
triggerall = anim != 6504 	;se evita desplasamiento cuando el p1 esta en la animacion de arrancar cabeza
trigger1 = p2name = "B.ORCHID BY AHRIMANES"
trigger1 = P2bodydist x <= 35 ;para sincronisar perfectamenta la mano y la cabesa..
trigger2 = p2name = "sub-zero by binho"
trigger2 = P2bodydist x <= 50 ;para sincronisar perfectamenta la mano y la cabesa..
trigger3 = p2name = "Binho by Binho"
trigger3 = P2bodydist x <= 40 ;para sincronisar perfectamenta la mano y la cabesa..
trigger4 = p2name = "Sektor"
trigger4 = P2bodydist x <= 40 ;para sincronisar perfectamenta la mano y la cabesa..
x = -1

[State 8005, Decapitando]
type = ChangeAnim
trigger1 = p2name = "B.ORCHID BY AHRIMANES"
trigger1 = P2bodydist x = 35 ;solo empiesa a arrancar la cabesa cuando la pocicion es la ideal.
trigger2 = p2name = "sub-zero by binho"
trigger2 = P2bodydist x = 50
trigger3 = p2name = "Binho by binho"
trigger3 = P2bodydist x = 40
trigger4 = p2name = "Sektor"
trigger4 = P2bodydist x = 40
value = 6504

[State 8005, SND] ;sonido de huesitos
type = PlaySnd
triggerall = anim = 6504 ;solo cuando la animacions sea la correcta
trigger1 = animelem = 5
trigger2 = animelem = 7
value = 0,2
volume = 255

[State 8005, SND] ;sonido de cuello roto
type = PlaySnd
triggerall = anim = 6504 ;solo cuando la animacions sea la correcta
trigger1 = animelem = 9
value = 0,3
volume = 255

[State 8005, SND] ;sonido de cuello roto
type = PlaySnd
triggerall = anim = 6504 ;solo cuando la animacions sea la correcta
trigger1 = animelem = 9
value = 5,1
volume = 200

[State 8005,nokosnd]; para que cuando muera p2 no grite..
type = AssertSpecial
trigger1 = 1
flag = nokosnd

[State 8005, cojiendo cabeza]
type = HitDef
trigger1 = anim = 6504   ; con esto y
trigger1 = AnimElem = 3  ; esto evitamos que suceda cuando no queremos
trigger1 = P2StateType != A 
attr = S, SP
damage = 0,0
animtype = Heavy
getpower = 10
givepower = 25
hitflag = MF
guardflag = A 
priority = 7
pausetime = 0,2
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
;p2facing = 1     ;  el forzar a ver al char se ha mudado al state 004
fall = 0
numhits=0	;con esto evitamos que haya respuesta a el golpe y los sonitos
p2stateno = 60021 ; este es el estado donde el p2 perdera la cabeza
kill = 0 ;evitamos que es golpe sea mortal

[State 8005, kill];para que el roud pueda terminar, el p2 deve estar muerto,pero necesitamos que no se vea el estado 5150;
type = HitDef
trigger1 = anim = 6504 ; con esto y
trigger1 = AnimElem = 14; esto evitamos que suceda cuando no queremos
trigger1 = P2StateType != A 
attr = S, SP
damage = 99999999  ; definitivamente tiene que morir jejejejejejejejeje
animtype = Heavy
getpower = 10
givepower = 25
hitflag = MF
guardflag = A 
priority = 7
pausetime = 0,2
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
;p2facing = 1     ;  el forzar a ver al char se ha mudado al state 004
fall = 0
numhits=1	;con esto evitamos que haya respuesta a el golpe y los sonitos
p2stateno = 60022 ; este es el estado donde el p2 perdera la cabeza
kill = 1 

;esta es la sangre 
[State 60021, Explod]
type = Explod
trigger1 = animelem = 9
anim = 7005
postype = p1
pos = 85,-85
facing = -1
sprpriority = 999
removeongethit = 0

;esta es la sangre 
[State 60021, Explod]
type = Explod
trigger1 = animelem = 9
anim = 7005
postype = p1
pos = 73,-83
facing = 1
sprpriority = -3
removeongethit = 0

;Helper de fatality
[State 8005, FATA]
type = Helper
trigger1 = Time = 0
trigger1 = NumHelper(8001) = 0
ID = 8001
pos = 155,-999;-170
postype = left
facing = 1
stateno = 8002
helpertype = normal
name = "FatalityLT"
keyctrl = 0
ownpal = 1

[State 8005, 4]
type = ChangeState
trigger1 = Time = 300
value = 0
ctrl = 1

;----------------------------------------------
;state el fatality
[Statedef 8002]
type = S
movetype = A
physics = N
;anim = 7502
velset = 0,0
ctrl = 1
sprpriority = 9999

[State 8002,anim]
type = posset
trigger1 = time = 600 
y=-170

[State 8002,anim]
type = changeanim
trigger1 = time = 600 
value = 7502

[State 8002, SND]
type = PlaySnd
trigger1 = time = 600 
value = 3,9
volume = 255

[State 8002, noroudover]
type = AssertSpecial
trigger1 = time < 800
flag = roundnotover

[state 8002, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

;====================
; P2 Custom States  *
;====================
;P2 Perde cabeça
[Statedef 60021]
type    = S
movetype= H
physics = S
juggle  = 1
velset = 0,0
anim = 22002
ctrl = 0


[State 60021, SND] ;sonido de muerte haaaaaaaaaaaaaaaaaaa!!!!!... pra sincronisar cuando pierde la cabesa..
type = PlaySnd
trigger1 = p1name = "B.ORCHID BY AHRIMANES"
trigger1 = animelem = 10
value = 2,11
volume = 255

[State 60021, SND] ;sonido de muerte haaaaaaaaaaaaaaaaaaa!!!!!... pra sincronisar cuando pierde la cabesa..
type = PlaySnd
trigger1 = p1name = "sub-zero by binho"
trigger1 = animelem = 6
value = 1,7
volume = 255

;**********************
;explods de la cabeza
;*********************
[State 60021, Explod]
type = Explod
trigger1 = enemy(0),animelem = 10
anim = 22004
id = 22004
postype = p2
pos = 67,-90
facing = -1
sprpriority = 999
removeongethit = 0

[State 60021, Explod]
type = Explod
trigger1 = enemy(0),animelem = 11
anim = 22005
id = 22005
postype = p2
pos = 34,-84
facing = -1
sprpriority = 999
removeongethit = 0

[State 60021, Explod]
type = Explod
trigger1 = enemy(0),animelem = 12
anim = 22006
id = 22006
postype = p2
pos = -5,-87
facing = -1
sprpriority = 999
removeongethit = 0

[State 60021, Explod]
type = Explod
trigger1 = enemy(0),animelem = 13
anim = 22007
id = 22007
postype = p2
pos = -18,-101
facing = -1
sprpriority = 999
removeongethit = 0


[State 60021, Explod]
type = Explod
trigger1 = enemy(0),animelem = 14
anim = 22008
id = 22008
postype = p2
pos = -14,-118
facing = 1
sprpriority = 999
removeongethit = 0
removetime = -1

;***************************
;fin de explods de la cabeza
;***************************

;para que el p2 se muera pero sin que veamos la animacion 5150
;es necesario retirar al p2 del ecenario pro dejamos visible acambio un na explod con el
;cuerpo ya sin cabeza; que sangriento soy ;)
[Statedef 60022]
type    = S
movetype= H
physics = S
juggle  = 1
velset = 0,0
ctrl = 0

[State 60022, Explod]
type = Explod
trigger1 = 1
anim = 22003
pos = 0,-9999
postype = P1
supermovetime = -1
facing = 1
sprpriority = -999
removeongethit = -1
removetime = -1


[State 60022,1]
type = AssertSpecial
trigger1 = 1
flag = nokosnd

[State 60022,2]
type = PosSet
trigger1 = time >=1
y = 9999

[State 60022, 3]
type = LifeSet
trigger1 = 1
value = -9000

[State 60022,9]
type = SelfState
trigger1 = time =2 
value = 5150

;++++++++++++++++++++++++++++++++++++++++++++++++++++
; FIN DE ARRANCANDO CABESAS DE PERSONAJES ACOPLADOS ;
;++++++++++++++++++++++++++++++++++++++++++++++++++++


;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;---------------------------------
;        QUEBRANDO O P2          :
;---------------------------------

; Inicio

[Statedef 8010]
type = S
movetype = A
physics = S
juggle  = 2
ctrl = 0
velset = 0,0,0
anim = 1000

[State 8010, 1]
type = PlaySnd
trigger1 = AnimElem = 5 
value = 1,8

; Helper
[State 8010, 1]
type = Helper
trigger1 = AnimElem = 5
trigger1 = NumHelper(8015) = 0
ID = 8015
pos = 10,-10
postype = p1
facing = 1
stateno = 8015
helpertype = normal
name = "freeze"
keyctrl = 0
ownpal = 1

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


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

[Statedef 8011]
type = S
physics = S
sprpriority = 0
ctrl = 0

[State 8011, 4]
type = ChangeAnim
trigger1 = time = 0
value = 0

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

[State 8011, 6]
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

; Gancho
[State 8011, 4]
type = ChangeState
trigger1 = command = "x"
trigger2 = command = "y"
value = 8012
ctrl = 1

; Chute 
[State 8011, 4]
type = ChangeState
trigger1 = command = "a"
trigger2 = command = "b"
value = 8013
ctrl = 1

; Nem uma coisa nem outra
[State 8011, 4]
type = ChangeState
trigger1 = time = 300
trigger1 = command != "a"
trigger1 = command != "x"
trigger1 = command != "b"
trigger1 = command != "y"
value = 8014
ctrl = 1

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

; Gancho
[Statedef 8012]
type = S
movetype = A
physics = S
sprpriority = 9999
velset = 0,0
ctrl = 0

[State 8012, 4]
type = VelSet
trigger1 = time >= 0
trigger1 = P2BodyDist X > 10
x = 2.4
y = 0

[State 8012, 4]
type = VelSet
trigger1 = P2BodyDist X <= 10
x = 0
y = 0

; Andando
[State 8012, 4]
type = ChangeAnim
trigger1 = P2BodyDist X > 10
value = 20
persistent = 0

; Abaixando
[State 8012, 4]
type = ChangeAnim
trigger1 = P2BodyDist X <= 10
value = 10
persistent = 0

; Abaixado
[State 8012, 4]
type = ChangeAnim
trigger1 = Anim = 10 && AnimElem = 2
value = 11
persistent = 0

; Gancho
[State 8012, 4]
type = ChangeAnim
trigger1 = P2BodyDist X <= 10 && Anim = 11 && time = 100
value = 410
persistent = 0

[State 8012, 1]
type = HitDef
trigger1 = AnimElem >= 1
attr = S,SP
animtype = Hard
damage  = 0,0
getpower = 30
givepower = 30
hitflag = MAF
guardflag = MF
hitsound = S1, 10
sparkno = S7015
guard.sparkno = s7015
sparkxy = 0,-50
pausetime = 0, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
air.animtype = Back
ground.velocity = 0, 0
air.velocity = 0, 0
p2stateno = 60010


; Crack!
[State 8012, 4]
type = PlaySnd
trigger1 = Anim = 410 && AnimElem = 3
value = 0,3
volume = 150
persistent = 0

; Tanananam!
[State 8012, 4]
type = PlaySnd
trigger1 = Anim = 11 && AnimElem = 1
value = 4,0
volume = 255
persistent = 0

; Tela treme
[State 8012, 4]
type = EnvShake
trigger1 = Anim = 410 && AnimElem = 3
freq = 80
ampl = 2
time = 60
persistent = 1
ignorehitpause = 1

; Tela clareia
[State 8012, 4]
type = EnvColor
trigger1 = Anim = 410 && AnimElem = 3
add = 255,255,255
mul = 255,255,255
time = 3
persistent = 1
ignorehitpause = 1

; Fundos somem
[state 8012, 3]
type = AssertSpecial
trigger1 = Anim = 11
trigger2 = Anim = 410
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1


; Helper
[State 8501, Gelo]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8016) = 0
ID = 8016
pos = 0,0
postype = p2
stateno = 8016
helpertype = normal
name = "Geloquebrando"
keyctrl = 0
ownpal = 1

; Helper 001
[State 8501, Gelo001]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8018) = 0
ID = 8018
pos = 0,-90
postype = p2
stateno = 8018
helpertype = normal
name = "Geloquebrando001"
keyctrl = 0
ownpal = 1

; Helper 002
[State 8501, Gelo002]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8019) = 0
ID = 8019
pos = 0,-90
postype = p2
stateno = 8019
helpertype = normal
name = "Geloquebrando002"
keyctrl = 0
ownpal = 1

; Helper 003
[State 8501, Gelo003]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8020) = 0
ID = 8020
pos = 0,-90
postype = p2
stateno = 8020
helpertype = normal
name = "Geloquebrando003"
keyctrl = 0
ownpal = 1

; Standing pós-fatal
[State 8012, 4]
type = ChangeState
trigger1 = Anim = 410 && AnimTime = 0
value = 0
ctrl = 1

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

; Chute
[Statedef 8013]
type = S
movetype = A
physics = S
sprpriority = 9999
velset = 0,0
ctrl = 0

[State 8013, 4]
type = VelSet
trigger1 = time >= 0
trigger1 = P2BodyDist X > 20
x = 2.4
y = 0

[State 8013, 4]
type = VelSet
trigger1 = P2BodyDist X <= 20
x = 0
y = 0

; Andando
[State 8013, 4]
type = ChangeAnim
trigger1 = P2BodyDist X > 20
value = 20
persistent = 0

; Stand Intermediario
[State 8012, 4]
type = ChangeAnim
trigger1 = P2BodyDist X <= 20
value = 0
persistent = 0


; Chute
[State 8013, 4]
type = ChangeAnim
trigger1 = P2BodyDist X <= 20 && Anim = 0 && Time = 100
value = 240
persistent = 0

[State 8013, 1]
type = HitDef
trigger1 = AnimElem >= 1
attr = S,SP
animtype = Hard
damage  = 0,0
getpower = 30
givepower = 30
hitflag = MAF
guardflag = MF
hitsound = S1, 10
sparkno = -1
sparkxy = 0,0
pausetime = 0, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
air.animtype = Back
ground.velocity = 0, 0
air.velocity = 0, 0
p2stateno = 60010

; Crack!
[State 8013, 4]
type = PlaySnd
trigger1 = Anim = 240 && AnimElem = 3
value = 0,3
volume = 150
persistent = 0

; Tanananam!
[State 8013, 4]
type = PlaySnd
trigger1 = Anim = 0 && AnimElem = 1
value = 4,0
volume = 255
persistent = 0

; Tela treme
[State 8012, 4]
type = EnvShake
trigger1 = Anim = 240 && AnimElem = 3
freq = 80
ampl = 2
time = 60
persistent = 1
ignorehitpause = 1

; Tela clareia
[State 8013, 4]
type = EnvColor
trigger1 = Anim = 240 && AnimElem = 3
add = 255,255,255
mul = 255,255,255
time = 3
persistent = 1
ignorehitpause = 1

; Fundos somem
[state 8013, 3]
type = AssertSpecial
trigger1 = Anim = 0
trigger2 = Anim = 240
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1


; Helper
[State 8501, Corpo]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8016) = 0
ID = 8016
pos = 0,0
postype = p2
stateno = 8016
helpertype = normal
name = "GeloQuebrando"
keyctrl = 0
ownpal = 1

; Helper 001
[State 8501, Gelo001]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8018) = 0
ID = 8018
pos = 0,-90
postype = p2
stateno = 8018
helpertype = normal
name = "Geloquebrando001"
keyctrl = 0
ownpal = 1

; Helper 002
[State 8501, Gelo002]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8019) = 0
ID = 8019
pos = 0,-90
postype = p2
stateno = 8019
helpertype = normal
name = "Geloquebrando002"
keyctrl = 0
ownpal = 1

; Helper 003
[State 8501, Gelo003]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8020) = 0
ID = 8020
pos = 0,-90
postype = p2
stateno = 8020
helpertype = normal
name = "Geloquebrando003"
keyctrl = 0
ownpal = 1

; Standing pós-fatal
[State 8013, 4]
type = ChangeState
trigger1 = Anim = 240 && AnimTime = 0
value = 0
ctrl = 1

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

; Standing intermediário 2
[Statedef 8014]
type = S
physics = S
sprpriority = 0

[State 8014, 4]
type = ChangeAnim
trigger1 = time = 0
value = (anim)
persistent = 0

[State 8014, 3] 
type = VelSet
trigger1 = Abs(Vel x) < 2
trigger2 = Time = 4
x = 0
y = 0

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

; Fatal freeze

[Statedef 8015]
type = S
movetype = A
poweradd = 0
physics = N
juggle = 0
ctrl = 0
anim = 1005
sprpriority = 5

[State 9000, 2]
type = PlaySnd
trigger1 = Time = 1
value = 1,8

[State 1002, Assertspecial]
type = Assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1002, 2]
type = VelSet
trigger1 = 1
x = 6

[State 1002, 1]
type = HitDef
trigger1 = AnimElem >= 1
attr = S,SP
animtype = Hard
damage  = 0,0
getpower = 30
givepower = 30
hitflag = MAF
guardflag = MF
hitsound = S1, 10
sparkno = S7015
guard.sparkno = s7015
sparkxy = 0,-50
pausetime = 0, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
air.animtype = Back
ground.velocity = 0, 0
air.velocity = 0, 0
p2stateno = 60000


[State 1002, ChangeState]
type = DestroySelf
trigger1 = movecontact 

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

; Helper gelo quebrando

[Statedef 8016]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7750
sprpriority = 9999

[State 8701, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay

[State 8001, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1

; Helper
[State 8016, Fatality LT]
type = Helper
trigger1 = Time >= 80
trigger1 = NumHelper(8017) = 0
ID = 8017
pos = 160,-170
postype = Left
stateno = 8017
helpertype = normal
name = "Fatality"
keyctrl = 0
ownpal = 1

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

; Fatality LT

[Statedef 8017]
type = S
movetype = A
physics = N
anim = 7502
velset = 0,0
ctrl = 1
sprpriority = 9999

[State 8017, SND]
type = PlaySnd
trigger1 = Time = 230
value = 3,9
volume = 255

[State 8017, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1

[state 8017, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

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

; Helper gelo quebrando

[Statedef 8018]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 8010
sprpriority = 9999

[State 8018, vs1]
type = VelSet
trigger1 = Time > 5
x = -1.5
y = -4.0

[State 8018, vs2]
type = VelSet
trigger1 = Time > 20
x = -0.8
y = 4.5

[State 8018, Spark]
type = Explod
trigger1 = Time = 52
anim = 8011
pos = 0,0
postype = p1
sprpriority = 999

[State 8018, ChangeState]
type = DestroySelf
trigger1 = time = 52


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

; Helper gelo quebrando 001

[Statedef 8019]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 8010
sprpriority = 9999

[State 8019, vs1]
type = VelSet
trigger1 = Time > 5
x = 1.5
y = -4.0

[State 8019, vs2]
type = VelSet
trigger1 = Time > 20
x = 0.8
y = 4.5

[State 8019, Spark]
type = Explod
trigger1 = Time = 52
anim = 8011
pos = 0,0
postype = p1
sprpriority = 999

[State 8019, ChangeState]
type = DestroySelf
trigger1 = time = 52


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

; Helper gelo quebrando 002 

[Statedef 8020]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 8010
sprpriority = 9999

[State 8020, vs1]
type = VelSet
trigger1 = Time > 5
x = 0.1
y = -5.5

[State 8020, vs1]
type = VelSet
trigger1 = Time > 40
x = 0.2
y = 5.5

[State 8020, Spark]
type = Explod
trigger1 = Time = 91
anim = 8011
pos = 0,0
postype = p1
sprpriority = 999

[State 8020, ChangeState]
type = DestroySelf
trigger1 = time = 91



;====================
; P2 Custom Stats   *
;====================

[Statedef 60000]
movetype= H
velset = 0,0
ctrl = 0

[State 60000, 3]
type = PosFreeze
trigger1 = 1
trigger1 = time > 1
value = 1

[State 60000, 2]
type = changeanim
trigger1 = 1
value = (anim)
elem = (animelemno(0))

[State 001, 3]
type = PalFX
trigger1 = time != 0
add = 0,156,198
mul = 13,179,199
time = 1

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

; Inimigo desce
[Statedef 60010]
type    = S
movetype= H
physics = S
juggle  = 2
ctrl = 0
velset = 0,0

; ZUUUUUUUM!
[State 60010, 2]
type = PosSet
trigger1 = time = 0
y = 9999

[State 50040, 4]
type = LifeSet
trigger1 = time = 0
value = 0

[State 60010, 2]
type = SelfState
trigger1 = life = 0
value = 5150


;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;---------------------------------
;           PIT SHALLOW          :
;---------------------------------

;(O Gancho)

[Statedef 8050]
type = S
movetype = A
physics = N
poweradd = 100
velset = 0,0
ctrl = 0
anim = 10

[State 8050, 2]
type = ChangeAnim
trigger1 = Anim = 10 && AnimElem = 2
value = 410

[State 8055, 2]
type = HitDef
trigger1 = Anim = 410 && AnimElem = 4
attr = C, NA
damage    = 0,0
animtype  = Hard
hitflag = MAF
guardflag = M
pausetime = 5,0
sparkno = S7760
sparkxy = -10,-55
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -0.8,-30
air.velocity = -0.8,-30
p2stateno = 50030 

[state 8050, E]
type = bgPalFx
trigger1 = Time = 1
add = 0,0,0
mul = 256,256,256
sinadd = -155,-155,-155,300
time = 200

[state 8050, E1]
type = bgPalFx
trigger1 = Time >= 100
add = -155,-155,-155
time = 99999999


[State 8050, SND] 
type = PlaySnd
trigger1 = time = 1
value = 4,0
volume = 255

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

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

;( Andando para Tras )

[Statedef 8051]
type = S
movetype = A
physics = N
poweradd = 100
velset = 0,0
ctrl = 0 
Anim = 21

[state 8050, E1]
type = bgPalFx
trigger1 = Time >= 0
add = -155,-155,-155
time = 99999999

[State 8500, 4]
type = VelSet
trigger1 = time >= 0
x = -2.0
y = 0

[State 8051, 2]
type = ChangeState
trigger1 = animtime = 0
value = 8052

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

;(lançando o Projetil )


[Statedef 8052]
type = S
movetype = A
physics = N
poweradd = 100
velset = 0,0
ctrl = 0 
Anim = 2500

[state 8051, E1]
type = bgPalFx
trigger1 = Time >= 1
add = -155,-155,-155
time = 99999999


[State 8051, Explod]
type = Explod
trigger1 = AnimTime = 12
anim = 7004
pos = 0,0
postype = P1
supermovetime = -1
facing = 1
sprpriority = 3
removeongethit = 1

[State 8051, Helper]
type = Helper
trigger1 = AnimTime = 12
helpertype = Normal
postype = p1
pos = 0,0
stateno = 8053
ownpal = 1
keyctrl = 0

[State 8051, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = Normal
postype = p1
pos = 0,0
stateno = 8054
Id = 8054
name = "PitGelo"
ownpal = 1
keyctrl = 0
sprpriority = -5

[State 8050, 2]
type = ChangeAnim
trigger1 = Time = 23
value = 0

[State 8050, 2]
type = ChangeState
trigger1 = Time = 60
value = 0
ctrl = 1

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

;( O Projetil )

[Statedef 8053]
type = S
movetype = A
poweradd = 0
physics = N
juggle = 0
ctrl = 0
anim = 2550
sprpriority = 1

[State 8053, DS]
type = DestroySelf
trigger1 = Time = 20

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

;( Chão Congelado )

[Statedef 8054]
type = S
movetype = A
poweradd = 0
physics = N
juggle = 0
ctrl = 0
anim = 7506

[State 8054, 2]
type = HitDef
trigger1 = 1
attr = C, NA
damage = 0,0
animtype  = Hard
hitflag = MAF
guardflag = M
pausetime = 0,0
sparkano = -1
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
p2stateno = 50031

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

[State 8054, 3]
type = Sprpriority
trigger1 = movehit
value = -9999

[State 8051, Helper]
type = Helper
trigger1 = Movehit
helpertype = Normal
postype = p1
pos = 0,0
stateno = 8055
Id = 8055
name = "PitGeloquebrando"
ownpal = 1
keyctrl = 0
sprpriority = -5

[State 8053, DS]
type = DestroySelf
trigger1 = Movehit

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

;( Chão Quebrando )

[Statedef 8055]
type = S
movetype = A
poweradd = 0
physics = N
juggle = 0
ctrl = 0
anim = 7505

[State 8055, Assertspecial]
type = Assertspecial
trigger1 = Time > 0
flag = noshadow
flag1 = nobardisplay
ignorehitpause = 1

[State 8055, 3]
type = Sprpriority
trigger1 = movehit
value = -9999

; Helper
[State 8016, Fatality LT]
type = Helper
trigger1 = Time >= 80
trigger1 = NumHelper(8017) = 0
ID = 8017
pos = 160,-170
postype = Left
stateno = 8017
helpertype = normal
name = "Fatality"
keyctrl = 0
ownpal = 1

;====================
; P2 Custom States  *
;====================

[Statedef 50030]
type    = S
movetype= H
physics = S
juggle  = 1
velset = 0,0
ctrl = 0

;Sem sombra

[state 50030, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

;Câmera não acompanha P2 saindo da tela.

[State 50030, 2]
type = ScreenBound
trigger1 = Time >= 0
value = 0
movecamera = 0

;Levando Pancada - animação de P2 ao ser acertado.

[State 50030, 3]
type =  ChangeAnim 
trigger1 = time >= 0
value = 5030 

;Velocidade - quando P2 está saindo da tela. 

[State 50030, 4]
type = VelAdd
trigger1 = time <= 32
y = -0.6
x = 0

;Velocidade - P2 aparece novamente na tela.

[State 50030, 5]
type = VelAdd
trigger1 = time >= 31
y = 0.4
x = 0

;Volta ao seu próprio CNS quando Pos Y = 1500

[State 50030, 9]
type = SelfState
trigger1 = Pos Y = 1500
value = 5150

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

[Statedef 50031]
type    = S
movetype= H
physics = S
juggle  = 1
velset = 0,0
ctrl = 0

;Sem sombra

[state 50031, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow
flag1 = nobardisplay

;Câmera não acompanha P2 saindo da tela.

[State 50031, 2]
type = ScreenBound
trigger1 = Time >= 0
value = 0
movecamera = 0

;Vida vai a zero em um determinado momento da queda.

[State 50031, 6]
type = LifeSet
trigger1 = time > 0
value = 0

[State 50031, some]
type = PosSet
trigger1 = 1
y = 9999

[State 50030, 9]
type = SelfState
trigger1 = Life = 0
value = 5150

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;---------------------------------
;            ANIMALITY           :
;---------------------------------

; Inicio

[Statedef 8500]
type = S
movetype = A
physics = S
juggle  = 2
ctrl = 0
velset = 0,0,0
Anim = 20

[State 8500, 4]
type = VelSet
trigger1 = time >= 0
trigger1 = P2BodyDist X > 10
x = 2.4
y = 0

[State 8500, 4]
type = VelSet
trigger1 = P2BodyDist X <= 10
x = 0
y = 0

; Andando
[State 8500, 4]
type = ChangeAnim
trigger1 = P2BodyDist X > 10
value = 20
persistent = 0

; Abaixando
[State 8012, 4]
type = ChangeAnim
trigger1 = P2BodyDist X < 60
value = 10
persistent = 0

; Abaixado
[State 8012, 4]
type = ChangeAnim
trigger1 = Anim = 10 && AnimElem = 2
value = 11
persistent = 0

[State 8500, 4]
type = ChangeState
trigger1 = P2BodyDist X  < 95
value = 8501

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

; Virando urso Polar

[Statedef 8501]
type = S
movetype = A
physics = S
juggle  = 2
ctrl = 0
velset = 0,0,0
Anim = 7600

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


[State 8501, SP]
type = SuperPause
trigger1 = AnimElem = 9
sound = S4,0
darken = 0
Time = 10
Anim = -1


[state 8005, Escuridão media]
type = bgPalFx
trigger1 = Time = 1
add = 0,0,0
mul = 256,256,256
sinadd = -155,-155,-155,300
time = 200

[state 8005, Escuridão media]
type = bgPalFx
trigger1 = Time >= 100
add = -155,-155,-155
time = 99999999

[State 8551, sem A]
type = AssertSpecial
trigger1 = AnimElem = 10
flag = NoBarDisplay



; Helper
[State 8501, Corpo]
type = Helper
trigger1 = AnimElem = 13
trigger1 = NumHelper(8502) = 0
ID = 8502
pos = 0,10
postype = p2
stateno = 8502
helpertype = normal
name = "Corpodestroçado"
keyctrl = 0
ownpal = 1

; Tela treme
[State 8501, ]
type = EnvShake
trigger1 = AnimElem = 13
freq = 80
ampl = 2
time = 60
persistent = 1
ignorehitpause = 1


[State 8501, 2]
type = HitDef
trigger1 = AnimElem = 13
attr = S, NA
damage    = 9999,0
getpower = 0,0
givepower = 0,0
animtype = Hard
air.animtype = Back
air.fall = 1
hitflag = MAF
guardflag = MA
pausetime = 10,0
sparkno = S7762
sparkxy = -10,-75
guard.sparkno = -1
hitsound   = s2,9
guardsound = 6,0
ground.type = High
ground.slidetime = 0
ground.hittime  = 0
ground.velocity = 0
air.velocity = 0
air.juggle = 0
p2stateno = 007

[State 410, Helper]
type = Helper
triggerall = NumHelper(411) = 0
trigger1 = AnimElem = 13
helpertype = Normal
ID = 411
name = "Sangue003"
postype = p2
pos = 0,-110
stateno = 411
ownpal = 1
keyctrl = 0

; Crack!
[State 8012, 4]
type = PlaySnd
trigger1 = AnimElem = 13
value = 0,3
volume = 150
persistent = 0

; Tanananam!
[State 8012, 4]
type = PlaySnd
trigger1 = AnimElem = 9
value = 4,4
volume = 255
persistent = 0


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

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

[Statedef 8502]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7503
sprpriority = 9999

[State 8551, sem A]
type = AssertSpecial
trigger1 = time >= 0
flag = nobardisplay

; Helper
[State 8502, Corpo]
type = Helper
trigger1 = Time >= 80
trigger1 = NumHelper(8503) = 0
ID = 8503
pos = 160,-150
postype = Left
stateno = 8503
helpertype = normal
name = "Animality"
keyctrl = 0
ownpal = 1

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

[Statedef 8503]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7504
sprpriority = 9999

[State 8551, sem A]
type = AssertSpecial
trigger1 = time >= 0
flag = nobardisplay

[state 8005, Escuridão media]
type = bgPalFx
trigger1 = Time >= 100
add = -155,-155,-155
time = 99999999

; animality
[State 8503, snd]
type = PlaySnd
trigger1 = AnimTime = 250
value = 5,2
volume = 255


;====================
; P2 Custom Stats   *
;====================

;---------------------
; Inimigo desce
[Statedef 007]
type    = S
movetype= H
physics = S
juggle  = 2
ctrl = 0
velset = 0,0


[State 007, 2]
type = PosSet
trigger1 = time = 0
y = 9999

[State 007, 2]
type = LifeSet
trigger1 = enemy(0), stateno = 8014
value = 0

[State 007, 2]
type = SelfState
trigger1 = life = 0
value = 5150


;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;---------------------------------
;            BRUTALITY           :
;---------------------------------

[Statedef 8550]
type    = S
movetype= A
physics = S
juggle  = 1
anim = 100  
velset = 0,0
ctrl = 0


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

[State 8550, sem A]
type = AssertSpecial
trigger1 = time >= 1
flag = nobardisplay

[State 8550, 2] 
type = AssertSpecial
trigger1 = 1
flag = NoWalk


[State 8550, 3] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 8550, 5]
type = ChangeState
trigger1 = P2BodyDist X <= 15
value = 8551
ctrl = 0

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

[Statedef 8551]
type    = S
movetype= A
physics = S
juggle  = 1
anim = 7510 
velset = 0,0
ctrl = 0

[State 8551, sem A]
type = AssertSpecial
trigger1 = time >= 0
flag = nobardisplay

[State 8551, 1]
type = Helper
trigger1 = AnimElem = 87
trigger1 = NumHelper(8552) = 0 
ID = 8552
pos = 0,13
postype = P2
facing = 1
stateno = 8552
helpertype = normal
name = "P2destroçado"
keyctrl = 0
sprpriority >= -2

[State 8551, 16]
type = Explod
trigger1 = AnimElem = 87
trigger1 = NumExplod(7760) = 0 
anim = 7760
pos = 40,-70
postype = p1
facing = 1
ontop = 1
bindtime = 9999
sprpriority >= -2


[state 8005, Escuridão media]
type = bgPalFx
trigger1 = AnimElem = 50
add = 0,0,0
mul = 256,256,256
sinadd = -155,-155,-155,300
time = 200

[state 8005, Escuridão media]
type = bgPalFx
trigger1 = AnimElem = 70
add = -155,-155,-155
time = 99999999


[State 8551, 3]
type = PlaySnd
triggerall = p2bodydist X <= 16 
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 15
trigger6 = AnimElem = 18
trigger7 = AnimElem = 20
trigger8 = AnimElem = 24
trigger9 = AnimElem = 28
trigger10 = AnimElem = 32
trigger11 = AnimElem = 36
trigger12 = AnimElem = 41
trigger13 = AnimElem = 43
trigger14 = AnimElem = 48
trigger15 = AnimElem = 51
trigger16 = AnimElem = 55
trigger17 = AnimElem = 58
trigger18 = AnimElem = 60
trigger19 = AnimElem = 64
trigger20 = AnimElem = 69
trigger21 = AnimElem = 71
trigger22 = AnimElem = 76
trigger23 = AnimElem = 79
trigger24 = AnimElem = 82
value = 0,0

[State 8551, 16]
type = Explod
triggerall = p2bodydist X <= 16 
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 15
trigger6 = AnimElem = 18
trigger7 = AnimElem = 20
trigger8 = AnimElem = 24
trigger9 = AnimElem = 28
trigger10 = AnimElem = 32
trigger11 = AnimElem = 36
trigger12 = AnimElem = 41
trigger13 = AnimElem = 43
trigger14 = AnimElem = 48
trigger15 = AnimElem = 51
trigger16 = AnimElem = 55
trigger17 = AnimElem = 58
trigger18 = AnimElem = 60
trigger19 = AnimElem = 64
trigger20 = AnimElem = 69
trigger21 = AnimElem = 71
trigger22 = AnimElem = 76
trigger23 = AnimElem = 79
trigger24 = AnimElem = 82
anim = 7005
pos = 60,-70
postype = p1
facing = 1
ontop = 1
bindtime = 9999
sprpriority >= -2

[State 8551, EnvShake]
type = EnvShake
triggerall = p2bodydist X <= 16
trigger1 = AnimElem = 87
time = 50

; Crack!
[State 8551, 4]
type = PlaySnd
trigger1 = AnimElem = 87
value = 0,3
volume = 150
persistent = 0

; Tanananam!
[State 8551, 4]
type = PlaySnd
trigger1 = AnimElem = 70
value = 4,4
volume = 255
persistent = 0

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

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

[Statedef 8552]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
anim = 7503
ctrl = 0

[State 8550, sem A]
type = AssertSpecial
trigger1 = time >= 0
flag = nobardisplay

[State 8552, LT]
type = Helper
trigger1 = Time = 150
trigger1 = NumHelper(8553) = 0 
ID = 8553
pos = 155,-170
postype = Left
stateno = 8553
helpertype = normal
name = "brutalityLT" 
keyctrl = 0

[State 8552, 2]
type = Destroyself
trigger1 = AnimTime = 0

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


[Statedef 8553]
type = S
movetype = A
physics = N
anim = 9211
velset = 0,0
ctrl = 1
sprpriority = 9999

[State 8553, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay

[State 8553, 4]
type = PlaySnd
trigger1 = Time = 160
value = 4,3
volume = 255


[state 8553, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow


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

;====================
; P2 Custom States  *
;====================


[Statedef 50005]
type    = S
movetype= H
physics = S
juggle  = 1
velset = 0,0
ctrl = 0

;Ocorrerá um sorteio entre as animações 5000 e 5001.
;O sorteio será feito a cada 12 ticks para não ficar muito rápido 

[State 50005, 1]
type = VarRandom 
trigger1 = (GameTime%6)=0
trigger1 = time >= 3
v = 10
range = 1,2

;Apanhando

[State 50005, 2]
type = ChangeAnim 
trigger1 = var(10) = 1
trigger1 = Time >= 3
value = 5000

;Apanhando - 2
[State 50005, 3]
type = ChangeAnim 
trigger1 = var(10) = 2
trigger1 = Time >= 3
value = 5010

;Vida vai a zero quando chegar a um determinado tempo.

[State 50005, 4]
type = LifeSet
trigger1 = time = 279
value = 0

;Muda de posição e uma outra animação pode surgir no local.

[State 50005, 5]
type = PosSet
trigger1 = Time = 267 ;Helper aparecerá no mesmo momento.
y = 1500

;Volta ao seu próprio CNS

[State 50005, 6]
type = SelfState
trigger1 = Time >= 300 
value = 5150

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

;---------------------------------
;             BABALITY           :
;---------------------------------

;(Inicio)

[Statedef 8600]
type = S
movetype = A
physics = N
velset = 0,0
ctrl = 0
anim = 0

[State 8600, sem A]
type = AssertSpecial
trigger1 = Time > 11
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1

[State 8600, sem S]
type = AssertSpecial
trigger1 = Time > 0
flag = nomusic

[State 8600, 1]
type = Helper
trigger1 = Time = 15
trigger1 = NumHelper(8601) = 0 
ID = 8601
pos = 0,0
postype = p2
stateno = 8601
helpertype = normal
name = "Fumaça" 
keyctrl = 0

[State 8600, SP]
type = SuperPause
trigger1 = Time = 10
sound = S4,0
darken = 1
Time = 50
Anim = -1

[State 8600, 3]
type = ChangeState
trigger1 = time = 320
value = 0
ctrl = 1

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

; ( Fumaça )

[Statedef 8601]
type = S
movetype = A
physics = S
anim = 7507
velset = 0,0
ctrl = 1
sprpriority = 999

[State 8601, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay
flag2 = noFG
flag3 = noBG

[State 8601, 1]
type = HitDef
trigger1 = 1
trigger1 = P2StateType != A
attr = S, SA
damage = 0, 0
animtype = Heavy
hitflag = MFA
guardflag = A 
priority = 7
pausetime = 0,3
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
fall = 0
numhits = 0
p2stateno = 60040

[State 8601, 2]
type = Helper
trigger1 = MoveHit
trigger1 = NumHelper(8602) = 0 
ID = 8602
pos = 0,0
postype = p2
stateno = 8602
helpertype = normal
name = "bebe" 
keyctrl = 0

[state 8601, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 8601, 3]
type = Destroyself
trigger1 = AnimTime = 0 

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

[Statedef 8602]
type = S
movetype = A
physics = N
anim = 9250
velset = 0,0
ctrl = 1
sprpriority = -999


[State 8603, 1]
type = Helper
trigger1 = Time = 150
trigger1 = NumHelper(8603) = 0 
ID = 8603
pos = 155,-170
postype = Left
stateno = 8603
helpertype = normal
name = "babalityLT" 
keyctrl = 0

[State 8602, som1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 6,0

[State 8602, som2]
type = PlaySnd
trigger1 = Time = 100 
value = 6,1

[State 8602, som3]
type = PlaySnd
trigger1 = Time = 500
value = 4,2

[state 8602, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow
flag1 = nobardisplay
;-----------------------------------------------


[Statedef 8603]
type = S
movetype = A
physics = N
anim = 9205
velset = 0,0
ctrl = 1
sprpriority = 9999

[State 8701, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay

[state 8602, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow


;====================
; P2 Custom States  *
;====================

[Statedef 60040]
type    = S
movetype= H
physics = S
juggle  = 2
ctrl = 0
velset = 0,0

[State 60040, 2]
type = PosSet
trigger1 = time = 0
y = 9999

[State 60040, 4]
type = LifeSet
trigger1 = time = 160
value = 0

[State 60040, 2]
type = SelfState
trigger1 = life = 0
value = 5150

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



;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


;---------------------------------
;           FRIENDSHIP           :
;---------------------------------

;(Inicio)

[Statedef 8700]
type = S
movetype = A
physics = N
velset = 0,0
ctrl = 0
anim = 0

[State 8700, sem A]
type = AssertSpecial
trigger1 = Time > 11
flag = nobardisplay
flag2 = noFG
flag3 = noBG
ignorehitpause = 1

[State 8700, sem S]
type = AssertSpecial
trigger1 = Time > 0
flag = nomusic

[State 8700, 1]
type = Helper
trigger1 = Time = 10
trigger1 = NumHelper(8701) = 0 
ID = 8701
pos = 0,-250
postype = p2
stateno = 8701
helpertype = normal
name = "Bola de gelo" 
keyctrl = 0

[State 8700, SP]
type = SuperPause
trigger1 = Time = 10
sound = S4,0
darken = 1
Time = 50
Anim = -1

[State 8700, 3]
type = ChangeState
trigger1 = time = 250
value = 0
ctrl = 1

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

[Statedef 8701]
type = S
movetype = A
physics = S
anim = 7700
velset = 0,0
ctrl = 1
sprpriority = 999

[State 8701, 5]
type = VelAdd
trigger1 = 1
y = 0.4
x = 0

[State 8701, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay
flag2 = noFG
flag3 = noBG

[State 8701, 1]
type = HitDef
trigger1 = 1
trigger1 = P2StateType != A
attr = S, SA
damage = 0, 0
animtype = Heavy
hitflag = MFA
guardflag = A 
priority = 7
pausetime = 0,3
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
fall = 0
numhits = 0
p2stateno = 60050

[state 8701, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 8701, 2]
type = Helper
trigger1 = Movehit
trigger1 = NumHelper(8702) = 0 
ID = 8702
pos = 0,0
postype = p2
stateno = 8702
helpertype = normal
name = "bola Quebrando" 
keyctrl = 0

[State 8701, 2]
type = Helper
trigger1 = MoveHit
trigger1 = NumHelper(8703) = 0 
ID = 8703
size.yscale = 0.8
size.xscale = 0.8
pos = 0,0
postype = p2
stateno = 8703
helpertype = normal
name = "Boneco de neve" 
keyctrl = 0

[State 8701, 3]
type = Destroyself
trigger1 = Movehit

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

[Statedef 8702]
type = S
movetype = A
physics = S
anim = 7701
velset = 0,0
ctrl = 1
sprpriority = 999

[State 8701, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay

[State 8702, 3]
type = Destroyself
trigger1 = AnimTime = 0 
;-----------------------------------

[Statedef 8703]
type = S
movetype = A
physics = S
anim = 7650
velset = 0,0
ctrl = 1
sprpriority = 999

[State 8703, sem A]
type = AssertSpecial
trigger1 = Time > 0
flag = nobardisplay

[State 8002, SND]
type = PlaySnd
trigger1 = time = 150 
value = 4,5
volume = 255

[State 8703, 1]
type = Helper
trigger1 = Time = 150
trigger1 = NumHelper(8704) = 0 
ID = 8704
pos = 155,-170
postype = Left
stateno = 8704
helpertype = normal
name = "FriendshipLT" 
keyctrl = 0

[State 8704, friendship snd]
type = PlaySnd
trigger1 = Time = 490
value = 4,1
volume = 255

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


[Statedef 8704]
type = S
movetype = A
physics = N
anim = 9210
velset = 0,0
ctrl = 1
sprpriority = 9999

[state 8704, 2]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow


;====================
; P2 Custom States  *
;====================


[Statedef 60050]
type    = S
movetype= H
physics = S
juggle  = 2
ctrl = 0
velset = 0,0

[State 60050, 2]
type = PosSet
trigger1 = time = 0
y = 9999

[State 60050, 4]
type = LifeSet
trigger1 = time = 200
value = 0

[State 60050, 2]
type = SelfState
trigger1 = life = 0
value = 5150
