;-2 -3のステートをまとめておく。
;--------------------------------
[Statedef -2];それなり監視ステート

;ダメージ台詞
[State -2,DamegeVoice1]
type = PlaySnd
triggerall = var(40);ボイスＯＫ
triggerall = Alive
triggerall = Random < 400
triggerall = Time = 1
triggerall = movetype = H
triggerall = PrevStateno != [5000,5030]
trigger1 = anim = [5000,5030];何か条件あれば足す
value = 1,11;
channel = 0;VC

;簡易攻撃力補正
[State Attackfv]
type = varset
trigger1 = Numtarget
trigger1 = Target,Gethitvar(hitcount) >= 1
;fvar(10) = 1.0/(Target,Gethitvar(hitcount)+1)
fvar(10) = 1.0-(Target,Gethitvar(hitcount)/50.0)
ignorehitpause=1
;一部技で補正ウン倍
[State Attackfv]
type = varset
triggerall = Numtarget
triggerall = Target,Gethitvar(hitcount) >= 1
trigger1 = Stateno = [3045,3049];ブレイジング
trigger1 = Target,Gethitvar(hitcount) > 6
;fvar(10) = 1.0/(Target,Gethitvar(hitcount)+1)
fvar(10) = 1.0-(Target,Gethitvar(hitcount)/15.0)
ignorehitpause=1
;ブレイジングの特殊な事情
[State Attackfv]
type = varset
triggerall = Numtarget
triggerall = Target,Gethitvar(hitcount) >= 1
trigger1 = Stateno = [3045,3049];ブレイジング
trigger1 = var(5) = 24;メイ道装備中に発動した場合＝本来MAXでしか使えないが特殊条件で発動した
fvar(10) = 0.6
ignorehitpause=1
;ヴァリアブル中補正
[State Attackfv]
type = varset
trigger1 = Stateno = [3050,3099];まりす砲など
trigger1 = Numtarget
trigger1 = Target,Gethitvar(hitcount) >= 1
;fvar(10) = 1.0/(Target,Gethitvar(hitcount)+1)
fvar(10) = 1.0-(Target,Gethitvar(hitcount)/180.0)
ignorehitpause=1
;カイザー
[State Attackfv]
type = varset
trigger1 = Stateno = [35311,35312]
trigger1 = var(15) > 100
trigger1 = Numtarget
trigger1 = Target,Gethitvar(hitcount) >= 1
;fvar(10) = 1.0-(Target,Gethitvar(hitcount)/180.0)
fvar(10) = 1.0-(Target,Gethitvar(hitcount)/30.0)
[State Attackfv]
type = varset
trigger1 = Stateno = [35311,35312]
trigger1 = var(15) >= 200
trigger1 = Numtarget
trigger1 = Target,Gethitvar(hitcount) >= 1
;fvar(10) = 1.0-(Target,Gethitvar(hitcount)/180.0)
fvar(10) = 1.0-(Target,Gethitvar(hitcount)/90.0)
ignorehitpause=1
;エリアルクレイモア
[State Attackfv]
type = varset
trigger1 = Stateno = [35426,35429]
trigger1 = Numtarget
trigger1 = Target,Gethitvar(hitcount) >= 1
fvar(10) = 1.0-(Target,Gethitvar(hitcount)/130.0)
;補正無し
[State Attackfv]
type = varset
trigger1 = !Numtarget
fvar(10) = 1.0 ;* fvar(11)
ignorehitpause=1

;MAX時のガーキャンとかも実装する？
;パワーＭＡＸ時の補正
[State -2, ParamMAX]
type = AttackMulSet
triggerall = fvar(10) > 0;補正値０以上
trigger1 = Numhelper(10010)
trigger1 = var(5) = -1
trigger1 = var(6) > 0;var6がある
value = 1.5 * fvar(10)
ignorehitpause=1
[State -2, ParamMAX]
type = AttackMulSet
triggerall = fvar(10) <= 0;補正値０未満
trigger1 = Numhelper(10010)
trigger1 = var(5) = -1
trigger1 = var(6) > 0;var6がある
value = 0
ignorehitpause=1
;通常時の補正
[State -2, ParamNOR]
type = AttackMulSet
triggerall = fvar(10) > 0;補正値０以上
trigger1 = !Numhelper(10010)
trigger2 = var(5) != -1
;trigger1 = var(5) != -1
;trigger1 = var(6) = 0;
;trigger2 = var(5) = -1
;trigger2 = var(6) = 0;
value = 1.0 * fvar(10)
ignorehitpause=1
[State -2, ParamNOR]
type = AttackMulSet
triggerall = fvar(10) <= 0;補正値０未満
trigger1 = !Numhelper(10010)
trigger2 = var(5) != -1
;trigger1 = var(5) != -1
;trigger1 = var(6) = 0;
;trigger2 = var(5) = -1
;trigger2 = var(6) = 0;
value = 0
ignorehitpause=1
;げっと武器時の補正
[State -2, ParamNOR]
type = AttackMulSet
triggerall = fvar(10) > 0;補正値０以上
trigger1 = var(5) >= 1
value = 1.0 * fvar(10)
ignorehitpause=1
[State -2, ParamNOR]
type = AttackMulSet
triggerall = fvar(10) <= 0;補正値０未満
trigger1 = var(5) >= 1
value = 0
ignorehitpause=1

