[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 0
liedown.time = 30 ; This doesn't do anything since the change states are defined later, must be > 10
airjuggle = 15
sparkno = -1
guard.sparkno = -1
KO.echo = 0
volume = 0
IntPersistIndex = 60
FloatPersistIndex = 40

; There are some things in this group that you may want to change.
[Size]
; The next two parameters are the X and Y scale factors of your character's
; sprites. You can leave them at 1 each to keep your sprites at a normal
; size.
xscale = 1
yscale = 1
; Make sure you adjust the width settings below to suit your character.
; These affect how close another character can get to yours. Adjust these
; values and press Ctrl-C in-game. Look at the bar the feet of the
; characters.
ground.back = 18          ;Player width (back, ground)
ground.front = 18         ;Player width (front, ground)
air.back = 18             ;Player width (back, air)
air.front = 18            ;Player width (front, air)
; This is generally fine at 60. Don't make it too big, or other
; characters will have trouble jumping over yours.
height = 50               ;Height of player (for opponent to jump over)
; You can leave the next 3 unchanged.
attack.dist = 0
proj.attack.dist = 0
proj.doscale = 0
; You can set these accordingly if your character is tall or short.
; Otherwise, these default values should be fine.
head.pos = 9, -76        ;Approximate position of head
mid.pos = 0, -50         ;Approximate position of midsection
; The next 2 parameters don't need to be changed.
shadowoffset = 0
draw.offset = 0,0

; These are the velocities used in various common states that all
; characters have. Adjust these to suit your character.
[Velocity]
walk.fwd  = 2.5          ;Walk forward
walk.back = -2.5         ;Walk backward
run.fwd  = 4.5,0         ;Run forward (x, y) (y should be 0)
run.back = -4.5,0      ;Hop backward (x, y)
jump.neu = 0,-8         ;Neutral jumping velocity (x, y)
jump.back = -2.5         ;Jump back Speed (x, y)
jump.fwd = 2.5            ;Jump forward Speed (x, y)
runjump.back = -3.5,-8 ;Running jump speeds (opt)
runjump.fwd = 3.5,-8      ;.
airjump.neu = 0,-8      ;.
airjump.back = -2.5      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

; These are miscellaneous variables used for movement. Set
; accordingly.
[Movement]
airjump.num = 1           ;Number of air jumps allowed (opt)
airjump.height = 0       ;Minimum distance from ground before you
                          ;can air jump (opt)
yaccel = .3125          ;Vertical acceleration
stand.friction = .89      ;Friction coefficient when standing
crouch.friction = .89    ;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Variable usage:
; fvar(1) Normals Damage Scaling  | Maybe use
; fvar(2) Specials Damage Scaling | fvar(5 to 7)
; fvar(3) Supers Damage Scaling   | for enemy 2
; fvar(4) Corner hit pushback
; fvar(5) Corner pushback initial direction
; fvar(6)
; fvar(7)
; fvar(8) Down Down
; fvar(9) Right Right
;fvar(10) Left Left
;fvar(11)
;fvar(12)
;fvar(13)
;fvar(14) Shunpo Refill
;fvar(15) Normals Damage Scaling
;fvar(16) Specials Damage Scaling
;fvar(17) Supers Damage Scaling
;fvar(18)
;fvar(19)
;fvar(20) Superpause movetime
;fvar(21) Current combo damage taken
;fvar(22) Ceiling Helper Pos Y
;fvar(23) Const(size.xscale)
;fvar(24) Const(size.yscale)
;fvar(39)
;Anyone with Bankai:
;fvar(37) Bankai Timer
;fvar(38) After Bankai Powerset
;Ukitake:
;fvar(25) Special A cough chance
;fvar(26) Special B cough chance
;fvar(27) Special C cough chance
;fvar(28) Special D cough chance
;fvar(29) Special E cough chance
;fvar(30) Super A cough chance
;fvar(31) Super B cough chance
;fvar(32) Orb 1 ID
;fvar(33) Orb 2 ID
;fvar(34) Laser Center
;fvar(35) Laser Mode (0 = full length, 1 = has a target, 2 = resized)
;fvar(36) Orb 1 reflection ID
;fvar(37) Orb 2 reflection ID
;Ikkaku:
;fvar(25) Bankao Rune
;fvar(26) Super Armor damage
;fvar(27) Special chaining
;Ururururururu:
;fvar(25) to fvar(36) Cannon charge variables
;  var(0) AI: The simplifier variable, optional but helpful
;  var(1) Combo Condition
;  var(2) Special A Combo Condition
;  var(3) Special B Combo Condition
;  var(4) Special C Combo Condition
;  var(5) Special D Combo Condition
;  var(6) Special E Combo Condition
;  var(7) Super A Combo Condition
;  var(8) Super B Combo Condition
;  var(9) Super C Combo Condition
; var(10) RF Refill
; var(11) RF Stock
; var(12) I have a buddy, and his id < mine
; var(13) Shunpo Stock
; var(14) Damage Cancel Check
; var(15) Tick Throw preventer, self
; var(16) Hold back guarding on? Fine.
; var(17) AI time spent guarding
; var(18) AI IAD
; var(19) Intro/Taunt/Win Randomize, or other randomizer
; var(20) Tick Throw preventer, opponent 1
; var(21) Tick Throw preventer, opponent 2
; var(22) Shunpo Time
; var(23) Face Slide Stateno/Shunpo direction on 1s, AI shunpo side on 10s/AI Jump direction
; var(24) Super Armor Damage Take
; var(25) Face Slide Super Armor Time
; var(26) Land Noise plz
; var(27) FIRST ATTACK
; var(28) In Shunpo
; var(29) RF hit 1
; var(30) RF hit 2
; var(31) In RF state
; var(32) Hitspark/Guardspark Thing XXX
; var(33) Personal GameTime
; var(34) Special timer (as needed)
; var(35) Enemy 1 ID
; var(36) Enemy 2 ID
; var(37) [Probably going to be supermovetime for player]
; var(38) Corner hit pushback enemy ID
; var(39) Special Targetting
; var(40) Corner Pushback Delay Timer
; var(41) Bankai "time" / Fireball Self Erase
; var(42) BANKAIZ ON
; var(43) Bankai State
; var(44) Bankai Super Armor Counter
; var(45) Shortcut 1 Limiter
; var(46) Shortcut 2 Limiter
; var(47) Shortcut 3 Limiter
; var(48) Double Jump Land Reset
; var(49) Air Dash Land Reset
; var(50) Special A Land Reset
; var(51) Special B Lend Reset
; var(52) Special C Land Reset
; var(53) Special D Land Reset
; var(54) Special E Land Reset
; var(55) Super A Land Reset
; var(56) AI: Used by the XOR-ed commands method to detect recent custom states
; var(57) AI: The GameTime variable, required by the helper and XOR methods
; var(58) AI: The primary AI variable
; var(59)
;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 各本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 各本
[Statedef 180]
type = S

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

;---------------------------------------------------------------------------
; Win pose
; CNS difficulty: basic
; CNS レベル: 各本
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, Random]
type = VarRandom
trigger1 = time = 0
v = 19
range = 0, 9

[State 181, Sound1]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 0
value = 8,0
channel = 0

[State 181, Sound2]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 1
value = 1,0
channel = 0

[State 181, Sound3]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 2
value = 1,1
channel = 0

[State 181, Sound4]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 3
value = 1,2
channel = 0

[State 181, Sound5a]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 4
value = 1,3
channel = 0

[State 181, Sound5b]
type = PlaySnd
trigger1 = time = 72
trigger1 = var(19) = 4
value = 1,4
channel = 0

[State 181, Sound6]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 5
value = 1,5
channel = 0

[State 181, Sound7a]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 6
value = 1,6
channel = 0

[State 181, Sound7b]
type = PlaySnd
trigger1 = time = 130
trigger1 = var(19) = 6
value = 1,7
channel = 0

[State 181, Sound8]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 7
value = 1,8
channel = 0

[State 181, Sound9]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 8
value = 1,9
channel = 0

[State 181, Sound10]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(19) = 9
value = 1,10
channel = 0

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

[State 181, 2]
type = AssertSpecial
trigger1 = ifelse(var(19) = 1 || var(19) = 4, time < 165, (ifelse(var(19) = 6, time < 215, time < 150)))
flag = RoundNotOver

;---------------------------------------------------------------------------
; Introduction, Pre-Intro
; CNS difficulty: basic
; CNS レベル: 各本
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, Why do you want hold back guarding]
type = VarSet
trigger1 = command = "back"
var(16) = var(16) + 1

[State 191, Random]
type = VarRandom
trigger1 = time = 0
v = 19
range = 0, 7

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

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

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = RoundState != 0
value = 192

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 各本
[Statedef 192]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 192, Why do you want hold back guarding]
type = VarSet
trigger1 = command = "back"
var(16) = var(16) + 1

[State 192, Sound1]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 0
value = 0,0
channel = 0

[State 192, Sound2]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 1
value = 0,1
channel = 0

[State 192, Sound3]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 2
value = 0,2
channel = 0

[State 192, Sound4a]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 3
value = 0,3
channel = 0

[State 192, Sound4b]
type = PlaySnd
trigger1 = time = 132
trigger1 = var(19) = 3
value = 0,4
channel = 0

[State 192, Sound5a]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 4
value = 0,5
channel = 0

[State 192, Sound5b]
type = PlaySnd
trigger1 = time = 58
trigger1 = var(19) = 4
value = 0,6
channel = 0

[State 192, Sound6]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 5
value = 0,7
channel = 0

[State 192, Sound7]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 6
value = 0,8
channel = 0

[State 192, Sound8]
type = PlaySnd
trigger1 = time = 30
trigger1 = var(19) = 7
value = 0,9
channel = 0

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

[State 192, Anim Hold]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 191

[State 192, 3] ;Change to stand state when done
type = ChangeState
trigger1 = ifelse(var(19) = 0 || var(19) = 5, time = 180, (ifelse(var(19) = 1 || var(19) = 7, time = 150, time = 210)))
value = 0

;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
velset = 0,0
anim = 195
movetype = I
physics = S
sprpriority = 2

[State 195, No Autoturn]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

;[State 195, Turn]
;type = Turn
;trigger1 = time = 0
;trigger1 = command = "holdback"

[State 195, 1]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 196

[State 195, Sound]
type = PlaySnd
trigger1 = time = 0
value = 8,0
channel = 0

[State 195, Stand State]
type = ChangeState
trigger1 = time = 107
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Normals
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Standing Light
[StateDef 200]
ctrl = 0
type = S
movetype = A
physics = S
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 200, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 200, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3920

[State 200, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 200, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 200

[State 200, Auto turn: One Opponent]
type = Turn
triggerall = time <= 1
triggerall = (prevstateno != [200,799]) || ((prevstateno = 200 || prevstateno = 400) && numtarget = 0)
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 200, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 200, Turn]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (playerID(var(35)), alive)
triggerall = (playerID(var(36)), alive)
trigger1 = time = 0
trigger1 = command = "holdback"
trigger2 = facing = 1
trigger2 = (playerID(var(35)), pos x) < pos x
trigger2 = (playerID(var(36)), pos x) < pos x
trigger3 = facing = -1
trigger3 = (playerID(var(35)), pos x) > pos x
trigger3 = (playerID(var(36)), pos x) > pos x

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

[State 200, Sound2]
type = PlaySnd
trigger1 = animelem = 2
value = 3,0

[State 200, Normal HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = time = 0
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(15) < 8, 16 * (1 - (3 * (fvar(15)/32))), 16 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -10, -45
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 120
ground.velocity = -4
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 80 * (1 - (3 * (fvar(15)/32))), 80 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 40 * (1 - (3 * (fvar(15)/32))), 40 / 4)), 0

