;=============================================================================================================================================================
; スペルカード
;=============================================================================================================================================================
;===============================================================================
;恋の埋火
;===============================================================================
[statedef 2000]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2000

[state 2000, 暗転]
type = superpause
trigger1 = animelem = 4
anim = -1
sound = S4,0
time = 43
poweradd = -4000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2000, スペカ名]
type = helper
trigger1 = animelem = 4
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2000, 魔方陣eff]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2000, SE]
type = playsnd
trigger1 = animelem = 5
value = 1,3

[state 2000, ハート1]
type = helper
trigger1 = animelem = 5
name = "uzumibi"
stateno = 12000
pos = 40,-80
postype = p1
facing = 1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12000

[state 2000, ハート2]
type = helper
trigger1 = animelem = 5
name = "uzumibi"
stateno = 12000
pos = 40,-20
postype = p1
facing = 1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12001

[state 2000, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1


;空中恋の埋火===================================================================
[statedef 2001]
type = A
movetype = A
physics = A
ctrl = 0
anim = 2000

[state 2001, 暗転]
type = superpause
trigger1 = animelem = 4
anim = -1
sound = S4,0
time = 43
poweradd = -4000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2001, スペカ名]
type = helper
trigger1 = animelem = 4
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2001, 魔方陣eff]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2001, SE]
type = playsnd
trigger1 = animelem = 5
value = 1,3

[state 2001, ハート1]
type = helper
trigger1 = animelem = 5
name = "uzumibi"
stateno = 12000
pos = 40,-80
postype = p1
facing = 1
ownpal = 0
size.xscale = 0.4
size.yscale = 0.4
ID = 12000

[state 2001, ハート2]
type = helper
trigger1 = animelem = 5
name = "uzumibi"
stateno = 12000
pos = 40,-20
postype = p1
facing = 1
ownpal = 0
size.xscale = 0.4
size.yscale = 0.4
ID = 12001

[state 2001, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1


;-------------------------------------------------------------------------------
;埋火
[statedef 12000]
type = A
movetype = A
physics = N
anim = 12000
ctrl = 0
sprpriority = 5

[state 12000, 複数ヒット]
type = varset
trigger1 = time = 0
var(1) = 0

[state 12000, 複数ヒット]
type = varadd
trigger1 = time >= 0
trigger1 = movecontact
var(1) = 1

[state 12000, 跳ね返り回数]
type = varset
trigger1 = time = 0
var(20) = 0

[state 12000, イドの解放スイッチ]
type = varset
trigger1 = time = 0
trigger1 = (root,var(8) & (1023)) / (1) > 0
var(8) = 1

[state 12000, 跳ね返り回数(決着)]
type = varset
trigger1 = roundstate = 3
var(20) = ifelse(var(8) = 0,6,16)

[state 12000, 方向・速度変数保存（地上）]
type = varset
trigger1 = time = 0
trigger1 = root,stateno = 2000
trigger1 = p2dist x != 0
fvar(0) = atan((-p2dist y - enemy,const(size.mid.pos.y))/p2dist x)

[state 12000, 方向・速度変数保存（地上）]
type = varset
trigger1 = time = 0
trigger1 = root,stateno = 2000
trigger1 = p2dist x = 0
fvar(0) = pi/2

[state 12000, 方向・速度変数保存（空中）1]
type = varset
trigger1 = time = 0
trigger1 = root,stateno = 2001
trigger1 = ishelper(12000)
fvar(0) = atan(3/1)

[state 12000, 方向・速度変数保存（空中）2]
type = varset
trigger1 = time = 0
trigger1 = root,stateno = 2001
trigger1 = ishelper(12001)
fvar(0) = atan(-3/1)

[state 12000, 飛ぶ方向]
type = varset
trigger1 = time >= 0
trigger1 = vel x != 0
fvar(1) = atan(-vel y/vel x)*180/pi+ifelse(vel x <= 0, 180, 0)

[state 12000, 直角]
type = varset
trigger1 = time >= 0
trigger1 = vel x = 0
fvar(1) = ifelse(vel y >= 0, 90, -90)

[state 12000, 初期向き]
type = angleset
trigger1 = time = 0
value = fvar(0)*180/pi

[state 12000, 向き]
type = angleset
trigger1 = time > 0
value = fvar(1)

[state 12000, 向き実行]
type = angledraw
trigger1 = 1

[state 12000, 速度設定(地上)]
type = velset
trigger1 = time = 0
trigger1 = root,stateno = 2000
x = 4*cos(fvar(0))
y = -4*sin(fvar(0))

[state 12000, 速度設定(空中)1]
type = velset
trigger1 = time = 0
trigger1 = root,stateno = 2001
trigger1 = ishelper(12000)
x = 1
y = -3

[state 12000, 速度設定(空中)1]
type = velset
trigger1 = time = 0
trigger1 = root,stateno = 2001
trigger1 = ishelper(12001)
x = 1
y = 3

[state 12000, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12000, 埋火のヒット定義]
type = hitdef
trigger1 = var(1) = 0
trigger2 = var(1)%3 = 0
trigger2 = var(1) <= 12
attr = A,HP
damage = ceil((root,fvar(10)*30)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 20,10
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 4,3
hitsound = S0,4
guardsound = S2,0
sparkno = S20075
sparkxy = 0,0
groundtype = high
ground.slidetime = 5
ground.hittime = 20
air.hittime = 20
ground.ctrltime = 20

[state 12000, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*root,fvar(10)),10)
ignorehitpause = 0

[state 12000, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 0
;persistent = 0

[state 12000, 青]
type = projectile
trigger1 = time%6 = 0
projID = 10313
projanim = 10350
projscale = 0.3,0.3
projremovetime = 40
velocity = -0.1*cos(fvar(1))-random*0.0005*sin(fvar(1)),-random*0.0005*cos(fvar(1))+0.1*sin(fvar(1))
offset = 0, 0 ;-15*cos(fvar(1))+6*sin(fvar(1)),-6*cos(fvar(1))+15*sin(fvar(1))
projsprpriority = 5

[state 12000, 赤]
type = projectile
trigger1 = time%6 = 3
projID = 10314
projanim = 10351
projscale = 0.3,0.3
projremovetime = 40
velocity = -0.1*cos(fvar(1))+random*0.0005*sin(fvar(1)),random*0.0005*cos(fvar(1))+0.1*sin(fvar(1))
offset = 0, 0 ;-15*cos(fvar(1))+6*sin(fvar(1)),6*cos(fvar(1))+15*sin(fvar(1))
projsprpriority = 5

[state 12000, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12000, 跳ね返り回数]
type = null;varadd
trigger1 = screenpos x < 0
trigger2 = screenpos y < 0
trigger3 = screenpos x > 320
trigger4 = screenpos y > 240
var(20) = 1

[state 12000, 複数ヒット]
type = varset
trigger1 = screenpos x < 0
trigger2 = screenpos y < 0
trigger3 = screenpos x > 320
trigger4 = screenpos y > 240
var(1) = 0

[state 12000, 複数ヒット]
type = movehitreset
trigger1 = screenpos x < 0
trigger2 = screenpos y < 0
trigger3 = screenpos x > 320
trigger4 = screenpos y > 240

[state 12000, 速度上下]
type = velset
triggerall = var(20) <= ifelse(var(8) = 0,5,10)
trigger1 = screenpos y > 240 ;下
trigger1 = vel y > 0
trigger1 = var(20) := var(20) + 1 || var(21) := 1
trigger2 = screenpos y < 0 ;上
trigger2 = vel y < 0
trigger2 = var(20) := var(20) + 1 || var(21) := 1
y = -vel y

[state 12000, 速度左右]
type = velset
triggerall = var(20) <= ifelse(var(8) = 0,5,10)
trigger1 = screenpos x < 0 ;左
trigger1 = facing = 1
trigger1 = vel x < 0
trigger1 = var(20) := var(20) + 1 || var(21) := 1
trigger2 = screenpos x > 320 ;右
trigger2 = facing = 1
trigger2 = vel x > 0
trigger2 = var(20) := var(20) + 1 || var(21) := 1
trigger3 = screenpos x < 0 ;左
trigger3 = facing = -1
trigger3 = vel x > 0
trigger3 = var(20) := var(20) + 1 || var(21) := 1
trigger4 = screenpos x > 320 ;右
trigger4 = facing = -1
trigger4 = vel x < 0
trigger4 = var(20) := var(20) + 1 || var(21) := 1
x = -vel x

[state 12000, SE]
type = playsnd
trigger1 = var(20) < ifelse(var(8) = 0,6,16)
trigger1 = var(21) = 1
value = 1,3

[state 12000, SE switch]
type = varset
trigger1 = 1
var(21) = 0

[state 12000, 消滅]
type = destroyself
triggerall = var(20) >= ifelse(var(8) = 0,6,16)
trigger1 = screenpos x < 0
trigger2 = screenpos y < 0
trigger3 = screenpos x > 320
trigger4 = screenpos y > 240


[state 12000, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12000, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12000, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-14-(enemynear,const(size.ground.front)), 14+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-12, 12-(enemy,const(size.head.pos.y))]
value = 3, 2



;===============================================================================
;サブタレイニアンローズ/ローズ地獄
;===============================================================================
[statedef 2010]
type = S
movetype = A
physics = S
anim = 2010
ctrl = 0
ignorehitpause = 1

[state 2010, 暗転]
type = superpause
trigger1 = animelem = 6;time = 19
anim = -1
sound = S4,0
time = 43
poweradd = -5000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2010, スペカ名]
type = helper
trigger1 = animelem = 6;time = 19
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2010, 魔方陣eff]
type = helper
trigger1 = animelem = 6;time = 19
name = "spell"
stateno = 22000
pos = 2,-53
ownpal = 1
ID = 22000
supermovetime = 200

[state 2010, 風]
type = explod
trigger1 = (var(8) & (1023)) / (1) = 0
trigger1 = animelem = 10;time = 41
anim = 12010
ID = 12010
postype = p1
pos = 0,0
facing = 1
scale = 7,7
removetime = 101
sprpriority = 10
ignorehitpause = 1

[state 2010, 当たり判定]
type = helper
trigger1 = (var(8) & (1023)) / (1) = 0
trigger1 = animelem = 10;time = 41
name = "sub"
stateno = 12010
ID = 12010
postype = p1
pos = 0,0
ownpal = 1
ignorehitpause = 1

[state 2010, ]
type = nothitby
trigger1 = animelem = 10;time >= 41
value = SCA

[state 12010, ガード用]
type = attackdist
trigger1 = time = 0
value = 1000

[state 2010, 蕾]
type = explod
trigger1 = animelem = 8
ID = 2010
anim = 12021
scale = 0.1,0.1
postype = p1
pos = 6,-50
velocity = 0,0
ownpal = 1
sprpriority = 11
removetime = 9
ignorehitpause = 1
removeongethit = 1

[state 2010, バラ]
type = explod
trigger1 = animelem = 10
ID = 2011
anim = 12020
scale = 0.1,0.1
postype = p1
pos = 6,-50
velocity = 0,0
ownpal = 1
sprpriority = 11
removetime = -1
ignorehitpause = 1
removeongethit = 1

[state 2010, ]
type = playsnd
trigger1 = (var(8) & (1023)) / (1) > 0
trigger1 = animelem = 10
value = 1,3

[state 2010, ステート変更]
type = changestate
trigger1 = time > 60
trigger1 = numhelper(12010) = 0
value = 2011
ctrl = 0


;-------------------------------------------------------------------------------
;サブタレイニアンローズ終わり
[statedef 2011,]
type = S
movetype = I
physics = S
anim = 2011
ctrl = 0
ignorehitpause = 1

[state 2011, ]
type = modifyexplod
trigger1 = animelem = 12
removetime = 0
ignorehitpause = 1
removeongethit = 1

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


;-------------------------------------------------------------------------------
;サブタレイニアンローズ当たり判定
[statedef 12010]
type = A
movetype = A
physics = N
anim = 12012
ctrl = 0

[state 12010,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := p2dist x
trigger1 = fvar(13) := p2dist y + enemy,const(size.mid.pos.y)

[state 12010, ]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12010. ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 0,256

[state 12010, ]
type = playsnd
trigger1 = time = 0
value = 2,8

[state 12010, 複数ヒット]
type = null;varadd
trigger1 = time >= 0
trigger1 = movecontact
var(1) = 1

[state 12010, サブタレイニアンローズのヒット定義1]
type = hitdef
trigger1 = time = 0
trigger2 = time%3 = 0
trigger2 = time = [3,84]
attr = A,HP
damage = ceil((root,fvar(10)*40)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),4
getpower = 5,8
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,0
hitsound = -1;S0,4
guardsound = -1;S2,0
sparkno = -1;S20075
groundtype = high
ground.slidetime = 1
ground.hittime = 10
air.hittime = 10
ground.velocity = -1,-2
;guard.velocity = 1,0
air.velocity = -1,-2
ground.ctrltime = 20
guard.dist = 340
fall = 1
fall.recover = 0

[state 12010, サブタレイニアンローズのヒット定義2]
type = hitdef
;trigger1 = var(1) = 30
trigger1 = time = 87
attr = A,HP
damage = ceil((root,fvar(10)*40)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),4
getpower = 4,8
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,0
hitsound = -1;S0,4
guardsound = -1;S2,0
sparkno = -1;S20075
groundtype = high
ground.slidetime = 1
ground.hittime = 20
air.hittime = 20
ground.velocity = -1,-4
;guard.velocity = 0,0
air.velocity = -2,-5
ground.ctrltime = 20
guard.dist = 340
fall = 1
fall.recover = 0

[state 12010, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.95
ignorehitpause = 0

[state 12010, ]
type = playsnd
trigger1 = movehit = 1
value = 0,3
channel = 0

[state 12010, ]
type = playsnd
trigger1 = moveguarded = 1
value = 2,0
channel = 0

[state 12010, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 11000
anim = 20070
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = -1
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12010, 茨1]
type = helper
trigger1 = time = 0
name = "hanabira"
stateno = 12011
ID = 12011
postype = back
pos = 53,0
ownpal = 1
ignorehitpause = 1

[state 12010, 茨2]
type = helper
trigger1 = time = 0
name = "hanabira"
stateno = 12011
ID = 12012
postype = back
pos = 106,0
ownpal = 1
ignorehitpause = 1

[state 12010, 茨3]
type = helper
trigger1 = time = 0
name = "hanabira"
stateno = 12011
ID = 12013
postype = back
pos = 160,0
ownpal = 1
ignorehitpause = 1

[state 12010, 茨4]
type = helper
trigger1 = time = 0
name = "hanabira"
stateno = 12011
ID = 12014
postype = back
pos = 213,0
ownpal = 1
ignorehitpause = 1

[state 12010, 茨5]
type = helper
trigger1 = time = 0
name = "hanabira"
stateno = 12011
ID = 12015
postype = back
pos = 266,0
ownpal = 1
ignorehitpause = 1

[state 12010, 花弁エフェクト表示]
type = projectile
trigger1 = movehit = 1
projID = 12011
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499,1,-1)*random*0.005, -random*0.005
accel = 0, 0.05
postype = p1
offset = floor(fvar(12)),floor(fvar(13))
projsprpriority = 8
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12010, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12010, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12010, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-1000-(enemynear,const(size.ground.front)), 1000+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-1000, 1000-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12010, ]
type = destroyself
trigger1 = time = 90
trigger2 = root,stateno != 2010



;-------------------------------------------------
[statedef 12011,]
type = A
movetype = I
physics = N
anim = 12015
ctrl = 0
sprpriority = -1

[state 12011, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12011, ]
type = varrandom
triggerall = time = 0
trigger1 = ishelper(12012)
trigger2 = ishelper(12013)
trigger3 = ishelper(12014)
v = 0
range = 60,120

[state 12011, ]
type = varrandom
trigger1 = ishelper(12011)
trigger1 = time = 0
v = 0
range = 60,90

[state 12011, ]
type = varrandom
trigger1 = ishelper(12015)
trigger1 = time = 0
v = 0
range = 90,120

[state 12011, ]
type = velset
trigger1 = time = 0
x = 15*cos(var(0)*pi/180)
y = -15*sin(var(0)*pi/180)

[state 12011, ]
type = angleset
trigger1 = 1
value = var(0)-90

[state 12011, ]
type = angledraw
trigger1 = 1

[state 12011, ]
type = destroyself
trigger1 = time = 120



;===============================================================================
;ローズ地獄
;===============================================================================
[statedef 13100]
type = A
movetype = A
physics = N
anim = 12013
ctrl = 0

[state 13100, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 13100, 速度設定]
type = varrandom
trigger1 = time >= 0
trigger1 = time%90 = 0
v = 0
range = 1,19

[state 13100, ]
type = varadd
trigger1 = var(0) > 10
var(0) = -20

[state 13100, ]
type = varset
trigger1 = movecontact = 1
var(1) = 1

[state 13100, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 13100, ]
type = angledraw
trigger1 = anim = 12013
scale = 0.3, 0.3

[state 13100, ]
type = velset
trigger1 = 1
x = var(0)*0.1
y = 1

[state 13100, 攻撃設定]
type = hitdef
trigger1 = var(1) = 0
attr = A,SP
damage = ceil((root,fvar(10)*20)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),7
getpower = 18,9
givepower = -10,-2
hitflag = MAF
guardflag = MA
animtype = hard
priority = 4,hit
pausetime = 1,0
hitsound = S0,4
guardsound = S2,0
sparkno = S20060
;sparkxy = -10, -58
ground.slidetime = 5
ground.hittime = 20
ground.velocity = -2,0
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -1
air.velocity = -2,-3

[state 12010, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.97
ignorehitpause = 0

[state 13100, バラ]
type = explod
trigger1 = var(1) = 1
ID = 13100
anim = 12014
scale = 0.15,0.15
postype = p1
pos = 0,0
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = 21
ignorehitpause = 1

[state 13100, ]
type = destroyself
trigger1 = screenpos x < -20
trigger2 = screenpos x > 360
trigger3 = screenpos y > 280
trigger4 = var(1) = 1



;===============================================================================
;嫌われ者のフィロソフィ
;===============================================================================
[statedef 2020]
type = S
movetype = I
physics = S
anim = 2020
ctrl = 0

[state 2020, ]
type = playsnd
trigger1 = time = 4
value = 2,6

[state 2020, 暗転]
type = superpause
trigger1 = animelem = 8
anim = -1
sound = S4,0
time = 43
poweradd = -3000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2020, スペカ名]
type = helper
trigger1 = animelem = 8
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2020, 魔方陣eff]
type = helper
trigger1 = animelem = 8
name = "spell"
stateno = 22000
pos = 2,-53
ownpal = 1
ID = 22000
supermovetime = 200

[state 2020, ]
type = playsnd
trigger1 = animelem = 9
value = 1,7

[state 2020, フィロソフィスイッチ]
type = varset
trigger1 = animelem = 9
var(14) = (var(14) | (536870912))

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


;-------------------------------------------------------------------------------
;嫌われ者のフィロソフィ解除
[statedef 2025]
type = S
movetype = I
physics = S
anim = 2025
ctrl = 0

[state 2025, ]
type = playsnd
trigger1 = animelem = 3
value = 2,9

[state 2025, 爆発]
type = helper
trigger1 = animelem = 3
name = "hikari"
stateno = 10420
pos = 4, -54
postype = p1
ownpal = 1
ID = 11049

[state 2025, フィロソフィスイッチoff]
type = varset
trigger1 = animelem = 3
var(14) = (var(14) | (536870912)) - (536870912)

[state 2025, 嫌われ者のフィロソフィ終了]
type = varset
trigger1 = animelem = 3
var(11) = 150

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


;-------------------------------------------------------------------------------
;嫌われ者のフィロソフィバラ開花（設置）
[statedef 12020]
type = A
movetype = A
physics = N
anim = 12020
ctrl = 0
sprpriority = 5

[state 12020,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -30,p2dist x,0)+ifelse(p2dist x > 30,30-p2dist x,0)
trigger1 = fvar(13) := 0

[state 12020, ]
type = playsnd
trigger1 = time = 0
value = 1,3

[state 12020, ]
type = angledraw
trigger1 = 1
scale = 0.35,0.35

[state 12020, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,128

[state 12020, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12020, 速度設定]
type = velset
trigger1 = time = 0
x = 0
y = 0

[state 12020, 攻撃設定]
type = hitdef
trigger1 = time = 0
attr = A,HP
damage = ceil((root,fvar(10)*50)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 20,10
hitflag = MAFP
guardflag = MA
animtype = hard
priority = 3,hit
pausetime = 9,8
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20060
sparkxy = -1;-10, -58
ground.slidetime = 5
ground.hittime = 20
ground.velocity = -2
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = -4,-2
;givepower = 10,2

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(70*root,fvar(10)),10)
ignorehitpause = 1
persistent = 0

[state 12020, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.80
ignorehitpause = 1
persistent = 0

[state 12020, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12020
anim = 20060
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12020, 花弁1]
type = projectile
trigger1 = movecontact
trigger2 = time = 0
projID = 12020
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12020, 花弁2]
type = projectile
trigger1 = movecontact
trigger2 = time = 0
projID = 12021
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12020, 花弁3]
type = projectile
trigger1 = movecontact
trigger2 = time = 0
projID = 12022
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12020, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12020, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12020, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-30-(enemynear,const(size.ground.front)), 30+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-30, 30-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12020, つぼみ状態へ]
type = changestate
trigger1 = movecontact
value = 12021

[state 12020, 夢枕にご先祖総立ち]
type = changestate
trigger1 = root,stateno = 2070
trigger1 = root,animelem = 6
value = 12070

[state 12020, 設置へ]
type = changestate
trigger1 = (root,var(14) & (536870912)) != (536870912)
trigger2 = rootdist x != [-40,40] ;x方向接近
value = 11040



;-------------------------------------------------------------------------------
;嫌われ者のフィロソフィつぼみ状態（設置）
[statedef 12021]
type = A
movetype = I
physics = N
anim = 12021
ctrl = 0

[state 12021, ]
type = angledraw
trigger1 = 1
scale = 0.35,0.35

[state 12020, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,128

[state 12021, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12021, 速度設定]
type = velset
trigger1 = time = 0
x = 0
y = 0

[state 12021, バラ開花へ]
type = changestate
trigger1 = time = 90
value = 12020

[state 12021, 夢枕にご先祖総立ち]
type = changestate
trigger1 = root,stateno = 2070
trigger1 = root,animelem = 6
value = 12070

[state 12021, 設置へ]
type = changestate
trigger1 = (root,var(14) & (536870912)) != (536870912)
trigger2 = rootdist x != [-40,40] ;x方向接近
value = 11040



;-------------------------------------------------------------------------------
;嫌われ者のフィロソフィバラ開花（憑依）
[statedef 12022]
type = A
movetype = A
physics = N
anim = 12020
ctrl = 0
sprpriority = 5

[state 12022,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -30,p2dist x,0)+ifelse(p2dist x > 30,30-p2dist x,0)
trigger1 = fvar(13) := 0

[state 12022, ]
type = playsnd
trigger1 = time = 0
value = 1,3

[state 12022, ]
type = angledraw
trigger1 = 1
scale = 0.35,0.35

[state 12022, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,128

[state 12022, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 11048, ]
type = bindtoroot
trigger1 = 1
facing = 0
pos = ceil(root,p2dist x +35*cos(3*time*pi/180)),root,ceil(enemy,pos y +enemy,const(size.mid.pos.y) -root,pos y)

[state 12022, 攻撃設定]
type = hitdef
trigger1 = time = 0
attr = A,HP
damage = ceil((root,fvar(10)*50)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 20,10
hitflag = MAFP
guardflag = MA
animtype = hard
priority = 3,hit
pausetime = 9,8
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20060
;sparkxy = -1;-10, -58
ground.slidetime = 5
ground.hittime = 20
ground.velocity = -2
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = -4,-2
;givepower = 10,2

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(70*root,fvar(10)),10)
ignorehitpause = 1
persistent = 0

[state 12022, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 1
persistent = 0

[state 12022, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12022
anim = 20060
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12022, 花弁1]
type = projectile
trigger1 = movecontact
trigger2 = time = 0
projID = 12020
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12022, 花弁2]
type = projectile
trigger1 = movecontact
trigger2 = time = 0
projID = 12021
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12022, 花弁3]
type = projectile
trigger1 = movecontact
trigger2 = time = 0
projID = 12022
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12022, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12022, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12022, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-30-(enemynear,const(size.ground.front)), 30+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-30, 30-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12022, つぼみ状態へ]
type = changestate
trigger1 = movecontact
value = 12023

[state 12022, 夢枕にご先祖総立ち]
type = changestate
trigger1 = root,stateno = 2070
trigger1 = root,animelem = 6
value = 12070

