;=========================================================================================================================================================
; 必殺技
;=========================================================================================================================================================
;---------------------------------------------------------------------------
; カンフーマンを代表する必殺技『カンフー突き手』。
; 最初に公開されたM.U.G.E.N（1999/1/1当時のMS-DOS版）では
; この技と超必殺技の『三烈カンフー突き手』しか持ってなかった。
;
;「P2BodyDist」は「自分から相手までの距離」を測るトリガー。
; Bodyの記述が無い「P2Dist」の場合は、
;「自分の軸位置から相手の軸位置との距離」を測る。
;---------------------------------------------------------------------------
;===============================================================================
;ゼンマイB昇竜623b
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1000
;poweradd = 20
sprpriority = 2
facep2 = 1

[state 1000, ]
type = nothitby
trigger1 = ((var(8) & (1023)) / (1)) > 0
trigger1 = animelem = 4,<=0
value = ,AA,AP

[state 1000, 霊力消費]
type = varadd
trigger1 = animelem = 3
var(10) = -200

[state 1000, 霊力停止時間]
type = varset
trigger1 = animelem = 3
var(11) = 120

[State 1000, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 4
value = 1, 0

[state 1000, ゼンマイ出現]
type = helper
trigger1 = animelem = 4
name = "zenmai"
stateno = 11000
pos = 50,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 11000

[State 1000, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


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

[state 11000,エフェクト位置]
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 11000, ]
type = playsnd
trigger1 = time = 0
value = 1,8

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

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

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

[state 11000, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 11000
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 11000, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 11000, 消す]
type = destroyself
trigger1 = root,stateno = [5000, 5150]
trigger2 = time = 56


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

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

[state 11000, グレイズ音]
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



;===============================================================================
;ゼンマイC昇竜623c
[Statedef 1005]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1000
;poweradd = 20
sprpriority = 2
facep2 = 1

[state 1005, ]
type = nothitby
trigger1 = ((var(8) & (1023)) / (1)) > 0
trigger1 = animelem = 4,<=0
value = ,AA,AP

[state 1005, 霊力消費]
type = varadd
trigger1 = animelem = 3
var(10) = -200

[state 1005, 霊力停止時間]
type = varset
trigger1 = animelem = 3
var(11) = 120

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

[State 1005, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 4
value = 1,0

[state 1005, Cゼンマイ1出現]
type = helper
trigger1 = animelem = 4
name = "zenmai"
stateno = 11005
pos = 50,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 11005
ignorehitpause = 1

[state 1005, Cゼンマイ2出現]
type = helper
trigger1 = animelem = 4
name = "zenmai"
stateno = 11005
pos = 115,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 11006
ignorehitpause = 1

[State 1005, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;-------------------------------------------------------------------------------
;Cゼンマイ
[statedef 11005]
type = A
movetype = A
physics = N
anim = 11000
ctrl = 0
sprpriority = 5

[state 11005,エフェクト位置]
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 11005, ]
type = playsnd
trigger1 = time = 0
value = 1,8

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

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

[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)),2)
ignorehitpause = 0

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

[state 11005, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 11005
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 11005, 影消し]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 11005, 消す]
type = destroyself
trigger1 = root,stateno = [5000, 5150]
trigger2 = time = 56


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

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

[state 11005, グレイズ音]
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



;===============================================================================
;Bユクゾ421b
[Statedef 1010]
type    = S
movetype= I
physics = S
;poweradd= 120
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

[state 1010, 霊力消費]
type = varadd
trigger1 = animelem = 3
var(10) = -200

[state 1010, 霊力停止時間]
type = varset
trigger1 = animelem = 3
var(11) = 120

