;===============================================================================
;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 -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 15
trigger1 = (GameTime%12) = 1
;trigger1 = time = 0
anim = 32000;22063
sprpriority = 0
postype = p1
pos = 0,0
bindtime = 1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999
Scale = 0.8,0.2

[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 15
trigger1 = (GameTime%12) = 1
;trigger1 = time = 0
anim = 31000;22063
sprpriority = 0
postype = p1
pos = 0,0
bindtime = 1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999
Scale = 0.8,0.2

[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 15
trigger1 = (GameTime%12) = 1
;trigger1 = time = 0
anim = 32700;22063
sprpriority = -1
postype = p1
pos = -10,20
bindtime = 1
Scale = 1.1,1.1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 4000,Afterimage]
type = Afterimage
trigger1 = TIME = 0
time = -1
length = 8
PalBright = 0, 0, 0
PalContrast =130, 130, 130
PalAdd = 0, 0, 20
PalMul = 0.9,0.9,0.9
FrameGap = 1
TimeGap  = 1
sprpriority = 15
Trans = Add
ownpal = 1
ontop = 1

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

[state -2, PlaySound]
type = playsnd
trigger1 = WinKO
trigger1 = RoundState = 3
trigger1 = var(12) = 0
IgnoreHitPause = 1
persistent = 0
value = s5200,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(1010) = [5,15]
trigger2 = ProjHitTime(1020) = [5,15]
time = 1
movetime = 0
ignorehitpause = 1

[State -2, EnvColor]
type = EnvColor
trigger1 = Projhittime(1000) >= 0 && Projhittime(1000) <= 1
trigger2 = Projhittime(1001) >= 0 && Projhittime(1001) <= 1
trigger3 = Projhittime(1020) >= 0 && Projhittime(1020) <= 1
value = 255,255,255
time = 1
under = 1
;-------------------------------------------------------------------------------
[State -2, Helper]
type = Helper
triggerall = numhelper(9910) <= 0
trigger1 = winKo = 1 && movehit && stateno = [899,4999]
trigger2 = winKo = 1 && Projhittime(1000) >= 0 && Projhittime(1000) <= 1
trigger3 = winKo = 1 && Projhittime(1001) >= 0 && Projhittime(1001) <= 1
trigger4 = winKo = 1 && Projhittime(1010) >= 0 && Projhittime(1010) <= 1
trigger5 = winKo = 1 && Projhittime(1020) >= 0 && Projhittime(1020) <= 1
helpertype = normal
name = "KO Flash"
Id = 9910
stateno = 9910
pos = 0,0
postype = p1
facing = 1
ignorehitpause = 1
supermove = 1
pausemove = 1
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[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 != 2200 && stateno != 2300
channel = 12
;-------------------------------------------------------------------------------

[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 -2, 残像]
type = AfterImage
trigger1 = Movetype = H
time = 1

[State -2,]
type = StopSnd
trigger1 = command != "holdfwd"
trigger2 = Anim != 100
channel = 6
;---------------------------------------------------------------------------------
[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
;------------------------------------------------------------------------------
