;---------------------------------------------------------------------------
; Psi-Thrust
[StateDef 3000]
type = U
movetype = A
physics = N
juggle = 0
anim = Cond(StateType != A, 3000, 3001)
ctrl = 0
facep2 = Cond(StateType != A, 1, 0)
poweradd = 0
velset = 0,0

[State 3000, VarRangeSet]
type = VarRangeSet
trigger1 = !Time
first = 2
last = 4
value = 0

[State 3000, VarSet]
type = VarSet
trigger1 = !Time
var(27) = 0

[State 3000, VarSet]
type = VarSet
trigger1 = Time = 30 && Var(4) = 0
var(4) = 6

[State 3000, Helper]
type = Helper
trigger1 = !Time
name = "Super FX" 
ID = 30000
stateno = 30000 
pos = 20,-80
postype = p1    ;p2,front,back,left,right
pausemovetime = 999
ownpal = 1

[State 0, Pause]
type = Pause
trigger1 = !Time
time = 41
movetime = 29

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

[State 3000, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 8
statetype = A 

[State 3000, ChangeAnim]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 41
elem = 11
persistent = 0

[State 3000, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S191,0
volumescale = 100
channel = 0

[State 3000, Helper]
type = Helper
trigger1 = AnimElem = 4
name = "Psi FX"
ID = 13000
stateno = 10200
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime = 999

[State 3000, ChangeState]
type = ChangeState
trigger1 = Time = 30
value = 3002
ctrl = 0

;---------------------------------------------------------------------------
; Psi-Thrust (Aiming 1)
[StateDef 3002]
type = U
movetype = A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
poweradd = 0

[State 3000, VarAdd]
type = VarAdd
trigger1 = 1
var(27) = 1

[State 3000, NotHitBy]
type = NotHitBy
triggerall = PrevStateNo != StateNo
trigger1 = Time < 25
value = SCA

[State 0, PlaySnd]
type = PlaySnd
triggerall = PrevStateNo != StateNo
trigger1 = Time = 0
value = S3000,0
volumescale = 100
channel = 0

[State 3002, PosSet]
type = PosSet
triggerall = PrevStateNo != StateNo
trigger1 = StateType != A
y = -30
persistent = 0

[State 3002, StateTypeSet]
type = StateTypeSet
triggerall = PrevStateNo != StateNo
trigger1 = Pos Y != 0
statetype = A
persistent = 0

[State 3002, ChangeAnim]
type = ChangeAnim
triggerall = PrevStateNo != StateNo
trigger1 = !Time
value = 1030
persistent = 0

[State 3002, ChangeAnim]
type = ChangeAnim
triggerall = PrevStateNo != StateNo
trigger1 = Anim = 1030 && AnimTime = 0
value = 1040 + var(4)
persistent = 0

[State 1020, Helper]
type = Helper
triggerall = NumHelper(23005) = 0
triggerall = MoveType = A
trigger1 = Anim != 1030
name = "Psi FX"
ID = 23005
stateno = 21000
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
persistent = 0
ignorehitpause = 1

[State 3002, VarSet]
type = VarSet
trigger1 = PrevStateNo != StateNo
trigger1 = Anim = [1041,1049]
var(4) = 0
persistent = 0

[State 0, VarAdd]
type = VarAdd
triggerall = !Time
trigger1 = PrevStateNo = StateNo
var(3) = 1

[State 3002, 1]
type = HitDef
triggerall = var(3) < 5
triggerall = Anim < 1044
trigger1 = 1
attr = A, HA			
damage = floor(30*fvar(20)), 10
animtype = Heavy			
guardflag = MA			
hitflag = MAFD
priority = 4, Hit			
pausetime = 5,5		
sparkno = S10001
guard.sparkno = S10130				
sparkxy = -20, -70	
hitsound = S5, 2		
guardsound = S6, 0			
ground.type = Low	
air.animtype = Back
ground.slidetime = 24	
ground.hittime = 24
guard.hittime = 14	
ground.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)			
air.velocity = -2.5, -7.5	
air.hittime = 24
getpower = 0
givepower = 100,50				
yaccel = 0.5
fall = Cond(var(3) < 4, 0, 1)
fall.recover = Cond(var(3) < 4, 0, 1)
fall.recovertime = 30
ground.cornerpush.veloff = 0

[State 3002, 2]
type = HitDef
triggerall = var(3) < 5
triggerall = Anim >= 1044
trigger1 = 1
attr = A, HA			
damage = floor(30*fvar(20)), 10
animtype = Heavy			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 5,5		
sparkno = S10001
guard.sparkno = S10130				
sparkxy = -20, -70	
hitsound = S5, 2		
guardsound = S6, 0			
ground.type = Low	
air.animtype = Back
ground.slidetime = 24	
ground.hittime = 24
guard.hittime = 14	
ground.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)		
air.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)		
air.hittime = 24
getpower = 0
givepower = 100, 50				
yaccel = 0.5
fall = Cond(var(3) < 4, 0, 1)
fall.recover = Cond(var(3) < 4, 0, 1)
fall.recovertime = 30
ground.cornerpush.veloff = 0