[state 12022, 憑依へ]
type = changestate
trigger1 = (root,var(14) & (536870912)) != (536870912)
trigger2 = rootdist x != [-40,40] ;x方向接近
value = 11048



;-------------------------------------------------------------------------------
;嫌われ者のフィロソフィつぼみ状態（憑依）
[statedef 12023]
type = A
movetype = I
physics = N
anim = 12021
ctrl = 0

[state 12023, ]
type = angledraw
trigger1 = 1
scale = 0.35,0.35

[state 12023, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,128

[state 12023, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 11048, ]
type = bindtoroot
trigger1 = 1
facing = 0
pos = ceil(root,p2dist x +35*cos(3*time*pi/180)),root,ceil(enemy,pos y +enemy,const(size.mid.pos.y) -root,pos y)

[state 12022, バラ開花へ]
type = changestate
trigger1 = time = 90
value = 12020

[state 12023, 夢枕にご先祖総立ち]
type = changestate
trigger1 = root,stateno = 2070
trigger1 = root,animelem = 6
value = 12070

[state 12023, 憑依へ]
type = changestate
trigger1 = (root,var(14) & (536870912)) != (536870912)
trigger2 = rootdist x != [-40,40] ;x方向接近
value = 11048



;===============================================================================
;「弾幕パラノイア」/「クレンボーエクスポージャー」
;===============================================================================
[statedef 2030]
type = S
movetype = A
physics = S
anim = ifelse((var(8) & (1023)) / (1) = 0,2030,2031)
ctrl = 0
vel = 0,0

[state 2030, 暗転]
type = superpause
trigger1 = animelem = 2
anim = -1
sound = S4,0
time = 43
poweradd = -2000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2030, スペカ名]
type = helper
trigger1 = animelem = 2
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2030, 魔方陣eff]
type = helper
trigger1 = animelem = 2
name = "spell"
stateno = 22000
pos = 2,-53
ownpal = 1
ID = 22000
supermovetime = 200

[state 2030, ]
type = helper
trigger1 = anim = 2030
trigger1 = animelem = 4
name = "kijun"
stateno = 12030
ID = 12030
pos = 0,0
postype = p1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

[state 2030, 黒]
type = helper
trigger1 = anim = 2031
trigger1 = animelem = 4
name = "kuro"
stateno = 12033
ID = 12033
pos = ceil(p2dist x),0
postype = p1
ownpal = 1

[State 2030, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1



;===============================================================================
;空中「弾幕パラノイア」/「クレンボーエクスポージャー」
;===============================================================================
[statedef 2035]
type = A
movetype = A
physics = A
vel = 0,0
ctrl = 0
anim = ifelse((var(8) & (1023)) / (1) = 0,2035,2036)

[state 2035, 暗転]
type = superpause
trigger1 = animelem = 2
anim = -1
sound = S4,0
time = 43
poweradd = -2000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2035, スペカ名]
type = helper
trigger1 = animelem = 2
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2035, 魔方陣eff]
type = helper
trigger1 = animelem = 2
name = "spell"
stateno = 22000
pos = 2,-53
ownpal = 1
ID = 22000
supermovetime = 200

[state 2035, ]
type = helper
trigger1 = anim = 2035
trigger1 = animelem = 4
name = "kijun"
stateno = 12030
ID = 12030
pos = 0,0
postype = p1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

[state 12030, 黒]
type = helper
trigger1 = anim = 2036
trigger1 = animelem = 4
name = "kuro"
stateno = 12033
ID = 12033
pos = ceil(p2dist x),0
postype = p1
ownpal = 1

[State 2035, 落下]
type = changestate
trigger1 = animtime = 0
value = 2037
ctrl = 0


;パラノイア落下---------------------------------------------------------
[statedef 2037]
type = A
movetype = I
physics = A
anim = 2037
ctrl = 0

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



;-------------------------------------------------------------------------------
;距離測定ヘルパー
[statedef 12030]
type = A
movetype = I
physics = N
anim = 11050
ctrl = 0
sprpriority = 6

[state 12030, ]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12030, イドスイッチ]
type = varset
triggerall = time = 0
trigger1 = root,anim = 2031
trigger2 = root,anim = 2036
var(1) = 1

[state 12030, ]
type = posset
trigger1 = time = 0
y = 0

[state 12030, ]
type = varset
trigger1 = time = 0
fvar(0) = p2dist x

[state 12030, ]
type = varset
trigger1 = time = 0
fvar(1) = p2bodydist x

[state 12030, ]
type = varset
trigger1 = time = 0
fvar(2) = fvar(1)-35

[state 12030, ]
type = varset
trigger1 = time = 0
fvar(3) = fvar(0)+(fvar(0)-fvar(1))+35

[state 12030, 手前]
type = helper
trigger1 = var(1) = 0
trigger1 = time = 0
name = "sitatemae"
stateno = 12031
ID = 12031
pos = ceil(fvar(2)),0
postype = p1
ownpal = 1

[state 12030, 後ろ]
type = helper
trigger1 = var(1) = 0
trigger1 = time = 0
name = "sitausiro"
stateno = 12031
ID = 12032
pos = ceil(fvar(3)),0
postype = p1
ownpal = 1

[state 12030, 黒]
type = null;helper
trigger1 = var(1) = 1
trigger1 = time = 0
name = "kuro"
stateno = 12033
ID = 12033
pos = ceil(fvar(0)),0
postype = p1
ownpal = 1
size.xscale = 2
size.yscale = 2

[state 12030, ]
type = destroyself
trigger1 = time = 10



;-------------------------------------------------
;下
[statedef 12031]
type = A
movetype = I
physics = N
anim = 11050
ctrl = 0
sprpriority = 6

[state 12031, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12031, ]
type = trans
trigger1 = time <= 220
trans = addalpha
alpha = 256,256

[state 12031, ]
type = trans
trigger1 = time > 220
trans = addalpha
alpha = ceil(256-12.8*(time -220)),256

[state 12031, ]
type = angledraw
trigger1 = 1
scale = 0.5,0.1

[state 12031, ]
type = playsnd
trigger1 = time%2 = 0
trigger1 = time <= 220
value = 2,11
channel = 1

[state 12031, 当たり判定]
type = helper
trigger1 = ishelper(12031)
trigger1 = time = 0
name = "hanteimae"
stateno = 12032
ID = 12033
pos = 0,0
postype = p1
ownpal = 1

[state 12031, 当たり判定]
type = helper
trigger1 = ishelper(12032)
trigger1 = time = 0
name = "hanteiusiro"
stateno = 12032
ID = 12034
pos = 0,0
postype = p1
ownpal = 1

[state 12031, クナイ]
type = explod
trigger1 = time%2 = 0
trigger1 = time <= 220
ID = 12030
anim = 12030
scale = 0.5,0.5
postype = p1
pos = 0,0
velocity = 0,-10
random = 40,0
ownpal = 1
sprpriority = 6
removetime = 60
ignorehitpause = 1

[state 12031, ]
type = destroyself
trigger1 = time = 240



;-------------------------------------------------
;当たり判定
[statedef 12032]
type = A
movetype = A
physics = N
anim = 12031
ctrl = 0
sprpriority = 6

[state 12032, ]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12032, ]
type = varadd
trigger1 = movecontact
var(1) = 1

[state 12032, ]
type = varset
trigger1 = var(1) >= 75
var(1) = 0

[state 12032,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -25,p2dist x,0)+ifelse(p2dist x > 25,25-p2dist x,0)
trigger1 = fvar(13) := ifelse(p2dist y < 0,p2dist y+ enemy,const(size.mid.pos.y),0)+ifelse(p2dist y >= 0,p2dist y+ enemy,const(size.mid.pos.y),0)

[state 12032, 攻撃設定1]
type = hitdef
triggerall = ishelper(12033)
trigger1 = var(1) = 0
trigger2 = var(1)%5 = 0
trigger2 = var(1) <= 45
attr = A, HP
damage = ceil((root,fvar(10)*10)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),3
getpower = 10,5
givepower = 0,-4
hitflag = MAF
guardflag = MA
animtype = medium
priority = 5,hit
pausetime = 0,5
hitsound = S0,6
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -3,0
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = -3,-4

[state 12032, 攻撃設定2]
type = hitdef
triggerall = ishelper(12034)
trigger1 = var(1) = 0
trigger2 = var(1)%5 = 0
trigger2 = var(1) <= 45
attr = A, HP
damage = ceil((root,fvar(10)*10)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),3
getpower = 10,5
givepower = 0,-4
hitflag = MAF
guardflag = MA
animtype = medium
priority = 5,hit
pausetime = 0,5
hitsound = S0,6
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
ground.slidetime = 15
ground.hittime = 15
ground.velocity = 3,0
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = 2
air.velocity = 3,-4

[state 12032, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(50*root,fvar(10)),5)
ignorehitpause = 1

[state 12032, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.98
ignorehitpause = 1

[state 12032, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12042
anim = 20080
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12032, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12032, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12032, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-25-(enemynear,const(size.ground.front)), 25+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-500, 30-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12032, ]
type = destroyself
trigger1 = time = 220



;-------------------------------------------------------------------------------
;「クレンボーエクスポージャー」当たり判定
[statedef 12033]
type = A
movetype = A
physics = N
anim = 12034
ctrl = 0
sprpriority = 6

[state 12033, ]
type = posset
trigger1 = time = 0
y = 0

[state 12033, ]
type = angledraw
trigger1 = 1
scale = 0.4,0.4

[state 12033, ]
type = trans
trigger1 = 1
trans = sub
ignorehitpause = 1

[state 12033, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12033, ]
type = varadd
trigger1 = 1
var(0) = 1
ignorehitpause = 1

[state 12033, ガード時]
type = varadd
trigger1 = movecontact
var(1) = 1

[state 12033, ヒット時]
type = varadd
trigger1 = movehit > 0
var(2) = 1

[state 12033,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -135,p2dist x,0)+ifelse(p2dist x > 135,135-p2dist x,0)

[state 12033,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(13) := ifelse(p2dist y < 0,p2dist y+ enemy,const(size.mid.pos.y),0)+ifelse(p2dist y >= 0,p2dist y+ enemy,const(size.mid.pos.y),0)

[state 12033, ]
type = playsnd
trigger1 = time = 0
value = 2,8

[state 12033, 黒風]
type = null;helper
trigger1 = time = 0
name = "kurowind"
stateno = 12034
ID = 12034
pos = 0,0
postype = p1
ownpal = 1

[state 12033, 黒風]
type = explod
trigger1 = time = 0
ID = 12033
anim = 12032
postype = p1
pos = 0,0
velocity = 0,0
removetime = 999
ownpal = 1
sprpriority = 6
scale = 2,2
ignorehitpause = 1

[state 12033, 黒風]
type = modifyexplod
trigger1 = var(2) >= 70
trigger2 = var(2) = 0
trigger2 = var(1) >= 70
trigger3 = time > 150
ID = 12033
velocity = 0,0
removetime = 1
ignorehitpause = 1

[state 12033, 黒風]
type = explod
trigger1 = var(2) >= 70
trigger2 = var(2) = 0
trigger2 = var(1) >= 70
trigger3 = time > 150
ID = 12034
anim = 12033
velocity = 0,0
removetime = -2;20
ignorehitpause = 1
persistent = 0

[state 12033, ]
type = posadd
trigger1 = var(2) >= 90
x = p2dist x
y = p2dist y+ enemy,const(size.mid.pos.y)
persistent = 0

[state 12033, ]
type = changeanim
trigger1 = var(2) >= 90
value = 12035
persistent = 0

[state 12033, 攻撃設定1]
type = hitdef
triggerall = anim = 12034
trigger1 = var(1) = 0
trigger2 = var(1)%5 = 0
trigger2 = var(1) < 45
attr = A, HP
damage = ceil((root,fvar(10)*40)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 10,5
hitflag = MAFD
guardflag = MA
animtype = hard
priority = 5,hit
pausetime = 5,5
hitsound = S0,6
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
ground.slidetime = 15
ground.hittime = 15
ground.velocity = 0,-4
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = 0,-4
fall = 1
fall.recover = 0

[state 12033, 攻撃設定1]
type = hitdef
triggerall = anim = 12034
trigger1 = var(1) = 45
attr = A, HP
damage = ceil((root,fvar(10)*40)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 10,5
hitflag = MAFD
guardflag = MA
animtype = hard
priority = 5,hit
pausetime = 5,5
hitsound = S0,6
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
ground.slidetime = 15
ground.hittime = 15
ground.velocity = 0,-7
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = 0,-7
fall = 1
fall.recover = 0

[state 12033, 攻撃設定1]
type = hitdef
trigger1 = anim = 12035
attr = A, HP
damage = ceil((root,fvar(10)*50)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 10,5
hitflag = MAFD
guardflag = MA
animtype = hard
priority = 5,hit
pausetime = 10,9
hitsound = S0,7
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
ground.slidetime = 15
ground.hittime = 15
ground.velocity = 0,-7
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = 0,-7
fall = 1
fall.recover = 0
persistent = 0

[state 12033, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(50*root,fvar(10)),5)
ignorehitpause = 1

[state 12033, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.98
ignorehitpause = 1

[state 12033, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12042
anim = 20080
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12033, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12033, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12033, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-135-(enemynear,const(size.ground.front)), 135+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-500, 12-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12033, 花弁1]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, 花弁2]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, 花弁3]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, 花弁4]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, 花弁5]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, 花弁6]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, 花弁7]
type = projectile
trigger1 = var(2) = 160
projID = 12035
projanim = 12036
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12033, ]
type = destroyself
trigger1 = var(2) = 0
trigger1 = var(1) > 70
trigger2 = var(2) > 160
trigger3 = time > 180



;-------------------------------------------------
;黒風
[statedef 12034]
type = A
movetype = I
physics = N
anim = 12032
vel = 0,0
ctrl = 0
sprpriority = 6

[state 12034, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12034, ]
type = angledraw
trigger1 = 1
scale = 2,2
ignorehitpause = 1

[state 12034, ]
type = trans
trigger1 = 1
trans = sub
ignorehitpause = 1

[state 12034, ]
type = changeanim
trigger1 = parent,var(2) = 0
trigger1 = parent,var(0) >= 150
trigger2 = parent,var(2) >= 70
value = 12033
persistent = 0

[state 12034, ]
type = destroyself
trigger1 = anim = 12033
trigger1 = animtime = 0



;===============================================================================
;「DNAの瑕」
;===============================================================================
[statedef 2040]
type = S
movetype = I
physics = S
anim = 2040
ctrl = 0

[state 2040, ]
type = nothitby
trigger1 = 1
value = SCA

[state 2040, 暗転]
type = superpause
trigger1 = animelem = 6
anim = -1
sound = S4,0
time = 43
poweradd = -4000
movetime = 0
darken = 0

[state 2040, スペカ名]
type = helper
trigger1 = animelem = 6
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2040, 魔方陣eff]
type = helper
trigger1 = animelem = 6
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2040, 青]
type = helper
trigger1 = animelem = 7;time = 20
trigger2 = time = 50 || time = 80
;trigger2 = (time -20)%15 = 0
;trigger2 = time = [35,95]
name = "dna"
stateno = 12040
pos = 70,0
postype = p1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12040

[state 2040, ピンク]
type = helper
trigger1 = animelem = 7;time = 20
trigger2 = time = 50 || time = 80
;trigger2 = (time -20)%15 = 0
;trigger2 = time = [35,95]
name = "dna"
stateno = 12041
pos = -70,0
postype = p1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12041

[state 2040, 判定]
type = helper
trigger1 = animelem = 7
name = "hantei"
stateno = 12042
pos = 0,0
postype = p1
ownpal = 1
ID = 12042

[state 2040, ]
type = playsnd
trigger1 = time >= 20
trigger1 = (time -20)%15 = 0
value = 2,10
channel = 1

[state 2040, ステート変更]
type = changestate
trigger1 = time = 150
value = 2041
ctrl = 0


;-------------------------------------------------------------------------------
;「DNAの瑕」終わり
[statedef 2041,]
type = S
movetype = I
physics = S
anim = 2041
ctrl = 0
ignorehitpause = 1

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



;-----------------------------------------------------------
;DNA青
[statedef 12040]
type = A
movetype = I
physics = N
anim = 10430
ctrl = 0

[state 12040, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12040, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12040, 青回転]
type = angleset
trigger1 = time >= 0
value = time*6+90

[state 12040, 回転実行]
type = angledraw
trigger1 = 1

[state 12040, 青速度]
type = velset
trigger1 = time >= 0
x = -15*sin(time*12*pi/180)
y = -4

[state 12040, ]
type = sprpriority
trigger1 = time = 0
value = 4

[state 12040, 青]
type = sprpriority
trigger1 = time > 0
trigger1 = cos(time*12*pi/180) = 1
value = 6+2*floor(time/30)

[state 12040, 青]
type = afterimage
trigger1 = time = 0
time = 200
length = 30
timegap = 1
framegap = 4
palbright = 20,20,50
palcontrast = 256,256,256
paladd = 0,0,0
palmul = 1.00,1.00,1.00
trans = add

[state 12040, 消滅]
type = destroyself
trigger1 = screenpos y < -194



;-----------------------------------------------------------
;DNAピンク
[statedef 12041]
type = A
movetype = I
physics = N
anim = 10431
ctrl = 0

[state 12041, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12041, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12041, ピンク回転]
type = angleset
trigger1 = time >= 0
value = time*6-90

[state 12041, 回転実行]
type = angledraw
trigger1 = 1

[state 12041, ピンク速度]
type = velset
trigger1 = time >= 0
x = 15*sin(time*12*pi/180)
y = -4

[state 12041, ]
type = sprpriority
trigger1 = time = 0
value = 4

[state 12041, ピンク]
type = sprpriority
trigger1 = cos(time*12*pi/180) = -1
value = 5+2*floor(time/30)

[state 12041, ピンク]
type = afterimage
trigger1 = time = 0
time = 200
length = 30;18
timegap = 1
framegap = 4;6
palbright = 50,20,20
palcontrast = 256,256,256
paladd = 0,0,0
palmul = 1.00,1.00,1.00
trans = add

[state 12041, 消滅]
type = destroyself
trigger1 = screenpos y < -194



;-----------------------------------------------------------
;DNA判定
[statedef 12042]
type = A
movetype = A
physics = N
anim = 12042
ctrl = 0

[state 12042,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -75,p2dist x,0)+ifelse(p2dist x > 75,75-p2dist x,0)
trigger1 = fvar(13) := ifelse(p2dist y < 0,p2dist y+ enemy,const(size.mid.pos.y),0)+ifelse(p2dist y >= 0,p2dist y+ enemy,const(size.mid.pos.y),0)

[state 12042, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12042, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 0,256

[state 12042, 速度]
type = velset
trigger1 = time = 0
y = -4
ignorehitpause = 1

[state 12042, 複数ヒット]
type = varadd
trigger1 = movecontact
var(1) = 1

[state 12042, ヒット定義]
type = hitdef
triggerall = time < 100
trigger1 = var(1) = 0
trigger2 = var(1)%8 =0;4 = 0
trigger2 = var(1) = [8,64];[4,32]
attr = A,HP
damage = ceil((root,fvar(10)*60)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),20
getpower = 70,30
animtype = hard
guardflag = MA
hitflag = MAF
priority = 4,hit
pausetime = 0,5
hitsound = S0,1
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;-10, -58
groundtype = high
ground.slidetime = 5
ground.hittime = 60
ground.velocity = 0,-4
guard.velocity = -1
air.velocity = 0,-4
air.hittime = 20
ground.ctrltime = 20
fall = 1
fall.recover = 0

[state 12042, ヒット定義]
type = hitdef
trigger1 = var(1) = 72;36
trigger2 = time >= 100
trigger2 = var(1) < 72;36
attr = A,HP
damage = ceil((root,fvar(10)*60)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 70,30
animtype = hard
guardflag = MA
hitflag = MAF
priority = 4,hit
pausetime = 0,5
hitsound = S0,1
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;-10, -58
groundtype = high
ground.slidetime = 5
ground.hittime = 30
ground.velocity = -4,-6
guard.velocity = -1.5
air.velocity = -4,-6
air.hittime = 40
ground.ctrltime = 20
fall = 1
fall.recover = 0
persistent = 0

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(70*root,fvar(10)),10)
ignorehitpause = 0

[state 12042, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.94
ignorehitpause = 0
;persistent = 0

[state 12042, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12042
anim = 20075
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12042, 消滅]
type = destroyself
trigger1 = root,stateno = [5000,5100]
trigger2 = screenpos y < -390


[state 12042, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12042, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12042, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-50-(enemynear,const(size.ground.front)), 50+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-13, 385-(enemy,const(size.head.pos.y))]
value = 3, 2



;===============================================================================
;心符「没我の愛」
;===============================================================================
[statedef 2050]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2050

[state 2050, ]
type = nothitby
trigger1 = time <= 80
value = SCA

[state 2050, 暗転]
type = superpause
trigger1 = animelem = 4
anim = -1
sound = S4,0
time = 43
poweradd = -3000;+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2050, スペカ名]
type = helper
trigger1 = animelem = 4
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2050, 魔方陣eff]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

;回転ハート---------------------------------------
[state 2050, 0]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12050

[state 2050, 45]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12051

[state 2050, 90]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12052

[state 2050, 135]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12053

[state 2050, 180]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12054

[state 2050, 225]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12055

[state 2050, 270]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12056

[state 2050, 315]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12057
[state 2050, 0]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12058

[state 2050, 45]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12059

[state 2050, 90]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12060

[state 2050, 135]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12061

[state 2050, 180]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12062

[state 2050, 225]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12063

[state 2050, 270]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12064

[state 2050, 315]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12065

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

[state 2050, ]
type = playsnd
trigger1 = numhelper(12050) = 1
value = 1,9
persistent = 10
channel = 1

[state 2050, ]
type = changestate
trigger1 = animelem = 6,>=0
trigger1 = numhelper(12065) = 0
value = 2051
ctrl = 0



;-------------------------------------------------
;没我の愛硬直
[statedef 2051]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2051

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


;===============================================================================
;心符「没我の愛」（空中）
;===============================================================================
[statedef 2055]
type = A
movetype = A
physics = A
ctrl = 0
anim = 2050

[state 2050, ]
type = nothitby
trigger1 = time <= 80
value = SCA

[state 2055, 暗転]
type = superpause
trigger1 = animelem = 4
anim = -1
sound = S4,0
time = 43
poweradd = -3000;+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2055, スペカ名]
type = helper
trigger1 = animelem = 4
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2055, 魔方陣eff]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

;飛んでくハート-----------------------------------
[state 2055, 0]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12050

[state 2055, 45]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12051

[state 2055, 90]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12052

[state 2055, 135]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12053

[state 2055, 180]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12054

[state 2055, 225]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12055

[state 2055, 270]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12056

[state 2055, 315]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12057
[state 2055, 0]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12058

[state 2055, 45]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12059

[state 2055, 90]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12060

[state 2055, 135]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12061

[state 2055, 180]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12062

[state 2055, 225]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12063

[state 2055, 270]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12064

[state 2055, 315]
type = helper
trigger1 = animelem = 5
name = "hart"
stateno = 12050
postype = p1
pos = 0,-50
ownpal = 0
ID = 12065

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

[state 2055, ]
type = playsnd
trigger1 = numhelper(12050) = 1
value = 1,9
persistent = 10
channel = 1

[state 2055, ]
type = changestate
trigger1 = animelem = 6,>=0
trigger1 = numhelper(12065) = 0
value = 2056
ctrl = 0



;-------------------------------------------------
;没我の愛硬直
[statedef 2056]
type = A
movetype = I
physics = A
ctrl = 0
anim = 2051

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



;-------------------------------------------------------------------------------
;回転ハート
[statedef 12050]
type = A
movetype = A
physics = N
anim = 10301
ctrl = 0
sprpriority = 6

[state 12050, 無敵]
type = nothitby
trigger1 = 1
value = SCA

[state 12050, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12050, 射出時間調整]
type = varset
trigger1 = time = 0
var(10) = 120;ifelse((root,var(8) & (1023)) / (1) = 0, 300, 600)

[state 12050, ]
type = changeanim
trigger1 = ishelper(12058)
trigger2 = ishelper(12059)
trigger3 = ishelper(12060)
trigger4 = ishelper(12061)
trigger5 = ishelper(12062)
trigger6 = ishelper(12063)
trigger7 = ishelper(12064)
trigger8 = ishelper(12065)
value = 10300

[state 12050, 反時計回り]
type = varset
trigger1 = ishelper(12050)
trigger2 = ishelper(12051)
trigger3 = ishelper(12052)
trigger4 = ishelper(12053)
trigger5 = ishelper(12054)
trigger6 = ishelper(12055)
trigger7 = ishelper(12056)
trigger8 = ishelper(12057)
var(1) = 1

