; ユウシャ（勇者30）のコマンドファイルです。
;==============================================================================
; Win版専用パート
;==============================================================================
;-| ボタンリマップ（ボタンコンフィグ）|---------------------------------------- 第１部
[Remap]
x = x      ;Ｘボタンの入力判定を実際に押すボタンに割り当てる。
y = y      ;Ｙボタン　　　　　　　　　〃
z = z      ;Ｚボタン　　　　　　　　　〃
a = a      ;Ａボタン　　　　　　　　　〃
b = b      ;Ｂボタン　　　　　　　　　〃
c = c      ;Ｃボタン　　　　　　　　　〃
s = s      ;スタートボタン　　　　　　〃

;-| デフォルト設定 |----------------------------------------------------------- 第２部

[Defaults]
command.time = 15  ;このパラメータを消した場合、デフォルトは１フレームになる。

command.buffer.time = 1  ;標準のコマンド入力記憶時間。

;============================================================================== 第３部
; コマンド定義パート（入力キーを設定する）
;------------------------------------------------------------------------------
;-| 通常技 |-------------------------------------------------------------------

;[Command]
;name = "TOUTEKI"
;command = /B, x
;time = 10

[Command]
name = "UMADASH"
command = /x, F
time = 10

[Command]
name = "UMABACK"
command = /x, B
time = 10

[Command]
name = "ITEM"
command = y
time = 10

[Command]
name = "NAKAMAMAE"
command = /F, y
time = 10

[Command]
name = "NAKAMASITA"
command = /D, y
time = 10

[Command]
name = "NAKAMAUSIRO"
command = /B, y
time = 10

;------------------------------------------------------------------------------
;-| 必殺技 |-------------------------------------------------------------------

[Command]
name = "MAOU30"
command = /F, a
time = 10

[Command]
name = "KNIGHT30"
command = /D, a
time = 10

[Command]
name = "OUJO30"
command = /B, a
time = 10

;------------------------------------------------------------------------------
;-| キー２回連続入力 |---------------------------------------------------------

[Command]
name = "FF"       ;必須コマンド名
command = F, F
time = 10

[Command]
name = "BB"       ;必須コマンド名
command = B, B
time = 10

[Command]
name = "UU"       
command = U, U
time = 10

;------------------------------------------------------------------------------
;-| 超必殺技 |-----------------------------------------------------------------

[Command]
name = "TOKINOMEGAMISAMA"
command = /B, b
time = 20

[Command]
name = "INISIENOAKUMA"
command = /F, b
time = 20


;[Command]
;name = "YUUSHA30"
;command = ~D, DF, F, c
;time = 20

;------------------------------------------------------------------------------
;-| 同時押し |-----------------------------------------------------------------

[Command]
name = "recovery" ;必須コマンド名
command = x+y
time = 1

;------------------------------------------------------------------------------
;-| 方向キー＋ボタン |---------------------------------------------------------

