;===========================================================================
; 常時監視ステート（−２）
;===========================================================================
;---------------------------------------------------------------------------
; 通常の食らい状態（Statedef 5000〜5199間）でも、
; 相手に（「P2StateNo」や「TargetState」等で）制御を奪われても、
; 常に登録したステートコントローラが有効になります。
; サブシステム等を制御する時に重宝するでしょう。
;---------------------------------------------------------------------------

[Statedef -2]
;---------------------------------------------------------------------------
;こんふぃぐ
;---------------------------------------------------------------------------
;------------------------------------外見-----------------------------------
[State -2,Cutin(CANCEL)]
type = VarSet
trigger1 = 1
v = 3
value = 1

;【0:今までの,1:NEWの】

[State -2,ニュートラルモーション]
type = VarSet
trigger1 = 1
fv = 2
value = 0;2;【0:今までの,1:アリスっぽい,2:サイキに近いアリス,3:仁王立ち4:初代】

;-----------------------------------システム-----------------------------------

[State -2,Explod];フラッシュ制限
type = varset
trigger1 = 1
V = 55
value = 1;０でオフ

[State -2,Explod];12P分身数
type = varset
trigger1 = 1
V = 57
value = 4

[State -2,11P,12P性能];11P,12P特殊システム
type = VarSet
trigger1 = 1
v = 23
value = 3;1
;0:なし
;1:喰らい抜け
;2:ステート抜け
;3:喰らい抜け(Withステ抜け)
;4:アーマー+ダメージ耐性(11P専用)
;※12P時は自動的に3になる。
IgNoreHitPause = 1

[State -2,FLAM];ゲージ回収率上昇スイッチ
type = VarSet  ;←ここ重要
trigger1 = 1
fv = 1
value = 1.00
;※NOTA BENE(注意せよ)※
;これは元あったゲージ回収量にどのくらいの量を上乗せするスイッチです。
;1.00というのは決して元々の回収率になっていることではありません。
;通常にしたい場合は『type = varset』の部分に『type = null;varset』
;と変えましょう。
;ちなみに大体が『出すだけ1ゲージ』レベルなので軽く無茶ゲー(無茶苦茶)の域です。
;FLAM---------------------------------------------------------------------------- 
;----------------------------------->deception<
[State -2,];空中ふっとばし;cpu専用
type = VarSet
trigger1 = 1
v = 39
value = 0
;0:off/1:on
[State -2,];Temporary paralysis&navraceni panenky背景変更
type = VarSet
trigger1 = 1
sysfvar(1) = 1
;0:off/1:on
[State -2,];Super Cancel Effect&DREAMCANCELを透明化
type = VarSet
trigger1 = 1
sysfvar(2) = 1
;0:off/1:on
[State -2,];1.2ゲージ技のカットイン選択
type = VarSet
trigger1 = 1
sysfvar(3) = 1
;0:無し/1:有り
[State -2,];3ゲージ技のカットイン演出
type = VarSet
trigger1 = 1
sysfvar(4) = 1
;【0:デフォ,1:変える】
;----------------------------------->deception<

[State -2, DestroySelf]
Type = DestroySelf
Triggerall = !ishelper(8500)
trigger1 = stateno = [0,110]
trigger2 = stateno = [5000,5150]

[State -2]
Type     = Helper
TriggerAll = NumHelper(6500) = 0
Trigger1 = stateno = [120,159]
Stateno  = 6500
ID       = 6500
Pos      = 0,0
PosType  = P1
Keyctrl  = 0
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999
persistent = 0
Size.XScale = 0.12
Size.YScale = 0.5
ownpal = 1 

[State 220]
type = pause
Triggerall = numHelper(30111) = 1
trigger1 = (GameTime%4) = 1
Trigger1 = Helper(30111),stateno = 3011
time = 3
movetime = 3
ignorehitpause = 1

[State -2]
Type     = Helper
triggerall = Stateno != 184&palno = [11,12]
trigger1 = (GameTime%5) = 1
trigger1 = movetype != H
Stateno  = 6000
ID       = 6000
pos = -20 + (random%40),0 - (random%20)
PosType  = P1
Keyctrl  = 0
IgnoreHitPause = 1
persistent = 0
ownpal = 0 
supermovetime = 9999
pausemovetime = 9999

[State 220, 音を鳴らす]
type = PlaySnd
trigger1 = Projhittime(3091) >= 0 && Projhittime(3091) <= 1
value = 500, 11
ignorehitpause = 1

[State 220, 音を鳴らす]
type = PlaySnd
trigger1 = Projhittime(3101) >= 0 && Projhittime(3101) <= 1
value = 500, 1
ignorehitpause = 1

[State 220, 音を鳴らす]
type = PlaySnd
trigger1 = Projhittime(1003) >= 0 && Projhittime(1003) <= 1
trigger2 = Projhittime(6701) >= 0 && Projhittime(6701) <= 1
value = 5, 5
ignorehitpause = 1

[State 220]
type = pause
trigger1 = Projhittime(1003) >= 0 && Projhittime(1003) <= 1
trigger2 = ProjGuarded1003 = 1
trigger3 = Projhittime(6701) >= 0 && Projhittime(6701) <= 1
trigger4 = ProjGuarded6701 = 1
trigger5 = Projhittime(3101) >= 0 && Projhittime(3101) <= 1
trigger6 = ProjGuarded3101 = 1
time = 1
movetime = 0
ignorehitpause = 1

[State -2, EnvColor]
type = EnvColor
Triggerall = var(55) = 1
trigger1 = ProjHit1003 = 1 <= 1
trigger2 = Projhit6701 = 1 <= 1
trigger3 = Projhit3091 = 1 <= 1
trigger4 = ProjHit3101 = 1
value = 255,255,255
time = 1
under = 1