[State 200, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse((fvar(17)) < 99, (16*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (16*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -10, -25
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 150
ground.velocity = -4
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (40*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (40*ifelse(fvar(25)>=80,2,1)) / 4)), 0

[State 200, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 4 * (1 - (3 * ((fvar(17) - 1)/396))), 4 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 200, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(2) >= 2 ; for "AnimElemTime(x) >= 2", x = first element with a CLSN1 
trigger1 = (var(1) = [210,220]) || (var(1) = [400,420]) || (var(1) = [800,801])
trigger2 = (var(1) = 200) && var(42) != 1
value = var(1)

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 200, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Medium
[StateDef 210]
ctrl = 0
type = S
movetype = A
physics = S
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 210, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 210, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3921

[State 210, 1]
type = StateTypeSet
trigger1 = var(42) = 1
physics = N

[State 210, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 210, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 210

[State 210, 1]
type = VelAdd
trigger1 = var(42) = 1
trigger1 = var(41) >= 12
trigger1 = vel x > 0
x = -.5

[State 210, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 12
x = 8

[State 210, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 32
x = 0

[State 210, Auto turn: One Opponent]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 210, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 210, Turn]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (playerID(var(35)), alive)
triggerall = (playerID(var(36)), alive)
trigger1 = time = 0
trigger1 = command = "holdback"
trigger2 = facing = 1
trigger2 = (playerID(var(35)), pos x) < pos x
trigger2 = (playerID(var(36)), pos x) < pos x
trigger3 = facing = -1
trigger3 = (playerID(var(35)), pos x) > pos x
trigger3 = (playerID(var(36)), pos x) > pos x

;[State 210, Stop if moving away]
;type = VelSet
;trigger1 = Vel X < 0
;trigger1 = time = 0
;x = 0

[State 210, Sound1]
type = PlaySnd
trigger1 = animelem = 2
value = 2,1
channel = 0

[State 210, Sound2]
type = PlaySnd
trigger1 = animelem = 2
value = 3,1

[State 210, HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = Time = 0
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Medium
damage = Floor(ifelse(fvar(15) < 8, 24 * (1 - (3 * (fvar(15)/32))), 24 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -18, -56
hitsound = S3, 8
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 100
ground.velocity = -5
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -11.5
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -11.5
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 120 * (1 - (3 * (fvar(15)/32))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 60 * (1 - (3 * (fvar(15)/32))), 60 / 4)), 0

[State 210, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Medium
damage = Floor(ifelse((fvar(17)) < 99, (24*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (24*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -10, -25
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 150
ground.velocity = -5
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (60*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (60*ifelse(fvar(25)>=80,2,1)) / 4)), 0

[State 210, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 6 * (1 - (3 * ((fvar(17) - 1)/396))), 6 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 210, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(4) >= 2
trigger1 = (var(1) = 220) || (var(1) = [410,420]) || (var(1) = [800,801])
value = var(1)

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 210, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Heavy
[StateDef 220]
ctrl = 0
type = S
movetype = A
physics = S
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 220, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 220, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3922

[State 220, 1]
type = StateTypeSet
trigger1 = var(42) = 1
physics = N

[State 220, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 220, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 220

[State 220, 1]
type = VelAdd
trigger1 = var(42) = 1
trigger1 = var(41) >= 16
trigger1 = vel x > 0
x = -1.75

[State 220, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 16
x = 32

[State 220, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 40
x = 0

[State 220, 1]
type = PlayerPush
trigger1 = var(42) = 1
trigger1 = var(41) >= 16
trigger1 = var(41) < 40
value = 0

[State 220, Auto turn: One Opponent]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 220, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 220, Turn]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (playerID(var(35)), alive)
triggerall = (playerID(var(36)), alive)
trigger1 = time = 0
trigger1 = command = "holdback"
trigger2 = facing = 1
trigger2 = (playerID(var(35)), pos x) < pos x
trigger2 = (playerID(var(36)), pos x) < pos x
trigger3 = facing = -1
trigger3 = (playerID(var(35)), pos x) > pos x
trigger3 = (playerID(var(36)), pos x) > pos x

[State 220, PosSet]
type = PosAdd
triggerall = var(42) != 1
trigger1 = AnimElem = 1
x = -16

[State 220, PosSet]
type = PosAdd
triggerall = var(42) != 1
trigger1 = AnimElem = 2
x = 24

[State 220, PosSet]
type = PosAdd
triggerall = var(42) != 1
trigger1 = AnimElem = 3
x = 24

[State 220, PosSet]
type = PosAdd
triggerall = var(42) != 1
trigger1 = AnimElem = 4
x = 16

[State 220, Dust]
type = Explod
triggerall = var(42) = 1
triggerall = vel x > 0
trigger1 = var(41) % 4 = 0 ; AnimElem = 1, = 0 || AnimTime = 0; RF/Shunpo Gauge, P1
trigger1 = 1 || (var(19) := Floor(((random%9) / 25.0 + 1) * 300))
anim = 949
ID = 949
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
vel = -4, ((random%5 - 2) * .2)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = var(19) / 100.0, var(19) / 100.0
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 220, Sound1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,2
channel = 0

[State 220, Sound2]
type = PlaySnd
triggerall = var(42) != 1
trigger1 = animelem = 4
value = 3,2

[State 220, Sound2]
type = PlaySnd
triggerall = var(42) = 1
trigger1 = animelem = 17
value = 9,8

[State 220, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 4, >0
trigger1 = AnimElem = 5, <=0
anim = 320
ID = 220
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 220, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 5, >0
trigger1 = AnimElem = 6, <=0
anim = 321
ID = 220
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 220, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 6, >0
trigger1 = AnimElem = 7, <=0
anim = 322
ID = 220
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 220, Sword Trail,4]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 7, >0
trigger1 = AnimElem = 8, <=0
anim = 323
ID = 220
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 220, HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = Time = 0
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Heavy
damage = Floor(ifelse(fvar(15) < 8, 32 * (1 - (3 * (fvar(15)/32))), 32 / 4))
pausetime = 8,8
sparkno = S982
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 125
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 160 * (1 - (3 * (fvar(15)/32))), 160 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 80 * (1 - (3 * (fvar(15)/32))), 80 / 4)), 0

[State 220, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Heavy
damage = Floor(ifelse((fvar(17)) < 99, (32*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (32*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -10, -25
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 150
ground.velocity = -1, -2
air.velocity = -1, -2
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (80*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (80*ifelse(fvar(25)>=80,2,1)) / 4)), 0
fall = 1
fall.recover = 0

[State 974, Target State]
type = TargetState
triggerall = var(42) = 1
trigger1 = MoveHit = 1
trigger1 = numtarget > 0
value = 974

[State 220, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 8 * (1 - (3 * ((fvar(17) - 1)/396))), 8 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 220, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(4) >= 2
trigger1 = (var(1) = 420 && var(42) != 1) || (var(1) = [800,801])
value = var(1)

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 220, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Light
[StateDef 400]
ctrl = 0
type = C
movetype = A
physics = C
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 400, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 400, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3940

[State 400, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 400, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 400

[State 400, Auto turn: One Opponent]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 400, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 400, Turn]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (playerID(var(35)), alive)
triggerall = (playerID(var(36)), alive)
trigger1 = time = 0
trigger1 = command = "holdback"
trigger2 = facing = 1
trigger2 = (playerID(var(35)), pos x) < pos x
trigger2 = (playerID(var(36)), pos x) < pos x
trigger3 = facing = -1
trigger3 = (playerID(var(35)), pos x) > pos x
trigger3 = (playerID(var(36)), pos x) > pos x

;[State 400, Stop if moving away]
;type = VelSet
;trigger1 = Vel X < 0
;trigger1 = time = 0
;x = 0

[State 400, Sound1]
type = PlaySnd
trigger1 = animelem = 2
value = 2,3
channel = 0

[State 400, Sound2]
type = PlaySnd
trigger1 = animelem = 2
value = 3,0

[State 400, HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = Time = 0
attr = C, NA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(15) < 8, 16 * (1 - (3 * (fvar(15)/32))), 16 / 4))
pausetime = 8,8
sparkno = S981
guard.sparkno = S973
sparkxy = -5, -10
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 100
ground.velocity = -4
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 80 * (1 - (3 * (fvar(15)/32))), 80 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 40 * (1 - (3 * (fvar(15)/32))), 40 / 4)), 0

[State 400, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = C, HA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse((fvar(17)) < 99, (16*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (16*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S981
guard.sparkno = S973
sparkxy = -10, -25
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 155
ground.velocity = -4
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (40*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (40*ifelse(fvar(25)>=80,2,1)) / 4)), 0

[State 400, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 4 * (1 - (3 * ((fvar(17) - 1)/396))), 4 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 400, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(2) >= 2
trigger1 = (var(1) = [210,220]) || (var(1) = [410,420]) || (var(1) = [800,801])
trigger2 = var(42) != 1
trigger2 = (var(1) = 400) && prevstateno != 200
value = var(1)

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 400, Crouch State]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(42) = 1, 0, 11)
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Medium
[StateDef 410]
ctrl = 0
type = C
movetype = A
physics = C
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 410, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 410, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3941

[State 410, 1]
type = StateTypeSet
trigger1 = var(42) = 1
physics = N

[State 410, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 410, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 410

[State 410, 1]
type = VelAdd
trigger1 = var(42) = 1
trigger1 = var(41) >= 12
trigger1 = vel x > 0
x = -.5

[State 410, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 12
x = 8

[State 410, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 32
x = 0

[State 410, Auto turn: One Opponent]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 410, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 410, Turn]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (playerID(var(35)), alive)
triggerall = (playerID(var(36)), alive)
trigger1 = time = 0
trigger1 = command = "holdback"
trigger2 = facing = 1
trigger2 = (playerID(var(35)), pos x) < pos x
trigger2 = (playerID(var(36)), pos x) < pos x
trigger3 = facing = -1
trigger3 = (playerID(var(35)), pos x) > pos x
trigger3 = (playerID(var(36)), pos x) > pos x

;[State 410, Stop if moving away]
;type = VelSet
;trigger1 = Vel X < 0
;trigger1 = time = 0
;x = 0

[State 410, Sound1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,4
channel = 0

[State 410, Sound2]
type = PlaySnd
trigger1 = animelem = 3
value = 3,1

[State 410, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElemNo(0) = 4
anim = 510
ID = 410
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 410, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElemNo(0) = 5
anim = 511
ID = 410
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 410, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElemNo(0) = 6
anim = 512
ID = 410
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 410, HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = Time = 0
attr = C, NA
hitflag = MAF
guardflag = LA
animtype = Medium
damage = Floor(ifelse(fvar(15) < 8, 24 * (1 - (3 * (fvar(15)/32))), 24 / 4))
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -15, -50
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 125
ground.velocity = -5
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -11.5
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -11.5
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 120 * (1 - (3 * (fvar(15)/32))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 60 * (1 - (3 * (fvar(15)/32))), 60 / 4)), 0

[State 410, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = S, HA
hitflag = MAF
guardflag = LA
animtype = Medium
damage = Floor(ifelse((fvar(17)) < 99, (24*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (24*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S981
guard.sparkno = S973
sparkxy = -10, -25
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 155
ground.velocity = -5
air.velocity = 0,-4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (60*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (60*ifelse(fvar(25)>=80,2,1)) / 4)), 0

[State 410, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 6 * (1 - (3 * ((fvar(17) - 1)/396))), 6 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 410, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(5) >= 2
trigger1 = (var(1) = 220) || (var(1) = 420) || (var(1) = [800,801])
value = var(1)

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 410, Crouch State]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(42) = 1, 0, 11)
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Heavy
[StateDef 420]
ctrl = 0
type = C
movetype = A
physics = C
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 420, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 420, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3942

[State 420, 1]
type = StateTypeSet
trigger1 = var(42) = 1
physics = N

[State 420, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 420, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 420

[State 420, 1]
type = VelAdd
trigger1 = var(42) = 1
trigger1 = var(41) >= 16
trigger1 = vel x > 0
x = -1.75

[State 420, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 16
x = 32

[State 420, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 40
x = 0

[State 420, 1]
type = PlayerPush
trigger1 = var(42) = 1
trigger1 = var(41) >= 16
trigger1 = var(41) < 40
value = 0

[State 420, Auto turn: One Opponent]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 420, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 420, Turn]
type = Turn
triggerall = time <= 1
triggerall = prevstateno != [200,799]
triggerall = numenemy = 2
triggerall = (playerID(var(35)), alive)
triggerall = (playerID(var(36)), alive)
trigger1 = time = 0
trigger1 = command = "holdback"
trigger2 = facing = 1
trigger2 = (playerID(var(35)), pos x) < pos x
trigger2 = (playerID(var(36)), pos x) < pos x
trigger3 = facing = -1
trigger3 = (playerID(var(35)), pos x) > pos x
trigger3 = (playerID(var(36)), pos x) > pos x

[State 420, Dust]
type = Explod
triggerall = var(42) = 1
triggerall = vel x > 0
trigger1 = var(41) % 4 = 0 ; AnimElem = 1, = 0 || AnimTime = 0; RF/Shunpo Gauge, P1
trigger1 = 1 || (var(19) := Floor(((random%9) / 25.0 + 1) * 300))
anim = 949
ID = 949
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
vel = -4, ((random%5 - 2) * .2)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = var(19) / 100.0, var(19) / 100.0
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 420, Sound1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,5
channel = 0

[State 420, Sound2]
type = PlaySnd
triggerall = var(42) != 1
trigger1 = animelem = 5
value = 3,2

[State 220, Sound2]
type = PlaySnd
triggerall = var(42) = 1
trigger1 = animelem = 17
value = 9,8

[State 420, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 4, >=0
trigger1 = AnimElem = 5, <0
anim = 520
ID = 420
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 420, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 5, >=0
trigger1 = AnimElem = 6, <0
anim = 521
ID = 420
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 420, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 6, >=0
trigger1 = AnimElem = 7, <0
anim = 522
ID = 420
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 420, Sword Trail,4]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 7, >=0
trigger1 = AnimElem = 8, <0
anim = 523
ID = 420
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 420, Sword Trail,5]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
anim = 524
ID = 420
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 420, HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = Time = 0
attr = C, NA
hitflag = MAF
guardflag = MA
animtype = Heavy
damage = Floor(ifelse(fvar(15) < 8, 32 * (1 - (3 * (fvar(15)/32))), 32 / 4))
pausetime = 8,8
sparkno = S977
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 24
ground.hittime  = 24
guard.dist = 120
ground.velocity = -0, -7
yaccel = .34375
air.velocity = 0,-7
air.hittime = 24
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 160 * (1 - (3 * (fvar(15)/32))), 160 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 80 * (1 - (3 * (fvar(15)/32))), 80 / 4)), 0

[State 420, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = S, HA
hitflag = MAF
guardflag = LA
animtype = Heavy
damage = Floor(ifelse((fvar(17)) < 99, (32*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (32*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -10, -25
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 150
ground.velocity = -1, -2
air.velocity = -1, -2
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (80*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (80*ifelse(fvar(25)>=80,2,1)) / 4)), 0
fall = 1
fall.recover = 0

[State 974, Target State]
type = TargetState
triggerall = var(42) = 1
trigger1 = MoveHit = 1
trigger1 = numtarget > 0
value = 974

[State 420, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 8 * (1 - (3 * ((fvar(17) - 1)/396))), 8 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 420, Set Target State]
type = TargetState
triggerall = var(42) != 1
trigger1 = Movehit = 1
value = 980

[State 420, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = var(42) != 1
triggerall = AnimElemTime(6) >= 2
trigger1 = var(1) = [800,801]
value = var(1)

[State 420, Jump Cancel]
type = ChangeState
triggerall = !var(0)
triggerall = var(42) != 1
trigger1 = MoveHit
trigger1 = command = "holdup"
value = 40
ctrl = 1

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 420, Crouch State]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(42) = 1, 0, 11)
ctrl = 1

;---------------------------------------------------------------------------
; Aerial Light
[StateDef 600]
anim = 600
ctrl = 0
type = A
movetype = A
physics = A
juggle = 0
sprpriority = 2
hitdefpersist = 1

[State 600, Reset MoveHit] ; there isn't one of these in 620 and there used to be two here???
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 600, Turn]
type = Turn
triggerall = time <= 1
triggerall = (prevstateno = [800,801])
triggerall = numtarget
trigger1 = facing != (enemynear, facing)
trigger1 = ifelse((enemynear, facing = 1), pos x < (enemynear, pos x), 1)
trigger1 = ifelse((enemynear, facing = -1), pos x > (enemynear, pos x), 1)
trigger2 = facing = (enemynear, facing)
trigger2 = P2BodyDist x < 0

[State 600, Sound1]
type = PlaySnd
trigger1 = animelem = 3, = 3
value = 2,6
channel = 0

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

[State 600, HitDef]
type = HitDef
trigger1 = Time = 0
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Light
damage = Floor(ifelse(fvar(15) < 8, 16 * (1 - (3 * (fvar(15)/32))), 16 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -20, -55
hitsound = S3,7
guardsound = S10,8
ground.type = High
air.type = Low
ground.slidetime = 24
ground.hittime  = 24
guard.dist = 85
ground.velocity = -4
air.velocity = 0,-4
air.hittime = 24
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 80 * (1 - (3 * (fvar(15)/32))), 80 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 40 * (1 - (3 * (fvar(15)/32))), 40 / 4)), 0
;p2stateno = 5020

[State 600, Target State]
type = TargetState
trigger1 = MoveHit = 1
trigger1 = numtarget > 0
value = 5021
ignorehitpause = 1

[State 600, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(3) >= 2
trigger1 = (var(1) = [600,620]) || (var(1) = [800,801])
value = var(1) 

[State 600, Double Jump Cancel]
type = ChangeState
triggerall = !var(0)
trigger1 = MoveContact
trigger1 = command = "fakedup"
trigger1 = var(48) > 0
value = 45
ctrl = 1

[State 600, Air State]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Aerial Medium
[StateDef 610]
anim = 610
ctrl = 0
type = A
movetype = A
physics = A
juggle = 0
sprpriority = 2

[State 610, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 610, Turn]
type = Turn
triggerall = time <= 1
triggerall = (prevstateno = [800,801])
triggerall = numtarget
trigger1 = facing != (enemynear, facing)
trigger1 = ifelse((enemynear, facing = 1), pos x < (enemynear, pos x), 1)
trigger1 = ifelse((enemynear, facing = -1), pos x > (enemynear, pos x), 1)
trigger2 = facing = (enemynear, facing)
trigger2 = P2BodyDist x < 0

[State 610, Sound1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,7
channel = 0

[State 610, Sound2]
type = PlaySnd
trigger1 = animelem = 3
value = 3,1

[State 610, HitDef]
type = HitDef
trigger1 = Time = 0
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Medium
damage = Floor(ifelse(fvar(15) < 8, 24 * (1 - (3 * (fvar(15)/32))), 24 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -30, -55
hitsound = S3, 8
guardsound = S10,8
ground.type = High
air.type = Low
ground.slidetime = 24
ground.hittime  = 24
guard.dist = 110
ground.velocity = -5
air.velocity = 0,-4
air.hittime = 24
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 120 * (1 - (3 * (fvar(15)/32))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 60 * (1 - (3 * (fvar(15)/32))), 60 / 4)), 0
;p2stateno = 5020

[State 610, Target State]
type = TargetState
trigger1 = MoveHit = 1
trigger1 = numtarget > 0
value = 5021
ignorehitpause = 1

[State 610, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = AnimElemTime(3) >= 2
trigger1 = (var(1) = 620) || (var(1) = [800,801])
value = var(1) 

[State 610, Double Jump Cancel]
type = ChangeState
triggerall = !var(0)
trigger1 = MoveContact
trigger1 = command = "fakedup"
trigger1 = var(48) > 0
value = 45
ctrl = 1

[State 610, Air State]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Aerial Heavy
[StateDef 620]
ctrl = 0
type = A
movetype = A
physics = N
juggle = 0
sprpriority = 2

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 620, Bankai Anim]
type = ChangeAnim
trigger1 = var(41) = 0
trigger1 = var(42) = 1
value = 3960

[State 620, Bankai Vel Reset]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 0
x = 0
y = 0

[State 620, Normal Anim]
type = ChangeAnim
trigger1 = var(42) != 1
trigger1 = time = 0
value = 620

[State 620, 1]
type = StateTypeSet
trigger1 = var(42) = 1
physics = N

[State 620, 1]
type = VelAdd
trigger1 = var(42) = 1
trigger1 = var(41) >= 11
trigger1 = pos y <= 0
y = .3125

[State 620, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = var(41) = 11
y = 12

[State 620, Land Anim]
type = ChangeAnim
trigger1 = var(41) >= 8
trigger1 = pos y >= 0
trigger1 = anim = 3960
value = 3965

[State 620, EnvShake]
type = EnvShake
trigger1 = anim = 3965
trigger1 = AnimElem = 1
time = 10
freq = 60
ampl = -4
phase = 90

[State 925, Dust 933]
type = Explod
trigger1 = anim = 3965
trigger1 = AnimElem = 1
anim = 949
ID = 949
pos = -20 + ((random % 21) - 10) * 2, 0
postype = p1
facing = 1
bindtime = 1
vel = ((random % 11) - 5) * .2, -((random % 11) + 10) * .2
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 4, 4
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 925, Dust 933]
type = Explod
trigger1 = anim = 3965
trigger1 = AnimElem = 1
anim = 949
ID = 949
pos = -20 + ((random % 21) - 10) * 2, 0
postype = p1
facing = 1
bindtime = 1
vel = ((random % 11) - 5) * .2, -((random % 11) + 10) * .2
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 4, 4
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 620, Land 1]
type = VelSet
trigger1 = pos y >= 0
x = 0
y = 0

[State 620, Land 2]
type = StateTypeSet
triggerall = pos y >= 0
trigger1 = var(42) = 1
trigger1 = var(41) >= 8
trigger2 = var(42) != 1
statetype = S
physics = S
movetype = A

[State 620, Land 3]
type = PosSet
trigger1 = pos y >= 0
y = 0

[State 620, Gravity]
type = VelAdd
trigger1 = var(42) != 1; pos y < 0
y = Const(movement.yaccel)

[State 620, Land State]
type = ChangeState
triggerall = var(42) != 1
triggerall = statetype = S
trigger1 = var(42) = 1
trigger1 = var(41) >= 8
trigger2 = var(42) != 1
value = ifelse(!var(0) && (var(1) = [100,105]), var(1), 52) + (var(1):=0)

[State 620, Turn]
type = Turn
triggerall = time <= 1
triggerall = (prevstateno = [800,801])
triggerall = numtarget
trigger1 = facing != (enemynear, facing)
trigger1 = ifelse((enemynear, facing = 1), pos x < (enemynear, pos x), 1)
trigger1 = ifelse((enemynear, facing = -1), pos x > (enemynear, pos x), 1)
trigger2 = facing = (enemynear, facing)
trigger2 = P2BodyDist x < 0

[State 620, Sound1]
type = PlaySnd
trigger1 = var(42) != 1
trigger1 = animelem = 2, = 2
trigger2 = var(42) = 1
trigger2 = animelem = 10, = 0
trigger2 = anim != 3965
value = 2,8
channel = 0

[State 620, Sound2] ; NOT THE RIGHT SOUND
type = PlaySnd
trigger1 = var(42) != 1
trigger1 = animelem = 3, = 1
trigger2 = var(42) = 1
trigger2 = animelem = 10, = 0
trigger2 = anim != 3965
value = 3,2

[State 620, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElemNo(0) = 3
anim = 720
ID = 620
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 620, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElemNo(0) = 4
anim = 721
ID = 620
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 620, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElemNo(0) = 5
anim = 722
ID = 620
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 620, HitDef]
type = HitDef
triggerall = var(42) != 1
trigger1 = time = 0
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Heavy
damage = Floor(ifelse(fvar(15) < 8, 32 * (1 - (3 * (fvar(15)/32))), 32 / 4))
pausetime = 8,8
sparkno = S982
guard.sparkno = S973
sparkxy = -25, -40
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
air.type = Low
ground.slidetime = 24
ground.hittime  = 24
guard.dist = 120
ground.velocity = -6
air.velocity = -0,0
air.hittime = 24
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(15) < 8, 160 * (1 - (3 * (fvar(15)/32))), 160 / 4)), 0
givepower = Floor(ifelse(fvar(15) < 8, 80 * (1 - (3 * (fvar(15)/32))), 80 / 4)), 0
fall.recover = 0
;p2stateno = 930

[State 620, Bankai HitDef]
type = HitDef
triggerall = var(42) = 1
trigger1 = var(41) = 0
attr = A, HA
hitflag = MAF
guardflag = HA
animtype = Heavy
damage = Floor(ifelse((fvar(17)) < 99, (32*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (32*ifelse(fvar(25)>=80,2,1)) / 4)), 1
pausetime = 8,8
sparkno = S976
guard.sparkno = S973
sparkxy = -10, -20
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 24
ground.hittime  = 24
guard.dist = 60
ground.velocity = -6
air.velocity = -0,0
air.hittime = 24
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0,0
givepower = Floor(ifelse((fvar(17)) < 99, (80*ifelse(fvar(25)>=80,2,1)) * (1 - (3 * ((fvar(17))/396))), (80*ifelse(fvar(25)>=80,2,1)) / 4)), 0
fall.recover = 0
;p2stateno = 930

[State 620, Target State]
type = TargetState
trigger1 = MoveHit = 1
trigger1 = numtarget > 0
value = 930
ignorehitpause = 1

[State 620, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 8 * (1 - (3 * ((fvar(17) - 1)/396))), 8 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 620, Make Land Dust Effect1]
type = Helper
triggerall = numhelper(936) = 0
triggerall = MoveHit = 1
trigger1 = numtarget > 0
name = "Spiked Dust Clouds"
ID = 936
pos = 0,0
postype = back
facing = 1
stateno = 936
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 620, Make Land Dust Effect2]
type = Helper
triggerall = numhelper(937) = 0
triggerall = MoveHit = 1
triggerall = numenemy = 2
triggerall = var(36) != 0
trigger1 = numtarget > 0
name = "Spiked Dust Clouds"
ID = 937
pos = 0,0
postype = back
facing = 1
stateno = 937
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 620, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = var(42) != 1
trigger1 = AnimElemTime(3) >= 2
trigger1 = var(1) = [800,801]
value = var(1)

[State 620, Double Jump Cancel]
type = ChangeState
triggerall = !var(0)
triggerall = var(42) != 1
triggerall = AnimElemTime(3) >= 2
trigger1 = MoveContact
trigger1 = ((command = "fakedup") && (var(48) > 0)) || (var(1) = [800,801])
value = ifelse(((command = "fakedup") && (var(48) > 0)), 45, var(1))
ctrl = 1

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
triggerall = var(42) = 1
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 620, Air State]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(42) = 1, 0, 50)
ctrl = 1

;---------------------------------------------------------------------------
; Specials
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Light Ame!
[StateDef 1000]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1001

[State 1000, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1000, B to A Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1000
trigger1 = prevstateno = [1100,1125]
trigger1 = anim = 1001
value = 1002

[State 1000, C to A Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1000
trigger1 = prevstateno = [1200,1225]
trigger1 = anim = 1001
value = 1003

[State 1000, Anim]
type = ChangeAnim
trigger1 = anim != 1000
trigger1 = AnimTime = 0
value = 1000

[State 1000, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1000, Special B Transfer]
type = varset
trigger1 = (fvar(8) >= 61)
fvar(27) = 1100

[State 1000, Special C Transfer]
type = varset
trigger1 = (command = "DU_y") || (command = "DU_x") || (command = "DU_a")
fvar(27) = 1200

[State 1000, Special D Transfer]
type = varset
triggerall = Command != "backcheck"
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
trigger1 = time >= 8
fvar(27) = 1300

[State 1000, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 1, >= 0
trigger1 = AnimElem = 3, < 0
trigger1 = anim = 1000
x = 4

[State 1000, Sound1]
type = PlaySnd
trigger1 = AnimElem = 1
trigger1 = anim != 1000
value = 4,0
channel = 0

[State 1000, Sound2]
type = PlaySnd
trigger1 = anim = 1000
trigger1 = AnimElem = 3
value = 5,3

[State 1000, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 2, >0
trigger1 = AnimElem = 3, <=0
trigger1 = anim = 1000
anim = 1025
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1000, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 3, >0
trigger1 = AnimElem = 4, <=0
trigger1 = anim = 1000
anim = 1026
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1000, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 4, >0
trigger1 = AnimElem = 5, <=0
trigger1 = anim = 1000
anim = 1027
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1000, Sword Trail,4]
type = Explod
trigger1 = AnimElem = 5, >0
trigger1 = AnimElem = 6, <=0
trigger1 = anim = 1000
anim = 1028
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1000, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 24 * (1 - (3 * (fvar(16)/200))), 24 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, 9
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 140
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 120 * (1 - (3 * (fvar(16)/200))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0

[State 1000, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1000, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = anim = 1000
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Light Ame!
[Statedef 1005]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1000
juggle = 0

[State 1005, Turn]
type = Turn
trigger1 = time = 0

[State 1005, 2]
type = ChangeState
trigger1 = 1
value = 1000

;---------------------------------------------------------------------------
; Medium Ame!
[StateDef 1010]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1010

[State 1010, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1010, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1010, Special B Transfer]
type = varset
trigger1 = (fvar(8) >= 61)
fvar(27) = 1100

[State 1010, Special C Transfer]
type = varset
trigger1 = (command = "DU_y") || (command = "DU_x") || (command = "DU_a")
fvar(27) = 1200

[State 1010, Special D Transfer]
type = varset
triggerall = Command != "backcheck"
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
trigger1 = time >= 8
fvar(27) = 1300

[State 1010, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 4, < 0
x = 4

[State 1010, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,0
channel = 0

[State 1010, Sound2]
type = PlaySnd
trigger1 = animelem = 4
value = 5,3

[State 1010, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 3, >0
trigger1 = AnimElem = 4, <=0
anim = 1025
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1010, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 4, >0
trigger1 = AnimElem = 5, <=0
anim = 1026
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1010, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 5, >0
trigger1 = AnimElem = 6, <=0
anim = 1027
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1010, Sword Trail,4]
type = Explod
trigger1 = AnimElem = 6, >0
trigger1 = AnimElem = 7, <=0
anim = 1028
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1010, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 24 * (1 - (3 * (fvar(16)/200))), 24 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, 9
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 140
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 120 * (1 - (3 * (fvar(16)/200))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0

[State 1010, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1010, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Medium Ame!
[Statedef 1015]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1010
juggle = 0

[State 1015, Turn]
type = Turn
trigger1 = time = 0

[State 1015, 2]
type = ChangeState
trigger1 = 1
value = 1010

;---------------------------------------------------------------------------
; RF Ame!
[StateDef 1020]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1020

[State 1020, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1020, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1020, Special B Transfer]
type = varset
trigger1 = (fvar(8) >= 61)
fvar(27) = 1100

[State 1020, Special C Transfer]
type = varset
trigger1 = (command = "DU_y") || (command = "DU_x") || (command = "DU_a")
fvar(27) = 1200

[State 1020, Special D Transfer]
type = varset
triggerall = Command != "backcheck"
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
trigger1 = time >= 8
fvar(27) = 1300

[State 1020, RF Stock1]
type = VarSet
trigger1 = time = 0
var(10) = 0

[State 1020, RF Stock2]
type = VarSet
trigger1 = time = 0
var(11) = var(11) - 1

[State 1020, Blink Yellow]
type = Null;PalFX
trigger1 = Time%2
time = 1
add = 128,128,0;64

[State 1020, Blink Yellow]
type = PalFX
trigger1 = Time%2
time = 1
add = 16, 16, -32
mul = 1024,1024,256
ignorehitpause = 1

[State 1020, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 4, < 0
x = 4

[State 1020, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,0
channel = 0

[State 1020, Sound2]
type = PlaySnd
trigger1 = animelem = 4
value = 5,3

[State 1020, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 3, >0
trigger1 = AnimElem = 4, <=0
anim = 1025
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1020, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 4, >0
trigger1 = AnimElem = 5, <=0
anim = 1026
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1020, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 5, >0
trigger1 = AnimElem = 6, <=0
anim = 1027
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1020, Sword Trail,4]
type = Explod
trigger1 = AnimElem = 6, >0
trigger1 = AnimElem = 7, <=0
anim = 1028
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1020, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 24 * (1 - (3 * (fvar(16)/200))), 24 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, 9
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 140
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0

[State 1020, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1020, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse RF Ame!
[Statedef 1025]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1020
juggle = 0

[State 1025, Turn]
type = Turn
trigger1 = time = 0

[State 1025, 2]
type = ChangeState
trigger1 = 1
value = 1020

;---------------------------------------------------------------------------
; Light Socchijane!
[StateDef 1100]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1102

[State 1100, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1100, A to B Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1100
trigger1 = prevstateno = [1000,1025]
trigger1 = anim = 1102
value = 1101

[State 1100, C to B Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1100
trigger1 = prevstateno = [1200,1225]
trigger1 = anim = 1102
value = 1103

[State 1100, Anim]
type = ChangeAnim
trigger1 = anim != 1100
trigger1 = AnimTime = 0
value = 1100

[State 1100, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1100, Special A Transfer]
type = varset
trigger1 = (command = "QCF_y") || (command = "QCF_x") || (command = "QCF_a")
fvar(27) = 1000

[State 1100, Special C Transfer]
type = varset
trigger1 = (command = "DU_y") || (command = "DU_x") || (command = "DU_a")
fvar(27) = 1200

[State 1100, Special D Transfer]
type = varset
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
fvar(27) = 1300

[State 1100, Sound1]
type = PlaySnd
trigger1 = AnimElem = 1
trigger1 = anim != 1100
value = 4,1
channel = 0

[State 1100, Sound2]
type = PlaySnd
trigger1 = anim = 1100
trigger1 = animelem = 1
value = 5,0

[State 1100, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 4, >0
trigger1 = AnimElem = 5, <=0
trigger1 = anim = 1100
anim = 1125
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1100, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 5, >0
trigger1 = AnimElem = 6, <=0
trigger1 = anim = 1100
anim = 1126
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1100, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 6, >0
trigger1 = AnimElem = 7, <=0
trigger1 = anim = 1100
anim = 1127
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1100, HitDef]
type = HitDef
trigger1 = Time = 0
trigger2 = AnimElem = 4, = 2
attr = C, SA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 4 * (1 - (3 * (fvar(16)/200))), 4 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 10 * (1 - (3 * (fvar(16)/200))), 10 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 5 * (1 - (3 * (fvar(16)/200))), 5 / 4)), 0

[State 1100, HitDef]
type = HitDef
trigger1 = AnimElem = 5
attr = C, SA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 16 * (1 - (3 * (fvar(16)/200))), 16 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 80 * (1 - (3 * (fvar(16)/200))), 80 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 40 * (1 - (3 * (fvar(16)/200))), 40 / 4)), 0

[State 1100, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1100, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Light Socchijane!
[Statedef 1105]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1100
juggle = 0

[State 1105, Turn]
type = Turn
trigger1 = time = 0

[State 1105, 2]
type = ChangeState
trigger1 = 1
value = 1100

;---------------------------------------------------------------------------
; Medium Socchijane!
[StateDef 1110]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1110

[State 1110, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1110, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1110, Special A Transfer]
type = varset
trigger1 = (command = "QCF_y") || (command = "QCF_x") || (command = "QCF_a")
fvar(27) = 1000

[State 1110, Special C Transfer]
type = varset
trigger1 = (command = "DU_y") || (command = "DU_x") || (command = "DU_a")
fvar(27) = 1200

[State 1110, Special D Transfer]
type = varset
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
fvar(27) = 1300

[State 1110, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,1
channel = 0

[State 1110, Sound2]
type = PlaySnd
trigger1 = animelem = 4
value = 5,0

[State 1110, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 7, >0
trigger1 = AnimElem = 8, <=0
anim = 1125
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1110, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 8, >0
trigger1 = AnimElem = 9, <=0
anim = 1126
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1110, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 9, >0
trigger1 = AnimElem = 10, <=0
anim = 1127
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1110, HitDef]
type = HitDef
trigger1 = Time = 0
trigger2 = AnimElem = 7, = 2
attr = C, SA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 4 * (1 - (3 * (fvar(16)/200))), 4 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 10 * (1 - (3 * (fvar(16)/200))), 10 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 5 * (1 - (3 * (fvar(16)/200))), 5 / 4)), 0

[State 1110, HitDef]
type = HitDef
trigger1 = AnimElem = 8
attr = C, SA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 16 * (1 - (3 * (fvar(16)/200))), 16 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 80 * (1 - (3 * (fvar(16)/200))), 80 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 40 * (1 - (3 * (fvar(16)/200))), 40 / 4)), 0

[State 1110, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1110, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Medium Socchijane!
[Statedef 1115]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1110
juggle = 0

[State 1115, Turn]
type = Turn
trigger1 = time = 0

[State 1115, 2]
type = ChangeState
trigger1 = 1
value = 1110

;---------------------------------------------------------------------------
; RF Socchijane!
[StateDef 1120]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1120

[State 1120, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1120, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1120, Special A Transfer]
type = varset
trigger1 = (command = "QCF_y") || (command = "QCF_x") || (command = "QCF_a")
fvar(27) = 1000

[State 1120, Special C Transfer]
type = varset
trigger1 = (command = "DU_y") || (command = "DU_x") || (command = "DU_a")
fvar(27) = 1200

[State 1120, Special D Transfer]
type = varset
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
fvar(27) = 1300

[State 1120, RF Stock1]
type = VarSet
trigger1 = time = 0
var(10) = 0

[State 1120, RF Stock2]
type = VarSet
trigger1 = time = 0
var(11) = var(11) - 1

[State 1120, Blink Yellow]
type = Null;PalFX
trigger1 = Time%2
time = 1
add = 128,128,0;64

[State 1120, Blink Yellow]
type = PalFX
trigger1 = Time%2
time = 1
add = 16, 16, -32
mul = 1024,1024,256
ignorehitpause = 1

[State 1120, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,1
channel = 0

[State 1120, Sound2]
type = PlaySnd
trigger1 = animelem = 4
value = 5,0

[State 1120, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 7, >0
trigger1 = AnimElem = 8, <=0
anim = 1125
ID = 1100
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1120, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 8, >0
trigger1 = AnimElem = 9, <=0
anim = 1126
ID = 1100
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1120, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 9, >0
trigger1 = AnimElem = 10, <=0
anim = 1127
ID = 1100
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 1120, HitDef]
type = HitDef
trigger1 = Time = 0
trigger2 = AnimElem = 7, = 2
attr = C, SA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 4 * (1 - (3 * (fvar(16)/200))), 4 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(16) < 50, 5 * (1 - (3 * (fvar(16)/200))), 5 / 4)), 0

[State 1120, HitDef]
type = HitDef
trigger1 = AnimElem = 8
attr = C, SA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 16 * (1 - (3 * (fvar(16)/200))), 16 / 4))
pausetime = 8,8
sparkno = S980
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(16) < 50, 40 * (1 - (3 * (fvar(16)/200))), 40 / 4)), 0

[State 1120, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1120, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse RF Socchijane!
[Statedef 1125]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1120
juggle = 0

[State 1125, Turn]
type = Turn
trigger1 = time = 0

[State 1125, 2]
type = ChangeState
trigger1 = 1
value = 1120

;---------------------------------------------------------------------------
; Light Mikireruka!
[StateDef 1200]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1203

[State 1200, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1200, A to C Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1200
trigger1 = prevstateno = [1000,1025]
trigger1 = anim = 1203
value = 1201

[State 1200, B to C Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1200
trigger1 = prevstateno = [1100,1125]
trigger1 = anim = 1203
value = 1202

[State 1200, Anim]
type = ChangeAnim
trigger1 = anim != 1200
trigger1 = AnimTime = 0
value = 1200

[State 1200, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1200, Special B Transfer]
type = varset
trigger1 = (fvar(8) >= 61)
fvar(27) = 1100

[State 1200, Special A Transfer]
type = varset
trigger1 = (command = "QCF_y") || (command = "QCF_x") || (command = "QCF_a")
fvar(27) = 1000

[State 1200, Special D Transfer]
type = varset
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
fvar(27) = 1300

[State 1210, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 4, >= 1
trigger1 = AnimElem = 9, < 1
trigger1 = anim = 1200
x = 4

[State 1200, Sound1]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = anim != 1200
value = 4,2
channel = 0

[State 1200, Sound2]
type = PlaySnd
trigger1 = animelem = 3
trigger1 = anim = 1200
value = 5,4

[State 1200, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 6, >=0
trigger1 = AnimElem = 7, <0
trigger1 = anim = 1200
anim = 1225
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1200, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 7, >=0
trigger1 = AnimElem = 8, <0
trigger1 = anim = 1200
anim = 1226
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1200, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
trigger1 = anim = 1200
anim = 1227
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1200, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = HA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 24 * (1 - (3 * (fvar(16)/200))), 24 / 4))
pausetime = 8,8
sparkno = S982
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 155
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 120 * (1 - (3 * (fvar(16)/200))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0

[State 1200, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Light Mikireruka!
[Statedef 1205]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1201
juggle = 0

[State 1205, Turn]
type = Turn
trigger1 = time = 0

[State 1205, 2]
type = ChangeState
trigger1 = 1
value = 1200

;---------------------------------------------------------------------------
; Medium Mikireruka!
[StateDef 1210]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1210

[State 1210, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1210, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1210, Special B Transfer]
type = varset
trigger1 = (fvar(8) >= 61)
fvar(27) = 1100

[State 1210, Special A Transfer]
type = varset
trigger1 = (command = "QCF_y") || (command = "QCF_x") || (command = "QCF_a")
fvar(27) = 1000

[State 1210, Special D Transfer]
type = varset
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
fvar(27) = 1300

[State 1210, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 6, >= 1
trigger1 = AnimElem = 11, < 1
x = 4

[State 1210, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,2
channel = 0

[State 1210, Sound2]
type = PlaySnd
trigger1 = animelem = 5
value = 5,4

[State 1210, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
anim = 1225
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1210, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 9, >=0
trigger1 = AnimElem = 10, <0
anim = 1226
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1210, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 10, >=0
trigger1 = AnimElem = 11, <0
anim = 1227
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1210, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = HA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 24 * (1 - (3 * (fvar(16)/200))), 24 / 4))
pausetime = 8,8
sparkno = S982
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 155
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 120 * (1 - (3 * (fvar(16)/200))), 120 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0

[State 1210, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Medium Mikireruka!
[Statedef 1215]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1210
juggle = 0

[State 1215, Turn]
type = Turn
trigger1 = time = 0

[State 1215, 2]
type = ChangeState
trigger1 = 1
value = 1210

;---------------------------------------------------------------------------
; RF Mikireruka!
[StateDef 1220]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1220

[State 1220, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1220, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1220, Special B Transfer]
type = varset
trigger1 = (fvar(8) >= 61)
fvar(27) = 1100

[State 1220, Special A Transfer]
type = varset
trigger1 = (command = "QCF_y") || (command = "QCF_x") || (command = "QCF_a")
fvar(27) = 1000

[State 1220, Special D Transfer]
type = varset
trigger1 = (command = "DP_y") || (command = "DP_x") || (command = "DP_a")
fvar(27) = 1300

[State 1220, RF Stock1]
type = VarSet
trigger1 = time = 0
var(10) = 0

[State 1220, RF Stock2]
type = VarSet
trigger1 = time = 0
var(11) = var(11) - 1

[State 1220, Blink Yellow]
type = Null;PalFX
trigger1 = Time%2
time = 1
add = 128,128,0;64

[State 1220, Blink Yellow]
type = PalFX
trigger1 = Time%2
time = 1
add = 16, 16, -32
mul = 1024,1024,256
ignorehitpause = 1

[State 1220, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 6, >= 1
trigger1 = AnimElem = 11, < 1
x = 4

[State 1210, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,2
channel = 0

[State 1220, Sound2]
type = PlaySnd
trigger1 = animelem = 5
value = 5,4

[State 1220, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
anim = 1225
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1220, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 9, >=0
trigger1 = AnimElem = 10, <0
anim = 1226
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1220, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 10, >=0
trigger1 = AnimElem = 11, <0
anim = 1227
ID = 1200
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1220, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = HA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 24 * (1 - (3 * (fvar(16)/200))), 24 / 4))
pausetime = 8,8
sparkno = S982
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 155
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0

[State 1220, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse RF Mikireruka!
[Statedef 1225]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1220
juggle = 0

[State 1225, Turn]
type = Turn
trigger1 = time = 0

[State 1225, 2]
type = ChangeState
trigger1 = 1
value = 1220

;---------------------------------------------------------------------------
; Light Shineyo!
[StateDef 1300]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1304

[State 1300, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1300, A to D Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1300
trigger1 = prevstateno = [1000,1025]
trigger1 = anim = 1304
value = 1301

[State 1300, B to D Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1300
trigger1 = prevstateno = [1100,1125]
trigger1 = anim = 1304
value = 1302

[State 1300, C to D Anim]
type = ChangeAnim
trigger1 = fvar(27) = 1300
trigger1 = prevstateno = [1200,1225]
trigger1 = anim = 1304
value = 1303

[State 1300, Anim]
type = ChangeAnim
trigger1 = anim != 1300
trigger1 = AnimTime = 0
value = 1300

[State 1300, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1300, Slide Forward]
type = PosAdd
triggerall = anim = 1300
trigger1 = AnimElem = 1, >= 0
trigger1 = AnimElem = 2, < 0
trigger2 = AnimElem = 7, >= 0
trigger2 = AnimElem = 9, < 0
x = 6

[State 1300, Sound1]
type = PlaySnd
trigger1 = AnimElem = 1
trigger1 = anim != 1300
value = 4,3
channel = 0

[State 1300, Sound2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger1 = anim = 1300
value = 5,2

[State 1300, Sound3]
type = PlaySnd
trigger1 = AnimElem = 8
trigger1 = anim = 1300
value = 5,1

[State 1300, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 2, >=0
trigger1 = AnimElem = 3, <0
trigger1 = anim = 1300
anim = 1325
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1300, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 3, >=0
trigger1 = AnimElem = 4, <0
trigger1 = anim = 1300
anim = 1326
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1300, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 4, >=0
trigger1 = AnimElem = 5, <0
trigger1 = anim = 1300
anim = 1327
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1300, Sword Trail,4]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
trigger1 = anim = 1300
anim = 1328
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1300, Sword Trail,5]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 9, >=0
trigger1 = AnimElem = 10, <0
trigger1 = anim = 1300
anim = 1329
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1300, Sword Trail,6]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 10, >=0
trigger1 = AnimElem = 11, <0
trigger1 = anim = 1300
anim = 1330
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1300, HitDef1]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 12 * (1 - (3 * (fvar(16)/200))), 12 / 4))
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 135
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 30 * (1 - (3 * (fvar(16)/200))), 30 / 4)), 0

[State 1300, HitDef2]
type = HitDef
trigger1 = AnimElem = 8
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 12 * (1 - (3 * (fvar(16)/200))), 12 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, 9
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 135
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 30 * (1 - (3 * (fvar(16)/200))), 30 / 4)), 0

[State 1300, Throw]
type = TargetState
trigger1 = AnimElem = 8, >= 0
trigger1 = MoveHit = 1
value = 921
ignorehitpause = 1

[State 1300, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1300, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Light Shineyo!
[Statedef 1305]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1300
juggle = 0

[State 1305, Turn]
type = Turn
trigger1 = time = 0

[State 1305, 2]
type = ChangeState
trigger1 = 1
value = 1300

;---------------------------------------------------------------------------
; Medium Shineyo!
[StateDef 1310]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1310

[State 1310, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1310, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1310, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 7, >= 0
trigger1 = AnimElem = 8, < 0
trigger2 = AnimElem = 13, >= 0
trigger2 = AnimElem = 15, < 0
x = 6

[State 1310, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,3
channel = 0

[State 1310, Sound2]
type = PlaySnd
trigger1 = animelem = 8
value = 5,2

[State 1310, Sound3]
type = PlaySnd
trigger1 = AnimElem = 14
value = 5,1

[State 1310, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
anim = 1325
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1310, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 9, >=0
trigger1 = AnimElem = 10, <0
anim = 1326
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1310, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 10, >=0
trigger1 = AnimElem = 11, <0
anim = 1327
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1310, Sword Trail,4]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 14, >=0
trigger1 = AnimElem = 15, <0
anim = 1328
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1310, Sword Trail,5]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 15, >=0
trigger1 = AnimElem = 16, <0
anim = 1329
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1310, Sword Trail,6]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 16, >=0
trigger1 = AnimElem = 17, <0
anim = 1330
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1310, HitDef1]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 12 * (1 - (3 * (fvar(16)/200))), 12 / 4))
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 135
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 30 * (1 - (3 * (fvar(16)/200))), 30 / 4)), 0

[State 1310, HitDef2]
type = HitDef
trigger1 = AnimElem = 14
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 12 * (1 - (3 * (fvar(16)/200))), 12 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, 9
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 135
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = Floor(ifelse(fvar(16) < 50, 60 * (1 - (3 * (fvar(16)/200))), 60 / 4)), 0
givepower = Floor(ifelse(fvar(16) < 50, 30 * (1 - (3 * (fvar(16)/200))), 30 / 4)), 0

[State 1310, Throw]
type = TargetState
trigger1 = AnimElem = 14, >= 0
trigger1 = MoveHit = 1
value = 921
ignorehitpause = 1

[State 1310, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1310, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Medium Shineyo!
[Statedef 1315]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1310
juggle = 0

[State 1315, Turn]
type = Turn
trigger1 = time = 0

[State 1315, 2]
type = ChangeState
trigger1 = 1
value = 1310

;---------------------------------------------------------------------------
; RF Shineyo!
[StateDef 1320]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 1320

[State 1320, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 1320, Transfer Reset]
type = varset
trigger1 = time = 0
fvar(27) = 0

[State 1320, Slide Forward]
type = PosAdd
trigger1 = AnimElem = 5, >= 0
trigger1 = AnimElem = 6, < 0
trigger2 = AnimElem = 11, >= 0
trigger2 = AnimElem = 13, < 0
x = 6

[State 1320, RF Stock1]
type = VarSet
trigger1 = time = 0
var(10) = 0

[State 1320, RF Stock2]
type = VarSet
trigger1 = time = 0
var(11) = var(11) - 1

[State 1320, Blink Yellow]
type = Null;PalFX
trigger1 = Time%2
time = 1
add = 128,128,0;64

[State 1320, Blink Yellow]
type = PalFX
trigger1 = Time%2
time = 1
add = 16, 16, -32
mul = 1024,1024,256
ignorehitpause = 1

[State 1320, Sound1]
type = PlaySnd
trigger1 = animelem = 1
value = 4,3
channel = 0

[State 1320, Sound2]
type = PlaySnd
trigger1 = animelem = 6
value = 5,2

[State 1310, Sound3]
type = PlaySnd
trigger1 = AnimElem = 12
value = 5,1

[State 1320, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 6, >=0
trigger1 = AnimElem = 7, <0
anim = 1325
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1320, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 7, >=0
trigger1 = AnimElem = 8, <0
anim = 1326
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1320, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
anim = 1327
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1320, Sword Trail,4]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 12, >=0
trigger1 = AnimElem = 13, <0
anim = 1328
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1320, Sword Trail,5]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 13, >=0
trigger1 = AnimElem = 14, <0
anim = 1329
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1320, Sword Trail,6]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 14, >=0
trigger1 = AnimElem = 15, <0
anim = 1330
ID = 1300
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 1320, HitDef1]
type = HitDef
trigger1 = Time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 12 * (1 - (3 * (fvar(16)/200))), 12 / 4))
pausetime = 8,8
sparkno = S979
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 135
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(16) < 50, 30 * (1 - (3 * (fvar(16)/200))), 30 / 4)), 0

[State 1320, HitDef2]
type = HitDef
trigger1 = AnimElem = 12
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(16) < 50, 12 * (1 - (3 * (fvar(16)/200))), 12 / 4))
pausetime = 8,8
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -66
hitsound = S3, 9
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 135
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(16) < 50, 30 * (1 - (3 * (fvar(16)/200))), 30 / 4)), 0

[State 1320, Throw]
type = TargetState
trigger1 = AnimElem = 12, >= 0
trigger1 = MoveHit = 1
value = 921
ignorehitpause = 1

[State 1320, Combo Into New Move]
type = ChangeState
triggerall = !var(0)
triggerall = MoveHit <= 8
trigger1 = (var(1) = [800,801])
value = var(1)

[State 1320, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse RF Shineyo!
[Statedef 1325]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 1320
juggle = 0

[State 1325, Turn]
type = Turn
trigger1 = time = 0

[State 1325, 2]
type = ChangeState
trigger1 = 1
value = 1320

;---------------------------------------------------------------------------
; Super Moves
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Buttobe!

;---------------------------------------------------------------------------
; Buttobe!
[StateDef 3000]
ctrl = 0
type = S
movetype = A
physics = S
velset = 0,0
juggle = 0
sprpriority = 2
anim = 3000

[State 3100, Explods]
type = Helper
trigger1 = AnimElem = 7
name = "SU-A Rings"
ID = 3001
pos = 0,0
postype = back
facing = 1
stateno = 3001
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 18
size.ground.front = 18
size.air.back = 18
size.air.front = 18
size.height = 50
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 3000, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State 3000, Super Flash BG]
type = Explod
trigger1 = time = 0
anim = 4000
ID = 4000
pos = 0, 136
postype = back
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 24
pausemovetime = 0
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3000, Super Portrait]
type = Explod
trigger1 = time = 0
anim = 4001
ID = 4001
pos = 0, 136
postype = back
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 23
pausemovetime = 0
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3000, Shortcut Limiter]
type = VarSet
trigger1 = time = 0
trigger1 = command = "LY"
var(45) = var(33)

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
time = 32
movetime = 32
anim = S3604
sound = S13,0
poweradd = -1000
p2defmul = 1

[State 3000, Superpause Time]
type = VarSet
trigger1 = AnimElem = 1
fvar(20) = 32

[State 3000, Sound1]
type = PlaySnd
trigger1 = animelem = 4
value = 6,0
channel = 0

[State 3000, Sound2]
type = PlaySnd
trigger1 = animelem = 4
value = 5,0

[State 3000, Sound3]
type = PlaySnd
trigger1 = animelem = 5
value = 7,0

[State 3000, Sound3]
type = Null;PlaySnd
trigger1 = animelem = 8
value = 7,0
freqmul = .9

[State 3000, Sword Trail,1]
type = Explod
trigger1 = AnimElem = 7, >0
trigger1 = AnimElem = 8, <=0
anim = 1125
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 3000, Sword Trail,2]
type = Explod
trigger1 = AnimElem = 8, >0
trigger1 = AnimElem = 9, <=0
anim = 1126
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 3000, Sword Trail,3]
type = Explod
trigger1 = AnimElem = 9, >0
trigger1 = AnimElem = 10, <=0
anim = 1127
ID = 1000
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 1
trans = addalpha
alpha = 256,128

[State 3000, HitDef]
type = HitDef
trigger1 = time = 0
attr = C, HA
hitflag = MAF
guardflag = LA
animtype = Light
damage = Floor(ifelse(fvar(17) < 99, 128 * (1 - (3 * (fvar(17)/396))), 128 / 4))
pausetime = 0,0
sparkno = S974
guard.sparkno = S973
sparkxy = -15, -44
hitsound = S3,6
guardsound = S10,8
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 200
ground.velocity = -6
air.velocity = 0, -4
air.hittime = 22
guard.velocity = -6
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -16
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -16
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = Floor(ifelse(fvar(17) < 99, 320 * (1 - (3 * (fvar(17)/396))), 320 / 4)), 0

[State 3000, Throw]
type = TargetState
trigger1 = MoveHit = 1
value = 921
ignorehitpause = 1

[State 3000, Stand State]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Buttobe!
[Statedef 3005]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 3000
juggle = 0

[State 3005, Turn]
type = Turn
trigger1 = time = 0

[State 3005, 2]
type = ChangeState
trigger1 = 1
value = 3000

;---------------------------------------------------------------------------
; Buttobe! Rings
[Statedef 3001]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
juggle = 0
anim = 3604
sprpriority = 3

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

[State 3001, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 3001, Bind To Parent]
type = PosSet
trigger1 = time = 0
x = parent, pos x
y = parent, pos y

[State 3001, Parent Facing]
type = Turn
trigger1 = time = 0
trigger1 = facing != parent, facing

[State 3001, Ring Vel Set]
type = VarSet
trigger1 = time = 0
var(22) = -7

;---------------------------------------------------------------------------
[State 3001, Ring 1-1F]
type = Explod
trigger1 = time = 0
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31001
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-1B]
type = Explod
trigger1 = time = 0
anim = 3002
ID = 32001
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-1F Modify]
type = ModifyExplod
trigger1 = 1
id = 31001
trans = addalpha
scale = Const(size.xscale) * (0.55 + time * 0.035), Const(size.yscale) * (0.55 + time * 0.035)
alpha = ifelse(time > 19, 256 - (time - 19) * 16, 256), ifelse(time > 19, (time - 19) * 16, 0)

[State 3001, Ring 1-1B Modify]
type = ModifyExplod
trigger1 = 1
id = 32001
trans = addalpha
scale = Const(size.xscale) * (0.55 + time * 0.035), Const(size.yscale) * (0.55 + time * 0.035)
alpha = ifelse(time > 19, 256 - (time - 19) * 16, 256), ifelse(time > 19, (time - 19) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 1-2F]
type = Explod
trigger1 = time = 0
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31002
pos = 184 + 4 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 33
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-2B]
type = Explod
trigger1 = time = 0
anim = 3002
ID = 32002
pos = 184 + 4 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 33
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-2F Modify]
type = ModifyExplod
trigger1 = 1
id = 31002
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 4) * 0.035), Const(size.yscale) * (0.55 + (time + 4) * 0.035)
alpha = ifelse(time > 15, 256 - (time - 15) * 16, 256), ifelse(time > 15, (time - 15) * 16, 0)

[State 3001, Ring 1-2B Modify]
type = ModifyExplod
trigger1 = 1
id = 32002
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 4) * 0.035), Const(size.yscale) * (0.55 + (time + 4) * 0.035)
alpha = ifelse(time > 15, 256 - (time - 15) * 16, 256), ifelse(time > 15, (time - 15) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 1-3F]
type = Explod
trigger1 = time = 0
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31003
pos = 184 + 8 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 29
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-3B]
type = Explod
trigger1 = time = 0
anim = 3002
ID = 32003
pos = 184 + 8 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 29
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-3F Modify]
type = ModifyExplod
trigger1 = 1
id = 31003
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 8) * 0.035), Const(size.yscale) * (0.55 + (time + 8) * 0.035)
alpha = ifelse(time > 11, 256 - (time - 11) * 16, 256), ifelse(time > 11, (time - 11) * 16, 0)

