;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;---------------------------------------------------------------------------
;マグネティックスフィア
;---------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

[Statedef 1030]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2

[State 1030]
type = NotHitBy 
trigger1 = palno=12&&animelem=6,<=0
value = SCA

[State 1030]
type = PlaySnd
trigger1 = animelem=4||animelem=5
value = 1300+(animelem=5)*2700,1+(animelem=5)*21
volume= 250

[State 1030]
type = Explod
trigger1 = animelem = 4
anim = 1305
sprpriority = -5
postype = p1
pos = 0,-5
bindtime = 1
supermove = 0
ignorehitpause = 0
under = 5
ownpal=1

[State 1030]
type = helper
trigger1 = numhelper(1031)=0&&animelem = 5
id = 1031
persistent = 0
name = "ri"
pos = 50,-80
postype = P1
stateno = 1031
helpertype = normal
keyctrl = 0
ownpal = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1030]
type = helper
trigger1 = numhelper(1032)=0&&animelem=5&&palno=12
id = 1032
persistent = 0
name = "ri"
pos = 110,-80
postype = P1
stateno = 1031
helpertype = normal
keyctrl = 0
ownpal = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1030]
type = helper
trigger1 = numhelper(1033)=0&&animelem=5&&palno=12
id = 1033
persistent = 0
name = "ri"
pos = 80,-110
postype = P1
stateno = 1031
helpertype = normal
keyctrl = 0
ownpal = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1030]
type = helper
trigger1 = numhelper(1034)=0&&animelem=5&&palno=12
id = 1034
persistent = 0
name = "ri"
pos = 80,-50
postype = P1
stateno = 1031
helpertype = normal
keyctrl = 0
ownpal = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

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

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

[Statedef 1031]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
ctrl = 0
anim = 3075
ownpal = 1
sprpriority = 99999

[State 1031]
type = ChangeState
trigger1 = !ishelper
value = 190001

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

[state 1031]
type = hitoverride
trigger1 = ishelper
attr = SCA,AA,AP,AT
stateno = 1031
ignorehitpause = 1

[State 1031]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[state 1]
type = velset
trigger1 = time>=30&&(p2bodydist X<0||p2bodydist X>0)
x = ifelse(p2bodydist X<0,-4,4)

[state 1]
type = velset
trigger1 = time>=30&&(p2bodydist Y<50||p2bodydist Y>50)
y = ifelse(p2bodydist Y<50,-1.0,1.0)

[State 1031]
type = angledraw
trigger1= 1
scale= 0.2+0.4*(gametime%2),0.2+0.4*(gametime%2)

[State 1031]
type = AngleAdd
trigger1 = 1
value = -14

[State 1031]
type = trans
trigger1 = 1
trans = addalpha
alpha= 250-70*(gametime%3),70*(gametime%3)
ignorehitpause = 1

[State 1031]
type = Explod
trigger1 = (gametime%10)=0
anim = 3076
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)
sprpriority = 99999
postype = p1
pos = 0,0
vel = 0,0
trans = add
bindtime = -1
removetime = 10
supermove = 1
ownpal = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1031]
type = ModifyExplod
trigger1 = 1
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)
scale= 0.2+0.12*(gametime%9),0.2+0.12*(gametime%9)

[state 1031]
type = removeexplod
trigger1 = time>=70||moveguarded||movereversed
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)

[State 1031]
type = null;PlaySnd
trigger1 = time>=45&&(GameTime%25)=1
value = 4000,23
volume = 100

[State 1031]
type = Projectile
trigger1 = root,palno=12&&(gametime%3)=0&&!(enemynear,HitDefAttr=SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP)
attr = S, NA
projanim = 3032
projhitanim = -1
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projremovetime = 1
postype = p1
offset = 0,0
velocity = 0
animtype  = hard
damage    = 4,2
getpower = 20,20
guardflag = H
pausetime = 0,2
sparkno = s7001
sparkxy = 0,0
hitsound   = s4000,3
guard.sparkno = s7011
guardsound = s120,0
ground.type = high
ground.slidetime = 18
ground.hittime  = 17
ground.velocity = -8
air.velocity = -4,-3
p2stateno=9000

[State 1031]
type = HitDef
trigger1 = Time=0&&ishelper&&root,palno!=12
attr = S, NA
animtype  = hard
damage    = 96
getpower = 30,30
guardflag = M
pausetime = 0,2
sparkno = s7001
sparkxy = 15,-10
hitsound   = s4000,3
guard.sparkno = s7011
guardsound = s120,0
ground.type = low
ground.slidetime = 27
ground.hittime  = 27
ground.velocity = 0
air.velocity = -3,-5.2
p1stateno=1035
p2stateno=1036

