
;JUMPING dropkick    ---------------------------------
[Statedef 630, a-drop]
type    = A
movetype= A
physics = A
juggle  = 2
ctrl = 0
anim = 630
velset= 5,-0



[State 621, adjust]
type = Turn
trigger1 = Time = 0
trigger1 = (P2Dist X < 0) && (P2Dist X > -55)

[State 620, Select]
type = VarRandom
trigger1 = Time = 1
v = 11
range = 11, 12


[State 620, 1.5]
type = Playsnd
trigger1 = Animelem = 2
value = F5,15

[State 620, 145]
type = Playsnd
trigger1 = Animelem = 2
value = 10,11
channel=3

[State 620, 2]
type = HitDef
;trigger1 = time > 0
trigger1 = !movecontact
attr = A, NA
damage    = 200,20
animtype  = Back
hitflag = CMAFD
;;Nothing = 10
guardflag = HL
priority = 7
p2facing = 1
pausetime = 0,0
sparkno = -1
sparkxy = -15,-50
guard.sparkno = -1
hitsound   = 5,1
guardsound = 5,14
ground.type = High
ground.slidetime = 20
guard.ctrltime = 20
ground.hittime  = 20
ground.velocity = -3, -11
air.velocity = -9, -3
;air.hittime  = 45
yaccel = 0.58
;fall = 1
;air.fall = 0
fall.recover = 0
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
p1stateno = 631

[State 620, 4]
type = Changestate
trigger1 = Pos Y >var(57) -10
value = 632
ctrl = 0

[State 620, 4]
type = Changestate
trigger1 = moveguarded
value = 633
ctrl = 0

[State 620, 4]
type = Changestate
trigger1 = Pos Y = var(57)
value = 0
ctrl = 1
;JUMPING dropkick после удара    ---------------------------------
[Statedef 631]
type    = A
movetype= I
physics = A
juggle  = 2
ctrl = 0
anim = 631
velset= -2,-5

[State 620, 4]
type = Changestate
trigger1 = Pos Y > var(57)-20
value = 632
ctrl = 1


;JUMPING dropkick шлепнулись на землю    ---------------------------------
[Statedef 632]
type    = C
movetype= I
physics = N
juggle  = 2
ctrl = 0
anim = 632
velset= 0,0

[State 0, VelSet]
type = VelSet
trigger1 =  time = 1
x = ifelse(prevstateno!=630,-1,1)

[State 5110, EnvShake]
type = EnvShake
trigger1 = animelem = 3, = 1
time = 20
freq = 70
ampl = 4

[State 0, PosSet]
type = PosSet
trigger1 = time = 1
y = var(57)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = F7,0