[State 1010, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 3
value = 1,4

[State 1010, 移動1]
type = veladd
trigger1 = AnimElem = 2
x = 1

[State 1010, 移動2]
type = veladd
trigger1 = AnimElem = 3
x = 2

[State 1010, 移動3]
type = veladd
trigger1 = AnimElem = 4
x = 20

[State 1010, 移動4]
type = veladd
trigger1 = AnimElem = 5
x = 2

[State 1010, 移動5]
type = veladd
trigger1 = AnimElem = 6
x = 1

[state 1010, 無敵設定]
type = hitby
trigger1 = time = [3,30]
value = S,AT

[state 1010, すり抜け]
type = playerpush
trigger1 = time = [3,30]
value = 0

[State 1010, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;===============================================================================
;Cユクゾ421c
[Statedef 1015]
type    = S
movetype= I
physics = S
;poweradd= 120
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

[state 1015, 霊力消費]
type = varadd
trigger1 = animelem = 3
var(10) = -200

[state 1015, 霊力停止時間]
type = varset
trigger1 = animelem = 3
var(11) = 120

[State 1015, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 3
value = 1,4

[State 1015, 移動1]
type = veladd
trigger1 = AnimElem = 2
x = -1

[State 1015, 移動2]
type = veladd
trigger1 = AnimElem = 3
x = -2

[State 1015, 移動3]
type = veladd
trigger1 = AnimElem = 4
x = -20

[State 1015, 移動4]
type = veladd
trigger1 = AnimElem = 5
x = -2

[State 1015, 移動5]
type = veladd
trigger1 = AnimElem = 6
x = -1

[state 1015, 無敵設定]
type = hitby
trigger1 = time = [3,30]
value = S,AT

[state 1015, すり抜け]
type = playerpush
trigger1 = time = [3,30]
value = 0

[State 1015, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;===============================================================================
;打撃当身214b
[statedef 1030]
type = S
movetype = I
physics = S
velset = 0, 0
ctrl = 0
anim = 1030

[state 1030, 霊力消費]
type = varadd
trigger1 = animelem = 2
var(10) = -200

[state 1030, 霊力停止時間]
type = varset
trigger1 = animelem = 2
var(11) = 120

[state 1036, ]
type = nothitby
trigger1 = animelem = 2
value = ,NA,SA

[state 1030, 当身設定]
type = reversaldef
trigger1 = animelem = 2
reversal.attr = SCA,NA,SA
pausetime = 0,60
sparkno = -1
sparkxy = 0,0
p1stateno = 1031

[State 1030, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;-------------------------------------------------------------------------------
;B当身攻撃
[statedef 1031]
type = S
movetype = I
physics = S
anim = 1031
ctrl = 0

[state 1031, ]
type = playsnd
trigger1 = time = 0
value = 1,7

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

[state 1031, g1]
type = helper
trigger1 = time = 22
name = "zenmai"
stateno = 12082
pos = 20,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 11031;12082
persistent = 0

[state 1031, g-1]
type = helper
trigger1 = time = 22
name = "zenmai"
stateno = 12082
pos = -20,0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5
ID = 11032;12085
persistent = 0

[state 1031, ]
type = changeanim
trigger1 = time = 50
value = 1032

[state 1031, 移動]
type = posadd
trigger1 = time = 50
x = ceil(p2dist x +50)
y = 0

[state 1031, 振り向き]
type = turn
trigger1 = time = 50

[State 1030, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = anim = 1032
value = 0
ctrl = 1


;===============================================================================
;射撃当身214c
[statedef 1035]
type = S
movetype = A
physics = S
velset = 0, 0
ctrl = 0
anim = 1030

[state 1035, 霊力消費]
type = varadd
trigger1 = animelem = 2
var(10) = -200

[state 1035, 霊力停止時間]
type = varset
trigger1 = animelem = 2
var(11) = 120

[state 1036, ]
type = nothitby
trigger1 = animelem = 2
value = ,NP,SP

[state 1035, 当身設定]
type = hitoverride
trigger1 = animelem = 2
attr = SCA,NP,SP
stateno = 1036
time = 20
;pausetime = 0,0
;sparkno = -1
;sparkxy = 0,0
;p1stateno = 1036

[State 1035, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;-------------------------------------------------------------------------------
;C当身攻撃
[statedef 1036]
type = S
movetype = I
physics = S
anim = 1036
ctrl = 0

[state 1036, ]
type = playsnd
trigger1 = time = 0
value = 1,7

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

[state 1036, 音を鳴らす]
type = playsnd
trigger1 = time = 22
value = 1,3

[state 1036, 消える]
type = trans
trigger1 = time = [21,45]
trans = addalpha
alpha = 0,256

[state 1036, 魚]
type = helper
triggerall = time >= 22
trigger1 = time%3 = 0
trigger1 = time <= 40
name = "fish"
stateno = 12081
pos = 0,0
ownpal = 1
size.xscale = 0.6
size.yscale = 0.6
ID = 1036

[state 1036, ]
type = changeanim
trigger1 = time = 45
value = 1037

[state 1036, 上空]
type = statetypeset
trigger1 = time = 45
statetype = A
movetype = I
physics = A

[state 1036, 上空へ移動]
type = posadd
trigger1 = time = 45
x = 0
y = -30

[state 1036, ]
type = velset
trigger1 = time = 45
x = 0
y = -5



;===============================================================================
;B設置22b
[statedef 1040]
type = S
movetype = A
physics = S
velset = 0, 0
ctrl = 0
anim = 1040

[state 1040, 霊力消費]
type = varadd
trigger1 = animelem = 6
var(10) = -200

[state 1040, 霊力停止時間]
type = varset
trigger1 = animelem = 6
var(11) = 120

[state 1040, 幽霊]
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 1040, se]
type = playsnd
trigger1 = animelem = 6
value = 1, 5

[State 1040, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;===============================================================================
;C設置22c
[statedef 1045]
type = S
movetype = A
physics = S
velset = 0, 0
ctrl = 0
anim = 1040

[state 1045, 霊力消費]
type = varadd
trigger1 = animelem = 6
var(10) = -200

[state 1045, 霊力停止時間]
type = varset
trigger1 = animelem = 6
var(11) = 120

[state 1045, 幽霊]
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 1045, se]
type = playsnd
trigger1 = animelem = 6
value = 1, 5

[State 1045, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;-------------------------------------------------------------------------------
;幽霊
[statedef 11040]
type = A
movetype = A
physics = N
anim = 11040
ctrl = 0
sprpriority = 5

[state 11040, ご先祖撒きイド時スイッチ]
type = varset
trigger1 = root,stateno = 2060
trigger1 = time = 0
trigger1 = ((root,var(8) & (1023)) / (1)) > 0
var(4) = 1

[state 11040, ご先祖撒きイド時時間測定]
type = varadd
trigger1 = var(4) = 1
var(5) = 1

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

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

[state 11040, フィロソフィ戻りの速度設定]
type = velset
triggerall = time = 0
trigger1 = prevstateno = 12020
trigger2 = prevstateno = 12021
x = 0
y = 0.1

[state 11040, B速度設定1]
type = velset
trigger1 = root,stateno = 1040
trigger1 = time <= 20
x = 3*cos(15*pi/180)
y = -3*sin(15*pi/180)+ time/15

[state 11040, C速度設定1]
type = velset
trigger1 = root,stateno = 1045
trigger1 = time <= 20
x = 3*cos(75*pi/180)
y = -3*sin(75*pi/180)+ time/15

[state 11040, ご先祖撒き速度設定1]
type = velset
trigger1 = root,stateno = 2060
trigger1 = time = 0
trigger1 = var(5) = 0
x = 3*cos((0.135*random+0.01)*pi/180)
y = -3*sin((0.135*random+0.01)*pi/180)+ time/15

[state 11040, 速度設定2]
type = velset
trigger1 = time > 20
trigger1 = var(5) = 0
x = 0
y = 0.2

[state 11040, イド時ご先祖撒き速度設定]
type = velset
trigger1 = var(5) > 0
trigger1 = time = 0
x = 3*cos((0.12*random -30+0.01)*pi/180)
y = -3*sin((0.12*random -30+0.01)*pi/180)+ time/15

[state 11040, ]
type = velset
trigger1 = var(5) >= 20
trigger1 = var(5) < 30
x = 0
y = 0

[state 11040, ]
type = velset
trigger1 = var(5) >= 30
x = 0
y = 0.2

[state 11040, レーザー]
type = helper
trigger1 = var(5) = 20
name = "beam"
stateno = 11044
postype = p1
pos = 0,0
postype = p1
ownpal = 1
ID = 11044

[state 11040, 攻撃設定]
type = hitdef
trigger1 = time = 0
attr = A,SP
damage = ceil((root,fvar(10)*40)*ifelse((root,var(14) & (3932160))/(262144) = 0, 1, 1.1*(log(2,(root,var(14) & (3932160))/(262144) +1)))),0
getpower = 20,10
hitflag = MAFP
guardflag = MA
animtype = hard
priority = 3,hit
pausetime = 0,8
hitsound = S0,4
guardsound = S2,0
sparkno = S20060
;sparkxy = 0,0;-10, -58
ground.slidetime = 5
ground.hittime = 20
ground.velocity = -2
guard.hittime = 10
ground.ctrltime = 10
guard.velocity = -2
air.velocity = -3,-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(40*root,fvar(10)),0)
ignorehitpause = 1
persistent = 0

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

[state 11040, ハート1]
type = projectile
trigger1 = movecontact
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 11040, ハート2]
type = projectile
trigger1 = movecontact
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 11040, ハート3]
type = projectile
trigger1 = movecontact
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 11040, 飛び道具だけにあたる]
type = nothitby
trigger1 = 1
value = ,AA,AT

[state 11040, 消える]
type = destroyself
triggerall = time >= 0
trigger1 = screenpos Y > 235
trigger2 = root,stateno = [5000,5150]

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

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

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

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

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

[state 11040, 爆発effhct]
type = helper
trigger1 = movecontact
name = "effect"
stateno = 11043
ownpal = 1
ID = 11043

[state 11040, 2C爆発移行]
type = changestate
trigger1 = root,stateno = 420
trigger1 = root,animelem = 4
value = 11046

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

[state 11040, 嫌われ者のフィロソフィ]
type = changestate
triggerall = (root,var(14) & (536870912)) = (536870912)
trigger1 = vel y = 0.2
trigger1 = rootdist x = [-40,40] ;x方向接近
value = 12020

[state 11040, 憑依へ]
type = changestate
trigger1 = movecontact
value = 11048


[statedef 11041];ヘルパー相殺2
type = A
movetype = I
physics = N
anim = 11040
ctrl = 0
sprpriority = 5

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


[statedef 11042];グレイズ消滅
type = A
movetype = I
physics = N
ctrl = 0

[state 11042, ]
type = destroyself
trigger1 = 1


;-------------------------------------------------------------------------------
;2C爆発effect
[statedef 11043]
type = A
movetype = I
physics = N
anim = 11042
ctrl = 0

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

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

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

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



;-----------------------------------------------------------
;レーザー
[statedef 11044]
type = A
movetype = A
physics = N
anim = 12060
ctrl = 0

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

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

[state 11044, ]
type = velset
trigger1 = time = 0
x = 8

[state 11044, 角度実行]
type = angledraw
trigger1 = 1
scale = 0.6,0.6

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

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

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

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

[state 11044, ハート1]
type = projectile
trigger1 = movecontact = 1
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 11044, ハート2]
type = projectile
trigger1 = movecontact = 1
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 11044, ハート3]
type = projectile
trigger1 = movecontact = 1
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 11044, ヘルパーを消す]
type = destroyself
trigger1 = screenpos x < 0
trigger2 = screenpos x > 340

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

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

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