[State 1031]
type = ReversalDef
trigger1 = root,palno=12&&enemynear,HitDefAttr=SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP
reversal.attr = SCA,AA,AT,AP
hitflag = M
priority = 7
pausetime = 0,0
numhits = 0
sparkno = s7001
sparkxy = 15,-10
hitsound = s4000,3
p1stateno=1035
p2stateno=1036

[State 1031]
type = ReversalDef
trigger1 = root,palno=12&&!(enemynear,HitDefAttr=SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP)
reversal.attr = SCA,AA,AT,AP
hitflag = M
priority = 7
pausetime = 0,0
numhits = 0
sparkno = -1
hitsound = -1
p1stateno=104001
p2stateno=104000
p2facing=-1

[state 1031]
type = destroyself
trigger1 = Time>=75||moveguarded||movereversed

[State 1031]
type = ChangeState
trigger1 =ishelper(1031)&&(helper(1032),stateno=104001||helper(1033),stateno=104001||helper(1034),stateno=104001)
trigger2 =ishelper(1032)&&(helper(1031),stateno=104001||helper(1033),stateno=104001||helper(1034),stateno=104001)
trigger3 =ishelper(1033)&&(helper(1031),stateno=104001||helper(1032),stateno=104001||helper(1034),stateno=104001)
trigger4 =ishelper(1034)&&(helper(1031),stateno=104001||helper(1032),stateno=104001||helper(1033),stateno=104001)
value = 104001

[State 1031]
type = ChangeState
trigger1 =ishelper(1031)&&(helper(1032),stateno=1035||helper(1033),stateno=1035||helper(1034),stateno=1035)
trigger2 =ishelper(1032)&&(helper(1031),stateno=1035||helper(1033),stateno=1035||helper(1034),stateno=1035)
trigger3 =ishelper(1033)&&(helper(1031),stateno=1035||helper(1032),stateno=1035||helper(1034),stateno=1035)
trigger4 =ishelper(1034)&&(helper(1031),stateno=1035||helper(1032),stateno=1035||helper(1033),stateno=1035)
value = 1035

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

[Statedef 1032]
type    = A
physics = N
ctrl = 0
anim = 3076
sprpriority = 99999

[State 1032]
type = ChangeState
trigger1 = !ishelper
value = 190001

[state 1032]
type = bindtoparent
trigger1 = 1
pos = 0,0

[state 1032]
type = nothitby
trigger1 = 1
value = SCA

[State 1032]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1031]
type = angledraw
trigger1= 1
scale= 0.2+0.12*time,0.2+0.12*time

[State 1031]
type = trans
trigger1 = 1
trans = add

[state 1031]
type = destroyself
trigger1 = Time>=10||!numhelper(1031)

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

[Statedef 1035]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
ctrl = 0
anim = 3075
ownpal = 1
sprpriority = 99999

[State 1035]
type = targetbind
trigger1 = 1
pos = 0,60

[State 1035]
type = null;targetstate
trigger1 = 1
value = 1036

[state 1035]
type = nothitby
trigger1 = 1
value = SCA

[State 1035]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[state 1035]
type = velset
trigger1 = (rootdist X<0||rootdist X>0)
x = ifelse(rootdist X<0,-10.5,10.5)

[state 1035]
type = velset
trigger1 = rootdist X=[-61,61]
x = 0

[state 1035]
type = velset
trigger1 = (rootdist Y<70||rootdist Y>70)
y = ifelse(rootdist Y<70,-0.8,0.8)

[state 1035]
type = velset
trigger1 = rootdist Y=[0,-70]
y = 0

[State 1035]
type = angledraw
trigger1= 1
scale= 0.2+0.4*(gametime%2),0.2+0.4*(gametime%2)

[State 1035]
type = AngleAdd
trigger1 = 1
value = 14

[State 1035]
type = trans
trigger1 = 1
trans = addalpha
alpha= 250-70*(gametime%3),70*(gametime%3)
ignorehitpause = 1

[State 1035]
type = Explod
trigger1 = (gametime%10)=0
anim = 3076
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)
sprpriority = 99999
postype = p1
pos = 0,0
vel = 0,0
trans = add
bindtime = -1
removetime = 10
supermove = 1
ownpal = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1035]
type = ModifyExplod
trigger1 = 1
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)
scale= 0.2+0.12*(gametime%9),0.2+0.12*(gametime%9)

