;===========================================================================
;================================■======■■■=============================
;===============================■■=======■===============================
;==============================■==■======■===============================
;=============================■■■■=====■===============================
;=============================■====■=====■===============================
;=============================■====■===■■■=============================
;===========================================================================
;
;	AI by FAY418
;
;■レベル設定
;	・下のValueの値を1〜11まで設定できます。
;	・さらにレベル11で超反応します
;	・レベルといってもランダムの値を変えてるだけなので行動はほとんど変わりません
;
;===========================================================================
[Statedef -3]

[State -3, AI]
Type = VarSet
TriggerAll = !Var(59)
TriggerAll = RoundState != 3
Trigger1  = Command = "AI_00" || Command = "AI_01" || Command = "AI_02" || Command = "AI_03" || Command = "AI_04"
Trigger2  = Command = "AI_05" || Command = "AI_06" || Command = "AI_07" || Command = "AI_08" || Command = "AI_09"
Trigger3  = Command = "AI_10" || Command = "AI_11" || Command = "AI_12" || Command = "AI_13" || Command = "AI_14"
Trigger4  = Command = "AI_15" || Command = "AI_16" || Command = "AI_17" || Command = "AI_18" || Command = "AI_19"
Trigger5  = Command = "AI_20" || Command = "AI_21" || Command = "AI_22" || Command = "AI_23" || Command = "AI_24"
Trigger6  = Command = "AI_25" || Command = "AI_26" || Command = "AI_27" || Command = "AI_28" || Command = "AI_29"
Trigger7  = Command = "AI_30" || Command = "AI_31" || Command = "AI_32" || Command = "AI_33" || Command = "AI_34"
Trigger8  = Command = "AI_35" || Command = "AI_36" || Command = "AI_37" || Command = "AI_38" || Command = "AI_39"
Trigger9  = Command = "AI_40" || Command = "AI_41" || Command = "AI_42" || Command = "AI_43" || Command = "AI_44"
Trigger10 = Command = "AI_45" || Command = "AI_46" || Command = "AI_47" || Command = "AI_48" || Command = "AI_49"
Trigger11 = Command = "AI_50" || Command = "AI_51" || Command = "AI_52" || Command = "AI_53" || Command = "AI_54"
Trigger12 = Command = "AI_55" || Command = "AI_56" || Command = "AI_57" || Command = "AI_58" || Command = "AI_59"
Trigger13 = Command = "AI_60" || Command = "AI_61" || Command = "AI_62" || Command = "AI_63" || Command = "AI_64"
Trigger14 = Command = "AI_65" || Command = "AI_66" || Command = "AI_67" || Command = "AI_68" || Command = "AI_69"
Trigger15 = PalNo >= 7 && RoundState = 2
Trigger16 = NumHelper(99998) > 0
Trigger16 = Helper(99998),Var(59) = 1
IgNoreHitPause = 1
V = 59
;■■■■■■■■■■■■■■■■■■■
Value = 11   ;ここを1〜11に設定できます
;■■■■■■■■■■■■■■■■■■■

[State -3, AI]
Type = VarSet
TriggerAll = Var(59) > 0
Trigger1 = Win = 1
Trigger2 = Lose = 1
Trigger3 = DrawGame = 1
Trigger4 = RoundState = [3,4]
V = 59
Value = -Var(59)
IgnoreHitPause = 1

[State -3, AI]
Type = VarSet
Trigger1 = Var(59) < 0
Trigger1 = RoundState = 2
V = 59
Value = -Var(59)
IgnoreHitPause = 1

;===========================================================================
;---------------------------------------------------------------------------
;Xボタン（0:離している 1:押している状態）
[State -3, PushButton X]
Type = VarSet
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(39) = 0
TriggerAll = Life >= 300
TriggerAll = (Var(5) != -1 && Power < 3000) || (Var(5) = -1 && Power < 2000)	;ファイナルマスパ撃ちたい
;TriggerAll = Var(5) != 3 && Var(5) != 5 && Var(5) != 7 && Var(5) != 13	;サイコミサイル撃ちたい
Trigger1 = StateNo = 220 || StateNo = 420 || StateNo = [620,626]
Trigger1 = Time = 2
Trigger1 = Random < 40 * Var(59)
Trigger2 = StateNo = 3005
Trigger3 = MoveType = H
Trigger3 = Random < 30 * Var(59)
var(39) = 1

[State -3, Charge End AI]
Type = VarSet
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(39) = 1
Trigger1 = StateNo = 220 || StateNo = 420 || StateNo = [620,626]
Trigger1 = Time = 1
Trigger2 = Var(5) = -1 && Power >= 1000
Trigger2 = StateNo = 215
Trigger2 = Random < 30 * Var(59)
var(39) = 0

;===========================================================================
;---------------------------------------------------------------------------
;空中復帰
[State -3]
Type = ChangeState
Value = 5210
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Vel Y > -1
TriggerAll = Alive	;生きているとき
TriggerAll = StateNo = 5050
Trigger1 = CanRecover	;復帰することが出来るとき
Trigger1 = Random < 10 * Var(59)*Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;ガード
[State -3, ガード]
Type = ChangeState
Value = 120
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Ctrl
TriggerAll = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
TriggerAll = 100 * Var(59)
Trigger1 = InGuardDist || Abs(P2BodyDist X) < 60
Trigger1 = EnemyNear,HitDefAttr = SCA,AA,AP
;Projectile形式飛び道具対策(別にProjectileそのものが防げるようになるわけではない。)
Trigger2 = InGuardDist
Trigger2 = Enemy,NumProj > 0
;突進系対策
Trigger3 = !InGuardDist
Trigger3 = EnemyNear,Vel X > 0
Trigger3 = EnemyNear,HitDefAttr = SC,AA
;ヘルパー対策
Trigger4 = InGuardDist
Trigger4 = NumHelper(99998)
Trigger4 = Enemy,NumHelper > Helper(99998),Var(0)

