;特殊システムステート

;---------------------------------------------------------------------------
; 
[Statedef 9000]


[state ]
type=changestate
trigger1 = animtime=0
value=0
ctrl=1




;=================================================================
;システムヘルパー
[Statedef 51000]

[state 転生変数]
type=varset
triggerall = ishelper
trigger1 = root,anim = 1200
trigger1 = root,animelemtime(7)=0
sysvar(2)=720
[state 転生変数]
type=varadd
triggerall = ishelper
trigger1 = sysvar(2)
trigger1 = root,stateno!=100200;Mapelao。
sysvar(2)=-1
[state 転生変数]
type=varset
triggerall = ishelper
trigger1 = sysvar(2)<0
sysvar(2)=0

[state 転生変数]
type=varset
triggerall = ishelper
trigger1 = root,stateno = 100200
sysvar(2)=99

[State , エフェクト表示]
type = Explod
triggerall = ishelper
trigger1 = sysvar(2)
trigger1 = !numexplod(10001)
anim = 10001
ID = 10001
bindtime = 19999999
postype=left
pos = 0,-0
scale = 1,1
ownpal = 0
sprpriority =-9
removetime = -1
pausemovetime = 0
ignorehitpause = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = sysvar(2)
flag = nobg

[State , エフェクト表示]
type = Explod
triggerall = ishelper
trigger1 = !sysvar(2)
trigger1 = numexplod(10001)
anim = 7213
bindtime = 19999999
postype=left
pos = -60,-60
scale = 4,4
ownpal = 1
sprpriority =6
pausemovetime = 999999
supermovetime = 9999
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !sysvar(2)
id = 10001



;┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋
;┃†Mapelao。

[state ]
type=palfx
triggerall=numexplod(10001)
triggerall=root,stateno=100200
trigger1=root,animelemtime(1)=[0,60+40+130-1]
trigger1=1||fvar(0):=512
time=1
add=floor(-128+(32768/fvar(0))),floor(-128+(32768/fvar(0))),floor(-128+(32768/fvar(0)))
mul=floor(fvar(0)),floor(fvar(0)),floor(fvar(0))
ignorehitpause=1
[state ]
type=palfx
triggerall=numexplod(10001)
triggerall=root,stateno=100200
trigger1=root,animelemtime(1)=[60+40+130,60+40+150-1]
trigger1=1||fvar(0):=256+256*sin((pi/2/20)*(root,animelemtime(1)-(60+40+130)))
time=1
add=floor(-128+(32768/fvar(0))),floor(-128+(32768/fvar(0))),floor(-128+(32768/fvar(0)))
mul=floor(fvar(0)),floor(fvar(0)),floor(fvar(0))
ignorehitpause=1

[state ]
type=modifyexplod
triggerall=numexplod(10001)
triggerall=root,stateno!=100200
trigger1=1
id=10001
trans=add
ignorehitpause=1
[state ]
type=modifyexplod
triggerall=numexplod(10001)
triggerall=root,stateno=100200
trigger1=root,animelemtime(1)=[0,60+40+130-1]
id=10001
trans=addalpha
alpha=0,256
ignorehitpause=1
[state ]
type=modifyexplod
triggerall=numexplod(10001)
triggerall=root,stateno=100200
trigger1=root,animelemtime(1)=[60+40+130,60+40+150-1]
id=10001
trans=addalpha
alpha=floor(256*sin((pi/2/20)*(root,animelemtime(1)-(60+40+130)))),256
ignorehitpause=1
[state ]
type=modifyexplod
triggerall=numexplod(10001)
triggerall=root,stateno=100200
trigger1=root,animelemtime(1)>=60+40+150
id=10001
trans=add
ignorehitpause=1

;┃†Mapelao。
;┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋


[State 51000, 当身]
Type = ReversalDef
Trigger1 = ishelper(51000)
Reversal.Attr = SCA,AA,AT,AP	
Pausetime = 0, 2		
Sparkno   = -1			
Hitsound = -1			
Numhits = 0
Ignorehitpause = 1
Numhits = 0


[state ]
type=turn
trigger1 = root,facing != facing

[state 相手がガードしないように]
type = AttackDist
trigger1 = 1
value = 0

[State ]
Type = AssertSpecial
Trigger1 = 1
Flag = NoShadow;影消し
Flag2 = Invisible;姿消し
Ignorehitpause = 1

[State 攻撃設定]
type = HitDef
trigger1 = !numtarget
trigger1 = root,var(4)
trigger1 = !sysfvar(0)
attr = , HT
damage = 0,0
animtype = Light
guardflag = 
hitflag = MAFD
priority = 7, Hit
pausetime = 0, 0
sparkxy = -10, -50
sparkno = S-1
hitsound = S-1,0
guardsound = S-1,0
p2stateno = 0
numhits = ifelse(var(17),1,0)

[state ]
type=varset
triggerall = root,var(4)
trigger1 = Movereversed
trigger2 = enemy,stateno != 0
trigger3 = enemy,name = "DeathStarla" 
sysfvar(0)=1

[State 51000, ステートタイプ設定]
Type = StateTypeSet
Trigger1 = ishelper(51000)
Trigger1 = !NumTarget
StateType = S
MoveType = A
Physics = N
Ignorehitpause = 1

[State 51000, タゲとったらタイプ変更]
Type = StateTypeSet
Trigger1 = ishelper(51000)
Trigger1 = NumTarget
StateType = S
MoveType = I
Physics = N
Ignorehitpause = 1

[State 51000, 位置固定];ターゲット取るまでは親と同じ座標で動く
Type = BindToRoot
Trigger1 = ishelper(51000)
Pos = 0, -0
Facing = 1
Time = -1
Ignorehitpause = 1

[State ]
type=screenbound
trigger1=ishelper
value=0
movecamera=0,0
ignorehitpause=1

[State 51000, アニメ変更]
Type = ChangeAnim
Trigger1 = !NumTarget
Value = 9998         
Ignorehitpause = 1

[State 51000, アニメ変更]
Type = ChangeAnim
Trigger1 = NumTarget
Value = 9999
Ignorehitpause = 1

[State 51000, ターゲットをひとつに絞る]
Type = TargetDrop
Triggerall = ishelper(51000)
Trigger1 = NumTarget > 1
KeepOne = 1
Ignorehitpause = 1