[state 12050, 時計回り]
type = varset
trigger1 = ishelper(12058)
trigger2 = ishelper(12059)
trigger3 = ishelper(12060)
trigger4 = ishelper(12061)
trigger5 = ishelper(12062)
trigger6 = ishelper(12063)
trigger7 = ishelper(12064)
trigger8 = ishelper(12065)
var(1) = -1

[state 12050, 反時計回り]
type = null
trigger1 = ishelper(12050)
trigger1 = var(0) := 0
trigger2 = ishelper(12051)
trigger2 = var(0) := 7;15
trigger3 = ishelper(12052)
trigger3 = var(0) := 15;30
trigger4 = ishelper(12053)
trigger4 = var(0) := 22;45
trigger5 = ishelper(12054)
trigger5 = var(0) := 30;60
trigger6 = ishelper(12055)
trigger6 = var(0) := 37;75
trigger7 = ishelper(12056)
trigger7 = var(0) := 45;90
trigger8 = ishelper(12057)
trigger8 = var(0) := 52;105

[state 12050, 時計回り]
type = null
trigger1 = ishelper(12058)
trigger1 = var(0) := -0
trigger2 = ishelper(12059)
trigger2 = var(0) := -7;15
trigger3 = ishelper(12060)
trigger3 = var(0) := -15;30
trigger4 = ishelper(12061)
trigger4 = var(0) := -22;45
trigger5 = ishelper(12062)
trigger5 = var(0) := -30;60
trigger6 = ishelper(12063)
trigger6 = var(0) := -37;75
trigger7 = ishelper(12064)
trigger7 = var(0) := -45;90
trigger8 = ishelper(12065)
trigger8 = var(0) := -52;105

[state 12050, ]
type = varset
trigger1 = 1
fvar(0) = (100+time/2)*cos((time+var(0))*pi/30)

[state 12050, ]
type = varset
trigger1 = 1
fvar(1) = -(25+time/20)*sin(var(1)*(time+var(0))*pi/30)

[state 12050, 広がり]
type = bindtoroot
triggerall = time >= 0
trigger1 = ishelper(12050)
trigger2 = ishelper(12051)
trigger3 = ishelper(12052)
trigger4 = ishelper(12053)
trigger5 = ishelper(12054)
trigger6 = ishelper(12055)
trigger7 = ishelper(12056)
trigger8 = ishelper(12057)
facing = 0
pos = ceil((fvar(0)+fvar(1))/(2**0.5)),ceil(-50+(-fvar(0)+fvar(1))/(2**0.5))

[state 12050, 広がり]
type = bindtoroot
triggerall = time >= 0
trigger1 = ishelper(12058)
trigger2 = ishelper(12059)
trigger3 = ishelper(12060)
trigger4 = ishelper(12061)
trigger5 = ishelper(12062)
trigger6 = ishelper(12063)
trigger7 = ishelper(12064)
trigger8 = ishelper(12065)
facing = 0
pos = ceil((fvar(1)+fvar(0))/(2**0.5)),ceil(-50+(-fvar(1)+fvar(0))/(2**0.5))

[state 12102, 角度]
type = angleset
trigger1 = time > 0
value = ifelse(var(1) = 1,(time+var(0))*180/30+45,-(time+var(0))*180/30-45)

[state 12050, 角度実行]
type = angledraw
trigger1 = 1
scale = 0.4,0.4

[state 12050, ]
type = sprpriority
trigger1 = var(1) = 1
value = ifelse(fvar(1) > 0,8,-2)

[state 12050, ]
type = sprpriority
trigger1 = var(1) = -1
value = ifelse(fvar(1) < 0,8,-2)

[state 12050, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12050, 攻撃設定]
type = hitdef
trigger1 = time = 0
attr = A,HP
damage = ceil((root,fvar(10)*25)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),5
getpower = 20,10
hitflag = MAF
guardflag = MA
animtype = medium
priority = 5,hit
pausetime = 0,10
hitsound = -1;S0,6
guardsound = S2,0
sparkno = S20075
sparkxy = 0,0
ground.slidetime = 3
ground.hittime = 15
ground.velocity = -2,-4
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -2
air.velocity = -2,-4
fall = 1
fall.recover = 1
fall.recovertime = 60

[state 325, ]
type = playsnd
trigger1 = movehit = 1
value = 0,8
channel = 1

[state 12050, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(50*root,fvar(10)),5)
ignorehitpause = 1
persistent = 0

[state 12050, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.94
ignorehitpause = 1
persistent = 0

[state 12050, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12050, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12050, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-14-(enemynear,const(size.ground.front)), 14+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-12, 12-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 10330, ハート1]
type = projectile
triggerall = time = var(10)
trigger1 = ishelper(12050)
trigger2 = ishelper(12051)
trigger3 = ishelper(12052)
trigger4 = ishelper(12053)
trigger5 = ishelper(12054)
trigger6 = ishelper(12055)
trigger7 = ishelper(12056)
trigger8 = ishelper(12057)
projID = 11043
projanim = 11047+ceil((random+1)/400)
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 10330, ハート2]
type = projectile
triggerall = time = var(10)
trigger1 = ishelper(12050)
trigger2 = ishelper(12051)
trigger3 = ishelper(12052)
trigger4 = ishelper(12053)
trigger5 = ishelper(12054)
trigger6 = ishelper(12055)
trigger7 = ishelper(12056)
trigger8 = ishelper(12057)
projID = 11043
projanim = 11047+ceil((random+1)/400)
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 10330, ハート3]
type = projectile
triggerall = time = var(10)
trigger1 = ishelper(12050)
trigger2 = ishelper(12051)
trigger3 = ishelper(12052)
trigger4 = ishelper(12053)
trigger5 = ishelper(12054)
trigger6 = ishelper(12055)
trigger7 = ishelper(12056)
trigger8 = ishelper(12057)
projID = 11043
projanim = 11047+ceil((random+1)/400)
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 10330, ハート1]
type = projectile
triggerall = time = var(10)
trigger1 = ishelper(12058)
trigger2 = ishelper(12059)
trigger3 = ishelper(12060)
trigger4 = ishelper(12061)
trigger5 = ishelper(12062)
trigger6 = ishelper(12063)
trigger7 = ishelper(12064)
trigger8 = ishelper(12065)
projID = 11043
projanim = 11044+ceil((random+1)/400)
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 10330, ハート2]
type = projectile
triggerall = time = var(10)
trigger1 = ishelper(12058)
trigger2 = ishelper(12059)
trigger3 = ishelper(12060)
trigger4 = ishelper(12061)
trigger5 = ishelper(12062)
trigger6 = ishelper(12063)
trigger7 = ishelper(12064)
trigger8 = ishelper(12065)
projID = 11043
projanim = 11044+ceil((random+1)/400)
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 10330, ハート3]
type = projectile
triggerall = time = var(10)
trigger1 = ishelper(12058)
trigger2 = ishelper(12059)
trigger3 = ishelper(12060)
trigger4 = ishelper(12061)
trigger5 = ishelper(12062)
trigger6 = ishelper(12063)
trigger7 = ishelper(12064)
trigger8 = ishelper(12065)
projID = 11043
projanim = 11044+ceil((random+1)/400)
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12050, ヘルパーを消す]
type = destroyself
trigger1 = time > var(10)





;===============================================================================
;ご先祖まき
;===============================================================================
[statedef 2060]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2060

[state 2060, 暗転]
type = superpause
trigger1 = animelem = 3
anim = -1
sound = S4,0
time = 43
poweradd = -1000
movetime = 0
darken = 0

[state 2060, スペカ名]
type = helper
trigger1 = animelem = 3
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2060, 魔方陣eff]
type = helper
trigger1 = animelem = 3
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2060, 幽霊]
type = helper
triggerall = animelem = 6
trigger1 = numhelper(11040) < 4
name = "yuurei"
stateno = 11040
pos = 40, -90
postype = p1
ownpal = 1
size.xscale = 0.75
size.yscale = 0.75
ID = 11040

[state 2060, 幽霊]
type = helper
triggerall = animelem = 6
trigger1 = numhelper(11040) < 5
name = "yuurei"
stateno = 11040
pos = 40, -90
postype = p1
ownpal = 1
size.xscale = 0.75
size.yscale = 0.75
ID = 11040

[state 2060, 幽霊]
type = helper
trigger1 = animelem = 6
trigger1 = numhelper(11040) < 6
name = "yuurei"
stateno = 11040
pos = 40, -90
postype = p1
ownpal = 1
size.xscale = 0.75
size.yscale = 0.75
ID = 11040

[state 2060, 幽霊]
type = helper
trigger1 = animelem = 6
trigger1 = numhelper(11040) < 7
name = "yuurei"
stateno = 11040
pos = 40, -90
postype = p1
ownpal = 1
size.xscale = 0.75
size.yscale = 0.75
ID = 11040

[state 2060, 幽霊]
type = helper
trigger1 = animelem = 6
trigger1 = numhelper(11040) < 8
name = "yuurei"
stateno = 11040
pos = 40, -90
postype = p1
ownpal = 1
size.xscale = 0.75
size.yscale = 0.75
ID = 11040

[state 2060, se]
type = playsnd
trigger1 = animelem = 6
value = 1, 5

[state 2060, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1



;===============================================================================
;夢枕にご先祖総立ち
;===============================================================================
[statedef 2070]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2070

[state 2070, 暗転]
type = superpause
trigger1 = animelem = 5
anim = -1
sound = S4,0
time = 43
poweradd = -2000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2070, スペカ名]
type = helper
trigger1 = animelem = 5
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2070, 魔方陣eff]
type = helper
trigger1 = animelem = 5
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2070, se]
type = playsnd
trigger1 = animelem = 6
value = 1, 6

[state 2070, 爆発]
type = helper
trigger1 = animelem = 6
name = "hikari"
stateno = 10420
pos = 24, -93
postype = p1
ownpal = 1
ID = 11049

[state 2070, 憑依ヘルパー1]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 1
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11041
;persistent = 0

[state 2070, 憑依ヘルパー2]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 2
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11042
;persistent = 0

[state 2070, 憑依ヘルパー3]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 3
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11043
;persistent = 0

[state 2070, 憑依ヘルパー4]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 4
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11044
;persistent = 0

[state 2070, 憑依ヘルパー5]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 5
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11045
;persistent = 0

[state 2070, 憑依ヘルパー6]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 6
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11046
;persistent = 0

[state 2070, 憑依ヘルパー7]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 7
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11047
;persistent = 0

[state 2070, 憑依ヘルパー8]
type = helper
trigger1 = animelem = 7
trigger1 = var(2) >= 8
name = "gosenzohyoui"
stateno = 12072
postype = p1
pos = 0,0
ownpal = 0
ID = 11048
;persistent = 0

[state 2070, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1



;-------------------------------------------------------------------------------
;夢枕にご先祖総立ちの爆発
[statedef 12070]
type = A
movetype = A
physics = N
anim = 12070
ctrl = 0

[state 12070,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -25,p2dist x,0)+ifelse(p2dist x > 25,25-p2dist x,0)
trigger1 = fvar(13) := 0

[state 12070, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

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

[state 12070,透過 ]
type = trans
trigger1 = time >= 0
trans = addalpha
alpha = 256-ceil(time*17.1),256

[state 12070,拡大]
type = angledraw
trigger1 = 1
scale = 0.2*time+0.1,0.2*time+0.1

[state 12070, 攻撃設定]
type = hitdef
trigger1 = time = 0
attr = A,SP
damage = ceil((root,fvar(10)*55)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),25
getpower = 35,20
hitflag = MAFP
guardflag = MA
animtype = back
priority = 4,hit
pausetime = 0,9
hitsound = S0,2
guardsound = S2,0
sparkno = S20060
;sparkxy = -10, -58
ground.slidetime = 5
ground.hittime = 40
ground.velocity = -2,-6
guard.hittime = 40
ground.ctrltime = 40
guard.velocity = -2
air.velocity = -3,-6
fall = 1
fall.recovertime = 30

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*root,fvar(10)),25)
ignorehitpause = 1
persistent = 0

[state 12070, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.85
ignorehitpause = 1
persistent = 0

[state 12070, 憑依数管理]
type = parentvaradd
trigger1 = (root,var(8) & (1023)) / (1) = 0
trigger1 = movehit = 1
trigger2 = (root,var(8) & (1023)) / (1) > 0
trigger2 = movecontact = 1
var(2) = 1
ignorehitpause = 1

[state 12070, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12070
anim = 20060
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 12070, ハート1]
type = projectile
trigger1 = time = 0
projID = 11043
projanim = 11044+ceil((random+1)/200)
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12070, ハート2]
type = projectile
trigger1 = time = 0
projID = 11043
projanim = 11044+ceil((random+1)/200)
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12070, ハート3]
type = projectile
trigger1 = time = 0
projID = 11043
projanim = 11044+ceil((random+1)/200)
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12070, 飛び道具だけにあたる]
type = nothitby
trigger1 = 1
value = ,AA,AT

[state 12070,消す]
type = destroyself
trigger1 = time = 15

[state 12070, ヘルパー相殺1]
type = hitoverride
trigger1 = 1
attr = SCA,AP
stateno = 11047
time = -1

[state 12070, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12070, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12070, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-25-(enemynear,const(size.ground.front)), 25+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-25, 25-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12070, グレイズ]
type = changestate
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-25-(enemynear,const(size.ground.front)), 25+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-25, 25-(enemynear,const(size.head.pos.y))]
value = 12071


[statedef 12071];ヘルパー相殺2
type = A
movetype = I
physics = N
ctrl = 0

[state 12071, ヘルパーを消す2]
type = destroyself
trigger1 = 1



;-------------------------------------------------------------------------------
;自分憑依
[statedef 12072]
type = A
movetype = I
physics = N
anim = 11041
ctrl = 0
sprpriority = 5

[state 12072, 位置決め変数]
type = varset
trigger1 = time = 0
var(2) = parent,var(2)

[state 12072, 表示優先度決め変数1]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11041)
fvar(2) = 3*time*pi/180

[state 12072, 表示優先度決め変数2]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11042)
fvar(2) = (3*time+360/var(2))*pi/180

[state 12072, 表示優先度決め変数3]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11043)
fvar(2) = (3*time+360/var(2)*2)*pi/180

[state 12072, 表示優先度決め変数4]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11044)
fvar(2) = (3*time+360/var(2)*3)*pi/180

[state 12072, 表示優先度決め変数5]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11045)
fvar(2) = (3*time+360/var(2)*4)*pi/180

[state 12072, 表示優先度決め変数6]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11046)
fvar(2) = (3*time+360/var(2)*5)*pi/180

[state 12072, 表示優先度決め変数7]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11047)
fvar(2) = (3*time+360/var(2)*6)*pi/180

[state 12072, 表示優先度決め変数8]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(11048)
fvar(2) = (3*time+360/var(2)*7)*pi/180

[state 12072, ]
type = angledraw
trigger1 = 1
scale = 0.5,0.5

[state 12072, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12072, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

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

[state 12072, 憑依]
type = bindtoroot
trigger1 = 1
facing = 1
pos = ceil(35*cos(fvar(2))),ceil(root,const(size.mid.pos.y))

[state 12072, 表]
type = sprpriority
trigger1 = sin(fvar(2)) > 0
value = 5

[state 12072, 裏]
type = sprpriority
trigger1 = sin(fvar(2)) < 0
value = -1

[state 12072, 憑依数管理]
type = parentvarset
trigger1 = time = 600
var(2) = 0

[state 12072, 消滅]
type = destroyself
trigger1 = time = 600
;trigger2 = root,stateno = [5000,5150]

[state 12072, 回復へ]
type = changestate
trigger1 = root,stateno = 420
trigger1 = root,animelem = 6
value = 12073



;-------------------------------------------------------------------------------
;回復
[statedef 12073]
type = A
movetype = I
physics = N
anim = 11042
ctrl = 0

[state 12073,影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12073,透過 ]
type = trans
trigger1 = time >= 0
trans = addalpha
alpha = 256-ceil(time*17.1),256

[state 12073,拡大]
type = angledraw
trigger1 = 1
scale = 0.2*time+0.1,0.2*time+0.1

[state 12073, ハート1]
type = projectile
trigger1 = time = 0
projID = 11043
projanim = 11044+ceil((random+1)/200)
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12073, ハート2]
type = projectile
trigger1 = time = 0
projID = 11043
projanim = 11044+ceil((random+1)/200)
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12073, ハート3]
type = projectile
trigger1 = time = 0
projID = 11043
projanim = 11044+ceil((random+1)/200)
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 5

[state 12073,消す]
type = destroyself
trigger1 = time = 15



;===============================================================================
;胎児の夢
;===============================================================================
[statedef 2080]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2080

[state 2080, ]
type = null;statetypeset
trigger1 = pos y < -10
statetype = A
movetype = A
physics = A
ignorehitpause = 1

[state 2080, 暗転]
type = superpause
trigger1 = anim = 2080
trigger1 = animelem = 5
anim = -1
sound = S4,0
time = 43
poweradd = -3000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2080, スペカ名]
type = helper
trigger1 = anim = 2080
trigger1 = animelem = 5
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2080, 魔方陣eff]
type = helper
trigger1 = anim = 2080
trigger1 = animelem = 5
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2080, 魔方陣]
type = helper
trigger1 = anim = 2080
trigger1 = animelem = 6
name = "spell2"
stateno = 12084
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
supermovetime = 200

[state 2080, ]
type = varadd
trigger1 = var(7) < 4
trigger1 = (var(8) & (1023)) / (1) = 0
var(7) = 1
persistent = 0

;[state 2080, イドスイッチ]
;type = null;varset
;trigger1 = time = 2
;trigger1 = (var(8) & (1023)) / (1) > 0
;var(7) = 4

[state 2080, テスト用スイッチ]
type = null;varset
trigger1 = time = 1
var(7) = 4

[state 2080, ]
type = changeanim
trigger1 = anim = 2080
trigger1 = animelem = 7
value = 2081

[state 2080, ]
type = trans
trigger1 = anim = 2081
trans = addalpha
alpha = 128,128
ignorehitpause = 1

[state 2080, ]
type = nothitby
trigger1 = anim = 2081
trigger2 = anim = 2080
trigger2 = animelem = 6,>=0
value = SCA

[state 2080, ]
type = changeanim
triggerall = anim = 2081
trigger1 = var(7) = 1
trigger1 = time = 50+28+20
trigger2 = var(7) = 2
trigger2 = time = 96+28+30
trigger3 = var(7) = 3
trigger3 = time = 110+28+30
trigger4 = var(7) = 4
trigger4 = time = 120+28+30
value = 2082

[state 2080, ステート変更]
type = changestate
triggerall = statetype = S
trigger1 = anim = 2082
trigger1 = animtime = 0
value = 0
ctrl = 1

[state 2080, ステート変更]
type = null;changestate
triggerall = statetype = A
trigger1 = anim = 2082
trigger1 = animtime = 0
value = 50
ctrl = 0


;演出-----------------------------------------------------------------
;きもいの---------------------------------------------
[state 2080, きもい物体]
type = helper
triggerall = anim = 2081
trigger1 = animelem = 1
;trigger2 = var(7) = 4
;trigger2 = time = 110
name = "cell"
stateno = 12083
pos = 0,-50
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12094
persistent = 0

[state 2080, きもい物体]
type = helper
triggerall = anim = 2081
trigger1 = animelem = 1
;trigger2 = var(7) = 4
;trigger2 = time = 110
name = "cell"
stateno = 12083
pos = 0,-50
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12095
persistent = 0

[state 2080, きもい物体]
type = helper
triggerall = anim = 2081
;trigger1 = var(7) = 1
trigger1 = animelem = 1
;trigger2 = var(7) = 4
;trigger2 = time = 110
name = "cell"
stateno = 12083
pos = 0,-50
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12096
persistent = 0


;魚祭り-----------------------------------------------
[state 2080, 魚]
type = helper
triggerall = anim = 2081
trigger1 = var(7) >= 2
trigger1 = time%6 = 0
trigger1 = time <= 96
;trigger2 = var(7) = 4
;trigger2 = time%9 = 0
;trigger2 = time <= 96+28
name = "fish"
stateno = 12081
pos = 0,0
ownpal = 1
size.xscale = 0.6
size.yscale = 0.6
ID = 12081


;ゼンマイ祭り-----------------------------------------
[state 2080, g1]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 1
name = "zenmai"
stateno = 12082
pos = 20,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12082
persistent = 0

[state 2080, g2]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 5
name = "zenmai"
stateno = 12082
pos = 160,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12083
persistent = 0

[state 2080, g3]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 9
name = "zenmai"
stateno = 12082
pos = 300,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12084
persistent = 0

[state 2080, g-1]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 1
name = "zenmai"
stateno = 12082
pos = -20,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12085
persistent = 0

[state 2080, g-2]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 5
name = "zenmai"
stateno = 12082
pos = -160,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12086
persistent = 0

[state 2080, g-3]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 9
name = "zenmai"
stateno = 12082
pos = -300,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12087
persistent = 0

[state 2080, a1]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 3
name = "zenmai"
stateno = 12082
pos = 90,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12088
persistent = 0

[state 2080, a2]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 7
name = "zenmai"
stateno = 12082
pos = 230,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12089
persistent = 0

[state 2080, a3]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 11
name = "zenmai"
stateno = 12082
pos = 370,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12090
persistent = 0

[state 2080, a-1]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 3
name = "zenmai"
stateno = 12082
pos = -90,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12091
persistent = 0

[state 2080, a-2]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 7
name = "zenmai"
stateno = 12082
pos = -230,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12092
persistent = 0

[state 2080, a-3]
type = helper
trigger1 = var(7) >= 3
trigger1 = anim = 2081
trigger1 = animelem = 11
name = "zenmai"
stateno = 12082
pos = -370,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12093
persistent = 0



;レーザー---------------------------------------------
[state 2080, レーザー]
type = helper
triggerall = anim = 2081
trigger1 = var(7) = 4
trigger1 = time%10 = 0
trigger1 = time <= 140
;trigger2 = var(7) = 4
;trigger2 = time%9 = 0
;trigger2 = time <= 96+28
name = "laser"
stateno = 12085
pos = -10,0
postype = back
ownpal = 1
size.xscale = 1
size.yscale = 1
ID = 12081


;きもいの-----------------------------------------------------------------------
[statedef 12083]
type = A
movetype = I
physics = N
anim = 12084
ctrl = 0
sprpriority = 7

[state 12083, イド時時間設定]
type = varset
trigger1 = time = 0
trigger1 = root,stateno = 2168
var(5) = 1500

[state 12080, ]
type = playsnd
trigger1 = time = 0
value = 1,3

[state 12083, 角度]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(12094)
var(0) = 0

[state 12083, 角度]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(12095)
var(0) = 40

[state 12083, 角度]
type = varset
trigger1 = time >= 0
trigger1 = ishelper(12096)
var(0) = 80

[state 12083, ]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12083, キラキラ]
type = projectile
trigger1 = time%6 = 0
projID = 12083
projanim = 12086
projscale = 0.2,0.2
projremovetime = 20
velocity = 0,0
offset = (random+1-500)*0.02,(random+1-500)*0.02
projsprpriority = 6

[state 12083, キラキラ]
type = projectile
trigger1 = time%6 = 3
projID = 12084
projanim = 12086
projscale = 0.2,0.2
projremovetime = 20
velocity = 0,0
offset = (random+1-500)*0.02,(random+1-500)*0.02
projsprpriority = 6

[state 12083, 広がり]
type = bindtoroot
trigger1 = time <= 50
facing = 0
pos = ceil(time*cos((time+var(0))*pi/60)),ceil(-50-time*sin((time+var(0))*pi/60))

[state 12083, 憑依]
type = bindtoroot
trigger1 = time > 50
facing = 0
pos = ceil(50*cos((time+var(0))*pi/60)),ceil(-50-50*sin((time+var(0))*pi/60))

[state 12083, 米拡散なし]
type = varset
trigger1 = var(2) >= 70
;trigger1 = var(1) = 0
;trigger2 = var(1) = 2
;trigger3 = var(1) = 4
;trigger1 = root,movetype != H
var(2) = 0

[state 12083, 拡散開始]
type = varadd
trigger1 = var(1) = 1
trigger2 = var(1) = 3
trigger3 = var(1) = 5
var(2) = 1

[state 12083, スイッチ]
type = varadd
triggerall = root,movetype != H
triggerall = var(2) >= 70
trigger1 = var(1) = 1
trigger2 = var(1) = 3
trigger3 = var(1) = 5
var(1) = 1

[state 12083, １個目]
type = varset
trigger1 = root,movetype = H
var(1) = 1
persistent = 0

[state 12083, ２個目]
type = varset
trigger1 = root,movetype = H
trigger1 = var(1) = 2
trigger1 = ishelper(12094) = 0
trigger1 = var(2) = 0
var(1) = 3
persistent = 0

