


 ;TELEPORT up
[Statedef 1000]    ;---------------------------------------------------------------------------
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
sprpriority = 0
Anim = 1000

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,0;F=common snd
volumescale = 100


[State 0, smok1noga]
type = Explod
trigger1 = time =0
anim = 12034
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,0
bindtime = 1
scale = 1,0.3
sprpriority = -3
ownpal = 1
trans=add

 [State 0, smok1noga]
type = Explod
trigger1= time =0
anim = 12034
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,0
bindtime = 1
scale = 1,0.3
sprpriority = -3
ownpal = 1
trans=sub


[State 0, smok-many-malo]
type = Explod
trigger1 = 1
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-40
bindtime = 1
scale = 0.4,0.4
random = 30,70
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random


[State 0, smok-many-malo]
type = Explod
trigger1 = 1
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-40
bindtime = 1
scale = 0.4,0.4
random = 30,70
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random

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

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 15
value =1321


; air throw
[Statedef 1100];====================================
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 1100

[State 800, 1]
type = HitDef
Trigger1 = !movecontact
damage = (p2stateno = 9010)
pausetime = 0,0
attr = A, NT          ;Attributes: Standing, Normal Throw
hitflag = AF          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
hitsound = -1
sparkno = -1          ;No spark
p2facing = 1       ;Force p2 to face KFM
p1stateno = 1101       ;On success, KFM changes to state 810
p2stateno = 1103       ;If hit, p2 changes to state 820 in KFM's cns
numhits = 0
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1
fall.recover = 0
hitonce = 1
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
fall.damage = ifelse((var(9) != 0 && p2life <= 240), (p2life-1), 240)
guard.kill = (Var(9) = 0)

[State 800, 2]
type = velset
Trigger1 = time = 0; && prevstateno%10 = 1 && prevstateno = [600,621]
y = 0

[State 800, 2]
type = Changeanim
Trigger1 = anim = 29 && Animtime = 0 && prevstateno != [600,621]
value = 41 + ifelse(vel x > 0, 1, 2)*(vel x != 0)
elem = 2

[State 800, 2]
type = Changeanim
Trigger1 = anim = 29 && Animtime = 0 && prevstateno = [600,621]
value = floor(prevstateno/10)*10
elem = 4


[State 800, 2]
type = veladd
Trigger1 = time > 0
y = 0.5

[State 800, 2]
type = selfState
Trigger1 = pos y > var(57) && vel y > 0
value = 52


;me
[Statedef 1101];----------------------------------------
type    = A
movetype= A
physics = N
anim = 1101
velset = 0,0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =1
value = F5,156;F=common snd
volumescale = 100


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =2
value = 2,13;=common snd
volumescale = 100

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

[State 810, Bind 7]
type = TargetBind
trigger1 = animelem=2,=0
pos = 20, -60
time = 1700


[State 810, Bind 7]
type = TargetBind
trigger1 = animelem=3,=0
pos = -60, -40
time = 1700

[State 810, Bind 7]
type = TargetBind
trigger1 = animelem=4,=0
pos = -70, -20
time = 1700


[State 0, VelSet]
type = VelSet
trigger1 = animelem=3,=0
x = -1
y = -4

[State 810, State End]
type = veladd
trigger1 = animelem=3,>0
y = 0.5

[State 810, State End]
type = playerpush
trigger1 = 1
value = 0




[State 810, State End]
type = selfState
trigger1 = pos y >= var(57) && vel y > 0
value = 1102

;me2
[Statedef 1102];---------------------------------------
type    = A
movetype= A
physics = N
sprpriority = 2
anim = 1150
velset = 0,0

[State 0, Turn]
type = Turn
trigger1 = time = 0
;ignorehitpause = 
;persistent = 


