; Thanks for DarkmanX for testing (a lot of feedback, thank him for the gameplay suggestion and damage balancing!!!), and xGutsx for "True Servant" palettes.
; INTEGER VAR USAGE
; var(0) - Temp var
; var(1) - Temp var
; var(2) - Airjump variable
; var(3) - Cipher Combo Var
;            0 = Ready
;            1 = y pressed
;            2 = z pressed
;            3 = b pressed
;            4 = c pressed
;            5 = Up pressed
;            6 = SuperJump entered
; var(4) - In the middle of super jump
; var(5) - Recovery roll var (1-short 2-med 3-long)
; var(6) - Ouroboro Signal Var
; var(7) - Combo Active?
; var(8) - Total hits of current combo
; var(9) - Hitcount of previous state
; var(10) - New hits this tick which must be accounted for
; var(11) - Helper hits to account for this tick
; var(12) - Facing at start of round
; var(13) - First attack counter
; var(14) - "Danger" counter
; var(15) - Temp var
; var(16) - Temp var
; var(17) - Air Combo active
; var(18) - Hyper Combo Finish
; var(19) - Holds Combo Count
; var(20) - Ouroboros Signal Var
; var(21) - Power after activating Ouroboros
; var(22) - Random for Ragnarok
; var(23) - Total Helpers for Ragnarok
; var(24) - WinKO Timer
; var(25) - Type of HC
;           1: Blessed Ouroboros
;           2: Legion
;           3: Ragnarok
;           4: Dance of the Cherub
;           5: Holy Legion
;           6: Holy Touch
;           7: Holy Touch ESP.
;           8: Just of Elohim
;           9: Ton Pooh Intervention
; var(26) - AI Active
; var(27) - Modified Opponent Y Dist
; var(28) - AI Charge Var
; var(29) - Difference in enemy power
; var(30) - Enemy Power on previous tick
; var(31) - Timer
; var(32) - Overhead var for AI
; var(55) - Ground Combo Limiter
; var(56) - Combo Alert to finish variable
; var(59) - AI was active
;
; FLOAT VAR USAGE
; fvar(0) - Temp
; fvar(1) - Damage scaling constant
; fvar(2) - Ouroboro rotation var 1
; fvar(3) - "        "        var 2

[Data]
;Amount of life to start with
life = 1000

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

[Size]
xscale = 1          ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 17     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 79          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 1     ;Set to 1 to scale projectiles too
head.pos = -6, -72   ;Approximate position of head
mid.pos = 0, -46    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 7.0      ;Walk forward
walk.back = -7.0     ;Walk backward
run.fwd  = 5, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.4    ;Neutral jumping velocity (x, y)
jump.back = -3.25    ;Jump back Speed (x, y)
jump.fwd = 3.2       ;Jump forward Speed (x, y)
runjump.back = -6.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 7,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

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

;---------------------------------------------------------------------------
; Lose Round by Time Over
[Statedef 170]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0
anim = 5000

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

[State 170, 2]
type = ChangeState
trigger1 = MatchOver
value = 171

;---------------------------------------------------------------------------
; Lose Match by Time Over
[Statedef 171]
type = S
ctrl = 0
anim = 170
velset = 0,0
sprpriority = -1

[State 171, 1]
type = PlaySnd
trigger1 = time = 0
value = 11, 1

[State 171, 2]
type = Explod
trigger1 = AnimElem = 5
ID = 0
anim = 173
postype = p1
pos = 42, -43
bindtime = 1
removetime = 300
vel = 4, 0
sprpriority = 3
ownpal = 1

[State 171, 3]
type = Explod
trigger1 = AnimElem = 5
ID = 1
anim = 173
postype = p1
pos = -42, -43
facing = -1
bindtime = 1
removetime = 300
vel = -4, 0
sprpriority = 3
ownpal = 1

[State 171, 4]
type = Explod
trigger1 = AnimElem = 5
ID = 2
anim = 173
postype = p1
pos = 64, -17
bindtime = 1
removetime = 300
vel = 4, 0
sprpriority = 2
ownpal = 1

[State 171, 5]
type = Explod
trigger1 = AnimElem = 5
ID = 3
anim = 173
postype = p1
pos = -64, -17
facing = -1
bindtime = 1
removetime = 300
vel = -4, 0
sprpriority = 2
ownpal = 1

[State 171, 6]
type = Explod
trigger1 = AnimElem = 5
ID = 4
anim = 171
postype = p1
pos = 135, 9
bindtime = 1
removetime = -2
vel = 7, 0
sprpriority = 1
ownpal = 1

[State 171, 7]
type = Explod
trigger1 = AnimElem = 5
ID = 5
anim = 171
postype = p1
pos = -135, 9
bindtime = 1
removetime = -2
facing = -1
vel = -7, 0
sprpriority = 1
ownpal = 1

[State 171, 8]
type = Explod
trigger1 = AnimElem = 5
ID = 6
anim = 172
postype = p1
pos = 85, 9
bindtime = 1
removetime = 300
vel = 4, 0
sprpriority = 0
ownpal = 1

[State 171, 9]
type = Explod
trigger1 = AnimElem = 5
ID = 7
anim = 172
postype = p1
pos = -85, 9
bindtime = 1
removetime = 300
facing = -1
vel = -4, 0
sprpriority = 0
ownpal = 1

[State 171, 10]
type = Explod
trigger1 = AnimElem = 5
ID = 8
anim = 172
postype = p1
pos = 65, 9
bindtime = 1
removetime = 300
vel = 4, 0
sprpriority = 0
ownpal = 1

[State 171, 11]
type = Explod
trigger1 = AnimElem = 5
ID = 9
anim = 172
postype = p1
pos = -65, 9
bindtime = 1
removetime = 300
facing = -1
vel = -4, 0
sprpriority = 0
ownpal = 1

;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S

[State 180, 1]
type = VarRandom
trigger1 = time = 0
v = 15
range = 0, 799

[State 180, 2]
type = ChangeState
trigger1 = var(15) = [0,199]
value = 181

[State 180, 3]
type = ChangeState
trigger1 = var(15) = [200,399]
value = 184

[State 180, 4]
type = ChangeState
trigger1 = var(15) = [400,599]
value = 185

[State 180, 5]
type = ChangeState
trigger1 = var(15) >= 600
value = 940

;---------------------------------------------------------------------------
; Win pose 1 - Just me and my robo-tiger
[Statedef 181]
type = S
ctrl = 0
anim = 670
ctrl = 0
velset = 0,0
sprpriority = 1

[State 181, 1]
type = AssertSpecial
trigger1 = time < 260
flag = RoundNotOver

[State 181, 2]
type = Explod
trigger1 = AnimElem = 2
ID = 123
anim = 1
postype = p1
pos = -3, -75
bindtime = -1
removetime = 4
sprpriority = 0
ownpal = 1

[State 181, 3]
type = Explod
trigger1 = AnimElem = 3
ID = 123
anim = 1
postype = p1
pos = -7, -85
bindtime = -1
removetime = -1
sprpriority = 0
ownpal = 1

[State 181, 4]
type = Helper
trigger1 = time = 30
ID = 0101
name = "Tiger"
StateNo = 182
postype = back
pos = -98, -90
ownpal = 1

[State 181, 5]
type = Explod
trigger1 = time = 0
ID = 1010
anim = 675
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1

[State 181, 6]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 6

;---------------------------------------------------------------------------
; Tiger Jump
[Statedef 182]
type = A
movetype = I
physics = N
anim = 680
velset = 5, -9.5
sprpriority = 4

[State 182, 1]
type = VelAdd
trigger1 = 1
y = .42

[State 182, 2]
type = ChangeState
trigger1 = Pos Y >= 0
value = 183

;---------------------------------------------------------------------------
; Tiger land and pose
[Statedef 183]
type = S
movetype = I
physics = N
anim = 685
velset = 0, 0

[State 183, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 183, 2]
type = PlaySnd
trigger1 = time = 2
value = 3, 2

;---------------------------------------------------------------------------
; Win Pose 2 - Long Speech In Japanese
[Statedef 184]
type = S
movetype = I
physics = S
anim = 690
ctrl = 0
velset = 0, 0
sprpriority = 1

[State 184, 1]
type = Explod
trigger1 = AnimElem = 2
ID = 123
anim = 1
postype = p1
pos = -3, -75
bindtime = -1
removetime = 4
sprpriority = 0
ownpal = 1

[State 184, 2]
type = Explod
trigger1 = AnimElem = 3
ID = 123
anim = 1
postype = p1
pos = -7, -85
bindtime = -1
removetime = -1
sprpriority = 0
ownpal = 1

[State 184, 3]
type = AssertSpecial
trigger1 = time < 220
flag = RoundNotOver

[State 184, 4]
type = Explod
trigger1 = time = 0
ID = 10101
anim = 695
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1

[State 184, 5]
type = PlaySnd
trigger1 = AnimElem = 6
value = 6, 9

;---------------------------------------------------------------------------
; Win Pose 3 - Oh, what a feelin'...
[Statedef 185]
type = A
movetype = I
physics = N
ctrl = 0
anim = 700
velset = 0, -1
sprpriority = 1

[State 185, a]
type = VarSet
trigger1 = time = 0
v = 2
value = 0

[State 185, b]
type = VarSet
trigger1 = time = 0
v = 5
value = -1

[State 185, c]
type = Helper
trigger1 = time = 0
ID = 5657
name = "Scroller"
StateNo = 188
postype = p1
pos = 0, 0

[State 185, 0]
type = Helper
trigger1 = time = 0
ID = 5656
name = "PlaceHolder"
StateNo = 187
postype = p1
pos = 0, 0

[State 185, 1]
type = VelAdd
trigger1 = 1
y = -.44

[State 185, 2]
type = AssertSpecial
trigger1 = 1
flag = RoundNotOver

[State 185, 3]
type = Null ;VarSet
trigger1 = 1
v = 0
value = floor(Pos Y - 124)

[State 185, 4]
type = VarSet
trigger1 = 1
v = 1
value = floor(ScreenPos Y - 124)

[State 185, 5]
type = Null ;PosAdd
trigger1 = var(1) < -10
y = -(var(1) + 10)

[State 185, 7]
type = ChangeState
trigger1 = var(1) <= -10
trigger1 = var(2)
trigger2 = time >= 360
value = 186

;---------------------------------------------------------------------------
; Land on ceiling and pose
[Statedef 186]
type = S
movetype = I
physics = N
anim = 710
velset = 0, 0
sprpriority = 1

[State 186, 1]
type = PlaySnd
trigger1 = time = 0
value = 2, 5

[State 186, 2]
type = AssertSpecial
trigger1 = time < 200
flag = RoundNotOver

[State 186, 3]
type = PosAdd
trigger1 = time = 0
y = -(ScreenPos Y)

[State 186, 4]
type = Helper
trigger1 = time = 0
ID = 9090
name = "Scarf"
Stateno = 189
postype = p1
pos = 0, 0
ownpal = 1

[State 186, 5]
type = Explod
trigger1 = time = 60
ID = 1111
Anim = 730
postype = back
pos = -50, 180
bindtime = 1
removetime = 200
vel = 5.5, 0
accel = 0, -.05
sprpriority = 7
ownpal = 1

;---------------------------------------------------------------------------
; Placeholder Helper
[Statedef 187]
type = A
movetype = I
physics = N
anim = 9999

[State 187, 0]
type = ParentVarSet
trigger1 = time = 0
v = 2
value = 1

[State 187, 1]
type = VarSet
trigger1 = 1
v = 0
value = floor(ScreenPos Y)

[State 187, 2]
type = VarSet
triggerall = time > 2
trigger1 = var(0) - var(1) != 0
v = 2
value = 1

[State 187, 3]
type = ParentVarSet
trigger1 = var(2)
v = 2
value = 0

[State 187, 3a]
type = ParentVarSet
trigger1 = var(2)
trigger1 = var(0) - var(1) = 0
v = 2
value = 1

[State 187, 4]
type = ParentVarSet
trigger1 = var(2)
fv = 0
value = var(0) - var(1)

[State 187, 4]
type = VarSet
trigger1 = 1
v = 1
value = floor(ScreenPos Y)

;---------------------------------------------------------------------------
; Screen Scroller Helper
[Statedef 188]
type = A
movetype = I
physics = N
anim = 9999
velset = 0, -1

[State 188, 1]
type = VelAdd
trigger1 = 1
y = -1

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

;---------------------------------------------------------------------------
; Upside Down Scarf
[Statedef 189]
type = A
movetype = I
physics = N
anim = 720
sprpriority = -1

[State 189, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 50000
TimeGap  = 1
FrameGap = 1
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 189, 1]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 1
pos = 1, 79

[State 189, 2]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 2
pos = 5, 85

[State 189, 3]
type = BindToParent
trigger1 = parent, ANimELemNo(0) = 3
pos = 1, 85

[State 189, 4]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 4
pos = 0, 85
time = -1

;---------------------------------------------------------------------------
; Introduction State Decider
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,599

[State 191, 4]
type = ChangeState
trigger1 = var(1) = [0,199]
value = 600

[State 191, 5]
type = ChangeState
trigger1 = var(1) = [200,399]
value = 620

[State 191, 6]
type = ChangeState
trigger1 = var(1) >= 400
value = 640

;[State 191, New Intro Static if desired]
;type = ChangeState
;trigger1 = 1
;value = 640
;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 0

[State 195, 1]
type = Helper
trigger1 = time = 0
ID = 1212
name = "Scarf"
StateNo = 930
postype = p1
pos = 1, -79
ownpal = 1

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

;---------------------------------------------------------------------------
; Stand Light Punch
[Statedef 200]
type = S
movetype = A
physics = S
ctrl = 0
anim = 200
poweradd = 15
juggle = 2
sprpriority = 1

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