[state 12083, ３個目]
type = varset
trigger1 = root,movetype = H
trigger1 = var(1) = 4
trigger1 = ishelper(12095) = 0
trigger1 = var(2) = 0
var(1) = 5
persistent = 0

[state 12083, ]
type = null;trans
trigger1 = var(1) >= 1
trigger1 = ishelper(12094)
trigger2 = var(1) >= 3
trigger2 = ishelper(12095)
trigger3 = var(1) >= 5
trigger3 = ishelper(12096)
trans = addalpha
alpha = 0,256

[state 12083, ]
type = playsnd
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger2 = var(1) = 3
trigger3 = var(1) = 5
value = 2,14
volume = -100

[state 12083, 米1]
type = helper
triggerall = root,movetype = H
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger1 = ishelper(12094)
trigger2 = var(1) = 3
trigger2 = ishelper(12095)
trigger3 = var(1) = 5
trigger3 = ishelper(12096)
name = "rice"
stateno = 12080
pos = 0,0
ownpal = 1
size.xscale = 0.2
size.yscale = 0.2
ID = 12097

[state 12083, 米2]
type = helper
triggerall = root,movetype = H
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger1 = ishelper(12094)
trigger2 = var(1) = 3
trigger2 = ishelper(12095)
trigger3 = var(1) = 5
trigger3 = ishelper(12096)
name = "rice"
stateno = 12080
pos = 0,0
ownpal = 1
size.xscale = 0.2
size.yscale = 0.2
ID = 12098

[state 12083, 米3]
type = helper
triggerall = root,movetype = H
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger1 = ishelper(12094)
trigger2 = var(1) = 3
trigger2 = ishelper(12095)
trigger3 = var(1) = 5
trigger3 = ishelper(12096)
name = "rice"
stateno = 12080
pos = 0,0
ownpal = 1
size.xscale = 0.2
size.yscale = 0.2
ID = 12099

[state 12083, 米4]
type = helper
triggerall = root,movetype = H
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger1 = ishelper(12094)
trigger2 = var(1) = 3
trigger2 = ishelper(12095)
trigger3 = var(1) = 5
trigger3 = ishelper(12096)
name = "rice"
stateno = 12080
pos = 0,0
ownpal = 1
size.xscale = 0.2
size.yscale = 0.2
ID = 12100

[state 12083, 米5]
type = helper
triggerall = root,movetype = H
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger1 = ishelper(12094)
trigger2 = var(1) = 3
trigger2 = ishelper(12095)
trigger3 = var(1) = 5
trigger3 = ishelper(12096)
name = "rice"
stateno = 12080
pos = 0,0
ownpal = 1
size.xscale = 0.2
size.yscale = 0.2
ID = 12101

[state 12083, 米6]
type = helper
triggerall = root,movetype = H
triggerall = var(2) = 0
trigger1 = var(1) = 1
trigger1 = ishelper(12094)
trigger2 = var(1) = 3
trigger2 = ishelper(12095)
trigger3 = var(1) = 5
trigger3 = ishelper(12096)
name = "rice"
stateno = 12080
pos = 0,0
ownpal = 1
size.xscale = 0.2
size.yscale = 0.2
ID = 12102

[state 12083,透過 ]
type = trans
trigger1 = var(5) = 0
trigger1 = time >= 600*(root,var(7)*0.6)-16 ;704
trans = addalpha
alpha = 256-ceil((time -600*(root,var(7)*0.6))*16),256

[state 12083, ]
type = destroyself
triggerall = ishelper(12080) = 0
trigger1 = var(5) = 0
trigger1 = time = 600*(root,var(7)*0.6)
trigger2 = ishelper(12094)
trigger2 = var(1) = 1
trigger3 = ishelper(12095)
trigger3 = var(1) = 3
trigger4 = ishelper(12096)
trigger4 = var(1) = 5
trigger5 = root,stateno = 2080
trigger5 = root,anim = 2080
trigger5 = root,animelem = 6
trigger6 = var(1) > 0
trigger6 = time = var(5)
trigger7 = root,stateno = 2167



;米設定-------------------------------------------
[statedef 12080]
type = A
movetype = A
physics = N
anim = 12080
ctrl = 0
sprpriority = 5

[state 12080, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12080, 速度向き]
type = null
trigger1 = ishelper(12097)
trigger1 = var(1) := 0
trigger2 = ishelper(12098)
trigger2 = var(1) := 60
trigger3 = ishelper(12099)
trigger3 = var(1) := 120
trigger4 = ishelper(12100)
trigger4 = var(1) := 180
trigger5 = ishelper(12101)
trigger5 = var(1) := 240
trigger6 = ishelper(12102)
trigger6 = var(1) := 300

[state 12080, 速度]
type = varset
trigger1 = time = 0
var(2) = 3

[state 12080, 速度設定]
type = velset
trigger1 = time = 1
x = var(2)*cos(var(1)*pi/180)
y = -var(2)*sin(var(1)*pi/180)

[state 12080, 減速]
type = veladd
trigger1 = vel x != 0
trigger1 = vel y != 0
x = -0.1*cos(var(1)*pi/180)
y = 0.1*sin(var(1)*pi/180)

[state 12080, 減速]
type = veladd
trigger1 = vel x = 0
trigger1 = vel y != 0
x = 0
y = 0.1*sin(var(1)*pi/180)

[state 12080, 減速]
type = veladd
trigger1 = vel x != 0
trigger1 = vel y = 0
x = -0.1*cos(var(1)*pi/180)
y = 0

[state 12080, ]
type = velset
trigger1 = time = 30
x = 0
y = 0

[state 12080, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12080, 向き]
type = angleset
trigger1 = vel y != 0
trigger1 = vel x != 0
trigger1 = atan(-vel y/vel x)*180/pi != 0
value = atan(-vel y/vel x)*180/pi

[state 12080, 向き]
type = angleset
trigger1 = vel y = 0
trigger1 = vel x != 0
trigger2 = vel y = 0
trigger2 = vel x = 0
value = 0

[state 12080, 向き]
type = angleset
trigger1 = vel y != 0
trigger1 = vel x = 0
value = 90

[state 12080, 向き実行]
type = angledraw
trigger1 = 1

[state 12080, 攻撃設定]
type = hitdef
trigger1 = anim = 12080
attr = A,SP
damage = ceil((root,fvar(10)*6)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),1
getpower = 10,1
hitflag = MAF
guardflag = MA
animtype = hard
priority = 4,hit
pausetime = 0,3
hitsound = S0,4
guardsound = S2,0
sparkno = S20060
;sparkxy = -10, -58
ground.slidetime = 10
ground.hittime = 10
ground.velocity = -2,0
guard.hittime = 10
ground.ctrltime = 10
guard.velocity = -1
air.velocity = -2,-2
persistent = 0

[state 12080, 攻撃設定]
type = hitdef
trigger1 = anim = 12085
attr = A,SP
damage = ceil((root,fvar(10)*6)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),1
getpower = 10,1
hitflag = MAF
guardflag = MA
animtype = hard
priority = 4,hit
pausetime = 0,3
hitsound = S0,4
guardsound = S2,0
sparkno = S20060
;sparkxy = -10, -58
ground.slidetime = 10
ground.hittime = 10
ground.velocity = -2,0
guard.hittime = 10
ground.ctrltime = 10
guard.velocity = -1
air.velocity = -2,-2
persistent = 0

[state 12120, ダメージ格納]
type = null;parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(6*root,fvar(10)),1)
ignorehitpause = 1
persistent = 0

[state 12080, 補正]
type = null;parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.95
ignorehitpause = 1
persistent = 0

[state 12080, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12080, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12080, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-10-(enemynear,const(size.ground.front)), 10+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-10, 10-(enemy,const(size.head.pos.y))]
value = 3, 2

[state 12080, 爆発]
type = changeanim
trigger1 = time > 0
trigger1 = vel x = 0
trigger1 = vel y = 0
value = 12085
persistent = 0

[state 12080, ]
type = playsnd
trigger1 = ishelper(12097)
trigger1 = anim = 12085
value = 2,15
volume = -100
persistent = 0

[state 12080, ]
type = destroyself
trigger1 = anim = 12085
trigger1 = animtime = 0



;魚祭り-------------------------------------------------------------------------
[statedef 12081]
type = A
movetype = A
physics = N
anim = 12081
ctrl = 0
sprpriority = 5

[state 12081, ]
type = posset
trigger1 = time = 0
trigger1 = root,statetype = A
y = 0

[state 12081,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -13,p2dist x,0)+ifelse(p2dist x > 10,10-p2dist x,0)
trigger1 = fvar(13) := 0

[state 12081, ]
type = playsnd
trigger1 = time = 0
value = 2,11

[state 12081, ]
type = playsnd
trigger1 = vel y > 0
trigger1 = pos y >= 0
value = 2,12

[state 12081, 複数ヒット]
type = varset
trigger1 = time = 0
trigger2 = var(1) != 0
trigger2 = pos y >= 0
var(1) = 0

[state 12081, ]
type = varadd
trigger1 = movecontact = 1
var(1) = 1

[state 12081, 速度設定]
type = velset
trigger1 = time = 0
x = 3+4*(random+1)/1000
y = -5-3*(random+1)/1000

[state 12081, 速度設定（当身）]
type = velset
trigger1 = ishelper(1036)
trigger1 = time = 0
x = 3+2*(random+1)/1000
y = -5-3*(random+1)/1000

[state 12081, 重力加算]
type = veladd
trigger1 = pos y < 0
y = 0.2

[state 12081, 跳ねる]
type = velset
trigger1 = vel y > 0
trigger1 = pos y >= 0
y = -vel y

[state 12081, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12081, 向き]
type = angleset
trigger1 = atan(-vel y/vel x)*180/pi != 0
value = atan(-vel y/vel x)*180/pi

[state 12081, 向き]
type = angleset
trigger1 = vel y = 0
value = 0

[state 12081, 向き実行]
type = angledraw
trigger1 = 1

[state 12081, 攻撃設定（当身）]
type = hitdef
trigger1 = ishelper(1036)
trigger1 = var(1) = 0
attr = A,HP
damage = ceil((root,fvar(10)*30)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = ifelse((root,var(8) & (1023)) / (1) > 0,50,25),12
hitflag = MAFDP
guardflag = MA
animtype = back
priority = 4,hit
pausetime = 1,0
hitsound = S0,5
guardsound = S2,0
sparkno = S20060
;sparkxy = -10, -58
ground.slidetime = 5
ground.hittime = 40
ground.velocity = -3,0
guard.hittime = 10
ground.ctrltime = 10
guard.velocity = -2
air.velocity = -1,-1

[state 12081, 攻撃設定]
type = hitdef
trigger1 = ishelper(12081)
trigger1 = var(1) = 0
attr = A,SP
damage = ceil((root,fvar(10)*35)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),5
getpower = 10,7
hitflag = MAFD
guardflag = MA
animtype = back
priority = 4,hit
pausetime = 1,0
hitsound = S0,5
guardsound = S2,0
sparkno = S20060
;sparkxy = -10, -58
ground.slidetime = 5
ground.hittime = 40
ground.velocity = -2,0
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -1.5
air.velocity = -1,-1

[state 12120, ダメージ格納（当身）]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
triggerall = ishelper(1036)
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(35*root,fvar(10)),10)
ignorehitpause = 1
persistent = 0

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
triggerall = ishelper(12081)
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*root,fvar(10)),5)
ignorehitpause = 1
persistent = 0

[state 12081, 補正]
type = parentvarset
trigger1 = movehit = 1
trigger1 = ishelper(12081)
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 1
persistent = 0

[state 12081, 補正（当身）]
type = parentvarset
trigger1 = movehit = 1
trigger1 = ishelper(1036)
fvar(10) = root,fvar(10)*0.88
ignorehitpause = 1
persistent = 0

[state 12081, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12081
anim = 20075
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 12081, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12081, 消す]
type = destroyself
trigger1 = screenpos x < 0
trigger2 = screenpos x > 340


[state 12081, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12081, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12081, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-13-(enemynear,const(size.ground.front)), 10+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-9, 7-(enemy,const(size.head.pos.y))]
value = 3, 2


;ゼンマイ祭り-------------------------------------------------------------------
[statedef 12082]
type = A
movetype = A
physics = N
anim = 12082
ctrl = 0
sprpriority = 5

[state 12082, ]
type = posset
triggerall = time = 0
triggerall = root,statetype = A
trigger1 = ishelper(12082)
trigger2 = ishelper(12083)
trigger3 = ishelper(12084)
trigger4 = ishelper(12085)
trigger5 = ishelper(12086)
trigger6 = ishelper(12087)
y = 0

[state 12082, ]
type = posadd
triggerall = time = 0
triggerall = root,statetype = A
trigger1 = ishelper(12088)
trigger2 = ishelper(12089)
trigger3 = ishelper(12090)
trigger4 = ishelper(12091)
trigger5 = ishelper(12092)
trigger6 = ishelper(12093)
y = -root,pos y

[state 12082, 反転]
type = turn
triggerall = time = 0
trigger1 = ishelper(12085)
trigger2 = ishelper(12086)
trigger3 = ishelper(12087)
trigger4 = ishelper(12088)
trigger5 = ishelper(12089)
trigger6 = ishelper(12090)
trigger7 = ishelper(11032);当身

[state 12082, アニメ変更]
type = changeanim
triggerall = time = 0
trigger1 = ishelper(12088)
trigger2 = ishelper(12089)
trigger3 = ishelper(12090)
trigger4 = ishelper(12091)
trigger5 = ishelper(12092)
trigger6 = ishelper(12093)
value = 12083

[state 12082,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := ifelse(p2dist x > -17,p2dist x,0)+ifelse(p2dist x > 55,55-p2dist x,0)
trigger1 = fvar(13) := ifelse(p2dist y <= 0,p2dist y+ enemy,const(size.mid.pos.y),0)

[state 12082, ]
type = playsnd
trigger1 = time = 0
value = 1,8

[State 12082, 当身ヒット定義]
type = HitDef
triggerall = time = 0
trigger1 = root,stateno = 1031
;triggerall = anim = 12082
;trigger1 = ishelper(11031)
;trigger2 = ishelper(11032)
attr = S, HP 
damage = ceil((root,fvar(10)*40)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))), 10
getpower = ifelse((root,var(8) & (1023)) / (1) > 0,60,30), 18
animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 3, 2
sparkno = -1;S20065
sparkxy = -1;-10,-50
hitsound = S0,6
guardsound = S2,0
ground.type = High
fall = 1
fall.recovertime = 40
ground.slidetime = 10
ground.hittime  = 60
air.hittime = 60
ground.velocity = 0, -12
guard.velocity = -3
air.velocity = 0,-12
ground.ctrltime = 15
guard.ctrltime = 15
airguard.velocity = -2,-2
ground.cornerpush.veloff = 0

[State 12082, gゼンマイのヒット定義]
type = HitDef
triggerall = time = 0
trigger1 = root,stateno = 2080
trigger1 = anim = 12082
trigger2 = root,stateno = 2168
attr = S, SP 
damage = ceil((root,fvar(10)*60)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))), 15
getpower = 15, 8
animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 3, 2
sparkno = -1;S20065
sparkxy = -1;-10,-50
hitsound = S0,6
guardsound = S2,0
ground.type = High
fall = 1
fall.recovertime = 40
ground.slidetime = 10
ground.hittime  = 60
air.hittime = 60
ground.velocity = -6, -8
guard.velocity = -10
air.velocity = -6,-1
ground.ctrltime = 15
guard.ctrltime = 15
airguard.velocity = -2,-2
ground.cornerpush.veloff = 0

[State 12082, aゼンマイのヒット定義]
type = HitDef
triggerall = time = 0
trigger1 = root,stateno = 2080
trigger1 = anim = 12083
trigger2 = root,stateno = 2168
attr = S, SP 
damage = ceil((root,fvar(10)*60)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))), 15
getpower = 15, 8
animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 3, 2
sparkno = -1;S20065
sparkxy = -1;-10,-50
hitsound = S0,6
guardsound = S2,0
ground.type = High
fall = 1
fall.recovertime = 40
ground.slidetime = 10
ground.hittime  = 60
air.hittime = 60
ground.velocity = 6, -8
guard.velocity = 10
air.velocity = 6,-1
ground.ctrltime = 15
guard.ctrltime = 15
airguard.velocity = 2,0
ground.cornerpush.veloff = 0

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
triggerall = ishelper(11031)
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(50*root,fvar(10)),10)
ignorehitpause = 1
persistent = 0

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
triggerall = ishelper(11032)
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(50*root,fvar(10)),10)
ignorehitpause = 1
persistent = 0

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
triggerall = anim = 12082
triggerall != ishelper(11031)
triggerall != ishelper(11032)
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(100*root,fvar(10)),15)
ignorehitpause = 1
persistent = 0

[state 12120, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
triggerall = anim = 12083
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(100*root,fvar(10)),15)
ignorehitpause = 1
persistent = 0

[state 12082, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.95
ignorehitpause = 1
persistent = 0

[state 12082, 当身補正]
type = parentvarset
trigger1 = movehit = 1
trigger1 = ishelper(11031)
trigger1 = ishelper(11032)
fvar(10) = root,fvar(10)*0.88
ignorehitpause = 1
persistent = 0

[state 12082, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12082
anim = 20065
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 12082, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12082, 消す]
type = destroyself
trigger1 = time = 56


[state 12082, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12082, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12082, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-17-(enemynear,const(size.ground.front)), 55+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-161, 4-(enemy,const(size.head.pos.y))]
value = 3, 2



;背景魔方陣---------------------------------------------------------------------
[statedef 12084]
type = A
movetype = I
physics = N
anim = 12087
ctrl = 0
sprpriority = 5

[state 12084, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12084, 回転]
type = angleadd
trigger1 = 1
value = -1

[state 12084, 回転実行]
type = angledraw
trigger1 = 1
scale = 1.75,1.75;1+0.2*sin(time*pi/180*4),1+0.2*sin(time*pi/180*4)

[state 12084, ]
type = varadd
trigger1 = root,anim = 2082
var(1) = 1

[state 12084, ]
type = trans
trigger1 = var(1) = 0
trans = addalpha
alpha = 64,256

[state 12084, ]
type = trans
trigger1 = var(1) > 0
trans = addalpha
alpha = 128-ceil(var(1)*6.4),256;ceil(var(1)*12.8)

[state 12084, ]
type = destroyself
trigger1 = var(1) >= 20



;レーザー祭り-------------------------------------------------------------------
[statedef 12085]
type = A
movetype = A
physics = N
anim = 12088
ctrl = 0
sprpriority = 4

[state 12085,エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := p2dist x
trigger1 = fvar(13) := 0

[state 12085, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12085, ]
type = playsnd
trigger1 = time = 0
value = 1,9

[state 12085, ]
type = varrandom
trigger1 = time = 0
v = 1
range = 0,150

[state 12085, ]
type = varadd
trigger1 = time = 0
var(1) = -150
persistent = 0

[state 12085, ]
type = posadd
trigger1 = time = 0
x = 0
y = var(1)

[state 12085, 攻撃設定]
type = hitdef
trigger1 = time = 0
attr = A,SP
damage = ceil((root,fvar(10)*50)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 15,8
hitflag = MAFD
guardflag = MA
animtype = back
priority = 5,hit
pausetime = 0,2
hitsound = S0,8
guardsound = S2,0
sparkno = S20065
;sparkxy = -10, -58
ground.slidetime = 5
ground.hittime = 15
ground.velocity = -4,0
guard.hittime = 15
ground.ctrltime = 15
guard.velocity = -1.5
air.velocity = -4,-1

[state 12085, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*root,fvar(10)),5)
ignorehitpause = 1
persistent = 0

[state 12085, 補正]
type = parentvarset
trigger1 = movehit = 1
trigger1 = ishelper(12081)
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 1
persistent = 0

[state 12085, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12081
anim = 20075
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 12085,透過 ]
type = trans
trigger1 = time >= 14
trans = addalpha
alpha = 256-ceil((time -14)*16),256

[state 12085, ]
type = destroyself
trigger1 = time = 30




;===============================================================================
;イドの解放
;===============================================================================
[statedef 2100]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2100
vel = 0,0

[state 12100, 体力格納]
type = varset
trigger1 = animelem = 2
var(8) = (var(8) | (2145386496)) -(2145386496)+(2097152)*(life)

[state 2100, 暗転]
type = superpause
trigger1 = animelem = 2
anim = -1
sound = S4,0
time = 73
poweradd = -3000
movetime = 0
darken = 0

[state 2100, スペカ名]
type = helper
trigger1 = animelem = 2
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2100, 魔方陣eff]
type = helper
trigger1 = animelem = 2
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2100, effect他]
type = helper
trigger1 = animelem = 2
name = "spell"
stateno = 12100
pos = 0,0
postype = p1
facing = 1
ownpal = 1
ID = 12100
supermovetime = 200

[state 2100, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1


;effect,etc...----------------------------------------------
[statedef 12100]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2101
vel = 0,0

[state 12100, ]
type = nothitby
trigger1 = 1
value = SCA

[state 12100, ハートa0]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12101
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa1]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12102
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa2]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12103
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa3]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12104
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa4]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12105
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa5]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12106
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa6]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12107
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートa7]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12108
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb0]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12109
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb1]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12110
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb2]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12111
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb3]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12112
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb4]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12113
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb5]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12114
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb6]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12115
ignorehitpause = 1
supermovetime = 1000

[state 12100, ハートb7]
type = helper
trigger1 = animelem = 3
name = "heart"
stateno = 12102
pos = 2,-46
postype = p1
ownpal = 1
ID = 12116
ignorehitpause = 1
supermovetime = 1000

[state 12100, ]
type = playsnd
trigger1 = animelem = 4
value = 2,2
persistent = 0

[state 12100, わっか]
type = helper
trigger1 = animelem = 4
name = "wakka"
stateno = 12101
postype = p1
pos = 2,-46
ownpal = 1
ignorehitpause = 1
supermovetime = 1000

[state 12100, ]
type =explod
trigger1 = animelem = 4
anim = 12101
ID = 12101
postype = p1
pos = 2,-46
facing = 1
removetime = 16
ownpal = 1
sprpriority = 5
ignorehitpause = 1
supermovetime = 1000

[state 12100, ]
type = envshake
trigger1 = animelem = 4
time = 10
freq = 60
ampl = 4
phase = 0

[state 12100, 効果時間]
type = parentvarset
trigger1 = animelem = 4
var(8) = (root,var(8) | (1023)) -(1023)+(1)*(1020)

[state 12100, ]
type = assertspecial
trigger1 = animelem = 6,>=0
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12100, ]
type = destroyself
trigger1 = animelem = 7,>=0
trigger1 = ishelper(12101) = 0


;わっか-------------------------------------------
[statedef 12101]
type = A
movetype = I
physics = N
ctrl = 0
anim = 12100

[state 12101, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12101,透過 ]
type = trans
trigger1 = time >= 0
trans = addalpha
alpha = 256-ceil(time*17.1),256

[state 12101, ]
type = angledraw
trigger1 = 1
scale = 0.2*time+0.1,0.2*time+0.1
ignorehitpause = 1

[state 12101, ]
type = destroyself
trigger1 = time = 30


;ハート-------------------------------------------
[statedef 12102]
type = A
movetype = I
physics = N
ctrl = 0
anim = 10326
sprpriority = 0

[state 12102, ]
type = varset
trigger1 = ishelper(12102)
trigger2 = ishelper(12103)
trigger3 = ishelper(12104)
trigger4 = ishelper(12105)
trigger5 = ishelper(12106)
trigger6 = ishelper(12107)
trigger7 = ishelper(12108)
trigger8 = ishelper(12101)
var(1) = 1

[state 12102, ]
type = varset
trigger1 = ishelper(12109)
trigger2 = ishelper(12110)
trigger3 = ishelper(12111)
trigger4 = ishelper(12112)
trigger5 = ishelper(12113)
trigger6 = ishelper(12114)
trigger7 = ishelper(12115)
trigger8 = ishelper(12116)
var(1) = -1

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12102)
trigger2 = ishelper(12110)
var(0) = ifelse(ishelper(12102),15,-15)

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12103)
trigger2 = ishelper(12111)
var(0) = ifelse(ishelper(12103),30,-30)

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12104)
trigger2 = ishelper(12112)
var(0) = ifelse(ishelper(12104),45,-45)

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12105)
trigger2 = ishelper(12113)
var(0) = ifelse(ishelper(12105),60,-60)

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12106)
trigger2 = ishelper(12114)
var(0) = ifelse(ishelper(12106),75,-75)

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12107)
trigger2 = ishelper(12115)
var(0) = ifelse(ishelper(12107),90,-90)