;-------------------------------------------------------------------------------
;当たり判定
[statedef 11046]
type = A
movetype = A
physics = N
anim = 11043
ctrl = 0

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

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

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

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

[state 11046, 攻撃設定]
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 = 35,20
hitflag = MAFP
guardflag = MA
animtype = back
priority = 4,hit
pausetime = 0,9
hitsound = S0,2
guardsound = S2,0
sparkno = -1;S20060
;sparkxy = -1;-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(50*root,fvar(10)),10)
ignorehitpause = 1
persistent = 0

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

[state 11046, エフェクト表示]
type = explod
trigger1 = movehit = 1
ID = 11000
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 11046, ハート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 11046, ハート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 11046, ハート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 11046, 飛び道具だけにあたる]
type = nothitby
trigger1 = 1
value = ,AA,AT

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

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

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

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

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

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

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

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


;-------------------------------------------------------------------------------
;幽霊憑依
[statedef 11048]
type = A
movetype = I
physics = N
anim = 11041
ctrl = 0

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

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

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

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

[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 11048, ]
type = sprpriority
trigger1 = sin(3*time*pi/180) > 0
value = 5

[state 11048, ]
type = sprpriority
trigger1 = sin(3*time*pi/180) < 0
value = -1

[state 11048, 2C]
type = changestate
trigger1 = root,stateno = 420
trigger1 = root,animelem = 4
value = 11046

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