[State 1000, 5]
type = Explod
trigger1 = ProjHit3091 = 1
anim = 8700
sprpriority = 100
postype = p2
pos = -10 + (random%10),-60 + (random%40)
bindtime = -1
ignorehitpause =0
under = 0
ownpal = 1
PauseMoveTime = 9999999
trans = add

[State -2]
Type     = Helper
triggerall = numhelper(8000) = 0
trigger1 = ProjHit1003 = 1
trigger2 = ProjHit6701 = 1
trigger3 = ProjHit3101 = 1
Stateno  = 8000
ID       = 8000
pos = -10 + (random%10),-60 + (random%20)
PosType  = P2
Keyctrl  = 0
IgnoreHitPause = 1
persistent = 0
ownpal = 1 
supermovetime = 9999
pausemovetime = 9999

[State 1000, 5]
type = Explod
trigger1 = Projguarded1003 = 1
trigger2 = Projguarded6701 = 1
trigger3 = Projguarded3091 = 1
trigger4 = Projguarded3101 = 1
anim = 8400
sprpriority = 100
postype = p2
pos = -10 + (random%10),-60 + (random%30)
bindtime = -1
ignorehitpause =0
under = 0
ownpal = 0
PauseMoveTime = 99999999

[State -2,12P保険]
type = VarSet
triggerall = var(23) = 4
trigger1 = Palno = 12
var(23) = 3
ignorehitpause =0

;-----------------------------------------------------------------
;                           保険用  Explod
;-----------------------------------------------------------------
[State -2,RemoveExplod]
type = RemoveExplod
trigger1 = stateno = 795&NumExplod(88555)
id = 88555

[State -2,RemoveExplod];Dream
type = RemoveExplod
trigger1 = NumExplod(6160)
id = 6165

[State -2,RemoveExplod];Dream
type = RemoveExplod
trigger1 = NumExplod(6161)
id = 6162

[State -2,RemoveExplod];Super
type = RemoveExplod
trigger1 = NumExplod(6150)
id = 6155

[State -2,RemoveExplod];Super
type = RemoveExplod
trigger1 = NumExplod(6151)
id = 6152

;----------------------------------
[State -2,RemoveExplod]
type = RemoveExplod
trigger1 = NumExplod(6165)
id = 6155

[State -2,RemoveExplod]
type = RemoveExplod
trigger1 = NumExplod(6162)
id = 6152

;----------------------------------
[State -2,Dream Explod]
type = Explod
triggerall = var(3)
triggerall = !NumExplod(6160)
triggerall = !NumExplod(6165)
triggerall = time = [0,1]
trigger1 = prevstateno = 3030
trigger1 = Stateno=3000||Stateno=3098||Stateno=3100
anim = 6160+(5*(sysfvar(2)>0))
ID = 6165
pos = 0,75
postype = left
removetime = -2
bindtime = -1
pausemove = 1
supermove = 1
sprpriority = 9
ownpal = 1

[State -2,Dream Explod]
type = Explod
triggerall = var(3)&sysfvar(2)=0
triggerall = !NumExplod(6161)
triggerall = !NumExplod(6162)
triggerall = time = [0,1]
trigger1 = prevstateno = 3030
trigger1 = Stateno=3000||Stateno=3098||Stateno=3100
anim = 6161
ID = 6162
pos = 0,73
postype = left
removetime = -2
bindtime = -1
pausemove = 1
supermove = 1
sprpriority = 8
trans = addalpha
alpha = 256, 135
ownpal = 1

;--------------------------Super Cancel Effect-------------------------------
[State -2,Super Explod]
type = Explod
triggerall = var(3)
triggerall = !NumExplod(6150)
triggerall = !NumExplod(6155)
triggerall = time = [0,1]
trigger1 = prevstateno = 2401
trigger1 = Stateno=3000
trigger2 = PrevStateno=2401
trigger2 = Stateno=3030
trigger3 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger3 = Stateno = 3098
trigger4 = PrevStateno=2401
trigger4 = Stateno=3100
trigger5 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger5 = Stateno=2700
anim = 6150+(5*(sysfvar(2)>0))
ID = 6155
pos = 0,75
postype = left
removetime = -2
bindtime = -1
pausemove = 9999
supermove = 9999
sprpriority = 9
ownpal = 1

[State -2,Super Explod]
type = Explod
triggerall = var(3)&sysfvar(2)=0
triggerall = !NumExplod(6151)
triggerall = !NumExplod(6152)
triggerall = time = [0,1]
trigger1 = prevstateno = 2401
trigger1 = Stateno=3000
trigger2 = PrevStateno=2401
trigger2 = Stateno=3030
trigger3 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger3 = Stateno = 3098
trigger4 = PrevStateno=2401
trigger4 = Stateno=3100
trigger5 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger5 = Stateno=2700
anim = 6151
ID = 6152
pos = 0,73
postype = left
removetime = -2
bindtime = -1
pausemove = 9999
supermove = 9999
sprpriority = 8
trans = addalpha
alpha = 256, 135
ownpal = 1
;=====================================================================
;-------------------------DREAMCANCEL----------------------------------------
[State -2,Dream Can];字 DREAM
type = Explod
triggerall = !var(3)
triggerall = !NumExplod(6005)
triggerall = !NumExplod(6010)
triggerall = time = [0,1]
trigger1 = prevstateno = 3030
trigger1 = Stateno=3000||Stateno=3098||Stateno=3100
anim = 6005
ID = 6010
sprpriority = 50
postype = left
pos = 0,40
bindtime = -1
scale = 0.5,0.5
supermove = 1
under = 0
ownpal = 1
trans = add