[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = time = 0
value =1105
ID = -1

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


[State 810, State End]
type = posset
trigger1 = time = 0
y = var(57)

[State 810, State End]
type = posadd
trigger1 = time = 0
x = -30

[State 810, State End]
type = playsnd
trigger1 = time = 0
value = f7,1

[State 810, State End]
type = selfState
trigger1 = animtime = 0
value = 0
ctrl = 1

;en
[Statedef 1103];---------------------------------
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 4



[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 1110

;en2
[Statedef 1104];---------------------------------
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 4

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




[State 821, 4] ;Hit ground
type = SelfState
trigger1 = pos y > var(57)
value = 1105

;en3
[Statedef 1105];------------------------------
type    = C
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State 0, aaa]
type = PlaySnd
trigger1 = time =0
value = 3,random%3;F=common snd
volumescale = 100


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



[State 820, 1]
type = ChangeAnim
Trigger1 = Time = 0
value = 5140

[State -2, 34]
type = Playsnd
trigger1 = time = 0
value = f7,1

[State 820, 1]
type = envshake
Trigger1 = Time = 0
ampl = 6
freq = 70
time = 12

[State 820, 1]
type = velset
Trigger1 = Time = 0
x = 2
y = -7

[State 820, 1]
type = veladd
Trigger1 = Time > 0
y = 1



[State 821, 4] ;Hit ground
type = SelfState
trigger1 = pos y >=var(57) -10&& vel y > 0
value = 5110




;teleport ATAK
[Statedef 1200];===========================================
type    = A
movetype= A
physics = N
juggle  = 1
anim = 1200
Velset = 0, 0
ctrl = 0

[State 181, DIED]
type = Explod
trigger1 = time = 0
anim = 888
ID = 12000
removetime = 106
removeongethit = 1
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,0;F=common snd
volumescale = 100

[State 0, smok-many-malo]
type = Explod
trigger1 = time<7
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 10,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random
vel= -(random%22*.1),0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<7
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 10,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random
vel=-(random%22*.1),0

[State 2000, 4]
type = playerpush
trigger1 = 1
value = 0


[State 2000, 0.6]
type = ScreenBound
trigger1 = time > 1
value = 0
movecamera = 0,0



[State 2000, 4]
type = Changestate
trigger1 = animtime=0
value = 1201

;[State 2000, 4]
;type = removeexplod
;trigger1 = pos y >= var(57)-6 && vel y > 0
;ID = 7767

[State 2000, 4]
type = selfstate
trigger1 = pos y >= var(57)-6 && vel y > 0
value = 52
anim = 0
;------------------------------------------------------------------------------------------
;teleport atak grnd
[Statedef 1201]
type    = S
movetype= A
physics = N
juggle = 6
ctrl = 0
anim=1201
velset=0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100

[State 10000, visible]
type = varset
trigger1 =time = 0
v = 17
value = 0

[State 0, Turn]
type = Turn
trigger1 = time=0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<5
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-40
random = 10,70
sprpriority =  -2
ownpal = 1
trans=add
angle=random
vel=1,0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<5
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-40
random = 10,70
sprpriority = -2
ownpal = 1
trans=sub
angle=random
vel=1,0



[State 1001, 10]
type = Posset
trigger1 = Time = 0
y = var(57)

[State 1050, 2]
type = Posadd
trigger1 = Time = 0
x = -backedgedist

[State 2000, changepos]
type = Posadd
trigger1 = time = 0
x = P2Dist X - 50


[State 1040, 0.6]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0


[State 1050, 4]
type = HitDef
trigger1 = !movecontact
;trigger1 = time > 6 || p2statetype = A
attr = A, SA
damage    = 150,40
p2facing = 1
animtype  = Light
air.animtype  = Back
guardflag = HL
priority = 7
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = 18,-60
hitsound   = 5,0
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 22
ground.velocity = -4,0
air.velocity = -4,-3
yaccel = 0.5
guard.slidetime = 12              ;Values for guarded attack (def: ground.slidetime)
guard.ctrltime = 12               ;Time to regain control after guard (def: guard.slidetime)
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
guard.dist = 320
hitonce = 1





[State 1040, 0.erf7]
type = envshake
trigger1 = movecontact
ampl = 3
freq = 70
time = 16
ignorehitpause = 1
persistent = 0


[State 1050, 7]
type= Changestate
trigger1 =  animtime=0
value = 0
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value =1203
ctrl = 0


[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact=15
value =1202
ctrl = 0


;------------------------------------------------------------------------------------------
;teleport atak grnd 2
[Statedef 1202]
type    = S
movetype= A
physics = N
juggle = 6
ctrl = 0
anim=1202
velset=0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100

[State 1040, 0.6]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0



[State 0, Turn]
type = Turn
trigger1 = time=0


[State 0, smok-many-malo]
type = Explod
trigger1 = time<5
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-40
random = 10,70
sprpriority =   ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random
vel=1,0


[State 0, smok-many-malo]
type = Explod
trigger1 = time<5
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-40
random = 10,70
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random
vel=1,0


[State 1001, 10]
type = Posset
trigger1 = Time = 0
y = var(57)


[State 2000, changepos]
type = Posadd
trigger1 = time = 0
x = P2Dist X - 50


[State 1050, 4]
type = HitDef
trigger1 = !movecontact
;trigger1 = time > 6 || p2statetype = A
attr = A, SA
damage    = 100,20
p2facing = 1
animtype  = Light
air.animtype  = Back
guardflag = HL
priority = 7
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = 18,-60
hitsound   = 5,0
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -6,-1
air.velocity = -6,-1
yaccel = 0.5
guard.slidetime = 12              ;Values for guarded attack (def: ground.slidetime)
guard.ctrltime = 12               ;Time to regain control after guard (def: guard.slidetime)
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
guard.dist = 320
hitonce = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value =1203
ctrl = 0

[State 1050, 7]
type= Changestate
trigger1 =  animtime=0
value = 0
ctrl = 1


;------------------------------------------------------------------------------------------
;teleport atak grnd BLOK
[Statedef 1203]
type    = S
movetype= H
physics = S
ctrl = 0
anim=1205
velset=0,0

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


;------------------------------------------------------------------------------------------
;teleport atak air 1
[Statedef 1210]
type    = A
movetype= A
physics = N
juggle = 6
ctrl = 0
anim=1211
velset=0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100

[State 10000, visible]
type = varset
trigger1 =time = 0
v = 17
value = 0

[State 0, Turn]
type = Turn
trigger1 = time=0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<3
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-60
random = 10,50
sprpriority =  -2
ownpal = 1
trans=add
angle=random
vel=1,0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<3
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-60
random = 10,50
sprpriority = -2
ownpal = 1
trans=sub
angle=random
vel=1,0


[State 1050, 2]
type = Posadd
trigger1 = Time = 0
x = -backedgedist

[State 2000, changepos]
type = Posadd
trigger1 = time = 0
x = P2Dist X - 50


[State 1040, 0.6]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0


[State 1050, 4]
type = HitDef
trigger1 = !movecontact
;trigger1 = time > 6 || p2statetype = A
attr = A, SA
damage    =  (ifelse(prevstateno>599 && prevstateno<622,30,150)),40
p2facing = 1
animtype  = Light
air.animtype  = Back
guardflag = HL
priority = 7
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = 18,-60
hitsound   = 5,0
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 22
ground.velocity = -4,0
air.velocity = -4,-3
yaccel = 0.5
guard.slidetime = 12              ;Values for guarded attack (def: ground.slidetime)
guard.ctrltime = 12               ;Time to regain control after guard (def: guard.slidetime)
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
guard.dist = 320
hitonce = 1





[State 1040, 0.erf7]
type = envshake
trigger1 = movecontact
ampl = 3
freq = 70
time = 16
ignorehitpause = 1
persistent = 0



[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact=10
value =1211
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value =1215
ctrl = 0


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




;------------------------------------------------------------------------------------------
;teleport atak air 2
[Statedef 1211]
type    = A
movetype= A
physics = N
juggle = 6
ctrl = 0
anim=1211
velset=0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100

[State 1040, 0.6]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0



[State 0, Turn]
type = Turn
trigger1 = time=0


[State 0, smok-many-malo]
type = Explod
trigger1 = time<3
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-60
random = 10,50
sprpriority =  -2
ownpal = 1
trans=add
angle=random
vel=1,0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<3
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.5,0.5
pos = -40,-60
random = 10,50
sprpriority = -2
ownpal = 1
trans=sub
angle=random
vel=1,0



[State 2000, changepos]
type = Posadd
trigger1 = time = 0
x = P2Dist X - 50


[State 1050, 4]
type = HitDef
trigger1 = !movecontact
;trigger1 = time > 6 || p2statetype = A
attr = A, SA
damage    = 100,20
p2facing = 1
animtype  = Light
air.animtype  = Back
guardflag = HL
priority = 7
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = 18,-60
hitsound   = 5,0
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -6,-1
air.velocity = -6,-1
yaccel = 0.5
guard.slidetime = 12              ;Values for guarded attack (def: ground.slidetime)
guard.ctrltime = 12               ;Time to regain control after guard (def: guard.slidetime)
kill       = (Var(9) = 0)
fall.kill  = (Var(9) = 0)
guard.kill = (Var(9) = 0)
guard.dist = 320
hitonce = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value =1215
ctrl = 0


[State 0, ChangeState]
type = ChangeState
trigger1 = animelem=4
value =1212
ctrl = 0


;------------------------------------------------------------------------------------------
;teleport  fall dn
[Statedef 1212]
type    = A
movetype= I
physics =N
ctrl = 0
velset=0,6

[State 1050, 7]
type = selfstate
trigger1 = pos y > var(57)-10 
value = 52

; Blocked
[StateDef 1215];-------------------------------------------------------
type    = A
movetype= I
physics = N
ctrl = 0
velset = -.2,-9
sprpriority = 2
anim = 1215


[State 1040, 0.6]
type = ScreenBound
trigger1 = time < 12
value = 0
movecamera = 0,0

[State 2000, 4]
type = playerpush
trigger1 = time < 12
value = 0

[State 1001, 10]
type = VelAdd
trigger1 = Time > 0
y = 0.375


[State 1001, 10]
type = posAdd
trigger1 = Time = 0
x = p2dist x - 40

[State 1001, 10]
type = Posset
trigger1 = Time = 0
y = var(57)

[State 1050, 7]
type = selfstate
trigger1 = vel y > 0 && pos y > var(57)
value = 52


 ;SMOK < >
[Statedef 1300]    ;-------------------------------------------------------------------
type    = S
movetype= I
physics = N
juggle  = 2
velset = 0,0
ctrl = 0
sprpriority = 0
Anim = 1300

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,0;F=common snd
volumescale = 100

  [State 0, smokLINE]
type = Explod
trigger1 = anim=1300&&time<15
anim = 12033
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-70
random=10,100
bindtime = 1
scale = 1,0.05
sprpriority = -3
ownpal = 1
trans=add
vel= ifelse(prevstateno=1310,-4,4),0
accel=ifelse(prevstateno=1310,.1,-.1),0

[State 0, smok1noga]
type = Explod
trigger1 = time =0
anim = 12034
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,0
bindtime = 1
scale = 1,0.3
sprpriority = -3
ownpal = 1
trans=add

 [State 0, smok1noga]
type = Explod
trigger1= time =0
anim = 12034
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,0
bindtime = 1
scale = 1,0.3
sprpriority = -3
ownpal = 1
trans=sub


[State 0, smok-many-malo]
type = Explod
trigger1 = time<10
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 20,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random
vel= ifelse(random>500,0,ifelse(prevstateno=1310,-(random%11*.1),1)),0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<10
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 20,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random
vel= ifelse(random>500,0,ifelse(prevstateno=1310,-(random%11*.1),1)),0

[State 0, 0]
type = posadd
trigger1 = time = 21 && prevstateno != 1310
x = 150

[State 0, 0]
type = posadd
trigger1 = time = 21 && prevstateno = 1310
x = -150

[State 0, 0]
type = nothitby
trigger1 = 1
value = SCA
time = 12

[State 0, 0]
type = screenbound
trigger1 = time > 20
value = 0
movecamera = (enemy,backedgedist > 30),0

[State 0, 0]
type = selfstate
trigger1 = time = 21 && anim= 1300
value = 1301



[Statedef 1301];----------------------------------------
type    = S
movetype= I
physics = S
juggle  = 2
velset = 0,0
ctrl = 0
sprpriority = 0
anim = 1301
facep2 = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100


[State 0, smok-many1]
type = Explod
trigger1 = 1
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-60
random = 20,110
bindtime = 1
scale = 0.5,0.5
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random


[State 0, smok-many2]
type = Explod
trigger1 = 1
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-60
bindtime = 1
scale = 0.5,0.5
random = 20,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random


[State 0, 0]
type = nothitby
trigger1 = 1
value = SCA
time = 12

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



;===================================
;back detector
[Statedef 1310]    
type    = S
movetype= I
physics = N
juggle  = 2
velset = 0,0
ctrl = 0
sprpriority = 0

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

;SMOK air
[Statedef 1320]    ;=========================================
type    = A
movetype= I
physics = N
juggle  = 2
velset = 0,0
ctrl = 0
sprpriority = 0
Anim = 1320

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,0;F=common snd
volumescale = 100


 [State 0, smokLINE]
type = Explod
trigger1 = time<5
anim = 12033
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-70
random=10,30
bindtime = 1
scale = 1,0.05
sprpriority = -3
ownpal = 1
trans=add
vel= ifelse(prevstateno=1330,-4,4),0
accel=ifelse(prevstateno=1330,.1,-.1),0



[State 0, smok-many1]
type = Explod
trigger1 = time <14
trigger2 = time = 21
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-60
bindtime = 1
scale = 0.3,0.3
random = 20,70
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random
vel= ifelse(random>500,0,ifelse(prevstateno=1330,-1,1)),0

[State 0, smok-many2]
type = Explod
trigger1 = time <14
trigger2 = time = 21
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-60
bindtime = 1
scale = 0.3,0.3
random = 20,50
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random
vel= ifelse(random>500,0,ifelse(prevstateno=1330,-1,1)),0

[State 0, 0]
type = posadd
trigger1 = time = 17 && prevstateno != 1330
x = 150

[State 0, 0]
type = posadd
trigger1 = time = 17 && prevstateno = 1330
x = -150

[State 0, 0]
type = nothitby
trigger1 = 1
value = SCA
time = 12

[State 0, 0]
type = screenbound
trigger1 = time > 20
value = 0
movecamera = (enemy,backedgedist > 30),0

[State 0, VelSet]
type = VelSet
trigger1 = time=17 && prevstateno != 1330
x = 2


[State 0, 0]
type = selfstate
trigger1 = time = 17
value = 1321


;out air
[Statedef 1321];----------------------------------------
type    = A
movetype= I
physics = N
juggle  = 1
ctrl = 1
sprpriority = 0
anim=1321

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100




[State 0, PosFreeze]
type = PosFreeze
trigger1 = time<10
value = 1


[State 0, smok-many1]
type = Explod
trigger1 = time<10
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-70
bindtime = 1
scale = 0.3,0.3
random = 30,60
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random


[State 0, smok-many2]
type = Explod
trigger1 = time<10
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
pos = 0,-70
bindtime = 1
scale = 0.3,0.3
random = 30,60
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time=10
physics = A         ;A,C,S,N




;===================================
;back detector air
[Statedef 1330]    
movetype= I
physics = N
juggle  = 2
velset = 0,0
ctrl = 0
sprpriority = 0

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



; invisible
[Statedef 1340];-----------------------------------------------------------------------
type    = S
movetype= I
physics = S
juggle  = 1
anim = 1340
Velset = 0, 0
sprpriority = 1
ctrl = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,0;F=common snd
volumescale = 100


[State 0, smok-many-malo]
type = Explod
trigger1 = time<10
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 10,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random
vel=(-1+random%3)*.5,0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<10
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 10,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random
vel=(-1+random%3)*.5,0


[State 10000, open]
type = varset
trigger1 = animelem = 6
v = 17
value = 1
ignorehitpause = 1




[State 10000, open]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

; visible
[Statedef 1341]; ----------------------------------------------
type    = S
movetype= I
physics = S
juggle  = 1
anim = 1341
Velset = 0, 0
sprpriority = 1
ctrl = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,0;F=common snd
volumescale = 100


[State 0, smok-many-malo]
type = Explod
trigger1 = time<5
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 10,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=add
angle=random
vel=(-1+random%3)*.5,0

[State 0, smok-many-malo]
type = Explod
trigger1 = time<5
anim =  ifelse(random>500,12033,12034)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
bindtime = 1
scale = 0.4,0.4
pos = 0,-60
random = 10,110
sprpriority =  ifelse(random>500,-2,2)
ownpal = 1
trans=sub
angle=random
vel=(-1+random%3)*.5,0

[State 10000, visible]
type = varset
trigger1 =time = 0
v = 17
value = 0



[State 0, LifeAdd]
type = LifeAdd
trigger1 =1
value = random%30
kill = 1
absolute = 0

[State 0, detectorr]
type = Explod
trigger1 = time=0 && anim!=5300
anim = 888
ID = 1341431
pos = random/3,-60
postype = p1;  p2,front,back,left,right
removetime = 350;"-2" odin raz; "-1" forever
removeongethit = 1

[State 0, detectorr]
type = PlaySnd
trigger1 =anim=5300 && animelem=1,=1
value = 3,2;F=common snd
volumescale = 100
channel = -1
freqmul = 1.0



[State 10000, detectorr]
type = changeanim
trigger1 = time=0 && numexplod(1341431)>1 &&random>500
value = 5300

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim=5300
movetype = H









[State 10000, open]
type = changestate
trigger1 =animtime = 0 && anim!=5300
trigger2 =time > 100 && anim=5300
value = 0
ctrl = 1

; shadow
[Statedef 1342]; -------------------------------------------
type    = S
movetype= I
physics = S
anim = 888
Velset = 0, 0
sprpriority = -8
ctrl = 0

[State 0, Aggressor fx]
type = AfterImage
trigger1 = time = 0
length = 5
palcolor = 256
palinvertall = 0
palbright = 30,30,30
palcontrast = 200,200,200
palpostbright = 0,0,0
paladd = 0,0,0
palmul = 1,1,1
timegap = 6
framegap = 1
Trans = addalpha
alpha = ifelse(root,var(17) = 0, 160, 90),ifelse(root,var(17) = 0, 90, 160)
time = 420
ignorehitpause = 1

[State 2000]
type = AfterImagetime
trigger1 = root,numexplod(11008) = 0
time = 1

[State 10000, open]
type = destroyself
trigger1 = root,numexplod(11008) = 0

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,var(17) = 0
time = 1
facing = 1
pos = 0, 0

[State 0, BindToRoot]
type = posadd
trigger1 = root,var(17) != 0
trigger1 = gametime%2 = 0
x = -3+6*(gametime%4 = 2)

[State 5900, 1]
type = changeanim
trigger1 = 1
value = ifelse(root,var(17) = 0, root,anim, 1510)
elem = ifelse(root,var(17) = 0, root,animelemno(0), 5)

[State 5900, 1]
type = changeanim
trigger1 = root,anim = 26
triggerall = root,var(17) = 0
value = 888

[State 9000, blood]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 9000, blood]
type = assertspecial
trigger1 = 1
flag = invisible

[State 9000, blood]
type = nothitby
trigger1 = 1
value = SCA

[State 9000, blood]
type = playerpush
trigger1 = 1
value = 0


; fireball
[StateDef 1700];============================================================
type    = S
movetype= A
physics = S
juggle  = 2
ctrl = 0
velset = 0,0
anim = 1700

[State 0, slow]
type = ChangeAnim
trigger1 = time= 0 && numhelper(1701)!=0
value = 1702
;elem = 1
;ignorehitpause = 
;persistent = 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = F5,156;=common snd
volumescale = 100



[State 0, fx]
type = Explod
trigger1 = time=0
anim =1711
ID = 1711
pos = 0,-77
postype = p1;  p2,front,back,left,right
facing = 1;1-2*(random%2)
vfacing = 1
bindtime = 1; -1 forever
vel = 3,0
removetime = -2;"-2" odin raz; "-1" forever
scale = 1,1
sprpriority = 6
ownpal = 1
removeongethit = 0




[State 0, fireball]
type = Helper
trigger1 = animelem = 4
stateno = 1701
pos = 40*const(size.xscale),-75*const(size.yscale)
postype = p1
ownpal = 1
id=1701

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim=1700 && helper(1701),stateno=1702 &&helper(1701),prevstateno!=1704
value = 1701


[State 181, boom1]
type = Explod
trigger1 = anim=1701 && enemynear,stateno=1710
pos=0,-30
anim =  12035
sprpriority =  7
scale = 1.2,1.2
ownpal = 1
bindtime = 1
trans=add
persistent=100
postype = p2

[State 181, boom1]
type = Explod
trigger1 = anim=1701 && enemynear,stateno=1710
pos=0,-30
anim =  12035
sprpriority =  7
scale = 1.1,1.1
ownpal = 1
bindtime = 1
trans=sub
postype = p2
persistent=100

[State 1200, 10]
type = ChangeState
trigger1 = AnimTime = 0
ctrl = 1
value = 0

;star
[StateDef 1701];---------------------------------------------------------
type    = A
movetype= A
physics = N
juggle  = 2
ctrl = 0
velset = 10,.5
sprpriority = 0
anim=1710




[State 1200, 10]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1200, BoltFat]
trigger1 = !movecontact && p2movetype!=h
type = hitdef
attr = S, NP
damage    = 0, 0
animtype = Light
air.animtype = Back
air.fall = 1
fall.recover = 0
hitflag = AFH
guardflag = HL
pausetime = 0,2
sparkno = -1
guard.sparkno = -1
hitsound   = S20,37
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -4,0
air.velocity = -3.5,-6
air.fall = 1
guard.dist = 100
fall.recover = 0
air.juggle = 3
yaccel = root,pos x
p2stateno = 1710
kill       = (root,Var(9) = 0)
fall.kill  = (root,Var(9) = 0)
guard.kill = (root,Var(9) = 0)
hitonce = 1

[State 1200, hited]
trigger1 = !movecontact && p2movetype=h
type = hitdef
attr = S, NP
damage    = 60, 0
animtype = Light
air.animtype = Back
air.fall = 1
fall.recover = 0
hitflag = MAFD
guardflag = HL
pausetime = 0,2
sparkno = -1
guard.sparkno = -1
hitsound   = S20,37
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -4,-2
air.velocity = -3.5,-6
air.fall = 1
guard.dist = 100
fall.recover = 0
air.juggle = 3
yaccel = 0.8
kill       = (root,Var(9) = 0)
fall.kill  = (root,Var(9) = 0)
guard.kill = (root,Var(9) = 0)
hitonce = 1
p1stateno = 1704

[State 181, shleif]
type = Explod
trigger1 = 1
pos=10,0
id=121212
anim =  ifelse(random>500,12034,12033)
sprpriority =  ifelse(random>500,-2,2)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = 0.4,0.4
ownpal = 1
random = 4,2
bindtime = 1
trans=add
persistent=2
vel=(random%10)*.1,0
angle=random

[State 181, shleif]
type = Explod
trigger1 = 1
pos=10,0
anim =  ifelse(random>500,12034,12033)
sprpriority =  -3
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = 0.4,0.4
ownpal = 1
random = 4,2
bindtime = 1
trans=sub
persistent=5
vel=(random%10)*.1,0



[State 181, DIED]
type = selfstate
trigger1 = movehit
trigger2 = pos y > -8 + root,var(57) && vel y > 0
trigger3 = frontedgedist < -100
trigger4 = time>200
value = 1702
ignorehitpause = 1

[State 181, DIED]
type = selfstate
trigger1 = moveguarded
value = 1705
ignorehitpause = 1



;star hits
[StateDef 1702];--------------------------------------------------
type    = A
movetype= A
physics = N
juggle  = 2
ctrl = 0
velset = 0,0
anim=888

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,2;F=common snd
volumescale = 100

[State 181, boom1]
type = Explod
trigger1 = time=0
pos=0,0
anim =  12035
sprpriority =  7
scale = 1.2,1.2
ownpal = 1
bindtime = 1
trans=add

[State 181, boom1]
type = Explod
trigger1 = time=0
pos=0,0
anim =  12035
sprpriority =  7
scale = 1.1,1.1
ownpal = 1
bindtime = 1
trans=sub


[State 181, boom2]
type = Explod
trigger1 = time=0
pos=0,0
anim =  12033
sprpriority =  7
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = .7,.7
ownpal = 1
bindtime = 1
trans=add
angle=random
vel=2,0

[State 181, DIED]
type = envshake
trigger1 = time = 0
time = 16
freq = 90
ampl = 4


[State 1200, 10]
type = destroyself
trigger1 = time > 33

;star flies back
[StateDef 1703];----------------------------------
type    = A
movetype= A
physics = N
juggle  = 2
ctrl = 0
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 1000,1;F=common snd
volumescale = 100

[State 181, shleif]
type = Explod
trigger1 = time =0
pos=10,0
id=121212
anim = 12034
sprpriority =  ifelse(random>500,-2,2)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = .5,1.5
ownpal = 1
bindtime = 1
trans=add



[State 1200, 10]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1200, Za]
type = turn
trigger1 = time = 0