[state 12102, 角度調整]
type = varset
trigger1 = ishelper(12108)
trigger2 = ishelper(12116)
var(0) = ifelse(ishelper(12108),105,-105)

[state 12102, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12102, 広がり]
type = bindtoroot
trigger1 = time <= 30
facing = 0
pos = ceil(time*100/30*cos((time+var(0))*pi/60)),ceil(-50-time*100/30*sin(var(1)*(time+var(0))*pi/60))

[state 12102, 憑依]
type = bindtoroot
trigger1 = time > 30
facing = 0
pos = ceil(100*cos((time+var(0))*pi/60)),ceil(-50-100*sin(var(1)*(time+var(0))*pi/60))

[state 12102, 角度]
type = angleset
trigger1 = time <= 30
value = ifelse(var(1) = 1,(time+var(0))*180/60+3*time,-(time+var(0))*180/60-3*time)

[state 12102, 角度]
type = angleset
trigger1 = time > 30
value = ifelse(var(1) = 1,(time+var(0))*180/60+90,-(time+var(0))*180/60-90)

[state 12102, 角度実行]
type = angledraw
trigger1 = 1
scale = 0.4,0.4

[state 12101,透過 ]
type = trans
trigger1 = time < 34
trans = addalpha
alpha = 256,256

[state 12101,透過 ]
type = trans
trigger1 = time >= 34
trans = addalpha
alpha = 256-ceil((time -34)*16),256

[state 12102, ]
type = destroyself
trigger1 = time = 50


;===============================================================================
;スーパーエゴ
;===============================================================================
[statedef 2120]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2120
vel = 0,0

[state 2120, ]
type = nothitby
trigger1 = animelem = 4
trigger2 = animelem = 5
value = SCA

[state 2120, 暗転]
type = superpause
trigger1 = animelem = 4
anim = -1
sound = S4,0
time = 52
poweradd = -1000
movetime = 0
darken = 0

[state 2120, スペカ名]
type = helper
trigger1 = animelem = 4
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2120, 魔方陣eff]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2120, effect他]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 12120
pos = 0,0
postype = p1
facing = 1
ownpal = 1
ID = 12120
supermovetime = 200

[state 12120, ダメージ]
type = lifeadd
trigger1 = animelem = 5
value = floor(((var(8) & (2096128)) / (1024) )/2)
absolute = 1

[state 12120, 自分体力]
type = lifeadd
trigger1 = animelem = 5
value = floor(((var(8) & (2145386496)) / (2097152) - life)/4)
absolute = 1

[state 2120, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1


;effect,etc...----------------------------------------------
[statedef 12120]
type = A
movetype = I
physics = N
ctrl = 0
anim = 2121
vel = 0,0

[state 12120, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12120, ]
type = nothitby
trigger1 = 1
value = SCA

[state 12120, ハートa0]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12101
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa1]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12102
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa2]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12103
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa3]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12104
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa4]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12105
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa5]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12106
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa6]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12107
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートa7]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12108
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb0]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12109
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb1]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12110
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb2]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12111
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb3]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12112
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb4]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12113
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb5]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12114
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb6]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12115
ignorehitpause = 1
supermovetime = 1000

[state 12120, ハートb7]
type = helper
trigger1 = animelem = 1
name = "heart"
stateno = 12122
pos = 2,-46
postype = p1
ownpal = 1
ID = 12116
ignorehitpause = 1
supermovetime = 1000

[state 12120, ]
type = playsnd
trigger1 = animelem = 13
value = 1,6
persistent = 0

[state 12120, わっか]
type = helper
trigger1 = animelem = 13
name = "wakka"
stateno = 12121
postype = p1
pos = 2,-46
ownpal = 1
ignorehitpause = 1
supermovetime = 1000

[state 12120, 時間解除]
type = parentvarset
trigger1 = animelem = 9
var(8) = (root,var(8) | (1023)) -(1023)

[state 12120, ]
type = assertspecial
trigger1 = animelem = 16,>=0
flag = invisible
ignorehitpause = 1

[state 12120, ]
type = destroyself
trigger1 = animelem = 15,>=0
trigger1 = ishelper(12101) = 0


;わっか-------------------------------------------
[statedef 12121]
type = A
movetype = I
physics = N
ctrl = 0
anim = 12120

[state 12121, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12121,透過 ]
type = trans
trigger1 = time >= 0
trans = addalpha
alpha = 256-ceil(time*17.1),256

[state 12121, ]
type = angledraw
trigger1 = 1
scale = 0.2*time+0.1,0.2*time+0.1
ignorehitpause = 1

[state 12121, ]
type = destroyself
trigger1 = time = 30


;ハート-------------------------------------------
[statedef 12122]
type = A
movetype = I
physics = N
ctrl = 0
anim = 10302
sprpriority = 0

[state 12122, ]
type = varset
trigger1 = ishelper(12102)
trigger2 = ishelper(12103)
trigger3 = ishelper(12104)
trigger4 = ishelper(12105)
trigger5 = ishelper(12106)
trigger6 = ishelper(12107)
trigger7 = ishelper(12108)
trigger8 = ishelper(12101)
var(1) = 1

[state 12122, ]
type = varset
trigger1 = ishelper(12109)
trigger2 = ishelper(12110)
trigger3 = ishelper(12111)
trigger4 = ishelper(12112)
trigger5 = ishelper(12113)
trigger6 = ishelper(12114)
trigger7 = ishelper(12115)
trigger8 = ishelper(12116)
var(1) = -1

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12102)
trigger2 = ishelper(12110)
var(0) = ifelse(ishelper(12102),15,-15)

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12103)
trigger2 = ishelper(12111)
var(0) = ifelse(ishelper(12103),30,-30)

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12104)
trigger2 = ishelper(12112)
var(0) = ifelse(ishelper(12104),45,-45)

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12105)
trigger2 = ishelper(12113)
var(0) = ifelse(ishelper(12105),60,-60)

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12106)
trigger2 = ishelper(12114)
var(0) = ifelse(ishelper(12106),75,-75)

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12107)
trigger2 = ishelper(12115)
var(0) = ifelse(ishelper(12107),90,-90)

[state 12122, 角度調整]
type = varset
trigger1 = ishelper(12108)
trigger2 = ishelper(12116)
var(0) = ifelse(ishelper(12108),105,-105)

[state 12122, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12122, 憑依]
type = bindtoroot
trigger1 = time < 20
facing = 0
pos = ceil(100*cos((time+var(0))*pi/60)),ceil(-50-100*sin(var(1)*(time+var(0))*pi/60))

[state 12122, 広がり]
type = bindtoroot
trigger1 = time >= 20
facing = 0
pos = ceil((100-(time -20)*100/30)*cos((time+var(0))*pi/60)),ceil(-50-(100-(time -20)*100/30)*sin(var(1)*(time+var(0))*pi/60))

[state 12122, 角度]
type = angleset
trigger1 = time < 20
value = ifelse(var(1) = 1,(time+var(0))*180/60+90,-(time+var(0))*180/60-90)

[state 12122, 角度]
type = angleset
trigger1 = time >= 20
value = ifelse(var(1) = 1,(time+var(0))*180/60+90+(3*(time -20)),-(time+var(0))*180/60-90-(3*(time -20)))

[state 12122, 角度実行]
type = angledraw
trigger1 = 1
scale = 0.4,0.4

[state 12101,透過 ]
type = trans
trigger1 = time < 34
trans = addalpha
alpha = 256,256

[state 12101,透過 ]
type = trans
trigger1 = time >= 34
trans = addalpha
alpha = 256-ceil((time -34)*16),256

[state 12122, ]
type = destroyself
trigger1 = time = 50



;===============================================================================
;ポリグラフ
;===============================================================================
[statedef 2130]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2130

[state 2130, 暗転]
type = superpause
trigger1 = animelem = 3
anim = -1
sound = S4,0
time = 43
poweradd = -5000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2130, スペカ名]
type = helper
trigger1 = animelem = 3
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2130, 魔方陣eff]
type = helper
trigger1 = animelem = 3
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2130, ]
type = helper
trigger1 = animelem = 3
name = "kijun"
stateno = 12130
pos = 160,15
postype = left
facing = 1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12130

[state 2130, SE]
type = playsnd
trigger1 = animelem = 6
value = 1,3

[state 2130, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1



;===============================================================================
;空中ポリグラフ
;===============================================================================
[statedef 2135]
type = A
movetype = A
physics = A
ctrl = 0
anim = 2130
vel = 0,0

[state 2135, 暗転]
type = superpause
trigger1 = animelem = 3
anim = -1
sound = S4,0
time = 43
poweradd = -5000+ifelse((var(8) & (1023)) / (1) > 0,1000,0)
movetime = 0
darken = 0

[state 2135, スペカ名]
type = helper
trigger1 = animelem = 3
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2135, 魔方陣eff]
type = helper
trigger1 = animelem = 3
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2135, ]
type = helper
trigger1 = animelem = 3
name = "kijun"
stateno = 12130
ID = 12130
pos = 160,15
postype = left
facing = 1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4


[state 2135, SE]
type = playsnd
trigger1 = animelem = 6
value = 1,3

[state 2135, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1



;基準---------------------------------------------
[statedef 12130]
type = A
movetype = I
physics = N
anim = 12021
ctrl = 0
sprpriority = 5

[state 12130, ]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible

[state 12130, ランダム判定1]
type = varrandom
trigger1 = time = 0
v = 2
range = 1,4

[state 12130, ランダム判定2]
type = varrandom
trigger1 = time = 0
v = 3
range = 1,4

[state 12130, ランダム判定3]
type = varrandom
trigger1 = time = 0
v = 4
range = 1,4

[state 12130, 判定2選考]
type = varset
trigger1 = time = 1
trigger1 = var(2) = var(3)
var(3) = ifelse(var(2) != 4,var(2)+1,1)

[state 12130, 判定3選考]
type = varset
trigger1 = time = 2
trigger1 = (var(4) = var(2)) || (var(4) = var(3))
trigger1 = (var(2) != 1) && (var(3) != 4)
var(4) = ifelse(var(2)-var(3) != 1,ifelse(var(3) != 4,var(3)+1,1),ifelse(var(3) != 1,var(3)-1,4))

[state 12130, 判定3選考]
type = varrandom
trigger1 = time = 2
trigger1 = (var(4) = var(2)) || (var(4) = var(3))
trigger1 = (var(2) = 1) && (var(3) = 4)
v = 4
range = 2,3

[state 12130, ランダム判定4]
type = varset
trigger1 = time = 3
var(5) = 10-var(2)-var(3)-var(4)

[state 12130, 距離保存]
type = varset
trigger1 = time = 0
var(0) = floor(rootdist x)+Ifelse(root,facing = 1,33,-33)

[state 12130, 距離保存]
type = varset
trigger1 = time = 0
var(1) = floor(rootdist y)+15

[state 12130, 1]
type = helper
trigger1 = root,animelem = 6
name = "tsubomi1"
stateno = 12131
pos = 0,0;var(0)+33,-85
postype = p1
facing = 1
ownpal = 0
ID = 12131
persistent = 0

[state 12130, 2]
type = helper
trigger1 = root,animelem = 6
name = "tsubomi2"
stateno = 12131
pos = 0,0;var(0)+33,-85
postype = p1
facing = 1
ownpal = 0
ID = 12132
persistent = 0

[state 12130, 3]
type = helper
trigger1 = root,animelem = 6
name = "tsubomi3"
stateno = 12131
pos = 0,0;var(0)+33,-85
postype = p1
facing = 1
ownpal = 0
ID = 12133
persistent = 0

[state 12130, 4]
type = helper
trigger1 = root,animelem = 6
name = "tsubomi4"
stateno = 12131
pos = 0,0;var(0)+33,-85
postype = p1
facing = 1
ownpal = 0
ID = 12134
persistent = 0

[state 12130, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12130, ]
type = null;posset
trigger1 = 1
x = 0
y = 0

[state 12130, ]
type = destroyself
trigger1 = root,animelem = 6,<0
trigger1 = root,movetype = H
trigger2 = time > 120
trigger2 = numhelper(12131) = 0



;蕾-----------------------------------------------
[statedef 12131]
type = A
movetype = I
physics = N
anim = 11047
ctrl = 0
sprpriority = 5

[state 12131, ]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12131)
var(0) = parent,var(2)

[state 12131, ]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12132)
var(0) = parent,var(3)

[state 12131, ]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12133)
var(0) = parent,var(4)

[state 12131, ]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12134)
var(0) = parent,var(5)

[state 12131, ]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12131, ]
type = angledraw
trigger1 = 1;time <= 30
scale = 0.6,0.6

[state 12131, ]
type = null;angledraw
trigger1 = time > 30
scale = 0.2,0.2

[state 12131, ]
type = trans
trigger1 = time <= 30
trans = addalpha
alpha = 256,256

[state 12131, ]
type = trans
trigger1 = time > 30
trans = addalpha
alpha = 256,0

[state 12131, ]
type = posset
trigger1 = ishelper(12131)
trigger1 = time <= 30
x = (parent,var(0))+(-120-(parent,var(0)))/30*time
y = ifelse(time < 15,-85+parent,var(1),-85+parent,var(1)+(-parent,var(1)+100)/15*(time-15))

[state 12131, ]
type = posset
trigger1 = ishelper(12131)
trigger1 = time >= 31
x = -120
y = 15

[state 12131, ]
type = posset
trigger1 = ishelper(12132)
trigger1 = time <= 30
x = (parent,var(0))+(-40-(parent,var(0)))/30*time
y = ifelse(time < 15,-85+parent,var(1),-85+parent,var(1)+(-parent,var(1)+100)/15*(time-15))

[state 12131, ]
type = posset
trigger1 = ishelper(12132)
trigger1 = time >= 31
x = -40
y = 15

[state 12131, ]
type = posset
trigger1 = ishelper(12133)
trigger1 = time <= 30
x = (parent,var(0))+(40-(parent,var(0)))/30*time
y = ifelse(time < 15,-85+parent,var(1),-85+parent,var(1)+(-parent,var(1)+100)/15*(time-15))

[state 12131, ]
type = posset
trigger1 = ishelper(12133)
trigger1 = time >= 31
x = 40
y = 15

[state 12131, ]
type = posset
trigger1 = ishelper(12134)
trigger1 = time <= 30
x = (parent,var(0))+(120-(parent,var(0)))/30*time
y = ifelse(time < 15,-85+parent,var(1),-85+parent,var(1)+(-parent,var(1)+100)/15*(time-15))

[state 12131, ]
type = posset
trigger1 = ishelper(12134)
trigger1 = time >= 31
x = 120
y = 15

[state 12131, ]
type = changeanim
trigger1 = time = 31
value = 12021

[state 12131, ]
type = playsnd
trigger1 = time = 210
value = 2,6

[state 12131, 240]
type = explod
triggerall = var(0) > 1
trigger1 = time = 210
trigger1 = var(0) >= 2
trigger2 = time = 230
trigger2 = var(0) >= 3
trigger3 = time = 250
trigger3 = var(0) = 4
ID = 12130
name = "maru"
anim = 12130
postype = p1
pos = 0,0
ownpal = 1
velocity = 0,0
sprpriority = 6
removetime = 20
scale = 1,1
bindtime = -1
ignorehitpause = 1

[state 12131, ]
type = statetypeset
trigger1  = time = 320
statetype = A
movetype = A
physics = N

[state 12131, ]
type = changeanim
trigger1 = time = 330
value = 12020

[state 12131, ]
type = playsnd
trigger1 = time = 330
value = 1,3

[state 12131, 240]
type = explod
trigger1 = time = 330
ID = 12131
name = "efe1"
anim = 12131
postype = p1
pos = 0,0
ownpal = 1
velocity = 0,0
sprpriority = 6
removetime = 18
scale = 1,1
bindtime = -1
ignorehitpause = 1

[state 12131, 240]
type = explod
trigger1 = time = 330
ID = 12132
name = "beam"
anim = 12133
postype = p1
pos = 0,0
ownpal = 1
velocity = 0,0
sprpriority = 6
removetime = 26
scale = 1,1
bindtime = -1
ignorehitpause = 1

[state 12131, ]
type = envshake
trigger1 = time = 330
time = 60
freq = 80
ampl = -4

[state 12131, ]
type = playsnd
trigger1 = time = 330
value = 2,13

[state 12131, 1]
type = helper
trigger1 = ishelper(12131)
trigger1 = time = 330+6
name = "hantei1"
stateno = 12132
pos = 0,0
postype = p1
facing = 1
ownpal = 0
size.xscale = 1
size.yscale = 1
ID = 12135
persistent = 0

[state 12131, 2]
type = helper
trigger1 = ishelper(12132)
trigger1 = time = 330+6
name = "hantei2"
stateno = 12132
pos = 0,0
postype = p1
facing = 1
ownpal = 0
size.xscale = 1
size.yscale = 1
ID = 12136
persistent = 0

[state 12131, 3]
type = helper
trigger1 = ishelper(12133)
trigger1 = time = 330+6
name = "hantei3"
stateno = 12132
pos = 0,0
postype = p1
facing = 1
ownpal = 0
size.xscale = 1
size.yscale = 1
ID = 12137
persistent = 0

[state 12131, 4]
type = helper
trigger1 = ishelper(12134)
trigger1 = time = 330+6
name = "hantei4"
stateno = 12132
pos = 0,0
postype = p1
facing = 1
ownpal = 0
size.xscale = 1
size.yscale = 1
ID = 12138
persistent = 0

[state 12131, 花弁1]
type = projectile
trigger1 = time = 330+6+60
projID = 12020
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12131, 花弁2]
type = projectile
trigger1 = time = 330+6+60
projID = 12021
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12131, 花弁3]
type = projectile
trigger1 = time = 330+6+60
projID = 12022
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12131, ]
type = destroyself
trigger1 = time = 330+6+60



;判定---------------------------------------------
[statedef 12132]
type = A
movetype = A
physics = N
anim = 12134
ctrl = 0
sprpriority = 5

[state 12132, ランダム判定]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12135)
var(0) = parent,var(0)

[state 12132, ランダム判定]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12136)
var(0) = parent,var(0)

[state 12132, ランダム判定]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12137)
var(0) = parent,var(0)

[state 12132, ランダム判定]
type = varset
trigger1 = time = 0
trigger1 = ishelper(12138)
var(0) = parent,var(0)

[state 12132, ]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 12132, ヒット定義]
type = hitdef
trigger1 = var(0) = 1
attr = A,HP
damage = 0,0
getpower = 0,0
animtype = hard
guardflag = M
hitflag = MAF
priority = 5,hit
pausetime = 4,3
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20075
;sparkxy = 0,0
groundtype = high
ground.slidetime = 20
ground.hittime = 20
air.hittime = 20
ground.ctrltime = 20
ground.velocity = -1,-20
groundguard.velocity = -2
air.velocity = -1,-20
airguard.velocity = -1,-2
ID = 12132
fall = 1
fall.recovertime = 2000
persistent = 0

[state 12132, ヒット定義]
type = hitdef
trigger1 = var(0) = 2
attr = A,HP
damage = 150,15
getpower = 0,10
animtype = hard
guardflag = M
hitflag = MAF
priority = 5,hit
pausetime = 4,3
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20075
;sparkxy = 0,0
groundtype = high
ground.slidetime = 20
ground.hittime = 20
air.hittime = 20
ground.ctrltime = 20
ground.velocity = -1,-20
groundguard.velocity = -2
air.velocity = -1,-20
airguard.velocity = -1,-2
ID = 12132
fall = 1
fall.recovertime = 2000
persistent = 0

[state 12132, ヒット定義]
type = hitdef
trigger1 = var(0) = 3
attr = A,HP
damage = 300,30
getpower = 0,30
animtype = hard
guardflag = M
hitflag = MAF
priority = 5,hit
pausetime = 4,3
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20075
;sparkxy = 0,0
groundtype = high
ground.slidetime = 20
ground.hittime = 20
air.hittime = 20
ground.ctrltime = 20
ground.velocity = -1,-20
groundguard.velocity = -2
air.velocity = -1,-20
airguard.velocity = -1,-2
ID = 12132
fall = 1
fall.recovertime = 2000
persistent = 0

[state 12132, ヒット定義]
type = hitdef
trigger1 = var(0) = 4
attr = A,HP
damage = 600,60
getpower = 0,60
animtype = hard
guardflag = M
hitflag = MAF
priority = 5,hit
pausetime = 4,3
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20075
;sparkxy = 0,0
groundtype = high
ground.slidetime = 20
ground.hittime = 20
air.hittime = 20
ground.ctrltime = 20
ground.velocity = -1,-20
groundguard.velocity = -2
air.velocity = -1,-20
airguard.velocity = -1,-2
ID = 12132
fall = 1
fall.recovertime = 2000
persistent = 0

[state 12132, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 0
persistent = 0

[state 12132, ]
type = targetstate
trigger1 = movehit
value = 6030
ID = 12132
persistent = 0

[state 12132, ]
type = destroyself
trigger1 = time = 20


[state 12132, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12132, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12132, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-30-(enemynear,const(size.ground.front)), 30+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-30, 1000-(enemynear,const(size.head.pos.y))]
value = 3, 2



;===============================================================================
;深層「無意識の遺伝子」
;===============================================================================
[statedef 2140]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2140

[state 2140, ]
type = nothitby
trigger1 = 1
value = ,AP,AT

[state 2140, 暗転]
type = superpause
trigger1 = animelem = 4
anim = -1
sound = S4,0
time = 43
poweradd = -2000
movetime = 0
darken = 0

[state 2140, スペカ名]
type = helper
trigger1 = animelem = 4
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2140, 魔方陣eff]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2140, 緑]
type = helper
trigger1 = animelem = 5
name = "green"
stateno = 12140
postype = p1
pos = 0,-50
ownpal = 0
ID = 12140

[state 2140, 青]
type = helper
trigger1 = animelem = 5
name = "blue"
stateno = 12140
postype = p1
pos = 0,-50
ownpal = 0
ID = 12141

[state 2140, ]
type = varset
trigger1 = animelem = 5
var(9) = 960

[state 2140, ]
type = playsnd
trigger1 = animelem = 5
value= 1,3

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



;-------------------------------------------------------------------------------
;回転物
[statedef 12140]
type = A
movetype = A
physics = N
anim = 12140
ctrl = 0
sprpriority = 6

[state 12140, 振り返り]
type = turn
trigger1 = root,facing != facing

[state 12140, ]
type = varadd
trigger1 = movecontact
var(0) = 1

[state 12140, ]
type = varset
trigger1 = var(0) > 50
var(0) = 0

[state 12140, 無敵]
type = nothitby
trigger1 = 1
value = SCA

[state 12140, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12140, 時間調整]
type = varset
trigger1 = time = 0
var(10) = 900;ifelse((root,var(8) & (1023)) / (1) = 0, 300, 600)

[state 12140, ]
type = changeanim
trigger1 = ishelper(12141)
value = 12141

[state 12140, 楕円式]
type = null
trigger1 = ishelper(12140)
trigger1 = fvar(0) := 70*cos((time+50)*pi/50)
trigger1 = fvar(1) := -25*sin((time+50)*pi/50)
trigger2 = ishelper(12141)
trigger2 = fvar(0) := 70*cos(time*pi/50)
trigger2 = fvar(1) := -25*sin(time*pi/50)

[state 12140, 回転]
type = bindtoroot
triggerall = time >= 0
trigger1 = ishelper(12140)
facing = 0
pos = ceil((fvar(0)+fvar(1))/(2**0.5)),ceil(-50+(-fvar(0)+fvar(1))/(2**0.5))

[state 12140, 回転]
type = bindtoroot
triggerall = time >= 0
trigger1 = ishelper(12141)
facing = 0
pos = ceil((fvar(1)+fvar(0))/(2**0.5)),ceil(-50+(-fvar(1)+fvar(0))/(2**0.5))

[state 12140, 角度実行]
type = angledraw
trigger1 = 1
scale = 0.3,0.3

[state 12140, ]
type = sprpriority
trigger1 = ishelper(12140)
value = ifelse(fvar(1) > 0,8,-2)

[state 12140, ]
type = sprpriority
trigger1 = ishelper(12141)
value = ifelse(fvar(1) < 0,8,-2)

[state 12140, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12140, 攻撃設定]
type = hitdef
trigger1 = var(0) = 0
attr = A,HP
damage = ceil((root,fvar(10)*10)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),3
getpower = 10,5
hitflag = MAF
guardflag = MA
animtype = medium
priority = 5,hit
pausetime = 0,5
hitsound = S0,8
guardsound = S2,0
sparkno = S20075
sparkxy = 0,0
ground.slidetime = 3
ground.hittime = 10
ground.velocity = -2,0
guard.hittime = 10
ground.ctrltime = 10
guard.velocity = -1
air.velocity = -2,-4