[State -2,Dream Can];字 枠
type = Explod
triggerall = !var(3)
triggerall = !NumExplod(6006)
triggerall = !NumExplod(6011)
triggerall = time = [0,1]
trigger1 = prevstateno = 3030
trigger1 = Stateno=3000||Stateno=3098||Stateno=3100
anim = 6006
ID = 6011
sprpriority = 51
postype = right
pos = 0,38
bindtime = -1
supermove = 1
under = 0
ownpal = 1

[State -2,Dream Can];字 黒背景
type = Explod
triggerall = !var(3)
triggerall = !NumExplod(6007)
triggerall = !NumExplod(6012)
triggerall = time = [0,1]
trigger1 = prevstateno = 3030
trigger1 = Stateno=3000||Stateno=3098||Stateno=3100
anim = 6007
ID = 6012
sprpriority = 49
postype = left
pos = 0,34
bindtime = -1
supermove = 1
under = 0
ownpal = 1
trans = addalpha
alpha = 340-120,120

;-------------------------SUPERCANCEL----------------------------------------
[State -2,Super Can];字 SUPER
type = Explod
triggerall = !var(3)
triggerall = !NumExplod(6008)
triggerall = !NumExplod(6013)
triggerall = time = [0,1]
trigger1 = prevstateno = 2401
trigger1 = Stateno=3000
trigger2 = PrevStateno=2401
trigger2 = Stateno=3030
trigger3 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger3 = Stateno = 3098
trigger4 = PrevStateno=2401
trigger4 = Stateno=3100
trigger5 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger5 = Stateno=2700
anim = 6008
ID = 6013
sprpriority = 50
postype = left
pos = 0,50
bindtime = -1
scale = 0.5,0.5
supermove = 1
under = 0
ownpal = 1
trans = add

[State -2,Super Can];字 枠
type = Explod
triggerall = !var(3)
triggerall = !NumExplod(6009)
triggerall = !NumExplod(6014)
triggerall = time = [0,1]
trigger1 = prevstateno = 2401
trigger1 = Stateno=3000
trigger2 = PrevStateno=2401
trigger2 = Stateno=3030
trigger3 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger3 = Stateno = 3098
trigger4 = PrevStateno=2401
trigger4 = Stateno=3100
trigger5 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger5 = Stateno=2700
anim = 6009
ID = 6014
sprpriority = 51
postype = right
pos = 0,48
bindtime = -1
supermove = 1
under = 0
ownpal = 1

[State -2,Super Can];字 黒背景
type = Explod
triggerall = !var(3)
triggerall = !NumExplod(6007)
triggerall = !NumExplod(6015)
triggerall = time = [0,1]
trigger1 = prevstateno = 2401
trigger1 = Stateno=3000
trigger2 = PrevStateno=2401
trigger2 = Stateno=3030
trigger3 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger3 = Stateno = 3098
trigger4 = PrevStateno=2401
trigger4 = Stateno=3100
trigger5 = PrevStateno=1020||PrevStateno=1023||PrevStateno=1025||PrevStateno=2401
trigger5 = Stateno=2700
anim = 6007
ID = 6015
pos = 0,41
scale = 1,0.5
sprpriority = 49
postype = left
pos = 0,44
bindtime = -1
supermove = 1
under = 0
ownpal = 1
trans = addalpha
alpha = 340-120,120

;----------------------------------------------------[ステ抜け]
[State -2,StateCancel1]
type = VarSet
trigger1 = 1
fvar(8) = 0
IgNoreHitPause = 1

[State -2,StateCancel2]
type = VarSet
trigger1 = stateno=0||(stateno=[10,12])||Stateno=20||(Stateno=[21,22])||(Stateno=[40,59])
trigger2 = (Stateno=[100,101])||(Stateno=[105,106])||(Stateno=[120,155])
trigger3 = (Stateno=[170,179])||(Stateno=[180,182])||(Stateno=[190,199])
trigger4 = Stateno=200||Stateno=205||Stateno=210||Stateno=220||Stateno=230
trigger5 = (Stateno=[700,705])||Stateno=800||(Stateno=[810,811])
trigger6 = Stateno=1000||Stateno=1005||Stateno=1010||Stateno=1016
trigger7 = (Stateno=[1020,1023])||Stateno=1030||(Stateno=[1040,1041])||Stateno=1090
trigger8 = Stateno=1050||Stateno=1052||(Stateno=[1080,1081])
trigger9 = Stateno=3000||Stateno=3002||Stateno=3010||(Stateno=[3020,3021])||Stateno=3030
trigger10= Stateno=3040||Stateno=3050||Stateno=3060||Stateno=3070
trigger11=(Stateno=[3090,3091])||Stateno=3093||Stateno=3098||Stateno=3100
trigger12= Stateno=2300||Stateno=2302||(Stateno=[2400,2401])||Stateno=2500
trigger13= (Stateno=[2600,2601])||(Stateno=[2700,2701])||Stateno=2706||(Stateno=[3200,3202])
trigger14= stateno=5000||stateno=5001||stateno=5010||stateno=5011||stateno=5020||stateno=5030
trigger15= stateno=5035||stateno=5040||stateno=5050||stateno=5070||stateno=5071||stateno=5072
trigger16= stateno=5080||stateno=5081||stateno=5100||stateno=5101||stateno=5110||stateno=5120
trigger17= stateno=5150||stateno=5200||stateno=5201||stateno=5210||stateno=5500||stateno=5900
fvar(8) = 1
IgNoreHitPause = 1

[state -2,StateCancel3]
type = VarSet
trigger1 = fvar(9)<Life||(GameTime%90=0&&MoveType!=H&&RoundState=2)
fvar(9) = Life

