;===============================================================================
;EN ESTA SECCION SE ENCUENTRABN TODOS LOS ESTADOS DE -2 Y -3
;DEL CHAR LA MODIFICACION SIN AUTORIZACION PUEDE SIGNIFICAR
;UNA FALLA TOTAL EN EL MISMO
;===============================================================================
;-------------------------------------------------------------------------------
[Statedef -2]

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = gametime%2 = 0
flag = noshadow
ignorehitpause = 1

;KO Flash Effect
[State -2, Sp Finish]
type = Explod
triggerall = numexplod(9910) <= 0
trigger1 = winKo = 1 && movehit && stateno = [899,4999]
trigger2 = winKo = 1 && Projhittime(1600) >= 0 && Projhittime(1600) <= 1
trigger3 = winKo = 1 && Projhittime(2200) >= 0 && Projhittime(2200) <= 1
trigger4 = winKo = 1 && Projhittime(3000) >= 0 && Projhittime(3000) <= 1
anim = 9910
removetime = -2
id = 9910
sprpriority = -9
pos = 0,0
postype = left
bindtime = -1
ignorehitpause = 1
supermove = 1
pausemove = 1
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

;Bloqueo de KO Flash Effect
[State -2, Sp Finish]
type = Explod
triggerall = numexplod(9910) <= 0
trigger1 = winKo = 1 && movehit && stateno = [200,898]
anim = 999
id = 9910
bindtime = -1
removetime = -1
ignorehitpause = 1
ownpal = 1

[state -2, PlaySound]
type = playsnd
trigger1 = WinKO
trigger1 = RoundState = 3
trigger1 = var(12) = 0
IgnoreHitPause = 1
persistent = 0
value = f5200,0

[state -2, varset]
type = varset
trigger1 = RoundState = 3
IgnoreHitPause = 1
v = 12
value = 1

[state -2, varset]
type = varset
trigger1 = RoundState = 2
IgnoreHitPause = 1
v = 12
value = 0

;Pausa de ataques
[State -3, Slow Down]
type = Pause
;triggerall = RoundState = 2
trigger1 = ProjHitTime(1000) = [5,15]
time = 1
movetime = 0
ignorehitpause = 1

[State -2, EnvColor]
type = EnvColor
trigger1 = Projhittime(3000) >= 0 && Projhittime(3000) <= 1
value = 255,255,255
time = 1
under = 1

;-------------------------------------------------------------------------------
;Variable de quemar
[State 2300, Burn]
type = Varset
triggerall = p2movetype = H
trigger1 = Anim = 1600
trigger1 = Random < 100
trigger1 = Movehit
trigger2 = Anim = 1601
trigger2 = Random < 100
trigger2 = Movehit
trigger3 = Anim = 1610
trigger3 = Random < 100
trigger3 = Movehit
trigger4 = Anim = 1620
trigger4 = Random < 100
trigger4 = Movehit
trigger5 = Anim = 1630
trigger5 = Random < 100
trigger5 = Movehit
trigger6 = Anim = 1700
trigger6 = Random < 100
trigger6 = Movehit
trigger7 = Anim = 1710
trigger7 = Random < 100
trigger7 = Movehit
trigger8 = Anim = 1720
trigger8 = Random < 100
trigger8 = Movehit
trigger9 = Anim = 1730
trigger9 = Random < 100
trigger9 = Movehit
trigger10 = Anim = 1105
trigger10 = Random < 100
trigger10 = Movehit
trigger11 = Anim = 1150
trigger11 = Random < 100
trigger11 = Movehit
trigger12 = Anim = 1155
trigger12 = Random < 100
trigger12 = Movehit
trigger13 = Anim = 2110
trigger13 = Random < 100
trigger13 = Movehit
trigger14 = Anim = 2200
trigger14 = Random < 100
trigger14 = Movehit
trigger15 = ishelper(2000) && movehit
trigger15 = Random < 100
trigger15 = Movehit
trigger16 = Anim = 3010
trigger16 = Random < 100
trigger16 = Movehit
trigger17 = Anim = 1415
trigger17 = Random < 300
trigger17 = Movehit
trigger18 = Projhittime(1000) >= 0 && Projhittime(1000) <= 25
trigger18 = Random < 100
trigger19 = Anim = 3000
trigger19 = Random < 100
trigger19 = Movehit
trigger20 = Anim = 2500
trigger20 = Random < 100
trigger20 = Movehit
trigger21 = Anim = 2010
trigger22 = Anim = 2510
persistent = 0
ignorehitpause = 1
var(23) = 1