;通常時防御力
[State ArmDefNor]
type = DefenceMulSet
trigger1 = Stateno = 0
trigger1 = !numhelper(35185)
value = 1
;マスターブレード時防御補正＋死亡時のレーザー消去
[State RemLZ]
type = RemoveExplod
trigger1 = NumExplod(3090) && !alive
id = 3090;レーザーをけしとく
[State ArmDef]
type = DefenceMulSet
trigger1 = Stateno = 3094
value = 3.5
;残悔拳発動状態
[State ArmDef]
type = DefenceMulSet
trigger1 = numhelper(35185)
value = 8

;パワーＭＡＸ時の本体エフェクト
[State -2, 2nd Flash]
type = PalFX
trigger1 = var(5) = -1
trigger1 = var(6) > 0;var6がある
trigger1 = TimeMod = 4,0
time = 2
add = 128,128,80

;パワーＭＡＸ時のゲージ管理
[State -2,MAXGUAGETIME]
type = Varadd
trigger1 = var(5) = -1
trigger1 = var(6) >= 0;var6がある
trigger1 = Stateno != 3010;一部技演出中は停止させる
trigger1 = Stateno != 30410;一部技演出中は停止させる
var(6) = -4

;ゲージが0になったならすみやかに通常状態へ移行する
[State -2,WPNNORMAL]
type = Varset
trigger1 = var(5) = -1
trigger1 = var(6) <= 0;var6がありません
var(5) = 0

;バスターチャージ関連

;ぱわーちゃーじ
;[State -2, Reset Hits]
;type = VarSet
;triggerall = Command != "holdx"
;trigger1 = numproj != 0
;trigger2 = Var(2) > 0
;var(0) = 0

;[State -2, Charge X-Buster Hits]
;type = VarAdd
;triggerall = timemod = 50,10
;trigger1 = Command = "holdx"
;trigger1 = Var(2) = 0
;trigger1 = ctrl
;var(0) = 1

;[State -2, Charge Reset 1];りせっと状況その１
;type = VarSet
;triggerall = Command != "holdx"
;trigger1 = !ctrl ;コントロールできない状況で離したらリセットかかるようにする
;trigger1 = numproj != 0
;trigger2 = Var(2) > 0
;var(1) = 0

[State -2, Charge Reset 1];りせっと状況その１
type = VarSet
trigger1 = !var(59)
trigger1 = Command != "holdx" ;ボタンを離した状態
trigger1 = var(1) < 30 ;まだミドルチャージがはじまってないなら
trigger2 = var(59)	;AI時
trigger2 = var(39) = 0	;0 = ボタンを離した状態
trigger2 = var(1) < 30 ;まだミドルチャージがはじまってないなら
trigger3 = roundstate != 2;戦闘中以外
var(1) = 0

;var(39)を擬似ショットボタン("holdx"の代わり)として使っちゃってくれて結構です。
;チャージじゃない単発バスターのほうは、普通の記述でも大丈夫・・・？（まだ怪しいかもしれないです）
;こんな感じでしょうか
;[State Shot]
;type = varset
;trigger1 = ***
;var(39) = * ;0 or 1

[State -2, Charge Reset 1];りせっと状況その２・特定ステートの時など
type = VarSet
trigger1 = Stateno = [70001,70099];テーレッテー
trigger2 = Stateno = [3090,3095];マスターブレード
var(1) = 0

[State -2, Max Charge]
type = VarSet
trigger1 = Var(1) >= 400
var(1) = 400

[State -2, Charge Buster]
type = VarAdd
;triggerall = ctrl;動ける状態でないとたまりません。
triggerall = movetype != H;ダメージ中は溜まりません
trigger1 = !var(59)
trigger1 = Command = "holdx"
;ＡＩセット時の記述を書いてません。ＡＩ作成の時は状況に応じて追記してっていただければ。
trigger2 = var(59)	;AI時
trigger2 = var(39) = 1	;1 = ボタンを押した状態
var(1) = 1

[State -2, Remove Charge]
type = RemoveExplod
;trigger1 = !var(59)
;trigger1 = Command != "holdx"
trigger1 = var(1) < 30 ;まだミドルチャージがはじまってないなら
id = 30050

[State -2, Remove Charge]
type = RemoveExplod
;trigger1 = !var(59)
;trigger1 = Command != "holdx"
trigger1 = var(1) < 100 ;まだミドルチャージがはじまってないなら
id = 30051

[State -2, ChargeSTOP]
type = stopsnd
trigger1 = var(1) < 30;チャージ30未満のときはチャージ音をけす
channel=4;

;-------

[State -2, 1st Blue]
type = PalFX
triggerall = PalNo % 6 != 0;金カラー時は必要ない
triggerall = ctrl;動ける状態でないとたまりません。
triggerall = movetype != H;ダメージ中は溜まりません
triggerall = var(1) >= 30
triggerall = var(1) <= 100
trigger1 = TimeMod = 4,0
time = 2
add = 0,100,30

;ちゃーじ音
[State -2, 1st Charge]
type = playsnd
triggerall = var(1) = 30
;triggerall = var(1) >= 30
;triggerall = var(1) <= 33;31
;trigger1 = TimeMod = 4,0
trigger1 = 1
value = S0,10
channel=4;サウンド止め用テスト

