;***************************************************************************
;===========================================================================
;---------------------------------------------------------------------------
[Statedef -2]; 常時監視ステート
;---------------------------------------------------------------------------
;===========================================================================
;***************************************************************************
常時AIon offスイッチ
[state -2]
type = null;varset
triggerall = roundstate = 2
trigger1 = !ishelper
var(30) = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[State -2, Y座標自己修復]
type = PosSet
triggerall = RoundState = 2
trigger1 = stateno = [0,12]      
trigger1 = floor(Pos Y) = [-2,3]
y = 0

[State -2, Y座標自動修正]
type = PosAdd
triggerall = RoundState = 2
triggerall = Life < 1000     
trigger1 = stateno = [0,30]
trigger1 = floor(Pos Y) < -2
y = 2

[State -2, Y座標自動修正]
type = PosAdd
triggerall = RoundState = 2
triggerall = Life < 1000
trigger1 = stateno = [0,30]
trigger1 = floor(Pos Y) > 2
y = -2

[State -2, Y座標強制修復]
type = ChangeState
triggerall = RoundState = 2
triggerall = ctrl = 0
triggerall = alive = 1
triggerall = !Lose
trigger1 = Pos Y < -1480
trigger1 = GameTime % 10 = 0
trigger2 = Pos Y > 480
trigger2 = GameTime % 10 = 0
value = 40

[state -2, a];右向き設定
type = varset
trigger1 = var(10) = 0
trigger1 = facing = 1
v = 10
value = 1

[state -2, a];左向き設定
type = varset
trigger1 = var(10) = 0
trigger1 = facing = -1
v = 10
value = 2

[State -2, 1]
type = stopSnd
trigger1 = stateno != 100
channel = 1

[state a]
type = removeexplod
trigger1 = movetype = H
id = 2200

[state a]
type = stopsnd
trigger1 = movetype = H
channel = 3

[state a]
type = stopsnd
trigger1 = stateno != 1055
channel = 5

[State -2, 3]
type = stopSnd
trigger1 = MoveType = H
channel = 2

[State -2, 4]
type = varadd
trigger1 = 1
v = 15
value = -1

[state a]
type = varset
trigger1 = movetype = H
v = 13
value = 0

[State 180, 1]
type = VarRandom
trigger1 = 1
v = 6
range = 0,2

[state -2, a]
type = varset
trigger1 = palno = 1
trigger2 = palno = 2
trigger3 = palno = 3
trigger4 = palno = 4
trigger5 = palno = 5
trigger6 = palno = 6
v = 1
value = 0

[state -2, a]
type = varset
trigger1 = palno = 7
trigger2 = palno = 8
trigger3 = palno = 9
trigger4 = palno = 10
trigger5 = palno = 11
trigger6 = palno = 12
v = 1
value = 1

[state -2, a]
type = varadd
trigger1 = 1
persistent = 0
ignorehitpause = 1
v = 4
value = -1

[state -2, a]
type = pause
trigger1 = var(4) >= 1
trigger1 = gametime % 2
persistent = 0
ignorehitpause = 1
time = 1

[state a];
type = removeexplod
trigger1 = MoveType = H
id = 185

[State 1]
type = removeexplod
trigger1 = MoveType = H
ID = 1470

[State -2 ,a]
type = removeexplod
trigger1 = MoveType = H
ID = 4000

[state -2 ,a]
type = removeexplod
trigger1 = MoveType = H
id = 4200

[state a]
type = removeexplod
trigger1 = MoveType = H
id = 1655

[state a]
type = removeexplod
trigger1 = MoveType = H
id = 1860

[state a]
type = stopsnd
trigger1 = MoveType = H
channel = 1
***************************************************************************
;===========================================================================
;特殊
;===========================================================================
;***************************************************************************
[State 1]
type = helper
trigger1 = !ishelper&&!numhelper(44489)
id = 44489
pos = -5,-90
postype = P1
stateno = 44489
ownpal = 1
ignorehitpause = 1
helpertype = player
pausemovetime = 99999999
supermovetime = 99999999

