;カミングアウト、または「奥まで気持ちいい」
[Statedef 4000]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0,0
anim = 4000
sprpriority = 1
poweradd = 0

;[state 4000, 超必殺の演出]
;type = SuperPause
;trigger1 = time = 0
;time = 0
;anim = 100
;sound = 20, 0
;pos = 25, -77
;movetime = 0
;darken = 0

;↓なにこれ？
;VarSetです。
;ここで時を止めるスイッチが入ったと思ってくれればいい。(多分)
[State 4000]
type = varset
trigger1 = p2bodydist X = [-5,30]
trigger1 = p2bodydist Y = 0
var(9) = 1

[state 4000,無敵]
type = NotHitBy
trigger1 = AnimElem = 1
value = SCA,AA,AT,AP
time = 2

[State 4000]
type = PlaySnd
trigger1 = P2bodydist X = [-5,30]
trigger1 = P2bodydist Y = 0
trigger1 = AnimElem = 2
value = 10000,0

;[state 4000,背景]
;type = BGPalFX
;trigger1 = AnimElem = 2
;trigger1 = p2bodydist X = [-5,30]
;trigger1 = p2bodydist Y = 0
;time = 150
;invertall = 1

[State 4000]
type = ChangeState
trigger1 = Animtime = 0
value = 0
ctrl = 1

;-------| 時止め終わり |-----------------
[Statedef 4001]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0,0
anim = 4001
sprpriority = 0

[State 4001,時止めスイッチオフ]
type = varset
trigger1 = Time = 0
var(9) = 0

;超重要。
;ここでPauseを新しいPauseで上書きすることで
;時止めを解除するという無理やりなことをしている。
[State 4001]
type = pause
trigger1 = time = 0
time = 0

[State 4001]
type = PosSet
trigger1 = time = 0
y = 0

[State 4001,背景]
type = BGPalFX
trigger1 = Time = 0
time = 1
add = 0,0,0
invertall = 0
color = 255

[State 4001]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;時止め
;まず、射程圏内にいたら
;var(9)=1 になる ＝ 時は止まる
;つまり、var(9)=1 になるとpauseのステコンが実行される
;そしてそれを-2ステート(常時監視ステート)、つまり常に実行されるステートに書いとく。
;これで近くにいた相手の時は止まる(多分)
;そして同じ-2ステートに"一回攻撃がヒットすると4001ステート(時は動きだす)に移行する"
;こんな記述をする。
;するってーと、そこでpauseのステコンがさらに実行。
;pauseのステコンは上塗りされると後から実行された方が優先されるので、
;そちらにpauseがすぐ終わるように書き込めば、後からのpauseによって、
;時止めしていたpauseが上書きされる。
;これがこの時止めの正体。
;後、var(9)も4001で零に戻す。不具合よけ(多分)

;ギャリック砲
[Statedef 4100]
type = L
movetype = A
physics = N
juggle = 1
anim = 4100
ctrl = 0
sprpriority = 2
velset = 0,0

[State 4100]
type = PlaySnd
trigger1 = Time = 0
value = F20,0

[State 4100]
type = Pause
trigger1 = Time = 0
time = 56

[State 4100]
type = PosSet
trigger1 = Time = 0
y = 0

[State 4100]
type = VarSet
trigger1 = 1
var(52) = 1

[State 4100, MAX2呼び出し]
type = Helper
trigger1 = Time = 0
stateno = 4101
postype = left
pos = 0,-90
ID = 4101
vel = 0, 0
ownpal = 1
size.xscale = 2
size.yscale = 0.38
supermovetime = 999
pausemovetime = 999

[State 4100, 背景]
type = Helper
trigger1 = Time = 0
stateno = 4102
postype = left
pos = 0,0
ID = 4102
vel = 0, 0
ownpal = 1
size.xscale = 1.5
size.yscale = 1.5
supermovetime = 999
pausemovetime = 999

[State 4100, ギャリック砲]
type = Projectile
trigger1 = AnimElem = 2
attr = S, HP
hitflag = MAF
animtype  = back
air.animtime = back
damage = 99999,99999
pausetime = 8,8
guardpausetime = 8,8
sparkno = 12
guard.sparkno = 12
sparkxy = 0,0
velocity = 25,-9
hitsound = S1101,1
grond.type = High
gurond.slidetime = 30
ground.velocity = -5,-5
sprpriority = 1
projID = 11000
projAnim = 11000
projremove = 1
projpriority = 3
projscale = 0.6,0.6
postype = p1
offset = 10,0
fall = 1
fall.recovertime = 50
yaccel = 0.4

[State 4100]
type = ChangeState
trigger1 = AnimTime = 0
value = 5120
ctrl = 1

;Max2風演出ヘルパーステート
;MAX2
[Statedef 4101]
type     = S
movetype = A
physics  = N
ctrl     = 0
anim     = 11002
sprpriority = 5