;チャージアニメ。多分
[State -2, 1st Charge]
type = Explod
triggerall = PalNo % 6 != 0;金カラー時は必要ない
;triggerall = ctrl;動ける状態でないとたまりません。
triggerall = Stateno < 3000;動ける状態でないとたまりません。
trigger1 = var(1) >= 30
trigger1 = var(1) <= 100
trigger1 = !numexplod(30050)
trigger1 = ifelse(var(59),var(39),(Command = "holdx"))
;trigger1 = (stateno != [220,225])&&(stateno != [420,425])&&(stateno != [620,625]) 
;trigger1 = TimeMod = 1,0
anim = 30050
id = 30050
pos = 3,-45;0
bindtime = -1
;ownpal = 1
ontop = 5

[State -2, Remove Charge]
type = RemoveExplod
;trigger1 = command != "holdx"
;trigger2 = var(1) >= 100
trigger1 = !var(59)
trigger1 = Command != "holdx"
trigger2 = var(59)	;AI時
trigger2 = var(39) = 0	;
trigger3 = var(1) >= 100
trigger3 = Stateno >= 3000;!ctrl;動ける状態でないとたまりません。
trigger4 = var(1) < 100
trigger4 = movetype = H;ダメージ中は溜まりません
trigger5 = (stateno = [220,225])||(stateno = [420,425])||(stateno = [620,625]) 
id = 30050

;---
[State -2, 2nd Flash]
type = PalFX
triggerall = PalNo % 6 != 0;金カラー時は必要ない
triggerall = ctrl;動ける状態でないとたまりません。
triggerall = movetype != H;ダメージ中は溜まりません
triggerall = var(1) >= 100
triggerall = var(1) <= 300
trigger1 = TimeMod = 4,0
time = 2
add = 0,130,200


;チャージアニメ。多分
[State -2, 2nd Charge]
type = Explod
triggerall = PalNo % 6 != 0;金カラー時は必要ない
;triggerall = ctrl;動ける状態でないとたまりません。
triggerall = Stateno < 3000;動ける状態でないとたまりません。
trigger1 = var(1) >= 100
;trigger1 = var(1) <= 300
trigger1 = !numexplod(30051)
trigger1 = ifelse(var(59),var(39),(Command = "holdx"))
;trigger1 = (stateno != [220,225])&&(stateno != [420,425])&&(stateno != [620,625]) 
;trigger1 = TimeMod = 1,0
anim = 30051
id = 30051
pos = 3,-45;0
bindtime = -1
;ownpal = 1
ontop = 5

[State -2, Remove Charge]
type = RemoveExplod
;trigger1 = command != "holdx"
;trigger2 = var(1) = 300
trigger1 = !var(59)
trigger1 = Command != "holdx"
trigger2 = var(59)	;AI時
trigger2 = var(39) = 0	;
trigger3 = var(1) < 100
trigger3 = Stateno >= 3000;!ctrl;動ける状態でないとたまりません。
trigger4 = var(1) < 100
trigger4 = movetype = H;ダメージ中は溜まりません
trigger5 = (stateno = [220,225])||(stateno = [420,425])||(stateno = [620,625]) 
id = 30051;10012

;---
[State -2, 3rd Flash]
type = PalFX
triggerall = PalNo % 6 != 0;金カラー時は必要ない
triggerall = ctrl;動ける状態でないとたまりません。
triggerall = movetype != H;ダメージ中は溜まりません
triggerall = var(1) >= 250
trigger1 = TimeMod = 4,0
time = 2
add = 0,255,128

;[State -2, 3rd Charge]
;type = Explod
;triggerall = var(1) >= 300
;triggerall = numexplod = 0
;trigger1 = TimeMod = 1,0
;anim = 10012
;id = 10012
;pos = 0,0
;bindtime = -1
;ownpal = 1
;ontop = 5

[State -2, 3rd Charge]
type = playsnd
;triggerall = ctrl;動ける状態でないとたまりません。
triggerall = movetype != H;ダメージ中は溜まりません
triggerall = var(1) >= 247
triggerall = var(1) <= 250
trigger1 = TimeMod = 4,0
value = S0,33;S246, 3;フルチャージ音ヲせっと
channel=4;

[State -2, Final Flash]
type = null;PalFX
triggerall = PalNo % 6 != 0;金カラー時は必要ない
triggerall = ctrl;動ける状態でないとたまりません。
;triggerall = power >= 3000
triggerall = var(1) >= 250;400
;trigger1 = TimeMod = 4,0
;time = 2
;add = 250,250,250
;sinadd = 255,223,45
trigger1 = Time % 2;TimeMod = 2,0
trigger1 = (Time + 11) % 32 != 0;
time = 1;3
add = 256,256,256
mul = 128,64,256;256-((Time % 16)*8),256-(((Time + 11) % 32)*8),256-(((Time + 22) % 32)*8)
;sinadd = 0,0,256,20

;チャージアニメ。多分
[State -2, 2nd Charge]
type = Explod
triggerall = PalNo % 6 != 0;金カラー時は必要ない
;triggerall = ctrl;動ける状態でないとたまりません。
triggerall = Stateno < 3000;動ける状態でないとたまりません。
triggerall = var(1) >= 250
trigger1 = TimeMod = 4,0
trigger1 = !numexplod(30052)
trigger1 = ifelse(var(59),var(39),(Command = "holdx"))
;trigger1 = (stateno != [220,225])&&(stateno != [420,425])&&(stateno != [620,625]) 
;trigger1 = TimeMod = 1,0
anim = 30051
id = 30052
pos = 3,-45;0
bindtime = -1
facing = -1
scale = 1.2,1.2
;ownpal = 1
ontop = 5