[state 11048, 嫌われ者のフィロソフィ]
type = changestate
triggerall = (root,var(14) & (536870912)) = (536870912)
trigger1 = rootdist x = [-40,40] ;x方向接近
value = 12022

[state 11048, ]
type = destroyself
trigger1 = time = ifelse((root,var(8) & (1023)) / (1) = 0,600,720)
trigger2 = (root,stateno = [5000,5150]) && ((root,var(8) & (1023)) / (1) = 0)



;===============================================================================
;突進パラノイアB236b
[statedef 1050]
type = S
movetype = A
physics = S
vel = 0,0
ctrl = 0
anim = 1050

[state 1050, ]
type = nothitby
trigger1 = ((var(8) & (1023)) / (1)) > 0
value = ,AP

[state 1050, 霊力消費]
type = varadd
trigger1 = animelem = 6
var(10) = -200

[state 1050, 霊力停止時間]
type = varset
trigger1 = animelem = 6
var(11) = 120

[state 1050, 消滅]
type = trans
;trigger1 = time <= 16
trigger1 = animelem = 2,>=0 && animelem = 5,<0
trans = addalpha
alpha = 256-floor((time -4)*16),floor((time -4)*16)

[state 1050, 消滅]
type = trans
trigger1 = animelem = 5,>=0 && animelem = 6,<0;time = [16,17]
trans = addalpha
alpha = 0,256

