Super armour is just a way of taking hits and maintaining your previous state. Here's a terrible version
[Statedef 1000]
type = S
movetype = A
physics = S
ctrl = 0
; Note, i have left out both velset AND anim they shouldn't be used.
;This is what we use to set the anim for the state Note that it doesn't change unless the anim is ;different from the one we want
[State Changeanim]
type = changeanim
trigger1 = time = 0 && anim != 1000
value = 1000
;This is the bit that sends you off to a special "hitstate" when you take a punch
[State HitOverride]
type = hitoverride
trigger1 = 1
attr = SCA ;Applies to all hits, ever
stateno = 1001 ;This is the special hitstate
;For the heck of it, here is a velset we want in the state
[state Velset]
type = velset
trigger1 = animelemtime(3) = [5,20]
x = 4
;Note that i have used animtime and have given it a specific range to occur in. Only the 3rd ;frame, and only for 15 ticks from that point. Time would not give the results we want. ;Actually, even this might need tweaking
[State Changestate]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;And this is the hitstate. It's really simple
[Statedef 1001]
type = U ;This means Unchanged
movetype = H ;This makes us take damage
physics = U
;This locks the animation
[State Changeanim]
type = changeanim
trigger1 = hitshakeover = 0 ;Still shaking from hit.
value = anim ;Maintain current anim
elem = animelemno(0) ;Maintain current frame, this means the frame to be displayed in 0 ;ticks, ie the one we're on
[State ChangeState]
type = Changestate
trigger1 = hitshakeover = 1 ; Done shaking from the hit
value = prevstateno ;Return to previous state
The beauty is that you can reuse that hitstate for anything and everything that requires super armour (although you might want to set up something else for aerial hits). The only issue with it is you become immune to throws/custom states, even though most people are aware of that limitation. You do run into issues when you change back because it does technically start the animation a second time, even when locking the current animelem, it'll start you at the beginning of it again. You can if you wish use variables to memorise both the anim and the frame of all states and remember them from that. You can also use a timer variable inside your attacking states and use that to time out when things should happen. When the character is in the hitstate the var doesn't increase, so it can continue where it left off. Good for stuff like sparks that require precise timing. But that's the basics, you will get a super armour effect from the above.