[Statedef 3000]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
juggle = 15
poweradd = -1000

[State 0, craneoHyper3]
type = RemoveExplod
trigger1 = anim != 30122 && anim != 7094
id = 30125
ignorehitpause = 1

[State 0, subzero]
type = ChangeAnim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = !time
value = 3000
elem = 1
[State 0, scorpion]
type = ChangeAnim
triggerall = var(20) = 2 || var(20) = 6
trigger1 = !time
value = 3000
elem = 2
[State 0, reptile]
type = ChangeAnim
triggerall = var(20) = 3 || var(20) = 5
trigger1 = !time
value = 3000
elem = 3
[State 0, rain]
type = ChangeAnim
triggerall = var(20) = 7
trigger1 = !time
value = 3000
elem = 4

;==================== EFECTOS ==============================
[State 0, supercancel]
type = Helper
trigger1 = time = 1 && var(6) != 0
helpertype = normal
name = "Super Cancel"
ID = 60778
stateno = 60778
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

[State 0, Effects]
type = Helper
trigger1 = time = 1 && var(6) = 0
helpertype = normal
name = "Super effects"
ID = 60777
stateno = 60777
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
;================ FIN DE EFECTOS ===========================
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 3003
movetype = A

[State 3000, seLanza]
type = ChangeAnim
trigger1 = Time > 1 && var(6) != 0 && !numhelper(60778)
trigger2 = Time > 1 && var(6) = 0
value = 3003
persistent = 0

[State 3100, 1]
type = AfterImage
trigger1 = palno != 7
trigger1 = anim = 3003
time = 20
length = 15
framegap = 2
palcolor = 0
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1
persistent = 0

[State 3100,1]
type = null;NotHitBy
trigger1 = time <= 45
value = SCA

[State 3100, 1]
type = StateTypeSet
trigger1 = anim = 3003
trigger1 = pos Y < 0
;trigger1 = !movecontact
statetype = A
physics = A

[State 3100, 1]
type = StateTypeSet
trigger1 = movecontact
statetype = A
physics = S

[State 3100, 1]
type = velset
trigger1 = AnimElem = 2
trigger1 = anim = 3003
x = 10
y = -3

[State 3100, 1]
type = veladd
triggerall = pos y < -5
trigger1 = movecontact
y = .4
x = 3

[State 3000, Hitdef]
type = HitDef
trigger1 = anim = 3003
attr = A, HA
hitflag = MA
animtype = hard
air.animtype = hard
fall.animtype = hard
damage = 5,1
guardflag = M
guard.pausetime = 2,12
sparkno = S1040
guard.sparkno = 40
sparkxy = 19,-84
hitsound = S0,6
guardsound = S0,7
ground.type = hard
ground.slidetime = 10
ground.hittime = 17
ground.velocity = 0,0
air.velocity = 0
airguard.velocity = 0
guard.velocity = -12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 20,20
fall = 0
fall.yvelocity = 0
fall.recovertime = 1
snap = 55,-10
yaccel = .5
p2facing = 1
p2getp1stateno = 1
forcestand = 1
kill = 0
persistent = 0
;p2stateno = 30000

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit ;&& target,stateno = 30000
value = 3001
ctrl = 0

[State 3000, PosSet]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 0, landing]
type = PlaySnd
trigger1 = animelemtime(9) = 0
value = 3, 0
ignorehitpause = 1
persistent = 0

[State 3000, volver a cero]
type = ChangeState
triggerall = anim = 3003
trigger1 = movecontact
trigger1 = animelemtime(9) > 20
value = 0
ctrl = 1

;=================== p2 golpeado a stand
[Statedef 30000]
type    = S
movetype= H
physics = N
velset = 0,0

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

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5000;ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = null;StateTypeSet
trigger1 = Time
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 30001 ;HITG_SLIDE

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140
;--------------------------------- golpeado 2
[Statedef 30001]
type    = S
movetype= H
physics = N
velset = 0,0

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

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 0

[State 5001, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0
y = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = selfState
trigger1 = HitOver
value = 0
ctrl = 1
;============================combo =====================================
[Statedef 3001]
type = S
movetype = A
physics = N
velset = 0,0
juggle = 0
anim = 3004
ctrl = 0

;--------------- brutality
[State 0, ChangeState]
type = ChangeState
trigger1 = var(18) > 7
trigger2 = random < 40 && var(55) = 1 ;AI
triggerall = animelemtime(78) = 1
value = 60806
ctrl = 0

[State 0, VarAdd]
type = VarAdd
triggerall = !numpartner && !enemynear,numpartner
triggerall = !var(4) && ((var(41) >= var(58)) || (var(58) = -1)) && enemynear,life = 1
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "y"
var(18) = 1
;-------------------------
[State 0, VarAdd]
type = VarAdd
trigger1 = time = 0
v = 6
value = 1

[State 3100, 1]
type = AfterImage
triggerall = palno != 7
trigger1 = time = 0
time = 170;188
length = 16
framegap = 0
;palcolor = 3
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1

[State 3103, 1]
type = posset
trigger1 = 1
y = 0

[State 3103, 1]
type = velset
trigger1 = Time = 0
y = 0
x = 2

[State 3103, 1]
type = velset
trigger1 = animelem = 47
x = 0

[State 3100,1]
type = width
trigger1 = time >= 0
value = 25

[State 300, 1]
type = PosAdd
trigger1 = animelem = 54
x = 8

[State ja]
type = PlaySnd
triggerall = enemynear,life > 1
triggerall = movehit
trigger1 = AnimElemtime(3) = 1
trigger2 = AnimElemtime(12) = 1
trigger3 = AnimElemtime(21) = 1
trigger4 = AnimElemtime(32) = 1
trigger5 = AnimElemtime(47) = 1
trigger6 = AnimElemtime(63) = 1
trigger7 = AnimElemtime(83) = 1
trigger8 = AnimElemtime(7) =1
trigger9 = AnimElemtime(17) =1
trigger10 = AnimElemtime(26) =1
trigger11 = AnimElemtime(39) =1
trigger12 = AnimElemtime(54) =1
trigger13 = AnimElemtime(73) =1
value = s2,7+var(0)
channel = 3
volume = 255

[State 3103, brillorojo]
type = BGPalFX
triggerall = movehit
trigger1 = AnimElem = 3, =1
trigger2 = AnimElem = 12, =1
trigger3 = AnimElem = 21, =1
trigger4 = AnimElem = 32, =1
trigger5 = AnimElem = 47, =1
trigger6 = AnimElem = 63, =1
trigger7 = AnimElem = 83, =1
time = 6
add = 255,0,0

[State 3103, brilloblanco]
type = BGPalFX
triggerall = movehit
trigger1 = AnimElem = 7, =1
trigger2 = AnimElem = 17, =1
trigger3 = AnimElem = 26, =1
trigger4 = AnimElem = 39, =1
trigger5 = AnimElem = 54, =1
trigger6 = AnimElem = 73, =1
time = 6
add = 255,255,255

[State ]
type = Helper
triggerall = movehit && ((target,stateno = [5000,5001]) || (target,stateno = [30000,30001]))
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 12
trigger4 = animelem = 17
trigger5 = animelem = 21
trigger6 = animelem = 26
trigger7 = animelem = 32
trigger8 = animelem = 39
trigger9 = animelem = 47
trigger10 = animelem = 54
trigger11 = animelem = 63
trigger12 = animelem = 73
trigger13 = animelem = 83
helpertype = Normal
ID = 7015
name = "bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
[State ò_ó]
type = Explod
triggerall = movehit && ((enemynear,stateno = [5000,5001]) || (target,stateno = [5000,5001]) || (p2stateno = [5000,5001]))
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 12
trigger4 = animelem = 17
trigger5 = animelem = 21
trigger6 = animelem = 26
trigger7 = animelem = 32
trigger8 = animelem = 39
trigger9 = animelem = 47
trigger10 = animelem = 54
trigger11 = animelem = 63
trigger12 = animelem = 73
trigger13 = animelem = 83
anim = 7010
id = 7010
Postype = p2
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
vel = -2.7,-0.5
sprpriority = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)
[State ò_ó]
type = Explod
triggerall = movehit && ((enemynear,stateno = [5000,5001]) || (target,stateno = [5000,5001]) || (p2stateno = [5000,5001]))
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 12
trigger4 = animelem = 17
trigger5 = animelem = 21
trigger6 = animelem = 26
trigger7 = animelem = 32
trigger8 = animelem = 39
trigger9 = animelem = 47
trigger10 = animelem = 54
trigger11 = animelem = 63
trigger12 = animelem = 73
trigger13 = animelem = 83
anim = 7010
id = 7010
Postype = p2
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
vel = -3.3,-0.9
sprpriority = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)
[State ò_ó]
type = Explod
triggerall = movehit && ((enemynear,stateno = [5000,5001]) || (target,stateno = [5000,5001]) || (p2stateno = [5000,5001]))
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 12
trigger4 = animelem = 17
trigger5 = animelem = 21
trigger6 = animelem = 26
trigger7 = animelem = 32
trigger8 = animelem = 39
trigger9 = animelem = 47
trigger10 = animelem = 54
trigger11 = animelem = 63
trigger12 = animelem = 73
trigger13 = animelem = 83
anim = 7010
id = 7010
Postype = p2
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
vel = -3,0
sprpriority = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)
[State 3103, Lp]
type = HitDef
trigger1 = !animelemtime(animelemno(0))
attr = S, HT
hitflag = MAHLF
animtype = hard
air.animtype = hard
fall.animtype = hard
damage = 110,20
guardflag = M
sparkno = S1040
guard.sparkno = 40
sparkxy = -3,-98
hitsound = S0,ifelse(random > 150,1,11)
guardsound = S0,7
ground.type = High
ground.slidetime = 0
ground.hittime = 30
ground.velocity = 0
guard.velocity = -12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 20,20
fall = 0
snap = 45,0
yaccel = 0
;p2stateno = 30000
kill = 0
guard.kill = 0