[State 51000, 本体じゃないものをターゲットした場合はターゲット破棄]
Type = TargetDrop
Triggerall = ishelper(51000)
Triggerall = NumTarget
Trigger1 = !Target,Alive
Trigger2 = Target,ishelper
Trigger3 = TeamSide = Target,TeamSide
Ignorehitpause = 1

[State ターゲット毒]
type = TargetLifeAdd
Triggerall = ishelper(51000)
triggerall = root,fvar(34)=[0,1]
trigger1 = root,projcontacttime(53000)=1
trigger2 = root,projcontacttime(53001)=1
value = -5
kill = 1
absolute = 1
[State ターゲット毒-強化]
type = TargetLifeAdd
Triggerall = ishelper(51000)
triggerall = root,fvar(34)=2
trigger1 = root,projcontacttime(53000)=1
trigger2 = root,projcontacttime(53001)=1
value = -10
kill = 1
absolute = 1
[State 0, TargetPowerAdd]
type = TargetPowerAdd
Triggerall = ishelper(51000)
triggerall = root,fvar(34)=2
trigger1 = root,projcontacttime(53000)=1
trigger2 = root,projcontacttime(53001)=1
value = -30
ignorehitpause = 1


[State 51000,死の宣告]
Type = TargetLifeAdd
TriggerAll = NumTarget = 1
Trigger1 = ishelper(51000)
Trigger1 = roundstate>2
trigger1 = root,alive  
Value = -2147483647
Ignorehitpause = 1

[state 喰らいステートへ飛ばす]
type = TargetState
Triggerall = ishelper(51000)
Triggerall = NumTarget
trigger1=root,stateno=100200;Mapelao
trigger1=root,animelemtime(1)=[60+40+5,60+40+130-1]
value = 51001
ignorehitpause = 1

;Time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1
ignorehitpause = 1

[State 51, ステート変更]
type = Changestate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1


;---------------------------------------------------------------------------
;無敵剥がし
[statedef 51001]
type=U
movetype=H
physics=U
ctrl = 0

[State ]
type=Statetypeset
trigger1=ishelper
movetype=H
physics=N
ignorehitpause=1

[state ]
type=statetypeset
trigger1 = statetype = L
statetype = C

[state ]
type=velset
trigger1 = time=0
x=0
y=0

[State ]
type=Gravity
trigger1=pos Y < -1
ignorehitpause=1

[state ]
type=posset
trigger1 = pos y >0
y = 0
ignorehitpause=1

[State ]
type=ChangeAnim2
trigger1=pos y >= 0
trigger1 = anim != [5304,5305]
value=5304
ignorehitpause=1
[State ]
type=ChangeAnim2
trigger1=pos Y<0
trigger1 = anim != [5304,5305]
value=5305
ignorehitpause=1
 
[State 永タゲ用Hitdef吐かせ]
type = HitDef
trigger1 = 1
attr = C,HT
damage = 0, 0
pausetime = 8,0
guardflag = MAFD
hitflag = ;空でも当身はされる
priority = 1, Hit
sparkno = -1
sparkxy = 0,-9999999
hitsound = S-1,0
GuardSound = s-1,0
guard.sparkno = S-1
ignorehitpause = 1

[State ]
type=hitby
trigger1=1
value=SCA,AA,AP,AT
time=-1
ignorehitpause=1
[State ]
type=hitby
trigger1=1
value2=SCA,AA,AP,AT
time=-1
ignorehitpause=1



[state ]
type=selfstate
triggerall = anim != [5304,5305]
trigger1 = animtime=0
trigger2 = time >30 
value=ifelse(pos y>=0,0,50)
ctrl=1

[state ]
type=selfstate
triggerall = anim = [5304,5305]
trigger1 = animtime=0
trigger2 = time >50
value=ifelse(pos y<0,5050,5020)
ctrl=0

[state ]
type=velmul
trigger1 = statetype=A
y = 0.5

[state ]
type=selfstate
trigger1 = !alive
value=5050
ctrl=0


;---------------------------------------------------------------------------
;アーマーヘルパー
[statedef 52000]
type=U
movetype=I
physics=U
ctrl = 0

;sysvar(1) ダメージ減衰処理
;sysvar(2)　Life管理変数
;sysvar(3)　Time代用変数

;sysfvar(1) Hitdefオンリーバリアスイッチ
;sysfvar(2)　Hitdefオンリー無敵時間

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = enemynear,movetype=A
movetype = H
ignorehitpause = 1

[state 防御補正相殺]
type = DefenceMulSet
trigger1 = 1
value = 1.1
ignorehitpause = 1

[state ]
type=lifeset
trigger1 = 1
value = 99999999999
ignorehitpause = 1

[state ダメージ処理]
type=varadd
trigger1 = root,fvar(36)=0
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=200,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,40]),0.8,1))


;Hp残量が低い処理順にしないと多重処理が発生する事がある
;sysvar(2)=受けたダメージの蓄積量

;HP1000~750で小補正　HP749~330で中補正　HP329~0で大補正
[state ダメージ処理-1ピンチ]
type=varadd
trigger1 = root,fvar(36)=1
trigger1 = sysvar(2)>=671
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=100,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,45]),0.55,0.65))
[state ダメージ処理-1]
type=varadd
trigger1 = root,fvar(36)=1
trigger1 = sysvar(2)=[251,670]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=130,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,45]),0.65,0.8))
[state ダメージ処理-1]
type=varadd
trigger1 = root,fvar(36)=1
trigger1 = sysvar(2)=[0,250]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=150,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,45]),0.75,0.85))

;HP1000~700で小補正　HP699~500で中補正　HP499~0で大補正
[state ダメージ処理-2ピンチ]
type=varadd
trigger1 = root,fvar(36)=2
trigger1 = sysvar(2)>=501
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=100,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,50]),0.4,0.55))
[state ダメージ処理-2]
type=varadd
trigger1 = root,fvar(36)=2
trigger1 = sysvar(2)=[301,500]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=130,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,50]),0.5,0.7))
[state ダメージ処理-2]
type=varadd
trigger1 = root,fvar(36)=2
trigger1 = sysvar(2)=[0,300]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=150,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,50]),0.65,0.7))

;HP1000~700で小補正　HP699~450で中補正　HP449~0で大補正
[state ダメージ処理-3ピンチ]
type=varadd
trigger1 = root,fvar(36)=3
trigger1 = sysvar(2)>=551
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=70,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,40]),0.35,0.45))
[state ダメージ処理-3]
type=varadd
trigger1 = root,fvar(36)=3
trigger1 = sysvar(2)=[301,550]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=85,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,60]),0.45,0.55))
[state ダメージ処理-3]
type=varadd
trigger1 = root,fvar(36)=3
trigger1 = sysvar(2)=[0,300]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=100,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,60]),0.6,0.7))