[State 1]
type = helper
trigger1 = !ishelper&&!numhelper(44490)
id = 44490
pos = -5,-90
postype = P1
stateno = 44489
ownpal = 1
ignorehitpause = 1
helpertype = player
size.xscale = 0.5
size.yscale = 0.5
pausemovetime = 99999999
supermovetime = 99999999

[state 1]
type = varset
triggerall = !ishelper
trigger1 =gametime%60=0
fv = 0
value = gametime * 0.01
ignorehitpause = 1

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%5) = 1
anim = 22125
sprpriority = 0
postype = p1
pos = 0,5
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%8) = 1
anim = 22131
id = 11
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
under = 0
ownpal = 1
trans = sub
persistent = 1
ignorehitpause = 1
vel = 0,-3
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%20) = 1
anim = 22123
id = 11
sprpriority = 99
postype = p1
pos = 0,-85
bindtime = -1 
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%35) = 1
anim = 22123
id = 11
sprpriority = 99
postype = p1
pos = 20,-60
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%30) = 1
anim = 22123
id = 11
sprpriority = 99
postype = p1
pos = -20,-40
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%40) = 1
anim = 22122
id = 11
sprpriority = 99
postype = p1
pos = -10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%46) = 1
anim = 22122
id = 11
sprpriority = 99
postype = p1
pos = -10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%49) = 1
anim = 22122
id = 11
sprpriority = 99
postype = p1
pos = 0,-30
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%46) = 1
anim = 22124
id = 11
sprpriority = 99
postype = p1
pos = 10,-10
bindtime = -1 
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%38) = 1
anim = 22124
id = 11
sprpriority = 99
postype = p1
pos = 10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = Explod
triggerall = anim = 0 && !ishelper
trigger1 = time >= 0
trigger1 = (GameTime%42) = 1
anim = 22124
id = 11
sprpriority = 99
postype = p1
pos = 0,-30
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -2]
type = Helper
triggerall = palno = 12
trigger1 = GameTime%2 = 1
trigger1 = MoveType != H
stateno = 400000
pos = -5,-90
size.xscale = 0.45*sin(6*pi*(GameTime%60)/180)
size.yscale = 0.45
ignorehitpause = 1
supermovetime = 9999999
pausemovetime = 9999999

[State -2]
type = Helper
triggerall = palno = 12
trigger1 = GameTime%2 = 1
trigger1 = MoveType != H
stateno = 400001
pos = -5,-90
size.xscale = 0.45*sin(-6*pi*(GameTime%60)/180)
size.yscale = 0.45
ignorehitpause = 1
supermovetime = 9999999
pausemovetime = 9999999

[State -2,]
type =  Helper
trigger1 = !numhelper(13500) && (palno=[7,12])
name = "G Field"
ID = 13500
postype = p1
pos = -5,-90
stateno = 13500

[State -2,nothitby]
type =  nothitby
trigger1 = numhelper(13500) > 0
trigger1 = helper(53),var(52) < 5
value = SCA,AA,AT,AP

[State -2,nothitby]
type =  nothitby
trigger1 = numhelper(13500) > 0
trigger1 = helper(53),var(52) < 5
value2 = SCA,AA,AT,AP

[State -2,Trans]
type =  Trans
trigger1 = numhelper(13500) > 0
trigger1 = helper(53),var(52) < 5
trans = addalpha
alpha = 256 - var(53), 256

[State -2]
type = varadd
trigger1 = var(52) = 0
var(53) = 2

[State -2]
type = varadd
trigger1 = var(52) = 1
var(53) = -2

[State -2]
type = varset
trigger1 = var(53) < 2
var(52) = 0

[State -2]
type = varset
trigger1 = var(53) > 160
var(52) = 1

[State -2,HitOverride]
type =  HitOverride
trigger1 = palno=[11,12]
attr = SCA,AA,AT,AP
slot = 1
stateno = 13000
time = 100

[State -1]
type = ReversalDef
TriggerAll = IsHelper(13000)
trigger1 = 1
reversal.attr = SCA,AA,AT,AP
pausetime = 0,0
p2Stateno = 5000
priority = 7,Hit
HitFlag = MAFDP
ignorehitpause = 1
SuperMoveTime = 99999999
PauseMoveTime = 99999999