[State vozfondo]
type = Playsnd
triggerall = enemynear,life > 1
trigger1 = AnimElem = 83, =1
persistent = 0
value = 3,var(5)

[State ]
type = Helper
triggerall = movehit && ((enemynear,stateno = [5000,5001]) || (target,stateno = [5000,5001]) || (p2stateno = [5000,5001]))
trigger1 = (AnimElem = 83, =1) && !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
scale = const(size.xscale),const(size.yscale)

[State 0, ovacionkhanarena]
type = PlaySnd
triggerall = enemynear,life > 1
triggerall = movehit
triggerall = AnimElem = 83, =1
trigger1 = var(22) = 5006
value = F9891,18
volume = 0
channel = -1
ignorehitpause = 1
persistent = 0

[State gritouppercut]
type = PlaySnd
triggerall = enemynear,life > 1
trigger1 = AnimElem = 83, =1
value = 3, ifelse(var(20) = 6,10,ifelse(!var(21),11,9))
channel = 0

[State 3103, Lp2]
type = HitDef
trigger1 = AnimElem = 83, =1
damage = 305,100
getpower = 0,0
givepower = 0,0
;pausetime = 20,1
attr = C,NA
guardflag = M
animtype = heavy
air.animtype = back
priority = 4, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 10
guard.hittime = 15
ground.velocity = -2, -25
air.velocity = -2, -25
guard.velocity = -14
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)

;-------------------------------- AI super cancel
[State -1, AIhyper2]
type = ChangeState
value = 3004
trigger1 = animelem = 81
trigger1 = anim = 3004
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = random < 200
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2bodydist X < 20
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = var(6) != 3 && !var(12)

[State -1, AIhyper3 SCORPION]
type = ChangeState
value = 3012
trigger1 = animelem = 81
trigger1 = anim = 3004
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 2 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
trigger1 = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper4 REPTILE]
type = ChangeState
value = 3013
trigger1 = animelem = 81
trigger1 = anim = 3004
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 3 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
trigger1 = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper5 ERMAC]
type = ChangeState
value = 3014
trigger1 = animelem = 81
trigger1 = anim = 3004
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 6 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
;---------------------------- fin AI
[State 0, fin]
type = ChangeState
trigger1 = time = 200
;trigger2 = time = 50 && target,stateno != [30000,30001]
value = 0
ctrl = 1


;=================================================================
;CARGAR===========================================================
;=================================================================
 ;Gauge Charge
[Statedef 3002]
type = S
movetype = I
physics = S
velset = 0, 0
ctrl = 0

[State 0, AIcancel]
type = ChangeState
trigger1 = p2bodydist X != [100,200]
triggerall = var(55) = 1
value = 0
ctrl = 0

[State 0, alacarga]
type = ChangeState
trigger1 = time = 0
triggerall = var(55) = 0
value = 3011
ctrl = 1

[Statedef 3011]
type = S
movetype = I
physics = S
velset = 0, 0
ctrl = 0
;anim = 3000

[State 0, subzero]
type = ChangeAnim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = !time
value = 30000
elem = 1

[State 0, scorpion]
type = ChangeAnim
triggerall = var(20) = 2 || var(20) = 6
trigger1 = !time
value = 30000
elem = 5

[State 0, reptile]
type = ChangeAnim
triggerall = var(20) = 3 || var(20) = 5
trigger1 = !time
value = 30000
elem = 8

[State 0, rain]
type = ChangeAnim
triggerall = var(20) = 7
trigger1 = !time
value = 30000
elem = 12

[State 706, 0]
type = PlaySnd
trigger1 = time = 10
value = S14,2
channel = 3

[State 706, 0]
type = PlaySnd
trigger1 = power = 9000
value = S14,1

[State 706, 0]
type = PlaySnd
trigger1 = time = 15
value = 3,var(5)

[State 706, 1]
type = PowerAdd
trigger1 = time >= 15
value = 5

[State 706, 1]
type = PowerAdd
trigger1 = time >= 60
value = 6