[state ダメージ処理-4本家　デススター2ndと同じく全ダメージ10]
type=varadd
trigger1 = root,fvar(36)=4
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=10



;HP1000~700で小補正　HP699~400で中補正　HP399~0で大補正
[state ダメージ処理-弱体化ピンチ]
type=varadd
trigger1 = root,fvar(35)=1
trigger1 = sysvar(2)>=601
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=200,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,40]),1.2,1.4))
[state ダメージ処理-弱体化]
type=varadd
trigger1 = root,fvar(35)=1
trigger1 = sysvar(2)=[301,600]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=200,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,60]),1.4,1.6))
[state ダメージ処理-弱体化]
type=varadd
trigger1 = root,fvar(35)=1
trigger1 = sysvar(2)=[0,300]
trigger1 = gethitvar(damage)=[1,300]
sysvar(2)=ceil((ifelse(gethitvar(damage)>=200,gethitvar(damage)/2,gethitvar(damage)))*ifelse((sysvar(1)=[1,60]),1.6,1.8))


[state 転生中回復]
type=varadd
trigger1 = numhelper(51000)
trigger1 = helper(51000),sysvar(2)
trigger1 = sysvar(2)<root,lifemax
trigger1 = gametime%3=0
trigger1 = root,fvar(36)=[0,1]
sysvar(2)=-1
[state 転生中回復-強化]
type=varadd
trigger1 = numhelper(51000)
trigger1 = helper(51000),sysvar(2)
trigger1 = sysvar(2)<root,lifemax
trigger1 = gametime%2=0
trigger1 = root,fvar(36)=2
sysvar(2)=-1
[state 転生中回復-超強化]
type=varadd
trigger1 = numhelper(51000)
trigger1 = helper(51000),sysvar(2)
trigger1 = sysvar(2)<root,lifemax
trigger1 = gametime%2=0
trigger1 = root,fvar(36)=3
sysvar(2)=-2

[state 減衰処理]
type=varset
trigger1 = sysvar(1)<0
trigger1 = gethitvar(damage)
sysvar(1)=50
[state 減衰処理]
type=varadd
trigger1 = 1
sysvar(1)=-1

[State 被弾無敵]
type = NotHitBy
trigger1 = gethitvar(damage)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 10
ignorehitpause = 1

[State 本体が超必殺やってるならアーマーも無敵]
type = NotHitBy
trigger1 = root,stateno = 720
trigger2 = root,stateno = [3000,3060]
trigger3 = root,stateno = 100200
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 2
ignorehitpause = 1


[state ]
type = AttackDist
trigger1 = 1
value = 0
[State a]
type = assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

[State a]
type = turn
trigger1 = facing != root,facing
ignorehitpause = 1

[State a]
type = posset
trigger1 = 1
x = root,pos x
y = root,pos y
ignorehitpause = 1

[State ステートを奪われていないときは親と同じアニメ]
type = changeanim
trigger1 = root,sysvar(4)= root,gametime
value = root,anim
elem = root,animelemno(0)
ignorehitpause = 1
[State ステートを奪われているときは無アニメ]
type = changeanim
trigger1 = root,sysvar(4)!= root,gametime
value = 9999
ignorehitpause = 1
[State ステートを奪われているときは無アニメ]
type = changeanim
trigger1 = sysfvar(1)
value = 9997
ignorehitpause = 1

[state HITDEFバリア発動処理]
type=varset
trigger1 = numhelper(51000)
trigger1 = helper(51000),sysvar(2)>0
sysfvar(1)=1
[state HITDEFバリア発動処理]
type=varset
trigger1 = numhelper(51000)
trigger1 = helper(51000),sysvar(2)<=0
sysfvar(1)=0

[state デバッグ処理]
type=varset
trigger1 = sysfvar(2)>15;ここが無敵時間
trigger1 = !numtarget
sysfvar(2)=0

[State 0, ReversalDef]
type = ReversalDef
trigger1 = !sysfvar(2)
trigger1 = anim = 9997
trigger1 = sysfvar(1)
reversal.attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
pausetime = 0,0
sparkno = S-1
hitsound = S-1,0
ignorehitpause = 1
numhits = 0

[State 0, ReversalDef]
type = ReversalDef
trigger1 = sysfvar(2)
trigger1 = anim = 9997
trigger1 = sysfvar(1)
trigger2 = root,anim = 1200
trigger2 = sysfvar(1)
reversal.attr = 
pausetime = 0,0
sparkno = S-1
hitsound = S-1,0
ignorehitpause = 1
numhits = 0

[State 0, TargetDrop]
type = TargetDrop
Triggerall = NumTarget
Trigger1 = !Target,Alive
Trigger2 = Target,ishelper
Trigger3 = Target,stateno = [120,155]
Trigger4 = Target,stateno = 5150
Trigger5 = TeamSide = Target,TeamSide
excludeID = -1
keepone = 0

[state デバッグ処理]
type=varadd
trigger1 = sysfvar(2)
sysfvar(2)=1
[state デバッグ処理]
type=varadd
trigger1 = !sysfvar(2)
trigger1 = numtarget
sysfvar(2)=1

[state ダメージ処理]
type=varadd
trigger1 = numtarget
trigger1 = root,fvar(36)=0
sysvar(2) = 50;ここがダメージ
[state ダメージ処理-1]
type=varadd
trigger1 = numtarget
trigger1 = root,fvar(36)=1
sysvar(2) = 45;ここがダメージ
[state ダメージ処理-2]
type=varadd
trigger1 = numtarget
trigger1 = root,fvar(36)=2
sysvar(2) = 40;ここがダメージ
[state ダメージ処理]
type=varadd
trigger1 = numtarget
trigger1 = root,fvar(36)=3
sysvar(2) = 40;ここがダメージ
[state ダメージ処理]
type=varadd
trigger1 = numtarget
trigger1 = root,fvar(36)=4
sysvar(2) = 10;ここがダメージ

