;==============================================================
;--------------- Harpon - Smoke ----------------------------
[Statedef 6000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 6000
ctrl = 0
sprpriority = 1

[State smokID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2102
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
ignorehitpause = 1

[State ]
type = Posset
trigger1 = !time 
Y = 0

[State ]
type = Helper
trigger1 = animelem = 2
stateno = 6002
name = "Harpoon"
id = 6000
pos = 0,ceil(-89*const(size.yscale))
helpertype = normal
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State END]
type = ChangeState
trigger1 = Time >= 70 
value = 0
ctrl = 1

[State JALA]
type = Changestate
triggerall = numhelper(6000)
trigger1 = helper(6000),var(0) = 1 && time > 60
trigger2 = helper(6000),var(0) = 2
value = 6001
;---------------------------------------------------------------------------
;jala
[Statedef 6001]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 6001
ctrl = 0
sprpriority = 1

[State smokID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2102
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State END]
type = ChangeState
trigger1 = time >= 60 && numhelper(6000)
trigger1 = helper(6000),var(0) = 3
trigger2 = time >= 70
trigger3 = p2stateno = 60060 && enemynear,time >= 20
value = 0
ctrl = 1

;------------------------------------------------
;HARPOON 
[Statedef 6002]
type    = A
movetype= A
physics = N
juggle  = 4
velset = ifelse(parent,var(21) = 1 && (parent,var(20) = 3),14,8),0
anim = 60001
ctrl = 0
sprpriority = 0

[State comboRESET]
type = ParentVarSet
trigger1 = parent,var(12) >= 5
var(12) = 0

[State combo]
type = ParentVarAdd
trigger1 = !time
var(12) = 1

[State sale]
type = Playsnd
trigger1 = !time 
value = 1,16
volume = 255

[State cuerda]
type = Helper
triggerall = time <= 60
trigger1 = timemod = 3,0
trigger2 = vel X = 14 && timemod = 2,0
stateno = 6003
name = "Rope"
helpertype = normal
;scale = root,const(size.xscale),root,const(size.yscale)
;pos = ceil((ceil(parent,const(size.xscale)))*(-15)),0

[State 1010, 2]
type = HitDef
trigger1 = parent,var(12) <= 3
numhits = 0
damage    = 25,5
attr = A,SP
guardflag = M
animtype = heavy
air.animtype = high
priority = 5, hit
hitsound   = S0,14
guardsound = 0,7
kill = 0
p2facing = 1
ground.slidetime = 10
guard.slidetime = 20
ground.hittime = 40
guard.hittime = 40
ground.velocity = -3, 0
air.velocity = -3-parent,fvar(1), -5+parent,fvar(1)
guard.velocity = -3
air.cornerpush.veloff = -10
ground.cornerpush.veloff = -10
p1stateno = 6007
p2stateno = 6006
envshake.time = 10
envshake.ampl = -2

[State 1010, 4]
type = Changestate
trigger1 = MoveGuarded 
value = 6005

[State end]
type = destroyself
trigger1 = frontedgedist <= -250

;---------------------------------------------------------------------------
;The Rope Animating the hidden Rope
[Statedef 6003]
type    = A
movetype= I
physics = N
anim = 9999
ctrl = 0
sprpriority = -1

[State Visible]
type = Changestate
trigger1 = rootdist X < 20 && (parent,stateno = 6007 || parent,stateno = 60070)
trigger2 = root,anim = 6001 && !root,animelemtime(1) && rootdist X < 20
value = 6004

[State BYE]
type = Destroyself
trigger1 = root, stateno != 6000 && root,stateno != 6001
trigger2 = !numhelper(6000)
;------------------------------------------------------------------------
;The Rope Becomes visible
[Statedef 6004]
type    = A
movetype= I
physics = N
anim = 60002
ctrl = 0
sprpriority = -1

[State desvanece]
type = ChangeAnim
trigger1 = anim != 60003 && parent,var(0) = 3
value = 60003

[State BYE]
type = Destroyself
trigger1 = !numhelper(6000)
trigger2 = Parentdist X < 20
trigger3 = anim = 60003 && !animtime
;------------------------------------------------------------------------
;MAKING THE HARPOON LESS CHEAP, IF HARPOON BLOCKED
[Statedef 6005]
type    = S
movetype= I
physics = N
anim = 60004
Velset = 0,0
ctrl = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, VelSet]
type = Veladd
trigger1 = time > 0
x = .2