[State 706, 2]
type = Explod
trigger1 = timemod = 12, 0
id = 3006
anim = 3006
postype = p1
pos = 0, 0
sprpriority = 1
bindtime = -1
ownpal = 1
scale = const(size.xscale),const(size.yscale)
[State 706, 3]
type = RemoveExplod
trigger1 = command != "hold_z" || command != "hold_c"
id = 3005

[State 706, 3]
type = ChangeState
trigger1 = command != "hold_z" || command != "hold_c"
trigger2 = power = 9000
triggerall = var(55) = 0
value = 3003

[State 706, AItermina]
type = ChangeState
trigger1 = p2bodydist X != [100,200]
trigger2 = power > 2990 && power < 3010
trigger3 = power > 4990 && power < 5010
value = 3003
triggerall = var(55) = 1

;Stop Charging
[Statedef 3003]
type = S
movetype = I
physics = S
ctrl = 0
anim = 3005

[State 0, StopSnd]
type = StopSnd
trigger1 = !time
channel = 3

[State 0, subzero]
type = ChangeAnim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = !time
value = 3005
elem = 1

[State 0, scorpion]
type = ChangeAnim
triggerall = var(20) = 2 || var(20) = 6
trigger1 = !time
value = 3005
elem = 6

[State 0, reptile]
type = ChangeAnim
triggerall = var(20) = 3 || var(20) = 5
trigger1 = !time
value = 3005
elem = 10

[State 0, rain]
type = ChangeAnim
triggerall = var(20) = 7
trigger1 = !time
value = 3005
elem = 14

[State 707, 1]
type = RemoveExplod
trigger1 = NumExplod(3005) != 0
id = 3006

[State 707, 2]
type = ChangeState
trigger1 = Animelem = 5
trigger2 = Animelem = 9
trigger3 = Animelem = 12
trigger4 = Animelem = 17
value = 0
ctrl = 1

;=========================================================================
;================HYPER 2==================================================
[Statedef 3004]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
poweradd = -1000
juggle = 15

[State 0, craneoHyper3]
type = RemoveExplod
trigger1 = anim != 30122 && anim != 7094
id = 30125
ignorehitpause = 1

[State 0, subzeroCANCEL]
type = ChangeAnim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = !time ;&& var(6) != 0
value = 3000
elem = 1
[State 0, scorpionCANCEL]
type = ChangeAnim
triggerall = var(20) = 2 || var(20) = 6
trigger1 = !time ;&& var(6) != 0
value = 3000
elem = 2
[State 0, reptileCANCEL]
type = ChangeAnim
triggerall = var(20) = 3 || var(20) = 5
trigger1 = !time ;&& var(6) != 0
value = 3000
elem = 3
[State 0, rain]
type = ChangeAnim
triggerall = var(20) = 7
trigger1 = !time
value = 3000
elem = 4

;==================== EFECTOS ==============================
[State 0, supercancel]
type = Helper
trigger1 = time = 1 && var(6) != 0
helpertype = normal
name = "Super Cancel"
ID = 60778
stateno = 60778
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

[State 0, Effects]
type = Helper
trigger1 = time = 1 && var(6) = 0
helpertype = normal
name = "Super effects"
ID = 60777
stateno = 60777
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
;================ FIN DE EFECTOS ===========================
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 3007
movetype = A

[State 0, Golpeinicial]
type = ChangeAnim
trigger1 = time > 1 && var(6) = 0
trigger2 = time > 1 && var(6) != 0 && !numhelper(60778)
value = 3007
persistent = 0

[State 3103, snd]
type = PlaySnd
triggerall = anim = 3007
trigger1 = AnimElemtime(3) = 1
value = s2,7+var(0)
channel = 2

[State 3100, 1]
type = AfterImage
triggerall = palno != 7
trigger1 = Time = 2
time = 70
length = 16
framegap = 3
;palcolor = 3
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1

[State 3000, Hitdef]
type = HitDef
trigger1 = (p2stateno != [5020,5040])
trigger1 = anim = 3007
attr = S, HA
pausetime = 20,10
hitflag = MA
animtype = hard
damage = 100,5
guardflag = M
guard.pausetime = 2,12
sparkno = -1
guard.sparkno = S1042
hitsound = s0,2
guardsound = S201,2
ground.type = high
ground.slidetime = 10
ground.hittime = 17
ground.velocity = 0,0
air.velocity = 0
airguard.velocity = 0
guard.velocity = -12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 20,20
fall = 0
snap = 55,0
yaccel = .5
p2facing = 1
p2getp1stateno = 1
kill = 0

[State 3000, volver a cero]
type = ChangeState
trigger1 = movecontact = 0
trigger2 = moveguarded
triggerall = anim = 3007
triggerall = animelem = 5
value = 0
ctrl = 1

[State 3000,sig]
type = ChangeState
triggerall = anim = 3007
trigger1 = movehit
value = 3005
ctrl = 1
;ignorehitpause = 1
;----------------- mas golpes hyper 2
[StateDef 3005]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
sprpriority = 2

[State 3103, snd]
type = PlaySnd
trigger1 = anim = 30070 && animelemtime(3) = 1
trigger2 = anim = 30071 && animelemtime(4) = 1
trigger3 = anim = 30072 && animelemtime(2) = 1
value = s2,7+var(0)
channel = 2

[State 0, Pause]
type = null;Pause
trigger1 = anim = 30070 && !animelemtime(4)
trigger2 = anim = 30071 && !animelemtime(5)
trigger3 = anim = 30072 && !animelemtime(3)
;trigger4 = !time
time = 10
movetime = 0
endcmdbuftime = 1
pausebg =  1

[State ]
type = Helper
trigger1 = !time
trigger2 = anim = 30070 && !animelemtime(4)
trigger3 = anim = 30071 && !animelemtime(5)
trigger4 = anim = 30072 && !animelemtime(3)
helpertype = Normal
ID = 7015
name = "bleed?"
postype = p2
ignorehitpause = 1
pos = enemynear,const(size.head.pos.x),ceil(enemynear,const(size.head.pos.y)*enemynear,const(size.yscale))
stateno = 7015
ownpal = 1
size.xscale = .5
size.yscale = .5

[State 0, VarAdd]
type = VarAdd
trigger1 = time = 0
v = 6
value = 1
ignorehitpause = 1

[State ]
type = Helper
triggerall = !numhelper(7018) && movehit
trigger1 = anim = 30071
trigger1 = animelem = 4
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
scale = const(size.xscale),const(size.yscale)

[State 0, golpe1]
type = ChangeAnim
trigger1 = time = 5
value = 30072
ignorehitpause = 1

[State 0, golpe2]
type = ChangeAnim
trigger1 = Anim = 30072 && animelem = 5
value = 30070
ignorehitpause = 1

[State 0, golpe3]
type = ChangeAnim
trigger1 = Anim = 30070 && animelem = 8
value = 30071
ignorehitpause = 1

[State 0, ovacionkhanarena]
type = PlaySnd
triggerall = enemynear,life > 1
triggerall = movehit
triggerall = anim = 30071
trigger1 = var(22) = 5006
value = F9891,18
volume = 0
channel = -1
ignorehitpause = 1
persistent = 0