[State 0, ChangeState]
type = ChangeState
triggerall = HitShakeOver
trigger1 = MoveContact && var(3) < 5
value = stateno
ctrl = 0
ignorehitpause = 0

;== 2, 8 movement

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1042 
x = 0
y = 10
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1048 
x = 0
y = -10
persistent = 0

;== 3, 6, 9 Movement

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1043 
x = 10
y = 5
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1046
x = 10
y = 0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1049 
x = 10
y = -5
persistent = 0

;== 1, 4, 7 movement

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1041 
x = -10
y = 5
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1044
x = -10
y = 0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1047 
x = -10
y = -5
persistent = 0

;==

[State 3002, StateTypeSet]
type = StateTypeSet
trigger1 = var(3) = 5
trigger2 = Var(27) >= 30
movetype = I

[State 3002, ChangeAnim]
type = ChangeAnim
triggerall = Anim = [1041,1049]
trigger1 = MoveType = I
value = 41
elem = 11
ignorehitpause = 1

[State 3002, VelSet]
type = VelSet
trigger1 = Anim = 41
x = 0
persistent = 0

[State 3002, VelSet]
type = VelSet
trigger1 = MoveType = A && Vel Y > 0 && Vel Y + Pos Y >= 0
y = 0

[State 3002, PosSet]
type = PosSet
trigger1 = MoveType = A && Vel Y > 0 && Vel Y + Pos Y >= 0
y = 0

[State 3002, VelAdd]
type = VelAdd
trigger1 = Anim = 41
y = 0.5

[State 3002, Repeat Attack]
type = ChangeState
triggerall = var(4) != 0
trigger1 = AnimTime = 0 && Var(3) = 5
value = 3003
ignorehitpause = 1
persistent = 0

[State 3002, StateTypeSet]
type = StateTypeSet
trigger1 = var(3) = 5 && var(4) = 0
movetype = I 

[State 3002, end]
type = ChangeState
triggerall = MoveType != A
trigger1 = Vel Y > 0 && Vel Y + Pos Y >= 0
value = 1003
ctrl = 0

;---------------------------------------------------------------------------
; Psi-Thrust (Aiming 2)
[StateDef 3003]
type = U
movetype = A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
poweradd = 0

[State 3000, VarSet]
type = VarSet
triggerall = PrevStateNo != StateNo
trigger1 = !Time
var(27) = 0

[State 3000, VarAdd]
type = VarAdd
trigger1 = Time > 0
var(27) = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = PrevStateNo != StateNo
trigger1 = Time = 0
value = S3000,0
volumescale = 100
channel = 0

[State 3002, ChangeAnim]
type = ChangeAnim
triggerall = PrevStateNo != StateNo
trigger1 = !Time
value = 1030
persistent = 0

[State 3000, VarRangeSet]
type = VarRangeSet
triggerall = PrevStateNo != StateNo
trigger1 = !Time
first = 3
last = 3
value = 0

[State 3002, StateTypeSet]
type = StateTypeSet
triggerall = PrevStateNo != StateNo
trigger1 = Pos Y != 0
statetype = A
persistent = 0

[State 0, PosSet]
type = PosSet
triggerall = !Time 
triggerall = PrevStateNo != StateNo
trigger1 = Pos Y >= -30
y = -30
persistent = 0

[State 3002, ChangeAnim]
type = ChangeAnim
triggerall = PrevStateNo != StateNo
trigger1 = Anim = 1030 && AnimTime = 0
value = 1040 + var(4)
persistent = 0

[State 1020, Helper]
type = Helper
triggerall = NumHelper(23005) = 0
triggerall = MoveType = A
trigger1 = Anim != 1030
name = "Psi FX"
ID = 23005
stateno = 21000
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
persistent = 0
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = !Time
trigger1 = PrevStateNo = StateNo
var(3) = 1

