;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;-------------------------------------------------------------------------------------------------------
;アーマー、ライフ保存
;-------------------------------------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

;-------------------------------------------------------------------------------------------------------
;アーマーヘルパー
;-------------------------------------------------------------------------------------------------------

[Statedef 6400000]
type    = S
movetype= I
physics = S

[State 6400000];透明に
type = AssertSpecial
trigger1 = 1
flag = Invisible
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State 6400000];本体に張り付かせる
type = BindToRoot
trigger1 = 1
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State 6400000];攻撃喰らったら自分のステートに飛ぶ
type = HitOverride
trigger1 = 1
time = -1
attr = SCA,AA,AT,AP
slot = 0
stateno = 6400000
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State 6400000]
type = PlaySnd
trigger1 = time = 0
trigger1 = gethitvar(damage)
value = 2000,random%3
freqmul = 1.3+((random%4)*0.2)
voulme = 255

[State 6400000];当たり判定のアニメを本体と同じに
type = ChangeAnim
trigger1 = 1
value = parent,Anim
elem = parent,AnimElemNo(0)
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State 6400000];ターン
type = Turn
trigger1 = Facing != root,Facing
ignorehitpause = 1

[State 6400000]
type = NotHitBy
trigger1 = root,stateno = 2200
trigger2 = root,stateno = 2205
trigger3 = root,stateno = 2210
trigger4 = root,stateno = 2000
trigger5 = root,stateno = 2001
trigger6 = root,stateno = 2002
trigger7 = root,stateno = 2100
trigger8 = root,stateno = 2101
trigger9 = root,stateno = 2102
trigger10= root,stateno = 14000
trigger11 = root,stateno = 14050
trigger12 = root,stateno = 14100
trigger13 = root,stateno = 22000
trigger14 = root,stateno = 22005
trigger15 = root,stateno = 22010
trigger16 = root,stateno = 10001
trigger17 = root,stateno = 11225
trigger18 = root,stateno = 30080
trigger19 = root,stateno = 10110
trigger20 = root,stateno = 10120
trigger21 = root,stateno = 10010
trigger22 = root,stateno = 1007000
trigger23 = root,stateno = 21000
trigger24 = root,stateno = 1950
trigger25 = root,stateno = 1450
trigger26 = root,stateno = 12300
trigger27 = root,stateno = 33500
trigger28 = root,stateno = 33600
value = SCA,AA,AT,AP
ignorehitpause = 1

[state 6400000];Hit後の無敵
type = nothitby
trigger1 = Helper(6400000),GetHitVar(Damage)
time = 300
value = SCA,AA,AT,AP
ignorehitpause = 1

[State 6400000]
type = NotHitBy
trigger1 = time = 0
trigger2 = root,stateno = [5000,5150]
value = SCA,AA,AT,AP
time = 60
ignorehitpause = 1

[state 6400000]
type = DestroySelf
trigger1 = root,palno != [11,12]
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Projectile
triggerall = !ishelper && palno=11
trigger1 = stateno=0
trigger2 = stateno=5900
attr = S, SA
projanim = 40030
projhitanim = -1
projid = 40030
projremove = 1
projremovetime = 4
postype = p1
animtype  = Light
guardflag = 
hitflag = MAFD
sparkno = -1
sparkxy = -15,-77
hitsound   = -1
guard.sparkno = -1
guardsound = -1

[State 1000, 5]
type = Explod
trigger1 = root,stateno = 19500
trigger1 = root,time = 100
trigger1 = numexplod(32800) = 0
anim = 32800
id = 32800
sprpriority = 9999999999999
postype = p1
pos = -2,-60
bindtime = 9999999999999;1
supermove = 1
under = 0
ownpal = 1
scale = 0.5,0.5
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1000, 5]
type = Explod
trigger1 = root,stateno = 19500
trigger1 = root,time = 345
trigger1 = numexplod(32600) = 0
anim = 32600
id = 32600
sprpriority = 8
postype = p1
pos = -2,-60
bindtime = 1
supermove = 1
under = 0
ownpal = 1
scale = 0.5,0.5
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -2]
type = varset
triggerall = root,palno = 12
trigger1 = enemynear,hitdefattr = SCA,AA,AT,AP
v = 3
value = 600
ignorehitpause = 1