[State 200, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
hitflag = MAF
guardflag = MA
pausetime = 8, 8
animtype = light
priority = 4, Hit
damage = 21
sparkno = 1
sparkxy = -5, -68
hitsound = S1, 2
guardsound = S1, 6
ground.type = high
ground.slidetime = 9
ground.hittime = 7
ground.velocity = -5.5
air.velocity = -2, -3.5
air.hittime = 7
guard.slidetime = 14
guard.hittime = 14
guard.velocity = -5.5
p2facing = 1
givepower = 10
getpower = 20

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

;---------------------------------------------------------------------------
; Stand Medium Punch
[Statedef 210]
type = S
movetype = A
physics = S
ctrl = 0
anim = 210
juggle = 4
poweradd = 30
sprpriority = 1

[State 210, 0]
type = VarSet
trigger1 = AnimElem = 3
v = 3
value = 0

[State 210, a]
type = VarSet
trigger1 = time = [0,1]
v = 1
value = 0

[State 210, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 210, 2]
type = PlaySnd
trigger1 = time = 1
value = 6, 0
channel = 0

[State 210, 3]
type = PlaySnd
trigger1 = time = 2
value = 0, 3

[State 210, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
hitflag = MAF
guardflag = MA
pausetime = 2, 11
animtype = medium
priority = 2, Hit
damage = 43
sparkno = S6020
sparkxy = -5, -67
hitsound = S1, 4
guardsound = S1, 6
ground.type = high
ground.slidetime = 14
ground.hittime = 9
ground.velocity = -7.6
ground.cornerpush.veloff = -12
air.velocity = -3, -2.5
air.hittime = 11
guard.slidetime = 13
guard.hittime = 13
guard.velocity = -8
givepower = 15
getpower = 25

[State 210, 5]
type = VarSet
trigger1 = AnimElem = 5
v = 1
value = 1

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

; Trace
[Statedef 211]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = 2
velset = 0,0

[State 211, 0]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, StateNo

[State 211, 1]
type = ChangeAnim
trigger1 = AnimExist(parent, Anim + 1)
value = parent, Anim + 1
elem = Parent, AnimElemNo(0)

[State 211, 2]
type = BindToParent
trigger1 = 1
pos = 0, 0

[State 211, 3]
type = DestroySelf
trigger1 = Parent, StateNo != var(0)
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Stand Hard Punch
[Statedef 220]
type = S
movetype = A
physics = S
ctrl = 0
anim = 220
juggle = 6
poweradd = 40
sprpriority = 1

[State 220, 0]
type = VarSet
trigger1 = AnimElem = 4
v = 3
value = 0
persistent = 0

[State 220, a]
type = VarSet
trigger1 = time = [0,1]
v = 1
value = 0

[State 220, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 220, 2]
type = PlaySnd
trigger1 = time = 1
value = 6, 2
channel = 0

[State 220, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 220, 4]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
hitflag = MAF
guardflag = MA
pausetime = 2, 11
animtype = hard
priority = 2, Hit
damage = 76
sparkno = S6021
sparkxy = -5, -67
hitsound = S1, 5
guardsound = S1, 6
ground.type = low
ground.slidetime = 19
ground.hittime = 12
ground.velocity = -9
ground.cornerpush.veloff = -12
air.velocity = -4, -9
air.hittime = 12
guard.slidetime = 16
guard.hittime = 16
guard.velocity = -8.6
p2facing = 1
givepower = 25
getpower = 35

[State 220, 5]
type = VarSet
trigger1 = AnimElem = 6
v = 1
value = 1

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

;---------------------------------------------------------------------------
; Stand Light Kick
[Statedef 230]
type = S
movetype = A
physics = S
ctrl = 0
anim = 230
juggle = 3
poweradd = 20
sprpriority = 1

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

[State 230, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
hitflag = MAF
guardflag = MA
pausetime = 8, 8
priority = 5, Hit
animtype = light
damage = 22
sparkno = 0
sparkxy = -5, -34
hitsound = S1, 0
guardsound = S1, 6
ground.type = low
ground.slidetime = 12
ground.hittime = 7
ground.velocity = -6
air.hittime = 8
air.velocity = -3, -2
guard.slidetime = 13
guard.hittime = 13
guard.velocity = -5.8
p2facing = 1
givepower = 10
getpower = 20

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Medium Kick
[Statedef 240]
type = S
movetype = A
physics = S
ctrl = 0
anim = 240
juggle = 5
poweradd = 25
sprpriority = 1

[State 240, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 240, 2]
type = VarSet
trigger1 = AnimElem = 3
v = 3
value = 0
persistent = 0

[State 240, 3]
type = VarSet
trigger1 = time = [0,1]
v = 1
value = 0

[State 240, 4]
type = PlaySnd
trigger1 = time = 2
value = 6, 1
channel = 0

[State 240, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 3

[State 240, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
hitflag = MAF
guardflag = MA
pausetime = 2, 11
priority = 2, Hit
animtype = medium
damage = 47
sparkno = S6021
sparkxy = -5, -27
hitsound = S1, 4
guardsound = S1, 6
ground.type = high
ground.slidetime = 13
ground.hittime = 9
ground.velocity = -6.4
air.velocity = -3, -2
air.hittime = 11
guard.slidetime = 13
guard.hittime = 13
guard.velocity = -6
givepower = 15
getpower = 25

[State 240, 7]
type = VarSet
trigger1 = AnimElem = 5
v = 1
value = 1

[State 240, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Hard Kick
[Statedef 250]
type = S
movetype = A
physics = S
ctrl = 0
anim = 250
juggle = 7
poweradd = 35
sprpriority = 1

[State 250, 0]
type = VarAdd
trigger1 = time = 1
v = 55
value = 1

[State 250, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 250, 2]
type = Width
trigger1 = 1
value = 15, 0

[State 250, 3]
type = VarSet
trigger1 = AnimElem = 4
v = 3
value = 0

[State 250, 4]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 10
channel = 0

[State 250, 5]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 3

[State 250, 6]
type = PosAdd
trigger1 = AnimElem = 3
x = 36

[State 250, 7]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
hitflag = MAF
guardflag = MA
pausetime = 2, 11
priority = 2, Hit
animtype = hard
damage = 78
sparkno = S6020
sparkxy = -5, -33
hitsound = S1, 5
guardsound = S1, 6
ground.type = low
ground.slidetime = 20
ground.hittime = 15
ground.velocity = -10
air.velocity = -5, -6
air.hittime = 12
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8.6
p2facing = 1
givepower = 35
getpower = 45

[State 250, 8]
type = VarSet
trigger1 = AnimElem = 7
v = 1
value = 1

[State 250, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Light Punch
[Statedef 300]
type = C
movetype = A
physics = C
ctrl = 0
anim = 300
juggle = 3
poweradd = 15
sprpriority = 1

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

[State 300, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
hitflag = MAF
guardflag = MA
pausetime = 8, 7
priority = 5, Hit
animtype = light
damage = 23
sparkno = 0
sparkxy = -5 ,-48
hitsound = S1, 2
guardsound = S1, 6
ground.type = low
ground.slidetime = 10
ground.hittime = 7
ground.velocity = -5.5
air.velocity = -3, -2
air.hittime = 7
guard.slidetime = 12
guard.hittime = 12
guard.velocity = -5
givepower = 10
getpower = 20

[State 300, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Medium Punch
[Statedef 310]
type = C
movetype = A
physics = C
ctrl = 0
anim = 310
juggle = 5
poweradd = 25
sprpriority = 1

[State 310, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 310, 2]
type = VarSet
trigger1 = time = [0,1]
v = 1
value = 0

[State 310, 3]
type = VarSet
trigger1 = AnimElem = 3
v = 3
value = 0

[State 310, 4]
type = PlaySnd
trigger1 = time = 2
value = 6, 0
channel = 0

[State 310, 5]
type = PlaySnd
trigger1 = time = 2
value = 0, 3

[State 310, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
hitflag = MAF
guardflag = MA
pausetime = 2, 11
priority = 2, Hit
animtype = medium
damage = 44
sparkno = S6020
sparkxy = -5, -44
hitsound = S1, 4
guardsound = S1, 6
ground.type = low
ground.slidetime = 15
ground.hittime = 8
ground.velocity = -7
air.velocity = -3, -4
air.hittime = 11
guard.slidetime = 17
guard.hittime = 17
guard.velocity = -7.5
givepower = 15
getpower = 25

[State 310, 7]
type = VarSet
trigger1 = AnimElem = 5
v = 1
value = 1

[State 310, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouch Hard Punch
[Statedef 320]
type = C
movetype = A
physics = C
ctrl = 0
anim = 320
juggle = 4
poweradd = 35
sprpriority = 1

[State 320, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 320, 2]
type = VarSet
trigger1 = time = [0,1]
v = 1
value = 0

[State 320, 3]
type = VarSet
trigger1 = AnimElem = 4
v = 3
value = 0

[State 320, 4]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 2
channel = 0

[State 320, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 3

[State 320, 6]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
hitflag = MAF
guardflag = MA
pausetime = 1, 11
animtype = Up
priority = 2, Hit
damage = 45
sparkno = S6080
sparkxy = -5, -72
hitsound = S1, 5
guardsound = S1, 6
p2stateno = 326
guard.slidetime = 22
guard.hittime = 22
guard.velocity = -9
givepower = 30
getpower = 35

[State 320, 7]
type = VarSet
trigger1 = AnimElem = 8
v = 1
value = 1

[State 320, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;--------------------------
; Launcher Followup Jump
[Statedef 325]
type    = S
physics = S
ctrl = 0
sprpriority = 1
anim = 40

[State 325, Set Superjump Var]
type = VarSet
trigger1 = time = 0
v = 4
value = 1

[State 325, Add AirJump]
type = VarSet
trigger1 = time = 0
v = 2
value = 1

[State 325, b]
type = PlaySnd
trigger1 = time = 0
value = 2, 7

[State 325, Set Aircombo Var]
type = VarSet
trigger1 = time = 0
v = 17
value = 1

[State 325, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 325, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger2 = var(26)
sysvar(1) = 1

[State 325, 3]
type = VarSet
triggerall = !var(26)
trigger1 = command = "holdback"
sysvar(1) = -1

[State 325, 4]
type = VelSet
trigger1 = 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)))
;x = ifelse(sysvar(1) = 0, 0, ifelse(sysvar(1)=1, 1.1, const(velocity.jump.back.x)))
y = const(velocity.jump.y) -3

[State 325, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 325, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 327
ctrl = 1

;-------------------------------------------------------------------
; Custom State - Launched
[Statedef 326]
type = A
movetype = H
physics = N
ctrl = 0
facep2 = 1
velset = 0, 0

[State 326, 1]
type = ChangeAnim
trigger1 = Time < 9
value = IfElse(SelfAnimExist(5052),5052,(IfElse(SelfAnimExist(5051),5051,5050)))

[State 326, 2]
type = VelSet
trigger1 = time = 11
x = -.1
y = -15

[State 326, 3]
type = VelAdd
trigger1 = time > 11
y = .39

[State 326, 4]
type = VelSet
trigger1 = !Alive
x = -8
y = -15

[State 326, 5]
type = SelfState
trigger1 = !Alive
value = 5050

[State 326, 6]
type = SelfState
trigger1 = Vel Y > 0
value = 5040
ctrl = 1

;---------------------------------------------------------------------------
; Launcher followup idle
[Statedef 327]
type = A
movetype = I
physics = A

[State 327, 1]
type = ChangeAnim
trigger1 = time = 0
value = 41

[State 327, 2]
type = ChangeAnim
trigger1 = Anim = 41
trigger1 = AnimTime = 0
value = 44

;---------------------------------------------------------------------------
; Crouch Light Kick
[Statedef 330]
type = C
movetype = A
physics = C
ctrl = 0
anim = 330
juggle = 3
poweradd = 20
sprpriority = 1

[State 330, 1]
type = PlaySnd
trigger1 = time = 2
value = 0, 0

[State 330, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
hitflag = MAFD
guardflag = LA
pausetime = 8, 8
priority = 5, Hit
animtype = light
damage = 21
sparkno = 0
sparkxy = -5, -5
hitsound = S1, 0
guardsound = S1, 6
ground.type = low
ground.slidetime = 12
ground.hittime = 7
ground.velocity = -6
air.velocity = -2, -3
air.hittime = 10
down.velocity = -3, -3
down.hittime = 15
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -5.5
p2facing = 1
givepower = 10
getpower = 20

[State 330, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouch Medium Kick
[Statedef 340]
type = C
movetype = A
physics = C
ctrl = 0
anim = 340
juggle = 4
poweradd = 25
sprpriority = 1

[State 340, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 340, 2]
type = VarSet
trigger1 = time = [0,1]
v = 1
value = 0

[State 340, 3]
type = VarSet
trigger1 = AnimElem = 3
v = 3
value = 0

[State 340, 4]
type = PlaySnd
trigger1 = time = 2
value = 6, 1
channel = 0

[State 340, 5]
type = PlaySnd
trigger1 = time = 3
value = 0, 3

[State 340, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
hitflag = MAFD
guardflag = LA
pausetime = 2, 11
animtype = medium
priority = 2, Hit
damage = 46
sparkno = S6021
sparkxy = -5, -20
hitsound = S1, 4
guardsound = S1, 6
ground.type = low
ground.slidetime = 16
ground.hittime = 11
ground.velocity = -7.2
air.velocity = -4, -3
air.hittime = 12
guard.slidetime = 17
guard.hittime = 17
guard.velocity = -7.1
givepower = 15
getpower = 25

[State 340, 7]
type = VarSet
trigger1 = AnimElem = 5
v = 1
value = 1

[State 340, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Hard Kick
[Statedef 350]
type = C
movetype = A
physics = C
ctrl = 0
anim = 350
juggle = 6
poweradd = 35
sprpriority = 1

[State 350, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 350, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 350, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 350, 2a]
type = VarSet
trigger1 = AnimElem = 3
v = 3
value = 0

[State 350, 3]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
hitflag = MAFD
guardflag = LA
pausetime = 2, 11
animtype = hard
priority = 2, Hit
damage = 73
sparkno = S6020
sparkxy = -5, -18
hitsound = S1, 5
guardsound = S1, 6
ground.type = trip
ground.velocity = -2, -5
air.velocity = -2, -3
guard.slidetime = 20
guard.hittime = 17
guard.velocity = -9.5
fall = 1
air.fall = 1
yaccel = .55
fall.recover = 0
givepower = 35
getpower = 45

[State 350, 4]
type = VarSet
trigger1 = AnimElem = 9
v = 1
value = 1

[State 350, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Slide Kick
[Statedef 360]
type = C
movetype = A
physics = N
ctrl = 0
anim = 360
juggle = 10
poweradd = 35
velset = 5.5, 0
sprpriority = 0

[State 360, 1]
type = Explod
trigger1 = time = [2,28]
trigger1 = (time % 5) = 0
ID = 1234
anim = 6000
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
vel = -.5, 0
sprpriority = 2
ownpal = 1

[State 360, 2]
type = PlaySnd
trigger1 = AnimElem = 5
value = 2, 4

[State 360, 3]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
hitflag = MAFD
guardflag = LA
pausetime = 11, 11
animtype = hard
priority = 5, Hit
damage = 76
sparkno = 2
sparkxy = -5, -19
hitsound = S1, 1
guardsound = S1, 6
ground.type = trip
ground.velocity = -2, -5.5
air.velocity = -2, -4
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -8
fall = 1
air.fall = 1
fall.recover = 0
yaccel = .55
givepower = 35
getpower = 55

[State 360, 4]
type = VelSet
trigger1 = AnimElem = 12
x = 0

[State 360, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Jump Light Punch
[Statedef 400]
type = A
movetype = A
physics = A
ctrl = 0
anim = 400
juggle = 3
poweradd = 15
sprpriority = 1

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

[State 400, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
hitflag = MAF
guardflag = HA
pausetime = 8, 11
animtype = light
priority = 5, Hit
damage = 24
sparkno = 0
sparkxy = -5, -82
hitsound = S1, 2
guardsound = S1, 6
ground.type = high
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -5
air.velocity = 0, -5
air.hittime = 14
airguard.velocity = -3, 0
p2facing = 1
givepower = 7
getpower = 17

[State 400, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Jump Medium Punch
[Statedef 410]
type = A
movetype = A
physics = A
ctrl = 0
anim = 410
juggle = 4
poweradd = 30
sprpriority = 1

[State 410, 0]
type = ChangeAnim
trigger1 = HitPauseTime
value = Anim
elem = AnimELemNo(var(1) % 3)
ignorehitpause = 1

[State 410, 01]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 410, 02]
type = VarAdd
trigger1 = 1
v = 1
value = 1
ignorehitpause = 1

[State 410, 3]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 410, 4]
type = PlaySnd
trigger1 = time = 2
value = 6, 0
channel = 0

[State 410, 5]
type = PlaySnd
trigger1 = time = 2
value = 0, 3

[State 410, 6]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
hitflag = MAF
guardflag = HA
pausetime = 8, 11
animtype = Medium
priority = 2, Hit
damage = 45
sparkno = S6020
sparkxy = -5, -85
hitsound = S1, 4
guardsound = S1, 6
ground.type = high
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -7.6
air.velocity = 0, -6
air.hittime = 22
guard.slidetime = 8
guard.hittime = 7
guard.velocity = -6.5
givepower = 12
getpower = 22
persistent = 0

[State 410, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Jump Hard Punch
[Statedef 420]
type = A
movetype = A
physics = A
ctrl = 0
anim = 420
juggle = 6
poweradd = 40
sprpriority = 1

[State 420, 0]
type = ChangeAnim
trigger1 = HitPauseTime
value = Anim
elem = AnimELemNo(var(1) % 3)
ignorehitpause = 1

[State 420, 01]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 420, 02]
type = VarAdd
trigger1 = 1
v = 1
value = 1
ignorehitpause = 1

[State 420, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 420, 2]
type = PlaySnd
trigger1 = time = 2
value = 6, 10
channel = 0

[State 420, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 3

[State 420, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
hitflag = MAFD
guardflag = HA
pausetime = 8, 11
priority = 2, Hit
animtype = Hard
air.animtype = Back
damage = 74
sparkno = S6020
sparkxy = -5, -77
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.slidetime = 16
ground.hittime = 16
ground.velocity = -8.8
air.velocity = -9, 10
down.velocity = -5, 0
down.hittime = 13
guard.slidetime = 7
guard.hittime = 7
guard.velocity = -7
air.fall = 1
fall.recover = 0
p2facing = 1
givepower = 17
getpower = 27
persistent = 0

[State 420, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Jump Light Kick
[Statedef 430]
type = A
movetype = A
physics = A
ctrl = 0
anim = 430
juggle = 2
poweradd = 15
sprpriority = 1

[State 430, 1]
type = PlaySnd
trigger1 = time = 2
value = 0, 0

[State 430, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
hitflag = MAFD
guardflag = HA
pausetime = 8, 11
priority = 5, Hit
animtype = light
damage = 21
sparkno = 0
sparkxy = -5, -22
hitsound = S1, 0
guardsound = S1, 6
ground.type = high
ground.slidetime = 11
ground.hittime = 11
ground.velocity = -6.5
air.velocity = 0, -5
air.hittime = 17
down.velocity = -3, 0
down.hittime = 10
guard.slidetime = 7
guard.hittime = 7
guard.velocity = -5
p2facing = 1
givepower = 7
getpower = 12

[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Jump Medium Kick
[Statedef 440]
type = A
movetype = A
physics = A
ctrl = 0
anim = 440
juggle = 4
poweradd = 25
sprpriority = 1

[State 440, 0]
type = ChangeAnim
trigger1 = HitPauseTime
value = Anim
elem = AnimELemNo(var(1) % 3)
ignorehitpause = 1

[State 440, 01]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 440, 02]
type = VarAdd
trigger1 = 1
v = 1
value = 1
ignorehitpause = 1

[State 440, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 440, 2]
type = PlaySnd
trigger1 = time = 2
value = 6, 1
channel = 0

[State 440, 3]
type = PlaySnd
trigger1 = time = 2
value = 0, 3

[State 440, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
hitflag = MAFD
guardflag = HA
pausetime = 8, 11
priority = 2, Hit
animtype = Medium
damage = 43
sparkno = S6021
sparkxy = -5, -37
hitsound = S1, 4
guardsound = S1, 6
ground.type = high
ground.slidetime = 16
ground.hittime = 16
ground.velocity = -8
air.velocity = 0, -6
air.hittime = 22
down.velocity = -5, 0
down.hittime = 13
guard.slidetime = 7
guard.hittime = 7
guard.velocity = -6.5
givepower = 12
getpower = 22
persistent = 0

[State 440, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Jump Hard Kick
[Statedef 450]
type = A
movetype = A
physics = A
ctrl = 0
anim = 450
juggle = 6
poweradd = 40
sprpriority = 1

[State 450, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = ifelse(PrevStateNo = 420, 1, 0)

[State 450, 01]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 450, 02]
type = VarAdd
trigger1 = 1
v = 1
value = 1
ignorehitpause = 1

[State 450, 1]
type = Helper
trigger1 = time = 0
ID = 2323
name = "Slash Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 450, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 0
channel = 0

[State 450, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 450, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
hitflag = MAFD
guardflag = HA
pausetime = 13, 15
priority = 2, Hit
animtype = hard
air.animtype = back
damage = 76 - ((var(15) && var(17)) * 50)
sparkno = S6021
sparkxy = -5, -9
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.slidetime = 16
ground.hittime = 16
ground.velocity = -8
air.velocity = -9, 10
down.velocity = -8, 0
down.hittime = 15
guard.slidetime = 7
guard.hittime = 7
guard.velocity = -6.5
air.fall = 1
fall.recover = 0
p2facing = 1
givepower = 22
getpower = 37
persistent = 0

[State 450, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Triangle Jump
[Statedef 500]
type = A
movetype = I
physics = N
ctrl = 0
anim = 500
velset = 0, 0

[State 500, 0]
type = Turn
trigger1 = FrontEdgeBodyDist <= 3

[State 500, 1]
type = PlaySnd
trigger1 = time = 0
value = 2, 1

[State 500, 3]
type = VarSet
trigger1 = time = 0
v = 2
value = 1

[State 500, 4]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 510

[State 500, 5]
type = VelSet
trigger1 = Anim = 510
x = const(velocity.jump.fwd.x)
y = const(velocity.jump.y)

[State 500, 6]
type = ChangeState
trigger1 = Anim = 510
value = 510
ctrl = 1

;---------------------------------------------------------------------------
; Jump off wall
[Statedef 510]
type = A
movetype = I
physics = A
ctrl = 1

[State 510, 2]
type = ChangeAnim
trigger1 = Anim = 41
trigger1 = AnimTime = 0
value = 44

[State 510, 3]
type = ChangeState
triggerall = var(2) > 0
triggerall = time > 20
trigger1 = command = "pressup"
value = 515

;---------------------------------------------------------------------------
; Wall Jump Airjump
[Statedef 515]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 515, Decrement]
type = VarAdd
trigger1 = time = 0
v = 2
value = -1

[State 515, 1]
type = ChangeAnim
trigger1 = time = 0
value = 41

[State 515, 2]
type = ChangeAnim
trigger1 = sysvar(1) = 1
value = 50

[State 515, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 515, 4]
type = VarSet
trigger1 = command = "holdfwd"
trigger2 = var(26) && (PrevStateNo != 3503)
sysvar(1) = 1

[State 515, 5]
type = VarSet
trigger1 = command = "holdback"
trigger2 = var(26) && (PrevStateNo != 3503)
sysvar(1) = -1

[State 515, 6]
type = VelSet
trigger1 = Time = 2
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 515, 7]
type = ChangeState
trigger1 = Time = 2
value = 510
ctrl = 1

;---------------------------------------------------------------------------
; Recovery Roll - short
[Statedef 520]
type = S
movetype = I
physics = N
anim = 520
velset = 0, 0
ctrl = 0
facep2 = 1

[State 520, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 520, 2]
type = VelSet
trigger1 = time = 0
x = 7.5

[State 520, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Recovery Roll - med
[Statedef 530]
type = S
movetype = I
physics = N
anim = 530
velset = 0, 0
ctrl = 0
facep2 = 1

[State 530, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 530, 2]
type = VelSet
trigger1 = time = 0
x = 7.5

[State 530, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Recovery Roll - long
[Statedef 540]
type = S
movetype = I
physics = N
anim = 540
velset = 0, 0
ctrl = 0
facep2 = 1

[State 540, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 540, 2]
type = VelSet
trigger1 = time = 0
x = 7.5

[State 540, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Push Block (Stand)
[Statedef 550]
type    = S
movetype= I
physics = S
velset = 0,0
anim = 550
ctrl = 0

[State 550, NotHitBy]
Type = NotHitBy
trigger1 = Time = 0
Value = SCA
Time = 37

[State 550, Push Block]
type = Helper
trigger1 = Time = 0
ID = 6600
name = "Push Block F"
pos = 0,0
postype = p1
stateno = 590
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 550, Push Block]
type = Helper
trigger1 = Time = 0
ID = 6601
name = "Push Block B"
pos = 0,0
postype = p1
stateno = 580
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 550, Spark]
type = Explod
trigger1 = Time = 0
pos = 57, -61
postype = p1
anim = 6090
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 550, SFX]
type = PlaySnd
trigger1 = Time = 0
value = 2, 0
ignorehitpause = 1

[State 550, Speech]
type = PlaySnd
trigger1 = Time = 0
value = 6, 1
channel = 0
ignorehitpause = 1

[State 550, Stop]
type = Velset
trigger1 = Time = [0,30]
x = 0
y = 0

[State 550, Done]
type = ChangeState
trigger1 = AnimTime = 0
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; Push Block (Crouch)
[Statedef 560]
type    = C
movetype= I
physics = C
velset = 0,0
anim = 560
ctrl = 0

[State 560, NotHitBy]
Type = NotHitBy
trigger1 = Time = 0
Value = SCA
Time = 37

[State 560, Push Block]
type = Helper
trigger1 = Time = 0
ID = 6600
name = "Push Block F"
pos = 0,0
postype = p1
stateno = 590
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 560, Push Block]
type = Helper
trigger1 = Time = 0
ID = 6601
name = "Push Block B"
pos = 0,0
postype = p1
stateno = 580
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 560, Spark]
type = Explod
trigger1 = Time = 0
pos = 57, -48
postype = p1
anim = 6090
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 560, SFX]
type = PlaySnd
trigger1 = Time = 0
value = 2,0
ignorehitpause = 1

[State 560, Speech]
type = PlaySnd
trigger1 = Time = 0
value = 6, 1
channel = 0
ignorehitpause = 1

[State 560, Stop]
type = Velset
trigger1 = Time = [0,30]
x = 0
y = 0

[State 560, Done]
type = ChangeState
trigger1 = AnimTime = 0
value = 131
ctrl = 1

;---------------------------------------------------------------------------
; Push Block (Air)
[Statedef 570]
type    = A
movetype= I
physics = A
velset = 0,0
anim = 570
ctrl = 0

[State 570, NotHitBy]
Type = NotHitBy
trigger1 = Time = 0
Value = SCA
Time = 37

[State 570, Push Block]
type = Helper
trigger1 = Time = 0
ID = 6600
name = "Push Block F"
pos = 0,0
postype = p1
stateno = 590
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 570, Push Block]
type = Helper
trigger1 = Time = 0
ID = 6601
name = "Push Block B"
pos = 0,0
postype = p1
stateno = 580
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 570, Spark]
type = Explod
trigger1 = Time = 0
pos = 56, -89
postype = p1
anim = 6090
sprpriority = 5
ownpal = 1
ignorehitpause = 1

[State 570, SFX]
type = PlaySnd
trigger1 = Time = 0
value = 2, 0
ignorehitpause = 1

[State 570, Speech]
type = PlaySnd
trigger1 = Time = 0
value = 6, 1
channel = 0
ignorehitpause = 1

[State 570, Stop]
type = Velset
trigger1 = Time = [0,30]
x = 0
y = 0

[State 570, Done]
type = ChangeState
trigger1 = AnimTime = 0
value = 132
ctrl = 1

;---------------------------------------------------------------------------
; Push Block Fwd
[Statedef 580]
type    = A
movetype= I
physics = N
velset = 0,0
anim = 580

[State 580, Not Get Hit]
type = NotHitBy
Trigger1 = Time >= 0
value = , AA ,AP ,AT
Time = 1

[State 580, Push]
type = PlayerPush
trigger1 = Time >= 0
value = 1

[State 580, Shove]
type = VelSet
trigger1 = Time >= 0
x = 15

[State 580, Done]
type = DestroySelf
trigger1 = Time = 30

;---------------------------------------------------------------------------
; Push Block Back
[Statedef 590]
type    = A
movetype= I
physics = N
velset = 0,0
anim = 580

[State 590, Not Get Hit]
type = NotHitBy
Trigger1 = Time >= 0
value = , AA ,AP ,AT
Time = 1

[State 590, Push]
type = PlayerPush
trigger1 = Time >= 0
value = 1

[State 590, Shove]
type = VelSet
trigger1 = Time >= 0
x = -15

[State 590, Done]
type = DestroySelf
trigger1 = Time = 30

;---------------------------------------------------------------------------
; Intro - Hangglider
[Statedef 600]
type = S
movetype = I
physics = S
ctrl = 0
anim = 9999
sprpriority = 1

[State 600, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 600, 1]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 600, 2]
type = Helper
trigger1 = time = 30
ID = 4343
name = "Hangglider"
StateNo = 610
postype = back
pos = -20, floor(pos Y - 160)
ownpal = 1

[State 600, 3]
type = ChangeAnim
trigger1 = var(0)
value = 47
persistent = 0

[State 600, Jump Land Sound]
type = PlaySnd
trigger1 = var(0)
value = 2, 2
persistent = 0

[State 600, Landing Wave]
type = Explod
trigger1 = var(0)
ID = 589
anim = 6010
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = -2
persistent = 0

[State 600, 4]
type = ChangeState
trigger1 = Anim = 47
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Hangglider State
[Statedef 610]
type = A
movetype = I
physics = N
anim = 600
sprpriority = 0
velset = 4.5, 0

[State 610, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 610, 1]
type = Explod
trigger1 = time = 0
ID = 100
anim = 605
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1

[State 610, 2]
type = Explod
trigger1 = time = 0
ID = 101
anim = 610
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1

[State 610, 3]
type = RemoveExplod
trigger1 = ParentDist X <= -95
ID = 101
persistent = 0

[State 610, 4]
type = Helper
trigger1 = ParentDist X <= -95
ID = 111
name = "Dummy Hiryu"
StateNo = 615
postype = p1
pos = -62, 70
ownpal = 1
persistent = 0

[State 610, 4a]
type = VarSet
trigger1 = NumHelper(111) = 1
v = 0
value = 1

[State 610, 5]
type = VelSet
trigger1 = time >= 80
y = -2

[State 610, 6]
type = ParentVarSet
trigger1 = var(1)
v = 0
value = 1

[State 610, 7]
type = DestroySelf
trigger1 = var(0)
trigger1 = NumHelper = 0

;---------------------------------------------------------------------------
; Hiryu Jump Off Hangglider
[Statedef 615]
type = A
movetype = I
physics = N
anim = 615
sprpriority = 4
velset = -1, -4

[State 615, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 615, 1]
type = Gravity
trigger1 = 1

[State 615, 2]
type = ParentVarSet
trigger1 = Pos Y >= -18
v = 1
value = 1

[State 615, 3]
type = DestroySelf
trigger1 = Pos Y >= 0

;---------------------------------------------------------------------------
; Intro - Riding Tiger
[Statedef 620]
type = S
movetype = I
physics = S
ctrl = 0
anim = 9999
sprpriority = 3

[State 620, 1]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 620, 2]
type = Helper
trigger1 = time = 30
ID = 4343
name = "Tiger"
StateNo = 630
postype = front
pos = 95, 0
facing = -1
ownpal = 1

[State 620, 3]
type = ChangeAnim
trigger1 = time = 112
value = 635

[State 620, 4]
type = ChangeState
trigger1 = Anim = 635
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Tiger's State
[Statedef 630]
type = S
movetype = I
physics = N
anim = 620
velset = 5, 0
sprpriority = 4

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 630, 1]
type = Helper
trigger1 = time = 0
ID = 123
name = "Hiryu"
StateNo = 635
postype = p1
pos = 0, 0
ownpal = 1

[State 630, 2]
type = Helper
trigger1 = time = 61
ID = 124
name = "Teleporting Hiryu"
StateNo = 636
postype = p1
pos = 0, 0
ownpal = 1

[State 630, 3]
type = VarSet
trigger1 = time = 61
v = 0
value = 1

[State 630, 4]
type = PlaySnd
trigger1 = time = 61
value = 6, 2

[State 630, 5]
type = DestroySelf
trigger1 = ScreenPos X >= 500
trigger1 = Facing = 1
trigger2 = ScreenPos X <= -500
trigger2 = Facing = -1


;---------------------------------------------------------------------------
; Hiryu on Tiger's Back
[Statedef 635]
type = A
movetype = I
physics = N
anim = 625
sprpriority = 5

[State 635, 1]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 1
pos = 12, -47

[State 635, 2]
type = BindToParent
trigger1 = parent, AnimELemNo(0) = 2
pos = 12, -54

[State 635, 3]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 3
pos = 12, -63

[State 635, 4]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 4
pos = 12, -52

[State 635, 5]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 5
pos = 12, -42

[State 635, 6]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 6
pos = 12, -44

[State 635, 7]
type = DestroySelf
trigger1 = parent, var(0)

;---------------------------------------------------------------------------
; Teleporting Hiryu
[Statedef 636]
type = A
movetype = I
physics = N
anim = 630
sprpriority = 5

[State 636, 1]
type = BindToParent
triggerall = AnimElemNo(0) = [1,4]
trigger1 = parent, AnimElemNo(0) = 1
pos = 12, -47
time = 300

[State 636, 2]
type = BindToParent
triggerall = AnimElemNo(0) = [1,4]
trigger1 = parent, AnimELemNo(0) = 2
pos = 12, -54
time = 300

[State 636, 3]
type = BindToParent
triggerall = AnimElemNo(0) = [1,4]
trigger1 = parent, AnimElemNo(0) = 3
pos = 12, -63
time = 300

[State 636, 4]
type = BindToParent
triggerall = AnimElemNo(0) = [1,4]
trigger1 = parent, AnimElemNo(0) = 4
pos = 12, -52
time = 300

[State 636, 5]
type = BindToParent
triggerall = AnimElemNo(0) = [1,4]
trigger1 = parent, AnimElemNo(0) = 5
pos = 12, -42
time = 300

[State 636, 6]
type = BindToParent
triggerall = AnimElemNo(0) = [1,4]
trigger1 = parent, AnimElemNo(0) = 6
pos = 12, -44
time = 300

[State 636, 7]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Intro - Item Box
[Statedef 640]
type = S
movetype = I
physics = N
ctrl = 0
anim = 640
sprpriority = 1

[State 640, 0]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 15
range = -100,100

[State 0, PalFX]
type = PalFX
trigger1 = time = 77
time = 120
add = 196,196,196
mul = 256,256,256
sinadd = 128,128,128,27
invertall = 0
color = 256

[State 0, Helper]
type = Helper
trigger1 = time >= 20
trigger1 = AnimElem = 1
trigger2 = time >= 50
trigger2 = AnimElem = 2
trigger3 = time >= 80
trigger3 = AnimElem = 3
trigger4 = time >= 110
trigger4 = AnimElem = 4
trigger5 = time >= 140
trigger5 = AnimElem = 5
trigger6 = time >= 150
trigger6 = AnimElem = 6
helpertype = normal ;player
name = "Light Beams"
ID = 650
stateno = 650
pos = var(15),250 + ceil((Pos Y*-1))
postype = p1
facing = 1
ownpal = 1
size.xscale = 1
size.yscale = 0.2
sprpriority = 2

[State 3370, 1]
type = Explod
triggerall = time >= 45
trigger1 = (time&7)=0
ID = 6120
anim = 6120
postype = p1
facing = 1
pos = 0 + ceil((var(15)*-0.5)),20 + ceil((Pos Y*-1))
scale = 1, 1
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 3370, 1]
type = Explod
triggerall = time >= 45
trigger1 = (time&7)=0
ID = 6120
anim = 6120
postype = p1
facing = -1
pos = 0 + ceil((var(15)*-0.5)),20 + ceil((Pos Y*-1))
scale = 1, 1
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 3370, 1]
type = Explod
triggerall = time >= 45
trigger1 = (time&7)=0
ID = 6120
anim = 6120
postype = p1
facing = 1
pos = 0 + ceil((var(15)*-0.1)),-20 + ceil((Pos Y*-1))
scale = 1, 1
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 3370, 1]
type = Explod
triggerall = time >= 45
trigger1 = (time&7)=0
ID = 6120
anim = 6120
postype = p1
facing = -1
pos = 0 + ceil((var(15)*-0.1)),-20 + ceil((Pos Y*-1))
scale = 1, 1
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 3370, 1]
type = Explod
triggerall = time >= 45
trigger1 = (time&5)=0
ID = 6010
anim = 6010
postype = p1
facing = -1
pos = 0,ceil(Pos Y*-1)
scale = 1, 1
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time = 150
id = 6010

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 57
value = 641
;elem = 1
;ignorehitpause =
;persistent =

[State 0, Helper]
type = Helper
trigger1 = time = 57
helpertype = normal ;player
name = "Red Scarf"
ID = 641
stateno = 641
pos = 0,0
postype = p1
facing = 1
ownpal = 0
size.xscale = 1.5
size.yscale = 0.7

[State 0, VelSet]
type = VelSet
trigger1 = time = 57
x = 0
y = -0.5

[State 0, VelAdd]
type = VelAdd
trigger1 = time >= 127
x = 0
y = -0.2

[State 0, AllPalFX]
type = AllPalFX
trigger1 = time = 147
time = 9999
add = 256,256,256
mul = 256,256,256
sinadd = 256,256,256,3
color = 256

[State 640, 16]
type = ChangeState
trigger1 = time = 177
value = 642

;---------------------------------------------------------------------------
; Red Scarf
[Statedef 641]
type = S
movetype = I
physics = N
ctrl = 0
anim = 642
velset = 0,0
sprpriority = 1

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 9999
facing = 1
pos = -38,-9

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = -90
persistent = 1

[State 641, 4]
type = DestroySelf
trigger1 = parent, StateNo != 640

;---------------------------------------------------------------------------
; Reserrected
[Statedef 642]
type = S
movetype = I
physics = N
ctrl = 0
anim = 643
velset = 0,0
sprpriority = 1

[State 640, 0]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 640, 0]
type = AssertSpecial
trigger1 = time <= 10
flag = invisible

[State 0, VarSet]
type = VarSet
trigger1 = time = 1
v = 16
value = 0

[State 0, VarAdd]
type = VarAdd
trigger1 = AnimElem = 5
v = 16
value = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = !var(16)
flag = noshadow

[State 0, PosSet]
type = PosSet
trigger1 = time >= 0
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S3,7
volume = 77
channel = 2

[State 0, AllPalFX]
type = AllPalFX
trigger1 = time < 10
time = 256
add = 256,256,256
mul = 256,256,256
color = 256

[State 0, AllPalFX]
type = AllPalFX
triggerall = time > 9
trigger1 = time < 256
time = 256
add = 256-time, 256-time, 256-time
mul = 256,256,256
color = 256

[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElem = 5
time = 17
freq = 120
ampl = 10

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = !var(16)
flag = noshadow

[State 0, Explod]
type = Explod
trigger1 = time = 3
ID = 61250
anim = 6125
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 0.7,0.7
sprpriority = 3
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 5
ID = 6125
anim = 6125
pos = 0,10
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = 1.5,1.5
sprpriority = 3
ownpal = 1

[State 3370, 1]
type = Explod
triggerall = time >= 270
trigger1 = (time&7)=0
ID = 6010
anim = 6010
postype = p1
facing = -1
pos = 0,0
scale = 1.5, 1
bindtime = -1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = AnimElem = 5
id = 61250

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S3,14
volume = 255
channel = 7
pan = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = AnimElem = 5
channel = 7

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 5
value = S2,6
volume = 200
channel = 2
pan = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 5
value = S3,12
volume = 200
channel = 3
pan = 0

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 15
range = -100,100

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "Holy Scarf"
ID = 643
stateno = 643
pos = 0,0
postype = p1
facing = 1
ownpal = 1
size.xscale = 1.7
size.yscale = 1

[State 0, Helper]
type = Helper
triggerall = time >= 270
trigger1 = (time&2)=0
helpertype = normal ;player
name = "Light Orbs"
ID = 645
stateno = 645
pos = var(15),5
postype = p1
facing = 1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

[State 0, AllPalFX]
type = AllPalFX
trigger1 = time >= 256
time = 99999
add = 0,0,0
mul = 256,256,256
color = 256

[State 0, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Holy Scarf
[Statedef 643]
type = A
movetype = I
physics = N
anim = 1
velset = 0,0

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 9999
facing = -1
pos = 2,-83

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = -17
persistent = 1

[State 641, 4]
type = DestroySelf
trigger1 = parent, StateNo != 642
trigger2 = time >= 256

;---------------------------------------------------------------------------
; Intro Mana Particles
[Statedef 645]
type = A
movetype = I
physics = N
anim = 3175
velset = 0,0
sprpriority = 3

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
x = 0
y = -0.3

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 641, 4]
type = DestroySelf
trigger1 = time >= 100

;---------------------------------------------------------------------------
; Intro Light Helper
[Statedef 650]
type = A
movetype = I
physics = N
anim = 3389
velset = 0, 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = 3,3
volume = 50
channel = 3
pan = 0

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 9999
add = 0,0,57
mul = 227,512,512
invertall = 0
color = 256

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 90
persistent = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Super Jump - Start
[Statedef 800]
type = S
movetype = I
physics = S
anim = 40
velset = 0, 0
sprpriority = 1
ctrl = 0

[State 800, Set Airjumps]
type = VarSet
trigger1 = time = 0
v = 2
value = 1

[State 800, Set Var]
type = VarSet
trigger1 = time = 0
v = 4
value = 1

[State 800, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = ifelse(command = "holdfwd", 1, ifelse(command = "holdback", -1, 0))

[State 800, 2]
type = Explod
trigger1 = AnimTime = 0
ID = 474
anim = 6060
postype = p1
pos = 0, 15
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 2

[State 800, 3]
type = PlaySnd
trigger1 = AnimTime = 0
value = 2, 7

[State 800, 4]
type = VelSet
trigger1 = AnimTime = 0
x = 2.25 * var(1)
y = -12.5

[State 800, 5]
type = Helper
trigger1 = AnimTime = 0
name = "Superjump FX Spawner"
ID = 840
stateno = 820
postype = p1
pos = 0, 0
ownpal = 1

[State 800, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 810
ctrl = 1

;---------------------------------------------------------------------------
; Super Jump - Neutral
[Statedef 810]
type = A
movetype = I
physics = A

[State 810, 1]
type = ChangeAnim
trigger1 = time = 0
trigger1 = PrevStateNo = 800 || PrevStateNo = 830
value = 41

[State 810, 1a]
type = ChangeAnim
trigger1 = time = 0
trigger1 = PrevStateNo = 800 || PrevStateNo = 830
trigger1 = Vel X > 0
value = 50

[State 810, 2]
type = ChangeAnim
trigger1 = time = 0
trigger1 = PrevStateNo != 800 && PrevStateNo != 830
trigger2 = Anim = 41 && AnimTime = 0
value = 44

[State 810, 3]
type = VelAdd
trigger1 = command = "holdfwd"
x = .5

[State 810, 4]
type = VelAdd
trigger1 = command = "holdback"
x = -.5

[State 810, 5]
type = ChangeState
triggerall = var(2) > 0
;triggerall = vel Y >= 0
trigger1 = command = "pressup"
value = 830

;---------------------------------------------------------------------------
; Superjump FX Spawner
[Statedef 820]
type = A
movetype = I
physics = N
anim = 9999

[State 820, 1]
type = BindToParent
trigger1 = time = 0
pos = 0, 0
time = 9999

[State 820, 2]
type = Explod
triggerall = time = [3,15]
trigger1 = (time % 5) = 0
ID = 481
anim = ifelse(random <= 499, 6070, 6075)
postype = p1
pos = 0, 0
random = 50, 0
bindtime = 1
removetime = 20
vel = 0, 0
ontop = 1

[State 820, 3]
type = Explod
trigger1 = (time % 10) = 0
ID = 482
anim = 6050
postype = p1
pos = -20, 0
bindtime = 1
removetime = -2
vel = 0, 0
ontop = 1

[State 820, 4]
type = DestroySelf
trigger1 = Parent, Vel Y >= -1
trigger2 = time = 1000

;---------------------------------------------------------------------------
; Super Jump Airjump
[Statedef 830]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 830, Decrement]
type = VarAdd
trigger1 = time = 0
v = 2
value = -1

[State 830, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44

[State 830, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41

[State 830, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 830, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 830, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 830, 6]
type = VelSet
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x) + 1.5))
y = const(velocity.airjump.y)

[State 830, 7]
type = ChangeState
trigger1 = Time = 2
value = 810
ctrl = 1

;---------------------------------------------------------------------------
; Standing Scarf
[Statedef 900]
type = A
movetype = I
physics = N
anim = 1
sprpriority = -1

[State -2, PalFX]
type = PalFx
trigger1 = PalNo >= 10
trigger1 = time = 1
time = 9999999
add = 10,12,15
mul = 256,256,256
sinadd = 100,100,100,3
color = 256
ignorehitpause = 1

[State 900, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 900, 1]
type = BindToParent
trigger1 = 1
pos = -4, -71

[State 900, 2]
type = ChangeAnim
trigger1 = Parent, Anim = 5
value = 9999

[State 900, 3]
type = Turn
trigger1 = Facing != parent, Facing

[State 900, 4]
type = ChangeAnim
trigger1 = Anim = 9999
trigger1 = Parent, Anim = 0
value = 1

[State 900, 5]
type = DestroySelf
trigger1 = Parent, StateNo != 0
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Crouching Scarf
[Statedef 910]
type = A
movetype = I
physics = N
anim = 1
sprpriority = -1

[State -2, PalFX]
type = PalFx
trigger1 = PalNo >= 10
trigger1 = time = 1
time = 9999999
add = 10,12,15
mul = 256,256,256
sinadd = 100,100,100,3
color = 256
ignorehitpause = 1

[State 910, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 910, 1]
type = BindToParent
trigger1 = 1
pos = 4, -48

[State 910, 2]
type = ChangeAnim
trigger1 = Parent, Anim = 6
value = 9999

[State 910, 3]
type = Turn
trigger1 = Facing != parent, Facing

[State 910, 4]
type = ChangeAnim
trigger1 = Anim = 9999
trigger1 = Parent, Anim = 11
value = 1

[State 910, 5]
type = DestroySelf
trigger1 = Parent, StateNo != 11
trigger2 = Parent, MoveType = H

;----------------------------------------------------------------------------
; Walking Scarf
[Statedef 920]
type = A
movetype = I
physics = N
anim = 1
sprpriority = -1

[State 920, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 920, 1]
type = BindToParent
triggerall = Parent, Anim = 20
trigger1 = Parent, AnimElemNo(0) = [1,2]
trigger2 = Parent, AnimElemNo(0) = [5,7]
pos = -8, -74

[State 920, 2]
type = BindToParent
triggerall = Parent, ANim = 20
trigger1 = Parent, AnimELemNo(0) = [3,4]
trigger2 = Parent, AnimElemNo(0) = [8,9]
pos = -8, -75

[State 920, 3]
type = BindToParent
triggerall = Parent, Anim = 21
trigger1 = Parent, AnimElemNo(0) = 1
trigger2 = Parent, AnimElemNo(0) = [4,6]
trigger3 = Parent, AnimElemNo(0) = [9,10]
pos = -8, -74

[State 920, 4]
type = BindToParent
triggerall = Parent, Anim = 21
trigger1 = Parent, ANimElemNo(0) = [2,3]
trigger2 = Parent, ANimElemNo(0) = [7,8]
pos = -8, -75

[State 920, 5]
type = DestroySelf
trigger1 = Parent, StateNo != 20
trigger2 = Parent, MoveType = H

[State 920, 2]
type = ChangeAnim
trigger1 = Parent, Anim = 5
value = 9999

[State 920, 3]
type = Turn
trigger1 = Facing != parent, Facing

[State 920, 4]
type = ChangeAnim
trigger1 = Anim = 9999
trigger1 = Parent, Anim = [20,21]
value = 1

;---------------------------------------------------------------------------
; Taunt Scarf
[Statedef 930]
type = A
movetype = I
physics = N
anim = 1
sprpriority = -1

[State 930, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 930, 1]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 1
pos = 1, -79

[State 930, 2]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 2
pos = 5, -85

[State 930, 3]
type = BindToParent
trigger1 = parent, ANimELemNo(0) = 3
pos = 1, -85

[State 930, 4]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 4
pos = 0, -85
time = -1

[State 930, 5]
type = DestroySelf
trigger1 = parent, StateNo != 195
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Winpose 4 - Always Recycle!
[Statedef 940]
type = S
movetype = I
physics = S
ctrl = 0
anim = 740
velset = 0, 0
sprpriority = 1

[State 940, 1]
type = Helper
trigger1 = time = 0
ID = 1212
name = "Scarf"
StateNo = 950
postype = p1
pos = 0, 0
ownpal = 1

[State 940, 2]
type = AssertSpecial
trigger1 = time < 200
flag = RoundNotOver

;---------------------------------------------------------------------------
; Win Pose 4 Scarf
[Statedef 950]
type = A
movetype = I
physics = N
anim = 1
sprpriority = -1

[State 950, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 950, 1]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 1
pos = 1, -79

[State 950, 2]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 2
pos = 5, -85

[State 950, 3]
type = BindToParent
trigger1 = parent, ANimELemNo(0) = 3
pos = 1, -85

[State 950, 4]
type = BindToParent
trigger1 = parent, AnimElemNo(0) = 4
pos = 0, -85
time = -1

;---------------------------------------------------------------------------
; Stand Punch Throw Attempt
[Statedef 1000]
type = S
movetype = A
physics = S
ctrl = 0
anim = 750

[State 1000, 1]
type = HitDef
trigger1 = time = 0
attr = S, NT
hitflag = -M
guardflag =
pausetime = 1, 1
priority = 1, Miss
sparkno = -1
hitsound = S6, 1
p1stateno = 1005
p2stateno = 1030
p2facing = -1
fall = 1
givepower = 80
getpower = 100

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

;---------------------------------------------------------------------------
; Stand Punch Throw Attempt
[Statedef 1005]
type = S
movetype = I
physics = N
ctrl = 0
velset = 0, 0
anim = 755
sprpriority = 2

[State 1005, 3]
type = TargetBind
trigger1 = time = 0
pos = 80, 0
time = 1

[State 1005, 2]
type = ChangeState
trigger1 = time = 7
value = 1010
ctrl = 1

;---------------------------------------------------------------------------
; Stand Punch Throw - Throwing Opponent
[Statedef 1010]
type = S
movetype = I
physics = N
ctrl = 0
anim = 800
velset = 0, 0
sprpriority = 1

[State 1010, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0
;ignorehitpause =
;persistent =

[State 1010, 3]
type = TargetBind
trigger1 = time = 0
id = 806
pos = 80, 0
time = 50

[State 1010, Explod]
type = Explod
trigger1 = time = 7
anim = 6080
ID = 6080
pos = 0,-50
postype = p2
bindtime = 1
removetime = -2
sprpriority = 3
ontop = 1
removeongethit = 0

[State 1010, 4]
type = PlaySnd
trigger1 = AnimElem = 4
value = 1, 5
channel = 0

[State 1010, PosSet]
type = PosAdd
trigger1 = AnimElem = 18
x = 0
y = -800
;ignorehitpause =
;persistent =

[State 1010, 9]
type = Gravity
trigger1 = AnimElemNo(0) = [25,26]

[State 1010, 10]
type = VelSet
trigger1 = time = 37
y = 50

[State 1010, 13]
type = TargetBind
trigger1 = P2BodyDist Y <= 9
trigger2 = P2BodyDist Y <= 9
trigger1 = AnimElem = 25
trigger2 = AnimElem = 26
pos = 0, 60
time = 50

[State 1010, PlaySnd]
type = PlaySnd
trigger1 = P2BodyDist Y <= 9
trigger2 = P2BodyDist Y <= 9
trigger1 = AnimElem = 25
trigger2 = AnimElem = 26
value = S1,1
channel = 4

[State 1010, Explod]
type = Explod
trigger1 = P2BodyDist Y <= 9
trigger2 = P2BodyDist Y <= 9
trigger1 = AnimElem = 25
trigger2 = AnimElem = 26
anim = 6060
ID = 6060
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
removeongethit = 0

[State 1010, 14a]
type = PlaySnd
trigger1 = AnimElem = 25
value = 6, 10

[State 1010, 15]
type = Gravity
trigger1 = AnimElemNo(0) = 25

[State 1010, 16]
type = ChangeState
trigger1 = AnimElemNo(0) = 25
trigger1 = Pos Y >= 0
value = 1020

;---------------------------------------------------------------------------
; Stand Punch Throw - Hit Ground and Roll Away
[Statedef 1020]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0

[State 1020, 2]
type = Explod
trigger1 = time = 0
trigger1 = time = 7
trigger1 = time = 14
anim = 6060
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
sprpriority = 4
ownpal = 1

[State 1020, 2]
type = Explod
trigger1 = time = 0
anim = 6120
postype = p1
facing = 1
pos = 30, 5
scale = 1,1
bindtime = 1
removetime = -2
sprpriority = 3

[State 1020, 3]
type = Explod
trigger1 = time = 1
anim = 6120
postype = p1
facing = -1
pos = -30, 5
scale = 1,1
bindtime = 1
removetime = -2
sprpriority = 4

[State 1020, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 1020, 2]
type = Explod
trigger1 = time = 0
ID = 23
anim = 6100
postype = p1
pos = 9, 0
bindtime = 1
removetime = -2
sprpriority = 4
ownpal = 1

[State 1020, 3]
type = Explod
trigger1 = time = 0
ID = 24
anim = 6110
postype = p1
pos = 9, 0
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 1020, 4]
type = TargetLifeAdd
trigger1 = time = 0
value = -93

[State 1020, 5]
type = EnvShake
trigger1 = time = 0
time = 38
freq = 110
ampl = -4

[State 1020, 6]
type = PlaySnd
trigger1 = time = 0
value = 2, 6

[State 1020, 7]
type = TargetState
trigger1 = time = 18
value = 1040

[State 1020, 8]
type = ChangeAnim
trigger1 = time = 18
value = 801

[State 1020, 8a]
type = TargetDrop
trigger1 = time = 18

[State 1020, 9]
type = VelSet
trigger1 = time = 18
x = 7

[State 1020, 10]
type = VelSet
trigger1 = Anim = 801
trigger1 = AnimElem = 4
x = 0

[State 1020, 11]
type = ChangeState
trigger1 = Anim = 801
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Being Thrown By Stand Punch Throw
[Statedef 1030]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0
sprpriority = 2

[State 1030, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 806

[State 1030, ChangeAnim2]
type = ChangeAnim2
trigger1 = P2BodyDist Y >= 9
trigger1 = time >= 30
value = 807

[State 1030, VelSet]
type = VelSet
trigger1 = AnimElem = 3
x = -2
y = -20

[State 1030, VelSet]
type = VelSet
trigger1 = AnimElem = 7
x = 0

[State 1030, VelAdd]
type = VelAdd
trigger1 = time >= 8
x = 0
y = 0.5

[State 1030, 3]
type = SelfState
trigger1 = time = 600
value = 5050

;---------------------------------------------------------------------------
; Hit Ground and Fly Back
[Statedef 1040]
type = A
movetype = H
physics = N
ctrl = 0

[State 1040, 1]
type = ChangeAnim
trigger1 = time = 0
value = 5050

[State 1040, 2]
type = VelSet
trigger1 = time = 0
x = -4
y = -8

[State 1040, 3]
type = VelAdd
trigger1 = 1
y = .39

[State 1040, 4]
type = PlayerPush
trigger1 = time < 10
value = 0

[State 1040, 4b]
type = NotHitBy
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = SCA
time = const(data.liedown.time) + 30

[State 1040, 5]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; Stand Kick Throw Attempt
[Statedef 1050]
type = S
movetype = A
physics = S
ctrl = 0
anim = 750

[State 1050, 1]
type = HitDef
trigger1 = time = 0
attr = S, NT
hitflag = -M
guardflag =
pausetime = 1, 1
priority = 1, Miss
sparkno = -1
hitsound = -1
p1stateno = 1060
p2stateno = 1100
p2facing = 1
fall = 1
givepower = 80
getpower = 100

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

;---------------------------------------------------------------------------
; Stand Kick Throw - Throwing
[Statedef 1060]
type = A
movetype = I
physics = N
ctrl = 0
anim = 810
velset = 0, 0
sprpriority = 2

[State 1060, 1]
type = VarSet
trigger1 = time = 0
v = 15
value = floor(target, Const(size.head.pos.x))

[State 1060, 2]
type = VarSet
trigger1 = time = 0
fv = 0
value = floor(target, Const(size.head.pos.y))

[State 1060, 3]
type = PosAdd
trigger1 = time = 1
x = -20 - var(15)

[State 1060, 4]
type = VelSet
trigger1 = time = 1
x = 3.5
y = fvar(0) * .091

[State 1060, 5]
type = Gravity
trigger1 = time > 1

[State 1060, 6]
type = ScreenBound
trigger1 = 1
value = 0

[State 1060, 7]
type = VarSet
trigger1 = time = 0
v = 1
value = floor(fvar(0))

[State 1060, 8]
type = TargetState
trigger1 = (P2Dist X - var(15)) <= 0
;trigger1 = (P2Dist Y + var(1)) <= 0
value = 1110

[State 1060, 9]
type = ChangeState
trigger1 = (P2Dist X - var(15)) <= 0
;trigger1 = (P2Dist Y + fvar(0)) <= 0
value = 1070

;---------------------------------------------------------------------------
; Kick Throw - Grab
[Statedef 1070]
type = A
movetype = I
physics = N
anim = 811
velset = 0, 0
sprpriority = 2

[State 1070, 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = -1, -39
time = 12

[State 1070, 1a]
type = PosAdd
trigger1 = AnimElem = 1
y = 42

[State 1070, 1b]
type = PosAdd
trigger1 = AnimElem = 1
trigger1 = Pos Y > 0
y = -(Pos Y)

[State 1070, 2]
type = PlaySnd
trigger1 = time = 0
value = 2, 1

[State 1070, 3]
type = VelSet
trigger1 = time = 8
x = 4
y = -5

[State 1070, 4]
type = Gravity
trigger1 = time >= 8

[State 1070, 5]
type = TargetBind
trigger1 = AnimElem = 2
pos = -38, -66
time = 3

[State 1070, 6]
type = TargetBind
trigger1 = AnimElem = 3
pos = -40, -93
time = -1

[State 1070, 7]
type = TargetState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1120

[State 1070, 8]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1080

;---------------------------------------------------------------------------
; Land from Grab
[Statedef 1080]
type = S
movetype = I
physics = S
ctrl = 0
anim = 812
velset = 0, 0

[State 1080, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 1080, 2]
type = Width
trigger1 = 1
value = 40, 0

[State 1080, 3]
type = TargetBind
trigger1 = time = 0
pos = 39, -108
time = 1

[State 1080, 4]
type = TargetLifeAdd
trigger1 = time = 0
value = -92

[State 1080, 5]
type = TargetDrop
trigger1 = time = 0

[State 1080, 6]
type = PlaySnd
trigger1 = time = 0
value = 6, 2

[State 1080, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Being Thrown By Kick Throw - Stand and Wait
[Statedef 1100]
type = S
movetype = H
physics = N
ctrl = 0
velset = 0, 0
sprpriority = 1

[State 1100, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 815

[State 1100, 2]
type = SelfState
trigger1 = time = 300
value = 5050

;---------------------------------------------------------------------------
; Being Thrown by Kick Throw - Grabbed
[Statedef 1110]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = 1

[State 1110, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 816

[State 1110, 2]
type = ScreenBound
trigger1 = 1
value = 0

;---------------------------------------------------------------------------
; Being Thrown By Kick Throw - Tossed
[Statedef 1120]
type = A
movetype = H
physics = N
ctrl = 0

[State 1120, 0]
type = ChangeAnim2
trigger1 = time = 0
value = 817

[State 1120, 1]
type = VelSet
trigger1 = time = 1
x = -5
y = -7

[State 1120, 2]
type = VelAdd
trigger1 = 1
y = .39

[State 1120, 3b]
type = NotHitBy
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = SCA
time = const(data.liedown.time) + 30

[State 1120, 3]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; Air Throw Attempt
[Statedef 1130]
type = A
movetype = A
physics = A
ctrl = 0
anim = 760

[State 1130, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
hitflag = AF
guardflag =
pausetime = 1, 1
priority = 4, Miss
sparkno = -1
hitsound = S2, 1
p1stateno = 1140
p2stateno = 1180
p2facing = 1
fall = 1
givepower = 80
getpower = 100

[State 1130, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(2), 810, 50)
ctrl = var(2)

;---------------------------------------------------------------------------
; Air Throw - Throwing Opponent
[Statedef 1140]
type = A
movetype = I
physics = N
ctrl = 0
anim = 820
sprpriority = 2
velset = 0, 0

[State 1140, 1]
type = BindToTarget
trigger1 = time = 1
pos = -37, 113
time = 12

[State 1140, 2]
type = BindToTarget
trigger1 = AnimElem = 2
pos = -71, 64
time = 4

[State 1140, 3]
type = BindToTarget
trigger1 = AnimElem = 3
pos = -47, 26
time = 3

[State 1140, 4]
type = BindToTarget
trigger1 = AnimElem = 4
pos = -28, 20
time = 4

[State 1140, 5]
type = BindToTarget
trigger1 = AnimElem = 5
pos = 46, 20
time = 3

[State 1140, 6]
type = TargetBind
trigger1 = AnimElem = 6
pos = -2, -28
time = -1

[State 1140, 7]
type = VelSet
trigger1 = AnimElem = 6
y = 8

[State 1140, 8]
type = Gravity
trigger1 = AnimElemNo(0) = 6

[State 1140, 9]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1150

;---------------------------------------------------------------------------
; Hit Ground
[Statedef 1150]
type = A
movetype = I
physics = N
ctrl = 0
anim = 821
velset = 0, 0

[State 1150, a]
type = PosSet
trigger1 = time = 0
y = 0

[State 1150, 0]
type = TargetBind
trigger1 = time = 0
pos = 0, 0
time = -1

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

[State 1150, 2]
type = Explod
trigger1 = time = 0
ID = 23
anim = 6100
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
sprpriority = 4
ownpal = 1

[State 1150, 3]
type = Explod
trigger1 = time = 0
ID = 24
anim = 6110
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 1150, 4]
type = TargetLifeAdd
trigger1 = time = 0
value = -93

[State 1150, 5]
type = EnvShake
trigger1 = time = 0
time = 40
freq = 130
ampl = -5

[State 1150, 6]
type = TargetState
trigger1 = time = 0
value = 1190

[State 1150, 7]
type = TargetDrop
trigger1 = AnimTime = 0

[State 1150, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 1160

;---------------------------------------------------------------------------
; Roll Away
[Statedef 1160]
type = S
movetype = I
physics = N
ctrl = 0
anim = 105
velset = -8, 0

[State 1160, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1160, 2]
type = VelSet
trigger1 = AnimElem = 6
x = 0

[State 1160, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Being Thrown By Air Throw
[Statedef 1180]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = 1
velset = 0, 0

[State 1180, 0]
type = PosAdd
trigger1 = time = 0
x = -(const(size.head.pos.x))
y = (const(size.head.pos.y))

[State 1180, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 825

[State 1180, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 1180, 3]
type = SelfState
trigger1 = time = 400
value = 5050

;---------------------------------------------------------------------------
; Hit Ground
[Statedef 1190]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0, 0

[State 1190, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 826

[State 1190, 2]
type = ChangeAnim2
trigger1 = Anim = 826
trigger1 = AnimTime = 0
value = 817

[State 1190, 3]
type = VelSet
trigger1 = Anim = 817
x = -5
y = -9
persistent = 0

[State 1190, 4]
type = VelAdd
trigger1 = Anim = 817
y = .39

[State 1190, 5]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;===========================================================================
; SPECIALS

;---------------------------------------------------------------------------
; Ame-no-Murakumo - LP Version (Combo Part 1.1)
[Statedef 2000]
type = S
movetype = A
physics = N
ctrl = 0
anim = 1900
juggle = 8
poweradd = 60
velset = 0, 0
sprpriority = 1

[State 200, 0]
type = VarSet
trigger1 = time = 0
v = 55
value = 2

[State 2000, a]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2000, 0]
type = Explod
trigger1 = time = 0
ID = 9900
anim = 6120
postype = p1
pos = 42, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2000, 1]
type = Helper
trigger1 = time = 0
ID = 2121
name = "Slash Trace"
StateNo = 2005
postype = p1
pos = 0, 0
ownpal = 1

[State 2000, 1a]
type = VelSet
trigger1 = AnimElem = 4
x = 4

[State 2000, 2]
type = PlaySnd
trigger1 = AnimElem = 7
value = 6, 1
channel = 0

[State 2000, 3]
type = PlaySnd
trigger1 = AnimElem = 8
value = 0, 3

[State 2000, 4]
type = VelSet
trigger1 = AnimElem = 13
x = 0

[State 2000, 5]
type = Helper
triggerall = AnimElemNo(0) = [5,11]
trigger1 = var(15) != AnimElemNo(0)
ID = 734
name = "Afterimage"
StateNo = 2006
postype = p1
pos = -20, 0
ownpal = 1

[State 2000, 6]
type = ChangeAnim
trigger1 = AnimElem = 4 = 2
value = 1900
elem = 5

[State 2000, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2000, 8]
type = HitDef
trigger1 = AnimElem = 9
attr = S, SA
hitflag = MAFD
guardflag = MA
pausetime = 11, 11
animtype = back
priority = 5, Hit
damage = 35, 2
sparkno = S6021
sparkxy = -5, -37
hitsound = S1, 7
guardsound = S1, 6
ground.velocity = -7
ground.slidetime = 20
ground.hittime = 20
air.velocity = -4, -5
guard.slidetime = 14
guard.hittime = 14
guard.velocity = -8.5
down.velocity = -3, -5
down.hittime = 30
fall = 0
air.fall = 1
fall.recover = 0
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 40
getpower = 60

[State 2000, 9]
type = EnvColor
trigger1 = MoveHit
time = 2
ignorehitpause = 1
persistent = 0

[State 2000, 10]
type = VarSet
trigger1 = 1
v = 15
value = AnimElemNo(0)

[State 2000, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Slash Trace Helper
[Statedef 2005]
type = A
movetype = I
physics = N
anim = 1905
sprpriority = 2

[State 2005, 1]
type = BindToParent
trigger1 = time = 0
pos = 0, 0
time = -1

[State 2005, 2]
type = ChangeAnim
trigger1 = 1
value = 1905
elem = parent, AnimElemNo(0)

[State 2005, 3]
type = DestroySelf
trigger1 = Parent, StateNo != 2000
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Afterimage Helper
[Statedef 2006]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = -1

[State 2006, 0]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2006, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, AnimElemNo(0) - 1

[State 2006, 2]
type = ChangeAnim
trigger1 = 1
value = 1900
elem = var(0)

[State 2006, 3]
type = Helper
trigger1 = var(0) = [7,10]
trigger1 = time = 0
ID = 9901
name = "Helper Sword Trace"
StateNo = 2007
postype = p1
pos = 0, 0
ownpal = 1

[State 2006, 4]
type = AssertSpecial
triggerall = parent, HitPauseTime = 0
trigger1 = (parent, var(1) % 2) = 1
flag = invisible

[State 2006, 5]
type = VarAdd
trigger1 = parent, HitPauseTime = 0
v = 1
value = 1

[State 2006, 6]
type = DestroySelf
;triggerall = NumHelper(9901) = 0
trigger1 = var(1) > 10
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Sword Trace for Afterimage
[Statedef 2007]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = 0

[State 2007, 1]
type = ChangeAnim
trigger1 = 1
value = 1905
elem = parent, var(0)

[State 2007, 2]
type = AssertSpecial
triggerall = root, HitPauseTime = 0
trigger1 = (root, var(1) % 2) = 1
flag = invisible

[State 2007, 3]
type = VarAdd
trigger1 = root, HitPauseTime = 0
v = 0
value = 1

[State 2007, 4]
type = DestroySelf
trigger1 = var(0) > 10
trigger2 = root, MoveType = H

;---------------------------------------------------------------------------
; Ame-no-Murakumo - MP Version
[Statedef 2010]
type = S
movetype = A
physics = N
ctrl = 0
anim = 1910
juggle = 8
poweradd = 70
velset = 0, 0
sprpriority = 1

[State 2010, a]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2010, 0]
type = Explod
trigger1 = time = 0
ID = 9900
anim = 6120
postype = p1
pos = 42, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2010, 1]
type = Helper
trigger1 = time = 0
ID = 2121
name = "Slash Trace"
StateNo = 2015
postype = p1
pos = 0, 0
ownpal = 1

[State 2010, 1a]
type = VelSet
trigger1 = AnimElem = 4
x = 20

[State 2010, 2]
type = PlaySnd
trigger1 = AnimElem = 6
value = 6, 1
channel = 0

[State 2010, 3]
type = PlaySnd
trigger1 = AnimElem = 8
value = 0, 3

[State 2010, 4]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 2010, 5]
type = Helper
triggerall = AnimElemNo(0) = [5,13]
trigger1 = var(15) != AnimElemNo(0)
ID = 734
name = "Afterimage"
StateNo = 2016
postype = p1
pos = -20, 0
ownpal = 1

[State 2010, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2010, 8]
type = HitDef
trigger1 = AnimElem = 10
attr = S, SA
hitflag = MAFD
guardflag = MA
pausetime = 20, 20
animtype = back
priority = 5, Hit
damage = 107, 2
sparkno = S6021
sparkxy = -5, -37
hitsound = S1, 7
guardsound = S1, 6
ground.velocity = -10
ground.slidetime = 20
ground.hittime = 20
air.velocity = -7, -5
guard.slidetime = 14
guard.hittime = 15
guard.velocity = -8.5
down.velocity = -3, -5
down.hittime = 30
fall = 0
air.fall = 1
fall.recover = 0
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 40
getpower = 60

[State 2010, 9]
type = EnvColor
trigger1 = MoveHit
time = 2
ignorehitpause = 1
persistent = 0

[State 2010, 10]
type = VarSet
trigger1 = 1
v = 15
value = AnimElemNo(0)

[State 2010, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Slash Trace Helper
[Statedef 2015]
type = A
movetype = I
physics = N
anim = 1915
sprpriority = 2

[State 2015, 1]
type = BindToParent
trigger1 = time = 0
pos = 0, 0
time = -1

[State 2015, 2]
type = ChangeAnim
trigger1 = 1
value = 1915
elem = parent, AnimElemNo(0)

[State 2015, 3]
type = DestroySelf
trigger1 = Parent, StateNo != 2010
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Afterimage Helper
[Statedef 2016]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = -1

[State 2016, 0]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2016, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, AnimElemNo(0) - 1

[State 2016, 2]
type = ChangeAnim
trigger1 = 1
value = 1910
elem = var(0)

[State 2016, 3]
type = Helper
trigger1 = var(0) = [9,12]
trigger1 = time = 0
ID = 9901
name = "Sword Trace"
StateNo = 2017
postype = p1
pos = 0, 0
ownpal = 1

[State 2016, 4]
type = AssertSpecial
triggerall = parent, HitPauseTime = 0
trigger1 = (parent, var(1) % 2) = 1
flag = invisible

[State 2016, 5]
type = VarAdd
trigger1 = parent, HitPauseTime = 0
v = 1
value = 1

[State 2016, 6]
type = DestroySelf
;triggerall = NumHelper(9901) = 0
trigger1 = var(1) > 10
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Sword Trace for Afterimage
[Statedef 2017]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = 0

[State 2017, 1]
type = ChangeAnim
trigger1 = 1
value = 1915
elem = parent, var(0)

[State 2017, 2]
type = AssertSpecial
triggerall = root, HitPauseTime = 0
trigger1 = (root, var(1) % 2) = 1
flag = invisible

[State 2017, 3]
type = VarAdd
trigger1 = root, HitPauseTime = 0
v = 0
value = 1

[State 2017, 4]
type = DestroySelf
trigger1 = var(0) > 10
trigger2 = root, MoveType = H

;---------------------------------------------------------------------------
; Ame-no-Murakumo - HP Version
[Statedef 2020]
type = S
movetype = A
physics = N
ctrl = 0
anim = 1920
juggle = 0
poweradd = 80
velset = 0, 0
sprpriority = 1

[State 2020, a]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2020, 0]
type = Explod
trigger1 = time = 0
ID = 9900
anim = 6120
postype = p1
pos = 42, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2020, 1]
type = Helper
trigger1 = time = 0
ID = 2121
name = "Slash Trace"
StateNo = 2025
postype = p1
pos = 0, 0
ownpal = 1

[State 2020, 1a]
type = VelSet
trigger1 = AnimElem = 4
x = 30

[State 2020, 2]
type = PlaySnd
trigger1 = AnimElem = 8
value = 6, 1
channel = 0

[State 2020, 3]
type = PlaySnd
trigger1 = AnimElem = 10
value = 0, 3

[State 2020, 4]
type = VelSet
trigger1 = AnimElem = 13
x = 0

[State 2020, 5]
type = Helper
triggerall = AnimElemNo(0) = [5,16]
trigger1 = var(15) != AnimElemNo(0)
ID = 734
name = "Afterimage"
StateNo = 2026
postype = p1
pos = -20, 0
ownpal = 1

[State 2020, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2020, 8]
type = HitDef
trigger1 = AnimElem = 12
attr = S, SA
hitflag = MAFD
guardflag = MA
pausetime = 20, 20
animtype = back
priority = 5, Hit
damage = 157, 2
sparkno = S6021
sparkxy = -5, -37
hitsound = S1, 7
guardsound = S1, 6
ground.velocity = -4, -5
air.velocity = -4, -5
guard.slidetime = 14
guard.hittime = 14
guard.velocity = -8.5
down.velocity = -3, -5
down.hittime = 30
fall = 1
air.fall = 1
fall.recover = 0
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 50
getpower = 100

[State 2020, 9]
type = EnvColor
trigger1 = MoveHit
time = 5
ignorehitpause = 1
persistent = 0

[State 2020, 10]
type = VarSet
trigger1 = 1
v = 15
value = AnimElemNo(0)

[State 2020, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Slash Trace Helper
[Statedef 2025]
type = A
movetype = I
physics = N
anim = 1925
sprpriority = 2

[State 2025, 1]
type = BindToParent
trigger1 = time = 0
pos = 0, 0
time = -1

[State 2025, 2]
type = ChangeAnim
trigger1 = 1
value = 1925
elem = parent, AnimElemNo(0)

[State 2025, 3]
type = DestroySelf
trigger1 = Parent, StateNo != 2020
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Afterimage Helper
[Statedef 2026]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = -1

[State 2026, 0]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2026, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, AnimElemNo(0) - 1

[State 2026, 2]
type = ChangeAnim
trigger1 = 1
value = 1920
elem = var(0)

[State 2026, 3]
type = Helper
trigger1 = var(0) = [11,14]
trigger1 = time = 0
ID = 9901
name = "Sword Trace"
StateNo = 2027
postype = p1
pos = 0, 0
ownpal = 1

[State 2026, 4]
type = AssertSpecial
triggerall = parent, HitPauseTime = 0
trigger1 = (parent, var(1) % 2) = 1
flag = invisible

[State 2026, 5]
type = VarAdd
trigger1 = parent, HitPauseTime = 0
v = 1
value = 1

[State 2026, 6]
type = DestroySelf
;triggerall = NumHelper(9901) = 0
trigger1 = var(1) > 10
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Sword Trace for Afterimage
[Statedef 2027]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = 0

[State 2027, 1]
type = ChangeAnim
trigger1 = 1
value = 1925
elem = parent, var(0)

[State 2027, 2]
type = AssertSpecial
triggerall = root, HitPauseTime = 0
trigger1 = (root, var(1) % 2) = 1
flag = invisible

[State 2027, 3]
type = VarAdd
trigger1 = root, HitPauseTime = 0
v = 0
value = 1

[State 2027, 4]
type = DestroySelf
trigger1 = var(0) > 10
trigger2 = root, MoveType = H

;---------------------------------------------------------------------------
; Gram - Standing
[Statedef 2030]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2000
juggle = 6
poweradd = 70
velset = 0, 0
sprpriority = 1

[State 2030, 0]
type = Explod
trigger1 = time = 1
ID = 1131
anim = 6120
postype = p1
pos = 36, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2030, 1]
type = Explod
trigger1 = time = 0
ID = 7462
anim = 2001
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1

[State 2030, 2]
type = Helper
trigger1 = time = 0
ID = 667
name = "Sword Trace"
StateNo = 2031
postype = p1
pos = 0, 0
ownpal = 1

[State 2030, 3]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 0
channel = 0

[State 2030, 4]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 3

[State 2030, 5]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
hitflag = MAF
guardflag = MA
pausetime = 1, 11
animtype = hard
priority = 4, Hit
damage = 80, 3
sparkno = S6021
sparkxy = -5, -54
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -3.5, -5.5
ground.hittime = 17
air.type = low
air.velocity = -3, -2
air.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8.5
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 50
getpower = 75

[State 2030, 6]
type = EnvColor
trigger1 = MoveHit
time = 2
persistent = 0
ignorehitpause = 1

[State 2030, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Sword Trace Helper
[Statedef 2031]
type = A
movetype = I
physics = N
anim = 9999
sprpriority = 2

[State 2031, 0]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, StateNo

[State 2031, 1]
type = ChangeAnim
trigger1 = AnimExist(parent, Anim + 5)
value = parent, Anim + 5
elem = Parent, AnimElemNo(0)

[State 2031, 2]
type = BindToParent
trigger1 = time = 0
pos = 0, 0
time = -1

[State 2031, 3]
type = DestroySelf
trigger1 = Parent, StateNo != var(0)
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Gram - Crouching
[Statedef 2040]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2010
juggle = 6
poweradd = 70
velset = 0, 0
sprpriority = 1

[State 2040, 0]
type = Explod
trigger1 = time = 1
ID = 1131
anim = 6120
postype = p1
pos = 30, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2040, 1]
type = Explod
trigger1 = time = 0
ID = 7462
anim = 2011
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1

[State 2040, 2]
type = Helper
trigger1 = time = 0
ID = 667
name = "Sword Trace"
StateNo = 2031
postype = p1
pos = 0, 0
ownpal = 1

[State 2040, 3]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 0
channel = 0

[State 2040, 4]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 3

[State 2040, 5]
type = HitDef
trigger1 = AnimElem = 7
attr = C, SA
hitflag = MAF
guardflag = MA
pausetime = 1, 11
animtype = hard
priority = 4, Hit
damage = 80, 3
sparkno = S6021
sparkxy = -5, -31
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -4, -3.5
ground.hittime = 17
air.type = low
air.velocity = -4, -1
air.hittime = 20
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -9
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 50
getpower = 75

[State 2040, 6]
type = EnvColor
trigger1 = MoveHit
time = 2
persistent = 0
ignorehitpause = 1

[State 2040, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Gram - Air
[Statedef 2050]
type = A
movetype = A
physics = N
ctrl = 0
anim = 2020
juggle = 6
poweradd = 70
sprpriority = 1

[State 2050, 1]
type = VelMul
trigger1 = time = 0
x = .15
y = .15

[State 2050, 2]
type = VelAdd
trigger1 = time = 0
trigger1 = Vel Y = [-.1,.1]
y = ifelse(Vel Y <= 0, .1, -.1)

[State 2050, 3]
type = VelSet
trigger1 = Pos Y >= 0
y = 0

[State 2050, 5]
type = Explod
trigger1 = time = 0
ID = 7462
anim = 2021
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1

[State 2050, 6]
type = Helper
trigger1 = time = 0
ID = 667
name = "Sword Trace"
StateNo = 2031
postype = p1
pos = 0, 0
ownpal = 1

[State 2050, 7]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 0
channel = 0

[State 2050, 8]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 3

[State 2050, 9]
type = HitDef
trigger1 = AnimElem = 7
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 11
animtype = hard
priority = 4, Hit
damage = 80, 3
sparkno = S6021
sparkxy = -5, -86
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -5, -4.5
ground.hittime = 17
air.type = low
air.velocity = -5, -1
air.hittime = 20
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -9
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 50
getpower = 75

[State 2050, 10]
type = EnvColor
trigger1 = MoveHit
time = 2
persistent = 0
ignorehitpause = 1

[State 2050, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Jump Up
[Statedef 2060]
type = S
movetype = I
physics = S, A
ctrl = 0
anim = 2030
velset = 0, 0
poweradd = 25
sprpriority = 1

[State 2060, 1]
type = VarSet
trigger1 = time = 0
v = 15
value = ifelse(command = "x", 1, ifelse(command = "y", 2, 3))

[State 2060, 2]
type = Explod
trigger1 = time = 1
ID = 3232
anim = 6120
postype = p1
pos = 32, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2060, 3]
type = VelSet
triggerall = var(15) = 1
trigger1 = AnimElem = 2
x = -(BackEdgeDist * .035)
y = -5.5

[State 2060, 4]
type = VelSet
triggerall = var(15) = 2
trigger1 = AnimElem = 2
x = -(BackEdgeDist * .035)
y = -7

[State 2060, 5]
type = VelSet
triggerall = var(15) = 3
trigger1 = AnimElem = 2
x = -(BackEdgeDist * .035)
y = -8.5

[State 2060, 5a]
type = VelSet
trigger1 = Vel X > 0
x = 0

[State 2060, 6]
type = StateTypeSet
trigger1 = AnimElem = 2
StateType = A
physics = N

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

[State 2060, 8]
type = VelAdd
trigger1 = time > 3
y = .2

[State 2060, 9]
type = ChangeState
triggerall = AnimElemNo(0) = [9,11]
trigger1 = Facing = 1
trigger1 = ScreenPos X <= 17
trigger2 = Facing = -1
trigger2 = ScreenPos X >= 302
value = 2070

[State 2060, 9a]
type = Width
trigger1 = 1
value = 0, -17

[State 2060, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52

;---------------------------------------------------------------------------
; Kabe Haritsuki Air
; Jump Up
[Statedef 2061]
type = A
movetype = I
physics = A
ctrl = 0
juggle = 8
anim = 2030
velset = 0, 0
poweradd = 25
sprpriority = 1

[State 2061, 1]
type = VarSet
trigger1 = time = 0
v = 15
value = ifelse(command = "x", 1, ifelse(command = "y", 2, 3))

[State 2061, 2]
type = Explod
trigger1 = time = 1
ID = 3232
anim = 6120
postype = p1
pos = 32, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2060, 3]
type = VelSet
triggerall = var(15) = 1
trigger1 = AnimElem = 2
x = -(BackEdgeDist * .035)
y = -1.1

[State 2061, 4]
type = VelSet
triggerall = var(15) = 2
trigger1 = AnimElem = 2
x = -(BackEdgeDist * .035)
y = -8

[State 2061, 5]
type = VelSet
triggerall = var(15) = 3
trigger1 = AnimElem = 2
x = -(BackEdgeDist * .035)
y = -20

[State 2061, 5a]
type = VelSet
trigger1 = Vel X > 0
x = 0

[State 2061, 6]
type = StateTypeSet
trigger1 = AnimElem = 2
StateType = A
physics = N

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

[State 2061, 8]
type = VelAdd
trigger1 = time > 3
y = .2

[State 2061, 9]
type = ChangeState
triggerall = AnimElemNo(0) = [9,11]
trigger1 = Facing = 1
trigger1 = ScreenPos X <= 17
trigger2 = Facing = -1
trigger2 = ScreenPos X >= 302
value = 2070

[State 2061, 9a]
type = Width
trigger1 = 1
value = 0, -17

[State 2061, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52

;---------------------------------------------------------------------------


; Kabe Haritsuki
; Grab Wall
[Statedef 2070]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2040
velset = 0, 0
sprpriority = 1

[State 2070, 0]
type = VarSet
trigger1 = PrevStateNo = 2060
v = 15
value = 0

[State 2070, 1]
type = PosAdd
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2070, 2]
type = PosAdd
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2070, 3]
type = PosAdd
trigger1 = ScreenPos Y < 101
y = -(ScreenPos Y - 101)

[State 2070, 4]
type = PlayerPush
trigger1 = 1
value = 0

[State 2070, 4a]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0, 1

[State 2070, 4b]
type = Width
trigger1 = 1
value = 0, -17

[State 2070, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 2080

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Idle
[Statedef 2080]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2050
velset = 0, 0
sprpriority = 1

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

[State 2080, 1]
type = PosAdd
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2080, 2]
type = PosAdd
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2080, 3]
type = Helper
trigger1 = time = 0
ID = 8008
name = "Scarf"
StateNo = 2081
postype = p1
pos = 0, 0
ownpal = 1

[State 2080, 4]
type = VarAdd
trigger1 = 1
v = 15
value = 1

[State 2080, 4a]
type = Width
trigger1 = 1
value = 0, -17

[State 2080, 5]
type = ChangeState
trigger1 = command = "holdup"
value = 2100

[State 2080, 6]
type = ChangeState
trigger1 = command = "holddown"
value = 2110

[State 2080, 7]
type = ChangeState
trigger1 = command = "SwitchWalls"
value = 2120

[State 2080, 8]
type = ChangeState
trigger1 = command = "FallOff"
trigger2 = var(15) >= 360
trigger3 = Win
value = 2090

[State 2080, 9]
type = ChangeState
trigger1 = command = "x" || command = "y" || command = "z"
value = 2130

[State 2080, 9a]
type = ChangeState
trigger1 = command = "a" || command = "b" || command = "c"
trigger1 = command = "holddown"
value = 2135

[State 2080, 10]
type = ChangeState
trigger1 = command = "a"
value = 2140

[State 2080, 11]
type = ChangeState
trigger1 = command = "b"
value = 2150

[State 2080, 12]
type = ChangeState
trigger1 = command = "c"
value = 2160

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Scarf (Idle)
[Statedef 2081]
type = A
movetype = I
physics = N
anim = 2060
sprpriority = 2

[State 2081, 1]
type = BindToParent
trigger1 = time = 0
pos = 26, -79
time = -1

[State 2081, 2]
type = DestroySelf
trigger1 = Parent, StateNo != 2080
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Fall Off Wall
[Statedef 2090]
type = A
movetype = I
physics = N
ctrl = 0
anim = 44
velset = 2, -4

[State 2090, 1]
type = Gravity
trigger1 = 1

[State 2090, 2]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Land From Fall
[Statedef 2091]
type = S
movetype = I
physics = S
ctrl = 0
anim = 47
velset = 0, 0

[State 2091, Jump Land Sound]
type = PlaySnd
trigger1 = time = 0
value = 2, 2

[State 2091, Landing Wave]
type = Explod
trigger1 = time = 0
ID = 589
anim = 6010
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = -2

[State 2091, 1]
type = PosSet
trigger1 = time = 0
y = 0

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Climb Up
[Statedef 2100]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2070
sprpriority = 1

[State 2100, 0]
type = Helper
trigger1 = time = 0
ID = 9009
name = "Scarf"
StateNo = 2101
postype = p1
pos = 0, 0
ownpal = 1

[State 2100, 1]
type = PosAdd
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2100, 2]
type = PosAdd
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2100, 3a]
type = Width
trigger1 = 1
value = 0, -17

[State 2100, 3]
type = VelSet
triggerall = ScreenPos Y > 101
trigger1 = command = "holdup"
y = -5

[State 2100, 3a]
type = VelSet
trigger1 = ScreenPos Y <= 101
y = 0

[State 2100, 3b]
type = PlayerPush
trigger1 = 1
value = 0

[State 2100, 4]
type = VarAdd
trigger1 = 1
v = 15
value = 1

[State 2100, 5]
type = ChangeState
trigger1 = command = "FallOff"
trigger2 = var(15) >= 360
value = 2090

[State 2100, 6]
type = ChangeState
trigger1 = command = "SwitchWalls"
value = 2120

[State 2100, 7]
type = ChangeState
trigger1 = command = "x" || command = "y" || command = "z"
value = 2130

[State 2100, 7a]
type = ChangeState
trigger1 = command = "a" || command = "b" || command = "c"
trigger1 = command = "holddown"
value = 2135

[State 2100, 8]
type = ChangeState
trigger1 = command = "a"
value = 2140

[State 2100, 9]
type = ChangeState
trigger1 = command = "b"
value = 2150

[State 2100, 10]
type = ChangeState
trigger1 = command = "c"
value = 2160

[State 2100, 11]
type = ChangeState
trigger1 = command != "holdup"
value = 2080

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Climbing Scarf
[Statedef 2101]
type = A
movetype = I
physics = N
anim = 2060
sprpriority = 2

[State 2101, 1]
type = BindToParent
trigger1 = Parent, AnimElemNo(0) = 1
pos = 25, -81

[State 2101, 2]
type = BindToParent
trigger1 = Parent, AnimElemNo(0) = 2
pos = 21, -85

[State 2101, 3]
type = BindToParent
trigger1 = Parent, AnimElemNo(0) = 3
pos = 20, -86

[State 2101, 4]
type = BindToParent
trigger1 = Parent, AnimElemNo(0) = 4
pos = 21, -85

[State 2101, 5]
type = BindToParent
trigger1 = Parent, AnimElemNo(0) = 5
pos = 25, -81

[State 2101, 6]
type = BindToParent
trigger1 = Parent, AnimElemNo(0) = 6
pos = 26, -79

[State 2101, 7]
type = DestroySelf
trigger1 = Parent, StateNo != 2100
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Descend
[Statedef 2110]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2110
velset = 0, 0
sprpriority = 1

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

[State 2110, 1]
type = PosAdd
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2110, 2]
type = PosAdd
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2110, 3]
type = VelSet
triggerall = Pos Y < 0
trigger1 = command = "holddown"
y = 8

[State 2110, 4]
type = VelSet
trigger1 = Pos Y >= 0
y = 0

[State 2110, 5]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 2110, 5a]
type = Width
trigger1 = 1
value = 0, -17

[State 2110, 6]
type = Explod
trigger1 = Random <= 100
ID = 1122
anim = 6000
postype = p1
pos = -18, -117
bindtime = 1
removetime = -2
vel = 0, -0.5
sprpriority = 3
ownpal = 1

[State 2110, 7]
type = VarAdd
trigger1 = 1
v = 15
value = 1

[State 2110, 8]
type = ChangeState
trigger1 = command = "FallOff"
trigger2 = var(15) >= 360
value = 2090

[State 2110, 9]
type = ChangeState
trigger1 = command = "SwitchWalls"
value = 2120

[State 2110, 10]
type = ChangeState
trigger1 = command = "x" || command = "y" || command = "z"
value = 2130

[State 2110, 10a]
type = ChangeState
trigger1 = command = "a" || command = "b" || command = "c"
trigger1 = command = "holddown"
value = 2135

[State 2110, 11]
type = ChangeState
trigger1 = command = "a"
value = 2140

[State 2110, 12]
type = ChangeState
trigger1 = command = "b"
value = 2150

[State 2110, 13]
type = ChangeState
trigger1 = command = "c"
value = 2160

[State 2110, 14]
type = ChangeState
trigger1 = command != "holddown"
value = 2080

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Switch Walls
[Statedef 2120]
type = A
movetype = A
physics = S
ctrl = 0
anim = 2120
velset = 0, 0
sprpriority = 1

[State 2120, 0]
type = Width
trigger1 = 1
value = -16, -17

[State 2120, 1]
type = VarAdd
trigger1 = 1
v = 15
value = 1

[State 2120, 2]
type = VelSet
trigger1 = AnimElem = 5
x = 90

[State 2120, 3]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 2
channel = 0

[State 2120, 3a]
type = HitDef
trigger1 = AnimElem = 5
attr = S, HA
hitflag = MA
guardflag = MA
pausetime = 1, 15
priority = 7, Hit
animtype = hard
damage = 100
sparkno = S6085
sparkxy = -5, -45
hitsound = S1, 7
stand.friction = .00
crouch.friction = .00
ground.type = low
ground.hittime = 100
ground.velocity = -1, -4
ground.cornerpush.veloff = -0
air.velocity = -1, -4
air.hittime = 11
guardsound = S1, 6
guard.pausetime = 10, 10
guard.slidetime = 15
guard.hittime = 20
guard.velocity = -20
fall = 1
air.fall = 1
givepower = 10
getpower = 50

[State 2120, 4]
type = Turn
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 302
trigger2 = Facing = -1
trigger2 = ScreenPos X <= 17

[State 2120, 5]
type = ChangeState
triggerall = time > 10
trigger1 = Facing = 1
trigger1 = ScreenPos X <= 17
trigger2 = Facing = -1
trigger2 = ScreenPos X >= 302
value = 2070

[State 2120, 6]
type = PlayerPush
trigger1 = 1
value = 0

[State 2120, 6b]
type = Null ;Width
trigger1 = 1
value = 0, -17

[State 2120, 7]
type = ChangeState
trigger1 = var(15) > 360
value = 2090

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

; Screen Scroller
[Statedef 2121]
type = A
movetype = I
physics = N
anim = 9999
velset = 11, 0

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

[State 2121, 2]
type = DestroySelf
trigger1 = Parent, StateNo != 2120
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Swing Cypher
[Statedef 2130]
type = A
movetype = A
physics = N
ctrl = 0
anim = 2080
poweradd = 50
juggle = 6
velset = 0, 0
sprpriority = 1

[State 2130, a]
type = PosAdd
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2130, 0]
type = PosAdd
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2130, 1]
type = Helper
trigger1 = time = 0
ID = 1212
name = "Sword Trace"
StateNo = 211
postype = p1
pos = 0, 0
ownpal = 1

[State 2130, 2]
type = PlaySnd
trigger1 = time = 0
value = 6, 0
channel = 0

[State 2130, 3]
type = PlaySnd
trigger1 = time = 0
value = 0, 3

[State 2130, 3a]
type = Width
trigger1 = 1
value = 0, -17

[State 2130, 4]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 11
animtype = hard
priority = 6, Hit
damage = 27, 2
sparkno = S6021
sparkxy = -5, -76
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -4, -5.5
ground.hittime = 20
air.type = low
air.velocity = -4, -2
air.hittime = 25
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -7.5
givepower = 30
getpower = 55

[State 2130, 5]
type = VarAdd
trigger1 = 1
v = 15
value = 1

[State 2130, 6]
type = PlayerPush
trigger1 = 1
value = 0

[State 2130, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 2080

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Slide Kick Down Wall
[Statedef 2135]
type = A
movetype = A
physics = N
ctrl = 0
anim = 2105
velset = 0, 0
sprpriority = 1

[State 2135, 0]
type = VarAdd
trigger1 = 1
v = 15
value = 1

[State 2135, 1]
type = PosAdd
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2135, 2]
type = PosAdd
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

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

[State 2135, 4]
type = PlayerPush
trigger1 = 1
value = 0

[State 2135, 4a]
type = Width
trigger1 = 1
value = 0, -17

[State 2135, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2

[State 2135, 6]
type = VelSet
trigger1 = AnimElem = 3
y = 10

[State 2135, 6a]
type = VelSet
trigger1 = Pos Y >= 0
y = 0

[State 2135, 6b]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 2135, 7]
type = Explod
trigger1 = AnimElemNo(0) = [3,7]
trigger1 = Random <= 300
ID = 5432
anim = 6000
postype = p1
pos = -15, -112
bindtime = 1
removetime = -2
vel = 0, -.5
sprpriority = 3
ownpal = 1

[State 2135, 8]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
hitflag = MAFD
guardflag = HA
pausetime = 20, 20
animtype = Hard
priority = 6, Hit
damage = 100, 2
sparkno = 2
sparkxy = -5, 8
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.slidetime = 19
ground.hittime = 19
ground.velocity = -9, -20
air.velocity = -4, 20
air.hittime = 20
down.velocity = -3, -10
down.hittime = 20
guard.slidetime = 17
guard.hittime = 17
guard.velocity = -15
givepower = 40
getpower = 80

[State 2135, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 2080

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Short Kick Off Wall
[Statedef 2140]
type = A
movetype = A
physics = N
ctrl = 0
anim = 2090
poweradd = 50
juggle = 5
velset = 0, 0

[State 2140, 1]
type = PosAdd
triggerall = AnimElemNo(0) = [1,4]
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2140, 2]
type = PosAdd
triggerall = AnimElemNo(0) = [1,4]
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2140, 2a]
type = Width
trigger1 = 1
value = 0, -17

[State 2140, 3]
type = VelSet
trigger1 = AnimElem = 5
x = 6
y = 13

[State 2140, 4]
type = Gravity
trigger1 = AnimElemNo(0) = [6,7]

[State 2140, 5]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 10
channel = 0

[State 2140, 6]
type = HitDef
trigger1 = AnimElem = 5
attr = A, SA
hitflag = MAFD
guardflag = HA
pausetime = 15, 30
animtype = hard
priority = 5, Hit
damage = 81, 3
sparkno = 2
sparkxy = -5, 0
hitsound = S1, 1
guardsound = S1, 6
ground.type = low
ground.velocity = -5, -4
ground.hittime = 20
air.type = high
air.velocity = -5, 6
air.hittime = 15
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -8
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 30
getpower = 50

[State 2140, 7]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Mid Kick Off Wall
[Statedef 2150]
type = A
movetype = A
physics = N
ctrl = 0
anim = 2100
poweradd = 50
juggle = 5
velset = 0, 0

[State 2150, 1]
type = PosAdd
triggerall = AnimElemNo(0) = [1,4]
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2150, 2]
type = PosAdd
triggerall = AnimElemNo(0) = [1,4]
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2150, 2a]
type = Width
trigger1 = 1
value = 0, -17

[State 2150, 3]
type = VelSet
trigger1 = AnimElem = 5
x = 12
y = 13

[State 2150, 4]
type = Gravity
trigger1 = AnimElemNo(0) = [6,7]

[State 2150, 5]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 10
channel = 0

[State 2150, 6]
type = HitDef
trigger1 = AnimElem = 5
attr = A, SA
hitflag = MAFD
guardflag = HA
pausetime = 15, 30
animtype = hard
priority = 5, Hit
damage = 81, 3
sparkno = 2
sparkxy = -5, 0
hitsound = S1, 1
guardsound = S1, 6
ground.type = low
ground.velocity = -5, -4
ground.hittime = 20
air.type = high
air.velocity = -5, 6
air.hittime = 15
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -8
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 30
getpower = 50

[State 2150, 7]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Far Kick Off Wall
[Statedef 2160]
type = A
movetype = A
physics = N
ctrl = 0
anim = 2100
poweradd = 50
juggle = 5
velset = 0, 0

[State 2160, 1]
type = PosAdd
triggerall = AnimElemNo(0) = [1,4]
triggerall = Facing = 1
trigger1 = ScreenPos X != 16
x = -(ScreenPos X - 16)

[State 2160, 2]
type = PosAdd
triggerall = AnimElemNo(0) = [1,4]
triggerall = Facing = -1
trigger1 = ScreenPos X != 304
x = ScreenPos X - 304

[State 2160, 2a]
type = Width
trigger1 = 1
value = 0, -17

[State 2160, 3]
type = VelSet
trigger1 = AnimElem = 5
x = 20
y = 13

[State 2160, 4]
type = Gravity
trigger1 = AnimElemNo(0) = [6,7]

[State 2160, 5]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 10
channel = 0

[State 2160, 6]
type = HitDef
trigger1 = AnimElem = 5
attr = A, SA
hitflag = MAFD
guardflag = HA
pausetime = 15, 30
animtype = hard
priority = 5, Hit
damage = 81, 3
sparkno = 2
sparkxy = -5, 0
hitsound = S1, 1
guardsound = S1, 6
ground.type = low
ground.velocity = -5, -4
ground.hittime = 20
air.type = high
air.velocity = -5, 6
air.hittime = 15
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -8
envshake.time = 15
envshake.freq = 80
envshake.ampl = -2
givepower = 30
getpower = 50

[State 2160, 7]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

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

;---------------------------------------------------------------------------
; Kabe Haritsuki
; Slash From Kick
[Statedef 2161]
type = A
movetype = A
physics = A
anim = 2101
juggle = 8
ctrl = 0
velset = -1, -5
sprpriority = 1

[State 2161, Descend]
type = VelAdd
trigger1 = 1
y = 0.001

[State 2161, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = S0,3
volume = 255

[State 2161, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
getpower = 60
givepower = 30
pausetime = 11, 40
animtype = Hard          ;light,medium,hard,back,up,diagup
air.animtype = Hard
priority = 6,Hit   ;Hit,Miss,Dodge
damage = 80,0
sparkno = S6021
sparkxy = 0,-20
hitsound = S1,7
guardsound = 0,3
ground.type = High      ;Low,Trip,None
air.type = Low
air.hittime = 20
ground.velocity = -0.3,-7
guard.velocity = 8
air.velocity = -1,-8
airguard.velocity = -0.3,-1
sprpriority = 1
fall = 1
down.velocity = -0.3,-30
down.bounce = 1
kill = 1
guard.kill = 1
fall.kill = 1
ignorehitpause = 1

[State 2161, Changestate]
type = ChangeState
trigger1 = Pos Y >= 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Formation A
; Hiryu Summons Tiger
[Statedef 2170]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2130
poweradd = 50
velset = 0, 0
sprpriority = 1

[State 2170, 1]
type = Explod
trigger1 = time = 1
ID = 0455
anim = 6120
postype = p1
pos = 39, 4
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2170, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 3
channel = 0

[State 2170, 3]
type = Helper
trigger1 = AnimElem = 3
ID = 7307
name = "Robo-Tiger"
StateNo = 2180
postype = back
pos = -95, 0
ownpal = 1

[State 2170, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Formation A
; Tiger Run At Enemy
[Statedef 2180]
type = S
movetype = A
physics = N
anim = 2140
velset = 5, 0
sprpriority = 2

[State 2240, AfterImage]
type = AfterImage
trigger1 = time =1
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 2180, 1]
type = PlaySnd
trigger1 = time = 0
value = 3, 2

[State 2180, 2]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 2180, 3]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 2180, 4]
type = HitDef
trigger1 = time = 0
attr = S, SA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
animtype = hard
priority = 5, Hit
damage = 80, 3
sparkno = S6510
sparkxy = -5, -45
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -9
ground.hittime = 29
air.type = low
air.velocity = -1.5, -9
air.hittime = 30
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -6.5
down.velocity = -2, -6
down.hittime = 20
sprpriority = 2
givepower = 35
getpower = 50

[State 2180, 5]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 2180, 6]
type = MoveHitReset
trigger1 = MoveHit

[State 2180, 7]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 2180, 8]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 2180, 9]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 900
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -500

;---------------------------------------------------------------------------
; Formation A
; Tiger Explode
[Statedef 2190]
type = A
movetype = I
physics = N
anim = 2150
velset = 0, 0
sprpriority = 2

[State 2190, 1]
type = PlaySnd
trigger1 = time = 0
value = 3, 0

[State 2190, 2]
type = Explod
trigger1 = time = 0
ID = 1113
anim = 660
postype = p1
pos = 0, -58
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2190, 3]
type = DestroySelf
trigger1 = time = 29

;---------------------------------------------------------------------------
; Formation B
; Summon Satellite
[Statedef 2200]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2160
poweradd = 25
velset = 0, 0
sprpriority = 1

[State 2200, 0]
type = VarSet
trigger1 = time = 0
v = 6
value = 0

[State 2200, 1]
type = Explod
trigger1 = time = 1
ID = 1111
anim = 6120
postype = p1
pos = 35, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2200, 2]
type = PlaySnd
trigger1 = AnimElem = 4
value = 6, 2
channel = 0