[state 12140, ダメージ格納]
type = parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(50*root,fvar(10)),5)
ignorehitpause = 1

[state 12140, 補正]
type = parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.98
ignorehitpause = 1
persistent = 0

[state 12140, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12140, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12140, グレイズ音]
type = playsnd
triggerall = numenemy > 0
triggerall = movetype = I
trigger1 = p2dist x = [-8-(enemynear,const(size.ground.front)), 8+(enemynear,const(size.ground.back))]
trigger1 = p2dist y = [-8, 8-(enemynear,const(size.head.pos.y))]
value = 3, 2

[state 12140, 軌跡1]
type = projectile
triggerall = time > 0
triggerall = time%10 = 0
trigger1 = ishelper(12140)
projID = 12140
projanim = 12142
projscale = 0.3,0.3
projremovetime = 70
velocity = 0,0
accel = 0, 0
offset = 0, 0
projsprpriority = ifelse(fvar(1) > 0,8,-2)

[state 12140, 軌跡2]
type = projectile
triggerall = time > 0
triggerall = time%10 = 0
trigger1 = ishelper(12141)
projID = 12141
projanim = 12143
projscale = 0.3,0.3
projremovetime = 70
velocity = 0,0
accel = 0, 0
offset = 0, 0
projsprpriority = ifelse(fvar(1) < 0,8,-2)

[state 12140, ]
type = playsnd
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
value = 2,14
volume = -100

[state 12140, g米粒]
type = helper
triggerall = ishelper(12140)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12142

[state 12140, g米粒]
type = helper
triggerall = ishelper(12140)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12143

[state 12140, g米粒]
type = helper
triggerall = ishelper(12140)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12144

[state 12140, g米粒]
type = helper
triggerall = ishelper(12140)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12145

[state 12140, g米粒]
type = helper
triggerall = ishelper(12140)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12146

[state 12140, b米粒]
type = helper
triggerall = ishelper(12141)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12147

[state 12140, b米粒]
type = helper
triggerall = ishelper(12141)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12148

[state 12140, b米粒]
type = helper
triggerall = ishelper(12141)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12149

[state 12140, b米粒]
type = helper
triggerall = ishelper(12141)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12150

[state 12140, b米粒]
type = helper
triggerall = ishelper(12141)
trigger1 = (root,stateno = 300) && (root,animelem = 5)
trigger2 = (root,stateno = 301) && (root,animelem = 3)
trigger3 = (root,stateno = 310) && (root,animelem = 6)
trigger4 = (root,stateno = 311) && (root,animelem = 3)
trigger5 = (root,stateno = 700) && (root,animelem = 5)
trigger6 = (root,stateno = 701) && (root,animelem = 3)
trigger7 = (root,stateno = 710) && (root,animelem = 6)
trigger8 = (root,stateno = 711) && (root,animelem = 3)
trigger9 = (root,stateno = 430) && (root,animelem = 5)
trigger10 = (root,stateno = 320) && (root,animelem = 4)
trigger11 = (root,stateno = 325) && (root,animelem = 4)
trigger12 = (root,stateno = 720) && (root,animelem = 4)
trigger13 = (root,stateno = 725) && (root,animelem = 4)
trigger14 = (root,stateno = 330) && (root,animelem = 5)
trigger15 = (root,stateno = 335) && (root,animelem = 5)
trigger16 = (root,stateno = 730) && (root,animelem = 5)
trigger17 = (root,stateno = 735) && (root,animelem = 5)
name = "kome2"
stateno = 12141
postype = p1
pos = 0,0
ownpal = 0
ID = 12151

[state 12140, ヘルパーを消す]
type = destroyself
trigger1 = time > var(10)



;-------------------------------------------------
;米粒
[statedef 12141]
type = A
movetype = A
physics = N
anim = 12144
ctrl = 0
sprpriority = 6

[state 12141, ]
type = null
trigger1 = ishelper(12142)
trigger1 = fvar(0) := 6
trigger1 = fvar(1) := 5
trigger2 = ishelper(12143)
trigger2 = fvar(0) := 12
trigger2 = fvar(1) := 6
trigger3 = ishelper(12144)
trigger3 = fvar(0) := 18
trigger3 = fvar(1) := 7
trigger4 = ishelper(12145)
trigger4 = fvar(0) := 24
trigger4 = fvar(1) := 8
trigger5 = ishelper(12146)
trigger5 = fvar(0) := 30
trigger5 = fvar(1) := 9

[state 12141, ]
type = null
trigger1 = ishelper(12147)
trigger1 = fvar(0) := -6
trigger1 = fvar(1) := 5
trigger2 = ishelper(12148)
trigger2 = fvar(0) := -12
trigger2 = fvar(1) := 6
trigger3 = ishelper(12149)
trigger3 = fvar(0) := -18
trigger3 = fvar(1) := 7
trigger4 = ishelper(12150)
trigger4 = fvar(0) := -24
trigger4 = fvar(1) := 8
trigger5 = ishelper(12151)
trigger5 = fvar(0) := -30
trigger5 = fvar(1) := 9

[state 12141, ]
type = velset
trigger1 = 1
x = fvar(1)*cos(fvar(0)*pi/180)
y = -fvar(1)*sin(fvar(0)*pi/180)

[state 12141, ]
type = angleset
trigger1 = 1
value = fvar(0)

[state 12141, ]
type = angledraw
trigger1 = 1
scale = 0.2,0.2

[state 12141, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12141, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 255,255

[state 12141, ヒット定義]
type = hitdef
trigger1 = time = 0
attr = A,SP
damage = ceil((root,fvar(10)*10)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),2
getpower = 5,1
animtype = light
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 4,3
hitsound = S0,4
guardsound = S2,0
sparkno = S20075
sparkxy = 0,0
groundtype = high
ground.slidetime = 5
ground.hittime = 10
air.hittime = 10
ground.ctrltime = 10

[state 12141, ダメージ格納]
type = null;parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*root,fvar(10)),10)
ignorehitpause = 0

[state 12141, 補正]
type = null;parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 0
;persistent = 0

[state 12141, 消滅]
type = destroyself
triggerall = time > 30
trigger1 = screenpos x < 0
trigger2 = screenpos y < 0
trigger3 = screenpos x > 320
trigger4 = screenpos y > 240
trigger5 = movecontact



;-------------------------------------------------------------------------------
;突撃
[statedef 2145]
type = A
movetype = A
physics = N
anim = 2145
ctrl = 0
vel = 0,0

[state 2145, 暗転]
type = superpause
trigger1 = time = 0
anim = -1
sound = S4,0
time = 43
poweradd = 0
movetime = 0
darken = 0

[state 2145, スペカ名]
type = helper
trigger1 = time = 0
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2145, 魔方陣eff]
type = helper
trigger1 = time = 0
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2145, ]
type = nothitby
trigger1 = 1
value = ,AP,AT

[state 2145, ]
type = playerpush
trigger1 = 1
value = 0

[state 2145, ]
type = screenbound
trigger1 = 1
value = 0

[state 2145, ]
type = varset
trigger1 = time = 0
var(9) = 0

[state 2145, ]
type = velset
trigger1 = time = 1
x = 30
y = 0

[state 2145, ]
type = playsnd
trigger1 = time = 1
value = 2,7

[state 2145, ヒット定義]
type = hitdef
trigger1 = time = 1
attr = A,HA
damage = ceil((fvar(10)*400)*ifelse((var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(var(14) & (3932160))/(262144) +1)))),20
getpower = 20,10
animtype = hard
guardflag = H
hitflag = MAF
priority = 5,hit
pausetime = 0,0
hitsound = S0,3
guardsound = S2,1
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 5
ground.hittime = 10
air.hittime = 10
ground.ctrltime = 10
ground.velocity = -20,-20
guard.velocity = -1
air.velocity = -20,-20
ground.ctrltime = 10
fall = 1
fall.recover = 0
ID = 2145

[state 2147, ステートを奪う]
type = targetstate
trigger1 = moveguarded
trigger1 = target,stateno = [120,155]
trigger1 = target,statetype != A
value = 6060
ID = 2145
persistent = 0
ignorehitpause = 1

[state 2145, ダメージ格納]
type = varadd
triggerall = (var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*fvar(10)),10)
ignorehitpause = 0

[state 2145, 補正]
type = varset
trigger1 = movehit = 1
fvar(10) = fvar(10)*0.80
ignorehitpause = 0
;persistent = 0

[state 2145, ]
type = changestate
trigger1 = time > 100
value = 2146
ctrl = 0



;-------------------------------------------------
;落下中
[statedef 2146]
type = A
movetype = I
physics = A
anim = 48
ctrl = 0

[state 2146, ]
type = turn
trigger1 = time = 0

[state 2146, ]
type = posset
trigger1 = time = 0
y = -300

[state 2146, ]
type = changestate
trigger1 = pos y > -10
value = 2147
ctrl = 0



;-------------------------------------------------
;着地コケ
[statedef 2147]
type = S
movetype = I
physics = S
anim = 2146
ctrl = 0

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

[state 2146, ]
type = posset
trigger1 = time = 0
y = 0

[state 2147, ]
type = statetypeset
trigger1 = animelem = 3
movetype = A

[state 2147, ヒット定義]
type = hitdef
trigger1 = animelem = 6
attr = A,HA
damage = ceil((fvar(10)*40)*ifelse((var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(var(14) & (3932160))/(262144) +1)))),5
getpower = 20,10
animtype = hard
guardflag = HA
hitflag = MAFD
priority = 5,hit
pausetime = 0,0
hitsound = S0,0
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 5
ground.hittime = 10
air.hittime = 10
ground.ctrltime = 10
ground.velocity = 0,0
guard.velocity = -1
air.velocity = 0,0
ground.ctrltime = 10
fall = 1
fall.recover = 0

[state 2147, ダメージ格納]
type = varadd
triggerall = (var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*fvar(10)),10)
ignorehitpause = 0

[state 2147, 補正]
type = varset
trigger1 = movehit = 1
fvar(10) = fvar(10)*0.98
ignorehitpause = 0
;persistent = 0

[state 2147, ]
type = lifeadd
trigger1 = animelem = 6
value = -100
kill = 1
absolute = 1
persistent = 0

[state 2147, ]
type = playsnd
trigger1 = animelem = 6,>=0
trigger1 = life = 0
value = 3,4
persistent = 0

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



;===============================================================================
;胎児の夢（イド解放中）
;===============================================================================
[statedef 2160]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2160

[state 2160, ]
type = varset
trigger1 = time = 0
var(26) = 0

[state 2160, ]
type = nothitby
trigger1 = 1
value = ,AA,AP

[state 2160, ]
type = nothitby
trigger1 = palno = 12
value = SCA

[state 2160, 暗転]
type = superpause
trigger1 = animelem = 3
anim = -1
sound = S4,0
time = 43
poweradd = -2000
movetime = 0
darken = 0

[state 2160, スペカ名]
type = helper
trigger1 = animelem = 3
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000
pausemovetime = 1000

[state 2160, 魔方陣eff]
type = helper
trigger1 = animelem = 3
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 1000
pausemovetime = 1000

[state 2160, 射撃当身用ヘルパー]
type = helper
trigger1 = animelem = 4
name = "spell"
stateno = 12170
pos = 0,0
postype = p1
facing = 1
ownpal = 1
ID = 12170
supermovetime = 9999
pausemovetime = 9999

[state 2160, 打撃]
type = reversaldef
trigger1 = animelem = 4,>=0
reversal.attr = SCA,AA
pausetime = 0,10
sparkno = -1
sparkxy = 0,0
;p1stateno = 2162
id = 2165

[state 2160, 射撃]
type = null;reversaldef
trigger1 = animelem = 4,>=0
reversal.attr = SCA,AP
pausetime = 0,0
sparkno = -1
sparkxy = 0,0
p1stateno = 2167

[state 2160, ヘルパー対象外]
type = targetdrop
trigger1 = numtarget(2165) > 0
trigger1 = target(2165),ishelper = 1

[state 2160, ]
type = targetstate
triggerall = numtarget(2165) > 0
trigger1 = target(2165),ishelper = 0
trigger1 = movehit = 1
value = 6070
id = 2165
ignorehitpause = 1

[state 2160, ]
type = pause
trigger1 = numtarget(2165) > 0
trigger1 = movehit = 1
anim = -1
sound = -1
time = 60
darken = 0
movetime = 60

[state 2160, 打撃]
type = changestate
trigger1 = numtarget(2165) > 0
trigger1 = movehit = 1
value = 2162

[state 2160, 射撃]
type = changestate
trigger1 = numhelper(12170) = 0
trigger1 = animelem = 4,>=0
value = 2167

[state 2160, テスト用飛び]
type = null;changestate
trigger1 = time = 30
value = 2162
ctrl = 0

[state 2160, 時間切れ]
type = changestate
trigger1 = time >= 69
value = 2161
ctrl = 0



;-------------------------------------------------
;終了
[statedef 2161]
type = S
movetype = I
physics = S
ctrl = 0
anim = 2161

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



;-----------------------------------------------------------
;打撃当身成功
[statedef 2162]
type = A
movetype = I
physics = N
velset = 0,0
ctrl = 0

[state 2165, 暗転用ヘルパー]
type = helper
trigger1 = time = 0
name = "helper"
stateno = 12169
ID = 12169
postype = p1
pos = 0,0
ownpal = 1
ignorehitpause = 1
supermovetime = 1000
pausemovetime = 1000

[state 2162, ]
type = playsnd
trigger1 = time = 0
value = 1,6

[state 2162, ]
type = nothitby
trigger1 = 1
value = SCA

[state 2162, ]
type = null;bgpalfx
trigger1 = time <= 30
time = 1
add = 0,0,0
mul = ceil(128-(time*4.27)),ceil(128-(time*4.27)),ceil(128-(time*4.27))
invertall = 0
color = 256
pausemovetime = 9999

[state 2162, ]
type = null;bgpalfx
trigger1 = time > 30
time = 1
add = 0,0,0
mul = 0,0,0
invertall = 0
color = 256
pausemovetime = 9999

[state 2162, ]
type = palfx
trigger1 = time <= 30
time = 1
mul = ceil(256-(time*8.53)),ceil(256-(time*8.53)),ceil(256-(time*8.53))
invertall = 0
color = 256

[state 2162, ]
type = palfx
trigger1 = time > 30
time = 1
mul = 0,0,0
invertall = 0
color = 256

[state 2162, ]
type = changestate
trigger1 = time >= 60
value = 2165



;----------------------------------------------------------------
;打撃版攻撃
[statedef 2165]
type = A
movetype = I;A
physics = N
anim = 2165
velset = 0
ctrl = 0

[state 2165, ]
type = varadd
trigger1 = time = [10,130]
var(26) = 7
persistent = 6

[state 2165, ]
type = varadd
trigger1 = time = [151,270]
var(26) = 5
persistent = 3

[state 2165, ]
type = varadd
trigger1 = time = [291,410]
var(26) = 4
persistent = 10

[state 2165, ]
type = varadd
trigger1 = time = [551,600]
var(26) = 3
persistent = 4

[state 2165, ]
type = varadd
trigger1 = time > 600
var(26) = 514-var(26)
persistent = 0

[state 2165, ]
type = varadd
trigger1 = time = [431,550]
var(26) = 6
persistent = 10

[state 2165, ]
type = nothitby
trigger1 = 1
value = SCA

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

[state 2165, ]
type = playerpush
trigger1 = 1
value = 0

[state 2165, ]
type = posset
trigger1 = time = 0
x = 0
y = -40

[state 2165, ]
type = trans
trigger1 = anim = 2165
trans = addalpha
alpha = 128,256

[state 2165, ]
type = palfx
trigger1 = time <= 20
time = 1
mul = ceil(time*12.8),ceil(time*12.8),ceil(time*12.8)
invertall = 0
color = 256

[state 2165, ]
type = bgpalfx
trigger1 = anim = 2165
trigger1 = time <= 20
time = 1
mul = ceil(time*6.4),ceil(time*6.4),ceil(time*6.4)
invertall = 0
color = 256

[state 2165, ]
type = bgpalfx
trigger1 = anim = 2165
trigger1 = time > 20
time = 1
mul = 128,128,128
invertall = 0
color = 256

[state 2165, ]
type = null;helper
trigger1 = time = 0
name = "byousin"
stateno = 12165
ID = 1
postype = left
pos = 160,0
ownpal = 1
ignorehitpause = 1
pausemovetime = 9999
supermovetime = 9999

[state 2165, ]
type = helper
trigger1 = time = 0
name = "tansin"
stateno = 12165
ID = 2
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
pausemovetime = 9999
supermovetime = 9999

[state 2165, ]
type = helper
trigger1 = time = 0
name = "tyousin"
stateno = 12165
ID = 3
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
pausemovetime = 9999
supermovetime = 9999

[state 2165, ]
type = helper
trigger1 = time = 0
name = "tokeiban"
stateno = 12165
ID = 4
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
pausemovetime = 9999
supermovetime = 9999

[state 2165, ]
type = hitadd
trigger1 = time < 605
value = var(26)

[state 2165, ]
type = envshake
trigger1 = time = 10
trigger2 = time = 151
trigger3 = time = 291
trigger4 = time = 431
time = 120
freq = 50
ampl = -2

[state 2165, ]
type = envshake
trigger1 = time = 551
time = 50
freq = 70
ampl = -2

;---------------------------------------
;細胞
[state 2165, 細胞]
type = null;hitdef
trigger1 = time = [10,130]
attr = A,HA
damage = 10,5
getpower = 0,0
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,20
hitsound = S0,1
guardsound = S0,2
sparkno = -1
sparkxy = -1
groundtype = high
ground.hittime = 20
ground.velocity = -4,-5
guard.velocity = -2,0
air.velocity = -3,-5
air.hittime = 20
ground.ctrltime = 20
fall = 1
fall.recovertime = 6000
numhits = 11
kill = 0

[state 2165, ]
type = playsnd
trigger1 = time = [10,130]
value = 1,3
persistent = 6

[state 2165, ]
type = helper
trigger1 = time = [10,130]
name = "hikariwa"
stateno = 12166
ID = 12168
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
persistent = 20

[state 2165, 左上]
type = projectile
trigger1 = time = [10,130]
projid = 2160
projanim = 12086
projscale = 0.4,0.4
projremovetime = 20
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = ceil((random+1)*0.16),-ceil((random+1)*0.120+90) ;x[0,320],y[25,-210]
projsprpriority = 7

[state 2165, 左下]
type = projectile
trigger1 = time = [10,130]
projid = 2160
projanim = 12086
projscale = 0.4,0.4
projremovetime = 20
velocity = 0,0
postype = left
offset = ceil((random+1)*0.16),-ceil((random+1)*0.115-25)
projsprpriority = 7

[state 2165, 右上]
type = projectile
trigger1 = time = [10,130]
projid = 2160
projanim = 12086
projscale = 0.4,0.4
projremovetime = 20
velocity = 0,0
postype = left
offset = ceil((random+1)*0.16+160),-ceil((random+1)*0.120+90)
projsprpriority = 7

[state 2165, 右下]
type = projectile
trigger1 = time = [10,130]
projid = 2160
projanim = 12086
projscale = 0.4,0.4
projremovetime = 20
velocity = 0,0
postype = left
offset = ceil((random+1)*0.16+160),-ceil((random+1)*0.115-25)
projsprpriority = 7

;---------------------------------------
;魚
[state 2165, 魚]
type = null;hitdef
trigger1 = time = [151,270]
attr = A,HA
damage = 10,5
getpower = 0,0
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,20
hitsound = S0,1
guardsound = S0,2
sparkno = -1
sparkxy = -1
groundtype = high
ground.hittime = 20
ground.velocity = -4,-5
guard.velocity = -2,0
air.velocity = -3,-5
air.hittime = 20
ground.ctrltime = 20
fall = 1
fall.recovertime = 6000
numhits = 9
kill = 0

[state 2165, 背景]
type = projectile
trigger1 = time = [151,270]
projid = 2161
projanim = 12170
projscale = 5,3
projremovetime = 60
velocity = 0,-20
postype = left ;画面左下（地面との接点が0,0）←？
offset = 160,30
projsprpriority = 2
persistent = 10

[state 2165, ]
type = projectile
trigger1 = time = [151,270]
projid = 2161
projanim = 12161
projscale = 0.6,0.6
projremovetime = 80
velocity = 15*cos(50*pi/180),-15*sin(50*pi/180)
postype = left ;画面左下（地面との接点が0,0）←？
offset = -ceil((random+1)*0.24),30 ;x[-240,320],y30
projsprpriority = 7
persistent = 3

[state 2165, ]
type = projectile
trigger1 = time = [151,270]
projid = 2161
projanim = 12161
projscale = 0.6,0.6
projremovetime = 80
velocity = 15*cos(50*pi/180),-15*sin(50*pi/180)
postype = left ;画面左下（地面との接点が0,0）←？
offset = ceil((random+1)*0.16),30 ;x[-240,320],y30
projsprpriority = 7
persistent = 3

[state 2165, ]
type = projectile
trigger1 = time = [151,270]
projid = 2161
projanim = 12161
projscale = 0.6,0.6
projremovetime = 80
velocity = 15*cos(50*pi/180),-15*sin(50*pi/180)
postype = left ;画面左下（地面との接点が0,0）←？
offset = ceil((random+1)*0.16+160),30 ;x[-240,320],y30
projsprpriority = 7
persistent = 3

[state 2165, ]
type = projectile
trigger1 = time = [151,270]
projid = 2162
projanim = 12160
projscale = 0.2,0.2
projremovetime = 11
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = ceil((random+1)*0.16),30 ;x[-240,320],y30
projsprpriority = 7
persistent = 3

[state 2165, ]
type = projectile
trigger1 = time = [151,270]
projid = 2162
projanim = 12160
projscale = 0.2,0.2
projremovetime = 11
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = ceil((random+1)*0.16+160),30 ;x[-240,320],y30
projsprpriority = 7
persistent = 3

[state 2165, ]
type = playsnd
trigger1 = time = [151,270]
value = 2,11
persistent = 4


;---------------------------------------
;ゼンマイ
[state 2165, ゼンマイ]
type = null;hitdef
trigger1 = time = [291,410]
attr = A,HA
damage = 10,5
getpower = 0,0
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,20
hitsound = S0,1
guardsound = S0,2
sparkno = -1
sparkxy = -1
groundtype = high
ground.hittime = 20
ground.velocity = -4,-5
guard.velocity = -2,0
air.velocity = -3,-5
air.hittime = 20
ground.ctrltime = 20
fall = 1
fall.recovertime = 6000
numhits = 9
kill = 0

[state 2165, ]
type = helper
trigger1 = time = [291,410]
name = "nanka"
stateno = 12166
ID = 12167
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
persistent = 15

[state 2165, ]
type = projectile
trigger1 = time = 291;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = -15,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 301;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 35,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 311;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 85,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 321;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 135,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 331;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 185,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 341;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 235,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 351;[281,400]
projid = 2162
projanim = 12082
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 285,30 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 291;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 335,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 301;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 285,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 311;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 235,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 321;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 185,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 331;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 135,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 341;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 85,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = projectile
trigger1 = time = 351;[281,400]
projid = 2162
projanim = 12083
projscale = 0.35,0.35
projremovetime = 58
velocity = 0,0
postype = left ;画面左下（地面との接点が0,0）←？
offset = 35,-215 ;x[0,320],y30,-215
projsprpriority = 7

[state 2165, ]
type = playsnd
trigger1 = time = [291,410]
value = 1,8
persistent = 10


;---------------------------------------
;光
[state 2165, 光]
type = null;hitdef
trigger1 = time = [431,550]
attr = A,HA
damage = 10,5
getpower = 0,0
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,20
hitsound = S0,1
guardsound = S0,2
sparkno = -1
sparkxy = -1
groundtype = high
ground.hittime = 20
ground.velocity = -4,-5
guard.velocity = -2,0
air.velocity = -3,-5
air.hittime = 20
ground.ctrltime = 20
fall = 1
fall.recovertime = 6000
numhits = 9
kill = 0

[state 2165, ]
type = helper
trigger1 = time = [431,600]
name = "hikariwa"
stateno = 12166
ID = 12166
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
persistent = 10

[state 12166, ]
type = playsnd
trigger1 = time = [431,550]
value = 2,10
channel = 1
persistent = 10

[state 12166, ]
type = playsnd
trigger1 = time = [551,600]
value = 2,10
channel = 1
persistent = 4

[state 2165, ]
type = helper
trigger1 = time = [431,600]
name = "kousen"
stateno = 12167
ID = 12167
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
persistent = 5

[state 2165, ]
type = helper
trigger1 = time = 550
name = "white_out"
stateno = 12168
ID = 12168
postype = back
pos = 160,-95
ownpal = 1
ignorehitpause = 1
persistent = 7