[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger2 = time = 60
value = 5120
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

;JUMPING dropkick после удара По блоку   ---------------------------------
[Statedef 633]
type    = A
movetype= H
physics = A
juggle  = 2
ctrl = 0
anim = 631
velset= -1,-8

[State 620, 4]
type = Changestate
trigger1 = Pos Y > var(57)-20
value = 632
ctrl = 1

;---------------------------------------------
[Statedef 411, sit z]     ; sit Z
type    = A
movetype= A
physics = C
juggle  = 1
ctrl = 0
anim = 416;414;413

[State 0, vel x]
type =VelSet
trigger1 = animelem = 6, >1
trigger1 = animelem = 18, <0
x = .4;

[State 0, pos Y]
type = PosSet
trigger1 = animelem = 7, =0
y = var(57)-10

[State 0, PosAdd X]
type = PosAdd
trigger1 = animelem = 18, =1
x = 10

[State 0, vel Y]
type =VelSet
trigger1 = animelem = 6, =1
y = -.8;-2

[State 0, vel Y]
type =Veladd
trigger1 = animelem = 9, >1
trigger1 = animelem = 18, <0
y = .1;-2



[State 0, PosSet]
type =PosSet
trigger1 = animelem = 18, >0
y = var(57)



[State 200, Plaay]
type = PlaySnd
trigger1 = time = 1
trigger1 = 1
value = F5, 20

[State 200, Playf]
type = PlaySnd
trigger1 = animelem = 2
value = 3  ,9
channel = 3



[State 430, aired]
type =  HitDef
trigger1 =!MoveContact
trigger1 = p2statetype =A
trigger1 = P2MoveType != H
attr = S, NA
damage    = 200, 30
animtype  = Back
hitflag = AF ;HAF
guardflag = HL
pausetime = 0,0
sparkno = -1
sparkxy = -18,-100
guard.sparkno = -1
hitsound   = 5,0
p2facing = 1
guardsound = 5,14
ground.cornerpush.veloff = -0
ground.type = High
guard.ctrltime = 20
guard.slidetime = 20
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -1.8,-12
air.velocity = -1.8,-13
yaccel = 0.38
envshake.time = 15
envshake.freq = 70
envshake.ampl = 7
fall.recover = 0
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
priority = 6, Miss


[State 430, faling]
type =  HitDef
trigger1 = animelem = 11
trigger1 =!MoveContact
trigger1 = p2statetype = A
trigger1 = P2MoveType = H
attr = S, NA
damage    = 100, 10
animtype  = Back
hitflag = AF ;HAF
guardflag = HL
pausetime = 0,0
sparkno = -1
sparkxy = -18,-100
guard.sparkno = -1
hitsound   = 5,0
p2facing = 1
guardsound = 5,14
ground.cornerpush.veloff = -30
ground.type = High
guard.ctrltime = 20
guard.slidetime = 20
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -10,-8
air.velocity = -1,-8
yaccel = 0.38
envshake.time = 15
envshake.freq = 70
envshake.ampl = 7
fall.recover = 0
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
priority = 6, Miss

[State 430, stand]
type = HitDef
trigger1 = !MoveContact
trigger1 = animelem = 12
trigger1 = p2statetype != A
attr = S, NA
damage    = 150, 10
animtype  = Back
hitflag = HAF ;HAF
guardflag = HL
pausetime = 0,0
sparkno = -1
sparkxy = -18,-100
guard.sparkno = -1
hitsound   = 5,0
p2facing = 1
guardsound = 5,14
ground.cornerpush.veloff = -0
ground.type = High
guard.ctrltime = 20
guard.slidetime = 20
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -.8,-12
air.velocity = -.8,-13
yaccel = 0.38
envshake.time = 15
envshake.freq = 70
envshake.ampl = 7
fall.recover = 0
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
priority = 6, Miss

[State 410, 3]
type = CtrlSet
trigger1 = animtime = 0
value = 1


[State 410, to stang]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 410, to sit]
type = ChangeState
trigger1 = animelem = 27, >0
trigger1 = command = "holddown"
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;JUMPING PUNCH
[Statedef 615]
type    = A
movetype= A
physics = A
juggle  = 1
ctrl = 0
anim = 615

[State 0, VelAdd]
type = Velset
trigger1 =animelem=16,<2
y = .5

[State 0, VelAdd]
type = Velset
trigger1 =animelem=9,<2
x = 2

[State 0, VelAdd]
type = Velset
trigger1 =animelem=9,=3
x = 0

[State 0, VelAdd]
type = Velset
trigger1 =animelem=13,>0 && animelem=16,<0 
x = 2



[State 610, Select]
type = VarRandom
trigger1 = Time = 1
v = 11
range = 11, 12

[State 610, Play]
type = PlaySnd
trigger1 = Time = 1
trigger2 = Animelem = 14
value = F5, 154

[State 620, 145]
type = Playsnd
trigger1 = Animelem = 2
value = 4,15
channel = 3

[State 610, 1.5]
type = turn
trigger1 = time = 0
trigger1 = P2Dist X < -55

[State 610, 2]
type = HitDef
trigger1 =1
attr = A, NA
damage    = 90, 20
air.animtype  = Back
air.hittime  = 55
air.velocity = -.5, -2
yaccel = 0.5
hitflag = MAF
guardflag = HL
priority = 6,miss;-((p2stateno = [600,620])&&enemy,time > time)
pausetime =0,1
hitsound   = 5,103
guardsound = 5,14
p2facing = 1
sparkno = -1
sparkxy = -25,-30
guard.sparkno = -1
forcestand = 1
ground.type = High
ground.slidetime = 12
ground.hittime  = 16
ground.velocity = -1
guard.hittime = 12
fall.recover = 0
hitonce = 1
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
;guard.dist = ifelse(vel x > 0, 80, 60)


[State 201, 347]
type = EnvShake
trigger1 = movecontact
time = 12
freq = 90
ampl = 3 
ignorehitpause = 1
persistent = 0

[State 600, 1.5]
type = targetstate
trigger1 = movecontact = [1,2]
trigger1 = win && target,pos y > var(57) - 20
value = 21299
ignorehitpause = 1
persistent = 0

[State 600, 1.5]
type = targetstate
trigger1 = movecontact && p2stateno = 5020 && enemy,numexplod(118) > 0
trigger1 = target,pos y > var(57) - 5
triggerall = enemy,authorname != "boss"
value = 5005
ignorehitpause = 1
persistent = 0


