;==============================================================================
;　ヘルパーステート
;==============================================================================

;==============================================================================
;　アーマー（オロチ）
;==============================================================================
[StateDef 1003]
Type = S
MoveType = I
Physics = N

[State 8000, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
Flag  = Invisible
IgnoreHitPause = 1

[State 8000, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = , NT, ST, HT
IgnoreHitPause = 1

[State 800, ChangeAnim]
Type = ChangeAnim
Trigger1 = 1
Trigger1 = Anim != 1003
Value = 1003
IgnoreHitPause = 1

[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1000)
X              = Helper(1000),Pos X
Y              = Helper(1000),Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999
[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1000) = 0
X              = Root,Pos X
Y              = Root,Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999

[State -1, DefenceMulSet]
Type = DefenceMulSet
Trigger1 = 1
Value = (Root,Life*0.3+700)*0.001
IgnoreHitPause = 1

[State 8000, HitOverride]
Type = HitOverride
Trigger1 = 1
Attr = SCA, NA, SA, HA, NP, SP, HP
StateNo = 1004
Time = 1
IgnoreHitPause = 1

[State 8000, DestroySelf]
Type = DestroySelf
Trigger1 = Root,Life = 0
Trigger2 = NumHelper(1000) = 0

;==============================================================================
;　アーマー２（オロチ）
;==============================================================================
[StateDef 1004]
Type = S
MoveType = H
Physics = N

[State -1, DefenceMulSet]
Type = DefenceMulSet
Trigger1 = 1
Value = (Root,Life*0.3+700)*0.001
IgnoreHitPause = 1

[State 8001, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
Flag  = Invisible
IgnoreHitPause = 1

[State 8001, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
IgnoreHitPause = 1

[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1000)
X              = Helper(1000),Pos X
Y              = Helper(1000),Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999
[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1000) = 0
X              = Root,Pos X
Y              = Root,Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999

[State 8001, ParentVarAdd]
Type = ParentVarAdd
Trigger1 = Time = 0
V = 27
Value = -floor(Ceil(GetHitVar(Damage)))
IgnoreHitPause = 1

[State 8001, ChangeState]
Type = ChangeState
Trigger1 = Time >= 10
Value = 1003
IgnoreHitPause = 1

[State 8001, DestroySelf]
Type = DestroySelf
Trigger1 = Root,Life = 0
Trigger2 = NumHelper(1000) = 0

;==============================================================================
;　アーマー（オロチっこ）
;==============================================================================
[StateDef 1013]
Type = S
MoveType = I
Physics = N

[State 8000, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
Flag  = Invisible
IgnoreHitPause = 1

[State 8000, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = , NT, ST, HT
IgnoreHitPause = 1

[State 800, ChangeAnim]
Type = ChangeAnim
Trigger1 = 1
Trigger1 = Anim != 1013
Value = 1013
IgnoreHitPause = 1

[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1010)
X              = Helper(1010),Pos X
Y              = Helper(1010),Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999
[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1010) = 0
X              = Root,Pos X
Y              = Root,Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999

[State -1, DefenceMulSet]
Type = DefenceMulSet
Trigger1 = 1
Value = (Root,Life*0.3+700)*0.001
IgnoreHitPause = 1

[State 8000, HitOverride]
Type = HitOverride
Trigger1 = 1
Attr = SCA, NA, SA, HA, NP, SP, HP
StateNo = 1014
Time = 1
IgnoreHitPause = 1

[State 8000, DestroySelf]
Type = DestroySelf
Trigger1 = Root,Life = 0
Trigger2 = NumHelper(1010) = 0

;==============================================================================
;　アーマー２（オロチっこ）
;==============================================================================
[StateDef 1014]
Type = S
MoveType = H
Physics = N

[State -1, DefenceMulSet]
Type = DefenceMulSet
Trigger1 = 1
Value = (Root,Life*0.3+700)*0.001
IgnoreHitPause = 1

[State 8001, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
Flag  = Invisible
IgnoreHitPause = 1

[State 8001, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
IgnoreHitPause = 1

[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1010)
X              = Helper(1010),Pos X
Y              = Helper(1010),Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999
[State 2110]
type = PosSet
trigger1       = 1
trigger1       = NumHelper(1010) = 0
X              = Root,Pos X
Y              = Root,Pos Y
supermovetime  = 9999999999
pausemovetime  = 9999999999

[State 8001, ParentVarAdd]
Type = ParentVarAdd
Trigger1 = Time = 0
V = 27
Value = -floor(Ceil(GetHitVar(Damage)))
IgnoreHitPause = 1

[State 8001, ChangeState]
Type = ChangeState
Trigger1 = Time >= 10
Value = 1013
IgnoreHitPause = 1

[State 8001, DestroySelf]
Type = DestroySelf
Trigger1 = Root,Life = 0
Trigger2 = NumHelper(1010) = 0

;==============================================================================
; カットイン　通常
;==============================================================================
[Statedef 8000]
Type = A
Physics = N
SprPriority = 8
Anim = 20012

[State -1, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
Time = 1

[State -1, Explod]
Type = null;Explod
Trigger1 = Time = [0,20]
Anim = 20000
ID = 20000
Postype = back
Pos = -240+(statetime*12) ,0 
scale = .5,.5
Ownpal = 1
SprPriority = -9
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1, Explod]
Type = null;Explod
Trigger1 = Time = [21,40]
Anim = 20000
ID = 20000
Postype = back
Pos = 0,0 
scale = .5,.5
Ownpal = 1
SprPriority = -9
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1, Explod]
Type = Explod
Trigger1 = Time = [0,20]
Anim = 20002
ID = 20002
Postype = back
Pos = -240+(statetime*12) ,0 
scale = .5,.5
Ownpal = 1
SprPriority = -8
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1, Explod]
Type = Explod
Trigger1 = Time = [21,40]
Anim = 20002
ID = 20002
Postype = back
Pos = 0,0 
scale = .5,.5
Ownpal = 1
SprPriority = -8
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1, Explod]
Type = Explod
Trigger1 = Time > 40
Anim = 20001
ID = 20001
Postype = back
Pos = 0,0
scale = 0.5+(statetime-40)*0.02,.5+(statetime-40)*0.02
Ownpal = 0
SprPriority = -9
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1]
Type     = VarAdd
Trigger1 = Time >= 40
V        = 7
Value    = 25

[State -1]
Type     = PalFx
Trigger1 = 256-Var(7) > 0
Time     = 1
Add      = 0,0,0
Mul      = ceil(256-Var(7)),ceil(256-Var(7)),ceil(256-Var(7))
[State -1]
Type     = PalFx
Trigger1 = 256-Var(7) <= 0
Time     = 1
Add      = 0,0,0
Mul      = 0,0,0

[State -1, AssertSpacial]
Type = AssertSpecial
Trigger1 = 1
Flag = Noshadow
Flag1 = invisible
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, DestroySelf]
Type = DestroySelf
Trigger1 = Time = 50

;==============================================================================
; カットイン　アークドライブ
;==============================================================================
[Statedef 8010]
Type = A
Physics = N
SprPriority = 8
Anim = 20012

[State -1, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
Time = 1

[State -1, Explod]
Type = Explod
Trigger1 = Time = [0,20]
Anim = 20002
ID = 20002
Postype = back
Pos = -240+(statetime*12) ,0 
scale = .5,.5
Ownpal = 1
SprPriority = -1
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, Explod]
Type = Explod
Trigger1 = Time = [21,40]
Anim = 20002
ID = 20002
Postype = back
Pos = 0,0 
scale = .5,.5
Ownpal = 1
SprPriority = -1
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, Explod]
Type = Explod
Trigger1 = Time > 40
Anim = 20003
ID = 20003
Postype = back
Pos = 0,0
scale = 0.5+(statetime-40)*0.02,.5+(statetime-40)*0.02
Ownpal = 0
SprPriority = -1
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1]
Type     = VarAdd
Trigger1 = Time >= 40
V        = 7
Value    = 25

[State -1]
Type     = PalFx
Trigger1 = 256-Var(7) > 0
Time     = 1
Add      = 0,0,0
Mul      = ceil(256-Var(7)),ceil(256-Var(7)),ceil(256-Var(7))
[State -1]
Type     = PalFx
Trigger1 = 256-Var(7) <= 0
Time     = 1
Add      = 0,0,0
Mul      = 0,0,0

[State -1, AssertSpacial]
Type = AssertSpecial
Trigger1 = 1
Flag = Noshadow
Flag1 = invisible
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, DestroySelf]
Type = DestroySelf
Trigger1 = Time = 50
IgnoreHitPause = 1