;---------------------------------------
;終わり
[state 2165, ]
type = changeanim
trigger1 = time = 610
value = 2166

[state 2165, ]
type = bgpalfx
trigger1 = anim = 2166
trigger1 = time < 320
time = 1
mul = ceil((time -310)*12.8),ceil((time -310)*12.8),ceil((time -310)*12.8)
invertall = 0
color = 256

[state 2165, ]
type = bgpalfx
trigger1 = anim = 2166
trigger1 = time >= 320
time = 1
mul = 256,256,256
invertall = 0
color = 256

[state 2165, ]
type = velset
trigger1 = anim = 2166
trigger1 = animtime = 0
y = -5

[state 2165, ]
type = changestate
trigger1 = anim = 2166
trigger1 = animtime = 0
value = 50
ctrl = 0



;-------------------------------------------------
;背景時計
[statedef 12165]
type = A
movetype = I
physics = N
ctrl = 0
vel = 0,0
sprpriority = -1

[state 12165, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12165, 秒針アニメ]
type = changeanim
trigger1 = time = 0
trigger1 = ishelper(1)
value = 12165

[state 12165, 短針アニメ]
type = changeanim
trigger1 = time = 0
trigger1 = ishelper(2)
value = 12166

[state 12165, 長針アニメ]
type = changeanim
trigger1 = time = 0
trigger1 = ishelper(3)
value = 12167

[state 12165, 魔方陣アニメ]
type = changeanim
trigger1 = time = 0
trigger1 = ishelper(4)
value = 12087

[state 12165, 時間測定]
type = varadd
trigger1 = 1
var(0) = 1
ignorehitpause = 1

[state 12165, 透過処理]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12165,秒針回転]
type = angleset
trigger1 = ishelper(1)
value = var(0)*1080

[state 12165,短針回転]
type = angleset
trigger1 = ishelper(2)
value = var(0)*1.5

[state 12165,長針回転]
type = angleset
trigger1 = ishelper(3)
value = var(0)*18

[state 12165,魔方陣回転]
type = angleset
trigger1 = ishelper(4)
value = var(0)*0.1

[state 12165, 角度実行・大きさ]
type = angledraw
trigger1 = 1
scale = ifelse(ishelper(4),1.75,0.25),ifelse(ishelper(4),1.75,0.25)

[state 12165, ]
type = destroyself
trigger1 = root,anim = 2166



;-------------------------------------------------
;光の輪とぜんまい&細胞背景
[statedef 12166]
type = A
movetype = I
physics = N
ctrl = 0
vel = 0,0
anim = 12163
sprpriority = 5

[state 12166, ]
type = sprpriority
trigger1 = ishelper(12167)
trigger2 = ishelper(12168)
value = 2

[state 12166, ぜんまい背景アニメ]
type = changeanim
trigger1 = time = 0
trigger1 = ishelper(12167)
value = 12169

[state 12166, 細胞背景アニメ]
type = changeanim
trigger1 = time = 0
trigger1 = ishelper(12168)
value = 12171

[state 12166, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12166, ぜんまい背景回転]
type = angleadd
trigger1 = ishelper(12167)
value = 20

[state 12166, ]
type = angledraw
trigger1 = 1
scale = time*0.2,time*0.2
ignorehitpause = 1

[state 12166, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12166, ]
type = destroyself
trigger1 = time = 20
trigger2 = time = 30
trigger2 = ishelper(12167)



;-------------------------------------------------
;光線
[statedef 12167]
type = A
movetype = I
physics = N
ctrl = 0
vel = 0,0
anim = 12164
sprpriority = 5

[state 12167, 角度ランダム]
type = varrandom
trigger1 = time = 0
v = 0
range = 0,359

[state 12167, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12167, ]
type = angleset
trigger1 = 1
value = var(0)

[state 12167, ]
type = angledraw
trigger1 = 1
scale = 0.4,0.2
ignorehitpause = 1

[state 12167, ]
type = velset
trigger1 = 1
x = 15*cos(var(0)*pi/180)
y = -15*sin(var(0)*pi/180)

[state 12167, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12167, ]
type = destroyself
trigger1 = time = 30



;-------------------------------------------------
;ホワイトアウト
[statedef 12168]
type = A
movetype = I
physics = N
ctrl = 0
vel = 0,0
anim = 12168
sprpriority = 7

[state 12168, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12168, ]
type = angledraw
trigger1 = 1
scale = time/4,time/4
ignorehitpause = 1

[state 12168, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12168, ]
type = destroyself
trigger1 = time = 60



;-------------------------------------------------
;暗転用ヘルパー
[statedef 12169]
type = A
movetype = I
physics = N
ctrl = 0

[state 12169, ]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12169, ]
type = null;varadd
trigger1 = root,stateno = 2162
var(0) = 1
ignorehitpause = 1
pausemovetime = 9999

[state 12169, ]
type = bgpalfx
trigger1 = time <= 30
time = 1
add = 0,0,0
mul = ceil(128-(time*4.27)),ceil(128-(time*4.27)),ceil(128-(time*4.27))
invertall = 0
color = 256
pausemovetime = 9999

[state 12169, ]
type = bgpalfx
trigger1 = time > 30
;trigger2 = root,stateno = 2162
time = 1
add = 0,0,0
mul = 0,0,0
invertall = 0
color = 256
pausemovetime = 9999

[state 12169, ]
type = destroyself
trigger1 = root,movetype = H
trigger2 = root,stateno = 2161
trigger3 = root,stateno = 2165
trigger4 = root,stateno = 2167
trigger5 = root,stateno = 2205



;-----------------------------------------------------------
;射撃当身成功
[statedef 2167]
type = A
movetype = I
physics = N
velset = 0,0
ctrl = 0

[state 2167, 暗転用ヘルパー]
type = helper
trigger1 = time = 0
name = "helper"
stateno = 12169
ID = 12170
postype = p1
pos = 0,0
ownpal = 1
ignorehitpause = 1
supermovetime = 1000
pausemovetime = 1000

[state 2167, ]
type = pause
trigger1 = time = 0
anim = -1
sound = -1
time = 60
darken = 0
movetime = 60

[state 2167, ]
type = playsnd
trigger1 = time = 0
value = 1,6

[state 2167, ]
type = nothitby
trigger1 = 1
value = SCA

[state 2167, ]
type = palfx
trigger1 = time <= 30
time = 1
mul = ceil(256-(time*8.53)),ceil(256-(time*8.53)),ceil(256-(time*8.53))
invertall = 0
color = 256

[state 2167, ]
type = palfx
trigger1 = time > 30
time = 1
mul = 0,0,0
invertall = 0
color = 256

[state 2167, ]
type = changestate
trigger1 = time >= 60
value = 2168



;----------------------------------------------------------------
;射撃版攻撃
[statedef 2168]
type = A
movetype = A
physics = N
anim = 2165
velset = 0
ctrl = 0

[state 2168, ]
type = nothitby
trigger1 = 1
value = SCA

[state 2168, ]
type = playerpush
trigger1 = 1
value = 0

[state 2168, ]
type = posset
trigger1 = time = 0
y = -40

[state 2168, ]
type = trans
trigger1 = anim = 2165
trans = addalpha
alpha = 128,256

[state 2168, ]
type = palfx
trigger1 = time <= 20
time = 1
mul = ceil(time*12.8),ceil(time*12.8),ceil(time*12.8)
invertall = 0
color = 256

[state 2168, ]
type = bgpalfx
trigger1 = anim = 2165
trigger1 = time <= 20
time = 1
mul = ceil(time*6.4),ceil(time*6.4),ceil(time*6.4)
invertall = 0
color = 256

[state 2168, ]
type = bgpalfx
trigger1 = anim = 2165
trigger1 = time >= 0
time = 1
mul = 128,128,128
invertall = 0
color = 256

;きもいの---------------------------------------------
[state 2168, きもい物体]
type = helper
trigger1 = animelem = 1
name = "cell"
stateno = 12083
pos = 0,-50
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12094
persistent = 0

[state 2168, きもい物体]
type = helper
trigger1 = animelem = 1
name = "cell"
stateno = 12083
pos = 0,-50
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12095
persistent = 0

[state 2168, きもい物体]
type = helper
trigger1 = animelem = 1
name = "cell"
stateno = 12083
pos = 0,-50
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12096
persistent = 0


;魚祭り-----------------------------------------------
[state 2168, 魚]
type = helper
trigger1 = time%6 = 0
trigger1 = time <= 96
name = "fish"
stateno = 12081
pos = 0,0
ownpal = 1
size.xscale = 0.6
size.yscale = 0.6
ID = 12081


;ゼンマイ祭り-----------------------------------------
[state 2168, g1]
type = helper
trigger1 = animelem = 1
name = "zenmai"
stateno = 12082
pos = 20,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12082
persistent = 0

[state 2168, g2]
type = helper
trigger1 = animelem = 5
name = "zenmai"
stateno = 12082
pos = 160,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12083
persistent = 0

[state 2168, g3]
type = helper
trigger1 = animelem = 9
name = "zenmai"
stateno = 12082
pos = 300,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12084
persistent = 0

[state 2168, g-1]
type = helper
trigger1 = animelem = 1
name = "zenmai"
stateno = 12082
pos = -20,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12085
persistent = 0

[state 2168, g-2]
type = helper
trigger1 = animelem = 5
name = "zenmai"
stateno = 12082
pos = -160,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12086
persistent = 0

[state 2168, g-3]
type = helper
trigger1 = animelem = 9
name = "zenmai"
stateno = 12082
pos = -300,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12087
persistent = 0

[state 2168, a1]
type = helper
trigger1 = animelem = 3
name = "zenmai"
stateno = 12082
pos = 90,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12088
persistent = 0

[state 2168, a2]
type = helper
trigger1 = animelem = 7
name = "zenmai"
stateno = 12082
pos = 230,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12089
persistent = 0

[state 2168, a3]
type = helper
trigger1 = animelem = 11
name = "zenmai"
stateno = 12082
pos = 370,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12090
persistent = 0

[state 2168, a-1]
type = helper
trigger1 = animelem = 3
name = "zenmai"
stateno = 12082
pos = -90,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12091
persistent = 0

[state 2168, a-2]
type = helper
trigger1 = animelem = 7
name = "zenmai"
stateno = 12082
pos = -230,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12092
persistent = 0

[state 2168, a-3]
type = helper
trigger1 = animelem = 11
name = "zenmai"
stateno = 12082
pos = -370,-230
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 12093
persistent = 0


;レーザー---------------------------------------------
[state 2168, レーザー]
type = helper
trigger1 = time%10 = 0
trigger1 = time <= 140
name = "laser"
stateno = 12085
pos = -10,0
postype = back
ownpal = 1
size.xscale = 1
size.yscale = 1
ID = 12081


;---------------------------------------
;終わり
[state 2168, ]
type = changeanim
trigger1 = time = 150
value = 2166

[state 2168, ]
type = null;bgpalfx
trigger1 = anim = 2166
trigger1 = time < 150
time = 1
mul = ceil((time -140)*12.8),ceil((time -140)*12.8),ceil((time -140)*12.8)
invertall = 0
color = 256

[state 2168, ]
type = null;bgpalfx
trigger1 = anim = 2166
trigger1 = time >= 150
time = 1
mul = 256,256,256
invertall = 0
color = 256

[state 2168, ]
type = velset
trigger1 = anim = 2166
trigger1 = animtime = 0
y = -5

[state 2168, ]
type = changestate
trigger1 = anim = 2166
trigger1 = animtime = 0
value = 50
ctrl = 0



;-----------------------------------------------------------
;射撃当身用ヘルパー
[statedef 12170]
type = A
movetype = I
physics = N
ctrl = 0
vel = 0,0
anim = 12172
sprpriority = 0

[state 12170, ]
type = nothitby
trigger1 = 1
value = ,AA,AT

[state 12170, ]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12170, ]
type = destroyself
trigger1 = root,stateno != 2160




;===============================================================================
;ＤＮＡの瑕（イド解放中）
;===============================================================================
[statedef 2180]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2180

[state 2180, ]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 2180, 暗転]
type = superpause
trigger1 = animelem = 6
anim = -1
sound = S4,0
time = 43
poweradd = -3000
movetime = 0
darken = 0

[state 2180, スペカ名]
type = helper
trigger1 = animelem = 6
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2180, 魔方陣eff]
type = helper
trigger1 = animelem = 6
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2180, クルクル青]
type = null;helper
trigger1 = animelem = 4
name = "kuru_b"
stateno = 12183
pos = 36,-68
postype = p1
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12183

[state 2180, クルクルピンク]
type = null;helper
trigger1 = animelem = 4
name = "kuru_p"
stateno = 12183
pos = 36,-68
postype = p1
ownpal = 1
size.xscale = 0.3
size.yscale = 0.3
ID = 12184

[state 2180, DNA出す基準ヘルパー];→systemヘルパーにて出現させる
type = null;helper
trigger1 = animelem = 4
name = "dna_kijun"
stateno = 12180
pos = 0,25 ;画面左下
postype = back
ownpal = 1
size.xscale = 1
size.yscale = 1
ID = 10

[state 2180, DNA出す基準ヘルパー2]
type = null;helper
trigger1 = animelem = 4
name = "dna_kijun"
stateno = 12180
pos = 0,25 ;画面左下
postype = back
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 20

[state 2180, DNA出す基準ヘルパー3]
type = null;helper
trigger1 = animelem = 4
name = "dna_kijun"
stateno = 12180
pos = 0,25 ;画面左下
postype = back
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 30

[state 2180, ステート変更]
type = changestate
trigger1 = time = 80
value = 2181
ctrl = 0


;-----------------------------------------------------------
;「DNAの瑕」終わり
[statedef 2181,]
type = S
movetype = I
physics = S
anim = 2181
ctrl = 0
ignorehitpause = 1

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


;-----------------------------------------------------------
;DNA出す基準ヘルパー
[statedef 12180]
type = A
movetype = I
physics = N
anim = 10430
ctrl = 0

[state 12180, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12180, 飛び出し方向決定]
type = varrandom
trigger1 = time = 0
v = 0
range = 1,6

[state 12180, 一番最初]
type = varset
trigger1 = time = 0
trigger1 = ishelper(5)
var(0) = 3

[state 12180, ]
type = varset
trigger1 = time = 0
trigger1 = ishelper(5)
var(4) = 1

[state 12180, テストスイッチ]
type = null;varset
trigger1 = time = 0
var(0) = 6

[state 12180, ]
type = null;posset
trigger1 = ishelper(10)
trigger1 = time < 180
trigger2 = ishelper(20)
trigger2 = time < 360
trigger3 = ishelper(30)
trigger3 = time < 540
x = -160
y = 30

[state 12180, 座標決定]
type = null
triggerall = time >= 0
trigger1 = var(0) = 1  ;右上方向
trigger1 = 1 || (var(1) := 0) ;x
trigger1 = 1 || (var(2) := 0) ;y
trigger1 = 1 || (var(3) := 0) ;+-決定
trigger2 = var(0) = 2  ;右下方向
trigger2 = 1 || (var(1) := 0)
trigger2 = 1 || (var(2) := 240)
trigger2 = 1 || (var(3) := 1)
trigger3 = var(0) = 3  ;上方向
trigger3 = 1 || (var(1) := ceil(parentdist x))
trigger3 = 1 || (var(2) := 20)
trigger3 = 1 || (var(3) := 0)
trigger4 = var(0) = 4  ;下方向
trigger4 = 1 || (var(1) := ceil(parentdist x))
trigger4 = 1 || (var(2) := 335)
trigger4 = 1 || (var(3) := 1)
trigger5 = var(0) = 5  ;前方向
trigger5 = 1 || (var(1) := 20)
trigger5 = 1 || (var(2) := 115)
trigger5 = 1 || (var(3) := 1)
trigger6 = var(0) = 6  ;後ろ方向
trigger6 = 1 || (var(1) := 340)
trigger6 = 1 || (var(2) := 115)
trigger6 = 1 || (var(3) := 1)

[state 12180, 発射位置移動]
type = posadd
trigger1 = time = 0
;trigger1 = ishelper(10)
;trigger1 = time = 180
;trigger2 = ishelper(20)
;trigger2 = time = 360
;trigger3 = ishelper(30)
;trigger3 = time = 540
x = ifelse(var(0) = 5,-1,1)*var(1)
y = ifelse(var(3) = 0,1,-1)*var(2)

[state 12180, 青]
type = helper
trigger1 = time = 0 || time = 30 || time = 60
;trigger1 = ishelper(10)
;trigger1 = time = 180 || time = 210 || time = 240
;trigger2 = ishelper(20)
;trigger2 = time = 360 || time = 390 || time = 420
;trigger3 = ishelper(30)
;trigger3 = time = 540 || time = 570 || time = 600
name = "dna"
stateno = 12181
pos = 0,0
postype = p1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12180

[state 12180, ピンク]
type = helper
trigger1 = time = 0 || time = 30 || time = 60
;trigger1 = ishelper(10)
;trigger1 = time = 180 || time = 210 || time = 240
;trigger2 = ishelper(20)
;trigger2 = time = 360 || time = 390 || time = 420
;trigger3 = ishelper(30)
;trigger3 = time = 540 || time = 570 || time = 600
name = "dna"
stateno = 12181
pos = 0,0
postype = p1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12181

[state 12180, 判定]
type = helper
trigger1 = time = 0
;trigger1 = ishelper(10)
;trigger1 = time = 180
;trigger2 = ishelper(20)
;trigger2 = time = 360
;trigger3 = ishelper(30)
;trigger3 = time = 540
name = "dna_hantei"
stateno = 12182
pos = 0,0
postype = p1
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
ID = 12182

[state 2180, ]
type = playsnd
trigger1 = time%15 = 0
;trigger1 = ishelper(10)
;trigger1 = time = [180,240]
;trigger1 = (time -180)%15 = 0
;trigger2 = ishelper(20)
;trigger2 = time = [360,420]
;trigger2 = (time -360)%15 = 0
;trigger3 = ishelper(30)
;trigger3 = time = [540,600]
;trigger3 = (time -540)%15 = 0
value = 2,10
channel = 1

[state 12180, ]
type = destroyself
trigger1 = time >= 80
;trigger1 = time > 250
;trigger1 = ishelper(10)
;trigger2 = time > 430
;trigger2 = ishelper(20)
;trigger3 = time > 610
;trigger3 = ishelper(30)



;-----------------------------------------------------------
;DNA
[statedef 12181]
type = A
movetype = I
physics = N
anim = 10430
ctrl = 0

[state 12181, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12181, ]
type = sprpriority
trigger1 = time = 0
value = 4

[state 12181, ]
type = changeanim
triggerall = time = 0
trigger1 = ishelper(12181)
value = 10431

[state 12181, 透過]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256

[state 12181, 出現位置調整1,2]
type = posadd
triggerall = time = 0
trigger1 = parent,var(0) = 1
trigger2 = parent,var(0) = 2
x = ifelse(parent,var(0) = 1,1,-1)*ifelse(ishelper(12180),1,-1)*ceil(70*cos(53*pi/180))
y = ifelse(ishelper(12180),1,-1)*ceil(70*sin(53*pi/180))

[state 12181, 出現位置調整3,4]
type = posadd
triggerall = time = 0
trigger1 = parent,var(0) = 3
trigger2 = parent,var(0) = 4
x = ifelse(parent,var(0) = 3,1,-1)*ifelse(ishelper(12180),1,-1)*70
;y = 0

[state 12181, 出現位置調整5,6]
type = posadd
triggerall = time = 0
trigger1 = parent,var(0) = 5
trigger2 = parent,var(0) = 6
x = 0
y = ifelse(parent,var(0) = 5,1,-1)*ifelse(ishelper(12180),1,-1)*70

[state 12181, 回転1,2]
type = angleset
triggerall = time >= 0
trigger1 = parent,var(0) = 1
trigger2 = parent,var(0) = 2
value = time*6+ifelse(ishelper(12180),1,-1)*ifelse(parent,var(0) = 1,37,323)

[state 12181, 回転3,4]
type = angleset
triggerall = time >= 0
trigger1 = parent,var(0) = 3
trigger2 = parent,var(0) = 4
value = time*6+ifelse(ishelper(12180),1,-1)*ifelse(parent,var(0) = 3,90,-90)

[state 12181, 回転5,6]
type = angleset
triggerall = time >= 0
trigger1 = parent,var(0) = 5
trigger2 = parent,var(0) = 6
value = time*6+ifelse(ishelper(12180),0,180)+ifelse(parent,var(0) = 5,0,-180)

[state 12181, 回転実行]
type = angledraw
trigger1 = 1

[state 12181, 速度1]
type = velset
trigger1 = time >= 0
trigger1 = parent,var(0) = 1
x = 10*cos(37*pi/180)-ifelse(ishelper(12180),1,-1)*15*sin(time*12*pi/180)*sin(37*pi/180)
y = -(10*sin(37*pi/180)+ifelse(ishelper(12180),1,-1)*15*sin(time*12*pi/180)*cos(37*pi/180))

[state 12181, 速度2]
type = velset
trigger1 = time >= 0
trigger1 = parent,var(0) = 2
x = 10*cos(323*pi/180)-ifelse(ishelper(12180),1,-1)*15*sin(time*12*pi/180)*sin(323*pi/180)
y = -(10*sin(323*pi/180)+ifelse(ishelper(12180),1,-1)*15*sin(time*12*pi/180)*cos(323*pi/180))

[state 12181, 速度3,4]
type = velset
triggerall = time >= 0
trigger1 = parent,var(0) = 3
trigger2 = parent,var(0) = 4
x = ifelse(parent,var(0) = 3,1,-1)*ifelse(ishelper(12180),-1,1)*15*sin(time*12*pi/180)
y = ifelse(parent,var(0) = 3,-1,1)*10

[state 12181, 速度5,6]
type = velset
triggerall = time >= 0
trigger1 = parent,var(0) = 5
trigger2 = parent,var(0) = 6
x = ifelse(parent,var(0) = 5,1,-1)*10
y = ifelse(parent,var(0) = 5,1,-1)*ifelse(ishelper(12180),-1,1)*15*sin(time*12*pi/180)

[state 12181, ]
type = sprpriority
trigger1 = time > 0
trigger1 = cos(time*12*pi/180) = ifelse(ishelper(12180),1,-1)
value = ifelse(ishelper(12180),6,5)+2*floor(time/30)

[state 12181, ]
type = afterimage
trigger1 = time = 0
time = 200
length = 30
timegap = 1
framegap = 4
palbright = 20,20,50
palcontrast = 256,256,256
paladd = 0,0,0
palmul = 1.00,1.00,1.00
trans = add

[state 12181, 消滅]
type = destroyself
triggerall = time > 70
trigger1 = screenpos y < -120
trigger2 = screenpos y > 360
trigger3 = screenpos x < -120
trigger4 = screenpos x > 440



;-----------------------------------------------------------
;DNA判定
[statedef 12182]
type = A
movetype = A
physics = N
anim = 12180
ctrl = 0

[state 12182, ]
type = varset
trigger1 = time = 0
trigger1 = parent,var(4) = 1
var(4) = 1

[state 12182, ]
type = varadd
triggerall = time >= 60
trigger1 = vel x = 0
trigger1 = vel y = 0
var(10) = 1

[state 12182, ]
type = varset
triggerall = time >= 60
trigger1 = vel x = 0
trigger1 = vel y = 0
trigger1 = var(10) >= 50+30
var(10) = 50+30

[state 12182, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 12182, エフェクト位置]
type = null
trigger1 = time >= 0
trigger1 = fvar(12) := p2dist x
trigger1 = fvar(13) := p2dist y + enemy,const(size.mid.pos.y)

[state 12182, ]
type = changeanim
trigger1 = time = 0
value = 12180+parent,var(0)

[state 12182, ]
type = velset
triggerall = time >= 0
trigger1 = parent,var(0) = 1
trigger2 = parent,var(0) = 2
x = ifelse(parent,var(0) = 1,10*cos(37*pi/180),10*cos(323*pi/180))
y = ifelse(parent,var(0) = 1,-10*sin(37*pi/180),-10*sin(323*pi/180))

[state 12182, ]
type = velset
triggerall = time >= 0
trigger1 = parent,var(0) = 3
trigger2 = parent,var(0) = 4
x = 0
y = ifelse(parent,var(0) = 3,-10,10)

[state 12182, ]
type = velset
triggerall = time >= 0
trigger1 = (parent,var(0) = 5) || (parent,var(0) = 6)
trigger1 = screenpos x < 480
trigger1 = screenpos x > -160
x = ifelse(parent,var(0) = 5,10,-10)
y = 0

[state 12182, 横方向途中停止]
type = velset
triggerall = (parent,var(0) = 5) || (parent,var(0) = 6)
trigger1 = screenpos x >= 480
trigger2 = screenpos x <= -160
x = 0
y = 0