[State -2]
type = varset
triggerall = root,palno = 12
trigger1 = var(3) > 600 || var(3) < 0
v = 3
value = 0
ignorehitpause = 1

[State -2]
type = varadd
triggerall = root,palno = 12
trigger1 = var(3) > 0
v = 3
value = -1
ignorehitpause = 1

[Statedef 44490]
anim = 10145

[state hogo1]
type = changestate
trigger1 =!ishelper
value = 0
ctrl=1
ignorehitpause = 1
[State hogo2]
type = destroyself
triggerall =ishelper&&0
trigger1 = root,var(40)!=gametime
ignorehitpause = 1
[State hogo3]
type = NotHitBy
trigger1 = ishelper
value = SCA
time = -1
ignorehitpause = 1
[state hogo4]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 44489
ignorehitpause = 1

[State 44489]
Type = AngleDraw
Trigger1 = Time >= 0
Value = gametime * 1.5 * (1 + random%100) * 0.1
Scale = (ifelse((gametime%120<=59),((gametime%60 * 0.01)  / 0.6),(1 - (gametime%60*0.01)  / 0.6))) * 1.5,1.5

[State 44489]
type = trans
trigger1 = 1
trans = sub
ignorehitpause = 1

[State 44489]
type = BindToRoot
trigger1 = 1
pos = -5,-90
ignorehitpause = 1

[State 44489]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1]
type = AssertSpecial
trigger1 = root,stateno!=0
trigger1 = root,stateno!=5900
flag = invisible
ignorehitpause = 1

[Statedef 44489]
anim = 10910

[state hogo1]
type = changestate
trigger1 =!ishelper
value = 0
ctrl=1
ignorehitpause = 1
[State hogo2]
type = destroyself
triggerall =ishelper&&0
trigger1 = root,var(40)!=gametime
ignorehitpause = 1
[State hogo3]
type = NotHitBy
trigger1 = ishelper
value = SCA
time = -1
ignorehitpause = 1
[state hogo4]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 44489
ignorehitpause = 1

[State 44489]
Type = AngleDraw
Trigger1 = Time >= 0
Value = gametime * 1.5 * (1 + random%100) * 0.1
Scale = (ifelse((gametime%120<=59),((gametime%60 * 0.01)  / 0.6),(1 - (gametime%60*0.01)  / 0.6))) * 1.5,1.5

[State 44489]
type = trans
trigger1 = 1
trans = sub
ignorehitpause = 1

[State 44489]
type = BindToRoot
trigger1 = 1
pos = -5,-90
ignorehitpause = 1

[State 44489]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1]
type = AssertSpecial
trigger1 = root,stateno!=0
trigger1 = root,stateno!=5900
flag = invisible
ignorehitpause = 1

[Statedef 310000]
anim = 40000

[State 1];トムキラー対策
type = selfstate
trigger1 = !ishelper
value = 0
ctrl = 1

[state hogo1];ヘルパー保護４つ
type = changestate
trigger1 =!ishelper
value = 0
ctrl=1
ignorehitpause = 1
[State hogo2]
type = destroyself
triggerall =ishelper&&0
trigger1 = root,var(40)!=gametime
ignorehitpause = 1
[State hogo3]
type = NotHitBy 
trigger1 = 1
value = SCA
ignorehitpause = 1
[state hogo4]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 310000
ignorehitpause = 1

[State 310000]
type = PalFx
trigger1 = time <= 50
sinadd = -256,-256,-256,200
color = 0
time = 50
supermovetime = 3600
pausemovetime = 3600

[State 310000]
type = Explod
trigger1 = time = 0
anim = 28000
id = 10004
removetime = 100
bindtime = -1
sprpriority = -999
supermovetime = 3600
pausemovetime = 3600

[State 310000]
type = ModifyExplod
trigger1 = time <= 25
id = 10004
scale = 0.04*time,0.02*time
supermovetime = 3600
pausemovetime = 3600