[State 23, trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha=ceil(256-(time*8)),ceil(0+(time*8))

[State 1013, 1]
type = Destroyself
trigger1 = time = 30
;---------------------------------------------------------------------------
;PLAYER 2 is HIT BY HARPOON
[Statedef 6006]
type    = S
movetype= H
physics = S
ctrl = 0
velset = 0,0
sprpriority = -2

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0

[State 1020, .5]
type = Changeanim2
trigger1 = !time && name != "juano`s morph guy"
value = 6015

[State shang tsung mk2]
type = ChangeAnim
Trigger1 = name = "juano`s morph guy"
Trigger1 = anim != 9108103+ifelse(name = "juano`s morph guy",var(20),0)
value = 5000+ifelse(name = "juano`s morph guy",var(20),0)

[State omega shang tsung]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger1 = !time
value = ifelse(!enemynear,fvar(20),5000,500+ceil(enemynear,fvar(20)))

[State vibra2]
type = PosAdd
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger2 = name = "juano`s morph guy"
triggerall = !(time%5)
x = 1
[State vibra3]
type = PosAdd
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger2 = name = "juano`s morph guy"
triggerall = (time%5) = 1
x = -1

;-------------------- jalado
[State 1020, subjalado]
type = Changeanim
triggerall = name = "Juano`s Sub guy" && anim != 29901
trigger1 = time = 45
value = 29901

[State 1020, compatiblejalado]
type = Changeanim
triggerall = name != "Juano`s Sub guy" && anim != 9108103+ifelse(name = "juano`s morph guy",var(20)*1000,0)
triggerall = selfanimexist(9108103+ifelse(name = "juano`s morph guy",var(20)*1000,0))
trigger1 = time = 45
value = 9108103+ifelse(name = "juano`s morph guy",var(20)*1000,0)
;---------------------------------
[State 1020, 2]
type = selfstate
trigger1 = !alive
value = 5050

[State 1020, 3]
type = Selfstate
trigger1 = time = 300
value = 0
ctrl = 1

;-------------------------------------------------------------------------------
;PLAYER 2 is Stun by harpoon
[Statedef 60060]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
sprpriority = 0

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0

[State 1021, 1]
type = Changeanim
trigger1 = animexist(5300+ifelse(name = "juano`s morph guy",var(20),0))
trigger1 = anim != 5300
trigger1 = time = 0
value = 5300+ifelse(name = "juano`s morph guy",var(20),0)

[State 1021, 1]
type = Changeanim2
trigger1 = !animexist(5300)
trigger1 = anim != 7052
trigger1 = time = 0
value = 60005

[State omega shang tsung]
type = ChangeAnim
Trigger1 = name = "SHANG TSUNG" && authorname = "OMEGAPSYCHO"
Trigger1 = !time
value = ifelse(!enemynear,fvar(20),5300,800+ceil(enemynear,fvar(20)))

[State 1021, 3]
type = Selfstate
trigger1 = time = 150
value = 0
ctrl = 1

;-------------------- HARPON AVANZA
[Statedef 6007]
type    = A
movetype= A
physics = N
juggle  = 1
anim = 60006
ctrl = 0

[State Sigolpearon]
type = TargetState
trigger1 = parent,stateno != 6000 && parent,stateno != 6001
value = 6006

[State ]
type = VelSet
trigger1 = time = 10
trigger2 = time = 5 && (parent,var(21) || parentdist X <= -120)
trigger3 = !time && parentdist X <= -200
x = 0

[State golpea]
type = VarSet
trigger1 = target,stateno = 6006
var(0) = 1

[State 0, TargetBind]
type = targetbind
trigger1 = target,stateno = 6006
time = 1
pos = 0,0

[State ]
type = Helper
trigger1 = time = [0,3]
helpertype = Normal
name = "bleed?"
postype = p2
pos = -20+enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
facing = -1
ignorehitpause = 1

[State 1010, 1.55]
type = Helper
triggerall = time = [0, 60]
trigger1 = timemod = 3,0
trigger2 = vel X = 14 && timemod = 2,0
stateno = 6003
ID = 6001
name = "Rope"
helpertype = normal
sprpriority = -1
keyctrl = 0
ownpal = 1
under = 1
scale = root,const(size.xscale),root,const(size.yscale)
pos = ceil((ceil(const(size.xscale)))*(-15)),0

[State 0, ChangeState]
type = ChangeState
trigger1 = !vel X
value = 60070

;--------------------------------------------------------------------------
;Harpoon latching onto target
[Statedef 60070]
type    = S
movetype= A
physics = N
juggle  = 1
anim = 60006
ctrl = 0

[State Sigolpearon]
type = TargetState
triggerall = numtarget
trigger1 = parent,stateno != 6000 && parent,stateno != 6001 && target,stateno != 60060
value = 70210

[State jala]
type = VarSet
trigger1 = ParentDist X >= -40
var(0) = 2

[State end]
type = varSet
triggerall = numtarget
trigger1 = target,stateno = 60060
var(0) = 3

[State 0, TargetBind]
type = targetbind
triggerall = numtarget
trigger1 = target,stateno = 6006
time = 1
pos = 0,0

[State 0, TargetState]
type = TargetState
triggerall = numtarget
trigger1 = ParentDist X >= -40
value = 60060
persistent = 0

[State 1030, 1.01]
type = Velset
trigger1 = time = 50
X = ifelse(parent,var(21) = 1 && parent,var(20) = 3,-14,-8)

[State 1030, 1.1]
type = Velset
trigger1 = ParentDist X >= -40
X = 0

[State jalaSND]
type = PlaySnd
trigger1 = time = 50
value = S1,ifelse(parent,var(21) || parentdist X <= -160,19,17)
volume = 255

[State 1030, 1.4]
type = Changeanim
triggerall = numtarget
triggerall = anim != 9999
trigger1 = target,stateno = 60060
value = 9999

[State 1030, 1.5]
type = Destroyself
trigger1 = numtarget
trigger1 = target,stateno != 60060 && anim = 9999
trigger2 = Parent,stateno != 6001 && parent,stateno != 6000
trigger3 = time >= 150


;==============================================================
;----------------------|Invisible|-----------------------------
[Statedef 6008]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time 
value = 30000
elem = 7
ignorehitpause = 1 

[State 0, smokID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2102
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State 3010, Fire]
type = explod
trigger1 = Time = 10
anim = 7038
id = 6008
pos = ceil(-6*const(size.xscale)*(1+fvar(2))),ceil(6*const(size.yscale)*(1+fvar(2)))
postype = p1
ontop = 1
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State 3010, Boom]
type = PlaySnd
trigger1 = time = 10
value = 1,22
volume = 200

