
;Combos
[Statedef 2001]
type    = S
movetype= A
physics = S
ctrl = 0
;velset = 10,0
sprpriority = 0
facep2 = 1
hitcountpersist =1


[State 0, to BRUTALITY]
type = VarSet
triggerall =!movecontact
trigger1 = anim = 2001 
trigger2 = anim = 2030
v = 31
value = p2stateno = 9010
;1 - finishfimable

;var(31)   для фаталок - 1 значит можно фаталить
;var(32) - Animation
;var(33) - Damage
;var(34) -  ai combo number :
;-------------------------------------------------------------

;xxK		1
;xxakK		2
;zz<		3
;zzzzz<		4

;triggerall = AILevel =[6,8];hard
;================================	

[State 0, stand-normal]
type = VarSet
triggerall = prevstateno!=stateno
triggerall = time = 0 && var(50)=1
trigger1 = p2statetype = S
v = 34
value = 1+random%4


[State 0, sit]
type = VarSet
triggerall = prevstateno!=stateno
triggerall = time = 0 && var(50)=1
trigger1 = p2statetype = C
v = 34
value = ifelse(random>500,3,4)
;// ai combo select end  //


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

[State 0, Kicks]
type = PosAdd
trigger1 = (animelem=3,>0&&animelem=7,<2 )&& anim =2010
trigger2 = (animelem=3,>0&&animelem=5,< 0) && anim =2011
trigger3 = (animelem=3,>0&&animelem=5,< 0) && anim =2012
x = 4









[State 0, knee];первый удаp koleno
type = ChangeAnim
triggerall = anim !=2200;brutality end
triggerall = anim !=[2001,2050] 
trigger1 = time = 0 && var(50)=0
trigger2 = var(34)=[3,4];ai
value = 2030


[State 0, elbow];первый уда ELBOW  или нет анимации в переходе
type = ChangeAnim
triggerall = anim !=2200;brutality end
triggerall = anim !=[2001,2050]
trigger1 = time = 0;  && var(50)=0
trigger2 = var(34)=[1,2];ai
value = 2001




[State 0, Damage]
type = VarSet
triggerall = time = 0
trigger1 = anim = 2001
v = 33
value = 180

[State 0, Damage]
type = VarSet
triggerall = time = 0
trigger1 = anim = 2030
v = 33
value = 140


[State 0, Damage]
type = VarSet
triggerall = time = 0
trigger1 = anim = 2002
trigger2 = anim = 2005
trigger3 = anim = 2003
v = 33
value = 70

[State 0, Damage]
type = VarSet
triggerall = time = 0
trigger1 = anim =  2006
trigger2 = anim =  2010
trigger3 = anim =  2011
trigger4 = anim =  2012
v = 33
value = 30+random%50

[State 0, Damage]
type = VarSet
triggerall = time = 0
trigger1 = anim =  2007
v = 33
value = 80


[State animvar]
type = varset
trigger1 = time = 0
v = 32
value = 0




[State ];fall> /not brutality
type = Hitdef
triggerall=var(31)=0; not brutality
trigger1 = anim =  2003
damage = var(33),var(33)/10
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = 5,0
guardsound = 5,14
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 17
guard.hittime = 15
ground.velocity =  -10,-5
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
ground.cornerpush.veloff =-15
yaccel = .7
air.fall = 1
p2facing = 1
kill       = (Var(9) = 0) 
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
fall = 1
;getpower = ifelse((prevstateno!=stateno),0,-3000),ifelse((prevstateno!=stateno),0,-3000);first hits ne umensh power



[State ];normal hits / not brutality
type = Hitdef
triggerall=var(31)=0; not brutality
trigger1 = anim = 2001
trigger2 = anim = 2002
trigger3 = anim = 2006
 trigger4= anim =[2010,2012]
damage = var(33),20
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
ground.type = high
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound =5,1
guardsound = 5,14
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 20
guard.hittime = 15
ground.velocity = 0, 0
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
guard.velocity = 0
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
air.cornerpush.veloff = -5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = -25
p2facing = 1
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
forcestand = 1
fall = 0 
;getpower = ifelse((prevstateno!=stateno),0,-3000),ifelse((prevstateno!=stateno),0,-3000);first hits ne umensh power

[State ];puzo hits / not brutality
type = Hitdef
triggerall=var(31)=0; not brutality
trigger2 = anim=2005
trigger1 = anim = 2030
damage = var(33),20
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
ground.type = low
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound =5,1
guardsound = 5,14
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 20
guard.hittime = 15
ground.velocity = ifelse(anim=2006,-4,0),  ifelse(anim=2006,-2,0)
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
guard.velocity = 0
yaccel = .5
air.fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
air.cornerpush.veloff = -5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = -25
p2facing = 1
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
forcestand = 1
fall =0
hitonce=1
;getpower = ifelse((prevstateno!=stateno),0,-3000),ifelse((prevstateno!=stateno),0,-3000);first hits ne umensh power