[state -2,StateCancel4]
type = SelfState
trigger1 = Alive
trigger1 = (palno=[11,12])&&(var(23)=[2,4])&&stateno!=[150,155]
trigger1 = GetHitVar(damage)>70||fvar(9)-life>70||fvar(8)!=1||(MoveType=H&&RoundState!=2)
trigger2 = (palno=[11,12])&&time>300&&stateno!=5150&&(fvar(8)!=1||MoveType=H)&&(var(23)=[2,4])
value = 46

[state -2,StateCancel5]
type = SelfState
trigger1 = Time=0&&fvar(8)=1&&(RoundState=2||RoundState=3)
trigger1 = MoveType!=H||(stateno=[150,155])||(stateno=[5000,5150])
value = StateNo

[state -2,StateCancel6]
type = SelfState
trigger1 = Time=0&&fvar(8)=1&&RoundState>1
trigger1 = MoveType=H&&(stateno!=[150,155])&&(stateno!=[5000,5150])
trigger1 = (Palno=[11,12])&&(var(23)=[2,4])
value = 46

;-------------------------------------------[喰らい抜け]
[State -2]
type = VarAdd
triggerall = PalNo = [11,12]
triggerall = var(23)=1||var(23)=3
trigger1 = MoveType = H
var(17) = Ceil(Floor(GetHitVar(damage))/5.0);50.0
ignorehitpause = 1

[State -2]
type = VarAdd
triggerall = PalNo = [11,12]
triggerall = var(23)=1||var(23)=3
triggerall = MoveType = H
triggerall = StateType = A
trigger1 = EnemyNear(var(42)),MoveType = I
var(17) = 10
ignorehitpause = 1

[State -2]
type = VarSet
trigger1 = var(17)
trigger1 = !(MoveType = H)
var(17) = 0
ignorehitpause = 1

[State -2]
type = NotHitBy
triggerall = PalNo = [11,12]
triggerall = var(23)=1||var(23)=3
triggerall = MoveType = H
trigger1 = var(17) >= 10
value = SCA
time = 1
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = PalNo = [11,12]
triggerall = var(23)=1||var(23)=3
trigger1 = MoveReversed
value = 5050
ignorehitpause = 1

;---------------------------------[防御補正]
[State -2, ]
type = defencemulset
triggerall = 1
trigger1 = palno = 12
value = 0.5

[State -2, ]
type = defencemulset
triggerall = 1
trigger1 = palno = 11
value = 0.3

[state 6506,1]
type = poweradd
trigger1 = palno = [11,12]
value = 10+(palno=11)*40

[state 6506,1]
type = lifeadd
trigger1 = palno = [11,12]
trigger1 = Movetype != H
trigger1 = (GameTime%12) = 1
trigger2 = palno = 11
trigger2 = MoveType=H
trigger2 = Stateno!=[5000,5219]
value = 1+(palno=11)*9

[State -2, AIフラグセット]
type = null;VarSet
trigger1 = ishelper(8500)
var(59) = 4;分身のAILVっぽい
IgNoreHitPause = 1

[State 191, ステート変更];アニメーションが終われば「通常立ち」のステートに変更する
type = ChangeState
trigger1 = stateno != 8501
trigger1 = ishelper(8500)
trigger1 = root,stateno = [180,185]
trigger1 = roundstate = 4
value = 8501

[State 191, ステート変更];アニメーションが終われば「通常立ち」のステートに変更する
type = ChangeState
triggerall = ishelper(8500)
triggerall = stateno != 8502
trigger1 = root,stateno = [170,175]
trigger2 = root,stateno = 5150
triggerall = roundstate = 4
value = 8502

[State -2, a];
type = palfx
triggerall = time = 0
trigger1 = ishelper(8500)
time = -1
add = -60,-80,-50
color = 1
ignorehitpause = 1
sinadd = 30,30,30,100

[State -2, a];
type = palfx
triggerall = time = 0
trigger1 = palno = [11,12]
time = -1
add = -36,-36,-36
sinadd = -30,-30,-30,120

[State -2]
Type     = Helper
triggerall = palno = 12
trigger1 = numhelper(8500) <= var(57)-1
trigger1 = roundstate = 2
trigger1 = (GameTime%8) = 1
Stateno  = 8500
ID       = 8500
pos = -100+random%200,0
PosType  = P1
Keyctrl  = 0
IgnoreHitPause = 1
persistent = 0
ownpal = 1
helpertype = player

[State 346, Explod]
type = null;Explod
trigger1 = (GameTime%8) = 1
trigger1 = palno = [11,12]
trigger1 = alive
anim = 6100
postype = p1
pos = -20+random%40,0-random%10
facing = 1
scale = 0.25,0.25
bindtime = 1
ownpal = 1
vel = 0,-2-random%2
supermovetime = 0
pausemovetime = 0
sprpriority = 10-random%20
ignorehitpause = 1
trans = add

;-----------------------------------------------------------------
;Navraceni Panenkyダメージ量
[State -2,Damege(nin)]
type = VarSet
trigger1 = 1
var(27)=Ceil(.6*(EnemyNear,Const(Data.Life))*(.01*(EnemyNear,Const(Data.Defence))))
ignorehitpause = 1

;-----------------------------------------------------------------
;Counter Hits
[State -2, Counter Hit1]
type = VarSet
trigger1 = enemynear, movetype = A
ignorehitpause = 1
var(20) = 1

[State -2, Counter Hit2]
type = VarSet
trigger1 = enemynear, movetype = I || var(21) >= 1
ignorehitpause = 1
var(20) = 0

[State -2, Counter Hit3]
type = VarSet
trigger1 = var(21) > 10 && enemynear, movetype = H
ignorehitpause = 1
var(20) = 0