[State , エフェクト表示]
type = Explod
triggerall = root,fvar(38)>0
trigger1 = gethitvar(damage)
trigger2 = numtarget
anim = 7018
bindtime = 1
postype=p1
pos = 0,-50
random=50,50
facing = ifelse(random%2=0,1,-1)
vfacing = ifelse(random%2=0,1,-1)
scale = 1,1
ownpal = 1
sprpriority =3
pausemovetime = 3
ignorehitpause = 1
[State , エフェクト表示]
type = Explod
triggerall = root,fvar(38)>0
trigger1 = gethitvar(damage)
trigger2 = numtarget
anim = 7142
bindtime = 1
postype=p1
pos = 0,-50
facing = ifelse(random%2=0,1,-1)
vfacing = ifelse(random%2=0,1,-1)
scale = 1,1
ownpal = 1
sprpriority =-5
ignorehitpause = 1
[State , エフェクト表示]
type = Explod
triggerall = root,fvar(38)>0
trigger1 = gethitvar(damage)
trigger2 = numtarget
anim = 7120
bindtime = 1
postype=p1
pos = 0,-50
facing = ifelse(random%2=0,1,-1)
vfacing = ifelse(random%2=0,1,-1)
scale = 1.2,1.2
ownpal = 1
sprpriority =3
ignorehitpause = 1

[State , エフェクト表示]
type = Explod
triggerall = root,fvar(38)>0
trigger1 = gethitvar(damage)
trigger2 = numtarget
anim = 7142
bindtime = 1
postype=p2
pos = 0,-50
facing = ifelse(random%2=0,1,-1)
vfacing = ifelse(random%2=0,1,-1)
scale = 0.8,0.8
ownpal = 1
sprpriority =3
ignorehitpause = 1
[state 接触反射]
type = Projectile
triggerall = root,fvar(38)>0
trigger1 = gethitvar(damage)
trigger2 = numtarget
projanim = 9995
ID = 9995
ProjID = 9995
projmisstime=1
projhits = 1
projremove = 0
projremovetime =3
postype = p2
offset = 0,0
attr = A, HA
damage = ifelse(root,fvar(38)>=2,ceil(((root,lifemax - root,life)+5+random%20)*0.5),10), ifelse(root,fvar(38)>=2,ceil(((root,lifemax - root,life)+5+random%20)*0.5),10)
animtype = Hard
guardflag = 
hitflag = MAFDP
priority = 7, Hit
pausetime = 0, 2
sparkxy = -10, -50
sparkno = S-1
hitsound = S-1,0
guardsound = S-1,0
guard.sparkno = S9000 ;ガードエフェクト
guard.hittime = 27
guard.ctrltime = 27
ground.type = High
ground.slidetime = 27
ground.hittime  = 29
ground.velocity = -15,-6+ifelse(enemy,pos y < -70,4,0)
airguard.velocity = -3.9,-.8
air.type = High
air.velocity = -15,-6+ifelse(enemy,pos y < -70,4,0)
air.hittime = 15
fall = 1
yaccel = 0.5+ifelse(enemy,pos y < -70,0.2,0)
Fall.recover = 0
palfx.time = 3
palfx.add = 190,190,250
palfx.sinadd = -100,-100,0,8
palfx.color = 0
palfx.invertall = 1
numhits = ifelse(var(25),1,0)

[State 0, TargetDrop]
type = TargetDrop
trigger1 = 1
excludeID = -1
keepone = 0

[State a]
type = HitOverride
trigger1 = ishelper
attr = SCA,AA,AP,AT
stateno = 52000
time = 0
ignorehitpause = 1

[state HPは最大より回復しない]
type=varset
trigger1 = sysvar(2)<0
sysvar(2)=0

;Time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1

[State 51, ステート変更]
type = Changestate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1


;------------------------------------------------------------------------
;スパークヘルパー
[StateDef 51510]
Type= U
MoveType = U
Physics = N
hitdefpersist = 1
hitcountpersist = 1
movehitpersist=1

[State -1]
Type = ChangeAnim
Trigger1 = anim!=7020
Value = 7020

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[State -1]
Type = AssertSpecial
Trigger1 = 1
flag = noshadow

[state ]
type=varset
trigger1 = !sysvar(3)
var(0)=random%12 * ifelse(random%2=0,1,-1)

[State 0, AngleAdd]
type = Angleset
trigger1 = !sysvar(3)
value = random%360

[State 0, AngleAdd]
type = AngleAdd
trigger1 = 1
value = var(0)
[State 1008, AngleDraw]
type = AngleDraw
trigger1 = 1
ignorehitpause = 1

[State 1008, AngleDraw]
type = null;AngleDraw
trigger1 = 1
value = ceil(-180/pi*ifelse(vel y >=0,1,-1)*acos(vel x/((vel x**2+vel y**2)**0.5)))
ignorehitpause = 1

[state ]
type=varset
trigger1 = !sysvar(3)
var(1)=(random%20) * ifelse(random%2=0,1,-1)
[state ]
type=varset
trigger1 = !sysvar(3)
var(2)=(random%20) * ifelse(random%2=0,1,-1)

[State -1]
Type = BindToRoot
Trigger1 = root,stateno != [760,761]
pos = var(1),-50+var(2)

[State 0, SprPriority]
type = SprPriority
trigger1 = !sysvar(3)
value = (random%4) * ifelse(random%2=0,1,-1)

[State 7050]
type =DestroySelf
trigger1 = animtime = 0

;Time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1
ignorehitpause = 1

[State 51, ステート変更]
type = Changestate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1


;シャドウヘルパー
[StateDef 51520]
Type= U
MoveType = U
Physics = N
SprPriority = 0
hitdefpersist = 1
hitcountpersist = 1
movehitpersist=1

[state ]
type=varset
trigger1 = root,movetype=H
trigger2 = root,stateno=[5000,5150]
sysvar(4)=0
[State -1]
Type = AfterImage
triggerall = roundstate=2
Trigger1= sysvar(3)=1
Time = -1
Trans = Add
length = 12
FrameGap = 3
TimeGap = 1
PalBright = 70,70,70
PalContrast = 130,130,255
PalAdd = 0,0,0
PalMul =.70,.70,.70
[state 6506,1]
type = nothitby
trigger1 = 1
value = SCA
time = -1
[State -1]
Type = ChangeAnim
Trigger1 = root,movetype=H
Value = 9999
[State -1]
Type = ChangeAnim
Trigger1 = root,movetype!=H
Value = Root,Anim
Elem = Root,AnimElemNo(0)
[State -1]
Type = AssertSpecial
Trigger1 = 1
Flag = Invisible
flag2 = noshadow
[State -1]
Type = BindToRoot
Trigger1 = 1
[State -1]
Type= Turn
Trigger1 = Facing != Root,Facing
[State 7050]
type =DestroySelf
trigger1 = root,alive=0