[State 3103, Lp2]
type = HitDef
trigger1 = Anim = 30072 ;&& animelemtime(3) = 0
trigger2 = Anim = 30070 ;&& animelemtime(5) = 0
damage = 170,70
getpower = 0,0
givepower = 0,0
pausetime = 10,5
attr = S, HA
hitflag = MAF
animtype = hard
guardflag = M
pausetime = 1,1
sparkno = S1040
guard.sparkno = S1042
sparkxy = -3,-98
hitsound = s0,2
guardsound = S201,2
ground.type = high
ground.slidetime = 0
ground.hittime = 30
ground.velocity = 0
guard.velocity = -12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 5,20
fall = 0
snap = 45,0
yaccel = 0
p2getp1stateno = 1
;p2stateno = 5000
kill = 0

[State ]
type = Playsnd
triggerall = enemynear,life > 1
trigger1 = Anim = 30071
trigger1 = movehit
persistent = 0
value = 3,var(5)
;abspan = 1

[State 3000, Super Pause]
type = Pause
trigger1 = anim = 30071 && AnimElemtime(4) = 0
movetime = 1;2
time = 40
anim = -1
p2defmul = 1
darken = 0
persistent = 0

[State gritouppercut]
type = PlaySnd
triggerall = anim = 30071
trigger1 = AnimElem = 4, =0
value = 3, ifelse(var(20) = 6,10,ifelse(!var(21),11,9))
channel = 0

[State ]
type = Hitdef
triggerall = anim = 30071
trigger1 = AnimElem = 5
trigger2 = AnimElem = 4
damage = 200,50
getpower = 0,0
pausetime = 10,5
givepower = 0,0
attr = C,NA
guardflag = M
animtype = heavy
air.animtype = back
priority = 1, hit
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S0,2
guardsound = S0,7
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 30
guard.hittime = 15
ground.velocity = -2, -35
air.velocity = -2, -30
guard.velocity = -14
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)

;-------- AI super cancels
[State -1, AIsupercancelhyper1]
type = ChangeState
value = 3000
trigger1 = anim = 400 && animelem = 4
triggerall = random <= 200
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = p2bodydist X <= 100

[State -1, AIhyper3 SCORPION]
type = ChangeState
value = 3012
trigger1 = anim = 400 && animelem = 4
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 2 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper4 REPTILE]
type = ChangeState
value = 3013
trigger1 = anim = 400 && animelem = 4
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 3 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
trigger1 = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper5 ERMAC]
type = ChangeState
value = 3014
trigger1 = anim = 400 && animelem = 4
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 6 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
;------ AI fin

[State 3005, end]
type = ChangeState
trigger1 = AnimTime = 0 && anim = 30071
value = 0
ctrl = 1
;========================================================
;=========================================
;Dodge
[Statedef 3006]
type = S
movetype = I
physics = N
anim = 3008
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0

[State 3006, AfterImage]
type = AfterImage
triggerall = palno != 7
trigger1 = time = 0
time = 17
length = 10
;palinvertall = 1
palbright = 60,60,60
palpostbright = 0,0,0

[State 702, 1]
type = PlaySnd
trigger1 = Time = 2
value = 2,7+var(0)
volume = 0
channel = 0

[State 702, 2]
type = HitBy
trigger1 = time <= 36
value = SCA, NT, ST, HT

[State 702, 3]
type = VarSet
trigger1 = Time = 0
var(5) = 0

[State 702, 4]
type = SprPriority
trigger1 = Time = 8
value = -1

[State 702, 5]
type = PlayerPush
trigger1 = Time >= 0
value = 0

;[State 702, 6]
;type = VarSet
;triggerall = animelem = 2, >= 1 && animelem = 2, < 20
;trigger1 = Command = "x"
;trigger2 = Command = "y"
;trigger3 = Command = "a"
;trigger4 = Command = "b"
;var(5) = 1

[State 702, 7]
type = ChangeState
;triggerall = var(9) != 1
;trigger1 = var(5) = 1
trigger1 = Command = "x"
trigger2 = Command = "y"
trigger3 = Command = "a"
trigger4 = Command = "b"
trigger1= animelem = 2, > 11
value = 208