[State 310000]
type = ModifyExplod
trigger1 = time > 50
id = 10004
scale = 1+(0.04*(time-50)),0.5+(0.02*(time-50))
supermovetime = 3600
pausemovetime = 3600

[State 310000]
type = RemoveExplod
trigger1 = root,stateno != 2000
id = 10004
supermovetime = 3600
pausemovetime = 3600

[State 310000]
type = DestroySelf
trigger1 = time > 100
trigger2 = root,stateno != 2000
supermovetime = 3600
pausemovetime = 3600

[Statedef 22101]
type    = A
movetype= I
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
ctrl = 0
anim = 10145
ownpal = 1

[State 1];トムキラー対策
type = selfstate
trigger1 = !ishelper
value = 0
ctrl = 1

[state hogo1];ヘルパー保護４つ
type = changestate
trigger1 =!ishelper
value = 0
ctrl=1
ignorehitpause = 1
[State hogo2]
type = destroyself
triggerall =ishelper&&0
trigger1 = root,var(40)!=gametime
ignorehitpause = 1
[State hogo3]
type = NotHitBy 
trigger1 = 1
value = SCA
ignorehitpause = 1
[state hogo4]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 22101
ignorehitpause = 1

[state a]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 22101

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

[State a]
type = Trans
trigger1 = 1
trans = sub

[state a]
type = varset
trigger1 = time = 0
v = 56
value = 0

[State a]
type = VarAdd
trigger1 = Var(56) <= 40
var(56) = 1

[State a]
Type = AngleDraw
Trigger1 = Time >= 0
scale = 0.2 + Var(56)/10.0 , 0.2 + Var(56)/10.0

[State a]
Type = AngleAdd
Trigger1 = Time >= 0
Value = -3

[state a]
type = destroyself
trigger1 = Time >= 25

[Statedef 22102]
type    = A
movetype= I
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
ctrl = 0
anim = 28100
ownpal = 1

[State 1];トムキラー対策
type = selfstate
trigger1 = !ishelper
value = 0
ctrl = 1

[state hogo1];ヘルパー保護４つ
type = changestate
trigger1 =!ishelper
value = 0
ctrl=1
ignorehitpause = 1
[State hogo2]
type = destroyself
triggerall =ishelper&&0
trigger1 = root,var(40)!=gametime
ignorehitpause = 1
[State hogo3]
type = NotHitBy 
trigger1 = 1
value = SCA
ignorehitpause = 1
[state hogo4]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 22102
ignorehitpause = 1

[state a]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 22102

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

[State a]
type = Trans
trigger1 = 1
trans = sub

[state a]
type = varset
trigger1 = time = 0
v = 56
value = 0

[State a]
type = VarAdd
trigger1 = Var(56) <= 40
var(56) = 1

[state a]
type = destroyself
trigger1 = Time >= 25

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;-------------------------------------------------------------------------------------------------------
;トムキラーヘルパー
;-------------------------------------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
[Statedef 6600000]
anim = 40020

[State 0]
type = BindToRoot
trigger1 = ishelper
ignorehitpause = 1

[State 0]
type = HitBy
trigger1 = ishelper
value = C,SA
ignorehitpause = 1

[State 0]
type = HitBy
trigger1 = ishelper
value2 = C,SA
ignorehitpause = 1

[State 0]
type = DestroySelf
trigger1 = enemy,numprojid(699991954673164577) <= 0

[Statedef 1098751]
anim = 40010
[State 0]
type = HitDef
trigger1 = 1
attr = A,AA
hitflag = MAFPD
damage = 99999999999999999999999999999999999999999999999999
sparkno = -1
sparkxy = 999,999
hitsound = -1
IgnoreHitPause = 1
SuperMoveTime = 3600
PauseMoveTime = 3600
[State 0]
type = BindToRoot
trigger1 = 1
ignorehitpause = 1
[State 0]
type = DestroySelf
trigger1 = roundstate >= 3
ignorehitpause = 1

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;-------------------------------------------------------------------------------------------------------
;ヘルパー
;-------------------------------------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
[Statedef 22220]
type    = S
movetype= A
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
ctrl = 0
anim = 40010