[State 0, AngleAdd]
type = Angleset
trigger1 = root,animelemtime(1)=1
trigger1 = root,stateno = 711
trigger2 = root,stateno!=711
value = 0
[State 0, AngleAdd]
type = AngleAdd
trigger1 = root,stateno = 711
value = -32

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1

[State 0, Offset]
type = Offset
trigger1 = root,stateno = 720
trigger1 = root,animelemtime(3)>=0
x = 0
y = - ifelse(ceil(root,animelemtime(1)*0.6)<=26,ceil(root,animelemtime(1)*0.6),26)
[State 0, Offset]
type = Offset
trigger1 = root,stateno != 720
x = 0
y = 0



;┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋
;┃†Mapelao。

[state ]
type=offset
trigger1=root,stateno=100200
trigger1=root,animelemtime(1)=[5,29]
x=facing*(-0.02*((root,animelemtime(1)-5)**2))
y=15*(sin((pi/2/25)*(root,animelemtime(1)-5))**0.4)
[state ]
type=offset
trigger1=root,stateno=100200
trigger1=root,animelemtime(1)=[30,54]
x=facing*(-0.02*((root,animelemtime(1)-5)**2))
y=-300+315*cos((pi/2/25)*(root,animelemtime(1)-30))
[state ]
type=offset
trigger1=root,stateno=100200
trigger1=root,animelemtime(1)=[55,259]
y=-300
[state ]
type=offset
trigger1=root,stateno=100200
trigger1=root,animelemtime(1)=[260,319]
y=-300+300*(sin((pi/2/60)*(root,animelemtime(1)-260))**0.3)

;┃†Mapelao。
;┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋



[State 0, AngleDraw]
type = AngleDraw
trigger1 = root,stateno = 720
trigger1 = root,animelemtime(3)>=40
scale = 1+((gametime%10)*0.04),1+((gametime%10)*0.03)
[State 0, Offset]
type = Offset
trigger1 = root,stateno = 720
trigger1 = root,animelemtime(3)>=40
x = 0
y = 0+((gametime%10)*0.25)-20

;Time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1
ignorehitpause = 1
[state ]
type=varadd
trigger1 = root,movetype!=H
trigger2 = root,stateno!=[5000,5150]
sysvar(4)=1
ignorehitpause = 1

[State 51, ステート変更]
type = Changestate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1


;------------------------------------------------------
;サテライトステート
[statedef 51530]
type=u
movetype=u
hitdefpersist=1
movehitpersist=1

;基本設定。
[state ]
type=changeanim
trigger1=anim!=9999;透明アニメ。
value=9999
ignorehitpause=1

;静止フラグ(1にすると止まる)。
[state ]
type=varset
triggerall = root,var(6)>0
triggerall = sysfvar(3)=0
Trigger1= gametime%120=[60,95]
trigger1 = ishelper(51530)
Trigger1 = gametime%120=[60,95]
trigger2 = ishelper(51531)
Trigger2 = gametime%120=[70,105]
trigger3 = ishelper(51532)
Trigger3 = gametime%120=[80,115]
sysfvar(3)=1
ignorehitpause=1
;静止フラグ(1にすると止まる)。
[state ]
type=varset
triggerall = sysfvar(3)=1
Trigger1 = gametime%120=96
trigger1 = ishelper(51530)
Trigger1 = gametime%120=96
trigger2 = ishelper(51531)
Trigger2 = gametime%120=106
trigger3 = ishelper(51532)
Trigger3 = gametime%120=116
sysfvar(3)=0
ignorehitpause=1



;---------------------------------------------------------------------------
[State レーザーヘルパー召喚]
Type = Helper
triggerall = sysfvar(3)=1
trigger1 = ishelper(51530)
Trigger1 = gametime%120=60
trigger2 = ishelper(51531)
Trigger2 = gametime%120=70
trigger3 = ishelper(51532)
Trigger3 = gametime%120=80
HelperType = Player
Name = "laser"
postype = p1
pos=floor(fvar(24)),floor(fvar(25))
ID = 51531
Stateno = 51531
size.mid.pos = 51531,0
Supermovetime = 2147483647	
Pausemovetime = 2147483647
Ignorehitpause = 1
ownpal =1


;座標設定（コンフィグ）。
;fvar(0)....衛星と本体との距離。
;fvar(1)....楕円の程度。1で正円。1未満でY軸方向に扁平。
;fvar(2)....初期角度。
;fvar(3)....衛星が一回転するために必要なフレーム数。
;fvar(4)....初期角度。
;fvar(5)....衛星軌道が最初の状態に戻るために必要なフレーム数。

;fvar(5)....衛星軌道の修正に際して本体の動きを先読みするフレーム数。
;fvar(7)....衛星と本体との距離がこの値よりも短い時、衛星軌道の修正にブレーキがかかる。
;fvar(8)....衛星軌道の修正に係る最低速度。
;fvar(9)....衛星軌道の修正に係る最高速度。
;fvar(10)...衛星軌道の修正に係る角度変更の最大値。

[state ]
type=forcefeedback
triggerall=ishelper(51530)
trigger1=1||fvar(0):=80
trigger1=1||fvar(1):=0.3
trigger1=1||fvar(2):=60*(pi/180)
trigger1=1||fvar(3):=90
trigger1=1||fvar(4):=0*(pi/180)
trigger1=1||fvar(5):=810
trigger1=1||fvar(6):=30
trigger1=1||fvar(7):=50
trigger1=1||fvar(8):=0
trigger1=1||fvar(9):=12
trigger1=1||fvar(10):=0*(pi/180)
ignorehitpause=1
[state ]
type=forcefeedback
triggerall=ishelper(51531)
trigger1=1||fvar(0):=80
trigger1=1||fvar(1):=0.3
trigger1=1||fvar(2):=120*(pi/180)
trigger1=1||fvar(3):=90
trigger1=1||fvar(4):=120*(pi/180)
trigger1=1||fvar(5):=810
trigger1=1||fvar(6):=30
trigger1=1||fvar(7):=50
trigger1=1||fvar(8):=0
trigger1=1||fvar(9):=12
trigger1=1||fvar(10):=0*(pi/180)
ignorehitpause=1
[state ]
type=forcefeedback
triggerall=ishelper(51532)
trigger1=1||fvar(0):=80
trigger1=1||fvar(1):=0.3
trigger1=1||fvar(2):=180*(pi/180)
trigger1=1||fvar(3):=90
trigger1=1||fvar(4):=240*(pi/180)
trigger1=1||fvar(5):=810
trigger1=1||fvar(6):=30
trigger1=1||fvar(7):=50
trigger1=1||fvar(8):=0
trigger1=1||fvar(9):=12
trigger1=1||fvar(10):=0*(pi/180)
ignorehitpause=1