[State 3001, Ring 1-3B Modify]
type = ModifyExplod
trigger1 = 1
id = 32003
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 8) * 0.035), Const(size.yscale) * (0.55 + (time + 8) * 0.035)
alpha = ifelse(time > 11, 256 - (time - 11) * 16, 256), ifelse(time > 11, (time - 11) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 1-4F]
type = Explod
trigger1 = time = 0
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31004
pos = 184 + 12 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 25
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-4B]
type = Explod
trigger1 = time = 0
anim = 3002
ID = 32004
pos = 184 + 12 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 25
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-4F Modify]
type = ModifyExplod
trigger1 = 1
id = 31004
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 12) * 0.035), Const(size.yscale) * (0.55 + (time + 12) * 0.035)
alpha = ifelse(time > 7, 256 - (time - 7) * 16, 256), ifelse(time > 7, (time - 7) * 16, 0)

[State 3001, Ring 1-4B Modify]
type = ModifyExplod
trigger1 = 1
id = 32004
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 12) * 0.035), Const(size.yscale) * (0.55 + (time + 12) * 0.035)
alpha = ifelse(time > 7, 256 - (time - 7) * 16, 256), ifelse(time > 7, (time - 7) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 1-5F]
type = Explod
trigger1 = time = 0
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31005
pos = 184 + 16 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 21
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-5B]
type = Explod
trigger1 = time = 0
anim = 3002
ID = 32005
pos = 184 + 16 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 21
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-5F Modify]
type = ModifyExplod
trigger1 = 1
id = 31005
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 16) * 0.035), Const(size.yscale) * (0.55 + (time + 16) * 0.035)
alpha = ifelse(time > 3, 256 - (time - 3) * 16, 256), ifelse(time > 3, (time - 3) * 16, 0)