[state 12182, 横方向停止後アニメ変更]
type = changeanim
triggerall = time >= 60
trigger1 = vel x = 0
trigger1 = vel y = 0
trigger1 = var(10) >= 30
value = ifelse(parent,var(0) = 5,22500,22560)+(var(10)-30)

[state 12182, ヒット定義]
type = hitdef
triggerall = time%10 = 0
trigger1 = var(4) = 0
trigger2 = var(4) = 1
trigger2 = time < 80
attr = A,HP
damage = ceil((root,fvar(10)*20)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 2,1
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,8
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 1
ground.hittime = 10
air.hittime = 10
ground.velocity = 0,-2
;guard.velocity = 1,0
air.velocity = 0,-1
ground.ctrltime = 20
guard.dist = 340

[state 12182, ヒット定義]
type = hitdef
trigger1 = time%10 = 0
trigger1 = time >= 80
trigger1 = var(4) = 1
attr = A,HP
damage = ceil((root,fvar(10)*20)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),10
getpower = 2,1
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,8
hitsound = S0,4
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 1
ground.hittime = 10
air.hittime = 10
ground.velocity = -4,-6
;guard.velocity = 1,0
air.velocity = -4,-6
ground.ctrltime = 20
guard.dist = 340

[state 12182, ダメージ格納]
type = null;parentvaradd
triggerall = (root,var(8) & (1023)) / (1) > 0
trigger1 = movecontact = 1
trigger2 = movehit = 1
var(8) = (1024)*ifelse(movehit = 1,ceil(60*root,fvar(10)),10)
ignorehitpause = 0

[state 12182, 補正]
type = null;parentvarset
trigger1 = movehit = 1
fvar(10) = root,fvar(10)*0.90
ignorehitpause = 0
;persistent = 0

[state 12182, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 12182
anim = 20065
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 3
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12182, グレイズ有効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) = [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) < 10))
movetype = I

[state 12182, グレイズ無効]
type = statetypeset
triggerall = numenemy > 0
trigger1 = (enemynear,stateno) != [100,119]
trigger2 = (((enemynear,stateno) = [5210,5219]) && ((enemynear,time) >= 10))
movetype = A

[state 12182, 消滅]
type = destroyself
triggerall = time > 70
trigger1 = numhelper(12180) = 0
trigger1 = numhelper(12181) = 0
trigger2 = var(10) = 50+30

[State 12182, Debug]
type = null;DisplayToClipBoard
trigger1 = 1
text = "Pos X=%f,velx=%f,anim=%d"
params = Pos X,vel x,anim
IgnoreHitpause = 1



;===============================================================================
;EX三姉妹
;===============================================================================
[statedef 2200]
type = S
movetype = A
physics = S
ctrl = 0
anim = 2200

[state 2200, ]
type = nothitby
trigger1 = animelem = 5,<0
value = ,AP

[state 2200, ]
type = nothitby
trigger1 = animelem = 5,>=0
trigger1 = animelem = 35,<=0
value = SCA

[state 2200, ]
type = nothitby
trigger1 = palno = 12
value = SCA

[state 2200, 暗転]
type = superpause
trigger1 = animelem = 3
anim = -1
sound = S4,0
time = 43
poweradd = -4000
movetime = 0
darken = 0

[state 2200, スペカ名]
type = helper
trigger1 = animelem = 3
name = "spell_name"
stateno = 22001
postype = p1
pos = 0,0
ownpal = 1
ID = 22001
ignorehitpause = 1
supermovetime = 1000

[state 2200, 魔方陣eff]
type = helper
trigger1 = animelem = 3
name = "spell"
stateno = 22000
pos = 2,-53
postype = p1
facing = 1
ownpal = 1
ID = 22000
supermovetime = 200

[state 2200, 茨1]
type = helper
trigger1 = animelem = 4
name = "ibara"
stateno = 12200
pos = 50,0
postype = p1
facing = 1
ownpal = 1
ID = 12200

[state 2200, 茨2]
type = helper
trigger1 = animelem = 4
name = "ibara"
stateno = 12200
pos = 20,-15
postype = p1
facing = 1
ownpal = 1
ID = 12201

[state 2200, 茨3]
type = helper
trigger1 = animelem = 4
name = "ibara"
stateno = 12200
pos = -20,-15
postype = p1
facing = 1
ownpal = 1
ID = 12202

[state 2200, 茨4]
type = helper
trigger1 = animelem = 4
name = "ibara"
stateno = 12200
pos = -50,0
postype = p1
facing = 1
ownpal = 1
ID = 12203

[state 2200, 茨5]
type = helper
trigger1 = animelem = 4
name = "ibara"
stateno = 12200
pos = -30,10
postype = p1
facing = 1
ownpal = 1
ID = 12204

[state 2200, 茨6]
type = helper
trigger1 = animelem = 4
name = "ibara"
stateno = 12200
pos = 30,10
postype = p1
facing = 1
ownpal = 1
ID = 12205

[state 2200, ヒット定義]
type = hitdef
trigger1 = animelem = 5,>=0
trigger1 = animelem = 35,<=0
attr = A,HA
damage = 0,0
getpower = 0,0
animtype = hard
guardflag = M
hitflag = MAF
priority = 5,hit
pausetime = 0,0
hitsound = S0,7
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 10
ground.hittime = 10
air.hittime = 10
ground.velocity = 0,0
;guard.velocity = -2,0
air.velocity = 0,0
ground.ctrltime = 20
guard.dist = 340
ID = 2200
persistent = 0

[state 2220, ヘルパー対象外]
type = targetdrop
trigger1 = numtarget(2200) > 0
trigger1 = target(2200),ishelper = 1

[state 2200, ステートを奪う]
type = targetstate
triggerall = numtarget(2200) > 0
trigger1 = target(2200),ishelper = 0
trigger1 = movehit = 1
value = 6080
ID = 2200
persistent = 0

[state 2202, ]
type = pause
trigger1 = numtarget(2165) > 0
trigger1 = movehit = 1
anim = -1
sound = -1
time = 60
darken = 0
movetime = 60

[state 2200, 失敗]
type = changestate
trigger1 = time = 210
value = 2201
ctrl = 0

[state 2200, 成功]
type = changestate
trigger1 = movehit = 1
trigger1 = numtarget(2200) > 0
value = 2202
ctrl = 0



;---------------------------------------
;三人娘終了
[statedef 2201]
type = S
movetype = I
physics = S
anim = 2201
ctrl = 0

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



;---------------------------------------
;成功
[statedef 2202]
type = S
movetype = I
physics = S
anim = 2202
ctrl = 0

[state 2202, 暗転用ヘルパー]
type = helper
trigger1 = time = 0
name = "helper"
stateno = 12169
ID = 12169
postype = p1
pos = 0,0
ownpal = 1
ignorehitpause = 1
supermovetime = 1000
pausemovetime = 1000

[state 2202, ]
type = playsnd
trigger1 = time = 0
value = 1,6

[state 2202, ]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 2202, ]
type = palfx
trigger1 = time <= 30
time = 1
mul = ceil(256-(time*8.53)),ceil(256-(time*8.53)),ceil(256-(time*8.53))
invertall = 0
color = 256

[state 2202, ]
type = palfx
trigger1 = time > 30
time = 1
mul = 0,0,0
invertall = 0
color = 256

[state 2202, ]
type = changestate
trigger1 = time >= 60
value = 2205



;---------------------------------------
;三人娘本番
[statedef 2205]
type = S
movetype = I
physics = S
anim = 2205
ctrl = 0

[state 2205, ]
type = playerpush
trigger1 = 1
value = 0

[state 2205, ]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[state 2205, ]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 2205, ]
type = posset
trigger1 = time < 650
x = 0
y = 0

[state 2205, ]
type = helper
trigger1 = time = 0
name = "koishi"
stateno = 2208
postype = p1
pos = -100,0
ownpal =1
ID = 2208
ignorehitpause = 1

[state 2205, ]
type = posadd
trigger1 = time = 650
x = -100
y = 0

[state 2205, ]
type = changestate
trigger1 = time = 660
value = 2206
ctrl = 0


;---------------------------------------
;こいし
[statedef 2208]
type = A
movetype = I
physics = N
anim = 2205
ctrl = 0

[state 2205, ]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 2205, ]
type = varset
trigger1 = time = 0
fvar(1) = pos x

[state 2205, ]
type = posset
trigger1 = time >= 0
x = ceil(fvar(1)) ;ifelse(screenpos x <= 160,-100,100)
y = 0

[state 2205, ]
type = null;posset
trigger1 = time > 0
x = ifelse(pos x = -100,-100,100)
y = 0

[state 2205, ]
type = playsnd
trigger1 = animelem = 12
value = 2,16

[state 2205, ]
type = null;playsnd
trigger1 = time = [60,150]
trigger1 = time%4 = 0
value = 0,5
channel = 1

[state 2000, バラエフェクト]
type = helper
trigger1 = time = [60,150]
trigger1 = time%4 = 0
name = "rose_eff"
stateno = 12201
postype = p1
pos = 100,-60
ownpal = 1
ID = 12201
ignorehitpause = 1

[state 2205, ]
type = trans
trigger1 = time = [125,145]
trans = addalpha
alpha = ceil(256-(time -125)*12.8),ceil((time -125)*12.8)
ignorehitpause = 1

[state 2205, ]
type = trans
trigger1 = time >= 145
trans = addalpha
alpha = 0,256
ignorehitpause = 1

[state 2205, ]
type = playerpush
trigger1 = time < 145
value = 1

[state 2205, フラン]
type = helper
trigger1 = time = 150
name = "fran"
stateno = 12205
postype = p1
pos = 25,-300
ownpal = 1
ID = 12205
ignorehitpause = 1

[state 2205, フラン斬撃エフェクト]
type = helper
trigger1 = time = 164
trigger2 = time = [235,355]
trigger2 = (time -227)%8 = 0
trigger3 = time = 365
name = "fran_eff"
stateno = 12202
postype = p1
pos = 100,-60
ownpal = 1
ID = 12202
ignorehitpause = 1

[state 2205, ]
type = envshake
trigger1 = time = 164
trigger2 = time = 365
time = 20
freq = 50
ampl = -2

[state 2205, ]
type = envshake
trigger1 = time = 235
time = 120
freq = 50
ampl = -2

[state 2205, ぬえ]
type = helper
trigger1 = time = 360
name = "nue-n"
stateno = 12210
postype = p1
pos = -25,-50
ownpal = 1
ID = 12210
ignorehitpause = 1

[state 2205, ]
type = envshake
trigger1 = time = 450
time = 100
freq = 50
ampl = -2

[state 2205, ]
type = envshake
trigger1 = time = 550
time = 100
freq = 60
ampl = -4

[state 2205, ]
type = destroyself
trigger1 = time = 660
value = 2206
ctrl = 0



;-------------------------------------------------
;三姉妹終了
[statedef 2206]
type = S
movetype = I
physics = S
anim = 2206
ctlr = 0
sprpriority = 12

[state 2206, ]
type = trans
trigger1 = time <= 20
trans = addalpha
alpha = ceil(time*12.8),ceil(256-time*12.8)
ignorehitpause = 1

[state 2206, ]
type = trans
trigger1 = time > 20
trans = addalpha
alpha = 256,0

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



;-------------------------------------------------
;茨
[statedef 12200]
type = A
movetype = I
physics = N
anim = 12015
ctrl = 0

[state 12200, ]
type = playsnd
trigger1 = time = 0
value = 1,8

[state 12200, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12200, ]
type = null
trigger1 = ishelper(12200)
trigger1 = 1 || (var(5) := 50) ;x
trigger1 = 1 || (var(6) := 0)  ;y
trigger1 = 1 || (var(7) := 0)  ;x+-
trigger1 = 1 || (var(8) := 0)  ;y+-
trigger2 = ishelper(12201)
trigger2 = 1 || (var(5) := 20)
trigger2 = 1 || (var(6) := 15)
trigger2 = 1 || (var(7) := 0)
trigger2 = 1 || (var(8) := 1)
trigger3 = ishelper(12202)
trigger3 = 1 || (var(5) := 20)
trigger3 = 1 || (var(6) := 15)
trigger3 = 1 || (var(7) := 1)
trigger3 = 1 || (var(8) := 1)
trigger4 = ishelper(12203)
trigger4 = 1 || (var(5) := 50)
trigger4 = 1 || (var(6) := 0)
trigger4 = 1 || (var(7) := 1)
trigger4 = 1 || (var(8) := 0)
trigger5 = ishelper(12204)
trigger5 = 1 || (var(5) := 30)
trigger5 = 1 || (var(6) := 10)
trigger5 = 1 || (var(7) := 1)
trigger5 = 1 || (var(8) := 0)
trigger6 = ishelper(12205)
trigger6 = 1 || (var(5) := 30)
trigger6 = 1 || (var(6) := 10)
trigger6 = 1 || (var(7) := 0)
trigger6 = 1 || (var(8) := 0)

[state 12200, ]
type = sprpriority
trigger1 = ishelper(12204) || ishelper(12205)
value = 6

[state 12200, ]
type = velset
trigger1 = time = 0
x = 0
y = -20

[state 12200, ]
type = velmul
trigger1 = time > 30
y = 0.8

[state 12200, ]
type = velset
trigger1 = vel y >= -1
x = 0
y = 0

[state 12200, ]
type = varadd
trigger1 = root,movetype = H
var(0) = 1

[state 12200, ]
type = palfx
trigger1 = root,stateno = 2202
time = 1
add = 0,0,0
mul = 0,0,0
invertall = 0
color = 256
pausemovetime = 9999

[state 12200, ]
type = varrandom
trigger1 = root,stateno = 2205
v = 10
range = 0,1
persistent = 0

[state 12200, 成功時時間測定]
type = varadd
trigger1 = root,stateno = 2205
var(15) = 1

[state 12200, ]
type = changeanim
trigger1 = root,stateno = 2205
value = ifelse(var(10) = 0,12202,12203)
pausemovetime = 9999

[state 12200, ]
type = posset
trigger1 = root,stateno = 2205
x = ifelse(var(7) = 0,1,-1)*var(5)
y = ifelse(var(8) = 0,1,-1)*var(6)+30

[state 12200, ]
type = varadd
trigger1 = time >= 120
trigger1 = root,stateno = 2200
trigger2 = var(0) > 0
trigger3 = root,stateno = 2206
trigger4 = var(15) >= 550
var(1) = 1

[state 12200, ]
type = trans
trigger1 = var(1) > 0
trans = addalpha
alpha = ceil(256-var(1)*12.8),ceil(var(1)*12.8)
ignorehitpause = 1

[state 12200, ]
type = destroyself
trigger1 = var(1) >= 20



;-------------------------------------------------
;バラエフェクト
[statedef 12201]
type = A
movetype = I
physics = N
anim = 12201
ctrl = 0
sprpriority = 6

[state 12201, ]
type = playsnd
trigger1 = time = 0
value = 0,5

[state 12201, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12201, ]
type = varrandom
trigger1 = time = 0
v = 0
range = 0,40

[state 12201, ]
type = varrandom
trigger1 = time = 0
v = 1
range = 0,40

[state 12201, ]
type = posadd
trigger1 = time = 0
x = var(0)-20
y = var(1)-20

[state 12201, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12201, ]
type = angledraw
trigger1 = 1
scale = 0.2,0.2

[state 12201, 花弁1]
type = projectile
trigger1 = time = 5
projID = 12020
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12201, 花弁2]
type = projectile
trigger1 = time = 5
projID = 12020
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = -random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12201, 花弁3]
type = projectile
trigger1 = time = 5
projID = 12020
projanim = 12011
projscale = 0.3,0.3
projremovetime = 60
velocity = ifelse(random >= 499, 1, -1)*random*0.001, -random*0.002
accel = 0, 0.05
offset = 0, 0
projsprpriority = 7

[state 12201, ]
type = destroyself
trigger1 = time = 5



;-------------------------------------------------
;フラン斬撃エフェクト
[statedef 12202]
type = A
movetype = I
physics = N
anim = 20080
ctrl = 0
sprpriority = 6

[state 12202, ]
type = playsnd
trigger1 = time = 0
value = 0,7

[state 12202, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 12202, ]
type = varrandom
trigger1 = time = 0
v = 0
range = 0,40

[state 12202, ]
type = varrandom
trigger1 = time = 0
v = 1
range = 0,40

[state 12202, ]
type = varrandom
trigger1 = time = 0
v = 2
range = 0,179

[state 12202, ]
type = posadd
trigger1 = time = 0
x = var(0)-20
y = var(1)-20

[state 12202, ]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 12202, ]
type = angleset
trigger1 = 1
value = var(2)

[state 12202, ]
type = angledraw
trigger1 = 1
scale = 3,3

[state 12202, ]
type = destroyself
trigger1 = animtime = 0


;-------------------------------------------------
;フラン
[statedef 12205]
type = A
movetype = I
physics = N
anim = 2210
ctrl = 0
sprpriority = 10

[state 12205, ]
type = velset
trigger1 = time = 0
x = 0
y = 20

[state 12205, 着地]
type = posset
trigger1 = pos y >= -25
y = -25

[state 12205, ]
type = changeanim
trigger1 = pos y = -25
value = 2211
persistent = 0

[state 12205, 着地音]
type = playsnd
trigger1 = pos y = -25
value = 3,0
persistent = 0

[state 12205, 最初の斬撃]
type = null;playsnd
trigger1 = pos y = -25
value = 0,7
persistent = 0

[state 12205, 振り回し]
type = playsnd
trigger1 = animelem = 5,>=0
trigger1 = animelem = 14,<=0
value = 1,0
channel = 1
persistent = 5

[state 12205, 連続切り]
type = null;playsnd
trigger1 = animelem = 18,>=0
trigger1 = animelem = 78,<=0
value = 0,7
persistent = 8

[state 12205, 連続振り音]
type = playsnd
trigger1 = animelem = 18,>=0
trigger1 = animelem = 78,<=0
value = 1,2
persistent = 8

[state 12205, 最後の切り]
type = null;playsnd
trigger1 = animelem = 82
value = 0,7
persistent = 0

[state 12205, 最後の振り]
type = playsnd
trigger1 = animelem = 82
value = 1,2
persistent = 0

[state 12205, ]
type = velset
trigger1 = animelem = 82
x = 0
y = -20

[state 12205, ]
type = destroyself
trigger1 = time > 30
trigger1 = pos y <= -400



;-------------------------------------------------
;ぬえ
[statedef 12210]
type = A
movetype = A
physics = N
anim = 2220
ctrl = 0
sprpriority = 10

[state 12210, エフェクト位置]
type = null
triggerall = time >= 0
trigger1 = fvar(12) := p2dist x
trigger1 = fvar(13) := p2dist y + enemy,const(size.mid.pos.y)

[state 12210, ]
type = playsnd
trigger1 = time = 0
value = 4,7

[state 12210, ]
type = trans
trigger1 = time <= 20
trans = addalpha
alpha = ceil(time*12.8),ceil(256-time*12.8)

[state 12210, ]
type = trans
trigger1 = time > 20
trigger1 = time < 300
trans = addalpha
alpha = 256,0

[state 12210, ]
type = trans
trigger1 = time >= 300
trans = addalpha
alpha = ceil(256-(time -300)*25.8),ceil((time -300)*25.8)

[state 12210, ufo]
type = helper
trigger1 = time = 0
name = "ufo_b"
stateno = 12211
postype = p1
pos = 30,-38
ownpal = 1
ID = 12211
ignorehitpause = 1

[state 12210, ufo]
type = helper
trigger1 = time = 0
name = "ufo_g"
stateno = 12211
postype = p1
pos = 30,-38
ownpal = 1
ID = 12212
ignorehitpause = 1

[state 12210, ufo]
type = helper
trigger1 = time = 0
name = "ufo_r"
stateno = 12211
postype = p1
pos = 30,-38
ownpal = 1
ID = 12213
ignorehitpause = 1

[state 12210, ]
type = changeanim
trigger1 = time = 60
value = 2221

[state 12210, チャージ]
type = playsnd
trigger1 = time = 30
trigger2 = time = 130
value = 2,6

[state 12210, 1]
type = changeanim
trigger1 = time = 90
value = 2225

[state 12210, マスパ1]
type = playsnd
trigger1 = time = 90
value = 2,17

[state 12210, マスパ1]
type = explod
trigger1 = time = 90
ID = 12210
anim = 12200
postype = p1
pos = 30,-40
velocity = 0,0
ownpal = 1
sprpriority = 9
scale = 3,0.4
removetime = 100

[state 12210, ヒット定義1]
type = hitdef
trigger1 = anim = 2225
attr = A,HP
damage = ceil((root,fvar(10)*4)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),1
getpower = 0,2
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,2
hitsound = -1;S0,8
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 1
ground.hittime = 10
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
ground.ctrltime = 20
guard.dist = 340
persistent = 3

[state 12210, 2]
type = changeanim
trigger1 = time = 190
value = 2226

[state 12210, マスパ2]
type = playsnd
trigger1 = time = 190
value = 2,18

[state 12210, マスパ2]
type = explod
trigger1 = time = 190
ID = 12211
anim = 12200
postype = p1
pos = 30,-40
velocity = 0,0
ownpal = 1
sprpriority = 9
scale = 3,1
removetime = 105

[state 12210, ヒット定義2]
type = hitdef
trigger1 = anim = 2226
trigger1 = time < 235
attr = A,HP
damage = ceil((root,fvar(10)*6)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),2
getpower = 0,2
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,2
hitsound = -1;S0,8
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 1
ground.hittime = 10
air.hittime = 10
ground.velocity = -6,0
air.velocity = -6,0
ground.ctrltime = 20
guard.dist = 340
persistent = 3

[state 12210, ヒット定義2]
type = hitdef
trigger1 = anim = 2226
trigger1 = time >= 235
attr = A,HP
damage = ceil((root,fvar(10)*6)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),2
getpower = 0,3
animtype = hard
guardflag = MA
hitflag = MAF
priority = 5,hit
pausetime = 0,2
hitsound = -1;S0,8
guardsound = S2,0
sparkno = -1;S20075
sparkxy = -1;0,0
groundtype = high
ground.slidetime = 1
ground.hittime = 10
air.hittime = 10
ground.velocity = -6,-5
air.velocity = -6,-5
ground.ctrltime = 20
guard.dist = 340
fall = 1
fall.recover = 0
persistent = 3

[state 12210, ヒットエフェクト]
type = explod
trigger1 = movehit = 1
ID = 12212
anim = 20070
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 0,0
ownpal = 1
sprpriority = 5
scale = 1,1
removetime = -2
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 12210, 3]
type = changeanim
trigger1 = time = 295
value = 2227

[state 12210, ]
type = destroyself
trigger1 = time = 310



;-------------------------------------------------
;UFO
[statedef 12211]
type = A
movetype = I
physics = N
anim = 2222
ctrl = 0
sprpriority = 10

[state 12211, UFO色指定]
type = changeanim
trigger1 = time = 0
value = ifelse(ishelper(12211),2222,ifelse(ishelper(12212),2223,2224))
ignorehitpause = 1

[state 12211, ]
type = trans
trigger1 = time <= 20
trans = addalpha
alpha = ceil(time*12.8),ceil(256-time*12.8)

[state 12211, ]
type = trans
trigger1 = time > 20
trigger1 = time < 300
trans = addalpha
alpha = 256,0

[state 12211, ]
type = trans
trigger1 = time > 310
trans = addalpha
alpha = 0,256

[state 12211, ]
type = trans
trigger1 = time = [300,310]
trans = addalpha
alpha = ceil(256-(time -300)*25.8),ceil((time -300)*25.8)

[state 12211, 回転速度]
type = varset
trigger1 = time = 0
var(0) = 6

[state 12211, 回転速度]
type = varadd
trigger1 = time = [30,40]
trigger2 = time = [130,140]
var(0) = 1
persistent = 2

[state 12211, ずらし]
type = null
triggerall = time = 0
trigger1 = ishelper(12211)
trigger1 = 1 || var(1) := 0
trigger2 = ishelper(12212)
trigger2 = var(1) := 120
trigger3 = ishelper(12213)
trigger3 = var(1) := 240

[state 12211, ]
type = bindtoparent
trigger1 = 1
time = 1
facing = 0
pos = ceil(30+15*cos((-time*var(0)+var(1))*pi/180)),ceil(-40+80*sin((-time*var(0)+var(1))*pi/180))
ignorehitpause = 1

[state 12211, ]
type = sprpriority
trigger1 = 1
value = ifelse(cos((-time*var(0)+var(1))*pi/180) <= 0,12,2)

[state 12211, ]
type = angledraw
trigger1 = 1
scale = 0.4,0.4

[state 12211, ]
type = destroyself
trigger1 = time > 0
trigger1 = numhelper(12210) = 0