[State 22220]
type = Projectile
triggerall = IsHelper(22220)
trigger1 = time > 0
trigger1 = time <= 230
trigger1 = gametime%3 = 0
attr = S, HA
projanim = 40010
projhitanim = -1
projid = 22220
projpriority = 999999999
projsprpriority = 999999999
projremove = 1
projremovetime = 1
postype = p1
offset = 0,0
velocity = 0
animtype  = diagup
damage    = 99999999999999999999999999999999999999999999999999,(random<=40)*(random%250)
getpower = 0,0
givepower = 0,0
guardflag = M
numhits = 1
hitflag = MAFD
pausetime = 2,1
sparkno = s22109 + (random%8)
sparkxy = ceil((p2dist X)-2),floor(enemy,pos y)+180
hitsound   = -1
guard.sparkno = s22184
guardsound = -1
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -1,-5
air.velocity = -1,-5
fall = 1
fall.recover = 0
p2stateno = 49000
ignorehitpause = 1
pausemovetime = 999999999999999
supermovetime = 999999999999999
[State 22220]
type = ReversalDef
trigger1 = IsHelper(22220)
reversal.attr = SCA,AA,AT,AP
numhits = 0
sparkno = s7014
hitsound = s120,1
p2stateno = 49000
ignorehitpause = 1

[State 22220]
type = Projectile
triggerall = IsHelper(22220)
trigger1 = time > 0
trigger1 = time <= 230
trigger1 = gametime%3 = 0
attr = S,HA
projanim = 40010
projhitanim = -1
projid = 22220
projpriority = 999999999
projsprpriority = 999999999
projremove = 1
projremovetime = 1
postype = p1
offset = 0,0
velocity = 0
animtype  = diagup
damage    = Ceil(0.099 * enemy,Const(data.life)),Ceil(0.005 * enemy,Const(data.life))
getpower = 0,0
givepower = Ceil(-1 * enemy,Const(data.power)),0
guardflag = 
numhits = 1
hitflag = MAFPD
pausetime = 2,1
sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -1,-5
air.velocity = -1,-5
fall = 1
fall.recover = 0
ignorehitpause = 1
pausemovetime = 999999999999999
supermovetime = 999999999999999
[State 22220]
type = Projectile
trigger1 = IsHelper(22220)
trigger1 = time > 0
trigger1 = time <= 230
trigger1 = gametime%3 = 0
attr = S,HA
projanim = 40010
projhitanim = -1
projid = 22220
projpriority = 999999999
projsprpriority = 999999999
projremove = 1
projremovetime = 1
postype = p1
offset = 0,0
velocity = 0
animtype  = diagup
damage    = 99999999999999999999999999999999999999999999999999
getpower = 0,0
givepower = Ceil(-1 * enemy,Const(data.power)),0
guardflag = 
numhits = 1
hitflag = MAFPD
pausetime = 2,1
sparkno = s22109 + (random%8)
sparkxy = ceil((p2dist X)-2),floor(enemy,pos y)+180
hitsound   = -1
guard.sparkno = s22184
guardsound = -1
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -1,-5
air.velocity = -1,-5
fall = 1
fall.recover = 0
p2stateno = 49000
ignorehitpause = 1
pausemovetime = 999999999999999
supermovetime = 999999999999999

[State 22220]
type = targetLifeAdd
triggerall = IsHelper(22220)
trigger1 = numtarget&&!target,ishelper
value = -99999999999999999999999
absolute = 1
ignorehitpause = 1
[State 22220]
type = targetpoweradd
triggerall = IsHelper(22220)
trigger1 = 1
value = -99999999999999999999999
absolute = 1
ignorehitpause = 1

[state 22220]
type = destroyself
trigger1 = root,stateno != 2001
ignorehitpause = 1

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;-------------------------------------------------------------------------------------------------------
;トムキラーヘルパー3
;-------------------------------------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

[Statedef 214748364]
type    = S
movetype= A
physics = N
juggle  = 0
poweradd= 0
velset = 0,0
ctrl = 0
anim = 40010
ownpal = 1