[state 1050, 出現]
type = trans
trigger1 = animelem = 6,>=0 && animelem = 9,<0;time = [18,34]
trans = addalpha
alpha = floor((time -22)*16),256-floor((time -22)*16)

[state 1050 ,]
type = assertspecial
trigger1 = animelem = 3,>=0 && animelem = 8,<0;[12,22]
flag = noshadow

[state 1050, ]
type = velset
trigger1 = animelem = 6,>=0 && animelem = 9,<0;time = [19,35];[19,54]
x = 8;4

[state 1050, ]
type = velset
trigger1 = animelem = 9,>=0 && animelem = 14,<0
x = 4;(8-0.3*(time - 34))

[state 1050, ]
type = velset
trigger1 = animelem = 14,>=0;time = [46,54]
x = 2

[state 1050, ]
type = veladd
trigger1 = animelem = 15
x = 1

[state 1050, ]
type = velset
trigger1 = animelem = 17
x = 0

[state 1050, ]
type = playsnd
trigger1 = animelem = 6;time = 18
value = 2,7

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

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

[state 1050, ]
type = null;varset
trigger1 = time = 32
trigger1 = var(1) = 0
var(1) = 1

[state 1050, ]
type = varset
trigger1 = animelem = 12;time = 41
trigger1 = var(1) < 6
var(1) = 6

[state 1050, 攻撃設定]
type = hitdef
trigger1 = var(1) = 0
trigger2 = var(1) = 3
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -1,-2
air.velocity = -1,-1
fall = 1
fall.recovertime = 40

[state 1050, 攻撃設定]
type = hitdef
trigger1 = var(1) = 6
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2,-4
air.velocity = -2,-6
guard.hittime = 20
guard.ctrltime = 15
fall = 1
fall.recovertime = 40

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

[state 1050, 補正]
type = varset
trigger1 = movehit = 1
fvar(10) = fvar(10)*0.95
ignorehitpause = 0
;persistent = 0

[state 1050, クナイeffect選別1]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 4
range = 0,11

[state 1050, クナイeffect選別2]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 5
range = 0,11

[state 1050, クナイeffect選別3]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 6
range = 0,11

[state 1050, クナイ1]
type = explod
trigger1 = movehit = 1
ID = 1050
anim = 11051+var(4)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(4)*pi/180),-5*sin(30*var(4)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1050, クナイ2]
type = explod
trigger1 = movehit = 1
ID = 1051
anim = 11051+var(5)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(5)*pi/180),-5*sin(30*var(5)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1050, クナイ3]
type = explod
trigger1 = movehit = 1
ID = 1052
anim = 11051+var(6)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(6)*pi/180),-5*sin(30*var(6)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1050, effect]
type = helper
trigger1 = animelem = 6;time = 22
name = "kaiten"
stateno = 11056
ID = 11056
pos = 42,-60
postype = p1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

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



;===============================================================================
;空中突進パラノイアB236b
[statedef 1051]
type = A
movetype = A
physics = A
vel = 0,0
ctrl = 0
anim = 1051

[state 1051, ]
type = nothitby
trigger1 = ((var(8) & (1023)) / (1)) > 0
value = ,AP

[state 1051, 霊力消費]
type = varadd
trigger1 = animelem = 6
var(10) = -200

[state 1051, 霊力停止時間]
type = varset
trigger1 = animelem = 6
var(11) = 120

[state 1051, 消滅]
type = trans
;trigger1 = time <= 16
trigger1 = animelem = 2,>=0 && animelem = 5,<0
trans = addalpha
alpha = 256-floor((time -4)*16),floor((time -4)*16)

[state 1051, 消滅]
type = trans
trigger1 = animelem = 5,>=0 && animelem = 6,<0;time = [16,17]
trans = addalpha
alpha = 0,256

[state 1051, 出現]
type = trans
trigger1 = animelem = 6,>=0 && animelem = 9,<0;time = [18,34]
trans = addalpha
alpha = floor((time -22)*16),256-floor((time -22)*16)

[state 1051 ,]
type = assertspecial
trigger1 = animelem = 3,>=0 && animelem = 8,<0;time = [12,22]
flag = noshadow