[State 3001, Ring 1-5B Modify]
type = ModifyExplod
trigger1 = 1
id = 32005
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 16) * 0.035), Const(size.yscale) * (0.55 + (time + 16) * 0.035)
alpha = ifelse(time > 3, 256 - (time - 3) * 16, 256), ifelse(time > 3, (time - 3) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 1-6F]
type = Explod
trigger1 = time = 0
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31006
pos = 184 + 20 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 17
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-6B]
type = Explod
trigger1 = time = 0
anim = 3002
ID = 32006
pos = 184 + 20 * var(22), var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 17
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 1-6F Modify]
type = ModifyExplod
trigger1 = 1
id = 31006
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 20) * 0.035), Const(size.yscale) * (0.55 + (time + 20) * 0.035)
alpha = 256 - (time + 1) * 16, (time + 1) * 16

[State 3001, Ring 1-6B Modify]
type = ModifyExplod
trigger1 = 1
id = 32006
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time + 20) * 0.035), Const(size.yscale) * (0.55 + (time + 20) * 0.035)
alpha = 256 - (time + 1) * 16, (time + 1) * 16

;---------------------------------------------------------------------------
[State 3001, Ring 2F]
type = Explod
trigger1 = time = 1
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31007
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 2B]
type = Explod
trigger1 = time = 1
anim = 3002
ID = 32007
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 2F Modify]
type = ModifyExplod
trigger1 = time >= 1
id = 31007
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 1) * 0.035), Const(size.yscale) * (0.55 + (time - 1) * 0.035)
alpha = ifelse(time > 20, 256 - (time - 20) * 16, 256), ifelse(time > 20, (time - 20) * 16, 0)

[State 3001, Ring 2B Modify]
type = ModifyExplod
trigger1 = time >= 1
id = 32007
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 1) * 0.035), Const(size.yscale) * (0.55 + (time - 1) * 0.035)
alpha = ifelse(time > 20, 256 - (time - 20) * 16, 256), ifelse(time > 20, (time - 20) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 3F]
type = Explod
trigger1 = time = 2
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31008
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 3B]
type = Explod
trigger1 = time = 2
anim = 3002
ID = 32008
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 3F Modify]
type = ModifyExplod
trigger1 = time >= 2
id = 31008
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 2) * 0.035), Const(size.yscale) * (0.55 + (time - 2) * 0.035)
alpha = ifelse(time > 21, 256 - (time - 21) * 16, 256), ifelse(time > 21, (time - 21) * 16, 0)

[State 3001, Ring 3B Modify]
type = ModifyExplod
trigger1 = time >= 2
id = 32008
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 2) * 0.035), Const(size.yscale) * (0.55 + (time - 2) * 0.035)
alpha = ifelse(time > 21, 256 - (time - 21) * 16, 256), ifelse(time > 21, (time - 21) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 4F]
type = Explod
trigger1 = time = 5
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31009
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 4B]
type = Explod
trigger1 = time = 5
anim = 3002
ID = 32009
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 4F Modify]
type = ModifyExplod
trigger1 = time >= 5
id = 31009
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 5) * 0.035), Const(size.yscale) * (0.55 + (time - 5) * 0.035)
alpha = ifelse(time > 24, 256 - (time - 24) * 16, 256), ifelse(time > 24, (time - 24) * 16, 0)

[State 3001, Ring 4B Modify]
type = ModifyExplod
trigger1 = time >= 5
id = 32009
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 5) * 0.035), Const(size.yscale) * (0.55 + (time - 5) * 0.035)
alpha = ifelse(time > 24, 256 - (time - 24) * 16, 256), ifelse(time > 24, (time - 24) * 16, 0)

;---------------------------------------------------------------------------
[State 3001, Ring 5F]
type = Explod
trigger1 = time = 6
trigger1 = 1 || var(23) := ((random % 16) - 7)
anim = 3001
ID = 31010
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = 4
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 5B]
type = Explod
trigger1 = time = 6
anim = 3002
ID = 32010
pos = 184, var(23) - 45
postype = p1
facing = 1
bindtime = 1
removetime = 37
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale) * 0.55, Const(size.yscale) * 0.55
vel = var(22), 0
sprpriority = -3
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 3001, Ring 5F Modify]
type = ModifyExplod
trigger1 = time >= 6
id = 31010
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 6) * 0.035), Const(size.yscale) * (0.55 + (time - 6) * 0.035)
alpha = ifelse(time > 25, 256 - (time - 25) * 16, 256), ifelse(time > 25, (time - 25) * 16, 0)

[State 3001, Ring 5B Modify]
type = ModifyExplod
trigger1 = time >= 6
id = 32010
trans = addalpha
scale = Const(size.xscale) * (0.55 + (time - 6) * 0.035), Const(size.yscale) * (0.55 + (time - 6) * 0.035)
alpha = ifelse(time > 25, 256 - (time - 25) * 16, 256), ifelse(time > 25, (time - 25) * 16, 0)

[State 3001, Remove]
type = DestroySelf
trigger1 = time = 70

;---------------------------------------------------------------------------
; Ryuumon Hoozukimaru

;---------------------------------------------------------------------------
; Ryuumon Hoozukimaru
; Dragon Crest Demon Light
[Statedef 3100]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
;anim = 3100
juggle = 0

[State 3100, Super B]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim != 3100
trigger1 = prevstateno != 3900
value = 3100

[State 3100, Bankai]
type = Helper
triggerall = numhelper(3901) = 0
trigger1 = AnimTime = 0
name = "Bankai Rune"
ID = 3901
pos = 0,0
postype = back
facing = 1
stateno = 3901
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 18
size.ground.front = 18
size.air.back = 18
size.air.front = 18
size.height = 50
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 3100, Sound]
type = PlaySnd
trigger1 = time = 0
trigger1 = prevstateno != 3900
value = 6,1
channel = 0

[State 3100, Sound]
type = PlaySnd
trigger1 = time = 30
trigger1 = prevstateno != 3900
value = 13,1

[State 3100, Sound]
type = PlaySnd
trigger1 = time = 45
trigger1 = prevstateno != 3900
value = 13,1

[State 3100, Bankao Super Flash]
type = Explod
trigger1 = time = 0
trigger1 = prevstateno != 3900
anim = 4004
ID = 4004
pos = 0, 240
postype = back
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 60
pausemovetime = 0
scale = 1,1
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3100, Shortcut Limiter]
type = VarSet
trigger1 = time = 0
trigger1 = command = "LA"
var(47) = var(33)

[State 3100, Super B]
type = SuperPause
trigger1 = AnimElem = 1
trigger1 = prevstateno != 3900
time = 75
movetime = 45
anim = S3604
sound = S13,0
poweradd = -3000
p2defmul = 1

[State 3100, Superpause Time]
type = VarSet
trigger1 = AnimElem = 1
trigger1 = prevstateno != 3900
fvar(20) = 45

[State 3100, Bankai On]
type = VarSet
trigger1 = time = 0
var(42) = 1

[State 3100, VarSet]
type = VarSet
trigger1 = time = 0
fvar(25) = 0

; Bankai Timer
[State -2, Bankai Timer]
type = VarSet
trigger1 = 1
fvar(37) = 0
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; Reverse Ryuumon Hoozukimaru
; Dragon Crest Demon Light
[Statedef 3105]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 3000
juggle = 0

[State 3105, Turn]
type = Turn
trigger1 = time = 0

[State 3105, 2]
type = ChangeState
trigger1 = 1
value = 3100

;---------------------------------------------------------------------------
; Bankai End
[Statedef 3150]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
anim = 3105
juggle = 0

[State 3150, PalFX]
type = PalFX
trigger1 = AnimElem = 1, >= 0
trigger1 = AnimElem = 2, < 0
time = 1
add = Floor(256 * (time / 16.0)), Floor(256 * (time / 16.0)), Floor(256 * (time / 16.0))
mul = 256,256,256

[State 3150, PalFX]
type = PalFX
trigger1 = AnimElem = 2, >= 0
trigger1 = AnimElem = 3, < 0
time = 1
add = Floor(256 * ((76.0 - time) / 60)), Floor(256 * ((76.0 - time) / 60)), Floor(256 * ((76.0 - time) / 60))
mul = 256,256,256

[State 3150, Bankai Off]
type = VarSet
trigger1 = time = 0
var(42) = 0

[State 3150, VarSet]
type = VarSet
trigger1 = time = 0
fvar(25) = 0

; Bankai Timer
[State 3150, Bankai Timer]
type = VarSet
trigger1 = 1
fvar(37) = 0
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; Spin Ur Bladez
[StateDef 3600]
ctrl = 0
type = S
movetype = A
physics = S
juggle = 0
sprpriority = 2

[State 3600, ScreenBound]
type = Null;ScreenBound
trigger1 = numtarget > 0
trigger1 = target, stateno != [120,155]
value = 1
movecamera = 0, 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 3600, Sound1]
type = PlaySnd
trigger1 = var(41) = 0
value = 6,2
channel = 0

[State 3600, Shortcut Limiter]
type = VarSet
trigger1 = var(41) = 0
trigger1 = command = "LX"
var(46) = var(33)

[State 3600, Attack Anim]
type = ChangeAnim
trigger1 = var(41) = 0
value = 3980

[State 3600, Attack Anim]
type = ChangeAnim
trigger1 = anim = 3980
trigger1 = AnimTime = 0
value = ifelse(fvar(25) >= 80, 3982, 3981)

[State 3600, End Anim]
type = ChangeAnim
trigger1 = anim = [3981,3982]
trigger1 = AnimTime = 0
value = 3985

[State 3600, Bankai Vel Reset]
type = VelSet
trigger1 = var(41) = 0
x = 0
y = 0

[State 3600, Sound2]
type = PlaySnd
trigger1 = anim = [3980,3981]
trigger1 = animelem = 2
value = 3,2

[State 3600, HitDef]
type = HitDef
trigger1 = (var(41) - 12) % (6 * ifelse(anim = 3981, 2, 1)) = 0
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Light
damage = Floor(ifelse(fvar(17) < 99, 8 * (1 - (3 * (fvar(15)/396))), 8 / 4))
pausetime = 1,1
sparkno = S980
guard.sparkno = S973
sparkxy = -10, -75
hitsound = S3, ifelse((random % 2), 4, 5)
guardsound = S10,8
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
guard.dist = 260
ground.velocity = -4
air.velocity = 0,-4
air.hittime = 22
guard.velocity = ifelse(facing = 1, ifelse((enemynear, pos x < pos x), 6, -6), ifelse((enemynear, pos x > pos x), 6, -6))
airguard.velocity = 0,0
ground.cornerpush.veloff = 0; -8
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0; -8
airguard.cornerpush.veloff = 0
getpower = 0
givepower = Floor(ifelse(fvar(17) < 99, 20 * (1 - (3 * (fvar(17)/396))), 20 / 4)), 0
;p2stateno = 921

[State 3600, VarSet]
type = VarSet
triggerall = var(42) = 1
trigger1 = MoveHit = 1
fvar(25) = fvar(25) + (ifelse((fvar(17) - 1) < 99, 2 * (1 - (3 * ((fvar(17) - 1)/396))), 2 / 4) * ifelse(numtarget = 0, 1, numtarget))

[State 3600, Wire]
type = TargetState
trigger1 = MoveHit = 1
trigger1 = target, movetype = H
value = 921
ignorehitpause = 1

[State 3600, Make Land Dust Effect1]
type = Helper
triggerall = MoveHit = 1
triggerall = numhelper(925) = 0
trigger1 = numtarget > 0
trigger1 = target, id = var(35)
name = "Wired Dust Clouds"
ID = 925
pos = 0,0
postype = back
facing = 1
stateno = 925
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 3600, Make Land Dust Effect2]
type = Helper
triggerall = MoveHit = 1
triggerall = numenemy = 2
triggerall = var(36) != 0
triggerall = numhelper(926) = 0
trigger1 = numtarget > 0
trigger1 = target, id = var(36)
name = "Wired Dust Clouds"
ID = 926
pos = 0,0
postype = back
facing = 1
stateno = 926
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 3900, Bankai End]
type = ChangeState
triggerall = AnimTime = 0
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State 3600, Stand State]
type = ChangeState
trigger1 = anim = 3985
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Reverse Spin Ur Bladez
[Statedef 3605]
type = S
movetype = A
physics = S
velset = 0,0
ctrl = 0
juggle = 0

[State 3605, Turn]
type = Turn
trigger1 = time = 0

[State 3605, 2]
type = ChangeState
trigger1 = 1
value = 3600

;---------------------------------------------------------------------------
; Bankai Rune
[Statedef 3901]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
juggle = 0
anim = 3604
sprpriority = 3