[State 1]
type = BindToroot
trigger1 = 1
pos = 0,0
ignorehitpause = 1

[state 1]
type = varset
trigger1 = numtarget&&target,ishelper=0||root,fvar(20)!=0
v = 10
value = (RoundState<=2)
ignorehitpause = 1

[state 1]
type = varset
trigger1 = root,time<150&&enemy,movereversed
trigger2 = root,time>=150
v = 11
value = (root,time<150)
ignorehitpause = 1

[State 1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA,AA,AT,AP
hitflag = M-
priority = 7
pausetime = 0,2
numhits = 0
sparkno = -1
hitsound = -1
p2stateno = 24504
ignorehitpause = 1

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

[State 1]
type = targetpowerAdd
trigger1 = 1
value = -(enemy,Const(data.power))
ignorehitpause = 1

[State 1]
type = targetLifeAdd
triggerall = numtarget&&!target,ishelper
trigger1 = (gametime%(1+((root,time<150)*3)))=1
value = -99999999999999999999999999999
absolute = 1
ignorehitpause = 1

[state 1]
type = targetstate
trigger1 = root,stateno=2001&&root,time>=150
value = 24505
ignorehitpause = 1
[state 1]
type = targetstate
trigger1 = var(11)!=0
trigger1 = enemy,alive&&root,time<150
value = 24505
ignorehitpause = 1

[State 1]
type = Projectile
trigger1 = root,stateno=2001&&(root,time=[30,170])&&var(10)!=0
trigger1 = (GameTime%6)=1
attr = S, NA
projanim = 40010
projhitanim = -1
projid = 22220
projpriority = 9999999999
projsprpriority = 5
projremove = 1
projremovetime = 2
postype = p1
offset = 0,0
velocity = 0
animtype  = hard
numhits = 0
damage    = 99999999999999999999999999999999999999999999999999
getpower = 0,0
givepower = -(enemy,Const(data.power))
hitflag = MAFPD
guardflag = 
pausetime = 2,1
guard.pausetime = 2,1
sparkno = -1
sparkxy = 40,-74
hitsound   = -1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -0.2,-0.5
air.velocity = -0.2,-0.5
fall = 1
fall.recover = 0
yaccel = .7
p2stateno = 49000
ignorehitpause = 1

[state 22220]
type = hitdef
triggerall = p2name = "Psycho Shredder[S]" || p4name = "Psycho Shredder[S]" || p2name = "ore_no_yome" || p4name = "ore_no_yome"|| p2name = "mapelao" || p4name = "mapelao"
triggerall = ishelper(214748364)
trigger1 = 1
damage = 2147483648
attr = A,AA
hitflag = MAFPD
sparkno = -1
hitsound = -1
ground.type = none
air.type = none
getpower = 0, 0
ignorehitpause = 1
[state 22220]
type = hitdef
triggerall = p2name = "Psycho Shredder[S]" || p4name = "Psycho Shredder[S]" || p2name = "ore_no_yome" || p4name = "ore_no_yome"|| p2name = "mapelao" || p4name = "mapelao"
triggerall = ishelper(214748364)
trigger1 = 1
damage = 2147483648
attr = A,AA
hitflag = MAFPD
sparkno = -1
hitsound = -1
ground.type = none
air.type = none
getpower = 0, 0
ignorehitpause = 1
[state 22220]
type = HitDef
triggerall = p2name = "Psycho Shredder[S]" || p4name = "Psycho Shredder[S]" || p2name = "ore_no_yome" || p4name = "ore_no_yome"|| p2name = "mapelao" || p4name = "mapelao"
trigger1 = ishelper(214748364)
attr = S, NA
animtype  = hard
damage    = 9999999,9999999
priority = 7
getpower = 0,0
givepower = -9999999,-9999999
guardflag = M
pausetime = 2,5
sparkno = -1
hitsound = -1
ground.type = none
air.type = none
ignorehitpause = 1

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

[state 1]
type = destroyself
trigger1 = root,stateno != 2001
ignorehitpause = 1

[Statedef 2147483647]
type    = S
movetype= I
physics = S
anim = 40010

[state hogo1];ヘルパー保護
type = changestate
trigger1 =!ishelper
value = 0
ctrl=1
ignorehitpause = 1
[State hogo2]
type = destroyself
triggerall =ishelper&&0
trigger1 = root,var(40)!=gametime
ignorehitpause = 1
[State hogo3]
type = NotHitBy
trigger1 = ishelper
value = SCA
time = -1
ignorehitpause = 1
[state hogo4]
type = hitoverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 2147483647
ignorehitpause = 1

[state 1003]
type = sprpriority
trigger1 = 1
value = -4
ignorehitpause = 1

[State 1009];透過処理
type = trans
trigger1 = 1
trans = sub
ignorehitpause = 1

[State 1009];回転
type = angledraw
trigger1= 1
scale= 0.75,0.75
ignorehitpause = 1

[State 1009]
type = Angleadd
trigger1 = 1
value = 1
ignorehitpause = 1

[State 1007];本体の中心に張り付かせる
type = BindToRoot
trigger1 = 1
pos = -5,-90
ignorehitpause = 1

[State 1]
type = AssertSpecial
trigger1 = root,stateno!=0
trigger1 = root,stateno!=5900
flag = invisible
ignorehitpause = 1

[statedef 24640]
movetype = I
ctrl = 1

[State 24640]
type = lifeadd
triggerall = life < lifemax/4
trigger1 = 1
value = lifemax/4
kill = 0
ignorehitpause = 1

[state 24640]
type = destroyself
trigger1 = ishelper

[State 24640]
type = poweradd
trigger1 = 1
value = 1000

[state 24640]
type = varset
trigger1 = 1
var(40) = gametime

[State 100500]
type = NotHitBy
trigger1 = time = 0
value = SCA,AA,AT,AP
time = 200

[state 24640]
type = selfstate
trigger1 = time >= 0
trigger1 = pos Y >= 0
value = 0
ctrl = 1

[state 24640]
type = selfstate
trigger1 = time >= 0
trigger1 = alive
trigger1 = pos Y < 0
value = 50
ctrl = 1

[Statedef 6400]
type    = S
movetype= I
physics = S

[State 6400]
type = ChangeAnim
trigger1 = time = 0
value = root,anim

[State 6400]
type = AssertSpecial
trigger1 = 1
flag = invisible

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

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

[state 6400]
type = posset
trigger1 = 1
x = root,pos x
y = root,pos y

[state 6400]
type = playsnd
trigger1 = time = 0
IgnoreHitPause = 1
persistent = 0
value = 11,10

[State 6400]
type = destroyself
trigger1 = RoundState != 3

[Statedef 6450]
type    = S
movetype= I
physics = S
anim = 40000

[State 6450]
type = BindToRoot
trigger1 = 1
ignorehitpause = 1

[State 6450]
type = Pause
trigger1 = !win
trigger2 = roundstate != 2
movetime = 0
time = 0
ignorehitpause = 1

[State 6450]
type = SuperPause
trigger1 = !win
trigger2 = roundstate != 2
movetime = 0
time = 0
darken = 0
anim = -1
p2defmul = 1
ignorehitpause = 1

[State 6450]
type = SuperPause
trigger1 = win
trigger1 = roundstate = 2
anim = -1
movetime = 1
time = 1
darken = 0
persistent = 0
ignorehitpause = 1

[State 6450]
type = destroyself
trigger1 = roundstate = 2
ignorehitpause = 1

[Statedef 65000]
type    = S
movetype= I
physics = S
anim = 0

[State 65000]
type = AssertSpecial
trigger1 = 1
flag = invisible

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

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

[state 65000]
type = posset
trigger1 = 1
x = root,pos x
y = root,pos y

[state 65000]
type = varset
trigger1 = time = 0
trigger2 = (time=[1,60])&&var(60)>=0
trigger3 = (time=[61,120])&&var(60)<=255
v = 60
value = ((time=0)*255)+(ifelse((time=[1,60]),var(60)-5,var(60)+7))
pausemovetime = 99999999
supermovetime = 99999999

[State 65000]
type = AllPalfx
trigger1 = time >= 1
mul = var(60),var(60),var(60)
time = 1
pausemovetime = 99999999
supermovetime = 99999999

[State 65000]
type = destroyself
trigger1 = time>=121

;------------------------------------------
;アーマー
[Statedef 40050]
type    = S
movetype= I
physics = S
anim = 0

[State 40050]
type = NotHitBy
trigger1 = time = 0
value = SCA,AA,AT,AP
time = 300

[State 40050]
type = lifeadd
trigger1 = fvar(30)=0
trigger1 = time = 0
value = -60
absolute = 1

[State 40050]
type = lifeadd
trigger1 = fvar(30)=1
trigger1 = time = 0
value = -40
absolute = 1

[State 40050]
type = lifeadd
trigger1 = fvar(30)=2
trigger1 = time = 0
value = -20
absolute = 1

[State 40050]
type = HitVelSet
trigger1 = Time = 0
x = 0

[State 40050]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = Time >= GetHitVar(hittime)
x = 0

[State 40050]
type = ChangeState
trigger1 = Time >= 1
value = 0
ctrl = 1

[Statedef 40060]
type    = A
movetype= I
physics = N

[State 40060]
type = NotHitBy
trigger1 = time = 0
value = SCA,AA,AT,AP
time = 300

[State 40060]
type = lifeadd
trigger1 = fvar(30)=0
trigger1 = time = 0
value = -60
absolute = 1

[State 40060]
type = lifeadd
trigger1 = fvar(30)=1
trigger1 = time = 0
value = -40
absolute = 1

[State 40060]
type = lifeadd
trigger1 = fvar(30)=2
trigger1 = time = 0
value = -20
absolute = 1

[State 40060]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 40060]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 40060]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 40060]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