[State 2200, 3]
type = Helper
trigger1 = AnimElem = 5
ID = 8135
name = "Ouroboro"
StateNo = 2230
postype = p1
pos = -38, -43
ownpal = 1

[State 2200, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Formation B
; Release Satellite - Ground
[Statedef 2210]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2180
poweradd = 50
velset = 0, 0
sprpriority = 1

[State 2210, 0]
type = Explod
trigger1 = time = 1
ID = 1132
anim = 6120
postype = p1
pos = 28, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2210, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 6, 11
channel = 0

[State 2210, 2]
type = VarSet
trigger1 = AnimElem = 4
v = 6
value = 1

[State 2210, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Formation B
; Release Satellite - Air
[Statedef 2220]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2190
poweradd = 50
velset = 0, 0
sprpriority = 1

[State 2220, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 6, 11
channel = 0

[State 2220, 2]
type = VarSet
trigger1 = AnimElem = 4
v = 6
value = 1

[State 2220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = ifelse(var(4), 810, 50)
ctrl = var(4)

;---------------------------------------------------------------------------
; Formation B
; Ouroboro Idle
[Statedef 2230]
type = A
movetype = I
physics = N
anim = 2170
sprpriority = 2

[State 2230, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 2230, 1]
type = BindToParent
trigger1 = 1
pos = -31, -51
time = 1

[State 2230, 2]
type = Turn
trigger1 = Facing != parent, Facing

[State 2230, 3]
type = ChangeState
trigger1 = parent, var(6) = 1
value = 2240

[State 2230, 4]
type = ChangeState
trigger1 = !(Parent, Alive)
trigger2 = Parent, Win
trigger3 = Parent, Lose
value = 2260

[State 2230, 5]
type = AssertSpecial
trigger1 = parent, StateNo = [3230,3270]
trigger1 = Parent, MoveType != H
flag = invisible

;---------------------------------------------------------------------------
; Formation B
; Satellite Fireball
[Statedef 2240]
type = A
movetype = A
physics = N
anim = 2200
velset = 2, 0
sprpriority = 3

[State 2240, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256

Trans = add

[State 2240, 1]
type = PosAdd
trigger1 = time = 0
x = 25

[State 2240, 2]
type = PlaySnd
trigger1 = time = 0
value = 3, 3

[State 2240, 3]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA, HA, NT, ST, HT
ignorehitpause = 1

[State 2240, 4]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2250
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 2240, 5]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 2240, 6]
type = HitDef
trigger1 = time = 0
attr = A, SP
hitflag = MAFD
guardflag = MA
pausetime = 5, 10
animtype = back
priority = 5, Hit
damage = 95, 2
sparkno = S6510
sparkxy = 0, 0
hitsound = S1, 3
guardsound = S1, 6
ground.type = hard
ground.velocity = -2, -2
air.velocity = -2, -2
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -9
fall = 1
air.fall = 1
fall.recovertime = 35
palfx.time = 40
palfx.add = 72,-19,-204
palfx.mul = 338,389,256
palfx.sinadd = 61,20,10,15
palfx.invertall = 1
palfx.color = 15
givepower = 35
getpower = 45

[State 2240, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 2240, 8]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 2240, 9]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 2240, 10]
type = ChangeState
trigger1 = MoveContact
value = 2250

[State 2240, 11]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 480
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -160

;---------------------------------------------------------------------------
; Formation B
; Satellite Explode
[Statedef 2250]
type = A
movetype = I
physics = N
anim = 660
velset = 0, 0
sprpriority = 2
movehitpersist = 1

[State 2250, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 2250, 1]
type = PlaySnd
trigger1 = time = 0
value = 3, 0

[State 2250, 2]
type = VarSet
triggerall = NumTarget > 0
triggerall = !(Target, IsHelper)
trigger1 = time = 0
v = 0
value = floor(Target, const(size.mid.pos.x))

[State 2250, 3]
type = VarSet
triggerall = NumTarget > 0
triggerall = !(Target, IsHelper)
trigger1 = time = 0
v = 1
value = floor(Target, const(size.mid.pos.y))

[State 2250, 4]
type = Explod
triggerall = MoveHit
triggerall = NumTarget > 0
triggerall = !(Target, IsHelper)
trigger1 = time = 0
ID = 8899
anim = 6130
postype = p2
pos = var(0), var(1)
bindtime = -1
removetime = -2
sprpriority = -3
ownpal = 1

[State 2250, 5]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Formation B
; Satellite Fall To Ground
[Statedef 2260]
type = A
movetype = I
physics = N
anim = 650
velset = 0, 0
sprpriority = 2

[State 2260, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 2260, 1]
type = VelAdd
trigger1 = 1
y = .35

[State 2260, 2]
type = ChangeState
trigger1 = Pos Y >= 0
value = 2265

; Hit Ground and Walk Away
[Statedef 2265]
type = S
movetype = I
physics = N
anim = 650
velset = 0, 0

[State 2265, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 2265, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 2265, 2]
type = ChangeAnim
trigger1 = time = 50
value = 655

[State 2265, 3]
type = VelSet
trigger1 = time = 50
x = -3

[State 2265, 4]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X <= -20
trigger2 = Facing = -1
trigger2 = ScreenPos X >= 340

;---------------------------------------------------------------------------
; Vajra
; LK Version
[Statedef 2270]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2210
velset = 0, 0

[State 2270, 1]
type = VarSet
trigger1 = time = 0
v = 15
value = 80

[State 2270, 2]
type = ChangeState
trigger1 = time = 0
value = 2280

;---------------------------------------------------------------------------
; Vajra
; MK Version
[Statedef 2271]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2210
velset = 0, 0

[State 2271, 1]
type = VarSet
trigger1 = time = 0
v = 15
value = 160

[State 2271, 2]
type = ChangeState
trigger1 = time = 0
value = 2280

;---------------------------------------------------------------------------
; Vajra
; HK Version
[Statedef 2272]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2210
velset = 0, 0

[State 2272, 1]
type = VarSet
trigger1 = time = 0
v = 15
value = 240

[State 2272, 2]
type = ChangeState
trigger1 = time = 0
value = 2280

;---------------------------------------------------------------------------
; Vajra
; Teleport Out
[Statedef 2280]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2210
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2280, 1]
type = Explod
trigger1 = time = 1
ID = 1312
anim = 6120
postype = p1
pos = 36, -1
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2280, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 1
channel = 0