[State 3901, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1

[State 3901, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 3901, PlayerPush]
type = PlayerPush
trigger1 = (parent, var(22) >= 8) && (parent, var(22) < 22)
trigger2 = stateno = 220 || stateno = 420
trigger2 = parent, var(42) = 1
trigger2 = parent, var(41) >= 16
trigger2 = parent, var(41) < 40
value = 0

[State 3901, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 3901, 3900 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3900
trigger1 = parent, stateno != 3100
trigger1 = time != 0
value = 3901

[State 3901, 3905 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3905
value = 3906

[State 3901, 3910 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3910
value = 3911

[State 3901, 3915 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3915
value = 3916

[State 3901, 3920 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3920
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 9, < 0
trigger2 = parent, anim = 3921
trigger2 = parent, AnimElem = 1, >= 0
trigger2 = parent, AnimElem = 13, < 0
trigger3 = parent, anim = 3922
trigger3 = parent, AnimElem = 1, >= 0
trigger3 = parent, AnimElem = 17, < 0
value = 3930

[State 3901, 3921 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3920
trigger1 = parent, AnimElem = 9, >= 0
trigger1 = parent, AnimElem = 26, <= 0
trigger2 = parent, anim = 3921
trigger2 = parent, AnimElem = 13, >= 0
trigger2 = parent, AnimElem = 32, <= 0
trigger3 = parent, anim = 3922
trigger3 = parent, AnimElem = 17, >= 0
trigger3 = parent, AnimElem = 40, <= 0
value = 3931

[State 3901, 3922 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3920
trigger1 = parent, AnimElem = 27, >= 0
trigger1 = parent, AnimElem = 30, <= 0
trigger2 = parent, anim = 3921
trigger2 = parent, AnimElem = 33, >= 0
trigger2 = parent, AnimElem = 36, <= 0
trigger3 = parent, anim = 3922
trigger3 = parent, AnimElem = 41, >= 0
trigger3 = parent, AnimElem = 44, <= 0
value = 3932

[State 3901, 3920 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3920
trigger1 = parent, AnimElem = 31, >= 0
trigger1 = parent, AnimTime <= 0
trigger2 = parent, anim = 3921
trigger2 = parent, AnimElem = 37, >= 0
trigger2 = parent, AnimTime <= 0
trigger3 = parent, anim = 3922
trigger3 = parent, AnimElem = 45, >= 0
trigger3 = parent, AnimTime <= 0
value = 3930

[State 3901, 3940 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3940
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 8, <= 0
trigger2 = parent, anim = 3941
trigger2 = parent, AnimElem = 1, >= 0
trigger2 = parent, AnimElem = 12, <= 0
trigger3 = parent, anim = 3942
trigger3 = parent, AnimElem = 1, >= 0
trigger3 = parent, AnimElem = 16, <= 0
value = 3950

[State 3901, 3941 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3940
trigger1 = parent, AnimElem = 9, >= 0
trigger1 = parent, AnimElem = 26, <= 0
trigger2 = parent, anim = 3941
trigger2 = parent, AnimElem = 13, >= 0
trigger2 = parent, AnimElem = 32, <= 0
trigger3 = parent, anim = 3942
trigger3 = parent, AnimElem = 17, >= 0
trigger3 = parent, AnimElem = 40, <= 0
value = 3951

[State 3901, 3942 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3940
trigger1 = parent, AnimElem = 27, >= 0
trigger1 = parent, AnimElem = 30, <= 0
trigger2 = parent, anim = 3941
trigger2 = parent, AnimElem = 33, >= 0
trigger2 = parent, AnimElem = 36, <= 0
trigger3 = parent, anim = 3942
trigger3 = parent, AnimElem = 41, >= 0
trigger3 = parent, AnimElem = 44, <= 0
value = 3952

[State 3901, 3940 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3940
trigger1 = parent, AnimElem = 31, >= 0
trigger1 = parent, AnimTime <= 0
trigger2 = parent, anim = 3941
trigger2 = parent, AnimElem = 37, >= 0
trigger2 = parent, AnimTime <= 0
trigger3 = parent, anim = 3942
trigger3 = parent, AnimElem = 45, >= 0
trigger3 = parent, AnimTime <= 0
value = 3950

[State 3901, 3960 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3960
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 8, <= 0
value = 3991

[State 3901, 3960 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3960
trigger1 = parent, AnimElem = 9, >= 0
trigger1 = parent, AnimElem = 10, <= 0
value = 3970

[State 3901, 3960 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3960
trigger1 = parent, AnimElem = 11, >= 0
trigger1 = parent, AnimTime <= 0
value = 3971

[State 3901, 3965 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3965
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 4, <= 0
value = 3990

[State 3901, 3965 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3965
trigger1 = parent, AnimElem = 5, >= 0
trigger1 = parent, AnimTime <= 0
value = 3991

[State 3901, 3980 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3980
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 4, <= 0
value = 3990

[State 3901, 3980 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3980
trigger1 = parent, AnimElem = 5, >= 0
trigger1 = parent, AnimTime <= 0
value = 3991

[State 3901, 3981 Rune]
type = ChangeAnim
triggerall = parent, anim = 3981
trigger1 = parent, AnimElem = 9, >= 0
trigger1 = parent, AnimElem = 24, <= 0
trigger2 = parent, AnimElem = 41, >= 0
trigger2 = parent, AnimElem = 56, <= 0
trigger3 = parent, AnimElem = 73, >= 0
trigger3 = parent, AnimElem = 88, <= 0
value = 3604

[State 3901, 3981 Rune]
type = ChangeAnim
triggerall = parent, anim = 3981
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 4, <= 0
trigger2 = parent, AnimElem = 33, >= 0
trigger2 = parent, AnimElem = 36, <= 0
trigger3 = parent, AnimElem = 65, >= 0
trigger3 = parent, AnimElem = 68, <= 0
value = 3992

[State 3901, 3981 Rune]
type = ChangeAnim
triggerall = parent, anim = 3981
trigger1 = parent, AnimElem = 5, >= 0
trigger1 = parent, AnimElem = 8, <= 0
trigger2 = parent, AnimElem = 37, >= 0
trigger2 = parent, AnimElem = 40, <= 0
trigger3 = parent, AnimElem = 69, >= 0
trigger3 = parent, AnimElem = 72, <= 0
value = 3993

[State 3901, 3981 Rune]
type = ChangeAnim
triggerall = parent, anim = 3981
trigger1 = parent, AnimElem = 25, >= 0
trigger1 = parent, AnimElem = 28, <= 0
trigger2 = parent, AnimElem = 57, >= 0
trigger2 = parent, AnimElem = 60, <= 0
trigger3 = parent, AnimElem = 89, >= 0
trigger3 = parent, AnimTime <= 0
value = 3994

[State 3901, 3981 Rune]
type = ChangeAnim
triggerall = parent, anim = 3981
trigger1 = parent, AnimElem = 29, >= 0
trigger1 = parent, AnimElem = 32, <= 0
trigger2 = parent, AnimElem = 61, >= 0
trigger2 = parent, AnimElem = 64, <= 0
value = 3995

[State 3901, 3982 Rune]
type = ChangeAnim
triggerall = parent, anim = 3982
trigger1 = parent, AnimElem = 5, >= 0
trigger1 = parent, AnimElem = 12, <= 0
trigger2 = parent, AnimElem = 21, >= 0
trigger2 = parent, AnimElem = 28, <= 0
trigger3 = parent, AnimElem = 37, >= 0
trigger3 = parent, AnimElem = 44, <= 0
trigger4 = parent, AnimElem = 53, >= 0
trigger4 = parent, AnimElem = 60, <= 0
trigger5 = parent, AnimElem = 69, >= 0
trigger5 = parent, AnimElem = 76, <= 0
trigger6 = parent, AnimElem = 85, >= 0
trigger6 = parent, AnimTime <= 0
value = 3604

[State 3901, 3982 Rune]
type = ChangeAnim
triggerall = parent, anim = 3982
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 2, <= 0
trigger2 = parent, AnimElem = 17, >= 0
trigger2 = parent, AnimElem = 18, <= 0
trigger3 = parent, AnimElem = 33, >= 0
trigger3 = parent, AnimElem = 34, <= 0
trigger4 = parent, AnimElem = 49, >= 0
trigger4 = parent, AnimElem = 50, <= 0
trigger5 = parent, AnimElem = 65, >= 0
trigger5 = parent, AnimElem = 66, <= 0
trigger6 = parent, AnimElem = 81, >= 0
trigger6 = parent, AnimElem = 82, <= 0
value = 3992

[State 3901, 3982 Rune]
type = ChangeAnim
triggerall = parent, anim = 3982
trigger1 = parent, AnimElem = 3, >= 0
trigger1 = parent, AnimElem = 4, <= 0
trigger2 = parent, AnimElem = 19, >= 0
trigger2 = parent, AnimElem = 20, <= 0
trigger3 = parent, AnimElem = 35, >= 0
trigger3 = parent, AnimElem = 36, <= 0
trigger4 = parent, AnimElem = 51, >= 0
trigger4 = parent, AnimElem = 52, <= 0
trigger5 = parent, AnimElem = 67, >= 0
trigger5 = parent, AnimElem = 68, <= 0
trigger6 = parent, AnimElem = 83, >= 0
trigger6 = parent, AnimElem = 84, <= 0
value = 3993

[State 3901, 3982 Rune]
type = ChangeAnim
triggerall = parent, anim = 3982
trigger1 = parent, AnimElem = 13, >= 0
trigger1 = parent, AnimElem = 14, <= 0
trigger2 = parent, AnimElem = 29, >= 0
trigger2 = parent, AnimElem = 30, <= 0
trigger3 = parent, AnimElem = 45, >= 0
trigger3 = parent, AnimElem = 46, <= 0
trigger4 = parent, AnimElem = 61, >= 0
trigger4 = parent, AnimElem = 62, <= 0
trigger4 = parent, AnimElem = 77, >= 0
trigger4 = parent, AnimElem = 78, <= 0
value = 3994

[State 3901, 3982 Rune]
type = ChangeAnim
triggerall = parent, anim = 3982
trigger1 = parent, AnimElem = 15, >= 0
trigger1 = parent, AnimElem = 16, <= 0
trigger2 = parent, AnimElem = 31, >= 0
trigger2 = parent, AnimElem = 32, <= 0
trigger3 = parent, AnimElem = 47, >= 0
trigger3 = parent, AnimElem = 48, <= 0
trigger4 = parent, AnimElem = 62, >= 0
trigger4 = parent, AnimElem = 64, <= 0
trigger4 = parent, AnimElem = 79, >= 0
trigger4 = parent, AnimElem = 80, <= 0
value = 3995

[State 3901, 3985 Rune]
type = ChangeAnim
triggerall = parent, anim = 3985
trigger1 = parent, AnimElem = 5, >= 0
trigger1 = parent, AnimElem = 20, <= 0
value = 3990

[State 3901, 3985 Rune]
type = ChangeAnim
trigger1 = parent, anim = 3985
trigger1 = parent, AnimElem = 1, >= 0
trigger1 = parent, AnimElem = 4, <= 0
trigger2 = parent, anim = 3985
trigger2 = parent, AnimElem = 21, >= 0
trigger2 = parent, AnimTime <= 0
value = 3991

[State 3901, Bind To Parent]
type = PosSet
trigger1 = 1
x = parent, pos x
y = parent, pos y

[State 3901, Parent Facing]
type = Turn
trigger1 = facing != parent, facing

[State 3901, PalFX]
type = PalFX
trigger1 = parent, fvar(25) < 80
time = 1
add = 0,0,0
mul = Floor((parent, fvar(25)) / 80 * 256), Floor((parent, fvar(25)) / 80 * 256), Floor((parent, fvar(25)) / 80 * 256)

[State 3901, PalFX]
type = PalFX
trigger1 = parent, fvar(25) >= 80
time = 1
add = 0,0,0
mul = (256 - ((time % 16) * 16)), (256 - ((time % 16) * 16)), (256 - ((time % 16) * 16))

[State 3901, Transparent]
type = Trans
trigger1 = parent, stateno = 801
trigger1 = (parent, var(22) >= 8) && (parent, var(22) < 22)
trans = addalpha
alpha = 128, 256

[State 3901, Remove]
type = DestroySelf
trigger1 = parent, var(42) != 1
trigger2 = !(parent, alive)

;---------------------------------------------------------------------------
; Special Movement
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Shunpo start
[Statedef 800]
type    = U
physics = N
ctrl = 0
sprpriority = 2

[State 800, Make Guard Cancel Helper]
type = Helper
trigger1 = prevstateno = [150,155]
trigger1 = (stateno = [1000,4999]) || (stateno = [800,803])
trigger1 = time = 0
trigger1 = NumHelper(150) < 1
name = "Guard Cancel"
ID = 150
pos = Floor(Const(size.xscale) * Const(size.mid.pos.x)), Floor(Const(size.yscale) * Const(size.mid.pos.y))
postype = p1
facing = 1
stateno = 960
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = Const(size.xscale)
size.yscale = Const(size.yscale)
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 800, No Autoturn]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

[State 800, Shunpo Timer]
type = VarSet
trigger1 = time = 0
var(22) = ifelse(((prevstateno = [200,799]) && (var(42) != 1)), 8, 0)

[State 800, Shunpo downback]
type = VarSet
triggerall = !var(0)
triggerall = prevstateno != 20
trigger1 = command = "holddown"
trigger1 = command = "holdback"
trigger1 = statetype = A
var(23) = 8

[State 800, Shunpo upback]
type = VarSet
triggerall = !var(0)
triggerall = prevstateno != 20
trigger1 = command = "holdup"
trigger1 = command = "holdback"
var(23) = 6

[State 800, Shunpo down]
type = VarSet
triggerall = !var(0)
trigger1 = command = "holddown"
trigger1 = (command != "holdfwd") && (command != "holdback")
trigger1 = statetype = A
var(23) = 5

[State 800, Shunpo downfwd]
type = VarSet
triggerall = !var(0)
trigger1 = command = "holddown"
trigger1 = command = "holdfwd"
trigger1 = statetype = A
var(23) = 4

[State 800, Shunpo fwd]
type = VarSet
triggerall = !var(0)
trigger1 = (command != "holdup") && (command != "holddown")
trigger1 = command != "holdback"
trigger2 = command = "holddown"
trigger2 = command != "holdback"
trigger2 = statetype != A
var(23) = 3

[State 800, Shunpo upfwd]
type = VarSet
triggerall = !var(0)
trigger1 = command = "holdup"
trigger1 = command = "holdfwd"
var(23) = 2

[State 800, Shunpo up]
type = VarSet
triggerall = !var(0)
trigger1 = command = "holdup"
trigger1 = (command != "holdfwd") && (command != "holdback")
var(23) = 1

[State 800, Shunpo back]
type = VarSet
triggerall = !var(0)
trigger1 = (command != "holdup") && (command != "holddown")
trigger1 = command = "holdback"
trigger2 = command = "holddown"
trigger2 = command = "holdback"
trigger2 = statetype != A
;trigger3 = var(23) = 3
;trigger3 = var(37) = 1
var(23) = 7

[State 800, Clear Combo Condition]
type = VarSet
trigger1 = time = 0
var(1) = 0

;[State 800, Walk Back to Shunpo Fix]
;type = VarSet
;trigger1 = time = 0
;var(37) = 0

[State 800, Sound2]
type = PlaySnd
trigger1 = time = 0
value = 9,4

[State 800, Shunpo Stock1]
type = VarSet
trigger1 = time = 0
fvar(14) = 0

[State 800, Shunpo Stock2]
type = VarSet
trigger1 = time = 0
var(13) = var(13) - 1

[State 800, State Change]
type = ChangeState
trigger1 = time = 0
value = 801

;---------------------------------------------------------------------------
; Shunpo
; var(23): 0_ is normal behavior, 1_ is BOFS, 2_ is stay in front
[Statedef 801]
type    = U
physics = N
velset = 0,0
sprpriority = 2

[State 800, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 801, Anim 1]
type = ChangeAnim
trigger1 = ifelse(var(42) = 1, var(41) = 0, time = 0)
value = ifelse(var(42) = 1, 3900, 800)

[State 801, Shunpo Ring1]
type = Explod
trigger1 = anim = 800
trigger1 = AnimElemNo(0) = 2
trigger2 = anim = 802
trigger2 = AnimElemNo(0) = 4
;trigger3 = var(42) = 1
;trigger3 = var(22) = 0 || var(22) = 1
;trigger4 = var(42) = 1
;trigger4 = var(22) = 26 || var(22) = 27
anim = 803
ID = 800
pos = Floor(Const(size.xscale)), Floor(Const(size.yscale))
postype = p1
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = Floor(Const(size.xscale)), Floor(Const(size.yscale))
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 801, Shunpo Ring2]
type = Explod
trigger1 = anim = 800
trigger1 = AnimElemNo(0) = 3
trigger2 = anim = 802
trigger2 = AnimElemNo(0) = 3
;trigger3 = var(42) = 1
;trigger3 = var(22) = 2 || var(22) = 3
;trigger4 = var(42) = 1
;trigger4 = var(22) = 24 || var(22) = 25
anim = 804
ID = 800
pos = Floor(Const(size.xscale)), Floor(Const(size.yscale))
postype = p1
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = Floor(Const(size.xscale)), Floor(Const(size.yscale))
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 801, Shunpo Ring3]
type = Explod
trigger1 = anim = 800
trigger1 = AnimElemNo(0) = 4
trigger2 = anim = 802
trigger2 = AnimElemNo(0) = 2
;trigger3 = var(42) = 1
;trigger3 = var(22) = 4 || var(22) = 5
;trigger4 = var(42) = 1
;trigger4 = var(22) = 22 || var(22) = 23
anim = 805
ID = 800
pos = Floor(Const(size.xscale)), Floor(Const(size.yscale))
postype = p1
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = Floor(Const(size.xscale)), Floor(Const(size.yscale))
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 801, Sound1]
type = PlaySnd
trigger1 = time = 0
value = 9, ifelse((random % 2), 0, 7)
channel = 0

[State 801, No Autoturn]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

[State 801, Turn]
type = Turn
trigger1 = time = 0
trigger1 = (var(23) % 10) > 5

[State 801, Shunpo back direction]
type = VarSet
trigger1 = (var(23) % 10) > 5
var(23) = var(23) - 4

[State 801, Anim 1]
type = ChangeAnim
trigger1 = var(22) = 8
value = ifelse(var(42) = 1, 3910, 801)

[State 801, Shunpo upfwd]
type = ChangeAnim
trigger1 = var(22) = 8
trigger1 = (var(23) % 10) = 2
value = ifelse(var(42) = 1, 3910, 42)

[State 801, Shunpo up, down]
type = ChangeAnim
trigger1 = var(22) = 8
trigger1 = (var(23) % 10) = 1 || (var(23) % 10) = 5
value = ifelse(var(42) = 1, 3910, 41)

[State 801, Shunpo downfwd]
type = ChangeAnim
trigger1 = var(22) = 8
trigger1 = (var(23) % 10) = 4
value = ifelse(var(42) = 1, 3915, 48)

[State 801, Anim 2]
type = ChangeAnim
trigger1 = var(22) = 22
value = ifelse(var(42) = 1, 3900, 802)

[State 801, Getting RF'd]
type = VarSet
trigger1 = NumEnemy = 1
trigger1 = enemy, SelfAnimExist(66167101)
trigger1 = (enemy, var(29) = id) || (enemy, var(30) = id)
trigger2 = NumEnemy > 1
trigger2 = playerID(var(35)), SelfAnimExist(66167101)
trigger2 = (playerID(var(35)), var(29) = id) || (playerID(var(35)), var(30) = id)
trigger3 = NumEnemy > 1
trigger3 = var(36) != 0
trigger3 = playerID(var(36)), SelfAnimExist(66167101)
trigger3 = (playerID(var(36)), var(29) = id) || (playerID(var(36)), var(30) = id)
var(28) = 0

[State 801, Shunpo Dodge]
type = NotHitBy
trigger1 = var(22) < 22
trigger1 = var(28)
value = SCA, AA, AP, AT
time = 1

[State 801, No shadow]
type = AssertSpecial
trigger1 = (var(22) >= 8) && (var(22) < 22)
flag = noshadow
ignorehitpause = 1

[State 801, Transparent]
type = Trans
trigger1 = (var(22) >= 8) && (var(22) < 22)
trans = addalpha
alpha = 128, 256

[State 801, Pass Through]
type = PlayerPush
trigger1 = (var(22) >= 8) && (var(22) < 22)
value = 0

[State 801, 1]
type = PosAdd
trigger1 = var(22) = 8
x = ifelse((var(23) % 10) = 3, 4.5, ifelse(((var(23) % 10) = 2) || ((var(23) % 10) = 4), 2.25 * (2**(.5)), 0))
y = ifelse((var(23) % 10) = 1, -4.5, ifelse((var(23) % 10) = 5, 4.5, ifelse((var(23) % 10) = 2, -2.25 * (2**(.5)), ifelse((var(23) % 10) = 4, 2.25 * (2**(.5)), 0))))

[State 801, 2]
type = PosAdd
trigger1 = var(22) = 9
x = ifelse((var(23) % 10) = 3, 7.5, ifelse(((var(23) % 10) = 2) || ((var(23) % 10) = 4), 3.75 * (2**(.5)), 0))
y = ifelse((var(23) % 10) = 1, -7.5, ifelse((var(23) % 10) = 5, 7.5, ifelse((var(23) % 10) = 2, -3.75 * (2**(.5)), ifelse((var(23) % 10) = 4, 3.75 * (2**(.5)), 0))))

[State 801, 3]
type = PosAdd
trigger1 = var(22) = 10
x = ifelse((var(23) % 10) = 3, 10.5, ifelse(((var(23) % 10) = 2) || ((var(23) % 10) = 4), 5.25 * (2**(.5)), 0))
y = ifelse((var(23) % 10) = 1, -10.5, ifelse((var(23) % 10) = 5, 10.5, ifelse((var(23) % 10) = 2, -5.25 * (2**(.5)), ifelse((var(23) % 10) = 4, 5.25 * (2**(.5)), 0))))

[State 801, 4]
type = PosAdd
trigger1 = var(22) >= 11
trigger1 = var(22) < 22
x = ifelse((var(23) % 10) = 3, 13.5, ifelse(((var(23) % 10) = 2) || ((var(23) % 10) = 4), 6.75 * (2**(.5)), 0))
y = ifelse((var(23) % 10) = 1, -13.5, ifelse((var(23) % 10) = 5, 13.5, ifelse((var(23) % 10) = 2, -6.75 * (2**(.5)), ifelse((var(23) % 10) = 4, 6.75 * (2**(.5)), 0))))

[State 801, 11]
type = VelSet
trigger1 = var(22) = 22
x = 0
y = 0

[State 801, 11]
type = VelSet
triggerall = !var(0)
trigger1 = var(1) != 0
x = 0
y = 0

[State 801, BOFS 1]
type = ScreenBound
triggerall = (var(22) = 22) || (!var(0) && var(1) != 0)
trigger1 = 1;pos x = enemynear, pos x
trigger1 = 1;abs(pos x) = 145
value = 0
movecamera = 1,1

[State 801, Pass Through]
type = PlayerPush
trigger1 = (var(22) = 22) || (!var(0) && var(1) != 0)
value = 1

[State 801, BOFS 2]
type = PosAdd;Set
triggerall = (var(22) = 22) || (!var(0) && var(1) != 0)
trigger1 = pos x = enemynear, pos x
trigger1 = enemynear, FrontEdgeBodyDist = 0;abs(pos x) = 145
trigger2 = enemynear, BackEdgeBodyDist = 0;abs(pos x) > 145
x = 1; * 146

[State 801, BOFS 3]
type = PosAdd
triggerall = pos x = enemynear, pos x
triggerall = (var(22) = 22) || (!var(0) && var(1) != 0)
trigger1 = var(1) != 0
x = 1

[State 801, Stand1]
type = StateTypeSet
trigger1 = pos y >= 0
statetype = S

[State 801, Stand2]
type = VelSet
trigger1 = pos y >= 0
y = 0

[State 801, Stand3]
type = PosSet
trigger1 = pos y >= 0
y = 0

[State 801, Air]
type = StateTypeSet
trigger1 = pos y < 0
statetype = A

[State 801, Crouch if down shunpo land]
type = ChangeAnim
trigger1 = (var(22) >= 8) && (var(22) < 22)
trigger1 = (var(23) % 10) = 5
trigger1 = pos y >= 0
value = ifelse(var(42) = 1, 3900, 11)

[State 801, Crouch if downfwd shunpo land]
type = ChangeAnim
trigger1 = (var(22) >= 8) && (var(22) < 22)
trigger1 = (var(23) % 10) = 4
trigger1 = pos y >= 0
value = ifelse(var(42) = 1, 3910, 801)

[State 801, Shunpo Timer]
type = VarSet
trigger1 = 1
var(22) = var(22) + 1

[State 801, State Change]
type = ChangeState
trigger1 = !var(0)
trigger1 = var(1) != 0
trigger1 = 1 + (var(23) := 0)
value = var(1)
ctrl = ifelse((var(1) = 0), 1, 0)

[State 801, State Change]
type = ChangeState
trigger1 = var(22) = 29
trigger1 = 1 + (var(23) := 0)
value = 50 * (StateType = a)
ctrl = 1


;---------------------------------------------------------------------------
; Air Dash
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Air Dash Forward
[Statedef 855]
type    = A
physics = N
ctrl = 0
anim = 855
velset = 0,0
sprpriority = 2
;sysvar(1) = -1

[State 855, AI IAD Reset]
type = VarSet
trigger1 = time = 0
var(18) = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 855, 1]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(42) = 1
value = 3915

[State 855, Cancel to Guard]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
trigger1 = command = "holdz"
value = 120

[State 855, 3]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimElem = 2)
value = 856

;---------------------------------------------------------------------------
; Air Dash Forward
[Statedef 856]
type    = A
physics = N
ctrl = 0
velset = 4.5,0
sprpriority = 2

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 856, 1]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(42) = 1
value = 3910

[State 856, Sound]
type = PlaySnd
trigger1 = time = 0
value = 9,1

[State 856, Ctrl]
type = CtrlSet
trigger1 = time = 8
value = 1

[State 856, Air Dash Limit]
type = VarSet
trigger1 = Time = 0
var(49) = var(49) -1

[State 856, 3]
type = ChangeState
triggerall = !var(0)
trigger1 = Time < 8
trigger1 = var(1) != 0
value = var(1)

[State 856, 3]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 16, time = 16)
value = 50

;---------------------------------------------------------------------------
; Air Dash Back
[Statedef 857]
type    = A
physics = N
ctrl = 0
anim = 855
velset = 0,0
sprpriority = 2
;sysvar(1) = -1

[State 857, AI IAD Reset]
type = VarSet
trigger1 = time = 0
var(18) = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 857, 1]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(42) = 1
value = 3915

[State 857, Turn]
type = Turn
trigger1 = time = 0

[State 857, Cancel to Guard]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
trigger1 = command = "holdz"
value = 120

[State 857, 3]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimElem = 2)
value = 858

;---------------------------------------------------------------------------
; Air Dash Back
[Statedef 858]
type    = A
physics = N
ctrl = 0
velset = 4.5,0
sprpriority = 2

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 858, 1]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(42) = 1
value = 3910

[State 858, Sound]
type = PlaySnd
trigger1 = time = 0
value = 9,1

[State 856, Ctrl]
type = CtrlSet
trigger1 = time = 8
value = 1

[State 858, Air Dash Limit]
type = VarSet
trigger1 = Time = 0
var(49) = var(49) -1

[State 856, 3]
type = ChangeState
triggerall = !var(0)
trigger1 = Time < 8
trigger1 = var(1) != 0
value = var(1)

[State 858, 3]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 16, time = 16)
value = 50

;---------------------------------------------------------------------------
; Throws
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
;Normal Throw - Attempt
[Statedef 900]
type    = U
movetype= A
physics = U
juggle  = 0
ctrl = 0
anim = 900
sprpriority = 0

[State 900, Air Grab]
type = ChangeAnim
trigger1 = time = 0
trigger1 = statetype = A
value = 901

[State 900, Stop if grounded]
type = VelSet
trigger1 = time = 0
trigger1 = statetype = S
x = 0
y = 0

[State 900, Air Physics]
type = StateTypeSet
trigger1 = time = 0
trigger1 = statetype = A
physics = N

[State 900, Gravity]
type = VelAdd
trigger1 = pos y < 0
trigger1 = statetype = A
y = Const(movement.yaccel)

[State 900, Turn if holding back]
type = Turn
triggerall = time = 0
triggerall = StateType != A
trigger1 = !var(0)
trigger1 = command = "holdback"
trigger2 = var(0)
trigger2 = var(23) = 4 || (var(23) = 0 && command = "holdback")

[State 900, Standing HitDef]
type = HitDef
trigger1 = (AnimElem = 1, >=0) && (AnimElem = 5, < 0)
trigger1 = ifelse(var(20) > 0, ifelse((enemynear, id = var(35)), 0, 1), 1)
trigger1 = ifelse(var(21) > 0, ifelse((enemynear, id = var(36)), 0, 1), 1)
;trigger1 = ifelse(var(15) != 0, ifelse((enemynear, id = var(15)), 0, 1), 1)
;trigger1 = ifelse(var(17) != 0, ifelse((enemynear, id = var(17)), 0, 1), 1)
trigger1 = statetype != A
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
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face character
p1stateno = 910       ;On success, character changes to state 910
p2stateno = 920       ;If hit, p2 changes to state 920 in character's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
ground.velocity = 0, 0
fall = 0              ;Force p2 into falling down
hitonce = 0

[State 900, Air HitDef]
type = HitDef
trigger1 = (AnimElem = 1, >=0) && (AnimElem = 5, < 0)
trigger1 = ifelse(var(20) > 0, ifelse((enemynear, id = var(35)), 0, 1), 1)
trigger1 = ifelse(var(21) > 0, ifelse((enemynear, id = var(36)), 0, 1), 1)
;trigger1 = ifelse(var(15) != 0, ifelse((enemynear, id = var(15)), 0, 1), 1)
;trigger1 = ifelse(var(17) != 0, ifelse((enemynear, id = var(17)), 0, 1), 1)
trigger1 = statetype = A
attr = A, NT          ;Attributes: Standing, Normal Throw
hitflag = A-          ;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
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face character
p1stateno = 911       ;On success, character changes to state 910
p2stateno = 920       ;If hit, p2 changes to state 920 in character's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 900, Sound]
type = PlaySnd
trigger1 = AnimElem = 6
value = 2,10
channel = 0

[State 900, Land 1]
type = VelSet
trigger1 = pos y >= 0
trigger1 = statetype = A
x = 0
y = 0

[State 900, Land 2]
type = PosSet
trigger1 = pos y >= 0
trigger1 = statetype = A
y = 0

[State 900, Land 3]
type = StateTypeSet
trigger1 = pos y >= 0
trigger1 = statetype = A
statetype = S
physics = S

[State 900, Air Grab Land]
type = ChangeAnim
trigger1 = anim = 901
trigger1 = statetype = S
value = ifelse((AnimElem = 6, >= 0), 902, 900)
elem = ifelse((AnimElem = 6, >= 0), 1, AnimElemNo(0))

[State 900, 2]
type = ChangeState
trigger1 = anim != 902
trigger1 = AnimTime = 0
trigger2 = time = 35
value = ifelse(statetype = A, 50, 0)
ctrl = 1

;---------------------------------------------------------------------------
;Normal Throw - Throwing the opponent, standing
[Statedef 910]
type    = S
movetype= A
physics = S
anim = 910
velset = 0,0

[State 910, Throw teched Bind]
type = TargetBind
triggerall = time < 8
trigger1 = (target, command = "x") && (target, command = "y")
trigger2 = (target, command = "x") && (target, command = "b")
trigger3 = (target, command = "y") && (target, command = "b")
time = 1
pos = 56, 0

[State 910, Throw teched target facing]
type = TargetFacing
triggerall = time < 8
trigger1 = (target, command = "x") && (target, command = "y")
trigger2 = (target, command = "x") && (target, command = "b")
trigger3 = (target, command = "y") && (target, command = "b")
value = -1

[State 910, Throw teched]
type = ChangeState
triggerall = time < 8
trigger1 = (target, command = "x") && (target, command = "y")
trigger2 = (target, command = "x") && (target, command = "b")
trigger3 = (target, command = "y") && (target, command = "b")
value = 901

[State 910, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 910, holdfwd - Turn]
type = null;Turn
trigger1 = command = "holdback"
trigger1 = Time = 0

[State 910, holdfwd - Turn Target]
type = TargetFacing
trigger1 = Time = 0
value = -1

[State 910, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 7, >=0
trigger1 = AnimElem = 8, <0
anim = 921
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 910, Sword Trail,2]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 8, >=0
trigger1 = AnimElem = 9, <0
anim = 922
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 910, Sword Trail,3]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 9, >=0
trigger1 = AnimElem = 10, <0
anim = 923
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 910, Sword Trail,4]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 13, >=0
trigger1 = AnimElem = 14, <0
anim = 924
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 910, Sword Trail,5]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 14, >=0
trigger1 = AnimElem = 15, <0
anim = 925
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 910, Sword Trail,6]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 15, >=0
trigger1 = AnimElem = 16, <0
anim = 926
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 910, Sound]
type = PlaySnd
trigger1 = AnimElem = 7
value = 2,1
channel = 0

[State 910, Sound]
type = PlaySnd
trigger1 = AnimElem = 7
value = 3,4

[State 910, Sound]
type = PlaySnd
trigger1 = AnimElem = 13
value = 3,9

[State 910, Combo Counter]
type = HitAdd
trigger1 = AnimElem = 7
trigger2 = AnimElem = 13
value = numtarget

[State 910, Combo Counter]
type = VarSet
trigger1 = AnimElem = 7
trigger2 = AnimElem = 13
fvar(16) = fvar(16) + 1

[State 910, Throw Hitspark]
type = Explod
trigger1 = AnimElem = 7
anim = 980
ID = 50
pos = Floor(Const(size.xscale) * 48), Floor(Const(size.yscale) * -55)
postype = p1
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 910, Bind1]
type = TargetBind
trigger1 = AnimElem = 1
time = 37
pos = 48, 0

[State 910, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 7
trigger2 = AnimElem = 13
value = ifelse((AnimElem = 13), Floor(-12 * 49/50), -12)

[State 910, PowerAdd]
type = PowerAdd
trigger1 = AnimElem = 7
trigger2 = AnimElem = 13
value = ifelse((AnimElem = 13), Floor(60 * 49/50), 60)

[State 910, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = AnimElem = 7
trigger2 = AnimElem = 13
value = ifelse((AnimElem = 13), Floor(30 * 49/50), 30)

[State 910, Throw]
type = TargetState
trigger1 = AnimElem = 13
value = 921

[State 910, Offscreen]
type = ScreenBound
trigger1 = AnimElem = 13, >= 0
value = 0
movecamera = 0,0

[State 910, Throw Hitspark]
type = Explod
trigger1 = AnimElem = 13
anim = 974
ID = 50
pos = Floor(Const(size.xscale) * 48), Floor(Const(size.yscale) * -55)
postype = p1
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 910, Make Land Dust Effect1]
type = Helper
triggerall = AnimElem = 13
trigger1 = numtarget > 0
;trigger1 = target, id = var(35)
name = "Wired Dust Clouds"
ID = 925
pos = 0,0
postype = back
facing = 1
stateno = 925
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 910, Make Land Dust Effect2]
type = Helper
triggerall = AnimElem = 13
triggerall = numenemy = 2
triggerall = var(36) != 0
trigger1 = numtarget > 0
;trigger1 = target, id = var(36)
name = "Wired Dust Clouds"
ID = 926
pos = 0,0
postype = back
facing = 1
stateno = 926
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 910, Opponent chasing time]
type = ChangeState
triggerall = AnimTime = 0
triggerall = abs(enemynear, pos x - pos x) > 220 || (ScreenPos x <= 0) || (ScreenPos x >= GameWidth)
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = numtarget > 0
trigger2 = ifelse((target, id = var(36)), !(playerID(var(35)), alive), 1)
trigger2 = ifelse((target, id = var(35)), !(playerID(var(36)), alive), 1)
value = 101

[State 910, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Normal Throw - Throwing the opponent, aerial
[Statedef 911]
type    = A
movetype= A
physics = N
anim = 911
velset = 0,0

[State 911, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 911, Throw teched Bind]
type = TargetBind
triggerall = time < 8
trigger1 = (target, command = "x") && (target, command = "y")
trigger2 = (target, command = "x") && (target, command = "b")
trigger3 = (target, command = "y") && (target, command = "b")
time = 1
pos = 48, 0

[State 911, Throw teched target facing]
type = TargetFacing
triggerall = time < 8
trigger1 = (target, command = "x") && (target, command = "y")
trigger2 = (target, command = "x") && (target, command = "b")
trigger3 = (target, command = "y") && (target, command = "b")
value = -1

[State 911, Throw teched]
type = ChangeState
triggerall = time < 8
trigger1 = (target, command = "x") && (target, command = "y")
trigger2 = (target, command = "x") && (target, command = "b")
trigger3 = (target, command = "y") && (target, command = "b")
value = 903

[State 911, holdfwd - Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = Time = 0

[State 911, holdfwd - Turn Target]
type = TargetFacing
trigger1 = Time = 0
value = -1

[State 911, Sword Trail,1]
type = Explod
triggerall = var(42) != 1
trigger1 = AnimElem = 3, >=0
trigger1 = AnimElem = 4, <0
anim = 927
ID = 900
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
removetime = 1
supermovetime = 0
pausemovetime = 0
scale = Const(size.xscale), Const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
ignorehitpause = 0
trans = addalpha
alpha = 256,128

[State 911, Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2,1
channel = 0

[State 911, Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3,9

[State 911, Combo Counter]
type = HitAdd
trigger1 = AnimElem = 3
value = numtarget

[State 911, Throw Hitspark]
type = Explod
trigger1 = AnimElem = 3
anim = 982
ID = 50
pos = Floor(Const(size.xscale) * 44), Floor(Const(size.yscale) * -40)
postype = p1
facing = 1
vfacing = 1
bindtime = 1
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 911, Bind1]
type = TargetBind
trigger1 = AnimElem = 1
time = 14
pos = 48, 0

[State 911, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 3
value = -32

[State 911, PowerAdd]
type = PowerAdd
trigger1 = AnimElem = 3
value = 160

[State 911, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = AnimElem = 3
value = 80

[State 911, Throw]
type = TargetState
trigger1 = AnimElem = 3
value = 930

[State 911, Make Land Dust Effect1]
type = Helper
triggerall = numhelper(936) = 0
triggerall = AnimElem = 3
trigger1 = numtarget > 0
;trigger1 = target, id = var(35)
name = "Spiked Dust Clouds"
ID = 936
pos = 0,0
postype = back
facing = 1
stateno = 936
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 911, Make Land Dust Effect2]
type = Helper
triggerall = numhelper(937) = 0
triggerall = AnimElem = 3
triggerall = numenemy = 2
triggerall = var(36) != 0
trigger1 = numtarget > 0
;trigger1 = target, id = var(36)
name = "Spiked Dust Clouds"
ID = 937
pos = 0,0
postype = back
facing = 1
stateno = 937
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State 911, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Bankai Super Armor
[Statedef 3900]
type = U
movetype = I
physics = U
hitdefpersist = 1

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

[State 3900, VarSet]
type = VarSet
trigger1 = GetHitVar(hitshaketime) > var(44)
var(44) = GetHitVar(hitshaketime)

[State 3900, Freeze Anim]
type = ChangeAnim
trigger1 = fvar(26) = 0
value = anim
elem = AnimElemNo(-1)

[State 3900, Freeze Anim]
type = VarSet
trigger1 = fvar(26) = 0
fvar(38) = fvar(38) + (GetHitVar(damage) * 2.5)

[State 3900, Damage Rune Charge]
type = VarSet
trigger1 = fvar(26) = 0
trigger1 = fvar(26) := 1
fvar(25) = fvar(25) + (GetHitVar(damage) / 4.0)
ignorehitpause = 1

[State 3900, Damage]
type = LifeAdd
trigger1 = 1
value = -GetHitVar(damage)
absolute = 1
ignorehitpause = 1

[State 3900, Dead lol]
type = PosSet
trigger1 = !alive
trigger1 = statetype != A
y = -1
ignorehitpause = 1

[State 3900, Dead lol]
type = VelSet
trigger1 = !alive
x = -4
y = -8
ignorehitpause = 1

[State 3900, Dead lol]
type = StateTypeSet
trigger1 = !alive
trigger1 = vel y < 0
statetype = A
movetype = H
physics = A
ignorehitpause = 1

[State 3900, Dead lol]
type = ChangeState
trigger1 = !alive
trigger1 = vel y < 0
trigger1 = (var(42) := 0) || 1
value = 5030
ignorehitpause = 1

[State 3900, Red Flash]
type = PalFX
trigger1 = 1
time = 1
add = 0, 0, 0
mul = 256,0,0
ignorehitpause = 1

[State 3900, PosFreeze]
type = PosFreeze
trigger1 = alive
value = 1

[State 3900, Change State]
type = Changestate
triggerall = time = var(44)
trigger1 = var(43) = 0
trigger1 = (var(44) := 0) || 1
trigger1 = (fvar(26) := 0) || 1
value = var(43)
ctrl = 1

[State 3900, Change State]
type = Changestate
triggerall = time = var(44)
trigger1 = (var(44) := 0) || 1
trigger1 = (fvar(26) := 0) || 1
value = var(43)

;---------------------------------------------------------------------------
; Projectiles
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; AI Helper Stuff
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; AI Activation Helper State - Primary Version
; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.)
; (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(58) - 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 = 5050

[State 9741, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = 2

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

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

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

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(58)
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(58) = var(4):=0

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
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(58) = 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(58) = -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(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2


;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick 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.
; var(10)- Buffered dir detection disabler.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(58) - 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 = 5050

[State 9742, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = var(3):=2

[State 9742, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(1)
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, BufferCheck]
type = VarSet
trigger1 = var(3) || var(4) || var(10)
var(10) = var(6)

[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(6)
trigger1 = !(var(9) || var(10))
var(58) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(58)
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(58) = 0

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

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !(var(2) || 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(58) = -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(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2

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

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

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

;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 0, Reset MoveHit]
type = MoveHitReset
trigger1 = time = 0
trigger1 = var(42) != 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != ifelse(var(42) = 1, 3900, 0) && Anim != ifelse(var(42) = 1, 3905, 5)
trigger2 = Anim = ifelse(var(42) = 1, 3905, 5) && AnimTime = 0 ;Turn anim over
value = ifelse(var(42) = 1, 3900, 0)

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

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

[State 0, Turn animation: One Opponent]
type = ChangeAnim
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)
value = ifelse(var(42) = 1, 3905, 5)

[State 0, Turn animation: Two Opponents-One Dead]
type = ChangeAnim
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
triggerall = (playerID(var(35)), alive) || (playerID(var(36)), alive)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)
value = ifelse(var(42) = 1, 3905, 5)

[State 0, Auto turn: One Opponent]
type = Turn
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 0, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
triggerall = (playerID(var(35)), alive) || (playerID(var(36)), alive)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = 10
ctrl = 1
sprpriority = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 10, 1]
type = ChangeAnim
trigger1 = var(42) = 1
value = 3900

[State 10, 1]
type = StateTypeSet
trigger1 = var(42) = 1
statetype = S
physics = S

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = 0

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 0, Turn animation: One Opponent]
type = ChangeAnim
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)
value = ifelse(var(42) = 1, 3905, 6)

[State 0, Turn animation: Two Opponents-One Dead]
type = ChangeAnim
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
triggerall = (playerID(var(35)), alive) || (playerID(var(36)), alive)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)
value = ifelse(var(42) = 1, 3905, 6)

[State 11, Auto turn: One Opponent]
type = Turn
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 11, Auto turn: Two Opponents-One Dead]
type = Turn
triggerall = (command != "holdfwd" && command != "holdback")
triggerall = (prevstateno  != [5000, 5019]) || time > 0
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
triggerall = (playerID(var(35)), alive) || (playerID(var(36)), alive)
trigger1 = !(playerID(var(35)), alive)
trigger1 = ifelse((facing = -1), pos x < (playerID(var(36)), pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (playerID(var(36)), pos x), 1)
trigger2 = !(playerID(var(36)), alive)
trigger2 = ifelse((facing = -1), pos x < (playerID(var(35)), pos x), 1)
trigger2 = ifelse((facing = 1), pos x > (playerID(var(35)), pos x), 1)

[State 11, Turn controls]
type = Turn
trigger1 = (command = "holdback")

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = ifelse(var(42) = 1, 3905, 6) && AnimTime = 0
value = ifelse(var(42) = 1, 3900, 11)

[State 11, 1]
type = StateTypeSet
trigger1 = var(42) = 1
statetype = S
physics = S

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12
ctrl = 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 12, 1]
type = ChangeAnim
trigger1 = var(42) = 1
value = 3900

[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

;[State 20, Walk Back to Shunpo Fix]
;type = VarSet
;trigger1 = time = 0
;trigger1 = command = "holdback"
;var(37) = 1

[State 20, Anim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = command = "holdback"
value = 5

[State 20, Turn]
type = Turn
trigger1 = time = 0
trigger1 = command = "holdback"

[State 20, No Autoturn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
ignorehitpause = 1

[State 20, Sound]
type = PlaySnd
trigger1 = var(42) != 1
trigger1 = Anim != 5
trigger1 = (AnimElem = 2) || (AnimElem = 4)
value = 9,5

[State 20, Anim]
type = ChangeAnim
;triggerall = vel x > 0
trigger1 = Anim != ifelse(var(42) = 1, 3900, 20) && Anim != ifelse(var(42) = 1, 3905, 5)
trigger2 = Anim = ifelse(var(42) = 1, 3905, 5) && AnimTime = 0
value = ifelse(var(42) = 1, 3900, 20)

;[State 20, 4]
;type = ChangeAnim
;triggerall = vel x < 0
;trigger1 = Anim != 21 && Anim != 5
;trigger2 = Anim = 5 && AnimTime = 0
;value = 21

[State 20, Velset]
type = VelSet
trigger1 = anim = 20
;trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

;[State 20, 2]
;type = VelSet
;trigger1 = command = "holdback"
;x = const(velocity.walk.back.x)

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 40, 1]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(42) = 1
value = 3900

[State 40, Double Jump Land Reset]
type = VarSet
trigger1 = time = 0
var(48) = 1 ; Double Jump

[State 40, Air Dash Land Reset]
type = VarSet
trigger1 = time = 0
var(49) = 2 ; Air Dash

;[State 40, Reverse Jump Anim]
;type = ChangeAnim
;trigger1 = Time = 0
;trigger1 = Anim = 40
;trigger1 = command = "holdback"
;value = 854

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet ; Jump diagonal
triggerall = Time = 0
trigger1 = !var(0)
trigger1 = command = "holdfwd" || command = "holdback"
trigger2 = var(0)
trigger2 = var(23) = 4 || var(23) = 6 || (var(23) = 0 && (command = "holdfwd" || command = "holdback"))
sysvar(1) = 1

[State 40, Turn]
type = Turn ; Turn jump
triggerall = time <= 1
trigger1 = !var(0)
trigger1 = command = "holdback"
trigger2 = var(0)
trigger2 = var(23) = 4 || (var(23) = 0 && command = "holdback")

[State 40, Cancel to Shunpo]
type = ChangeState
triggerall = !var(0)
trigger1 = command = "a"
trigger1 = var(13) >= 1
value = 800

[State 40, Sound]
type = PlaySnd
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
value = 9,2

[State 40, Cancel to Guard]
type = ChangeState
triggerall = !var(0)
triggerall = var(42) != 1
trigger1 = AnimTime = 0
trigger1 = command = "holdz"
value = 120

[State 40, 4]
type = VelSet
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = VelSet
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
trigger1 = prevstateno = 105 ;RUN_BACK
trigger1 = sysvar(1) = -1
x = const(velocity.runjump.back.x)

[State 40, 7]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
value = 50

;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
anim = 40
ctrl = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 45, 1]
type = ChangeAnim
trigger1 = var(42) = 1
value = 3900

[State 45, Double Jump Limit]
type = ChangeState
trigger1 = time = 0
trigger1 = var(48) = 0
value = 50
ctrl = 1

[State 45, Sound]
type = PlaySnd
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
value = 9,2

;[State 45, Reverse Jump Anim]
;type = ChangeAnim
;trigger1 = Time = 0
;trigger1 = Anim = 40
;trigger1 = command = "holdback"
;value = 854

[State 45, 5]
type = VelSet
trigger1 = var(48) > 0
trigger1 = time = 0
x = 0
y = 0

[State 45, 1]
type = VarSet
trigger1 = Time = 0
var(48) = var(48) - 1

[State 45, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 2]
type = VarSet ; Jump diagonal
triggerall = Time = 0
trigger1 = !var(0)
trigger1 = command = "holdfwd" || command = "holdback"
trigger2 = var(0)
trigger2 = var(23) = 4 || var(23) = 6 || (var(23) = 0 && (command = "holdfwd" || command = "holdback"))
sysvar(1) = 1

[State 45, Turn]
type = Turn ; Turn jump
triggerall = time = 0
trigger1 = !var(0)
trigger1 = command = "holdback"
trigger2 = var(0)
trigger2 = var(23) = 4 || (var(23) = 0 && command = "holdback")

[State 45, 4]
type = VelSet
trigger1 =ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State 45, 5]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 6, AnimTime = 0)
value = 50

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = N;A
ctrl = 1 ; 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 50, 1]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 50, Turn]
type = Turn
trigger1 = time = 0
trigger1 = (prevstateno = 40) || (prevstateno = 45)
trigger1 = vel x < 0

[State 50, Hold Back blocking lawl wut]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
triggerall = statetype = A
triggerall = InGuardDist
triggerall = var(16) >= 5
triggerall = command = "holdfwd"
trigger1 = ifelse(facing = -1, (pos x < playerID(var(35)), pos x), (pos x > playerID(var(35)), pos x))
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = ifelse(!(playerID(var(35)), alive), ifelse(facing = -1, (pos x < playerID(var(36)), pos x), (pos x > playerID(var(36)), pos x)), 0)
trigger3 = numenemy = 2
trigger3 = (var(35) != 0) && (var(36) != 0)
trigger3 = ifelse(!(playerID(var(36)), alive), ifelse(facing = -1, (pos x < playerID(var(35)), pos x), (pos x > playerID(var(35)), pos x)), 0)
value = 120

[State 50, Hold Back blocking lawl wut]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
triggerall = statetype = A
triggerall = InGuardDist
triggerall = var(16) >= 5
triggerall = command = "holdback"
trigger1 = ifelse(facing = -1, (pos x > playerID(var(35)), pos x), (pos x < playerID(var(35)), pos x))
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = ifelse(!(playerID(var(35)), alive), ifelse(facing = -1, (pos x > playerID(var(36)), pos x), (pos x < playerID(var(36)), pos x)), 0)
trigger3 = numenemy = 2
trigger3 = (var(35) != 0) && (var(36) != 0)
trigger3 = ifelse(!(playerID(var(36)), alive), ifelse(facing = -1, (pos x > playerID(var(35)), pos x), (pos x < playerID(var(35)), pos x)), 0)
value = 120

[State 50, 1]
type = CtrlSet
trigger1 = (prevstateno = 40) || (prevstateno = 45)
trigger1 = time = 2
trigger2 = !((prevstateno = 40) || (prevstateno = 45))
value = 1

[State 50, 1]
type = VarSet
trigger1 = Time = 0
trigger1 = 1 || var(23) := 0
sysvar(1) = 0

;[State 50, 2]
;type = ChangeAnim
;trigger1 = Time = 0
;value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))
;value = ifelse((vel x)=0, 41, ifelse((vel x)>0 || prevstateno = 5050, 42, 43))

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse(var(42) = 1, 3910, ifelse((vel x)>0, 42, 41))
;value = ifelse((vel x)=0, 41, ifelse((vel x)>0 || prevstateno = 5050, 42, 43))