[State 10000, Helper]
type = Helper
triggerall = p2movetype = H
trigger1 = Anim = 1600
trigger1 = Random < 100
trigger1 = Movehit
trigger2 = Anim = 1601
trigger2 = Random < 100
trigger2 = Movehit
trigger3 = Anim = 1610
trigger3 = Random < 100
trigger3 = Movehit
trigger4 = Anim = 1620
trigger4 = Random < 100
trigger4 = Movehit
trigger5 = Anim = 1630
trigger5 = Random < 100
trigger5 = Movehit
trigger6 = Anim = 1700
trigger6 = Random < 100
trigger6 = Movehit
trigger7 = Anim = 1710
trigger7 = Random < 100
trigger7 = Movehit
trigger8 = Anim = 1720
trigger8 = Random < 100
trigger8 = Movehit
trigger9 = Anim = 1730
trigger9 = Random < 100
trigger9 = Movehit
trigger10 = Anim = 1105
trigger10 = Random < 100
trigger10 = Movehit
trigger11 = Anim = 1150
trigger11 = Random < 100
trigger11 = Movehit
trigger12 = Anim = 1155
trigger12 = Random < 100
trigger12 = Movehit
trigger13 = Anim = 2110
trigger13 = Random < 100
trigger13 = Movehit
trigger14 = Anim = 2200
trigger14 = Random < 100
trigger14 = Movehit
trigger15 = ishelper(2000) && movehit
trigger15 = Random < 100
trigger15 = Movehit
trigger16 = Anim = 3010
trigger16 = Random < 100
trigger16 = Movehit
trigger17 = Anim = 1415
trigger17 = Random < 300
trigger17 = Movehit
trigger18 = Projhittime(1000) >= 0 && Projhittime(1000) <= 25
trigger18 = Random < 100
trigger19 = Anim = 3000
trigger19 = Random < 100
trigger19 = Movehit
trigger20 = Anim = 2500
trigger20 = Random < 100
trigger20 = Movehit
helpertype = normal
stateno = 4140
pos = 0,-50
postype = p2
sprpriority = 9
bindtime = 1
random = 100,100
ownpal = 1







[State 1000, VarSet]
type = VarSet
trigger1 = p2movetype != H
v = 23
value = 0
persistent = 0
;-------------------------------------------------------------------------------

[State -2, varset]
type = varset
trigger1 = roundstate = 0
trigger1 = facing = 1
var(57) = 1

[State -2, varset]
type = varset
trigger1 = roundstate = 0
trigger1 = facing = -1
var(57) = 2

;-------------------------------------------------------------------------------
;Intro and K.O. no Lifebars
[State -2]
type = AssertSpecial
trigger1 = roundstate = [0,1]
trigger2 = roundstate = 4
trigger3 = Ctrl = 0 && (Anim = [0,2]) && MoveType != H
flag = NoBarDisplay
ignorehitpause = 1
;----------------------------------------------------------------------------

[State -2, No sound in Guanding KO]
type = AssertSpecial
triggerall = prevstateno = [120,152]
trigger1 = stateno = 5000 || stateno = 5010
trigger1 = statetype != A
flag = Nokosnd
ignorehitpause = 1

[State -2, Guarding KO]
type = ChangeState
trigger1 = prevstateno = [120,152]
trigger1 = !alive
value = 6010
ignorehitpause = 1
;----------------------------------------------------------------------------
[State 100, StopSnd]
type = StopSnd
trigger1 = stateno != 910 && stateno != 911
channel = 11

[State 100, StopSnd]
type = StopSnd
trigger1 = stateno != 910 && stateno != 911
channel = 12

[State 100, StopSnd]
type = StopSnd
trigger1 = stateno != 1400 && stateno != 1450
channel = 13

