; Vega's Mask states
;---------------------------------------------------------------------------
; Mask
[Statedef 10000]
movetype = I
ctrl = 0

[State 10000, X Velocity Set]
type = VarSet
trigger1 = Root, Var(10) < 20
v = 10
value = 0

[State 10000, Random X Velocity]
type = VarRandom
trigger1 = Root, Var(10) >= 20
v = 10
range = -2,2

[State 10000, VarAdd]
type = VarAdd
trigger1 = Var(10) = 0
v = 10
value = 1

[State 10000, Y Velocity Set]
type = VarSet
trigger1 = Root, Var(10) < 10
v = 11
value = 0

[State 10000, Random Y Velocity]
type = VarRandom
trigger1 = Root, Var(10) >= 10
v = 11
range = -2,-6

[State 10000, Pause]
type = Pause
trigger1 = Root, StateNo = 900
trigger1 = Root, Anim = 905
trigger1 = Root, AnimElem = 4
movetime = 25
time = 25

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

[State 10000, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 10000, ChangeState]
type = ChangeState
trigger1 = Root, MoveType = H
trigger1 = Root, var(10) >= 30
value = 19000

[State 10000, DestroySelf]
type = null ;DestroySelf
trigger1 = Root, MoveType = H
trigger1 = Root, var(10) >= 30

[State 10000, SprPriority]
type = SprPriority
trigger1 = Root, MoveType != H
value = 2

[State 10000, SprPriority]
type = SprPriority
trigger1 = Root, MoveType = H
value = 1

[State 10000, SprPriority]
type = SprPriority
triggerall = Var(40) = 0
trigger1 = Root, StateNo >= 1100
trigger1 = Root, StateNo < 1110
value = -5

[State 10000, Invisible]
type = AssertSpecial
triggerall = Root, MoveType != H
trigger1 = Root, Anim >= 260
trigger1 = Root, Anim <= 270
trigger2 = Root, Anim > 280
trigger2 = Root, Anim < 290
trigger3 = Root, Anim > 314
trigger3 = Root, Anim < 316
trigger4 = Root, Anim > 700
trigger4 = Root, Anim < 710
trigger5 = Root, Anim > 802
trigger5 = Root, Anim < 804
trigger6 = Root, Anim > 810
trigger6 = Root, Anim < 900
trigger7 = Root, Anim > 1060
trigger7 = Root, Anim < 1065
trigger8 = Root, Anim > 3100
trigger8 = Root, Anim < 3105
trigger9 = Root, Anim > 4000
trigger9 = Root, Anim < 5000
trigger10 = Root, Anim > 5400
flag = invisible

[State 10000, Invisible]
type = AssertSpecial
triggerall = Root, MoveType = H
trigger1 = Root, Anim > 200
trigger1 = Root, Anim < 5000
trigger2 = Root, Anim > 5240
trigger2 = Root, Anim < 5300
trigger3 = Root, Anim > 5400
trigger3 = Root, Anim < 7600
trigger4 = Root, Anim > 7700
trigger4 = Root, Anim < 9990
trigger5 = Root, Anim > 10000
flag = invisible

[State 10000, Anim]
type = ChangeAnim
triggerall = Root, MoveType != H
trigger1 = Root, Anim >= 0
trigger1 = Root, Anim < 260
trigger2 = Root, Anim >= 290
trigger2 = Root, Anim <= 314
trigger3 = Root, Anim >= 316
trigger3 = Root, Anim <= 700
trigger4 = Root, Anim >= 800
trigger4 = Root, Anim <= 802
trigger5 = Root, Anim >= 804
trigger5 = Root, Anim <= 1060
trigger6 = Root, Anim >= 1065
trigger6 = Root, Anim <= 3100
trigger7 = Root, Anim >= 3105
trigger7 = Root, Anim <= 4000
trigger8 = Root, Anim >= 5000
trigger8 = Root, Anim <= 5400
value = root, Anim + 10000
elem = root, animelemno(0)

[State 10000, Anim]
type = ChangeAnim
triggerall = Root, MoveType = H
trigger1 = Root, Anim >= 0
trigger1 = Root, Anim <= 200
trigger2 = Root, Anim >= 5000
trigger2 = Root, Anim < 5250
trigger3 = Root, Anim >= 5300
trigger3 = Root, Anim <= 5400
trigger4 = Root, Anim >= 7600
trigger4 = Root, Anim < 8500
trigger5 = Root, Anim > 8500
trigger5 = Root, Anim < 8510
trigger6 = Root, Anim > 8510
trigger6 = Root, Anim < 9000
trigger7 = Root, Anim = 9999
value = root, Anim + 10000
elem = root, animelemno(0)

;---------------------------------------------------------------------------
; Mask Flying
[Statedef 19000]
movetype = I
sprpriority = 2
anim = 19000
velset = Var(10),Var(11)
ctrl = 0

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

[State 19000, Width]
type = Width
trigger1 = 1
value = -10,-10

[State 19000, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 5, 0

[State 19000, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, StateType = S
facing = 1
pos = -10,-90
time = 1

[State 19000, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, StateType = C
facing = 1
pos = -10,-50
time = 1

[State 19000, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, StateType = A
facing = 1
pos = -10,-90
time = 1

[State 19000, Mask off]
type = ParentVarSet
trigger1 = 1
v = 1
value = 1

[State 19000, Mask Hit Reset]
type = ParentVarSet
trigger1 = 1
v = 10
value = 0

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

[State 19000, 3]
type = ChangeState
trigger1 = Time > 10
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 19010

;---------------------------------------------------------------------------
; Mask Idle
[Statedef 19010]
movetype = I
sprpriority = -4
anim = 19010
velset = 0,0
ctrl = 0

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

[State 19010, Width]
type = Width
trigger1 = 1
value = -10,-10

[State 19010, PosSet]
type = PosSet
trigger1 = Time = 0
y = 0

[State 19010, ParentVarSet]
type = ParentVarSet
triggerall = Root, MoveType != H
triggerall = Root, StateType != L
triggerall = Root, MoveType = I
trigger1 = RootDist X = [-30, 30]
trigger1 = RootDist Y = 0
v = 1
value = 0

[State 19010, PlaySnd]
type = PlaySnd
triggerall = Root, Var(1) = 0
trigger1 = RootDist X = [-30, 30]
trigger1 = RootDist Y = 0
value = 2, 10
freqmul = 1.5
channel = 5

[State 19010, ChangeState]
type = ChangeState
triggerall = Root, Var(1) = 0
trigger1 = RootDist X = [-30, 30]
trigger1 = RootDist Y = 0
value = 10000

[State 19010, DestroySelf]
type = null ;DestroySelf
triggerall = Root, Var(1) = 0
trigger1 = RootDist X = [-30, 30]
trigger1 = RootDist Y = 0

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