;==============================================================================
; カットイン　ラストアーク
;==============================================================================
[Statedef 8020]
Type = A
Physics = N
SprPriority = 8
Anim = 20012

[State -1, NotHitBy]
Type = NotHitBy
Trigger1 = 1
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
Time = 1

[State -1, Explod]
Type = Explod
Trigger1 = Time = [0,20]
Anim = 20004
ID = 20004
Postype = back
Pos = -240+(statetime*12) ,0 
scale = .5,.5
Ownpal = 1
SprPriority = -1+ifelse(IsHelper(3100),42,0)
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, Explod]
Type = Explod
Trigger1 = Time = [21,40]
Anim = 20004
ID = 20004
Postype = back
Pos = 0,0 
scale = .5,.5
Ownpal = 1
SprPriority = -1+ifelse(IsHelper(3100),42,0)
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, Explod]
Type = Explod
Trigger1 = Time > 40
Anim = 20005
ID = 20005
Postype = back
Pos = 0,0
scale = 0.5+(statetime-40)*0.02,.5+(statetime-40)*0.02
Ownpal = 0
SprPriority = -1+ifelse(IsHelper(3100),42,0)
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1]
Type     = VarAdd
Trigger1 = Time >= 40
V        = 7
Value    = 25

[State -1]
Type     = PalFx
Trigger1 = 256-Var(7) > 0
Time     = 1
Add      = 0,0,0
Mul      = ceil(256-Var(7)),ceil(256-Var(7)),ceil(256-Var(7))
[State -1]
Type     = PalFx
Trigger1 = 256-Var(7) <= 0
Time     = 1
Add      = 0,0,0
Mul      = 0,0,0