[Statedef 40070]
type    = A
movetype= I
physics = A

[State 40070]
type = NotHitBy
trigger1 = time = 0
value = SCA,AA,AT,AP
time = 300

[State 40070]
type = lifeadd
trigger1 = fvar(30)=0
trigger1 = time = 0
value = -60
absolute = 1

[State 40070]
type = lifeadd
trigger1 = fvar(30)=1
trigger1 = time = 0
value = -40
absolute = 1

[State 40070]
type = lifeadd
trigger1 = fvar(30)=2
trigger1 = time = 0
value = -20
absolute = 1

[State 40070]
type = poweradd
trigger1 = time = 0
value = 200

[State 40070]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 40070]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3


[Statedef 19]
type    = S
physics = S
sprpriority = 1
anim = 20
ctrl = 0

[State 19, 1]
type = Turn
trigger1 = P2dist X < 0

[State 19, 2]
type = VelSet
trigger1 = 1
x = const(velocity.walk.fwd.x)

[State 19, 5]
type = changestate
trigger1 = roundstate != 2
trigger2 = P2BodyDist X <= 5
trigger3 = inguarddist
trigger3 = random <= 100*(Var(30))
value = 0
ctrl = 1

[Statedef 21]
type    = S
physics = S
sprpriority = 1
anim = 21
ctrl = 0

