;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;---------------------------------------------------------------------------
;カオティック・フレア
;---------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

[Statedef 2405]
type    = S
movetype= A
physics = N
velset = 0,0
juggle = 15
poweradd= -9000
anim = 2201
ctrl = 0

[State 2405]
type = varset
trigger1 = palno=12&&time=0
fv = 13
value = 1
ignorehitpause = 1

[State 2405]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg
flag3 = nobg

[State 2405]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2405]
type = SuperPause
trigger1 = time = 0
time = 32
movetime = 32
anim = -1

[State 3000, Super]
type = Helper
trigger1 = Time = 0
persistent = 0
id = 2320
name = "Super Spark Helper"
pos = 0,-74
postype = P1
stateno = 2300
helpertype = normal
supermove = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 99999
pausemovetime = 99999

[State 2405]
type = PlaySnd
trigger1 = Time = 0
value = 2100,1
volume = 150

[State 2405]
type = PlaySnd
trigger1 = Time = 2
value = 2211,0

[State 2405]
type = PlaySnd
trigger1 = Time = 1
value = 2312,3

[State 2405]
type = PlaySnd
trigger1 = Time = 8
value = 9999,1

[State 2405]
type = EnvColor
trigger1 = time = 0
persistent = 0
ignorehitpause = 1
time = 3
value = 255,255,255
under = 2

[State 2405]
type = EnvColor
trigger1 = time = 3
persistent = 0
ignorehitpause = 1
time = 50
value = 0,0,0
under = 2

[state 2405]
type = changestate
trigger1 = animtime = 0
value = 23000

;---------------------------------------------------------------------------
;攻撃
;---------------------------------------------------------------------------

[Statedef 23000]
type    = S
movetype= A
physics = N
velset = 0,0
juggle = 15
anim = 2206
ctrl = 0

[State 23000]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg
flag3 = nobg
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 23000]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 23000]
type = varadd
trigger1 = palno=12&&time<160&&fvar(17)!=0
fv = 15
value = (stateno=23000)
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state 23000]
type = varset
trigger1 = palno=12&&time<160&&enemy,movereversed
fv = 17
value = (stateno=23000)
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 23000]
type = NotHitBy
trigger1 = 1
value = SCA

[State 23000]
type = EnvColor
trigger1 = 1
ignorehitpause = 1
time = 10
value = 0,0,0
under = 2

[State 23000]
type = PlaySnd
trigger1 = Time = 0
value = 2100,0
volume = 150

[State 23000]
type = PlaySnd
trigger1 = Time = 0
value = 4000,17
volume = 250
channel = 9

[State 23000]
type = null;PlaySnd
trigger1 = Time = 0
value = 4000,20
volume = 150

[State 23000]
type = Explod
trigger1 = Time = 0
anim = 3060
id = 3060
sprpriority = 999999999
postype = back
pos = 0,0
bindtime = -1
supermove = 0
under = 0
ownpal = 1
ontop = 1
trans = add

[State 23000]
type = EnvShake
trigger1 = (GameTime%4) = 1
time = 5
ampl = -5
freq = 95
phase = 95

[State 23000]
type = Projectile
triggerall = palno = 12
trigger1 = fvar(16)!=1&&(time=[20,220])&&(GameTime%3) = 1
trigger2 = fvar(16)!=0&&(time=[180,220])&&(GameTime%3) = 1
attr = S, NA
projanim = 3063
projhitanim = -1
projid = 3063
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projremovetime = 2
postype = p1
offset = 0,0
velocity = 0
animtype  = hard
damage    = 21474836
getpower = 0,0
givepower = -9999999999
hitflag = MAFD
guardflag =
pausetime = 9,5
guard.pausetime = 9,5
sparkno = -1
sparkxy = 40,-74
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -0.75,-0.01
guard.velocity = -9.5
air.velocity = -0.75,-0.01
fall = 1
air.fall = 1
fall.recover = 0
p2stateno = 26350

[State 23000]
type = Projectile
triggerall = palno != 12
trigger1 = time = [20,220]
trigger1 = (GameTime%3) = 1
attr = S, NA
projanim = 3063
projhitanim = -1
projid = 3063
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projremovetime = 2
postype = p1
offset = 0,0
velocity = 0
animtype  = hard
damage    = ((random<=10)*(random%150))+(random<=(2+(var(1)*5)))*21474836,(random<=20)*(random%200)
getpower = 0,0
givepower = 0
hitflag = MAFD
guardflag = M
pausetime = 9,5
guard.pausetime = 9,5
sparkno = -1
sparkxy = 40,-74
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -0.75,-0.01
guard.velocity = -9.5
air.velocity = -0.75,-0.01
fall = 1
air.fall = 1
fall.recover = 0
p2stateno = 26350