;===========================================================================
;カードを墓地に捨ててやるぜ！
[State -3, CARDSHOOT]
type = ChangeState
value = 3600
triggerall = Var(59) && RoundState = 2
triggerAll = var(5) > 0;現在、ＭＡＸでない＆何か装備している 0以上
triggerAll = statetype = S && ctrl
Trigger1 = Life < 300	;ぴんち
Trigger1 = Power >= 3000
Trigger1 = P2Life > 300	;負けてる；；
Trigger1 = P2BodyDist X > 200
Trigger1 = Random < 80 * Var(59)
Trigger2 = Var(6) = 0
Trigger2 = P2StateType != A && P2StateType != L && P2StateNo != 5120
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 6)) = [-7 , 107]
Trigger2 = Random < 91 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;テーレッテー
[State -3, Tehletteh]
Type = ChangeState
Value = 70000
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(41) >= 7;七星ゲージＭＡＸ 
TriggerAll = Var(5) >= -1;MAX状態〜特殊武器
Trigger1 = (Stateno = 240);マスィブブルーム
Trigger1 = moveHit
Trigger1 = (P2BodyDist X - (EnemyNear,Vel X * 4)) = [-29 , 143]
;Trigger1 = (P2BodyDist Y + (EnemyNear,Vel Y * 5 + EnemyNear,Const(movement.yaccel) * 15)) = [-48, 0]
Trigger1 = Random < 100 * Var(59)
Trigger2 = (Stateno = 245);パワースィープ
Trigger2 = moveHit > 17
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 4)) = [-29 , 143]
;Trigger2 = (P2BodyDist Y + (EnemyNear,Vel Y * 5 + EnemyNear,Const(movement.yaccel) * 15)) = [-48, 0]
Trigger2 = Random < 100 * Var(59)
Trigger3 = StateType = S && Ctrl
Trigger3 = (P2BodyDist X - (EnemyNear,Vel X * 12)) = [-29 , 143]
Trigger3 = (P2BodyDist Y + (EnemyNear,Vel Y * 12 + EnemyNear,Const(movement.yaccel) * 78)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-48, 0]
Trigger3 = P2StateType != L && P2StateNo != 5120
Trigger3 = P2MoveType = H && P2StateNo != [120,155]
Trigger3 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;ますたーすぱーくLv3
[State -3, MasterSparkLv3]
Type = ChangeState
Value = 3010
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 2000
TriggerAll = Var(5) = -1;MAX状態
TriggerAll = life < 300
TriggerAll = !Var(39)
TriggerAll = StateType = S && Ctrl
Trigger1 = (P2MoveType = H) || (P2StateType = L)
Trigger1 = P2BodyDist X > 150
Trigger1 = Random < 80 * Var(59)
Trigger2 = !EnemyNear,Ctrl
Trigger2 = Enemy,NumProj = 0 
Trigger2 = NumHelper(99998) > 0
Trigger2 = Enemy,NumHelper = Helper(99998),Var(0)
Trigger2 = P2BodyDist X > 220
Trigger2 = Random < 80 * Var(59)

;---------------------------------------------------------------------------
;後退ダッシュ
[State -3, Run Back]
Type = ChangeState
Value = 105
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S && Ctrl
TriggerAll = BackEdgeBodyDist > 30
Trigger1 = life < 300;ピンチ
Trigger1 = Var(5) = -1
Trigger1 = Power >= 2000
Trigger1 = P2BodyDist X > 0
Trigger1 = Random < 80 * Var(59)
Trigger2 = life < 300;ピンチ
Trigger2 = Var(5) != -1
Trigger2 = Power >= 3000
Trigger2 = P2BodyDist X > 0
Trigger2 = Random < 80 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;ゲット武器発動！-----------------------------------------------------------
;武器番号
;1:覇王翔吼拳　2:真・昇竜拳　3:ヴェノム魔理沙　4:ダークエンジェル　5:スラッシュクロー
;6:メリークリスマス　7:レイジングストーム　8:羅生門　9:滅びのバーストストリーム　10:ハイパーボッ(笑)
;11:ハイパーボム(岩男)　12:Rocks　13:大蛇薙　14:やみどうこく　15:ギガンテックプレッシャー

[State -3, 覇王翔吼拳]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35010)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 1	 || (PalNo % 6) = 0;覇王翔吼拳
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl
Trigger2 = P2StateType != A && (P2MoveType = A || Enemy,NumProj > 0)
Trigger2 = P2BodyDist X > 120
Trigger2 = Random < 60 * Var(59)

[State -3, 真・昇竜拳]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35020)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 2	 || (PalNo % 6) = 0;真・昇竜拳
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2StateType != A && P2MoveType = A
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 2)) = [26, 50]
Trigger2 = Random < 40 * Var(59)

[State -3, ヴェノム魔理沙]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35030)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 3	 || (PalNo % 6) = 0;ヴェノム
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl && Time > 0
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2StateType != A && P2MoveType = A
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 16)) = [-38, 146]
Trigger2 = Random < 40 * Var(59)

[State -3, ダークエンジェル]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35040)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 4	 || (PalNo % 6) = 0;ダークエンジェル
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998) > 0
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = Ctrl
Trigger1 = P2BodyDist X > 160
Trigger1 = P2BodyDist Y = [-30,0]
Trigger1 = P2MoveType != H
Trigger1 = Random < 50 * Var(59)

[State -3, スラッシュクロー]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35050)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 5	 || (PalNo % 6) = 0;スラッシュ
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2StateType != A && (P2MoveType = A || Enemy,NumProj > 0)
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 13)) = [100, 195]
Trigger2 = Random < 40 * Var(59)
Trigger3 = Ctrl && Time > 0
Trigger3 = P2MoveType = H && P2StateNo != [120,155]
Trigger3 = (P2BodyDist X - (EnemyNear,Vel X * 13)) = [25, 195]
Trigger3 = (P2BodyDist Y + (EnemyNear,Vel Y * 13 + EnemyNear,Const(movement.yaccel) * 91)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-54, -24]
Trigger3 = Random < 60 * Var(59)

[State -3, メリークリスマス]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35060)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 6	 || (PalNo % 6) = 0;メリクリ
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = Ctrl
Trigger1 = Life < 200
Trigger1 = P2Life - Life > 300
Trigger1 = Random < 1 * Var(59)*Var(59)*Var(59)

[State -3, レイジングストーム]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35070)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 7	 || (PalNo % 6) = 0;レイジングストーム
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl && Time > 0
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2MoveType != I && P2StateNo != [120,155]
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 8)) = [-42, 120]
Trigger2 = (P2BodyDist Y + (EnemyNear,Vel Y * 8 + EnemyNear,Const(movement.yaccel) * 36)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-210, 1]
Trigger2 = Random < 50 * Var(59)

[State -3, 羅生門]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35080)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 8	|| (PalNo % 6) = 0	;羅生門
TriggerAll = Var(6)	|| (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveContact
Trigger1 = (P2BodyDist X - EnemyNear,Vel X) < 66
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl && Time > 0
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2StateType != A && P2StateType != L && P2StateNo != 5120
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X)) = [23, 66]
Trigger2 = Random < 40 * Var(59)

[State -3, 滅びのバーストストリーム]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35090)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 9	 || (PalNo % 6) = 0	;滅びのバーストストリーム
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = Ctrl
Trigger1 = !InGuardDist
Trigger1 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger1 = P2MoveType = A || Enemy,NumProj > 0
Trigger1 = Random < 20 * Var(59)

[State -3, ハイパーボッ（笑）]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35100)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 10 || (PalNo % 6) = 0	;ハイパーボッ
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveContact
Trigger1 = (P2BodyDist X - EnemyNear,Vel X * 3) < 80
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl && Time > 0
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2StateType != A && P2StateType != L && P2StateNo != 5120
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 3)) = [21, 80]

[State -3, ハイパーボム（岩男）]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35110)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 11 || (PalNo % 6) = 0	;ハイパーボム
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = Ctrl
Trigger1 = P2BodyDist X > 100
Trigger1 = P2BodyDist Y = [-50,0]
Trigger1 = Random < 50 * Var(59)