;[State 50, Combo Into New Move]
;type = ChangeState
;trigger1 = time >= 4
;trigger1 = ctrl
;trigger1 = (var(2) = 600) || (var(2) = 610) || (var(2) = 620)
;value = var(2) + (Vel x < 0)

;[State 50, Combo Into New Move2]
;type = ChangeState
;trigger1 = time >= 4
;trigger1 = ctrl
;trigger1 = var(2) = [802,803]
;trigger1 = var(13) > 0
;value = var(2)

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = ifelse(var(42) = 1, 1, SelfAnimExist(anim + 3))
persistent = 0
value = ifelse(var(42) = 1, 3915, Anim + 3)

[State 50, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State 51, after air guard]
type = ChangeState
trigger1 = prevstateno = 140
value = 50

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 1
anim = 47

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 52, 1]
type = ChangeAnim
trigger1 = var(42) = 1
value = 3900

[State 52, Dust1]
type = Explod
trigger1 = time = 0
anim = 949
ID = 949
pos = -28 + (random%5 - 2), 10
postype = p1
facing = 1
bindtime = 1
vel = 0, -(((random%11)-5) / 20.0 + 1)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1, 1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 52, Dust2]
type = Explod
trigger1 = time = 0
anim = 949
ID = 949
pos = -14 + (random%5 - 2), 10
postype = p1
facing = 1
bindtime = 1
vel = 0, -(((random%11)-5) / 20.0 + 1)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1, 1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 52, Dust3]
type = Explod
trigger1 = time = 0
anim = 949
ID = 949
pos = (random%5 - 2), 10
postype = p1
facing = 1
bindtime = 1
vel = 0, -(((random%11)-5) / 20.0 + 1)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1, 1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 52, Dust4]
type = Explod
trigger1 = time = 0
anim = 949
ID = 949
pos = 14 + (random%5 - 2), 10
postype = p1
facing = 1
bindtime = 1
vel = 0, -(((random%11)-5) / 20.0 + 1)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1, 1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 52, Dust5]
type = Explod
trigger1 = time = 0
anim = 949
ID = 949
pos = 28 + (random%5 - 2), 10
postype = p1
facing = 1
bindtime = 1
vel = 0, -(((random%11)-5) / 20.0 + 1)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1, 1
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0
x = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

