;   =============================================
;   =                SUB-ZERO CNS               =
;   = ------------------------------------------=


[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 0
IntPersistIndex = 57
FloatPersistIndex = 40

[Size]
xscale = 1.3
yscale = 1.3
ground.back = 15
ground.front = 16
air.back = 12
air.front = 12
height = 60
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = -5, -90
mid.pos = -5, -60
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.4
walk.back = -2.2
run.fwd  = 5.5, 0
run.back = -5.5,-4.5
jump.neu = 0,-10.5
jump.back = -2.55
jump.fwd = 2.5
runjump.back = -2.55,-9.1
runjump.fwd = 4,-9.1
airjump.neu = 0,-9.1
airjump.back = -2.55
airjump.fwd = 2.5

[Movement]
airjump.num = 0
airjump.height = 35
yaccel = .45
stand.friction = .60
crouch.friction = .70



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

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

; Win state decider
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181

; Win Pose 001
;---------------------------------------------------------------------------

; Win Pose basica
[Statedef 181]
type = S
ctrl = 0
;anim = 181 ;<<<<<<<< para poder dejar la animacion de la cabesa tenemos evitar esta animacion asi tendrea que ser en las demas win pose... mira mas abajo..
velset = 0,0

[State 181, anim]
type = changeanim
trigger1 = anim != 6504;<<<<<<<<<<<<< con esto evitmos cambiar el la animacion cuando ya cortamos la cabeza...
trigger1 = time = 0
value = 181

[State 181, Vitoria]
type = PlaySnd
trigger1 = Time = 0
value = 6,2
volume = 255

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

[State 181, 1]
type = AssertSpecial
trigger1 = time = [0,9999]
flag = nomusic

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;-----------------------------------------
; Introduction
[Statedef 190]
type = S
ctrl = 0
Anim = 0
velset = 0,0
sprpriority = 5

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

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

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

[State 190, umm]
type = PlaySnd
trigger1 = AnimElem = 8
value = 0,7
volume = 255

[State 195, 1]
type = CtrlSet
trigger1 = Time = 40
value = 1

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

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

; Stand Light Punch

[Statedef 200]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 200
poweradd = 20
sprpriority = 2

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 50, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = S7761
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 5

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

; Standing strong punch

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 3

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 6

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 70
guardflag = MA
pausetime = 12,12
sparkno = S7765
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5.5
air.velocity = -2.5,-4
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 

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

; Standing light kick

[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 5

[State 230, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 26
guardflag = MA
pausetime = 12,12
sparkno = S7761
sparkxy = -10,-70
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2.5,-3.5
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 


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

; Standing strong kick

[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

[State 240, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 6

[State 240, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = hard
damage    = 60
guardflag = MA
pausetime = 12,12
sparkno = S7765
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 

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

;Crouching light punch

[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 5

[State 400, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 30
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkno = S7761
sparkxy = -10,-42
hitsound   = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 12
ground.velocity = -4
air.velocity = -1.5,-3
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 

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

;Crouching strong punch

[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 1,1

[State 410, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage    = 70
animtype  = Hard
hitflag = MAF
guardflag = M
pausetime = 0,0
sparkno = S7762
sparkxy = -10,-90
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2,-8
air.velocity = -2,-8
fall = 1
fall.recover = 0
down.velocity = 4,0
ID = 66
nochainID = 66
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 

[State 410, Helper]
type = Helper
triggerall = NumHelper(411) = 0
trigger1 = Movehit && Time >=0 && Time <= 20
helpertype = Normal
ID = 411
name = "Sangue003"
postype = p2
pos = 0,-110
stateno = 411
ownpal = 1
keyctrl = 0

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

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

[Statedef 411]
type = S
movetype = A
physics = N
anim = 7763
velset = 0,0
ctrl = 1
sprpriority = -2


[State 8000, Vel]
type = VelSet
trigger1 = anim != 7764
trigger1 = AnimElem = 26
Y = 7

[State 60021, Explod]
type = Explod
Trigger1 = Pos Y >= -100
anim = 7764
postype = p1
pos = 0,-30
ID = 7764
facing = -1
sprpriority = -2

[State 8601, 3]
type = Destroyself
trigger1 = Pos Y >= -100



;Crouching light kick

[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2

[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 5

[State 430, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 30
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = -1
sparkxy = -10,-8
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 20
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 


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

;Crouch Strong Kick

[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 70
ctrl = 0
anim = 440
sprpriority = -99

[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 6

[State 440, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 72
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = S7006
sparkxy = -5,-10
hitsound   = 5,2
guardsound = 6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 


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

;Jump Light Punch

[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd = 11
ctrl = 0
anim = 600
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 5

[State 600, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage    = 30
guardflag = HA
priority = 3
pausetime = 7,8
sparkno = S7761
sparkxy = -10,-45
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -4
air.velocity = -1.3,-3
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 


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

;Jump Strong Punch

[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 70
ctrl = 0
anim = 610
sprpriority = 2

[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 6

[State 610, 3]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage = 80
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S7765
sparkxy = -10,-55
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 


;Jump Light Kick

[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd = 20
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 5

[State 630, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
damage = 26
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = S7761
sparkxy = -5,-35
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 6
ground.velocity = -4
air.velocity = -2,-3
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 


;Jump Strong Kick

[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 640
sprpriority = 2

[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 6

[State 640, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S7765
sparkxy = -10,-40
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,-4
fall = 1
kill = !var(58) || 1*p2stateno = 003 ; evita que o P2 morra antes do Finish Him 

[State 640, Helper]
type = Helper
triggerall = NumHelper(411) = 0
trigger1 = Movehit && Time >=0 && Time <= 20
helpertype = Normal
ID = 411
name = "Sangue003"
postype = p2
pos = 0,-110
stateno = 411
ownpal = 1
keyctrl = 0

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

; THOW


; Arremesso
[Statedef 800]
type = S
movetype= A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

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

[State 800, Definicao de golpe]
type = HitDef
Trigger1 = AnimElem = 1 
attr = S, NT 
hitflag = M 
priority = 7, Miss 
sparkno = -1 
sprpriority = 1 
p1facing = ifelse (BackEdgeDist <= 30, -1, 1)
p2facing = 1 
p1stateno = 801 
p2stateno = 802 
getpower = 50
givepower = 20

[State 800, Invulneravel]
type = NotHitBy 
trigger1 = time >= 0
value = SCA 


[State 800, CS]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

; Arremessando
[Statedef 801]
type = S
movetype= A
physics = N
anim = 801
poweradd = 120

[State 801, Invulneravel]
type = NotHitBy
trigger1 = time >= 0
value = SCA

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

[State 801, Tamanho] 
type = Width
trigger1 = time >= 0
edge = 100,0

[State 801, Bind 1] 
type = TargetBind
trigger1 = AnimElem = 1
pos = 35,0

[State 801, Bind 2]
type = TargetBind
trigger1 = AnimElem = 2
pos = 20,-15

[State 801, Bind 3]
type = TargetBind
trigger1 = AnimElem = 3
pos = -40, -10

[State 801, Bind 3]
type = TargetBind
trigger1 = AnimElem = 4
pos = -55, -30

[State 801, Bind 3]
type = TargetBind
trigger1 = AnimElem = 5
pos = -100, -50

[State 801, TS]
type = TargetState
trigger1 = AnimElem >= 5
value = 821

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

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

[Statedef 802]
type = A
movetype = H 
physics = N
velset = 0,0

[State 802, CA2]
type = ChangeAnim2
Trigger1 = Time = 0
value = 802

[Statedef 821]
type = A
movetype= H
physics = N
velset = 3,-4
poweradd = 60

[State 821, 1] 
type = VelAdd
Trigger1 = 1
x = .2
y = .5 

[State 821, 1] 
type = VelSet
Trigger1 = Pos Y >= 0
x = 0

[State 821, SS]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100 

;----------------------------------------
;               STATES -2               ;
;----------------------------------------

; States -2 Indispensaveis para os fatalitys .

[Statedef -2]

; Essa VAR só será ligada quando um round anterior for vencido.

[State -2, 1] 
type = varset
trigger1 = Win = 1
trigger1 = NumHelper(9010) = 0 ;Helper que tonteia o inimigo. 
v = 58
value = 1

; Quando oponente morre, ela reseta.

[State -2, 2] 
type = varset
trigger1 = Win = 1
trigger1 = NumHelper(9010) = 1
trigger1 = p2life != 0
v = 58
value = 0

; Qaundo oponente estiver com 1 de energia, ele morre com qualquer golpe.

[State -2, 3] 
type = AttackMulSet
triggerall = !Var(58) && p2Life <= 1
trigger1 = RoundNo != 1 && Win = 0 
trigger2 = P2StateNo = 003
value = 9999

; Sem música
[state -2, 4]
type = AssertSpecial
trigger1 = NumHelper(9010) = 1
flag = nomusic

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

; Sem lentidão no K.O.
[State -2, 2]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
ignorehitpause = 1

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

; evita e a msg de F.H. saia da visão .
[State -2, 1]
type = Screenbound
triggerall = P2stateno = 003
triggerall = p2Life = 1
triggerall = NumHelper(9011) = 1
triggerall = RoundNo != 1
trigger1 = time < 70
movecamera = 0,0

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

; Para ter noção de distancia entre P1 e P2 .
[State -2, 4]
type = DisplayToClipBoard
trigger1 = 1
text = "P2BodyDist X %f, P2BodyDist Y %f, Var(58) = %d"
params = P2bodydist x, p2bodydist y, Var(58)


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

[State -2,HitCountAdd]
Type=VarAdd
TriggerAll=EnemyNear,Time=0
Trigger1=MoveHit|ProjHit=1
Trigger2=NumHelper>0
Trigger2=Helper,MoveHit
var(2)=Ifelse(uniqhitcount>hitcount,2,1+(var(2)<0))
IgNoreHitPause=1
[State -1.Hitfinish]
Type=VarSet
Trigger1=var(2)>0&P2MoveType!=H
var(2)=0

[State -2,HitCountAdd]
Type=VarAdd
TriggerAll=EnemyNear,Time=0
Trigger1=MoveHit|ProjHit=1
Trigger2=NumHelper>0
Trigger2=Helper,MoveHit
var(2)=Ifelse(uniqhitcount>hitcount,2,1)
IgNoreHitPause=1
[State -1.Hitfinish]
Type=VarSet
Trigger1=var(2)>0&P2MoveType!=H
var(2)=0


;----------------------------------------
;               STATES -3               ;
;----------------------------------------

[Statedef -3]

;sons do pulo

[State -3, tocando o solo SND]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 
trigger2 = stateno = 106 
value = 0,1

[State -3, Pulo SND]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 40 
trigger2 = stateno = 105 
value = 0,5

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

;Sons Apanhando

[State -3, 19]
type = PlaySnd
triggerall = time = 1
triggerall = Life > 0
triggerall = var(3) = 0
trigger1 = stateno = 5000
channel = 0
value = 1,2

[State -3, 20]
type = PlaySnd
triggerall = time = 1
triggerall = Life > 0
triggerall = var(3) = 1 
trigger1 = stateno = 5010
channel = 0
value = 1,3

[State -3, 20]
type = PlaySnd
triggerall = time = 1
triggerall = Life > 0
triggerall = var(3) = 1 
trigger1 = stateno = [5020,5099]
channel = 0
value = 1,4

[State -3, 21]
type = PlaySnd
trigger1 = time = 1 
trigger1 = Life > 0
trigger1 = stateno = 5030 
channel = 0
value = 1,4

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

;Som correndo

[State -3, 21]
type = PlaySnd
triggerall = time = 1 
trigger1 = stateno = 100 
value = 3,6