[State 702, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;========================================================
;Roll (forwards)
[Statedef 3007]
type = S
movetype = I
physics = N
anim = 3009
poweradd = 0
velset = 0,0
ctrl = 0

[State 700, 1]
type = PlaySnd
trigger1 = animelem = 2
trigger1 = anim = 3009
value = 2,7+var(0)
channel = 1

[State 700, 2]
type = HitBy
trigger1 = AnimElem = 6, <=2
value = SCA, NT, ST, HT

[State 700, AFTER]
type = AfterImage
triggerall = palno != 7
trigger1 = animelem = 2
time = 10
;PalContrast =  250,250,250
PalAdd = 0, 0, 0
PalMul = 1,1,1
Length = 12
;FrameGap = 2
palbright = 80,80,80
palpostbright = 0,0,0

[State 700, 5]
type = SprPriority
trigger1 = Time = 8
value = -1

[State 700, 6]
type = VelSet
trigger1 = AnimElem = 3
x = 5.7

[State 700, 7]
type = VelAdd
trigger1 = AnimElem = 3, >= 0
trigger1 = AnimElem = 7, < 0
x = -.10

[State 700, 8]
type = VelSet
trigger1 = AnimElem = 7,>=0
x = 0

[State 700, 9]
type = PlayerPush
trigger1 = Time < 25
value = 0

[State 700, 10]
type = PlayerPush
trigger1 = Time >= 25
value = 1

[State 700, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Roll (BAck)
[Statedef 3008]
type = S
movetype = I
physics = N
anim = 3010
poweradd = 0
velset = 0,0
ctrl = 0

[State 700, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 2,7+var(0)
channel = 0

[State 701, 2]
type = HitBy
trigger1 = AnimElem = 6, <=2
value = SCA, NT, ST, HT

[State 701, 3]
type = VarSet
trigger1 = Time = 0
var(1) = 0

[State 701, AFTER]
type = AfterImage
triggerall = palno != 7
trigger1 = animelem = 2
time = 10
;PalContrast =  250,250,250
PalAdd = 0, 0, 0
PalMul = 1,1,1
Length = 12
;FrameGap = 2
palbright = 80,80,80
palpostbright = 0,0,0

[State 701, 5]
type = SprPriority
trigger1 = Time = 8
value = -1

[State 700, 6]
type = VelSet
trigger1 = AnimElem = 3
x = -5.7

[State 700, 7]
type = VelAdd
trigger1 = AnimElem = 3, >= 0
trigger1 = AnimElem = 7, < 0
x = .10

[State 700, 8]
type = VelSet
trigger1 = AnimElem = 7,>=0
x = 0

[State 701, 9]
type = PlayerPush
trigger1 = Time < 25
value = 0

[State 701, 10]
type = PlayerPush
trigger1 = Time >= 25
value = 1

[State 701, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;;=================================
;;------------------------------------
;===================================================
;Roll (BAck) COUNTER
[Statedef 3009]
type = S
movetype = I
physics = N
anim = 3010
velset = 0,0
ctrl = 0

[State 710, 1]
type = SuperPause
trigger1 = Time = 0
persistent = 1
ignorehitpause
time = 10
pos = -7,-90
poweradd = -1000
movetime = 1
darken = 1
anim = 3002

[State 710, 1]
type = PlaySnd
trigger1 = Time = 0
value = 2,7+var(0)
volume = 0
channel = 0

[State 710, 2]
type = HitBy
trigger1 = AnimElem = 9, <=5
value = SCA, NT, ST, HT

[State 710, AFTER]
type = AfterImage
triggerall = palno != 7
trigger1 = Time = 3
time = 30
trans = add1
timegap = 2
framegap = 1
length = 4

[State 710, 5]
type = SprPriority
trigger1 = Time = 8
value = -1

[State 700, 6]
type = VelSet
trigger1 = AnimElem = 4
x = -9.7

[State 700, 7]
type = VelAdd
trigger1 = AnimElem = 4, >= 0
trigger1 = AnimElem = 8, < 0
x = .10

[State 700, 8]
type = VelSet
trigger1 = AnimElem = 8,>=0
x = 0

[State 710, 9]
type = PlayerPush
trigger1 = Time < 25
value = 0

[State 710, 10]
type = PlayerPush
trigger1 = Time >= 25
value = 1

[State 710, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Roll (forwards) COUNTER
[Statedef 3010]
type = S
movetype = I
physics = N
anim = 3009
velset = 0,0
ctrl = 0

[State 711, SP]
type = SuperPause
trigger1 = Time = 0
persistent = 1
ignorehitpause
time = 10
pos = -7,-90
poweradd = -1000
movetime = 1
darken = 1
anim = 3002

[State 711, 1]
type = PlaySnd
trigger1 = Time = 0
value = 2,7+var(0)
volume = 0
channel = 0

[State 711, 2]
type = HitBy
trigger1 = animelem = 10, <=4
value = SCA, NT, ST, HT

[State 701, AFTER]
type = AfterImage
triggerall = palno != 7
trigger1 = Time = 3
time = 30
trans = add1
timegap = 2
framegap = 1
length = 4

[State 711, 5]
type = SprPriority
trigger1 = Time = 8
value = -1

[State 700, 6]
type = VelSet
trigger1 = AnimElem = 4
x = 11.7

[State 700, 7]
type = VelAdd
trigger1 = AnimElem = 4, >= 0
trigger1 = AnimElem = 8, < 0
x = -.10

[State 711, 8]
type = VelSet
trigger1 = AnimElem = 8,>=0
x = 0

[State 711, 9]
type = PlayerPush
trigger1 = Time < 0;25
value = 0

;[State 711, 10]
;type = PlayerPush
;trigger1 = Time >= 25
;value = 1

[State 711, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;===================================================================
;===================== HYPER 3 - Scorpion ==========================
;===================================================================
[Statedef 3012]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
anim = 3011
;juggle = 15
poweradd = -1000

[State 0, scorID]
type = Explod
trigger1 = !(time%1)
anim = 9999
ID = 2101
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
scale = const(size.xscale),const(size.yscale)
;==================== EFECTOS ==============================
[State 0, supercancel]
type = Helper
trigger1 = time = 0 && var(6) != 0
helpertype = normal
name = "Cancel"
ID = 60778
stateno = 60778
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
persistent = 0

[State 0, Effects]
type = Helper
trigger1 = time = 0 && var(6) = 0
helpertype = normal
name = "Normal"
ID = 60777
stateno = 60777
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
persistent = 0
;================ FIN DE EFECTOS ===========================
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 3012
movetype = A

[State 0, cortes]
type = ChangeAnim
trigger1 = time = 1 && var(6) = 0
trigger2 = time != 0 && var(6) != 0 && !numhelper(60778)
value = 3012
persistent = 0

[State 3100, 1]
type = AfterImage
triggerall = palno != 7
trigger1 = Time = 2
time = 180
length = 16
framegap = 3
;palcolor = 3
trans = add1
palbright = 106,106,138
palcontrast = 96,64,160
paladd = 0,0,0
palmul = 1,1,1

[State 0, VarAdd]
type = VarAdd
trigger1 = anim = 3012
v = 6
value = 1
persistent = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = anim = 3012
value = 1

[State 0, kitaAfterImage]
type = AfterImage
trigger1 = animelem = 7 || animelem = 19
triggerall = movecontact = 0
triggerall = anim = 3012
time = 1
length = 1
ignorehitpause = 1

[State 0, sinogolpeo]
type = ChangeState
trigger1 = animelem = 7 || animelem = 19
triggerall = movecontact = 0
triggerall = anim = 3012
value = 0
ctrl = 1

[State UP]
type = HitDef
trigger1 = animelem = 2 || animelem = 12 || animelem = 14
attr = S, HA
hitflag = MAF
animtype = light
damage = 60,30
guardflag = M
sparkno = -1
guard.sparkno = 40
sparkxy = -20,ceil(const(size.head.pos.y)*const(size.yscale))
hitsound = s17,2
guardsound = S0,6+(var(3))
ground.type = High
ground.slidetime = 0
ground.hittime = 17
ground.velocity = -2
guard.velocity = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 20,20
fall = 0
snap = 45,0
forcestand = 1
kill = var(4)
guard.kill = var(4)

[State DOWN]
type = HitDef
trigger1 = animelem = 6 || animelem = 8 || animelem = 18
attr = C, HA
hitflag = MAF
animtype = light
damage = 60,30
guardflag = M
sparkno = -1
guard.sparkno = 40
sparkxy = -20,ceil(const(size.head.pos.y)*const(size.yscale))
hitsound = s17,2
guardsound = S0,6+(var(3))
ground.type = High
ground.slidetime = 0
ground.hittime = 17
ground.velocity = 2
guard.velocity = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0
givepower = 20,20
fall = 0
snap = 45,0
forcestand = 1
kill = var(4)
guard.kill = var(4)

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 3
range = 0,1

[State 0, voz]
type = PlaySnd
triggerall = anim = 3012
trigger1 = animelem = 2 ;UP
trigger2 = animelem = 6  ;DOWN
trigger3 = animelem = 8  ;DOWN
trigger4 = animelem = 12 ;UP
trigger5 = animelem = 14 ;UP
trigger6 = animelem = 18 ;DOWN
value = S2,7+var(0)
volume = 0
channel = 2

[State 0, sangrecuelloUP]
type = Helper
triggerall = p2stateno = 5000 || p2stateno = 5001 || p2stateno = 5002
triggerall = movehit  && anim = 3012
trigger1 = animelem = 1 ;UP
trigger2 = animelem = 11 ;UP
trigger3 = animelem = 13 ;UP
helpertype = normal
name = "chorro"
ID = 7038
stateno = 7038
pos = (-5)*(target,const(size.yscale)),(target,const(size.head.pos.y)*target,const(size.yscale))
postype = p2
ownpal = 1
scale = const(size.xscale),const(size.yscale)
[State 0, sangrecuelloDOWN]
type = Helper
triggerall = p2stateno = 5000 || p2stateno = 5001 || p2stateno = 5002
triggerall = movehit  && anim = 3012
trigger1 = animelem = 5  ;DOWN
trigger2 = animelem = 7  ;DOWN
trigger3 = animelem = 17 ;DOWN
helpertype = normal
name = "chorro"
ID = 7038
stateno = 7038
pos = (-5)*(target,const(size.yscale)),(target,const(size.mid.pos.y)*target,const(size.yscale))
postype = p2
ownpal = 1
scale = const(size.xscale),const(size.yscale)
[State 0, lanzafuego]
type = ChangeAnim
trigger1 = time = 150
value = 30122

[State 0, craneo]
type = Explod
trigger1 = time = 150 && anim = 30122
anim = 30125
ID = 30125
sprpriority = 2
shadow = 0
ownpal = 1
removeongethit = 1
bindtime = -2
scale = const(size.xscale),const(size.yscale)

[State brillo]
type = Explod
trigger1 = anim = 30122
trigger1 = animelem = 8
anim = 70189
id = 30125
Postype = p1
pos = ceil(0*const(size.xscale)),ceil(0*const(size.yscale))
bindtime = -1
removeongethit = 1
sprpriority = 3
scale = const(size.xscale),const(size.yscale)
ownpal = 1
removetime = 30

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 30122 && animelem = 4
value = S1,17
volume = 0
channel = -1

[State 0, fuego]
type = Helper
triggerall = anim = 30122
trigger1 = animelem = 8
helpertype = normal
name = "fuego"
ID = 3012
stateno = 30122
pos = (const(size.head.pos.x)+(15))*2*const(size.xscale),(ceil(const(size.head.pos.y)+(19))*2*const(size.yscale))
postype = p1
ownpal = 1
scale = const(size.xscale),const(size.yscale)
;-------- AI super cancels
[State -1, AIsupercancelhyper1]
type = ChangeState
value = 3000
trigger1 = anim = 30122 && animelem = 13
triggerall = random <= 200
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = p2bodydist X <= 100

[State -1, AIhyper2]
type = ChangeState
value = 3004
trigger1 = anim = 30122 && animelem = 13
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = random < 200
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2bodydist X < 20
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = var(6) != 3 && !var(12)

[State -1, AIhyper4 REPTILE]
type = ChangeState
value = 3013
trigger1 = anim = 30122 && animelem = 13
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 3 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
trigger1 = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper5 ERMAC]
type = ChangeState
value = 3014
trigger1 = anim = 30122 && animelem = 13
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 6 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

;--- Ai fin ----------------------------

[State 3005, end]
type = ChangeState
trigger1 = anim = 30122 && animelem = 14
value = 0
ctrl = 1

;------------------------------------------
[Statedef 30121] ;p2 quemado
type    = S
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State ]
type = ChangeAnim
trigger1 = !Time
value = ifelse(selfanimexist(7697),7697,5000)

[State back]
type = Changeanim
trigger1 = time = 10 && anim != 7697 && (SelfAnimExist(9108109) || name = "Juano`s Sub guy")
value = ifelse(name = "Juano`s Sub guy",29900,9108109)

[State 0, VelSet]
type = VelSet
trigger1 = time = 10 && (anim = 29900 || anim = 9108109)
x = -2.8

[State ]
type = selfState
trigger1 = time = ifelse(anim = 7697,70,55)
value = 5050
;-------------------------------------------
[Statedef 30122]     ;fuego
type    = S
movetype= A
physics = S
anim = 30121
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S17,6
volume = 200
channel = 2
abspan = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S17,10
volume = 200

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 3
range = 0,1

[State 0, fuegoquemo]
type = PlaySnd
trigger1 = anim = 30121
trigger1 = movehit
value = S17,7
volume = 200
channel = 1
abspan = 1
persistent = 0

[State 0, HitDef]
type = HitDef
trigger1 = !(time%6);movehit
attr = A,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 0,0
givepower = 0,0
animtype = light          ;light,medium,hard,back,up,diagup
air.animtype = light
damage = 25,10
pausetime = 4,2
guard.pause,0
sparkno = -1
guard.sparkno = 40
sparkxy = 0,0
hitsound = S17,7
guardsound = S0,6+(var(3))
ground.velocity = -5
p2stateno = 30121
fall = 0
kill = parent,var(4)
guard.kill = parent,var(4)
palfx.time = ifelse(enemynear,selfAnimExist(7697),45,70)
palfx.mul = 250,224,120
palfx.add = 240,50,0

[State 1200, p2quemandose]
type = Explod
trigger1 = movehit
trigger1 = anim = 30121
trigger1 = !numexplod(30124)
anim = 30124
id = 30124
postype = p2
pos = 0,0
ownpal = 1
scale = .45,.45
sprpriority = 5
bindtime = -1
ignorehitpause = 1

[State 1200, p2quemandose2]
type = Explod
trigger1 = movehit
trigger1 = anim = 30121
trigger1 = !numexplod(301242)
anim = 30124
id = 301242
postype = p2
pos = -20,-60
ownpal = 1
scale = .45,.45
sprpriority = 5
bindtime = -1
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 30123
trigger1 = animelem = 10
trigger2 = parent,movetype = H
trigger3 = parent,anim != 30122
value = 30123

[State ]
type = Explod
trigger1 = target,stateno = 30121 && !(time%2)
anim = 7040
name = "Humo"
pos = 0, -50*const(size.yscale)*(1+fvar(2))
postype = p2
vel = 0, -2
random = 40*2*const(size.xscale)*(1+fvar(2)),45*2*const(size.yscale)*(1+fvar(2))
removetime = -2
ontop = 1
ownpal = 1
shadow = 0
removeongethit = 0
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))

[State 0, DestroySelf]
type = DestroySelf
trigger1 = anim = 30123 && animelem = 6 && target,stateno != 30121

;=================================================
;======= HYPER 4 REPTILE
[Statedef 3013]
type = S
movetype = I
physics = S
velset = 0,0
anim = 7094
ctrl = 0
juggle  = 4
poweradd = -1000
sprpriority = 0

[State 0, RepID]
type = Explod
trigger1 = !(time%1)
anim = 9999
ID = 2102
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 7094
elem = ifelse(!var(6),1,10)

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = !time
ID = 30125
pos = 999,999
postype = left
supermovetime = 9999
pausemovetime = 9999

[State 0, cabeza]
type = Explod
trigger1 = !time
anim = ifelse(!var(6),70941,70942)
ID = 30125
sprpriority = 1
shadow = 0
pausemovetime = 85
ownpal = 1
removeongethit = 1
bindtime = 99999
scale = .01+const(size.xscale)*(1+fvar(2)),.01+const(size.yscale)*(1+fvar(2))

[State 0, VarAdd]
type = VarAdd
trigger1 = animelemtime(10) = 1
v = 6
value = 1

[State 3050, Pause]
type = Pause
trigger1 = !time && animelem = 1
trigger2 = time = 1 && var(6) != 0
time = ifelse(!time,90,40)
movetime = ifelse(!time,85,40)
;==================== EFECTOS ==============================
[State 0, supercancel]
type = Helper
trigger1 = !time && var(6) != 0
helpertype = normal
name = "Super Cancel"
ID = 60778
stateno = 60778
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

[State 0, Effects]
type = Helper
trigger1 = animelem = 10 && var(6) = 0
helpertype = normal
name = "Super effects"
ID = 60777
stateno = 60777
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
;================ FIN DE EFECTOS ===========================
[State 0, vomito]
type = PlaySnd
trigger1 = animelemtime(16) = 10
value = 1,45
volume = 255
channel = 0
freqmul = .6

[State 0, acido]
type = Helper
trigger1 = animelemtime(16) = 10
trigger2 = animelemtime(16) = 35
trigger3 = animelemtime(16) = 60
helpertype = normal
name = "Acido"
ID = 3013
stateno = 30130
ownpal = 1
scale = const(size.xscale),const(size.yscale)

;-------- AI super cancels
[State -1, AIsupercancelhyper1]
type = ChangeState
value = 3000
trigger1 = animelemtime(16) > 10
triggerall = random <= 200
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = p2bodydist X <= 100

[State -1, AIhyper2]
type = ChangeState
value = 3004
trigger1 = animelemtime(16) > 10
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = random < 200
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2bodydist X < 20
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = var(6) != 3 && !var(12)

[State -1, AIhyper3 SCORPION]
type = ChangeState
value = 3012
trigger1 = animelemtime(16) > 10
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 2 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
trigger1 = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper5 ERMAC]
type = ChangeState
value = 3014
trigger1 = animelemtime(16) > 10
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 6 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
;--- Ai fin ----------------------------
[State 3005, end]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1
;===========================================
;--------------------------- Acido hyper 4
[Statedef 30130]
type    = A
movetype= A
physics = S
anim = 70940
velset = 0,0
sprpriority = 2

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

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 1
pos = (30)*parent,const(size.xscale),(-224)*parent,const(size.yscale)
ignorehitpause = 1

[State 3050, 3]
type = HitDef
trigger1 = (time%6) = 1
attr = S, HA
damage    = 25, 6
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 5,4
sparkno = -1
hitsound   = 5,4
guardsound = S0,7
ground.type = Low
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -5
ground.cornerpush.veloff = -20 ;To push far away when p2 is in corner
guard.velocity = -5
air.velocity = -4,-2
airguard.velocity = -5,-2
air.fall = 1
fall.animtype = Hard           ;Show "hard" animtype when hit for a fall
yaccel = .4
envshake.time = 25           ;Parameters for shaking the screen on hit
envshake.ampl = 7
envshake.freq = 176
fall = 1
palfx.time = 88
palfx.add = 189,70,8
palfx.mul = 70,162,0
palfx.color = 60
fall.recover = 0             ;Prevent p2 from recovering
fall.damage = 10             ;p2 will take 70 damage on hitting the ground
fall.envshake.ampl = 6       ;Parameters for shaking the screen on fall
fall.envshake.freq = 178
fall.envshake.time = 15
kill = parent,var(4)
guard.kill = parent,var(4)
fall.kill = parent,var(4)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !animtime


;=================================================
;======= HYPER 5 ERMAC
[Statedef 3014]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
juggle  = 4
poweradd = -1000
sprpriority = 0

[State 0, ermacID]
type = Explod
trigger1 = !(time%1)
anim = 9999
ID = 2105
pos = 320,240
postype = left
bindtime = 1
removetime = 1
ownpal = 1
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, craneoHyper3]
type = RemoveExplod
trigger1 = anim != 30122 && anim != 7094
id = 30125
ignorehitpause = 1