;[State 52, 3]
;type = CtrlSet
;trigger1 = Time = 1
;value = 1

[State 52, Run]
type = ChangeState
triggerall = !var(0)
trigger1 = time = 0
trigger1 = var(1) = [100,105]
trigger1 = 1 + (var(1):= 0)
value = var(1)

[State 52, 4]
type = ChangeState
trigger1 = ifelse(var(42) = 1, var(41) = 4, AnimTime = 0)
value = 0
;ctrl = 1

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State -3, Bankai "time" reset]
type = VarSet
trigger1 = var(42) = 1
trigger1 = prevstateno != (3900)
trigger1 = time = 0
var(41) = 0

[State 100, 1]
type = ChangeAnim
trigger1 = var(42) = 1
value = 3910

[State 100, 1]
type = StateTypeSet
trigger1 = var(42) = 1
physics = N

[State 100, Turn]
type = Turn
triggerall = prevstateno != 101
triggerall = time = 0
trigger1 = facing = 1
trigger1 = !(fvar(9) >= 61)
trigger1 = fvar(10) >= 61
trigger2 = facing = -1
trigger2 = fvar(9) >= 61
trigger2 = !(fvar(10) >= 61)

[State -1, Standing Turn for AI]
type = Turn
triggerall = var(0)
triggerall = time = 0
trigger1 = numenemy = 1
trigger1 = ifelse((facing = -1), pos x < (enemynear, pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (enemynear, pos x), 1)
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = (playerID(var(35)), alive) && (playerID(var(36)), alive)
trigger2 = facing = 1
trigger2 = pos x > (PlayerID(var(35)), pos x)
trigger2 = pos x > (PlayerID(var(36)), pos x)
trigger3 = numenemy = 2
trigger3 = (var(35) != 0) && (var(36) != 0)
trigger3 = (playerID(var(35)), alive) && (playerID(var(36)), alive)
trigger3 = facing = -1
trigger3 = pos x < (PlayerID(var(35)), pos x)
trigger3 = pos x < (PlayerID(var(36)), pos x)

[State 100, Hold Back blocking lawl wut]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
triggerall = statetype != A
triggerall = InGuardDist
triggerall = var(16) >= 5
triggerall = command = "holdfwd"
trigger1 = ifelse(facing = -1, (pos x < playerID(var(35)), pos x), (pos x > playerID(var(35)), pos x))
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = ifelse(!(playerID(var(35)), alive), ifelse(facing = -1, (pos x < playerID(var(36)), pos x), (pos x > playerID(var(36)), pos x)), 0)
trigger3 = numenemy = 2
trigger3 = (var(35) != 0) && (var(36) != 0)
trigger3 = ifelse(!(playerID(var(36)), alive), ifelse(facing = -1, (pos x < playerID(var(35)), pos x), (pos x > playerID(var(35)), pos x)), 0)
value = 120

[State 100, Hold Back blocking lawl wut]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
triggerall = statetype != A
triggerall = InGuardDist
triggerall = var(16) >= 5
triggerall = command = "holdback"
trigger1 = ifelse(facing = -1, (pos x > playerID(var(35)), pos x), (pos x < playerID(var(35)), pos x))
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = ifelse(!(playerID(var(35)), alive), ifelse(facing = -1, (pos x > playerID(var(36)), pos x), (pos x < playerID(var(36)), pos x)), 0)
trigger3 = numenemy = 2
trigger3 = (var(35) != 0) && (var(36) != 0)
trigger3 = ifelse(!(playerID(var(36)), alive), ifelse(facing = -1, (pos x > playerID(var(35)), pos x), (pos x < playerID(var(35)), pos x)), 0)
value = 120

[State 100, Sound]
type = PlaySnd
trigger1 = var(42) != 1
trigger1 = time % 10 = 0 ; AnimElem = 1, = 0 || AnimTime = 0
trigger2 = var(42) = 1
trigger2 = time = 0
value = 9, ifelse(var(42) = 1, 8, 6)

[State 100, Dust]
type = Explod
triggerall = var(42) = 1
trigger1 = var(41) % 4 = 0 ; AnimElem = 1, = 0 || AnimTime = 0; RF/Shunpo Gauge, P1
trigger1 = 1 || (var(19) := Floor(((random%9) / 25.0 + 1) * 300))
anim = 949
ID = 949
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
vel = -4, ((random%5 - 2) * .2)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = var(19) / 100.0, var(19) / 100.0
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 100, Dust]
type = Explod
triggerall = var(42) != 1
trigger1 = (AnimElem = 1) || (AnimTime = 0)
trigger1 = 1 || (var(19) := Floor(((random%9) / 25.0 + 1) * 100))
trigger2 = (AnimElem = 5)
trigger2 = 1 || (var(19) := Floor(((random%9) / 25.0 + 1) * 100))
anim = 949
ID = 949
pos = 0, 0
postype = p1
facing = 1
bindtime = 1
vel = -4, ((random%5 - 2) * .2)
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = var(19) / 100.0, var(19) / 100.0
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 100, 1]
type = VelSet
trigger1 = var(42) != 1
x = const(velocity.run.fwd.x)
y = 0

[State 100, 1]
type = VelAdd
trigger1 = var(42) = 1
x = -.75

[State 100, 1]
type = VelSet
trigger1 = var(42) = 1
trigger1 = time = 0
x = 16
y = 0

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk
ignorehitpause = 1

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
ignorehitpause = 1

[State 100, 4]
type = ChangeState
triggerall = !var(0)
trigger1 = var(42) != 1
trigger1 = command != "holdfwd"
trigger1 = time > 29
trigger2 = var(1) != 0
value = var(1)
ctrl = 1

[State 100, 4]
type = ChangeState
triggerall = !var(0)
triggerall = var(42) = 1
trigger1 = var(41) > 21
value = var(1)
ctrl = 1

[State 100, 4]
type = ChangeState
triggerall = var(0)
triggerall = var(42) = 1
trigger1 = var(41) > 21
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State 105, Turn]
type = Turn
trigger1 = time = 0

[State 105, 4]
type = ChangeState
trigger1 = 1
value = 100
ctrl = 1

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

[Statedef -2]

;---------------------------------------------------------------------------
; Statedef -2 AI Stuff
; 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(58) > 0 && !IsHelper
trigger1 = RoundState != 2
trigger2 = !Alive
var(58) = -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(58)>0", and letting you make moves usable only
; by humans by using "!var(0)" instead of "var(58)<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
triggerall = !IsHelper
trigger1 = var(58) = 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


;---------------------------------------------------------------------------
; Stage Center Helper
[State -2, Stage Center Helper]
type = Helper
trigger1 = numhelper(456) = 0
name = "Stage Center Helper"
ID = 456
pos = 160,-120;-99999
postype = back
facing = 1
stateno = 990
keyctrl = 0
ownpal = 1
supermovetime = 2147483647
pausemovetime = 2147483647
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

;---------------------------------------------------------------------------
; Ceiling Helper
[State -2, Ceiling Helper]
type = Helper
trigger1 = numhelper(789) = 0
name = "Ceiling Helper"
ID = 789
pos = 160,-150
postype = back
facing = 1
stateno = 995
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

[State -2, Ceiling Y Axis]
type = VarSet
trigger1 = 1
fvar(22) = helper(789), pos y

[State -2, Hit Ceiling]
type = PosSet
trigger1 = numhelper(789) > 0
;trigger1 = helper(789), anim = 960
trigger1 = pos y - Const(size.height) < fvar(22)
y = fvar(22) + Const(size.height)
ignorehitpause = 1

;---------------------------------------------------------------------------
; Low Health Damage Reduction
[State -2, Low Health Damage Reduction]
type = DefenceMulSet
trigger1 = 1
value = (.0005*life + .5);**(-1)

;---------------------------------------------------------------------------
; Scaling fix, if you want
[State -2, xscale]
type = VarSet
trigger1 = 1
fvar(23) = Const(size.xscale)

[State -2, xscale]
type = VarSet
trigger1 = 1
fvar(24) = Const(size.yscale)

;---------------------------------------------------------------------------
; Enemy IDs get
[State -2, Enemy 1 Reset]
type = VarSet
trigger1 = GameTime = 0
var(35) = 0

[State -2, Enemy 2 Reset]
type = VarSet
trigger1 = GameTime = 0
var(36) = 0

[State -2, Enemy 1]
type = VarSet
trigger1 = var(35) = 0
var(35) = enemy(0), id

[State -2, Enemy 2]
type = VarSet
trigger1 = numenemy = 2
trigger1 = var(36) = 0
var(36) = enemy(1), id

;---------------------------------------------------------------------------
; Guard Cancel Helper
[State -2, Make Guard Cancel Helper]
type = Helper
trigger1 = prevstateno = [150,155]
trigger1 = (stateno = [1000,4999])
trigger1 = time = 1
trigger1 = NumHelper(150) < 1
name = "Guard Cancel"
ID = 150
pos = Floor(Const(size.xscale) * Const(size.mid.pos.x)), Floor(Const(size.yscale) * Const(size.mid.pos.y))
postype = p1
facing = 1
stateno = 960
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = Const(size.xscale)
size.yscale = Const(size.yscale)
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
size.height = 0
size.head.pos = 0,0
size.mid.pos = 0,0
size.shadowoffset = 0

;---------------------------------------------------------------------------
; Damage Cancel Stuff
; Damage Cancel Check to make sure the enemy isn't in a Super
[State -2, Damage Cancel Check 1]
type = VarSet
trigger1 = movetype != H
var(14) = 1

; Damage Cancel Check to make sure the enemy isn't in a Super
[State -2, Damage Cancel Check 3]
type = VarSet
trigger1 = (NumEnemy = 1) && !(playerID(var(35)), HitDefAttr = SCA, HA, HT, HP) ;stateno = [3000,4999])
trigger1 = (stateno = 5000) || (stateno = 5010) || (stateno = 5020) || (stateno = 5030) || (stateno = 5080)
trigger1 = time > 1
trigger2 = (NumEnemy > 1)
trigger2 = var(36) != 0
trigger2 = !(playerID(var(35)), HitDefAttr = SCA, HA, HT, HP) && !(playerID(var(36)), HitDefAttr = SCA, HA, HT, HP) ;stateno = [3000,4999])
trigger2 = (stateno = 5000) || (stateno = 5010) || (stateno = 5020) || (stateno = 5030) || (stateno = 5080)
trigger2 = time > 1
var(14) = 1

; Damage Cancel Check to make sure the enemy isn't in a Super
[State -2, Damage Cancel Check 2]
type = VarSet
trigger1 = (NumEnemy = 1) && ((playerID(var(35)), HitDefAttr = SCA, HA, HT, HP) || (playerID(var(35)), stateno = [3000,4999]))
trigger1 = movetype = H
trigger1 = !HitOver
trigger2 = (NumEnemy > 1)
trigger2 = var(36) != 0
trigger2 = ((playerID(var(35)), HitDefAttr = SCA, HA, HT, HP) || (playerID(var(35)), stateno = [3000,4999])) || ((playerID(var(36)), HitDefAttr = SCA, HA, HT, HP) || (playerID(var(36)), stateno = [3000,4999]))
trigger2 = movetype = H
trigger2 = !HitOver
var(14) = 0

;---------------------------------------------------------------------------
; Shortcut Limiters
; Shortcut 1 Limiter
[State -2, Shortcut 1 Limiter]
type = VarSet
trigger1 = (var(45) + 120) <= var(33)
var(45) = 0
ignorehitpause = 1

; Shortcut 2 Limiter
[State -2, Shortcut 2 Limiter]
type = VarSet
trigger1 = (var(46) + 120) <= var(33)
var(46) = 0
ignorehitpause = 1

; Shortcut 3 Limiter
[State -2, Shortcut 3 Limiter]
type = VarSet
trigger1 = (var(47) + 120) <= var(33)
var(47) = 0
ignorehitpause = 1

;---------------------------------------------------------------------------
; Gives bar when Fireballs hit
[State -2, Fireball PowerAdd] ; use multiple if different damage
type = PowerAdd
triggerall = fvar(20) = -1
trigger1 = NumHelper(20) > 0 ; Put helper id here
trigger1 = ((helper(20), MoveHit) = 1)
value = Floor(ifelse(fvar(16) < 50, 8 * (1 - (3 * (fvar(16)/200))), 8 / 4)) * 20

;---------------------------------------------------------------------------
; Damage Scaling
; Normal Damage scaling lawl
[State -2, Normals Scaling Reset]
type = VarSet
trigger1 = NumEnemy = 1
trigger1 = Enemy, movetype != H
trigger2 = NumEnemy = 2
trigger2 = ifelse((PlayerID(var(35)), alive), (PlayerID(var(35)), movetype != H), 1)
trigger2 = ifelse((PlayerID(var(36)), alive), (PlayerID(var(36)), movetype != H), 1)
fvar(15) = 0

[State -2, Normals Scaling]
type = VarSet
triggerall = var(42) != 1
trigger1 = stateno = [200, 799]
trigger1 = MoveHit = 1
fvar(15) = fvar(15) + 1;numtarget

; Special Damage scaling lawl
[State -2, Specials Scaling Reset]
type = VarSet
trigger1 = NumEnemy = 1
trigger1 = Enemy, movetype != H
trigger2 = NumEnemy = 2
trigger2 = ifelse((PlayerID(var(35)), alive), (PlayerID(var(35)), movetype != H), 1)
trigger2 = ifelse((PlayerID(var(36)), alive), (PlayerID(var(36)), movetype != H), 1)
fvar(16) = 0

[State -2, Specials Scaling]
type = VarSet
trigger1 = stateno = [1000, 2999]
trigger1 = MoveHit = 1
fvar(16) = fvar(16) + 1;numtarget

; Super Damage scaling lawl
[State -2, Supers Scaling Reset]
type = VarSet
trigger1 = NumEnemy = 1
trigger1 = Enemy, movetype != H
trigger2 = NumEnemy = 2
trigger2 = ifelse((PlayerID(var(35)), alive), (PlayerID(var(35)), movetype != H), 1)
trigger2 = ifelse((PlayerID(var(36)), alive), (PlayerID(var(36)), movetype != H), 1)
fvar(17) = 0

[State -2, Supers Scaling]
type = VarSet
trigger1 = stateno = [3000, 4999]
trigger1 = MoveHit = 1
trigger2 = var(42) = 1
trigger2 = stateno = [200, 799]
trigger2 = MoveHit = 1
fvar(17) = fvar(17) + 1;numtarget

; Ensures fireballs don't fire the above code every tick of a super pause
[State 3100, Superpause Time]
type = VarSet
trigger1 = fvar(20) > -1
fvar(20) = fvar(20) - 1

;---------------------------------------------------------------------------
; RF/Shunpo Control
[State -2, RF New Round Reset]
type = VarSet
trigger1 = RoundState < 2
trigger2 = var(33) < 2
var(11) = 3

[State -2, Shunpo New Round Reset]
type = VarSet
trigger1 = RoundState < 2
trigger2 = var(33) < 2
var(13) = 3

[State -2, RF Recovery]
type = VarSet
triggerall = alive
trigger1 = var(11) < 3
var(10) = var(10) + 1

[State -2, RF Stock1]
type = VarSet
trigger1 = var(10) >= 600
trigger1 = var(11) < 3
trigger1 = 1 || (var(10) := var(10) - 600)
var(11) = var(11) + 1

[State -2, RF Stock3]
type = VarSet
trigger1 = var(11) = 3
trigger1 = var(10) != 0
var(10) = 0

[State -2, Shunpo Recovery1]
type = VarSet
triggerall = alive
trigger1 = var(13) < var(11)
fvar(14) = fvar(14) + ifelse(((StateNo = [0,199]) && (StateNo != [40,52]) && (StateNo != [120,140]) && (StateNo != 195)) || movetype = H, 10, 1.25)