[State -2]
type = assertspecial
triggerall =numhelper(1007)
trigger1 =(movetype=H&&helper(1007),var(21)>1||var(58) != 2*gametime&&helper(1007),var(21)>1||roundstate>=2&&!alive&&helper(1007),var(21)>1)
flag = noko
ignorehitpause = 1

[State -2]
type = assertspecial
triggerall = numhelper(13000) && (palno=[11,12])
trigger1 = movetype = H || var(40) != gametime
flag = noko
ignorehitpause = 1

[State -2]
Type = AssertSpecial
triggerall = !ishelper
Triggerall = roundstate != 2 && alive
Trigger1 = enemynear,life != 0 || !enemynear,alive
Flag = noko
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = roundstate=2 && !ishelper
trigger1 = numhelper(1007)
trigger1 = helper(1007),var(21)-life>lifemax*0.1
value=(helper(1007),var(21)-life)
ignorehitpause = 1

[State -2]
type = lifeSet
triggerall = palno = [11,12]
trigger1 = movetype = H || var(58) != 2*gametime
value=lifemax 
ignorehitpause = 1

[State -2]
type = helper
trigger1 = roundstate = 2 && !ishelper
trigger1 = !numhelper(13000) && (palno=[11,12])
id = 13000
persistent = 1
name = "Mizuchi"
pos = 0,0
postype = P1
stateno = 13000
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2]
type = helper
trigger1 = !numhelper(12001) && (palno=[11,12]) &&!ishelper
id = 12001
persistent = 1
name = "Mizuchi"
pos = 0,0
postype = P1
stateno = 12001
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2]
type = helper
trigger1 =!ishelper && !numhelper(1007)&& (palno=[7,12])
id = 1007
persistent = 1
name = "Mizuchi"
pos = 0,0
postype = P1
stateno = 1007
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2]
type = Helper
trigger1 = !numhelper(140000) && !ishelper && (palno=[7,12])
stateno = 140000
id = 140000
helpertype = player
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2]
type = AssertSpecial
trigger1 = 1
flag  = NoStandGuard
flag2 = NoCrouchGuard
flag3 = NoairGuard
ignorehitpause = 1

[state -2]
type = NotHitBy
trigger1 = (palno=[11,12]) && !ishelper
value = SCA
time = -1
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = roundstate = 2 && (palno=[11,12]) && alive && !ishelper 
trigger1 = helper(12001),var(21)-life>lifemax*0.01
value= helper(12001),var(21)-life
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = alive && roundstate=2 && palno=12 && !ishelper
trigger1 = numhelper(13000) && (helper(13000),GetHitVar(Damage) = [1,(lifemax*0.1)])
value=-(ifelse(helper(13000),GetHitVar(Damage)>=lifemax*0.01,lifemax*0.001,(helper(13000),GetHitVar(Damage))/2))
ignorehitpause = 1