[State 600, 1.5]
type = targetvelset
trigger1 = moveguarded = [1,12]
x = -2
ignorehitpause = 1



;========================================================

[Statedef 176]; Taunt
type    = S
movetype= I
physics = S
juggle  = 2
velset = 0,0
anim = 176+random%3
ctrl = 0

[State 210, 1.4]
type = Playsnd
trigger1 = Animelem = 2
value = F5,15

[State 240, 1.5]
type = Playsnd
trigger1 = animelem = 3
value = 3  ,9
volume=-40
channel=3

[State 0, LifeAdd]
type = LifeAdd
trigger1 =  time > 0
value = 3
kill = 1
absolute = 0

[State 0, PowerAdd]
type = PowerAdd
trigger1 = 1
value = 10
;ignorehitpause = 
;persistent = 


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




[Statedef 90, groll]; ground ROLL    ----------------------
type    = C
movetype= I
physics = N
juggle  = 2
velset = 2,0
anim = 90
ctrl = 0

[State 210, 1.4]
type = Playsnd
trigger1 = Animelem = 4
value = 10,5



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

[State 0, VelSet]
type = VelSet
trigger1 = animelem=12
x = 2
y = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelem=2,>0 && animelem=22,<0
value = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem=2,=1
x = 20



[State 0, VelSet]
type = VelSet
trigger1 = animelem=21
x = 0
y = 0

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


;------------------------------------------
[Statedef 95, backflip]; ground BACKFLIP
type    = A
movetype= I
physics = N
juggle  = 2
ctrl = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = ifelse(prevstateno=95,96,95)

[State -3, Landing Sound]
type = PlaySnd
trigger1 = animelem = 23,=1
trigger1 = anim = 95
trigger2 = animelem = 22,=1
trigger2 = anim = 96
value = 10,6;F20, 0
volume = -100

[State 210, 1.4]
type = Playsnd
trigger1 = Animelem = 10
value = 10,4

[State 0, VelSet]
type = VelSet
trigger1 = animelem=8,=1
trigger1 = anim = 95
trigger2 = animelem=5,=1
trigger2 = anim = 96
;trigger1 = animelem=20,<0
x = -9

[State 0, VelSet]
type = VelSet
trigger1 = animelem=18,=1
trigger1 = anim = 95
trigger2 = animelem=15,=1
trigger2 = anim = 96
x = 0



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

[State 0, ChangeState]
type = ChangeState
trigger1 = command = "run"
trigger1 = animelem=22,>1
trigger1 = anim = 95
value =  95
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall = command = "holddown"
trigger1 = animelem=26,>1
trigger1 = anim = 95
trigger2 = animelem=22,>1
trigger2 = anim = 96
value =  11
ctrl = 1

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

;                     ломаем летающих
[Statedef 1400, air]
type    = A
movetype= A
physics = A
juggle  = 0
ctrl = 0
anim = 1400

[State 800, 1]
type = HitDef
trigger1 = 1
pausetime = 0,0
attr = A, ST          ;Attributes: Standing, Normal Throw
hitflag = A          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
damage = 0
sparkno = -1          ;No spark
hitsound = 5,14
sprpriority = -1      ;Draw in front of p2
p2facing = -1       ;Force p2 to face KFM
p1stateno = 1401       ;On success, KFM changes to state 810
p2stateno = 1410       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
;fall = 1              ;Force p2 into falling down
fall.recover = 0
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time= 0
value = F5,15
volume = -100



[State 800, 2]
type = ChangeState
Trigger1 = Animtime = 0
value = 0
ctrl = 1


;   ---------------------------------------------
;          ломаем летающих сук - cshvatili i idem vniz
[Statedef 1401]
type    = S
movetype= A
physics = N
ctrl=0
anim = 1401
velset = 0,-8

[State 240, 1.5]
type = Playsnd
trigger1 = time = 1
value = 10,3
channel =3

[State 810, Bind 7]
type = TargetBind
trigger1 = TIME > -1
pos = 0, -110

[State 0, VelAdd]
type = Veladd
trigger1 = time>2
y = .8

[State 0, ChangeState]
type = ChangeState
trigger1 = pos Y > var(57)
value = 1402
ctrl = 0

;   ---------------------------------------------
;          ломаем летающих сук - lomaem o koleno
[Statedef 1402]
type    = S
movetype= A
physics = N
ctrl=0
anim = 1402
velset = 0,0

[State 240, 1.5]
type = Playsnd
trigger1 =  animelem = 4
value = F5,17
volume=200


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

