;---------------------------------------------------------------------------
; ここは-2のステートを書いてください、ヘルパー関係です
;---------------------------------------------------------------------------
[Statedef -2]


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

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

[State -2, 1];ダッシュの音止め
type = stopSnd
trigger1 = stateno != 100
channel = 1

[state a];断鋼刃エフェクト消去
type = removeexplod
trigger1 = movetype = H
id = 2200


[state a];超火炎音止め
type = stopsnd
trigger1 = movetype = H
channel = 3

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

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




[State -2, 4];ハイジャンプ判定
type = varadd
trigger1 = 1
v = 15
value = -1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;::::::::変数設定(多分ダメージ関係が殆ど)
[state a]
type = varset
trigger1 = movetype = H
v = 13
value = 0

;::::::::ボイス変更の乱数
[State 180, 1]
type = VarRandom
trigger1 = 1
v = 6
range = 0,2

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;::::::::スロー処理

[state -2, a];スロー処理をする時間のカウント
type = varadd
trigger1 = 1
persistent = 0
ignorehitpause = 1
v = 4
value = -1

[state -2, a];スロー処理
type = pause
trigger1 = var(4) >= 1
trigger1 = gametime % 2
persistent = 0
ignorehitpause = 1
time = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;ダメージ時のエフェクト、サウンドの消去
;//////////////////////////////////////////////////////////////////////////
;ダメージ時のエフェクトの消去;死祟
[state a];
type = removeexplod
trigger1 = MoveType = H
id = 185

;ダメージ時のエフェクトの消去;ハウリングブル
[State 1]
type = removeexplod
trigger1 = MoveType = H
ID = 1470

;ダメージ時のエフェクトの消去
[State -2 ,a]
type = removeexplod
trigger1 = MoveType = H
ID = 4000

;ダメージ時のエフェクトの消去
[state -2 ,a]
type = removeexplod
trigger1 = MoveType = H
id = 4200

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

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

;ダメージ時のサウンドの消去
[state a]
type = stopsnd
trigger1 = MoveType = H
channel = 1

;ダメージ時の残像の消去
;[state a]
;type = afterimagetime
;trigger1 = MoveType = H
;time = 0

;///////////////////////////////////////////////////////////////////////
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;特殊
;//////////////////////////////////////////////////////////////////////////

