; Dizzy
; CNS difficulty: medium
; This is a custom state that, once activated, will make the character "Dizzy" or "Stunned" for a short period of
; time. The character will not be able to move and will be left completely open to all attacks, but can also
; repeatly press any attack button(s) to escape from the dizzy early.
[Statedef 5300, Dizzy]
type = S
movetype = H ;H-Hit or Hurt.
physics = S
ctrl = 0
[State 5300, VarSet] ;Resets fvar(1) to Zero after the character has been dizzied.
type = VarSet
trigger1 = time = 0
fvar(1) = 0 ;Tells this VarSet to set the value to fvar(1).
persistent = 1
[State 5300, ChangeAnim] ;Change to dizzy Animation.
type = ChangeAnim ;ChangeAnim for Self, ChangeAnim2 for Opponent.
trigger1 = time = 0
value = 5300
[State 5300, Dizzy Sound]
type = PlaySnd
trigger1 = time = 0
value = F30, 0 ;Dizzy sound found in MUGEN's common.snd You can also use your own sound by removing the F.
loop = 1 ;Loops the sound.
channel = 0 ; Stops the sound from playing if the character is hit out of the dizzy.
[State 5300, Stop Dizzy Sound] ;Stops the Dizzy sound after the character is no longer dizzy or when var(3) = 25.
type = StopSnd
trigger1 = time = 299 || var(3) >= 24
channel = 0
ignorehitpause = 1
persistent = 1
[State 5300, Escape Counter] ;Creates the Dizzy Escape Counter Variable (Variable Three or var(3) ).
type = VarSet
trigger1 = time = 0
var(3) = 0 ;Sets the Variable name to the number. (Ex. Variable Three or var(3)) and the starting value to 0.
[State 5300, VarAdd] ;Rapidly Press any attack button(s) to escape the dizzy.
type = VarAdd
trigger1 = command = "a" || command = "b" || command = "c"
trigger2 = command = "x" || command = "y" || command = "z"
var(3) = 1 ;Tells this VarAdd to add the value to Variable Three.
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable every time a button is pressed.
[State 5300, ChangeState] ;The character escapes the dizzy after they hit the button enough times.
type = ChangeState
trigger1 = var(3) >= 40 ;P1 escapes dizzy after Variable Three is higher or equal to 40.
value = 0 ;Brings P1 back to there standing state.
ctrl = 1 ;Gives control back to P1.
[State 5300, ChangeState] ;Will place P1 back into there own CNS after a certain amount of time.
type = ChangeState
trigger1 = time = 300 ;Time before P1 escapes the dizzy. (5 seconds.) (60 = 1 second.)
value = 0 ;Brings P2 back to there standing state.
ctrl = 1 ;Gives control back to P2.
;-----------------------------------------------------------------------------------------------------------------
[Statedef -2, Always Executed]
;-----------------------------------------------------------------------------------------------------------------
; Dizzy Controller and Activator.
[State -2, VarSet] ;Creates the Self Dizzy Controller Variable (Float Variable One or fvar(1) ).
type = VarSet
trigger1 = time = 0
fvar(1) = fvar(1) ;Sets the Float Variable name to the number. (Ex. Float Variable One or fvar(1)) and
; the starting value to 0.
persistent = 1
[State -2, VarAdd] ;Adds the value to fvar(1) every time the character is damaged by a Light Attack.
type = VarAdd
trigger1 = time = 0 && gethitvar(damage) && gethitvar(animtype) = 0
;Activates the VarAdd whenever the character is damaged.
fvar(1) = 2 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable.
[State -2, VarAdd] ;Adds the value to fvar(1) every time the character is damaged by a Medium Attack.
type = VarAdd
trigger1 = time = 0 && gethitvar(damage) && gethitvar(animtype) = 1
;Activates the VarAdd whenever the character is damaged.
fvar(1) = 4 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable.
[State -2, VarAdd] ;Adds the value to fvar(1) every time the character is damaged by a Hard Attack.
type = VarAdd
trigger1 = time = 0 && gethitvar(damage) && gethitvar(animtype) = 2
fvar(1) = 6 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable.
[State -2, VarAdd] ;Adds the value to fvar(1) every time the character is damaged by a HitBack Attack.
type = VarAdd
trigger1 = time = 0 && gethitvar(damage) && gethitvar(animtype) = 3
fvar(1) = 6 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable.
[State -2, VarAdd] ;Adds the value to fvar(1) every time the character is damaged by a Up Attack.
type = VarAdd
trigger1 = time = 0 && gethitvar(damage) && gethitvar(animtype) = 4
fvar(1) = 8 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable.
[State -2, VarAdd] ;Adds the value to fvar(1) every time the character is damaged by a Diagonal Up Attack.
type = VarAdd
trigger1 = time = 0 && gethitvar(damage) && gethitvar(animtype) = 5
fvar(1) = 8 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1 ;Makes the VarAdd keep adding the value to the Variable.
[State -2, VarAdd] ;Takes 1 away from fvar(1) every second.
type = VarAdd
triggerall = time != 1 && var(time%60)
trigger1 = fvar(1) > 0
fvar(1) = -1 ;Tells this VarAdd to add the value to fvar(1).
persistent = 1
[State -2, ChangeState] ;Puts the character into the dizzy state after fvar(1) reaches the value.
type = ChangeState
trigger1 = fvar(1) >=40 ;Character enters dizzy state once fvar(1) reaches 40.
value = 5300 ;Brings Character into the dizzy state.
ctrl = 0 ;Takes control away from the character.
;------------------------------------------------------------------------------------------------------------------
[State -2, StateTypeSet]
type = StateTypeSet
trigger1 = stateno = 5300
statetype = S ;S,A,C,L
movetype = I ;I,A,H
physics = N ;A,C,S,N
;------------------------------------------------------------------------------------------------------------------