[State 21, 1]
type = Turn
trigger1 = P2dist X < 0

[State 21, 2]
type = VelSet
trigger1 = 1
x = const(velocity.walk.back.x)

[State 21, 5]
type = changestate
trigger1 = roundstate != 2
trigger2 = P2BodyDist X >= 240
trigger3 = inguarddist
trigger3 = random <= 100*(Var(30))
trigger4 = BackEdgeBodyDist <= 10
value = 0
ctrl = 1

[Statedef 99]
type    = S
physics = S
ctrl = 0
sprpriority = 1

[State -1]
Type = ChangeAnim
trigger1 = Time = 0
value = 100

[State 100, 1]
type = VelSet
trigger1 = 1
trigger1 = AnimElem = 2, >0
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
triggerall = Var(30) = 0
trigger1 = command != "holdfwd"
value = 0

[State -3, AI]
Type = ChangeState
triggerAll = Var(30)
trigger1 = P2BodyDist X <= 5
trigger2 = P2BodyDist X = [0,30]
trigger2 = random <= 10*(Var(30))
trigger3 = P2BodyDist X = [31,60]
trigger3 = random <= 7*(Var(30))
trigger4 = P2BodyDist X = [61,90]
trigger4 = random <= 5*(Var(30))
trigger5 = inguarddist
value = 0
ctrl = 1
IgnoreHitPause = 1