[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 15
trigger1 = (GameTime%5) = 1
anim = 22126
sprpriority = 0
postype = p1
pos = -5,-90
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = null;Explod
triggerall = anim = 0
triggerall = time >= 15
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 0
postype = p1
pos = -5,-90
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

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

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


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


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


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


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


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



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


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


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


;---------------------
[State -1]
type = Projectile
triggerall = anim = 0
triggerall = time >= 15
trigger1 = (GameTime%2) = 1
attr = S, SA
projanim = 3459
projhitanim = -1
projid = 3459
projpriority = 999999999
projsprpriority = 1
;projedgebound = 220
projremove = 1
projremovetime = 4
postype = p1
offset = 0,0
velocity = 0
animtype  = Light
damage    = 0,0
getpower = 0,0
givepower = 0,0
guardflag = 
hitflag = MAFD
pausetime = 2,8
sparkno = -1
sparkxy = -15,-77
hitsound   = -1
guard.sparkno = -1;s7011
guardsound = -1
ground.type = low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -2
air.velocity = -2,-1


;技ダメージ倍率
[State -2] ;パワーアップ中
type = varset 
trigger1 = var(29) >= 1
var(39) = 2

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


;パワーアップカウント
[state a]
type = varadd
trigger1 = 1
v = 29
value = -1


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

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

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

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

[State -1]
type = varset
trigger1 = roundstate = 0
var(21) = 1

[State -1]
type = varset
trigger1 = roundstate = 0
var(22) = 1

[State -1]
type = varset
trigger1 = var(21) <= 1
var(22) = 3

[State -1]
type = varset
trigger1 = var(21) >= 150
var(22) = 2

[State -1]
type = varadd
trigger1 = 1
trigger1 = var(22) = 3
var(21) = 5

[State -1]
type = varadd
trigger1 = 1
trigger1 = var(22) = 2
var(21) = -5

[State a]
type = PalFX
trigger1 = 1
trigger1 = stateno != [190,192]
trigger1 = roundstate != 0
time = 2
add = var(21),var(21),var(21)
ignorehitpause = 1

[State a]
type = PalFX
trigger1 = 1
trigger1 = stateno != [190,192]
trigger1 = roundstate != 0
trigger1 = var(21) <= 40
time = 2
add = var(21)-40,var(21)-40,var(21)-40
ignorehitpause = 1
color = 0


[State -1]
type = Explod
triggerall = alive = 1
triggerall = statetype != C
triggerall = MoveType != H
triggerall = stateno != [190,192]
triggerall = stateno != 22050
triggerall = stateno != [170,171]
trigger1 = (GameTime%30) = 1
anim = 8200
id = 8200
sprpriority = 1
postype = p1
pos = 0,-50
bindtime = -1
supermove = 1
under = 1
ownpal = 1

[State a] 
type = Afterimage
triggerall = stateno != [190,192]
trigger1 = roundstate != 0
trigger1 = TIME = 0
trans = add
PalContrast =  250, 250, 250
PalBright = 0,0,0
time    =  -1
length  = 13
TimeGap = 1
FrameGap = 1

[State a]
type = EnvColor
trigger1 = projhit1050 = 1
persistent = 0
ignorehitpause = 1
time = 1
value = 255,255,255
under = 1

[State 1000, 9]
type = Envcolor
trigger1 = projHit22079 = 1
ignorehitpause = 1
value = 255, 255, 255
time = 1
under = 5
supermove = 1

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

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

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

;---------------------
[State 1000, 5]
type = Explod
trigger1 = ProjGuarded22079 = 1
anim = 22113
sprpriority = 100
postype = p2
pos = 0,-60
bindtime = -1
supermove = 0
ignorehitpause =0
under = 0
ownpal = 1

;---------------------
[State -1]
type = null;Projectile
trigger1 = stateno = 0;[120,151]
trigger1 = (GameTime%2) = 1
attr = S, SA
projanim = 3459
projhitanim = -1
projid = 3459
projpriority = 999999999
projsprpriority = 999999999
;projedgebound = 220
projremove = 1
projremovetime = 4
postype = p1
offset = 0,0
velocity = 0
animtype  = Light
damage    = 10,0
getpower = 10,0
givepower = 0,0
guardflag = 
hitflag = MAFD
pausetime = 2,8
sparkno = -1
sparkxy = -15,-77
hitsound   = s2562,6
guard.sparkno = -1;s7011
guardsound = -1
ground.type = low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -2
air.velocity = -2,-1
p2stateno = 9000

[State -1]
type = palfx
trigger1 = var(29) >= 1
time = 1
add = 60,60,60
color = 1
ignorehitpause = 1

[State -2]
Type = VarSet
triggerall = var(29) >= 1
Trigger1   = Life >= 0
sysvar(3) = 1
IgnoreHitPause = 1

[State -2]
type = attackMulSet
trigger1 = var(29) >= 1
value = 2.0
ignorehitpause = 1

[State -2]
type = attackMulSet
trigger1 = var(29) <= 1
value = 1
ignorehitpause = 1

[state -2]
type = poweradd
trigger1 = Helper(13000),GetHitVar(Damage)
value = 100
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = powerset
trigger1 = Life <= 300
value = 4000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;---------------------------------------------------------------------------
;超即死、ステ固定制御
;---------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

[State -2]
type = Helper
trigger1 = numhelper(200000) <= 0
stateno = 200000
id = 200000
ignorehitpause = 1

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;---------------------------------------------------------------------------
;変数記憶用記載
;---------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

;本体hitdefありで即死を防ぐ場合ステコンの順番にも気をつけましょう
;順番はこの通りにしてください。でないとセレスティアルあたりを喰らうと消えてなくなります(爆

;NOKOフラグ
;これは常時アーマーの場合は特に必要ありません。あくまで投げを喰らうようにして且つ即死無効にしたい場合
[State -2]
type = assertspecial
triggerall =numhelper(1007)
trigger1 =(movetype=H&&helper(1007),var(1)>1||var(1)!=gametime&&helper(1007),var(1)>1||roundstate>=2&&!alive&&helper(1007),var(1)>1)
flag = noko
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

;上記トリガー説明

;movetype=H&&helper(1007),var(1)>1
;保存して置いたライフが1より大きくてダメージ状態

;var(1)!=gametime&&helper(1007),var(1)>1
;保存して置いたライフが1より大きくてステートを奪われた場合

;roundstate>=2&&!alive&&helper(1007),var(1)>1
;保存して置いたライフが1より大きくて死んだ場合

;ライフ維持
;lifesetでもかまいませんがトレーニングモードでの見栄え等を考慮するとlifeaddの方がいいです
[State -2]
type = lifeadd
triggerall = roundstate=2
trigger1 = numhelper(1007)
trigger1 = helper(1007),var(1)-life>lifemax*0.2;保存していたライフから現在ライフを引いた数がライフ最大値の2割以上
value=(helper(1007),var(1)-life)
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

;ステート抜け
[State -2]
type = SelfState
trigger1 = numhelper(1007)
trigger1 = helper(1007),var(1)>1;保存して置いたライフが1より大きい場合
trigger1 = ((stateno=[5150,5199])||var(1)!=gametime&&helper(1007),var(0)>1199||!alive&&helper(1007),var(1)>1)
value= (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151;ガードステート
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

;上記トリガー説明

;var(1)!=gametime&&helper(1007),var(0)>1199
;ステートに引き込まれて1200フレーム以上経過(長時間ステート引き込み対策)

;!alive&&helper(1007),var(1)>1
;保存して置いたライフが1より大きくて死んだ場合

;変数記憶用ヘルパー(変数リセ防御用)
[State -2]
type = helper
trigger1 =!numhelper(1007)
id = 1007
persistent = 1
name = "The Will of Earth"
pos = 0,0
postype = P1
stateno = 1007
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;---------------------------------------------------------------------------
;アーマー用記載
;---------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

;アーマーヘルパーを出す
[State -2]
type = helper
trigger1 = roundstate = 2 && !ishelper
trigger1 = !numhelper(13000) && (palno=[1,12])
id = 13000
persistent = 1
name = "The Will of Earth"
pos = 0,0
postype = P1
stateno = 13000
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999
sausemovetime = 9999999

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

[State -2]
type = AssertSpecial
trigger1 = (palno=[1,12]) && !ishelper                       
flag = NoStandGuard                            
flag2 = NoCrouchGuard                          
flag3 = NoairGuard                            
ignorehitpause = 1
pausemovetime = 9999999
supermovetime = 9999999

[State -2]
type = NotHitBy 
trigger1 = (palno=[1,12]) && !ishelper
value = SCA,AA,AP,AT
time = 9999999
ignorehitpause = 1
supermovetime = 999999999999999
pausemovetime = 999999999999999

[State -2]
type = HitOverride
trigger1 = (palno=[1,12]) && !ishelper  
trigger1 = alive 
time = 1
slot=1
attr = SCA,NA,SA,HA,NT,ST,HT,NP,SP,HP,AA,AT,AP
stateno = 14000                                   
ignorehitpause = 1
supermovetime = 9999999
pausemovetime = 9999999

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

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

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