;座標設定。
[state ]
type=forcefeedback
triggerall=sysfvar(3)=0
trigger1=1||fvar(2):=fvar(2)+(2*pi/fvar(3))*(floor(sysfvar(4))%floor(fvar(3)))
trigger1=1||fvar(4):=fvar(4)+(2*pi/fvar(5))*(floor(sysfvar(4))%floor(fvar(5)))
trigger1=1||fvar(20):=root,fvar(20)+root,facing*root,const(size.mid.pos.x)
trigger1=1||fvar(21):=root,fvar(21)+root,const(size.mid.pos.y)
trigger1=1||fvar(22):=fvar(0)*cos(fvar(2))
trigger1=1||fvar(23):=fvar(1)*fvar(0)*sin(fvar(2))
trigger1=1||fvar(24):=fvar(22)*cos(fvar(4))-fvar(23)*sin(fvar(4))
trigger1=1||fvar(25):=fvar(22)*sin(fvar(4))+fvar(23)*cos(fvar(4))
ignorehitpause=1
[state ]
type=posset
triggerall=sysfvar(3)=0
trigger1=sysvar(3)=0
x=fvar(20)
y=fvar(21)
ignorehitpause=1
[state ]
type=forcefeedback
triggerall=sysfvar(3)=0
triggerall=1||fvar(20):=fvar(20)+root,facing*root,vel x*fvar(6)
triggerall=1||fvar(21):=fvar(21)+root,vel y*fvar(6)
triggerall=1||fvar(28):=fvar(20)-pos x
triggerall=1||fvar(29):=fvar(21)-pos y
triggerall=1||fvar(30):=(fvar(28)**2+fvar(29)**2)**0.5
trigger1=fvar(30)=0

trigger2=1||fvar(31):=(1-2*(fvar(29)<0))*acos(fvar(28)/fvar(30))
ignorehitpause=1
[state ]
type=forcefeedback
triggerall=sysfvar(3)=0
triggerall=1||fvar(32):=fvar(24)-fvar(26)
triggerall=1||fvar(33):=fvar(25)-fvar(27)
triggerall=1||fvar(34):=(fvar(32)**2+fvar(33)**2)**0.5
trigger1=fvar(34)=0
trigger2=1||fvar(35):=(1-2*(fvar(33)<0))*acos(fvar(32)/fvar(34))
ignorehitpause=1
[state ]
type=posset
triggerall=sysfvar(3)=0
trigger1=1||fvar(36):=fvar(31)-fvar(35)
trigger1=1||fvar(36):=fvar(36)+ifelse(fvar(36)>=-pi&&fvar(36)<=pi,0,2*pi*(1-2*(fvar(36)>0)))
trigger1=1||fvar(35):=ifelse(abs(fvar(36))<fvar(10),fvar(31),fvar(35)+fvar(10)*(1-2*(fvar(36)<0)))
trigger1=1||fvar(35):=fvar(35)+ifelse(fvar(35)>=-pi&&fvar(35)<=pi,0,2*pi*(1-2*(fvar(35)>0)))
trigger1=1||fvar(36):=fvar(31)-fvar(35)
trigger1=1||fvar(36):=fvar(36)+ifelse(fvar(36)>=-pi&&fvar(36)<=pi,0,2*pi*(1-2*(fvar(36)>0)))
trigger1=1||fvar(37):=ifelse(fvar(30)>fvar(7),1,fvar(30)/fvar(7))
trigger1=1||fvar(37):=fvar(37)*(fvar(8)+(fvar(9)-fvar(8))*(1-sin(abs(fvar(36))/2)))
trigger1=1||fvar(38):=fvar(37)*cos(fvar(35))
trigger1=1||fvar(39):=fvar(37)*sin(fvar(35))
trigger1=1||fvar(26):=fvar(24)
trigger1=1||fvar(27):=fvar(25)
x=pos x+fvar(38)
y=pos y+fvar(39)
ignorehitpause=1



;パーティクル。
[state ]
type=explod
trigger1=root,stateno!=181
trigger1=root,alive
;trigger1 = sysfvar(3)=0
id=0
anim=7014;←　ここを7214にすると尾が増える
facing=1
vfacing=1
scale=0.15,0.15
sprpriority=6*ifelse(fvar(26)>0,1,-1)
ownpal=1
removetime=-2
pos=floor(fvar(24)),floor(fvar(25))
postype=p1
bindtime=1
ignorehitpause=1
supermovetime = 999999
pausemovetime = 999999

[State , エフェクト表示]
type = Explod
trigger1=root,alive
trigger1 = sysfvar(3)=1
trigger1 = sysvar(3)%3=0
anim =7028
postype = p1
pos=floor(fvar(24)),floor(fvar(25))
bindtime=1
random = 5,5
scale = 0.4,0.2
ignorehitpause =1
sprpriority = 3
ownpal =1

[State , エフェクト表示]
type = Explod
trigger1=root,alive
trigger1 = sysfvar(3)=1
trigger1 = sysvar(2)=1
anim =7029
postype = p1
pos=floor(fvar(24)),floor(fvar(25))
bindtime=1
scale = 0.6,0.6
ignorehitpause =1
sprpriority = 0
ownpal =1

[state ]
type = null;Projectile　;←nullを外すと判定が出る
trigger1 = 1
projanim = 7314
ID = 7314
ProjID = 7314+gametime%5
projmisstime=1
projhits = 1
projremove = 0
projremovetime =10
offset = floor(fvar(24)),floor(fvar(25))
attr = A, SA
damage = 5,1
animtype = Light
guardflag = MA
hitflag = MAFDP
priority = 7, Hit
pausetime = 0, 3
sparkxy = -10, -50
sparkno = S-1
hitsound = S-1,0
guardsound = S-1,0
guard.sparkno = S9000 ;ガードエフェクト
guard.hittime = 27
guard.ctrltime = 27
ground.type = High
ground.slidetime = 27
ground.hittime  = 29
ground.velocity = -7,0
airguard.velocity = -3.9,-.8
air.type = High
air.velocity = -2.4,-2
air.hittime = 15
fall = ifelse(Enemy,statetype=A,1,0)
Fall.recover = 0
palfx.time = 18
palfx.add = 190,190,250
palfx.sinadd = -100,-100,0,8
palfx.color = 0
palfx.invertall = 1
envshake.time = 6;ヒット時画面振動時間 (int)
envshake.freq = 88;振動数 (float)
envshake.ampl =  -6;振幅 (int)
envshake.phase = 0;位相 (float)
numhits = ifelse(var(25),1,0)


