
;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 :
;-------------------------------------------------------------

;xxx		1
;xxz		2
;zzz		3
;================================	

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


[State 0, sit]
type = VarSet
triggerall = prevstateno!=stateno
triggerall = time = 0 && var(50)=1
trigger1 = p2statetype = C
v = 34
value = 3



;//---------------------------------- ai combo select end  //



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

;[State 0, PosAdd]
;type = PosAdd
;trigger1 = anim  = 2004
;trigger1 = animelem=2,>0
;trigger1 = animelem=5,<1
;x = 6

[State 0, PosAdd]
type = PosAdd
trigger1 = anim  = 2032
trigger1 = animelem=1,=1
x = 10

[State 0, PosAdd]
type = PosAdd
trigger1 = anim  = 2032
trigger1 = animelem=2,=1
x = 10

[State 0, PosAdd]
type = PosAdd
trigger1 = anim  = 2032
trigger1 = animelem=3,>0
trigger1 = animelem=12,<1
x = 2

[State 0, PosAdd]
type = PosAdd
triggerall = anim  = 2004
trigger1 = animelem=2,=1
trigger2 = animelem=11,=1
x = 10

[State 0, PosAdd]
type = PosAdd
trigger1 = anim  = 2004
trigger1 = animelem=7,>0
trigger1 = animelem=12,<1
x = 9

[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;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, PlaySnd]
type = PlaySnd
trigger1 = time=0 && anim=2004
trigger2 = time=0 && anim=2005
value = 1000,6;F=common snd
volumescale = 100













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

[State 0, Damage]
type = VarSet
triggerall = time = 0
trigger1 = anim = 2002
trigger2 = anim = 2031
trigger3 = anim = 2032
trigger4 = anim = 2004
v = 33
value = 100


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

[State 0, Damage]
type = VarSet
triggerall = time = 0

trigger1 = anim = 2005
v = 33
value = 70

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim= 2003 && animelem=6,=0
value =1000,5;F=common snd
volumescale = 100






[State ];fall> /not brutality
type = Hitdef
triggerall=var(31)=0; not brutality
trigger1 = anim = 2032
trigger2 = anim = 2003
trigger3 = anim = 2004
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 = -11+((anim=2004)*4),-5
air.velocity =  -11+((anim=2004)*8),-4
ground.cornerpush.veloff =-15
yaccel = .7
air.fall = 1
p2facing = 1
kill       = (Var(9) = 0) || var(31)=1
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=2030
trigger4 = anim=2031
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 Brutality_kill_fatal_Kills]; конечные удары в бруталити - убивает
type = Hitdef
triggerall=var(31)=1; brutality
trigger1 = anim=2003
trigger2 = anim=2004
trigger3 = anim=2032
p1stateno = ifelse(anim=2003,3300,-1)
p2stateno = ifelse(anim=2003,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
trigger2 = anim =2002
trigger3 = anim =2030
trigger4 = anim =2031
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
trigger1 =movehit=1 && (anim=2033 ||anim=[2004,2006] )
stateno = 30
pos = 0, 0
postype = p1
facing = 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 xX]
type = varset
triggerall = anim = 2001  && time>0
trigger1 = var(50) = 0 && command = "x" && movecontact<10
trigger2 = var(34)=1;ai
trigger3 = var(34)=2;ai
v = 32
value = 2002

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

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






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

[State zzX]
type = varset
triggerall = anim = 2031 && time>0
trigger1 = var(50) = 0 && (command = "y" || command = "b") && movecontact<10
trigger2 = var(34)=3;ai
v = 32
value = 2004;2032




[State 0, brutality ender]
type = Helper
trigger1=var(31)=1
trigger1=movecontact>15
trigger1 = numhelper(2002)=0
triggerall = anim!= 2003 && anim !=2032&& anim !=2004
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 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 = 