[state 1051, ]
type = velset
trigger1 = animelem = 6,>=0 && animelem = 9,<0;time = [19,35];[19,54]
x = 8;4

[state 1051, ]
type = velset
trigger1 = animelem = 9,>=0 && animelem = 13,<0;time = [36,44]
x = 4;8-0.3*(time - 34)

[state 1051, ]
type = velset
trigger1 = animelem = 13;time >= 46
x = 2

[state 1051, ]
type = playsnd
trigger1 = animelem = 6;time = 18
value = 2,7

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

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

[state 1051, ]
type = null;varset
trigger1 = time = 32
trigger1 = var(1) != 3
var(1) = 3

[state 1051, ]
type = varset
trigger1 = animelem = 12;time = 41
trigger1 = var(1) < 6
var(1) = 6

[state 1051, 攻撃設定]
type = hitdef
trigger1 = var(1) = 0
trigger2 = var(1) = 3
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -1,-2
air.velocity = -1,-1
fall = 1
fall.recovertime = 40

[state 1051, 攻撃設定]
type = hitdef
trigger1 = var(1) = 6
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2,-4
air.velocity = -2,-6
guard.hittime = 20
guard.ctrltime = 15
fall = 1
fall.recovertime = 40

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

[state 1051, 補正]
type = varset
trigger1 = movehit = 1
fvar(10) = fvar(10)*0.95
ignorehitpause = 0
;persistent = 0

[state 1051, クナイeffect選別1]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 4
range = 0,11

[state 1051, クナイeffect選別2]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 5
range = 0,11

[state 1051, クナイeffect選別3]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 6
range = 0,11

[state 1051, クナイ1]
type = explod
trigger1 = movehit = 1
ID = 1050
anim = 11051+var(4)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(4)*pi/180),-5*sin(30*var(4)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1051, クナイ2]
type = explod
trigger1 = movehit = 1
ID = 1051
anim = 11051+var(5)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(5)*pi/180),-5*sin(30*var(5)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1051, クナイ3]
type = explod
trigger1 = movehit = 1
ID = 1052
anim = 11051+var(6)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(6)*pi/180),-5*sin(30*var(6)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1051, effect]
type = helper
trigger1 = animelem = 6;time = 22
name = "kaiten"
stateno = 11056
ID = 11056
pos = 42,-60
postype = p1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

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



;空中突進パラノイア落下---------------------------------------------------------
[statedef 1052]
type = A
movetype = I
physics = A
anim = 1052
ctrl = 0

[state 1052, ]
type = velset
trigger1 = prevstateno = 1056
trigger1 = animelem = 1,<=0;time <= 4
y = 0

[state 1052, ]
type = velset
trigger1 = animelem = 1,<=0;time <= 4
x = 2

[state 1052, ]
type = veladd
trigger1 = animelem = 2
x = 1



;空中突進パラノイア着地---------------------------------------------------------
[statedef 1053]
type = S
movetype = I
physics = S
anim = 1053
ctrl = 0

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

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

[state 1053, ]
type = velset
trigger1 = time  = 0
y = 0

[state 1053, ]
type = velset
trigger1 = animelem = 1,<=0;time <= 4
x = 2

[state 1053, ]
type = veladd
trigger1 = animelem = 2
x = 1

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



;===============================================================================
;突進パラノイアC236c
[statedef 1055]
type = S
movetype = A
physics = S
vel = 0,0
ctrl = 0
anim = 1055

[state 1055, ]
type = nothitby
trigger1 = ((var(8) & (1023)) / (1)) > 0
value = ,AP

[state 1055, 霊力消費]
type = varadd
trigger1 = animelem = 6
var(10) = -200

[state 1055, 霊力停止時間]
type = varset
trigger1 = animelem = 6
var(11) = 120

[state 1055, 消滅]
type = trans
;trigger1 = time > 2
;trigger1 = time <=18
trigger1 = animelem = 2,>=0 && animelem = 5,<0
trans = addalpha
alpha = 256-floor((time -4)*16),floor((time -4)*16)

[state 1055, 消滅]
type = trans
trigger1 = animelem = 5,>=0 && animelem = 8,<0;time = [18,27]
trans = addalpha
alpha = 0,256

[state 1055, 出現]
type = trans
trigger1 = animelem = 8,>=0 && animelem = 11,<0;time = [28,44]
trans = addalpha
alpha = floor((time -32)*16),256-floor((time -32)*16)

[state 1055 ,]
type = assertspecial
trigger1 = animelem = 3,>=0 && animelem = 10,<0;time = [14,32]
flag = noshadow