[state -2]
type = assertspecial
triggerall = enemy,alive
triggerall = !ishelper
triggerall = palno != 1
trigger1 = numhelper(1007) = 0
trigger2 = var(55) != GameTime+1300;gametime異常
trigger3 = numhelper(1007)
trigger3 = !alive && helper(1007),var(21)>1;保存したライフが１以上で死んだとき
;trigger4 = numhelper(1007)
;trigger4 = helper(1007),var(5) - life > lifemax*0.4;
trigger4 = roundstate != 2
flag = noko
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = palno != 1
triggerall = loseko = 0
triggerall = roundstate >= 2
trigger1 = numhelper(1007)
trigger1 = helper(1007),var(21)>1;保存して置いたライフが1より大きい場合
trigger1 = ((stateno=[5150,5199])||var(55)!=gametime+1300&&helper(1007),var(0)>360||!alive&&helper(1007),var(21)>1)
value= (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151;ガードステート
ignorehitpause = 1
;上記トリガー説明
;var(1)!=gametime&&helper(1007),var(0)>360
;ステートに引き込まれて360フレーム以上経過(長時間ステート引き込み対策)
;!alive&&helper(1007),var(1)>1
;保存して置いたライフが1より大きくて死んだ場合

[state -2];大ダメージ回避
type = selfstate
triggerall = palno != 1
triggerall = roundstate = [2,3]
triggerall = !ishelper
triggerall = alive
trigger1 = numhelper(1007)
trigger1 = helper(1007),var(21)-life >= 200 || gethitvar(damage) >= 200
trigger2 = (palno = [11,12]) && gethitvar(damage) >= 200
trigger3 = (palno = [11,12]) && life <= 400 && gethitvar(damage) >= 100
trigger4 = stateno = 0 && life = 0
value = (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = (palno=[7,12]) && !ishelper
trigger1 = (movetype=H||var(40)!=gametime||helper(12001),var(21)-life>=lifemax*0.01)
value= (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = (palno=[7,12]) && !ishelper
trigger1 = numhelper(1007)
trigger1 = helper(1007),var(21)>1
trigger1 = ((stateno=[5150,5199])||var(55)!=gametime+1300&&helper(1007),var(0)>1||!alive&&helper(1007),var(21)>1)
value= (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1
[state -2]
type = selfstate
trigger1 = palno!=1
trigger1 = loseko = 0
trigger1 = life = 0
trigger1 = roundstate >= 3
value = (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1

[state -2]
type = selfstate
trigger1 = palno!=1
trigger1 = loseko = 0
trigger1 = stateno = 5150
value = (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = roundstate = 2
triggerall = gametime%200 = 0
trigger1 = palno=[11,12]
value = -10
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2]
type = lifeadd
triggerall = roundstate = 2
triggerall = gametime%1 = 0
triggerall = life > 10
trigger1 = palno=[7,10]
value = -10
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2]
type = LifeSet
triggerall = !ishelper
triggerall = life < 1000
triggerall = alive
triggerall = p2life>=enemy,lifemax*0.9
;trigger1 = roundstate != 2
trigger1 = palno=[11,12]
value = lifemax
ignorehitpause = 1

[State -2]
type = NotHitBy
trigger1 = ScreenPos X != [0,320]
trigger2 = ScreenPos Y != [0,240]
trigger3 = enemynear,ScreenPos X != [0,320]
trigger4 = enemynear,ScreenPos Y != [0,240]
time = 120
value = SCA
ignorehitpause = 1

[State -2]
type = NotHitBy
trigger1 = GetHitVar(hitcount) >= 5
time = 120
value2 = ,AP
ignorehitpause = 1

[State -2]
type = NotHitBy
trigger1 = GetHitVar(hitcount) >= 7
time = 180
value2 = ,AA,AP
ignorehitpause = 1

[State -2]
type = NotHitBy
trigger1 = GetHitVar(hitcount) >= 10
time = 300
value2 = SCA,AA,AP,AT
ignorehitpause = 1

[State -2]
Type = AssertSpecial
triggerall = !ishelper
Trigger1 = 1
flag = UnGuardable
ignorehitpause = 1

[state -2]
type = selfstate
triggerall = roundstate = 2
trigger1 = stateno = [0,20]
trigger1 = ctrl = 0
value = 0
ignorehitpause = 1
SuperMoveTime = 99999999
PauseMoveTime = 99999999

[state -2]
type = varset
triggerall = roundstate = 2
triggerall = !ishelper
triggerall = stateno = 0
trigger1 = var(30) != [0,1]
var(30) = 0
ignorehitpause = 1

[state 0]
type=varset
triggerall = palno = [7,12]
trigger1=projcontact=1
v=60
value=numtarget=0

[state 0]
type=varset
triggerall = palno = [7,12]
trigger1=1
v=59
value=(var(59)+1)*var(60)

[state 0];対アーマー常時
type=projectile
triggerall = palno = [7,12]
trigger1=roundstate>0&&palno=[7,12]
trigger1=var(60)=1&&stateno!=750||!alive||enemynear,movetype!=h&&!enemynear,alive
projanim=99998
projremovetime=2
attr=s,na
hitflag=mafd
priority=7
damage=random+1
pausetime=0,1
ground.velocity=-3,15
air.velocity=-3,15
fall=1
fall.recover=0
hitonce=0
numhits=0
getpower=0
givepower=0
ignorehitpause = 1
pausemovetime = 999999999999
supermovetime = 999999999999
p2stateno = 25000000

[state 0];対アーマー常時2
type=projectile
triggerall = palno = [7,12]
trigger1=roundstate>0&&palno=[7,12]
trigger1=var(60)=1&&stateno!=750||!alive||enemynear,movetype!=h&&!enemynear,alive
projanim=99999
projremovetime=2
attr=s,na
hitflag=mafd
priority=7
damage=ifelse(alive,ceil(var(59)/4),21474836)
pausetime=0,1
ground.velocity=-3,15
air.velocity=-3,15
fall=1
fall.recover=0
hitonce=0
numhits=0
getpower=0
givepower=0
ignorehitpause = 1
pausemovetime = 999999999999
supermovetime = 999999999999
p2stateno = 25000000

[state 0]
type=targetlifeadd
triggerall = palno = [7,12]
trigger1=(roundstate>2||!alive)&&palno=12
value=-2147483647
absolute=1

[state 0]
type=targetstate
triggerall = palno = [7,12]
trigger1=stateno<200&&time>=180&&roundstate>1
value=5150

[state 0]
type=targetdrop
triggerall = palno = [7,12]
trigger1=stateno<200||numtarget>6||roundstate=4

[state 0]
type=projectile
trigger1=roundstate=2
trigger1=palno=11
projanim=99998
projremovetime=2
attr=S,NP
hitflag=ma-
priority=7
damage=random+1
hitonce=0
numhits=0
getpower=0
givepower=0
ignorehitpause = 1
pausemovetime = 999999999999
supermovetime = 999999999999
p2stateno = 20007

[state 0]
type=projectile
trigger1=roundstate=2
trigger1=palno=11
projanim=99999
projremovetime=2
attr=s,na
hitflag=ma-
priority=7
damage=random+1
hitonce=0
numhits=0
getpower=0
givepower=0
ignorehitpause = 1
pausemovetime = 999999999999
supermovetime = 999999999999
p2stateno = 20007

[state 0]
type=projectile
trigger1=roundstate>2||!alive
projanim=99999
projremovetime=2
attr=s,na
hitflag=ma-
priority=7
damage=21474836
p2stateno=25000000
hitonce=0
numhits=0
getpower=0
givepower=0
ignorehitpause = 1
pausemovetime = 999999999999
supermovetime = 999999999999

[state 0]
type=targetlifeadd
trigger1=roundstate>2||!alive
value=-2147483647
absolute=1

[state 0]
type=targetstate
trigger1=stateno<200&&time>=180&&roundstate>1
value=5150

[state 0]
type=targetdrop
trigger1=stateno<200||numtarget>6||roundstate=4

[State -2]
type =  lifeadd
triggerall = roundstate = 2
triggerall = gametime%90 = 0
triggerall = life > 50
trigger1 = palno=[1,6]
value = -20
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2];透明処理
type = Trans
triggerall = !ishelper&&palno = [11,12]
trigger1 = var(35) != 10
trigger1 = 1
trigger2 = var(35) = 10
trigger2 = var(32) <= 1000
trigger2 = 1
trans = addalpha
alpha = 200,200;60,256

[State -2]
type = Trans
triggeall = !ishelper&&palno = [11,12]
trigger1 = var(35) = 10
trigger1 = var(32) >= 1001
trigger1 = 1
trans = addalpha
alpha = 250,256

[State -2]
type = Trans
triggerall = !ishelper&&palno != [10,12]
trigger1 = 1
trigger1 = p2life >= lifemax/2
trans = addalpha
alpha = 100,256

[State -2]
type = Trans
triggerall = !ishelper&&palno != [10,12]
trigger1 = 1
trigger1 = p2life <= lifemax/2
trigger1 = p2life >= 200
trans = addalpha
alpha = 160,256

[State -2]
type = Trans
triggerall = !ishelper&&palno != [10,12]
trigger1 = 1
trigger1 = p2life <= lifemax/2
trigger1 = p2life < 200
;trigger1 = p2life != 0 
trans = addalpha
alpha = 220,256

[State -2]
type = Trans
triggerall = !ishelper
trigger1 = numhelper(11355) != 0
trigger1 = 1
trans = addalpha
alpha = 10,256

[State -2]
type = Trans
trigger1 = numhelper(113550) != 0
trigger1 = 1
trans = addalpha
alpha = 10,256

[State -2]
type = PalFx
triggerall = roundstate >= 0
triggerall = var(38) = 1850
triggerall = stateno != 191;190
triggerall = stateno != 171000
triggerall = stateno != 171010
trigger1 = GameTime%40 = 0
add = 0,0,0
sinadd = 100,100,100,40
time = 40
ignorehitpause = 1

[State -2]
type = PalFx
triggerall = roundstate >= 0
trigger1 = GameTime%80 = 0
add = 0,0,0
sinadd = 100,100,100,80
time = 80
ignorehitpause = 1

[State -2]
type = statetypeset
trigger1 = var(58) != 2*gametime
trigger2 = gethitvar(damage)
movetype = I
ignorehitpause = 1

[State -2]
type = screenbound
trigger1 = ishelper
value = 0
movecamera = 0
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = ishelper
trigger1 = var(58) != 2*gametime
trigger2 = movetype = H
trigger3 = anim = [5000,5150]
trigger4 = stateno = [5000,5150]
value = 0
ignorehitpause = 1
;---------------------------------------------------------------------------
;エフェクトランダム変数
;---------------------------------------------------------------------------

[State 1]
type = varrandom
trigger1 = 1
range = -55,55
v = 50

[State 1]
type = varrandom
trigger1 = 1
range = 0,-60
v = 51

[State 1]
type = varrandom
trigger1 = 1
range = -40,-130
v = 53

[State 1]
type = varrandom
trigger1 = 1
range = -75,75
v = 52

[State -2]
type = Varset
trigger1 = stateno != 22077
var(40) = 0

[State -2]
Type = VarSet
trigger1 = 1
var(35) = 0
IgnoreHitPause = 1

[State -2]
Type = VarSet
trigger1 = Random <= 300
var(35) = 1
IgnoreHitPause = 1

[State -2]
Type = VarSet
trigger1 = Random <= 300
var(35) = 2
IgnoreHitPause = 1

[State -2]
Type = VarSet
trigger1 = Random <= 300
var(35) = 3
IgnoreHitPause = 1

;---------------------------------------------------------------------------
;時間カウント
;---------------------------------------------------------------------------

[state a]
type = varadd
triggerall = palno = 12
trigger1 = roundstate = 2
v = 54
value = 1
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State a]
type = varset
triggerall = palno = 12
trigger1 = roundstate != 2
trigger2 = roundstate = 2 && fvar(32) != 1
trigger3 = roundstate = 2 && fvar(32)!= 0 && var(54)>=6700
v = 54
value = ((roundstate=2&&fvar(32)!=1)*5800)
IgnoreHitPause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[state 1]
type = varset
trigger1 = palno=12&&fvar(38)=2&&stateno!=22050
fv = 18
value = 0
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

[state 1]
type = varset
trigger1 = palno=12&&(stateno=22100||enemy,numprojid(96968484321)>=1||RoundState!=2)
fv = 19
value = (stateno!=22100)*RoundState=2
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

[state 1]
type = varset
trigger1 = palno=12&&numtarget&&target,ishelper=0
fv = 20
value = (RoundState<=2)
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

[State 1] 
type = varset
triggerall = palno = 12
trigger1 = RoundState = 2 && (GameTime%50) = 1
trigger2 = RoundState != 2
fv = 22
value = 0+((RoundState = 2)*enemy,life)
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1] 
type = varset
triggerall = palno = 12 && var(54) < 5700
trigger1 = RoundState = 2 && (GameTime%55) = 1
trigger1 = fvar(22) != 0 && enemy,life >= fvar(22)
trigger2 = fvar(22) != 0 && enemy,life < fvar(22)
trigger3 = RoundState != 2
fv = 23
value = IfElse((RoundState = 2),IfElse((fvar(22) != 0 && enemy,life < fvar(22)),0,1),0)
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state 1]
type = varadd
trigger1 = palno = 12 && roundstate = 2 && fvar(23) = 1 && var(54) < 5700
fv = 24
value = 1+((enemy,life>=enemy,lifemax&&enemy,power>=enemy,powermax)*80)
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1]
type = varset
triggerall = palno = 12
trigger1 = roundstate != 2 || fvar(23) = 0 || numtarget || var(54) >= 5700
fv = 24
value = 0
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[state -2]
type = varset
trigger1 = palno = 12 && RoundState <= 2 && anim = 0 && ctrl = 0 && var(54) <= 40
trigger1 =  enemynear,movetype=A&&(enemynear,numproj>=1||enemynear,numhelper>=1)||enemynear,anim!=0&&p2bodydist X <= 60||enemynear,vel x != 0
trigger2 = palno = 12 && RoundState>=3
fv = 25
value = (RoundState<=2)
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

