;===============================================================================
;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
;-------------------------------------------------------------------------------
;---------------Special KO detect
[Statedef 169]
type = S
physics = S
anim = 999
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0
facep2 = 1

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 169
;-------------------------------------------------------------------------------
[Statedef 6050]
type = A
movetype = I
physics = N
anim = 6050 + root,var(25)
velset = 0, 17
ctrl = 0
sprpriority = -5

[State 3020, 1]
type = AssertSpecial
trigger1 = 1
;flag = NoBG
;flag2 = NoFG
flag = noshadow
ignorehitpause = 1

[State 1000, Especial]
type = helper
trigger1 = pos y >= 0;time = 15
id = 6050
persistent = 0
name = "MAX2"
pos = 0,-508
postype = p1
stateno = 6050
helpertype = normal
keyctrl = 0
persistent = 0

[state a]
type = posset
trigger1 = 1
x = -160

[state a];透過
type = Trans
trigger1 = 1
trans = addalpha
alpha = 306-40, 40

[State 3020, 1]
type = DestroySelf
triggerall = Time > 0
trigger1 = root,StateNo != 2015
trigger1 = root,StateNo != 2100
trigger2 = time = 0
;-------------------------------------------------------------------------------
[Statedef 6055]
type = A
movetype = I
physics = N
anim = 6055 + root,var(25)
velset = 0, 17
ctrl = 0

[State 3020, 1]
type = AssertSpecial
trigger1 = 1
;flag = NoBG
;flag2 = NoFG
flag = noshadow
ignorehitpause = 1

[State 1000, Especial]
type = helper
trigger1 = pos y >= 0;time = 15
id = 6055
persistent = 0
name = "MAX2"
pos = 0,-508
postype = p1
stateno = 6055
helpertype = normal
keyctrl = 0
persistent = 0

[state a]
type = posset
trigger1 = 1
x = -160

[state a];透過
type = Trans
trigger1 = 1
trans = addalpha
alpha = 306-40, 40

[State 3020, 1]
type = DestroySelf
triggerall = Time > 0
trigger1 = root,StateNo != 2200
trigger2 = time = 0
;-------------------------------------------------------------------------------

[Statedef -2]

[State -2,explods]
type = Explod
triggerall = p2movetype = H
trigger1 = Projhittime(1000) >= 0 && Projhittime(1000) <= 25
trigger1 = Random < 80
trigger2 = Projhittime(1200) >= 0 && Projhittime(1200) <= 25
trigger2 = Random < 200
trigger3 = Projhittime(1500) >= 0 && Projhittime(1500) <= 25
trigger3 = Random < 100
trigger4 = Projhittime(1600) >= 0 && Projhittime(1600) <= 25
trigger4 = Random < 150
trigger5 = Projhittime(2010) >= 0 && Projhittime(2010) <= 25
trigger5 = Random < 200
trigger6 = Projhittime(2025) >= 0 && Projhittime(2025) <= 250
trigger6 = Random < 50
trigger7 = Projhittime(2095) >= 0 && Projhittime(2095) <= 25
trigger7 = Random < 100
trigger8 = Projhittime(2105) >= 0 && Projhittime(2105) <= 25
trigger8 = Random < 100
trigger9 = Projhittime(2116) >= 0 && Projhittime(2116) <= 25
trigger9 = Random < 100
trigger10 = Projhittime(2302) >= 0 && Projhittime(2302) <= 25
trigger10 = Random < 150
trigger11 = Anim = 810
trigger11 = Random < 200
trigger11 = Movehit
trigger12 = Anim = 1105
trigger12 = Random < 200
trigger12 = Movehit
trigger13 = Anim = 1206
trigger13 = Random < 200
trigger13 = Movehit
trigger14 = Anim = 1170
trigger14 = Random < 200
trigger14 = Movehit
trigger15 = Anim = 1175
trigger15 = Random < 200
trigger15 = Movehit
trigger16 = Anim = 2080
trigger16 = Random < 200
trigger16 = Movehit
trigger17 = Anim = 2086
trigger17 = Random < 200
trigger17 = Movehit
trigger18 = Anim = 2201
trigger18 = Random < 200
trigger18 = Movehit
trigger19 = Anim = 2202
trigger19 = Random < 300
trigger19 = Movehit
anim = 4130
pos = -20,-40
postype = p2
sprpriority = 6
bindtime = 1
random = 80,60
ownpal = 1
supermove = 1