;-------------------------------------------------------------------------------
;Slow Down When ProjHit
[State -3, Slow Down]
type = SuperPause
triggerall = RoundState = 2
trigger1 = ProjHitTime(1000) = [12,25]
anim = -1
sound = -1
time = 1
darken = 0
p2defmul = 1
;-------------------------------------------------------------------------------

[State -2, 二人目のイントロ]
type = ChangeState
value = 190
triggerall = TeamMode = Turns
trigger1 = stateno = 5900

[State -2, ライフ確認]
type = VarSet
triggerall = RoundState = [0,1]
trigger1 = RoundNo = 1
trigger2 = TeamMode = Turns
trigger2 = RoundsExisted = 0
v = 22
value = Life

[State -2, ライフ取得ミス対策]
type = VarSet
triggerall = Var(22) = [0,100]
triggerall = Time = 1
trigger1 = RoundNo = 1
trigger2 = RoundsExisted = 0
v = 22
value = const(data.life)

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

[State 700,]
type = palfx
trigger1 = var(33) != 0
trigger1 = 1
time = 20
add = 90,50,0

[State 1100, ]
type = Varset
triggerall = var(33) != 0
trigger1 = enemy,movetype = H
trigger1 = enemy,Gethitvar(hitcount) >= 2
fvar(1) = enemy,Gethitvar(hitcount)

[State 1100, ]
type = Varset
trigger1 = var(33) = 0
trigger2 = stateno = 0
trigger3 = Enemy,stateno = 0
fvar(1) = 0

[State 1100, ]
type = Varset
trigger1 = fvar(1) >= 13
fvar(1) = 13

[State 1100, ]
type = AttackMulSet
trigger1 = var(33) != 0
value = ((10.0-(((fvar(1))*3.2)/10)*2)/10.0)

[State 1100, ]
type = AttackMulSet
trigger1 = stateno = 0
value = 1

[State 1100, ]
type = Varadd
trigger1 = (GameTime%2) = 0 && var(33) != 0
var(33) = -1
persistent = 0

[State 1000, ]
type = Varset
trigger1 = Enemy,Stateno = 5100
trigger2 = Enemy,Stateno = 0
var(17) = 0

[State 1000, ]
type = Varset
trigger1 = Stateno = 0
var(18) = 0

[State -2, 残像]
type = AfterImage
trigger1 = Movetype = H
time = 1

[State -2,]
type = StopSnd
trigger1 = command != "holdfwd"
trigger2 = Anim != 100
channel = 6


;-------------------------------------------------------------------------------
[State -2, 4]
type = VarRandom
triggerall = Time = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
v = 4
range = 0,30

[State -2, 5]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [0,3]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = s5000,0

[State -2, 6]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [4,7]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = s5000,1

[State -2, 6]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [8,11]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = s5000,2

[State -2, 6]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [12,16]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = s5000,3

[State -2, 6]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [17,30]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = s0,99

[State -2]
type = PlaySnd
Triggerall = Alive = 1
triggerall = Time = 1
trigger1 = (stateno = 5100) && (anim = 5100 || anim = 5101 || anim = 5102)
value = S5000,2
;-------------------------------------------------------------------------------
[State -2, EXモード判別]
type = VarSet
trigger1 = PalNo = [7,12]
var(5) = 1
;---------------------------------------------------------------------------------
[Statedef -3]
;---------------------------------------------------------------------------------

[State -3, コマンドを入れたらVarをON] 
type = VarSet
trigger1 = command = "jump"
trigger1 = ctrl
trigger1 = statetype = S
v = 3
value = 1

[State -3, sysvarを引継ぐ]
type = VarSet
trigger1 = Var(3) = 1
trigger1 = stateno = 40
trigger1 = AnimTime = 0
var(3) = ifelse(sysvar(1)=0, 2, ifelse(sysvar(1)=1, 3, 4))

[State -3, varをOFFにするステート]
type = VarSet
triggerall = Time = 2
trigger1 = stateno = 50
trigger2 = stateno != [40,59]
v = 3
value = 0