[State -2, Remove Charge]
type = RemoveExplod
;trigger1 = command != "holdx"
;trigger2 = var(1) = 300
trigger1 = !var(59)
trigger1 = Command != "holdx"
trigger2 = var(59)	;AI時
trigger2 = var(39) = 0	;
trigger3 = var(1) < 100
trigger3 = Stateno >= 3000;!ctrl;動ける状態でないとたまりません。
trigger4 = var(1) < 100
trigger4 = movetype = H;ダメージ中は溜まりません
trigger5 = (stateno = [220,225])||(stateno = [420,425])||(stateno = [620,625]) 
id = 30052;10012

[State -2, Remove Charge]
type = RemoveExplod
;trigger1 = command != "holdx"
trigger1 = !var(59)
trigger1 = Command != "holdx"
trigger2 = var(59)	;AI時
trigger2 = var(39) = 0	;
trigger3 = Stateno >= 3000;!ctrl;動ける状態でないとたまりません。
trigger4 = movetype = H;ダメージ中は溜まりません
trigger5 = (stateno = [220,225])||(stateno = [420,425])||(stateno = [620,625]) 
id = 10012

;-----------------------------------
;チャージバスターガード時
[State 240, TargetState]
Type = TargetState
TriggerAll = NumTarget > 0
Trigger1 = ProjGuardedTime(3105) = 1
Value = 3107
Persistent = 0
IgnoreHitPause = 1

;---------------------
;決着時エフェクト
[State -2, Finish Explod KO]
type = Helper
triggerall = RoundState = 3;var(*) = 0
triggerall = !NumHelper(15000)
triggerall = var(5) != 27;IWBTG以外
trigger1 = winko;勝ったときか
trigger2 = loseko;まけたとき
helpertype = normal
name = "15000"
id = 15000
pos = -250,-260
bindtime = -1
postype = left
stateno = 15000;6010
keyctrl = 0
persistent = 0
ownpal = 1
pausemovetime = 999999999999999999999
supermovetime = 999999999999999999999
ignorehitpause = 1

[State remexp]
type = removeexplod
trigger1 = RoundState = 3;var(*) = 0
;trigger1 = NumHelper(15000)
;trigger1 = Helper(15000),time=0
id = 15060

;---------------------
;やられカットイン
[State YARARETA,BAKURA]
type = Helper
triggerall = !Alive && (NumHelper(6010) = 0)
triggerall = RoundState = [1,3]
triggerall = HitOver = 0;自分がやられている時に。
;triggerall = RoundState <= 3
;trigger1 = !Alive && (NumHelper(6010) = 0)
;trigger1 = RoundState <= 3
;triggerall = StateNo != 5150
;trigger1 = 1;実験用トリガー　コメアウト
trigger1 = enemynear,stateno = [3000,4999];3000番以降のステート攻撃で死んだ場合
trigger2 = enemynear,HitDefAttr = SCA,HA,HT,HP;HA,HTのステート攻撃で死んだ場合

trigger3 = enemynear,stateno = 2001 && enemynear,name = "Shadow DIO"
trigger4 = enemynear,stateno = 2012 && enemynear,name = "Shadow DIO"
trigger5 = enemynear,stateno = 3001 && enemynear,name = "Shadow DIO"
trigger6 = enemynear,stateno = 2206 && enemynear,name = "Shadow DIO"
trigger7 = enemynear,stateno = 2025 && enemynear,name = "Shadow DIO"
helpertype = normal
name = "6010"
id = (6010)
pos = -250,-260
bindtime = -1
postype = left
stateno = 6010
keyctrl = 0
persistent = 0
ownpal = 1
pausemovetime = 999999999999999999999
supermovetime = 999999999999999999999
ignorehitpause = 1

[State YARARETA,BAKURA SUIMU]
type = Helper
;triggerall = !Alive && (NumHelper(6011) = 0)
triggerall = RoundState <= 3
trigger1 = enemynear,name="Marisa Kirisame";相手が本家魔理沙だった場合
trigger1 = (NumHelper(6011) = 0); && winko
trigger1 = enemynear,stateno = 1253
;レーザーオブアイリスの破壊は1253-4
helpertype = normal
name = "6010-1"
id = (6011)
pos = -250,-260
bindtime = -1
postype = left
stateno = 6011
keyctrl = 0
persistent = 0
ownpal = 1
pausemovetime = 999999999999999999999
supermovetime = 999999999999999999999
ignorehitpause = 1

;***********************************************
;愛乃シン用
;***********************************************
[State KING]
type = null;changestate
triggerall = numpartner > 0;タッグ
triggerall = statetype != A;地上
triggerall = ctrl;動ける
trigger1 = partner,name = "Shin"
trigger1 = partner,Authorname = "Ahuron"
trigger1 = partner,stateno = 2506
trigger1 = stateno != [7600,7699]
value = 7600


;***********************************************
;逃げるんだよォォォーーーーーーッ
;***********************************************

;魔理沙では絶対に勝利できない相手（あるいは特定の相手）だと確認した場合、戦略的撤退を行う

[State ,逃げるんだよォォォ]
type = changeState
triggerall = Roundstate > 1
triggerall = !Alive
trigger1 = var(45) = [8,9]
trigger2 = var(45) >= 5
value = 5150
persistent = 0