[State 3010, Var]
type = VarSet
trigger1 = time = 20
var(17) = 1

[State 20001, Super B]
type = AfterImage
trigger1 = !time 
FrameGap = 10
length = 30
PalBright   =   0,  0,  0
PalContrast = 118,118,118
PalAdd      =   0,  0,  0
PalMul      =  1,1,1
Trans = Add1
time = 20

[State 3010, CS]
type = ChangeState
trigger1 = time = 20
value = 0
ctrl = 1


;==============================================================
;----------------------|visible|-----------------------------
[Statedef 60080]
type = S
movetype = I
physics = S
anim = 9999
ctrl = 0
velset = 0,0

[State aparece]
type = ChangeAnim
trigger1 = time < 15
value = 3005
elem = 6
ignorehitpause = 1

[State 0, smokID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2102
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
ignorehitpause = 1

[State 3011, Fire]
type = explod
trigger1 = Time = 1
anim = 7038
id = 6008
pos = ceil(-6*const(size.xscale)*(1+fvar(2))),ceil(6*const(size.yscale)*(1+fvar(2)))
postype = p1
ontop = 1
ownpal = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State 3011, Var]
type = VarSet
trigger1 = time = 20
var(17) = 0 

[State 3011, Boom]
type = PlaySnd
trigger1 = time = 1
value = 1,22