[State , ヒットエフェクト表示]
type = Explod
triggerall=root,stateno!=181
trigger1=ishelper(51530)
trigger1 = sysvar(3)%75=0
trigger2=ishelper(51531)
trigger2 = sysvar(3)%75=20
trigger3=ishelper(51532)
trigger3 = sysvar(3)%75=60
anim = 7021
postype = p1
facing = ifelse(random%2=0,1,-1)
bindtime = 1
pos=floor(fvar(24)),floor(fvar(25))
ontop = 1
scale = 0.3,0.3
removeongethit = 0
supermovetime = 300
pausemovetime = 300
ownpal = 1
ignorehitpause = 1


;time代用変数セット。
[state ]
type=varadd
triggerall=1
trigger1=1
sysvar(3)=1
ignorehitpause=1
[state ]
type=varadd
trigger1=sysfvar(3)=0
sysfvar(4)=1
ignorehitpause=1

[state ]
type=varset
Trigger1= sysfvar(3)=0
sysvar(2)=0
ignorehitpause=1
[state ]
type=varadd
Trigger1= sysfvar(3)=1
sysvar(2)=1
ignorehitpause=1


;ステート移行。
[state ]
type=changestate
trigger1=1
value=5150
persistent=256
ignorehitpause=1


;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
;オートエイムレーザー
[statedef 51531]
type     = U
movetype = U
physics  = U
ctrl     = 0
sprpriority = 3
movehitpersist = 1
hitdefpersist = 1
sprpriority = 7

[state ステートタイプ変更]
type = statetypeset
trigger1 = 1
statetype = S
movetype = A
physics = S
ignorehitpause = 1

[state ]
type=changeanim
trigger1 = anim!=7027
value =7027
ignorehitpause

[state ]
type=turn
trigger1 = root,facing != facing

[State 0, BindToTarget]
type = null;BindToparent
trigger1 = 1
time = 1
pos =(parent,floor(fvar(24))),(parent,floor(fvar(25)))

[state ダメージ設定]
type=varset
trigger1 = 1
sysvar(2)=15 + ifelse(enemy,lifemax>=10000,21474836,0)
[state 削りダメージ設定]
type=varset
trigger1 = 1
sysvar(1)=4 + ifelse(enemy,lifemax>=10000,21474836,0)

[state ]
type = assertspecial
trigger1 = 1
flag = noshadow
Ignorehitpause = 1

[state ]
type = trans
trigger1 = 1
trans = add

[state ]
type = screenbound
trigger1 = 1
value = 0
moveCamera = 0,0
Ignorehitpause = 1

[state ]
type=varset
trigger1 = sysvar(3) = 0
fvar(0)= ifelse((p2dist X=[0,1]),1,ifelse((p2dist X=[-1,0]), -1, p2dist X))

[state ]
type= varset
trigger1 = sysvar(3) = 0
fvar(10) = p2dist Y+ifelse((enemynear,statetype = C),-20,(enemynear,const(size.mid.pos.Y)))

[state ]
type=varset
trigger1 = sysvar(3) = 0
fvar(1)= ifelse((fvar(10) = [0,1]), 1, ifelse((fvar(10)=[-1,0]), -1, fvar(10)))

[state ]
type=varset
trigger1 = sysvar(3) = 0
fvar(2)= atan(fvar(0)/fvar(1))-((.5*pi)*ifelse((fvar(10)<0),-1,1))

[state ]
type=varset
trigger1 = sysvar(3) = 0
fvar(3)=ifelse(fvar(2)>80*(pi/180.0),80*(pi/180.0),ifelse(fvar(2)<-80*(pi/180.0),-80*(pi/180.0),fvar(2)))

[state ]
type = velset
trigger1 = sysvar(3) = 0
X = 1*cos(fvar(3))
Y = -1*sin(fvar(3))

[state ]
type = posfreeze
trigger1 = 1
value = 1

[state ]
type=varadd
trigger1=sysvar(3)<=9
fvar(20)=0.05

[state ]
type=varadd
trigger1=sysvar(3)>=20&&fvar(20)>=-0.05
fvar(20)=-0.025+fvar(21)

[state ]
type=varadd
trigger1=sysvar(3)>=41&&fvar(21)<=0.0200
fvar(21)=0.0075

[state ]
type=angledraw
trigger1=1
value=atan(vel Y/vel X)*(-180.0/pi)
scale=1,0.05+fvar(20)

[state 1]
type= projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 20*Cos(fvar(3)),-20*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=maf
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 2]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 50*Cos(fvar(3)),-50*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 3]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 80*Cos(fvar(3)),-80*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 4]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 110*Cos(fvar(3)),-110*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 5]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 140*Cos(fvar(3)),-140*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 6]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 170*Cos(fvar(3)),-170*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 7]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 200*Cos(fvar(3)),-200*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 8]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset= 230*Cos(fvar(3)),-230*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 9]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset=260*Cos(fvar(3)),-260*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 10]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset=290*Cos(fvar(3)),-290*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 11]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset=320*Cos(fvar(3)),-320*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state 12]
type=projectile
trigger1=sysvar(3)=10||sysvar(3)=14||sysvar(3)=18||sysvar(3)=22
projID=802
projanim=802
projhitanim=802
projscale=1,1
projremovetime=1
projedgebound=80
projstagebound=200
Offset=350*Cos(fvar(3)),-350*sin(fvar(3))
velOcity=0,0
velmul=0,0
supermovetime=0
pausemovetime=0
attr=s,hp
hitflag=mafp
guardflag=ma
animtype=hard
damage=sysvar(2),sysvar(1)
pausetime=0,5
guard.pausetime=0,5
sparkno=S-1
guard.sparkno=S-1
sparkXY=0,0
hitsound=S-1,0
guardsound=S-1,0
ground.type=high
ground.slidetime=16
ground.hittime=18
air.hittime=18
ground.velocity=-5,-5
guard.velocity=-4
air.velocity=-3,-5.5
fall=1
fall.recover=0
numhits = ifelse(var(25),1,0)

