
;***************************************************************************
;===========================================================================
;---------------------------------------------------------------------------
[Statedef -2]; 忢帪娔帇僗僥乕僩
;---------------------------------------------------------------------------
;===========================================================================
;***************************************************************************

[State -2, DEBUG]
type = DisplayToClipboard
trigger1 = 1
text = "P2BDPos X:%f, P2BDPos Y:%f"
params = P2BodyDist X, P2BodyDist Y
ignorehitpause = 1

;嫮偝儗儀儖
;庛丂0 1 2 3 嫮
[state -2]
type = varset
trigger1 = !ishelper&&roundstate<2
fv = 30
value = 3 ;random%3
ignorehitpause = 1

[State -2]
type = varset
triggerall = p2name != "F1" || p4name != "F1"
triggerall = var(30)
triggerall = palno = [11,12]
trigger1 = numhelper(6400000)
v = 30
value = 1
ignorehitpause = 1

[State -2]
type = varset
triggerall = p2name != "F1" || p4name != "F1"
triggerall = palno = [11,12]
triggerall = numhelper(6400000)
trigger1 = helper(6400000),var(0) = 1
v = 30
value = 1
ignorehitpause = 1

[State -2]
type = varset
triggerall = p2name = "F1" || p4name = "F1"
triggerall = var(30)
triggerall = palno = [11,12]
trigger1 = numhelper(6400000)
v = 30
value = 0
ignorehitpause = 1

[state -1]
type = varset
trigger1 = fvar(30)!=[0,3] 
fv = 30
value = 0
ignorehitpause = 1
[state -2]
type = varset
trigger1 = roundstate>=3&&(drawgame||lose||win)
fv = 29
value = (!win)
ignorehitpause = 1

[State -2]
type = RemoveExplod
triggerall = !ishelper
trigger1 = anim != 0
id = 32400
ignorehitpause = 1

[State -2]
type = RemoveExplod
trigger1 = enemy,stateno = 30082
id = 32800
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 < 1200     
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 < -1280
trigger1 = GameTime % 10 = 0
trigger2 = Pos Y > 480
trigger2 = GameTime % 10 = 0
value = 40

[State -2]
type = posset
triggerall = !ishelper
trigger1 = roundstate = 4
y = 0
ignorehitpause = 1

[State -2]
type = PosSet
triggerall = RoundState=2 && !ishelper
trigger1 = (stateno=[0,12])||stateno=151||stateno=153
trigger1 = pos y != 0
y = 0
ignorehitpause = 1

[State -2]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 
trigger2 = stateno = 107 
trigger3 = stateno = 103 
value = 40, 0

[State -2]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 105 
value = 105, 0

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

[State -2]
type = afterimagetime
trigger1 = movetype = H
time = 0

[State -2]
type = Width
trigger1 = 1
edge = 5,0

[state -2]
type = varset
trigger1 = var(10) = 0
trigger1 = facing = 1
v = 10
value = 1

[state -2]
type = varset
trigger1 = var(10) = 0
trigger1 = facing = -1
v = 10
value = 2

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

[state a]
type = stopsnd
trigger1 = MoveType = H
channel = 1

[state a]
type = afterimagetime
trigger1 = MoveType = H
time = 0



[State -2]
type = assertspecial
triggerall = roundno = 1
trigger1 = roundstate < 2
flag = nomusic

[State -2]
type = assertspecial
triggerall = !ishelper&&!loseko&&!lose&&!drawgame
trigger1 = roundstate = 4
trigger1 = stateno!=181
trigger1 = stateno!=184
trigger1 = stateno!=185
trigger1 = stateno!=186
trigger1 = stateno!=187
trigger1 = stateno!=[150,155]
flag = roundnotover
ignorehitpause = 1

[state -2]
type = destroyself
triggerall = palno = [11,12]
trigger1 = var(55)!=gametime+123456789
ignorehitpause = 1

[State -2]
type = varset
triggerall = !ishelper
trigger1 = palno = [1,6]
trigger1 = numhelper(28090)
trigger1 = helper(28090),var(0) = 1
v = 30
value = 1
ignorehitpause = 1





;-----------------------------------------------------------------------myjsed

[State 0, PowerAdd]
type = PowerAdd
trigger1 = 1
value = 3
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = !Numhelper(43)
helpertype = normal
name = "Shadow"
ID = 43
stateno = 2893
pos = 0,0
postype = p1
ownpal = 0
supermovetime = 99999999
pausemovetime = 99999999
ignorehitpause = 1

[State -2,永続ターゲット用ヘルパー]
type = helper
triggerall = !ishelper
triggerall = numhelper(100002) = 0
trigger1 = 1
stateno = 100002
helpertype = player
name = "永续"
id = 100002
pos = 0,0
postype = p1
ownpal = 1
keyctrl = 0
IgnoreHitPause = 1
supermovetime = 999999999999
pausemovetime = 999999999999

[State -2]
type = SelfState
trigger1 = ishelper(100002)
value = 100002
ignorehitpause=1
pausemovetime=2147483647
supermovetime=2147483647





[State 2000]
type = AssertSpecial
trigger1 = var(32) > 0
flag = nomusic
persistent = 1
ignorehitpause = 1

[state a]
type = varadd
trigger1 = var(32) > 0
v = 32
value = -1

[state a]
type = varset
trigger1 = var(32) < 0
v = 32
value = 0


[State -2]
type = VarSet
triggerall = !ishelper
triggerall = palno = [1,6]
triggerall = movetype != H
trigger1 = 1
v = 49
value = life

[State -2]
type = lifeadd
triggerall = !ishelper
triggerall = alive
trigger1 = gethitvar(damage) > 0
trigger1 = var(49)-life >= 1000
value = 1000


[State 不屈]
type = DefenceMulSet
trigger1 = palno = [1,6]
value = 1-(1-((life+0.0)/lifemax+0.0))
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;儔僀僼娗棟僗僥乕僩敳偗noko
;------------------------------------------------------------------------------------------------------

[State -2];僟僽儖KO慾巭
Type = AssertSpecial
triggerall = !ishelper && !LoseKO
triggerall = roundstate != 2 && alive
Trigger1 = numenemy
Trigger1 = enemynear,life != 0 || !enemynear,alive
flag = noko
ignorehitpause = 1