[State -2,explods 2]
type = Explod
triggerall = p2movetype = H
trigger1 = Projhittime(1000) >= 0 && Projhittime(1000) <= 25
trigger1 = Random < 20
trigger2 = Projhittime(1200) >= 0 && Projhittime(1200) <= 25
trigger2 = Random < 50
trigger3 = Projhittime(1500) >= 0 && Projhittime(1500) <= 25
trigger3 = Random < 50
trigger4 = Projhittime(1600) >= 0 && Projhittime(1600) <= 25
trigger4 = Random < 50
trigger5 = Projhittime(2010) >= 0 && Projhittime(2010) <= 25
trigger5 = Random < 50
trigger6 = Projhittime(2025) >= 0 && Projhittime(2025) <= 250
trigger6 = Random < 50
trigger7 = Projhittime(2095) >= 0 && Projhittime(2095) <= 25
trigger7 = Random < 50
trigger8 = Projhittime(2105) >= 0 && Projhittime(2105) <= 25
trigger8 = Random < 50
trigger9 = Projhittime(2116) >= 0 && Projhittime(2116) <= 25
trigger9 = Random < 50
trigger10 = Projhittime(2302) >= 0 && Projhittime(2302) <= 25
trigger10 = Random < 50
trigger11 = Anim = 810
trigger11 = Random < 200
trigger11 = Movehit
trigger12 = Anim = 1105
trigger12 = Random < 50
trigger12 = Movehit
trigger13 = Anim = 1206
trigger13 = Random < 50
trigger13 = Movehit
trigger14 = Anim = 1170
trigger14 = Random < 50
trigger14 = Movehit
trigger15 = Anim = 1175
trigger15 = Random < 50
trigger15 = Movehit
trigger16 = Anim = 2080
trigger16 = Random < 50
trigger16 = Movehit
trigger17 = Anim = 2086
trigger17 = Random < 50
trigger17 = Movehit
trigger18 = Anim = 2201
trigger18 = Random < 50
trigger18 = Movehit
trigger19 = Anim = 2202
trigger19 = Random < 50
trigger19 = Movehit
anim = 4140
pos = -20,-40
postype = p2
sprpriority = 6
bindtime = 1
random = 80,60
ownpal = 1
supermove = 1


[State -2, ChangeState]
type = ChangeState
value = 190
triggerall = RoundsExisted = 0
triggerall = TeamMode = Turns
trigger1 = stateno = 5900

[State -2, VarSet]
type = VarSet
triggerall = RoundState = [0,1]
trigger1 = RoundNo = 1
trigger2 = TeamMode = Turns
trigger2 = RoundsExisted = 0
value = Life

[State -2, VarSet]
type = VarSet
triggerall = Var(22) = [0,100]
triggerall = Time = 1
trigger1 = RoundNo = 1
trigger2 = RoundsExisted = 0
value = const(data.life)

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

[State -2 ,7(0)]
type = Pause;ポーズ
trigger1 = stateno = [2040,2060]
trigger1 = timemod = 2,0
ignorehitpause = 1
anim = -1
time = 3
p2defmul = 2.9
movetime = 2

[State -2, EXモード判別]
type = VarSet
trigger1 = PalNo = [7,12]
var(5) = 1

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

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

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