[State 810, Bind 7]
type = TargetBind
trigger1 =  animelem = 3
pos = 0, -80

[State 810, Bind 7]
type = TargetBind
trigger1 =  animelem = 4
pos = 0, -60

[State 810, Bind 7]
type = TargetBind
trigger1 =  animelem = 5
pos = 0, -40

[State 0, TargetState]
type = TargetState
trigger1 =  animelem = 6
value = 1411
ID = -1

[State 810, Bind 7]
type = TargetBind
trigger1 =  animelem = 6
pos = 0, 10



[State 0, EnvShake]
type = EnvShake
trigger1 =  animelem = 6
time = 10
freq = 160
ampl = 10



[State 2, blood]
type = Helper
trigger1 =  animelem = 6
ID = 29
stateno = 7460
pos = 20,-40
postype = p1
persistent = 0
ignorehitpause = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =  animelem = 6
value = -160
ID = -1
absolute = 1
kill       = (Var(9) = 0)


[State 0, TargetState]
type = TargetState
trigger1 =  animelem = 19
value = 1412
ID = -1

[State 0, TargetDrop]
type = TargetDrop
trigger1 =  animelem = 19
excludeID = -1
keepone = 1
;ignorehitpause = 
;persistent = 


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



;   ---------------------------------------------
;          ломаем летающих сук - поведение врага  1
[Statedef 1410]
type    = S
movetype= H
physics = N
ctrl=0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 5110

[State 820, 1]
type = Sprpriority
Trigger1 = Time = 0
value = 3

;   ---------------------------------------------
;       
[Statedef 1411]
type    = S
movetype= H
physics = N
ctrl=0

[State 820, 4351]
type = varadd
Trigger1 = time = 0
v = 21
value = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 5800

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 3,0;F=common snd
volumescale = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
;lowpriority = -1
;abspan = 
;ignorehitpause = 
;persistent = 


[State 820, 1]
type = Sprpriority
Trigger1 = Time = 0
value = 3

;---------------------------------------------
;          ломаем летающих сук - поведение врага  2
[Statedef 1412]
type    = S
movetype= H
physics = N
ctrl=0
anim=5110
velset = 2,-9

[State 0, PosAdd]
type = PosAdd
trigger1 = time=0
y = -40



[State 0, VelAdd]
type = VelAdd
trigger1 = time>0
y = .7

[State 0, SelfState]
type = SelfState
trigger1 = pos Y > var(57)
trigger2 = time > 100
value = 5110


;==========================================
; dynamite
[Statedef 1500, bomb]   ;  кидает
type    = S
movetype= I
physics = S
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, динамит уже лежит]
type = ChangeState
trigger1 = time = 0
trigger1 = NumHelper(1501) > 0
value = 176

[State 0, кидает динамит]
type = ChangeAnim
trigger1 = time = 0
trigger1 = NumHelper(1501) = 0
value = 1500

[State 210, 1.4]
type = Playsnd
trigger1 = Animelem = 10
;trigger1 = NumHelper(1501) = 0
value = 10,5
volume=-50


[State 9251,dYNAMIT]
type = Helper
trigger1 = AnimElem = 11
trigger1 = NumHelper(1501) = 0
trigger1 = anim = 1500
postype = p1
pos = 0, -85
stateno = 1501
name="dynamit"
ID=1501
ownpal = 1


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

;------------------------------
[Statedef 1501]     ;  динамит летит
type    = S
movetype= I
physics = N
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1501

[State 1000, 0.12]
type = VelSet
trigger1 = time = 0
X = 3
Y = -6

[State 1000, 0.12]
type = Veladd
trigger1 = time < 4
trigger1 = time > 0
Y = 1

[State 1000, 0.12]
type = Veladd
trigger1 = time >= 4
Y = 0.3

[State 0, DestroySelf]
type = DestroySelf
trigger5 = time = 100
trigger1 = root,stateno = [4300,4330] ;pit
trigger2 = root,stateno = 9010 ; dizzy
trigger3 = root,stateno = [3000,3499] ; fat
trigger4 = root,stateno = [3700,3799] ; fat

[State 0, ChangeState]
type = ChangeState
trigger1 = pos y > root,var(57)
value = 1502
ctrl = 0




 ;------------------------------
[Statedef 1502]     ;  динамит лежит
type    = S
movetype= A
physics = N
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = F5,14;F=common snd
volumescale = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0