[State -3, Rocks]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35120)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 12 || (PalNo % 6) = 0	;歌
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = Ctrl
Trigger1 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger1 = P2MoveType = A || Enemy,NumProj > 0
Trigger1 = Random < 20 * Var(59)

[State -3, 大蛇薙]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35130)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 13 || (PalNo % 6) = 0	;大蛇薙
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl && Time > 0
Trigger2 = P2MoveType = H && P2StateNo != [120,155]
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 9)) = [8, 126]
Trigger2 = (P2BodyDist Y + (EnemyNear,Vel Y * 9 + EnemyNear,Const(movement.yaccel) * 45)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-74, -3]
Trigger2 = Random < 60 * Var(59)

[State -3, やみどうこく]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35140)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 14 || (PalNo % 6) = 0	;闇慟哭
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveContact
Trigger1 = (P2BodyDist X - EnemyNear,Vel X) < 66
Trigger1 = Random < 100 * Var(59)
Trigger2 = Ctrl && Time > 0
Trigger2 = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger2 = P2StateType != A && P2StateType != L && P2StateNo != 5120
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X)) = [23, 66]
Trigger2 = Random < 40 * Var(59)

[State -3, ギガンテックプレッシャー]
Type = ChangeState
Value = IfElse((PalNo % 6) != 0, 35000, 35150)
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(5) = 15 || (PalNo % 6) = 0	;運送
TriggerAll = Var(6)	 || (PalNo % 6) = 0	;げーじ大丈夫？
TriggerAll = StateType != A
Trigger1 = (StateNo = [230,235]) || (StateNo = [250,255])	;地上コンボ三段目からキャンセルが可能
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;ますたーすぱーくLv2
[State -3, MasterSparkLv2]
Type = ChangeState
Value = 3005
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) = -1;MAX状態
TriggerAll = !Var(39)
Trigger1 = (Stateno = 215)
Trigger1 = moveHit
Trigger1 = Random < 40 * Var(59)

;---------------------------------------------------------------------------
;ますたーすぱーくLv1
[State -3, MasterSpark]
Type = ChangeState
Value = 3000
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) != -1
TriggerAll = StateType = S && Ctrl
TriggerAll = !Var(39)
Trigger1 = P2StateType = A && P2MoveType = H
Trigger1 = P2BodyDist X > 100
Trigger1 = (P2BodyDist Y + (EnemyNear,Vel Y * 40 + EnemyNear,Const(movement.yaccel) * 820)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-74, -5]
Trigger1 = Power > 1700
Trigger1 = IfElse((Life > 300), 1 ,(Power < 2700))
Trigger1 = Random < 20 * Var(59)
Trigger2 = (P2BodyDist Y + (EnemyNear,Vel Y * 40 + EnemyNear,Const(movement.yaccel) * 820)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-74, -5]
Trigger2 = P2MoveType = A
Trigger2 = Random < 45 * Var(59)

;---------------------------------------------------------------------------
;ブレイジングスター
[State -3, ITEM-2]
Type = ChangeState
Value = 3045
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) = -1;MAX状態
;MAXゲージ切れそうになったら発動
Trigger1 = StateType != C;立ち状態か空中状態
Trigger1 = Ctrl
Trigger1 = Var(6) < 300
Trigger1 = Random < 100 * Var(59)
;箒から発動
Trigger2 = (Stateno = 245) || (Stateno = 261);パワースィープ　or　マスィブボディ
Trigger2 = movehit
Trigger2 = Var(41) < 7
Trigger2 = Random < 40 * Var(59)
;えりある途中から発動
Trigger3 = Power < 2000
Trigger3 = (Stateno = 615) || (Stateno = 630)
Trigger3 = MoveHit
Trigger3 = Random < 40 * Var(59)

;---------------------------------------------------------------------------
;スターダストレヴァリエ
[State -3, HOUKISP]
Type = ChangeState
Value = 3040
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) != -1;MAX状態じゃない
Trigger1 = StateType != C;立ち状態か空中状態
Trigger1 = Ctrl
Trigger1 = Power > 1700
Trigger1 = IfElse((Life > 300), 1 ,(Power < 2700))
Trigger1 = P2BodyDist X = [0,60]
Trigger1 = P2BodyDist Y = [-40,-10]
Trigger1 = P2StateType != L
Trigger1 = Random < 3 * Var(59)
;なぜかヒップから繋がる
Trigger2 =  (Stateno = 261)
Trigger2 = moveHit
Trigger2 = Power > 1700
Trigger2 = IfElse((Life > 300), 1 ,(Power < 2700))
Trigger2 = Random < 30 * Var(59)

;---------------------------------------------------------------------------
;ＭＡＸアクセルフォーム
[State -3, AXEL]
Type = ChangeState
Value = 30410
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) = -1;MAX状態
TriggerAll = StateType = S && Ctrl
TriggerAll = Life < 600 || P2Life > 600
TriggerAll = Random < 3 * Var(59)
Trigger1 = P2StateType = L || (P2StateType = A && P2MoveType = H)
Trigger2 = P2BodyDist X > 200

;---------------------------------------------------------------------------
;アクセルフォーム
[State -3, AXEL]
Type = ChangeState
Value = 30400
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) != -1;MAX状態じゃない
TriggerAll = StateType = S && Ctrl
;Trigger1 = Power > 1700
Trigger1 = IfElse((Life > 300), 1 ,(Power < 2700))
Trigger1 = P2StateType != L && P2MoveType = H && P2StateNo != [120, 155]
Trigger1 = P2BodyDist Y = [-30, 0]
Trigger1 = EnemyNear,Vel Y = [0, 2]
Trigger1 = Random < 80 * Var(59)
Trigger2 = Var(5) = -2	;アクセル状態
Trigger2 = Var(6) < 500
Trigger2 = P2StateType != A
Trigger2 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;バタフライストームＭＡＸ
[State -3, HOUKISP]
Type = ChangeState
Value = 3035
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) = -1;MAX状態
Trigger1 = StateType = S && Ctrl
Trigger1 = P2BodyDist X = [0,50]
Trigger1 = P2BodyDist Y = [-40,0]
Trigger1 = Life <= 200 && P2Life - Life > 400
Trigger1 = Random < 70 * Var(59)

;---------------------------------------------------------------------------
;バタフライストーム
[State -3, HOUKISP]
Type = ChangeState
Value = 3030
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000
TriggerAll = Var(5) != -1;MAX状態じゃない
Trigger1 = (Stateno = 245) ;パワースィープ
Trigger1 = movehit
Trigger1 = Power > 1700
Trigger1 = IfElse((Life > 300), 1 ,(Power < 2700))
Trigger1 = Var(41) < 7
Trigger1 = P2BodyDist X = [0,120]
Trigger1 = 70 * Var(59)

;---------------------------------------------------------------------------
;マスターブレード
[State -3, MasterBlade]
Type = ChangeState
Value = 3090
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(30) = 0;アリスタイマーが０
TriggerAll = Var(32) = 0;パチュリータイマーが０
TriggerAll = !NumHelper(1202)
TriggerAll = !NumHelper(3050)
TriggerAll = !NumHelper(3060)
TriggerAll = Power >= 3000
TriggerAll = Var(5) = 0;ノーマル
Trigger1 = StateType = S && Ctrl
Trigger1 = P2MoveType = A
Trigger1 = Life > 500
Trigger1 = Random < 40 * Var(59)