[State -2 ,2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Value = s5000, 0
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Value = s5000, 1
Channel = 1

;----------------------------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5000
Trigger2 = StateNo = 5010
V = 1
Range = 0,2

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Value = s5000, 2
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Value = s5000, 3
Channel = 1

;----------------------------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5000
Trigger2 = StateNo = 5010
V = 1
Range = 0,2

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5000
Trigger1 = Anim   != [5000,5001]
Trigger1 = Anim   != [5010,5011]
Trigger1 = Anim   != [5020,5021]
Trigger2 = StateNo = 5010
Trigger2 = Anim   != [5000,5001]
Trigger2 = Anim   != [5010,5011]
Trigger2 = Anim   != [5020,5021]
Value = s5000, 5
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5000
Trigger1 = Anim   != [5000,5001]
Trigger1 = Anim   != [5010,5011]
Trigger1 = Anim   != [5020,5021]
Trigger2 = StateNo = 5010
Trigger2 = Anim   != [5000,5001]
Trigger2 = Anim   != [5010,5011]
Trigger2 = Anim   != [5020,5021]
Value = s5000, 6
Channel = 1

;-----------------------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5020
V = 1
Range = 0, 2
IgnoreHitPause = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5020
Value = s5000, 4
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5020
Value = s5000, 7
Channel = 1

;===============================================================================
[State -2, Cheese!!!]
type = ChangeState
triggerall = prevstateno = [120,152]
;triggerall = statetype != A
triggerall = !alive
trigger1 = enemy,hitdefattr = SCA, SA, NA, SP, HA, HP
trigger2 = enemy,ProjHit = 1, < 20
value = 6010
ignorehitpause = 1

[State -2, Sexy KO]
type = Helper
triggerall = NumHelper(6969) = 0
trigger1 = !alive
trigger1 = matchover || teammode = turns
helpertype = normal
name = "Sexy KO detect"
id = 6969
postype = p1
pos = 0,0
stateno = 169
keyctrl = 0
ownpal = 1
facep2 = 0
ignorehitpause = 1

[State 5000, 1]
type = ChangeAnim
trigger1 = stateno = 5020
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
trigger1 = anim != 25030
value = 25030
ignorehitpause
;===============================================================================

;----------------------Critical hit
[Statedef 6005]
type = S
movetype = H
physics = S
ctrl = 0
facep2 = 1
velset = 0,0

[State 6005, ani]
type = Changeanim2
trigger1 = time = 0
value = 6005

[State 1250, pos]
type = Velset
trigger1 = time > 12
x = -10

[State 1250n state]
type = changestate
trigger1 = animtime = 0
value = 6006

[Statedef 6006]
type = A
movetype = H
physics = N

[State 865, 2]
type = VelSet
trigger1 = time < 2
x = -8

[State 865, 2]
type = VelAdd
trigger1 = 1
y = .58

[State 865, 3]
type = ChangeAnim2
trigger1 = Time = 0
value = 5030

[State 865, 4]
type = ChangeAnim
trigger1 = Time = 18
value = 5050

[State 865, 5]
type = SelfState
trigger1 = Pos Y >= 0
trigger1 = Vel Y > 0
value = 5100

[Statedef 6010]
type = S
physics = S
;anim = 6010
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0
facep2 = 1

[State 6010, anim]
type = Changeanim
trigger1 = anim = 6010
triggerall = NumHelper(6969) = 1
value = 6020

[State 6010, anim]
type = Changeanim
trigger1 = time = 0
triggerall = NumHelper(6969) = 0
value = 6010

[State 6010, air]
type = Changestate
trigger1 = pos Y != 0
value = 5000

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150

; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1]
type = ChangeAnim
triggerall = 1
trigger1 = Prevstateno = 6010
triggerall = NumHelper(6969) = 1
value = 6021