[State 3002, 1]
type = HitDef
triggerall = var(3) < 5
triggerall = Anim < 1044
trigger1 = 1
attr = A, HA			
damage = floor(30*fvar(20)), 10
animtype = Heavy			
guardflag = MA			
hitflag = MAFD
priority = 4, Hit			
pausetime = 5,5		
sparkno = S10001
guard.sparkno = S10130				
sparkxy = -20, -70	
hitsound = S5, 2		
guardsound = S6, 0			
ground.type = Low	
air.animtype = Back
ground.slidetime = 24	
ground.hittime = 24
guard.hittime = 14		
ground.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)			
air.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)	
air.hittime = 24
getpower = 0
givepower = 100,50				
yaccel = 0.5
fall = Cond(var(3) < 4, 0, 1)
fall.recover = Cond(var(3) < 4, 0, 1)
fall.recovertime = 30
ground.cornerpush.veloff = 0

[State 3002, 2]
type = HitDef
triggerall = var(3) < 5
triggerall = Anim >= 1044
trigger1 = 1
attr = A, HA			
damage = floor(30*fvar(20)), 10
animtype = Heavy			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 5,5		
sparkno = S10001
guard.sparkno = S10130				
sparkxy = -20, -70	
hitsound = S5, 2		
guardsound = S6, 0			
ground.type = Low	
air.animtype = Back
ground.slidetime = 24	
ground.hittime = 24
guard.hittime = 14		
ground.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)		
air.velocity = -2.5, Cond(var(3) < 4, 0, -7.5)		
air.hittime = 24
getpower = 0
givepower = 100, 50				
yaccel = 0.5
fall = Cond(var(3) < 4, 0, 1)
fall.recover = Cond(var(3) < 4, 0, 1)
fall.recovertime = 30
ground.cornerpush.veloff = 0

[State 0, ChangeState]
type = ChangeState
triggerall = HitShakeOver
trigger1 = MoveContact && var(3) < 5
value = stateno
ctrl = 0
ignorehitpause = 0

;== 2, 8 movement

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1042 
x = 0
y = 10
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1048 
x = 0
y = -10
persistent = 0

;== 3, 6, 9 Movement

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1043 
x = 10
y = 5
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1046
x = 10
y = 0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1049 
x = 10
y = -5
persistent = 0

;== 1, 4, 7 movement

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1041 
x = -10
y = 5
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1044
x = -10
y = 0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 1047 
x = -10
y = -5
persistent = 0

;==

[State 0, Turn]
type = Turn
triggerall = MoveType = I 
trigger1 = Vel X > 0 && Facing != 1
trigger2 = Vel X < 0 && Facing != -1
persistent = 0

[State 3002, StateTypeSet]
type = StateTypeSet
trigger1 = var(3) = 5
trigger2 = Var(27) >= 30
movetype = I

[State 3002, ChangeAnim]
type = ChangeAnim
triggerall = Anim = [1041,1049]
trigger1 = MoveType = I
value = 41
elem = 11
ignorehitpause = 1

[State 3002, VelSet]
type = VelSet
trigger1 = Anim = 41
x = 0
persistent = 0

[State 3002, VelAdd]
type = VelAdd
trigger1 = Anim = 41
y = 0.5

[State 3002, VelSet]
type = VelSet
trigger1 = MoveType = A && Vel Y > 0 && Vel Y + Pos Y >= 0
y = 0

[State 3002, PosSet]
type = PosSet
trigger1 = MoveType = A && Vel Y > 0 && Vel Y + Pos Y >= 0
y = 0

[State 3002, StateTypeSet]
type = StateTypeSet
trigger1 = var(3) = 5
movetype = I

[State 3002, end]
type = ChangeState
triggerall = MoveType != A
trigger1 = Vel Y > 0 && Vel Y + Pos Y >= 0
value = 1003
ctrl = 0
;---------------------------------------------------------------------------
; Psi-Malestrom
[StateDef 3005]
type = A
movetype = A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
facep2 = Cond(StateType != A, 1, 0)
poweradd = 50
anim = 3005

[State 0, PlaySnd]
type = PlaySnd
triggerall = PrevStateNo != StateNo
trigger1 = AnimElem = 2
value = S3005,0
volumescale = 100
channel = 0

