;Vars:
;	0  = temp var
;	1  = temp var
;	2  = enemy 1 id
;	3  = enemy 1 guardcrush guage
;	4  = enemy 2 id
;	5  = enemy 2 guardcrush guage
;	6  = guard break strength
;	7  = guard break sound trigger
;	8  = guard crush fx check
;	9  = weapon type (0 = none,  1 = old, 2 = bronze, 3 = steel, 4 = diamond, 5 = legendary,
;				6 = fire, 7 = ice, 8 = thunder, 9 = axe)
;	10 = shield type
;	11 = weapon sub-layer
;	12 = shield sub-layer
;	13 = base sprpriority
;	14 = id of most recent hitdef
;	15 = highjump buffer
;	16 = custom gameplay off/on
;	17 = Weapon trail stateno
;	18 = hit tracking
;	19 = current experience
;	20 = experience level
;	21 = available weapons ([weapon-levels]: axe-1, thunder-1, ice-1, fire-1, normal-5)
;	22 = warzard hitsparks off/on
;	23 = advanced fx off/on
;	24 = current Mystic Break element
;	25 = getup voice flag
;	26 = movehit/fx sound flag
;	27 = fx element flag
;	28 = previous hitpausetime
;	29 = p2movetype was A
;	30 = sword selection setting
;	31 = life last frame
;	32 = power last frame
;	33 = delay damage dampening
;	34 = previous weapon
;	35 = previous shield
;	36 = hitstun counter
;	37 = previous uniqhitcount
;	38 = combo counter
;	39 = xp needed per level
;	40 = maximum level
;	41 = invis flag
;	42 = special invincibility setting

;	48 = enemy superattack
;	49 = perseus buffer time
;	50 = perseus charge time
;	51 = perseus high/low bias
;	52 = enemy cornered
;	53 = hitstun balance
;	54 = p2movecontact
;	55 = wakeup timer
;	56 = pause/superpause check
;	57 = (Winane) GameTime var, for pause and custom state check
;	58 = AI action select
;	59 = (Winane) AI

;FVars
;	0  = temp var
;	1  = temp var
;	5  = normal attack damage multiplier
;	6  = special/hyper attack damage multiplier
;	7  = chip damage multiplier
;	8  = guard crush multiplier
;	9  = defense multiplier
;	10 = AI aggression setting
;	11 = level requirements setting
;	12 = guard crush strength setting
;	13 = overall damage mod
;	14 = damage dampening setting
;	15 = damage bonus per level
;	16 = defence bonus per level
;	17 = additional xp needed per level
;	18 = target x pos
;	19 = target y pos
;       39 = AI guard jump/crouch response

[Data]
life = 1050			;Amount of life to start with
attack = 80		;attack power (more is stronger)
defence = 100		;defensive power (more is stronger)
power = 3000
fall.defence_up = 50	;Percentage to increase defense everytime player is knocked down
liedown.time = 60		;Time which player lies down for, before getting up
airjuggle = 1		;Number of points for juggling
sparkno = 2			;Default hit spark number for HitDefs
guard.sparkno = 40	;Default guard spark number
KO.echo = 0			;1 to enable echo on KO
volume = 200			;Volume offset (negative for softer)
IntPersistIndex = 9	;Variables with this index and above will not have their values
FloatPersistIndex = 2   ;reset to 0 between rounds or matches. There are 60 int variables,
  				;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
  				;If omitted, then it defaults to 60 and 40 for integer and float
  				;variables repectively, meaning that none are persistent, i.e. all
  				;are reset. If you want your variables to persist between matches,
  				;you need to override state 5900 from common1.cns.


[Size]
;Adapted scale large (direct conversion from CPS-3)
	xscale=0.83333333333333333333333333333333
	yscale=1.0714285714285714285714285714286

;Adapted scale small (bit smaller to avoid pixellation)
;	xscale = 0.801           ;Horizontal scaling factor.
;	yscale = 1

;Original scale (no scaling, may appear "squashed")
;	xscale = 1           ;Horizontal scaling factor.
;	yscale = 1           ;Vertical scaling factor.

ground.back = 30		;Player width (back, ground)
ground.front = 45		;Player width (front, ground)
air.back = 15		;Player width (back, air)
air.front = 35		;Player width (front, air)
height = 60			;Height of player (for opponent to jump over)
attack.dist = 240		;Default attack distance
proj.attack.dist = 90	;Default attack distance for projectiles
proj.doscale = 1		;Set to 1 to scale projectiles too   
head.pos = 16, -85	;Approximate position of head
mid.pos = 12.5, -43		;Approximate position of midsection
shadowoffset = 0		;Number of pixels to vertically offset the shadow
draw.offset = 0,0		;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 1.9		;Walk forward
walk.back = -1.9		;Walk backward
run.fwd  = 7.5, 0		;Run forward (x, y)
run.back = -7.5, 0	;Hop backward (x, y)
jump.neu = 0,-10.7		;Neutral jumping velocity (x, y)
jump.back = -3		;Jump back Speed (x, y)
jump.fwd = 3		;Jump forward Speed (x, y)
runjump.back = -3,-14	;Running jump speeds (opt)
runjump.fwd = 3,-14	;.

[Movement]
airjump.num = 0		;Number of air jumps allowed (opt)
airjump.height = 35	;Minimum distance from ground before you can air jump (opt)
yaccel = .536		;Vertical acceleration
stand.friction = .85	;Friction coefficient when standing
crouch.friction = .82	;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Format:
; [Statedef STATENO]
; type = ?      S/C/A/L  stand/crouch/air/liedown
; movetype = ?  I/A/H    idle/attack/gethit
; physics = ?   S/C/A/N  stand/crouch/air/none
; juggle = ?             air juggle points move requires
;
; [State STATENO, ?]     ? - any number you choose
; type = ?
; ...

;---------------------------------------------------------------------------
; Ultimate Guard
[Statedef 160]
type = S
physics = S
movetype = U
ctrl = 0
anim = 160
sprpriority = (var(13) := 0)

;[State 160, 3] ;Stop moving if low velocity or 4 ticks pass
;type = VelSet
;trigger1 = abs(vel x) < 2
;trigger2 = Time = 4
;x = 0

[State 160, Turn]
type = Turn
trigger1 = time = 0
trigger1 = p2dist x < 0
trigger1 = prevstateno != 165

[State 160, VarSet]
type = VarSet
trigger1 = !time
var(0) = 0

[State 160, VarSet]
type = VarSet
trigger1 = !var(0)
trigger1 = animelemno(0) < 6
trigger1 = command = "z" && command = "c"
var(0) = 1

[State 160, HitVelSet]
type = HitVelSet
trigger1 = !time
trigger1 = prevstateno = 165
trigger1 = fvar(0)
x = 1

[State 160, VarSet]
type = VarSet
trigger1 = 1
var(1) = 1

[State 160, VelSet]
type = VelSet
trigger1 = !hitover
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 160, StateTypeSet]
type = StateTypeSet
trigger1 = hitover
movetype = I

[State 160, ChangeAnim]
type = ChangeAnim
trigger1 = !var(0)
trigger1 = animelemno(0) = 6
trigger1 = command = "z" && command = "c"
trigger1 = var(0) := 1
value = 160
elem = 6

[State 160, ChangeAnim]
type = ChangeAnim
trigger1 = var(0)
trigger1 = animelem = 6, = 20
trigger2 = animelemno(0) = 6
trigger2 = time = 61
value = 160
elem = 7

[State 160, 2]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

[State 160, PalFX]
type = PalFX
trigger1 = !var(0)
trigger1 = animelem = 7, < -1
trigger1 = time%2
mul = 288, 192, 192
add = -24, -32, -32
time = 1

[State 160, PalFX]
type = PalFX
trigger1 = var(0)
trigger1 = animelem = 7, < -1
mul = 320, 288, 192
add = 8, 0, -32
color = 128*(time%2)
time = 1

[State 160, HitOverride]
type = HitOverride
trigger1 = animelem = 7, < -1
attr = SCA, AA, AP
stateno = ifelse(var(0), 166, 161)
ignorehitpause = 1

[State 160, ReversalDef]
type = ReversalDef
trigger1 = var(0)
reversal.attr = SCA, AA, AP
p1stateno = 166
sparkno = -1
pausetime = 0, 9
ignorehitpause = 1

[State 160, No Damage]
type = VarSet
trigger1 = animelemno(0) < 6 || animelemno(1) = 6
var(1) = life

;---------------------------------------------------------------------------
; Ultimate Guard Shake
[Statedef 161]
type = S
physics = N
movetype = H
ctrl = 0
anim = 161
sprpriority = (var(13) := 0)
velset = 0, 0

[State 161, HitFallSet]
type = HitFallSet
trigger1 = 1
value = 0

[State 161, VarSet]
type = VarSet
trigger1 = !var(0)
trigger1 = command = "z" && command = "c"
var(0) = 20
ignorehitpause = 1

[State 161, Turn]
type = Turn
trigger1 = time = 0
trigger1 = p2dist x < 0

[State 161, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 6, 1

[State 161, Explod]
type = Explod
triggerall = var(22)
trigger1 = time = 0
postype = p1
anim = 17006
bindtime = 1
pos = floor(95*const(size.xscale)), floor(-45*const(size.yscale))
facing = -1
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 161, Explod]
type = Explod
triggerall = !var(22)
trigger1 = time = 0
postype = p1
anim = F40
bindtime = 1
pos = floor(95*const(size.xscale)), floor(-45*const(size.yscale))
facing = -1
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 161, No Damage]
type = VarSet
trigger1 = !time
var(1) = life

[State 161, No Damage]
type = LifeAdd
trigger1 = time = 0
value = gethitvar(damage)
persistent = 0

[State 161, No Damage]
type = LifeAdd
trigger1 = time
trigger1 = life < var(1)
value = var(1) - life