[State ,逃げるんだよォォォ]
type = PlayerPush
trigger1 = var(45) >= 5
value = 0

[State ,不思議な柱状の物体]
type = Helper
triggerall = !numhelper(75010)
trigger1 = var(45) = -3
id = 75010
name = "Twitter"
sprpriority = 10
Pos = 0,0
PosType = left;p1
stateno = 75010
helpertype = normal
pausemovetime = 99999999999999
supermovetime = 99999999999999
bindtime = -1
keyctrl = 0 
ownpal = 1
persistent = 0
[State ,逃げるんだよォォォ]
type = changeState
triggerall = Statetype != A
triggerall = Roundstate = 2
triggerall = ctrl
triggerall = stateno != [75000,75009]
triggerall = stateno != 5150
trigger1 = var(45) >= 5
value = 75000
persistent = 0

;アクセルフォーム----------------
;アクセルフォーム加速状態の制御。
;案１
[State Pause];
type = null;Pause;
trigger1 = gametime%4 = 0
trigger1 = var(5) = -2;アクセルモードで
trigger1 = var(6) > 0;var6がある
time = 2
movetime = 2
;案２
[State Pause];
type = Pause;
trigger1 = gametime%8 = 0
trigger1 = var(5) = -2;アクセルモードで
trigger1 = var(6) > 0;var6がある
time = 4
movetime = 4
;残像
[State Axel]
Type        = AfterImage
triggerall = var(5) = -2;アクセルモードで
triggerall = var(6) > 0;var6がある
trigger1 = prevstateno != 20
trigger1 = prevstateno != [50,52]
trigger1 = time = 1
Time        = -1
Trans       = Add
Length      = 20
TimeGap     = 1
FrameFap    = 1
PalBright   = 10,10,10;0  , 0  , 0
PalContrast = 0,220,40;0  , 0  , 150
;PalAdd      = 0  , 0  , 0
;PalMul      = .5 , .5 , .5
;攻撃力補正
[State -2, ParamAXEL]
type = AttackMulSet
trigger1 = Numhelper(10010)
trigger1 = var(5) = -2;Axel
trigger1 = var(6) >= 0;var6がある
value = .6
;ゲージ減少
[State -2,AXELGUAGETIME]
type = Varadd
trigger1 = var(5) = -2;あくせる
trigger1 = var(6) >= 0;var6がある
trigger1 = movetype != A;攻撃中でない
trigger1 = Stateno != 3010;一部技演出中は停止させる
var(6) = -6
;ゲージ減少２・攻撃時は更に減少
[State -2,AXELGUAGETIME]
type = Varadd
trigger1 = var(5) = -2;あくせる
trigger1 = var(6) >= 0;var6がある
trigger1 = movetype = A;攻撃中でない
trigger1 = Stateno != 3010;一部技演出中は停止させる
var(6) = -12

;発動中の背景
;ゲージヘルパーでやっとく
[State -2,AxelBG]
type = null;BGPalFX;この処理はゲージヘルパーに移動しますた　詳しくは「SasugaFightingROBERT.st」にて
trigger1 = var(5) = -2;あくせる
trigger1 = gameTime % 2 = 0;TimeMod = 2,0
time = 2;目にやさしくしたい時は値を２にした上で下の魔砲虹のownpalを０にしてください
add = 128,128,128
;mul = 128,64,256;256-((Time % 16)*8),256-(((Time + 11) % 32)*8),256-(((Time + 22) % 32)*8)
;color = 0;グレースケール
color = 96;色彩うすめに。

;タイムあうと
[State -2,AxelTimeOut]
type = changestate
trigger1 = ctrl
trigger1 = Stateno != 30415
trigger1 = pos Y >= 0;地上
trigger1 = statetype != A;空中じゃない
trigger1 = var(5) = -2;あくせる
trigger1 = var(6) <= 0;var6がじかんぎれ
value = 30415

;IWBTG-------------------------------
;何かに当たったら自滅。触っても自滅。

[state IWBTG]
type = hitoverride
triggerall = Roundstate = 2
trigger1 = !IsHelper;本体専用
trigger1 = alive;生存
trigger1 = stateno != 35270;
trigger1 = prevstateno != 35270;
trigger1 = var(5) = 27;IWBTG
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 35270
[State IWBTG];
type = changestate
triggerall = Roundstate = 2
trigger1 = !IsHelper;本体専用
trigger1 = alive;生存
trigger1 = stateno != 35270;
trigger1 = prevstateno != 35270;
trigger1 = var(5) = 27;IWBTG
trigger1 = abs(p2bodydist x) < 10
trigger1 = abs(p2bodydist y) < 10
value = 35270
[State IWBTG];
type = changestate
triggerall = Roundstate = 3
trigger1 = !IsHelper;本体専用
trigger1 = !alive;死亡
trigger1 = stateno != 35270;
trigger1 = prevstateno != 35270;
trigger1 = var(5) = 27;IWBTG
value = 35270
[State IWBTG];
type = poweradd
trigger1 = !IsHelper;本体専用
trigger1 = !alive;死亡
trigger1 = stateno = 5150;死亡ステート
trigger1 = var(5) = 27;IWBTG
value = 9999