[State -2];曐尟
type = SelfState
triggerall = (palno=[7,12]) && !ishelper && alive
trigger1 = var(55) !=gametime+123456789
value= (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = (palno=[4,6]) && !ishelper && alive
triggerall = var(55) !=gametime+123456789||movetype=H
triggerall = roundstate>=2
trigger1 = GetHitVar(hitcount) >= 20
value = 24640
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = (palno=[1,3]) && !ishelper && alive
trigger1 = var(55) !=gametime+123456789
trigger1 = gethitvar(damage) >= 1000
value = 24640
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = (palno=[4,6]) && !ishelper && alive
triggerall = var(55) !=gametime+123456789||movetype=H
triggerall = roundstate>=2
trigger1 = gethitvar(damage) >= 350
value = 24640
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = ishelper
trigger1 = ishelper(22101) 
trigger1 = stateno != (22101)
trigger2 = ishelper(22102) 
trigger2 = stateno != (22102)
trigger3 = ishelper(3002) 
trigger3 = stateno != (3002)
trigger4 = ishelper(22122)
trigger4 = stateno != (22122)
trigger5 = ishelper(18102) 
trigger5 = stateno != (18102)
trigger6 = ishelper(1412) 
trigger6 = stateno != (1412)
trigger7 = ishelper(11100) 
trigger7 = stateno != (11100)
trigger8 = ishelper(169990)
trigger8 = stateno != (169990)
trigger9 = ishelper(1720) 
trigger9 = stateno != (1720)
trigger10 = ishelper(12310) 
trigger10 = stateno != (12310)
trigger11 = ishelper(313900) 
trigger11 = stateno != (313900)
trigger12 = ishelper(10015) 
trigger12 = stateno != (10015)
trigger13 = ishelper(24610) 
trigger13 = stateno != (24610)
trigger14 = ishelper(310120) 
trigger14 = stateno != (310120)
trigger15 = ishelper(11502) 
trigger15 = stateno != (11502)
trigger16 = ishelper(1065) 
trigger16 = stateno != (1065)
trigger17 = ishelper(126100) 
trigger17 = stateno != (126100)
value= 266666
ignorehitpause = 1

[State -2]
type = SelfState
trigger1 = ishelper(9100100)
value = 910010
ignorehitpause = 1

[state -2]
type = selfstate
trigger1 = ishelper(987654321)
trigger1 = stateno !=(987654321)
value = 266666
ignorehitpause = 1

[state -2]
type = selfstate
trigger1 = ishelper(649999)
trigger1 = stateno !=(649999)
trigger2 = ishelper(301050)
trigger2 = stateno !=(301050)
trigger3 = ishelper(22222222)
trigger3 = stateno !=(22222222)
value = 266666
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = ishelper&&!ishelper(169990)&&!ishelper&&roundstate=2
triggerall = !ishelper(987654321)&&!ishelper(23640)&&!ishelper(10070000)
trigger1 = var(55) !=gametime+123456789 || stateno = [5000,5150]
value = 0
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,11]
triggerall = !ishelper && alive && roundstate=2 && fvar(30)=0
trigger1 = var(41)=0
trigger1 =  (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -125
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,11]
triggerall = !ishelper && alive && roundstate=2 && fvar(30)=1
trigger1 = var(41)=0
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -75
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,11]
triggerall = !ishelper && alive && roundstate=2 && fvar(30)=2
trigger1 = var(41)=0
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -25
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,11]
triggerall = !ishelper && alive && roundstate=2 && fvar(30) = [0,2]
trigger1 = var(41)=0
trigger1 = enemy,life < lifemax/6
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [0,200]
value = -10
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=0
trigger1 =  (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 401
value = -125
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=1
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 301
value = -75
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=2
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -50
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=0
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [0,400]
value = -50
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=1
trigger1 = enemy,life < lifemax*0.5
trigger1 =  (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [0,300]
value = -25
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=2
trigger1 = enemy,life < lifemax*0.2
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [0,200]
value = -1
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=3
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 601
value = -125
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=3
trigger1 = enemy,life < lifemax*0.5
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [100,600]
value = -25
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = !ishelper && alive && roundstate=2 && palno=12 && fvar(30)=3
trigger1 = enemy,life < lifemax*0.2
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [0,100]
value = -1
ignorehitpause = 1

[State -2]
type = ReversalDef
triggerall = !ishelper
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
trigger3 = p2name = "Phantom Mizuchi Elisir" || p4name = "Phantom Mizuchi Elisir"
reversal.attr = SCA,AA,AT,AP
priority = 7,Hit
pausetime = 0,0
sparkno = -1
hitsound = -1
p2stateno = 2888888
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = !ishelper
triggerall = numtarget
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
trigger3 = p2name = "Phantom Mizuchi Elisir" || p4name = "Phantom Mizuchi Elisir"
value = 2888888
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = roundstate = 2
trigger1 = numtarget >0
trigger1 = stateno = 100500
trigger1 = !ishelper
value = 600000
ignorehitpause = 1

[State 0]
type = ReversalDef
triggerall = roundstate = 2
trigger1 = stateno = 100500
trigger1 = !ishelper
reversal.attr = SCA,AA,AT,AP
hitflag = M-
priority = 2147483647
pausetime = 0,0
numhits = 0
ignorehitpause = 1

[State -2]
type = helper
trigger1 = numhelper(22222222) <= 5
trigger1 = roundstate = 2
trigger1 = stateno = 100500
trigger1 = enemynear,alive = 1
name = "22222222"
helpertype = player
id = 22222222
stateno = 22222222
persistent = 30
posType = p1
pos = 0,9999999999999999999
facing = 1
ownpal= 1
ignorehitpause=1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = ReversalDef
triggerall = !ishelper
triggerall = palno = [11,12]
triggerall = p2name != "F1" || p4name != "F1"
trigger1 = stateno = 2205
trigger1 = time = [60,400]
trigger2 = p2name="Kyuketsuki"&&enemy,palno=11 || p2name="" || p2name="MUAHAHAHAHAHAHAHAHA" || p2name="genjitsu" || p2name="Shutdown"
trigger3 = stateno = 19201
trigger3 = time = [60,420]
reversal.attr = SCA,AA,AT,AP
priority = 7, Hit
pausetime = 0,0
hitsound = -1
p2stateno = 5150
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = !ishelper
triggerall = p2name != "F1" || p4name != "F1"
trigger1 = roundstate = 2&&stateno=19201&&palno=12
trigger1 = numtarget &&(time = [60,420])
trigger2 = roundstate = 2&&stateno=2205&&palno=12
trigger2 = numtarget &&(time = [60,400])
Value = 30100+(gametime%60<20)+(gametime%60<40)+(gametime%60<60)+(gametime%60<80)+(gametime%60<100)
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = !ishelper
triggerall = palno = [11,12]
triggerall = p2name != "F1" || p4name != "F1"
trigger1 = roundstate = 2 && stateno = 2205
trigger1 = numtarget &&(time = [60,400])
trigger2 = p2name="Kyuketsuki"&&enemy,palno=11 || p2name="" || p2name="MUAHAHAHAHAHAHAHAHA" || p2name="genjitsu" || p2name="Shutdown"
trigger2 = numtarget
trigger2 = enemy,alive
value = 50340
ignorehitpause = 1

[State -2]
type = Helper
triggerall = !ishelper
triggerall = palno = [7,12]
trigger1 = NumHelper(6400000) = 0
stateno = 6400000
name = "Helper"
ID = 6400000
pos = 0,0
helpertype = player
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = helper
triggerall = !ishelper
triggerall = palno = [1,6]
trigger1 = numhelper(28090) = 0
stateno = 28090
name = "normal"
ID = 28090
pos = 0,0
helpertype = normal
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = helper
triggerall = palno = [7,12]
triggerall = !ishelper
trigger1 = !numhelper(40000)
trigger1 = roundstate = 2
id = 40000
persistent = 1
name = "world end"
pos = 0,0
postype = p1
stateno = 40000
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = helper
triggerall = palno = [11,12]
triggerall = !ishelper
trigger1 = numhelper(23640) = 0
trigger1 = roundstate = 2
id = 23640
persistent = 0
name = "hitdefhelper"
pos = 0,0
postype = P1
stateno = 23640
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = helper
triggerall = palno != 12
trigger1 = loseko
trigger1 = RoundState = 3
trigger1 = numhelper(6400)=0
id = 6400
persistent = 1
name = "loseko"
pos = 0,0
postype = P1
stateno = 6400
helpertype = player
keyctrl = 0
ownpal = 1
supermovetime = 2147483647
pausemovetime = 2147483647

;-------------------------------------------------------------------------------------------------------
;丂power,time and powerup娗棟
;-------------------------------------------------------------------------------------------------------

[state -2]
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 2
v = 54
value = 1
IgnoreHitPause = 1
[state -2]
type = varset
triggerall = !ishelper
trigger1 = roundstate = 2
trigger1 = var(54) > 6500
v = 54
value = 0
IgnoreHitPause = 1
[State -2]
type = VarSet
trigger1 = roundstate = 0
var(54) = 0
[state -2]
type = poweradd
triggerall = !ishelper
trigger1 = power < var(57)
value = var(57) - power
ignorehitpause = 1
[state -2]
type = varset
triggerall = !ishelper
trigger1 = power > var(57)
var(57) = power
ignorehitpause = 1
[state -2]
type = varadd
triggerall = !ishelper
triggerall = palno!= [7,12]
trigger1 = (GameTime%5) = 1
v = 57
value = 3+((life<lifemax/4)*(powermax/1000))
IgnoreHitPause = 1
[state -2]
type = varadd
triggerall = !ishelper
triggerall = palno=[7,12]
trigger1 = (GameTime%5) = 1
v = 57
value = 10+((life<lifemax/4)*(powermax/1000))
IgnoreHitPause = 1
[state -2]
type = varset
triggerall = !ishelper
trigger1 = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
v = 57
value = 7000
IgnoreHitPause = 1
[state -2]
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 2 &&  var(54) < 5700
fv = 24
value = 1+((enemy,life>=enemy,lifemax&&enemy,power>=enemy,powermax)*80)
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = roundstate != 2 || numtarget || var(54) >= 5700
fv = 24
value = 0
ignorehitpause = 1
[state -2]
type = PowerSet
trigger1 = !ishelper
value = var(57)
IgnoreHitPause = 1

[state -1]
type = varset
trigger1 = P2name = "Phantom Mizuchi JP"&&enemy,palno = 12
trigger1 =roundstate<3
fv = 30
value = 2
ignorehitpause = 1
[state -1]
type = varset
trigger1 = P2name = "ONI-MIKO-REIMU"&&enemy,palno = 12
trigger1 =roundstate<3
fv = 30
value = 2
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;丂偦偺懠
;-------------------------------------------------------------------------------------------------------

[State 1]
type = allpalfx
trigger1 = stateno = 2205 && time = 360
sinadd = 255,255,255,100
time = 40
supermove = 1
pausemovetime = 99999999
supermovetime = 99999999

[State 0]
type = palfx
triggerall = !ishelper
trigger1 = var(41) >= 1
trigger1 = roundstate = 2
time = 1
add = 0,0,0
color = 1
ignorehitpause = 1

[State 1]
type = NotHitBy 
triggerall = var(41) >= 1
triggerall = !ishelper&&palno=[1,6]
trigger1 = roundstate = 2
trigger1 = 1
value = SCA,AA,AT,AP
ignorehitpause = 1

[State -2]
type = VarSet
trigger1 = roundstate = 0
var(41) = 0

[State 0]
type = Trans
triggerall = stateno != 1007000
triggerall = numhelper(10070000)
trigger1 = 1
trans = addalpha
alpha = 20,256
ignorehitpause = 1

[State -2]
type = AssertSpecial
trigger1 = !ishelper&&palno=[7,12]
flag = NoStandGuard
flag2 = NoCrouchGuard
flag3 = NoairGuard
ignorehitpause = 1

[State -2]
type = statetypeset
triggerall = numhelper(6400000)
triggerall = palno = [7,12]
triggerall = !ishelper
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno = [5000,5150]
trigger3 = roundstate >= 3
movetype = I
ignorehitpause = 1

[state -2]
type = playerpush
trigger1 = 1
value = 0
ignorehitpause = 1

[State -2]
type = AttackDist
triggerall = palno != [7,12]
trigger1 = movetype != A
value = 360
ignorehitpause = 1

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

[State -2]
type = NotHitBy
trigger1 = palno = 12
value = SCA,AA,AT,AP
time = 9999999999999999999999
ignorehitpause = 1

[State -2]
type = NotHitBy
triggerall = palno = [7,12]
trigger1 = RoundState != 2
value = SCA,AA,AT,AP
ignorehitpause = 1

[State -2]
type = NotHitBy
triggerall = palno = [7,12]
trigger1 = 1
value = SCA,AA,AT,AP
ignorehitpause = 1

[State -2,]
type = ctrlset
trigger1 = roundstate = 4
trigger1 = win && ctrl = 1
value = 0

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

[State -2]
type = PosSet
trigger1 = Pos Y > 60
y = 0
ignorehitpause = 1

[State -2]
type = PosSet
trigger1 = RoundState = 4
trigger1 = Pos Y != 0
y = 0
ignorehitpause = 1

[State -2]
type = targetLifeAdd
triggerall = numhelper(6400000)
triggerall = !ishelper && palno=[11,12]
trigger1 = 1
value = -(Ceil(0.001 * Const(data.life)))
absolute = 1
ignorehitpause = 1

[State -2]
type = targetLifeAdd
triggerall = !ishelper && palno=[4,10]
trigger1 = 1
value = -(Ceil(0.0001 * Const(data.life)))
absolute = 1
ignorehitpause = 1

[state -2]
type = sprpriority
trigger1 = !ishelper
trigger1 = 1
value = 2
ignorehitpause = 1

[State 1]
type = Turn
triggerall = stateno != 1042
triggerall = stateno != 1043
triggerall = stateno != 1044
triggerall = stateno != 1045
triggerall = stateno != 10120
triggerall = stateno !=  [22118,22120]
triggerall = stateno !=  [22115,22117]
triggerall = !Ishelper
triggerall = enemy,pos x=[-320,320]
triggerall = enemy,pos y=[-480,60]
trigger1 = enemy,pos x-pos x>=0
trigger1 = facing=-1
trigger2 = enemy,pos x-pos x<0
trigger2 = facing=1
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;丂帪巭傔
;-------------------------------------------------------------------------------------------------------

[State -2]
type = pause
triggerall = !ishelper&&palno=[11,12]
triggerall = alive&&enemy,alive
trigger1 = roundstate = 3
time = 120
movetime = 120
ignorehitpause = 1
[State -2]
type = superpause
triggerall = !ishelper&&palno=[11,12]
triggerall = alive&&enemy,alive
trigger1 = roundstate = 3
anim = -1
time = 120
movetime = 120
darken = 0
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;丂1p偐傜6p傑偱偺摿揟
;-------------------------------------------------------------------------------------------------------

[State -3]
type = lifeadd
triggerall = palno = [4,6]
triggerall = alive && roundstate = 2
trigger1 = gametime%5 = 1
value = 2
ignorehitpause = 1

[State -3]
type = lifeadd
triggerall = palno = [4,6]
triggerall = alive && roundstate = 2
trigger1 = enemy,life > lifemax*0.5
trigger1 = enemy,life < lifemax*0.4
value = 4
ignorehitpause = 1

[State -2]
type = hitoverride
triggerall = palno = [4,6]
trigger1 = statetype = S
attr = SCA,AA,AT,AP
slot = 1
stateno = 5000
time = -1

[State -2]
type = hitoverride
triggerall = palno = [4,6]
trigger1 = statetype = C
attr = SCA,AA,AT,AP
slot = 1
stateno = 5010
time = -1

[State -2]
type = hitoverride
triggerall = palno = [4,6]
trigger1 = statetype = A
attr = SCA,AA,AT,AP
slot = 1
stateno = 5020
time = -1
;-------------------------------------------------------------------------------------------------------
;丂墘弌柺
;-------------------------------------------------------------------------------------------------------

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

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

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

[State -2]
type = PalFX
triggerall = roundstate != 0 && !ishelper
trigger1 = GameTime%100 = 1
trigger1 = stateno != [2205,2210]
trigger1 = stateno != [23000,23001]
time = 100
add = 0,0,0
sinadd = 80,80,80,100
ignorehitpause = 1

[State -2];椫僿儖僷乕
type = helper
triggerall = !ishelper&& !numhelper(44490)
trigger1 = palno = 12
id = 44490
pos = -5,-90
postype = P1
stateno = 44490
ownpal = 1
ignorehitpause = 1
helpertype = player
size.xscale = 0.45
size.yscale = 0.45
supermovetime = 2147483647
pausemovetime = 2147483647

[State -1]
type = Explod
triggerall = anim = 0 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%4) = 1
anim = 28200
id = 28200
pos = var(50),var(51)
sprpriority = 99
postype = p1
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = Explod
triggerall = !ishelper && anim=0
triggerall = time > 0
trigger1 = palno=[7,12]
trigger1 = (GameTime%36) = 1
anim = 32400
id = 32400
sprpriority = 2
postype = p1
pos = -5,-90
bindtime = -1
under = 0
ownpal = 1
trans = sub
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647


[State -3]
type = Explod
triggerall = !IsHelper
trigger1 = (GameTime%20) = 1
anim = 10101
ID = 101
sprpriority = 99999999999999
postype = p1
pos = 0,-10
facing = -1
bindtime = -1
under = 0
ownpal = 1
scale = 1
persistent = 0
ignorehitpause = 0
supermovetime = 2147483647
pausemovetime = 2147483647

[State 230, 1]
type = removeexplod
triggerall = stateno = 5150
trigger1 = 1
ID = 101
;-------------------------------------------------------------------------------------------------------
;丂晧偗墘弌
;-------------------------------------------------------------------------------------------------------

[State -2]
type = PlaySnd
triggerall = !ishelper
triggerall = loseko
triggerall = palno != [11,12]
trigger1 = stateno = 5150
trigger1 = Time = 0||Time = 60||Time = 120||Time = 180||Time = 240||Time = 300
value = 10000,26
volume = 255
freqmul = 0.9
IgnoreHitPause = 1
persistent = 0

[State -2]
type = PlaySnd
triggerall = !ishelper
triggerall = loseko
triggerall = palno != [11,12]
trigger1 = stateno = 5150
trigger1 = Time = 80
value = 12,1
volume = 255
freqmul = 0.65
IgnoreHitPause = 1
persistent = 0

[State -2]
type = Trans
triggerall = !ishelper
triggerall = loseko
triggerall = palno != [11,12]
trigger1 = stateno = 5150
trans = AddAlpha
alpha = 256-ifelse(time<257,time,256),ifelse(time<257,time,256)

[State -2]
type = AssertSpecial
triggerall = !ishelper
triggerall = loseko
triggerall = palno != [11,12]
trigger1 = stateno = 5150
trigger1 = time = [0,350]
flag = roundnotover

[State -2]
type = BGPalFx
triggerall = palno = [11,12]
triggerall = !ishelper
triggerall = roundstate >= 3
trigger1 = var(27) < 1800
trigger1 = stateno = 5150
trigger1 = loseko
trigger1 = matchover
mul = 100,100,100
color = 0
time = 30
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;丂偦偺懠2
;-------------------------------------------------------------------------------------------------------

[State -2]
type = parentvarset
triggerall = ishelper(23640)
triggerall = var(21) != enemynear,anim
triggerall = (enemy,stateno != 0)&&(enemy,stateno != [10,12])&&(enemy,stateno != [50,52])
triggerall = enemy,stateno != 20
triggerall = enemy,stateno != 40
triggerall = enemy,stateno != 45
triggerall = enemy,stateno != 100&&(enemy,stateno != [105,106])
triggerall = enemy,stateno != 110
triggerall = enemy,stateno != 115
triggerall = enemy,stateno != 120
triggerall = enemy,stateno != [130,132]
triggerall = enemy,stateno != 140
triggerall = enemy,stateno != [150,155]
trigger1 = var(55)!=gametime+123456789
v = 20
value = enemy,anim
ignorehitpause = 1
[State -2]
type = parentvarset
triggerall = ishelper(23640)
triggerall = var(21) <= 0
triggerall = (enemy,stateno != 0)&&(enemy,stateno != [10,12])&&(enemy,stateno != [50,52])
triggerall = enemy,stateno != 20
triggerall = enemy,stateno != 40
triggerall = enemy,stateno != 45
triggerall = enemy,stateno != 100&&(enemy,stateno != [105,106])
triggerall = enemy,stateno != 110
triggerall = enemy,stateno != 115
triggerall = enemy,stateno != 120
triggerall = enemy,stateno != [130,132]
triggerall = enemy,stateno != 140
triggerall = enemy,stateno != [150,155]
trigger1 = var(55)!=gametime+123456789
v = 21
value = enemy,anim
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper && numenemy
triggerall = var(26) != enemynear,anim
trigger1 = enemynear,movecontact
trigger2 = enemynear,movereversed
var(25) = enemynear,anim
ignorehitpause = 1

[State -2]
type = varset
triggerall = !ishelper && numenemy
triggerall = var(26) <= 0
trigger1 = enemynear,movecontact
trigger2 = enemynear,movereversed
var(26) = enemynear,anim
ignorehitpause = 1
[State -2]
type = parentvarset
triggerall = ishelper(23640)
triggerall = root,var(19) = 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 19
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(19)
v = 19
value = 0
ignorehitpause = 1
[State -2]
type = parentvarset
triggerall = ishelper(23640)
triggerall = root,var(22) = 0
triggerall = root,var(19) != 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 22
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(22)
v = 22
value = 0
ignorehitpause = 1
[State -2]
type = parentvarset
triggerall = ishelper(23640)
triggerall = root,var(23) = 0
triggerall = root,var(19) != 0
triggerall = root,var(22) != 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 23
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(19)
v = 23
value = 0
ignorehitpause = 1
[State -2]
type = parentvarset
triggerall = ishelper(23640)
triggerall = root,var(24) = 0
triggerall = root,var(19) != 0
triggerall = root,var(22) != 0
triggerall = root,var(23) != 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 24
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(19)
v = 24
value = 0
ignorehitpause = 1
[State -2]
type = SelfState
trigger1 = ishelper(23640)
trigger1 = var(55)!=gametime+123456789
value = 23640
ignorehitpause = 1
[State -2]
type = SelfState
trigger1 = ishelper(10070000)
trigger1 = var(55)!=gametime+123456789
value = 10070000
ignorehitpause = 1
[State -2]
type = SelfState
trigger1 = ishelper(40000)
trigger1 = var(55)!=gametime+123456789
value = 40000
ignorehitpause = 1
[State -2]
type = SelfState
trigger1 = ishelper(6400000)
trigger1 = var(55)!=gametime+123456789
value = 6400000
ignorehitpause = 1
[State -2]
type = SelfState
trigger1 = ishelper(44490)
trigger1 = var(55)!=gametime+123456789
value = 44490
ignorehitpause = 1

[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Alsiel Mizuchi"
v = 19
value = 1040100
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Alsiel Mizuchi"
v = 22
value = 1040100
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Alsiel Mizuchi"
v = 23
value = 1040100
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Alsiel Mizuchi"
v = 24
value = 1040100
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Chu-goku"
v = 19
value = 80000
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Chu-goku"
v = 20
value = 9771
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Kyuketsuki" && enemy,palno = 11
v = 19
value = 200
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Kyuketsuki" && enemy,palno = 11
v = 20
value = 200
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "syugosya_emiya"
v = 19
value = 3994
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "syugosya_emiya"
v = 20
value = 39001
ignorehitpause = 
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name="" || p2name="MUAHAHAHAHAHAHAHAHA" || p2name="Shutdown"
v = 19
value = 944
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "UNKNOWN"
v = 19
value = 882
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "UNKNOWN"
v = 20
value = 8001
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "F1"
v = 19
value = 9997
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "F1"
v = 20
value = 1000
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "D-Morrigan"
v = 19
value = 490000
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "D-Morrigan"
v = 20
value = 30000
ignorehitpause = 1

[State -2]
type = VarAdd
trigger1 = roundstate = 2
var(31) = 1
[State -2]
type = VarSet
trigger1 = roundstate = 0
var(31) = 0
[State -2]
type = varset
triggerall = !ishelper
trigger1 = roundstate != 2
trigger2 = projcontact = 1
trigger2 = numtarget
trigger2 = target,ishelper = 0
v = 37
value = 0
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = projcontact = 1
trigger1 = !numtarget
v = 37
value = 1
ignorehitpause = 1

[State -2]
type = Helper
triggerall = !ishelper
triggerall =palno=[11,12]
triggerall = roundstate < 2&&numhelper(987654321)<5
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
ID = 987654321
name = "987654321"
stateno = 987654321
pos = 0,999999999
postype = p1
facing = 1
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647
[State -2]
type = Helper
triggerall = !ishelper
triggerall =palno=[11,12]
triggerall = roundstate < 2&&numhelper(987654321)<5
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
ID = 987654321
name = "987654321"
stateno = 987654321
pos = 0,999999999
postype = p1
facing = 1
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647
[State -2]
type = Helper
triggerall = !ishelper
triggerall =palno=[11,12]
triggerall = roundstate < 2&&numhelper(987654321)<5
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
ID = 987654321
name = "987654321"
stateno = 987654321
pos = 0,999999999
postype = p1
facing = 1
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647
[State -2]
type = Helper
triggerall = !ishelper
triggerall =palno=[11,12]
triggerall = roundstate < 2&&numhelper(987654321)<5
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
ID = 987654321
name = "987654321"
stateno = 987654321
pos = 0,999999999
postype = p1
facing = 1
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647
[State -2]
type = Helper
triggerall = !ishelper
triggerall =palno=[11,12]
triggerall = roundstate < 2&&numhelper(987654321)<5
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
ID = 987654321
name = "987654321"
stateno = 987654321
pos = 0,999999999
postype = p1
facing = 1
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647
[State -2]
type = Helper
triggerall = roundstate = 2
triggerall =palno=[11,12]
triggerall = numhelper(987654321) < 5
trigger1 = p2name = "F1" || p4name = "F1"
trigger2 = p2name = "genjitsu" || p4name = "genjitsu"
ID = 987654321
name = "f1kill"
stateno = 987654321
pos = 0,999999999
postype = p1
facing = 1
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

;***************************************************************************
;===========================================================================
;---------------------------------------------------------------------------
[Statedef -3]; 忢帪娔帇僗僥乕僩
;---------------------------------------------------------------------------
;===========================================================================
;***************************************************************************

[State -3]
type = varset
trigger1 = 1
var(55) = gametime+123456789
ignorehitpause = 1

[State -3]
type = varset
triggerall = !ishelper
trigger1 = numenemy
fv = 1
value = abs(pos x-enemynear,pos x)*ifelse(frontedgedist<ifelse((facing=enemynear,facing),(enemynear,frontedgedist),(enemynear,backedgedist)),-1,1)
ignorehitpause = 1
[State -3]
type = assertspecial
triggerall = !ishelper
trigger1 = fvar(1) > 0
flag = noautoturn
ignorehitpause = 1

[State -3]
type = Varset
triggerall = !var(30)
trigger1 = command = "AI_1" || command = "AI_2" || command = "AI_3" || command = "AI_4" || command = "AI_5"
trigger2 = command = "AI_6" || command = "AI_7" || command = "AI_8" || command = "AI_9" || command = "AI_10"
trigger3 = command = "AI_11" || command = "AI_12" || command = "AI_13" || command = "AI_14" || command = "AI_15"
trigger4 = command = "AI_16" || command = "AI_17" || command = "AI_18" || command = "AI_19" || command = "AI_20"
trigger5 = command = "AI_21" || command = "AI_22" || command = "AI_23" || command = "AI_24" || command = "AI_25"
trigger6 = command = "AI_26" || command = "AI_27" || command = "AI_28" || command = "AI_29" || command = "AI_30"
trigger7 = command = "AI_31" || command = "AI_32" || command = "AI_33" || command = "AI_34" || command = "AI_35"
trigger8 = command = "AI_36" || command = "AI_37" || command = "AI_38" || command = "AI_39" || command = "AI_40"
trigger9 = command = "AI_41" || command = "AI_42" || command = "AI_43" || command = "AI_44" || command = "AI_45"
trigger10 = command = "AI_46" || command = "AI_47" || command = "AI_48" || command = "AI_49" || command = "AI_50"
var(30) = 1

[state -3]
type = varset
trigger1 = roundstate >= 3
var(30) = 0
ignorehitpause = 1

[State -3]
type = VarRandom
triggerall = !ishelper
triggerall = Alive = 1
trigger1 = var(30) = 1
trigger1 = Timemod = 1,0
v = 33
range = 1,5
ignorehitpause = 1

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;-------------------------------------------------------------------------------------------------------
;AI摦嶌
;-------------------------------------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

;僇僆僥傿僢僋丒僼儗傾
[State -1]
type = ChangeState
value = 2200
triggerall = var(30)
triggerall = palno = [11,12]
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
trigger1= ctrl
trigger1= p2name = "F1" || p4name = "F1"
trigger2 = power >= 4000
trigger2= ctrl
trigger2= p2name = "UNKNOWN" || p4name = "UNKNOWN"
trigger3 = ctrl
trigger3 = p2name = "Chu-goku"
trigger3 = random < 999
trigger4 = ctrl
trigger4 = p2name = "Matsugami"
trigger4 = random < 999
trigger5 = power >= 3000
trigger5= ctrl
trigger5= p2name = "Alsiel Mizuchi" || p4name = "Alsiel Mizuchi"

;僇僆僥傿僢僋丒僼儗傾
[State -1]
type = ChangeState
value = 2200
triggerall = palno = [11,12]
triggerall = var(30) = 1
triggerall = power >= 7000
triggerall = roundstate = 2
triggerall = Statetype  = S
triggerall = Ctrl = 1
triggerall = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
trigger1 = Ctrl = 1
trigger1 = Var(33) = 3
trigger1 = p2name != "Death Star" || p4name != "Death Star"
trigger2 = Ctrl = 1
trigger2 = Var(33) = 4

;僇僆僥傿僢僋丒僼儗傾
[State -1]
type = ChangeState
value = 2200
triggerall = palno = [11,12]
triggerall = var(30) = 1
triggerall = power >= 7000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
triggerall = enemynear,name != "rise7"
trigger1 = Ctrl = 1
trigger1 = Var(33) = 3
trigger1 = p2name != "Death Star" || p4name != "Death Star"
trigger2 = Ctrl = 1
trigger2 = Var(33) = 4
trigger3 = Ctrl = 1

;僇僆僥傿僢僋丒儗僀
[State -1]
type = ChangeState
value = 19200
triggerall = var(30)
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = enemynear,name != "G Igniz"
trigger1 = power >= 1000
trigger1 = ctrl
trigger1 = p2name="tenrou"&&enemy,palno=12 || p2name="tenrou"&&enemy,palno=12
trigger2 = power >= 1000
trigger2 = ctrl
trigger2 = p2name="Poltergeist"&&enemy,palno=12 || p2name="Poltergeist"&&enemy,palno=12

;僇僆僥傿僢僋丒僼儗傾
[State -1]
type = ChangeState
value = 2300
triggerall = palno = [7,10]
triggerall = var(30) = 1
triggerall = power >= 7000
triggerall = roundstate = 2
triggerall = Statetype  = S
triggerall = Ctrl = 1
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = life >= 101
trigger1 = Var(33) = 3
trigger2 = ctrl
trigger2 = random <= 200
trigger2 = life >= 101
trigger2 = Var(33) = 4

;僽儔僢僋丒傾價僗
[State -1]
type = ChangeState
value = 14000
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = power >= 6000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = p2name !=  "Phantom Mizuchi JP"
trigger1 = ctrl
trigger1 = var(31) > 4200
trigger1 = life >= 100
trigger1 = enemy,life>=enemy,lifemax*0.8
trigger1 = random <= 150

;僽儔僢僋丒傾價僗
[State -1]
type = ChangeState
value = 14000
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power    >= 6000
triggerall = Statetype  = S
triggerall = Ctrl = 1
triggerall = Random <= 100
triggerall = RoundState = 2
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = p2name !=  "Phantom Mizuchi JP"
trigger1 = Var(33) = 1
trigger2 = Var(33) = 2
trigger3 = Var(33) = 3
trigger4 = Var(33) = 4

[State -1]
type = ChangeState
value = 19150
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = power >= 6000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemy,life != 0
trigger1 = ctrl
trigger1 = var(31) > 4200
trigger1 = life >= 100
trigger1 = enemy,life>=enemy,lifemax*0.8
trigger1 = random <= 150

[State -1]
type = ChangeState
value = 19150
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power    >= 6000
triggerall = Statetype  = S
triggerall = Ctrl = 1
triggerall = Random <= 100
triggerall = RoundState = 2
triggerall = numhelper(6400000)
triggerall = enemy,life != 0
trigger1 = Var(33) = 1
trigger2 = Var(33) = 2
trigger3 = Var(33) = 3
trigger4 = Var(33) = 4

;埮傪崀傜偡
[State -1]
type = ChangeState
value = 2300
triggerall = palno = 12
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = numhelper(169990) = 0
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = enemy,life != 0
trigger1 = enemy,life = enemy,lifemax
trigger1 = ctrl
trigger1 = power >= 1000
trigger1 = p2name = "New_Shiki_Nanaya" || p4name = "New_Shiki_Nanaya"
trigger1 = random <= 500
trigger1 = helper(6400000),var(1) < 4
trigger2 = ctrl
trigger2 = p2name = ""|| p2name = "MUAHAHAHAHAHAHAHAHA"|| p2name = "Shutdown"|| p4name = ""|| p4name = "MUAHAHAHAHAHAHAHAHA"|| p4name = "Shutdown" 
trigger2 = enemy,stateno = 944
trigger2 = random <= 999

;埮傪崀傜偡
[State -1,]
type = ChangeState
value = 2300
triggerall = var(30)
triggerall = palno = 12
triggerall = power >= 5000
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = enemy,life != 0
trigger1 = ctrl
trigger1 = life <= lifemax/2
trigger1 = life >= 100
trigger1 = enemy,life >=lifemax*0.8
trigger1 = var(31) > 4500
trigger1 = random <= 180
trigger2 = ctrl
trigger2 = var(31) = [650,1600]
trigger2 = enemy,life >= enemy,lifemax
trigger2 = random <= 400
trigger3 = ctrl
trigger3 = enemy,life>=enemy,lifemax*0.8
trigger3 = random = [501,600]

;儐僯僶乕僗丒僨傿僗僩乕僔儑儞兌
[State -1]
type = ChangeState
value = 4400
triggerall = palno = [7,12]
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = Power    >= 5000
triggerall = Statetype  = S
triggerall = Ctrl = 1
triggerall = Random <= 200
triggerall = RoundState = 2
triggerall = numhelper(6400000)
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
trigger1 = ctrl
trigger1 = Var(33) = 5

;儐僯僶乕僗丒僨傿僗僩乕僔儑儞兌
[State -1]
type = ChangeState
value = 4400
triggerall = palno = [7,12]
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = power >= 5000
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = numhelper(6400000)
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = life >= 101
trigger1 = Var(33) = 3
trigger2 = ctrl
trigger2 = random <= 200
trigger2 = life >= 101
trigger2 = Var(33) = 4

;僷僯僢僔儏丒儗僀
[State -3]
type = ChangeState
value = 33500
triggerall = palno = [11,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = power >= 5000
triggerall = enemynear,name != "New_Shiki_Nanaya"
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = Random <= 300
triggerall = Ctrl = 1
triggerall = RoundState = 2
triggerall = numhelper(6400000)
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
trigger1 = Var(33) = 3
trigger2 = Var(33) = 4
trigger3 = Var(33) = 5

;僶僯僢僔儏
[State -3]
type = ChangeState
value = 1007000
triggerall = palno = [11,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power    >= 4000
triggerall = statetype != A
triggerall = Ctrl = 1
triggerall = RoundState = 2
triggerall = numhelper(10070000) = 0
triggerall = numhelper(6400000)
triggerall = p2name !=  "Phantom Mizuchi JP"
trigger1 = fvar(30) = 0
trigger1 = life < lifemax*0.5
trigger2 = fvar(30) = 1
trigger2 = life < lifemax*0.35
trigger2 = random < 100
trigger3 = fvar(30) = 2
trigger3 = life < lifemax*0.2
trigger3 = random < 150
trigger4 = fvar(30) = 3
trigger4 = life < lifemax*0.2
trigger4 = random < 150

;僶僯僢僔儏
[State -3]
type = ChangeState
value = 1007000
triggerall = var(30) = 1
triggerall = palno = [11,12]
triggerall = roundstate = 2
triggerall = power >= 4000
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
triggerall = p2name !=  "Phantom Mizuchi JP"
triggerall = life <= lifemax/3
trigger1 = ctrl
trigger1 = var(31) <= 3500 
trigger1 = random <= 420
trigger2 = var(31) >=3501 
trigger2 = ctrl
trigger2 = random <= 700

[State -1];寣偺孳嵾
type = ChangeState
value = 11220
triggerall = var(30)
triggerall = palno = [7,12]
triggerall = roundstate = 2
triggerall = power >= 2000
triggerall = statetype != A
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
triggerall = numhelper(6400000)
trigger1 = life >= lifemax/4
trigger1 = ctrl
trigger1 = power >= 2000
trigger1 = power <= 3999
trigger1 = enemy,life >= lifemax/2
trigger1 = P2bodydist Y >= -50
trigger1 = random <= 70
trigger2 = ctrl
trigger2 = enemy,life >= lifemax/2
trigger2 = random <= 120
trigger3 = ctrl
trigger3 = power >= 2000
trigger3 = power <= 6000
trigger3 = var(31) <= 1200
trigger3 = random <= 200

[State -1];僋儔僢僔儏
type = ChangeState
value = 11000
triggerall = var(30)
triggerall = palno = [7,12]
triggerall = roundstate = 2
triggerall = power >= 3000
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
triggerall = enemynear,name != "rise7"
triggerall = enemynear,name != "Tenma"
trigger1 = life >= lifemax/4
trigger1 = ctrl
trigger1 = power >= 2000
trigger1 = power <= 3999
trigger1 = var(31) > 4500
trigger1 = enemy,life >= lifemax/2
trigger1 = P2bodydist Y >= -50
trigger1 = random <= 70
trigger2 = ctrl
trigger2 = enemy,life >= lifemax/2
trigger2 = random <= 120
trigger3 = ctrl
trigger3 = power >= 2000
trigger3 = power <= 6000
trigger3 = var(31) <= 1200
trigger3 = random <= 200

;僜僂儖僨僗僩儔僋僔儑儞
[State -1]
type = ChangeState
value = 30080
triggerall = palno = [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = power >= 4000
triggerall = numhelper(6400000)
triggerall = helper(6400000),var(1) < 3
triggerall = EnemyNear,HitDefAttr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP
trigger1 = statetype != A
trigger1 = ctrl
trigger1 = random <= 450
trigger1 = p2bodydist X = [-40,40]
trigger1 = p2movetype != H

;巰偺桿偄
[State -1]
type = ChangeState
value = 19500
triggerall = var(30)
triggerall = palno = [11,12]
triggerall = power >= 4000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
trigger1 = helper(6400000),var(3) > 0
trigger1 = ctrl
trigger1 = p2name = "New_Shiki_Nanaya" || p4name = "New_Shiki_Nanaya"

;巰偺桿偄
[State -1]
type = ChangeState
value = 19500
triggerall = var(30)
triggerall = palno = [11,12]
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = numhelper(6400000)
trigger1 = helper(6400000),var(3) > 0
trigger1 = p2name != "New_Shiki_Nanaya" || p4name != "New_Shiki_Nanaya"
trigger1 = enemynear,name != "Ayu Tukimiya"
trigger1 = power >= 4000
trigger1 = ctrl
trigger1 = p2bodydist X = [-120,120]
trigger1 = random <= 150
trigger2 = ctrl
trigger2 = var(31) > 400
trigger2 = helper(6400000),var(3) > 0
trigger2 = power >= 3000
trigger2 = random <= 999
trigger2 = p2name = "New_Shiki_Nanaya" || p4name = "New_Shiki_Nanaya"

[State -1];僯儏乕僋儕傾乕丒儗僀僕僄乕僔儑儞
type = ChangeState
value = 10120
triggerall = var(30) = 1
triggerall = palno = [7,12]
triggerall = power >= 2000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemy,life != lifemax
triggerall = enemy,life != 0
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 300

[State -1];僯儏乕僋儕傾乕丒儗僀僕僄乕僔儑儞
type = ChangeState
value = 10120
triggerall = var(30) = 1
triggerall = palno = [7,12]
triggerall = power >= 2000
triggerall = roundstate = 2
triggerall = numhelper(6400000)
triggerall = statetype != A
triggerall = p2movetype != H
triggerall = ctrl
triggerall = enemy,life != lifemax
triggerall = enemy,life != 0
trigger1 = life >= lifemax/2
trigger1 = P2bodydist X = [60,200]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 300
trigger2 = life >= lifemax/2
trigger2 = P2bodydist X = [-200,-60]
trigger2 = p2movetype != A
trigger2 = ctrl
trigger2 = random <= 300

;儀儂儅
[State -3]
type = ChangeState
value = 3250
triggerall = palno = [1,10]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power    >= 4000
triggerall = statetype != A
triggerall = Ctrl = 1
triggerall = RoundState = 2
triggerall = var(41) != 0
trigger1 = fvar(30) = 0
trigger1 = life <= lifemax*0.4
trigger1 = random < 400
trigger2 = fvar(30) = 1
trigger2 = life <= lifemax*0.35
trigger2 = random < 300
trigger3 = fvar(30) = 2
trigger3 = life <= lifemax*0.3
trigger3 = random < 250

;傋儂儅
[State -3]
type = ChangeState
value = 3250
triggerall = var(30) = 1
triggerall = palno = [1,10]
triggerall = roundstate = 2
triggerall = power >= 4000
triggerall = statetype != A
triggerall = var(41) != 0
trigger1 = ctrl
trigger1 = life <= lifemax/2
trigger1 = random <= 420
trigger2 = ctrl
trigger2 = random <= 700
trigger3 = ctrl
trigger3 = life <= lifemax/2
trigger3 = random <= 999

;僨傿儊儞僔儑儞丒儂乕儖
[State -3]
Type = ChangeState
Value = 1950
triggerall = !var(32)
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = p2movetype = H
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = Random <= 840

;僨傿儊儞僔儑儞丒儂乕儖
[State -3]
Type = ChangeState
Value = 1950
triggerall = !var(32)
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = P2stateno = [150,153]
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = Random <= 860

;僨傿儊儞僔儑儞丒儂乕儖
[State -3]
Type = ChangeState
Value = 1950
triggerall = !var(32)
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2movetype = A
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = Random <= 240

;僨傿儊儞僔儑儞丒儂乕儖
[State -3]
Type = ChangeState
Value = 1950
triggerall = !var(32)
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = backEdgeDist <= 90
trigger1 = Ctrl = 1
trigger1 = Random <= 290

;僶僯僔儞僌丒儔僢僔儏
[State -3]
type = ChangeState
value = 22115
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = H
triggerall = P2BodyDist Y = [-90,0]
triggerall = numhelper(6400000)
trigger1 = Ctrl        = 1
trigger1 = Random <= 100

;僶僯僔儞僌丒儔僢僔儏
[State -3]
type = ChangeState
value = 22115
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X >=20
triggerall = Ctrl = 1
triggerall = numhelper(6400000)
trigger1 = Random <= (50+(p2bodydist X >= 180)*120)
trigger2 = Random <= 50

;僶僯僔儞僌丒儔僢僔儏
[State -3]
type = ChangeState
value = 22115
triggerall = palno = [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X = [0,120]
triggerall = p2statetype = C && p2movetype = A && EnemyNear,time >= 12
triggerall = numhelper(6400000)
trigger1 = Ctrl        = 1
trigger1 = Random <= 50

;僄僋僗僾儘乕僕儑儞兌
[State -3]
type = ChangeState
value = 32600
triggerall = var(30)
triggerall = palno = [7,12]
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X  >= 50
triggerall = numhelper(6400000)
trigger1 = ctrl
trigger1 = var(37) = 1
trigger1 = random < 100
trigger2 = ctrl
trigger2 = var(37) != 1
trigger2 = random < 30

[State -1];僆儘僠旘傃摴嬶
type = ChangeState
value = 1050
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = numhelper(1050) = 0
triggerall = p2bodydist X   >= 30
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = Random <= 150

[State -1];僆儘僠旘傃摴嬶2
type = ChangeState
value = 11610
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 50
triggerall = numhelper(6400000)
trigger1 = random <= 300

[State -1];僆儘僠旘傃摴嬶3
type = ChangeState
value = 3001
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = p2bodydist X   >= 30
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = numhelper(6400000)
trigger1 = Ctrl        = 1
trigger1 = Random <= 50

[State -1];僆儘僠旘傃摴嬶3
Type = ChangeState
Value = 3001
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = StateType != A
triggerall = Ctrl = 1
triggerall = P2StateType != C
triggerall = numhelper(6400000)
trigger1 = Enemy,NumHelper > 0 || Enemy,NumProj > 0
trigger1 = EnemyNear,MoveType = A
trigger1 = InGuardDist
trigger1 = EnemyNear,HitDefAttr = SCA,NP,SP,HP,NA,SA,HA
trigger1 = P2MoveType = A
trigger1 = Random <= 640

;巰孻愰崘
[State -3]
type = ChangeState
value = 30530
triggerall = var(30)
triggerall = palno = 12
triggerall = var(37) != 1
triggerall = numhelper(6400000)
triggerall = statetype != A
trigger1 = ctrl
trigger1 = helper(6400000),var(4) < 100

;嫲晐偺曅椮
[State -3]
type = ChangeState
value = IfElse((Random < 600),1700,11050)
triggerall = palno=[7,12]
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = numhelper(6400000)
trigger1 = ctrl
trigger1 = p2bodydist X = [-50,30]
trigger1 = p2movetype != A
trigger1 = p2movetype != H
trigger1 = random <= 500

[State -1];僄僋僗僾儘乕僕儑儞僗僼傿傾兌
type = ChangeState
value = 1700
triggerall = p2name != "Hades" || p4name != "Hades";嬌抂偵廳偔側傞丒丒丒
triggerall = enemynear,name != "Hades"
triggerall = numHelper(1720) <= 0
triggerall = numhelper(6400000)
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X >= 50
trigger1 = ctrl
trigger1 = random <= 150

[State -1];儈儔乕僂僅乕儖
type = ChangeState
value = 11600
triggerall = numhelper(1720) <= 0
triggerall = var(30)
triggerall = random <= 200
triggerall = statetype != A
triggerall = p2statetype != A && p2statetype != L
triggerall = P2BodyDist X > 100
triggerall = P2BodyDist Y > -150
triggerall = numhelper(6400000)
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1080

[State -1];僿儖丒僷僯僔儏
type = ChangeState
value = 1100
triggerall = var(30)
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist X <= 120
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1080

[State -1];僌儔價僥傿乕僗僼傿傾
type = ChangeState
value = 1800
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X   >= 80
trigger1 = ctrl
trigger1 = random <= 150

[State -1];僌儔價僥傿乕僗僼傿傾2
type = ChangeState
value = 1810
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X   >= 100
trigger1 = ctrl
trigger1 = random <= 200

[State -1];僼僅僩儞僗僼傿傾
type = ChangeState
value = 11101
triggerall = var(30)
triggerall = numhelper(11100) = 0
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X >= 50
triggerall = numhelper(6400000)
trigger1 = random <= 300
trigger2 = stateno = 220 && animelemtime(4) > 0
trigger3 = stateno = 240 && animelemtime(10) > 0
trigger4 = stateno = 410 && animelemtime(7) > 0

[State -1];僼僅僩儞僗僼傿傾2
type = ChangeState
value = 11500
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = numhelper(11500) = 0
triggerall = enemy,alive
triggerall = numhelper(6400000)
trigger1 = Ctrl        = 1
trigger1 = Random <= 60

;儅僌僱僥傿僢僋僗僼傿傾
[State -3]
type = ChangeState
value = 12300
triggerall = numhelper(12310) = 0
triggerall = Alive   = 1
triggerall = roundstate = 2
triggerall = var(30) = 1
triggerall = p2bodydist X >= 50
triggerall = statetype != A
triggerall = Random<=990-((enemynear,statetype=C)*950)
triggerall = numhelper(6400000)
trigger1   = Ctrl = 1
trigger1 = Random <= 300

;儅僌僱僥傿僢僋僗僼傿傾
[State -3]
type = ChangeState
value = 12300
triggerall = numhelper(12310) = 0
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2bodydist X >= 50
triggerall = statetype != A
triggerall = enemy,alive
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*950)
triggerall = numhelper(6400000)
trigger1 = Random<= 100

;栦復
[State -1]
type = ChangeState
value = 18100
triggerall = palno = [7,12]
triggerall = numhelper(18102) = 0
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power >= 0
triggerall = numhelper(6400000)
trigger1 = statetype  = S
trigger1   = Ctrl = 1
trigger1 = Random <= 300
trigger1 = RoundState = 2

;儗乕儖僼僅乕僗
[State -1]
type = ChangeState
value = 1080
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = p2bodydist X   >= 50
trigger1 = Ctrl        = 1
trigger1 = Random <= 60

;奫崪拰
[State -1]
type = ChangeState
value = 1450
triggerall = var(30)
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
trigger1 = ctrl
trigger1 = p2bodydist X > 100-40
trigger1 = random <= 220
trigger2 = ctrl
trigger2 = p2movetype = A
trigger2 = p2bodydist X = [-30,30]
trigger2 = random <= 220
trigger3 = ctrl
trigger3 = p2movetype = A
trigger3 = p2bodydist X = [0,30]
trigger3 = random <= 220
trigger4 = ctrl
trigger4 = p2bodydist X > 100-40
trigger4 = random <= 250

;僄僋僗僾儘乕僨傿儞僌僗僼傿傾
[State -3]
type = ChangeState
value = 1250
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = P2BodyDist X = [0,240]
triggerall = p2movetype = H
trigger1 = Ctrl = 0
trigger1 = stateno = 1260 && animelem = 4,>=0
trigger1 = Random <= 500

;僄僋僗僾儘乕僨傿儞僌僗僼傿傾
[State -3]
type = ChangeState
value = 1260
triggerall = Alive   = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = Random <= 300
trigger1 = RoundState = 2

;僄僋僗僾儘乕僨傿儞僌僗僼傿傾
[State -3]
type = ChangeState
value = 1260
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*850)
trigger1 = Random <= 105

[State -3]
type = ChangeState
value = 25555
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,60]
trigger1 = Ctrl        = 1
trigger1 = Random <= 100

[State -3]
type = ChangeState
value = 25555
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-130,0]
triggerall = statetype != A
trigger1 = ctrl
trigger1 = Random <= 800

[State -3]
Type = ChangeState
Value = 25555
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = P2BodyDist X = [0,40]
trigger1 = P2BodyDist Y = [-40,0]
trigger1 = Random <= 990

[State -3]
Type = ChangeState
Value = 701
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = p2BodyDist X = [0,60]
trigger1 = p2BodyDist Y = [-40,0]
trigger1 = Random <= 820

[State -3]
type = ChangeState
value = 700
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype != A
triggerall = p2statetype != A && p2StateNo = 5120
triggerall = p2BodyDist X = [-80,80]
trigger1 = Ctrl = 1
trigger1 = Random <= 100

[State -3]
type = ChangeState
value = 700
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = p2statetype != A
triggerall = (P2BodyDist X = [0,100])||backEdgeDist <= 60&&(P2BodyDist X = [0,80])
trigger1 = Ctrl = 1
trigger1 = Random <= 150

[State -3]
Type = ChangeState
Value = 700
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
Trigger1 = Ctrl = 1
Trigger1 = Inguarddist && enemy,numproj
trigger1 = Random <= 200

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;1p偐傜6p傑偱
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;僽儔僢僋儂乕儖
[State -1]
type = null;ChangeState
value = 2300
triggerall = var(30) = 1
triggerall = Alive   = 1
triggerall = palno != [7,12]
triggerall = power >= 6000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = Statetype  = S
triggerall = Random <= 300
triggerall = enemy,alive
trigger1 = Ctrl = 1
trigger1 = Var(33) = 3
trigger2 = Ctrl = 1
trigger2 = Var(33) = 4
trigger3 = Ctrl = 1
trigger2 = Var(33) = 5

[State -3];僷僯僢僔儏丒儗僀
type = ChangeState
value = ifelse(random<400,33500,3301)
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = power >= 4000
triggerall = Statetype  = S
triggerall = Random <= 300
triggerall = Ctrl = 1
triggerall = RoundState = 2
trigger1 = Var(33) = 3
trigger2 = Var(33) = 4

;僕僃僲僒僀僪僇僢僞乕
[State -1]
type = ChangeState
value = 1030
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = p2movetype != H && p2movetype != I
triggerall = p2stateno != [150,155]
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = P2bodydist X = [0,90]
trigger2 = ctrl
trigger2 = random <= 400
trigger2 = P2bodydist X = [-20,50]
trigger3 = ctrl
trigger3 = p2statetype != A
trigger3 = p2movetype = A
trigger3 = random <= 400
trigger3 = P2bodydist X = [-30,60]

;僕僃僲僒僀僪僇僢僞乕
[State -1]
type = ChangeState
value = 1030
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2stateno = 2620
triggerall = p2movetype = H && p2movetype != I
trigger1 = ctrl
trigger1 = random <= 900
trigger1 = P2bodydist X = [0,90]


[State AI]
type = ChangeState
value = 3200
triggerall = palno != [7,12]
triggerall = var(30) = 1
triggerall = !var(32)
triggerall = Alive   = 1
triggerall = random <= 500
triggerall = roundstate = 2
triggerall = power >= 3000
triggerall = ctrl && statetype != A
triggerall = p2statetype != A
triggerall = p2bodydist x = [110,300]
trigger1 = ctrl

;僜僂儖僨僗僩儔僋僔儑儞
[State -3]
type = ChangeState
value = 30080
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = power >= 3000
trigger1 = ctrl
trigger1 = p2bodydist X = [-50,100]
trigger1 = p2movetype != H
trigger1 = random <= 460
trigger1 = enemy,alive

;儐僯僶乕僗丒僨傿僗僩乕僔儑儞兌
[State -1]
type = ChangeState
value = 3000
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2bodydist X >= 150
triggerall = p2movetype = A
triggerall = Power >= 2000
triggerall = p2life > 0
trigger1 = Ctrl = 1
trigger1 = Random <= 440

;儐僯僶乕僗丒僨傿僗僩乕僔儑儞兌
[State -1]
type = ChangeState
value = 3000
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = power >= 2000
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = enemy,life != lifemax
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 200

[State -1]
type = ChangeState
value = 30001
triggerall = palno != [7,12]
triggerall = power >= 2000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2movetype != H
triggerall = statetype != A
triggerall = p2bodydist X = [100,300]
trigger1 = random <= 400
trigger1 = ctrl

[State -1];僯儏乕僋儕傾乕丒儗僀僕僄乕僔儑儞
type = ChangeState
value = 10120
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = power >= 2000
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = life >= lifemax/2
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 200

[State -1];僕僃僲僒僀僪僇僢僞乕
type = ChangeState
value = 1042
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = p2movetype != H && p2movetype != I
triggerall = p2statetype != L
triggerall = p2stateno != [150,155]
triggerall = P2BodyDist X = [0,200]
triggerall = Power    >= 1000 
trigger1   = Ctrl        = 1
trigger1 = Random <= 50
trigger1 = enemy,alive

[State -1];僜僂儖僽儗僀僋
type = ChangeState
value = 11800
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = p2statetype  != A && p2statetype != L
triggerall = P2BodyDist X = [0,65]
triggerall = Power    >= 1000 
trigger1   = Ctrl        = 1
trigger1 = Random <= 50
trigger1 = enemy,alive

;嫲晐偺曅椮
[State -3]
type = ChangeState
value = 11050
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
trigger1 = ctrl
trigger1 = p2bodydist X = [-50,30]
trigger1 = p2movetype != A
trigger1 = p2movetype != H
trigger1 = random <= 500



;僶僯僔儞僌丒儔僢僔儏
[State -3]
type = ChangeState
value = 22118
triggerall = palno!= [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = H
triggerall = P2BodyDist Y = [-80,0]
trigger1 = Ctrl        = 1
trigger1 = Random <= 200

;僶僯僔儞僌丒儔僢僔儏
[State -3]
type = ChangeState
value = 22118
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X >=50
triggerall = Ctrl = 1
trigger1 = Random <= (50+(p2bodydist X >= 180)*120)
trigger2 = Random <= 200

;僶僯僔儞僌丒儔僢僔儏
[State -3]
type = ChangeState
value = 22118
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X = [0,120]
triggerall = p2statetype = C && p2movetype = A
trigger1 = Ctrl        = 1
trigger1 = Random <= 200

[State -1];閼閻拰
type = ChangeState
value = 1450
triggerall = var(30) = 1
triggerall = palno != 12
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = p2bodydist X > 100-40
trigger1 = random <= 220
trigger2 = ctrl
trigger2 = p2movetype = A
trigger2 = p2bodydist X = [-30,30]
trigger2 = random <= 220
trigger3 = ctrl
trigger3 = p2movetype = A
trigger3 = p2bodydist X = [0,30]
trigger3 = random <= 220
trigger4 = ctrl
trigger4 = p2bodydist X > 100-40
trigger4 = random <= 250
trigger4 = Time = 60 || Time = 120 || Time = 180 || Time = 240 || Time = 300 || Time = 360 || Time = 400 || Time = 440

[State -3]
type = ChangeState
value = 200
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = P2BodyDist X = [0,50]
trigger1 = Ctrl        = 1
trigger1 = Random <= 50

[State -3]
type = ChangeState
value = 230
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2life > 0
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-140,-40]
triggerall = statetype != A
trigger1 = ctrl = 1
trigger1 = Random <= 290

[State -3]
type = ChangeState
value = 240
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2bodydist X = [-5,55]
trigger1 = p2movetype != A
trigger1 = random <= 90


;偟傖偑傒庛僉僢僋
[State -3]
type = ChangeState
value = 430
IgnoreHitPause = 1
triggerall = HitPauseTime = 0
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = P2statetype != A && p2statetype != L
triggerall = movehit <=2
trigger1 = ctrl
trigger1 = P2bodydist X = [-20,40]
trigger1 = P2bodydist Y = 0
trigger1 = p2stateno != [152,153]
trigger1 = Random <= 900
trigger2 = ctrl
trigger2 = P2bodydist X = [-20,40]
trigger2 = p2movetype != H
trigger2 = stateno = 22120
trigger2 = Random <= 900
trigger3 = ctrl
trigger3 = P2bodydist X = [-20,40]
trigger3 = stateno = 1955
trigger3 = Random <= 900
;trigger2 = P2statetype != A && p2statetype != L
;trigger2 = P2bodydist X = [-40,40]
;trigger2 = stateno = 430&&movecontact >= 1
;trigger2 = p2movetype = H
;trigger2 = P2bodydist Y = 0
;trigger2 = p2stateno != [152,153]
;trigger2 = Random < 800

;偟傖偑傒庛峌寕
[State -3]
type = ChangeState
value = 400
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
trigger1 = stateno = 430 && movehit

;偟傖偑傒庛峌寕
[State -3]
type = ChangeState
value = 410
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
trigger1 = stateno = 400 && movehit

;偟傖偑傒庛峌寕
[State -3]
type = ChangeState
value = 210
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
trigger1 = stateno = 410 && movehit

;偟傖偑傒庛峌寕
[State -3]
type = ChangeState
value = 1030
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2statetype != L
trigger1 = stateno = 210 && time = 33



;偟傖偑傒嫮僉僢僋
[State -3]
type = ChangeState
value = 440
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2statetype != A && p2statetype != L
trigger1 = P2bodydist X = [-5,70]
trigger1 = p2stateno != [150,153]
trigger1 = Random < 120

;嬻拞嫮僷儞僠
[State -1,]
type = ChangeState
value = 610
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = vel Y > 0
trigger1 = P2bodydist X = [-5,70]
trigger1 = P2bodydist Y = [-80,0]

;嬻拞嫮僉僢僋
[State -1,]
type = ChangeState
value = 640
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]

;嬻拞傆偭旘偽偟峌寕
[State -1]
type = ChangeState
value = 690
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]
trigger1 = p2statetype = A
trigger1 = p2movetype = H
trigger1 = random < 50