[State 3011, CS]
type = ChangeState
trigger1 = time = 30
value = 0
ctrl = 1

;==================================================================
;-------------------------|NEAR BOMB|------------------------------
[Statedef 6009]
type = S
movetype = I
physics = S
ctrl = 0
anim = 6002
velset = 0,0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(7000) < 2
helpertype = normal
stateno = 7000
name = "Bomba"
id = 7000
pos = ceil(3*const(size.xscale)),ceil(-90*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

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

;======================================================================
;-------------------------|air NEAR BOMB|------------------------------
[Statedef 60090]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = 6017
sprpriority = 2

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(7000) < 2
helpertype = normal
stateno = 7000
name = "Bomba"
id = 7000
pos = 0,ceil(-100*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State ]
type = velset
trigger1 = time = 4
x = -1
y = -3

[State ]
type = statetypeset
trigger1 = time = 5
physics = A

;==================================================================
;-------------------------|FAR BOMB|------------------------------
[Statedef 6010]
type = S
movetype = I
physics = S
ctrl = 0
anim = 6002
velset = 0,0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(7000) < 2
helpertype = normal
stateno = 7000
name = "Bomba"
id = 7000
pos = ceil(3*const(size.xscale)),ceil(-90*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

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

;=====================================================================
;-------------------------|air FAR BOMB|------------------------------
[Statedef 60100]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = 6017
sprpriority = 2

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(7000) < 2
helpertype = normal
stateno = 7000
name = "Bomba"
id = 7000
pos = 0,ceil(-100*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State ]
type = velset
trigger1 = time = 4
x = -1
y = -3

[State ]
type = statetypeset
trigger1 = time = 5
physics = A

;==================================================================
;----------------------------|NET|---------------------------------
[Statedef 6011]
type = S
movetype = I
physics = S
ctrl = 0
anim = 6002
velset = 0,0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && !numhelper(6011)
helpertype = normal
stateno = 7001
name = "net"
id = 6011
pos = ceil(3*const(size.xscale)),ceil(-90*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

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

;======================================================================
;----------------------------|air NET|---------------------------------
[Statedef 60110]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = 6017
sprpriority = 2

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && !numhelper(6011)
helpertype = normal
stateno = 7001
name = "net"
id = 6011
pos = 0,ceil(-100*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State ]
type = velset
trigger1 = time = 4
x = -1
y = -3

[State ]
type = statetypeset
trigger1 = time = 5
physics = A

;============================================================
;----------------------|TELEPORT|----------------------------
[Statedef 6012]
type = U
movetype = I
physics = S
ctrl = 0
anim = 6004
velset = 0,0
sprpriority = 0

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State gira]
type = Turn
trigger1 = facing = enemynear,facing

[State explosion]
type = Explod
trigger1 = animelem = 4 || animelem = 5
anim = 60040
pos = 0,ceil(-70*const(size.yscale))
scale = const(size.xscale),const(size.yscale)
sprpriority = 0
ownpal = 1

[State teleport1]
type = PlaySnd
trigger1 = animelem = 4
value = 1,53
volume = 255

[State teleport2]
type = PlaySnd
trigger1 = animelem = 5
value = 1,54
volume = 255

[State transporte]
type = PosAdd
trigger1 = animelemtime(4) = 5
x = p2dist x +40

[State suelo]
type = PosSet
trigger1 = animelemtime(4) = 5
y = 0

[State nodaņo]
type = NotHitBy
trigger1 = animelemtime(4) >= 0 && animelemtime(6) <= 0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 20
ignorehitpause = 1

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

;----------------- PARTES DEL CUERPO APARECEN ----------------
[State S cabeza]
type = Explod
trigger1 = animelem = 4
anim = 60041
id = 60041
pos = 0,ceil(-120*const(size.yscale))
sprpriority = 1
vel = 0,-10
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B cabeza]
type = ModifyExplod
trigger1 = animelem = 5
id = 60041
pos = 0,-240
postype = p1
vel = 0,10


[State S pecho]
type = Explod
trigger1 = animelem = 4
anim = 60044
id = 60044
pos = 0,ceil(-95*const(size.yscale))
sprpriority = 1
vel = 0,-7
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B pecho]
type = ModifyExplod
trigger1 = animelem = 5
id = 60044
pos = 0,-220
postype = p1
vel = 0,12



