=============================
Self Dizzy State (Stun Meter)
=============================
Created by Ragnarok

;---------------------------------------------------------------------------
Non-intrusive Dizzy Mode -- you can put opponents into this special state, 
pound the buttons to get out of it, and it won't overwrite the opponent's variables. 
Also included is the code that makes the character dizzied by long strings 
of attacks (A sort of Stun Meter). 
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Dizzy -- used for Mind Control on 
; opponents, and self on frequent attacking
;---------------------------------------------------------------------------
[Statedef 9000]
type = S
physics = S
movetype = H
ctrl = 0

[State 9000, Change Animation]
type = ChangeAnim
trigger1 = Time = 0
value = 5300

[State 9000, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9001

[State 9000, Next]
type = ChangeState
trigger1 = Time = 30
value = 9001

;-------------- Next Part
[Statedef 9001]
type = S
physics = S
movetype = H
ctrl = 0

[State 9001, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9001, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9002

[State 9001, Next]
type = ChangeState
trigger1 = Time = 30
value = 9002

;-------------- Next Part
[Statedef 9002]
type = S
physics = S
movetype = H
ctrl = 0

[State 9002, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9002, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9003

[State 9002, Next]
type = ChangeState
trigger1 = Time = 30
value = 9003

;-------------- Next Part
[Statedef 9003]
type = S
physics = S
movetype = H
ctrl = 0

[State 9003, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9003, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9004

[State 9003, Next]
type = ChangeState
trigger1 = Time = 30
value = 9004

;-------------- Next Part
[Statedef 9004]
type = S
physics = S
movetype = H
ctrl = 0

[State 9004, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9004, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9005

[State 9004, Next]
type = ChangeState
trigger1 = Time = 30
value = 9005

;-------------- Next Part
[Statedef 9005]
type = S
physics = S
movetype = H
ctrl = 0

[State 9005, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9005, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9006

[State 9005, Next]
type = ChangeState
trigger1 = Time = 30
value = 9006

;-------------- Next Part
[Statedef 9006]
type = S
physics = S
movetype = H
ctrl = 0

[State 9006, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9006, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 9007

[State 9006, Next]
type = ChangeState
trigger1 = Time = 30
value = 9007

;-------------- Last Part
[Statedef 9007]
type = S
physics = S
movetype = H
ctrl = 0

[State 9007, Flash]
type = PalFX
trigger1 = Time = 0
time = 2
add = 50,50,50
mul = 300,300,300

[State 9007, Button Jam]
type = ChangeState
triggerall = Random <= 500
trigger1 = (command = "a") || (command = "b") || (command = "c") 
trigger2 = (command = "x") || (command = "y") || (command = "z")
value = 0

[State 9007, Undizzy]
type = SelfState
trigger1 = Time = 30
ctrl = 1
value = 0

;---------------------------------------------------------------------------
;Being dizzied (self only -- the following code
;can all be omitted if you don't want the 
;character to succumb from Stun Dizzies
;---------------------------------------------------------------------------
[Statedef 9010] ;Still being hit
type = S
movetype = H
physics = N
ctrl = 0

[State 9010, Can't Hit]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9010, Clear Stun]
type = VarSet
trigger1 = Time = 0
v = 10
value = 0

[State 9010, Fall]
type = ChangeState
trigger1 = HitShakeOver
value = 9011

[Statedef 9011] ;Fall
type = A
movetype = H
physics = N
velset = -3, -4
ctrl = 0
anim = 9011

[State 9011, Grav]
type = VelAdd
trigger1 = Pos Y < 0
y = 0.35

[State 9011, Can't Hit]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9011, Fall]
type = ChangeState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 9012

[Statedef 9012] ;Ground/Getup
type = S
movetype = H
physics = S
ctrl = 0
anim = 5110

[State 9012, Stop Falling]
type = VelSet
trigger1 = Time = 0
Y = 0

[State 9012, Can't Hit]
type = NotHitBy
trigger1 = 1
value = SCA

[State 9012, Get Up]
type = ChangeAnim
trigger1 = Time = 25
value = 5120

[State 9012, Dizzy]
type = ChangeState
trigger1 = (AnimTime = 0) && (Anim = 5120)
value = 9000

;---------------------------------------------------------------------------
;-3 States -- VERY important
;---------------------------------------------------------------------------

[Statedef -3]

;Dizzying
[State -3, Add Stun for Light]
type = VarAdd
triggerall = Time = 2
trigger1 = ((StateNo = 5001) && (Anim = 5000)) || (StateNo = 5001) && (Anim = 5010)) || ((StateNo = 5011) && (Anim = 5020))
persistent = 0
ignorehitpause = 1
v = 10
value = 10

[State -3, Add Stun for Medium]
type = VarAdd
triggerall = Time = 4
trigger1 = ((StateNo = 5001) && (Anim = 5001)) || (( StateNo = 5001) && (Anim = 5011)) || ((StateNo = 5011) && (Anim = 5021))
persistent = 0
ignorehitpause = 1
v = 10
value = 40

[State -3, Add Stun for Heavy]
type = VarAdd
triggerall = Time = 6
trigger1 = ((StateNo = 5001) && (Anim = 5002)) || ((StateNo = 5001) && (Anim = 5012)) || ((StateNo = 5011) && (Anim = 5022))
persistent = 0
ignorehitpause = 1
v = 10
value = 100

[State -3, Reduce Stun]
type = VarAdd
trigger1 = Var(10) > 0
ignorehitpause = 1
v = 10
value = -1

[State -3, Dizzy Self]
type = ChangeState
trigger1 = (Var(10) >= 400) && (StateNo != [9000,9007])
value = 9010 ;Fall down before dizzy
ignorehitpause = 1
