;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]
[State -2, VarSet]
type = VarSet
trigger1 = StateNo != 1000
trigger1 = StateNo != 1001
trigger1 = StateNo != 1002
trigger1 = StateNo != 1010
trigger1 = StateNo != 1011
trigger1 = StateNo != 1012
trigger1 = StateNo != 1020
trigger1 = StateNo != 1021
trigger1 = StateNo != 1022
trigger1 = StateNo != 4005
trigger1 = StateNo != 4110
trigger1 = StateNo != 4111
v = 1
value = 0

[State -2, Remove Fist Flame]
type = RemoveExplod
trigger1 = StateNo != 1600
trigger1 = StateNo != 1610
trigger1 = StateNo != 1620
id = 1600

[State -2, Remove Fist Flame]
type = RemoveExplod
trigger1 = StateNo != 3100
trigger1 = StateNo != 3110
trigger1 = StateNo != 3120
trigger1 = StateNo != 3130
trigger1 = StateNo != 4003
id = 3100

[State -2, Remove Rising Flame]
type = RemoveExplod
trigger1 = StateNo != 1100
trigger1 = StateNo != 1101
trigger1 = StateNo != 1110
trigger1 = StateNo != 1111
trigger1 = StateNo != 1120
trigger1 = StateNo != 1121
trigger1 = StateNo != 3200
trigger1 = StateNo != 3201
trigger1 = StateNo != 3210
trigger1 = StateNo != 3211
trigger1 = StateNo != 3220
trigger1 = StateNo != 3221
id = 1100

[State -2, Remove Fist]
type = RemoveExplod
trigger1 = StateNo != 4003
id = 223

;-----Super Explode Finish-----
[State -2, KOExplode]
type = Explod
triggerall = MoveHit
triggerall = WinKO = 1
triggerall = NumExplod(4400) = 0
trigger1 = HitDefAttr = SA, HA
trigger2 = StateNo = 3805
trigger3 = StateNo = 3905
pos = 0,0
postype = left
bindtime = -1
anim = 4400
id = 4400
sprpriority = -5
time = 50
ignorehitpause = 1
scale = .85, 1.10
ownpal = 1

[State -2, KOExplode]
type = Explod
triggerall = ProjHit = 1
triggerall = WinKO = 1
triggerall = NumExplod(4400) = 0
trigger1 = HitDefAttr = SA, HP
trigger2 = NumProjid(1000) > 0
pos = 0,0
postype = left
bindtime = -1
anim = 4400
id = 4400
sprpriority = -5
time = 50
ignorehitpause = 1
scale = .85, 1.10
ownpal = 1

[State -2, KOSound]
type = PlaySnd
triggerall = WinKO = 1
triggerall = NumExplod(4400) = 1
trigger1 = Var(20) = 0
value = 20,0
ignorehitpause = 1
channel = 1

[State -2, 1]
type = VarAdd
triggerall = WinKO = 1
triggerall = NumExplod(4400) = 1
trigger1 = TimeMod = 1,0
ignorehitpause = 1
v = 20
value = 10

[State -2, 2]
type = VarSet
triggerall = WinKO = 1
triggerall = NumExplod(4400) = 1
trigger1 = Var(20) >= 200
ignorehitpause = 1
v = 20
value = -1

[State -2,3]
type = Envcolor
triggerall = WinKO = 1
trigger1 = NumExplod(4400) = 1
value = var(20),var(20),var(20)
ignorehitpause = 1
under = 1

[State -2,4]
type = AssertSpecial
triggerall = WinKO = 1
trigger1 = NumExplod(4400) = 1
ignorehitpause = 1
flag = NoMusic

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------
[Statedef -3]
;-----Hit Sounds-----
[State -3, VarRandom]
type = VarRandom
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5030
trigger5 = stateno = 5050
trigger6 = stateno = 5070
trigger7 = stateno = 5080
v = 0
range = 0,100

[State -3, Hit0]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [0,20]
trigger1 = Stateno = 5000
trigger2 = Stateno = 5010
value = 5000, 0

[State -3, Hit1]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [30,50]
trigger1 = Stateno = 5000
trigger2 = Stateno = 5010
value = 5000, 1

[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [50,100]
trigger1 = stateno = 5020
trigger2 = stateno = 5030
trigger3 = stateno = 5050
trigger4 = stateno = 5070
trigger5 = stateno = 5080
value = 5000, 2
;-------------------

;This controller plays a sound everytime the player lands from a jump, or
;from a back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
trigger3 = stateno = 243 ;Hop Kick land
trigger4 = stateno = 1131 ;Shienkyaku land
trigger5 = stateno = 1230 ;Rekkukyaku land
trigger6 = stateno = 3105 ;Ryu Yassai Flying Kick land
value = 0, 0