[State -1, AssertSpacial]
Type = AssertSpecial
Trigger1 = 1
Flag = Noshadow
Flag1 = invisible
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -1, DestroySelf]
Type = DestroySelf
Trigger1 = Time = 50
IgnoreHitPause = 1

;==============================================================================
; 霊力ゲージ１
;==============================================================================
[Statedef 8040]
Type = A
Physics = N
SprPriority = 8
Anim = 20012

[State -1, VelSet]
Type = PosSet
TriggerAll = 1
Trigger1 = Enemy,TeamMode = Single || Enemy,TeamMode = Turns
Trigger2 = Enemy,TeamMode = Simul
Trigger2 = EnemyNear,Alive != 0
X = EnemyNear,Pos X
Y = EnemyNear,Pos Y
[State -1, VelSet]
Type = PosSet
TriggerAll = 1
Trigger1 = Enemy,TeamMode = Simul
Trigger1 = EnemyNear,Alive = 0
X = EnemyNear(1),Pos X
Y = EnemyNear(1),Pos Y


[State 200, Sound Effect]
type = PlaySnd
Trigger1 = Parent,Var(12) = 1
value = s1,1
channel = 5
[State 200, Sound Effect]
type = PlaySnd
Trigger1 = Parent,Var(12) = 2
value = s1,2
channel = 5
[State 200, Sound Effect]
type = PlaySnd
Trigger1 = Parent,Var(12) = 6
value = s1,6
channel = 5
[State 200, Sound Effect]
type = PlaySnd
Trigger1 = Parent,Var(12) = 7
value = s1,7
channel = 5
[State 200, Sound Effect]
type = PlaySnd
Trigger1 = Parent,Var(12) = 320
value = s3,20
channel = 3
[State -1, ParentVarSet]
Type = ParentVarSet
Trigger1 = Parent,Var(12) > 0
V = 12
Value = 0

;==============================================================================
;　AI起動用ヘルパー
;==============================================================================
[Statedef 9000]
anim=20012;なにも表示しないｱﾆﾒでもいいけど入れなくても全然問題ない
ctrl=0

[State 10000,間違いで本体が来たら立ちへ移行]
type=selfstate
trigger1=!ishelper
value=0

[State 10000,プレイヤー判定]
type=varset
trigger1=command="up"&&root,command="up"
trigger2=command="down"&&root,command="down"
trigger3=command="back"&&root,command="back"
trigger4=command="fwd"&&root,command="fwd"
trigger5=command="a"&&root,command="a"
trigger6=command="b"&&root,command="b"
trigger7=command="c"&&root,command="c"
trigger8=command="x"&&root,command="x"
trigger9=command="y"&&root,command="y"
trigger10=command="z"&&root,command="z"
trigger11=command="start"&&root,command="start"
var(1)=-1

[State 10000,立ったら消失]
Type = DestroySelf
triggerAll = isHelper
Trigger1 = root,var(1)||var(1)=-1
trigger2=command="up"&&root,command="up"
trigger3=command="down"&&root,command="down"
trigger4=command="back"&&root,command="back"
trigger5=command="fwd"&&root,command="fwd"
trigger6=command="a"&&root,command="a"
trigger7=command="b"&&root,command="b"
trigger8=command="c"&&root,command="c"
trigger9=command="x"&&root,command="x"
trigger10=command="y"&&root,command="y"
trigger11=command="z"&&root,command="z"
trigger12=command="start"&&root,command="start"

[State 10000,ﾌﾗｸﾞON]
type=varset
triggerall=var(1)!=-1
trigger1=root,command="up"
trigger2=root,command="down"
trigger3=root,command="back"
trigger4=root,command="fwd"
trigger5=root,command="a"
trigger6=root,command="b"
trigger7=root,command="c"
trigger8=root,command="x"
trigger9=root,command="y"
trigger10=root,command="z"
trigger11=root,command="start"
var(1)=1