;北斗七星------------------------
;あふろん氏のを参考に、4000番で管理する。詳しくはtehletteh.stにて
[State NorthStarGuage]
type = Helper
triggerall = !numhelper(4000)
;trigger1 = TeamMode = single
;trigger2 = TeamMode = turns
trigger1 = 1;無条件で。ゲージ表示はヘルパーまかせに
id = 4000
name = "NorthStarGuage"
sprpriority = 10
Pos = 0,0
PosType = left;p1
stateno = 4000
helpertype = normal
pausemovetime = 0
bindtime = -1
keyctrl = 0 
ownpal = 1

[State Star]
type = varset
trigger1 = var(41) <= 0
var(41) = 0

[State Star]
type = varset
trigger1 = var(41) >= 8
var(41) = 8


;--------------------------------
;ストライカー関連
[State -2,Alice]
type = varadd
trigger1 = var(30) > 0;カウンターが０になってない
var(30) = -1
[State -2,Spilitia]
type = varadd
trigger1 = var(31) > 0;カウンターが０になってない
var(31) = -1
[State -2,Patche]
type = varadd
trigger1 = var(32) > 0;カウンターが０になってない
var(32) = -1

;パートナーがアリス・Ｒの場合
[State -2,Alice]
type = varadd
triggerall = NumPartner > 0;パートナーが存在
triggerall = partner,name = "Alice-R";ありすだったなら
trigger1 = var(30) < -1;カウンターが-1になってない
var(30) = 1
[State -2,Alice]
type = varset
triggerall = NumPartner > 0;パートナーが存在
triggerall = partner,name = "Alice-R";ありすだったなら
trigger1 = partner,stateno = 215;特殊技
;trigger1 = partner,time = 0
var(30) = -300
;--------------------------------
;[Statedef -3];常時監視ステート


[State GuageON]
type = Helper
Trigger1 = var(5) != 0;武器をそうびしている状態なら
trigger1 = !Numhelper(10010)
ID = 10010
Name = "SubPower Guage"
Pos = 0,0
PosType = left;p1
StateNo = 10010
helpertype = Normal
Keyctrl = 0
ownpal = 1
pausemovetime = 99999999999999
supermovetime = 99999999999999
facing = 1

[State -3, State];てぃうんてぃうん
type = SelfState
;triggerall = Var(20) >= 0
trigger1 = MatchOver 
trigger1 = TeamMode = single
trigger2 = TeamMode = simul;まっちおーばーか、シングル以外か
trigger3 = TeamMode = turns
;triggerall = StateNo < 5150 || StateNo >= 5160
triggerall = !var(4);ティウンは一回だけでいい。その制御フラグ
triggerall = !Alive
triggerall = var(5) != 27;IWBTG以外
value = 5151
[State -3, State];てぃうんてぃうん
type = Assertspecial
trigger1 = numexplod(6800);ティウンな○が出た辞典でinvをかける。消えた頃には5150に飛んでいる
flag = invisible

[State *,*];BGMストップ
type = AssertSpecial
trigger1 = MatchOver 
trigger1 = TeamMode = single
;trigger2 = LoseKO
;trigger2 = TeamMode = simul;まっちおーばーか、シングル以外か
;trigger3 = TeamMode = turns;このモードでは毎回ティウン
;triggerall = StateNo < 5150 || StateNo >= 5160
triggerall = !Alive
flag = nomusic
ignorehitpause = 1

[State PowRESET]
type = VarSet
trigger1 = var(4);ティウンしたなら発動
v = 1
value = 0

;うおおおおっ、ぐふぁっ
;[State -3, State]
;type = Playsnd
;triggerall = Time <= 1
;triggerall = !MatchOver
;trigger1 = !Alive
;value = 1,14;うおおおおっぐふぁ
;channel=0;VC
;persistent = 0

[state -2,kabegekitotz]
type = explod
;triggerall = var(42)
triggerall = Var(0);特定の攻撃でVar0が立っている時出す
triggerall = enemy,stateno != [120,159]
triggerall = enemynear, stateno != 5040
triggerall = !numexplod(6016);Timemod = 5,0;
trigger1 = numtarget
trigger1 = enemynear,movetype = h
trigger1 = enemynear,backedgedist <= 15
trigger1 = enemynear,statetype = a
trigger1 = enemynear,vel x < 0
anim = 4033;3010;6016
;pos = (enemy,const(size.mid.pos.x))-20,(target,const(size.mid.pos.y))
pos = (enemy,const(size.mid.pos.x))-20,(target,const(size.mid.pos.y))
postype = p2
sprpriority = 3
bindtime = 1
facing = -1
removetime = -2
id = 6016
shadow = -1
ownpal = 1

;[State -3,STOPBGM];BGMストップ
;type = AssertSpecial
;triggerall = Win
;trigger1 = var(20) = 1;BGMが流れ出したなら
;flag = nomusic
;これはヘルパーで制御したほうが良い模様である
[State -3,STOPBGM HELPER]
type = Helper
trigger1 = var(20) = 1;var20がオンになったら
trigger1 = !Numhelper(37000);かぶってないか確認
ID = 37000
Name = "STOPBGM HELPER"
Pos = 0,0
PosType = left;p1
StateNo = 37000
helpertype = Normal
Keyctrl = 0
ownpal = 1
pausemovetime = 99999999999999
supermovetime = 99999999999999
facing = 1