[State 2280, 3]
type = Explod
trigger1 = AnimElem = 4
ID = 0997
anim = 2220
postype = p1
pos = 30, 0
bindtime = 1
removetime = -2
vel = 6, -11
sprpriority = 1
ownpal = 1

[State 2280, 4]
type = Explod
trigger1 = AnimElem = 4
ID = 0998
anim = 2230
postype = p1
pos = 45, 20
bindtime = 1
removetime = -2
vel = 11, -2
sprpriority = 2
ownpal = 1

[State 2280, 5]
type = Explod
trigger1 = AnimElem = 4
ID = 0999
anim = 2230
postype = p1
pos = -15, 20
facing = -1
bindtime = 1
removetime = -2
vel = -11, -2
sprpriority = 0
ownpal = 1

[State 2280, 6]
type = Turn
trigger1 = AnimElem = 4

[State 2280, 7]
type = PosAdd
trigger1 = AnimElem = 4
x = 30

[State 2280, 8]
type = StateTypeSet
trigger1 = AnimElem = 4
StateType = A
Physics = N

[State 2280, 9]
type = VelSet
trigger1 = AnimElem = 4
x = 6
y = -11

[State 2280, 10]
type = ScreenBound
trigger1 = time > 13
value = 0
movecamera = 1, 1

[State 2280, 11]
type = PosSet
trigger1 = AnimTime = 0
y = 0

[State 2280, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 2290

;---------------------------------------------------------------------------
; Vajra
; Teleport In
[Statedef 2290]
type = A
movetype = A
physics = N
ctrl = 0
juggle = 7
anim = 9999
velset = 0, 0

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

[State 2290, 2]
type = Turn
trigger1 = time = 0

[State 2290, 3]
type = PosAdd
trigger1 = time = 0
x = Facing * (var(15) - ScreenPos X)

[State 2290, 4]
type = Helper
trigger1 = time = 0
ID = 6767
name = "Image"
StateNo = 2295
postype = p1
pos = 100, -200
facing = -1
ownpal = 1

[State 2290, 5]
type = Helper
trigger1 = time = 0
ID = 6768
name = "Image"
StateNo = 2296
postype = p1
pos = 240, -120
facing = -1
ownpal = 1

[State 2290, 6]
type = Helper
trigger1 = time = 0
ID = 6768
name = "Image"
StateNo = 2296
postype = p1
pos = -240, -120
ownpal = 1

[State 2290, 7]
type = PosAdd
trigger1 = time = 1
y = -200

[State 2290, 8]
type = ChangeAnim
trigger1 = time = 1
value = 2240

[State 2290, 9]
type = PosAdd
trigger1 = time = 1
x = -40 ;* Facing

[State 2290, 10]
type = Explod
trigger1 = AnimElem = 4
ID = 7676
anim = 2270
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2290, 11]
type = PlaySnd
trigger1 = AnimElem = 4
value = 6, 10
channel = 0

[State 2290, 12]
type = VelSet
trigger1 = AnimElem = 4
x = 3.5
y = 13

[State 2290, 13]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
hitflag = MAFD
guardflag = HA
pausetime = 11, 11
animtype = hard
priority = 5, Hit
damage = 100, 2
sparkno = 2
sparkxy = -5, 0
hitsound = S1, 1
guardsound = S1, 6
ground.type = high
ground.velocity = -3, -8
air.type = low
air.velocity = -3, 6
down.velocity = -3, -4
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8.5
fall = 1
air.fall = 1
fall.recovertime = 30
givepower = 40
getpower = 60

[State 2290, 14]
type = RemoveExplod
triggerall = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 7676

[State 2290, 15]
type = ChangeState
triggerall = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

;---------------------------
; Image States
[Statedef 2295]
type = A
movetype = I
physics = N
anim = 2250
velset = 0, 0
sprpriority = 1

[State 2295, 1]
type = VelSet
trigger1 = time = 11
x = 3.5
y = 13

[State 2295, 2]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = Parent, MoveType = H