[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y =  root,var(57)

[State 0, fatality]
type = HitDef
trigger1 =1
attr = S, NP
hitflag = MAF
guardflag = A
p1stateno = 1503
sparkno = -1
sparkxy = 0,0;100,0
;p1stateno=1002
ground.type=none
 animtype = light
 
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1502

[State 0, принудительно взорвать]
type = ChangeState
trigger1 =  root,stateno = 176
trigger2 =  time > 500
value = 1504
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno = [4300,4330] ;pit
trigger2 = root,stateno = 9010 ; dizzy
trigger3 = root,stateno = [3000,3499] ; fat
trigger4 = root,stateno = [3700,3799] ; fat

 ;------------------------------
[Statedef 1503]  ; мигает переж бумоом
type    = S
movetype= A
physics = N
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2
velset = 0,0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1503

[State 0, ChangeState]
type = ChangeState
trigger1 =  time = 5
value = 1504
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno = [4300,4330] ;pit
trigger2 = root,stateno = 9010 ; dizzy
trigger3 = root,stateno = [3000,3499] ; fat
trigger4 = root,stateno = [3700,3799] ; fat

;---------------------------------
[Statedef 1504]        ;  бум
type    = S
movetype= A
physics = N
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2
velset = 0,0
anim=1507

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 1500,0



[State 0, AllPalFX]
type = AllPalFX
trigger1 = time = 0
time = 2
add = 250,250,250

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 15
freq = 70


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time > 60
trigger2 = time > 100
trigger3 = root,stateno = [4300,4330] ;pit

[State 0, star1]
type = Explod
trigger1 = time = 0
anim = 1506
ID = 1505
pos = 0,0
postype = p1  ;p2,front,back,left,right
vel = 1,-6
removetime = -2
ontop = 1
ownpal = 1
scale =1,1
accel = 0,.15
angle=random


[State 0, star2]
type = Explod
trigger1 = time = 0
anim = 1506
ID = 1505
pos = 0,0
postype = p1  ;p2,front,back,left,right
vel = -1,-7
removetime = -2
ontop = 1
ownpal = 1
scale =1,1
accel = 0,.15
angle=random

[State 0, star3up]
type = Explod
trigger1 = time = 0
anim = 1506
ID = 1505
pos = 0,0
postype = p1  ;p2,front,back,left,right
vel = -1,-4
removetime = -2
ontop = 1
ownpal = 1
scale =1,.6


[State 0, fire]
type = Explod
trigger1 = time = 0
anim = 1504
ID = 1505
pos = 0,0
postype = p1  ;p2,front,back,left,right
vel = 0,-.3
removetime = -2
ontop = 1
ownpal = 1

[State 0, smok]
type = Explod
trigger1 = time = 0
anim = 1505
ID = 1505
pos = 0,0
postype = p1  ;p2,front,back,left,right
vel = 0,-.5
removetime = -2
ontop = 1
ownpal = 1
scale =.8,1

[State 430, 111]
type =  HitDef
trigger1 =!MoveContact
trigger1 = RoundState = 2
attr = S, NA
damage    = 240, 10
animtype  = Back
hitflag = MAF ;HAF
guardflag = HL
pausetime = 0,0
sparkno = -1
sparkxy = -18,-100
guard.sparkno = -1
hitsound   = 5,0
p2facing = 1
guardsound = 5,14
ground.cornerpush.veloff = -30
ground.type = High
guard.ctrltime = 20
guard.slidetime = 20
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2,-12
air.velocity = -2,-13
yaccel = 0.38
envshake.time = 15
envshake.freq = 70
envshake.ampl = 7
fall.recover = 0
kill       = root, Var(9) = 0
fall.kill  = root, Var(9) = 0
guard.kill = root, Var(9) = 0
priority = 6, Miss
hitonce = 1



;----------------------------------------------------------------
[Statedef 1600, gun]            ;fire!
type    = S
movetype= I
physics = S
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, переход на фаталити]
type = ChangeState
trigger1 =  time = 0
triggerall = p2stateno = 9010
value = 3400
ctrl = 0

[State 240, 1.5]
type = Playsnd
trigger1 = time = 9
value = 12,0

[State 0, gilza]
type = Explod
trigger1 = AnimElem = 10
anim = 1605
ID = 1605
pos = 23, -97
postype = p1  ;p2,front,back,left,right
vel = -1,-5
removetime = 65
ontop = 1
ownpal = 1
scale =.7,.7
accel = 0,.2

[State 0, smok]
type = Explod
trigger1 = AnimElem = 10
anim = 1602
ID = 1602
pos = 40, -97
postype = p1  ;p2,front,back,left,right
vel = 0,-.5
removetime = -2
ontop = 1
ownpal = 1
scale =1,1