[State 0, subzero]
type = ChangeAnim
triggerall = var(20) = 1 || var(20) = 4
trigger1 = !time ;&& var(6) != 0
value = 3000
elem = 1
[State 0, scorpion]
type = ChangeAnim
triggerall = var(20) = 2 || var(20) = 6
trigger1 = !time ;&& var(6) != 0
value = 3000
elem = 2
[State 0, reptile]
type = ChangeAnim
triggerall = var(20) = 3 || var(20) = 5
trigger1 = !time ;&& var(6) != 0
value = 3000
elem = 3
[State 0, rain]
type = ChangeAnim
triggerall = var(20) = 7
trigger1 = !time
value = 3000
elem = 4

[State 0, VarAdd]
type = VarAdd
trigger1 = time = 1
v = 6
value = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = !time
ID = 30125
pos = 999,999
postype = left
supermovetime = 9999
pausemovetime = 9999
;==================== EFECTOS ==============================
[State 0, supercancel]
type = Helper
triggerall = Anim = 3000
trigger1 = !time && var(6) != 0
helpertype = normal
name = "Super Cancel"
ID = 60778
stateno = 60778
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
persistent = 0

[State 0, Effects]
type = Helper
triggerall = Anim = 3000
trigger1 = !time && var(6) = 0
helpertype = normal
name = "Super effects"
ID = 60777
stateno = 60777
postype = p1
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1
persistent = 0
;================ FIN DE EFECTOS ===========================
[State 0, ScreenBound]
type = null;ScreenBound
trigger1 = 1
value = 0