[State -2, Counter Hit4]
type = VarSet
trigger1 = var(20) = 1 && movehit
trigger2 = var(20) = 1 && Projhittime(1003) >= 0 && Projhittime(1003) <= 1
trigger3 = var(20) = 1 && Projhittime(6701) >= 0 && Projhittime(6701) <= 1
trigger4 = var(20) = 1 && Projhittime(3101) >= 0 && Projhittime(3101) <= 1
trigger5 = var(20) = 1 && Projhittime(3091) >= 0 && Projhittime(3091) <= 1
trigger6 = var(20) = 1 && Projhittime(2500) >= 0 && Projhittime(2500) <= 1
trigger7 = var(20) = 1 && Projhittime(2600) >= 0 && Projhittime(2600) <= 1
trigger8 = var(20) = 1 && Projhittime(2300) >= 0 && Projhittime(2300) <= 1
trigger9 = var(20) = 1 && Projhittime(2302) >= 0 && Projhittime(2302) <= 1
ignorehitpause = 1
var(21) = 1

[State -2, Counter Hit5]
type = Varadd
trigger1 = var(21) >= 1
ignorehitpause = 1
var(21) = 1

[State -2, Counter Hit6]
type = VarSet
trigger1 = p2movetype != H
trigger2 = var(21) > 22 && p2stateno = 5030; || p2stateno = 1300)
trigger3 = p2statetype = L
trigger4 = var(21) > 30 && movehit
ignorehitpause = 1
var(21) = 0

[State -2, Counter Hit7]
type = Assertspecial
trigger1 = var(20) = 1 && numexplod(4000) <= 1
flag = Nojugglecheck

[State -2, EnvColor]
type = EnvColor
trigger1 = var(21) = [1,2]
value = 255,255,255
time = 1
ignorehitpause = 1
under = 1

[State -2, Counter]
type = Explod
triggerall = (var(21) = [1,2]) && numexplod(4000) <= 0 && teamside = 1
trigger1 = movehit = 1
anim = 4000
id = 4000
pos = 17,95
postype = Left
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1
ignorehitpause = 1
persistent = 0


[State -2, Counter]
type = Explod
triggerall = (var(21) = [1,2]) && numexplod(4000) <= 0 && teamside = 2
trigger1 = movehit = 1
anim = 4001
id = 4000
pos = -84,95
postype = right
bindtime = -1
removetime = -2
ontop = 1
ownpal = 1
ignorehitpause = 1
persistent = 0

;-----------------------------------
;ここは「パワー溜め」のステートで発生させた「Explod」のエフェクト画像を
;特定の条件が有効になれば消す、という処理をしています。

[State -2, エフェクトを消す];パワー溜めステート用
type = RemoveExplod
triggerall = NumExplod(130) > 0
                          ;↑はＩＤナンバー「130」のExplodの画面中の数が0よりも多い、
                          ;つまり１枚以上表示されている時
trigger1 = StateNo != 700 ;ステートが７００（パワー溜め）以外の時
trigger2 = MoveType != I  ;MoveTypeが「I（何もしてない）」以外の時
ID = 130                  ;消すExplodの特定のＩＤナンバーを指定

;-----------------------------------
;KO Flash Effect-------------------------------------------------------------
[State -2, Sp Finish]
type = Explod
triggerall = numexplod(9010) <= 0
trigger1 = winKo = 1 && movehit && stateno = [899,4999]
trigger2 = winKo = 1 && Projhittime(1003) >= 0 && Projhittime(1003) <= 1
trigger3 = winKo = 1 && Projhittime(6701) >= 0 && Projhittime(6701) <= 1
trigger4 = winKo = 1 && Projhittime(3101) >= 0 && Projhittime(3101) <= 1
trigger5 = winKo = 1 && Projhittime(3091) >= 0 && Projhittime(3091) <= 1
trigger6 = winKo = 1 && Projhittime(2500) >= 0 && Projhittime(2500) <= 1
trigger7 = winKo = 1 && Projhittime(2600) >= 0 && Projhittime(2600) <= 1
trigger8 = winKo = 1 && Projhittime(2300) >= 0 && Projhittime(2300) <= 1
trigger9 = winKo = 1 && Projhittime(2302) >= 0 && Projhittime(2302) <= 1
anim = 9010
removetime = -2
id = 9010
sprpriority = -9
pos = 0,0
postype = left
scale = 4.0, 80.0
bindtime = -1
ignorehitpause = 1
ownpal = 1

[state -2, PlaySound]
type = playsnd
trigger1 = WinKO
trigger1 = RoundState = 3
trigger1 = var(16) = 0
IgnoreHitPause = 1
persistent = 0
value = f5200,0

[state -2, varset]
type = varset
trigger1 = RoundState = 3
IgnoreHitPause = 1
v = 16
value = 1

[state -2, varset]
type = varset
trigger1 = RoundState = 2
IgnoreHitPause = 1
v = 16
value = 0

;=========================================AI=======================================
;===================================================================================
;                                  ガード補助ヘルパー
;===================================================================================
;ヘルパー誤動作防止
[State -2]
type = null;DestroySelf
trigger1 = MoveType = H
trigger1 = IsHelper
trigger2 = (Parent,Stateno = [5000,5110])
trigger2 = IsHelper

[State -2];ガード補助ヘルパー1
type = Helper
triggerall = Parent,PalNo!=12
trigger1 = numhelper(30000) = 0
trigger1 = var(59)
ID = 30000
name = "Guard1"
postype = p1
pos = 0,0
sprpriority = -1
stateno = 30000
helpertype = normal
keyctrl = 0
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0
ignorehitpause = 1

[State -2];ガード補助ヘルパー2
type = Helper
triggerall = Parent,PalNo!=12
trigger1 = numhelper(30001) = 0
trigger1 = var(59)
ID = 30001
name = "Guard2"
postype = p1
pos = 0,0
sprpriority = -1
stateno = 30001
helpertype = normal
keyctrl = 0
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0
ignorehitpause = 1