[state 1055, ]
type = velset
trigger1 = animelem = 8,>=0 && animelem = 11,<0;time = [29,45]
x = 8;4

[state 1055, ]
type = velset
trigger1 = animelem = 11,>=0 && animelem = 16,<0
x = 4;(8-0.3*(time - 34))

[state 1055, ]
type = velset
trigger1 = animelem = 16,>=0;time = [56,64]
x = 2

[state 1055, ]
type = veladd
trigger1 = animelem = 17
x = 1

[state 1055, ]
type = velset
trigger1 = animelem = 19
x = 0

[state 1055, 回り込み]
type = posadd
trigger1 = animelem = 8;time = 28
x = 150

[state 1055, 振りかえり]
type = turn
trigger1 = animelem = 8;time = 28
trigger1 = p2dist x < 0

[state 1055, ]
type = playsnd
trigger1 = animelem = 8;time = 28
value = 2,7

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

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

[state 1055, ]
type = null;varset
trigger1 = time = 42
trigger1 = var(1) = 0
var(1) = 1

[state 1055, ]
type = varset
trigger1 = animelem = 14;time = 51
trigger1 = var(1) < 6
var(1) = 6

[state 1055, 攻撃設定]
type = hitdef
trigger1 = var(1) = 0
trigger2 = var(1) = 3
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -1,-2
air.velocity = -1,-1
fall = 1
fall.recovertime = 40

[state 1055, 攻撃設定]
type = hitdef
trigger1 = var(1) = 6
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2,-4
air.velocity = -2,-6
guard.hittime = 20
guard.ctrltime = 15
fall = 1
fall.recovertime = 40

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

[state 1055, 補正]
type = varset
trigger1 = movehit = 1
fvar(10) = fvar(10)*0.95
ignorehitpause = 0
;persistent = 0

[state 1055, クナイeffect選別1]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 4
range = 0,11

[state 1055, クナイeffect選別2]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 5
range = 0,11

[state 1055, クナイeffect選別3]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 6
range = 0,11

[state 1055, クナイ1]
type = explod
trigger1 = movehit = 1
ID = 1050
anim = 11051+var(4)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(4)*pi/180),-5*sin(30*var(4)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1055, クナイ2]
type = explod
trigger1 = movehit = 1
ID = 1051
anim = 11051+var(5)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(5)*pi/180),-5*sin(30*var(5)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1055, クナイ3]
type = explod
trigger1 = movehit = 1
ID = 1052
anim = 11051+var(6)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(6)*pi/180),-5*sin(30*var(6)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1055, effect]
type = helper
trigger1 = animelem = 8;time = 32
name = "kaiten"
stateno = 11056
ID = 11056
pos = 42,-60
postype = p1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

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



;===============================================================================
;空中突進パラノイアC236c
[statedef 1056]
type = A
movetype = A
physics = A
vel = 0,0
ctrl = 0
anim = 1056

[state 1056, ]
type = nothitby
trigger1 = ((var(8) & (1023)) / (1)) > 0
value = ,AP

[state 1056, 霊力消費]
type = varadd
trigger1 = animelem = 6
var(10) = -200

[state 1056, 霊力停止時間]
type = varset
trigger1 = animelem = 6
var(11) = 120

[state 1056, 消滅]
type = trans
;trigger1 = time <= 16
trigger1 = animelem = 2,>=0 && animelem = 5,<0
trans = addalpha
alpha = 256-floor(time*16),floor(time*16)

[state 1056, 消滅]
type = trans
trigger1 = animelem = 5,>=0 && animelem = 6,<0;time = [16,17]
trans = addalpha
alpha = 0,256

[state 1056, 出現]
type = trans
trigger1 = animelem = 6,>=0 && animelem = 9,<0;time = [18,34]
trans = addalpha
alpha = floor((time -18)*16),256-floor((time -18)*16)

[state 1056 ,]
type = assertspecial
trigger1 = animelem = 3,>=0 && animelem = 8,<0;time = [12,22]
flag = noshadow

[state 1056, ]
type = velset
trigger1 = animelem = 6,>=0 && animelem = 9,<0;time = [19,35];[19,54]
x = 8*cos(pi/6)
y = 8*sin(pi/6)

[state 1056, ]
type = velset
trigger1 = animelem = 9,>=0 && animelem = 13,<0;time = [36,44]
x = 4*cos(pi/6);(8-0.85*(time - 35))*cos(pi/6)
y = 4*sin(pi/6);(8-0.85*(time - 35))*sin(pi/6)