[State 1200, Za]
type = posadd
trigger1 = time = 0
x = 20

[State 1200, 10]
type = velset
trigger1 = var(11) = 0
x = 10

[State 1200, 10]
type = velset
trigger1 = var(11) = 1
x = 6
y = 6

[State 1200, 10]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1200, BoltFat]
trigger1 = !movecontact
type = hitdef
attr = S, HP
damage    = 200, 20
affectteam = F
animtype = Light
air.animtype = Back
air.fall = 1
fall.recover = 0
hitflag = MAFD
guardflag = HL
pausetime = 0,2
sparkno = -1
guard.sparkno = -1
hitsound   = S20,37
guardsound = 5,14
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = 4,-7
air.velocity = 3.5,-7
air.fall = 1
guard.dist = 100
fall.recover = 0
air.juggle = 3
yaccel = 0.5
kill       = (enemy,Var(9) = 0)
fall.kill  = (enemy,Var(9) = 0)
guard.kill = (enemy,Var(9) = 0)
hitonce = 1

[State 181, shleif]
type = Explod
trigger1 = 1
pos=10,0
id=121212
anim =  ifelse(random>500,12034,12033)
sprpriority =  ifelse(random>500,-2,2)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = 0.4,0.4
ownpal = 1
random = 4,2
bindtime = 1
trans=add
persistent=2
vel=(random%10)*.1,0
angle=random