[State -2];ガード補助ヘルパー
type = Helper
triggerall = Parent,PalNo!=12
trigger1 = numhelper(30002) = 0
trigger1 = var(59)
ID = 30002
name = "Guard3"
postype = p1
pos = 0,0
sprpriority = -1
stateno = 30002
helpertype = normal
keyctrl = 0
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0
ignorehitpause = 1

[State -2];ガード補助ヘルパー
type = Helper
triggerall = Parent,PalNo!=12
trigger1 = numhelper(30003) = 0
trigger1 = var(59)
ID = 30003
name = "Guard4"
postype = p1
pos = 0,0
sprpriority = -1
stateno = 30003
helpertype = normal
keyctrl = 0
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0
ignorehitpause = 1

[State -2];ガード補助ヘルパー
type = Helper
triggerall = Parent,PalNo!=12
trigger1 = numhelper(30004) = 0
trigger1 = var(59)
ID = 30004
name = "Guard5"
postype = p1
pos = 0,0
sprpriority = -1
stateno = 30004
helpertype = normal
keyctrl = 0
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0
ignorehitpause = 1

;===================================================================================
;                                   ガード運用
;===================================================================================

;対めくり攻撃
[State -2]
type = VarSet
trigger1 = NumHelper(30000)
trigger1 = !InGuardDist && Helper(30000),InGuardDist
trigger2 = NumHelper(30001)
trigger2 = Facing = EnemyNear(var(42)),Facing
trigger2 = Helper(30001),InGuardDist
var(35) = 1
ignorehitpause = 1

[State -2]
type = VarSet
triggerall = NumHelper(30000)
triggerall = NumHelper(30001)
trigger1 = !(!InGuardDist && Helper(30000),InGuardDist)
trigger1 = !((Facing = EnemyNear(var(42)),Facing) && (Helper(30001),InGuardDist))
trigger1 = !(Helper(30001),InGuardDist)
var(35) = 0
ignorehitpause = 1


[State -2]
type = VarSet
triggerall = NumHelper(30002)
triggerall = NumHelper(30003)
triggerall = NumHelper(30004)
trigger1 = !(Helper(30002),InGuardDist)
trigger1 = !(Helper(30003),InGuardDist)
trigger1 = !(Helper(30004),InGuardDist)
trigger1 = !(EnemyNear(var(42)),NumProj > 0 || var(33))
trigger2 = !(EnemyNear(var(42)),NumProj > 0 || var(33))
var(34) = 0

;===================================================================================
;                               ラウンド開始時間記録
;===================================================================================
[State -2]
type = varset
trigger1 = RoundState != 2
var(30) = 0

[State -2]
type = varset
triggerall = !var(30)
trigger1 = Ctrl
var(30) = GameTime
persistent = 0

;===================================================================================
;                                      EnemyNear
;===================================================================================
[State -2];EnemyNear
type = VarSet
triggerall = RoundState = 2
trigger1 = NumEnemy = 1;シングル
trigger2 = NumEnemy = 2;タッグ
trigger2 = EnemyNear(0),Life > 0;直近の敵Alive
var(42) = 0
ignorehitpause = 1

[State -2];EnemyNear
type = VarSet
triggerall = RoundState = 2
trigger1 = NumEnemy = 2;タッグ
trigger1 = EnemyNear(0),Life <= 0;直近の敵Death
var(42) = 1
ignorehitpause = 1

;タッグ用--------------------------------------------------------
[State -2, EnemyNear]
type = VarSet
triggerall = var(59)
triggerall = NumPartner > 0
triggerall = Partner,Life > 0
triggerall = NumEnemy > 1
triggerall = EnemyNear(0),Life > 0 && EnemyNear(1),Life > 0
trigger1 = !(Partner,MoveType = A && Partner,NumTarget && EnemyNear(0),MoveType = H && EnemyNear(1),MoveType != H && !((EnemyNear(0),StateNo = [5000,5300]) || (EnemyNear(0),StateNo = [120,160])) && EnemyNear(0),GetHitVar(hitshaketime) = 0)
trigger1 = !(Partner,MoveType = H && EnemyNear(0),NumTarget && EnemyNear(0),MoveType = A && !((Partner,StateNo = [5000,5300]) || (Partner,StateNo = [120,160])) && Partner,GetHitVar(hitshaketime) = 0)
var(42) = 0
ignorehitpause = 1

[State -2, EnemyNear]
type = VarSet
triggerall = var(59)
triggerall = NumPartner > 0
triggerall = Partner,Life > 0
triggerall = NumEnemy > 1
triggerall = EnemyNear(0),Life > 0 && EnemyNear(1),Life > 0
trigger1 = (Partner,MoveType = A && Partner,NumTarget && EnemyNear(0),MoveType = H && EnemyNear(1),MoveType != H && !((EnemyNear(0),StateNo = [5000,5300]) || (EnemyNear(0),StateNo = [120,160])) && EnemyNear(0),GetHitVar(hitshaketime) = 0)
trigger2 = (Partner,MoveType = H && EnemyNear(0),NumTarget && EnemyNear(0),MoveType = A && !((Partner,StateNo = [5000,5300]) || (Partner,StateNo = [120,160])) && Partner,GetHitVar(hitshaketime) = 0)
var(42) = 1
ignorehitpause = 1

;===================================================================================
;                              対飛び道具＆ヘルパー用
;===================================================================================
[State -2];敵Aヘルパー数
type = varset
triggerall = RoundState = 2
trigger1 = GameTime = var(30)
trigger2 = P2MoveType = I && !InGuardDist
var(31) = Enemy(0),NumHelper
ignorehitpause = 1