;---------------------------------------------------------------------------
;マリス砲
[State -3, MaliceCannon]
Type = ChangeState
Value = 3050
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(30) = 0;アリスタイマーが０
TriggerAll = !NumHelper(1202)
TriggerAll = !NumHelper(3050)
TriggerAll = Power >= 2000
TriggerAll = Var(5) = 0;ノーマル
Trigger1 = StateType = S && Ctrl
Trigger1 = P2StateType != A && P2StateType != L
Trigger1 = P2MoveType = H && P2StateNo != [120,155]
Trigger1 = P2BodyDist X > 120
Trigger1 = Random < 6 * Var(59)*Var(59)

;---------------------------------------------------------------------------
;ノンディレクショナル
[State -3, NonDirLazer]
Type = ChangeState
Value = 3060
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(32) = 0;パチュリータイマーが０
TriggerAll = !NumHelper(3060)
TriggerAll = Power >= 2000
TriggerAll = Var(5) = 0;ノーマル
Trigger1 = StateType = S && Ctrl
Trigger1 = (P2BodyDist X > 150) || (P2BodyDist Y < -150)
Trigger1 = P2MoveType = H
Trigger1 = Random < 8 * Var(59)
Trigger2 = TeamMode = Simul
Trigger2 = (P2BodyDist X > 100) || (P2BodyDist Y < -100)
Trigger2 = Random < 20 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;陰陽ストライク
[State -3, RockBAllA]
Type = ChangeState
Value = 1020
TriggerAll = Var(59) && RoundState = 2
TriggerAll = !NumHelper(1020)
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998)
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = StateType != A && Ctrl
Trigger1 = P2BodyDist X > 170
Trigger1 = Random < 10 * Var(59)

[State -3, RockBAllB]
Type = ChangeState
Value = 1021
TriggerAll = Var(59) && RoundState = 2
TriggerAll = !NumHelper(1020)
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998)
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = StateType != A && Ctrl
Trigger1 = P2BodyDist X > 220
Trigger1 = Random < 20 * Var(59)

;---------------------------------------------------------------------------
;マスィブブルーム
[State -3, マスティブ箒]
Type = ChangeState
Value = 240
TriggerAll = Var(59) && RoundState = 2
TriggerAll = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
TriggerAll = IfElse((Var(5) = -2), (Random < 80 * Var(59)), (Random < 40 * Var(59)))
TriggerAll = StateType != A && Ctrl
TriggerAll = P2BodyDist X > 76 || P2BodyDist Y < -63
Trigger1 = Time > 0
Trigger1 = P2StateType = A
Trigger1 = (P2BodyDist X - (EnemyNear,Vel X * 21)) = [-29, 96]
Trigger1 = (P2BodyDist Y + (EnemyNear,Vel Y * 21 + EnemyNear,Const(movement.yaccel) * 221)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-104, -48]
Trigger2 = Time > 0
Trigger2 = P2StateType != L && P2MoveType = H && P2StateNo != 5120 && P2StateNo != [120, 155]
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 23)) = [58, 120]
Trigger2 = (P2BodyDist Y + (EnemyNear,Vel Y * 23 + EnemyNear,Const(movement.yaccel) * 276)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-83, 0]

;---------------------------------------------------------------------------
;パワースィープ
[State -3, Power箒]
Type = ChangeState
Value = 245
TriggerAll = Var(59) && RoundState = 2
TriggerAll = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
TriggerAll = StateType != A && Ctrl
TriggerAll = P2StateType != A && P2StateType != L
TriggerAll = P2BodyDist X > 143
TriggerAll = (P2BodyDist X - (EnemyNear,Vel X * 24)) = [-29, 143]
TriggerAll = (P2BodyDist Y + (EnemyNear,Vel Y * 24 + EnemyNear,Const(movement.yaccel) * 300)*(P2StateType=A && EnemyNear,Vel Y!=0)) = [-48, 0]
TriggerAll = Random < 40 * Var(59)
Trigger1 = Time > 0
Trigger1 = P2StateNo != 5120

;---------------------------------------------------------------------------
;しょーりゅーけん弱
[State -3, RockUpperA]
Type = ChangeState
Value = 1010
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType != A && Ctrl
TriggerAll = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger1 = P2BodyDist X = [0,40]
Trigger1 = P2BodyDist Y = [-80,-20]
Trigger1 = P2MoveType = A
Trigger1 = Random < 40 * Var(59)
;Trigger2 = P2BodyDist X = [0,30]
;Trigger2 = P2MoveType = A
;Trigger2 = Random < 40 * Var(59)

;---------------------------------------------------------------------------
;しょーりゅーけん強
[State -3, RockUpperB]
Type = ChangeState
Value = 1011
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType != A && Ctrl
TriggerAll = IfElse((Var(59) > 10), 1, (EnemyNear,Time > 20 + (Random % 30)))
Trigger1 = P2BodyDist X = [0,60]
Trigger1 = P2BodyDist Y = [-120,-20]
Trigger1 = P2MoveType = A
Trigger1 = Random < 40 * Var(59)
Trigger2 = P2MoveType = A
Trigger2 = (P2BodyDist X - (EnemyNear,Vel X * 7)) < 50
Trigger2 = Random < 40 * Var(59)

;---------------------------------------------------------------------------
;さいこみさいる
[State -3, PsycoMissile]
Type = ChangeState
Value = 1000
TriggerAll = Var(59) && RoundState = 2
TriggerAll = !NumHelper(3011);ミサイルが残っているときは連射できまそん
TriggerAll = !Var(39)	;xボタンを使う技だから
TriggerAll = (Var(5) != -1 && Power < 3000) || (Var(5) = -1 && Power < 2000)
Trigger1 = StateType = A;空中用必殺技
Trigger1 = Ctrl
Trigger1 = P2BodyDist X = [50,130]
Trigger1 = P2BodyDist Y = [60,120]
Trigger1 = P2StateType = S || P2StateType = C
Trigger1 = P2MoveType = A
Trigger1 = Random < 20 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;ニュートラルキック
[State -3, Stand Kick]
Type = ChangeState
Value = 210
TriggerAll = Var(59) && RoundState = 2
TriggerAll = P2MoveType != A
Trigger1 = (StateNo = 200) && time > 5
Trigger1 = MoveContact
Trigger1 = P2BodyDist X = [0,35]
Trigger1 = Random < 50 * Var(59)
Trigger2 = StateType = S && Ctrl
Trigger2 = (P2StateType = S) || (P2StateType = C)
Trigger2 = P2MoveType != H
Trigger2 = P2BodyDist X = [0,40]
Trigger2 = Random < 50 * Var(59)
Trigger3 = (Stateno = 230) && time > 6
Trigger3 = P2BodyDist X = [0,45]
Trigger3 = Random < 80 * Var(59)