[State 3000, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(10) < 2
value = SCA

[State 3000, Helper]
type = Helper
trigger1 = !Time
name = "Super FX" 
ID = 30000
stateno = 30000 
pos = 20,-80
postype = p1    ;p2,front,back,left,right
pausemovetime = 999
ownpal = 1

[State 1005, Helper]
type = Helper
trigger1 = !Time
name = "Psi FX"
ID = 23005
stateno = 21000
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 29

[State 0, Pause]
type = Pause
trigger1 = !Time
time = 41
movetime = 29

[State 3005, VelSet]
type = VelSet
trigger1 = AnimElem = 2
y = -3

[State 0, VarSet]
type = VarSet
triggerall = AnimElemTime(2) >= 0 && MoveType != I
trigger1 = command = "a" || command = "b" || command = "c" || command = "x" || command = "y" || command = "z"
var(30) = 1

[State 0, VarSet]
type = VarSet
trigger1 = command != "a" && command != "b" && command != "c" && command != "x" && command != "y" && command != "z"
var(30) = 0

[State 3005, HitAdd]
type = HitAdd
triggerall = NumTarget(StateNo)
triggerall = AnimElemTime(26) < 0
trigger1 = var(30)
trigger1 = MoveContact = 1
value = 1

[State 3005, TargetLifeAdd]
type = TargetLifeAdd
triggerall = NumTarget(StateNo)
triggerall = AnimElemTime(26) < 0
trigger1 = var(30)
trigger1 = MoveContact = 1
value = floor(-10*fvar(20))
ID = StateNo
kill = 1
absolute = 0

[State 3005, Explod]
type = Explod
triggerall = NumTarget(StateNo)
triggerall = AnimElemTime(26) < 0
trigger1 = var(30)
trigger1 = MoveContact = 1
anim = Cond(MoveHit, 10001, 10120)
ID = 10001
pos = 0, (Target, const(size.mid.pos.y))
postype = p2  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 3005, PlaySnd]
type = PlaySnd
trigger1 = var(30) && MoveContact = 1
value = S(IfElse(MoveHit, 5, 6)), IfElse(MoveHit, 2, 0)
volumescale = 100
channel = 1

[State 3005, 1]
type = HitDef
triggerall = Time % 4 = 0
triggerall = AnimElemTime(25) <= 1
trigger1 = Var(15) < 4
attr = A, HA			
damage = floor(20*fvar(20)), 5
animtype = Heavy			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 5,5		
sparkno = S10001
guard.sparkno = S10130				
sparkxy = -20, -70	
hitsound = S5, 2		
guardsound = S6, 0			
ground.type = Low	
air.animtype = Back
ground.slidetime = 14	
ground.hittime = 14
guard.hittime = 14		
ground.velocity = 0, cond(AnimElemTime(25) < 1, Vel Y - 2, -10.5)			
air.velocity = 0, cond(AnimElemTime(25) < 1, Vel Y - 2, -10.5)
air.hittime = 18
getpower = 0
givepower = 100,50				
yaccel = 0.5
fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
id = StateNo

[State 3005, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 26
movetype = I

[State 3005, VelMul]
type = VelMul
trigger1 = MoveType = I
x = 0.9
y = 1

[State 3005, VelAdd]
type = VelAdd
trigger1 = MoveType = I
y = 0.5

[State 3005, end]
type = ChangeState
trigger1 = Vel Y > 0 && Vel Y + Pos Y >= 0
value = 1003
ctrl = 0

;---------------------------------------------------------------------------
; Kochou Gakure
[StateDef 3010]
type = U
movetype = A
physics = N
juggle = 0
anim = 3010
ctrl = 0
facep2 = Cond(StateType != A, 1, 0)
poweradd = 0
velset = 0,0

[State 3010, PlaySnd]
type = PlaySnd
triggerall = PrevStateNo != StateNo
trigger1 = AnimElem = 2
value = S3010,0
volumescale = 100
channel = 0

[State 3010, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(10) < 5
value = SCA

[State 3010, Helper]
type = Helper
trigger1 = !Time
name = "Super FX" 
ID = 30000
stateno = 30000 
pos = 20,-80
postype = p1    ;p2,front,back,left,right
pausemovetime = 999
ownpal = 1

[State 3010, Pause]
type = Pause
trigger1 = !Time
time = 41
movetime = 29

[State 3010, Helper]
type = Helper
trigger1 = AnimElem = 8
name = "Kochou Gakure" 
ID = 13010
stateno = 13010
pos = 0,0
postype = p1    ;p2,front,back,left,right
pausemovetime = 999
ownpal = 1

[State 3010, ChangeAnim]
type = ChangeAnim
triggerall = Time < 175
trigger1 = AnimElemTime(23) = 1
value = StateNo
elem = 22

[State 3010, ChangeAnim]
type = ChangeAnim
triggerall = Time >= 175
trigger1 = StateType = A
value = 41
elem = 11
persistent = 0

[State 3010, StateTypeSet]
type = StateTypeSet
trigger1 = Time >= 175
movetype = I

[State 3010, VelAdd]
type = VelAdd
trigger1 = Anim = 41
y = 0.5

[State 3010, end]
type = ChangeState
trigger1 = AnimTime = 0 && StateType != A
value = 0
ctrl = 1

[State 3010, end]
type = ChangeState
trigger1 = Vel Y > 0 && Vel Y + Pos Y >= 0
value = 1003
ctrl = 0