[State S cadera]
type = Explod
trigger1 = animelem = 4
anim = 60045
id = 60045
pos = 0,ceil(-57*const(size.yscale))
sprpriority = 1
vel = 0,8
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B cadera]
type = ModifyExplod
trigger1 = animelem = 5
id = 60045
pos = 0,60
postype = p1
vel = 0,-10



[State S mano I]
type = Explod
trigger1 = animelem = 4
anim = 60042
id = 60042
pos = ceil(-25*const(size.xscale)),ceil(-110*const(size.yscale))
sprpriority = 1
vel = -8,-8
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B mano I]
type = ModifyExplod
trigger1 = animelem = 5
id = 60042
pos = -160,-240
postype = p1
vel = 11,11



[State S mano D]
type = Explod
trigger1 = animelem = 4
anim = 60043
id = 60043
pos = ceil(25*const(size.xscale)),ceil(-110*const(size.yscale))
sprpriority = 1
vel = 8,-8
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B mano D]
type = ModifyExplod
trigger1 = animelem = 5
id = 60043
pos = 160,-240
postype = p1
vel = -11,11



[State S pie I]
type = Explod
trigger1 = animelem = 4
anim = 60047
id = 60047
pos = ceil(-20*const(size.xscale)),ceil(-37*const(size.yscale))
sprpriority = 1
vel = -8,8
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B pie I]
type = ModifyExplod
trigger1 = animelem = 5
id = 60047
pos = -140,110
postype = p1
vel = 11,-11



[State S pie D]
type = Explod
trigger1 = animelem = 4
anim = 60046
id = 60046
pos = ceil(20*const(size.xscale)),ceil(-37*const(size.yscale))
sprpriority = 1
vel = 8,8
removetime = 31
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State B pie D]
type = ModifyExplod
trigger1 = animelem = 5
id = 60046
pos = 140,110
postype = p1
vel = -11,-11

;========================================================
;-------------------|Smoke Air Trow|---------------------
[Statedef 6013]
type    = A
movetype= A
physics = A
poweradd= 0
ctrl = 0
sprpriority = 2

[State ]
type = VelSet
trigger1 = movecontact
x = 0

[State ]
type = ChangeAnim
trigger1 = !time && prevstateno != 600 && prevstateno != 620 && prevstateno != 6047
value = 6005
;---------------
[State ]
type = ChangeAnim
trigger1 = prevstateno = 600 || prevstateno = 620 || prevstateno = 6047
value = anim
elem = animelemno(0)

[State ]
type = null;TargetBind
trigger1 = prevstateno = 600 || prevstateno = 620 || prevstateno = 6047
trigger1 = !time
time = 1
pos = ceil(60*const(size.xscale)),0

[State 0, TargetState]
type = null;TargetState
trigger1 = prevstateno = 600 || prevstateno = 620 || prevstateno = 6047
trigger1 = !time
value = 802

