===========
Guard Crush
===========
Created by Omniscience

;---------------------------------------------------------------------------
Guard Crush -- A system where guarding is limited. When the limit
is reached, the character loses his/her guard, making it free for the 
opponent to attack. 

This feature is to prevent any character from "turtling", which can be 
pretty cheap.
;---------------------------------------------------------------------------
We'll need to create the counter for this system. The first part is this
system to is to decrease the gauge whenever your character successfully 
guarded an attack.

;Guard (Weak Attacks)
[State -3, VarAdd]
type = Varadd
triggerall = GetHitVar(hitshaketime) = 5
trigger1 = (stateno = 150) || (stateno = 152)
var(0) = 1
ignorehitpause = 1

;Guard (Medium Attacks)
[State -3, VarAdd]
type = Varadd
triggerall = GetHitVar(hitshaketime) = 10
trigger1 = (stateno = 150) || (stateno = 152)
var(0) = 2
ignorehitpause = 1

;Guard (Strong Attacks)
[State -3, VarAdd]
type = Varadd
triggerall = GetHitVar(hitshaketime) = 15
trigger1 = (stateno = 150) || (stateno = 152)
var(0) = 3
ignorehitpause = 1

Next, to substract points if the character gets hit.

;Weak Attacks (Ground)
[State -3, VarAdd]
type = Varadd
triggerall = (var(0) > 0) && (time = 0) && (stateno = 5000) && (alive)
trigger1 = (anim = 5000) || (anim = 5001) || (anim = 5010) || (anim = 5011)
var(0) = -3
ignorehitpause = 1

;Weak Attacks (Air)
[State -3, VarAdd]
type = Varadd
triggerall = (var(0) > 0) && (time = 0) && (stateno = 5010) && (alive)
trigger1 = (anim = 5020) || (anim = 5021)
var(0) = -3
ignorehitpause = 1

;Strong Attacks (Ground)
[State -3, VarAdd]
type = VarAdd
triggerall = (var(0) > 0) && (time = 0) && (stateno = 5000) && (alive)
trigger1 = (anim = 5002) || (anim = 5012)
var(0) = -6
ignorehitpause = 1

;Strong Attacks - Air
[State -3, VarAdd]
type = VarAdd
trigger1 = (var(0) > 0) && (time = 0) && (stateno = 5010) && (alive) && (anim = 5022)
var(0) = -6
ignorehitpause = 1

;Falling into the ground
[State -3, VarAdd]
type = PlaySnd
trigger1 = (var(0) > 0) && (time = 0) && (stateno = 5100) && (alive)
var(0) = -9
ignorehitpause = 1
 
A code is needed, to recover from the effect if the character is not blocking, nor getting hit by an attack.

[State -3, VarAdd]
type = VarAdd
trigger1 = (var(0) > 0) && ((gametime%5) = 0) && (movetype != H) && (stateno != [130,160])
var(0) = -1
ignorehitpause = 1

[State -3, ChangeState]
type = ChangeState
trigger1 = var(0) >= 100
value = 9000
ctrl = 0
ignorehitpause = 1

Finally, create state 9000, where the character is opened for an attack (A GetHit State).
This is one example.

;Guard Crush
[Statedef 9000]
type = S
movetype = H
physics = S
anim = 5000
ctrl = 0

[State 9000, VarSet]
type = VarSet
trigger1 = Time = 0
v = 6
value = 0

[State 9000, NotHitBy]
type = NotHitBy
trigger1 = Time < 10
value = SCA

[State 9000, VelSet]
type = VelSet
trigger1 = Time = 0
x = -5

[State 9000, ChangeState]
type = ChangeState
trigger1 = Time = 15
value = 0

Add any special effects in this state, like in SFA3. (Flash effects)
 