[State *,*];KO/BGMストップ・自前BGM 1
type = StopSnd
trigger1 = MatchOver 
trigger1 = TeamMode = single
;trigger2 = LoseKO
;trigger2 = TeamMode = simul;まっちおーばーか、シングル以外か
trigger3 = TeamMode = turns;このモードでは毎回ティウン
;triggerall = StateNo < 5150 || StateNo >= 5160
triggerall = !Alive
channel = 2;BGM

[State *,*];KO/BGMストップ・自前BGM 2
type = StopSnd
triggerall = RoundState = 3;var(*) = 0
trigger1 = Stateno = [35000,35999];特殊武器フィニッシュ
trigger1 = winko;勝ったときか
trigger2 = loseko;まけたとき
channel = 2;BGM


;ケンシロウ　8804 トキ　8804 ジャギ　8803 ラオウ　8804 ドロウィン北斗キャラ
;シン　2501　レイ　2502　サウザー　2502　アフロン北斗キャラ

[State *,*];BGMストップ・他のキャラのBGMが再生された時　自前BGM側　直近キャラ
type = varset
trigger1 = (Enemynear,name = "MegaMari")
trigger1 = (Enemynear,Stateno = 3502)
trigger2 = (Enemynear,authorname = "Drowin hokuto");ドロウィン北斗
trigger2 = (Enemynear,Stateno = [8803,8804])
trigger3 = (Enemynear,authorname = "ahuron");アフロン北斗
trigger3 = (Enemynear,name = "SHIN")||(Enemynear,name = "REI")||(Enemynear,name = "THOUTHER")
trigger3 = (Enemynear,Stateno = [2501,2502])
var(20) = 0

[State *,*];BGMストップ・他のキャラのBGMが再生された時　自前BGM側　もう一体のキャラ
type = varset
triggerall = NumEnemy >= 2;敵が複数の場合
trigger1 = (Enemynear(1),name = "MegaMari")
trigger1 = (Enemynear(1),Stateno = 3502)
trigger2 = (Enemynear(1),authorname = "Drowin hokuto")
trigger2 = (Enemynear(1),Stateno = [8803,8804])
trigger3 = (Enemynear(1),authorname = "ahuron");アフロン北斗
trigger3 = (Enemynear(1),name = "SHIN")||(Enemynear(1),name = "REI")||(Enemynear(1),name = "THOUTHER")
trigger3 = (Enemynear(1),Stateno = [2501,2502])
var(20) = 0

[State *,*];BGMストップ・他のキャラのBGMが再生された時　自前BGM側　パートナーキャラ
type = varset
;triggerall = Teammode = simul;simulの場合
triggerall = NumPartner ;パートナーがいます　Teammodeでの判定は推奨されない？
trigger1 = (partner,name = "MegaMari")
trigger1 = (partner,Stateno = 3502)
trigger2 = (partner,authorname = "Drowin hokuto")
trigger2 = (partner,Stateno = [8803,8804])
trigger3 = (partner,authorname = "ahuron");アフロン北斗
trigger3 = (partner,name = "SHIN")||(partner,name = "REI")||(partner,name = "THOUTHER")
trigger3 = (partner,Stateno = [2501,2502])
var(20) = 0

[State *,*];BGMストップ・他のキャラのBGMが再生された時　共通処理　var20が解除されたなら止めれ
type = StopSnd
trigger1 = var(20) = 0
channel = 2;BGM

;ハンマー状態
[State HAMMER]
type = ChangeState
trigger1 = RoundState = 2
trigger1 = Statetype = S;立ち
trigger1 = ctrl
trigger1 = var(5) = 32;はんまーである
value = 35320;移行せよ

;ＵＦＯ
[State UFO]
type = ChangeState
trigger1 = RoundState = 2
trigger1 = Statetype = S;立ち
trigger1 = ctrl
trigger1 = var(5) = 39;ＵＦＯである
value = 35390;移行せよ

;弾幕吸収
[State ABSORB]
type = Helper
triggerall = !numhelper(65340)
triggerall = RoundState = 2
triggerall = Statetype = S;立ち
triggerall = ctrl
trigger1 = var(5) = 34;マスターグレネイド
ID = 65340
Name = "ABSORB"
Pos = 0,0
PosType = left;p1
StateNo = 65340
helpertype = Normal
Keyctrl = 0
ownpal = 1
pausemovetime = 99999999999999
supermovetime = 99999999999999
facing = 1
[State muteki];特定状態で飛び道具完全無敵
type = nothitby
triggerall = numhelper(65340)
trigger1 = Stateno = [100,105]
trigger2 = Stateno = [40,50]
trigger3 = Stateno = [2200,2220]
trigger4 = Stateno = [2250,2270]
value = ,NP,SP,HP
time = 2
;パワーＭＡＸ時の本体エフェクト
[State -2, 2nd Flash]
type = PalFX
triggerall = numhelper(65340)
trigger1 = TimeMod = 4,0
time = 2
add = (helper(65340),var(0)),(helper(65340),var(0)),(helper(65340),var(0))/2


;オーノーアナルパワー
[State OH NO!!]
type = ChangeState
trigger1 = Stateno = 0;立ちステートである
trigger1 = var(5) > 0;武器装備中である
trigger1 = var(6) <= 0;エネルギー切れである
value = 36000;移行せよ