[State 0, ChangeState]
type = null;ChangeState
trigger1 = prevstateno = 600 || prevstateno = 620 || prevstateno = 6047
trigger1 = !time
value = 801
ctrl = 0
;--------------------
[State 0, smoke cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = ifelse(prevstateno = 6014,2100,2102)
pos = 320,240
postype = left
bindtime = 1
removetime = 52
ownpal = 1

[State 0, nosecubre]
type = AssertSpecial
trigger1 = 1
flag = unguardable
ignorehitpause = 1

[State grabby]
type = HitDef
trigger1 = !movecontact
attr = A,NT
hitflag = MAF
priority = 1, Miss
sparkno = -1
sprpriority = -1
p1facing = 1
p2facing = 1
p1stateno = 801
p2stateno = 802
guard.dist = 0
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0

[State end]
type = ChangeState
trigger1 = !AnimTime || time = 5
value = 50

;=====================================================
;----------------|Cyrax - Air Trow|-------------------
[Statedef 6014]
type    = A
movetype= A
physics = A
poweradd= 0
ctrl = 0
anim = 6005
sprpriority = 1

[State cyraxID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2100
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State ]
type = PlaySnd
trigger1 = !time
value = S1,23
volume = 255

[State ]
type = VelAdd
trigger1 = 1
x = ifelse(vel x < 6,ifelse(p2bodydist x > 30,.8,.2),0)
y = ifelse(!p2bodydist y,0,ifelse(p2bodydist y > 0,1,-1))

[State 0, nosecubre]
type = AssertSpecial
trigger1 = 1
flag = unguardable
ignorehitpause = 1

[State grabby]
type = HitDef
trigger1 = !movecontact && command = "a"
attr = A,NT
hitflag = MAF
priority = 1, Miss
sparkno = -1
sprpriority = -1
p1facing = 1
p2facing = 1
p1stateno = 801
p2stateno = 802
guard.dist = 0
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0

;====================================================
;--------|Teleport Punch - Sektor - Smoke|-----------
[StateDef 6015]
type    = A
movetype= A
physics = S
juggle  = 2
ctrl = 0
anim = 6006
sprpriority = 5
velset = 0,0

[State ]
type = ScreenBound
trigger1 = time < 20
trigger2 = pos Y > 0
value = 0

[State ID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = ifelse(var(20) = 2,2101,2102)
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
ignorehitpause = 1

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

[State ]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State ]
type = NotHitBy
trigger1 = time <= 23
trigger2 = anim = 6006
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
value2 = S,NA
time = 20
ignorehitpause = 1

[State golpe]
type = Changeanim
trigger1 = Time = 20
value = 60060

[State combo]
type = VarAdd
trigger1 = !time
var(12) = 1
ignorehitpause = 1

[State ]
type = Hitdef
trigger1 = !movecontact && var(12) <= 5
damage = 123,70
getpower = 200,10
givepower = 0,0
pausetime = 1,1
attr = C,NA
hitflag = MAF
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = 40
sparkxy = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 10
guard.hittime = 0
ground.velocity = 2, -14
air.velocity = 2, -14
guard.velocity = -1
air.cornerpush.veloff = -30
ground.cornerpush.veloff = -30
yaccel = .5
fall = 1
fall.recover = 0
envshake.time = 15
envshake.ampl = -4
fall.xvelocity = 0
fall.yvelocity = 0
p2facing = -1
kill = var(4)
guard.kill = var(4)

[State ]
type = StateTypeSet
trigger1 = anim = 60060 && animelemtime(5) > 5
statetype = A
movetype = I
physics = A 
ignorehitpause = 1

[State ]
type = VelsET
trigger1 = time >= 14
trigger1 = time <= 19
TRIGGER2 = TIME >= 35
TRIGGEr2 = TIME <= 35
trigger3 = Pos Y = -10
Y = 0

[State ]
type = Helper
trigger1 = movehit && !numhelper(7018)
helpertype = Normal
ID = 7018
name = "what the bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7018
ownpal = 1
size.xscale = 1
size.yscale = 1
persistent = 0

[State ]
type = VelAdd
trigger1 = time <= 13
Y = 2

[State ]
type = VelAdd
trigger1 = time <= 30 && time > 13
Y = -2

[State ]
type = posset
trigger1 = time = 15
Y = 200

[State ]
type = PosAdd
trigger1 = TIME = 15
X = (P2Dist X)+20

[State ]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

;============================================================
;-------------------------|Misil|----------------------------
[Statedef 6016]
type = S
movetype = I
physics = S
ctrl = 0
anim = 6002
velset = 0,0

[State ]
type = VarAdd
trigger1 = !time
var(12) = 1

[State 0, stopchannel0]
type = StopSnd
trigger1 = prevstateno = 100
channel = 0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State sektorID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && var(12) <= 3
helpertype = normal
stateno = 7002
name = "Misil"
id = 6016
pos = ceil(3*const(size.xscale)),ceil(-90*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

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

;============================================================
;-------------------------|air Misil|----------------------------
[Statedef 60160]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = 6017
sprpriority = 2

[State 0, stopchannel0]
type = StopSnd
trigger1 = prevstateno = 100
channel = 0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State sektorID]
type = Explod
trigger1 = !(time%1) && var(21) = 1
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(6016) < 2
helpertype = normal
stateno = 7002
name = "Misil"
id = 6016
pos = 0,ceil(-100*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State ]
type = velset
trigger1 = time = 6
x = -1
y = -3

[State ]
type = statetypeset
trigger1 = time = 5
physics = A

;==============================================================
;-------------------------|H Misil|----------------------------
[Statedef 6017]
type = S
movetype = I
physics = S
ctrl = 0
anim = 6002
velset = 0,0

[State 0, stopchannel0]
type = StopSnd
trigger1 = prevstateno = 100
channel = 0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State sektorID]
type = Explod
trigger1 = !(time%1) && var(21) = 2
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(6016) < 2
helpertype = normal
stateno = 7003
name = "Misil"
id = 7003
pos = ceil(3*const(size.xscale)),ceil(-90*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

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

;==================================================================
;-------------------------|air H Misil|----------------------------
[Statedef 60170]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = 6017
sprpriority = 2

[State 0, stopchannel0]
type = StopSnd
trigger1 = prevstateno = 100
channel = 0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State sektorID]
type = Explod
trigger1 = !(time%1) && var(21) = 2
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = animelem = 2 && numhelper(6016) < 2
helpertype = normal
stateno = 7003
name = "Misil"
id = 7003
pos = 0,ceil(-100*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State ]
type = velset
trigger1 = time = 6
x = -1
y = -3