[State -2, Shunpo Recovery2]
type = Null;VarSet
triggerall = alive
triggerall = fvar(14) < 600
triggerall = var(13) < var(11)
triggerall = movetype != H
;trigger1 = (StateNo = [40,52]) || (StateNo = [120,140]) || ((StateNo = [200,4999]) && (StateNo != [800,803]) && movetype != H)
trigger1 = (StateNo = [40,52]) || (StateNo = [120,140]) || (StateNo = [200,4999])
fvar(14) = fvar(14) + 1.25

[State -2, Shunpo Stock1]
type = VarSet
trigger1 = fvar(14) >= 600
trigger1 = var(13) < var(11)
trigger1 = 1 || (fvar(14) := fvar(14) - 600)
var(13) = var(13) + 1

[State -2, Shunpo Stock3]
type = VarSet
trigger1 = var(13) >= var(11)
trigger1 = fvar(14) != 0
fvar(14) = 0

[State -2, Shunpo Stock4]
type = VarSet
trigger1 = var(13) > var(11)
var(13) = var(11)

;---------------------------------------------------------------------------
[State -2, Land Noise Reset]
type = VarSet
trigger1 = movetype = H
var(26) = 0

;---------------------------------------------------------------------------
[State -2, Normals Multiplier]
type = VarSet
trigger1 = 1
fvar(1) = (1 - (3 * (fvar(15)/32)))

[State -2, Specials Multiplier]
type = VarSet
trigger1 = 1
fvar(2) = (1 - (3 * (fvar(16)/200)))

[State -2, Supers Multiplier]
type = VarSet
trigger1 = 1
fvar(3) = (1 - (3 * (fvar(17)/396)))

[State -2, Normals Multiplier]
type = VarSet
trigger1 = fvar(15) > 8
fvar(1) = .25

[State -2, Specials Multiplier]
type = VarSet
trigger1 = fvar(16) > 50
fvar(2) = .25

[State -2, Supers Multiplier]
type = VarSet
trigger1 = fvar(17) > 99
fvar(3) = .25

;---------------------------------------------------------------------------
; Stop guarding with back
[State -2, Hold back guard off]
type = AssertSpecial
trigger1 = stateno != [191,192]
trigger1 = movetype != A
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard
ignorehitpause = 1

;---------------------------------------------------------------------------
; No auto turn
[State -2, No auto turn]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

;---------------------------------------------------------------------------
; Personal GameTime
[State -2, Time]
type = VarSet
trigger1 = stateno != [3000,4999]
trigger2 = stateno = [3000,4999]
trigger2 = time > ifelse(stateno = 3100, 50, 24)
trigger3 = stateno = 3600
var(33) = var(33) + 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; FIRST ATTACK free stock
[State -2, Done]
type = VarSet
trigger1 = var(27) = 5
var(27) = 0
ignorehitpause = 1

[State -2, Half Stock for tie]
type = VarSet
triggerall = var(27) = 3
trigger1 = numpartner = 1
trigger1 = (partner, SelfAnimExist(66167100))
trigger1 = (partner, var(27) >= 3)
trigger2 = (enemy(0), SelfAnimExist(66167100))
trigger2 = (enemy(0), var(27) >= 3)
trigger3 = numenemy = 2
trigger3 = (enemy(1), SelfAnimExist(66167100))
trigger3 = (enemy(1), var(27) >= 3)
var(27) = 4
ignorehitpause = 1

[State -2, PowerAdd 1]
type = PowerAdd
trigger1 = var(27) = 3
trigger1 = var(27) := 5
value = 1000
ignorehitpause = 1

[State -2, PowerAdd 2]
type = PowerAdd
trigger1 = var(27) = 4
trigger1 = var(27) := 5
value = 500
ignorehitpause = 1

[State -2, Initialize]
type = VarSet
trigger1 = var(33) = 1
var(27) = 1
ignorehitpause = 1

[State -2, Check that everyone complies]
type = VarSet
triggerall = var(27) = 1
trigger1 = numpartner = 1
trigger1 = !(partner, SelfAnimExist(66167100))
trigger2 = !(enemy(0), SelfAnimExist(66167100))
trigger3 = numenemy = 2
trigger3 = !(enemy(1), SelfAnimExist(66167100))
var(27) = 0
ignorehitpause = 1

[State -2, Confirm]
type = VarSet
trigger1 = var(27) = 1
var(27) = 2
ignorehitpause = 1

[State -2, Turn off when someone else gets it]
type = VarSet
triggerall = var(27) = 2
trigger1 = numpartner = 1
trigger1 = (partner, SelfAnimExist(66167100))
trigger1 = (partner, var(27) >= 3)
trigger2 = (enemy(0), SelfAnimExist(66167100))
trigger2 = (enemy(0), var(27) >= 3)
trigger3 = numenemy = 2
trigger3 = (enemy(1), SelfAnimExist(66167100))
trigger3 = (enemy(1), var(27) >= 3)
var(27) = 0
ignorehitpause = 1

[State -2, Hit]
type = VarSet
triggerall = var(27) = 2
trigger1 = MoveHit
trigger2 = ProjHit = 1
;trigger3 = helper(id), MoveHit ; Use one for each special helper (Checking super helpers would be pointless)
var(27) = 3
ignorehitpause = 1

;---------------------------------------------------------------------------
; Bankai; why was this below stuff in -3 before
[State -3, Previous State]
type = VarSet
trigger1 = stateno != (3900)
trigger1 = movetype != H
; If possible there should be a check here to make sure we're not in a P2state
var(43) = stateno

[State -3, Previous State]
type = VarSet
trigger1 = var(42)
trigger1 = stateno != (3900)
var(41) = var(41) + 1

[State -3, Previous State]
type = VarSet
trigger1 = !(var(42))
var(41) = 0

[State -3, No Throwing in Bankai]
type = NotHitBy
trigger1 = var(42) = 1
value = ,NT,ST,HT

[State -3, Bankai Super Armor]
type = HitOverride
trigger1 = var(42) = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 3900
time = 1
ignorehitpause = 1

[State -2, y u reverse bankai]
type = SelfState
triggerall = var(42) = 1
trigger1 = MoveReversed
trigger1 = stateno != 3900 && stateno != var(43)
value = 3900
;---------------------------------------------------------------------------
; Bankai Timer
[State -2, Bankai Timer]
type = VarSet
trigger1 = stateno != 3100
trigger1 = var(42) = 1
fvar(37) = fvar(37) + 1
ignorehitpause = 1

[State -2, Bankai Timer PowerSet]
type = PowerSet
trigger1 = var(42) = 1
trigger1 = numpartner = 0
value = Floor((900 - fvar(37)) * 10 / 3)

[State -2, Bankai Timer]
type = PowerSet
triggerall = var(42) != 1
trigger1 = fvar(38) != 0
value = 0

[State -2, Bankai Timer]
type = PowerAdd
triggerall = var(42) != 1
trigger1 = fvar(38) != 0
value = Floor(fvar(38))

[State -2, Bankai Timer]
type = VarSet
trigger1 = var(42) != 1
fvar(38) = 0

[State -2, Bankai Timer]
type = VarSet
triggerall = var(42) != 1
trigger1 = fvar(38) != 0
value = fvar(8) = 0

;---------------------------------------------------------------------------
; Stuff
[State -2, Buddy Check]
type = VarSet
trigger1 = var(33) = 1
trigger1 = numpartner = 1
trigger1 = (partner, id) < id
var(12) = 1

[State -2, Buddy Check]
type = VarSet
trigger1 = var(12) = 1
trigger1 = partner, SelfAnimExist(66167100)
var(12) = 2

[State -2, Double Jump Land Reset]
type = VarSet
trigger1 = var(33) = 1
var(48) = 1 ; Double Jump

[State -2, Air Dash Land Reset]
type = VarSet
trigger1 = var(33) = 1
var(49) = 2 ; Air Dash

;---------------------------------------------------------------------------
; Clipboard
[State -2, Clipboard]
type = DisplayToClipboard
trigger1 = 1
;text = "%f %d %d %f %d"
;params = fvar(4), var(38), (var(38) != 0) && (fvar(4) = 0), pos x, var(1)
text = "Normals:.%d Specials:.%d Supers:.%d (.999 is 1) Bankai Timer:%d DD:%d"
params = ifelse(fvar(1)=1,999,Floor(fvar(1)*1000)), ifelse(fvar(2)=1,999,Floor(fvar(2)*1000)), ifelse(fvar(3)=1,999,Floor(fvar(3)*1000)), Floor(fvar(37)), Floor(fvar(8))
ignorehitpause = 1


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

[Statedef -3]

[State -3, Ctrl after hit]
type = CtrlSet
trigger1 = StateNo = 5001 || StateNo = 5011
trigger1 = HitOver
trigger2 = StateNo = 5030
trigger2 = !HitFall
trigger2 = HitOver
value = 1

[State -3, No longer hit]
type = StateTypeSet
trigger1 = StateNo = 5001 || StateNo = 5011
trigger1 = HitOver
trigger2 = StateNo = 5030
trigger2 = !HitFall
trigger2 = HitOver
movetype = I

;---------------------------------------------------------------------------
; Statedef -3 AI Stuff
; 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 = Alive && !IsHelper
triggerall = IsHomeTeam
trigger1 = TeamSide = 2
trigger2 = MatchNo > 1
var(58) = 1

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

; 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 the 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
; from my site ( http://www.mugenguild.net/~winane/ ), and then just add a
; "(var(59)&63)>30" triggerall to this controller.
; Alternatively, you can just set "Dummy control" to "Manual", press a P2 button
; to kill the AI helper, and then set dummy control back to "Cooperative".  (In
; fact, setting dummy control to manual isn't even necessary, if you press the
; P2 button prior to the first time you pause.)
[State -3, AI Helper]
type = Helper
triggerall = !var(58) && !IsHelper
triggerall = !NumHelper(9741)
triggerall = Alive && RoundState = 2
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = var(58) = -2 && !IsHelper
trigger1 = Alive && RoundState = 2
var(58) = 1

; This method works somewhat 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 nearly as well if AI.Cheat is turned off
; in mugen.cfg.
[State -3, XOR]
type = VarSet
triggerall = var(58)!=1 && !IsHelper
triggerall = !var(56)
triggerall = var(57) = GameTime-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"
;Add more as desired. (See my notes in the CMD.)
var(58) = 1

; These next two controllers must be placed here, after the above XOR
; VarSet controller and before the below GameTime VarSet controller.
[State -3, fiXOR]
type = VarAdd
trigger1 = var(56) > 0 && !IsHelper
var(56) = -1

[State -3, fuXOR]
type = VarSet
trigger1 = var(57) < GameTime-1 && !IsHelper
var(56) = 31
IgnoreHitPause = 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 = !IsHelper
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.

;---------------------------------------------------------------------------
; Bankai
[State -3, Bankai End]
type = ChangeState
triggerall = var(42) = 1
triggerall = ctrl && statetype != A
trigger1 = fvar(37) >= 900
trigger2 = roundstate = 3
value = 3150

[State -3, Bankai Dead'd]
type = VelSet
triggerall = var(42) = 1
trigger1 = !alive
x = -2
y = -4

[State -3, Bankai Dead'd]
type = ChangeState
triggerall = var(42) = 1
trigger1 = !alive
trigger1 = !(var(42) := 0)
value = 5050

;---------------------------------------------------------------------------
; Personal turn control with two opponents
[State -3, Hold back to turn]
type = Turn
trigger1 = numenemy = 2
trigger1 = (var(35) != 0) && (var(36) != 0)
trigger1 = (playerID(var(35)), alive) && (playerID(var(36)), alive)
trigger1 = statetype != A
trigger1 = (ctrl) && (command = "holdback")

;---------------------------------------------------------------------------
; Why
[State -3, Hold Back blocking lawl wut]
type = ChangeState
triggerall = var(42) != 1
triggerall = !var(0)
triggerall = statetype != A
triggerall = InGuardDist
triggerall = var(16) >= 5
triggerall = ctrl
triggerall = command = "holdfwd"
trigger1 = ifelse(facing = -1, (pos x < playerID(var(35)), pos x), (pos x > playerID(var(35)), pos x))
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = (var(35) != 0) && (var(36) != 0)
trigger2 = ifelse(!(playerID(var(35)), alive), ifelse(facing = -1, (pos x < playerID(var(36)), pos x), (pos x > playerID(var(36)), pos x)), 0)
trigger3 = numenemy = 2
trigger3 = (var(35) != 0) && (var(36) != 0)
trigger3 = ifelse(!(playerID(var(36)), alive), ifelse(facing = -1, (pos x < playerID(var(35)), pos x), (pos x > playerID(var(35)), pos x)), 0)
value = 120

;---------------------------------------------------------------------------
;This controller plays a sound everytime the character lands from a jump.
[State -3, Landing Sound]
type = PlaySnd
triggerall = stateno != [800,801]
triggerall = ifelse((stateno = 20 || (stateno = [100,105])), time = 0, 1)
trigger1 = statetype != A
trigger1 = var(26) = 1
;trigger2 = stateno = 851 ;Wake-up forward land
;trigger3 = stateno = 853 ;Wake-up forward land
value = 9,3

[State -3, Land Noise]
type = VarSet
triggerall = (var(26) = 0)
triggerall = movetype != H
trigger1 = stateno = 50 || stateno = 5040
trigger2 = ((stateno = [120,155]) && (statetype = A))
var(26) = 1

[State -3, Land Noise Reset]
type = VarSet
trigger1 = statetype != A
trigger2 = movetype = H
var(26) = 0

;---------------------------------------------------------------------------
;Shunpo Time
[State -3, Shunpo Timer Reset]
type = VarSet
triggerall = (stateno != [800,804])
trigger1 = var(42) != 1
trigger2 = var(42) = 1
trigger2 = stateno != 3900
var(22) = 0

;---------------------------------------------------------------------------
;RF Hit Check
[State -3, In RF State Reset]
type = VarSet
trigger1 = stateno != 1020
trigger2 = stateno != 1120
trigger3 = stateno != 1220
trigger4 = stateno != 1320
var(31) = 0

[State -3, In RF State]
type = VarSet
trigger1 = stateno = 1020
trigger2 = stateno = 1120
trigger3 = stateno = 1220
trigger4 = stateno = 1320
var(31) = 1

[State -3, Not RF'in]
type = Varset
trigger1 = (var(31) = 0)
var(29) = 0

[State -3, Not RF'in]
type = Varset
trigger1 = (var(31) = 0)
var(30) = 0

[State -3, RF'in]
type = VarSet
triggerall = var(31)
triggerall = PlayerID(var(35)), SelfAnimExist(66167101)
trigger1 = ifelse(stateno = 1020, abs((PlayerID(var(35)), pos x) - (pos x)) < 123, 0)
trigger1 = ifelse(facing = 1, (PlayerID(var(35)), pos x) >= (pos x), (PlayerID(var(35)), pos x) <= (pos x))
trigger2 = ifelse(stateno = 1120, abs((PlayerID(var(35)), pos x) - (pos x)) < 189, 0)
trigger2 = ifelse(facing = 1, (PlayerID(var(35)), pos x) >= (pos x), (PlayerID(var(35)), pos x) <= (pos x))
trigger3 = ifelse(stateno = 1220, abs((PlayerID(var(35)), pos x) - (pos x)) < 141, 0)
trigger3 = ifelse(facing = 1, (PlayerID(var(35)), pos x) >= (pos x), (PlayerID(var(35)), pos x) <= (pos x))
trigger4 = ifelse(stateno = 1320, abs((PlayerID(var(35)), pos x) - (pos x)) < 125, 0)
trigger4 = ifelse(facing = 1, (PlayerID(var(35)), pos x) >= (pos x), (PlayerID(var(35)), pos x) <= (pos x))
var(29) = var(35)

[State -3, RF'in]
type = Varset
triggerall = numenemy > 1
triggerall = var(31)
triggerall = PlayerID(var(36)), SelfAnimExist(66167101)
trigger1 = ifelse(stateno = 1020, abs((PlayerID(var(36)), pos x) - (pos x)) < 123, 0)
trigger1 = ifelse(facing = 1, (PlayerID(var(36)), pos x) >= (pos x), (PlayerID(var(36)), pos x) <= (pos x))
trigger2 = ifelse(stateno = 1120, abs((PlayerID(var(36)), pos x) - (pos x)) < 189, 0)
trigger2 = ifelse(facing = 1, (PlayerID(var(36)), pos x) >= (pos x), (PlayerID(var(36)), pos x) <= (pos x))
trigger3 = ifelse(stateno = 1220, abs((PlayerID(var(36)), pos x) - (pos x)) < 141, 0)
trigger3 = ifelse(facing = 1, (PlayerID(var(36)), pos x) >= (pos x), (PlayerID(var(36)), pos x) <= (pos x))
trigger4 = ifelse(stateno = 1320, abs((PlayerID(var(36)), pos x) - (pos x)) < 125, 0)
trigger4 = ifelse(facing = 1, (PlayerID(var(36)), pos x) >= (pos x), (PlayerID(var(36)), pos x) <= (pos x))
var(30) = var(36)

;---------------------------------------------------------------------------
;Shunpo Dodge Reset
[State -3, Shunpo Reset1]
type = VarSet
;trigger1 = movetype != H
trigger1 = stateno != [800,804]
var(28) = 1

[State -3, Shunpo Reset2]
type = VarSet
triggerall = stateno = [800,804]
trigger1 = numenemy = 1
trigger1 = enemy, SelfAnimExist(66167101)
trigger1 = (enemy, var(29) != id) && (enemy, var(30) != id)
trigger2 = numenemy > 1
trigger2 = var(36) != 0
trigger2 = ifelse(playerID(var(35)), SelfAnimExist(66167101), (playerID(var(35)), var(29) != id) && (playerID(var(35)), var(30) != id), 1)
trigger2 = ifelse(playerID(var(36)), SelfAnimExist(66167101), (playerID(var(36)), var(29) != id) && (playerID(var(36)), var(30) != id), 1)
var(28) = 1

;---------------------------------------------------------------------------
;Tick Throw Preventer
[State -3, Tick Throw Target 1-1]
type = Varset
trigger1 = var(20) > 0
var(20) = var(20) - 1
ignorehitpause = 1

[State -3, Tick Throw Target 1-2]
type = Varset
trigger1 = var(35) != 0
trigger1 = PlayerID(var(35)), movetype = H
var(20) = 60
ignorehitpause = 1

[State -3, Tick Throw Target 2-1]
type = Varset
trigger1 = var(21) > 0
var(21) = var(21) - 1
ignorehitpause = 1

[State -3, Tick Throw Target 2-2]
type = Varset
trigger1 = numenemy = 2
trigger1 = var(36) != 0
trigger1 = PlayerID(var(36)), movetype = H
var(21) = 60
ignorehitpause = 1

[State -3, Tick Throw Self Preventer]
type = NotHitBy
trigger1 = var(15) > 0
value = , AT

[State -3, Tick Throw Self-1]
type = Varset
trigger1 = stateno != 850
trigger1 = stateno != 852
trigger1 = var(15) > 0
var(15) = var(15) - 1
ignorehitpause = 1

[State -3, Tick Throw Self-2]
type = Varset
trigger1 = movetype = H
var(15) = 60
ignorehitpause = 1

;---------------------------------------------------------------------------
;Corner Hit Pushback Idiocy
[State -3, Corner Hit Pushback Friction]
type = VarSet
triggerall = var(40) >= 3
triggerall = !(((stateno = 3000) && (time < 32)) || ((stateno = 3100) && (time < 51)))
trigger1 = fvar(4) != 0
fvar(4) = ifelse((fvar(4) - .375) < .5, 0, fvar(4) - .375)

[State -3, Pushback Delay Time Increment]
type = VarSet
trigger1 = var(38) = 0
var(40) = 0

[State -3, Pushback Delay Time Reset]
type = VarSet
trigger1 = var(40) >= 1
var(40) = var(40) + 1

[State -3, Corner Hit Pushback Enemy ID]
type = Varset
trigger1 = movecontact = 1
trigger1 = var(40) := 1
trigger1 = (stateno = [200,799]) || (stateno = [1000,1999]) ; Physical Attack States with normal pushback
trigger1 = NumTarget > 0
trigger1 = target, statetype != A
var(38) = target, ID
ignorehitpause = 1

[State -3, Corner Hit Pushback Enemy ID]
type = Varset
trigger1 = var(38) != 0
trigger1 = playerID(var(38)), HitOver
trigger1 = var(40) := 0
var(38) = 0
ignorehitpause = 1

[State -3, Corner Hit Pushback Velocity Reset]
type = Varset
trigger1 = var(38) = 0
fvar(4) = 0
ignorehitpause = 1

[State -3, Normal Corner Hit Pushback Velocity]
type = Varset
triggerall = stateno = [200,799]
trigger1 = var(38) != 0
trigger1 = movecontact = 1
trigger1 = (fvar(5) := facing) || 1
fvar(4) = ifelse((stateno = 220), 6, ifelse((stateno = 210) || (stateno = 410), 5, 4))
ignorehitpause = 1

[State -3, Special Corner Hit Pushback Velocity]
type = Varset
triggerall = stateno = [1000, 1999]
trigger1 = var(38) != 0
trigger1 = movecontact = 1
trigger1 = (fvar(5) := facing) || 1 ;This needs to be based on enemy position later ;Actually with turned pushback being messed up it's correct for now
fvar(4) = 4 ; I dunno what this should be, check later lol
ignorehitpause = 1

[State -3, Corner Hit Pushback]
type = PosAdd
triggerall = var(40) >= 3
triggerall = !(((stateno = 3000) && (time < 32)) || ((stateno = 3100) && (time < 51)))
triggerall = fvar(4) != 0
triggerall = (var(0) || var(1) != 800) && (stateno != [800, 804])
triggerall = movetype != H
trigger1 = (PlayerID(var(38)), backedgebodydist = 0) || (PlayerID(var(38)), frontedgebodydist = 0);abs(playerID(var(38)), pos x) = 145
trigger1 = PlayerID(var(38)), statetype != A
x = -fvar(4) * ifelse(fvar(5) != facing, -1, 1)