; Sideways Image
[Statedef 2296]
type = A
movetype = I
physics = N
anim = 2260
velset = 0, 0
sprpriority = 1

[State 2296, 1]
type = VelSet
trigger1 = time = 11
x = 17
y = 8

[State 2296, 2]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Warp
; LP
[Statedef 2300]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0

[State 2300, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = 80

[State 2300, 2]
type = VarSet
trigger1 = time = 0
v = 15
value = -135

[State 2300, 3]
type = ChangeState
trigger1 = time = 0
value = 2310

; MP
[Statedef 2301]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0

[State 2301, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = 160

[State 2301, 2]
type = VarSet
trigger1 = time = 0
v = 15
value = -135

[State 2301, 3]
type = ChangeState
trigger1 = time = 0
value = 2310

; HP
[Statedef 2302]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0

[State 2302, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = 240

[State 2302, 2]
type = VarSet
trigger1 = time = 0
v = 15
value = -135

[State 2302, 3]
type = ChangeState
trigger1 = time = 0
value = 2310

; LK
[Statedef 2303]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0

[State 2303, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = 80

[State 2303, 2]
type = VarSet
trigger1 = time = 0
v = 15
value = -50

[State 2303, 3]
type = ChangeState
trigger1 = time = 0
value = 2310

; MK
[Statedef 2304]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0

[State 2304, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = 160

[State 2304, 2]
type = VarSet
trigger1 = time = 0
v = 15
value = -50

[State 2304, 3]
type = ChangeState
trigger1 = time = 0
value = 2310

; HK
[Statedef 2305]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0, 0

[State 2305, 1]
type = VarSet
trigger1 = time = 0
v = 1
value = 240

[State 2305, 2]
type = VarSet
trigger1 = time = 0
v = 15
value = -50

[State 2305, 3]
type = ChangeState
trigger1 = time = 0
value = 2310

;---------------------------------------------------------------------------
; Warp
; Warp Out
[Statedef 2310]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2280
poweradd = 65
sprpriority = 1

[State 2310, 1]
type = Explod
trigger1 = time = 1
ID = 1312
anim = 6120
postype = p1
pos = 32, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2310, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2320

;---------------------------------------------------------------------------
; Warp
; Warp In
[Statedef 2320]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2290
sprpriority = 1

[State 2320, 1]
type = PosSet
trigger1 = time = 0
y = var(15)

[State 2320, 2]
type = PosAdd
trigger1 = time = 0
x = Facing * (var(1) - ScreenPos X)

[State 2320, 3]
type = PlaySnd
trigger1 = AnimElem = 4
value = 6, 2
channel = 0

[State 2320, 3]
type = Gravity
trigger1 = AnimElemNo(0) > 4

[State 2320, 4]
type = CtrlSet
trigger1 = AnimElem = 5
value = 1

[State 2320, 5]
type = AssertSpecial
trigger1 = AnimElemNo(0) > 4
flag = NoAirGuard

[State 2320, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

;---------------------------------------------------------------------------
; Formation C
; LK - Call Falcon
[Statedef 2330]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2300
poweradd = 70
velset = 0, 0
sprpriority = 1

[State 2330, 1]
type = Explod
trigger1 = time = 1
ID = 1112
anim = 6120
postype = p1
pos = 44, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2330, 2]
type = PlaySnd
trigger1 = AnimElem = 6
value = 6, 4
channel = 0

[State 2330, 3]
type = VarSet
trigger1 = time = 0
v = 1
value = 150

[State 2330, 4]
type = Helper
trigger1 = AnimElem = 6
ID = 5198
name = "Falcon"
StateNo = 2360
postype = back
pos = -55, -230
ownpal = 1

[State 2330, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Formation C
; MK - Call Falcon
[Statedef 2340]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2300
poweradd = 70
velset = 0, 0
sprpriority = 1

[State 2340, 1]
type = Explod
trigger1 = time = 1
ID = 1112
anim = 6120
postype = p1
pos = 44, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2340, 2]
type = PlaySnd
trigger1 = AnimElem = 6
value = 6, 4
channel = 0

[State 2340, 3]
type = VarSet
trigger1 = time = 0
v = 1
value = 210

[State 2340, 4]
type = Helper
trigger1 = AnimElem = 6
ID = 5198
name = "Falcon"
StateNo = 2360
postype = back
pos = -55, -230
ownpal = 1

[State 2340, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Formation C
; HK - Call Falcon
[Statedef 2350]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2300
poweradd = 70
velset = 0, 0
sprpriority = 1

[State 2350, 1]
type = Explod
trigger1 = time = 1
ID = 1112
anim = 6120
postype = p1
pos = 44, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2350, 2]
type = PlaySnd
trigger1 = AnimElem = 6
value = 6, 4
channel = 0

[State 2350, 3]
type = VarSet
trigger1 = time = 0
v = 1
value = 270

[State 2350, 4]
type = Helper
trigger1 = AnimElem = 6
ID = 5198
name = "Falcon"
StateNo = 2360
postype = back
pos = -55, -230
ownpal = 1

[State 2350, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Formation C
; Falcon carry bomb
[Statedef 2360]
type = A
movetype = I
physics = N
anim = 2310
velset = 5.5, 1.2
sprpriority = 3

[State 2360, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add


[State 2360, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, var(1)

[State 2360, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = floor(Pos X + (var(0) * Facing))

[State 2360, 3]
type = ChangeState
trigger1 = Facing = 1
trigger1 = Pos X >= var(1)
trigger2 = Facing = -1
trigger2 = Pos X <= var(1)
value = 2370

;---------------------------------------------------------------------------
; Formation C
; Drop Bomb
[Statedef 2370]
type = A
movetype = I
physics = N
anim = 2320
velset = 5.5, -2
sprpriority = 2

[State 2370, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 2370, 1]
type = Helper
trigger1 = time = 0
ID = 245
name = "Bomb"
StateNo = 2380
postype = p1
pos = 14, 27
ownpal = 1

[State 2370, 2]
type = DestroySelf
triggerall = NumHelper(245) = 0
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 450
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -130

[State 2370, 3]
type = ParentVarAdd
trigger1 = var(11) > 0
v = 11
value = 1

[State 2370, 4]
type = VarAdd
trigger1 = var(11) > 0
v = 11
value = -1

;---------------------------------------------------------------------------
; Formation C
; Bomb
[Statedef 2380]
type = A
movetype = A
physics = N
anim = 2330
velset = 0, 2.5
sprpriority = 3

[State 2380, 1]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA, HA, NT, ST, HT
ignorehitpause = 1

[State 2380, 2]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2390
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 2380, 3]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 2380, 4]
type = HitDef
trigger1 = time = 0
attr = A, SA
hitflag = MAF
guardflag = MA
pausetime = 1, 11
animtype = hard
damage = 40, 2
sparkno = 3
sparkxy = -5, -16
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -5, -9
air.type = low
air.velocity = -5, -9
guard.slidetime = 20
guard.hittime = 20
guard.velocity = -9
givepower = 20
getpower = 30

[State 2380, 5]
type = VarSet
trigger1 = 1
fv = 0
value = root, fvar(1)

[State 2380, 6]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 2380, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 2380, 8]
type = ChangeState
trigger1 = MoveContact
trigger2 = Pos Y >= 0
value = 2390

;---------------------------------------------------------------------------
; Formation C
; Bomb Explode
[Statedef 2390]
type = A
movetype = A
physics = N
juggle = 10
velset = 0, 0
sprpriority = 4

[State 2390, 1]
type = VarAdd
trigger1 = 1
v = 3
value = 1

[State 2390, 2]
type = ChangeAnim
trigger1 = var(3) = 1
value = 2340

[State 2390, 3]
type = PlaySnd
trigger1 = var(3) = 1
value = 3, 1

[State 2390, 4]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA, HA, NT, ST, HT
ignorehitpause = 1

[State 2390, 5]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 2390
attr = SCA, NP, SP, HP
ignorehitpause = 1

[State 2390, 6]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP
time = 1
ignorehitpause = 1

[State 2390, 7]
type = HitDef
trigger1 = Var(3) = 1
attr = A, SA
hitflag = MAF
guardflag = MA
pausetime = 1, 11
animtype = hard
damage = 130, 5
sparkno = 3
sparkxy = -5, -10
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1, -12
air.type = low
air.velocity = -1, -12
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -7
palfx.time = 40
palfx.add = 72,-19,-204
palfx.mul = 338,389,256
palfx.sinadd = 61,20,10,15
palfx.invertall = 1
palfx.color = 15
fall = 1
air.fall = 1
fall.recovertime = 35
givepower = 40
getpower = 60

[State 2390, 8]
type = VarSet
trigger1 = 1
fv = 0
value = root, fvar(1)

[State 2390, 9]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 2390, 10]
type = VarSet
triggerall = NumTarget > 0
trigger1 = MoveHit
v = 5
value = Target, const(size.mid.pos.x)

[State 2390, 11]
type = VarSet
triggerall = NumTarget > 0
trigger1 = MoveHit
v = 6
value = Target, const(size.mid.pos.y)

[State 2390, 12]
type = Explod
trigger1 = MoveHit
ID = 4455
anim = 6130
postype = p2
pos = var(5), var(6)
bindtime = -1
removetime = -2
sprpriority = -3
ownpal = 1
persistent = 0

[State 2390, 13]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 2390, 14]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Excalibur
; LP Version
[Statedef 2400]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2350
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2400, 1]
type = Explod
trigger1 = time = 0
ID = 5566
anim = 2360
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2400, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2410

;---------------------------------------------------------------------------
; Excalibur
; LP Rush
[Statedef 2410]
type = A
movetype = A
physics = N
ctrl = 1
anim = 2370
juggle = 8
velset = 6.45, -14
sprpriority = 1

[State 2410, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2410, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 2410, 000]
type = VarSet
trigger1 = time = 0
v = 16
value = 1

[State 2410, 1]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2375
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2410, 2]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2380
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 2410, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 2410, 4]
type = PlaySnd
trigger1 = time = 0
value = 2, 8

[State 2410, 5]
type = Helper
trigger1 = (time % 2) = 1
ID = 9891
name = "Afterimage"
StateNo = 2430
postype = p1
pos = 0, 0
ownpal = 1

[State 2410, 6]
type = Helper
trigger1 = (time % 2) = 1
ID = 9892
name = "Sword Afterimage"
StateNo = 2440
postype = p1
pos = 0, 0
ownpal = 1

[State 2410, 7a]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2410, 8]
type = HitDef
triggerall = HitCount < 3
trigger1 = time = 0
trigger2 = (var(15) % var(16)) = 0
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 50, 50
animtype = hard
priority = 5, Hit
damage = 120, 5
sparkno = S6020
sparkxy = -5, -109
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -2, -5
air.velocity = -2, -18
guard.slidetime = 10
guard.hittime = 10
guard.velocity = -6
yaccel = .39
air.fall = 1
fall.recover = 0
givepower = 60
getpower = 80

[State 2410, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
v = 16
value = 1
ignorehitpause = 1

[State 2410, 10]
type = VarSet
trigger1 = HitPauseTime = 1
v = 15
value = 0
ignorehitpause = 1

[State 2410, 11]
type = VarAdd
trigger1 = MoveHit
v = 15
value = 1

[State 2410, 12]
type = RemoveExplod
trigger1 = time = 0
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
ID = 2236

[State 2410, 13]
type = ChangeState
trigger1 = time = 15
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
value = 2420

;---------------------------------------------------------------------------
; Excalibur
; End
[Statedef 2420]
type = A
movetype = I
physics = N
ctrl = 1
anim = 2490
movehitpersist = 1

[State 2420, 0]
type = VelMul
trigger1 = MoveHit
trigger1 = time = 0
x = .25
y = .25

[State 2420, 1]
type = Gravity
trigger1 = 1

[State 2420, 2]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2091

;---------------------------------------------------------------------------
; Excalibur
; Afterimage State
[Statedef 2430]
type = A
movetype = I
physics = N
sprpriority = -1

[State 2430, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, Anim

[State 2430, 2]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2430, 3]
type = VarSet
trigger1 = time = 0
v = 1
value = parent, AnimElemNo(0)

[State 2430, 4]
type = ChangeAnim
trigger1 = 1
value = var(0)
elem = var(1)

[State 2430, 5]
type = AssertSpecial
triggerall = parent, HitPauseTime = 0
trigger1 = (parent, var(1) % 2) = 1
flag = invisible

[State 2430, 6]
type = VarAdd
trigger1 = parent, HitPauseTime = 0
v = 2
value = 1

[State 2430, 6]
type = DestroySelf
trigger1 = var(2) = 10
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Excalibur
; Sword Afterimage State
[Statedef 2440]
type = A
movetype = I
physics = N
sprpriority = 0

[State 2440, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, Anim

[State 2440, 4]
type = ChangeAnim
trigger1 = time = 0
value = ifelse(AnimExist(var(0) + 5), var(0) + 5, 9999)

[State 2440, 5]
type = AssertSpecial
triggerall = parent, HitPauseTime = 0
trigger1 = (parent, var(1) % 2) = 1
flag = invisible

[State 2440, 6]
type = VarAdd
trigger1 = parent, HitPauseTime = 0
v = 2
value = 1

[State 2440, 6]
type = DestroySelf
trigger1 = var(2) = 10
trigger2 = Parent, MoveType = H

;---------------------------------------------------------------------------
; Excalibur
; MP Version
[Statedef 2450]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2350
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2450, 1]
type = Explod
trigger1 = time = 0
ID = 5566
anim = 2360
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2450, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2460

;---------------------------------------------------------------------------
; Excalibur
; MP Rush
[Statedef 2460]
type = A
movetype = A
physics = N
ctrl = 1

anim = 2390
juggle = 8
velset = 10, -5.8
sprpriority = 1

[State 2460, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2460, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 2460, 000]
type = VarSet
trigger1 = time = 0
v = 16
value = 1

[State 2460, 1]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2395
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2460, 2]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2400
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 2460, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 2460, 4]
type = PlaySnd
trigger1 = time = 0
value = 2, 8

[State 2460, 5]
type = Helper
trigger1 = (time % 2) = 1
ID = 9891
name = "Afterimage"
StateNo = 2430
postype = p1
pos = 0, 0
ownpal = 1

[State 2460, 6]
type = Helper
trigger1 = (time % 2) = 1
ID = 9892
name = "Sword Afterimage"
StateNo = 2440
postype = p1
pos = 0, 0
ownpal = 1

[State 2460, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2460, 8]
type = HitDef
triggerall = HitCount < 15
trigger1 = time = 0
trigger2 = (var(15) % var(16)) = 0
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 1
animtype = hard
priority = 5, Hit
damage = 12, 2
sparkno = S6020
sparkxy = -5, -109
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -4, -5
air.velocity = -4, -8
guard.slidetime = 10
guard.hittime = 10
guard.velocity = -6
yaccel = .39
air.fall = 1
fall.recover = 0
givepower = 20
getpower = 30

[State 2460, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
v = 16
value = 1
ignorehitpause = 1

[State 2460, 10]
type = VarSet
trigger1 = HitPauseTime = 1
v = 15
value = 0
ignorehitpause = 1

[State 2460, 11]
type = VarAdd
trigger1 = MoveHit
v = 15
value = 1

[State 2460, 12]
type = EnvColor
triggerall = MoveHit
trigger1 = HitPauseTime = 7
time = 2
ignorehitpause = 1

[State 2460, 13]
type = RemoveExplod
trigger1 = time = 0
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
trigger5 = stateno != 2460
ID = 2236

[State 2460, 14]
type = ChangeState
trigger1 = time = 27
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
value = 2420

;---------------------------------------------------------------------------
; Excalibur
; HP Version
[Statedef 2470]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2350
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2470, 1]
type = Explod
trigger1 = time = 0
ID = 5566
anim = 2360
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2470, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2480

;---------------------------------------------------------------------------
; Excalibur
; HP Rush
[Statedef 2480]
type = A
movetype = A
physics = N
ctrl = 1
anim = 2410
juggle = 8
velset = 12, -1.8
sprpriority = 1

[State 2480, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2480, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 2480, 000]
type = VarSet
trigger1 = time = 0
v = 16
value = 1

[State 2480, 1]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2415
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2480, 2]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2420
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 2480, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 2480, 4]
type = PlaySnd
trigger1 = time = 0
value = 2, 8

[State 2480, 5]
type = Helper
trigger1 = (time % 2) = 1
ID = 9891
name = "Afterimage"
StateNo = 2430
postype = p1
pos = 0, 0
ownpal = 1

[State 2480, 6]
type = Helper
trigger1 = (time % 2) = 1
ID = 9892
name = "Sword Afterimage"
StateNo = 2440
postype = p1
pos = 0, 0
ownpal = 1

[State 2480, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2480, 8]
type = HitDef
triggerall = HitCount < 15
trigger1 = time = 0
trigger2 = (var(15) % var(16)) = 0
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 0
animtype = hard
priority = 5, Hit
damage = 12, 2
sparkno = S6020
sparkxy = -5, -109
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -4, -5
air.velocity = -5, -6
guard.slidetime = 10
guard.hittime = 10
guard.velocity = -6
yaccel = .39
air.fall = 1
fall.recover = 0
givepower = 20
getpower = 30

[State 2480, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
v = 16
value = 1
ignorehitpause = 1

[State 2480, 10]
type = VarSet
trigger1 = HitPauseTime = 1
v = 15
value = 0
ignorehitpause = 1

[State 2480, 11]
type = VarAdd
trigger1 = MoveHit
v = 15
value = 1

[State 2480, 12]
type = EnvColor
triggerall = MoveHit
trigger1 = HitPauseTime = 7
time = 2
ignorehitpause = 1

[State 2480, 13]
type = RemoveExplod
trigger1 = time = 0
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
ID = 2236

[State 2480, 14]
type = ChangeState
trigger1 = time = 27
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
value = 2420

;---------------------------------------------------------------------------
; Excalibur
; LK Version
[Statedef 2490]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2350
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2490, 1]
type = Explod
trigger1 = time = 0
ID = 5566
anim = 2360
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2490, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2500

;---------------------------------------------------------------------------
; Excalibur
; LK Rush
[Statedef 2500]
type = A
movetype = A
physics = N
ctrl = 1
anim = 2430
juggle = 8
velset = 6.45, 14
sprpriority = 1

[State 2500, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2500, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 2500, 000]
type = VarSet
trigger1 = time = 0
v = 16
value = 1

[State 2500, 1]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2435
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2500, 2]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2440
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 2500, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 2500, 4]
type = PlaySnd
trigger1 = time = 0
value = 2, 8

[State 2500, 5]
type = Helper
trigger1 = (time % 2) = 1
ID = 9891
name = "Afterimage"
StateNo = 2430
postype = p1
pos = 0, 0
ownpal = 1

[State 2500, 6]
type = Helper
trigger1 = (time % 2) = 1
ID = 9892
name = "Sword Afterimage"
StateNo = 2440
postype = p1
pos = 0, 0
ownpal = 1

[State 2500, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2500, 8]
type = HitDef
triggerall = HitCount < 15
trigger1 = time = 0
trigger2 = (var(15) % var(16)) = 0
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 0
animtype = hard
priority = 5, Hit
damage = 12, 2
sparkno = S6020
sparkxy = -5, -109
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -4, -3
air.velocity = -2, 5
guard.slidetime = 10
guard.hittime = 10
guard.velocity = -6
yaccel = .39
air.fall = 1
fall.recover = 0
givepower = 20
getpower = 30

[State 2500, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
v = 16
value = 1
ignorehitpause = 1

[State 2500, 10]
type = VarSet
trigger1 = HitPauseTime = 1
v = 15
value = 0
ignorehitpause = 1

[State 2500, 11]
type = VarAdd
trigger1 = MoveHit
v = 15
value = 1

[State 2500, 12]
type = EnvColor
triggerall = MoveHit
trigger1 = HitPauseTime = 7
time = 2
ignorehitpause = 1

[State 2500, 13]
type = RemoveExplod
trigger1 = time = 0
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
trigger5 = Pos Y >= 0
ID = 2236

[State 2500, 14]
type = ChangeState
trigger1 = time = 27
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
value = 2420

[State 2500, 15]
type = ChangeState
trigger1 = Pos Y >= 0
value = 2091

;---------------------------------------------------------------------------
; Excalibur
; MK Version
[Statedef 2510]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2350
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2510, 1]
type = Explod
trigger1 = time = 0
ID = 5566
anim = 2360
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2510, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2520

;---------------------------------------------------------------------------
; Excalibur
; MK Rush
[Statedef 2520]
type = A
movetype = A
physics = N
ctrl = 1
anim = 2450
juggle = 8
velset = 10, 5
sprpriority = 1

[State 2520, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2520, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 2520, 000]
type = VarSet
trigger1 = time = 0
v = 16
value = 1

[State 2520, 1]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2455
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2520, 2]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2460
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 2520, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 2520, 4]
type = PlaySnd
trigger1 = time = 0
value = 2, 8

[State 2520, 5]
type = Helper
trigger1 = (time % 2) = 1
ID = 9891
name = "Afterimage"
StateNo = 2430
postype = p1
pos = 0, 0
ownpal = 1

[State 2520, 6]
type = Helper
trigger1 = (time % 2) = 1
ID = 9892
name = "Sword Afterimage"
StateNo = 2440
postype = p1
pos = 0, 0
ownpal = 1

[State 2520, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2520, 8]
type = HitDef
triggerall = HitCount < 15
trigger1 = time = 0
trigger2 = (var(15) % var(16)) = 0
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 0
animtype = hard
priority = 5, Hit
damage = 12, 2
sparkno = S6020
sparkxy = -5, -109
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -4, -5
air.velocity = -4, -2
guard.slidetime = 10
guard.hittime = 10
guard.velocity = -6
yaccel = .39
air.fall = 1
fall.recover = 0
givepower = 20
getpower = 30

[State 2520, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
v = 16
value = 1
ignorehitpause = 1

[State 2520, 10]
type = VarSet
trigger1 = HitPauseTime = 1
v = 15
value = 0
ignorehitpause = 1

[State 2520, 11]
type = VarAdd
trigger1 = MoveHit
v = 15
value = 1

[State 2520, 12]
type = EnvColor
triggerall = MoveHit
trigger1 = HitPauseTime = 7
time = 2
ignorehitpause = 1

[State 2520, 13]
type = RemoveExplod
trigger1 = time = 0
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
trigger5 = Pos Y >= 0
ID = 2236

[State 2520, 14]
type = ChangeState
trigger1 = time = 27
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
value = 2420

[State 2520, 15]
type = ChangeState
trigger1 = Pos Y >= 0
value = 2091

;---------------------------------------------------------------------------
; Excalibur
; HK Version
[Statedef 2530]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2350
poweradd = 55
velset = 0, 0
sprpriority = 1

[State 2530, 1]
type = Explod
trigger1 = time = 0
ID = 5566
anim = 2360
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2530, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2540

;---------------------------------------------------------------------------
; Excalibur
; HK Rush
[Statedef 2540]
type = A
movetype = A
physics = N
ctrl = 1
anim = 2470
juggle = 8
velset = 12, 1.6
sprpriority = 1

[State 2540, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 2540, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 2540, 000]
type = VarSet
trigger1 = time = 0
v = 16
value = 1

[State 2540, 1]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2475
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 2540, 2]
type = Explod
trigger1 = time = 0
ID = 2236
anim = 2480
postype = p1
pos = 0, 0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 2540, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 2540, 4]
type = PlaySnd
trigger1 = time = 0
value = 2, 8

[State 2540, 5]
type = Helper
trigger1 = (time % 2) = 1
ID = 9891
name = "Afterimage"
StateNo = 2430
postype = p1
pos = 0, 0
ownpal = 1

[State 2540, 6]
type = Helper
trigger1 = (time % 2) = 1
ID = 9892
name = "Sword Afterimage"
StateNo = 2440
postype = p1
pos = 0, 0
ownpal = 1

[State 2540, 7]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 2540, 8]
type = HitDef
triggerall = HitCount < 15
trigger1 = time = 0
trigger2 = (var(15) % var(16)) = 0
attr = A, SA
hitflag = MAF
guardflag = HA
pausetime = 1, 0
animtype = hard
priority = 5, Hit
damage = 12, 2
sparkno = S6020
sparkxy = -5, -109
hitsound = S1, 5
guardsound = S1, 6
ground.type = high
ground.velocity = -3, -6
air.velocity = -5, -4
guard.slidetime = 10
guard.hittime = 10
guard.velocity = -6
yaccel = .39
air.fall = 1
fall.recover = 0
givepower = 20
getpower = 30

[State 2540, 9]
type = VarAdd
trigger1 = HitPauseTime = 1
v = 16
value = 1
ignorehitpause = 1

[State 2540, 10]
type = VarSet
trigger1 = HitPauseTime = 1
v = 15
value = 0
ignorehitpause = 1

[State 2540, 11]
type = VarAdd
trigger1 = MoveHit
v = 15
value = 1

[State 2540, 12]
type = EnvColor
triggerall = MoveHit
trigger1 = HitPauseTime = 7
time = 2
ignorehitpause = 1

[State 2540, 13]
type = RemoveExplod
trigger1 = time = 0
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
trigger5 = Pos Y >= 0
ID = 2236

[State 2540, 14]
type = ChangeState
trigger1 = time = 27
trigger2 = MoveGuarded
trigger3 = Facing = 1
trigger3 = ScreenPos X > 303
trigger4 = Facing = -1
trigger4 = ScreenPos X < 17
value = 2420

[State 2540, 15]
type = ChangeState
trigger1 = Pos Y >= 0
value = 2091

;---------------------------------------------------------------------------
; Formation A
; Hiryu Summons Falcon
[Statedef 2550]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2130
poweradd = 50
velset = 0, 0
sprpriority = 1

[State 2550, 1]
type = Explod
trigger1 = time = 1
ID = 0455
anim = 6120
postype = p1
pos = 39, 4
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2550, 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 3
channel = 0

[State 2550, 3]
type = Helper
trigger1 = AnimElem = 3
ID = 7308
name = "Falcon"
StateNo = 2560
postype = back
pos = -50, -180
ownpal = 1

[State 2550, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Formation A
; Falcon Fly At Enemy
[Statedef 2560]
type = S
movetype = A
physics = N
anim = 2500
velset = 7, 3.5
sprpriority = 2

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 2560, 1]
type = VelAdd
trigger1 = 1
y = -.09

[State 2560, 2]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2570

[State 2560, 3]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 2560, 4]
type = HitDef
trigger1 = time = 0
attr = S, SA
hitflag = MAF
guardflag = MA
pausetime = 1, 11
animtype = hard
priority = 5, Hit
damage = 80, 3
sparkno = 2
sparkxy = -5, -45
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -5, -7
ground.hittime = 29
air.type = low
air.velocity = -5, -7
air.hittime = 30
guard.slidetime = 23
guard.hittime = 23
guard.velocity = -6.5
sprpriority = 2
givepower = 35
getpower = 50

[State 2560, 5]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 2560, 6]
type = MoveHitReset
trigger1 = MoveHit

[State 2560, 7]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 2560, 8]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 2560, 9]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 900
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -400

;---------------------------------------------------------------------------
; Formation A
; Falcon Explode
[Statedef 2570]
type = A
movetype = I
physics = N
anim = 2510
velset = 0, 0
sprpriority = 2

[State 2570, 1]
type = PlaySnd
trigger1 = time = 0
value = 3, 0

[State 2570, 2]
type = Explod
trigger1 = time = 0
ID = 1113
anim = 660
postype = p1
pos = 0, -27
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1

[State 2570, 3]
type = DestroySelf
trigger1 = time = 29

;===========================================================================
; SUPERS

;---------------------------------------------------------------------------
; Ouroboros
; Startup
[Statedef 3000]
type = S
movetype = A
physics = S
ctrl = 0
anim = 3000
velset = 0, 0
sprpriority = 1

[State 3000, 0]
type = VarSet
trigger1 = time = 0
v = 20
value = 0

[State 3000, 00]
type = VarSet
trigger1 = time = 0
fv = 2
value = ifelse(Facing = 1, Pi/4, (5*Pi)/3) ;6.797, 5.221)

[State 3000, 000]
type = VarSet
trigger1 = time = 0
fv = 3
value = ifelse(Facing = 1, (7*Pi)/6, ((7*Pi)/6) - (Pi/2)) ;9.949, 8.472)

[State 3000, 0000]
type = VarSet
trigger1 = time = 0
v = 25
value = 1

[State 3000, 4]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
damage    = 77,10
animtype  = Hard
getpower  = 50
givepower = 12
hitflag = MAf
guardflag = MA
pausetime = 1,21
sparkno = S3060
sparkxy = -15,-59
hitsound   = S1,3
guardsound = S1,6
ground.type = Low
air.juggle = 2
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -25
air.velocity = -25,-10
guard.velocity = -25
ground.cornerpush.veloff = -3
air.cornerpush.veloff = -3
fall.recover = 0

[State 3000, AllPalFX1]
type = AllPalFX
trigger1 = AnimElem = 4 & MoveContact
time = 12
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,10
;invertall = 0

[State 3000, EnvColor1]
type = EnvColor
trigger1 = AnimElem = 4 & MoveContact
value = 255,255,255
time = 2
under = 0
;ignorehitpause =
;persistent =
color = 256
;ignorehitpause =
;persistent =

[State 3000, BGPalFX1]
type = BGPalFX
trigger1 = AnimElem = 4 & MoveContact
time = 12
add = 256,256,256
mul = 200,225,256
sinadd = 0,0,0,10
;invertall = 0
color = 256
;ignorehitpause =
;persistent =


[State 3000, EnvShake1]
type = EnvShake
trigger1 = AnimElem = 4 & MoveContact
time = 4
freq = 180
ampl = -4
phase = 180
;ignorehitpause =
;persistent =


[State 3000, 1]
type = Explod
trigger1 = time = 3
ID = 1
anim = 6120
postype = p1
pos = 44, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 3000, 2]
type = PlaySnd
trigger1 = AnimElem = 5
value = 6, 2
channel = 0

[State 3000, 3]
type = Explod
trigger1 = AnimElem = 5 = 6
ID = 3
anim = 6140 + (PalNo - 1)
postype = back
pos = -180, 10
bindtime = -1
removetime = -2
sprpriority = -4
ownpal = 1
supermovetime = 9999

[State 3000, 4]
type = Explod
trigger1 = AnimElem = 5 = 6
ID = 4
anim = 6240
postype = left
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = -5
ownpal = 1
supermovetime = 9999

[State 3000, 5]
type = AssertSpecial
trigger1 = NumExplod(5) > 0
trigger2 = NumExplod(6) > 0
flag = NoBG
flag2 = NoFG

[State 3000, 6]
type = SuperPause
trigger1 = AnimElem = 5 = 6
time = 50
anim = S6230
pos = 35, -67
sound = S4, 1
darken = 0
p2defmul = 1
poweradd = ifelse(PalNo >= 10, -500, -1000)
unhittable = 1
movetime = 50

[State 3000, 6a]
type = RemoveExplod
trigger1 = time = 55
ID = 3

[State 3000, 7]
type = Explod
trigger1 = time = 50
ID = 5
anim = 6250
postype = left
pos = -80, -40
bindtime = -1
removetime = -0
sprpriority = -5
ownpal = 1
supermovetime = 9999
removeongethit = 1

[State 3000, 7a]
type = VarSet
trigger1 = AnimElem = 6
v = 21
value = Power

[State 3000, 8]
type = Helper
trigger1 = AnimElem = 6
ID = 5643
name = "Ouroboro 1"
StateNo = 3010
postype = p1
pos = 0, -98
ownpal = 1

[State 3000, 9]
type = Helper
trigger1 = AnimElem = 6
ID = 5643
name = "Ouroboro 2"
StateNo = 3020
postype = p1
pos = 0, -98
ownpal = 1

[State 3000, 10]
type = Helper
trigger1 = AnimElem = 6
ID = 616
name = "Timer"
StateNo = 3030
postype = left
pos = 0, 0
ownpal = 1

[State 3000, 11]
type = RemoveExplod
trigger1 = AnimTime = 0
ID = 5

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