[state -1]
type = varset
triggerall =palno=12
trigger1 = var(29) >= 1
trigger2 = roundstate != 2
trigger3 = life>=lifemax
fv = 26
value = 0
ignorehitpause = 1
supermovetime = 99999999
pausemovetime = 99999999

[state -1]
type = varset
trigger1 =palno=12&&(fvar(28)!=[0,2])
fv = 28
value = 0
ignorehitpause = 1
supermovetime = 99999999
pausemovetime = 99999999

[state -1]
type = varset
trigger1 =palno=12&&fvar(28)!=0&&(fvar(24)>=2150&&var(54)>=2150||fvar(25)=1||fvar(29)!=0&&RoundState<=2&&var(54)<=40&&random<=100)
fv = 28
value = 0
ignorehitpause = 1
supermovetime = 99999999
pausemovetime = 99999999

[state -1]
type = varset
trigger1 =palno=12&&roundstate>=3&&(drawgame||lose||win)
fv = 29
value = (!win)
ignorehitpause = 1
supermovetime = 99999999
pausemovetime = 99999999

[State 1]
type = varset
triggerall = !ishelper && palno = 12
trigger1 = roundno = 1 && roundstate < 2
trigger2 = roundstate >= 2 && var(3) != gametime
fv = 32
value = 1-(roundstate>=2&& var(3)!=gametime)
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1]
type = varset
triggerall = !ishelper && palno = 12
trigger1 = numexplod(2211325)
fv = 32
value = 0
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1]
type = varset
triggerall = !ishelper
trigger1 = palno = 12 && (GameTime%20) = 1
fv = 35
value = power
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999