[State 0, Pause]
type = Pause
trigger1 = time = 1
time = 30
movetime = 20

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1
value = 7095

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 7095 && animelem = 4
value = 1,28

[State -3, luzsuelo]
type = Explod
triggerall = time = [21,121]
trigger1 = !(time%1)
anim = 70811
name = "suelo"
pos = 170*2*const(size.xscale)*(1+fvar(2))
vel = 0,-2
postype = p1
random = 320*2*const(size.xscale)*(1+fvar(2)),30*2*const(size.yscale)*(1+fvar(2))
ontop = 1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
ownpal = 1
shadow = 0

[State 0,luzmano]
type = Explod
trigger1 = time = 1
anim = 70950
id = 70950
Postype = p1
bindtime = -2
removeongethit = 1
sprpriority = 3
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
ownpal = 1
pausemovetime = 20

;--------------------------------------- BAJANDO MANO
[State -3, Bajandomano]
type = Explod
triggerall = !(time%5)
trigger1 = time >= 20
ID = 70811
anim = 70811
name = "Baja1"
pos = (1+fvar(2))*2*ceil(const(size.xscale))*var(10),(1+fvar(2))*2*ceil(const(size.yscale))*var(11)
random = (1+fvar(2))*2*ceil(const(size.xscale))*50,(1+fvar(2))*2*ceil(const(size.yscale))*50
postype = p1
scale = const(size.xscale)*(1+fvar(2)),const(size.yscale)*(1+fvar(2))
ontop = 1
ownpal = 1
shadow = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID = 70811
pos = (1+fvar(2))*2*ceil(const(size.xscale))*var(10),(1+fvar(2))*2*ceil(const(size.yscale))*var(11)
postype = p1