;---------------------------------------------------------------------------
; Ouroboros
; Ouroboro State A
[Statedef 3010]
type = A
movetype = A
physics = N
sprpriority = 3
hitdefpersist = 1

[State 3010, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3010, Explod]
type = Explod
trigger1 = time = 0
anim = 6750
ID = 6750
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 7777
removetime = -2
scale = 1,1
sprpriority = 4
removeongethit = 0

[State 3010, 0]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(2)

[State 3010, 00]
type = ChangeAnim
trigger1 = Facing != Parent, Facing
value = ifelse(Facing = 1, 3015, 3010)
elem = AnimElemNo(0)

[State 3010, 000]
type = ParentVarSet
trigger1 = Facing != Parent, Facing
trigger1 = Facing = 1
fv = 2
value = fvar(0) + (Pi / 2)

[State 3010, 0000]
type = ParentVarSet
trigger1 = Facing != Parent, Facing
trigger1 = Facing = -1
fv = 2
value = fvar(0) - (Pi / 2)

[State 3010, 00000]
type = Turn
trigger1 = Facing != Parent, Facing

[State 3010, 1]
type = VarAdd
trigger1 = 1
v = 0
value = 1

[State 3010, 1a]
type = ChangeAnim
trigger1 = ParentDist Y < 0
trigger1 = ParentDist X = [-1,1]
trigger1 = Facing = 1
value = 3010
elem = 16

[State 3010, 1b]
type = ChangeAnim
trigger1 = ParentDist Y < 0
trigger1 = ParentDist X = [-1,1]
trigger1 = Facing = -1
value = 3015
elem = 17

[State 3010, 2]
type = ChangeAnim
trigger1 = var(0) = 1
value = ifelse(Facing = 1, 3010, 3015)
elem = ifelse(Facing = 1, 24, 9)

[State 3010, 3]
type = AssertSpecial
trigger1 = var(0) <= 20
trigger1 = (var(0) % 2) = 1
trigger2 = Parent, StateNo = 2290
trigger2 = Parent, Time < 4
flag = Invisible

[State 3010, 4]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
stateno = 3010

[State 3010, 6]
type = VarAdd
trigger1 = 1
fv = 0
value = 1

[State 0, SprPriority]
type = SprPriority
trigger1 = Pos Y < -47
value = 0

[State 0, SprPriority]
type = SprPriority
trigger1 = Pos Y >= -47
value = 4

[State 3010, 7]
type = BindToParent
trigger1 = Facing = 1
pos = floor(55 * (sin(fvar(0)))), (floor(55 * (0.2*cos(fvar(0))))) - 47
time = 1

[State 3010, 7b]
type = BindToParent
trigger1 = Facing = -1
pos = floor(55 * (cos(fvar(0)))), (floor(55 * (0.2*sin(fvar(0))))) - 47
time = 1

[State 3010, 8]
type = HitDef
trigger1 = var(0) = 5
trigger2 = var(3) = 10
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 50, Hit
animtype = hard
damage = 1, 0
sparkno = S6510
sparkxy = 0, 0
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.slidetime = 21
ground.hittime = 21
ground.velocity = -6
air.type = low
air.velocity = -4, -2
air.hittime = 20
down.velocity = -3, -4
down.hittime = 30
guard.slidetime = 20
guard.hittime = 20
guard.velocity = -5.5
givepower = 20
getpower = 0

[State 3010, 8a]
type = VarSet
trigger1 = MoveHit
v = 3
value = 0
ignorehitpause = 1

[State 3010, 8b]
type = VarAdd
trigger1 = MoveHit
trigger2 = var(3) > 0
v = 3
value = 1

[State 3010, 9]
type = ParentVarAdd
trigger1 = MoveHit
trigger2 = ProjHit1199 = 1
v = 11
value = 1

[State 3010, 9a]
type = ParentVarSet
trigger1 = MoveHit
trigger2 = ProjHit1199 = 1
v = 25
value = 1

[State 3010, 10]
type = MoveHitReset
trigger1 = MoveHit

[State 3010, 11]
type = Projectile
triggerall = var(1) = 0
triggerall = Pos Y <= 0
trigger1 = Parent, StateNo = [200,220]
trigger2 = Parent, StateNo = [300,320]
trigger3 = Parent, StateNo = [400,420]
trigger4 = Parent, StateNo = 2410
trigger5 = Parent, StateNo = 2460
trigger6 = Parent, StateNo = 2480
trigger7 = Parent, StateNo = 2500
trigger8 = Parent, StateNo = 2520
trigger9 = Parent, StateNo = 2540
trigger10 = Parent, StateNo = 2030
trigger11 = Parent, StateNo = [2000,2020]
trigger12 = Parent, StateNo = 2050
projID = 1199
projanim = 3050
projhitanim = -1
projremanim = 9999
velocity = 5, 0
projsprpriority = 4
projstagebound = 80
postype = p1
pos = 0, 0
attr = A, HP
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
animtype = hard
damage = floor(7 * fvar(1)), 1
sparkno = S3060
sparkxy = 0, 0
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.slidetime = 11
ground.hittime = 11
ground.velocity = -6
air.velocity = -3, -3
air.hittime = 15
down.velocity = -3, -4
down.hittime = 15
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -7
givepower = 20
getpower = 0

[State 3010, 12]
type = Explod
triggerall = var(1) = 0
trigger1 = Parent, StateNo = [200,220]
trigger2 = Parent, StateNo = [300,320]
trigger3 = Parent, StateNo = [400,420]
trigger4 = Parent, StateNo = 2410
trigger5 = Parent, StateNo = 2460
trigger6 = Parent, StateNo = 2480
trigger7 = Parent, StateNo = 2500
trigger8 = Parent, StateNo = 2520
trigger9 = Parent, StateNo = 2540
trigger10 = Parent, StateNo = 2030
trigger11 = Parent, StateNo = [2000,2020]
trigger12 = Parent, StateNo = 2050
anim = 3040
ID = 1235
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 4
ownpal = 1

[State 3010, 13]
type = VarAdd
triggerall = var(1) = 0
trigger1 = Parent, StateNo = [200,220]
trigger2 = Parent, StateNo = [300,320]
trigger3 = Parent, StateNo = [400,420]
trigger4 = Parent, StateNo = 2410
trigger5 = Parent, StateNo = 2460
trigger6 = Parent, StateNo = 2480
trigger7 = Parent, StateNo = 2500
trigger8 = Parent, StateNo = 2520
trigger9 = Parent, StateNo = 2540
trigger10 = Parent, StateNo = 2030
trigger11 = Parent, StateNo = [2000,2020]
trigger12 = Parent, StateNo = 2050
v = 1
value = 1

[State 3010, 14]
type = VarAdd
trigger1 = var(1) > 0
v = 1
value = 1

[State 3010, 15]
type = VarSet
trigger1 = var(1) >= 7
v = 1
value = 0

[State 3010, 16]
type = VarSet
trigger1 = 1
fv = 1
value = parent, fvar(1)

[State 3010, 17]
type = AttackMulSet
trigger1 = 1
value = fvar(1)

[State 3010, 18]
type = ChangeState
trigger1 = parent, var(20) = 1
trigger2 = 0
trigger3 = parent, Lose
trigger4 = !(parent, Alive)
value = 2260

[State 3010, 19]
type = DestroySelf
trigger1 = Parent, StateNo = 3230
trigger1 = Parent, MoveType != H

;---------------------------------------------------------------------------
; Ouroboros
; Ouroboro State B
[Statedef 3020]
type = A
movetype = A
physics = N
sprpriority = 3
hitdefpersist = 1

[State 3020, Explod]
type = Explod
trigger1 = time = 0
anim = 6750
ID = 67502
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 7777
removetime = -2
scale = 1,1
sprpriority = 4
removeongethit = 0

[State 3020, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 5
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3020, 0]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(3)

[State 3020, 00]
type = ChangeAnim
trigger1 = Facing != Parent, Facing
value = ifelse(Facing = 1, 3015, 3010)
elem = AnimElemNo(0)

[State 3020, 000]
type = ParentVarSet
trigger1 = Facing != Parent, Facing
trigger1 = Facing = 1
fv = 3
value = fvar(0) + (Pi / 2)

[State 3020, 0000]
type = ParentVarSet
trigger1 = Facing != Parent, Facing
trigger1 = Facing = -1
fv = 3
value = fvar(0) - (Pi / 2)

[State 3020, 00000]
type = Turn
trigger1 = Facing != Parent, Facing

[State 3020, 1]
type = VarAdd
trigger1 = 1
v = 0
value = 1

[State 3020, 1a]
type = ChangeAnim
trigger1 = ParentDist Y < 0
trigger1 = ParentDist X = [-1,1]
trigger1 = Facing = 1
value = 3010
elem = 16

[State 3020, 1b]
type = ChangeAnim
trigger1 = ParentDist Y < 0
trigger1 = ParentDist X = [-1,1]
trigger1 = Facing = -1
value = 3015
elem = 17

[State 3020, 2]
type = ChangeAnim
trigger1 = var(0) = 1
value = ifelse(Facing = 1, 3010, 3015)
elem = ifelse(Facing = 1, 8, 25)

[State 3020, 3]
type = AssertSpecial
trigger1 = var(0) <= 20
trigger1 = (var(0) % 2) = 1
trigger2 = Parent, StateNo = 2290
trigger2 = Parent, Time < 4
flag = Invisible

[State 3020, 4]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
stateno = 3020

[State 3020, 5]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3020, 6]
type = VarAdd
trigger1 = 1
fv = 0
value = 1

[State 3020, 7]
type = BindToParent
trigger1 = Facing = 1
pos = floor(55 * (sin(fvar(0)))), (floor(55 * (cos(fvar(0))))) - 47
time = 1

[State 3020, 7b]
type = BindToParent
trigger1 = Facing = -1
pos = floor(55 * (cos(fvar(0)))), (floor(55 * (sin(fvar(0))))) - 47
time = 1

[State 3020, 8]
type = HitDef
trigger1 = var(0) = 5
trigger2 = var(3) = 10
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 50, Hit
animtype = hard
damage = 1, 0
sparkno = S6510
sparkxy = 0, 0
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.slidetime = 21
ground.hittime = 21
ground.velocity = -6
air.type = low
air.velocity = -4, -2
air.hittime = 20
down.velocity = -3, -4
down.hittime = 30
guard.slidetime = 20
guard.hittime = 20
guard.velocity = -5.5
givepower = 20
getpower = 0

[State 3020, 8a]
type = VarSet
trigger1 = MoveHit
v = 3
value = 0
ignorehitpause = 1

[State 3020, 8b]
type = VarAdd
trigger1 = MoveHit
trigger2 = var(3) > 0
v = 3
value = 1

[State 3020, 9]
type = ParentVarAdd
trigger1 = MoveHit
trigger2 = ProjHit1199 = 1
v = 11
value = 1

[State 3020, 9a]
type = ParentVarSet
trigger1 = MoveHit
trigger2 = ProjHit1199 = 1
v = 25
value = 1

[State 3020, 10]
type = MoveHitReset
trigger1 = MoveHit

[State 3020, 11]
type = Projectile
triggerall = var(1) = 0
triggerall = Pos Y <= 0
trigger1 = Parent, StateNo = [200,220]
trigger2 = Parent, StateNo = [300,320]
trigger3 = Parent, StateNo = [400,420]
trigger4 = Parent, StateNo = 2410
trigger5 = Parent, StateNo = 2460
trigger6 = Parent, StateNo = 2480
trigger7 = Parent, StateNo = 2500
trigger8 = Parent, StateNo = 2520
trigger9 = Parent, StateNo = 2540
trigger10 = Parent, StateNo = 2030
trigger11 = Parent, StateNo = [2000,2020]
trigger12 = Parent, StateNo = 2050
projID = 1199
projanim = 3050
projhitanim = -1
projremanim = 9999
velocity = 5, 0
projsprpriority = 4
projstagebound = 80
postype = p1
pos = 0, 0
attr = A, HP
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
animtype = hard
damage = floor(7 * fvar(1)), 1
sparkno = S3060
sparkxy = 0, 0
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.slidetime = 11
ground.hittime = 11
ground.velocity = -6
air.velocity = -3, -3
air.hittime = 15
down.velocity = -3, -4
down.hittime = 15
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -7
givepower = 20
getpower = 0

[State 3020, 12]
type = Explod
triggerall = var(1) = 0
trigger1 = Parent, StateNo = [200,220]
trigger2 = Parent, StateNo = [300,320]
trigger3 = Parent, StateNo = [400,420]
trigger4 = Parent, StateNo = 2410
trigger5 = Parent, StateNo = 2460
trigger6 = Parent, StateNo = 2480
trigger7 = Parent, StateNo = 2500
trigger8 = Parent, StateNo = 2520
trigger9 = Parent, StateNo = 2540
trigger10 = Parent, StateNo = 2030
trigger11 = Parent, StateNo = [2000,2020]
trigger12 = Parent, StateNo = 2050
anim = 3040
ID = 1235
postype = p1
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = 4
ownpal = 1

[State 3020, 13]
type = VarAdd
triggerall = var(1) = 0
trigger1 = Parent, StateNo = [200,220]
trigger2 = Parent, StateNo = [300,320]
trigger3 = Parent, StateNo = [400,420]
trigger4 = Parent, StateNo = 2410
trigger5 = Parent, StateNo = 2460
trigger6 = Parent, StateNo = 2480
trigger7 = Parent, StateNo = 2500
trigger8 = Parent, StateNo = 2520
trigger9 = Parent, StateNo = 2540
trigger10 = Parent, StateNo = 2030
trigger11 = Parent, StateNo = [2000,2020]
trigger12 = Parent, StateNo = 2050
v = 1
value = 1

[State 3020, 14]
type = VarAdd
trigger1 = var(1) > 0
v = 1
value = 1

[State 3020, 15]
type = VarSet
trigger1 = var(1) >= 7
v = 1
value = 0

[State 3020, 16]
type = VarSet
trigger1 = 1
fv = 1
value = parent, fvar(1)

[State 3020, 17]
type = AttackMulSet
trigger1 = 1
value = fvar(1)

[State 3020, 18]
type = ChangeState
trigger1 = parent, var(20) = 1
trigger2 = 0
trigger3 = parent, Lose
trigger4 = !(parent, Alive)
value = 2260

[State 3020, 19]
type = DestroySelf
trigger1 = Parent, StateNo = 3230
trigger1 = Parent, MoveType != H

;---------------------------------------------------------------------------
; Ouroboros
; Timer
[Statedef 3030]
type = A
movetype = I
physics = N
anim = 9999

[State 3030, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, var(12)

[State 3030, 2]
type = Explod
triggerall = var(0) = 1
trigger1 = time = 20
ID = 7878
anim = 3020
postype = left
pos = 10, 60
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = -5

[State 3030, 3]
type = Explod
triggerall = var(0) = 1
trigger1 = time = 20
ID = 7879
anim = 3030
postype = left
pos = 10, 60
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = -4

[State 3030, 4]
type = Explod
triggerall = var(0) = -1
trigger1 = time = 20
ID = 7878
anim = 3020
postype = right
pos = -157, 60
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = -5

[State 3030, 5]
type = Explod
triggerall = var(0) = -1
trigger1 = time = 20
ID = 7879
anim = 3030
postype = right
pos = -157, 60
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = -4

[State 3030, 6]
type = VarAdd
trigger1 = time > 20
fv = 0
value = 1

[State 3030, 7]
type = VarSet
trigger1 = time > 20
fv = 1
value = fvar(0) / 300

[State 3030, 8]
type = ModifyExplod
trigger1 = time > 20
ID = 7879
scale = fvar(1), 1

[State 3030, 9]
type = ParentVarSet
trigger1 = fvar(0) > 300
v = 20
value = 1

[State 2300, 2]
type = VarSet
trigger1 = fvar(0) > 298
trigger2 = parent, Win
trigger3 = !(Parent, Alive)
trigger4 = Parent, Lose
trigger5 = Parent, StateNo = 3230
trigger5 = Parent, MoveType != H
v = 56
value = 50

[State 3030, 10]
type = RemoveExplod
trigger1 = fvar(0) > 300
trigger2 = parent, Win
trigger3 = !(Parent, Alive)
trigger4 = Parent, Lose
trigger5 = Parent, StateNo = 3230
trigger5 = Parent, MoveType != H

[STate 3030, 11]
type = DestroySelf
trigger1 = fvar(0) > 300
trigger2 = 0
trigger3 = !(Parent, Alive)
trigger4 = Parent, Lose
trigger5 = Parent, StateNo = 3230
trigger5 = Parent, MoveType != H

;---------------------------------------------------------------------------
; Legion
; Hiryu's State
[Statedef 3040]
type = S
movetype = A
physics = S
ctrl = 0
anim = 3070
velset = 0, 0
sprpriority = 1

[State 3040, 0]
type = VarSet
trigger1 = time = 0
v = 25
value = 2

[State 3040, 1]
type = Explod
trigger1 = time = 1
ID = 2255
anim = 6120
postype = p1
pos = 45, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 3040, 2]
type = Explod
trigger1 = time = 6
ID = 3
anim = 6140 + (PalNo - 1)
postype = back
pos = -180, 10
bindtime = -1
removetime = -2
sprpriority = -4
ownpal = 1
supermovetime = 9999

[State 3040, 3]
type = Explod
trigger1 = time = 6
ID = 4
anim = 6240
postype = left
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = -5
ownpal = 1
supermovetime = 9999

[State 3040, 4]
type = AssertSpecial
trigger1 = NumExplod(4) > 0
trigger2 = NumExplod(5) > 0
flag = NoBG
flag2 = NoFG

[State 3040, 5]
type = SuperPause
trigger1 = time = 6
time = 50
anim = S6230
pos = -15, -88
sound = S4, 1
darken = 0
p2defmul = 1
poweradd = ifelse(PalNo >= 10, -500, -1000)
unhittable = 1
movetime = 50

[State 3040, 6]
type = RemoveExplod
trigger1 = time = 53
ID = 3

[State 3040, 7]
type = Explod
trigger1 = time = 43
ID = 5
anim = 6250
postype = left
pos = -80, -40
bindtime = -1
removetime = -1
sprpriority = -5
ownpal = 1
supermovetime = 9999
removeongethit = 1

[State 3040, 7a]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 3
channel = 0

[State 3040, 8]
type = Helper
trigger1 = AnimElem = 3
ID = 7752
name = "Tiger 1"
StateNo = 3050
postype = back
pos = -45, 0
ownpal = 1

[State 3040, 9]
type = Helper
trigger1 = AnimElem = 3
ID = 7752
name = "Tiger 2"
StateNo = 3060
postype = back
pos = -80, 0
ownpal = 1

[State 3040, 10]
type = Helper
trigger1 = AnimElem = 3
ID = 7752
name = "Tiger 3"
StateNo = 3070
postype = back
pos = -68, -67
ownpal = 1

[State 3040, 11]
type = Helper
trigger1 = AnimElem = 3
ID = 7752
name = "Tiger 4"
StateNo = 3080
postype = back
pos = -85, -90
ownpal = 1

[State 3040, 12]
type = Helper
trigger1 = AnimElem = 3
ID = 7752
name = "Tiger 5"
StateNo = 3090
postype = back
pos = -110, -81
ownpal = 1

[State 3040, 13]
type = Helper
trigger1 = AnimElem = 5
ID = 7752
name = "Tiger 6"
StateNo = 3100
postype = back
pos = -45, 0
ownpal = 1

[State 3040, 14]
type = Helper
trigger1 = AnimElem = 7
ID = 7752
name = "Tiger 7"
StateNo = 3110
postype = back
pos = -45, 0
ownpal = 1

[State 3040, 15]
type = Helper
trigger1 = AnimElem = 10
ID = 7752
name = "Tiger 8"
StateNo = 3060
postype = back
pos = -80, 0
ownpal = 1

[State 3040, 16]
type = Helper
trigger1 = AnimElem = 4
ID = 7752
name = "Falcon 1"
StateNo = 3120
postype = back
pos = -22, -120
ownpal = 1

[State 3040, 17]
type = Helper
trigger1 = AnimElem = 6
ID = 7752
name = "Falcon 2"
StateNo = 3130
postype = back
pos = -40, -100
ownpal = 1

[State 3040, 18]
type = Helper
trigger1 = AnimElem = 8
ID = 7752
name = "Falcon 3"
StateNo = 3140
postype = back
pos = -35, -160
ownpal = 1

[State 3040, 19]
type = Helper
trigger1 = AnimElem = 9
ID = 7752
name = "Falcon 4"
StateNo = 3150
postype = back
pos = -80, -140
ownpal = 1

[State 3040, 20]
type = Helper
trigger1 = AnimElem = 12
ID = 7752
name = "Falcon 5"
StateNo = 3120
postype = back
pos = -50, -110
ownpal = 1

[State 3040, 21]
type = Helper
trigger1 = AnimElem = 14
ID = 7752
name = "Falcon 6"
StateNo = 3130
postype = back
pos = -90, -140
ownpal = 1

[State 3040, 22]
type = Helper
trigger1 = AnimElem = 14
ID = 7752
name = "Falcon 7"
StateNo = 3140
postype = back
pos = -80, -155
ownpal = 1

[State 3040, 23]
type = Helper
trigger1 = AnimElem = 26
ID = 7752
name = "Falcon 8"
StateNo = 3150
postype = back
pos = -120, -140
ownpal = 1

[State 3040, z]
type = RemoveExplod
trigger1 = AnimTime = 0
ID = 5

[State 3040, zz]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Legion
; Custom GetHit State
[Statedef 3045]
type = U
movetype = H
physics = N
sprpriority = 1

[State 3045, 1]
type = ChangeAnim
trigger1 = time <= 11
value = ifelse(StateType = A, 5012, 5002)

[State 3045, 2]
type = PosFreeze
trigger1 = time <= 11

[State 3045, 3]
type = StateTypeSet
trigger1 = time = 12
StateType = A

[State 3045, 4]
type = ChangeAnim
trigger1 = time = 12
value = 5050

[State 3045, 5]
type = VelSet
trigger1 = time = 12
x = -3
y = -11

[State 3045, 6]
type = HitBy
trigger1 = 1
value = , HA

[State 3045, 7]
type = NotHitBy
trigger1 = 1
value = , NA, SA, AP, AT

[State 3045, 8]
type = VelAdd
trigger1 = time >= 12
y = .39

[State 3045, 9]
type = ChangeState
trigger1 = Pos Y > 0
value = 3046

;---------------------------------------------------------------------------
; Legion
; Custom State - Liedown
[Statedef 3046]
type = L
movetype = H
physics = N
velset = 0, 0

[State 3046, 0]
type = ChangeAnim
trigger1 = time = 0
value = 5100

[State 3046, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 3046, 2]
type = PlaySnd
trigger1 = time = 0
value = F7, 0

[State 3046, 3]
type = ChangeAnim
trigger1 = Anim = 5100
trigger1 = AnimTime = 0
value = 5110

[State 3046, 4]
type = HitBy
trigger1 = 1
value = , HA

[State 3046, 5]
type = NotHitBy
trigger1 = 1
value = , NA, SA, AP, AT

[State 3046, 6]
type = SelfState
trigger1 = time > 30
trigger1 = Alive
value = 5120

[State 3046, 7]
type = SelfState
trigger1 = time > 30
trigger1 = !Alive
value = 5150

;---------------------------------------------------------------------------
; Legion
; Tiger 1 of 8: Start
[Statedef 3050]
type = S
movetype = I
physics = N
anim = 3090
sprpriority = 2

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3050, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3050, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3050, 3]
type = ChangeState
trigger1 = time = 4
value = 3051

;---------------------------------------------------------------------------
; Legion
; Tiger 1 of 8: Leap
[Statedef 3051]
type = A
movetype = A
physics = N
anim = 3080
velset = 9, -8

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3051, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3051, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3051, 3]
type = VelAdd
trigger1 = 1
y = .39

[State 3051, 4]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8.5
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3051, 5]
type = VarSet
trigger1 = 1
fv = 0
value = Parent, fvar(1)

[State 3051, 6]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3051, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3051, 7a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3051, 8]
type = MoveHitReset
trigger1 = MoveHit

[State 3051, 9]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3052

;---------------------------------------------------------------------------
; Legion
; Tiger 1 of 8: Land
[Statedef 3052]
type = S
movetype = I
physics = N
anim = 3110
velset = 0, 0

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3052, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 3052, 2]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3052, 3]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3052, 4]
type = ChangeAnim
trigger1 = anim = 3110
trigger1 = AnimTime = 0
value = 2140

[State 3052, 5]
type = VelSet
trigger1 = Anim = 2140
x = 6

[State 3052, 6]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 800
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -800

;---------------------------------------------------------------------------
; Legion
; Tiger 2 of 8: Start
[Statedef 3060]
type = S
movetype = I
physics = N
anim = 3090
sprpriority = 2

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3060, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3060, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3060, 3]
type = ChangeState
trigger1 = time = 4
value = 3061

;---------------------------------------------------------------------------
; Legion
; Tiger 2 of 8: Leap
[Statedef 3061]
type = A
movetype = A
physics = N
anim = 3080
velset = 9, -10

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3061, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3061, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3061, 3]
type = VelAdd
trigger1 = 1
y = .39

[State 3061, 4]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3061, 5]
type = VarSet
trigger1 = 1
fv = 0
value = Parent, fvar(1)

[State 3061, 6]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3061, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3061, 7a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3061, 8]
type = MoveHitReset
trigger1 = MoveHit

[State 3061, 9]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3062

;---------------------------------------------------------------------------
; Legion
; Tiger 2 of 8: Land
[Statedef 3062]
type = S
movetype = I
physics = N
anim = 3110
velset = 0, 0

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3062, 1]
type = PosSet
trigger1 = time = 0
y = 0

[State 3062, 2]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3062, 3]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3062, 4]
type = ChangeAnim
trigger1 = anim = 3110
trigger1 = AnimTime = 0
value = 2140

[State 3062, 5]
type = VelSet
trigger1 = Anim = 2140
x = 6

[State 3062, 6]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 450
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -130

;---------------------------------------------------------------------------
; Legion
; Tiger 3 of 8: Fall
[Statedef 3070]
type = A
movetype = A
physics = N
anim = 3100
sprpriority = 2
velset = 3, -4

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3070, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3070, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3070, 3]
type = VelAdd
trigger1 = 1
y = .39

[State 3070, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3070, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3070, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3070, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3070, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3070, 8]
type = ChangeState
trigger1 = Pos Y >= 0
value = 3071

;---------------------------------------------------------------------------
; Legion
; Tiger 3 of 8: Land
[Statedef 3071]
type = S
movetype = I
physics = N
anim = 3110
velset = 0, 0

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3071, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3071, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3071, 3]
type = PosSet
trigger1 = time = 0
y = 0

[State 3071, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 3072

;---------------------------------------------------------------------------
; Legion
; Tiger 3 of 8: Leap
[Statedef 3072]
type = A
movetype = A
physics = N
anim = 3080
velset = 9.5, -10

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3072, 0]
type = VelAdd
trigger1 = 1
y = .39

[State 3072, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3072, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3072, 3]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3072, 4]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3072, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3072, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3072, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3072, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3072, 8]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 450
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -130
trigger3 = Vel Y > 0
trigger3 = Pos Y >= 0

;---------------------------------------------------------------------------
; Legion
; Tiger 4 of 8: Fall
[Statedef 3080]
type = A
movetype = A
physics = N
anim = 3100
sprpriority = 2
velset = 3, -4

[State 3080, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add

[State 3080, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3080, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3080, 3]
type = VelAdd
trigger1 = 1
y = .39

[State 3080, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3080, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3080, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3080, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3080, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3080, 8]
type = ChangeState
trigger1 = Pos Y >= 0
value = 3081

;---------------------------------------------------------------------------
; Legion
; Tiger 4 of 8: Land
[Statedef 3081]
type = S
movetype = I
physics = N
anim = 3110
velset = 0, 0

[State 3081, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3081, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3081, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3081, 3]
type = PosSet
trigger1 = time = 0
y = 0

[State 3081, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 3082

;---------------------------------------------------------------------------
; Legion
; Tiger 4 of 8: Leap
[Statedef 3082]
type = A
movetype = A
physics = N
anim = 3080
velset = 9.5, -7

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3082, 0]
type = VelAdd
trigger1 = 1
y = .39

[State 3082, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3082, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3082, 3]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3082, 4]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3082, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3082, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3082, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3082, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3082, 8]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 450
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -130

[State 3082, 9]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3062

;---------------------------------------------------------------------------
; Legion
; Tiger 5 of 8: Fall
[Statedef 3090]
type = A
movetype = A
physics = N
anim = 3100
sprpriority = 2
velset = 3.1, -4.1

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3090, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3090, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3090, 3]
type = VelAdd
trigger1 = 1
y = .39

[State 3090, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3090, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3090, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3090, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3090, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3090, 8]
type = ChangeState
trigger1 = Pos Y >= 0
value = 3091

;---------------------------------------------------------------------------
; Legion
; Tiger 5 of 8: Land
[Statedef 3091]
type = S
movetype = I
physics = N
anim = 3110
velset = 0, 0

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3091, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3091, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3091, 3]
type = PosSet
trigger1 = time = 0
y = 0

[State 3091, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 3092

;---------------------------------------------------------------------------
; Legion
; Tiger 5 of 8: Run
[Statedef 3092]
type = S
movetype = A
physics = N
anim = 2140
velset = 7, 0

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3092, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3092, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3092, 3]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3092, 4]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3092, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3092, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3092, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3092, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3092, 8]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 450
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -130

;---------------------------------------------------------------------------
; Legion
; Tiger 6 of 8: Start
[Statedef 3100]
type = S
movetype = I
physics = N
anim = 3090
sprpriority = 2

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3100, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3100, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3100, 3]
type = ChangeState
trigger1 = time = 8
value = 3092

;---------------------------------------------------------------------------
; Legion
; Tiger 7 of 8: Start
[Statedef 3110]
type = S
movetype = I
physics = N
anim = 3090
sprpriority = 2

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3110, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3110, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3110, 3]
type = ChangeState
trigger1 = time = 8
value = 3111

;---------------------------------------------------------------------------
; Legion
; Tiger 7 of 8: Leap
[Statedef 3111]
type = A
movetype = A
physics = N
anim = 3080
velset = 10, -6

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3111, 0]
type = VelAdd
trigger1 = 1
y = .39

[State 3111, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2190

[State 3111, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3111, 3]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3111, 4]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3111, 5]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 40, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3111, 6]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3111, 6a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3111, 7]
type = MoveHitReset
trigger1 = MoveHit

[State 3111, 8]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 450
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -130

[State 3111, 9]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3062

;---------------------------------------------------------------------------
; Legion
; Falcon 1 of 8: Fly
[Statedef 3120]
type = A
movetype = A
physics = N
anim = 3120
sprpriority = 2
velset = 6.5, 2.5

[State 3120, AfterImage]
type = AfterImage
trigger1 = 1
time = 50000
TimeGap  = 1
FrameGap = 1
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
Trans = add


[State 3120, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2570

[State 3120, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3120, 3]
type = VelAdd
trigger1 = 1
y = -.17

[State 3120, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3120, 5]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3120, 6]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 30, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3120, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3120, 7a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3120, 8]
type = MoveHitReset
trigger1 = MoveHit

[State 3120, 9]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 410
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -90

;---------------------------------------------------------------------------
; Legion
; Falcon 2 of 8: Fly
[Statedef 3130]
type = A
movetype = A
physics = N
anim = 3120
sprpriority = 2
velset = 6.5, 1.8

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3130, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2570

[State 3130, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3130, 3]
type = VelAdd
trigger1 = 1
y = -.11

[State 3130, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3130, 5]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3130, 6]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 30, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3130, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3130, 7a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3130, 8]
type = MoveHitReset
trigger1 = MoveHit

[State 3130, 9]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 410
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -90

;---------------------------------------------------------------------------
; Legion
; Falcon 3 of 8: Fly
[Statedef 3140]
type = A
movetype = A
physics = N
anim = 3120
sprpriority = 2
velset = 5.5, 3

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3140, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2570