[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

;------------------------------------------------------------------------------
;-| ボタン単発 |---------------------------------------------------------------

[Command]
name = "a"
command = a
time = 1

[Command]
name = "b"
command = b
time = 1

[Command]
name = "c"
command = c
time = 1

[Command]
name = "x"
command = x
time = 1

[Command]
name = "y"
command = y
time = 1

[Command]
name = "z"
command = z
time = 1

[Command]
name = "start"
command = s
time = 1


;------------------------------------------------------------------------------
;-| 方向キー |-----------------------------------------------------------------

[Command]
name = "holdfwd"   ;必須コマンド名
command = /$F
time = 1

[Command]
name = "holdback"  ;必須コマンド名
command = /$B
time = 1

[Command]
name = "holdup"    ;必須コマンド名
command = /$U
time = 1

[Command]
name = "holddown"  ;必須コマンド名
command = /$D
time = 1

;------------------------------------------------------------------------------
; ■準常時監視ステート（−１）■
[Statedef -1] 

;==============================================================================
; 超必殺技
;==============================================================================
;------------------------------------------------------------------------------

[State -1, 時間の巻き戻し];毎ラウンド1回
type = ChangeState
value = 13050
triggerall = RoundState = 2
triggerall = var(0) = 0
triggerall =statetype != A 
triggerall = ctrl
triggerall = var(30) <= 900
trigger1 = command = "TOKINOMEGAMISAMA"  
;trigger1 = power >= 5000  
;trigger1 = var(3) = 0
trigger1 = var(59) = 0

trigger2 = var(59) = 1
trigger2 = var(29) >= 1
trigger2 = var(30) <= 600
trigger2 = life >= 1


[State -1, 暗黒の力];毎ラウンド1回
type = ChangeState
value = 13052
triggerall = RoundState = 2
triggerall = var(3) = 0
triggerall =statetype != A 
triggerall = ctrl
trigger1 = command = "INISIENOAKUMA"  
trigger1 = life >= lifemax
trigger1 = var(59) = 0

trigger2 = var(59) = 1
trigger2 = life >= lifemax
trigger2 = random = 0 
trigger2 = var(0) > 0


;==============================================================================
; 必殺技
;==============================================================================
[State -1, 魔王30];1ゲージ消費
type = ChangeState
value = 13100
triggerall = RoundState = 2
triggerall = statetype != A
triggerall = NumHelper(3100) = 0
triggerall = power >= 1000
triggerall = ctrl
triggerall = var(3) = 0
trigger1 = command = "MAOU30"
trigger1 = var(59) = 0

trigger2 = statetype = S
trigger2 = var(59) = 1
trigger2 = var(12) = 0
trigger3 = statetype = S
trigger3 = var(59) = 1
trigger3 = power >= 3000
trigger3 = Random = [0,1]


[State -1,AI用呼び出し間隔]
type = varset
triggerall = var(59) = 1 ;&& var(12) = 0
;trigger1 = stateno = 13100
trigger1 = NumHelper(3100) = 1
trigger2 = RoundState = 0
var(12) = 2400
ignorehitpause=1

[State -1,AI用呼び出し間隔]
type = varadd
triggerall = var(59) = 1
trigger1 = var(12) > 0
var(12) = -1 



[State -1, 王女30];1ゲージ消費
type = ChangeState
value = 13200
triggerall = RoundState = 2
triggerall = NumHelper(3200) = 0
triggerall = power >= 1000
triggerall = ctrl
triggerall = var(3) = 0
trigger1 = command = "OUJO30"
trigger1 = var(59) = 0

trigger2 = var(59) = 1
trigger2 = var(13) = 0
trigger2 = p2bodydist Y >= -20
trigger2 = random <= 200  
trigger3 = var(59) = 1
trigger3 = var(13) = 0
trigger3 = p2bodydist X <= 60
trigger3 = p2bodydist Y >= -60
trigger4 = var(59) = 1
trigger4 = power >= 3000
trigger4 = Random = [0,1]

[State -1,AI用呼び出し間隔]
type = varset
triggerall = var(59) = 1 ;&& var(13) = 0
;trigger1 = stateno = 13200
trigger1 = NumHelper(3200) = 1
trigger2 = RoundState = 0
var(13) = 1500
ignorehitpause=1

[State -1,AI用呼び出し間隔]
type = varadd
triggerall = var(59) = 1
trigger1 = var(13) > 0
var(13) = -1 



[State -1, 騎士30];3ゲージ消費
type = ChangeState
value = 13300
triggerall = RoundState = 2
triggerall = statetype != A
triggerall = NumHelper(3300) = 0
triggerall = power >= 1000
triggerall = ctrl
triggerall = var(3) = 0
trigger1 = command = "KNIGHT30"
trigger1 = var(59) = 0

trigger2 = statetype = S
trigger2 = var(59) = 1
trigger2 = var(14) = 0
trigger3 = statetype = S
trigger3 = var(59) = 1
trigger3 = power >= 3000
trigger3 = Random = [0,1]

[State -1,AI用呼び出し間隔]
type = varset
triggerall = var(59) = 1 ;&& var(14) = 0
trigger1 = RoundState = 0
var(14) = 600
ignorehitpause=1

[State -1,AI用呼び出し間隔]
type = varset
triggerall = var(59) = 1 ;&& var(14) = 0
trigger1 = NumHelper(3300) = 1
var(14) = 6000
ignorehitpause=1

[State -1,AI用呼び出し間隔]
type = varadd
triggerall = var(59) = 1
trigger1 = var(14) > 0
var(14) = -1 

;==============================================================================
;通常技
;==============================================================================
;------------------------------------------------------------------------------
[State -1, アイテム使用]
type = ChangeState
value = 1300
triggerall = RoundState = 2
;triggerall = ctrl
triggerall = NumProjID(1300) = 0
triggerall = var(1) <= 1
trigger1 = command = "ITEM"
trigger1 = var(59) = 0

trigger2 = var(59) = 1 ;薬草
trigger2 = var(1)  = 0
trigger2 = life <= lifemax / 3
trigger3 = var(59) = 1 ;爆弾
trigger3 = var(1)  = 1
trigger3 = var(1)  = 1
trigger3 = p2bodydist X >= 160


;------------------------------------------------------------------------------
[State -1, シルドニクス]
type = ChangeState
value = 600
triggerall = RoundState = 2
triggerall = statetype = A
;triggerall = ctrl
triggerall = var(3) = 0
trigger1 = command = "x"
trigger1 = var(59) = 0
trigger2 = stateno = 600
trigger2 = command = "x"
trigger2 = var(59) = 0

trigger3 = var(59) = 1
trigger3 = stateno != 600
;trigger3 = FrontEdgeDist > 60
trigger3 = random <= 500  


;==============================================================================
; 特殊技
;==============================================================================
;------------------------------------------------------------------------------
[State -1, 挑発]
type = ChangeState
value = 195
triggerall = RoundState = 2
triggerall = statetype != A
triggerall = ctrl
trigger1 = command = "start"
trigger1 = var(3) = 0
trigger1 = var(59) = 0

;trigger2 = var(59) = 1
;trigger2 = random <= 0  


[State -1, 緊急回避]
type = ChangeState
value = 610
triggerall = RoundState = 2
trigger1 = movetype = H
;trigger1 = ctrl
trigger1 = command = "UU"
trigger1 = var(3) = 0
trigger1 = var(59) = 0

;trigger2 = var(59) = 1
;trigger2 = movetype = H
;trigger2 = random <= 2
;trigger2 = RoundState = 2

;==============================================================================
; 移動関連
;==============================================================================
;------------------------------------------------------------------------------

;[State -1, 歩く]
;type = ChangeState
;value = 20
;triggerall = RoundState = 2
;triggerall = statetype = S
;triggerall = ctrl = 1
;trigger1 = var(59) = 1

[State -1, 走る]
type = ChangeState
value = 100
triggerall = RoundState = 2
triggerall = statetype = S
triggerall = ctrl
triggerall = var(3) = 0
trigger1 = command = "FF"
trigger1 = var(59) = 0
trigger2 = command = "UMADASH"
trigger2 = var(59) = 0

trigger3 = var(59) = 1
Trigger3 = Random = [0,2]
trigger3 = stateno != 100 
trigger4 = var(59) = 1
trigger4 = BackEdgeDist <= 60
trigger4 = stateno != 100 

[State -1, 後走り]
type = ChangeState
value = 105
triggerall = RoundState = 2
triggerall = statetype = S
triggerall = ctrl
triggerall = var(3) = 0
trigger1 = command = "BB"
trigger1 = var(59) = 0
trigger2 = command = "UMABACK"
trigger2 = var(59) = 0

;trigger2 = var(59) = 1
;trigger2 = stateno = 100
;trigger2 = stateno = 100
;trigger2 = FrontEdgeDist < 60


;ガード(AI用)
[State -3]
Type = ChangeState
Value = 120
triggerall = RoundState = 2
TriggerAll = Var(59) = 1
TriggerAll = StateType != A
Trigger1 = Ctrl
Trigger1 =! EnemyNear,HitDefAttr = ,NT,ST,HT ;投げ属性以外の攻撃にのみ
Trigger1 = InGuardDist
Trigger1 = Random = [0,0]

;空中復帰(AI用)
[State -3]
Type = ChangeState
Value = 5210
triggerall = RoundState = 2
TriggerAll = Var(59) = 1
TriggerAll = Vel Y > -1
TriggerAll = Alive 
TriggerAll = StateNo = 5050
Trigger1 = CanRecover
Trigger1 = Random = [0,700]

;ジャンプ(AI用)
[State -3]
Type = ChangeState
Value = 40
triggerall = RoundState = 2
TriggerAll = Var(59) = 1
triggerall = statetype != A
;TriggerAll = StateType = S
Trigger1 = Ctrl
Trigger1 = Random = [0,2]

[State -1, 歩く] 
type = ChangeState 
value = 20 
triggerall = var(59) = 1 
triggerall = RoundState = 2 
triggerall = stateno != 201 && stateno != 202 && stateno != 100 && stateno != 600 && stateno != 20 
trigger1 = vel x != const(velocity.walk.fwd.x) 
trigger1 = vel x != -5
trigger1 = statetype != A 
trigger1 = ctrl
ctrl = 1 