;---------------------------------------------------------------------------
;立ちパンチ
;[State -3, Stand Light Punch]
[State -3, Stand Punch]
Type = ChangeState
Value = 200
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S
TriggerAll = Ctrl
Trigger1 = P2BodyDist X = [0,35]
Trigger1 = (P2StateType = S) || (P2StateType = C)
Trigger1 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;210->キック
[State -3, Stand Air Kick]
Type = ChangeState
Value = 255
TriggerAll = Var(59) && RoundState = 2
Trigger1 = StateNo = 210 && MoveContact
Trigger1 = P2BodyDist X = [0,25]
Trigger1 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;210->パンチ
[State -3, Stand Punch 4]
Type = ChangeState
Value = 250
TriggerAll = Var(59) && RoundState = 2
Trigger1 = StateNo = 210 && MoveContact
Trigger1 = P2BodyDist X = [0,45]
Trigger1 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;横キック//エリアル発動技
[State -3, Eriak Kick]
Type = ChangeState
Value = 215
TriggerAll = Var(59) && RoundState = 2
Trigger1 = (StateNo = 250) || (StateNo = 255)
Trigger1 = MoveHit
Trigger1 = P2BodyDist X = [0,45]
Trigger1 = Random < 100 * Var(59)
Trigger2 = StateNo = 100	;前ダッシュ中に入れたら発動
Trigger2 = P2BodyDist X = [0,49]
Trigger2 = (P2StateType = S) || (P2StateType = C)
Trigger2 = !NumProjID(35030)
Trigger2 = P2MoveType != H

;---------------------------------------------------------------------------
;ヒップ
[State -3, HIP Stand]
Type = ChangeState
Value = 260
TriggerAll = Var(59) && RoundState = 2
;Trigger1 = StateType = S
;Trigger1 = Ctrl
Trigger1 = (StateNo = 250) || (StateNo = 255)
Trigger1 = MoveHit
Trigger1 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;パンチ二段目
[State -3, Stand Punch 2]
Type = ChangeState
Value = 205
TriggerAll = Var(59) && RoundState = 2
Trigger1 = (StateNo = 200) && MoveContact
Trigger1 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;パンチ三段目
[State -3, Stand Punch 3]
Type = ChangeState
Value = 230
TriggerAll = Var(59) && RoundState = 2
Trigger1 = (StateNo = 205) && MoveContact
Trigger1 = P2BodyDist X = [0,42]
Trigger1 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;205->キック
[State -3, Stand Drop Kick]
Type = ChangeState
Value = 235
TriggerAll = Var(59) && RoundState = 2
Trigger1 = (StateNo = 205) && MoveContact
Trigger1 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;立ちバスター
[State -3, Buster]
Type = ChangeState
Value = 220
TriggerAll = Var(59) && RoundState = 2
TriggerAll = NumProjID(10053) < 3
TriggerAll = IfElse((TeamMode = Simul), (IfElse(NumPartner = 1, !Partner,Alive, 0)), 1)
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998) > 0
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = StateType = S && Ctrl && Var(1) < 250
Trigger1 = NumProjID(10053) < 1
Trigger1 = P2BodyDist X > 200 && P2BodyDist Y > -40
Trigger1 = Random < 60 * Var(59)
Trigger2 = StateType = S && Ctrl && Var(1) >= 250
Trigger2 = P2StateType = S && P2MoveType != H
Trigger2 = P2BodyDist X > 200 && P2BodyDist Y = [-20,0]
Trigger2 = Random < 60 * Var(59)
Trigger3 = (Stateno = 200) || (Stateno = 205) || (Stateno = 230) || (StateNo = 235) || (StateNo =  250) || (StateNo =  255)
Trigger3 = MoveContact
Trigger3 = P2StateType = C
Trigger3 = Random < 100 * Var(59)
Trigger4 = (Stateno = 200) || (Stateno = 205) || (Stateno = 230) || (StateNo = 235) || (StateNo =  250) || (StateNo =  255)
Trigger4 = MoveHit
Trigger4 = P2StateType = C
Trigger4 = Var(1) >= 250
Trigger4 = P2BodyDist X > 20
Trigger4 = Random < 100 * Var(59)

[State -3, Buster]
Type = ChangeState
Value = 220
TriggerAll = Var(59) && RoundState = 2
TriggerAll = NumProjID(10053) < 3
TriggerAll = StateType = S && Ctrl
Trigger1 = TeamMode = Simul && NumPartner = 1
Trigger1 = Partner,Alive
Trigger1 = P2BodyDist X > 120 && P2BodyDist Y > -40
Trigger1 = IfElse((Var(1) >= 250), (Random < 80 * Var(59)), (Random < 30 * Var(59)))

;---------------------------------------------------------------------------
;しゃがみ弱パンチ
[State -3, Crouching Light Punch]
Type = ChangeState
Value = 400
TriggerAll = Var(59) && RoundState = 2
Trigger1 = StateType = C
Trigger1 = Ctrl
Trigger1 = P2BodyDist X = [0,30]
Trigger1 = P2StateType = S
Trigger1 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;しゃがみキック
[State -3, Crouching Strong Punch]
Type = ChangeState
Value = 410
TriggerAll = Var(59) && RoundState = 2
Trigger1 = StateType = C && Ctrl
Trigger1 = P2StateType = S
Trigger1 = P2BodyDist X = [0,50]
Trigger1 = Random < 20 * Var(59)
Trigger2 = StateNo = 400
Trigger2 = MoveContact && Time > 5
Trigger2 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;しゃがみバスター
[State -3, Crouching Buster]
Type = ChangeState
Value = 420
TriggerAll = Var(59) && RoundState = 2
TriggerAll = NumProjID(10053) < 3
TriggerAll = IfElse((TeamMode = Simul), (IfElse(NumPartner = 1, !Partner,Alive, 0)), 1)
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998) > 0
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = StateType = C
Trigger1 = Ctrl
Trigger1 = Var(1) < 250
Trigger1 = NumProjID(10053) < 1
Trigger1 = P2BodyDist X > 200
Trigger1 = P2BodyDist Y > -40
Trigger1 = Random < 40 * Var(59)
Trigger2 = StateType = C
Trigger2 = Ctrl
Trigger2 = Var(1) >= 250
Trigger2 = P2StateType = C
Trigger2 = P2MoveType != H
Trigger2 = P2BodyDist X > 200
Trigger2 = P2BodyDist Y = [-20,0]
Trigger2 = Random < 60 * Var(59)
Trigger3 = (Stateno = 200) || (Stateno = 210) || (Stateno = 230) || (Stateno = 400)
Trigger3 = MoveHit
Trigger3 = P2StateType = S
Trigger3 = Var(1) >= 250
Trigger3 = P2BodyDist X > 20
Trigger3 = Random < 100 * Var(59)
Trigger4 = (Stateno = 200) || (Stateno = 210) || (Stateno = 230) || (Stateno = 240) || (StateNo =  240) || (Stateno = 400)
Trigger4 = MoveContact
Trigger4 = Var(1) < 250
Trigger4 = Random < 100 * Var(59)
Trigger5 = StateNo = 410
Trigger5 = Var(5) != 15
Trigger5 = MoveContact
Trigger5 = Var(1) < 250
Trigger5 = Random < 100 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;空中弱パンチ
[State -3, Jump Low Punch]
Type = ChangeState
Value = 605
TriggerAll = Var(59) && RoundState = 2
TriggerAll = !Var(0)
Trigger1 = StateType = A
Trigger1 = Ctrl
Trigger1 = P2BodyDist X = [0,23]
Trigger1 = P2BodyDist Y = [-40,60]
Trigger1 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;空中弱キック
[State -3, Jump Kick]
Type = ChangeState
Value = 610
TriggerAll = Var(59) && RoundState = 2
TriggerAll = !Var(0)
Trigger1 = StateNo = 605 && MoveContact
Trigger1 = Random < 100 * Var(59)
Trigger2 = StateType = A
Trigger2 = Ctrl
Trigger2 = P2StateType != A
Trigger2 = P2BodyDist X = [-20,60]
Trigger2 = P2BodyDist Y = [0,110]