;-----------------------------------------------------------------
;立ちブロッキング

[Statedef 4040]
type = S
physics = S
movetype = I
velset = 0,0
anim = 121
ctrl = 0

[State 4040, 1]
type = pause
trigger1 = time = 1
time = 14
movetime = 14

[State 4040, 4]
type = playsnd
trigger1 = time = 0
value = 121,0

[State 4040, 5]
type = NotHitBy
trigger1 = 1
value = SCA
time = 2

[State 4040, 7]
type = PalFX
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
time = 1
add = 75,75,250

[State 4040, 8]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;--------------------------------------------------------------------
;しゃがみブロッキング

[Statedef 4010]
type = C
movetype = I
physics = C
anim = 121
velset = 0,0
ctrl = 0

[State 4010, 1]
type = pause
trigger1 = time = 1
time = 14
movetime = 14

[State 4010, 3]
type = playsnd
trigger1 = time = 0
value = 121,0

[State 4010, 5]
type = NotHitBy
trigger1 = 1
value = SCA
time = 2

[State 4010, 7]
type = PalFX
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
time = 1
add = 75,75,250

[State 4010, 8]
type = ChangeState
trigger1 = animtime = 0
value = 11
ctrl = 1

;--------------------------------------------------------------------
;空中ブロッキング

[Statedef 4020]
type = A
physics = N
movetype = I
anim =122
velset = 0,0
ctrl = 0

[State 4020, 1]
type = pause
trigger1 = time = 1
time = 14
movetime = 14

[State 4020, 3]
type = playsnd
trigger1 = time = 0
value = 121,0

[State 4020, 5]
type = NotHitBy
trigger1 = 1
value = SCA
time = 2

[State 4020, 7]
type = PalFX
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
time = 1
add = 75,75,250

[State 4020, 8]
type = ChangeState
trigger1 = animtime = 0
value = 4030

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

[Statedef 4030]
type = A
physics = N
velset = 0,-4
anim = 47
ctrl = 1

[State 4030, 1]
type = Gravity
trigger1 = 1

; 立ちジャストディフェンス
[Statedef 125]
type = S
movetype = I
physics = S
anim = 150
velset = 0,0
ctrl = 0

[State 125, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 125, Pause]
type = Pause
trigger1 = time = 1
time = 3

[State 125, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
value = 120, 0

[State 125, PalFX]
type = PalFX
trigger1 = Time = 0
time = 5
add = 190,190,228
mul = 190,190,228
sinadd = 190,190,228,-100

[State 125, ChangeState] 
type = ChangeState
trigger1 = time > 1
value = 0
ctrl = 1

[Statedef 126]
type = C
movetype = I
physics = C
anim = 151
velset = 0,0
ctrl = 0

[State 126, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 126, Pause]
type = Pause
trigger1 = time = 1
time = 3

[State 126, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
value = 120, 0

[State 126, PalFX]
type = PalFX
trigger1 = Time = 0
time = 5
add = 190,190,228
mul = 190,190,228
sinadd = 190,190,228,-100

[State 126, ChangeState] 
type = ChangeState
trigger1 = time > 1
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; 空中ジャストディフェンス
[Statedef 127] 
type = A
movetype = I
physics = N
anim = 152
ctrl = 0

[State 127, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 127, Pause]
type = Pause
trigger1 = time = 1
time = 3

[State 127, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
value = 120, 0

[State 127, PalFX]
type = PalFX
trigger1 = Time = 0
time = 5
add = 190,190,228
mul = 190,190,228
sinadd = 190,190,228,-100

[State 127, ChangeState] 
type = velset
trigger1 = time = 1
x = 0
y = 0

[State 127, ChangeState] 
type = velset
trigger1 = time > 1
y = -2.5
x = -3

[State 127, ChangeState] 
type = ChangeState
trigger1 = time > 1
value = 132