[State 0, fire]
type = Explod
trigger1 = AnimElem = 10
anim = 1603
ID = 1603
pos = 45, -97
postype = p1  ;p2,front,back,left,right
vel = 0,0
removetime = -2
ontop = 1
ownpal = 1
scale =1,1

[State 9251,misil]
type = Helper
trigger1 = AnimElem = 10
postype = p1
pos = 20, -97
stateno = 1601
id=1601

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1600

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

;-------------------------------------------------
 ;patron
[Statedef 1601]      
type    = A
movetype= A
physics = N
juggle  = 5
velset = 15,0
ctrl = 0
sprpriority = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1601

[State 1200, BoltFat]
type = hitdef
trigger1 = !movecontact
trigger1 = p2statetype != C || (p2stateno = [120,159])
attr = S, NP
damage    = 180-(root,numhelper(1601)>1)*110, 2
animtype = light
air.animtype = Back
hitflag = MAF
guardflag = H
pausetime = 0,0
sparkno = -1
sparkxy = 0,0;20,-30
guard.sparkno = -1
hitsound   = 5,17
guardsound = 5,14
ground.type = High
ground.velocity = -4,0
air.fall=1
air.velocity = ifelse(time>8,0,-4),-5
air.juggle = 1
ground.hittime = 22
air.hittime = 12
guard.slidetime = 12
guard.dist = 160
yaccel = 1
p2facing = 1
kill       = (root,Var(9) = 0)
fall.kill  = (root,Var(9) = 0)
guard.kill = (root,Var(9) = 0)
fall=0
getpower=0,0
hitsound   = S4,18
guardsound = S4,19

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


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 100
trigger2 = movecontact >30

;-------------------------------------------------
 ;patron bk
[Statedef 1602]      
type    = A
movetype= A
physics = N
juggle  = 5
velset = -15,0
ctrl = 0
sprpriority = 2