;---------------------------------------------------------------------------
;空中中パンチ　掌撃
[State -3, Jump Mid Punch]
Type = ChangeState
Value = 630
TriggerAll = Var(59) && RoundState = 2
Trigger1 = StateNo = 605 && MoveContact	;弱パンチから繋がる
Trigger1 = Random < 1000 - Var(59) * 80
Trigger2 = StateNo = 610 && MoveContact	;弱キック中で
Trigger2 = P2BodyDist Y = [-30,-10]
Trigger2 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;ドロップキック
[State -3, Jump Mid Kick]
Type = ChangeState
Value = 615
TriggerAll = Var(59) && RoundState = 2
Trigger1 = StateNo = 610 && MoveContact
Trigger1 = Random < 100 * Var(59)
Trigger2 = StateNo = 630 && MoveContact
Trigger2 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;空中強パンチ　;空中強パンチ 単発含めたい
[State -3, Jump Pow Punch]
Type = ChangeState
Value = 600
TriggerAll = Var(59) && RoundState = 2
;TriggerAll = P2BodyDist Y = [-20,20]
Trigger1 = (StateNo = 630) && MoveContact
Trigger1 = Random < 1000 - Var(59) * 80
Trigger2 = (StateNo = 615) && MoveContact
Trigger2 = Random < 90 * Var(59)

;---------------------------------------------------------------------------
;エリアルチャージバスターフィニッシュ
[State -3, ChargeFire AIRCOMBO FINISH]
Type = ChangeState
Value = 626
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(1) >= 100
TriggerAll = !Var(0) ;Var0（エリアルふっとばし中）が立ってない時でないと出せない
Trigger1 = (StateNo = 615) && MoveHit
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist Y = [-50,50]
Trigger1 = Random < 100 * Var(59)

;---------------------------------------------------------------------------
;空中強キック
[State -3, Jump Strong Kick]
Type = ChangeState
Value = 640
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = A
Trigger1 = (StateNo = 615) && MoveContact
Trigger1 = Random  < 100 * Var(59)

;---------------------------------------------------------------------------
;空中バスター
[State -3, Jump Shot]
Type = ChangeState
Value = 620
TriggerAll = Var(59) && RoundState = 2
TriggerAll = !Var(0) ;Var0（エリアルふっとばし中）が立ってない時でないと出せない
TriggerAll = StateNo != 460
TriggerAll = NumProjID(10053) < 3
TriggerAll = IfElse((TeamMode = Simul), (IfElse(NumPartner = 1, !Partner,Alive, 0)), 1)
Trigger1 = StateType = A
Trigger1 = Ctrl
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist X > 120
Trigger1 = P2BodyDist Y = [-10,10]
Trigger1 = Random < 20 * Var(59)
Trigger2 = StateType = A
Trigger2 = Ctrl
Trigger2 = Pos Y > 70
Trigger2 = P2MoveType = H
Trigger2 = P2BodyDist X > 23
Trigger2 = P2BodyDist Y = [-20,20]
Trigger2 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;通常の空中チャージ
[State -3, ChargeFire sora]
Type = ChangeState
Value = 620
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Var(1) >= 30
TriggerAll = !NumProjID(10051);チャージバスターが飛んでない時
TriggerAll = StateNo != 460
TriggerAll = (StateNo != 630)
TriggerAll = (StateNo != 615)
Trigger1 = Ctrl
Trigger1 = StateType = A
Trigger1 = Var(1) >= 250
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist X > 120
Trigger1 = P2BodyDist Y = [-20,0]
Trigger1 = Random < 20 * Var(59)
Trigger2 = StateType = A
Trigger2 = Ctrl
Trigger2 = Pos Y > 70
Trigger2 = P2MoveType = H
Trigger2 = P2BodyDist X > 23
Trigger2 = P2BodyDist Y = [-20,20]
Trigger2 = Random < 50 * Var(59)

;---------------------------------------------------------------------------
;援護攻撃
;アリス援護
[State -1, Alice]
type = ChangeState
value = 1200
triggerall = var(59) && RoundState = 2
triggerall = var(30) = 0;アリスタイマーが０ ０以外の場合いかなる場合も撃てない
triggerall = !NumHelper(1202)
trigger1 = statetype != A && ctrl
Trigger1 = P2StateType != A
Trigger1 = P2BodyDist X > 200
Trigger1 = Random < 10 * Var(59)

;スピリティア援護
[State -1, Spilitia]
type = ChangeState
value = 1210
triggerall = var(59) && RoundState = 2
triggerall = var(31) = 0;ティアタイマーが０
trigger1 = statetype != A && ctrl
Trigger1 = P2StateType != A
Trigger1 = P2BodyDist X > 200
Trigger1 = Random < 20 * Var(59)

;---------------------------------------------------------------------------
;真空投げ
;羅生門装備時発動
[State -3, Kung Fu Throw]
Type = ChangeState
Value = 65080
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S
TriggerAll = Ctrl
TriggerAll = Var(5) = [7,8];真空投げ装備
TriggerAll = Random < 40 * Var(59)
Trigger1 = StateNo != 100
Trigger1 = P2BodyDist X = [0,60]
Trigger1 = (P2StateType = S) || (P2StateType = C)
Trigger1 = P2MoveType != H

;---------------------------------------------------------------------------
;零距離ゴッドプレス
;運送装備時発動
[State -3, Kung Fu Throw]
Type = ChangeState
Value = 65150
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S
TriggerAll = Var(5) = 15;運送装備
TriggerAll = Stateno != 100
Trigger1 = Ctrl
Trigger1 = P2BodyDist X <= 50
Trigger1 = P2BodyDist Y = [-30,0]
Trigger1 = P2MoveType != H
Trigger1 = Random < 40 * Var(59)
Trigger2 = Ctrl
Trigger2 = Stateno != 100
Trigger2 = P2BodyDist X <= 30
Trigger2 = P2BodyDist Y = [0,-30]
Trigger2 = P2StateType = A
Trigger2 = P2MoveType = H;食らい状態・空中落下してる時
Trigger2 = Random < 60 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;投げ
[State -3, Nage]
Type = ChangeState
Value = 800
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S
TriggerAll = Ctrl
TriggerAll = Random < 40 * Var(59)
Trigger1 = StateNo != 100
Trigger1 = P2BodyDist X = [0,10]
Trigger1 = (P2StateType = S) || (P2StateType = C)
Trigger1 = P2MoveType != H