[state 1035]
type = removeexplod
trigger1 = time>=145||!numtarget||roundstate>=3||target,stateno!=1036
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)

[state 1035]
type = destroyself
trigger1 = Time>=150||!numtarget||roundstate>=3||target,stateno!=1036

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

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

[State 1036]
type = PlaySnd
triggerall = alive
trigger1 = time = 0
value = 11,0
freqmul = 1.0+(enemynear,palno=12)*0.4
volume = 250

[State 1036]
type = NotHitBy 
trigger1 = enemynear,palno=12&&time<=10
value = SCA

[state 1036]
type = destroyself
trigger1 = ishelper

[State 1036]
type = lifeset
trigger1 = time=0
ignorehitpause = 1
value = life-lifemax*0.01

[State 1036]
type = lifeset
trigger1 = enemynear,palno=12&&(gametime%2)=0
ignorehitpause = 1
value = life-lifemax*0.0012

[State 1036]
type = powerset
trigger1 = enemynear,palno=12&&(gametime%2)=0
ignorehitpause = 1
value = power-powermax*0.0012

[State 1036]
type = angledraw
trigger1= 1
scale= 0.9+0.1*(gametime%4),0.9+0.1*(gametime%4)

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

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

[State 1036]
type = ChangeAnim2
Trigger1 = Time = 0
value = 3077

[State 1036]
type = Trans
trigger1 = 1
trans = add1
alpha = 200,150

[State 1036] 
type = changestate
trigger1 = time>=350||roundstate>=3||!alive
value = 1037

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

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

[state 1037]
type = destroyself
trigger1 = ishelper

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

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

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

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

[state 1037]
type = velset
trigger1 = time = 0
y = -2.8

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

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

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

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

[State 104000]
type = NotHitBy
trigger1 = ishelper
value = SCA

[state 104000]
type = hitoverride
trigger1 = ishelper
attr = SCA,AA,AP,AT
stateno = 104000

[State 104000]
type = AssertSpecial
trigger1 = ishelper
flag = noshadow
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[state 104000]
type = velset
trigger1 = time=0
x = ifelse(ishelper,-vel x,-4)
y = ifelse(ishelper,-vel y,-6)
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104000]
type = HitDef
trigger1 = Time>=5&&ishelper
attr = S,SA
animtype  = diagup
damage    = 98,10
getpower = 0,0
guardflag = 
pausetime = 1,12
affectteam = f
sparkno = -1
sparkxy = -15,-75
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5,-4.5
air.velocity = -5,-4.8
fall = 1
fall.recover = 0
envshake.time = 5
envshake.ampl = 5

[State 104000]
type = Projectile
trigger1 = ishelper&&movecontact=1
projanim = 0
projremove = 1
projremovetime = 1
projpriority = 1
projsprpriority = 1
projid = 21511198241+(moveguarded=1)
attr = S,NA
offset = 0,2500
hitflag = 
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104000]
type = Trans
trigger1 = ishelper
trans = add

[state 104000]
type = Changestate
trigger1 = ishelper&&(movecontact>=1||time>=150)
trigger2 = ishelper&&Vel Y>0
trigger2 = Pos Y >= 0
value = 104002
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104000]
type = ChangeAnim
trigger1 = time=0&&!ishelper
value = 5070

[State 104000]
type = VelAdd
Trigger1 = time > 0&&!ishelper
y = .39

[State 104000]
type = SelfState
trigger1 = Vel Y > 0&&!ishelper
trigger1 = Pos Y >= 0
value = 5100

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

[Statedef 104001]
type    = A
movetype= I
physics = N
sprpriority = 4

[state 104001]
type = removeexplod
trigger1 = 1
id = 3076+ishelper(1032)+(ishelper(1033)*2)+(ishelper(1034)*3)
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104001]
type = AssertSpecial
trigger1 = ishelper
flag = noshadow
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[state 104001]
type = destroyself
trigger1 = time>=1
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

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

[Statedef 104002]
type    = A
physics = N
ctrl = 0
sprpriority = 99999

[state 104002]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104002]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104002]
type = angledraw
trigger1= 1
scale= 1.0-0.09*time,1.0-0.09*time
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 104002]
type = trans
trigger1 = 1
trans = add
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[state 104002]
type = destroyself
trigger1 = Time>=10
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999