[State -2];敵Bヘルパー数
type = varset
triggerall = NumEnemy = 2
triggerall = RoundState = 2
trigger1 = GameTime = var(30)
trigger2 = P2MoveType = I && !InGuardDist
var(32) = Enemy(1),NumHelper
ignorehitpause = 1

;===================================================================================
;                              敵攻撃用ヘルパー有無判定
;===================================================================================

[State -2]
type = varset
trigger1 = NumEnemy = 1
trigger1 = Enemy(0),NumHelper - var(31) > 0
trigger1 = Enemy(0),MoveType = A || (Enemy(0),MoveType != A && InGuardDist)
trigger2 = NumEnemy = 2
trigger2 = Enemy(0),NumHelper - var(31) > 0
trigger2 = Enemy(0),MoveType = A || (Enemy(0),MoveType != A && InGuardDist)
trigger3 = NumEnemy = 2
trigger3 = Enemy(1),NumHelper - var(32) > 0
trigger3 = Enemy(1),MoveType = A || (Enemy(1),MoveType != A && InGuardDist)
var(33) = 1
ignorehitpause = 1

[State -2]
type = varset
trigger1 = NumEnemy = 1
trigger1 = !(Enemy(0),NumHelper - var(31) > 0 && (Enemy(0),MoveType = A || (Enemy(0),MoveType != A && InGuardDist)))
trigger2 = NumEnemy = 2
trigger2 = !(Enemy(0),NumHelper - var(31) > 0 && (Enemy(0),MoveType = A || (Enemy(0),MoveType != A && InGuardDist)))
trigger2 = !(Enemy(1),NumHelper - var(31) > 0 && (Enemy(1),MoveType = A || (Enemy(1),MoveType != A && InGuardDist)))
var(33) = 0
ignorehitpause = 1

;===================================================================================
;                              相手飛び道具速度
;===================================================================================

[State -2]
type = VarSet
triggerall = EnemyNear(var(42)),NumProj > 0 || var(33)
trigger1 = fvar(12) - fvar(13) = (0,25]
fvar(10) = Ceil(500/floor(fvar(12) - fvar(13)))/10.0

[State -2]
type = VarSet
triggerall = EnemyNear(var(42)),NumProj > 0 || var(33)
triggerall = !(fvar(12) - fvar(13) = (0,25])
trigger1 = fvar(11) - fvar(12) = (0,25]
fvar(10) = Ceil(500/floor(fvar(11) - fvar(12)))/10.0

[State -2]
type = VarSet
trigger1 = EnemyNear(var(42)),NumProj > 0 || var(33)
trigger1 = fvar(12) - fvar(13) = 0
trigger2 = EnemyNear(var(42)),NumProj > 0 || var(33)
trigger2 = fvar(11) - fvar(12) = 0
trigger3 = EnemyNear(var(42)),NumProj = 0 && !var(33)
fvar(10) = 0

[State -2]
type = VarSet
triggerall = EnemyNear(var(42)),NumProj > 0 || var(33)
trigger1 = !(fvar(12) - fvar(13) = [0,25])
trigger1 = !(fvar(11) - fvar(12) = [0,25])
fvar(10) = 5.55

;===================================================================================
;                                      敵滞空時間
;===================================================================================
[State -2];敵滞空時間
type = VarSet
triggerall = !var(40)
trigger1 = EnemyNear(var(42)),StateType = A
var(40) = 1

[State -2]
type = VarAdd
trigger1 = var(40)
trigger1 = !(EnemyNear(var(42)),GetHitVar(hitshaketime) > 0)
var(40) = 1

[State -2]
type = VarSet
trigger1 = !(EnemyNear(var(42)),StateType = A)
var(40) = 0

;================================================================================================
;                                       タッグ位置関係 
;================================================================================================
[State -2,43(0)];My->E0,E1
type = VarSet
trigger1 = NumEnemy<2
trigger2 = !(EnemyNear(0),Alive&&EnemyNear(1),Alive)
v = 43
value = 0

[State -2,43(1)];My->E0,E1
type = VarSet
triggerall=NumEnemy>1
triggerall=EnemyNear(0),Alive
triggerall=EnemyNear(1),Alive
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Pos X>0,EnemyNear(0),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Pos X>0,EnemyNear(1),Pos X-Pos X<0)
v = 43
value =1

[State -2,43(2)];My->P,E0,E1
type = VarSet
triggerall=NumEnemy>1
triggerall=NumPartner
triggerall=EnemyNear(0),Alive
triggerall=EnemyNear(1),Alive
triggerall=Partner,Alive
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Pos X>0,EnemyNear(0),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Pos X>0,EnemyNear(1),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Partner,Pos X>0,EnemyNear(0),Pos X-Partner,Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Partner,Pos X>0,EnemyNear(1),Pos X-Partner,Pos X<0)
v = 43
value =2

[State -2,43(3)];My->E0,P,E1
type = VarSet
triggerall=NumEnemy>1
triggerall=NumPartner
triggerall=EnemyNear(0),Alive
triggerall=EnemyNear(1),Alive
triggerall=Partner,Alive
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Pos X>0,EnemyNear(0),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Pos X>0,EnemyNear(1),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Partner,Pos X<0,EnemyNear(0),Pos X-Partner,Pos X>0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Partner,Pos X>0,EnemyNear(1),Pos X-Partner,Pos X<0)
v = 43
value =3