[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1606

[State 1200, BoltFat]
type = hitdef
trigger1 = !movecontact
attr = S, HP
damage    = 130, 2
affectteam = F
animtype = Light
air.animtype = Back
guardflag = HL
pausetime = 0,2
sparkno = -1
guard.sparkno = -1
hitsound   = S4,18
guardsound = S4,19
ground.type = High
ground.slidetime = 20
ground.hittime  = 15
ground.velocity = 5,-5
air.velocity = -4,-5
yaccel = 1
guard.dist = 90
air.fall = 1
fall.recover = 0
air.juggle = 3
kill       = (enemy,Var(9) = 0)
fall.kill  = (enemy,Var(9) = 0)
guard.kill = (enemy,Var(9) = 0)
fall = 1
hitsound   = S4,18
guardsound = S4,19


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 100
trigger2 = movecontact


;----------------------------------------------------------------
[Statedef 1610, gun 3]            ; 3 x fire!
type    = S
movetype= I
physics = S
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1610


[State 240, 1.5]
type = Playsnd
trigger1 = AnimElem = 10
trigger2 = AnimElem = 15
trigger3 = AnimElem = 20
value = 12,0

[State 0, gilza]
type = Explod
trigger1 = AnimElem = 10
trigger2 = AnimElem = 15
trigger3 = AnimElem = 20
anim = 1605
ID = 1605
pos = 23, -97
postype = p1  ;p2,front,back,left,right
vel = -1,-5
removetime = 65
ontop = 1
ownpal = 1
scale =.7,.7
accel = 0,.2

[State 0, smok]
type = Explod
trigger1 = AnimElem = 15
anim = 1602
ID = 1602
pos = 40, -97
postype = p1  ;p2,front,back,left,right
vel = 0,-.5
removetime = -2
ontop = 1
ownpal = 1
scale =1,1

[State 0, fire]
type = Explod
trigger1 = AnimElem = 10
trigger2 = AnimElem = 15
trigger3 = AnimElem = 20
anim = 1603
ID = 1603
pos = 45, -97
postype = p1  ;p2,front,back,left,right
vel = 0,0
removetime = -2
ontop = 1
ownpal = 1
scale =1,1

[State 9251,misil]
type = Helper
trigger1 = AnimElem = 10
trigger2 = AnimElem = 15
trigger3 = AnimElem = 20
postype = p1
pos = 20, -97
stateno = 1601
id=1601



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

;-------------------------------------------------
[Statedef 1611]       ;patron  3
type    = A
movetype= A
physics = N
juggle  = 5
velset = 15,0
ctrl = 0
sprpriority = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1601;1606

[State 210, 2]
type = HitDef
trigger1 = !movecontact
attr = S, SA
animtype  = Light
damage    = 100, 50
guardflag = HL
hitflag = MAF
pausetime = 1,1
sparkno = 57
sparkxy = -30,-0
guard.sparkno = S1604
hitsound   = 5,21
guardsound = 5,14
ground.type = High
p2facing = 1
guard.ctrltime = 20
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = 0,0
air.velocity = -2,-3;-3.7,-4.8
yaccel = 0.5;58
air.hittime = 20
air.fall = 1
fall.recover = 0
kill       = root, Var(9) = 0
fall.kill  = root, Var(9) = 0
guard.kill = root, Var(9) = 0




[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 100
trigger2 = movecontact


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

[Statedef 1700, spear]         ; захват
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
anim = 1700
;sprpriority = 2

[State 210, 1.4]
type = Playsnd
trigger1 = Animelem = 2
value = 10,4

[State 5120, 3]
type = playsnd
trigger1 =animelem = 13, =1
value = F7,0

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

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 9
x = 3
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem= 17
x = 0
y = 0



[State 800, 1]
type = HitDef
Trigger1 = animelem = 2
pausetime = 0,0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = MAF          ;Affect only ground people who are not being hit
guardflag = MA
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
damage = 232
sparkno = 3          ;No spark
guard.sparkno = -1
sparkxy = -20,-120
hitsound = 5,17
guardsound = 5,14
sprpriority = -1      ;Draw in front of p2
p2facing = -1       ;Force p2 to face KFM
p1stateno = 1701       ;On success, KFM changes to state 810
p2stateno = 1702       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
;fall = 1              ;Force p2 into falling down
fall.recover = 0
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)

[State 800, 2]
type = ChangeState
Trigger1 = Animtime = 0
value = 0
ctrl = 1




[Statedef 1701, spear]         ; letit           ==========================
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
sprpriority=5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =  time = 0
value = 1701

[State 810, Bind 7]
type = TargetBind
trigger1 = TIME = 0
pos = 20, -20
time = 40


[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
y = 10

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 9
y = -7

[State 0, VelSet]
type = Veladd
trigger1 = time > 0
trigger1 = animelem = 2,<0
y = .9
x = -.1

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

[State 0, PosSet]
type = PosSet
trigger1 = animelem = 2
y = var(57)

[State 0, TargetDrop]
type = TargetDrop
trigger1 = time = 15
excludeID = -1
keepone = 0





[State 800, 2]
type = ChangeState
Trigger1 = Animtime = 0
value = 0
ctrl = 1

[Statedef 1702, spear]         ; letit     =======================
type    = S
movetype= H
physics = N
juggle  = 0
velset = 0,0
ctrl = 0

[State 0, Turn]
type = Turn
trigger1 = time = 16
;ignorehitpause =
;persistent =
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 3,1;F=common snd
volumescale = 100


[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
y = 10

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 =  time = 0
value = 1702

[State 0, VelSet]
type = VelSet
trigger1 = time =16
x = -6
y = -2

[State 0, VelAdd]
type = VelAdd
trigger1 = time >16
x =   0
y =  .4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 16
value = 5035
;elem = 1
;ignorehitpause =
;persistent =



[State 821, 4] ;Hit ground
type = SelfState
trigger1 = time > 100
trigger2 = time >32
value = 5110 ;Hit ground

;-------------------------------------------------------------------------
; Thor hammer
[Statedef 1800, thor]   ;  hammer thor
type    = S
movetype= A
physics = N
juggle  = 5
velset = 10,-3
ctrl = 0
sprpriority = 2

[State 240, 1.5]
type = Playsnd
trigger1 = animelem =4, =0
value = 4,6

[State 0, light]
type = Explod
trigger1 = time = 3
anim = 1804
ID = 1804
pos = -100,-90
postype = p1  ;p2,front,back,left,right
vel = 0,0
removetime = -2
ontop = 1
ownpal = 1
scale =1,1
accel = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1800

[State 0, VelAdd]
type = VelAdd
triggerall =  time > 0
trigger1 = vel x >0
x = -.5


[State 0, VelAdd]
type = VelAdd
triggerall =  time > 0
trigger1 = vel y <0
y = .2

[State 800, 2]
type = ChangeState
Trigger1 = time = 15
trigger2 = p2bodydist x < 20
triggerall = time > 6
value = 1801
ctrl = 0


[State 800, 2]
type = ChangeState
Trigger1 = Animtime = 0
value = 0
ctrl = 1


; Thor hammer
[Statedef 1801, thor]   ;  hammer thor      --------------
type    = S
movetype= A
physics = N
juggle  = 5
velset = 0,0
ctrl = 0
sprpriority = 2

[State 240, 2]
type = HitDef
trigger1 = !movecontact
attr = S, SA
animtype  = Back
damage    = 320, 20
guardflag = HL
hitflag = MAF
pausetime = 0,2
sparkno = -1
;sparkxy = -55,-95
guard.sparkno = -1
hitsound = 5,0
guardsound = 5,14
ground.type = High
ground.slidetime = 30
p2facing = 1
guard.ctrltime = 20
guard.slidetime = 20
ground.hittime  = 30
ground.velocity = -5,6
air.velocity = -10,-6
air.hittime = 17
ground.cornerpush.veloff = -15
fall.recover = 0
envshake.time = 15
envshake.freq = 70
envshake.ampl = 7
yaccel = 0.45
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
priority = 3, hit

[State 2, Roundhouseblood]
type = Helper
trigger1 = movehit
trigger1 = numhelper(29) < 1
ID = 29
stateno = 29
pos = 0, 0
postype = p1
persistent = 0
ignorehitpause = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 6, = 0
time = 15
freq = 70

[State 0, smok]
type = Explod
trigger1 = animelem =6, =0
anim = 1802
ID = 1802
pos = 80,00
postype = p1  ;p2,front,back,left,right
vel = 0,0
removetime = -2
ontop = 1
ownpal = 1
scale =1,1
accel = 0,0

[State 240, booom]
type = Playsnd
trigger1 = animelem =6, =0
value = 1800,1
;volume = -160

[State 0, end hammer]
type = Explod
trigger1 = animelem =10, =0
anim = 1803
ID = 1803
pos = 0,-3
postype = p1  ;p2,front,back,left,right
vel = 0,0
removetime = -2
ontop = 1
ownpal = 1
scale =1,1
accel = 0,0

[State 0, end hammer]
type = Explod
trigger1 = animelem =10, =0
anim = 1805
ID = 1805
pos = 0,-8
postype = p1  ;p2,front,back,left,right
vel = 0,.4
removetime = -2
ontop = 1
ownpal = 1
scale =1,1
accel = 0,0

[State 240, electro enmd]
type = Playsnd
trigger1 = animelem =10, =0
trigger1 = NumExplod(1803)=1
value = 1800,0
volume = -160



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1801

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

[State 800, 2]
type = ChangeState
Trigger1 = Animtime = 0
value = 0
ctrl = 1

;==============================================================

[StateDef 1999]
type    = U
movetype= H
physics = N
ctrl = 0

[State 1000, 7]
type = removeexplod
trigger1 = time = 0
ID = 1010

[State 1000, BounceOff]
type = selfState
trigger1 = prevstateno != 1999
value = 1999


[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1601
value = 1602

[State 1000, BounceOff]
type = destroyself
trigger1 = ishelper && root,stateno >= 0

[State 1000, BounceOff]
type = selfState
trigger1 = time = 30 || animtime = 0
value = 0
ctrl = 1

;-----

[Statedef 2111];fake jump
type    = S
physics = S
anim = 0
ctrl = 0
sprpriority = 1

[State 40, jumpup]
type = PlaySnd
trigger1 = time = 2 && numexplod(7082) = 0
value = 3, 9
channel = 3

[State 40, 4]
type = VelSet
trigger1 = Time = 2
x = const(velocity.jump.fwd.x)
y = const(velocity.jump.y)

[State 40, 6]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

[StateDef 2112]; fake walk
type    = S
movetype= I
physics = N
ctrl = 0
anim = 20
velset = 3,0

[State -1]
type = selfState
value = 1200
trigger1 = var(50) = 1 && p2life > 2
triggerall = roundstate = 2
triggerall = time = 3 && random%12 < AILevel

[State -1]
type = selfState
value = 1100
trigger1 = var(50) = 1 && p2life > 2
triggerall = roundstate = 2
triggerall = time > 8 && time < 16 && random%12 < AILevel

[State -1]
type = selfState
value = 210
trigger1 = var(50) = 1 && p2life > 2
triggerall = roundstate = 2
triggerall = time > 16 && random%8 < AILevel

[State -1]
type = selfState
value = 20
trigger1 = var(50) != 1
trigger2 = roundstate != 2
trigger3 = time = 30
trigger4 = time > 7
trigger4 = p2statetype != A || p2movetype != H
ctrl = 1