[State -3]
type = ChangeState
value = 800
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = P2statetype = S
triggerall = P2BodyDist X = [0,20]
trigger1 = Ctrl        = 1
trigger1 = Random <= 200

[State -3]
type = ChangeState
value = 800
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2statetype != A
triggerall = p2bodydist X < 8
triggerall = (p2statetype = S) || (p2statetype = C)
triggerall = p2movetype != H
triggerall = p2movetype != A
trigger1 = ctrl&&random < 150
trigger1 = p2stateno != [150,153]
trigger2 = p2stateno != [150,153]
trigger2 = stateno = 700 && animelem = 3,>=0

[State -3]
type = ChangeState
value = 702
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = random < 200
trigger1 = stateno = 5050
trigger1 = pos y >=-40

;棫偪僈乕僪
[State -3]
type = ChangeState
value = 130
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = Alive = 1
triggerall = roundstate = 2
triggerall = P2statetype != C
triggerall = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
triggerall = StateType != A
triggerall = Ctrl = 1
triggerall = inguarddist
trigger1 = P2MoveType = A
trigger2 = EnemyNear,MoveType = A
trigger3 = stateno = [100,101]
trigger4 = Enemy,NumProj >= 1
trigger5 = EnemyNear,NumProj >= 1

;孅傒僈乕僪
[State -3]
type = ChangeState
value = 131
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = Alive = 1
triggerall = roundstate = 2
triggerall = P2statetype = C
triggerall = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
triggerall = StateType != A
triggerall = Ctrl = 1
triggerall = inguarddist
trigger1 = P2MoveType = A
trigger2 = EnemyNear,MoveType = A
trigger3 = stateno = [100,101]
trigger4 = Enemy,NumProj >= 1
trigger5 = EnemyNear,NumProj >= 1

;嬻拞僈乕僪
[State -3]
type = ChangeState
value = 132
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = Alive = 1
triggerall = roundstate = 2
triggerall = inguarddist
triggerall = StateType = A
trigger1 = P2MoveType = A
trigger2 = EnemyNear,MoveType = A
trigger3 = stateno = [100,101]
trigger4 = Enemy,NumProj >= 1
trigger5 = EnemyNear,NumProj >= 1

;僕儍儞僾
[State -3]
Type     = ChangeState
Value    = 40
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = var(30)
triggerall = StateType != A
triggerall = Ctrl
trigger1 = random < 300
trigger1 = p2bodydist X = [-40,40]
trigger1 = p2bodydist Y < -80
trigger1 = movetype = I
trigger2 = stateno = [100,101]
trigger2 = random < 300
trigger2 = p2bodydist X = [80,120]
trigger2 = p2bodydist Y = 0
trigger2 = movetype = I

;僟僢僔儏
[State -3]
Type     = ChangeState
Value    = 100
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = EnemyNear,StateType != L
triggerall = EnemyNear,MoveType = I
triggerall = StateType != A
triggerall = roundstate = 2
triggerall = ctrl
trigger1 = p2bodydist X < 200
trigger1 = random < 80