[State 3140, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3140, 3]
type = VelAdd
trigger1 = 1
y = -.35

[State 3140, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3140, 5]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3140, 6]
type = HitDef
trigger1 = time = 0
attr a= A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 30, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3140, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3140, 7a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3140, 8]
type = MoveHitReset
trigger1 = MoveHit

[State 3140, 9]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 410
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -90
trigger3 = ScreenPos Y <= -100

;---------------------------------------------------------------------------
; Legion
; Falcon 4 of 8: Fly
[Statedef 3150]
type = A
movetype = A
physics = N
anim = 3120
sprpriority = 2
velset = 6.5, .5

[State 2560, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 50000
TimeGap  = 1
FrameGap = 2
length = 50
PalBright   = 0,0,0
PalContrast = 170,170,170
Trans = add

[State 3150, 1]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP
StateNo = 2570

[State 3150, 2]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 3150, 3]
type = Null ;VelAdd
trigger1 = 1
y = 0

[State 3150, 4]
type = VarSet
trigger1 = 1
fv = 0
value = parent, fvar(1)

[State 3150, 5]
type = AttackMulSet
trigger1 = 1
value = fvar(0)

[State 3150, 6]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = MAFD
guardflag = MA
pausetime = 1, 11
priority = 7, Hit
animtype = Hard
damage = 30, 2
sparkno = S6510
sparkxy = -5, -34
hitsound = S1, 3
guardsound = S1, 6
ground.type = high
ground.velocity = -1.5, -8
air.type = low
air.velocity = -1.5, -8
air.hittime = 20
down.velocity = -1.5, -5
down.hittime = 20
guard.slidetime = 21
guard.hittime = 21
guard.velocity = -8
fall = 1
air.fall = 1
p2stateno = 3045
fall.recover = 0
givepower = 35
getpower = 0

[State 3150, 7]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1

[State 3150, 7a]
type = ParentVarSet
trigger1 = MoveHit
v = 25
value = 2

[State 3150, 8]
type = MoveHitReset
trigger1 = MoveHit

[State 3150, 9]
type = DestroySelf
trigger1 = Facing = 1
trigger1 = ScreenPos X >= 410
trigger2 = Facing = -1
trigger2 = ScreenPos X <= -90

;---------------------------------------------------------------------------
; Ragnarok
; Startup
[Statedef 3200]
type = S
movetype = I
physics = S
ctrl = 0
anim = 3200
velset = 0, 0
sprpriority = 1

[State 3200, 0]
type = VarSet
trigger1 = time = 0
v = 1
value = 0

[State 3200, 00]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 3200, 000]
type = VarSet
trigger1 = time = 0
v = 25
value = 3

[State 3200, 1]
type = Explod
trigger1 = time = 1
ID = 23
anim = 6120
postype = p1
pos = 40, 0
bindtime = 1
removetime = -2
sprpriority = 3
ownpal = 1

[State 3200, 2]
type = Explod
trigger1 = AnimElem = 2
ID = 24
anim = 1
postype = p1
pos = -4, -77
bindtime = -1
removetime = 2
sprpriority = 0
ownpal = 1

[State 3200, 3]
type = Explod
trigger1 = AnimElem = 3
ID = 25
anim = 1
postype = p1
pos = -7, -86
bindtime = -1
removetime = -1
sprpriority = 0
ownpal = 1
removeongethit = 1

[State 3200, 4]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6, 2
channel = 0

[State 3200, 5]
type = Explod
trigger1 = AnimElem = 6
ID = 26
anim = 3205
postype = p1
pos = 0, 0
bindtime = -1
removetime = 9
sprpriority = 2
ownpal = 1
removeongethit = 1

[State 3200, 6]
type = Explod
trigger1 = AnimElem = 6 = 5
ID = 3
anim = 6140 + (PalNo - 1)
postype = back
pos = -180, 10
bindtime = -1
removetime = -2
sprpriority = -4
ownpal = 1
supermovetime = 9999

[State 3200, 7]
type = Explod
trigger1 = AnimElem = 6 = 5
ID = 4
anim = 6240
postype = left
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = -5
ownpal = 1
supermovetime = 9999

[State 3200, 8]
type = AssertSpecial
trigger1 = NumExplod(4) > 0
trigger2 = NumExplod(5) > 0
flag = NoBG
flag2 = NoFG

[State 3200, 9]
type = SuperPause
trigger1 = AnimElem = 6 = 5
time = 50
anim = S6230
pos = 10, -73
sound = S4, 1
darken = 0
p2defmul = 0
poweradd = ifelse(PalNo >= 10, -500, -1000)
unhittable = 1
movetime = 50

[State 3200, 10]
type = Explod
trigger1 = time = 58
ID = 5
anim = 6250
postype = left
pos = -80, -75
bindtime = -1
removetime = -1
sprpriority = -5
ownpal = 1
supermovetime = 9999
removeongethit = 1

[State 3200, 10a]
type = VarAdd
trigger1 = time >= 58
v = 1
value = 1

[State 3200, 11]
type = RemoveExplod
trigger1 = time = 66
ID = 3

[State 3200, 12]
type = RemoveExplod
trigger1 = AnimTime = 0
ID = 25

[State 3200, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 3210

;---------------------------------------------------------------------------
; Ragnarok
; Run At Opponent
[Statedef 3210]
type = S
movetype = A
physics = N
ctrl = 0
anim = 3210
velset = 35, 0

[State 3210, 0]
type = NotHitBy
trigger1 = time < 8
value = SCA

[State 3210, 1]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 3210, 2]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
value = 2, 5

[State 3210, 3]
type = HitDef
trigger1 = time = 0
attr = S, HA
hitflag = MA
guardflag = MA
pausetime = 1, 1
priority = 7, Miss
damage = 0
sparkno = S3060
sparkxy = -5, -45
hitsound = S2, 1
guardsound = S1, 6
guard.pausetime = 11, 11
guard.slidetime = 15
guard.hittime = 15
guard.velocity = -8
p1stateno = 3230
p2stateno = 3400
p2facing = 1
fall = 1
air.fall = 1
givepower = 50
getpower = 0

[State 3210, 4]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = MoveGuarded
value = 3220

;---------------------------------------------------------------------------
; Ragnarok
; Slide to Stop
[Statedef 3220]
type = S
movetype = I
physics = S
ctrl = 0
anim = 3220

[State 3220, 1]
type = RemoveExplod
trigger1 = time = 0
ID = 5

[State 3220, 2]
type = PlaySnd
trigger1 = time = 0
value = 2, 4

[State 3220, 3]
type = Explod
trigger1 = time <= 15
trigger1 = (time % 4) = 0
ID = 43
anim = 6000
postype = p1
pos = 10, 0
bindtime = 1
removetime = -2
vel = -.2, 0
ownpal = 1
sprpriority = 2

[State 3220, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Ragnarok
; Grabbed Opponent
[Statedef 3230]
type = S
movetype = I
physics = N
ctrl = 0
anim = 3230
velset = 0, 0
sprpriority = 1

[State 3230, 0]
type = Width
trigger1 = 1
value = var(15), var(15)-50

[State 3230, 00]
type = AssertSpecial
trigger1 = 1
flag = NoFG
flag2 = NoBG

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

[State 3230, 0000]
type = VarAdd
trigger1 = var(15) < 160
v = 15
value = 8

[State 3230, 1]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 3230, 2]
type = TargetBind
trigger1 = time = 0
pos = 63, 0
time = 19

[State 3230, 3]
type = TargetBind
trigger1 = AnimElem = 2
pos = 53, 0
time = 4

[State 3230, 4]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2, 8

[State 3230, 5]
type = TargetBind
trigger1 = AnimElem = 3
pos = 39, -81
time = -1

[State 3230, 6]
type = VelSet
trigger1 = AnimElem = 3
y = -8

[State 3230, 7]
type = RemoveExplod
trigger1 = ScreenPos Y <= 130
ID = 5
persistent = 0

[State 3230, 8]
type = Explod
trigger1 = ScreenPos Y <= 130
ID = 5
anim = 6250 + ((var(1) / 24) / 3)
postype = left
pos = -80, -75
bindtime = 1
removetime = -1
vel = 0, 7.4
accel = 0, -.39
sprpriority = -5
ownpal = 1
removeongethit = 1
persistent = 0

[State 3230, 8a]
type = VarSet
trigger1 = ScreenPos Y <= 130
fv = 0
value = (186 - ScreenPos Y) / 28

[State 3230, 9]
type = VelSet
trigger1 = ScreenPos Y <= 130
y = fvar(0) ;3.7
persistent = 0

[State 3230, 10]
type = RemoveExplod
trigger1 = time = 52
ID = 5

[State 3230, 11]
type = Explod
trigger1 = time = 52
ID = 5
anim = 6250 + ((var(1) / 24) / 3)
postype = left
pos = -80, 0
bindtime = -1
removetime = -1
sprpriority = -5
ownpal = 1
removeongethit = 1
persistent = 0

[State 3230, 12]
type = ChangeState
trigger1 = time = 52
value = 3240

;---------------------------------------------------------------------------
; Ragnarok
; Teleport Out
[Statedef 3240]
type = A
movetype = I
physics = N
anim = 9999
velset = 0, 0

[State 3240, 0]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 3240, 00]
type = AssertSpecial
trigger1 = 1
flag = NoBG
flag2 = NoFG

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

[State 3240, 0000]
type = Width
trigger1 = 1
value = var(15), var(15)-50

[State 3240, 1]
type = Explod
trigger1 = time = 1
ID = 5513
anim = 3240
postype = p1
pos = 30, 0
bindtime = 1
removetime = -2
vel = 2, -7
sprpriority = 3

[State 3240, 2]
type = Explod
trigger1 = time = 1
ID = 5514
anim = 3245
postype = p1
pos = 30, 0
bindtime = 1
removetime = -2
vel = 7, -3
sprpriority = 3

[State 3240, 3]
type = PlaySnd
trigger1 = time = 1
value = 6, 1

[State 3240, 4]
type = Explod
trigger1 = time = 1
ID = 5513
anim = 3240
postype = p1
pos = -30, 0
facing = -1
bindtime = 1
removetime = -2
vel = -2, -7
sprpriority = 3

[State 3240, 5]
type = Explod
trigger1 = time = 1
ID = 5514
anim = 3245
postype = p1
pos = -30, 0
facing = -1
bindtime = 1
removetime = -2
vel = -7, -3
sprpriority = 3

[State 3240, 6]
type = ChangeState
trigger1 = time = 30
value = 3250

[State 3240, 7]
type = PosAdd
trigger1 = ScreenPos Y != 186
y = 186 - ScreenPos Y

;---------------------------------------------------------------------------
; Ragnarok
; Launch Attacks
[Statedef 3250]
type = A
movetype = I
physics = N
anim = 9999

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

[State 3250, 00]
type = VarSet
trigger1 = time = 0
v = 23
value = 0

[State 3250, 1]
type = TargetState
trigger1 = time = 0
value = 3410

[State 3250, 2]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 3250, 3]
type = AssertSpecial
trigger1 = 1
flag = NoBG
flag2 = NoFG

[State 3250, 4]
type = Width
trigger1 = 1
value = var(15), var(15)-50

[State 3250, 5]
type = VarSet
trigger1 = PrevStateNo = 3240
trigger1 = time = 0
v = 16
value = 0

[State 3250, 5aa]
type = VarAdd
trigger1 = PrevStateNo = 3250
trigger1 = time = 0
v = 16
value = 1

[State 3250, 5a]
type = VarRandom
trigger1 = 1
v = 22
range = 0, 1199

[State 3250, 5b]
type = VarSet
trigger1 = 1
v = 22
value = floor(var(22) / 100)

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3000) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5d]
type = VarAdd
trigger1 = NumHelper(3001) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5e]
type = VarAdd
trigger1 = NumHelper(3002) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5f]
type = VarAdd
trigger1 = NumHelper(3003) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3004) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3005) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3006) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3007) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3008) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3009) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3010) > 0
v = 23
value = 1
persistent = 0

[State 3250, 5c]
type = VarAdd
trigger1 = NumHelper(3011) > 0
v = 23
value = 1
persistent = 0

[State 3250, 6] ; Sharp forward downward angle attack
type = Helper
triggerall = NumHelper(3000) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 0
ID = 3000
name = "Attack Image"
StateNo = 3300
postype = p1
pos = -30, -100
facing = 1
ownpal = 1

[State 3250, 7] ; Sharp backward downward angle attack
type = Helper
triggerall = NumHelper(3001) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 1
ID = 3001
name = "Attack Image"
StateNo = 3300
postype = p1
pos = 80, -100
facing = -1
ownpal = 1

[State 3250, 8] ; Mid forward downward angle attack
type = Helper
triggerall = NumHelper(3002) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 2
ID = 3002
name = "Attack Image"
StateNo = 3310
postype = p1
pos = -200, -130
facing = 1
ownpal = 1

[State 3250, 9] ; Mid backward downward angle attack
type = Helper
triggerall = NumHelper(3003) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 3
ID = 3003
name = "Attack Image"
StateNo = 3310
postype = p1
pos = 230, -130
facing = -1
ownpal = 1

[State 3250, 10] ; Shallow forward downward angle attack
type = Helper
triggerall = NumHelper(3004) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 4
ID = 3004
name = "Attack Image"
StateNo = 3320
postype = p1
pos = -200, -40
facing = 1
ownpal = 1

[State 3250, 11] ; Shallow backward downward angle attack
type = Helper
triggerall = NumHelper(3005) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 5
ID = 3005
name = "Attack Image"
StateNo = 3320
postype = p1
pos = 230, -40
facing = -1
ownpal = 1

[State 3250, 12] ; Sharp forward upward angle attack
type = Helper
triggerall = NumHelper(3006) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 6
ID = 3006
name = "Attack Image"
StateNo = 3330
postype = p1
pos = -45, 175
facing = 1
ownpal = 1

[State 3250, 13] ; Sharp backward upward angle attack
type = Helper
triggerall = NumHelper(3007) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 7
ID = 3007
name = "Attack Image"
StateNo = 3330
postype = p1
pos = 95, 175
facing = -1
ownpal = 1

[State 3250, 14] ; Mid forward upward angle attack
type = Helper
triggerall = NumHelper(3008) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 8
ID = 3008
name = "Attack Image"
StateNo = 3340
postype = p1
pos = -240, 125
facing = 1
ownpal = 1

[State 3250, 15] ; Mid backward upward angle attack
type = Helper
triggerall = NumHelper(3009) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 9
ID = 3009
name = "Attack Image"
StateNo = 3340
postype = p1
pos = 270, 125
facing = -1
ownpal = 1

[State 3250, 17] ; Shallow forward upward angle attack
type = Helper
triggerall = NumHelper(3010) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 10
ID = 3010
name = "Attack Image"
StateNo = 3350
postype = p1
pos = -240, 40
facing = 1
ownpal = 1

[State 3250, 18] ; Shallow backward upward angle attack
type = Helper
triggerall = NumHelper(3011) = 0
trigger1 = time >= 2
trigger1 = var(23) < 4
trigger1 = var(22) = 11
ID = 3011
name = "Attack Image"
StateNo = 3350
postype = p1
pos = 270, 40
facing = -1
ownpal = 1

[State 3250, 19]
type = ChangeState
triggerall = var(23) = 4
triggerall = var(16) != 2
trigger1 = NumHelper(3000) = 0 && NumHelper(3001) = 0 && Numhelper(3002) = 0
trigger1 = NumHelper(3003) = 0 && NumHelper(3004) = 0 && NumHelper(3005) = 0
trigger1 = NumHelper(3006) = 0 && NumHelper(3007) = 0 && NumHelper(3008) = 0
trigger1 = NumHelper(3009) = 0 && NumHelper(3010) = 0 && NumHelper(3011) = 0
value = 3250

[State 3250, 20]
type = ChangeState
triggerall = var(23) = 4
triggerall = var(16) = 2
trigger1 = NumHelper(3000) = 0 && NumHelper(3001) = 0 && Numhelper(3002) = 0
trigger1 = NumHelper(3003) = 0 && NumHelper(3004) = 0 && NumHelper(3005) = 0
trigger1 = NumHelper(3006) = 0 && NumHelper(3007) = 0 && NumHelper(3008) = 0
trigger1 = NumHelper(3009) = 0 && NumHelper(3010) = 0 && NumHelper(3011) = 0
value = 3260

;---------------------------------------------------------------------------
; Rangnarok
; Kick Attack
[Statedef 3260]
type = A
movetype = A
physics = N
anim = 9999

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

[State 3260, 2]
type = VarAdd
trigger1 = 1
v = 1
value = 1

[State 3260, 3]
type = AssertSpecial
trigger1 = 1
flag = NoBG
flag2 = NoFG

[State 3260, 4]
type = Width
trigger1 = 1
value = var(15), var(15)-50

[State 3260, 5]
type = TargetBind
trigger1 = time = 0
pos = 39, -81
time = 1

[State 3260, 5a]
type = Turn
trigger1 = time = 5

[State 3260, 6]
type = Projectile
trigger1 = time = 5
projID = 2233
projanim = 3320
projhitanim = -1
projremanim = -1
projremove = 0
projremovetime = 22
velocity = 12, 8
projsprpriority = 2
postype = p1
offset = -170, -180
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = 3
sparkxy = -5, 0
hitsound = S1, 1
p2stateno = 3430
givepower = 40
getpower = 0

[State 3260, 7]
type = Explod
trigger1 = time = 4
ID = 9900
anim = 3325
postype = p1
pos = -170, -180
bindtime = 1
removetime = -2
vel = 12, 8
sprpriority = 3
ownpal = 1

[State 3260, 8]
type = Projectile
trigger1 = time = 5
projID = 2233
projanim = 3330
projhitanim = -1
projremanim = -1
projremove = 0
projremovetime = 22
velocity = 8, 12
projsprpriority = 2
postype = p1
offset = -80, -230
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = 3
sparkxy = -5, 0
hitsound = S1, 1
p2stateno = 3430
givepower = 40
getpower = 0

[State 3260, 9]
type = Explod
trigger1 = time = 4
ID = 1122
anim = 2270
postype = p1
pos = -80, -230
bindtime = 1
removetime = 13
vel = 8, 12
sprpriority = 3
ownpal = 1

[State 3260, 10]
type = Turn
trigger1 = time = 5
trigger2 = time = 4

[State 3260, 11]
type = Projectile
trigger1 = time = 5
projID = 2233
projanim = 3320
projhitanim = -1
projremanim = -1
projremove = 0
projremovetime = 22
velocity = 12, 8
projsprpriority = 2
postype = p1
offset = -170, -180
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = 3
sparkxy = -5, 0
hitsound = S1, 1
p2stateno = 3430
givepower = 40
getpower = 0

[State 3260, 12]
type = Explod
trigger1 = time = 4
ID = 9900
anim = 3325
postype = p1
pos = -170, -180
bindtime = 1
removetime = -2
vel = 12, 8
sprpriority = 3
ownpal = 1

[State 3260, 13]
type = Projectile
trigger1 = time = 5
projID = 2233
projanim = 3330
projhitanim = -1
projremanim = -1
projremove = 0
projremovetime = 22
velocity = 8, 12
projsprpriority = 2
postype = p1
offset = -80, -230
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = 3
sparkxy = -5, 0
hitsound = S1, 1
p2stateno = 3430
givepower = 40
getpower = 0

[State 3260, 14]
type = Explod
trigger1 = time = 4
ID = 1122
anim = 2270
postype = p1
pos = -80, -230
bindtime = 1
removetime = 13
vel = 8, 12
sprpriority = 3
ownpal = 1

[State 3260, 15]
type = EnvColor
trigger1 = ProjHit = 1
time = 2
persistent = 0

[State 3260, 16]
type = TargetState
trigger1 = Target, Vel Y > 0
trigger1 = Target, ScreenPos Y >= 140
value = 3440

[State 3260, 17]
type = ChangeState
trigger1 = Target, Vel Y > 0
trigger1 = Target, ScreenPos Y >= 140
value = 3270

;---------------------------------------------------------------------------
; Ragnarok
; Scroll Downward
[Statedef 3270]
type = A
movetype = I
physics = N
anim = 9999

[State 3270, 1]
type = VarAdd
trigger1 = 1
v = 1
value = 1

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

[State 3270, 3]
type = AssertSpecial
trigger1 = 1
flag = NoBG
flag2 = NoFG

[State 3270, 4]
type = Width
trigger1 = 1
value = var(15), var(15)-50

[State 3270, 5]
type = RemoveExplod
trigger1 = time = 0
ID = 5

[State 3270, 6]
type = Explod
triggerall = NumHelper(5829) = 0
trigger1 = time = 0
ID = 5
anim = 6250 + ((var(1) / 24) / 3)
postype = left
pos = -80, 0
bindtime = 1
removetime = -1
vel = 0, -8
accel = 0, -.17
sprpriority = -5
ownpal = 1

[State 3270, 7]
type = RemoveExplod
trigger1 = time = 9
ID = 5

[State 3270, 8]
type = Explod
triggerall = NumHelper(5829) = 0
trigger1 = time = 9
ID = 5
anim = 6250 + ((var(1) / 24) / 3)
postype = left
pos = -80, -75
bindtime = -1
removetime = -1
sprpriority = -5
ownpal = 1
removeongethit = 1

[State 3270, 9]
type = TargetState
trigger1 = time = 9
value = 3450

[State 3270, 10]
type = ChangeState
trigger1 = Target, StateNo = 3460
value = 3280

;---------------------------------------------------------------------------
; Ragnarok
; Teleport In
[Statedef 3280]
type = A
movetype = I
physics = N
anim = 2290
velset = 0, 0

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

[State 3280, 1]
type = PosSet
trigger1 = time = 0
y = -20

[State 3280, 2]
type = RemoveExplod
trigger1 = time = 0
ID = 5

[State 3280, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 6
channel = 0

[State 3280, 4]
type = StateTypeSet
trigger1 = AnimElem = 5
physics = A

[State 3280, 5]
type = NotHitBy
trigger1 = 1
value = SCA

;---------------------------------------------------------------------------
; Ragnarok
; Sharp downward angle attack image
[Statedef 3300]
type = A
movetype = A
physics = N
anim = 2430
velset = 9.675, 21 ;6.45, 14
sprpriority = 3

[State 3300, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3300, 2]
type = Explod
trigger1 = time = 0
ID = 1122
anim = 3260
postype = p1
pos = 8, -89
bindtime = 16
removetime = -2
sprpriority = 4
ownpal = 1

[State 3300, 3]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = S6021
sparkxy = -5, -33
hitsound = S1, 7
p2stateno = 3420
kill = 0
givepower = 35
getpower = 0

[State 3300, 4]
type = EnvColor
trigger1 = MoveHit
time = 1
persistent = 0
ignorehitpause = 1

[State 3300, 4a]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 3300, 5]
type = DestroySelf
trigger1 = ScreenPos Y >= 380

;---------------------------------------------------------------------------
; Ragnarok
; Med downward angle attack image
[Statedef 3310]
type = A
movetype = A
physics = N
anim = 2450
velset = 19.5, 9 ;13, 6
sprpriority = 3

[State 3310, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3310, 2]
type = Explod
trigger1 = time = 0
ID = 1122
anim = 3280
postype = p1
pos = -8, -87
facing = -1
bindtime = 30
removetime = -2
sprpriority = 4
ownpal = 1

[State 3310, 3]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = S6021
sparkxy = -5, -33
hitsound = S1, 7
kill = 0
p2stateno = 3420
givepower = 35
getpower = 0

[State 3310, 3a]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 3310, 4]
type = EnvColor
trigger1 = MoveHit
time = 1
persistent = 0
ignorehitpause = 1

[State 3310, 5]
type = DestroySelf
trigger1 = ScreenPos Y >= 380
trigger2 = Facing = 1
trigger2 = ScreenPos X >= 405
trigger3 = Facing = -1
trigger3 = ScreenPos X <= -85

;---------------------------------------------------------------------------
; Ragnarok
; Shallow downward angle attack image
[Statedef 3320]
type = A
movetype = A
physics = N
anim = 2470
velset = 22.5, 3 ;15, 2
sprpriority = 3

[State 3320, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3320, 2]
type = Explod
trigger1 = time = 0
ID = 1122
anim = 3300
postype = p1
pos = -13, -79
facing = -1
bindtime = 26
removetime = -2
sprpriority = 4
ownpal = 1

[State 3320, 3]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = S6021
sparkxy = -5, -33
hitsound = S1, 7
kill = 0
p2stateno = 3420
givepower = 35
getpower = 0

[State 3320, 3a]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 3320, 4]
type = EnvColor
trigger1 = MoveHit
time = 1
persistent = 0
ignorehitpause = 1

[State 3320, 5]
type = DestroySelf
trigger1 = ScreenPos Y >= 380
trigger2 = Facing = 1
trigger2 = ScreenPos X >= 405
trigger3 = Facing = -1
trigger3 = ScreenPos X <= -85

;---------------------------------------------------------------------------
; Ragnarok
; Sharp upward angle attack image
[Statedef 3330]
type = A
movetype = A
physics = N
anim = 2370
velset = 9.675, -21 ;6.45, -14
sprpriority = 3

[State 3330, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3330, 2]
type = Explod
trigger1 = time = 0
ID = 1122
anim = 3250
postype = p1
pos = -25, -54
bindtime = 23
removetime = -2
sprpriority = 4
ownpal = 1

[State 3330, 3]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = S6020
sparkxy = -5, -33
hitsound = S1, 7
kill = 0
p2stateno = 3420
givepower = 35
getpower = 0

[State 3330, 3a]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 3330, 4]
type = EnvColor
trigger1 = MoveHit
time = 1
persistent = 0
ignorehitpause = 1

[State 3330, 5]
type = DestroySelf
trigger1 = ScreenPos Y <= -10

;---------------------------------------------------------------------------
; Ragnarok
; Med upward angle attack image
[Statedef 3340]
type = A
movetype = A
physics = N
anim = 2390
velset = 19.5, -9 ; 13, -6
sprpriority = 3

[State 3340, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3340, 2]
type = Explod
trigger1 = time = 0
ID = 1122
anim = 3270
postype = p1
pos = -26, -65
facing = -1
bindtime = 34
removetime = -2
sprpriority = 4
ownpal = 1

[State 3340, 3]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = S6020
sparkxy = -5, -33
hitsound = S1, 7
kill = 0
p2stateno = 3420
givepower = 35
getpower = 0

[State 3340, 4]
type = EnvColor
trigger1 = MoveHit
time = 1
persistent = 0
ignorehitpause = 1

[State 3340, 4a]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 3340, 5]
type = DestroySelf
trigger1 = ScreenPos Y >= 380
trigger2 = Facing = 1
trigger2 = ScreenPos X >= 405
trigger3 = Facing = -1
trigger3 = ScreenPos X <= -85

;---------------------------------------------------------------------------
; Ragnarok
; Shallow upward angle attack image
[Statedef 3350]
type = A
movetype = A
physics = N
anim = 2410
velset = 22.5, -3 ;15, -2
sprpriority = 3

[State 3350, 1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3350, 2]
type = Explod
trigger1 = time = 0
ID = 1122
anim = 3290
postype = p1
pos = -25, -73
facing = -1
bindtime = 29
removetime = -2
sprpriority = 4
ownpal = 1

[State 3350, 3]
type = HitDef
trigger1 = time = 0
attr = A, HA
hitflag = AF+
guardflag =
pausetime = 1, 1
damage = 25
sparkno = S6020
sparkxy = -5, -33
kill = 0
hitsound = S1, 7
p2stateno = 3420
givepower = 35
getpower = 0

[State 3350, 4]
type = EnvColor
trigger1 = MoveHit
time = 1
persistent = 0
ignorehitpause = 1

[State 3350, 4a]
type = ParentVarAdd
trigger1 = MoveHit
v = 11
value = 1
persistent = 0

[State 3350, 5]
type = DestroySelf
trigger1 = ScreenPos Y >= 380
trigger2 = Facing = 1
trigger2 = ScreenPos X >= 405
trigger3 = Facing = -1
trigger3 = ScreenPos X <= -85

;---------------------------------------------------------------------------
; Ragnarok
; Getting Hit Part 1
[Statedef 3400]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = 0

[State 3400, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 3400, 2]
type = ChangeAnim2
trigger1 = time = 0
value = 3235

[State 3400, 3]
type = SelfState
trigger1 = time > 600
value = 5050

;---------------------------------------------------------------------------
; Ragnarok
; Getting Hit Part 2
[Statedef 3410]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = 0

[State 3410, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 3410, 2]
type = ChangeAnim2
trigger1 = time = 0
value = 3310
elem = 2

[State 3410, 3]
type = SelfState
trigger1 = time > 600
value = 5050

[State 3410, 4]
type = PlayerPush
trigger1 = 1
value = 0

[State 3410, 5]
type = NotHitBy
trigger1 = 1
value = SC ,NA, SA, AP, AT

[State 3410, 6]
type = HitBy
trigger1 = 1
value = A, HA

;---------------------------------------------------------------------------
; Ragnarok
; Getting Hit By Images
[Statedef 3420]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = 0

[State 3420, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 3420, 2]
type = ChangeAnim2
trigger1 = time = 0
value = 3310

[State 3420, 3]
type = SelfState
trigger1 = time > 600
value = 5050

[State 3420, 4]
type = PlayerPush
trigger1 = 1
value = 0

[State 3420, 5]
type = NotHitBy
trigger1 = 1
value =  SC ,NA, SA, AP, AT

[State 3420, 6]
type = HitBy
trigger1 = 1
value = A, HA

;---------------------------------------------------------------------------
; Ragnarok
; Get hit by kicks
[Statedef 3430]
type = A
movetype = H
physics = N

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

[State 3430, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 3430, 3]
type = NotHitBy
trigger1 = 1
value =  SC ,NA, SA, AP, AT

[State 3430, 4]
type = HitBy
trigger1 = 1
value = A, HA

[State 3430, 5]
type = ChangeAnim2
trigger1 = time <= 11
value = 3340

[State 3430, 6]
type = VelSet
trigger1 = time = 12
y = -14

[State 3430, 7]
type = VelAdd
trigger1 = time >= 12
y = .39

[State 3430, 8]
type = ChangeAnim2
trigger1 = Vel Y > 0
value = 3350
persistent = 0

;---------------------------------------------------------------------------
; Ragnarok
; Get Hit - Simulated Downward Fall
[Statedef 3440]
type = A
movetype = H
physics = N
velset = 0, -9.2

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

[State 3340, 1]
type = ChangeAnim2
trigger1 = time = 0
value = 3350

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

;---------------------------------------------------------------------------
; Ragnarok
; Plummet to ground
[Statedef 3450]
type = A
movetype = H
physics = N
velset = 0, 10

[State 3450, 1]
type = EnvShake
trigger1 = Pos Y >= 0
time = 50
freq = 130

[STate 3450, 3]
type = ChangeState
trigger1 = Pos Y >= 0
value = 3460

;---------------------------------------------------------------------------
; Ragnarok
; Hit Ground
[Statedef 3460]
type    = L
movetype= H
physics = N

[State 3460, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 3460, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 3460, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 3460, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 3460, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 3460, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 3460, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 3460, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 3460, 7]
type = Null ;ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 3460, 8]
type = GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 3460, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 3460, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 3460, 11]
type = PosFreeze
trigger1 = 1

[State 3460, 12]
type = SelfState
trigger1 = AnimTime = 0
value = 5101

[State 3460, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------

;===========================================================================
; REPORT HELPER STATES

;---------------------------------------------------------------------------
; "Danger!" Helper
[Statedef 9000]
type = A
movetype = I
physics = N
anim = 9999

[State 9000, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, var(12)

[State 9000, 2]
type = Explod
triggerall = var(0) = 1
trigger1 = time = 0
ID = 547
anim = 6150
postype = left
pos = 0, 50
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9000, 3]
type = Explod
triggerall = var(0) = -1
trigger1 = time = 0
ID = 547
anim = 6155
postype = right
pos = 0, 50
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9000, 4]
type = PlaySnd
trigger1 = time = 0
value = 5, 0
volume = 200

[State 9000, 5]
type = DestroySelf
trigger1 = NumExplod(547) = 0
trigger2 = time = 500