;---------------------------------------------------------------------------
;ゲット投げ
[State -3, Get Nage]
Type = ChangeState
Value = 805
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S
TriggerAll = Ctrl
TriggerAll = Var(5) = 0
TriggerAll = Random < 40 * Var(59)
Trigger1 = StateNo != 100
Trigger1 = P2BodyDist X = [0,60]
Trigger1 = (P2StateType = S) || (P2StateType = C)
Trigger1 = P2MoveType != H

;---------------------------------------------------------------------------
;ぱわーＭＡＸ
[State -3, PowerMAX]
Type = ChangeState
Value = 860
TriggerAll = Var(59) && RoundState = 2
TriggerAll = Power >= 1000 ;パワーが１０００以上
TriggerAll = Var(5) = 0;現在、何も装備していない＆ＭＡＸでない
TriggerAll = !Var(39)	;xボタンを使う技だから
TriggerAll = StateType = S && Ctrl
TriggerAll = Vel X = 0
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998)
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = Life < 300	;ぴんち
Trigger1 = Power >= 3000
Trigger1 = P2Life > 300	;負けてる；；
Trigger1 = P2BodyDist X > 200
Trigger1 = Random < 80 * Var(59)
Trigger2 = Power > 2000
Trigger2 = Life >= 100
Trigger2 = P2BodyDist X > 170
Trigger2 = Random < 60 * Var(59)

;ドローカード！
[State -3, BATTLECARD]
Type = ChangeState
Value = 3503
TriggerAll = Var(59) && RoundState = 2 && (PalNo % 6) != 0
TriggerAll = Power >= 1000 ;パワーが１０００以上
TriggerAll = Var(5) = 0;現在、何も装備していない＆ＭＡＸでない
TriggerAll = StateType = S
TriggerAll = Ctrl
TriggerAll = Vel X = 0
TriggerAll = Enemy,NumProj = 0 
TriggerAll = NumHelper(99998)
TriggerAll = Enemy,NumHelper = Helper(99998),Var(0)
TriggerAll = P2MoveType != A
Trigger1 = Power > 1500
Trigger1 = IfElse((Life > 300), 1 ,(Power < 2700))
Trigger1 = Life >= 100
Trigger1 = P2BodyDist X > 170
Trigger1 = Random < 50 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;ジャンプ
[State -3, ダッシュジャンプ]
Type = ChangeState
Value = 40
TriggerAll = Var(59) && RoundState = 2
TriggerAll = time >= 10
Trigger1 = StateNo = 100
Trigger1 = P2BodyDist X = [140,180]
Trigger1 = P2StateType != A
Trigger1 = Random < 40 * Var(59)

[State -3, エリアルジャンプ]
Type = ChangeState
Value = 40
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType != A
Trigger1 = StateNo = 215
Trigger1 = MoveHit
Trigger1 = Random < 80 * Var(59)

;===========================================================================
;---------------------------------------------------------------------------
;ダッシュ
[State -3, Run Fwd]
Type = ChangeState
Value = 100
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S && Ctrl
TriggerAll = IfElse((TeamMode = Simul), ((IfElse(NumPartner = 1, !Partner,Alive, 0)) && (NumEnemy = 2 && (!EnemyNear,Alive || !EnemyNear(1),Alive))), 1)
Trigger1 = NumProjID(35030)	;千年眼
Trigger1 = P2MoveType = H
Trigger2 = BackEdgeBodyDist < 60
Trigger2 = P2MoveType != H
Trigger2 = P2BodyDist X < 30
Trigger2 = P2BodyDist Y < -120
Trigger2 = Random < 60 * Var(59)
;Trigger3 = Power < 1000
Trigger3 = P2StateType != A && P2StateType != L
Trigger3 = P2MoveType = H && P2StateNo != [120, 155]
Trigger3 = P2BodyDist X > 90
Trigger3 = Random < 10 * Var(59)*Var(59)
;Trigger4 = Power < 1000
Trigger4 = NumProjID(10053) || NumProjID(10050) || NumProjID(10051)
Trigger4 = P2BodyDist X > 160
Trigger4 = Random < 70 * Var(59)

;---------------------------------------------------------------------------
;後退ダッシュ
[State -3, Run Back]
Type = ChangeState
Value = 105
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S && Ctrl
Trigger1 = BackEdgeBodyDist > 60
Trigger1 = Var(5) = 0
Trigger1 = Power >= 3000
Trigger1 = P2BodyDist X = [0,200]
Trigger1 = Random < 80 * Var(59)
Trigger2 = BackEdgeBodyDist > 60
Trigger2 = !NumProjID(10053) && !NumProjID(10050) && !NumProjID(10051)
Trigger2 = P2StateType != A && P2MoveType != H
Trigger2 = P2BodyDist X < 200
Trigger2 = Random < 70 * Var(59)
Trigger3 = BackEdgeBodyDist > 60
Trigger3 = P2StateType = L || P2StateNo = 5120
Trigger3 = Random < 60 * Var(59)
Trigger4 = Var(5) > 0
Trigger4 = Var(6) = 0
Trigger4 = P2BodyDist X < 200
Trigger4 = BackEdgeBodyDist > 60
Trigger4 = Random < 91 * Var(59)


;===========================================================================
;---------------------------------------------------------------------------
;緊急回避
[State -3, 前避け]
Type = ChangeState
Value = 2200
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S && Ctrl
Trigger1 = BackEdgeBodyDist < 50
Trigger1 = P2BodyDist X = [0, 50]
Trigger1 = P2MoveType != H
Trigger1 = Random < 10 * Var(59)*Var(59)

;---------------------------------------------------------------------------
[State -3, 後避け]
Type = ChangeState
Value = 2250
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S && Ctrl
TriggerAll = Random < 10 * Var(59)*Var(59)
TriggerAll = BackEdgeBodyDist > 50
Trigger1 = InGuardDist || P2MoveType = A || (P2BodyDist X < 40 && StateNo = 200 && !MoveContact)
Trigger1 = IfElse((Var(59) > 10), 1, (Time > (10 + (Random = [0,40]))))

;-------------------------------
;アドバンシングガードもどき。
;普通のガードですでにエフェクト使ってるんで、ガードアニメを変えることでわかりやすくする。
[State -3,ADVGUARD ST]
Type = ChangeState
Value = 160;guard.cnsに詳細。
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = S
TriggerAll = StateNo = [150,153];まぁ、通常であれば１５０になるんだろうけど
Trigger1 = P2BodyDist X < 100
Trigger1 = Random < 30 * Var(59)