[State 23000]
type = Projectile
triggerall = palno != 12
trigger1 = time = [20,220]
trigger1 = (GameTime%2) = 1
attr = S, NA
projanim = 3067
projhitanim = -1
projid = 3067
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projremovetime = 2
postype = back
offset = 160,-140
velocity = 0
animtype  = hard
damage    = ((random<=10)*(random%150))+(random<=(2+(var(1)*5)))*21474836,(random<=20)*(random%200)
getpower = 0,0
givepower = 0
hitflag = MAFD
guardflag = M
pausetime = 9,5
guard.pausetime = 9,5
sparkno = -1
sparkxy = 40,-74
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -0.75,-0.01
guard.velocity = -9.5
air.velocity = -0.75,-0.01
fall = 1
air.fall = 1
fall.recover = 0
p2stateno = 26350

[State 23000]
type = Projectile
trigger1 = 1
attr = S, SP
projanim = 3064
projhitanim = -1
projid = 3064
projpriority = 999999999
projsprpriority = 999999999
projremove = 1
projremovetime = 2
postype = p1
offset = 0,0
velocity = 0
animtype  = Light
damage    = 10,0
getpower = 10,0
givepower = 0,0
guardflag = M
hitflag = MAFD
pausetime = 2,8
sparkno = -1
sparkxy = -15,-77
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -2
air.velocity = -2,-1

[State 23000]
type = AttackDist
trigger1 = 1
value = 0

[State 23000]
type = ReversalDef
triggerall = palno = 12
trigger1 = time <= 220
reversal.attr = SCA,AT,AA,AP
hitflag = M-
priority = 7
pausetime = 0,0
numhits = 0
sparkno = -1
hitsound = -1
p2stateno = 263601
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state 23000]
type = targetdrop
trigger1 = palno=12&&(roundstate>=3&&enemy,alive=0&&enemy,stateno=5150||numtarget>=7)

[state 23000]
type = targetstate
triggerall = palno = 12 &&roundstate=2
trigger1 = time = [160,220]
trigger1 = (GameTime%3) = 1
value = 263601
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state 23000]
type = null;targetstate
triggerall = palno=12&&roundstate=2&&fvar(17)=1&&(fvar(15)=[1,50])&&enemy,alive
trigger1 = time <= 159
value = 263601
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state 23000]
type = targetstate
triggerall = palno=12&&roundstate=2&&fvar(17)=1&&enemy,alive
trigger1 = time <= 159
value = 263601
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state 23000]
type = targetstate
trigger1 = palno=12&&enemy,alive=0&&!(enemy,stateno=2701000||enemy,stateno=263601||enemy,stateno=5150)
value = 2701000
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 23000]
type = Explod
trigger1 = palno=12&&target,stateno=263601&&enemyNear,time=0||projhit3063=1||projguarded3063=1
anim = IfElse((projguarded=1),7011,7001)
sprpriority = 120
postype = p2
pos = (target,const(size.mid.pos.x))+(random%20)-(random%40),(target,const(size.mid.pos.y))+(random%40)-(random%60)
facing = -1
ownpal = 1
trans = add

[State 23000]
type = Explod
trigger1 = projhit3067=1||projguarded3067=1
anim = IfElse((projguarded=1),7011,7001)
sprpriority = 120
postype = p2
pos = (target,const(size.mid.pos.x))+(random%20)-(random%40),(target,const(size.mid.pos.y))+(random%40)-(random%60)
facing = -1
ownpal = 1
trans = add

[State 23000]
type = HitAdd
trigger1 = palno = 12 && target,stateno = 263601 && enemyNear,time = 0
value = 1

[state 23000]
type = changestate
trigger1 = time >= 250
value = 23001

;---------------------------------------------------------------------------
;終了
;---------------------------------------------------------------------------

[Statedef 23001]
type    = S
movetype= A
physics = N
velset = 0,0
juggle = 15
anim = 2211
ctrl = 0

[State 23001]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay

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

;---------------------------------------------------------------------------
;やられ
;---------------------------------------------------------------------------

[Statedef 26350]
type    = A
movetype= H
physics = N
velset = 0,0
facep2 = 1

[state 26350]
type = destroyself
trigger1 = ishelper

[State 26350]
type = lifeset
trigger1 = time = 0
ignorehitpause = 1
value = life - (Ceil(((random<=20)*0.2) * Const(data.life)))

[State 26350]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1

[State 26350]
type = ChangeAnim
Trigger1 = Time = 0
value = 5070

[State 26350]
type = Trans
trigger1 = 1
trans = add1
alpha = 250,70

[State 26350]
type = changestate
trigger1 = time >= 8
value = 26370

;---------------------------------------------------------------------------
;やられ
;---------------------------------------------------------------------------

[Statedef 263601]
type    = A
movetype= H
physics = N
velset = 0,0
facep2 = 1

[State 263601]
type = lifeset
trigger1 = 1
ignorehitpause = 1
value = 0

[State 263601]
type = powerset
trigger1 = 1
ignorehitpause = 1
value = 0