[State -3, 前にボタンを押してたら前にも加速]
type = VelAdd
trigger1 = var(3) = 3
trigger1 = stateno = 50
y = -0.8
x = 2

[State -3, 後ろなら後ろに加速]
type = VelAdd
trigger1 = var(3) = 4
trigger1 = stateno = 50
y = -0.8
x = -2.1

[State -3, 垂直ジャンプにveladdを使って上に加速]
type = VelAdd
trigger1 = var(3) = 2
trigger1 = stateno = 50
y = -2

[State -3, Afterimage]
type = Afterimage
trigger1 = var(3) >= 1
trigger1 = stateno = 50
trigger2 = AnimTime = 0
trigger2 = prevstateno = 100 ;RUN_FWD
trigger2 = sysvar(1) = 1
time = 2
length = 7
PalBright = 0,0,0
PalContrast = 256,256,256
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 2041, 2]
type = Afterimagetime
trigger1 = stateno = 50
trigger1 = time%2 = 0 && Time < 20
time = 2
;------------------------------------------------------------------------------
[State -3, 空中ガード]
type  = ChangeState
value = 132
triggerall = p2movetype = A
triggerall = statetype = A
triggerall = var(20) = 1
triggerall = ctrl
triggerall = stateno != [190,194]
triggerall = p2statetype = A
trigger1   = P2BodyDist X = [40,80]
trigger1   = var(21) = [0,39]
trigger2   = P2BodyDist X = [-20,39]
trigger2   = var(21) = [0,59]

[State -3, 対地 立ちガード]
type  = ChangeState
value = 130
triggerall = p2movetype = A
triggerall = statetype != A
triggerall = var(20) = 1
triggerall = ctrl
triggerall = stateno != [190,194]
triggerall = p2statetype = S
trigger1   = P2BodyDist X = [40,90]
trigger1   = var(21) = [0,14]
trigger2   = P2BodyDist X = [-15,39]
trigger2   = var(21) = [10,29]
trigger3   = enemy,teammode = simul
trigger3   = P2BodyDist X = [-50,-16]
trigger3   = var(21) = [0,39]
trigger4   = P2BodyDist X = [-15,39]
trigger4   = enemy,hitdefattr = S, NA,SA,HA
trigger4   = Random < 200

[State -3, 対空 立ちガード]
type  = ChangeState
value = 130
triggerall = p2movetype = A
triggerall = statetype != A
triggerall = var(20) = 1
triggerall = ctrl
triggerall = stateno != [190,194]
triggerall = p2statetype = A
trigger1   = P2BodyDist X = [40,90]
trigger1   = var(21) = [0,15]
trigger2   = P2BodyDist X = [-40,39]
trigger2   = var(21) = [0,32]
trigger3   = P2BodyDist X = [-40,39]
trigger3   = enemy,hitdefattr = A, NA,SA,HA
trigger3   = Random < 400

[State -3, しゃがみガード]
type  = ChangeState
value = 131
triggerall = p2movetype = A
triggerall = statetype != A
triggerall = var(20) = 1
triggerall = ctrl
triggerall = stateno != [190,194]
trigger1   = p2statetype = C
trigger1   = P2BodyDist X = [40,85]
trigger1   = var(21) = [0,24]
trigger2   = p2statetype = C
trigger2   = P2BodyDist X = [-20,39]
trigger2   = var(21) = [0,39]
trigger3   = p2statetype = S
trigger3   = P2BodyDist X = [-15,39]
trigger3   = var(21) = [0,9]
trigger4   = p2statetype = C
trigger4   = enemy,teammode = simul
trigger4   = P2BodyDist X = [-50,-16]
trigger4   = var(21) = [0,39]
trigger5   = P2BodyDist X = [-20,39]
trigger5   = enemy,hitdefattr = C, NA,SA,HA
trigger5   = Random < 300

[State -3, 投げ]
type  = ChangeState
value = 800
triggerall = var(20) = 1
triggerall = roundstate = 2
triggerall = Random = [0,59]
triggerall = statetype = S
triggerall = ctrl
trigger1   = P2BodyDist X = [-3,3)
trigger1   = p2statetype != A
trigger1   = p2statetype != L
trigger1   = p2movetype != H