[State 0, X1]
type = VarSet
trigger1 = anim = 7095 && animelemtime(4) >= 0
v = 10
value = 45
persistent = 0
[State 0, Y1]
type = VarSet
trigger1 = anim = 7095 && animelemtime(4) >= 0
v = 11
value = -117
persistent = 0

[State 0, X2]
type = VarSet
trigger1 = anim = 7095 && animelemtime(5) >= 0
v = 10
value = 42
persistent = 0
[State 0, Y2]
type = VarSet
trigger1 = anim = 7095 && animelemtime(5) >= 0
v = 11
value = -100
persistent = 0

[State 0, X3]
type = VarSet
trigger1 = anim = 7095 && animelemtime(6) >= 0
v = 10
value = 50
persistent = 0
[State 0, Y3]
type = VarSet
trigger1 = anim = 7095 && animelemtime(6) >= 0
v = 11
value = -90
persistent = 0

[State 0, X4]
type = VarSet
trigger1 = anim = 7095 && animelemtime(7) >= 0
v = 10
value = 35
persistent = 0
[State 0, Y4]
type = VarSet
trigger1 = anim = 7095 && animelemtime(7) >= 0
v = 11
value = -58
persistent = 0
;-------------------------------------
[State grabby]
type = HitDef
trigger1 = animelemtime(4) < 30
attr = S, HT
guardflag = M
getpower = 0,0
givepower = 0,0
pausetime = 1,2
guard.pausetime = 1,8
sparkno = -1
guard.sparkno = -1
sprpriority = -1
damage = 5,2
guardsound = S0,7
p2stateno = 30140
guard.velocity = -7
ground.slidetime = 15
ground.hittime = 15
fall = 1
fall.recover = 0
fall.xvelocity = 0
fall.yvelocity = 0
yaccel = .5
numhits = 0

[State ]
type = playsnd
trigger1 = target,stateno = 30143 && !target,pos Y
value = S1,6
;-------- AI super cancels
[State -1, AIsupercancelhyper1]
type = ChangeState
value = 3000
trigger1 = animelemtime(4) = 30
triggerall = random <= 200
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = p2bodydist X <= 100

[State -1, AIhyper2]
type = ChangeState
value = 3004
trigger1 = animelemtime(4) = 30
triggerall = var(55) = 1
triggerall = power >= 1000
triggerall = random < 200
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2bodydist X < 20
triggerall = p2stateno != 7022 && numhelper(7021) = 0
triggerall = var(6) != 3 && !var(12)

[State -1, AIhyper3 SCORPION]
type = ChangeState
value = 3012
trigger1 = animelemtime(4) = 30
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 2 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
triggerall = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

[State -1, AIhyper4 REPTILE]
type = ChangeState
value = 3013
trigger1 = animelemtime(4) = 30
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = var(55) = 1
triggerall = var(20) = 3 || var(21) = 1
triggerall = random < 200
triggerall = power >= 1000
triggerall = var(6) != 3 && !var(12)
trigger1 = statetype != A
triggerall = p2stateno != 7022 && numhelper(7021) = 0

;--- Ai fin ----------------------------
[State 3005, end]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1

;-------------------------- P2 LEVANTADO
[Statedef 30140]
type    = A
movetype= H
physics = N
velset = 0,-4
anim = 5030

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

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !(time%2)
value = -3
kill = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !(time%4)
value = F5,ifelse(!(time%8),0,1)

[State -3, luz1]
type = Explod
trigger1 = !(time%1)
anim = F0
name = "Spark"
pos = 0,-60
random = ceil(const(size.yscale))*40,ceil(const(size.yscale))*60
ontop = 1
ownpal = 1
shadow = 0
scale = const(size.xscale),const(size.yscale)

[State owSubzero]
type = Playsnd
trigger1 = name = "Juano`s Sub guy"
trigger1 = !time
value = 2,var(3)
channel = 0

[State 0, PosAdd]
type = PosAdd
triggerall = time < 20
trigger1 = (time%2) = 1
y = 7

[State 0, PosAdd]
type = PosAdd
trigger1 = !(time%2)
x = 3
[State 0, PosAdd]
type = PosAdd
trigger1 = (time%2) = 1
x = -3

[State 0, ChangeState]
type = ChangeState
trigger1 = pos Y < -150
value = 30141
ctrl = 0

;..........................
[Statedef 30141]
type    = S
movetype= H
physics = N
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !(time%2)
value = -4
kill = 0
absolute = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !(time%4)
value = F5,ifelse(!(time%8),0,1)

[State -3, luz1]
type = Explod
trigger1 = !(time%1)
anim = F0
name = "Spark"
pos = 0,-60
random = ceil(const(size.yscale))*40,ceil(const(size.yscale))*60
ontop = 1
ownpal = 1
shadow = 0
scale = const(size.xscale),const(size.yscale)

[State amination]
type = ChangeAnim2
Trigger1 = 1
value = 50502

[State wallbanger]
type = posset
Trigger1 = !time && pos y >= 0
y = 0

[State is it over?]
type = ChangeState
Trigger1 = hitshakeover
value = 30142
;---------------------------------------------------------------------------
;..............................
[Statedef 30142]
type    = A
movetype= H
physics = N
velset = 0,-7

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !(time%2)
value = -5
kill = 0
absolute = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !(time%4)
value = F5,ifelse(!(time%8),0,1)

[State -3, luz1]
type = Explod
trigger1 = !(time%1)
anim = F0
name = "Spark"
pos = 0,-60
random = ceil(const(size.yscale))*40,ceil(const(size.yscale))*60
ontop = 1
ownpal = 1
shadow = 0
scale = const(size.xscale),const(size.yscale)

[State wallbanger]
type = posadd
triggerall = time <= 15
Trigger1 = !(time%2)
x = 2
y = -2

[State wallbanger]
type = posadd
triggerall = time <= 15
Trigger1 = !(time%3)
x = -2
y = 2

[State wallbanger]
type = velset
trigger1 = time = 19
y = -15

[State wallbanger]
type = veladd
trigger1 = time >= 19
y = 2


[State wallbanger]
type = ChangeState
triggerall = time >= 10
Trigger1 = (Vel Y > 5) && (Pos Y >= 5)
value = 30143

;---------------------------------------------------------------------------
;..............................
[Statedef 30143]
type    = L
movetype= H
physics = N
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = vel Y <= 0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State ]
type = posset
Trigger1 = time <= 3
y = 0

[State shake]
type = EnvShake
trigger1 = !time
time = 15
ampl = -4
freq = 75
phase = 60

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !time
value = -100
kill = enemynear,var(4)
absolute = 1

[State amination]
type = ChangeAnim
Trigger1 = !time
value = 5110

[State amination]
type = ChangeAnim
Trigger1 = time = 4
value = 5050

[State amination]
type = velset
Trigger1 = time = 4
x = 3
y = -10

[State amination]
type = veladd
Trigger1 = anim = 5050
y = .5

[State weeeeeee!]
type = SelfState
triggerall = time >= 10
trigger1 = (Vel Y > 5) && (Pos Y >= 5)
value = 5100