[State ]
type = statetypeset
trigger1 = time = 5
physics = A
;================================================================
;-------------------------|2 Misiles|----------------------------
[Statedef 6018]
type = S
movetype = I
physics = S
ctrl = 0
anim = 6002
velset = 0,0

[State 0, stopchannel0]
type = StopSnd
trigger1 = prevstateno = 100
channel = 0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State sektorID]
type = Explod
trigger1 = !(time%1) && var(21) = 2
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = (!animelemtime(2) || animelemtime(2) = 15) && numhelper(6016) < 2
trigger1 = !numexplod(6016)
helpertype = normal
stateno = 7002
name = "Misil"
id = 6016
pos = ceil(3*const(size.xscale)),ceil(-90*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

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

;================================================================
;-------------------------|air 2 Misiles|----------------------------
[Statedef 60180]
type    = A
movetype= A
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = 6017
sprpriority = 2

[State 0, stopchannel0]
type = StopSnd
trigger1 = prevstateno = 100
channel = 0

[State sale]
type = PlaySnd
trigger1 = !time
value = S1,7
volume = 255

[State sektorID]
type = Explod
trigger1 = !(time%1) && var(21) = 2
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1

[State Bomb]
type = Helper
trigger1 = (!animelemtime(2) || animelemtime(2) = 15) && numhelper(6016) < 2
helpertype = normal
stateno = 7002
name = "Misil"
id = 6016
pos = 0,ceil(-100*const(size.yscale))
ownpal = 1
scale = const(size.xscale),const(size.yscale)

[State ]
type = velset
trigger1 = (animelemtime(2) = 1 || animelemtime(2) = 16) && numhelper(6016) < 2
x = -1
y = -1

[State ]
type = statetypeset
trigger1 = time = 16
physics = A