;---------------------------------------------------------------------------
; "First Attack" Message
[Statedef 9010]
type = A
movetype = I
physics = N
anim = 9999

[State 9010, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, var(12)

[State 9010, 2]
type = Explod
triggerall = var(0) = 1
trigger1 = time = 0
ID = 548
anim = 6160
postype = left
pos = 0, 50
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9010, 3]
type = Explod
triggerall = var(0) = -1
trigger1 = time = 0
ID = 548
anim = 6165
postype = right
pos = 0, 50
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9010, 4]
type = PlaySnd
trigger1 = time = 0
value = 5, 2
volume = 200

[State 9010, 5]
type = DestroySelf
trigger1 = NumExplod(548) = 0
trigger2 = time = 500

;---------------------------------------------------------------------------
; Combo Report Helper
[Statedef 9020]
type = A
movetype = I
physics = N
anim = 9999

[State 9020, 2]
type = VarSet
trigger1 = time = 0
v = 1
value = parent, var(19)

[State 9020, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, var(12)

[State 9020, 1a]
type = VarSet
trigger1 = time = 0
v = 2
value = parent, var(18)

[State 9020, 3]
type = Explod
triggerall = !var(2)
triggerall = var(0) = 1
triggerall = var(1) = [3,4]
trigger1 = time = 0
ID = 548
anim = 6170
postype = left
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 4]
type = Explod
triggerall = !var(2)
triggerall = var(0) = -1
triggerall = var(1) = [3,4]
trigger1 = time = 0
ID = 548
anim = 6175
postype = right
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 5]
type = Explod
triggerall = !var(2)
triggerall = var(0) = 1
triggerall = var(1) = [5,6]
trigger1 = time = 0
ID = 548
anim = 6180
postype = left
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 6]
type = Explod
triggerall = !var(2)
triggerall = var(0) = -1
triggerall = var(1) = [5,6]
trigger1 = time = 0
ID = 548
anim = 6185
postype = right
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 7]
type = Explod
triggerall = !var(2)
triggerall = var(0) = 1
triggerall = var(1) = [7,9]
trigger1 = time = 0
ID = 548
anim = 6190
postype = left
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 8]
type = Explod
triggerall = !var(2)
triggerall = var(0) = -1
triggerall = var(1) = [7,9]
trigger1 = time = 0
ID = 548
anim = 6195
postype = right
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 9]
type = Explod
triggerall = !var(2)
triggerall = var(0) = 1
triggerall = var(1) = [10,12]
trigger1 = time = 0
ID = 548
anim = 6200
postype = left
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 10]
type = Explod
triggerall = var(0) = -1
triggerall = var(1) = [10,12]
trigger1 = time = 0
ID = 548
anim = 6205
postype = right
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 11]
type = Explod
triggerall = var(0) = 1
triggerall = var(1) = [13,14]
trigger1 = time = 0
ID = 548
anim = 6210
postype = left
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 12]
type = Explod
triggerall = var(0) = -1
triggerall = var(1) = [13,14]
trigger1 = time = 0
ID = 548
anim = 6215
postype = right
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 13]
type = Explod
triggerall = var(0) = 1
triggerall = var(1) >= 15
trigger1 = time = 0
ID = 548
anim = 6220
postype = left
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 14]
type = Explod
triggerall = var(0) = -1
triggerall = var(1) >= 15
trigger1 = time = 0
ID = 548
anim = 6225
postype = right
pos = 0, 70
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1

[State 9020, 15]
type = PlaySnd
triggerall = var(1) = [3,4]
trigger1 = time = 0
value = 5, 3

[State 9020, 16]
type = PlaySnd
triggerall = var(1) = [5,6]
trigger1 = time = 0
value = 5, 7

[State 9020, 17]
type = PlaySnd
triggerall = var(1) = [7,9]
trigger1 = time = 0
value = 5, 4

[State 9020, 18]
type = PlaySnd
triggerall = var(1) = [10,12]
trigger1 = time = 0
value = 5, 8

[State 9020, 19]
type = PlaySnd
triggerall = var(1) = [13,14]
trigger1 = time = 0
value = 5, 5

[State 9020, 20]
type = PlaySnd
triggerall = var(1) >= 15
trigger1 = time = 0
value = 5, 1

[State 9020, 21]
type = DestroySelf
trigger1 = NumExplod(548) = 0
trigger2 = time = 500

;----------------------------------------------------------------------------
; Hyper Combo Finish Helper
[Statedef 9030]
type = A
movetype = I
physics = N
anim = 9999

[State 9030, 0]
type = ParentVarSet
trigger1 = time = 0
v = 26
value = 0

[State 9030, 1]
type = VarSet
trigger1 = time = 0
v = 0
value = parent, var(25)

[State 9030, 2]
type = AssertSpecial
trigger1 = NumExplod(7) > 0
flag = NoBG
flag2 = NoFG
flag3 = NoMusic

[State 9030, 3]
type = Explod
trigger1 = time = 1
ID = 7
Anim = 6260
postype = left
pos = 0, 0
bindtime = -1
removetime = -2
sprpriority = -5
ownpal = 1

[State 9030, 4]
type = PlaySnd
trigger1 = time = 1
value = 4, 2

[State 9030, 5]
type = Explod
triggerall = var(0) != 2
triggerall = var(0) != 3
trigger1 = time = 1
ID = 8
anim = 6270+((var(0)*10)-10)
postype = left
pos = 160, 120
bindtime = -1
removetime = -2
scale = 0.5,0.5
ontop = 1
ownpal = 0

[State 9030, 5]
type = Explod
triggerall = var(0) != 2
triggerall = var(0) != 3
trigger1 = time = 1
ID = 9
anim = 6271+((var(0)*10)-10)
postype = left
pos = 160, 120
bindtime = -1
removetime = -2
scale = 0.5,0.5
ontop = 1
ownpal = 0

[State 0, ModifyExplod]
type = ModifyExplod
triggerall = var(0) != 2
triggerall = var(0) != 3
trigger1 = 1
ID = 9
pos = 160,120
scale = 0.5+(time*0.01),0.5-(time*0.002)


[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 0
time = 57
add = -256,-256,-256
mul = 256,256,256
sinadd = 256,256,256,154
invertall = 0
color = 256

[State 0, PalFXWiz]
type = PalFX
trigger1 = time > 57
time = 1
add = 0,0,0
mul = 256,256,256
sinadd = 0,0,0,0
invertall = 0
color = 256

[State 9030, 9]
type = PlaySnd
trigger1 = time = 45
value = 5, 6

[State 9030, 10]
type = ParentVarSet
trigger1 = time = 10
v = 20
value = 1

;============================================================================
; OVERRIDE COMMON STATES
;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
movetype = I
physics = S
velset = 0,0
sprpriority = 0

[State 0, 0]
type = VarSet
trigger1 = time = 0
v = 25
value = 0

[State 0, AllPalFX]
type = AllPalFX
trigger1 = PrevStateNo = 642
time = 9999999
add = 0,0,0
mul = 256,256,256
color = 256

[State -2, AfterImage]
type = AfterImage
trigger1 = 1
time = 9999999
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add
ignorehitpause = 1

[State 0, Spawn Scarf]
type = Helper
trigger1 = time = 0
ID = 1212
name = "Scarf"
StateNo = 900
postype = p1
pos = -4, -71
ownpal = 1

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 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 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State 11, Spawn Scarf]
type = Helper
trigger1 = time = 0
ID = 1212
name = "Scarf"
StateNo = 910
postype = p1
pos = 4, -48
ownpal = 1

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, Spawn Scarf]
type = Helper
trigger1 = time = 0
ID = 1212
name = "Scarf"
StateNo = 920
postype = p1
pos = -8, -73
ownpal = 1

[State 20, 0]
type = VarSet
trigger1 = time = 1
v = 15
value = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A
ctrl = 1

[State 50, VarSet]
type = VarSet
triggerall = time = 1
trigger1 = PrevStateNo = 3376
trigger2 = PrevStateNo = 3501
trigger3 = PrevStateNo = 3503
v = 25
value = 0

[State 50, VarSet]
type = VarSet
trigger1 = PrevStateNo = 3503
v = 42    ;fv = 10
value = 1

[State 50, VarSet]
type = VarSet
trigger1 = PrevStateNo != 3503
v = 42    ;fv = 10
value = 0

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, Airjump Fwd]
type = ChangeAnim
triggerall = PrevStateNo = 45
triggerall = Vel X > 0
trigger1 = time = 0
value = 50

[State 50, Falling After Attack]
type = ChangeAnim
trigger1 = PrevStateNo = [400,450]
trigger1 = time = 0
trigger2 = PrevStateNo = 2050 || PrevStateNo = 1130
trigger2 = time = 0
value = 44

[State 50, 3]
type = ChangeAnim
triggerall = Anim != 50
triggerall = PrevStateNo != [400,450]
triggerall = PrevStateNo != 2050 && PrevStateNo != 1130
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

;---------------------------------------------------------------------------
; Jump Up Reverse
[Statedef 51]
type    = A
physics = A
ctrl = 1

[State 51, 0]
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 51, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 0, VelSet]
type = VelSet
trigger1 = time = 1
y = -5

[State 0, VelAdd]
type = VelAdd
trigger1 = time = time + 1
y = 0.12
;ignorehitpause =
;persistent =

[State 51, 2]
type = ChangeAnim
trigger1 = PrevStateNo != 1945
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 51, Blah]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = PrevStateNo = 1945
value = 46

[State 51, Airjump Fwd]
type = ChangeAnim
triggerall = PrevStateNo = 46
triggerall = Vel X > 0
trigger1 = time = 0
value = 50

[State 51, Falling After Attack]
type = ChangeAnim
trigger1 = PrevStateNo = [400,450]
trigger1 = time = 0
trigger2 = PrevStateNo = 2050 || PrevStateNo = 1130
trigger2 = time = 0
value = 44

[State 51, 3]
type = ChangeAnim
triggerall = Anim != 50
triggerall = PrevStateNo != [400,450]
triggerall = PrevStateNo != 2050 && PrevStateNo != 1130
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 52, Clear Var32]
type = VarSet
triggerall = var(26)
trigger1 = time = 0
v = 32
value = 0

[State 52, 0]
type = VarSet
trigger1 = time = 1
v = 15
value = 0

[State 52, Jump Land Sound]
type = PlaySnd
trigger1 = time = 0
value = 2, 2

[State 52, Landing Wave]
type = Explod
trigger1 = time = 0
ID = 589
anim = 6010
postype = p1
pos = 0, 0
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = -2

[State 52, Clear Airjump Var]
type = VarSet
trigger1 = time = 0
v = 2
value = 0

[State 52, Clear Superjump Var]
type = VarSet
trigger1 = time = 0
v = 4
value = 0

[State 52, Clear Aircombo Var]
type = VarSet
trigger1 = time = 0
v = 17
value = 0

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = N
anim = 100
sprpriority = 1
velset = 20, 0

[State 100, 1] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 2] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 3]
type = PlaySnd
trigger1 = time = 0
value = 6, 2
channel = 0

[State 100, 4]
type = PlaySnd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 3
trigger3 = AnimElem = 5
value = 2, 5

[State 100, 5]
type = PlaySnd
trigger1 = AnimElem = 7
value = 2, 4

[State 100, 6]
type = Explod
trigger1 = time < 15
trigger1 = (time % 4) = 1
ID = 41
anim = 6030
postype = p1
pos = -20, -40
bindtime = 1
removetime = -2
vel = -1, 0
ownpal = 1
random = 20, 60
sprpriority = 2

[State 100, 7]
type = Explod
trigger1 = time < 15
trigger1 = (time % 4) = 0
ID = 42
anim = 6040
postype = p1
pos = -20, -40
bindtime = 1
removetime = -2
vel = -.8, 0
ownpal = 1
random = 20, 60
sprpriority = 2

[State 100, 8]
type = VelAdd
triggerall = Vel X > 0
trigger1 = time > 15
x = -.3

[State 100, 0]
type = VarSet
trigger1 = time = 1
v = 15
value = 0

[State 100, 9]
type = Explod
trigger1 = time = [16,35]
trigger1 = (time % 4) = 0
ID = 43
anim = 6000
postype = p1
pos = 10, 0
bindtime = 1
removetime = -2
vel = -.2, 0
ownpal = 1
sprpriority = 2

[State 100, 10]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
physics = N
anim = 105
sprpriority = 1
ctrl = 1

[State 105, 1]
type = AssertSpecial
trigger1 = 1
flag = NoWalk
flag2 = NoAutoTurn

[State 105, 2]
type = PlaySnd
trigger1 = time = 0
value = 2, 3

[State 105, 0]
type = VarSet
trigger1 = time = 0
v = 15
value = 0

[State 105, 3]
type = VelSet
trigger1 = time = 0
x = -15

[State 105, 4]
type = VelSet
trigger1 = AnimElem = 8
x = 0

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

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, Roll]
type = ChangeState
triggerall = Alive
trigger1 = var(5) > 0
value = ifelse(var(5) = 1, 520, ifelse(var(5) = 2, 530, 540))

[State 5100, Thud]
type = PlaySnd
trigger1 = Time = 1
;value = F7, 0 ;Hit ground
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
;trigger1 = GetHitVar(fall.yvel) = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = GameMakeAnim
trigger1 = Time = 1
;value = 61
;pos = 0, 0
;under = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5110

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, Reset]
type = VarSet
trigger1 = time = 0
v = 26
value = 0

[State 5110, 1]
type = ChangeAnim
trigger1 = time = 0
value = 5110

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
trigger1 = stateno = 154
trigger2 = stateno = 155
trigger2 = Time <= 10; HIT_LIEDEAD

[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

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

[State 5150, 9]
type = ChangeState
triggerall = RoundState = 4
trigger1 = time >= 60
trigger1 = MatchOver
value = 171

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State 5900, Activate AI]
type = VarSet
trigger1 = var(59)
v = 26
value = 1

[State 5900, 3] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190

[State 5900, 4]
type = ChangeState
trigger1 = RoundNo != 1
value = 0

;============================================================================
; Statedef -2
[Statedef -2]

;Ame Combo Resetter-------------
[State -2, Ground Combo Reset]
type = VarSet
triggerall = (enemyNear, movetype!=H)
trigger1 = var(55) > 0
v = 55
value = 0

;Steady Afterimage Controller---------
[State -2, AfterImage]
type = AfterImage
trigger1 = StateNo = 0
time = 9999999
TimeGap  = 1
FrameGap = 1
length = 10
PalBright   = 0,0,0
PalContrast = 170,170,170
paladd = 10,10,10
palmul = .65,.65,.65
PalColor = 256
Trans = add
ignorehitpause = 1

;Formation B Type Y Attack Multiplier----------
[State -2, AttackMulSet]
type = AttackMulSet
trigger1 = NumHelper(21001) = 1
trigger1 = 1
value = ifelse(PalNo >= 10, 2,1)

;Formation B Type Z Statedef -2 Controllers----------
[State -2, DefenceMulSet]
type = DefenceMulSet
trigger1 = NumHelper(22001) = 1
trigger1 = 1
value = 0.2

[State -2, AttackMulSet]
type = AttackMulSet
trigger1 = NumHelper(22001) = 1
trigger1 = 1
value = 0.2

;True Servant Statedef -2--------------
[State -2, PalFX]
type = PalFx
triggerall = PalNo >= 10
trigger1 = StateNo != 1930
trigger1 = StateNo != 1931
trigger1 = StateNo != 1932
trigger1 = StateNo != 1945
trigger1 = StateNo != 1946
trigger1 = StateNo != 1947
trigger1 = time = 1
time = 9999999
add = 10,12,15
mul = 256,256,256
sinadd = 100,100,100,3
color = 256
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = PalNo >= 10
time = 9999999
value = 1.2

;PalFX Resetter
[State 0, PalFX]
type = PalFX
triggerall = PalNo < 10
triggerall = time = 1
trigger1 = StateNo != [1930,1932]
trigger1 = StateNo != [1945,1947]
trigger1 = StateNo != 33911
time = 99999999
add = 0,0,0
mul = 256,256,256
invertall = 0
color = 256
persistent = 1

;---------------------
;Juggle Reset Ability - By : Cypha Signals

[State -2, Can Juggle]
type = AssertSpecial
trigger1 = var(56) < 71
flag = nojugglecheck
ignorehitpause = 1

[State -2, PlaySnd]
type = PlaySnd
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
trigger1 = var(56) = 55
value = 5,10
volume = 255
channel = 5
pan = 1

[State -2, Juggling Combo Reset]
type = VarSet
triggerall = var(56) > 0
trigger1 = (enemyNear, movetype!=H)
trigger2 = movetype = H
v = 56
value = 0
ignorehitpause = 1

[State -2, Pause]
type = Pause
triggerall = var(56) > 54
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
triggerall = StateNo != 0
triggerall = StateNo != 130
triggerall = StateNo != 131
triggerall = StateNo != 132
triggerall = Movetype != H
triggerall = (enemynear, Movetype = H)
triggerall = Power >= 5500
trigger1 = command = "ComboReset"
trigger2 = Movetype = A
trigger2 = Movecontact
trigger2 = command = "ComboReset"
time = 20
movetime = 0
pausebg = 1

[State -2, Explod]
type = Explod
triggerall = var(56) > 54
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
triggerall = StateNo != 0
triggerall = StateNo != 130
triggerall = StateNo != 131
triggerall = StateNo != 132
triggerall = Movetype != H
triggerall = (enemynear, Movetype = H)
triggerall = Power >= 5500
trigger1 = command = "ComboReset"
trigger2 = Movetype = A
trigger2 = Movecontact
trigger2 = command = "ComboReset"
anim = 6515
ID = 6515000
pos = 0,-54
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
scale = 1,1
sprpriority = 10
ownpal = 1
removeongethit = 0

[State -2, PlaySnd]
type = PlaySnd
triggerall = var(56) > 54
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
triggerall = StateNo != 0
triggerall = StateNo != 130
triggerall = StateNo != 131
triggerall = StateNo != 132
triggerall = Movetype != H
triggerall = (enemynear, Movetype = H)
triggerall = Power >= 5500
trigger1 = command = "ComboReset"
trigger2 = Movetype = A
trigger2 = Movecontact
trigger2 = command = "ComboReset"
value = 3,12
volume = 100
ignorehitpause = 0

[State -2, PowerAdd]
type = PowerAdd
triggerall = var(56) > 54
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
triggerall = StateNo != 0
triggerall = StateNo != 130
triggerall = StateNo != 131
triggerall = StateNo != 132
triggerall = Movetype != H
triggerall = (enemynear, Movetype = H)
triggerall = Power >= 5500
trigger1 = command = "ComboReset"
trigger2 = Movetype = A
trigger2 = Movecontact
trigger2 = command = "ComboReset"
value = -5500
ignorehitpause = 0

[State -2, Juggling Combo Reset]
type = VarSet
triggerall = var(56) > 54
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
triggerall = StateNo != 0
triggerall = StateNo != 130
triggerall = StateNo != 131
triggerall = StateNo != 132
triggerall = Movetype != H
triggerall = (enemynear, Movetype = H)
trigger1 = command = "ComboReset"
trigger2 = Movetype = A
trigger2 = Movecontact
trigger2 = command = "ComboReset"
v = 56
value = 0
ignorehitpause = 0

[State -2, VarAdd]
type = VarAdd
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
trigger1 = MoveHit = 1
v = 56    ;fv = 10
value = 1

[State -2, VarSet]
type = VarAdd
triggerall = StateNo != [3000,3603]
triggerall = StateNo != 30400
triggerall = StateNo != 33910
triggerall = StateNo != 33911
trigger1 = ProjHit = 1
v = 56    ;fv = 10
value = 1

;End Juggle Reset Controller-----------------

;Splode's Coding From Here on----------------
[State -2, VarAdd]
type = VarAdd
trigger1 = NumHelper(5643) > 0
fv = 2
value = 0.15
ignorehitpause = 0

[State -2, VarAdd]
type = VarAdd
trigger1 = NumHelper(5643) > 0
fv = 3
value = 0.15
ignorehitpause = 0

; Clear superjump var on gethit
[State -2, Clear Superjump Var]
type = VarSet
trigger1 = MoveType = H
v = 4
value = 0

; Clear Air Combo var on gethit
[State -2, Clear Aircombo var]
type = VarSet
trigger1 = MoveType = H
v = 17
value = 0

; Recovery roll (from Sunboy's Psylocke)
[State -2]
type = VarSet
triggerall = statetype = A
triggerall = movetype = H
trigger1 = command = "RecoveryRolla"
trigger2 = var(26)
trigger2 = Alive
trigger2 = Random <= 50
var(5) = 1

[State -2]
type = VarSet
triggerall = statetype = A
triggerall = movetype = H
trigger1 = command = "RecoveryRollb"
trigger2 = var(26)
trigger2 = Alive
trigger2 = Random <= 50
var(5) = 2

[State -2]
type = VarSet
triggerall = statetype = A
triggerall = movetype = H
trigger1 = command = "RecoveryRollc"
trigger2 = var(26)
trigger2 = Alive
trigger2 = Random <= 50
var(5) = 3

[State -2]
type = VarSet
trigger1 = StateNo < 5000
trigger2 = StateNo > 5999
var(5) = 0

; First Attack message (by M@ppy, cut and pasted from BB Hood, with mods by ME!)
[State -2, Var]
type = VarSet
triggerall = Var(13) = 0
triggerall = p2movetype = H
triggerall = p2StateNo != [150,155]
triggerall = RoundState = 2
trigger1 = movecontact = 1
trigger2 = projcontact = 1
trigger3 = var(11) > 0
;trigger3 = NumHelper(7307) > 0
;trigger3 = Helper(7307), MoveHit
;trigger4 = NumHelper(245) > 0
;trigger4 = Helper(245), MoveHit
;trigger5 = NumHelper(5643) > 0
;trigger5 = Helper(5643), MoveHit
;trigger6 = NumHelper(5643) > 0
;trigger6 = Helper(5643), ProjHit1199 = 1
v = 13
value = 1
ignorehitpause = 1

[State -2, Message]
type = Helper
triggerall = NumHelper(9208) = 0
trigger1 = Var(13) = 1
ID = 9208
name = "First Attack!"
facing = 1
postype = left
stateno = 9010
ownpal = 1

[State -2, Var]
type = VarSet
trigger1 = Var(13) = 1
trigger2 = movetype = H
trigger2 = StateNo != [150,155]
v = 13
value = 2

; Combo Tracker
[State -2, Start Count]
type = VarSet
triggerall = P2MoveType = H && !WinKO
trigger1 = var(7) = 0
v = 7
value = 1
ignorehitpause = 1

[State -2, Set]
type = VarSet
triggerall = var(7)
trigger1 = HitCount > var(9)
v = 10
value = HitCount - var(9)

[State -2, Set]
type = VarSet
triggerall = var(7)
trigger1 = HitCount < var(9)
trigger1 = HitCount != 0
v = 10
value = HitCount

[State -2, Set]
type = VarSet
triggerall = var(7)
trigger1 = HitCount = var(9)
trigger2 = HitCount = 0
v = 10
value = 0

[State -2, Projectile Hits]
type = VarAdd
triggerall = var(7)
trigger1 = ProjHit = 1
v = 10
value = 1

[State -2, Add new hits to combo]
type = VarAdd
triggerall = var(7)
trigger1 = var(10) > 0 || var(11) > 0
v = 8
value = var(10) + var(11)

; Set Attack Ratio for Damage Dampening
[State -2, First Decrease]
type = VarSet
triggerall = var(7)
trigger1 = var(8) > 1
trigger1 = var(8) < 4
fv = 1
value = .62
ignorehitpause = 1

[State -2, Second Decrease]
type = VarSet
triggerall = var(7)
trigger1 = var(8) = [4,8]
fv = 1
value = .47
ignorehitpause = 1

[State -2, Third Decrease]
type = VarSet
triggerall = var(7)
trigger1 = var(8) = [9,12]
fv = 1
value = .41
ignorehitpause = 1

[State -2, Fourth Decrease]
type = VarSet
triggerall = var(7)
trigger1 = var(8) = [13,16]
fv = 1
value = .33
ignorehitpause = 1

[State -2, Final Decrease]
type = VarSet
triggerall = var(7)
trigger1 = var(8) > 16
fv = 1
value = .28
ignorehitpause = 1

[State -2, Clear Helper Hits]
type = VarSet
trigger1 = var(7)
v = 11
value = 0

[State -2, Spawn Combo Report Helper]
type = Helper
triggerall = var(7)
triggerall = NumHelper(929) = 0
triggerall = (StateNo != 1500) && (StateNo != [1645,1650])
trigger1 = P2MoveType != H || WinKO
trigger1 = NumHelper(930) = 0
ID = 930
name = "Combo Report"
StateNo = 9020
postype = p1
pos = 0, 0
ownpal = 1

[State -2, Leave Combo Counting Mode]
type = VarSet
triggerall = var(7)
trigger1 = P2MoveType != H || WinKO
v = 19
value = var(8)
ignorehitpause = 1

[State -2, Leave Combo Counting Mode]
type = VarSet
triggerall = var(7)
trigger1 = P2MoveType != H || WinKO
v = 8
value = 0
ignorehitpause = 1

[State -2, Leave Combo Counting Mode]
type = VarSet
triggerall = var(7)
trigger1 = P2MoveType != H || WinKO
v = 9
value = 0
ignorehitpause = 1

[State -2, Leave Combo Counting Mode]
type = VarSet
triggerall = var(7)
trigger1 = P2MoveType != H || WinKO
v = 7
value = 0
ignorehitpause = 1

; Display "Danger" Message
[State -2, Create Helper]
type = Helper
triggerall = var(14) = 0
triggerall = Alive
triggerall = NumHelper(929) = 0
trigger1 = Life <= 200
ID = 929
name = "Danger!"
StateNo = 9000
postype = p1
pos = 0, 0
ownpal = 1

[State -2, Increment Var]
type = VarSet
triggerall = var(14) = 0
trigger1 = Life <= 200
v = 14
value = 1

; Hyper Combo Finish
[State -2, Hyper Combo Finish]
type = Helper
triggerall = var(24) <= 1
triggerall = WinKO
triggerall = NumHelper(5829) = 0
trigger1 = NumHelper(5643) > 0
trigger1 = Helper(5643), StateNo = 3010
trigger2 = NumHelper(5643) > 0
trigger2 = Helper(5643), StateNo = 3020
trigger3 = NumHelper(7752) > 0
trigger4 = StateNo = 3260
trigger5 = StateNo = 3371
trigger6 = StateNo = 3373
trigger7 = StateNo = 3376
trigger8 = StateNo = 3378
trigger9 = StateNo = [3391,3393]
trigger10 = StateNo = [33901,33911]
trigger11 = NumHelper(3385) > 0
trigger11 = Helper(3385), StateNo = 3386
trigger12 = StateNo = [3501,3503]
trigger13 = NumHelper(3620000) > 0
trigger13 = Helper(3620000), StateNo = [3620, 3655]
trigger14 = StateNo = 30400
trigger14 = NumHelper(30410) > 0
trigger15 = StateNo = 30400
trigger15 = NumHelper(30420) > 0
trigger16 = StateNo = 30400
trigger16 = NumHelper(30430) > 0
trigger17 = StateNo = 30400
trigger17 = NumHelper(30440) > 0
trigger18 = StateNo = 30400
trigger18 = PalNo >= 10
trigger18 = NumHelper(30450) > 0
name = "Hyper Combo Finish"
ID = 5829
StateNo = 9030
postype = p1
pos = 0, 0
ownpal = 1
ignorehitpause = 1

[State -2, Hyper Combo Finish]
type = RemoveExplod
trigger1 = NumHelper(5829) > 0
ID = 5
ignorehitpause = 1

; Guard triggers for AI (from BB Hood)
[State -2, Stand guard]
type = ChangeState
triggerall = var(26) > 0
triggerall = StateType != A
triggerall = EnemyNear, StateType != C
triggerall = EnemyNear, MoveType = A
triggerall = StateNo != 130
trigger1 = ctrl = 1
value = 130

[State -2, S-to-C guard]
type = ChangeState
triggerall = var(26) > 0
triggerall = StateType != A
triggerall = EnemyNear, statetype = C
triggerall = EnemyNear, Movetype = A
trigger1 = stateno = 150
value = 152

[State -2, Crouch guard]
type = ChangeState
triggerall = var(26) > 0
triggerall = StateType != A
triggerall = EnemyNear, statetype = C
triggerall = EnemyNear, Movetype = A
triggerall = StateNo != 131
trigger1 = ctrl = 1
value = 131

[State -2, C-to-S guard]
type = ChangeState
triggerall = var(26) > 0
triggerall = StateType != A
triggerall = EnemyNear, statetype != C
triggerall = EnemyNear, Movetype = A
trigger1 = stateno = 152
value = 150

[State -2, Air guard]
type = ChangeState
triggerall = var(26) > 0
triggerall = StateType = A
triggerall = EnemyNear, Movetype = A
triggerall = StateNo != 132
trigger1 = ctrl = 1
value = 132

; End-of-tick updates

[State -2, Hit Count]
type = VarSet
trigger1 = var(7)
v = 9
value = HitCount

;============================================================================
; State -3

[Statedef -3]

; Gethit sounds
[State -3, 1]
type = VarRandom
trigger1 = StateNo = 5000
trigger1 = time = 1
v = 1
range = 0,600

; Ow sound 1
[State -3, Owie 1]
type = PlaySnd
triggerall = alive
triggerall = time = 1
triggerall = var(1) = [0,300]
trigger1 = stateno = 5001 || stateno = 5011
trigger1 = (anim % 10) != 0
trigger2 = stateno = 5040 || stateno = 5050
trigger2 = random < 500
trigger3 = stateno = 5070
value = 6, 7

; Ow sound 2
[State -3, Owie 2]
type = Playsnd
triggerall = alive
triggerall = time = 1
triggerall = var(1) = [301,600]
trigger1 = stateno = 5001 || stateno = 5011
trigger1 = (anim % 10) != 0
trigger2 = stateno = 5040 || stateno = 5050
trigger2 = random < 500
trigger3 = stateno = 5070
value = 6, 8

[State -3, Get Facing]
type = VarSet
trigger1 = !var(12)
v = 12
value = Facing

[State -3, Set Normal Attack Value]
type = VarSet
triggerall = !var(7)
trigger1 = fvar(1) < 1
fv = 1
value = 1

[State -3, Set Attack]
type = AttackMulSet
trigger1 = 1
value = fvar(1)

[State -3, Deactivate Juggle Points for Ouroboros]
type = AssertSpecial
trigger1 = NumHelper(5643) > 0
flag = nojugglecheck

[State -3, WinKO timer]
type = VarAdd
trigger1 = WinKO
v = 24
value = 1
ignorehitpause = 1

[State -3, Turn Off Ctrl For HCF]
type = CtrlSet
triggerall = WinKO
triggerall = NumHelper(5829) = 1
triggerall = Helper(5829), NumExplod(8) > 0
trigger1 = StateNo = 0
value = 0

[State -3, Turn Ctrl Back on]
type = CtrlSet
triggerall = WinKO
triggerall = NumHelper(5829) = 1
triggerall = Helper(5829), NumExplod(8) = 0
trigger1 = StateNo = 0
value = 1

[State -3, Record AI Being Active]
type = VarSet
triggerall = var(26)
trigger1 = !var(59)
v = 59
value = 1

[State -3, Kill AI When Fight is Over]
type = VarSet
triggerall = var(26)
trigger1 = Win
v = 26
value = 0

; Debug
[State -3, Debug]
type = Null ;VarSet
trigger1 = 1
v = 40
value = floor(P2BodyDist X)

[State -3, Debug]
type = Null ;VarSet
trigger1 = 1
v = 41
value = floor(EnemyNear, ScreenPos X)

[State -3, Debug]
type = Null ;DisplayToClipboard
trigger1 = 1
text = "ScreenPos X = %d Y = %d Enemy X Dist = %d AI = %d  Enemy ScreenPos = %d\n"
params = var(32), var(27), var(40), var(26), var(41)
ignorehitpause = 1