;アバレッタ対策
;[State A-Bulleta_Override]
;type = changeanim
;triggerall = time = 1
;triggerall = var(40) = 1
;triggerall = movetype= h
;trigger1 = anim = 5000+(200*var(40))+ gethitvar(animtype)
;value = 5000+ gethitvar(animtype)
;[State A-Bulleta_Override]
;type = changeanim
;triggerall = time = 1
;triggerall = var(40) = 1
;triggerall = movetype= h
;trigger1 = anim = 5010+(200*var(40))+ gethitvar(animtype)
;value = 5010+ gethitvar(animtype)
;[State A-Bulleta_Override]
;type = changeanim
;triggerall = time = 1
;triggerall = var(40) = 1
;triggerall = movetype= h
;trigger1 = anim = 5030+(200*var(40))
;value = 5030
[State A-Bulleta_Override]
type = changeanim
triggerall = time = 1
triggerall = var(40) = 1
triggerall = (enemynear,name = "Bulleta SXP")||(enemynear,authorname="Beximus")
triggerall = stateno = [9000,9099]
triggerall = movetype= h
trigger1 = anim = [5200,5299]
value = anim-200
;アバレッタここまで

[State 5150, 8]
type = NotHitBy
trigger1 = var(45) >= 5
value2 = SCA
time = 1

[State Clip];何か参照したいときに手軽に使う
;type = AppendToClipboard
type = DisplayToClipboard
trigger1 = 1
text = "\n    15 = %d"
params = var(15)



;===========================================================================
;---------------------------------------------------------------------------
;自重しない12Pカラー
[State -2, 攻撃力]
type = AttackMulSet
TriggerAll = RoundState = 2
Trigger1 = PalNo % 6 = 0
Trigger1 = Var(5) = -1
value = 1.5

[State -2, 防御力]
type = DefenceMulSet
TriggerAll = RoundState = 2
Trigger1 = PalNo % 6 = 0
Trigger1 = Var(5) != -1
value = 0.5

[State -2, 防御力]
type = DefenceMulSet
TriggerAll = RoundState = 2
Trigger1 = PalNo % 6 = 0
Trigger1 = Var(5) = -1
value = 0.1

[State -2, 回復]
Type = LifeAdd
TriggerAll = RoundState = 2
TriggerAll = Alive
Trigger1 = PalNo % 6 = 0
Trigger1 = GameTime % 6 = 0
Value = 1
IgnoreHitPause

[State -2, ゲージ]
Type = PowerAdd
TriggerAll = RoundState = 2
TriggerAll = Alive
Trigger1 = PalNo % 6 = 0
Trigger1 = Var(5) != -1
Value = 1
IgnoreHitPause

[State -2, ゲージ]
Type = PowerSet
TriggerAll = RoundState = 2
TriggerAll = Alive
Trigger1 = PalNo % 6 = 0
Trigger1 = Var(5) = -1
Value = PowerMax
IgnoreHitPause

[State -2, チャージ]
type = VarSet
TriggerAll = RoundState = 2
trigger1 = PalNo % 6 = 0
var(1) = 400

[State -2, 死兆星]
type = null;VarSet
Trigger1 = RoundState = 2
trigger1 = PalNo % 6 = 0
Trigger1 = Var(5) = -1
;Trigger2 = 1
var(41) = 7
[State -2, 死兆星]
type = VarSet
Trigger1 = RoundState = 2
trigger1 = p2name = "cubee" || p4name = "cubee"
;Trigger2 = 1
var(41) = 7
[State -2, 死兆星]
type = powerset
Trigger1 = RoundState = 2
trigger1 = p2name = "cubee" || p4name = "cubee"
value = 99999999

[State -2, アリスタイマー]
type = VarSet
TriggerAll = RoundState = 2
trigger1 = PalNo % 6 = 0
var(30) = 0

[State -2, スピリティアタイマー]
type = VarSet
TriggerAll = RoundState = 2
trigger1 = PalNo % 6 = 0
var(31) = 0

[State -2, パチュリータイマー]
type = VarSet
TriggerAll = RoundState = 2
trigger1 = PalNo % 6 = 0
var(32) = 0

[State -2]
type = assertspecial
triggerall = 0;numhelper(80000) = 1 ;アーマーヘルパー出てるとき限定
trigger1 = movetype = H; || Helper(80000),var(10) != gametime 
flag = noko
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

[State -2];ステート奪いでは倒せないように。
type = lifeSet
triggerall = 0;roundstate = 2
trigger1 = numhelper(80000) = 1 ;アーマーヘルパー出てるとき限定
trigger1 = movetype = H; || Helper(80000),var(10) != gametime
value = LifeMax
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

[State -2, アーマー用]
type = NotHitBy
trigger1 = 0;palno = 12
value2 = SCA
time = -1
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2, ハイパーアーマー]
type = Helper
TriggerAll = 0;PalNo % 6 = 0
triggerall = !NumHelper(80000)
trigger1 = roundstate = 2
stateno = 80000
ID = 80000
pos = 0,0
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2, ダメージ]
type = LifeAdd
triggerall = 0;roundstate = 2
triggerall = NumHelper(80000)
TriggerAll = !IsHelper
trigger1 = stateno != [120,155]
trigger1 = palno = 12
trigger1 = Helper(80000),Var(0) = 0
trigger1 = Helper(80000),GetHitVar(Damage) = [1, 700]
value = -(Helper(80000),GetHitVar(Damage) / ((LifeMax - Life) / 100 + 1 ))