[State 1]
type = varset
triggerall = !ishelper
trigger1 = palno=12&&(helper(288888),stateno=288889)&&enemy,numhelper>=2&&enemy,movetype=A
fv = 36
value = enemy,stateno
ignorehitpause = 1
SuperMoveTime = 999999
PauseMoveTime = 999999
;---------------------------------------------------------------------------
;技ダメージ倍率
;---------------------------------------------------------------------------

[State -2] ;パワーアップ中
type = varset 
trigger1 = var(29) >= 1
var(39) = 3-(palno=12)

[State -2] ;通常
type = varset 
trigger1 = var(29) <= 1
var(39) = 1

[state a]
type = varadd
trigger1 = 1
v = 29
value = -1

[state a]
type = varset
trigger1 = palno != 12 && roundstate != 2
v = 29
value = 0
;---------------------------------------------------------------------------
;キー判別
;---------------------------------------------------------------------------

[state a]
type = varset
trigger1 = command = "holdup"
v = 56
value = 2

[state a]
type = varset
trigger1 = command = "holddown"
v = 56
value = 3

[state a]
type = varset
trigger1 = command != "holddown"
trigger1 = command != "holdup"
v = 56
value = 0

[state -2]
type = varset
trigger1 = 1
fv = 33
value = (projhit22183=1)
;---------------------------------------------------------------------------
[State 1000, 5]
type = Explod
trigger1 = Projhit3459 = 1 || Projhit35904 = 1 || Projhit22519 = 1
anim = 22109 + var(35)
sprpriority = 6
postype = p2
pos = 0,-60
bindtime = -1
ignorehitpause =0
under = 0
ownpal = 1
PauseMoveTime = 9999999