[State 26360]
type = VarRangeSet
trigger1 = enemynear,name="Black Kyurem"&&enemynear,fvar(26)=1&&!ishelper&&name!="Black Kyurem"&&prevstateno!=263601
value = 0
IgnoreHitPause = 1

[State 26360]
type = VarRangeSet
trigger1 = enemynear,name="Black Kyurem"&&enemynear,fvar(26)=1&&!ishelper&&name!="Black Kyurem"&&prevstateno!=263601
fvalue = 0
IgnoreHitPause = 1

[state 26360]
type = varset
trigger1 = ishelper&&time=0&&enemynear,name="Black Kyurem"&&enemynear,fvar(19)!=0
v = 2
value = prevstateno

[state 26360]
type = varset
trigger1 = ishelper&&time=0&&enemynear,name="Black Kyurem"&&enemynear,fvar(19)!=0
v = 3
value = anim

[State 263601]
type = PlayerPush
trigger1 = 1
value = -1

[State 263601]
type = NotHitBy
trigger1 = 1
value = SCA

[State 263601]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1

[State 263601]
type = ChangeAnim
Trigger1 = Time = 0&&!ishelper
value = 5070

[State 263601]
type = Trans
trigger1 = 1
trans = add1
alpha = 250,70

[State 263601]
type = AssertSpecial
trigger1 = ishelper
flag = invisible

[state 263601]
type = destroyself
trigger1 = ishelper&&time=0&&enemynear,name="Black Kyurem"&&enemynear,fvar(19)!=1
trigger2 = ishelper&&time>=5

[state 263601]
type = changestate
trigger1 = ishelper&&time=1&&enemynear,name="Black Kyurem"&&enemynear,fvar(19)!=0
value = 2636010

[State 263601]
type = changestate
trigger1 = time>=8&&!ishelper
value = 26370

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

[Statedef 2636010]
type    = U
movetype= I
physics = N
sprpriority = 4

[State 2636010]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow

[State 2636010]
type = Projectile
trigger1 = time<=1&&enemynear,name="Black Kyurem"&&enemynear,fvar(19)!=0&&ishelper
attr = S, NA
projanim = var(3)
projhitanim = -1
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projid = 26360100
projremovetime = 100
postype = p2
offset = 0,250
velocity = 0
animtype  = hard
damage    = 0
numhits = 0
getpower = 0,0
givepower = 0,0
hitflag = MAFLPD
guardflag =
pausetime = 10,10
sparkno = -1
sparkxy = 0,0
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -10,-10
air.velocity = -10,-10
fall = 1
air.fall = 1
fall.recover = 0
p1stateno = var(2)
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 2636010]
type = Projectile
trigger1 = time>=20&&enemynear,name="Black Kyurem"&&enemynear,fvar(19)!=0&&ishelper&&root,alive
;trigger1 =!(root,HitDefAttr=SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP)
attr = S, NA
projanim = var(3)
projhitanim = -1
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projid = 26360100
projremovetime = 100
postype = p2
offset = 0,250
velocity = 0
animtype  = hard
damage    = 0
numhits = 0
getpower = 0,0
givepower = 0,0
hitflag = MAFLPD
guardflag =
pausetime = 10,10
sparkno = -1
sparkxy = 0,0
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -10,-10
air.velocity = -10,-10
fall = 1
air.fall = 1
fall.recover = 0
p1stateno = 40
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 2636010]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2636010]
type = PosSet
trigger1 = ishelper
Y = 2400

[State 2636010]
type = ChangeState
trigger1 = !ishelper
value = 0

[State 2636010]
type = destroyself
trigger1 = roundstate!=2||root,alive=0||enemynear,name="Black Kyurem"&&enemynear,stateno!=23000||time>=21

;---------------------------------------------------------------------------
;相手落下1
;---------------------------------------------------------------------------

[Statedef 26370]
type    = A
movetype= H
physics = N
sprpriority = 4

[state 26370]
type = destroyself
trigger1 = ishelper

[State 26370]
type = lifeset
trigger1 = time = 0
ignorehitpause = 1
value = life - (Ceil(0.035 * Const(data.life)))

[State 26370]
type = lifeset
trigger1 = life <= (Ceil(0.01 * Const(data.life)))
ignorehitpause = 1
value = 0

[State 26370]
type = PlayerPush
trigger1 = 1
value = -1

[State 26370]
type = NotHitBy
trigger1 = 1
value = SCA

[State 26370]
type = screenbound
trigger1 = 1
value = 1
movecamera = 1

[State 26370]
type = ChangeAnim
trigger1 = time = 0
value = 5050

[state 26370]
type = velset
trigger1 = time = 0
x = IfElse((p2dist x< 0 ),3.32,-3.32)
y = -2.8

[State 26370]
type = VelAdd
Trigger1 = time > 0
y = .39

[State 26370]
type = selfstate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