[State Brutality_kill_fatal_Kills]; конечные удары в бруталити - убивает
type = Hitdef
triggerall=var(31)=1; brutality
trigger1 = anim=2003
;p1stateno = ifelse(anim=2034||anim=2042,3300,-1)
;p2stateno = ifelse(anim=2034||anim=2042,3310,-1)
damage = 11110,0
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = 5,0
guardsound = 5,14
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 30
guard.hittime = 15
ground.velocity = -10,-2
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
guard.cornerpush.veloff = 0
p2facing = 1
kill       = 1
fall.kill  = 1
guard.kill = 0
fall = 1
givepower=0

[State Brutality_end_no_kill]; промежуточные удары в бруталити - не убивают врага
type = Hitdef
triggerall=var(31)=1; brutality
trigger1 = anim =[2001,2002]
trigger2 = anim =[2005,2006]
trigger3 = anim =2030
trigger4 = anim =[2010,2012]
damage = 0,0
pausetime = 2,2
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = 5,0
guardsound = 5,14
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 30
guard.hittime = 15
ground.velocity = -1, 0
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
guard.velocity = -9.5
air.cornerpush.veloff = -5
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
guard.cornerpush.veloff = -25
p2facing = 1
kill       = 0
fall.kill  = 0
guard.kill = 0
fall = 0 ;+ (anim=2002) + (anim=2013)


[State 1, blood]
type = Helper
triggerall =movehit=1 
trigger1 = anim=2006
trigger2 = anim=[2010,2012]
stateno = 30
pos = 0, 0
postype = p1
facing = 1

[State 2, Roundhouseblood]
type = Helper
triggerall =movehit=1 
trigger1 = anim=2003
ID = 29
stateno = 29
pos = 0, 0
postype = p1
persistent = 0
ignorehitpause = 1



;[State 0, Power bloker]
;type = RemoveExplod
;trigger1 = numexplod(7080)=0
;trigger1 = time = 0 
;;trigger1 = anim!=2001;begin hits
;;trigger1 = anim!=2030;;begin hits:
;trigger1 = prevstateno!=stateno; не в первом ударе
;ID = 7080
;ignorehitpause = 1
;;persistent = 

;[State 0, Power bloker]
;type = PowerSet
;trigger1 = time = 0 
;trigger1 = prevstateno=stateno; не в первом ударе
;value = 0
;
;[State 8000, Power bloker]
;type = Explod
;trigger1 = numexplod(7080)=0
;trigger1 = time = 0 
;anim = 888
;pos = 0,0
;postype = p1
;ID = 7080
;removetime = 100
;ignorehitpause = 1





;[State var]
;type = targetstate
;trigger1 = movecontact && win
;triggerall = anim!=2003&& anim !=[2031,2032]
;value = 21299 
;persistent = 0

[State var]
type = targetvelset
trigger1 = movehit && target,stateno = [5000,5012]
triggerall = anim != 2001 && anim != [2010,2013]
x = -1

[State var]
type = targetvelset
trigger1 = moveguarded = [2,13]
trigger1 = target,stateno = [150,159]
x = -4

[State var]
type = targetvelset
trigger1 = !movecontact && target,statetype != A
x = 0





[State ]
type = posset
trigger1 = time = 0 || prevstateno = 601 || prevstateno = 611
y = var(57)

;sigue ke te sigue
[State 1610, 1]
type = PosAdd
triggerall = time = 0 && (prevstateno = 601 || prevstateno = 611)
trigger1 = P2bodyDist X > 7
x = p2bodydist x - 7



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


;--------------------anims--------------------

[State xxak<K]
type = varset
triggerall = (anim = 2006||anim = 2012)  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10 &&command = "holdback" 
trigger2 = var(34)=2;ai
trigger3 = var(34)=4;ai
v = 32
value = 2007

[State xxak<K]
type = varset
triggerall = (anim = 2030)  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10 &&command = "holdback" 
trigger2 = var(34)=3;ai
v = 32
value = 2007

[State 0, brutality]
type = ChangeState
triggerall = (anim = 2006)  && time>0 && var(31)=1
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10 &&command != "holdback" 
value =3300
ctrl = 0


[State xX]
type = varset
triggerall = anim = 2001  && time>0
trigger1 = var(50) = 0 && command = "x" && movecontact<10
trigger2 = var(34)=[1,2];ai
v = 32
value = 2002

[State xxA]
type = varset
triggerall = anim = 2002  && time>0
trigger1 = var(50) = 0 && command = "a" && movecontact<10
trigger2 = var(34)=2;ai
v = 32
value = 2005

[State xxaK]
type = varset
triggerall = anim = 2005  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10
trigger2 = var(34)=2;ai
v = 32
value = 2006




[State xxZ]
type = varset
triggerall = anim = 2002  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" )  && movecontact<10
trigger2 = var(34)=1;ai
v = 32
value = 2003

[State kK]
type = varset
triggerall = (anim = 2030)  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10 &&command != "holdback" 
trigger2 = var(34)=4;ai
v = 32
value = 2010

[State kkK]
type = varset
triggerall = anim = 2010  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10
trigger2 = var(34)=4;ai
v = 32
value = 2011