[state ]
type= destroyself
trigger1 = sysvar(3) >= 200
trigger2 = fvar(20) <= -0.05

;time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1
ignorehitpause = 1

[state ]
type=changestate
trigger1 = 1
value = 5150
ignorehitpause = 1


;--------------------------------------------------------------
;サテライトステート
[statedef 51529]
Type= U
MoveType = U
Physics = N
hitdefpersist = 1
hitcountpersist = 1
movehitpersist=1

[state ]
type=changeanim
trigger1=anim!=9999;透明アニメ。
value=9999
ignorehitpause=1

[state ]
type=posadd
trigger1 = !sysvar(3)
triggerall=ishelper(51530)
x = 250
y = -200
[state ]
type=posadd
trigger1 = !sysvar(3)
triggerall=ishelper(51531)
x = -250
y = -250
[state ]
type=posadd
trigger1 = !sysvar(3)
triggerall=ishelper(51532)
x = 0
y = 340

;座標設定（コンフィグ）。
[state ]
type=forcefeedback
triggerall=ishelper(51530)
trigger1=1||fvar(0):=0.008
trigger1=1||fvar(1):=0.25
trigger1=1||fvar(2):=30*(pi/180)
trigger1=1||fvar(3):=4
trigger1=1||fvar(4):=5*0.5
ignorehitpause=1
[state ]
type=forcefeedback
triggerall=ishelper(51531)
trigger1=1||fvar(0):=0.008
trigger1=1||fvar(1):=0.25
trigger1=1||fvar(2):=90*(pi/180)
trigger1=1||fvar(3):=5
trigger1=1||fvar(4):=6*0.5
ignorehitpause=1
[state ]
type=forcefeedback
triggerall=ishelper(51532)
trigger1=1||fvar(0):=0.008
trigger1=1||fvar(1):=0.25
trigger1=1||fvar(2):=150*(pi/180)
trigger1=1||fvar(3):=6
trigger1=1||fvar(4):=7*0.5
ignorehitpause=1


;座標設定。
[state ]
type=forcefeedback
triggerall=1||fvar(5):=facing*(root,fvar(20)+root,facing*root,const(size.mid.pos.x)-pos x)
triggerall=1||fvar(6):=root,fvar(21)+root,const(size.mid.pos.y)-pos y
triggerall=1||fvar(7):=vel x+fvar(0)*(fvar(5)+fvar(1)*(fvar(5)*cos(fvar(2))-fvar(6)*sin(fvar(2))))
triggerall=1||fvar(8):=vel y+fvar(0)*(fvar(6)+fvar(1)*(fvar(5)*sin(fvar(2))+fvar(6)*cos(fvar(2))))
triggerall=1||fvar(9):=(fvar(7)**2+fvar(8)**2)**0.5
trigger1=fvar(9)=0
trigger1=1||fvar(10):=0
trigger2=1||fvar(10):=(1-2*(fvar(8)<0))*acos(fvar(7)/fvar(9))
ignorehitpause=1
[state ]
type=velset
trigger1=1||fvar(11):=ifelse(fvar(9)>fvar(3),fvar(3),ifelse(fvar(9)<fvar(4),fvar(4),fvar(9)))
trigger1=1||fvar(12):=fvar(11)*cos(fvar(10))
trigger1=1||fvar(13):=fvar(11)*sin(fvar(10))
x=fvar(12)
y=fvar(13)
ignorehitpause=1


;パーティクル。
[state ]
type=explod
trigger1=1
anim=7114;パーティクルのアニメーション。
facing=1
vfacing=1
scale=0.1,0.1
shadow=0,0,0
sprpriority=6*ifelse(vel x>0,1,-1)
ontop=0
ownpal=1
supermove=0	
pausemovetime=0
supermovetime=0
removetime=-2
removeongethit=0
pos=0,0
postype=p1
random=0,0
bindtime=1
vel=0,0
accel=0,0
ignorehitpause=1

;Time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1
ignorehitpause = 1

[State 51, ステート変更]
type = Selfstate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1

;-------------------------------------
;サテライトステ2
[statedef 51540]
Type= U
MoveType = U
Physics = N
hitdefpersist = 1
hitcountpersist = 1
movehitpersist=1

[state ]
type=changeanim
trigger1=anim!=9999;透明アニメ。
value=9999
ignorehitpause=1

[state ]
type=turn
trigger1 = facing = -1

[state ]
type = AngleDraw;回転指示
trigger1 = 1

[state ];回転速度
type = varadd
trigger1 = ishelper(51540)
trigger2 = ishelper(51541)
var(0) = 2
[state ];回転速度
type = varadd
trigger1 = ishelper(51542)
var(0) = 7

[state ]
type = varset
trigger1 = ishelper(51540)
trigger2 = ishelper(51541)
var(1) = 12
[state ]
type = varset
trigger1 = ishelper(51542)
var(1) = 12

[state ];回転速度
type = varadd
trigger1 = gametime%5=0
var(2) = 1

[state ];固定と回転
type = BindToParent
trigger1 = ishelper(51540)
time = 9999;
pos = 0+(55+var(1))*sin((Var(0)-45+var(2))*pi/110),-50-(55+var(1))*sin((Var(0)+45-var(2))*pi/80)

[state ];固定と回転
type = BindToParent
trigger1 = ishelper(51541)
time = 9999;
pos = 0-(55+var(1))*sin((Var(0)-45+var(2))*pi/110),-50+(55+var(1))*sin((Var(0)+45-var(2))*pi/80)

[state ];固定と回転
type = BindToParent
trigger1 = ishelper(51542)
time = 9999;
pos = 0+(52+var(1))*sin((Var(0)-45)*pi/180),-50-(52+var(1))*sin((Var(0)+45)*pi/180)


[state ]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[state ]
type=explod
trigger1=1
anim=7014;パーティクルのアニメーション。
facing=1
vfacing=1
scale=0.1,0.1
shadow=0,0,0
sprpriority=ifelse((sysvar(3)%80=[0,40]),6,-6)*ifelse(ishelper(51541),-1,1)
ontop=0
ownpal=1
supermove=0
pausemovetime=0
supermovetime=0
removetime=-2
removeongethit=0
pos=0,0
postype=p1
random=0,0
bindtime=1
vel=0,0
accel=0,0
ignorehitpause=1

;Time代用変数
[state ]
type=varadd
trigger1 = 1
sysvar(3)=1
ignorehitpause = 1

[State 51, ステート変更]
type = Selfstate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1



;この下、一行以上空ける事！