[State -3,ADVGUARD CR]
Type = ChangeState
Value = 161;guard.cnsに詳細。
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = C
TriggerAll = StateNo = [151,153];
Trigger1 = P2BodyDist X < 100
Trigger1 = Random < 30 * Var(59)

[State -3,ADVGUARD AIR]
Type = ChangeState
Value = 162;guard.cnsに詳細。
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType = A
TriggerAll = Random < 30 * Var(59)
Trigger1 = StateNo = 154;
Trigger1 = P2BodyDist X < 100
Trigger2 = StateNo = 154 && PrevStateNo != 162
Trigger2 = P2BodyDist X < 50
Trigger2 = Time < 15

;===========================================================================
;---------------------------------------------------------------------------
;挑発
;「フン、無駄なあがきを・・・」
[State -3, Taunt]
Type = ChangeState
Value = 195
TriggerAll = Var(59) && RoundState = 2
TriggerAll = StateType != A
TriggerAll = Ctrl
Trigger1 = P2BodyDist X > 140
Trigger1 = (Life - P2Life) > 700
Trigger1 = Random < (Life - P2Life - 700)

;===========================================================================
;---------------------------------------------------------------------------
;勝利
[State -3, Win]
Type = ChangeState
Value = 99999
TriggerAll = Var(59) < -10 && Win
;一部勝利ポーズで致命的問題が発生する予感。すみませんが設定変更してます
;ヴェノム魔理沙フィニッシュとか、テーレッテーとか
;以下、特殊勝利ポーズの数だけ追加していく方針で
TriggerAll = var(5) != 3;ヴェノム魔理沙
TriggerAll = Stateno != [70001,70099];テーレッテー
Trigger1 = StateType != A
Trigger1 = Ctrl
Trigger1 = NumHelper(99998) > 0
Trigger1 = Helper(99998),Var(59) = 0

;===========================================================================
;---------------------------------------------------------------------------
;汎用ヘルパー
[State -3, ヘルパー召喚]
type = Helper
TriggerAll = !NumHelper(99998)
TriggerAll = Var(59) != 0
Trigger1 = RoundsExisted = 0
Trigger2 = Var(59) < 0
stateno = 99998
ID = 99998
Name = "ConvenienceHelper"
pos = 0,0
postype = p1
ownpal = 1
keyctrl = 1
persistent = 0
ignorehitpause = 0
pausemovetime = 99999999
supermovetime = 99999999

;===========================================================================
;---------------------------------------------------------------------------
;AI用ステート
;勝利ポーズ
[StateDef 99999]
Type     = S
MoveType = I
Physics  = S
Ctrl     = 0
sprpriority = 6
Anim = 99999;ひゅう、ちっちっち
velset = 0,0

[State 99999, Voice]
type = playsnd
triggerall = var(40);ボイスＯＫ
trigger1 = animelemTime(1) = 0
value = 195,0;ひゅう
channel = 0;VC

[State 99999, Voice]
type = playsnd
triggerall = var(40);ボイスＯＫ
trigger1 = animelemTime(3) = 0
trigger2 = animelemTime(4) = 0
trigger3 = animelemTime(5) = 0
trigger4 = animelemTime(6) = 0
trigger5 = animelemTime(7) = 0
trigger6 = animelemTime(8) = 0
value = 195,1;ちっちっち
channel = 0;VC

[State 99999, End]
type = ChangeState
trigger1 = animtime = 0;Time > 90
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;ヘルパーステート
[StateDef 99998]
physics  = N
sprpriority = -1
movehitpersist = 1
Ctrl = 0

[State 99998, 消す]
type = DestroySelf
trigger1 = Var(59) = -1

;通常時の相手のヘルパー数を記憶
[State 99998, Enemy,NumHelper]
Type = VarSet
Trigger1 = EnemyNear,StateNo != Var(2)
Trigger1 = Var(1) = 0
Trigger2 = Enemy,NumHelper < Var(0)
Trigger3 = RoundState != 2
V = 0
Value = Enemy,NumHelper

;通常時誤認防止タイマー
[State 99998, EnemyHelperTimer]
Type = VarSet
Trigger1 = EnemyNear,StateNo = Var(2)
V = 1
Value = 120

[State 99998, EnemyHelperTimer]
Type = VarAdd
Trigger1 = EnemyNear,StateNo != Var(2)
Trigger1 = Var(1) > 0
V = 1
Value = -1

;----------------------------------------------------------------------------
;相手がヘルパー攻撃を繰り出した
[State 99998, EnemyAttack Helper]
Type = VarSet
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,NumHelper > Var(3)
V = 2
Value = EnemyNear,StateNo

[State 99998, Enemy NumHelper]
Type = VarSet
Trigger1 = 1
V = 3
Value = Enemy,NumHelper

;----------------------------------------------------------------------------
[State 99999, AI起動しようか]
Type = VarSet
Trigger1  = !(Command = "a")     && Root,Command = "a"
Trigger2  = !(Command = "b")     && Root,Command = "b"
Trigger3  = !(Command = "c")     && Root,Command = "c"
Trigger4  = !(Command = "x")     && Root,Command = "x"
Trigger5  = !(Command = "y")     && Root,Command = "y"
Trigger6  = !(Command = "z")     && Root,Command = "z"
Trigger7  = !(Command = "start") && Root,Command = "start"
Trigger8  = !(Command = "up")    && Root,Command = "up"
Trigger8  = RoundState = 2 && Root,Ctrl
Trigger9  = !(Command = "down")  && Root,Command = "down"
Trigger9  = RoundState = 2 && Root,Ctrl
Trigger10 = !(Command = "back")  && Root,Command = "back"
Trigger10 = RoundState = 2 && Root,Ctrl
Trigger11 = !(Command = "fwd")   && Root,Command = "fwd"
Trigger11 = RoundState = 2 && Root,Ctrl
V = 59
Value = 1

;----------------------------------------------------------------------------
[State 99999, プレイヤー判定]
Type = VarSet
TriggerAll = Var(59) != 1
Trigger1  = Command = "a"     && Root,Command = "a"
Trigger2  = Command = "b"     && Root,Command = "b"
Trigger3  = Command = "c"     && Root,Command = "c"
Trigger4  = Command = "x"     && Root,Command = "x"
Trigger5  = Command = "y"     && Root,Command = "y"
Trigger6  = Command = "z"     && Root,Command = "z"
Trigger7  = Command = "start" && Root,Command = "start"
Trigger8  = Command = "up"    && Root,Command = "up"
Trigger9  = Command = "down"  && Root,Command = "down"
Trigger10 = Command = "back"  && Root,Command = "back"
Trigger11 = Command = "fwd"   && Root,Command = "fwd"
V = 59
Value = -1

[State 99998, 無敵]
type = NotHitBy
trigger1 = 1
value = SCA

[State 99998, 不可視]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 99998, 自分についてく]
type = BindToRoot
trigger1 = 1

[State 99998, 同じアニメ]
type = ChangeAnim
trigger1 = 1
value = parent,Anim
elem = parent,AnimElemNo(0)

[State 99998, 本体と同じ方向]
type = Turn
trigger1 = Facing != Parent,Facing