[state 1056, ]
type = velset
trigger1 = animelem = 13;time >= 46
x = 2*cos(pi/6)
y = 2*sin(pi/6)

[state 1056, ]
type = angleset
trigger1 = animelem = 6;time = 18
value = -30

[state 1056, ]
type = angledraw
trigger1 = animelem = 6,>=0;time >= 18

[state 1056, ]
type = playsnd
trigger1 = animelem = 6;time = 18
value = 2,7

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

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

[state 1056, ]
type = null;varset
trigger1 = time = 32
trigger1 = var(1) = 0
var(1) = 1

[state 1056, ]
type = varset
trigger1 = animelem = 12;time = 41
trigger1 = var(1) < 6
var(1) = 6

[state 1056, 攻撃設定]
type = hitdef
triggerall = pos y < -10
trigger1 = var(1) = 0
trigger2 = var(1) = 3
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -1,-2
air.velocity = -1,-1
fall = 1
fall.recovertime = 40

[state 1056, 攻撃設定]
type = hitdef
trigger1 = var(1) = 6
trigger2 = pos y >= -10
attr = A, SA
damage = ceil(fvar(10)*40),15
getpower = 35,15
hitflag = MAF
guardflag = MA
priority = 4,Hit
pausetime = 8,7
sparkno = -1;S20060
sparkxy = -1;-10,6
hitsound   = S0,7
guardsound = S2,0
animtype = back
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2,-4
air.velocity = -2,-6
guard.hittime = 20
guard.ctrltime = 15
fall = 1
fall.recovertime = 40

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

[state 1056, 補正]
type = varset
trigger1 = movehit = 1
fvar(10) = fvar(10)*0.95
ignorehitpause = 0
;persistent = 0

[state 1056, クナイeffect選別1]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 4
range = 0,11

[state 1056, クナイeffect選別2]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 5
range = 0,11

[state 1056, クナイeffect選別3]
type = varrandom
trigger1 = var(1)%3 = 0
trigger1 = var(1) = [0,6]
v = 6
range = 0,11

[state 1056, クナイ1]
type = explod
trigger1 = movehit = 1
ID = 1050
anim = 11051+var(4)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(4)*pi/180),-5*sin(30*var(4)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1056, クナイ2]
type = explod
trigger1 = movehit = 1
ID = 1051
anim = 11051+var(5)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(5)*pi/180),-5*sin(30*var(5)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1056, クナイ3]
type = explod
trigger1 = movehit = 1
ID = 1052
anim = 11051+var(6)
scale = 0.5,0.5
postype = p1
pos = floor(fvar(12)),floor(fvar(13))
velocity = 5*cos(30*var(6)*pi/180),-5*sin(30*var(6)*pi/180)
ownpal = 1
sprpriority = 6
removetime = -2
ignorehitpause = 0
supermovetime = 999
pausemovetime = 999

[state 1056, effect]
type = helper
trigger1 = animelem = 6;time = 22
name = "kaiten"
stateno = 11056
ID = 11056
pos = 66,-30
postype = p1
ownpal = 1
size.xscale = 0.5
size.yscale = 0.5

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

[State 1056, ステート変更（着地）]
type = changestate
trigger1 = pos y >= -10
value = 1053
ctrl = 0



;突進パラノイアCeffect------------------------------------------------------
[statedef 11056]
type = A
movetype = I
physics = N
anim = 11050
ctrl = 0
sprpriority = 6

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

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

[state 11056, ]
type = angleset
trigger1 = root,statetype = A
trigger1 = root,stateno != 1051
value = -30

[state 11056, ]
type = angleset
trigger1 = root,pos y = 0
trigger2 = root,stateno = 1051
value = 0

[state 11056, ]
type = angledraw
trigger1 = 1

[state 11056, ]
type = bindtoroot
trigger1 = root,statetype = A
trigger1 = root,stateno = 1056
pos = 66,-30

[state 11056, ]
type = bindtoroot
trigger1 = root,pos y = 0
trigger2 = root,stateno = 1051
pos = 42,-60

[state 11056, 通常消滅]
type = destroyself
trigger1 = root,stateno = 1050
trigger1 = root,animelem = 14
trigger2 = root,stateno = 1051
trigger2 = root,animelem = 14
trigger3 = root,stateno = 1055
trigger3 = root,animelem = 16

[state 11056, 食らい・キャンセル消滅]
type = destroyself
trigger1 = root,stateno != 1050
trigger1 = root,stateno != 1051
trigger1 = root,stateno != 1055
trigger1 = root,stateno != 1056