[State 161, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 161

[State 161, PalFX]
type = PalFX
trigger1 = var(0)
mul = 320, 288, 192
add = 8, 0, -32
color = 128*(time%2)
time = 1
ignorehitpause = 1

[State 161, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 162

[State 161, ReversalDef]
type = ReversalDef
trigger1 = var(0)
reversal.attr = SCA, AA, AP
p1stateno = 166
pausetime = 0, 9
sparkno = -1
ignorehitpause = 1

[State 161, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
stateno = ifelse(var(0), 166, 161)
ignorehitpause = 1

[State 161, VarAdd]
type = VarAdd
trigger1 = var(0) > 0
var(0) = -1
ignorehitpause = 1

[State 161, Width]
type = Width
trigger1 = 1
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State Shield Layer]
type = Null
trigger1 = var(12) := 2
ignorehitpause = 1

;---------------------------------------------------------------------------
; Ultimate Guard Knocked Back
[Statedef 162]
type = S
physics = S
movetype = H
ctrl = 0
sprpriority = (var(13) := 0)

[State 162, VarSet]
type = VarSet
trigger1 = !var(0)
trigger1 = command = "z" && command = "c"
var(0) = 10
ignorehitpause = 1

[State 162, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 162, 2]
type = ChangeState
trigger1 = HitOver
trigger2 = time > 30
value = 163

[State 162, PalFX]
type = PalFX
trigger1 = var(0)
mul = 320, 288, 192
add = 8, 0, -32
color = 128*(time%2)
time = 1
ignorehitpause = 1

[State 162, ReversalDef]
type = ReversalDef
trigger1 = var(0)
reversal.attr = SCA, AA, AP
p1stateno = 166
pausetime = 0, 9
sparkno = -1
ignorehitpause = 1

[State 162, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
stateno = ifelse(var(0), 166, 161)
ignorehitpause = 1

[State 162, VarAdd]
type = VarAdd
trigger1 = var(0) > 0
var(0) = -1
ignorehitpause = 1

[State 162, No Damage]
type = VarSet
trigger1 = 1
var(1) = life

[State 162, Width]
type = Width
trigger1 = 1
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State Shield Layer]
type = Null
trigger1 = var(12) := 2

;---------------------------------------------------------------------------
; Ultimate Guard End
[Statedef 163]
type = S
physics = S
movetype = I
ctrl = 0
anim = 162
sprpriority = (var(13) := 0)

[State 163, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 163, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 4
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 163, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Ultimate Guard Cancel Buffer
[Statedef 165]
type = S
physics = S
movetype = H
ctrl = 0
sprpriority = (var(13) := 0)

[State 165, VarSet]
type = VarSet
trigger1 = !time
var(0) = 0

[State 165, VarSet]
type = VarSet
trigger1 = 1
var(1) = 1

[State 165, VarSet]
type = VarSet
trigger1 = !time
fvar(0) = 0

[State 165, VarSet]
type = VarSet
trigger1 = !hitshakeover
fvar(0) = 1

[State 165, VarSet]
type = VarSet
trigger1 = !var(0)
trigger1 = command = "z" && command = "c"
var(0) = 1

[State 165, 1]
type = HitVelSet
trigger1 = hitshakeover
x = 1

[State 165, 2]
type = ChangeState
trigger1 = hitshakeover || time > 30
trigger1 = fvar(0)
value = 160

[State 165, 1]
type = ChangeAnim
trigger1 = 1
value = 160
elem = 1

[State 165, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
stateno = 161
ignorehitpause = 1

[State 165, ReversalDef]
type = ReversalDef
trigger1 = var(0)
reversal.attr = SCA, AA, AP
p1stateno = 166
pausetime = 0, 9
sparkno = -1
ignorehitpause = 1

[State 165, PalFX]
type = PalFX
trigger1 = !var(0)
trigger1 = time%2
mul = 288, 192, 192
add = -24, -32, -32
time = 1

[State 165, PalFX]
type = PalFX
trigger1 = var(0)
mul = 320, 288, 192
add = 8, 0, -32
color = 128*(time%2)
time = 1

[State 165, No Damage]
type = VarSet
trigger1 = 1
var(1) = life

;---------------------------------------------------------------------------
[Statedef 166]
type = S
physics = S
movetype = I
ctrl = 0
velset = 0, 0
anim = 166
sprpriority = (var(13) := 0)

[State 166, HitFallSet]
type = HitFallSet
trigger1 = 1
value = 0

[State 166, Push]
type = Helper
trigger1 = time = 8
;trigger1 = var(1)
name = "push"
id = 168
stateno = 168
ignorehitpause = 1
persistent = 0

[State 166, VarSet]
type = VarSet
trigger1 = time = 8
var(1) = 0

[State 166, PosAdd]
type = PosAdd
triggerall = numhelper(168)
trigger1 = helper(168), rootdist x > helper(168), fvar(0)*0.5
x = (helper(168), fvar(0)*0.5 - helper(168), rootdist x)*0.5

[State 166, Turn]
type = Turn
trigger1 = time = 0
trigger1 = p2dist x < 0

[State 166, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 6, 1

[State 166, Explod]
type = Explod
triggerall = var(22)
trigger1 = time = 0
postype = p1
anim = 17007
bindtime = 1
pos = floor(95*const(size.xscale)), floor(-45*const(size.yscale))
facing = -1
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 166, Explod]
type = Explod
triggerall = !var(22)
trigger1 = time = 0
postype = p1
anim = F40
bindtime = 1
pos = floor(95*const(size.xscale)), floor(-45*const(size.yscale))
facing = -1
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 166, NotHitBy]
type = NotHitBy
trigger1 = time = 8
value = SCA, AA, AP
time = 8
ignorehitpause = 1

[State 166, ChangeAnim]
type = ChangeAnim
trigger1 = time = 8
value = 161

[State 166, ChangeState]
type = ChangeState
trigger1 = time = 30
value = 163

[State 166, PalFX]
type = PalFX
trigger1 = 1
mul = 320, 288, 192
add = 8, 0, -32
color = 128*(time%2)
time = 1

[State 166, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
stateno = 166
ignorehitpause = 1

[State 166, Width]
type = Width
trigger1 = 1
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State Shield Layer]
type = Null
trigger1 = var(12) := 2
ignorehitpause = 1

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 170, 0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Win pose 1/state decider
; CNS difficulty: basic
[Statedef 180]
type = S
anim = 180

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
trigger1 = random%2
value = 181

[State 180, PlaySnd]
type = PlaySnd
trigger1 = animelem = 12
value = 180, 0

[State 180, 2]
type = AssertSpecial
trigger1 = time < 120
flag = RoundNotOver

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [3, 7]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = (animelemno(0) = [3, 4]) || animelemno(0) = [8, 10]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Win pose 2
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
trigger2 = animelem = 13
value = 180, 0

[State 181, 2]
type = AssertSpecial
trigger1 = time < 120
flag = RoundNotOver

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = [2, 5]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 190]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 190, 1]
type = ChangeState
trigger1 = !time
trigger1 = random%3 = 0
value = 192

[State 190, 1]
type = VarSet
triggerall = !time
triggerall = var(0) := 1
trigger1 = enemy, name = "Blade" || enemy, name = "Jihad"
trigger1 = enemy, authorname = "Doggiedoo"||  enemy, authorname = "Blade" ;not a typo :P
trigger2 = enemy, name = "Ravange" || enemy, name = "Secmeto" || enemy, name = "Sekhmet" || enemy, name = "Valdoll" || enemy, name = "Shin Valdoll" || enemy, name = "Scion" || enemy, name = "Shin Scion"
trigger2 = enemy, authorname = "Doggiedoo"
trigger3 = enemy, name = "Hydron" || enemy, name = "Nool" || enemy, name = "Gi Gi" || enemy, name = "Lavia" || enemy, name = "Luan"
trigger3 = enemy, authorname = "Trasgo7"
var(0) = 0

[State 190, 1]
type = ChangeState
triggerall = RoundState > 0
triggerall = animelemno(0) = 6
trigger1 = var(0)
trigger2 = enemy, anim = 0
value = 191

[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State Shield Layer]
type = Null
trigger1 = var(12) := 1

[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 191, PlaySnd]
type = PlaySnd
trigger1 = animelem = 14
value = 191, 0
channel = 0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [2, 18]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = (animelemno(0) = [2, 15]) || animelemno(0) = [19, 20]
trigger1 = var(12) := 2

[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0

[State 190, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = 192

[State 192, PlaySnd]
type = PlaySnd
trigger1 = animelem = 13
trigger1 = var(25) := 1
value = 5120, 0
channel = 0

[State 192, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 192, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) < 17
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = (var(13) := 2) + 1

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [3, 7]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = (animelemno(0) = [3, 4]) || animelemno(0) = 9
trigger1 = var(12) := 1
trigger2 = animelemno(0) = 8
trigger2 = var(12) := 2

;---------------------------------------------------------------------------
; Standing Light Punch
; CNS difficulty: easy
[Statedef 200]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A				;Move-type: A-attack, I-idle, H-gethit
physics = S				;Physics: S-stand, C-crouch, A-air
;Commonly-used controllers:
velset = 0,0			;Set velocity (x,y) (Def: no change)
ctrl = 0				;Set ctrl (Def: no change)
anim = 200 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
poweradd = 20			;Power to add (Def: 0)
sprpriority = (var(13) := 2) + 1			;Set layering priority to 2 (in front)

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 5, = 2
trigger2 = animelem = 9, = 4
value = anim
elem = animelemno(0) + 1

[State 200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6, = -1
trigger2 = var(9) = 8
trigger2 = animelem = 5, = 1
value = 200, 0
channel = 0

[State 200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6, = -1
trigger2 = var(9) = 8
trigger2 = animelem = 5, = 1
value = 20, 3

[State 200, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 10, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 200, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 10, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 200, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 10, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 200, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 10, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 200, Screenbounder]
type = Helper
trigger1 = animelem = 5, = 5
trigger2 = var(9) = 8
trigger2 = animelem = 5, = 1
name = "screenbounder"
id = 1040
stateno = 1040
persistent = 0

[State 200, PosAdd]
type = PosAdd
trigger1 = animelem = 6
x = 32*const(size.xscale)

[State 200, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 12
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 200, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [4,5]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = [10, 11]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Standing Medium Punch
; CNS difficulty: easy
[Statedef 210]
type    = S
movetype= A
physics = S
poweradd= 25
ctrl = 0
velset = 0,0
anim = 210 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 4, = 4
trigger2 = animelem = 5, = 2
trigger3 = animelem = 6, = 2
trigger4 = animelem = 7, = 2
trigger5 = animelem = 8, = 6
trigger6 = animelem = 10, = 3
trigger7 = animelem = 11, = 3
trigger8 = animelem = 12, = 3
value = anim
elem = animelemno(0) + 1

[State 210, Width]
type = Width
trigger1 = animelemno(0) = 5 || animelemno(0) = [7, 9]
player = floor(8*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 210, Width]
type = Width
trigger1 = animelemno(0) = 6
player = floor(16*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 210, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 200, 1
channel = 0

[State 210, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 4

[State 210, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 11
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-79*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 210, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 22
guard.pausetime = 11, 11
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-79*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 210, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 11
sparkno = 1
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-79*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 210, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 22
guard.pausetime = 11, 11
sparkno = 1
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-79*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 210, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 11
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = 6 || animelemno(0) = 10 || animelemno(0) = [3,4]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = [2, 5]
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) = 5
var(12) = 2

;---------------------------------------------------------------------------
; Standing Strong Punch
; CNS difficulty: easy
[Statedef 220]
type    = S
movetype= A
physics = S
poweradd= 30
ctrl = 0
velset = 0,0
anim = 220 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 4, = 2
trigger2 = animelem = 8, = 3
trigger2 = animelem = 9, = 3
value = anim
elem = animelemno(0) + 1

[State 220, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 200, 1
channel = 0

[State 220, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 5

[State 220, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-38*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 220, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 26
guard.pausetime = 13, 13 
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-38*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 220, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-38*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 220, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 26
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-38*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 220, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = 0

[State 220, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 11
value = 1

[State 220, ChangeState]
type = ChangeState
triggerall = animelemno(0) = 10
trigger1 = var(0)
value = 260

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 220, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = 3 || animelemno(0) = 5
trigger1 = var(11) := 0
trigger2 = animelemno(0) = 4
trigger2 = var(11) := -1

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = [7, 10]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Standing Strong Punch Followup
; CNS difficulty: easy
[Statedef 260]
type    = S
movetype= A
physics = S
poweradd= 35
ctrl = 0
velset = 0,0
anim = 260 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 4, = 1
trigger2 = animelem = 5, = 1
trigger3 = animelem = 8, = 5
trigger4 = animelem = 9, = 2
trigger5 = animelem = 11, = 2
trigger6 = animelem = 12, = 2
value = anim
elem = animelemno(0) + 1

[State 260, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 1000, 1
channel = 0

[State 260, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 5

[State 260, Width]
type = Width
trigger1 = animelemno(0) = 4 || animelemno(0) = 9
player = floor(16*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 260, Width]
type = Width
trigger1 = animelemno(0) = [5, 8]
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 260, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Back
guardflag = MA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.hittime = 19
guard.velocity = -10
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
fall = 1
fall.recover = 0
airguard.velocity = -5, -6.43
yaccel = .536

[State 260, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.3*fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Back
guardflag = MA
hitflag = MA
pausetime = 14, 20
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.hittime = 19
guard.velocity = -10
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
fall = 1
fall.recover = 0
airguard.velocity = -5, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 260, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Back
guardflag = MA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.hittime = 19
guard.velocity = -10
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
fall = 1
fall.recover = 0
airguard.velocity = -5, -6.43
yaccel = .536

[State 260, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.3*fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Back
guardflag = MA
hitflag = MA
pausetime = 14, 20
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.hittime = 19
guard.velocity = -10
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
fall = 1
fall.recover = 0
airguard.velocity = -5, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 260, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 13
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 260, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [2,9]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = 1 || animelemno(0) = 9
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Standing Light Kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
poweradd= 20
ctrl = 0
velset = 0,0
anim = 230
sprpriority = (var(13) := 2) + 1

[State 230, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 200, 0
channel = 0

[State 230, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 20, 0

[State 230, VarSet]
type = VarSet
trigger1 = !time
var(0) = 0

[State 230, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*100) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = 80, 0
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-61*const(size.yscale))
hitsound   = s5,0
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 230, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*100) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = 80, 0
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-61*const(size.yscale))
hitsound   = s5,0
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 230, VarAdd]
type = VarAdd
trigger1 = animelemno(0) = [3, 5]
var(0) = 1
ignorehitpause = 1

[State 230, ChangeAnim]
type = ChangeAnim
trigger1 = animelemno(0) = [3, 5]
trigger1 = hitpausetime
trigger1 = var(0) = [7, 12]
value = anim
elem = 5
ignorehitpause = 1

[State 230, ChangeAnim]
type = ChangeAnim
trigger1 = animelem = 4
value = anim
elem = 5

[State 230, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 8
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 5
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 230, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = 2
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Standing Medium Kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
poweradd= 25
ctrl = 0
velset = 0,0
anim = 240
sprpriority = (var(13) := 2) + 1

[State 240, Width]
type = Width
trigger1 = animelemno(0) = 3 || animelemno(0) = 12
player = floor(16*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 240, Width]
type = Width
trigger1 = animelemno(0) = [4, 11]
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 240, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 200, 1
channel = 0

[State 240, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 1

[State 240, VarSet]
type = VarSet
trigger1 = !time
var(0) = 0

[State 240, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*200) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = 104, 0
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 11
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-91.5*const(size.yscale))
hitsound   = s5,1
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 240, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*200) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = 104, 0
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 11
sparkno = 1
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-91.5*const(size.yscale))
hitsound   = s5,1
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 240, VarAdd]
type = VarAdd
trigger1 = animelemno(0) = [5, 11]
var(0) = 1
ignorehitpause = 1

[State 240, ChangeAnim]
type = ChangeAnim
trigger1 = var(0) > 0
trigger1 = animelemno(0) = [5, 9]
trigger1 = hitpausetime
trigger1 = (var(0) - 1)%3 = 0
value = anim
elem = animelemno(0) + 2
ignorehitpause = 1

[State 240, ChangeAnim]
type = ChangeAnim
trigger1 = var(0) = 11
trigger1 = movecontact
value = 240
elem = 11
persistent = 0
ignorehitpause = 1

[State 240, ChangeAnim]
type = ChangeAnim
trigger1 = animelem = 6
trigger2 = animelem = 8
trigger3 = animelem = 10
value = 240
elem = animelemno(0) + 1

[State 240, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 14
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State 240, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Strong Kick
; CNS difficulty: easy
[Statedef 250]
type    = S
movetype= A
physics = S
poweradd= 30
ctrl = 0
velset = 0,0
anim = ifelse(var(16), 270, 250)
sprpriority = (var(13) := 2) + 1

[State 250, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
value = 20, 2

[State 250, VarSet]
type = VarSet
trigger1 = !time
var(0) = 0

[State 250, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*600) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = 120, 0
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -10, floor(-75.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 250, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*600) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = 120, 0
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 13, 13
sparkno = 2
sparkxy = -10, floor(-75.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 250, VarAdd]
type = VarAdd
trigger1 = animelemno(0) = [6, 8]
var(0) = 1
ignorehitpause = 1

[State 250, ChangeAnim]
type = ChangeAnim
trigger1 = animelemno(0) = [6, 8]
trigger1 = hitpausetime
trigger1 = var(0) = [6, 13]
value = anim
elem = 8
ignorehitpause = 1

[State 250, ChangeAnim]
type = ChangeAnim
trigger1 = animelem = 7
value = anim
elem = 8
ignorehitpause = 1

[State 250, PosAdd]
type = PosAdd
trigger1 = animelem = 2
trigger2 = animelem = 6
trigger3 = animelem = 9
x = 16*const(size.xscale)

[State 250, PosAdd]
type = PosAdd
trigger1 = anim = 250
trigger1 = animelem = 10
x = 32*const(size.xscale)

[State 250, PosAdd]
type = PosAdd
trigger1 = anim = 270
trigger1 = animelem = 10
x = 30*const(size.xscale)

[State 250, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 11
value = 1

[State 250, NoWalk]
type = AssertSpecial
trigger1 = anim = 260
trigger1 = animelemno(0) < 13
trigger2 = animelemno(0) < 12
flag = NoWalk

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 8
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = animelemno(0) > 12 || (anim = 270 && animelemno(0) > 11)
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State 250, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = [6, 9]
trigger1 = var(12) := 1
trigger2 = animelemno(0) = [10, 11]
trigger2 = anim = 270
trigger2 = var(12) := 1

;---------------------------------------------------------------------------
; Crouching Light Punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning the
;     player will get hit instead of trading hits with the opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
poweradd= 20
ctrl = 0
velset = 0,0
anim = 400 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 1
trigger2 = animelem = 4, = 1
trigger3 = animelem = 5, = 2
trigger4 = animelem = 8, = 3
trigger5 = animelem = 9, = 3
trigger6 = animelem = 10, = 3
trigger7 = animelem = 11, = 3
value = anim
elem = animelemno(0) + 1

[State 400, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 3

[State 400, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = LA
hitflag = MA
pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -10), floor(-37.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 400, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = LA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -10), floor(-37.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 400, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = LA
hitflag = MA
pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -10), floor(-37.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 400, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = LA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -10), floor(-37.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 400, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 10
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 6
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 400, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = (animelemno(0) = [2,3]) || animelemno(0) = [5, 7]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) < 5 || animelemno(0) > 8
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) < 5
var(12) = 2

;---------------------------------------------------------------------------
; Crouching Medium Punch
[Statedef 410]
type    = C
movetype= A
physics = C
poweradd= 25
ctrl = 0
velset = 0,0
anim = 410 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 4
trigger2 = animelem = 5, = 2
trigger3 = animelem = 6, = 2
trigger4 = animelem = 8, = 6
value = anim
elem = animelemno(0) + 1

[State 410, Width]
type = Width
trigger1 = animelemno(0) = 5 || animelemno(0) = 9
player = floor(8*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 410, Width]
type = Width
trigger1 = animelemno(0) = [6, 8]
player = floor(16*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 410, VarSet]
type = VarSet
trigger1 = time = 0
trigger2 = p2movetype != A
trigger2 = !movehit
var(1) = 0

[State 410, VarSet]
type = VarSet
trigger1 = p2movetype = A
var(1) = 1

[State 410, VarSet]
type = VarSet
trigger1 = time = 0
var(18) = 0

[State 410, Hit Tracking]
type = VarSet
trigger1 = movecontact = 1
trigger2 = movereversed = 1
var(18) = animelemno(-1)

[State 410, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 200, 0 
channel = 0

[State 410, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 4

[State 410, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*72), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 30, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -20), floor(-103*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = -5
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 410, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = var(1)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*72), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 30, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -20), floor(-103*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = -5
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 410, 2]
type = HitDef
triggerall = var(22)
triggerall = !var(43) || movecontact
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*ifelse(movecontact, 150, 300)) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*ifelse(movehit, 40, 96)), ceil(fvar(7)*fvar(5)*ifelse(movehit, 40, 96))
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-44*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 410, 2c]
type = HitDef
triggerall = var(22)
triggerall = !var(43) || movecontact
triggerall = var(9) = 7
triggerall = var(1)
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*ifelse(movecontact, 150, 300)) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*ifelse(movehit, 40, 96)), ceil(fvar(7)*fvar(5)*ifelse(movehit, 40, 96))
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-44*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 410, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*72), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 30, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -20), floor(-103*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = -5
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 410, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = var(1)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*72), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 30, ifelse(p2bodydist x < 0, -50, ceil(p2bodydist x - 50)), -20), floor(-103*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = -5
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 410, 2]
type = HitDef
triggerall = !var(22)
triggerall = !var(43) || movecontact
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*ifelse(movecontact, 150, 300)) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*ifelse(movehit, 40, 96)), ceil(fvar(7)*fvar(5)*ifelse(movehit, 40, 96))
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-44*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 410, 2c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43) || movecontact
triggerall = var(9) = 7
triggerall = var(1)
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*ifelse(movecontact, 150, 300)) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*ifelse(movehit, 40, 96)), ceil(fvar(7)*fvar(5)*ifelse(movehit, 40, 96))
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 50, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -10), floor(-44*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 410, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 12
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 410, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [4, 10]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = 1 || animelemno(0) > 10 || animelemno(0) = [7, 9]
trigger1 = var(12) := 1

[State Delay Dampening]
type = VarSet
trigger1 = time
var(33) = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; Crouching Strong Punch
[Statedef 420]
type    = C
movetype= A
physics = C
poweradd= 30
ctrl = 0
velset = 0,0
anim = 420 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 3
trigger2 = animelem = 5, = 1
trigger3 = animelem = 6, = 1
trigger4 = animelem = 11, = 5
trigger5 = animelem = 14, = 3
trigger6 = animelem = 15, = 3
trigger7 = animelem = 16, = 3
trigger8 = animelem = 17, = 3
trigger9 = animelem = 18, = 3
value = anim
elem = animelemno(0) + 1

[State 420, VarSet]
type = VarSet
trigger1 = !time
var(0) = 0

[State 420, VarSet]
type = VarSet
trigger1 = movecontact
trigger1 = p2movetype = H
trigger2 = movereversed = 1
var(0) = 1

[State 420, VarSet]
type = VarSet
trigger1 = time = 0
var(18) = 0

[State 420, Hit Tracking]
type = VarSet
trigger1 = movecontact = 1
trigger2 = movereversed = 1
var(18) = animelemno(-1)

[State 420, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 200, 2
channel = 0

[State 420, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 5

[State 420, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = !var(0)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -10, floor(-10.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -15
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -13.75
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536

[State 420, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
triggerall = !var(0)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.3*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 13, 16
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -10, floor(-10.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -13.75
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -12.5
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 420, 2]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = !var(0)
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger2 = animelemno(0) = 7
trigger2 = var(18) < 7
trigger2 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA ;looks better against parries/reversals due to posture
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor((-75 - 53.5*(animelemno(0) = 7))*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -15
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -13.75 + 1.75*(animelemno(0) = 7)
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536

[State 420, 2c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
triggerall = !var(0)
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
trigger2 = animelemno(0) = 7
trigger2 = var(18) < 7
trigger2 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger2 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA ;looks better against parries/reversals due to posture
damage = ceil(1.3*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 13, 16
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor((-75 - 53.5*(animelem = 7))*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -13.75
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -12.5
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 420, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = !var(0)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = 2
sparkxy = -10, floor(-10.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -15
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -13.75
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536

[State 420, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
triggerall = !var(0)
trigger1 = animelemno(0) = 5
trigger1 = var(18) < 5
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.3*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 13, 16
guard.pausetime = 13, 13
sparkno = 2
sparkxy = -10, floor(-10.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -13.75
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -12.5
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 420, 2]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = !var(0)
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger2 = animelemno(0) = 7
trigger2 = var(18) < 7
trigger2 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA ;looks better against parries/reversals due to posture
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = 2
sparkxy = -20, floor((-75 - 53.5*(animelemno(0) = 7))*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -15
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -13.75 + 1.75*(animelemno(0) = 7)
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536

[State 420, 2c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
triggerall = !var(0)
trigger1 = animelemno(0) = 6
trigger1 = var(18) < 6
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
trigger2 = animelemno(0) = 7
trigger2 = var(18) < 7
trigger2 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger2 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA ;looks better against parries/reversals due to posture
damage = ceil(1.3*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Up
guardflag = MA
hitflag = MA
pausetime = 13, 16
guard.pausetime = 13, 13
sparkno = 2
sparkxy = -20, floor((-75 - 53.5*(animelem = 7))*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -0.83, -13.75
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 15
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -0.83, -12.5
fall = 1
fall.recover = 0
fall.yvelocity = -4
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 420, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 6
statetype = S

[State 420, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 14
statetype = C

[State 420, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 17
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 8
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 420, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = (animelemno(0) = [2,3]) || animelemno(0) = [8, 14]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) < 5 || animelemno(0) > 14
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) < 5
var(12) = 2

;---------------------------------------------------------------------------
; Crouching Light Kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
poweradd= 20
ctrl = 0
velset = 0,0
anim = 430 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 4
trigger2 = animelem = 5, = 1
trigger3 = animelem = 6, = 1
trigger4 = animelem = 7, = 4
trigger5 = animelem = 11, = 2
trigger6 = animelem = 12, = 2
trigger7 = animelem = 13, = 2
trigger8 = animelem = 14, = 2
trigger9 = animelem = 15, = 2
trigger10 = animelem = 16, = 2
value = anim
elem = animelemno(0) + 1

[State 430, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 20, 3

[State 430, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-37*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 430, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-37*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 430, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-37*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 430, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Light
guardflag = MA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 0
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -30, ceil(p2bodydist x - 30)), -10), floor(-37*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -5
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 430, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 15
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 8
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 430, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [5, 10]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = 1 || animelemno(0) > 13
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Crouching Medium Kick
; CNS difficulty: easy
[Statedef 440]
type    = C
movetype= A
physics = C
poweradd= 25
ctrl = 0
velset = 0,0
anim = 440 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 5, = 2
trigger2 = animelem = 9, = 4
trigger3 = animelem = 10, = 3
trigger4 = animelem = 11, = 3
trigger5 = animelem = 12, = 3
value = anim
elem = animelemno(0) + 1

[State 440, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 200, 1
channel = 0

[State 440, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 4

[State 440, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 11
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-51*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 440, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 22
guard.pausetime = 11, 11
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-51*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 440, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 11
sparkno = 1
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-51*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 440, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = MA
hitflag = MA
pausetime = 11, 22
guard.pausetime = 11, 11
sparkno = 1
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-51*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 440, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 11
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 8
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 440, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 300
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [6,9]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) > 1
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 450]
type    = C
movetype= A
physics = C
poweradd= 30
ctrl = 0
velset = 0,0
anim = 450 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 5
trigger2 = animelem = 5, = 2
trigger3 = animelem = 8, = 8
value = anim
elem = animelemno(0) + 1

[State 450, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 5

[State 450, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-3*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Trip
ground.velocity = 0, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Trip
air.velocity = 0, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0

[State 450, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.3*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 20
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-3*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0
palfx.add = 256, 256, 256
palfx.time = 1

[State 450, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-3*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Trip
ground.velocity = 0, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Trip
air.velocity = 0, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0

[State 450, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.3*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 20
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-3*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0
palfx.add = 256, 256, 256
palfx.time = 1

[State 450, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 10
value = 1

[State 450, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = 0

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 6
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 450, ChangeState]
type = ChangeState
triggerall = animelemno(0) = 8
trigger1 = var(0)
value = 460

[State 450, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = (animelemno(0) = [2,5]) || animelemno(0) = [7, 8]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) > 5
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) = [7, 9]
var(12) = 2

;---------------------------------------------------------------------------
; Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 460]
type    = C
movetype= A
physics = C
poweradd= 30
ctrl = 0
velset = 0,0
anim = 460 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 2, = 4
trigger2 = animelem = 3, = 2
trigger3 = animelem = 4, = 2
trigger4 = animelem = 6, = 6
value = anim
elem = animelemno(0) + 1

[State 460, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 1000, 0
channel = 0

[State 460, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 5

[State 460, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-12*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Trip
ground.velocity = 0, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Trip
air.velocity = 0, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0

[State 460, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.3*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 20
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-12*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0
palfx.add = 256, 256, 256
palfx.time = 1

[State 460, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-12*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Trip
ground.velocity = 0, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Trip
air.velocity = 0, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0

[State 460, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*500) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = C, NA
damage = ceil(1.3*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 20
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-12*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 20
ground.slidetime  = 20
ground.cornerpush.veloff = 0
guard.velocity = -10
guard.hittime = 19
guard.cornerpush.veloff = -13
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0
palfx.add = 256, 256, 256
palfx.time = 1

[State 460, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 9
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 5
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command != "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 12, 20))
ctrl = 1

[State 460, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 11
ctrl = 1

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) < 3 || animelemno(0) = [4, 6]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) < 4 || animelemno(0) > 7
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) = 3
var(12) = 2

;---------------------------------------------------------------------------
; Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 600 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 1, = 1
value = anim
elem = animelemno(0) + 1

[State 600, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 200, 0
channel = 0

[State 600, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 20, 3

[State 600, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-90*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 600, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17000
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-90*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 600, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 0
sparkxy = -20, floor(-90*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 600, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Light
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 0
sparkxy = -20, floor(-90*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 5
movetype = I

[State 600, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) < 3 || animelemno(0) = [4, 8]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [8, 10]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Jump Medium Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 610 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 3
trigger2 = animelem = 4, = 1
value = anim
elem = animelemno(0) + 1

[State 610, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 200, 1
channel = 0

[State 610, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 4

[State 610, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-90.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 610, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-90.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 610, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(-90.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 610, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(-90.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 6
movetype = I

[State 610, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [5, 8]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = (animelemno(0) = [2, 3]) || animelemno(0) = [8, 10]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Jump Medium Punch 2
; CNS difficulty: easy
[Statedef 660]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 660 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 4, = 2
trigger2 = animelem = 5, = 1
value = anim
elem = animelemno(0) + 1

[State 660, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 200, 1
channel = 0

[State 660, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 4

[State 660, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-177*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 660, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-177*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 660, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-177*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 660, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-177*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 7
movetype = I

[State 660, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [6, 9]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = 1 || (animelemno(0) = [3, 4]) || animelemno(0) = [6,11]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Jump Strong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 620 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 2
value = anim
elem = animelemno(0) + 1

[State 620, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 200, 2
channel = 0

[State 620, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 5

[State 620, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 620, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 620, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 620, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-68.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 6
movetype = I

[State 620, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [1, 9]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [9, 11]
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) = 1
var(11) = -1

;---------------------------------------------------------------------------
; Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 630 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 3
value = anim
elem = animelemno(0) + 1

[State 630, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 200, 0
channel = 0

[State 630, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 3

[State 630, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-48.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 630, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-48.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 630, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(-48.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 630, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*250) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*88), ceil(fvar(7)*fvar(5)*88)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(-48.5*const(size.yscale))
hitsound   = s5,4
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Low
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 7
movetype = I

[State 630, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [1, 4]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = 1 || animelemno(0) = [9, 10]
trigger1 = var(12) := 1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) = 3
var(11) = -1

;---------------------------------------------------------------------------
; Jump Medium Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 640 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 3, = 4
trigger2 = animelem = 4, = 1
value = anim
elem = animelemno(0) + 1

[State 640, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 200, 1
channel = 0

[State 640, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 20, 4

[State 640, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 640, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 640, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 640, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*96), ceil(fvar(7)*fvar(5)*96)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 8
movetype = I

[State 640, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = 8
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = (animelemno(0) = [1, 4]) || animelemno(0) = [8, 10]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Jump Medium Kick 2
; CNS difficulty: easy
[Statedef 670]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 670 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 5
trigger2 = animelem = 7, = 1
value = anim
elem = animelemno(0) + 1

[State 670, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 200, 2
channel = 0

[State 670, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 20, 4

[State 670, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 670, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 670, 2]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = animelemno(0) = 9
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(18*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 670, 2c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = animelemno(0) = 9
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17001
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(18*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 670, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(-5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 670, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(-5*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 670, 2]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = animelemno(0) = 9
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(18*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 670, 2c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = animelemno(0) = 9
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*300) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*104), ceil(fvar(7)*fvar(5)*104)
animtype = Medium
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 1
sparkxy = -20, floor(18*const(size.yscale))
hitsound   = s5,5
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 16
ground.slidetime  = 16
guard.hittime = 15
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 12
movetype = I

[State 670, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [8, 10]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = 1 || animelemno(0) = 3 || animelemno(0) = 13 || animelemno(0) = [8, 10]
trigger1 = var(12) := 1
trigger2 = animelemno(0) = [11, 12]
trigger2 = var(12) := 2

;---------------------------------------------------------------------------
; Jump Strong Kick
; CNS difficulty: easy
[Statedef 650]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 650 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 1, = 3
trigger2 = animelem = 3, = 1
trigger3 = animelem = 4, = 1
trigger4 = animelem = 5, = 1
value = anim
elem = animelemno(0) + 1

[State 650, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 200, 1
channel = 0

[State 650, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 20, 5

[State 650, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 650, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 650, 2]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = animelemno(0) = 5
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-136.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 650, 2c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = animelemno(0) = 5
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = -20, floor(-136.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 650, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 2
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 650, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*120), ceil(fvar(7)*fvar(5)*120)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 2
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-40.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 650, 2]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = animelemno(0) = 5
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 2
sparkxy = -20, floor(-136.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 650, 2c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = animelemno(0) = 5
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 2
sparkxy = -20, floor(-136.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 6
movetype = I

[State 650, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [5, 9]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = [2, 11]
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Jump Strong Kick
; CNS difficulty: easy
[Statedef 680]
type    = A
movetype= A
physics = A
poweradd= 25
ctrl = 0
anim = 680 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 5, = 3
trigger2 = animelem = 7, = 1
value = anim
elem = animelemno(0) + 1

[State 680, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 200, 2
channel = 0

[State 680, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 20, 5

[State 680, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-33.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 680, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-33.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 680, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 9
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-33.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 680, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*350) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(1.25*fvar(5)*128), ceil(fvar(7)*fvar(5)*128)
animtype = Heavy
guardflag = HA
hitflag = MA
pausetime = 9, 18
guard.pausetime = 9, 9
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-33.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -7.5
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State Idle]
type = StateTypeSet
trigger1 = animelem = 9
movetype = I

[State 680, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 600
ignorehitpause = 1

[State Weapon Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = (animelemno(0) = [3, 4]) || animelemno(0) = [6, 11]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
triggerall = pos y + vel y + const(movement.yaccel) < 0
trigger1 = animelemno(0) = 1 || animelemno(0) = 12
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Pounce Attack
[Statedef 700]
type    = S
movetype= A
physics = S
poweradd= 25
ctrl = 0
sprpriority = (var(13) := 2) + 1

[State 700, VarSet]
type = VarSet
trigger1 = p2movetype = H
trigger1 = (p2statetype = A && enemynear, gethitvar(fall)) || p2statetype = L
trigger2 = !time
fvar(1) = 0.05*((enemynear, pos x - helper(9998), fvar(0) + enemynear, vel x*enemynear, facing) - fvar(0))*facing

[State 700, VarSet]
type = VarSet
trigger1 = numtarget
trigger1 = (target, statetype = A && target, gethitvar(fall)) || target, statetype = L
fvar(1) = 0.05*((target, pos x - helper(9998), fvar(0) + target, vel x*target, facing) - fvar(0))*facing

[State 700, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 40
trigger1 = anim != 10
trigger1 = anim != 12
value = 40

[State 700, ChangeAnim]
type = ChangeAnim
triggerall = anim != 40
triggerall = anim = 10
triggerall = animelemno(0) < 4
trigger1 = animelemno(-1) != animelemno(0)
value = 40
elem = animelemno(0)

[State 700, ChangeAnim]
type = ChangeAnim
triggerall = anim != 40
triggerall = anim = 12
trigger1 = animelem = 4
trigger2 = animelemno(0) != 4
value = 40
elem = ifelse(animelemno(0) < 5, 3, ifelse(animelemno(-1) < 5, 2, 1))

[State 700, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 700, 0
channel = 0

[State 700, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0 || (anim = 10 && animelemno(0) > 3) || (anim = 12 && animelem = 3)
value = 701

[State Shield Layer]
type = VarSet
trigger1 = anim = 40 && animelemno(0) != 1
trigger2 = anim = 10 && animelemno(0) != 1
trigger3 = anim = 12 && animelemno(0) < 4
var(12) = 1

[Statedef 701]
type    = A
movetype= A
physics = N
poweradd= 25
ctrl = 0
anim = 42
sprpriority = (var(13) := 2) + 1
velset = 0, -12.5

[State 701, VelSet]
type = VelSet
trigger1 = animelem = 12
x = -4.12
y = -10

[State 701, VarSet]
type = VarSet
trigger1 = animtime = 0
sysvar(1) = -1

[State 701, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 0

[State 701, ChangeAnim]
type = ChangeAnim
trigger1 = time = 3
value = 670 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
elem = 3

[State 701, ChangeAnim]
type = ChangeAnim
trigger1 = animelemno(0) = 9
value = 670 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
elem = 9

[State 701, VelAdd]
type = VelAdd
trigger1 = 1;time < 21
y = 0.536

[State 701, VelAdd]
type = VelSet
trigger1 = time = 21
y = 10

[State 701, PosSet]
type = PosSet
trigger1 = vel y >= 0
trigger1 = pos y + vel y >= 0;-36*const(size.yscale)
y = 0;-36*const(size.yscale)

[State 701, VelSet]
type = VelSet
trigger1 = vel y >= 0
trigger1 = pos y + vel y  >= 0;-36*const(size.yscale)
y = 0

[State 701, ChangeAnim]
type = ChangeAnim
trigger1 = time > 20
trigger1 = pos y = 0
trigger1 = animelemno(0) = 9
value = 670 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
elem = 10

[State 701, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = !movecontact && !movereversed
triggerall = animelemno(0) = 9
trigger1 = p2movetype = H
trigger1 = enemynear, pos y + enemynear, vel y >= 0
trigger1 = p2statetype = L
trigger2 = numtarget
trigger2 = target, pos y + target, vel y >= 0
trigger2 = target, statetype = L
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*64)
animtype = Back
guardflag = HA
hitflag = FD
pausetime = 5, 5
sparkno = -1
guard.sparkno = s17006
sparkxy = -20, floor(18*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0
ground.type = High
ground.velocity = 0
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.velocity = 0, vel y
fall.recovery = 0
fall.yvelocity = 0
down.velocity = 0, 0
airguard.velocity = -3, -6.43
yaccel = .536

[State 701, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = !movecontact && !movereversed
triggerall = animelemno(0) = 9
trigger1 = p2movetype = H
trigger1 = enemynear, pos y + enemynear, vel y >= 0
trigger1 = p2statetype = L
trigger2 = numtarget
trigger2 = target, pos y + target, vel y >= 0
trigger2 = target, statetype = L
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = A, NA
damage = ceil(fvar(5)*64)
animtype = Back
guardflag = HA
hitflag = FD
pausetime = 5, 5
sparkno = -1
sparkxy = -20, floor(18*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0
ground.type = High
ground.velocity = 0
ground.hittime  = 11
ground.slidetime  = 11
guard.hittime = 10
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.velocity = 0, vel y
fall.recovery = 0
fall.yvelocity = 0
down.velocity = 0, 0
airguard.velocity = -3, -6.43
yaccel = .536

[State 701, Explod]
type = Explod
triggerall = var(22)
trigger1 = movehit = 1
trigger1 = hitpausetime = 4
postype = p1
anim = 17002
bindtime = 1
postype = p2
pos = floor(23*const(size.xscale)), floor(ifelse(pos y + vel y  < -64*const(size.yscale), 64*const(size.yscale) - 12,-pos y - vel y - 12))
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ignorehitpause = 1
ownpal = 1

[State 701, Explod]
type = Explod
triggerall = !var(22)
trigger1 = movehit = 1
trigger1 = hitpausetime = 4
postype = p1
anim = F2
bindtime = 1
postype = p2
pos = floor(23*const(size.xscale)), floor(ifelse(pos y + vel y  < -64*const(size.yscale), 64*const(size.yscale) - 12,-pos y - vel y - 12))
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ignorehitpause = 1
ownpal = 1

[State 701, VarSet]
type = VarSet
trigger1 = time = 0
fvar(0) = pos x - helper(9998), fvar(0)

[State 701, VarSet]
type = VarSet
triggerall = time < 21
trigger1 = p2movetype = H
trigger1 = (p2statetype = A && enemynear, gethitvar(fall)) || p2statetype = L
fvar(1) = 0.05*((enemynear, pos x - helper(9998), fvar(0) + enemynear, vel x*enemynear, facing) - fvar(0))*facing

[State 701, VarSet]
type = VarSet
triggerall = time < 21
trigger1 = numtarget
trigger1 = (target, statetype = A && target, gethitvar(fall)) || target, statetype = L
fvar(1) = 0.05*((target, pos x - helper(9998), fvar(0) + target, vel x*target, facing) - fvar(0))*facing

[State 701, VelSet]
type = VelSet
trigger1 = time < 21
x = fvar(1)

[State 701, VelSet]
type = VelSet
trigger1 = time = 21
x = 0

[State 701, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 400
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [8, 10]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = 3 || animelemno(0) = 13 || animelemno(0) = [8, 10]
trigger1 = var(12) := 1
trigger2 = animelemno(0) = [11, 12]
trigger2 = var(12) := 2


;---------------------------------------------------------------------------
; Throw - Attempt
; CNS difficulty: medium-advanced
; Description: Throws are not difficult to make, although then can be
;     tedious at times. Throw attempt states have a HitDef of a
;     special format. The key parameters in a throw are p1stateno
;     and p2stateno. If the HitDef successfully connects, then
;     the attacker will change to the state number specified by
;     p1stateno, and the opponent will be change to the state
;     number assigned to p2stateno. The special thing about p2stateno
;     is that the opponent will be temporarily brought into the
;     attacker's state file. In this case, no matter who the
;     opponent is, he will be taken to state 820 of this file (kfm.cns)
;     and remain here until the end of the throw (look at his debug
;     information when he is being thrown; the text changes to yellow
;     to mean that he is in another player's state file).
[Statedef 800]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 800
sprpriority = (var(13) := 2) + 1

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents the player from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
hitsound = s8, 0
sprpriority = 2       ;Draw in front of p2
p2facing = 1          ;Force p2 to face player
p1stateno = 801       ;On success, player changes to state 810
p2stateno = 805       ;If hit, p2 changes to state 820 in player's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
ground.velocity = 0
fall = 1              ;Force p2 into falling down
fall.recover = 0
fall.xvelocity = -4.12
fall.yvelocity = -6.43
yaccel = .536

[State 800, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 220

;---------------------------------------------------------------------------
; Throwing the opponent
; Description: In this state, the player throws the opponent by binding him to
;     various offsets based on his current frame of animation. For
;     example, [State 810, Bind 1] binds the DopponentO to an offset of
;     28 pixels in front of the player. That puts GhimG around where the hand
;     is at. Is is IimportantE to keep the opponent bound using a
;     TargetBind controller at all times, until you let him go. This
;     is especially important if your player has a Clsn2 box that
;     allows him to get hit while throwing someone. Each time a player
;     gets hit, all his bound targets will be set to a fall state. If 
;     the opponent is not boundDO, then he might get stuck in his thrown
;     state when his attacker is knocked out of the throw halfway.
; Notes: There is a TargetLifeAdd cOontroller to decrease the opponent's
;     life, and a TargetState controller to change his state to a
;     falling state when KFM lets go of him.
[Statedef 801]
type    = S
movetype= A
physics = N
anim = 801

[State 801, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 200, 1
channel = 0

[State 801, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 105

[State 801, Bind 2]
type = TargetBind
trigger1 = animelemno(0) = 2
pos = 85*const(size.xscale), 0

[State 801, Bind 3]
type = TargetBind
trigger1 = animelemno(0) = 3
pos = 85*const(size.xscale), 0

[State 801, Bind 4]
type = TargetBind
trigger1 = animelemno(0) = 4
pos = 95*const(size.xscale) + 0.8*target, const(size.head.pos.x), -40*const(size.yscale) + 0.6*target, const(size.head.pos.y)

[State 801, Bind 5]
type = TargetBind
trigger1 = animelemno(0) = 5
pos = 95*const(size.xscale), -40*const(size.yscale) + 0.8*target, const(size.head.pos.y)*(0.5 + 0.5*((target, const(size.head.pos.y)/target, const(size.mid.pos.y)) - 0.25))

[State 801, Bind 6]
type = TargetBind
trigger1 = animelemno(0) = 6
pos = 95*const(size.xscale), -50*const(size.yscale) + 0.8*target, const(size.head.pos.y)*(0.5 + 0.5*((target, const(size.head.pos.y)/target, const(size.mid.pos.y)) - 0.25))

[State 801, Bind 7]
type = TargetBind
trigger1 = animelemno(0) = 7
pos = 45*const(size.xscale) - 0.8*target, const(size.head.pos.x), -140*const(size.yscale) + 0.33*target, const(size.head.pos.y)

[State 801, Bind 8]
type = TargetBind
trigger1 = animelemno(0) = 8
pos = 35*const(size.xscale) - 0.9*target, const(size.head.pos.x), -135*const(size.yscale) + 0.30*target, const(size.head.pos.y)

[State 801, Bind 9]
type = TargetBind
trigger1 = animelemno(0) = 9
pos = 50*const(size.xscale) - target, const(size.head.pos.x), -130*const(size.yscale) + 0.27*target, const(size.head.pos.y)

[State 801, Bind 10]
type = TargetBind
trigger1 = animelemno(0) = 10
pos = 67*const(size.xscale) - target, const(size.head.pos.x), -110*const(size.yscale) + 0.27*target, const(size.head.pos.y)

[State 801, Bind 10]
type = TargetBind
trigger1 = animelemno(0) = 11
pos = 20*const(size.xscale), 0

[State 801, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 11
value = ceil(-144.0*const(data.attack)*ifelse(var(20), 1 + (var(20) - 1)*fvar(15), 1)/100.0)

[State 801, EnvShake]
type = EnvShake
trigger1 = AnimElem = 11
time = 10
freq = 50
ampl = 5
phase = 270

[State 801, Explod]
type = Explod
triggerall = var(22)
trigger1 = AnimElem = 11
postype = p1
anim = 17005
bindtime = 1
pos = floor(20*const(size.xscale)), 5
facing = -1
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 801, Explod]
type = Explod
triggerall = !var(22)
trigger1 = AnimElem = 11
postype = p1
anim = F62
bindtime = 1
pos = floor(20*const(size.xscale)), 5
facing = -1
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State XP Add]
type = VarAdd
trigger1 = animelem = 11
var(19) = 700
ignorehitpause = 1

[State 801, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 11
pan = floor(20*const(size.xscale))
value = 8, 2

[State 801, 8]
type = Explod
trigger1 = AnimElem = 11
postype = p1
anim =  F60
pos = floor(20*const(size.xscale)), 0
sprpriority = -5
facing = -1
ownpal = 1

[State 801, SprPriority]
type = SprPriority
trigger1 = animelemno(0) > 10
trigger1 = var(13) := -1 || 1
value = -1

[State Shield Layer]
type = VarSet
trigger1 = animelemno(0) = 6 || animelemno(0) = [2, 3]
trigger2 = animelemno(0) > 10
var(12) = 1

;---------------------------------------------------------------------------
; Opponent Thrown
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by the throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 805]
type    = A
movetype= H
physics = N
velset = 0,0

[State 805, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 805

[State 805, Turn]
type = Turn
Trigger1 = Time = 27

[State 805, 1]
type = ChangeAnim
trigger1 = selfanimexist(5100)
Trigger1 = Time = 31
value = 5100

[State 805, SelfState]
type = SelfState
Trigger1 = anim = 5100
trigger1 = animtime = 0 || animtime = 3
trigger2 = time = 31
trigger2 = anim != 5100
value = 5101

[State 805, SelfState]
type = SelfState
trigger1 = time
trigger1 = anim != 5100
trigger1 = !gethitvar(isbound)
value = 5050

[State 805, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0, 0

;---------------------------------------------------------------------------
; Grab
[Statedef 810]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 800
sprpriority = (var(13) := 2) + 1

[State 810, 1]
type = HitDef
Trigger1 = Time = 0
id = 0*(var(14) := stateno + id%10) + var(14)
animtype = back
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
hitsound = s8, 0
sprpriority = 2       ;Draw in front of p2
p2facing = 1          ;Force p2 to face player
p1stateno = 811       ;On success, player changes to state 810
p2stateno = 815       ;If hit, p2 changes to state 820 in player's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
ground.velocity = 0
fall = 1              ;Force p2 into falling down
fall.recover = 0
yaccel = .536

[State 810, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 210

[Statedef 811]
type    = S
movetype= A
physics = N
anim = 810

[State 811, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 200, 0
channel = 0

[State 811, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = 0

[State 811, VarSet]
type = VarSet
trigger1 = time = 0
var(1) = 0

[State 811, VarSet]
type = VarSet
trigger1 = time = 0
fvar(0) = 8

[State 811, VarSet]
type = VarSet
trigger1 = time = 0
fvar(1) = 0

[State 811, PlaySnd]
type = PlaySnd
trigger1 = animelem = 10
pan = floor(65*const(size.xscale))
value = 810, 0

[State 811, Explod]
type = Explod
trigger1 = var(22)
trigger1 = animelem = 10
postype = p1
anim = 17000
bindtime = 1
pos = floor(75*const(size.xscale)), floor(-65*const(size.yscale))
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 811, Explod]
type = Explod
trigger1 = !var(22)
trigger1 = animelem = 10
postype = p1
anim = F0
bindtime = 1
pos = floor(75*const(size.xscale)), floor(-65*const(size.yscale))
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1

[State 811, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 10
value = floor(-32*const(data.attack)*ifelse(var(20), 1 + (var(20) - 1)*fvar(15), 1)/100)

[State 811, VarAdd]
type = VarAdd
trigger1 = animelem = 10
fvar(1) = -32*const(data.attack)*ifelse(var(20), 1 + (var(20) - 1)*fvar(15), 1) - floor(-32*const(data.attack)*ifelse(var(20), 1 + (var(20) - 1)*fvar(15), 1))%100

[State 811, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 10
trigger1 = fvar(1) > 1
value = floor(fvar(1))

[State 811, VarAdd]
type = VarAdd
trigger1 = animelem = 10
trigger1 = fvar(1) > 1
fvar(1) = fvar(1) - floor(fvar(1))

[State XP Add]
type = VarAdd
trigger1 = animelem = 10
var(19) = 100
ignorehitpause = 1

[State 811, VarSet]
type = Null
triggerall = !var(0)
trigger1 = command = "holdback"
trigger1 = var(0) := -1 || 1
trigger2 = command = "holdfwd"
trigger2 = var(0) := 1

[State 811, VarAdd]
type = VarAdd
trigger1 = var(59) < 1
trigger1 = command = "a" || command = "b" || command = "c" || command = "x" || command = "y" || command = "z"
trigger2 = var(59) > 0
trigger2 = time%2 = 0
trigger2 = !time || random/(0.5 + 0.5*(fvar(10))) < 500
var(0) = ifelse(var(0) < 0, -1, 1)

[State 811, VarSet]
type = VarSet
trigger1 = var(59) < 1
trigger1 = var(0) > 0
trigger1 = command = "holdback" && command != "holdfwd"
trigger2 = var(59) > 0
trigger2 = time%6 = 0
trigger2 = random/(0.5 + 0.5*(fvar(10))) < 500
var(0) = -var(0) - 2

[State 811, VarSet]
type = VarSet
trigger1 = var(59) < 1
trigger1 = var(0) < 0
trigger1 = command = "holdfwd" && command != "holdback"
trigger2 = var(59) > 0
trigger2 = time%6 = 3
trigger2 = random/(0.5 + 0.5*(fvar(10))) < 500
var(0) = -var(0) + 2

[State 811, VarSet]
type = Null
triggerall = !var(1)
trigger1 = target, command = "holdback"
trigger1 = var(1) := -1 || 1
trigger2 = target, command = "holdfwd"
trigger2 = var(1) := 1

[State 811, VarAdd]
type = VarAdd
trigger1 = target, command = "a" || target, command = "b" || target, command = "c" || target, command = "x" || target, command = "y" || target, command = "z"
var(1) = ifelse(var(1) < 0, -2, 2)

[State 811, VarSet]
type = VarSet
trigger1 = var(1) > 0
trigger1 = target, command = "holdback" && target, command != "holdfwd"
var(1) = -var(1) - 4

[State 811, VarSet]
type = VarSet
trigger1 = var(1) < 0
trigger1 = target, command = "holdfwd" && target, command != "holdback"
var(1) = -var(1) + 4

[State 811, TargetVelSet]
type = TargetVelSet
trigger1 = animelem = 11
trigger1 = ifelse(abs(var(0)) - abs(var(1)) > 0, fvar(0) > 27 + abs(var(0)), fvar(0) > 32) || abs(var(0)) - abs(var(1)) < -32
x = -5
y = -7.5

[State 811, ChangeState]
type = ChangeState
trigger1 = animelem = 11
trigger1 = ifelse(abs(var(0)) - abs(var(1)) > 0, fvar(0) > 27 + abs(var(0)), fvar(0) > 32) || abs(var(0)) - abs(var(1)) < -32
value = 812

[State 811, VarAdd]
type = VarAdd
trigger1 = animelem = 11
fvar(0) = fvar(0)*.5

[State 811, Bind 2]
type = TargetBind
trigger1 = animelemno(0) = 2
pos = 85*const(size.xscale), 0

[State 811, Bind 3]
type = TargetBind
trigger1 = animelemno(0) = 3
pos = 85*const(size.xscale), 0

[State 811, Bind 4]
type = TargetBind
trigger1 = animelemno(0) = 4
pos = 95*const(size.xscale) + 0.8*target, const(size.head.pos.x), -40*const(size.yscale) + 0.6*target, const(size.head.pos.y)

[State 811, Bind 5]
type = TargetBind
trigger1 = animelemno(0) = 5
pos = 95*const(size.xscale), -40*const(size.yscale) + 0.8*target, const(size.head.pos.y)*(0.5 + 0.5*((target, const(size.head.pos.y)/target, const(size.mid.pos.y)) - 0.25))

[State 811, Bind 6]
type = TargetBind
trigger1 = animelemno(0) = 6
pos = 95*const(size.xscale), -50*const(size.yscale) + 0.8*target, const(size.head.pos.y)*(0.5 + 0.5*((target, const(size.head.pos.y)/target, const(size.mid.pos.y)) - 0.25))

[State 811, Bind 7]
type = TargetBind
trigger1 = animelemno(0) = 7
pos = 85*const(size.xscale), -60*const(size.yscale) + 0.8*target, const(size.head.pos.y)*(0.5 + 0.5*((target, const(size.head.pos.y)/target, const(size.mid.pos.y)) - 0.25))

[State 811, Bind 8]
type = TargetBind
trigger1 = animelemno(0) = 8
pos = 85*const(size.xscale), -60*const(size.yscale) + 0.8*target, const(size.head.pos.y)*(0.5 + 0.5*((target, const(size.head.pos.y)/target, const(size.mid.pos.y)) - 0.25))

[State 811, Bind 9]
type = TargetBind
trigger1 = animelemno(0) = 9
pos = 65*const(size.xscale), 0

[State 811, Bind 10]
type = TargetBind
trigger1 = animelemno(0) = 10
pos = 67*const(size.xscale), 0

[State 811, Bind 11]
type = TargetBind
trigger1 = animelemno(0) = 11
pos = 65*const(size.xscale), 0

[State Shield Layer]
type = VarSet
trigger1 = (animelemno(0) = [2, 3]) || animelemno(0) = [6, 8]
var(12) = 1

[State Debug Info]
type = DisplayToClipboard
trigger1 = 1
text = "grabber score %d, victim score %d, balance %d, escape threshold: -32, mod: %.0f"
params = abs(var(0)), abs(var(1)), (abs(var(0)) - abs(var(1))), fvar(0)
ignorehitpause = 1

[Statedef 812]
type    = S
physics = S
ctrl = 1
anim = 812
velset = 0,0

[State 812, 4]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = animelemno(0) > 5
trigger2 = p2dist x < 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Opponent Grabbed
[Statedef 815]
type    = A
movetype= H
physics = N
velset = 0,0

[State 815, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 815

[State 815, SelfState]
type = SelfState
trigger1 = time
trigger1 = !gethitvar(isbound)
value = 5050

[State 815, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0, 0

;---------------------------------------------------------------------------
; Ultimate Counter (punch)
[Statedef 900]
type    = S
movetype= A
physics = S
poweradd= 35
ctrl = 0
velset = 0,0
anim = 900 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 6, = 3
trigger2 = animelem = 8, = 5
trigger3 = animelem = 9, = 2
value = anim
elem = animelemno(0) + 1

[State 900, No Damage]
type = LifeAdd
trigger1 = !time
trigger1 = life < var(1)
value = var(1) - life

[State 900, Pause]
type = Pause
trigger1 = time = 0
time = 19
movetime = 19

[State 900, EnvColor]
type = EnvColor
trigger1 = time = 3
trigger2 = time = 4
trigger3 = time = 7
time = 1

[State 900, GlobalNoShadow]
type = AssertSpecial
trigger1 = time = 3
trigger2 = time = 4
trigger3 = time = 7
flag = GlobalNoShadow

[State 900, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = 700, 0
channel = 0

[State 900, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20, 5

[State 900, Width]
type = Width
trigger1 = animelemno(0) = 4 || animelemno(0) = 9
player = floor(16*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 900, Width]
type = Width
trigger1 = animelemno(0) = [5, 8]
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 900, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 900, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 26
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 900, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536

[State 900, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, NA
damage = ceil(1.25*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 13, 26
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 40, ifelse(p2bodydist x < 0, -60, ceil(p2bodydist x - 60)), -20), floor(-55.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
air.fall = 1
airguard.velocity = -3, -6.43
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1

[State 900, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 13
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 7
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 900, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State 900, NotHitBy]
type = NotHitBy
trigger1 = animelemno(0) < 6
value = SCA
time = 1 + (prevstateno = 166)

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = [2,9]
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) = 9
trigger1 = var(12) := 1

;---------------------------------------------------------------------------
; Ultimate Counter (Kick)
[Statedef 910]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim = 910 + ifelse(var(9) = 1 || var(9) = 9, 1, ifelse((var(9) = [3,4]), 2, ifelse(var(9) = 5, 3, 0)))
sprpriority = (var(13) := 2) + 1
movecontactpersist = 1
hitcountpersist = 1

[State Thunder Sword Speedup]
type = ChangeAnim
triggerall = var(9) = 8
trigger1 = animelem = 4, = 3
trigger2 = animelem = 8, = 3
value = anim
elem = animelemno(0) + 1

[State 910, No Damage]
type = LifeAdd
trigger1 = !time
trigger1 = life < var(1)
value = var(1) - life

[State 910, Pause]
type = Pause
trigger1 = time = 0
time = 19
movetime = 19

[State 910, EnvColor]
type = EnvColor
trigger1 = time = 3
trigger2 = time = 4
trigger3 = time = 7
time = 1

[State 910, GlobalNoShadow]
type = AssertSpecial
trigger1 = time = 3
trigger2 = time = 4
trigger3 = time = 7
flag = GlobalNoShadow

[State 910, Width]
type = Width
trigger1 = animelemno(0) = 2 || animelemno(0) = [5, 8]
player = floor(16*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 910, Width]
type = Width
trigger1 = animelemno(0) = [3, 4]
player = floor(32*const(size.xscale) + const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State 910, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = 700, 0
channel = 0

[State 910, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 20, 5

[State 910, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, SA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-11.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Trip
ground.velocity = 0, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
guard.cornerpush.veloff = -16.25
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Trip
air.velocity = 0, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0

[State 910, 1c]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, SA
damage = ceil(1.3*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 24
guard.pausetime = 13, 13
sparkno = s17002
guard.sparkno = s17006 + 2*(numenemy = 1 && var(8) - var(6) < 1)
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-11.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
guard.cornerpush.veloff = -16.25
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0
palfx.add = 256, 256, 256
palfx.time = 1

[State 910, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, SA
damage = ceil(fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 15
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-11.5*const(size.yscale))
hitsound   = s5,6
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = Trip
ground.velocity = 0, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
guard.cornerpush.veloff = -16.25
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.type = Trip
air.velocity = 0, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0

[State 910, 1c]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
triggerall = var(9) = 7
triggerall = p2movetype = A
trigger1 = !movecontact && !movereversed
trigger1 = var(6) := floor(fvar(12)*fvar(8)*400) || 1
trigger1 = var(27) := 2
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, SA
damage = ceil(1.3*fvar(5)*112), ceil(fvar(7)*fvar(5)*112)
animtype = Back
guardflag = LA
hitflag = MA
pausetime = 14, 24
guard.pausetime = 13, 13
sparkno = 2
sparkxy = ifelse(p2bodydist x < 20, ifelse(p2bodydist x < 0, -40, ceil(p2bodydist x - 40)), -20), floor(-11.5*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(numenemy = 1 && var(8) - var(6) < 1)
ground.type = High
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
guard.cornerpush.veloff = -16.25
guard.kill = 0
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
yaccel = .536
fall = 1
fall.recover = 0
palfx.add = 256, 256, 256
palfx.time = 1

[State 910, CtrlSet]
type = CtrlSet
triggerall = roundstate < 3
trigger1 = animelem = 12
value = 1

[State Idle Anim]
type = StateTypeSet
trigger1 = ctrl
trigger2 = animelem = 5
movetype = I

[State Idle Anim Cancel]
type = ChangeState
triggerall = ctrl
trigger1 = var(59) < 1
trigger1 = command != "holddown" && (command = "holdfwd" || command = "holdback")
trigger1 = var(0) := 0 || 1
trigger2 = var(59) < 1
trigger2 = command = "holddown"
trigger2 = var(0) := 1
trigger3 = var(59) < 1
trigger3 = command = "holdup"
trigger3 = var(0) := 2
value = ifelse(var(0) = 2, 40, ifelse(var(0) = 1, 10, 20))
ctrl = 1

[State 910, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = ctrl
trigger2 = p2dist x < 0
value = 0
ctrl = 1

[State 910, NotHitBy]
type = NotHitBy
trigger1 = animelemno(0) < 4
value = SCA
time = 1 + (prevstateno = 166)

[State XP Add]
type = VarAdd
trigger1 = var(20)
trigger1 = var(26)
var(19) = 500
ignorehitpause = 1

[State Weapon Layer]
type = Null
trigger1 = animelemno(0) = 4 || animelemno(0) = 8
trigger1 = var(11) := 0

[State Shield Layer]
type = Null
trigger1 = animelemno(0) < 3
trigger1 = var(12) := 1

;==================================================================================
;======| RELACIONADO À AI - AI RELATED |===========================================
;==================================================================================

; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.)
;
;------------------
; AI Activation Helper State - Primary Version
; (Credit to YongMing for the basic HitPause bugfix concept.)
;
; var(1) - First tick button activation prevention.
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Persistent direction command detection enabler (due to 2002.04.14).
; var(9) - AutoTurn bug fixer.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9741]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9741, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9741, PauseCheck]
type = VarSet
trigger1 = (GameTime>(Parent,var(57)))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)+(var(4):=0)

[State 9741, Facing]
type = Turn
trigger1 = (var(9):=(Facing != Parent,Facing))

[State 9741, DirTurnOnAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = !var(9)
trigger1 = (Parent,command = "holdfwd")
trigger2 = (Parent,command = "holdback")
trigger3 = (Parent,command = "holdup")
trigger4 = (Parent,command = "holddown")
trigger5 = !(var(4):=1)
var(59) = var(4)

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (Parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (Parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (Parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (Parent,command = "holddown")
var(59) = (var(4):=0)

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = var(1)
triggerall = !var(2)
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
var(59) = 1

[State 9741, ButtonTurnOffAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = (command = "a")
trigger1 = (Parent,command = "a")
trigger2 = (command = "b")
trigger2 = (Parent,command = "b")
trigger3 = (command = "c")
trigger3 = (Parent,command = "c")
trigger4 = (command = "x")
trigger4 = (Parent,command = "x")
trigger5 = (command = "y")
trigger5 = (Parent,command = "y")
trigger6 = (command = "z")
trigger6 = (Parent,command = "z")
trigger7 = (command = "start")
trigger7 = (Parent,command = "start")
var(59) = -1

[State 9741, UnPauseCheck]
type = VarSet
triggerall = var(2)
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
trigger8 = (var(2) = 2)
trigger8 = (var(2):=0)
var(2) = 2

[State 9741, Goodbye]
type = DestroySelf
triggerall = (var(1):=1)
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)


;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick dir activation prevention
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Hitpause check.
; var(5) - No button on previous tick.
; var(6) - Any dir on this tick.
; var(7) - Any button on this tick.
; var(8) - Matching partner button detected.
; var(9) - AutoTurn bug fixer.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9742]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9742, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9742, PauseCheck]
type = VarSet
trigger1 = (GameTime>Parent,var(57))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)

[State 9742, Facing]
type = Turn
trigger1 = (var(9):=(Facing != Parent,Facing))

[State 9742, ParentDirCheck]
type = VarSet
trigger1 = (Parent,command = "holdfwd")
trigger2 = (Parent,command = "holdback")
trigger3 = (Parent,command = "holdup")
trigger4 = (Parent,command = "holddown")
trigger5 = (var(6):=0)
var(6) = 1

[State 9742, ParentButtonCheck]
type = VarSet
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
trigger8 = (var(7):=0)
var(7) = 1

[State 9742, SameButtonCheck]
type = VarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = NumPartner
trigger1 = (Parent,command = "a")
trigger1 = (Partner,command = "a")
trigger2 = (Parent,command = "b")
trigger2 = (Partner,command = "b")
trigger3 = (Parent,command = "c")
trigger3 = (Partner,command = "c")
trigger4 = (Parent,command = "x")
trigger4 = (Partner,command = "x")
trigger5 = (Parent,command = "y")
trigger5 = (Partner,command = "y")
trigger6 = (Parent,command = "z")
trigger6 = (Partner,command = "z")
trigger7 = (Parent,command = "start")
trigger7 = (Partner,command = "start")
trigger8 = (var(8):=0)
var(8) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(1)
trigger1 = var(6)
trigger1 = !var(3)
trigger1 = !var(4)
trigger1 = !var(9)
var(59) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (Parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (Parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (Parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (Parent,command = "holddown")
var(59) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5)
trigger1 = var(7)
trigger1 = !var(2)
trigger1 = !var(8)
var(59) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = !var(8)
trigger1 = (command = "a")
trigger1 = (Parent,command = "a")
trigger2 = (command = "b")
trigger2 = (Parent,command = "b")
trigger3 = (command = "c")
trigger3 = (Parent,command = "c")
trigger4 = (command = "x")
trigger4 = (Parent,command = "x")
trigger5 = (command = "y")
trigger5 = (Parent,command = "y")
trigger6 = (command = "z")
trigger6 = (Parent,command = "z")
trigger7 = (command = "start")
trigger7 = (Parent,command = "start")
var(59) = -1

[State 9742, UnPauseCheck]
type = VarSet
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = (var(2) = 2)
trigger2 = (var(2):=0)
var(2) = 2

[State 9742, Goodbye]
type = DestroySelf
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6)
trigger2 = var(7)
trigger3 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = (var(1):=1)
var(5) = !var(7)


;------------------
; XOR Method's HitPauseTime Helper State

[StateDef 9743]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9743, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9743, HitPauseTime]
type = VarSet
trigger1 = !(Parent,HitPauseTime)
trigger2 = (GameTime>Parent,var(57))
var(1) = Parent,HitPauseTime

[State 9742, Goodbye]
type = DestroySelf
trigger1 = (Parent,var(59) = 1)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

;==================================================================================
;==================================================================================
;==================================================================================

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

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[StateDef -2]

;==================================================================================
;======| RELACIONADO À AI - AI RELATED |===========================================
;==================================================================================

; Within StateDef -2, none of your own AI-related code should be placed
; above these next two controllers.

[State -2, StopAI]
type = VarSet
triggerall = (var(59) > 0)
trigger1 = (RoundState != 2)
trigger2 = !Alive
var(59) = -2
IgnoreHitPause = 1

; This controller is optional.  It allows you treat the AI flag as a boolean
; value rather than an integer value, letting you trigger your AI directives
; with "var(0)" instead of "var(59)>0", and letting you make moves usable only
; by humans by using "!var(0)" instead of "var(59)<1", thus slightly improving
; the size and efficiency of your code.
; Another benefit is that it makes it much easier for users to disable your AI,
; if they so choose.
;[State -2, Simplifier]
;type = VarSet
;trigger1 = (var(59) = 1)
;trigger2 = (var(0):=0)
;var(0) = 1	; Another option is to replace 1 with something like MatchNo, if
		; you want to design your AI to have varying levels of difficulty.
;IgnoreHitPause = 1

;==================================================================================
;==================================================================================
;==================================================================================


[State -2, Command Reader]
type = Helper
trigger1 = !numhelper(9998)
name = "comreader"
id = 9998
stateno = 9998
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999
keyctrl = 1
ownpal = 0
postype = left

[State -2, Helper Controller]
type = Helper
trigger1 = !numhelper(9999)
name = "controller"
id = 9999
stateno = 9999
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999
keyctrl = 1
ownpal = 0
postype = left
pos = 0, 128

[State -2, XP Report]
type = Helper
trigger1 = roundstate > 2
trigger1 = var(20)
trigger1 = alive
trigger1 = !numhelper(30000)
name = "report"
id = 30000
stateno = 30000
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
postype = left

[State -2, KO Display]
type = Helper
trigger1 = var(20)
trigger1 = matchover
trigger1 = lose || drawgame
trigger1 = !numhelper(30200)
name = "display"
id = 30200
stateno = 30200
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
postype = left

[State -2, Weapon Lost]
type = VarSet
triggerall = var(9) > 0
trigger1 = !selfanimexist(anim)
trigger2 = anim > 5930
var(9) = -var(9)

[State -2, Width Scale]
type = Width
trigger1 = statetype != A
player = floor(const(size.ground.front)*(const(size.xscale) - 1)), floor(const(size.ground.back)*(const(size.xscale) - 1))

[State -2, Width Scale]
type = Width
trigger1 = statetype = A
player = floor(const(size.air.front)*(const(size.xscale) - 1)), floor(const(size.air.back)*(const(size.xscale) - 1))

[State Weapon Layer Default]
type = VarSet
trigger1 = var(9) > 0
var(11) = 1

[State Shield Layer Default]
type = VarSet
trigger1 = var(9) > 0
var(12) = 0 

[State Weapon Trial Reset]
type = Null
trigger1 = var(17) := 0

[State Invisible Flag Reset]
type = Null
trigger1 = var(41) := 0

[State Invisible]
type = AssertSpecial
trigger1 = movetype != H || (anim = 161 && statetype = S && stateno = [161, 162])
trigger1 = var(9) > 0
trigger1 = anim != 5300
trigger1 = var(41) := 1
flag = Invisible
ignorehitpause = 1

[State -2, Single Target Guarded]
type = VarAdd
triggerall = moveguarded = 1 || projguardedtime(var(14)) = 0
triggerall = numtarget(var(14)) = 1
triggerall = numenemy
triggerall = target(var(14)), gethitvar(guarded)
triggerall = var(6)
trigger1 = target(var(14)), id = var(2)
trigger1 = var(3) != -1
trigger2 = target(var(14)), id = var(4)
trigger2 = var(5) != -1
v = ifelse(target(var(14)), id = var(2), 3, 5)
value = var(6)
ignorehitpause = 1

[State -2, Multiple Targets Guarded]
type = null
triggerall = moveguarded = 1 || projguardedtime(var(14)) = 0
triggerall = numtarget(var(14)) > 1
triggerall = numenemy
triggerall = var(6)
;triggerall = target(var(14)), id = var(2) || target(var(14)), id = var(4)
trigger1 = var(3) != -1
trigger1 = enemy(0), gethitvar(guarded)
trigger1 = enemy(0), gethitvar(chainid) = var(14)
trigger1 = enemy(0), gethitvar(hitshaketime)
trigger1 = var(3) := var(3) + var(6)
trigger1 = 0
trigger2 = var(5) != -1
trigger2 = numenemy > 1
trigger2 = enemy(1), gethitvar(guarded)
trigger2 = enemy(1), gethitvar(chainid) = var(14)
trigger2 = enemy(1), gethitvar(hitshaketime)
trigger2 = var(5) := var(5) +  var(6)
trigger2 = 0
ignorehitpause = 1

[State -2, Single Target Guard Break]
type = TargetState
triggerall = moveguarded = 1 || projguardedtime(var(14)) = 0
triggerall = var(6)
triggerall = numtarget(var(14)) = 1
triggerall = target(var(14)), alive
triggerall = target(var(14)), gethitvar(guarded)
trigger1 = target(var(14)), id = var(2)
trigger1 = var(3) >= floor(target(var(14)), lifemax*target(var(14)), const(data.defence)*0.01)
trigger1 = var(3) := 0 || 1
trigger1 = var(7) := 1
trigger2 = target(var(14)), id = var(4)
trigger2 = var(5) >= floor(target(var(14)), lifemax*target(var(14)), const(data.defence)*0.01)
trigger2 = var(5) := 0 || 1
trigger2 = var(7) := 1
id = var(14)
value = 5400
ignorehitpause = 1

[State -2, Multiple Target Guard Break]
;Since TargetState can only affect ALL targets, only activates when both enemies meet criteria
;This means if only 1 can be broken, but both are hit at the same time, there will be no guard crush
type = TargetState
triggerall = moveguarded = 1 || projguardedtime(var(14)) = 0
triggerall = var(6)
triggerall = numtarget(var(14)) > 1
triggerall = numenemy > 1
trigger1 = enemy(0), alive
trigger1 = enemy(0), gethitvar(guarded)
trigger1 = enemy(0), gethitvar(chainid) = var(14)
trigger1 = enemy(0), gethitvar(hitshaketime)
trigger1 = enemy(1), alive
trigger1 = enemy(1), gethitvar(guarded) 
trigger1 = enemy(1), gethitvar(chainid) = var(14)
trigger1 = enemy(1), gethitvar(hitshaketime)
trigger1 = var(3) >= floor(enemy(0), lifemax*enemy(0), const(data.defence)*0.01)
trigger1 = var(5) >= floor(enemy(1), lifemax*enemy(0), const(data.defence)*0.01)
trigger1 = var(3) := 0 || 1
trigger1 = var(5) := 0 || 1
trigger1 = var(7) := 2
id = var(14)
value = 5400
ignorehitpause = 1

[State -2, Single Mode Guard Break Spark/Sound]
type = VarSet
trigger1 = var(7)
trigger1 = var(22)
trigger1 = numenemy = 1
var(7) = 0
ignorehitpause = 1

[State -2, Guard Break Spark]
type = Explod
trigger1 = numtarget(var(14)) = 1
trigger1 = var(7) = 1
id = 17008
anim = 17008
sprpriority = 5
bindtime = 1
pos = floor((target(var(14)), pos x - pos x)*facing - target(var(14)), const(size.ground.front) + 10), floor((target(var(14)), pos y - pos y) + target(var(14)), const(size.head.pos.y)*0.3 + target(var(14)), const(size.mid.pos.y)*0.7)
ignorehitpause = 1
supermovetime = 99999
pausemovetime = 99999
ownpal = 1

[State -2, Double Guard Break Spark]
type = Explod
trigger1 = numenemy
trigger1 = var(7) = 2
id = 17008
anim = 17008
sprpriority = 5
bindtime = 1
pos = floor((enemy(0), pos x - pos x)*facing - enemy(0), const(size.ground.front) + 10), floor((enemy(0), pos y - pos y) + enemy(0), const(size.head.pos.y)*0.3 + enemy(0), const(size.mid.pos.y)*0.7)
ignorehitpause = 1
supermovetime = 99999
pausemovetime = 99999
ownpal = 1


[State -2, Double Guard Break Spark]
type = Explod
trigger1 = numenemy > 1
trigger1 = var(7) = 2
id = 17008
anim = 17008
sprpriority = 5
bindtime = 1
pos = floor((enemy(1), pos x - pos x)*facing - enemy(1), const(size.ground.front) + 10), floor((enemy(1), pos y - pos y) + enemy(1), const(size.head.pos.y)*0.3 + enemy(1), const(size.mid.pos.y)*0.7)
ignorehitpause = 1
supermovetime = 99999
pausemovetime = 99999
ownpal = 1


[State -2, Guard Break Sound]
type = PlaySnd
trigger1 = numenemy > 1
trigger1 = numtarget(var(14)) = 1
trigger1 = var(7) = 1
trigger1 = var(7) := 0 || 1
value = 6, 2
abspan = floor(target(var(14)), pos x)
ignorehitpause = 1

[State -2, Double Guard Break Sounds]
type = PlaySnd
trigger1 = var(7) = 2
trigger1 = numenemy
value = 6, 2
abspan = floor(enemy(0), pos x)
ignorehitpause = 1

[State -2, Double Guard Break Sounds]
type = PlaySnd
trigger1 = var(7) = 2
trigger1 = var(7) := 0 || 1
trigger1 = numenemy > 1
value = 6, 2
abspan = floor(enemy(1), pos x)
ignorehitpause = 1

[State -2, Guard Break Reset]
type = VarSet
triggerall = var(7) := 0 || 1
trigger1 = !hitdefattr = SCA, AA
trigger2 = movecontact = 1 || projcontacttime(var(14)) = 0
var(6) = 0
ignorehitpause = 1

[State -2, Enemy 1 Guard Guage]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = numenemy
trigger1 = enemy(0), statetype != A
trigger1 = enemy(0), movetype != H || enemy(0), statetype = L
var(3) = ifelse(var(3) > ceil(fvar(12)*15), -ceil(fvar(12)*15), -var(3))
ignorehitpause = 1

[State -2, Enemy 2 Guard Guage]
type = VarAdd
trigger1 = var(5) > 0
trigger1 = numenemy > 1
trigger1 = enemy(1), statetype != A
trigger1 = enemy(1), movetype != H || enemy(1), statetype = L
var(5) = ifelse(var(5) > ceil(fvar(12)*15), -ceil(fvar(12)*15), -var(5))
ignorehitpause = 1

[State -2, Single Mode Guard Break Spark/Sound]
type = VarSet
trigger1 = var(8)
var(8) = 0
ignorehitpause = 1

[State -2, Single Mode Guard Break Spark/Sound]
type = null
triggerall = numenemy = 1
trigger1 = enemy, id = var(2)
trigger1 = var(8) := floor(enemy, lifemax*enemy, const(data.defence)*0.01) - var(3)
trigger2 = enemy, id = var(4)
trigger2 = var(8) := floor(enemy, lifemax*enemy, const(data.defence)*0.01) - var(5)
ignorehitpause = 1

[State -2, GetHit Sound]
type = StopSnd
trigger1 = movetype = H
trigger1 = stateno != 161
trigger1 = gethitvar(hitshaketime) = 1
trigger1 = !gethitvar(guarded) || stateno > 155
channel = 0
ignorehitpause = 1

[State -2, GetHit Sound]
type = PlaySnd
triggerall = alive
trigger1 = movetype = H
trigger1 = stateno != 161
trigger1 = gethitvar(hitshaketime) = 1
trigger1 = random < (gethitvar(animtype) + 1)*100
trigger1 = !gethitvar(guarded)
channel = 0
value = 5000, 0
ignorehitpause = 1

[State -2, Max Level]
type = VarSet
trigger1 = var(20) >= var(40)
var(19) = 0

[State -2, Movehit Var Reset]
type = VarSet
trigger1 = 1
var(26) = ifelse(movehit = 1 && (hitpausetime > var(28) || movetype != A), -1, 0)
ignorehitpause = 1

[State -2, Movehit Var Reset for Projcontact]
type = VarSet
trigger1 = projcontacttime(var(14)) = 0
var(26) = -1
ignorehitpause = 1

[State -2, Hitpause Var Reset]
type = VarSet
trigger1 = 1
var(28) = hitpausetime
ignorehitpause = 1

[State -2, FX Flag Reset]
type = VarSet
trigger1 = var(27) < 0
var(27) = 0
ignorehitpause = 1

[State -2, Fire FX]
type = Explod
trigger1 = var(27) = 1
trigger1 = var(26) = -1
trigger1 = numtarget(var(14))
trigger1 = var(26) := 2
id = 7050
anim = 7050 + random%3
sprpriority = 2
postype = p2
bindtime = 45 
pos = 0, floor(target(var(14)), const(size.mid.pos.y))
random = floor((target(var(14)), const(size.ground.front)+target(var(14)), const(size.ground.back))*(hitcount != 0)*0.4), floor((target(var(14)), const(size.mid.pos.y)-target(var(14)), const(size.head.pos.y))*(hitcount != 0)*0.8)
ignorehitpause = 1
ownpal = 1

[State -2, Ice TargetState]
type = TargetState
triggerall = var(27) = 2
triggerall = var(26) = -1
trigger1 = numtarget(var(14))
trigger1 = numtarget(var(14)) > 1 || !target(var(14)), gethitvar(guarded)
value = 5706
id = var(14)
ignorehitpause = 1

[State -2, Ice EnvColor]
type = EnvColor
triggerall = var(27) = 2
triggerall = var(26) = -1
triggerall = var(29) = 1
trigger1 = numtarget(var(14))
trigger1 = target(var(14)), stateno = [5706, 5708]
trigger1 = target(var(14)), time = 0
trigger1 = !target(var(14)), gethitvar(guarded)
time = 2
ignorehitpause = 1

[State -2, Ice FX]
type = Helper
triggerall = var(27) = 2
triggerall = var(26) = -1
trigger1 = numtarget(var(14))
trigger1 = target(var(14)), stateno = [5706, 5708]
trigger1 = target(var(14)), time = 0
trigger1 = !target(var(14)), gethitvar(guarded)
trigger1 = var(26) := 2
name = "ice"
id = 7060
stateno = 7060
postype = left
pos = floor(target(var(14)), pos x - target(var(14)), facing*10), floor(target(var(14)), pos y + target(var(14)), const(size.mid.pos.y))
facing = target(var(14)), facing
ownpal = 1
random = floor((target(var(14)), const(size.ground.front)+target(var(14)), const(size.ground.back))*0.2), floor((target(var(14)), const(size.mid.pos.y)-target(var(14)), const(size.head.pos.y))*(movehit != 0)*0.2)
ignorehitpause = 1

[State -2, Shock FX]
type = Explod
trigger1 = var(27) = 3
trigger1 = var(26) = -1
trigger1 = numtarget(var(14))
trigger1 = var(26) := 2
id = 7070
anim = 7070 + random%5
sprpriority = 2
postype = p2
bindtime = -1
pos = 0, target(var(14)), const(size.mid.pos.y)
random = floor((target(var(14)), const(size.ground.front)+target(var(14)), const(size.ground.back))*(hitcount != 0)*0.4), floor((target(var(14)), const(size.mid.pos.y)-target(var(14)), const(size.head.pos.y))*(hitcount != 0)*0.8)
ignorehitpause = 1
ownpal = 1

[State -2, FX Sound]
type = PlaySnd
trigger1 = var(26) = 2
trigger1 = numtarget(var(14))
value = 5, 7 + var(27)
abspan = floor(target(var(14)), pos x)
ignorehitpause = 1
channel = 2

[State -2, FX Flag Invert]
type = VarSet
trigger1 = var(27) > 0
var(27) = -var(27)
ignorehitpause = 1

[State -2, Counterhit Var]
type = VarSet
trigger1 = 1
var(29) = ifelse(p2movetype = A, 1, ifelse(var(29) > 0, -1, 0))
ignorehitpause = 1

[State -2, Jump Buffer]
type = VarAdd
triggerall = var(15) > 0
trigger1 = var(15) > 1
trigger2 = command != "holddown"
var(15) = -1
ignorehitpause = 1

[State -2, Jump Buffer]
type = VarSet
triggerall = var(15) = 0
trigger1 = command = "holddown"
var(15) = 12
ignorehitpause = 1

[State -2, Defence]
type = LifeAdd
trigger1 = life > 1
trigger1 = life < var(31)
trigger1 = alive
value = floor((1-(fvar(9)/(1 + ifelse(var(20), (var(20) - 1)*fvar(16), 0))))*(var(31) - life))
ignorehitpause = 1

;[State -2, Defence]
;type = DefenceMulSet
;trigger1 = 1
;value = 0.8;fvar(9)/(1 + ifelse(var(20), (var(20) - 1)*fvar(16), 0))
;ignorehitpause = 1

[State -2, Legendary Power Drain]
type = PowerAdd
triggerall = !var(20)
triggerall = abs(var(9)) = 5
triggerall = gametime%2
triggerall = alive
trigger1 = movetype = H
trigger2 = stateno != [2000, 2001]
trigger2 = stateno != [2100, 2104]
trigger2 = stateno != 1204 || prevstateno != 2103
trigger2 = stateno != 2200 && stateno != 2210
trigger2 = stateno != 4000
value = -5

;[State -2, Legendary Power Drain]
;type = PowerAdd
;triggerall = !var(20)
;triggerall = abs(var(9)) = 5
;trigger1 = power > var(32)
;trigger1 = alive
;value = ceil(0.5*(var(32) - power))
;ignorehitpause = 1

[State -2, Legendary Power Empty]
type = Null
triggerall = !var(20)
triggerall = abs(var(9)) = 5
trigger1 = power = 0 || !alive
trigger1 = hitshakeover
trigger1 = ctrl || movetype != A
trigger1 = var(9) := abs(var(34)) || 1
trigger1 = var(10) := abs(var(35))

[State -2, Life Var]
type = VarSet
trigger1 = 1
var(31) = life

[State -2, Power Var]
type = VarSet
trigger1 = 1
var(32) = power

[State -2, Movetype Var]
type = VarSet
trigger1 = movetype != H
var(36) = 0
ignorehitpause = 1

[State -2, Movetype Var]
type = VarAdd
trigger1 = movetype = H
var(36) = 1
ignorehitpause = 1

[State -2, Combo Counter]
type = VarSet
trigger1 = !numtarget
var(38) = 0
ignorehitpause = 1

[State -2, Combo Counter]
type = VarAdd
trigger1 = uniqhitcount > var(37)
var(38) = uniqhitcount - var(37)
ignorehitpause = 1

[State -2, Combo Counter]
type = VarSet
trigger1 = 1
var(37) = uniqhitcount
ignorehitpause = 1

[State -2, Hitstun Balance]
type = VarAdd
triggerall = var(53) < 600
trigger1 = movetype = H
trigger1 = gametime%3
trigger2 = stateno = [120, 155]
trigger2 = gametime%6
var(53) = 2
ignorehitpause = 1

[State -2, Hitstun Balance]
type = VarAdd
trigger1 = var(53) > 0
trigger1 = movetype != H
trigger1 = statetype != L
trigger1 = anim != 9999
trigger1 = gametime%2
var(53) = ceil(-1 - var(53)/100.0)
ignorehitpause = 1

[State -2, P2MoveContact]
type = VarSet
trigger1 = enemynear, hitpausetime
trigger2 = movetype = H
trigger2 = gethitvar(guarded)
trigger2 = !hitshakeover
var(54) = 1
ignorehitpause = 1

[State -2, P2MoveContact]
type = VarSet
trigger1 = enemynear, time < 2
var(54) = 0
ignorehitpause = 1

[State -2, Wakeup Timer]
type = VarAdd
trigger1 = var(55)
var(55) = -1
ignorehitpause = 1

[State -2, Pause Detector]
type = VarSet
trigger1 = 1
var(56) = gametime

[State -2, Target X Pos]
type = VarSet
trigger1 = numtarget
fvar(18) = target, screenpos x
ignorehitpause = 1

[State -2, Target Y Pos]
type = VarSet
trigger1 = numtarget
fvar(19) = target, pos y + target, const(size.head.pos.y)*(0.5*(target, statetype = C) + 0.5*(target, statetype = S || target, statetype = A))
ignorehitpause = 1

[State -2, Target X Pos]
type = VarSet
trigger1 = !numtarget
trigger1 = numenemy
fvar(18) = enemynear, screenpos x
ignorehitpause = 1

[State -2, Target Y Pos]
type = VarSet
trigger1 = !numtarget
trigger1 = numenemy
fvar(19) = enemynear, pos y + enemynear, const(size.head.pos.y)*(0.5*(enemynear, statetype = C) + 0.5*(enemynear, statetype = S || enemynear, statetype = A))
ignorehitpause = 1

[State -2, Super BG]
type = AssertSpecial
trigger1 = numexplod(7500)
flag = NoBG
flag2 = NoFG
ignorehitpause = 1

[State -2, Damage Dampening Var]
type = VarSet
trigger1 = var(38)
trigger1 = !var(33)
fvar(13) = fvar(14)*(fvar(14)**var(38))
ignorehitpause = 1

[State -2, Damage Dampening Var]
type = VarSet
trigger1 = !var(38)
fvar(13) = 1
ignorehitpause = 1

[State -2, Damage Dampening & Bonus]
type = AttackMulSet
trigger1 = fvar(13) = 1
trigger2 = !var(33)
value = fvar(13)*ifelse(var(20), 1 + (var(20) - 1)*fvar(15), 1)
ignorehitpause = 1

[State -2, Damage Dampening Var]
type = VarSet
trigger1 = 1
var(33) = 0
ignorehitpause = 1

[State -2, Juggle Flag]
type = VarSet
triggerall = var(43) := 0 || 1
triggerall = numtarget
trigger1 = numenemy = 1
trigger1 = target, statetype = A
trigger1 = target, movetype = H
trigger2 = numenemy > 1
trigger2 = enemynear(0), statetype = A
trigger2 = enemynear(0), movetype = H
trigger2 = enemynear(1), statetype = A
trigger2 = enemynear(1), movetype = H
var(43) = 1
ignorehitpause = 1

[State -2, Mystic Break Select]
type = RemoveExplod
triggerall = numexplod(7600)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger1 = var(24) := ifelse(var(24) = 6, 1, var(24) + 1)
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
trigger2 = var(24) := ifelse(var(24) = 6, 1, var(24) + 1)
id = 7600
ignorehitpause = 1

[State -2, Mystic Break Select]
type = RemoveExplod
triggerall = numexplod(7601)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
id = 7601
ignorehitpause = 1

[State -2, Mystic Break Select]
type = RemoveExplod
triggerall = numexplod(7602)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
id = 7602
ignorehitpause = 1

[State -2, Mystic Break Select]
type = RemoveExplod
triggerall = numexplod(7603)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
id = 7603
ignorehitpause = 1

[State -2, Mystic Break Select]
type = RemoveExplod
triggerall = numexplod(7604)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
id = 7604
ignorehitpause = 1

[State -2, Mystic Break Select]
type = RemoveExplod
triggerall = numexplod(7605)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
id = 7605
ignorehitpause = 1

[State -2, Mystic Break Select]
type = Explod
triggerall = var(59) < 1
triggerall = var(24)
triggerall = !numexplod(7600)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
postype = p1
id = 7600
anim = 7610
bindtime = -1
pos = -30*facing, ifelse(statetype = S || statetype = A, floor(-110*const(size.yscale)), floor(-80*const(size.yscale)))
facing = facing
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = ifelse(var(24) = 1, 1.2, 0.7), ifelse(var(24) = 1, 1.2, 0.7)
ownpal = 1
ignorehitpause = 1

[State -2, Mystic Break Select]
type = Explod
triggerall = var(59) < 1
triggerall = var(24)
triggerall = !numexplod(7601)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
postype = p1
id = 7601
anim = 7620
bindtime = -1
pos = -18*facing, ifelse(statetype = S || statetype = A, floor(-110*const(size.yscale)), floor(-80*const(size.yscale)))
facing = facing
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = ifelse(var(24) = 2, 1.2, 0.7), ifelse(var(24) = 2, 1.2, 0.7)
ownpal = 1
ignorehitpause = 1

[State -2, Mystic Break Select]
type = Explod
triggerall = var(59) < 1
triggerall = var(24)
triggerall = !numexplod(7602)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
postype = p1
id = 7602
anim = 7630
bindtime = -1
pos = -6*facing, ifelse(statetype = S || statetype = A, floor(-110*const(size.yscale)), floor(-80*const(size.yscale)))
facing = facing
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = ifelse(var(24) = 3, 1.2, 0.7), ifelse(var(24) = 3, 1.2, 0.7)
ownpal = 1
ignorehitpause = 1

[State -2, Mystic Break Select]
type = Explod
triggerall = var(59) < 1
triggerall = var(24)
triggerall = !numexplod(7603)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
postype = p1
id = 7603
anim = 7640
bindtime = -1
pos = 6*facing, ifelse(statetype = S || statetype = A, floor(-110*const(size.yscale)), floor(-80*const(size.yscale)))
facing = facing
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = ifelse(var(24) = 4, 1.2, 0.7), ifelse(var(24) = 4, 1.2, 0.7)
ownpal = 1
ignorehitpause = 1

[State -2, Mystic Break Select]
type = Explod
triggerall = var(59) < 1
triggerall = var(24)
triggerall = !numexplod(7604)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
postype = p1
id = 7604
anim = 7650
bindtime = -1
pos = 18*facing, ifelse(statetype = S || statetype = A, floor(-110*const(size.yscale)), floor(-80*const(size.yscale)))
facing = facing
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = ifelse(var(24) = 5, 1.2, 0.7), ifelse(var(24) = 5, 1.2, 0.7)
ownpal = 1
ignorehitpause = 1

[State -2, Mystic Break Select]
type = Explod
triggerall = var(59) < 1
triggerall = var(24)
triggerall = !numexplod(7605)
trigger1 = command = "start"
trigger1 = var(56) = gametime
trigger2 = numhelper(9998)
trigger2 = helper(9998), command = "start"
postype = p1
id = 7605
anim = 7660
bindtime = -1
pos = 30*facing, ifelse(statetype = S || statetype = A, floor(-110*const(size.yscale)), floor(-80*const(size.yscale)))
facing = facing
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = ifelse(var(24) = 6, 1.2, 0.7), ifelse(var(24) = 6, 1.2, 0.7)
ownpal = 1
ignorehitpause = 1

[State Shield Properties]
type = Null
triggerall = !var(20)
trigger1 = var(10) != 5
trigger1 = fvar(9) := 1
trigger2 = var(10) = 5
trigger2 = fvar(9) := 0.75
ignorehitpause = 1

[State Shield Properties]
type = Null
triggerall = var(20)
trigger1 = var(10) = 1
trigger1 = fvar(9) := 1
trigger2 = var(10) = 2
trigger2 = fvar(9) := 0.95
trigger3 = var(10) = 3
trigger3 = fvar(9) := 0.9
trigger4 = var(10) = 4
trigger4 = fvar(9) := 0.85
trigger5 = var(10) = 5
trigger5 = fvar(9) := 0.8
ignorehitpause = 1

[State Debug Info]
type = DisplayToClipboard
trigger1 = !var(20)
text = "en.1 guard %d, combo counter %d, dampening %.2f, AI anger %d, AI perseus charge time %d"
params = var(3), var(38), fvar(10), var(53), var(50)

[State Debug Info]
type = DisplayToClipboard
trigger1 = var(20)
text = "en.1 guard %d, level %d, xp %d, available weaps %d"
params = var(3), var(20), var(19), var(21)
ignorehitpause = 1

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

;==================================================================================
;======| RELACIONADO À AI - AI RELATED |===========================================
;==================================================================================

; Kamek and Luchini appear to have been the first ones to use the IsHomeTeam AI activation concept.
; Feel free to move this controller to your character's intro state for slightly better efficiency.
[State -3, SetAI]
type = VarSet
triggerall = !RoundState
triggerall = IsHomeTeam
trigger1 = (TeamSide = 2)
trigger2 = (MatchNo > 1)
var(59) = 1

; Feel free to move this controller to your character's intro state for slightly better efficiency.
; Note that it may give P2 a slight unfair advantage in simul team vs mode, so you
; may want to disable it.  But then, since when has Mugen been about fairness? =P
[State -3, Unfair]; Is this reliable?
type = VarSet
trigger1 = !RoundState
trigger1 = (var(59) != 1)
trigger1 = NumPartner
trigger1 = (ID > Partner,ID)
trigger1 = (TeamSide = 2)
var(59) = 1

[State -3, AI Helper (Compatibly Partnered Version)]
type = Helper
trigger1 = !var(59)
trigger1 = !NumHelper(9742)
trigger1 = (RoundState = 2)
trigger1 = Alive
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 999999999
SuperMoveTime = 999999999

; If you want to use the Guard mode, Dummy mode, Distance, or Button jam dummy control
; options in Training mode without activating the dummy's AI while working on your
; character, then all you need to do is temporarily disable this controller.
; Or, if you want to permanently disable this controller in Training mode,
; then you could use the Training mode detection code available on my site
; ( http://www.shinmugen.net/winane/ ), and then just add a "(var(59)&63)>30"
; triggerall to this controller.
[State -3, AI Helper]
type = Helper
triggerall = !var(59)
triggerall = !NumHelper(9741)
triggerall = (RoundState = 2)
triggerall = Alive
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 999999999
SuperMoveTime = 999999999

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = (var(59) = -2)
trigger1 = (RoundState = 2)
trigger1 = Alive
var(59) = 1

[State -3, HitPauseTime Helper]
type = Helper
triggerall = var(59)!=1
triggerall = !NumHelper(9743)
triggerall = (RoundState = 2)
triggerall = Alive
trigger1 = (MatchNo = 1)
trigger2 = NumPartner
trigger2 = (ID > Partner,ID)
HelperType = normal
name = "HitPauseTime"
ID = 9743
pos = 9999999,99999
StateNo = 9743
PauseMoveTime = 999999999
SuperMoveTime = 999999999

; According to Roque, this method works in Linux Mugen version 2002.04.14,
; whereas the old humanly-impossible commands method does not.
; It is very important that this controller NOT be moved to State -2.
; Note that this part won't work if AI.Cheat is turned off in mugen.cfg.
[State -3, XOR]
type = VarSet
triggerall = var(59)!=1
triggerall = (var(57) = GameTime-1)
triggerall = NumHelper(9743)
triggerall = !(Helper(9743),var(1))
trigger1 = (command = "a") ^^ (command = "a2")
trigger2 = (command = "b") ^^ (command = "b2")
trigger3 = (command = "c") ^^ (command = "c2")
trigger4 = (command = "x") ^^ (command = "x2")
trigger5 = (command = "y") ^^ (command = "y2")
trigger6 = (command = "z") ^^ (command = "z2")
trigger7 = (command = "start") ^^ (command = "start2")
trigger8 = (command = "holda") ^^ (command = "holda2")
trigger9 = (command = "holdb") ^^ (command = "holdb2")
trigger10 = (command = "holdc") ^^ (command = "holdc2")
trigger11 = (command = "holdx") ^^ (command = "holdx2")
trigger12 = (command = "holdy") ^^ (command = "holdy2")
trigger13 = (command = "holdz") ^^ (command = "holdz2")
trigger14 = (command = "holdstart") ^^ (command = "holdstart2")
trigger15 = (command = "holdfwd") ^^ (command = "holdfwd2")
trigger16 = (command = "holdback") ^^ (command = "holdback2")
trigger17 = (command = "holdup") ^^ (command = "holdup2")
trigger18 = (command = "holddown") ^^ (command = "holddown2")
trigger19 = (command = "recovery") ^^ (command = "recovery2")
trigger20 = (command = "jupiter") ^^ (command = "jupiter2")
trigger21 = (command = "hercules") ^^ (command = "hercules2")
trigger22 = (command = "mystic") ^^ (command = "mystic2")
trigger23 = (command = "gaiax") ^^ (command = "gaiax2")
trigger24 = (command = "gaiay") ^^ (command = "gaiay2")
trigger25 = (command = "gaiaz") ^^ (command = "gaiaz2")
trigger26 = (command = "switchlegendary") ^^ (command = "switchlegendary2")
trigger27 = (command = "slama") ^^ (command = "slama2")
trigger28 = (command = "slamb") ^^ (command = "slamb2")
trigger29 = (command = "slamaquick") ^^ (command = "slamaquick2")
trigger30 = (command = "slambquick") ^^ (command = "slambquick2")
;trigger31 = command = "start"
;Add more as desired. (See my notes in the CMD.)
var(59) = 1

; It is very important that this controller NOT be moved to State -2, as putting
; it there would defeat the entire purpose of the controller, allowing the
; helper method or the XOR method to erroneously set the AI variable.
; And within State -3, don't put any ChangeState controllers before this
; controller, lest you unnecessarily delay your character's AI activation.
[State -3, GameTimeVar]
type = VarSet
trigger1 = 1
var(57) = GameTime
IgnoreHitPause = 1

; Within StateDef -3, none of your own AI-related code should come after the code
; provided here (and putting it before the code is also generally a bad idea).
; It's better to use State -1 (or, in special circumstances, State -2) instead.

;==================================================================================
;==================================================================================
;==================================================================================

[State -3, SprPriority]
type = SprPriority
trigger1 = movetype = H
trigger1 = !hitshakeover
value = 0

[State Weapon Select]
type = Null
triggerall = roundstate < 2
triggerall = var(30)
triggerall = command = "back"
var(9) = ifelse(var(9) = 4, 9, ifelse(var(9) = 6, 4, ifelse(var(9) = 7, 6, ifelse(var(9) = 8, 7, 8))))
trigger1 = (var(21)%10000)/1000
trigger1 = var(9) > 8 || (!((var(21)%100000)/10000) && var(9) = [1, 5])
trigger1 = var(9) := 8
trigger2 = (var(21)%1000)/100 
trigger2 = var(9) > 7 || (!((var(21)%100000)/10000) && var(9) = [1, 5])
trigger2 = var(9) := 7
trigger3 = (var(21)%100)/10
trigger3 = var(9) > 6 || (!((var(21)%100000)/10000) && var(9) = [1, 5])
trigger3 = var(9) := 6
trigger4 = var(9) > 5
trigger4 = var(9) := var(21)%10
trigger5 = (var(21)%100000)/10000
trigger5 = var(9) := 9

[State Weapon Select]
type = Null
triggerall = roundstate < 2
triggerall = var(30)
triggerall = command = "fwd"
trigger1 = (var(21)%100)/10
trigger1 = var(9) < 6
trigger1 = var(9) := 6
trigger2 = (var(21)%1000)/100
trigger2 = var(9) < 7
trigger2 = var(9) := 7
trigger3 = (var(21)%10000)/1000
trigger3 = var(9) < 8
trigger3 = var(9) := 8
trigger4 = (var(21)%100000)/10000
trigger4 = var(9) < 9
trigger4 = var(9) := 9
trigger5 = var(9) := var(21)%10

[State Weapon Properties]
type = Null
triggerall = var(9) = 1
trigger1 = 1 || fvar(5) := 1
trigger1 = 1 || fvar(6) := 1
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 1

[State Weapon Properties]
type = Null
triggerall = var(9) = 2
trigger1 = 1 || fvar(5) := 1.05
trigger1 = 1 || fvar(6) := 1.05
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 1

[State Weapon Properties]
type = Null
triggerall = var(9) = 3
trigger1 = 1 || fvar(5) := 1.10
trigger1 = 1 || fvar(6) := 1.10
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 1

[State Weapon Properties]
type = Null
triggerall = var(9) = 4
trigger1 = 1 || fvar(5) := 1.15
trigger1 = 1 || fvar(6) := 1.15
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 1

[State Weapon Properties]
type = Null
triggerall = var(9) = 5
triggerall = !var(20)
trigger1 = 1 || fvar(5) := 1.4
trigger1 = 1 || fvar(6) := 1.4
trigger1 = 1 || fvar(7) := 0.1
trigger1 = 1 || fvar(8) := 1.2

[State Weapon Properties]
type = Null
triggerall = var(9) = 5
triggerall = var(20)
trigger1 = 1 || fvar(5) := 1.2
trigger1 = 1 || fvar(6) := 1.2
trigger1 = 1 || fvar(7) := 0.03
trigger1 = 1 || fvar(8) := 1.1

[State Weapon Properties]
type = Null
triggerall = var(9) = 6
trigger1 = 1 || fvar(5) := 1.1
trigger1 = 1 || fvar(6) := 1.1
trigger1 = 1 || fvar(7) := 0.1
trigger1 = 1 || fvar(8) := 1

[State Weapon Properties]
type = Null
triggerall = var(9) = 7
trigger1 = 1 || fvar(5) := 1.05
trigger1 = 1 || fvar(6) := 1.05
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 1

[State Weapon Properties]
type = Null
triggerall = var(9) = 8
trigger1 = 1 || fvar(5) := 1 + 0.1*statetype = A
trigger1 = 1 || fvar(6) := 1.05
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 0.95

[State Weapon Properties]
type = Null
triggerall = var(9) = 9
trigger1 = 1 || fvar(5) := 1.25
trigger1 = 1 || fvar(6) := 1.15
trigger1 = 1 || fvar(7) := 0
trigger1 = 1 || fvar(8) := 1.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
;value = 52, 0