[State 4101, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = NoShadow ;影を消す

[State 4101]
type = SprPriority
trigger1 = 1
value = -4

[State 4101, 奈良呼び出し]
type = Helper
trigger1 = AnimElem = 5
stateno = 4103
postype = left
pos = 160,-144
ID = 4103
vel = 0, 0
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
supermovetime = 999
pausemovetime = 999

[State 4101, このヘルパーを消す]
type = DestroySelf
trigger1 = Time = 56

;背景
[Statedef 4102]
type     = S
movetype = A
physics  = N
ctrl     = 0
anim     = 11003
sprpriority = 5

[State 4102, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = NoShadow ;影を消す

[State 4102]
type = SprPriority
trigger1 = 1
value = -5

[State 4102, このヘルパーを消す]
type = DestroySelf
trigger1 = Time = 56

;奈良の顔
[Statedef 4103]
type     = S
movetype = A
physics  = N
ctrl     = 0
anim     = 11001
sprpriority = -5

[State 4103, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = NoShadow ;影を消す

[State 4103]
type = SprPriority
trigger1 = 1
value = -3

[State 4103, このヘルパーを消す]
type = DestroySelf
trigger1 = Time = 52


;エビの脱皮
[Statedef 7777]
type     = S
movetype = A
physics  = S
ctrl     = 0
anim     = 7777
sprpriority = 5

[State 7777, 2]
type = HitDef
trigger1 = Time >= 0
trigger1 = Enemynear,Movetype != H
attr = S, SA
damage = 0, 0
animtype = back
hitflag = MAF
priority = 1, Hit
pausetime = 0, 0
guard.pausetime = 0, 0
hitonce = 1
sparkno = 1
sparkxy = -10, -66
hitsound = 5, 4
guardsound = 6, 0
ground.type = Trip
ground.slidetime = 17
ground.hittime  = 20
ground.velocity = -10,0
getpower = 0,0
givepower = -500,-500
down.bounce = 0

[State 7777]
type = VelSet
trigger1 = command = "holdfwd"
x = 1.5
y = 0

[State 7777]
type = VelSet
trigger1 = command = "holdback"
x = -1.5
y = 0

[State 7777, ？？？フラグ]
type = VarAdd
trigger1 = Time > 0
var(50) = 1

[State 7777, ステート終了]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;???
[Statedef 7778]
type     = S
movetype = A
physics  = S
ctrl     = 0
anim     = 7778
sprpriority = 5

[State 7778, 7779ステートに飛ばす]
type = HitDef
trigger1 = Time >= 0
attr = S, HA
damage = 0, 0
animtype = back
hitflag = MAF
priority = 7, Miss
pausetime = 0, 0
guard.pausetime = 0, 0
hitonce = 1
sparkno = -1
hitsound = 5, 4
ground.type = High
ground.slidetime = 0
ground.hittime  = 0
ground.velocity = 0,0
getpower = 0,0
givepower = 0,0
down.bounce = 0
P1StateNo = 7779

[State 7778, 速度設定]
type = VelSet
trigger1 = Time > 0
x = 5
y = 0

[State 7778, ステート終了]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;???
[Statedef 7779]
type     = S
movetype = A
physics  = S
ctrl     = 0
anim     = 0
sprpriority = 1
power = -3000

[State 7779, ヘルパー呼び出し]
type = Helper
trigger1 = time = 0
anim = 7779
ID = 7779
StateNo = 7780
pos = 160, -30
postype = left
facing = 1
vel = 0, 0
accel = 0, 0
random = 0, 0
removetime = -2
supermovetime = 0
pausemovetime = 0
size.xscale = 0.82
size.yscale = 0.82
sprpriority = 1
ontop = 1
shadow = 0, 0, 0
ownpal = 1
removeongethit = 1

[State 7779, 音を鳴らす]
type = PlaySnd
trigger1 = time = 0
value = 7777, 0
volume = 100

[State 7779, 音を鳴らす]
type = PlaySnd
trigger1 = Random <= 300
value = 7777, 5
volume = 100

[State 7779, 音を鳴らす]
type = PlaySnd
trigger1 = Random <= 300
value = 7777, 4
volume = 100

[State 7779, 音を鳴らす]
type = PlaySnd
trigger1 = Random <= 300
value = 7777, 7
volume = 100

[State 7779, 音を鳴らす]
type = PlaySnd
trigger1 = Random <= 300
value = 7777, 1
volume = 100

[State 7779, 音を鳴らす]
type = PlaySnd
trigger1 = Random <= 300
value = 7777, 6
volume = 100

[State 7779, 音を鳴らす]
type = StopSnd
trigger1 = Helper(7779),AnimTime = 0
channel = -1

[State 7779, 音を鳴らす]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 7779, 音を鳴らす]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 7779, 音を鳴らす]
type = EnvShake
trigger1 = time = 0
time = 105
freq = 100
ampl = 4
phase = 4

[State 7779, ステート終了]
type = ChangeState
trigger1 = Helper(7779),AnimTime = 0
value = 0
ctrl = 1


;???(ヘルパー)
[Statedef 7780]
type     = S
movetype = A
physics  = S
ctrl     = 0
anim     = 7779
sprpriority = 7

[State 7780, 攻撃判定]
type = HitDef
trigger1 = Time > 0
attr = S, HA
damage = 1000, 1000
animtype = back
hitflag = MAF
priority = 1, Hit
pausetime = 0, 0
guard.pausetime = 0, 0
sparkno = -1
hitsound = 5, 4
ground.type = Trip
ground.slidetime = 0
ground.hittime  = 0
ground.velocity = 0,0
getpower = 0,0
givepower = -1000,-1000
down.bounce = 0
hitonce = 1

[State 7780, 押し出し判定変更]
type=playerpush
trigger1=ishelper(7780)
value=0
ignorehitpause=1

[State 7780, 透明＋影消し]
type=assertspecial
trigger1=ishelper(7780)
flag=noshadow
ignorehitpause=1

[State 7780, 位置固定]
type = PosFreeze
trigger1 = 1
value = 1

[State 7780,　ヘルパーの消去]
type = DestroySelf
trigger1 = animtime = 0