[State kkkK]
type = varset
triggerall = anim = 2011  && time>0
trigger1 = var(50) = 0 && (command = "b" ||command = "y" ) && movecontact<10
trigger2 = var(34)=4;ai
v = 32
value = 2012


[State 0, brutality ender]
type = Helper
trigger1=var(31)=1
trigger1=movecontact>15
trigger1 = numhelper(2002)=0
triggerall = anim!= 2003 
name = "brutality ender not bloody"
ID = 2002
stateno = 2002
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, <kik]
type = ChangeState
trigger1 = var(32)=2007&& movecontact=[6,14]
value =2003
ctrl = 0
;anim =
;ignorehitpause = 
;persistent = 


[State super]
type = changestate
trigger1 = var(32) > 0 && var (32)<2000 && movecontact=[6,14]
value = var(32)

[State kombo]
type = changestate
trigger1 = var(32) > 2000  && movecontact=[6,14]
value = stateno
anim = var(32)






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

;brutality helper
[Statedef 2002];-------------------------------------------------------------------;-------------------------------------------------------------------
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim= 2200


[State Brutality!!!]
type = Hitdef
trigger1=1
damage = 111111,111111
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = 0,0
guardsound = 5,14
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 17
guard.hittime = 15
ground.velocity = -1, 0
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
guard.velocity = -9.5
air.cornerpush.veloff = -5
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
guard.cornerpush.veloff = 0
p2facing = 1
kill       = 1
fall.kill  = 1
guard.kill = 1
fall = 1 

[State 0, to BRUTALITY];reset
type = ParentVarSet
trigger1=time=0
v = 31 
value = 0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movecontact
value = 888
;elem = 1
;ignorehitpause = 
;persistent = 


[State 0, DestroySelf]
type = DestroySelf
trigger1 =movecontact
trigger2 =time>10
;ignorehitpause = 
;persistent = 


;jump kik Combos end
[Statedef 2003];=========================================================
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
sprpriority = 0
facep2 = 1
hitcountpersist =1
anim=2007

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =animelem=4
value = F5,153
volumescale = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
;lowpriority = -1
;abspan = 
;ignorehitpause = 
;persistent = 


[State ];fall> /not brutality
type = Hitdef
trigger1=var(31)=0; not brutality
damage = var(33),var(33)/10
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = 5,0
guardsound = 5,14
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 17
guard.hittime = 15
ground.velocity =  ifelse(anim=2004,-2,-13),ifelse(anim=2004,-14,-3)
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
ground.cornerpush.veloff =-15
yaccel = .7
air.fall = 1
p2facing = 1
kill       = (Var(9) = 0) 
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
fall = 1
;getpower = ifelse((prevstateno!=stateno),0,-3000),ifelse((prevstateno!=stateno),0,-3000);first hits ne umensh power



[State Brutality_kill_fatal_Kills]; конечные удары в бруталити - убивает
type = Hitdef
trigger1=var(31)=1; brutality

;p1stateno = ifelse(anim=2034||anim=2042,3300,-1)
;p2stateno = ifelse(anim=2034||anim=2042,3310,-1)
damage = 11110,0
pausetime = 0,0
attr = S,NA
hitflag = MAF
guardflag = M
animtype = light
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = 5,0
guardsound = 5,14
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 30
guard.hittime = 15
ground.velocity = -10,-2
;air.velocity = -3.5+((anim=2002)*-20), -6+((anim=2005)*8)
ground.cornerpush.veloff = 0
yaccel = .5
air.fall = 1
guard.cornerpush.veloff = 0
p2facing = 1
kill       = 1
fall.kill  = 1
guard.kill = 0
fall = 1
givepower=0

[State 1, blood]
type = Helper
trigger1 =movehit=1 
stateno = 30
pos = 0, 0
postype = p1
facing = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=3,=0
statetype = A       ;S,A,C,L
movetype = A        ;I,A,H
physics = N         ;A,C,S,N

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=3,=0
trigger2 = animelem=2,=0
triggerall = anim = 2007
x = 15

[State 0, VelSet]
type = VelSet
trigger1 = animelem=3,=1
triggerall = anim = 2007
x=2

[State 0, VelSet]
type = VelSet
trigger1 = animelem=3,=1
triggerall = anim = 2007
y = -6.5

[State 0, VelSet]
type = VelSet
trigger1 = movecontact=1
x=-1

[State 0, VelSet]
type = VelSet
trigger1 = movecontact=1
y = -2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movecontact=1
value = 2009


[State 0, VelAdd]
type = VelAdd
trigger1 = animelem=2,>0
y = 0.5


[State 0, ChangeState]
type = ChangeState
trigger1  = pos y >=var(57) -10 &&  ((animelem=11,>0 && anim = 2007)||anim=2009)
value =2004
ctrl = 0


;jump kik Combos end
[Statedef 2004];=========================================================
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
sprpriority = 0
hitcountpersist =1
anim=2008

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = var(57)
;ignorehitpause = 
;persistent = 


[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
x = -16




[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value =0
ctrl = 1
;anim =
;ignorehitpause = 
;persistent = 