[State 181, DIED]
type = selfstate
trigger1 = movecontact
trigger2 = pos y > -8 + root,var(57) && vel y > 0
trigger3 = frontedgedist < -100
trigger4 = time>200

value = 1702
ignorehitpause = 1

;star hits detector
[StateDef 1704];--------------------------------------------------
type    = A
movetype= A
physics = N
juggle  = 2
ctrl = 0
velset = 0,0
anim=888

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




;star hits guarded
[StateDef 1705];--------------------------------------------------
type    = A
movetype= A
physics = N
juggle  = 2
ctrl = 0
velset = 10,0
anim=888

[State 181, DIED]
type = envshake
trigger1 = time = 0
time = 16
freq = 90
ampl = 4


[State 1200, 10]
type = destroyself
trigger1 = time > 10

[State 181, shleif]
type = Explod
trigger1 = 1
pos=10,0
id=121212
anim =  ifelse(random>500,12034,12033)
sprpriority =  ifelse(random>500,-2,2)
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = 0.4,0.4
ownpal = 1
random = 4,12
bindtime = 1
trans=add
persistent=2
vel=(random%10)*.1,0
angle=random
accel=-.1,0

[State 181, shleif]
type = Explod
trigger1 = 1
pos=10,0
anim =  ifelse(random>500,12034,12033)
sprpriority =  -3
facing = 1-2*(random%2)
vfacing = 1-2*(random%2)
scale = 0.4,0.4
ownpal = 1
random = 4,12
bindtime = 1
trans=sub
persistent=5
vel=(random%10)*.1,(RANDOM%3)-1
accel=-.1,0

;star P2
[StateDef 1710];---------------------------------------------------------
type    = A
movetype= H
physics = N
juggle  = 2
ctrl = 0
velset =0, -6
sprpriority = 0
anim=888

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0
value = 3,2;F=common snd
volumescale = 100

[State 2000, 0.6]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=2
value = 5050



[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .4



[State 0, PosSet]
type = PosSet
trigger1 = time=0
x = GetHitVar(yaccel)
y = var(57) -140;var(57)

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



[State 821, 4] ;Hit ground
type = SelfState
trigger1 = pos y >=var(57) -10&& vel y > 0
value = 5110


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

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

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

[State 1000, spear]
type = selfState
trigger1 = anim = 1002
value = 1007



[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1710
value = 1703

[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1011
value = 1102

[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1020
value = 1310

[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1035
value = 1524

[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1501
value = 1605


[State 1000, BounceOff]
type = selfState
trigger1 = anim = 1600
value = (1902 - var(11))

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

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