[State -2,43(4)];My->E0,E1,P
type = VarSet
triggerall=NumEnemy>1
triggerall=NumPartner
triggerall=EnemyNear(0),Alive
triggerall=EnemyNear(1),Alive
triggerall=Partner,Alive
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Pos X>0,EnemyNear(0),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Pos X>0,EnemyNear(1),Pos X-Pos X<0)
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Partner,Pos X<0,EnemyNear(0),Pos X-Partner,Pos X>0)
trigger1 = IfElse(facing=1,EnemyNear(1),Pos X-Partner,Pos X<0,EnemyNear(1),Pos X-Partner,Pos X>0)
v = 43
value =4

[State -2,43(5)];E1,E0,My->(P)
type = VarSet
triggerall=NumEnemy>1
triggerall=EnemyNear(0),Alive
triggerall=EnemyNear(1),Alive
trigger1 = IfElse(facing=1,EnemyNear(0),Pos X-Pos X<0,EnemyNear(0),Pos X-Pos X>0)
trigger2 = IfElse(facing=1,EnemyNear(1),Pos X-Pos X<0,EnemyNear(1),Pos X-Pos X>0)
v = 43
value =5

;================================================================================================
;                                       タッグ状況 
;================================================================================================
[State -2,44(0)];P:None
type = VarSet
triggerall=TeamMode=Simul
trigger1 = !NumPartner
trigger2 = !Partner,Alive
v = 44
value = 0

[State -2,44(1)];P:REAR
type = VarSet
triggerall=TeamMode=Simul
triggerall = NumPartner
triggerall = Partner,Alive
trigger1 = IfElse(facing=1,Partner,Pos X-Pos X<0,Partner,Pos X-Pos X>0)
v = 44
value = 1

[State -2,44(2)];P:VANGUARD
type = VarSet
triggerall=TeamMode=Simul
triggerall = NumPartner
triggerall = Partner,Alive
trigger1 = IfElse(facing=1,Partner,Pos X-Pos X>0,Partner,Pos X-Pos X<0)
v = 44
value = 2

[State -2,44(3)];P:DAMEAGE
type = VarSet
triggerall=TeamMode=Simul
triggerall=NumPartner
triggerall=Partner,Alive
triggerall=Partner,movetype=H
triggerall=IfElse(facing=1,Partner,Pos X-Pos X>0,Partner,Pos X-Pos X<0);P:VAN
trigger1 = Partner,stateno=[5000,5099]
trigger2 = Partner,stateno=[120,159]
v = 44
value = 3

[State -2,44(4)];P:ATTACK
type = VarSet
triggerall=TeamMode=Simul
triggerall=NumPartner
triggerall=Partner,Alive
triggerall=Partner,movetype=A
triggerall=Partner,movetype!=H
triggerall=EnemyNear(var(42)),movetype=H
triggerall=IfElse(facing=1,Partner,Pos X-Pos X>0,Partner,Pos X-Pos X<0)
trigger1 = EnemyNear(var(42)),stateno=[5000,5099]
v = 44
value = 4

[State -2,44(5)];P:Re.STATE
type = VarSet
triggerall=TeamMode=Simul
triggerall=NumPartner
triggerall=Partner,Alive
triggerall=Partner,movetype=H
triggerall=IfElse(facing=1,Partner,Pos X-Pos X>0,Partner,Pos X-Pos X<0)
trigger1 = Partner,stateno!=[5000,5500]
trigger1 = Partner,stateno!=[120,159]
v = 44
value = 5

[State -2,44(6)];P:Rob.STATE
type = VarSet
triggerall=TeamMode=Simul
triggerall=NumPartner
triggerall=Partner,Alive
triggerall=(Partner,stateno=[2000,4999])||Partner,stateno>5500
trigger1 = EnemyNear(var(42)),movetype=H
trigger1 = EnemyNear(var(42)),stateno!=[5000,5500]
trigger1 = EnemyNear(var(42)),stateno!=[120,159]
v = 44
value = 6
;----------------------------------->deception<

[State ]
type = VarSet
triggerall=(p3Name="Psyqhical"|p3Name="Gustab Munchausen"|p3Name="Hei_F"|p3Name="Hei Meiling")
Triggerall=RoundState=[0,1]
trigger1=teamside=2
trigger1=pos x<(partner,Pos X)
trigger2=teamside=1
trigger2=pos x>(partner,pos X)
v = 38
value = 1
;0:off/1:on
;----------------------------------->deception<

[State -2, クリップボード]
type = null;DisplayToClipboard
trigger1 = 1
text = "Cancel=%d, Throw=%d, Button=%d, Body-Distance X=%d,Y=%d \n"
params = var(1),var(2),var(5),floor(P2BodyDist X),floor(P2BodyDist Y)

[State -2, デバック(変数確認)fly]
Type = null;DisplayToClipBoard
Trigger1 = 1
Text = "v(33)=%d,v(34)=%d,v(35)=%d,fv(14)=%f,fv(11)=%f\n"
Params = var(33),var(34),var(35),fvar(14),fvar(11)
IgnoreHitPause = 1

[State -2, デバック(変数確認)]
Type = DisplayToClipBoard
Trigger1 = 1
Text = "v(51)=%d,v(45)=%d,v(27)=%d,v(53)=%d,v(23)=%d\n"
Params = var(51),var(45),var(27),var(53),var(23);fvar(14)
IgnoreHitPause = 1

[State -2, クリップボード（追加専用）]
type = null;AppendToClipboard
trigger1 = 1
text = "Position X=%d,Y=%d, Velocity X=%f,Y=%f, Hit=%d \n"
params = floor(Pos X),floor(Pos Y),(Vel X),(Vel Y),(MoveHit)

[State -2, 距離確認デバック]
type = AppendToClipboard
trigger1 = 1
text =  "P2X:%f,P2Y:%f,FE%d,BE%d,Py:%d \n"
params = P2BodyDist x,P2BodyDist y,FrontEdgeBodyDist,BackEdgeBodyDist,Pos y
IgnoreHitPause = 1

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