[State 1000, 5]
type = Explod
trigger1 = ProjHit20000 = 1 || projhit22182 = 1 || projhit22183 = 1
anim = 22109 + var(35)
sprpriority = 100
postype = p2
pos = 0,-60
bindtime = -1
ignorehitpause =0
under = 0
ownpal = 1
PauseMoveTime = 9999999

[State 1000, 5]
type = Explod
trigger1 = ProjHit22079 = 1
anim = 22109 + var(35)
sprpriority = 100
postype = p2
pos = 0,-60
bindtime = -1
ignorehitpause =0
under = 0
ownpal = 1
PauseMoveTime = 9999999

[State 1000, 5]
type = Explod
trigger1 = ProjGuarded22079 = 1
anim = 22113
sprpriority = 100
postype = p2
pos = 0,-60
bindtime = -1
ignorehitpause =0
under = 0
ownpal = 1
PauseMoveTime = 9999999
;---------------------------------------------------------------------------
[State -2]
type = EnvColor
trigger1 = projhit35900 = 1
persistent = 0
ignorehitpause = 1
time = 2
value = 255,255,255
under = 1
invertall = 1

[State -2]
type = PlaySnd
trigger1 = projhit22182 = 1 || projhit22183 = 1
value = 2300,2

[State -2]
type = PosSet
triggerall = RoundState = 2
trigger1 = stateno = [0,12]
trigger1 = floor(Pos Y) < -20
y = 0