[State 5150, 1]
type = ChangeAnim
triggerall = 1
trigger1 = Prevstateno = 6010
triggerall = NumHelper(6969) = 0
value = 6011

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
trigger1 = Prevstateno != 6010
value = 25110

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = Prevstateno != 6010
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = Prevstateno != 6010
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = Prevstateno != 6010
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = Prevstateno != 6010
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = Prevstateno != 6010
triggerall = Time = 0
triggerall = SelfAnimExist(15140)
trigger1 = (anim != [15111,15119]) && (anim != [15171,15179])
trigger2 = !SelfAnimExist(15140 + (anim % 10))
value = 15140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = Prevstateno != 6010
trigger1 = Time = 0
trigger1 = (anim = [15111,15119]) || (anim = [15171,15179])
trigger1 = SelfAnimExist(15140 + (anim % 10))
value = 15140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = Prevstateno != 6010
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [15140,15149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = Prevstateno != 6010
trigger1 = Time = 0
trigger1 = Anim != [15140,15159]
trigger1 = Anim != [15110,15119]
value = 15110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1


;==============================================================================================================
;--------------------------------------------------------------------------------------------------------------




;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
trigger1 = anim != 25030
value = 25030

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
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
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

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

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),15000,15010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 15030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(15047 + GetHitVar(animtype)))
value = 15047 + GetHitVar(animtype) ;15051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
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 = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[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


; HITA_SHAKE
[Statedef 5020]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
trigger1 = anim != 25030
value = 25030
ignorehitpause

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

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

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),15000,15010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 15030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(15047 + GetHitVar(animtype)))
value = 15047 + GetHitVar(animtype) ;15051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

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

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

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140


; HITA_UP (initial going up)
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
trigger1 = anim != 25030
value = 25030

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

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

[State 5030, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 5035 ;HITA_UP (transition)


; HITA_UP_T (transition)
[Statedef 5035]
type    = A
movetype= H
physics = N

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
trigger1 = anim != 25035
value = 25035

[State 5035, 1]
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 1]
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = Time = 0
trigger1 = SelfAnimExist(15035)
trigger1 = Anim != [15051,15059] ;Not if in hit up anim
trigger1 = Anim != 15090 ;Not if hit off ground anim
value = 15035

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = var(22) = 0
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
trigger5 = var(22) != 0
trigger5 = Time = 0     ;No transition anim
trigger5 = Anim != 15035 ;.
value = 5040 ;HITA_RECOV

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = var(22) = 0
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
trigger5 = var(22) != 0
trigger5 = Time = 0     ;No transition anim
trigger5 = Anim != 15035 ;.
value = 5050 ;HITA_FALL


; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
value = 25050

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = AnimTime = 0
trigger1 = Anim = 15035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 15035
trigger2 = (Anim != [15051, 15059]) && (Anim != [15061, 15069])
trigger2 = Anim != 15090 ;Not if hit off ground anim
value = 15050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = anim = [15050,15059]
trigger1 = Vel Y >= ifelse(anim = 15050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 6]
type = ChangeState
triggerall = var(22) = 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

[State 5050, 6]
type = ChangeState
triggerall = var(22) != 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [15051,15059]) || (anim = [15061,15069]), 0, 25)
value = 5100 ;HIT_BOUNCE


; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
value = 25100

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = time = 0
trigger1 = (anim != [15051,15059]) && (anim != [15061,15069])
trigger2 = !SelfAnimExist(15100 + (anim % 10))
value = 15100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = time = 0
trigger1 = (anim = [15051,15059]) || (anim = [15061,15069])
trigger1 = SelfAnimExist(15100 + (anim % 10))
value = 15100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = anim = 25100 && time = 5
value = 5101

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20


; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
value = 25160

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = time = 0
trigger1 = anim != [15101,15109]
trigger2 = !SelfAnimExist(15160 + (anim % 10))
value = 15160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = time = 0
trigger1 = anim = [15101,15109]
trigger1 = SelfAnimExist(15160 + (anim % 10))
value = 15160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5000, 1]
type = ChangeAnim
trigger1 = time >= 0
trigger1 = NumHelper(6969) = 1
value = 25170

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
trigger1 = SelfAnimExist(15110 + (anim % 10))
trigger1 = anim = [15081,15089]
value = 15110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = time = 0
triggerall = anim != [15110,15119] ;Not already changed anim
trigger1 = anim != [15161,15169]
trigger2 = !SelfAnimExist(15170 + (anim % 10))
value = 15170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = time = 0
triggerall = anim != [15110,15119] ;Not already changed anim
trigger1 = anim = [15161,15169]
trigger1 = SelfAnimExist(15170 + (anim % 10))
value = 15170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
triggerall = NumHelper(6969) = 0
triggerall = var(22) = 0
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = anim = [15171,15179]
triggerall = SelfAnimExist(15110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 15110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = NumHelper(6969) = 0
triggerall = var(22) != 0
triggerall = Anim != [15111,15119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 15110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
triggerall = var(22) = 0
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
trigger4 = anim = 25170 && time = 5
value = 5150

[State 5110, 11] ;If just died
type = ChangeState
triggerall = var(22) != 0
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [15110,15119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;-------------------------------------------------------------------------------
[Statedef -3];常時監視ステート(p2statenoなどで相手に行動を制御された時は実行しない)
;---------------------------------------------------------------------------------

;※※※※※※※※※※※※※※※※※※※※ハイジャンプ・東方萃夢想風味
;理論は簡単
;ハイジャンプコマンドを入れた「瞬間」、varスイッチを１にする。
;でハイジャンプのコマンドは最後がU、つまりジャンプする。
;そしてジャンプステート５０の時にvarスイッチが１以上ならveladdで加速します。
;varスイッチを０にするトリガーは「ステート５０の２フレーム目」です。

[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 ;ジャンプ方向を決めるsysvarがリセットされる寸前
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, 成功したときの残像]
type = AfterImage
trigger1 = var(3) >= 1
trigger1 = stateno = 50
time = 25
trans = add1
length = 4
timeGap = 3
frameGap = 1
palBright = 0, 0, 0
palContrast = 128, 128, 128
palAdd = 0, 0, 0
palMul = 1, 1, 1

;※常時監視ステートは常に有効にしたいステートコントローラをどんどん追加していきます。

;------------------------------------------------------------------------------
;状況による行動制限編（必殺技・ガード）

;p2movetype、p2statetype、power、Lifeなど
;互いの状況をおもに利用した行動を取らせる様にしています。


[State -3, 空中ガード]
type  = ChangeState
value = 132
triggerall = p2movetype = A          ;相手が攻撃中
triggerall = statetype = A           ;自分が空中
triggerall = var(20) = 1             ;CPU時
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]         ;CPUのガードが固いと気分が悪くないですか？
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
;-------------------------------------------------------------------------------

[State 192, ]
type = AssertSpecial
trigger1 = enemy,movetype = H
trigger1 = enemy,stateno = 2620
trigger1 = enemy,anim = 2635
flag = nojugglecheck

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 2600
trigger2 = Movetype != A
ID = 2600

[State 1001,]
type = RemoveExplod
trigger1 = enemy,movetype = H
trigger1 = enemy,stateno != 2620
ID = 2625

[State 700, エフェクト表示]
type = Explod
trigger1 = enemy,movetype = H
trigger1 = enemy,stateno = 2620
trigger1 = enemy,anim = 2635
trigger1 = numExplod(2625) != 1
anim = 2625
postype = P2
pos = 0, 0
persistent = 0
sprpriority = -5
ownpal = 1
bindtime = -1
removetime = -1
removeongethit = 1
ID = 2625

[State 700, エフェクト表示]
type = Explod
triggerall = enemy,movetype = H
triggerall = enemy,prevstateno = 2620
trigger1 = enemy,stateno = 2630
trigger1 = enemy,time = 1
trigger2 = enemy,time = 1
anim = 2630
postype = P2
pos = 0, 0
persistent = 0
sprpriority = -5
ownpal = 1
removeongethit = 1
ID = 2630

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

[Statedef -3];常時監視ステート(p2statenoなどで相手に行動を制御された時は実行しない)
;---------------------------------------------------------------------------------

[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 ;ジャンプ方向を決めるsysvarがリセットされる寸前
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, 成功したときの残像]
type = AfterImage
trigger1 = var(3) >= 1
trigger1 = stateno = 50
time = 25
trans = add1
length = 4
timeGap = 3
frameGap = 1
palBright = 0, 0, 0
palContrast = 128, 128, 128
palAdd = 0, 0, 0
palMul = 1, 1, 1

;※常時監視ステートは常に有効にしたいステートコントローラをどんどん追加していきます。

;------------------------------------------------------------------------------
;状況による行動制限編（必殺技・ガード）

;p2movetype、p2statetype、power、Lifeなど
;互いの状況をおもに利用した行動を取らせる様にしています。


[State -3, 空中ガード]
type  = ChangeState
value = 132
triggerall = p2movetype = A          ;相手が攻撃中
triggerall = statetype = A           ;自分が空中
triggerall = var(20) = 1             ;CPU時
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]         ;CPUのガードが固いと気分が悪くないですか？
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
;-------------------------------------------------------------------------------

[State 192, ]
type = AssertSpecial
trigger1 = enemy,movetype = H
trigger1 = enemy,stateno = 2620
trigger1 = enemy,anim = 2635
flag = nojugglecheck

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 2600
trigger2 = Movetype != A
ID = 2600

[State 1001,]
type = RemoveExplod
trigger1 = enemy,movetype = H
trigger1 = enemy,stateno != 2620
ID = 2625

[State 700, エフェクト表示]
type = Explod
trigger1 = enemy,movetype = H
trigger1 = enemy,stateno = 2620
trigger1 = enemy,anim = 2635
trigger1 = numExplod(2625) != 1
anim = 2625
postype = P2
pos = 0, 0
persistent = 0
sprpriority = -5
ownpal = 1
bindtime = -1
removetime = -1
removeongethit = 1
ID = 2625

[State 700, エフェクト表示]
type = Explod
triggerall = enemy,movetype = H
triggerall = enemy,prevstateno = 2620
trigger1 = enemy,stateno = 2630
trigger1 = enemy,time = 1
trigger2 = enemy,time = 1
anim = 2630
postype = P2
pos = 0, 0
persistent = 0
sprpriority = -5
ownpal = 1
removeongethit = 1
ID = 2630

[State 100,]
type = StopSnd
trigger1 = command != "holdfwd"
trigger2 = Anim != 100
channel = 6
;-------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5000
Trigger2 = StateNo = 5010
V = 1
Range = 0,2

[State -2 ,2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Value = s5000, 0
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5000 || Anim    = 5010 || Anim    = 5020
Value = s5000, 1
Channel = 1

;----------------------------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5000
Trigger2 = StateNo = 5010
V = 1
Range = 0,2

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Value = s5000, 2
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5000
Trigger1 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Trigger2 = StateNo = 5010
Trigger2 = Anim    = 5001 || Anim    = 5011 || Anim    = 5021
Value = s5000, 3
Channel = 1

;----------------------------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5000
Trigger2 = StateNo = 5010
V = 1
Range = 0,2

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5000
Trigger1 = Anim   != [5000,5001]
Trigger1 = Anim   != [5010,5011]
Trigger1 = Anim   != [5020,5021]
Trigger2 = StateNo = 5010
Trigger2 = Anim   != [5000,5001]
Trigger2 = Anim   != [5010,5011]
Trigger2 = Anim   != [5020,5021]
Value = s5000, 5
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5000
Trigger1 = Anim   != [5000,5001]
Trigger1 = Anim   != [5010,5011]
Trigger1 = Anim   != [5020,5021]
Trigger2 = StateNo = 5010
Trigger2 = Anim   != [5000,5001]
Trigger2 = Anim   != [5010,5011]
Trigger2 = Anim   != [5020,5021]
Value = s5000, 6
Channel = 1

;-----------------------------------------------------------------------------------------------
[State -2]
Type = VarRandom
TriggerAll = Alive = 1
TriggerAll = Time = 0
Trigger1 = StateNo = 5020
V = 1
Range = 0, 2
IgnoreHitPause = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 0
Trigger1 = StateNo = 5020
Value = s5000, 4
Channel = 1

[State -2]
Type = PlaySnd
TriggerAll = Alive = 1
TriggerAll = Time = 1
TriggerAll = Var(1) = 1
Trigger1 = StateNo = 5020
Value = s5000, 7
Channel = 1