[State 1]
type = poweradd
triggerall = roundstate = 2 && var(1)!=1
trigger1 = (GameTime%4) = 1
value =2+((life<lifemax/4)*(powermax/1000))
ignorehitpause = 1
supermovetime = 99999999
pausemovetime = 99999999

[State -2]
type = NotHitBy
triggerall = var(1) = 1
triggerall = stateno = [40,52]
trigger1 = time = 0
value = SCA,AA,AT,AP
Time = 25

[State -2]
type = NotHitBy
triggerall = palno = 12
trigger1 = RoundState != 2 || RoundState=2&&var(54)<=100
trigger2 = fvar(32) != 1
value = SCA

[State -2]
type = attackMulSet
triggerall = !ishelper
trigger1 = 1
value = 1+((var(29)>=1)*(2-(palno=[1,12])))
ignorehitpause = 1

[State -2]
type = defenceMulSet
trigger1 = var(1) != 1
value = 1.2
ignorehitpause = 1

[State -2];根性値
type = defenceMulSet
trigger1 = var(1) != 1
trigger2 = Alive = 1
value = 0.0005*((life)+1000)
ignorehitpause = 1

[State -2]
type = PlayerPush
triggerall = palno = 12
trigger1 = var(29) >= 1
value = 0

[State 1]
type = HitOverride
triggerall = alive && var(1) = 1
triggerall = statetype != A
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 10051
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = HitOverride
triggerall = alive && var(1) = 1
triggerall = var(29) <= 1
triggerall = statetype = A
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 38853
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = HitOverride
triggerall = alive && var(1) = 1
triggerall = var(29) <= 1
triggerall = stateno = 40 || stateno = 52
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 38852
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = HitOverride
triggerall = alive && var(1) = 1
triggerall = var(29) >= 1
triggerall = stateno = 40 || stateno = 52
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 18000
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State 1]
type = HitOverride
triggerall = alive && var(1) = 1
triggerall = var(29) >= 1
triggerall = statetype = A
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 18000
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State -2]
type = helper
triggerall = palno = [11,12]
trigger1 = numhelper(288888)=0
id = 288888
persistent = 0
name = "godfild"
pos = 0,0
postype = P1
stateno = 288888
helpertype = normal
keyctrl = 0
ownpal = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999