; 汉化版功夫人的cmd文件
;
; 两部分:按键定义和state入口（就是按什么键进入什么state。原谅我吧……想不出好名字了）
; (state入口在按键定义之后)
;
; 1. 按键定义
; ---------------------
; 注意: 按键和招式名分大小写。
; 八个方向分别是:
;   B, DB, D, DF, F, UF, U, UB     (全大写)
;   对应后，下后，下，下前，前，前上，上，上后。
; 六个按键是:
;   a, b, c, x, y, z               (全小写)
;   在默认按键的情况下，xyz在上排，abc在下排。
;   推荐使用xyz作为拳，abc作为脚。
;
; 每一个[Command]定义一个操作指令。
; 这些操作指令可以在cmd和cns里被调用。
; 操作指令的语法规范如下:
;
;   [Command]
;   name = "指令名"
;   command = 按键输入
;   time = 接受指令输入的时间 (可选)
;   buffer.time = 输入缓存的时间 (可选)
;
; - 指令名
;   指令的名字，在调用时需要输入同样的名字，比如trigger1=command="指令名"。
;   指令名区分大小写。(QCB_a和Qcb_a或者QCB_A不同)。
;
; - 按键输入
;   输入的按键的列表。每一个键由逗号隔开。一个方向键或者一个攻击键叫为一个符号。
;   方向键和攻击键之前可以用特殊符号来达到一些效果:
;   斜杠 (/) - 表示之后的一个键必须被按住不放
;          举例, command = /D       ;按住不放下方向键
;               command = /DB, a   ;按住不放下后方向键的时候按a
;   波浪号 (~) - 表示按键被松开
;          举例, command = ~a       ;松开a键
;               command = ~D, F, a ;松开下方向键，按前方向键，再按a
;          如果你想让某个键蓄力一段时间再放开，可以再波浪号之后加入你想保持蓄力的时间(以帧为单位)
;          举例, command = ~30a     ;按住a30帧，再松开
;   美金 ($) - 仅限上下左右方向键。表示包括正和斜方向
;          举例, command = $D       ;包括下，下后和下前
;               command = $B       ;包括后，下后和上后
;   加号 (+) - 仅限攻击键。表示同时按多个键。
;          举例, command = a+b      ;同时按a和b
;               command = x+y+z    ;同时按x，y和z
;   大于号 (>) - 表示上一次按键和这一次按键之中不能掺杂其他的按键
;          举例, command = a, >~a   ;按下a再松开a，而其中不按下或者松开其他键
;   这些符号可以组合使用:
;     举例, command = ~30$D, a+b     ;按住下，下后或者下前30帧，松开，然后同时按a和b
;
;   注意: 连续按方向键的指令会被MUGEN引擎自动理解如下:
;         举例，cmd文件中的定义:
;           command = F, F
;         会被引擎理解成:
;           command = F, >~F, >F
;
;   对于有多个方向键的定义，例如四分之一圈下前，为了让招数能更容易的使出，最好在定义由一个"松开方向键"起始。
;
; - 指令输入时间 (可选)
;   接受指令输入的时间，以帧为单位。默认值可以在[Defaults]条目修改，通常为15。
;
; - 指令缓存时间 (可选)
;   输入的指令被缓存的时间。当一个指令被输入时，它在这段时间里都是有效的。
;   最基本的情况是设置成值为1。这种情况下只有在这一帧输入指令才会执行。如果值更高，比如3或4，输入会提前进入缓存，然后当可以执行时就被执行。这样人物的操作会松快一些，因为玩家可以提前输入指令，比如在还没有击中敌人时就开始取消，或者从受击状态还没有获得控制时就切反。
;   但这也有副作用，因为在缓存的期间会认为一直在输入这个指令。举例来说，把这个值设成30，然后发一个很快的招式，比如功夫人的站轻拳，看它的效果。
;   默认值可以在[Defaults]条目修改。
;   这个参数对蓄力指令不起作用，参数的值会自动当作1。
;
; 如果有多种输入有同样的名子，每一种输入都会读出这个指令。你可以用这个技巧来让一个招式接受不同的输入。
;
; 以下是一些常用指令的输入示例:
;
; [Command] ;下前 + x
; name = "下前x"
; command = ~D, DF, F, x
;
; [Command] ;向后半圈 + a
; name = "后半圈a"
; command = ~F, DF, D, DB, B, a
;
; [Command] ;下前下前 + y
; name = "下前下前y"
; command = ~D, DF, F, D, DF, F, y
;
; [Command] ;连打b
; name = "连打b"
; command = b, b, b, b, b
; time = 30
;
; [Command] ;蓄后，前 + z
; name = "蓄后前z"
; command = ~60$B, F, z
; time = 10
;
; [Command] ;蓄下，上 + c
; name = "蓄下上c"
; command = ~60$D, U, c
; time = 10

;-| AI起動用 |-----------------------------------------------------------------
[Command]
name = "AI1"
command = F, B, B, F, F, B, B, F, F, B, B, F, F, B
time = 1

[Command]
name = "AI2"
command = U, D, D, U, U, D, D, U, U, D, D, U, U, D
time = 1

[Command]
name = "AI3"
command = D, U, U, D, D, U, U, D, D, U, U, D, D, U
time = 1

[Command]
name = "AI4"
command = B, F, F, B, B, F, F, B, B, F, F, B, B, F
time = 1

[Command]
name = "AI5"
command = a, x, x, a, a, x, x, a, a, x, x, a, a, x
time = 1

[Command]
name = "AI6"
command = b, y, y, b, b, y, y, b, b, y, y, b, b, y
time = 1

[Command]
name = "AI7"
command = c, z, z, c, c, z, z, c, c, z, z, c, c, z
time = 1

[Command]
name = "AI8"
command = x, a, a, x, x, a, a, x, x, a, a, x, x, a
time = 1

[Command]
name = "AI9"
command = y, b, b, y, y, b, b, y, y, b, b, y, y, b
time = 1

[Command]
name = "AI10"
command = z, c, c, z, z, c, c, z, z, c, c, z, z, c
time = 1

[Command]
name = "AI11"
command = F, B, F, B, F, B, F, B, F, B, F, B, F, B
time = 1

[Command]
name = "AI12"
command = U, D, U, D, U, D, U, D, U, D, U, D, U, D
time = 1

[Command]
name = "AI13"
command = D, U, D, U, D, U, D, U, D, U, D, U, D, U
time = 1

[Command]
name = "AI14"
command = B, F, B, F, B, F, B, F, B, F, B, F, B, F
time = 1

[Command]
name = "AI15"
command = a, x, a, x, a, x, a, x, a, x, a, x, a, x
time = 1

[Command]
name = "AI16"
command = b, y, b, y, b, y, b, y, b, y, b, y, b, y
time = 1

[Command]
name = "AI17"
command = c, z, c, z, c, z, c, z, c, z, c, z, c, z
time = 1

[Command]
name = "AI18"
command = x, a, x, a, x, a, x, a, x, a, x, a, x, a
time = 1

[Command]
name = "AI19"
command = y, b, y, b, y, b, y, b, y, b, y, b, y, b
time = 1

[Command]
name = "AI20"
command = z, c, z, c, z, c, z, c, z, c, z, c, z, c
time = 1

[Command]
name = "AI21"
command = F, B, F, B, F, B, F, B, F, B
time = 1

[Command]
name = "AI22"
command = U, D, U, D, U, D, U, D, U, D
time = 1

[Command]
name = "AI23"
command = D, U, D, U, D, U, D, U, D, U
time = 1

[Command]
name = "AI24"
command = B, F, B, F, B, F, B, F, B, F
time = 1

[Command]
name = "AI25"
command = D, U, B, F, D, U, B, F, D
time = 1


;-| 重新排列按键 |-----------------------------------------------------
; 这一段可以让玩家简单的重新排列攻击按键。格式是:
;  以前对应的键 = 修改后的键
; 如果不填写修改后的键，则以前对应的键将失效。
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| 默认输入时间 |-------------------------------------------------------
[Defaults]
; 默认接受指令的时间，最小为1。
command.time = 15

; 默认指令蓄力的时间，最小为1，最大为30。
command.buffer.time = 1


;-| 超必杀技 |--------------------------------------------------------
;下面有两个技能是一样的，但是输入不同。
;两种输入都会触发command = 三连功夫掌"。
;为了方便玩家操作，指令接受时间不是默认的15，而是20。
;
[Command]
name = "厄运钟摆"
command = ~D, DF,D, DF, z
time = 30

[Command]
name = "The world"
command = ~D, DF,D, DF, c
time = 30

[Command]
name = "白羅滅精二气"
command = ~D, DF,D, DF, y
time = 30

[Command]
name = "白羅滅精"
command = ~D, DF,D, DF, x
time = 30

[Command]
name = "命运"
command = ~D, DF,D, DF, a
time = 30

[Command]
name = "命运-主动"
command = ~D, DF,D, DF, b
time = 30

;-| 特殊技 |------------------------------------------------------

[Command]
name = "致命打击"
command = ~D, F, z
time = 13

[Command]
name = "邪灵之刃"
command = ~D, B, y
time = 13

[Command]
name = "邪灵之箭"
command = ~D, B, x
time = 13

[Command]
name = "无尽崩塌-近"
command = ~D, B, a
time = 13

[Command]
name = "无尽崩塌-远"
command = ~D, B, b
time = 13

[Command]
name = "无尽崩塌-空中"
command = ~D, F, a
time = 13

[Command]
name = "斬風燕破-鳳牙"
command = ~D, DF, a
time = 13

[Command]
name = "斬風燕破-鳳牙二式"
command = ~D, DF, b
time = 13

[Command]
name = "斬風燕破-鳳牙-空袭一式"
command = ~D, DF, x
time = 13

[Command]
name = "斬風燕破-鳳牙-空袭二式"
command = ~D, DF, y
time = 13

[Command]
name = "斬風燕破-殺魔"
command = ~D, DF, F, x
time = 13

[Command]
name = "斬風燕破-叛鏡"
command = ~D, DF, F, y
time = 13

[Command]
name = "毁灭-对空"
command = ~B, F, x
time = 13

[Command]
name = "毁灭-对中"
command = ~B, F, a
time = 13

[Command]
name = "毁灭-对地"
command = ~B, F, y
time = 13

[Command]
name = "瞬狱杀"
command = ~D, DF, F, c
time = 13

[Command]
name = "陨落"
command = ~D, DB, B, c
time = 13

[Command]
name = "陨灭"
command = ~D, DF, F, s
time = 13

[Command]
name = "厄运"
command = ~D, DB, B, z
time = 13

[Command]
name = "暗潮涌动-空中-后退"
command = ~D, B, a
time = 13

[Command]
name = "暗潮涌动-空中-背后"
command = ~D, B, y
time = 13

[Command]
name = "暗潮涌动-空中-下方"
command = ~D, B, x
time = 13

[Command]
name = "暗潮涌动-空中-背空"
command = ~D, B, b
time = 13

[Command]
name = "暗潮涌动-空中-前空"
command = ~D, B, c
time = 13

[Command]
name = "暗潮涌动-地面-后退"
command = ~D, D, a
time = 13

[Command]
name = "暗潮涌动-地面-背空"
command = ~D, D, b
time = 13

[Command]
name = "暗潮涌动-地面-背后"
command = ~D, D, y
time = 13

[Command]
name = "暗潮涌动-地面-前移-远"
command = ~D, D, z
time = 13

[Command]
name = "暗潮涌动-地面-前移"
command = ~D, D, x
time = 13

[Command]
name = "暗潮涌动-地面-前空"
command = ~D, D, c
time = 13

[Command]
name = "精防"
command = a+y
time = 13

[command]
name = "CD"
command = b+y
buffer.time = 1
[command]
name = "CD"
command =  c
buffer.time = 1


;-| 按两次 |-----------------------------------------------------------
[Command]
name = "FF"     ;必须包括 (不要删除)
command = F, F
time = 10

[Command]
name = "BB"     ;必须包括 (不要删除)
command = B, B
time = 10

[Command]
name = "前前"
command = F, F
time = 10

[Command]
name = "后后"
command = B, B
time = 10

;-| 同时按键 |-----------------------------------------------
[Command]
name = "recovery";必须包括 (不要删除)
command = x+a
time = 1
[Command]
name = "recovery";必须包括 (不要删除)
command = z
time = 1

[Command]
name = "受身"
command = x+y
time = 1

;-| 方向＋攻击键 |---------------------------------------------------------
[Command]
name = "下+a"
command = /$D,a
time = 1

[Command]
name = "下+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

[Command]
name = "蓄上方向"
command = /$F
time = 1

[Command]
name = "蓄后方向"
command = /$B
time = 1

[Command]
name = "蓄前方向"
command = /$U
time = 1

[Command]
name = "蓄下方向"
command = /$D
time = 1

[Command]
name = "jump"    
command = D, $U
time = 12

;-| AI Helper |----------------------------------------------------------------
[command]
name = "fwd"
command = F
time = 1

[command]
name = "back"
command = B
time = 1

[command]
name = "up"
command = U
time = 1

[command]
name = "down"
command = D
time = 1

;---------------------------------------------------------------------------
; 2. state入口
; --------------
; 在这一段里，人物会依据输入来转到相应的state里。
;
; 入口示例如下:
;   [State -1, 标签]           ;标签可以是任意你想要来标注这个入口的名字
;   type = ChangeState          ;不要改
;   value = 要跳转到的state
;   trigger1 = command = "招式名"
;   . . .  (其他trigger)
;
; - 一些常用的trigger:
;   - statetype
;       S, C or A : 现在人物的状态 (站立, 下蹲, 空中)
;   - ctrl
;       0 or 1 : 如果人物可控，则值为1，否则为0。除非取消另一个招数，否则出招是一般要求ctrl=1
;   - stateno
;       现在人物的state号 - 在取消招数时常用。
;   - movecontact
;       0 or 1 : 如果上一个招数接触到了敌人，则值为1，否则为0。在取消招数时常用。
;
; 注意: 入口的顺序很重要。
;   如果指令A是指令B的一部分，则指令B的入口应排在指令A前。
;   比如说，下前下前XY应该排在下前XY之前，下前XY应该排在下前X之前，下前X应该排在X之前。
;
; 关于trigger的详细解释，请参阅MUGEN自带的cns参考说明。
;
; 提示:
; 这部分是cns的延伸。-1这个state是一个特殊state，无论人物实际上在哪个state，-1这个state每一帧都会执行。


; 不要删除下面这行。语法标准要求CMD文件必须包括这行。
[Statedef -1]
[state ]
type = null
trigger1 = roundno = 1
trigger1 = roundstate = 0;（或者1）
value = powermax

;===========================================================================
[State -2, ??]
type= DisplaytoClipboard
trigger1= 1
text="p2bodydist x: %d | P2Dist Y: %d | enemynear,BackEdgeBodyDist: %d | FrontEdgeBodyDist: %d| VAR(31): %d| VAR(50): %d"
params= ceil(p2bodydist x),ceil(P2Dist Y),ceil(enemynear,BackEdgeBodyDist),ceil(FrontEdgeBodyDist),ceil(VAR(31)),ceil(VAR(50))

[State -2, Debug]
type = appendtoclipboard
Trigger1 = 1
text="\nTRACE = %d PREVStateNo = %d enemynear(var(58)),numhelper = %d hittime = %d p2AnimTime = %d"  
params= var(32), PREVStateNo, enemynear(var(58)),numhelper, GetHitVar(hittime), EnemyNear,AnimTime
ignorehitpause = 1 

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



[State -3 ,movereversed]
type = varset
trigger1 = movereversed
v = 27
value = enemy,prevstateno
ignorehitpause = 1

[State -3 ,movereversed]
type = varset
trigger1 = movereversed
v = 28
value = enemy,stateno
ignorehitpause = 1


;硬直?制
[State -3,varadd]
Type = VarAdd
Trigger1 = StateNo = 650 && MoveContact = 1
Trigger2 = StateNo = 640 && MoveContact = 1
Trigger3 = STATENO = 2050 && movehit && hitcount = 7
persistent = 0
V = 29
value = 5

[State -3,varset]
Type = VarSet
TriggerAll = var(29)
Trigger1 = enemynear(var(58)),StateNo = [200,4999]
persistent = 0
var(29) = 0

[State -3,varadd]
Type = VarAdd
Trigger1 = StateNo = 200 && MoveContact = 1
Trigger2 = StateNo = 400 && MoveContact = 1
Trigger3 = StateNo = 215 && MoveContact = 1
Trigger4 = StateNo = 430 && MoveContact = 1
Trigger5 = StateNo = 230 && MoveContact = 1
Trigger6 = StateNo = 210 && MoveContact = 1
Trigger7 = StateNo = 240 && MoveContact = 1
Trigger8 = StateNo = 245 && MoveContact = 1
persistent = 0
V = 30
value = 5

[State -3,varset]
Type = VarSet
TriggerAll = var(30)
Trigger1 = enemynear,MoveType != H||StateNo = 1300||StateNo = 1500||StateNo >= 2000 && var(50) != 6 && var(50) != 9
persistent = 0
var(30) = 0

[State -3,varadd]
Type = VarAdd
Triggerall = var(50) = 9
Trigger1 = StateNo = 1450 && time >= 15
Trigger2 = StateNo = 1451 && time >= 18
persistent = 0
V = 31
value = 5

[State -3,varset]
Type = VarSet
TriggerAll = var(31)
Trigger1 = enemynear,MoveType != H
persistent = 0
var(31) = 0

;---------------------------------------------------------------------------------
;AI跳?限制用
;---------------------------------------------------------------------------------
[State -2]
type = varadd
Trigger1 = var(33) > 0
var(33) = -1

;限制跳?
[State -2]
type = varadd
Triggerall = !ishelper
Triggerall = name = "ZERO-SOUL"
Triggerall = EnemyNear,StateType != A
TriggerAll = EnemyNear,MoveHit = 1 && Time = 1||EnemyNear,numhelper > 0 && p2stateno >= 1000 && StateType = A
TriggerAll = MoveType = H
Trigger1 = var(32)/100 = 120 || var(32)/100 = 36
Trigger1 = StateType = A
Trigger1 = prevstateno = [120,159]
trigger1 = stateno != [120,159]
Trigger1 = EnemyNear,movetype = A
;Trigger6 = var(34)/10000 = 39
var(33) = 120 + EnemyNear,GetHitVar(damage)

[State Neko,防止乱跳]
type = ChangeState
value = 0
triggerall = var(59)
triggerall = var(33) > 0 && var(44) != 2
triggerall = statetype != A 
triggerall = roundstate = 2
triggerall = enemynear,hitdefattr != SC,AT
triggerall = p2bodydist x >= 100||p2bodydist x < 100 && var(49) < 5
trigger1 = stateno = [30,39]
ctrl = 1 
IgnoreHitPause = 1 

;-----------------------------------------------------------
;==============================================================================

[State -3]
type = Turn
triggerall = p2dist x < 0 && !time && var(59)
trigger1 = stateno = [150,154]


;起き攻め
;---------------------------------------------------------------------------
[State -3, 起き攻め選択]
type = VarSet
triggerall = var(44) = 0
triggerall = roundstate = 2
triggerall = enemynear(var(58)),statetype = L && enemynear(var(58)),movetype != A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),stateno != 5120 || enemynear(var(58)),animtime < -4
trigger1 = statetype != L && movetype != H
var(44) = 1 + (ifelse(Random <= 500,ifelse(Random <= 500,0,1),ifelse(Random <= 500,2,3)))

[State -3, リセット]
type = varset
triggerall = var(44) != 0
trigger1 = roundstate != 2 || movetype = H || movetype = A || statetype = L 
var(44) = 0

[State -3];上のリセット
type = varset
triggerall = var(44) != 0
trigger1 = var(44) = 1 && enemynear(var(58)),stateno = 5120
trigger1 = enemynear(var(58)),animtime = 0
trigger2 = var(44) = 2 && enemynear(var(58)),stateno = 5120
trigger2 = enemynear(var(58)),animtime > -6
trigger2 = !((stateno = [30,39]) || statetype = A)
trigger3 = var(44) = 3 && enemynear(var(58)),stateno = 5120
trigger3 = enemynear(var(58)),animtime > -5
trigger4 = var(44) = 4 && enemynear(var(58)),stateno = 5120
trigger4 = enemynear(var(58)),animtime > -4
var(44) = 10


[State -3, VarSet]
Type = VarSet
Trigger1 = var(49) != 0
V = 49
Value = 0
IgnoreHitPause = 1

[State -3, ヒット硬直時間]
Type = VarSet
TriggerAll = EnemyNear(var(58)),Ctrl = 0
TriggerAll = EnemyNear(var(58)),StateType != A
TriggerAll = EnemyNear(var(58)),StateType != L
TriggerAll = EnemyNear(var(58)),MoveType = H
Trigger1 = EnemyNear(var(58)),StateNo = [120,160)
Trigger2 = EnemyNear(var(58)),StateNo = [5000,5100)
V = 49
Value = EnemyNear(var(58)),GetHitVar(hittime) + 1 ;?里也是一?的道理
IgnoreHitPause = 1


;各???--------------------------------------------------------------------
[State -1, ヒット確認]
type = VarSet
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = p2bodydist x<= 100
trigger1 = ProjHit1400 = 1
var(50) = 1

[State -1, ヒット確認]
type = VarSet
triggerall = var(50) != 8
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype = A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 2111 && movehit
var(50) = 2

[State -1, ヒット確認]
type = VarSet
triggerall = var(50) != 8
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype = A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 2050 && movehit
var(50) = 3

[State -1, ヒット確認]
type = VarSet
triggerall = var(50) != 9
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype = A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 2100 && movehit
var(50) = 4

[State -1, ヒット確認]
type = VarSet
triggerall = var(50) != 9
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 2000 && movehit
var(50) = 5

[State -1, ヒット確認]
type = VarSet
triggerall = var(50) = 0
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 1300 && movehit
var(50) = 6

[State -1, ヒット確認]
type = VarSet
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype = A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 1150 && movehit
var(50) = 7

[State -1, ヒット確認]
type = VarSet
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype = A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 1155 && movehit
var(50) = 8

[State -1, ヒット確認]
type = VarSet
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 200 && movehit && var(30) = 5
trigger2 = stateno = 430 && movehit && var(30) = 5
trigger3 = stateno = 400 && movehit && var(30) = 5
var(47) = ifelse(stateno = 430,1,2)

[State -1, ヒット確認]
type = VarSet
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = stateno = 3410 && movehit
var(50) = 9

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


;===========================================================================
;这个控制器不触发招数。如果人物可以从普通技取消到必杀技，这个控制器会把var(1)设置成1。下面必杀技的控制器会用到这个变量。
;Since a lot of special moves rely on the same conditions, this reduces
;redundant logic.
[State 变量清零]
type = VarSet
trigger1 = 1
var(1) = 0

[State 检查可否取消]
type = VarSet
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
var(1) = 1

;---------------------------------------------------------------------------
;厄运钟摆
[State 厄运钟摆]
type = ChangeState
value = 3900
triggerall = !var(59)
triggerall = command = "厄运钟摆"
triggerall = power >= 3000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
trigger3 = 2050 && movecontact
trigger4 = 2000 && movecontact
trigger5 = 1500 && movecontact
trigger6 = 1451 && movecontact
trigger6 = animelem = 11 ,>=0
trigger7 = 1450
trigger7 = animelem = 10 ,>=0
trigger8 = 1400
trigger8 = animelem = 5 ,>=0
trigger9 = 1330 && movecontact
trigger10 = 1320 && movecontact
trigger11 = 1310 && movecontact
trigger12 = 1300 && movecontact
trigger13 = 1155 && movecontact
trigger14 = 1150 && movecontact 
trigger15 = 1100 && movecontact 

;---------------------------------------------------------------------------
;The world
[State The world]
type = ChangeState
value = 3500
triggerall = !var(59)
triggerall = command = "The world"
triggerall = power >= 3000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
trigger3 = 2050 && movecontact
trigger4 = 2000 && movecontact
trigger5 = 1500 && movecontact
trigger6 = 1451 && movecontact
trigger6 = animelem = 11 ,>=0
trigger7 = 1450
trigger7 = animelem = 10 ,>=0
trigger8 = 1400
trigger8 = animelem = 5 ,>=0
trigger9 = 1330 && movecontact
trigger10 = 1320 && movecontact
trigger11 = 1310 && movecontact
trigger12 = 1300 && movecontact
trigger13 = 1155 && movecontact
trigger14 = 1150 && movecontact 
trigger15 = 1100 && movecontact 

;---------------------------------------------------------------------------
;白羅滅精二气
[State 白羅滅精二气]
type = ChangeState
value = 3300
triggerall = !var(59)
triggerall = command = "白羅滅精二气"
triggerall = power >= 2000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
trigger3 = 2050 && movecontact
trigger4 = 2000 && movecontact
trigger5 = 1500 && movecontact
trigger6 = 1451 && movecontact
trigger6 = animelem = 11 ,>=0
trigger7 = 1450
trigger7 = animelem = 10 ,>=0
trigger8 = 1400
trigger8 = animelem = 5 ,>=0
trigger9 = 1330 && movecontact
trigger10 = 1320 && movecontact
trigger11 = 1310 && movecontact
trigger12 = 1300 && movecontact
trigger13 = 1155 && movecontact
trigger14 = 1150 && movecontact 
trigger15 = 1100 && movecontact 

;---------------------------------------------------------------------------
;白羅滅精
[State 白羅滅精]
type = ChangeState
value = 3100
triggerall = !var(59)
triggerall = command = "白羅滅精"
triggerall = power >= 1000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
trigger3 = 2050 && movecontact
trigger4 = 2000 && movecontact
trigger5 = 1500 && movecontact
trigger6 = 1451 && movecontact
trigger6 = animelem = 11 ,>=0
trigger7 = 1450
trigger7 = animelem = 10 ,>=0
trigger8 = 1400
trigger8 = animelem = 5 ,>=0
trigger9 = 1330 && movecontact
trigger10 = 1320 && movecontact
trigger11 = 1310 && movecontact
trigger12 = 1300 && movecontact
trigger13 = 1155 && movecontact
trigger14 = 1150 && movecontact 
trigger15 = 1100 && movecontact 

;---------------------------------------------------------------------------
;命运-主动
[State 白羅滅精]
type = ChangeState
value = 3400
triggerall = !var(59)
triggerall = command = "命运-主动"
triggerall = power >= 1000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
trigger3 = 2050 && movecontact
trigger4 = 2000 && movecontact
trigger5 = 1500 && movecontact
trigger6 = 1451 && movecontact
trigger6 = animelem = 11 ,>=0
trigger7 = 1450
trigger7 = animelem = 10 ,>=0
trigger8 = 1400
trigger8 = animelem = 5 ,>=0
trigger9 = 1330 && movecontact
trigger10 = 1320 && movecontact
trigger11 = 1310 && movecontact
trigger12 = 1300 && movecontact
trigger13 = 1155 && movecontact
trigger14 = 1150 && movecontact 
trigger15 = 1100 && movecontact 

;---------------------------------------------------------------------------
;命运
[State 命运]
type = ChangeState
value = 3200
triggerall = !var(59)
triggerall = command = "命运"
triggerall = power >= 1000
triggerall = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
;暗潮涌动-空中-后退
[State 暗潮涌动-空中-后退]
type = ChangeState
value = 2254
triggerall = !var(59)
triggerall = command = "暗潮涌动-空中-后退"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 2 ,>=0
trigger3 = (stateno = [600,699])
trigger4 = stateno = 2250 
trigger5 = stateno = 2251 
trigger6 = stateno = 2252 
trigger7 = stateno = 2253
trigger8 = stateno = 2205
trigger8 = animelem = 2 ,>=0
trigger9 = stateno = 2111
trigger9 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger10 = stateno = 2150
trigger10 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger11 = stateno = 2151 
trigger11 = animelem = 7 ,>=0 && animelem = 8 ,<=4

;---------------------------------------------------------------------------
;暗潮涌动-空中-背后
[State 暗潮涌动-空中-背后]
type = ChangeState
value = 2253
triggerall = !var(59)
triggerall = command = "暗潮涌动-空中-背后"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 2 ,>=0
trigger3 = (stateno = [600,699])
trigger4 = stateno = 2250 
trigger5 = stateno = 2251 
trigger6 = stateno = 2254 
trigger7 = stateno = 2205
trigger7 = animelem = 2 ,>=0
trigger8 = stateno = 2111
trigger8 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger9 = stateno = 2150
trigger9 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger10 = stateno = 2151 
trigger10 = animelem = 7 ,>=0 && animelem = 8 ,<=4

;---------------------------------------------------------------------------
;暗潮涌动-空中-下方
[State 暗潮涌动-空中-下方]
type = ChangeState
value = 2252
triggerall = !var(59)
triggerall = command = "暗潮涌动-空中-下方"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 2 ,>=0
trigger3 = (stateno = [600,699])
trigger4 = stateno = 2250 
trigger5 = stateno = 2251 
trigger6 = stateno = 2254 
trigger7 = stateno = 2205
trigger7 = animelem = 2 ,>=0
trigger8 = stateno = 2111
trigger8 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger9 = stateno = 2150
trigger9 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger10 = stateno = 2151 
trigger10 = animelem = 7 ,>=0 && animelem = 8 ,<=4

;---------------------------------------------------------------------------
;暗潮涌动-地面-背空
[State 暗潮涌动-空中-背空]
type = ChangeState
value = 2251
triggerall = !var(59)
triggerall = command = "暗潮涌动-空中-背空"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 2 ,>=0
trigger3 = (stateno = [600,699])
trigger4 = stateno = 2250 
trigger5 = stateno = 2252 
trigger6 = stateno = 2253 
trigger7 = stateno = 2254 
trigger8 = stateno = 2205
trigger8 = animelem = 2 ,>=0
trigger9 = stateno = 2111
trigger9 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger10 = stateno = 2150 
trigger10 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger11 = stateno = 2151
trigger11 = animelem = 7 ,>=0 && animelem = 8 ,<=4

;---------------------------------------------------------------------------
;暗潮涌动-空中-前空
[State 暗潮涌动-空中-前空]
type = ChangeState
value = 2250
triggerall = !var(59)
triggerall = command = "暗潮涌动-空中-前空"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 2 ,>=0
trigger3 = (stateno = [600,699])
trigger4 = stateno = 2251 
trigger5 = stateno = 2252 
trigger6 = stateno = 2253 
trigger7 = stateno = 2254 
trigger8 = stateno = 2205
trigger8 = animelem = 2 ,>=0
trigger9 = stateno = 2111
trigger9 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger10 = stateno = 2150 
trigger10 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger11 = stateno = 2151
trigger11 = animelem = 7 ,>=0 && animelem = 8 ,<=4
trigger12 = stateno = 1705

;---------------------------------------------------------------------------
;暗潮涌动-地面-前移
[State 暗潮涌动-地面-前移-远]
type = ChangeState
value = 2206
triggerall = !var(59)
triggerall = command = "暗潮涌动-地面-前移-远"
triggerall = power >= 330
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 2200 
trigger4 = stateno = 2204
trigger5 = stateno = 1500 && movecontact
trigger6 = stateno = 1450 
trigger7 = animelem = 10 ,>=0
trigger8 = stateno = 1451 
trigger9 = animelem = 11 ,>=0
trigger10 = stateno = 1400 
trigger10 = animelem = 5 ,>=0
trigger11 = stateno = 1150 && movecontact
trigger12 = stateno = 1155 && movecontact
trigger13 = stateno = 1100 && movecontact
trigger14 = stateno = 1105 && movecontact 
trigger15 = stateno = 1330 && movecontact
trigger16 = stateno = 2203
trigger17 = stateno = 1800
trigger18 = stateno = 1810
trigger19 = stateno = 1820

;---------------------------------------------------------------------------
;暗潮涌动-地面-前空
[State 暗潮涌动-地面-前空]
type = ChangeState
value = 2205
triggerall = !var(59)
triggerall = command = "暗潮涌动-地面-前空"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 2200 
trigger4 = stateno = 2203
trigger5 = stateno = 2204 
trigger6 = stateno = 1500 && movecontact
trigger7 = stateno = 1450 
trigger7 = animelem = 10 ,>=0
trigger8 = stateno = 1451 
trigger8 = animelem = 11 ,>=0
trigger9 = stateno = 1400 
trigger9 = animelem = 5 ,>=0
trigger10 = stateno = 1150 && movecontact
trigger11 = stateno = 1155 && movecontact
trigger12 = stateno = 1100 && movecontact
trigger13 = stateno = 1105 && movecontact 
trigger14 = stateno = 1330 && movecontact
trigger15 = stateno = 1800
trigger16 = stateno = 1810
trigger17 = stateno = 1820
trigger18 = stateno = 2206

;---------------------------------------------------------------------------
;暗潮涌动-地面-后退
[State 暗潮涌动-地面-后退]
type = ChangeState
value = 2204
triggerall = !var(59)
triggerall = command = "暗潮涌动-地面-后退"
trigger1 = var(1) ;在可以取消时
trigger3 = stateno = 2200 
trigger4 = stateno = 2203
trigger5 = stateno = 1500 && movecontact
trigger6 = stateno = 1450 
trigger7 = animelem = 10 ,>=0
trigger8 = stateno = 1451 
trigger9 = animelem = 11 ,>=0
trigger10 = stateno = 1400 
trigger10 = animelem = 5 ,>=0
trigger11 = stateno = 1150 && movecontact
trigger12 = stateno = 1155 && movecontact
trigger13 = stateno = 1100 && movecontact
trigger14 = stateno = 1105 && movecontact
trigger15 = stateno = 1330 && movecontact 
trigger16 = stateno = 1800
trigger17 = stateno = 1810
trigger18 = stateno = 1820
trigger19 = stateno = 2206

;---------------------------------------------------------------------------
;暗潮涌动-地面-前移
[State 暗潮涌动-地面-前移]
type = ChangeState
value = 2203
triggerall = !var(59)
triggerall = command = "暗潮涌动-地面-前移"
triggerall = power >= 330
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 2200 
trigger4 = stateno = 2204
trigger5 = stateno = 1500 && movecontact
trigger6 = stateno = 1450 
trigger7 = animelem = 10 ,>=0
trigger8 = stateno = 1451 
trigger9 = animelem = 11 ,>=0
trigger10 = stateno = 1400 
trigger10 = animelem = 5 ,>=0
trigger11 = stateno = 1150 && movecontact
trigger12 = stateno = 1155 && movecontact
trigger13 = stateno = 1100 && movecontact
trigger14 = stateno = 1105 && movecontact 
trigger15 = stateno = 1330 && movecontact
trigger16 = stateno = 1800
trigger17 = stateno = 1810
trigger18 = stateno = 1820
trigger19 = stateno = 2206

;---------------------------------------------------------------------------
;暗潮涌动-地面-背空
[State 暗潮涌动-地面-背空]
type = ChangeState
value = 2201
triggerall = !var(59)
triggerall = command = "暗潮涌动-地面-背空"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 2200 
trigger4 = stateno = 2203
trigger5 = stateno = 2204 
trigger6 = stateno = 1500 && movecontact
trigger7 = stateno = 1450 
trigger7 = animelem = 10 ,>=0
trigger8 = stateno = 1451 
trigger8 = animelem = 11 ,>=0
trigger9 = stateno = 1400 
trigger9 = animelem = 5 ,>=0
trigger10 = stateno = 1150 && movecontact
trigger11 = stateno = 1155 && movecontact
trigger12 = stateno = 1100 && movecontact
trigger13 = stateno = 1105 && movecontact 
trigger14 = stateno = 1330 && movecontact
trigger15 = stateno = 1800
trigger16 = stateno = 1810
trigger17 = stateno = 1820
trigger18 = stateno = 2206

;---------------------------------------------------------------------------
;暗潮涌动-地面-背后
[State 暗潮涌动-地面-背后]
type = ChangeState
value = 2200
triggerall = !var(59)
triggerall = command = "暗潮涌动-地面-背后"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 2203 
trigger4 = stateno = 2204
trigger5 = stateno = 1500 && movecontact
trigger6 = stateno = 1450 
trigger7 = animelem = 10 ,>=0
trigger8 = stateno = 1451 
trigger9 = animelem = 11 ,>=0
trigger10 = stateno = 1400 
trigger10 = animelem = 5 ,>=0
trigger11 = stateno = 1150 && movecontact
trigger12 = stateno = 1155 && movecontact
trigger13 = stateno = 1100 && movecontact
trigger14 = stateno = 1105 && movecontact 
trigger15 = stateno = 1330 && movecontact
trigger16 = stateno = 2206
trigger17 = stateno = 1800
trigger18 = stateno = 1810
trigger19 = stateno = 1820

;---------------------------------------------------------------------------
;斬風燕破-鳳牙-空袭二式
[State 斬風燕破-鳳牙-空袭二式]
type = ChangeState
value = 2151
triggerall = !var(59)
triggerall = command = "斬風燕破-鳳牙-空袭二式"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger3 = stateno = 2201 
trigger4 = stateno = 2205 
trigger5 = stateno = 2250 
trigger6 = stateno = 2251 
trigger7 = stateno = 2254 

;---------------------------------------------------------------------------
;斬風燕破-鳳牙-空袭一式
[State 斬風燕破-鳳牙-空袭一式]
type = ChangeState
value = 2150
triggerall = !var(59)
triggerall = command = "斬風燕破-鳳牙-空袭一式"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger3 = stateno = 2201 
trigger4 = stateno = 2205 
trigger5 = stateno = 2250 
trigger6 = stateno = 2251 
trigger7 = stateno = 2254 

;---------------------------------------------------------------------------
;斬風燕破-鳳牙二式
[State 斬風燕破-鳳牙二式]
type = ChangeState
value = 2110
triggerall = !var(59)
triggerall = command = "斬風燕破-鳳牙二式"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1450 
trigger4 = animelem = 10 ,>=0
trigger5 = stateno = 1451 
trigger5 = animelem = 11 ,>=0
trigger6 = stateno = 1340 
trigger6 = animelem = 6 ,>=0
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1155 && movecontact
trigger9 = stateno = 1100 && movecontact 
trigger10 = stateno = 1105 && movecontact 
trigger11 = stateno = 1330 && movecontact
trigger12 = stateno = 1705 && movecontact

;---------------------------------------------------------------------------
;斬風燕破-鳳牙
[State 斬風燕破-鳳牙]
type = ChangeState
value = 2100
triggerall = !var(59)
triggerall = command = "斬風燕破-鳳牙"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1300 && movecontact
trigger5 = stateno = 1310 && movecontact
trigger6 = stateno = 1320 && movecontact
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1100 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1940 

;---------------------------------------------------------------------------
;斬風燕破-叛鏡
[State 斬風燕破-叛鏡]
type = ChangeState
value = 2050
triggerall = !var(59)
triggerall = command = "斬風燕破-叛鏡"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1300 && movecontact
trigger5 = stateno = 1310 && movecontact
trigger6 = stateno = 1320 && movecontact
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1100 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1940 

;---------------------------------------------------------------------------
;斬風燕破-殺魔
[State 斬風燕破-殺魔]
type = ChangeState
value = 2000
triggerall = !var(59)
triggerall = command = "斬風燕破-殺魔"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1300 && movecontact
trigger5 = stateno = 1310 && movecontact
trigger6 = stateno = 1320 && movecontact
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1100 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1940 

;---------------------------------------------------------------------------
;陨落
[State 陨落]
type = ChangeState
value = 1900
triggerall = !var(59)
triggerall = command = "陨落"
trigger1 = var(1) ;在可以取消时

;---------------------------------------------------------------------------
;毁灭-对地
[State 毁灭-对地]
type = ChangeState
value = 1820
triggerall = !var(59)
triggerall = command = "毁灭-对地"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1300 && movecontact
trigger5 = stateno = 1310 && movecontact
trigger6 = stateno = 1320 && movecontact
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1100 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1155 && movecontact
trigger11 = stateno = 1810
trigger12 = stateno = 1800

;---------------------------------------------------------------------------
;毁灭-对中
[State 毁灭-对中]
type = ChangeState
value = 1810
triggerall = !var(59)
triggerall = command = "毁灭-对中"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1300 && movecontact
trigger5 = stateno = 1310 && movecontact
trigger6 = stateno = 1320 && movecontact
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1100 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1155 && movecontact
trigger11 = stateno = 1820 
trigger12 = stateno = 1800

;---------------------------------------------------------------------------
;毁灭-对空
[State 毁灭-对空]
type = ChangeState
value = 1800
triggerall = !var(59)
triggerall = command = "毁灭-对空"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1300 && movecontact
trigger5 = stateno = 1310 && movecontact
trigger6 = stateno = 1320 && movecontact
trigger7 = stateno = 1150 && movecontact
trigger8 = stateno = 1100 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1155 && movecontact
trigger11 = stateno = 1810
trigger12 = stateno = 1820

;---------------------------------------------------------------------------
;无尽崩塌-空中
[State 无尽崩塌-空中]
type = ChangeState
value = 1700
triggerall = !var(59)
triggerall = command = "无尽崩塌-空中"
triggerall = statetype = A
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [600,699])
trigger3 = stateno = 2201 
trigger3 = animelem = 2 ,>=0
trigger4 = stateno = 2205
trigger4 = animelem = 2 ,>=0
trigger5 = stateno = 2111
trigger5 = animelem = 5 ,>=0 && animelem = 6 ,<=4
trigger6 = stateno = 2250
trigger6 = animelem = 3 ,>=0 
trigger7 = stateno = 2251 
trigger7 = animelem = 3 ,>=0 
trigger8 = stateno = 2254 
trigger8 = animelem = 3 ,>=0 
trigger9 = ctrl

;---------------------------------------------------------------------------
;厄运
[State 厄运]
type = ChangeState
value = 1600
triggerall = !var(59)
triggerall = command = "厄运"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])

;---------------------------------------------------------------------------
;精防
[State 精防]
type = hitoverride
triggerall = !var(59)
triggerall = command = "精防"
triggerall = roundstate = 2 && statetype = S
triggerall = !(StateNo = 120)
trigger1 = (ctrl || (stateno = 160))
attr = SA,AA,AP
stateno = 160
slot = 0
time = 8

[State 精防]
type = hitoverride
triggerall = !var(59)
triggerall = command = "精防"
triggerall = roundstate = 2 && statetype = C
triggerall = !(StateNo = 121)
trigger1 = (ctrl || (stateno = 161))
attr = SA,AA,AP
stateno = 161
slot = 0
time = 8

[State 精防]
type = hitoverride
triggerall = !var(59)
triggerall = command = "精防"
triggerall = roundstate = 2 && statetype = A
triggerall = !(StateNo = 122)
trigger1 = (ctrl || (stateno = 162))
attr = SA,AA,AP
stateno = 162
slot = 0
time = 8

;---------------------------------------------------------------------------
;致命打击
[State 致命打击]
type = ChangeState
value = 1500
triggerall = !var(59)
triggerall = command = "致命打击"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1340 
trigger3 = animelem = 5 ,>=0
trigger4 = stateno = 1450 
trigger4 = animelem = 10 ,>=0
trigger5 = stateno = 1451 
trigger5 = animelem = 11 ,>=0
trigger6 = stateno = 1940 
;---------------------------------------------------------------------------
;邪灵之刃
[State 邪灵之刃]
type = ChangeState
value = 1450
triggerall = !var(59)
triggerall = command = "邪灵之刃"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1400 
trigger3 = animelem = 4 ,>=0
trigger4 = stateno = 1340 
trigger4 = animelem = 6 ,>=0
trigger5 = stateno = 1330 && movecontact
trigger6 = stateno = 2050
trigger6 = animelem = 11 ,>=0
trigger7 = stateno = 1100 && movecontact
trigger8 = stateno = 1150 && movecontact
trigger9 = stateno = 1705 && movecontact
trigger10 = stateno = 1940 
;---------------------------------------------------------------------------
;邪灵之箭
[State 邪灵之箭]
type = ChangeState
value = 1400
triggerall = !var(59)
triggerall = command = "邪灵之箭"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1340 
trigger3 = animelem = 6 ,>=0
trigger4 = stateno = 1330 && movecontact
trigger5 = stateno = 1100 && movecontact
trigger6 = stateno = 1150 && movecontact
trigger7 = stateno = 1705 && movecontact
trigger8 = stateno = 1940 
;---------------------------------------------------------------------------
;瞬狱杀
[State 瞬狱杀]
type = ChangeState
value = 1300
triggerall = !var(59)
triggerall = command = "瞬狱杀"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 1500 && movecontact
trigger4 = stateno = 1940 

;---------------------------------------------------------------------------
;陨灭
[State 陨灭]
type = ChangeState
value = 1200
triggerall = !var(59)
triggerall = command = "陨灭"
trigger1 = ctrl

;---------------------------------------------------------------------------
;无尽崩塌-远
[State 无尽崩塌-远]
type = ChangeState
value = 1150
triggerall = !var(59)
triggerall = command = "无尽崩塌-远"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 801 
trigger3 = animelem = 14 ,>=0
trigger4 = stateno = 1940 
;---------------------------------------------------------------------------
;无尽崩塌-近
[State 无尽崩塌-近]
type = ChangeState
value = 1100
triggerall = !var(59)
triggerall = command = "无尽崩塌-近"
trigger1 = var(1) ;在可以取消时
trigger2 = (stateno = [200,499])
trigger3 = stateno = 801 
trigger3 = animelem = 14 ,>=0
trigger4 = stateno = 1940 
;---------------------------------------------------------------------------
;功夫格挡 (High)

;---------------------------------------------------------------------------
;功夫格挡格挡 (下段)

;---------------------------------------------------------------------------
;功夫格挡 (空中)

;===========================================================================
;---------------------------------------------------------------------------
;前跑
[State 前跑]
type = ChangeState
value = 100
triggerall = !var(59)
trigger1 = command = "前前"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;后跑
[State 后跑]
type = ChangeState
value = 105
triggerall = !var(59)
trigger1 = command = "后后"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;投技—邪骸喰刹
[State 邪骸喰刹]
type = ChangeState
value = 800
triggerall = !var(59)
triggerall = command = "y"
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
trigger1 = command = "蓄上方向"
trigger1 = p2bodydist X < 3
trigger1 = (p2statetype = S) || (p2statetype = C)
trigger1 = p2movetype != H
trigger2 = command = "蓄后方向"
trigger2 = p2bodydist X < 5
trigger2 = (p2statetype = S) || (p2statetype = C)
trigger2 = p2movetype != H

;===========================================================================
;---------------------------------------------------------------------------
;立轻拳
[State 立轻拳]
type = ChangeState
value = 200
triggerall = !var(59)
triggerall = command = "x"
triggerall = command != "holddown"
triggerall = statetype = S
trigger1 = ctrl || stateno = 100
trigger2 = (stateno = 1501) && time > 6

;---------------------------------------------------------------------------
;立重拳近
[State 立重拳近]
type = ChangeState
value = 210
triggerall = !var(59)
triggerall = command = "y"
triggerall = command != "holddown"
triggerall = P2dist X <=50
triggerall = statetype = S
trigger1 = ctrl || stateno = 100
trigger2 = (stateno = 200) && time > 5
trigger3 = (stateno = 230) && time > 8

;---------------------------------------------------------------------------
;立重拳远
[State 立重拳远]
type = ChangeState
value = 215
triggerall = !var(59)
triggerall = command = "y"
triggerall = command != "holddown"
triggerall = P2dist X >50
triggerall = statetype = S
trigger1 = ctrl || stateno = 100
trigger2 = (stateno = 200) && time > 3
trigger3 = (stateno = 230) && time > 5

;---------------------------------------------------------------------------
;立轻脚
[State 立轻脚]
type = ChangeState
value = 230
triggerall = !var(59)
triggerall = command = "a"
triggerall = command != "holddown"
triggerall = statetype = S
trigger1 = ctrl || stateno = 100
trigger2 = (stateno = 1501) && time > 6
trigger3 = stateno = 230 && movecontact

;---------------------------------------------------------------------------
;立重脚近
[State 立重脚近]
type = ChangeState
value = 240
triggerall = !var(59)
triggerall = command = "b"
triggerall = command != "holddown"
triggerall = P2dist X <=50
triggerall = statetype = S
trigger1 = ctrl || stateno = 100
trigger2 = (stateno = 200) && time > 5
trigger3 = (stateno = 230) && time > 6

;---------------------------------------------------------------------------
;立重脚远
[State 立重脚远]
type = ChangeState
value = 245
triggerall = !var(59)
triggerall = command = "b"
triggerall = command != "holddown"
triggerall = P2dist X >50
triggerall = statetype = S
trigger1 = ctrl || stateno = 100
trigger2 = (stateno = 200) && time > 5
trigger3 = (stateno = 230) && time > 6

;---------------------------------------------------------------------------
;挑拨
[State 挑拨]
type = ChangeState
value = 195
triggerall = !var(59)
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl || stateno = 100

;---------------------------------------------------------------------------
;蹲轻拳
[State 蹲轻拳]
type = ChangeState
value = 400
triggerall = !var(59)
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = statetype = C
trigger1 = ctrl 
trigger2 = statetype != A && (ctrl || stateno = 100)

;---------------------------------------------------------------------------
;蹲重拳
[State 蹲重拳]
type = ChangeState
value = 410
triggerall = !var(59)
triggerall = command = "y"
triggerall = command = "holddown"
triggerall = statetype = C
trigger1 = ctrl
trigger2 = (stateno = 400) || (stateno = 430)
trigger2 = (time > 9) || (movecontact && time > 5)
trigger3 = statetype != A && (ctrl || stateno = 100)

;---------------------------------------------------------------------------
;蹲轻脚
[State 蹲轻脚]
type = ChangeState
value = 430
triggerall = !var(59)
triggerall = command = "a"
triggerall = command = "holddown"
triggerall = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = 400) || (stateno = 430)
trigger2 = (time > 9) || (movecontact && time > 5)
trigger3 = statetype != A && (ctrl || stateno = 100)

;---------------------------------------------------------------------------
;蹲重脚
[State 蹲重脚]
type = ChangeState
value = 440
triggerall = !var(59)
triggerall = command = "b"
triggerall = command = "holddown"
triggerall = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = 400) || (stateno = 430)
trigger2 = (time > 9) || (movecontact && time > 5)
trigger3 = statetype != A && (ctrl || stateno = 100)

;---------------------------------------------------------------------------
;跳轻拳
[State 跳轻拳]
type = changestate
value = 600
triggerall = !var(59)
triggerall = command = "x"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 4 ,>=0
trigger3 = stateno = 2205 
trigger3 = animelem = 4 ,>=0
trigger4 = stateno = 2250 
trigger4 = animelem = 4 ,>=0
trigger5 = stateno = 2251 
trigger5 = animelem = 4 ,>=0
trigger6 = stateno = 2254 
trigger6 = animelem = 4 ,>=0

;---------------------------------------------------------------------------
;跳重拳
[State 跳重拳]
type = ChangeState
value = 610
triggerall = !var(59)
triggerall = command = "y"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 4 ,>=0
trigger3 = stateno = 2205 
trigger3 = animelem = 4 ,>=0
trigger4 = stateno = 2250 
trigger4 = animelem = 4 ,>=0
trigger5 = stateno = 2251 
trigger5 = animelem = 4 ,>=0
trigger6 = stateno = 2254 
trigger6 = animelem = 4 ,>=0

;---------------------------------------------------------------------------
;跳轻脚
[State 跳轻脚]
type = ChangeState
value = 630
triggerall = !var(59)
triggerall = command = "a"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 4 ,>=0
trigger3 = stateno = 2205 
trigger3 = animelem = 4 ,>=0
trigger4 = stateno = 2250 
trigger4 = animelem = 4 ,>=0
trigger5 = stateno = 2251 
trigger5 = animelem = 4 ,>=0
trigger6 = stateno = 2254 
trigger6 = animelem = 4 ,>=0

;---------------------------------------------------------------------------
;跳重脚
[State 跳重脚]
type = ChangeState
value = 640
triggerall = !var(59)
triggerall = command = "b"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 4 ,>=0
trigger3 = stateno = 2205 
trigger3 = animelem = 4 ,>=0
trigger4 = stateno = 2250 
trigger4 = animelem = 4 ,>=0
trigger5 = stateno = 2251 
trigger5 = animelem = 4 ,>=0
trigger6 = stateno = 2254 
trigger6 = animelem = 4 ,>=0

;---------------------------------------------------------------------------
;跳CD
[state 跳CD]
type = changestate
value = 650
triggerall = !var(59)
triggerall = command = "CD"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2201 
trigger2 = animelem = 4 ,>=0
trigger3 = stateno = 2205 
trigger3 = animelem = 4 ,>=0
trigger4 = stateno = 2250 
trigger4 = animelem = 4 ,>=0
trigger5 = stateno = 2251 
trigger5 = animelem = 4 ,>=0
trigger6 = stateno = 2254 
trigger6 = animelem = 4 ,>=0

;---------------------------------------------------------------------------
;刚CD
[state CD]
type=changestate
value  = 351
triggerall = !var(59)
triggerall = command = "CD"
triggerall = statetype != a
triggerall = power >= 1000
trigger1 = stateno = [140,155]

;---------------------------------------------------------------------------
;站CD
[state CD]
type = changestate
value = 350
triggerall = !var(59)
triggerall = command = "CD"
triggerall = statetype != a
trigger1 = ctrl || stateno = 100

;--------------------------------
; 后闪避（耗气）
[State 后闪避（耗气）]
type = ChangeState
value = 826
triggerall = !var(59)
triggerall = command = "recovery"
triggerall = command = "holdback"
triggerall = statetype != A
triggerall = power >= 1000
trigger1 = stateno = [140,155]

;--------------------------------
; 后闪避
[State 后闪避]
type = ChangeState
value = 825
triggerall = !var(59)
triggerall = command = "recovery"
triggerall = command = "holdback"
trigger1 = statetype != A && (ctrl || stateno = 100)

;--------------------------------
; 前闪避（耗气）
[State 前闪避（耗气）]
type = ChangeState
value = 821
triggerall = !var(59)
triggerall = command = "recovery"
triggerall = command = "holdfwd"
triggerall = statetype != A
triggerall = power >= 1000
trigger1 = stateno = [140,155]

;--------------------------------
; 前闪避
[State 前闪避]
type = ChangeState
value = 820
triggerall = !var(59)
triggerall = command = "recovery"
triggerall = command = "holdfwd"
trigger1 = statetype != A && (ctrl || stateno = 100)

;--------------------------------
; 原地闪避
[State 原地闪避]
type = ChangeState
value = 830
triggerall = !var(59)
triggerall = command = "recovery"
trigger1 = statetype != A && (ctrl || stateno = 100)

;-------------------------------------------------------------------------------
;--------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; AI By Shirayuki
;---------------------------------------------------------------------------
; 各種ヘルパー
;---------------------------------------------------------------------------
[State -3, AI起動ヘルパー]
type = Helper
triggerall = var(59) = 0
trigger1 =!NumHelper(30000)
trigger1 =!IsHelper
trigger1 = roundstate <= 2 && alive
Trigger1 =!ctrl && stateno=0
helpertype = normal
name = "AI"
stateno = 30000
ID = 30000
pos = 0,0
keyctrl = 1
pausemovetime = 9999999
supermovetime = 9999999
persistent = 0

[State -3, ガードチェックヘルパー]
Type = Helper
triggerall = var(59) = 1
triggerall = RoundState = 2
trigger1 =!NumHelper(31000+id)
trigger1 =!IsHelper
HelperType = Normal
Name = "Guard"
PosType = left
StateNo = 31000
ID = 31000+id
PauseMoveTime = 0
pos=0,9999
pausemovetime=2147483647
supermovetime=2147483647
persistent = 0
IgnoreHitPause = 1
KeyCtrl = 0
Ownpal = 1

[State -3, 飛び道具確認ヘルパー]
Type = Helper
triggerall = var(59) = 1
trigger1 =!NumHelper(32000)
trigger1 =!ishelper
HelperType = Normal
Name = "TOBIDOUGU"
StateNo = 32000
ID = 32000
Pos = 9999,9999
KeyCtrl = 0
persistent = 0
pausemovetime=2147483647
supermovetime=2147483647

[State -3, 飛び道具確認ヘルパー]
Type = Helper
triggerall = var(59) = 1
trigger1 =!NumHelper(32500)
trigger1 =!ishelper
HelperType = Normal
Name = "TOBIDOUGU ITI A"
StateNo = 32500
ID = 32500
Pos = 9999,9999
KeyCtrl = 0
persistent = 0
pausemovetime=2147483647
supermovetime=2147483647

[State -3, 飛び道具確認ヘルパー]
Type = Helper
triggerall = var(59) = 1
trigger1 =!NumHelper(32501)
trigger1 =!ishelper
HelperType = Normal
Name = "TOBIDOUGU ITI B"
StateNo = 32500
ID = 32501
Pos = 9999,9999
KeyCtrl = 0
persistent = 0
pausemovetime=2147483647
supermovetime=2147483647

[State -3]
type = Helper
trigger1 = !numhelper(998)
helpertype = normal
name = "AIhelper多段攻击记忆"
ID = 998
stateno = 998
pos = 9999,9999
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0

[State -3]
type = Helper
trigger1 = !numhelper(999)
helpertype = normal
name = "AIhelper"
ID = 999
stateno = 999
pos = 9999,9999
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0

[State -1]
Type       = Helper
Trigger1   = numhelper(90000) = 0
Id         = 90000
Stateno    = 90000
Pos        = 50,-100
Helpertype = normal
Ownpal     = 1
Bind       = -1
Postype    = left
name = "各种变量写在这里"

[State -3, 画面端検出ヘルパー]
Type = Helper
Trigger1 =!NumHelper(20000+ID)
Trigger1 =!IsHelper
HelperType = Normal
Name = "Edge of Stage Right"
PosType = P1
StateNo = 20000
ID = 20000+ID
PauseMoveTime = 0
Persistent = 0
IgnoreHitPause = 1
KeyCtrl = 0
Ownpal = 1

[State -3, 画面端検出ヘルパー]
Type = Helper
Trigger1 =!NumHelper(20001+ID)
Trigger1 =!IsHelper
HelperType = Normal
Name = "Edge of Stage Left"
PosType = P1
StateNo = 20001
ID = 20001+ID
PauseMoveTime = 0
Persistent = 0
IgnoreHitPause = 1
KeyCtrl = 0
Ownpal = 1

[State -3]
Type = HelPer
Trigger1 = !NumHelper(25000+ID)
HelPerType = normal
Name = "bullet"
StateNo = 25000
ID = 25000+ID
OwnPal = 1
pos = 5, 0
postype = p1
PauseMoveTime = 99999999
SuperMoveTime = 99999999
IgnoreHitPause = 1

[State -3]
Type = HelPer
Trigger1 = !NumHelper(26000+ID)
HelPerType = normal
Name = "mekuri"
StateNo = 26000
ID = 26000+ID
OwnPal = 1
pos = 0, 0
postype = p1
facing = -1
PauseMoveTime = 99999999
SuperMoveTime = 99999999
IgnoreHitPause = 1

[State -3, 飛び道具確認ヘルパー]
Type = Helper
TriggerAll = var(59) = 1
Trigger1 =!NumHelper(35000+id)
Trigger1 =!IsHelper
HelperType = Normal
Name = "TOBIDOUGU KILLER"
StateNo = 35000
ID = 35000+id
KeyCtrl = 0
Persistent = 0
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, 当身検出ヘルパー]
Type = Helper
trigger1 =!NumHelper(33700+id)
trigger1 =!IsHelper
HelperType = Normal
Name = "MoveReversedLV2"
PosType = p1
StateNo = 33700
ID = 33700+id
pos=0,0
pausemovetime=2147483647
supermovetime=2147483647
persistent = 1
IgnoreHitPause = 1
KeyCtrl = 0
Ownpal = 1

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

;---------------------------------------------------------------------------
; 関係無いステートに行かないように
;---------------------------------------------------------------------------
[State -3, 関係無いステートに行かないように]
Type = ChangeState
Trigger1 = IsHelper
Trigger1 = IsHelper(20000+Root,ID)
Trigger1 = StateNo != 20000
Value = 20000

[State -3, 関係無いステートに行かないように]
Type = ChangeState
Trigger1 = IsHelper
Trigger1 = IsHelper(20001+Root,ID)
Trigger1 = StateNo != 20001
Value = 20001

; ステージ前後方端までの距離
;-----------------------------------------------------------------------------
[State -3, ステージ前方端までの距離]
Type = VarSet
Trigger1 =(NumHelper(20000+ID) && NumHelper(20001+ID))
Trigger1 = TeamSide = 1
var(41) = floor(Abs(ifelse(Facing = 1,Helper(20000+ID),RootDist X,Helper(20001+ID),RootDist X)))
IgnoreHitPause = 1

[State -3, ステージ前方端までの距離]
Type = VarSet
Trigger1 =(NumHelper(20000+ID) && NumHelper(20001+ID))
Trigger1 = TeamSide = 2
var(41) = floor(Abs(ifelse(Facing = 1,Helper(20001+ID),RootDist X,Helper(20000+ID),RootDist X)))
IgnoreHitPause = 1

[State -3, ステージ後方端までの距離]
Type = VarSet
Trigger1 =(NumHelper(20000+ID) && NumHelper(20001+ID))
Trigger1 = TeamSide = 1
var(42) = floor(Abs(ifelse(Facing = 1,Helper(20001+ID),RootDist X,Helper(20000+ID),RootDist X)))
IgnoreHitPause = 1

[State -3, ステージ後方端までの距離]
Type = VarSet
Trigger1 =(NumHelper(20000+ID) && NumHelper(20001+ID))
Trigger1 = TeamSide = 2
var(42) = floor(Abs(ifelse(Facing = 1,Helper(20000+ID),RootDist X,Helper(20001+ID),RootDist X)))
IgnoreHitPause = 1



;---------------------------------------------------------------------------
[State -3, 関係無いステートに行かないように]
type = ChangeState
trigger1 = ishelper(30000)
trigger1 = stateno != 30000
value = 30000

[State -3, 関係無いステートに行かないように]
type = ChangeState
trigger1 = ishelper
trigger1 = ishelper(31000+root,id)
trigger1 = stateno != 31000
value = 31000

[State -3]
type = ChangeState
trigger1 = ishelper(999)
trigger1 = stateno!=999
value = 999

[State -3, 関係無いステートに行かないように]
type = SelfState
trigger1 = ishelper(32000)
trigger1 = stateno != 32000
value = 32000

[State -3, 関係無いステートに行かないように]
type = SelfState
trigger1 = ishelper(32500) || ishelper(32501)
trigger1 = stateno != 32500
value = 32500


;AIswich---------------------------------------------------------------------------
; AI swich -> ON
[State -1, AVarSetI]
type = varset;varset
triggerall = !ishelper || isHelper(30000)
triggerall = var(59) != 1
triggerall = RoundState = [1,2]
trigger1  = Command = "AI1"
trigger2  = Command = "AI2"
trigger3  = Command = "AI3"
trigger4  = Command = "AI4"
trigger5  = Command = "AI5"
trigger6  = Command = "AI6"
trigger7  = Command = "AI7"
trigger8  = Command = "AI8"
trigger9  = Command = "AI9"
trigger10 = Command = "AI10"
trigger11 = Command = "AI11"
trigger12 = Command = "AI12"
trigger13 = Command = "AI13" 
trigger14 = Command = "AI14"
trigger15 = Command = "AI15"
trigger16 = Command = "AI16"
trigger17 = Command = "AI17"
trigger18 = Command = "AI18"
trigger19 = Command = "AI19"
trigger20 = Command = "AI20"
trigger21 = Command = "AI21"
trigger22 = Command = "AI22"
trigger23 = Command = "AI23"
trigger24 = Command = "AI24"
trigger25 = Command = "AI25"
trigger26 = NumHelper(30000)
trigger26 = Helper(30000),var(59)
trigger26 = Helper(30000),time > 5
trigger27 = AILevel 
var(59) = 1 ;(AI swich ON)

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

[State -1, AI]
Type = VarSet
triggerall = var(59) = 1
trigger1 = RoundState = 4
trigger2 = Win = 1
trigger3 = Lose = 1
trigger4 = DrawGame = 1
V = 59
Value = -1

[State -1, AI]
Type = VarSet
triggerall = var(59) = -1
trigger1 = RoundState = 2
V = 59
Value = 1

;-----------------------------------------------------------------------------
;タッグ用生死判別
;-----------------------------------------------------------------------------
[State -3, VarSet]
Type = VarSet
Trigger1 = NumEnemy = 1
Trigger2 = NumEnemy = 2
Trigger2 = Enemynear,Life > 0
var(58) = 0
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -3, VarSet]
Type = VarSet
Trigger1 = NumEnemy > 1
Trigger1 = Enemynear,Life = 0
var(58) = 1
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

;-----------------------------------------------------------------------------
[State -3,varset]
Type = varset
trigger1 = NumEnemy = 1
fvar(37) = 0

[State -3,varset]
Type = varset
trigger1 = NumEnemy = 2
trigger1 = EnemyNear(0),Alive
trigger1 = EnemyNear(1),Alive
fvar(37) = IfElse(((Abs(Pos X - EnemyNear(0),Pos X)) < (Abs(Pos X - EnemyNear(1),Pos X))),0,1)
ignorehitpause = 1

[State -3,varset]
Type = varset
trigger1 = NumEnemy = 2
trigger1 = !EnemyNear(0),Alive || !EnemyNear(1),Alive
fvar(37) = IfElse(EnemyNear(0),Alive,0,1)
ignorehitpause = 1



;特殊移?━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[State -1]
type = ChangeState
value = 195
triggerall = var(59) && !ishelper
triggerall = statetype != A
triggerall = stateno != 195 && prevstateno != 195
trigger1 = EnemyNear(var(58)),life < Life && roundstate = 3 && ctrl
Persistent = 0

[State -1, Stand Strong Punch]
type = ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
triggerall = statetype != A
triggerall = var(50) != 9
triggerall = var(29) > 0 || stateno = 1501 || stateno = 1940
trigger1 = stateno = 52 || stateno = 1940
trigger1 = enemynear(var(58)),stateno >= 5000
trigger1 = var(57):= 1500
trigger2 = stateno = 1501 && animtime = 0
trigger2 = enemynear(var(58)),stateno >= 5000
trigger2 = var(57):= ifelse(enemynear(var(58)),statetype = S,200,400)

[State -1, Stand Strong Punch]
type = ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
triggerall = var(50) = 9
trigger1 = ctrl || (stateno = [100,101]) || (stateno = [120,159])
trigger1 = statetype != A
trigger1 = enemynear(var(58)),stateno = 3430
trigger1 = var(57):= 195
trigger2 = stateno = 195 && animtime = 0
trigger2 = statetype != A
trigger2 = enemynear(var(58)),stateno = 3430
trigger2 = var(57):= 99
trigger3 = statetype != A
trigger3 = stateno = 99 && p2bodydist x<= 10
trigger3 = var(57):= 230
trigger4 = statetype != A
trigger4 = stateno = 230 && movehit 
trigger4 = var(57):= ifelse(var(30)<15,230,245)
trigger5 = statetype != A
trigger5 = stateno = 245 && movehit || stateno = 210 && movehit 
trigger5 = var(57):= ifelse(stateno = 245,1900,1300)
trigger6 = statetype != A
trigger6 = stateno = 1940 && enemynear(var(58)),stateno >= 5000
trigger6 = var(57) := 210
trigger7 = statetype != A
trigger7 = stateno = 1320 && movehit || stateno = 1451 && movehit && AnimElemtime(11) >= 0 && var(31) < 20
trigger7 = var(57):= 1450
;trigger8 = statetype != A
;trigger8 = STATENO = 2000 && movehit && hitcount >= 5 || STATENO = 2050 && movehit && hitcount >= 7
;trigger8 = var(57):= 2200
;trigger9 = statetype != A
;trigger9 = stateno = 2200 && animtime = 0
;trigger9 = var(57):= ifelse(VAR(29) < 20,2050,1450)
;trigger10 = stateno = 2201 || stateno = 2251
;trigger10 = statetype = A
;trigger10 = var(57):= 640

;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
;飛び道具対策
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
;前転(飛び道具対策)
[State -1, FRoll]
type = ChangeState
value = ifelse(random<=500,2203,2204)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = random <= 300
triggerall = statetype != A
triggerall = enemynear(var(58)),MoveType != H
triggerall = InGuardDist
triggerall = ctrl || (StateNo = [50,52]) || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])|| stateno = 1150|| stateno = 1400
trigger1 = P2bodydist X >= 200 || (enemynear(var(58)),AnimTime <= -35 && !enemynear(var(58)),Ctrl)
trigger1 = (Enemy,NumHelper > 0 && Enemy,NumHelper > Helper(32000),var(1)) || Enemy,Numproj != 0
trigger1 = var(45) = 1
Trigger1 = var(32) := 220001

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

[State -3,後転 AttackDist無効通常技回避]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = BackEdgeBodyDist >= 20
TriggerAll = RoundState = 2
triggerall = Random <= 10|| Life <= ceil(lifemax/3) && Random <= 100
TriggerAll = StateType != A
TriggerAll = P2BodyDist X <= 25 && EnemyNear(var(58)),AnimTime > -5 || P2BodyDist X > 25
TriggerAll = EnemyNear(var(58)),StateNo = [200,699]
TriggerAll = EnemyNear(var(58)),MoveType = A
TriggerAll =!EnemyNear(var(58)),HitDefAttr = SCA, NT, ST, HT
TriggerAll = EnemyNear(var(58)),Time <= 5
TriggerAll = EnemyNear(var(58)),facing != facing
TriggerAll =!InGuardDist
TriggerAll = Ctrl || (StateNo = [20,22]) || (StateNo = [120,149]) || StateNo = 100
Trigger1 = P2BodyDist X <= 45 && EnemyNear(var(58)),AnimTime >= -5
Trigger2 = P2BodyDist X <= 55 && EnemyNear(var(58)),AnimTime >= -16 || P2BodyDist X <= 65 && EnemyNear(var(58)),AnimTime >= -17
Trigger3 = P2BodyDist X <= 75 && EnemyNear(var(58)),AnimTime >= -18 || P2BodyDist X <= 85 && EnemyNear(var(58)),AnimTime >= -19
Trigger4 = P2BodyDist X <= 95 && EnemyNear(var(58)),AnimTime >= -20

[State -1,ブラックアウト 空キャン]
Type = ChangeState
Value = IFELSE(VAR(41) < 150,2204,2200)
TriggerAll = var(59)
TriggerAll = RoundState = 2 && enemynear(var(58)),life > 0 
TriggerAll = StateType != A
TriggerAll = MoveType != H
TriggerAll = EnemyNear(var(58)),stateno != [5000,5500]
TriggerAll = (StateNo = [200,440])&&time>=5
Trigger1 = Enemy,StateNo = var(27)
Trigger1 = (var(27) != [0,1])
Trigger2 = Enemy,StateNo = var(28)
Trigger2 = (var(28) != [0,1])
IgnoreHitPause = 1

;?策-------------------------------------------------------------------------------
[State -3,中ジャンプ 飛び込み]
Type = ChangeState
Value = 2110
TriggerAll = var(59)
TriggerAll = RoundState = 2 && EnemyNear(var(58)),life > 0 && fvar(22) = 0
TriggerAll = EnemyNear(var(58)),StateType != A || EnemyNear(var(58)),Vel X < 2
TriggerAll = EnemyNear(var(58)),StateNo < 2000 || EnemyNear(var(58)),MoveType = I
TriggerAll = EnemyNear(var(58)),StateNo < 1000
TriggerAll = !InGuardDist && !Helper(26000+ID),InGuardDist || P2bodyDist X > 160 && !Enemy,NumProj 
TriggerAll = !Helper(25000+ID),InGuardDist
TriggerAll = Ctrl || (StateNo = [50,52]) || (StateNo = [20,22]) || (StateNo = [100,101]) || (StateNo = [120,149])|| stateno = 1150||stateno = 1400
Trigger1 = Enemy,NumProj
Trigger1 = EnemyNear(var(58)),facing != facing
Trigger1 = P2bodyDist X > 155
Trigger1 = random >= 500 || StateType = A
Trigger1 = var(32) := 220002


[State -3,大ジャンプ 飛び込み]
Type = ChangeState
Value = 2200
TriggerAll = var(59)
TriggerAll = RoundState = 2 && EnemyNear(var(58)),life > 0 && fvar(22) = 0
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),StateType != A || EnemyNear(var(58)),StateNo < 1000
TriggerAll = EnemyNear(var(58)),StateNo < 2000 || EnemyNear(var(58)),MoveType = I
TriggerAll =!InGuardDist && !Helper(26000+ID),InGuardDist || P2bodyDist X > 160 && !Enemy,NumProj 
TriggerAll =!Helper(25000+ID),InGuardDist
TriggerAll = Ctrl || (StateNo = [50,52]) || (StateNo = [20,22]) || (StateNo = [100,101]) || (StateNo = [120,149])
Trigger1 = P2bodyDist X > 160
Trigger1 = Enemy,NumProj
Trigger1 = EnemyNear(var(58)),facing != facing
Trigger1 = Random < 500
Trigger1 = var(32) := 3602

[State -1, Stand Strong Punch]
type = ChangeState
Value = IFELSE(VAR(41) < 150,2204,ifelse(random<= 500,2110,1900))
triggerall = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
;triggerall = MoveGuarded
triggerall = statetype != A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),movetype = A
triggerall = enemynear(var(58)),PrevStateno = [150,155]
triggerall = enemynear(var(58)),hitdefattr = SCA,AA
TriggerAll = enemynear(var(58)),facing != facing
triggerall = enemynear(var(58)),animtime <= -5
Trigger1 = Stateno = [200,440]
Trigger2 = Stateno = 2000
Trigger3 = Stateno = 2050
Trigger4 = Stateno = [1100,1150]
Trigger5 = Stateno = [1450,1451]
Trigger6 = stateno = 1150
Trigger7 = stateno = 1400
Trigger8 = stateno = ctrl

[State -1, Stand Strong Punch]
type = ChangeState
Value = 1340
triggerall = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),movetype = A
triggerall = enemynear(var(58)),PrevStateno = [150,155]
triggerall = enemynear(var(58)),hitdefattr = SCA,AA
Trigger1 = Stateno = [1300,1330]

[State -1, Stand Strong Punch]
type = ChangeState
Value = 1340
triggerall = var(59)
triggerall = MoveGuarded
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),Stateno = [120,159]
Trigger1 = Stateno = [1300,1330]
Trigger1 = random <= 100

[state -1,バックステップ 投げ外し]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = p2bodydist X >= 30 || stateno = 52
TriggerAll = Ctrl || (Stateno = [20,22]) || (Stateno = [100,101]) || (StateNo = [120,159]) || (StateNo = [200,499]) || stateno = 721
trigger1 = p2name = "Orochi Eagrose Version" && (p2StateNo = [2100,2101]) || p4name = "Orochi Eagrose Version" && (p2stateno = [2100,2101]) || p2name = "Orochi-EV" && (p2StateNo = [2100,2101]) || p4name = "Orochi-EV" && (p2stateNo = [2100,2101])
Trigger1 = Movetype = A && stateno >= 200 || movetype = I
Trigger1 = Enemynear(var(58)),ctrl = 0
trigger2 = p2name = "Orochi Eagrose Version" && (p2StateNo = [2300,2301]) || p4name = "Orochi Eagrose Version" && (p2stateNo = [2300,2301]) || p2name = "Orochi-EV" && (p2StateNo = [2300,2301]) || p4name = "Orochi-EV" && (p2stateNo = [2300,2301])
Trigger2 = Movetype = A && stateno >= 200 || movetype = I
Trigger2 = Enemynear(var(58)),ctrl = 0

[state -1,バックステップ 投げ外し]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = p2bodydist X < 30
TriggerAll = Ctrl || (Stateno = [20,22]) || (Stateno = [100,101]) || (StateNo = [120,159]) || (StateNo = [200,499]) || stateno = 721
trigger1 = p2name = "Orochi Eagrose Version" && (p2StateNo = [2100,2101]) || p4name = "Orochi Eagrose Version" && (p2stateno = [2100,2101]) || p2name = "Orochi-EV" && (p2StateNo = [2100,2101]) || p4name = "Orochi-EV" && (p2stateNo = [2100,2101])
Trigger1 = Movetype = A && stateno >= 200 || movetype = I
Trigger1 = Enemynear(var(58)),ctrl = 0
trigger2 = p2name = "Orochi Eagrose Version" && (p2StateNo = [2300,2301]) || p4name = "Orochi Eagrose Version" && (p2stateNo = [2300,2301]) || p2name = "Orochi-EV" && (p2StateNo = [2300,2301]) || p4name = "Orochi-EV" && (p2stateNo = [2300,2301])
Trigger2 = Movetype = A && stateno >= 200 || movetype = I
Trigger2 = Enemynear(var(58)),ctrl = 0

[State -3,バックステップ 投げ外し]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = Enemynear(var(58)),life > 0
TriggerAll = Enemynear(var(58)),movetype != H
TriggerAll = Enemynear(var(58)),stateno >= 1000
TriggerAll = playerid(helper(33700+id),var(1)),stateno = fvar(0) || playerid(helper(33700+id),var(1)),stateno = fvar(1) || playerid(helper(33700+id),var(1)),stateno = fvar(2) || playerid(helper(33700+id),var(1)),stateno = fvar(3) || playerid(helper(33700+id),var(1)),stateno = fvar(4)
TriggerAll = playerid(helper(33700+id),var(1)),stateno != 358002
TriggerAll = Movetype = A && stateno >= 200 || movetype = I
TriggerAll = Enemynear(var(58)),ctrl = 0
TriggerAll = p2name != "Gustab Munchausen" && p4name != "Gustab Munchausen"
Trigger1 = Ctrl || (StateNo = [20,22]) || (StateNo = [100,101]) || (StateNo = [120,149])
Trigger1 = (PrevStateNo = [200,440]) || (PrevStateNo = [800,825]) || (PrevStateNo = [5000,5270]) || PrevStateNo = 52000
Trigger2 = Stateno = 200; && Animelem = 2,> 0
Trigger3 = Stateno = 230; && Animelem = 4,> 0
Trigger4 = Stateno = 250; && Animelem = 3,> 0
Trigger5 = StateNo = 240; && AnimElem = 2,> 0
Trigger6 = Stateno = 245; && Animelem = 3,> 0
Trigger7 = Stateno = 290; && Animelem = 5,> 0
Trigger8 = Stateno = 291; && Animelem = 5,> 0
Trigger9 = Stateno = 400; && Animelem = 2,> 0
Trigger10 = Stateno = 430; && Animelem = 2,> 0
Trigger11 = Stateno = 410; && Animelem = 4,> 0
Trigger12 = Stateno = 440; && Animelem = 3,> 0
Trigger13 = stateno = 1400
Trigger14 = stateno = ctrl
IgnoreHitPause = 1

[State -3,バックステップ 投げ外し]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = Enemynear(var(58)),life > 0
TriggerAll = Enemynear(var(58)),movetype != H
TriggerAll = Ctrl || (Stateno = [20,22]) || (Stateno = [100,101])|| (StateNo = [120,149])
TriggerAll = Enemynear(var(58)),stateno >= 1000
TriggerAll = playerid(helper(33700+id),var(1)),stateno = fvar(0) || playerid(helper(33700+id),var(1)),stateno = fvar(1) || playerid(helper(33700+id),var(1)),stateno = fvar(2) || playerid(helper(33700+id),var(1)),stateno = fvar(3) || playerid(helper(33700+id),var(1)),stateno = fvar(4)
TriggerAll = playerid(helper(33700+id),var(1)),stateno != 358002 && playerid(helper(33700+id),var(1)),stateno != 5150
TriggerAll = p2name != "Gustab Munchausen" && p4name != "Gustab Munchausen"
Trigger1 = Movetype = A && stateno >= 200 || movetype = I
Trigger1 = Enemynear(var(58)),ctrl = 0
Trigger2 = p2stateno >= 1000
Trigger2 = p2MoveType = I && !Enemynear(var(58)),NumProj
Trigger3 = p2stateno >= 1000
Trigger3 = p2stateno != [5000,5500]
Trigger3 = p2MoveType = H && !NumTarget

;?制-------------------------------------------------------------------------------------

[State -1, RUN]
Type = ChangeState
Value = IFELSE(RANDOM<=666,ifelse(random<=333,2200,2204),1900)
TriggerAll = var(59) 
TriggerAll = var(49) > 4  ;???面有4?以上的硬直出
TriggerAll = RoundState = 2
triggerall = p2bodydist x >= 20 
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),StateType != A
TriggerAll = EnemyNear(var(58)),StateType != L
TriggerAll = EnemyNear(var(58)),MoveType = H
TriggerAll = EnemyNear(var(58)),stateno != [5000,5199]
TriggerAll = Abs(EnemyNear(var(58)),Pos X - Pos X) <= 200;大概多少距?自己算，??内部AI里面要保??面在被打（防御和真被打）情况下一直?而不停
TriggerAll =!InGuardDist
Trigger1 = stateno = 1400 && animtime = 0 || ctrl

[State -1, RUN]
Type = ChangeState
Value = IFELSE(RANDOM<=500,1900,2200)
TriggerAll = var(59) 
TriggerAll = var(49) > 4  ;???面有4?以上的硬直出
TriggerAll = RoundState = 2
triggerall = p2bodydist x >= 20 
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),StateType != A
TriggerAll = EnemyNear(var(58)),StateType != L
TriggerAll = EnemyNear(var(58)),MoveType = H
TriggerAll = EnemyNear(var(58)),stateno != [5000,5199]
TriggerAll = Abs(EnemyNear(var(58)),Pos X - Pos X) >= 200;大概多少距?自己算，??内部AI里面要保??面在被打（防御和真被打）情况下一直?而不停
TriggerAll =!InGuardDist
Trigger1 = Ctrl || (StateNo = [20,22]) || (StateNo = [120,149])||(StateNo = [100,101])


[State -1, しゃがみ弱キック 下段起き攻め]
type = ChangeState
value = 210
triggerall = var(59) = 1
triggerall = var(44) = 1
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = P2BodyDist X = [-20,40]
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = enemynear(var(58)),stateno = 5120
trigger1 = enemynear(var(58)),animtime = -5



;?反-----------------------------------------------------------------------------

[State -1, 2b]
Type = NULL ;改?状?
Value = ifelse(EnemyNear(VAR(58)),StateType = C,400,200) ;状?号?400的技能
TriggerAll = var(59) = 1 ;AI??
TriggerAll = Alive ;存活
TriggerAll = RoundState = 2 ;?斗中
TriggerAll = Random <= 1000 ;概率
TriggerAll = StateType != A ;自己的状?，statetype分A（空中），S（站立），C（蹲下），L（倒地），?里statetype !=A也就是?自己不在空中触?
TriggerAll =!EnemyNear,Ctrl ;?面不可控?
TriggerAll = EnemyNear,StateNo >= 200 ;状?号>= 200，200以前一般不是?斗中的state （通常除了195 TAUNT）
TriggerAll = EnemyNear,StateType != A ;?面不在空中
TriggerAll = EnemyNear,StateType != L ;?面不倒地，也就是?面站立或者蹲下都可以
TriggerAll = EnemyNear,AnimTime <= -4 ;Animtime，?个理解?“自己?个技能的?生?数”，比如?400的?生?数?第5?，?就写enemynear,animtime <= -5,概念有点抽象，以后??
TriggerAll = EnemyNear,MoveType = I || EnemyNear,MoveType = A && EnemyNear,HitdefAttr != SCA,AA,AT,AP || EnemyNear,AnimTime <= -4 && ((PrevStateNo = [130,155]) || EnemyNear,Facing = Facing|| EnemyNear,AnimTime <= -4 && (prevstateno = [820,825])) ;?面未作出?作，或者?面?然是攻?状?，但未有任何攻?定?，或者是??面?剩5??候，自己之前的?作是防御来抓硬直，或者要?打背也可以
TriggerAll = EnemyNear,Time >= 0 ;?面TIME >= 0，反???,?里TIME >= 0就是超反?允?的意思
TriggerAll =!InGuardDist || EnemyNear,Facing = Facing|| EnemyNear,AnimTime <= -4 && (prevstateno = [820,825]) || EnemyNear,AnimTime <= -4 && (PrevStateNo = [130,155]) ;不?在防御范?内，或者背??面（如果是Inguarddist再??命中就是counter)，或者是抓最后的硬直
TriggerAll = Ctrl || (StateNo = [20,22])|| stateno = 52 || (StateNo = [100,101]) || (StateNo = [120,149]); （?一行非常重要，特?是ctrl，少了?一行如果触??个AI?人物会鬼畜）
Trigger1 = P2BodyDist X = [-40,30]; （算好与?面的距?，??反?）
trigger1 = var(32) := 40001

;近距離立ち強パンチ
[State -1, Stand Strong Punch]
type = ChangeState
Value = ifelse(EnemyNear(VAR(58)),StateType = S && random <= 500,200,400)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype != H
triggerall = enemynear(var(58)),stateno >= 200
triggerall = enemynear(var(58)),animtime <= -4
triggerall = enemy,numproj = 0
triggerall =!InGuardDist || enemynear(var(58)),facing = facing || EnemyNear,AnimTime <= -4 && (prevstateno = [130,155]) || (prevstateno = [700,720])
triggerall = p2bodydist X < 40
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2bodydist x = [-15,25]
trigger1 = var(32) := 43001

[state -1]
Type = ChangeState;ChangeState
Value = ifelse(EnemyNear(VAR(58)),StateType = S && random <= 500,200,400)
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),MoveType = A
TriggerAll = EnemyNear(var(58)),StateNo >= 200
TriggerAll = EnemyNear(var(58)),StateType != A
TriggerAll =!EnemyNear(var(58)),HitDefAttr = SCA, NT, ST, HT
TriggerAll = EnemyNear(var(58)),AnimTime <= -4
TriggerAll = EnemyNear(var(58)),Time >= 50
triggerall =!InGuardDist || enemynear(var(58)),facing = facing || (prevstateno = [130,155]) || (prevstateno = [700,720])
triggerALL = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || stateno = 1105 || stateno = 1115 || (stateno = [120,149])
Trigger1 = P2BodyDist X = [-20,25]
trigger1 = var(32) := 40002

[State -1, Crouching Light Punch]
type = ChangeState
;value = ifelse(Random <= 500,ifelse(random<=500,2110,2050),ifelse(random<=500,1400,1450))
value = ifelse(Random <=666,Ifelse(random<=333,ifelse(random<=500,2110,2050),ifelse(random<=500,1400,1500)),ifelse(random<=500,ifelse(random<=500,400,2100),ifelse(random<=500,1810,1820)))
triggerall = var(59)
triggerall = var(50) != 1
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl || stateno = 20|| stateno = 21|| stateno = 22|| stateno = 100|| stateno = 1940
triggerall = P2BodyDist X = [-20+floor(5*(EnemyNear(floor(fvar(37))),vel X)),30+floor(5*(EnemyNear(floor(fvar(37))),vel X))]
triggerall = P2BodyDist Y = [-10-floor(5*(EnemyNear(floor(fvar(37))),vel Y)+(5*(5+1)/2)*fvar(20)),0-floor(5*(EnemyNear(floor(fvar(37))),vel Y)+(5*(5+1)/2)*fvar(20))]
triggerall = P2statetype != L
triggerall = P2movetype != H
triggerall = !InGuardDist
triggerall = P2movetype != A
Trigger1 = Random <= 400
trigger1 = var(32) := 40003

[State -1, Crouching Light Kick]
type = ChangeState
value = ifelse(Random <=666,Ifelse(random<=333,ifelse(random<=500,2110,2050),ifelse(random<=500,1400,1500)),ifelse(random<=500,ifelse(random<=500,400,2100),ifelse(random<=500,1810,1820)))
triggerall = var(59)
triggerall = var(50) != 1
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl || stateno = 20|| stateno = 21|| stateno = 22|| stateno = 100|| stateno = 1940
triggerall = P2BodyDist X = [-5+floor(5*(EnemyNear(floor(fvar(37))),vel X)),15+floor(5*(EnemyNear(floor(fvar(37))),vel X))]
triggerall = P2BodyDist Y >= 0--floor(5*(EnemyNear(floor(fvar(37))),vel Y)+(5*(5+1)/2)*fvar(20))
triggerall = P2statetype != L
triggerall = P2movetype != H
triggerall = P2statetype != C
triggerall = !InGuardDist
Trigger1 = Random <= 300
trigger1 = var(32) := 40004

[State -1, Crouching Light Kick]
type = ChangeState
value = ifelse(Random <=666,Ifelse(random<=333,ifelse(random<=500,2110,2050),ifelse(random<=500,1400,1500)),ifelse(random<=500,ifelse(random<=500,400,2100),ifelse(random<=500,1810,1820)))
triggerall = var(59)
triggerall = var(50) != 1
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl || stateno = 20|| stateno = 21|| stateno = 22|| stateno = 100|| stateno = 1940
triggerall = P2BodyDist X = [-5,15]
triggerall = P2BodyDist Y >= 0
triggerall = P2statetype != L
triggerall = P2movetype = H
triggerall = P2statetype != A
triggerall = !InGuardDist
Trigger1 = Random <= 1000
trigger1 = var(32) := 40005

[State -1, Crouching Light Kick]
type = ChangeState
value = 400
TriggerAll = var(59)
triggerall = roundstate = 2
TriggerAll = StateType != A
TriggerAll = P2StateType = L
triggerall = ctrl || stateno = 20|| stateno = 21|| stateno = 22|| stateno = 100
Triggerall = P2BodyDist X = [-5,15]
Triggerall = Facing = EnemyNear(floor(fvar(37))),Facing
Triggerall = EnemyNear(floor(fvar(37))),AnimTime = -1
Trigger1 = P2StateNo = 5120
Trigger1 = Random <= 1000
trigger1 = var(32) := 40006

[State -1, Standing Strong Kick]
type = ChangeState
value = 430
triggerall = var(59)
triggerall = roundstate = 2
triggerall = P2BodyDist X = [-10,25]
triggerall = statetype != A
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [120,149])
triggerall = P2BodyDist Y = [100-floor(12*(EnemyNear(floor(fvar(37))),vel Y)+(12*(12+1)/2)*fvar(20)),200-floor(3*(EnemyNear(floor(fvar(37))),vel Y)+(12*(12+1)/2)*fvar(20))]
triggerall = P2statetype != L
triggerall = P2movetype != H
triggerall = !InGuardDist
Trigger1 = Random <= 400
trigger1 = var(32) := 40007

;抓硬直-----------------------------------------------------------------------------

[State -1, Dash]
type = ChangeState
value = 100
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = statetype != A
triggerall = enemynear(var(58)),Time >= 10 && p2statetype = A && p2bodydist x >= 10|| p2statetype != A
triggerall =!InGuardDist
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [120,149]) || (stateno = [910,913])
trigger1 = p2bodydist x > 120 || enemynear(var(58)),facing = facing
trigger1 = enemynear(var(58)),statetype = A
trigger1 = enemynear(var(58)),MoveType = A
trigger1 =!enemynear(var(58)),HitDefAttr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT
trigger1 = enemynear(var(58)),Time >= 60
trigger2 = enemynear(var(58)),MoveType != H
trigger2 = enemynear(var(58)),StateType = A
trigger2 =!enemynear(var(58)),Ctrl
trigger2 = enemynear(var(58)),facing = facing
Trigger3 = EnemyNear(var(58)),MoveType != H
Trigger3 = EnemyNear(var(58)),StateType != A
Trigger3 =!EnemyNear(var(58)),Ctrl
Trigger3 = EnemyNear(var(58)),facing = facing
Trigger3 = EnemyNear(var(58)),HitDefAttr = SC, NA, SA, HA

;強百式・鬼焼き
[State -1, S ONIYAKI]
type = ChangeState;ChangeState
value = 400
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),time >= 50;50
triggerall = Random <= 600
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),MoveType = A
triggerall = enemynear(var(58)),StateNo >= 200
triggerall = enemynear(var(58)),facing != facing
triggerall = InGuardDist
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || stateno = 1105 || stateno = 1115 || (stateno = [120,149]) 
trigger1 = p2bodydist x = [-5,22]
trigger1 = enemynear(var(58)),animtime <= -4
trigger1 = var(32) := 40007



[State -3, Stand Strong Punch]
type = ChangeState
value = 400
triggerall = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),movetype = A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),stateno = [200,1000)
triggerall = p2bodydist X = [-5,24]
triggerall = enemynear(var(58)),time = [0,5]
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || stateno = 1105 || stateno = 1115 || (stateno = [120,149])
trigger1 = (enemynear(var(58)), StateNo = Helper(999), var(1)) && enemynear(var(58)), Time < (Helper(999), var(2) - 4)
trigger2 = (enemynear(var(58)), StateNo = Helper(999), var(3)) && enemynear(var(58)), Time < (Helper(999), var(4) - 4)
trigger3 = (enemynear(var(58)), StateNo = Helper(999), var(5)) && enemynear(var(58)), Time < (Helper(999), var(6) - 4)
trigger4 = (enemynear(var(58)), StateNo = Helper(999), var(7)) && enemynear(var(58)), Time < (Helper(999), var(8) - 4)
trigger5 = (enemynear(var(58)), StateNo = Helper(999), var(9)) && enemynear(var(58)), Time < (Helper(999), var(10) - 4)
trigger6 = (enemynear(var(58)), StateNo = Helper(999), var(11)) && enemynear(var(58)), Time < (Helper(999), var(12) - 4)
trigger7 = (enemynear(var(58)), StateNo = Helper(999), var(13)) && enemynear(var(58)), Time < (Helper(999), var(14) - 4)
trigger8 = (enemynear(var(58)), StateNo = Helper(999), var(15)) && enemynear(var(58)), Time < (Helper(999), var(16) - 4)
trigger9 = (enemynear(var(58)), StateNo = Helper(999), var(17)) && enemynear(var(58)), Time < (Helper(999), var(18) - 4)
trigger10 = (enemynear(var(58)), StateNo = Helper(999), var(19)) && enemynear(var(58)), Time < (Helper(999), var(20) - 4)
trigger11 = (enemynear(var(58)), StateNo = Helper(999), var(21)) && enemynear(var(58)), Time < (Helper(999), var(22) - 4)
trigger12 = (enemynear(var(58)), StateNo = Helper(999), var(23)) && enemynear(var(58)), Time < (Helper(999), var(24) - 4)
trigger13 = (enemynear(var(58)), StateNo = Helper(999), var(25)) && enemynear(var(58)), Time < (Helper(999), var(26) - 4)
trigger14 = (enemynear(var(58)), StateNo = Helper(999), var(27)) && enemynear(var(58)), Time < (Helper(999), var(28) - 4)
trigger15 = (enemynear(var(58)), StateNo = Helper(999), var(29)) && enemynear(var(58)), Time < (Helper(999), var(30) - 4)
trigger16 = (enemynear(var(58)), StateNo = Helper(999), var(31)) && enemynear(var(58)), Time < (Helper(999), var(32) - 4)
trigger17 = (enemynear(var(58)), StateNo = Helper(999), var(33)) && enemynear(var(58)), Time < (Helper(999), var(34) - 4)
trigger18 = (enemynear(var(58)), StateNo = Helper(999), var(35)) && enemynear(var(58)), Time < (Helper(999), var(36) - 4)
trigger19 = (enemynear(var(58)), StateNo = Helper(999), var(37)) && enemynear(var(58)), Time < (Helper(999), var(38) - 4)
trigger20 = (enemynear(var(58)), StateNo = Helper(999), var(39)) && enemynear(var(58)), Time < (Helper(999), var(40) - 4)
trigger21 = (enemynear(var(58)), StateNo = Helper(999), var(41)) && enemynear(var(58)), Time < (Helper(999), var(42) - 4)
trigger22 = (enemynear(var(58)), StateNo = Helper(999), var(43)) && enemynear(var(58)), Time < (Helper(999), var(44) - 4)
trigger23 = (enemynear(var(58)), StateNo = Helper(999), var(45)) && enemynear(var(58)), Time < (Helper(999), var(46) - 4)
trigger24 = (enemynear(var(58)), StateNo = Helper(999), var(47)) && enemynear(var(58)), Time < (Helper(999), var(48) - 4)
trigger25 = (enemynear(var(58)), StateNo = Helper(999), var(49)) && enemynear(var(58)), Time < (Helper(999), var(50) - 4)
trigger26 = (enemynear(var(58)), StateNo = Helper(999), var(51)) && enemynear(var(58)), Time < (Helper(999), var(52) - 4)
trigger27 = (enemynear(var(58)), StateNo = Helper(999), var(53)) && enemynear(var(58)), Time < (Helper(999), var(54) - 4)
trigger28 = (enemynear(var(58)), StateNo = Helper(999), var(55)) && enemynear(var(58)), Time < (Helper(999), var(56) - 4)


;连段-----------------------------------------------------------------------------

[State -1, ?段]
type = ChangeState;ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = (stateno = 245||stateno = 215||stateno = 210||stateno = 240) && movehit
trigger1 = var(50) = 0
trigger1 = statetype != A
trigger1 = var(57) := ifelse(random<=500,ifelse(random<=500 && p2bodydist x<= 50,ifelse(random <= 500 && power >= 1000,3400,2000),2050),ifelse(random>=500,1400,1300));2000;2050;1400ifelse(random<=500,ifelse(random<=500,2000,2050),ifelse(random<=500,1400,1300))
trigger2 = enemynear(var(58)),STATENO >= 5000 && ifelse(var(41)< 130,enemynear(var(58)),vel y > 0,enemynear(var(58)),vel y >= 0)
trigger2 = enemynear(var(58)),HitShakeOver = 1
trigger2 = p2bodydist y = [-70-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger2 = (ctrl || (stateno = [20,22])) && var(50) = 1
trigger2 = var(57) := ifelse(var(41)< 130,410,1450)
trigger3 = stateno = 410 && movehit
trigger3 = var(50) = 1
trigger3 = var(57) := 1450
trigger4 = stateno = 1451 && enemynear(var(58)),vel y >= 0 && hitcount >= 2
trigger4 = var(50) = 1
trigger4 = enemynear(var(58)),HitShakeOver = 1
trigger4 = var(57) := 2110
trigger5 = statetype != A
trigger5 = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger5 = p2bodydist y = [-230-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger5 = enemynear(var(58)),vel y > 0
trigger5 = var(50) = 2
trigger5 = var(57) := 38 
trigger6 = stateno = 50 && statetype = A
trigger6 = p2bodydist y = [-200-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger6 = var(50) = 2 && vel x = 0 
trigger6 = var(57) := 650 
trigger7 = STATENO = 650 && movehit 
trigger7 = var(50) = 2
trigger7 = statetype = A
trigger7 = var(57) := ifelse(var(29) < 15,2253,2151)

[State -1, ?段]
type = ChangeState;ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = STATENO = 2050 && movehit && hitcount >= 9
trigger1 = statetype != A
trigger1 = var(57) := 2200
trigger2 = STATENO = 2200 && animtime = 0
trigger2 = statetype != A
trigger2 = var(50) = 3
trigger2 = var(57) := 22
trigger3 = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger3 = p2bodydist y = [-160-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger3 = p2bodydist x <= 40
trigger3 = statetype != A
trigger3 = var(50) = 3
trigger3 = var(57) := 410
trigger4 = STATENO = 410 && movehit 
trigger4 = var(50) = 3
trigger4 = statetype != A
trigger4 = var(57) := 2100
trigger5 = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger5 = statetype != A
trigger5 = p2bodydist y = [-200-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger5 = var(50) = 4
trigger5 = var(57) := 1450

[State -1, ?段]
type = ChangeState;ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = STATENO = 2000 && movehit && hitcount >= 5
trigger1 = statetype != A
trigger1 = var(50) = 5
trigger1 = var(57) := ifelse(var(41)< 150,2203,2200)
trigger2 = (STATENO = 2200 || STATENO = 2203)&& animtime = 0
trigger2 = statetype != A
trigger2 = var(50) = 5
trigger2 = var(57) := 410
trigger3 = STATENO = 410 && movehit
trigger3 = statetype != A
trigger3 = var(50) = 5
trigger3 = var(57) := 1450
trigger4 = STATENO = 1451 && movehit && AnimElemtime(12) >= 0
trigger4 = statetype != A
trigger4 = var(50) = 5
trigger4 = var(57) := 1500
trigger5 = STATENO = 1501 && animtime = 0
trigger5 = statetype != A
trigger5 = var(50) = 5
trigger5 = var(57) := 200
trigger6 = STATENO = 1501 && animtime = 0
trigger6 = statetype != A
trigger6 = var(50) = 5
trigger6 = var(57) := 200
trigger7 = (stateno = 245||stateno = 215||stateno = 210||stateno = 240) && movehit
trigger7 = statetype != A
trigger7 = var(50) = 5
trigger7 = var(57) := 1300

[State -1, ?段]
type = ChangeState;ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
trigger1 = STATENO = 1320 && movehit
trigger1 = statetype != A
trigger1 = var(50) = 6
trigger1 = var(57) := 2200
trigger2 = STATENO = 2200 && animtime = 0
trigger2 = statetype != A
trigger2 = var(50) = 6
trigger2 = var(57) := ifelse(var(30) = 0,215,ifelse(var(30) = 5,240,ifelse(var(30) = 10,210,245)))
trigger3 = (stateno = 245||stateno = 215||stateno = 210||stateno = 240||stateno = 440) && movehit
trigger3 = statetype != A
trigger3 = var(50) = 6
trigger3 = var(57) := ifelse(stateno = 245,1500,2200)
trigger4 = stateno = 1500 && movehit
trigger4 = statetype != A
trigger4 = var(50) = 6
trigger4 = var(57) := 2100

[State -1, ?段]
type = ChangeState;ChangeState
value = var(57)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = H
triggerall = (enemynear(var(58)),stateno = [5000,5200]) || enemynear(var(58)),stateno = 2056 || enemynear(var(58)),stateno = 1160 && var(50) = 8
;triggerall = var(50) > 0
trigger1 = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2bodydist y = [-185-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),200-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger1 = enemynear(var(58)),vel y > 0 && enemynear(var(58)),stateno = 2056
trigger1 = (var(50) = 0 || var(50) = 6) &&  statetype != A
trigger1 = var(57) := 1150
trigger2 = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger2 = p2bodydist y = [-65-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),200-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger2 = enemynear(var(58)),vel y > 0 && enemynear(var(58)),HitShakeOver = 1
trigger2 = var(50) != 1 && var(50) != 8 && statetype != A
trigger2 = var(57) := 1150
trigger3 = STATENO = 1150 && enemynear(var(58)),vel y <= 0
trigger3 = statetype != A
trigger3 = var(50) = 7 && p2bodydist x >= 100
;trigger3 = life <= ceil(lifemax/3) || enemynear(var(58)),life <= ceil(lifemax/3)
trigger3 = power>= 1000
trigger3 = var(57) := ifelse(power >= 2000 && (enemynear(var(58)),life<ceil(lifemax/2) || life<ceil(lifemax/3)),3300,3100)
trigger4 = STATENO = 1150 && enemynear(var(58)),vel y > 0
trigger4 = statetype != A
trigger4 = var(50) = 7 
trigger4 = p2bodydist y = [-40-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger4 = p2bodydist x < 100
trigger4 = var(57) := 1155
trigger5 = (STATENO = 1155 || ctrl) && enemynear(var(58)),vel y > 0
trigger5 = statetype != A
trigger5 = var(50) = 8
trigger5 = p2dist x > 0
trigger5 = p2bodydist y = [-70-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),40-floor(12*(enemynear(var(58)),vel y)+(12*(12+1)/2)*fvar(20))]
trigger5 = var(57) := 2050
trigger6 = STATENO = 410 && movehit
trigger6 = statetype != A
trigger6 = var(50) = 0
trigger6 = var(57) := 2100
trigger7 = ProjHit1400 = 1 && ctrl
trigger7 = statetype != A
trigger7 = var(50) = 0
trigger7 = var(57) := 2110
trigger8 = stateno = 2050 && movehit &&  enemynear(var(58)),stateno = 2056
trigger8 = statetype != A
trigger8 = var(50) = 8
trigger8 = var(57) := ifelse(power >= 2000 && (enemynear(var(58)),life<ceil(lifemax/2)|| life<ceil(lifemax/3)),3300,3100)
;ab----------------------------------------------------------------------------

[State -1, BB]
Type = ChangeState
Value = ifelse(var(41) <= 100,2204,2203)
TriggerAll = var(59)
TriggerAll = roundstate = 2 && EnemyNear(var(58)),life > 0 && fvar(22) = 0
TriggerAll = StateNo = 5120 && AnimTime = [-1,0]
TriggerAll = Abs(EnemyNear(var(58)),Pos X - Pos X) = [0,80]
trigger1 = Random <= 10|| Life <= ceil(lifemax/3)&& Random <= 100


[State -1, GCFRoll]
type = ChangeState;ChangeState
value = 2200
triggerall = var(59) 
triggerall = RoundState = 2
triggerall = power >= 1000
triggerall = Random <= 10|| Life <= ceil(lifemax/3) && Random <= 100
triggerall = StateType != A
triggerall = (stateno = 150 || stateno = 152) && HitShakeOver
trigger1 = enemynear(var(58)),StateNo >= 200
trigger1 = enemynear(var(58)),statetype != A
trigger1 = enemynear(var(58)),MoveType = A
trigger1 = enemynear(var(58)),AnimTime <= -30

[State -1, GC_Q]
type = ChangeState;ChangeState
value = 2200
triggerall = var(59)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = Power >= 1000
triggerall = Random <= 10|| Life <= ceil(lifemax/3) && Random <= 100
triggerall = EnemyNear(var(58)),statetype != L
triggerall = EnemyNear(var(58)),statetype != A
triggerall = EnemyNear(var(58)),StateNo >= 200
triggerall = !EnemyNear(var(58)),Ctrl 
TriggerAll = EnemyNear(var(58)),facing + facing = 0
triggerall = StateNo = 150 || StateNo = 151 || StateNo = 152
trigger1 = EnemyNear(var(58)),HitDefAttr = SCA,NP,SP,HP||EnemyNear(var(58)),numproj
trigger1 = EnemyNear(var(58)),AnimTime<=-29
trigger2 = P2BodyDist X = [-10,100]
trigger2 = EnemyNear(var(58)),AnimTime<=-30

;前転
[State -1, FRoll]
type = ChangeState
value = 2203
triggerall = var(59) 
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = enemynear(var(58)),time >= 0   
triggerall = Random <= 10|| Life <= ceil(lifemax/2) && Random <= 100
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype != H
triggerall = enemynear(var(58)),StateNo >= 200
triggerall =!enemynear(var(58)),HitDefAttr = SCA, AT
triggerall = enemynear(var(58)),facing != facing
triggerall = InGuardDist
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || stateno = 1150|| (stateno = [120,149])
trigger1 = p2bodydist X = [0,150]
trigger1 = enemynear(var(58)),animtime <= -29

;後転
[State -3]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = BackEdgeBodyDist >= 20
triggerall = Random <= 10|| Life <= ceil(lifemax/2) && Random <= 100
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll =!EnemyNear(var(58)),HitDefAttr = SCA, NT, ST, HT
TriggerAll = EnemyNear(var(58)),StateNo < 1000
TriggerAll = EnemyNear(var(58)),MoveType = A || EnemyNear(var(58)),Ctrl
TriggerAll = EnemyNear(var(58)),facing != facing
TriggerAll =!Enemy,NumProj
TriggerAll = Ctrl || StateNo = [120,149]
Trigger1 = P2BodyDist X = [20,140]
Trigger1 = Random < 50



[state -1,回り込み、後 切り返し]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
triggerall = Random <= 10|| Life <= ceil(lifemax/2) && Random <= 100
TriggerAll = StateType != A
TriggerAll = BackEdgeBodyDist >= 40
TriggerAll =!Enemy,Numproj
TriggerAll = EnemyNear(var(58)),MoveType = A && EnemyNear(var(58)),StateNo >= 200
TriggerAll = EnemyNear(var(58)),StateType != A
TriggerAll =!EnemyNear(var(58)),HitDefAttr = SC, NT, ST, HT
TriggerAll = EnemyNear(var(58)),Time >= 0
TriggerAll = EnemyNear(var(58)),facing != facing
TriggerAll = InGuardDist
TriggerAll = Ctrl || (StateNo = [120,149]) || StateNo = 100
Trigger1 =(P2BodyDist X = [-5,50]) &&  EnemyNear(var(58)),AnimTime > -3
Trigger2 =(P2BodyDist X = [30,70]) &&  EnemyNear(var(58)),AnimTime > -29



[state -1,バックステップ 投げ外し]
Type = ChangeState
value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = BackEdgeBodyDist >= 30
TriggerAll = EnemyNear(var(58)),Time >= 0
TriggerAll = EnemyNear(var(58)),facing != facing
TriggerAll = Ctrl || StateNo = [120,149]
Trigger1 = P2BodyDist X = [-5,60]
Trigger1 = EnemyNear(var(58)),Vel Y >= 0
Trigger1 = EnemyNear(var(58)),HitDefAttr = SCA,NT,ST,HT


;後転
[State -1, BRoll]
type = ChangeState
value = 2204
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),time >= 0
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),Vel X <= 0
triggerall = enemynear(var(58)),StateNo >= 200
triggerall = enemynear(var(58)),MoveType = A
triggerall =!enemynear(var(58)),HitDefAttr = SCA, NT, ST, HT
triggerall = enemynear(var(58)),facing != facing
triggerall = p2bodydist x <= 25 && enemynear(var(58)),AnimTime > -5 || p2bodydist x > 25
triggerall = BackEdgeBodyDist >= 20
triggerall = InGuardDist
triggerall =!enemy,numproj
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || stateno = 1150 || (stateno = [120,159])
trigger1 = p2bodydist x <= 45 && enemynear(var(58)),AnimTime >= -5
trigger2 = p2bodydist x <= 55 && enemynear(var(58)),AnimTime >= -16
trigger3 = p2bodydist x <= 65 && enemynear(var(58)),AnimTime >= -17
trigger4 = p2bodydist x <= 75 && enemynear(var(58)),AnimTime >= -18
trigger5 = p2bodydist x <= 85 && enemynear(var(58)),AnimTime >= -19
trigger6 = p2bodydist x <= 95 && enemynear(var(58)),AnimTime >= -20

[State -1, 中ジャンプ(対投げ用)]
type = ChangeState;ChangeState
value = 1900
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = Random <= 500||(enemynear(var(58)),statetype = A) && Random <= 700
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || stateno = 1150  || (stateno = [120,149])
trigger1 = p2bodydist x = [-20,150]
;trigger1 = enemynear(var(58)),statetype = A
trigger1 = enemynear(var(58)),HitDefAttr = SCA, NT, ST, HT

;精防写在防御上面----------------------------------------------------------------------------

[State -1, Standing Parry AI]
type=HitOverride
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149])|| (stateno = [160,161])
trigger1 = (enemynear(var(58)), StateNo = Helper(998), var(1))
trigger2 = (enemynear(var(58)), StateNo = Helper(998), var(3))
trigger3 = (enemynear(var(58)), StateNo = Helper(998), var(5))
trigger4 = (enemynear(var(58)), StateNo = Helper(998), var(7))
trigger5 = (enemynear(var(58)), StateNo = Helper(998), var(9))
trigger6 = (enemynear(var(58)), StateNo = Helper(998), var(11))
trigger7 = (enemynear(var(58)), StateNo = Helper(998), var(13))
trigger8 = (enemynear(var(58)), StateNo = Helper(998), var(15))
trigger9 = (enemynear(var(58)), StateNo = Helper(998), var(17))
trigger10 = (enemynear(var(58)), StateNo = Helper(998), var(19))
trigger11 = (enemynear(var(58)), StateNo = Helper(998), var(21))
trigger12 = (enemynear(var(58)), StateNo = Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo = Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo = Helper(998), var(27)) 
trigger15 = (enemynear(var(58)), StateNo = Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo = Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo = Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo = Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo = Helper(998), var(37))  
trigger20 = (enemynear(var(58)), StateNo = Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo = Helper(998), var(41))  
trigger22 = (enemynear(var(58)), StateNo = Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo = Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo = Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo = Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo = Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo = Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo = Helper(998), var(55))
slot=0
stateno=160
attr=SA,AA,AP
time=20

;---------------------------------------------------------------
[State -1, Crouching Parry AI]
type=HitOverride
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149]) || (stateno = [160,161])
trigger1 = enemynear,hitdefattr=SA,AA,AP && random< ifelse(helper(90000),var(40) >= 2,ifelse(helper(90000),var(40) >= 5,1000,300),100)
trigger2 = enemynear(var(58)),NUMPROJ > 0 && RANDOM <= ifelse(enemynear(var(58)),stateno >= 2000 && life<=ceil(lifemax/3),1000,ifelse(life<=ceil(lifemax/2),300,100))
trigger3 = (enemynear,numhelper - helper(90000),var(7) >= 1) && RANDOM <= ifelse(enemynear(var(58)),stateno >= 2000 && life<=ceil(lifemax/3),1000,ifelse(life<=ceil(lifemax/2),300,100))
trigger4 = helper(90000),var(51) = 1
slot=0
stateno=160
attr=SA,AA,AP
time=20
;---------------------------------------------------------------
[State -1, Crouching Parry AI]
type=HitOverride
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149])|| (stateno = [160,161])
trigger1 = enemynear,hitdefattr=C,AA,AP && random < ifelse(helper(90000),var(40) >= 2,ifelse(helper(90000),var(40) >= 5,1000,300),100)
trigger2 = enemynear,hitdefattr=C,AA,AP && helper(90000),var(40) >= 5
slot=0
stateno=161
attr=C,AA,AP
time=20

;-------------------------------------------------------------------
[State -1, Crouching Parry AI]
type=HitOverride
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = StateType = A
triggerall = ctrl || (stateno = [120,149]) || stateno = 162 || anim = 105 || stateno = [1910,1930]
trigger1 = enemynear(var(58)),NUMPROJ > 0 && RANDOM <= ifelse(enemynear(var(58)),stateno >= 2000 && life<=ceil(lifemax/3),1000,ifelse(life<=ceil(lifemax/2),500,300))
trigger2 = (enemynear,numhelper - helper(90000),var(7) >= 1) && RANDOM <= ifelse(enemynear(var(58)),stateno >= 2000 && life<=ceil(lifemax/3),1000,ifelse(life<=ceil(lifemax/2),500,300))
trigger3 = helper(90000),var(40) >= 5
trigger4 = helper(90000),var(51) = 1
trigger5 = enemynear,hitdefattr=SA,AA,AP && random>=500
forceair=1
slot=0
stateno=162
attr=SA,AA,AP
time=20
;-------------------------------------------------------------------

[State -1, Standing Parry AI]
type=HitOverride
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),time <= 10
triggerall = StateType = A
triggerall = ctrl || (stateno = [120,149]) || stateno = 162 || anim = 105 || stateno = [1910,1930]
trigger1 = (enemynear(var(58)), StateNo = Helper(998), var(1))
trigger2 = (enemynear(var(58)), StateNo = Helper(998), var(3))
trigger3 = (enemynear(var(58)), StateNo = Helper(998), var(5))
trigger4 = (enemynear(var(58)), StateNo = Helper(998), var(7))
trigger5 = (enemynear(var(58)), StateNo = Helper(998), var(9))
trigger6 = (enemynear(var(58)), StateNo = Helper(998), var(11))
trigger7 = (enemynear(var(58)), StateNo = Helper(998), var(13))
trigger8 = (enemynear(var(58)), StateNo = Helper(998), var(15))
trigger9 = (enemynear(var(58)), StateNo = Helper(998), var(17))
trigger10 = (enemynear(var(58)), StateNo = Helper(998), var(19))
trigger11 = (enemynear(var(58)), StateNo = Helper(998), var(21))
trigger12 = (enemynear(var(58)), StateNo = Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo = Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo = Helper(998), var(27)) 
trigger15 = (enemynear(var(58)), StateNo = Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo = Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo = Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo = Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo = Helper(998), var(37))  
trigger20 = (enemynear(var(58)), StateNo = Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo = Helper(998), var(41))  
trigger22 = (enemynear(var(58)), StateNo = Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo = Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo = Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo = Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo = Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo = Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo = Helper(998), var(55))
forceair=1
slot=0
stateno=162
attr=SA,AA,AP
time=20

;後転
[State -3]
Type = ChangeState
Value = 105
TriggerAll = var(59) = 1 
TriggerAll = Helper(90000),var(8) - Helper(90000),var(7) >= 1 || enemynear(var(58)),NUMPROJ > 0 && enemynear(var(58)),stateno >= 2000
TriggerAll = RoundState = 2
TriggerAll = StateType != A
triggerall = enemynear(var(58)),movetype = A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = (enemynear(var(58)), StateNo = Helper(998), var(1))
trigger2 = (enemynear(var(58)), StateNo = Helper(998), var(3))
trigger3 = (enemynear(var(58)), StateNo = Helper(998), var(5))
trigger4 = (enemynear(var(58)), StateNo = Helper(998), var(7))
trigger5 = (enemynear(var(58)), StateNo = Helper(998), var(9))
trigger6 = (enemynear(var(58)), StateNo = Helper(998), var(11))
trigger7 = (enemynear(var(58)), StateNo = Helper(998), var(13))
trigger8 = (enemynear(var(58)), StateNo = Helper(998), var(15))
trigger9 = (enemynear(var(58)), StateNo = Helper(998), var(17))
trigger10 = (enemynear(var(58)), StateNo = Helper(998), var(19))
trigger11 = (enemynear(var(58)), StateNo = Helper(998), var(21))
trigger12 = (enemynear(var(58)), StateNo = Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo = Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo = Helper(998), var(27)) 
trigger15 = (enemynear(var(58)), StateNo = Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo = Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo = Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo = Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo = Helper(998), var(37))  
trigger20 = (enemynear(var(58)), StateNo = Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo = Helper(998), var(41))  
trigger22 = (enemynear(var(58)), StateNo = Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo = Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo = Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo = Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo = Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo = Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo = Helper(998), var(55))

;後転
[State -3]
Type = ChangeState
Value = ifelse(p2bodydist x<= 60,105,100)
TriggerAll = var(59) = 1 
TriggerAll = !(Helper(90000),var(8) - Helper(90000),var(7) >= 1 || enemynear(var(58)),NUMPROJ > 0 && enemynear(var(58)),stateno >= 2000)
TriggerAll = RoundState = 2
TriggerAll = StateType != A
triggerall = enemynear(var(58)),movetype = A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || stateno = 101 || (stateno = [120,149])
trigger1 = (enemynear(var(58)), StateNo = Helper(998), var(1))
trigger2 = (enemynear(var(58)), StateNo = Helper(998), var(3))
trigger3 = (enemynear(var(58)), StateNo = Helper(998), var(5))
trigger4 = (enemynear(var(58)), StateNo = Helper(998), var(7))
trigger5 = (enemynear(var(58)), StateNo = Helper(998), var(9))
trigger6 = (enemynear(var(58)), StateNo = Helper(998), var(11))
trigger7 = (enemynear(var(58)), StateNo = Helper(998), var(13))
trigger8 = (enemynear(var(58)), StateNo = Helper(998), var(15))
trigger9 = (enemynear(var(58)), StateNo = Helper(998), var(17))
trigger10 = (enemynear(var(58)), StateNo = Helper(998), var(19))
trigger11 = (enemynear(var(58)), StateNo = Helper(998), var(21))
trigger12 = (enemynear(var(58)), StateNo = Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo = Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo = Helper(998), var(27)) 
trigger15 = (enemynear(var(58)), StateNo = Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo = Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo = Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo = Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo = Helper(998), var(37))  
trigger20 = (enemynear(var(58)), StateNo = Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo = Helper(998), var(41))  
trigger22 = (enemynear(var(58)), StateNo = Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo = Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo = Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo = Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo = Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo = Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo = Helper(998), var(55))


;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
;防御(ガード等)
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━


[State -1, Guard]
type = ChangeState
value = 120
triggerall = var(59) 
triggerall = helper(90000),var(52) != 1
triggerall = stateno != [120,159]
triggerall = ctrl || stateno = 0 || (stateno = [20,22]) || (stateno = [100,101]) || stateno = 106 || (stateno = [160,162]) && time >= 15 && statetype != A
trigger1 = inguarddist
trigger1 = var(32) := 12001
trigger2 = inguarddist
trigger2 = p2bodydist x > 90 || enemynear(var(58)),time > 50
trigger2 = var(32) := 12002
trigger3 = inguarddist
trigger3 = enemynear(var(58)),numhelper > 0 || enemy,numproj > 0
trigger3 = var(32) := 12003
trigger4 = enemynear(var(58)),movetype = A
trigger4 = !enemynear(var(58)),hitdefattr = SCA, NT, ST, HT
trigger4 = stateno != 100 || stateno = 100 && p2dist y > -45 || numenemy >= 2
trigger4 = p2bodydist x < 0
trigger4 = p2dist x > 0 || p2dist x < 0
trigger4 = var(32) := 12004
trigger5 = inguarddist
trigger5 = numenemy > 1
trigger5 = enemy(0),numhelper+enemy(1),numhelper > 0 || enemy(0),numproj+enemy(1),numproj > 0
trigger5 = var(32) := 12005
trigger6 = enemynear(var(58)),facing != facing
trigger6 = numhelper(31000+id)
trigger6 = helper(31000+id),inguarddist
trigger6 = !enemynear(var(58)),hitdefattr = SCA, NT, ST, HT
trigger6 = var(32) := 12006

[State -1,蹲防]
type = ChangeState
value = 131 ;蹲防的stateno
triggerall = var(59) && statetype !=A ;ai??且自身不在空中
triggerall = p2statetype = C
triggerall = !EnemyNear,hitdefattr = SCA,AT,ST,NT ;?手不能出投技
triggerall = ctrl && p2statetype !=A ;?里加一个?手不在空中保?起?。
trigger1 = inguarddist ;inguarddist之前已?提到?了，大家仔?看的可能会注意到，不?待会?会?
trigger1 = facing !=EnemyNear,facing ;facing 和 enemynear,facing的?系:enemynear,facing = facing?不面??手，反之面?
trigger2 = p2bodydist x < 0 && p2movetype = A ;当?手在?背后?不算在inguarddist内
;---------------------------------------------------------------------------
[State -1,立防]
type = ChangeState
value = 130 ;站防stateno
triggerall = var(59) && statetype !=A
triggerall = p2statetype != C
triggerall = !EnemyNear,hitdefattr = SCA,AT,ST,NT ;?手不能出投技
triggerall = ctrl
trigger1 = inguarddist
trigger1 = facing!= EnemyNear,facing ;面??手，并且inguarddist
trigger2 = facing!= EnemyNear,facing
trigger2 = p2dist x > 0
trigger2 = p2bodydist x = [-10,60] ;距?
trigger2 = p2movetype = A ;不面??手，但是?面?个?候可能是打逆的，最好使用站防
trigger3 = p2bodydist x < 0 && p2movetype = A ;同上
;---------------------------------------------------------------------------
[State -1,空防]
type = ChangeState
value = 132 ;空防stateno
triggerall = var(59)
triggerall = ctrl && statetype = A ;自身在空中
triggerall = STATENO != 162
trigger1 = var(32) := 12001
trigger1 = inguarddist
trigger2 = p2bodydist x < 0 && p2movetype = A ;同上
trigger2 = var(32) := 12001

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

;?制--------------------------------------------------------------------------

[State -1, Stand Strong Punch]
type = null
value = 1800
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = StateType != A
triggerall = enemynear(var(58)),StateType = A
triggerall = enemynear(var(58)),vel y >= 0
Triggerall = enemynear(var(58)),StateType != L
triggerall = enemynear(var(58)),movetype != H
triggerall = enemynear(var(58)),stateno != [5020,5040]
triggerall = enemynear(var(58)),facing != facing
triggerall =!InGuardDist
triggerall = p2bodydist X < 60
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2bodydist x = [0+floor(6*(enemynear(var(58)),vel x)),50+floor(6*(enemynear(var(58)),vel x))]
trigger1 = p2bodydist y = [-80-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20)),0-floor(6*(enemynear(var(58)),vel y)+(6*(6+1)/2)*fvar(20))]

[State -1, Stand Light Kick]
type = null
value = 1800
triggerall = var(59) 
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = Random <= 100
triggerall = StateType != A
triggerall = enemynear(var(58)),statetype = A
triggerall = enemynear(var(58)),StateType != L
triggerall = enemynear(var(58)),movetype != H
triggerall = enemynear(var(58)),stateno != [5020,5040]
triggerall = enemynear(var(58)),facing != facing
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || stateno = 115 || (stateno = [120,149])
trigger1 = p2bodydist x = [5+floor(7*(enemynear(var(58)),vel x)),65+floor(7*(enemynear(var(58)),vel x))]
trigger1 = p2bodydist y = [-60-floor(7*(enemynear(var(58)),vel y)+(7*(7+1)/2)*fvar(20)),0-floor(7*(enemynear(var(58)),vel y)+(7*(7+1)/2)*fvar(20))]


;しゃがみ弱キック
[State -1, Crouching Light Kick]
type = ChangeState
value = 430
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype = I || ((enemynear(var(58)),stateno = [120,159]) && random <= 250)
triggerall = enemynear(var(58)),stateno != [5710,5715]
triggerall =!InGuardDist || enemynear(var(58)),facing = facing
triggerall = p2bodydist x = [-5,20]
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = random <= 200 && ifelse(enemynear(var(58)),statetype = S,1,random <= 250)

;近距離立ち強パンチ
[State -1, 奈落落]
type = ChangeState
value = ifelse(random<=500,400,430)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall =!InGuardDist || enemynear(var(58)),facing = facing
triggerall = p2bodydist x = [-10,30]
triggerall = p2bodydist X < 20
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149]) || stateno = 1105 || stateno = 1115
trigger1 = enemynear(var(58)),movetype = H
trigger1 = enemynear(var(58)),stateno != [120,159]


;しゃがみ弱パンチ
[State -1, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = Random <= 400
triggerall = statetype != A
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),stateno != [5710,5715]
triggerall =!InGuardDist || enemynear(var(58)),facing = facing
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2bodydist x = [-5,25]

;目?-----------------------------------------------------------------------------

[State -1,近距?目?]
Type = ChangeState
value = var(57)
TriggerAll = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall = p2statetype != A
triggerall = p2statetype != L
triggerall = p2bodydist X = (40,55]
triggerall = movehit
trigger1 = stateno = 230 || stateno = 430 || stateno = 200 || stateno = 400
trigger1 = var(57):= 245

[State -1,近距?目?]
Type = ChangeState
value = var(57)
TriggerAll = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall = p2statetype != A
triggerall = p2statetype != L
triggerall = (p2bodydist X = [-10,40])||stateno = 200 && time > 5|| stateno = 400|| stateno = 230
triggerall = movehit
trigger1 = stateno = 430 && var(30) = 5 && var(47) = 1
trigger1 = var(57) := ifelse(p2statetype != C && random<= 500,200,400)
trigger2 = (stateno = 400 || stateno = 200 && time > 5) && var(30) = 10  && var(47) = 1
trigger2 = var(57) := 230
trigger3 = stateno = 230 && var(30) = 15 ;&& var(47) = 1
trigger3 = var(57) := ifelse(p2bodydist X <= 20,ifelse(random<=500,240,210),ifelse(random<=500,245,215))
trigger4 = stateno = 400 && var(30) = 10 ||stateno = 200 && time > 5 && var(30) = 5  
trigger4 = var(47) = 2
trigger4 = var(57) := ifelse(stateno = 200,400,ifelse(p2bodydist X <= 20,ifelse(random<=500,240,210),245))
trigger5 = stateno = 400 && var(30) = 5 ||stateno = 430 && var(30) = 10 
trigger5 = var(47) = 2
trigger5 = var(57) := ifelse(stateno = 400,430,230)


;?攻?被防-----------------------------------------------------------------

[State -1,近距?目?]
Type = ChangeState
value = var(57)
TriggerAll = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall = p2statetype != A
triggerall = p2statetype != L
triggerall = (p2bodydist X = [-10,35])||stateno = 200 && time > 5|| stateno = 400|| stateno = 230
triggerall = MoveContact
trigger1 = (stateno = 430 && var(30) = 5 ||stateno = 400||stateno = 200 && time > 5 || stateno = 230 && var(30) < 15)
trigger1 = var(57) := 230

[State -1,近距?目?]
Type = ChangeState
value = var(57)
TriggerAll = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A 
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),movetype != H
trigger1 = STATENO = 1500 && TIME >= 20
trigger1 = var(57):= ifelse(random <= 500,ifelse(random<=500,1900,1810),ifelse(random<=500,2110,2204))

[State -1,近距?目?]
Type = ChangeState
value = var(57)
TriggerAll = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A || (STATENO = 1900||STATENO = 2251 || STATENO = 2101 || STATENO = 640)||(STATENO = [1800,1820])
triggerall = enemynear(var(58)),statetype != A || (STATENO = 1900||STATENO = 2251||STATENO = 1150 || STATENO = 2101||STATENO = 2050||STATENO = 2204)||(STATENO = [1800,1820])
triggerall = enemynear(var(58)),statetype != L
triggerall = (p2stateno = [0,159]) || (STATENO = 1900||STATENO = 2251||STATENO = 1150 || STATENO = 2101 ||STATENO = 2050 ||STATENO = 2204)||(STATENO = [1800,1820])
trigger1 = stateno = 230 && MoveGuarded && var(30) >= 15
trigger1 = var(57) := ifelse(random<= 500,ifelse(random <= 500,ifelse(random<=500,1150,ifelse(random<=500,1810,1820)),ifelse(random<= 500,1400,1450)),ifelse(random<= 500,ifelse(random<= 500,1500,1300),ifelse(random<= 500,2110,2050)))
trigger2 = STATENO = 1451 && AnimElemtime(12) >= 0 || stateno = 1500 && animtime = 0|| stateno = 1150 && MoveGuarded
trigger2 = statetype != A
trigger2 = var(57) := ifelse(random <= 500,ifelse(random<=500,1900,1810),ifelse(random<=500,2110,2204))
trigger3 = STATENO = 2204 && animtime = 0
trigger3 = statetype != A
trigger3 = var(57) := ifelse(random<=500,ifelse(random<=500,1400,1150),ifelse(random<=500,ifelse(random<=500,2110,1450),ifelse(random<=500,1820,1810)))
;trigger4 = prevSTATENO = 1400 && STATENO = 52
;trigger4 = statetype != A
;trigger4 = var(57) := 2201
trigger4 = (STATENO = 2201||STATENO = 2251) && vel y > 0
trigger4 = enemynear(var(58)),Pos Y - Pos Y = [-100,80]
trigger4 = statetype = A
trigger4 = var(57) := ifelse(enemynear(var(58)),statetype != A,640,2151)
trigger5 = STATENO = 2101 && time >= 13
trigger5 = enemynear(var(58)),stateno != 2056
trigger5 = statetype = A
trigger5 = var(57) := 2254
trigger6 = STATENO = 1150 && time >= 20
trigger6 = enemynear(var(58)),stateno < 5000
trigger6 = statetype != A
trigger6 = var(57) := ifelse(random <= 666,ifelse(random<=333,1900,2204),ifelse(random<=500,1810,2110));2201
trigger7 = STATENO = 2050 && time >= 28
trigger7 = enemynear(var(58)),stateno != 2056
trigger7 = statetype != A
trigger7 = var(57) := 2203
trigger8 = (STATENO = [1800,1820]) && time > 7
trigger8 = enemynear(var(58)),stateno < 5000
trigger8 = statetype != A
trigger8 = var(57) := 825

;裸凹--------------------------------------------------------------------

[State -1]
type = ChangeState
Value = ifelse(power >= 2000 && enemynear(var(58)),life<ceil(lifemax/2),3300,3100)
IgnoreHitPause = 1
triggerall = enemynear(var(58)),name = "Gustab Munchausen"
triggerall = HitPauseTime = 0
triggerall = var(59)
triggerall = Roundstate = 2
triggerall = power >= 1000 
triggerall = random <= 100||(life<ceil(lifemax/3))
triggerall = statetype != A
triggerall = p2bodydist x >= 200
triggerall = Ctrl || (stateno = [20,25]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149])
triggerall = enemynear(var(58)),movetype = A
trigger1 = EnemyNear(var(58)),animtime < - 13
trigger1 = EnemyNear(var(58)),numproj > 0

[State -1,最終決戦奥義　無式 切り返し]
Type = ChangeState
Value = ifelse(power >= 2000 && enemynear(var(58)),life<ceil(lifemax/2),3300,3100)
triggerall = enemynear(var(58)),name != "Gustab Munchausen"
TriggerAll = var(59)
TriggerAll = RoundState = 2
triggerall = random <= 100||(life<ceil(lifemax/3))
TriggerAll = power >= 1000 
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),AnimTime < -8
TriggerAll = Enemy,NumProj
TriggerAll = Ctrl || (stateno = [19,22]) || (stateno = [100,101]) || (stateno = [120,149]) || (stateno = [800,825])
Trigger1 = EnemyNear(var(58)),MoveType = A && EnemyNear(var(58)),StateNo >= 200

[state -1,最終決戦奥義　無式 切り返し]
Type = ChangeState
value = 3200
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = Random <= 100||(life<ceil(lifemax/3))
TriggerAll = power >= 1000
TriggerAll = StateType != A
TriggerAll = P2BodyDist X = [0,60]
TriggerAll = EnemyNear(var(58)),AnimTime < -2
TriggerAll = EnemyNear(var(58)),Time >= 0
TriggerAll = Ctrl || (stateno = [19,22]) || (stateno = [100,101]) || (stateno = [120,149])
Trigger1 = EnemyNear(var(58)),StateType != A
Trigger1 = EnemyNear(var(58)),MoveType = A && EnemyNear(var(58)),StateNo >= 200
Trigger2 = Enemy,HitDefAttr = SC,AT || EnemyNear(var(58)),HitDefAttr = SC,AT
Trigger2 = Enemy,Vel X > 0 || EnemyNear(var(58)),Vel X > 0

[State -3, S ONIYAKI]
type = ChangeState
value = ifelse(random<=500,2100,2050)
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = enemynear(var(58)),time >= 0
triggerALL = random<=100||(LIFE <= ceil(lifemax/3))
triggerall = statetype != A
triggerall = enemynear(var(58)),ctrl = 0
triggerall = enemynear(var(58)),statetype != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),MoveType = A
triggerall = enemynear(var(58)),StateNo >= 200
triggerall = enemynear(var(58)),facing != facing
triggerall = InGuardDist
triggerall = ctrl || (stateno = [20,22]) || stateno = 52 || (stateno = [100,101]) || (stateno = [120,149]) || (var(1) = [1,2]) && !movecontact && movetype != H
trigger1 = p2bodydist x = [-5,100]
trigger1 = enemynear(var(58)),animtime <= -5

[state -1,最終決戦奥義　無式 切り返し]
Type = ChangeState
Value = ifelse(power >= 2000 && enemynear(var(58)),life<ceil(lifemax/2),3300,3100)
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = Random <= 100||(life<ceil(lifemax/3))
TriggerAll = power >= 1000
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),AnimTime < -8
TriggerAll = EnemyNear(var(58)),Time >= 0
TriggerAll = Ctrl || (stateno = [19,22]) || (stateno = [100,101]) || (stateno = [120,149])
Trigger1 = EnemyNear(var(58)),MoveType = A && EnemyNear(var(58)),StateNo >= 200
Trigger2 = Enemy,HitDefAttr = SC,AT || EnemyNear(var(58)),HitDefAttr = SC,AT
Trigger2 = Enemy,Vel X > 0 || EnemyNear(var(58)),Vel X > 0

[State -1, Stand Strong Punch]
type = ChangeState
value = 3200
triggerall = var(59)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 
triggerall = statetype != A
triggerall=  enemynear(var(58)),movetype = A
triggerall=  enemynear(var(58)),statetype != A
triggerall = enemynear,time >=0
TriggerAll = power >= 1000 
;triggerall = enemynear(var(58)),stateno = [200,1000];stateno = [200,1000)
;triggerall = enemynear(var(58)),HitDefAttr = SCA, NA, SA, HA
triggerall = p2bodydist X = [-5,60]
triggerALL = random<=300||(LIFE <= ceil(lifemax/3))
TriggerAll = Ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = (enemynear(var(58)), StateNo = Helper(999), var(1)) && enemynear(var(58)), Time < (Helper(999), var(2) - 2)
trigger2 = (enemynear(var(58)), StateNo = Helper(999), var(3)) && enemynear(var(58)), Time < (Helper(999), var(4) - 2)
trigger3 = (enemynear(var(58)), StateNo = Helper(999), var(5)) && enemynear(var(58)), Time < (Helper(999), var(6) - 2)
trigger4 = (enemynear(var(58)), StateNo = Helper(999), var(7)) && enemynear(var(58)), Time < (Helper(999), var(8) - 2)
trigger5 = (enemynear(var(58)), StateNo = Helper(999), var(9)) && enemynear(var(58)), Time < (Helper(999), var(10) - 2)
trigger6 = (enemynear(var(58)), StateNo = Helper(999), var(11)) && enemynear(var(58)), Time < (Helper(999), var(12) - 2)
trigger7 = (enemynear(var(58)), StateNo = Helper(999), var(13)) && enemynear(var(58)), Time < (Helper(999), var(14) - 2)
trigger8 = (enemynear(var(58)), StateNo = Helper(999), var(15)) && enemynear(var(58)), Time < (Helper(999), var(16) - 2)
trigger9 = (enemynear(var(58)), StateNo = Helper(999), var(17)) && enemynear(var(58)), Time < (Helper(999), var(18) - 2)
trigger10 = (enemynear(var(58)), StateNo = Helper(999), var(19)) && enemynear(var(58)), Time < (Helper(999), var(20) - 2)
trigger11 = (enemynear(var(58)), StateNo = Helper(999), var(21)) && enemynear(var(58)), Time < (Helper(999), var(22) - 2)
trigger12 = (enemynear(var(58)), StateNo = Helper(999), var(23)) && enemynear(var(58)), Time < (Helper(999), var(24) - 2)
trigger13 = (enemynear(var(58)), StateNo = Helper(999), var(25)) && enemynear(var(58)), Time < (Helper(999), var(26) - 2)
trigger14 = (enemynear(var(58)), StateNo = Helper(999), var(27)) && enemynear(var(58)), Time < (Helper(999), var(28) - 2)
trigger15 = (enemynear(var(58)), StateNo = Helper(999), var(29)) && enemynear(var(58)), Time < (Helper(999), var(30) - 2)
trigger16 = (enemynear(var(58)), StateNo = Helper(999), var(31)) && enemynear(var(58)), Time < (Helper(999), var(32) - 2)
trigger17 = (enemynear(var(58)), StateNo = Helper(999), var(33)) && enemynear(var(58)), Time < (Helper(999), var(34) - 2)
trigger18 = (enemynear(var(58)), StateNo = Helper(999), var(35)) && enemynear(var(58)), Time < (Helper(999), var(36) - 2)
trigger19 = (enemynear(var(58)), StateNo = Helper(999), var(37)) && enemynear(var(58)), Time < (Helper(999), var(38) - 2)
trigger20 = (enemynear(var(58)), StateNo = Helper(999), var(39)) && enemynear(var(58)), Time < (Helper(999), var(40) - 2)
trigger21 = (enemynear(var(58)), StateNo = Helper(999), var(41)) && enemynear(var(58)), Time < (Helper(999), var(42) - 2)
trigger22 = (enemynear(var(58)), StateNo = Helper(999), var(43)) && enemynear(var(58)), Time < (Helper(999), var(44) - 2)
trigger23 = (enemynear(var(58)), StateNo = Helper(999), var(45)) && enemynear(var(58)), Time < (Helper(999), var(46) - 2)
trigger24 = (enemynear(var(58)), StateNo = Helper(999), var(47)) && enemynear(var(58)), Time < (Helper(999), var(48) - 2)
trigger25 = (enemynear(var(58)), StateNo = Helper(999), var(49)) && enemynear(var(58)), Time < (Helper(999), var(50) - 2)
trigger26 = (enemynear(var(58)), StateNo = Helper(999), var(51)) && enemynear(var(58)), Time < (Helper(999), var(52) - 2)
trigger27 = (enemynear(var(58)), StateNo = Helper(999), var(53)) && enemynear(var(58)), Time < (Helper(999), var(54) - 2)
trigger28 = (enemynear(var(58)), StateNo = Helper(999), var(55)) && enemynear(var(58)), Time < (Helper(999), var(56) - 2)

[State -1, Strong Kung Fu Palm]
type = ChangeState
value = ifelse(random<=666,ifelse(random<=333,2100,1800),2050)
TriggerAll = var(59) = 1
;triggerALL = random <= 300
TriggerAll = RoundState = 2
triggerALL = statetype != A
TriggerAll = Ctrl || (stateno = [19,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2movetype!=H
trigger1 = (p2bodydist X = [0,200])&&p2statetype!=L
trigger1 = EnemyNear(var(58)),StateNo = [30,70]
trigger1 = EnemyNear(var(58)),VEL Y < 0&& EnemyNear(var(58)),VEL X >= 0
trigger1 = p2bodydist y <= -50

[State -1,投げ]
Type = ChangeState
Value = 800
TriggerAll = var(59)
triggerall = StateType!=A
triggerall = RoundState=2
triggerall = EnemyNear(var(58)),statetype != L
triggerall = (EnemyNear(var(58)),statetype=S)||(EnemyNear(var(58)),statetype=C)
triggerall = EnemyNear(var(58)),movetype != H||EnemyNear(var(58)),stateno=[120,140]
TriggerAll = EnemyNear(var(58)),StateNo != [5100,5299]
triggerall = p2bodydist X <= 25
TriggerAll = P2BodyDist X = [-15,25]
triggerall = ctrl||stateno=21||stateno=22||stateno=100||(stateno=[120,140])||stateno=52||stateno = 710&&animtime = 0||stateno = 720&&animtime = 0
triggerall = Random <= 100||Life <= ceil(lifemax/3) && Random <= 250||helper(90000),var(54) >= 4
Trigger1 = EnemyNear(var(58)),MoveType=I||floor(EnemyNear(var(58)),GetHitVar(hittime))<0
Trigger2 = EnemyNear(var(58)),facing!=facing||(EnemyNear(var(58)),stateno=[50,55])||(EnemyNear(var(58)),stateno=[120,159])&&floor(EnemyNear(var(58)),GetHitVar(hittime))<0

;ガードキャンセルふっとばし攻撃
[State -1, GCA]
type = ChangeState
value = 351
triggerall = var(59) = 1
triggerall = RoundState = 2
triggerall = Random <= 100||Life <= ceil(lifemax/3) && Random <= 250||helper(90000),var(54) >= 4
triggerall = power >= 1000
triggerall = StateType != A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),MoveType = A
triggerall = enemynear(var(58)),StateNo >= 200
triggerall = p2bodydist x = [-5,50]
triggerall = (stateno = 150 || stateno = 152) && HitShakeOver
trigger1 = enemynear(var(58)),statetype != A
trigger2 = enemynear(var(58)),statetype = A
trigger2 = p2bodydist y = [-50-floor(5*(enemynear(var(58)),vel y)+(5*(5+1)/2)*fvar(20)),0-floor(5*(enemynear(var(58)),vel y)+(5*(5+1)/2)*fvar(20))]

;起攻-----------------------------------------------------------------------

[State -1, 小ジャンプ 中段起き攻め]
Type = ChangeState
value = 1900
triggerall = var(59) = 1
triggerall = var(44) = 2
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = enemynear(var(58)),stateno = 5120
trigger1 = enemynear(var(58)),animtime = [-15,-10]


[State -1, 小ジャンプ 中段起き攻め]
Type = ChangeState
value = 2200
triggerall = var(59) = 1
triggerall = var(44) = 1
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = enemynear(var(58)),stateno = 5120
trigger1 = enemynear(var(58)),animtime = [-19,-10]

[State -1, ジャンプ強パンチ 起き攻め]
type = ChangeState
value = IFELSE(RANDOM<=500,400,430)
triggerall = var(59) = 1
triggerall = var(44) = 1
triggerall = RoundState = 2
triggerall = StateType != A
trigger1 = stateno = 2200 && ANIMTIME = 0


[State -1, バックステップ／ハイジャンプ 起き攻め放棄]
type = ChangeState
value = ifelse(BackEdgeBodyDist <= 20,2203,2204)
triggerall = var(59) = 1
triggerall = var(44) = 3
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = BackEdgeBodyDist <= 20
trigger1 = enemynear(var(58)),statetype = L && p2bodydist X <= 80 && !Inguarddist
trigger1 = enemynear(var(58)),stateno != 5120
trigger2 = enemynear(var(58)),stateno = 5120
trigger2 = enemynear(var(58)),animtime >= -10




;---------------------------------------------------------------------------
;位置取り
;---------------------------------------------------------------------------
;ダッシュ 起き攻め位置取り
[State -1, Dash]
Type = ChangeState
Value = 100
triggerall = var(59) = 1
triggerall = RoundState = 2
triggerall = StateType != A
triggerall =!inguarddist
triggerall =!enemy,numproj
triggerALL = p2bodydist x >= 90
triggerall = ctrl || (stateno = [20,22]) || (stateno = [120,149])
trigger1 = enemynear(var(58)),StateType = A
trigger1 = enemynear(var(58)),StateNo = [5000,5100]

;ダッシュ
[state -1]
Type = ChangeState
Value = 100
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),MoveType != A || EnemyNear(var(58)),facing = facing
TriggerAll =!InGuardDist
TriggerAll = Ctrl || StateNo = [120,149]
triggerall = enemynear(var(58)),Time >= 10 && p2statetype = A && p2bodydist x >= 10|| p2statetype != A
Trigger1 = P2BodyDist X > 140
Trigger1 = EnemyNear(var(58)),StateType != A
Trigger1 = EnemyNear(var(58)),MoveType = I
Trigger2 = P2BodyDist X > 100
Trigger2 = EnemyNear(var(58)),StateType = L
Trigger3 = P2BodyDist X > 140 || EnemyNear(var(58)),facing = facing
Trigger3 = EnemyNear(var(58)),StateType = A
Trigger3 = EnemyNear(var(58)),MoveType = A && EnemyNear(var(58)),StateNo >= 200
Trigger3 =!EnemyNear(var(58)),HitDefAttr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT
Trigger4 = EnemyNear(var(58)),MoveType != H
Trigger4 = EnemyNear(var(58)),StateType = A
Trigger4 =!EnemyNear(var(58)),Ctrl
Trigger4 = EnemyNear(var(58)),facing = facing

;歩き(起き攻め位置取り)
[State -1, Walk]
type = ChangeState
value = 22
triggerall = var(59) = 1
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = stateno != 22
triggerall = ctrl || (stateno = [20,22])
trigger1 = enemynear(var(58)),StateType = L
trigger2 = var(50) = [1,3];||var(50) = 4
trigger2 = enemynear(var(58)),StateType = A


;後中ジャンプ 起き攻め 起き攻め放棄
[State -1, 後中ジャンプ]
Type = ChangeState;ChangeState
Value = 195
triggerall = var(59) = 1
triggerall = var(44) = 4
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = p2bodydist x>= 150
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = enemynear(var(58)),StateNo = [5100,5120]

;空中对策-----------------------------------------------------------

[State -1, 後小ジャンプ 空対空]
Type = ChangeState
Value = 2100
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = Random <= 400
triggerall =!Enemy,NumProj
triggerall = enemynear(var(58)),Vel X > 0
triggerall = enemynear(var(58)),Vel Y < 0
triggerall = enemynear(var(58)),MoveType != H
triggerall = enemynear(var(58)),StateType = A
triggerall = enemynear(var(58)),facing != facing
triggerall =!InGuardDist
triggerall = BackEdgeBodyDist > 40
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2bodydist x = [100,160]
trigger1 = enemynear(var(58)),Vel X <= 4
trigger2 = p2bodydist x = [140,180]
trigger2 = enemynear(var(58)),Vel X <= 6

[State -1, 後中ジャンプ 空対空]
Type = ChangeState
Value = 2204
triggerall = var(59) = 1
triggerall = RoundState = 2 && enemynear(var(58)),life > 0 && fvar(22) = 0
triggerall = Random >= 400
triggerall = StateType != A
triggerall =!Enemy,NumProj
triggerall = enemynear(var(58)),Vel X > 0
triggerall = enemynear(var(58)),Vel Y < 0
triggerall = enemynear(var(58)),MoveType != H
triggerall = enemynear(var(58)),StateType = A
triggerall = enemynear(var(58)),facing != facing
triggerall =!InGuardDist
triggerall = BackEdgeBodyDist > 40
triggerall = ctrl || (stateno = [20,22]) || (stateno = [100,101]) || (stateno = [120,149])
trigger1 = p2bodydist x = [60,120]
trigger1 = enemynear(var(58)),Vel X <= 4
trigger2 = p2bodydist x = [100,160]
trigger2 = enemynear(var(58)),Vel X <= 6

;空中拳脚----------------------------------------------------------------------------

[State -3, Jump Strong Kick]
type = ChangeState
value = 1900
triggerall = var(59)
triggerall = !var(44)
triggerall = RoundState = 2 && enemynear(var(58)),life > 0
;triggerall = random <= 600
triggerall = statetype = A
triggerall = enemynear(var(58)),statetype != L
triggerall = enemynear(var(58)),stateno != [5020,5040]
triggerall = ctrl
trigger1 = p2bodydist x = [0,61+floor(10*(EnemyNear(var(58)),vel X)+floor(10*vel X))]
trigger1 = enemynear(var(58)),Pos Y - Pos Y = [-80,80]
trigger1 = enemynear(var(58)),StateType = A
trigger1 = var(32) := 64006
trigger2 = Vel Y > 0
trigger2 = enemynear(var(58)),Pos Y - Pos Y = [-80,80]
trigger2 = p2bodydist x = [-60,61+floor(10*(EnemyNear(var(58)),vel X)+floor(10*vel X))]
trigger2 = enemynear(var(58)),statetype != A
trigger2 = var(32) := 64007

;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
;移動
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
;ダッシュ
[State -1, RUN]
type = ChangeState
value = 21
triggerall = var(59) = 1
triggerall = RoundState = 2
triggerall = statetype != A
triggerall = !inguarddist
triggerall = ctrl || (stateno = [20,22]) || (stateno = [120,149])
trigger1 = p2bodydist x >= 240
trigger1 = Random <= 400
trigger1 = var(32):= 10001
trigger2 = p2bodydist x = [120,240]
trigger2 = Random <= 200
trigger2 = var(32):= 10002
trigger3 = p2bodydist x = [60,120]
trigger3 = Random <= 100
trigger3 = var(32):= 10003


[State -1, RUN]
type = ChangeState
value = 100
triggerall = var(59) = 1
triggerall = RoundState = 2
triggerall = statetype != A
triggerall = !inguarddist
triggerall = ctrl || (stateno = [20,22]) || (stateno = [120,149])
trigger1 = var(49) > 4 && enemynear(var(58)),StateType != A

;歩き
[State -1, Walk]
type = ChangeState
value = 21
triggerall = var(59) = 1
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = enemynear(var(58)),StateType != A
triggerall = enemynear(var(58)),StateType != L
triggerall = enemynear(var(58)),StateNo != [5120,5299]
triggerall = stateno != 21
triggerall = ctrl || (stateno = [20,22])
trigger1 = p2bodydist x <= 140
trigger1 =!InGuardDist || enemynear(var(58)),facing = facing
trigger2 = p2bodydist x > 180


;バックステップ
[state -1]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = BackEdgeBodyDist >= 40
TriggerAll = Ctrl || StateNo = [120,149]
Trigger1 = P2BodyDist X < 80 || FrontEdgeBodyDist < 80
Trigger1 = EnemyNear(var(58)),StateNo = [5200,5299]
trigger1 =!Enemy,NumProj

;バックステップ
[State -1]
Type = ChangeState
Value = 2204
TriggerAll = var(59) = 1
TriggerAll = RoundState = 2
TriggerAll = StateType != A
TriggerAll = EnemyNear(var(58)),MoveType = I
TriggerAll = EnemyNear(var(58)),facing != facing
TriggerAll =!Enemy,NumProj
TriggerAll = Ctrl || StateNo = [120,149]
Trigger1 = P2BodyDist X = [100,140]
Trigger1 = Random < 30




[State -3, Hitr];リセット
type = VarSet
triggerall = var(50)
trigger1 = enemynear(var(58)),movetype = A
trigger2 = enemynear(var(58)),stateno = [0,159]
trigger3 = enemynear(var(58)),ctrl=1
trigger4 = roundstate != 2
trigger5 = (stateno = [8900,8999])
trigger6 = enemynear(var(58)),stateno = 5120
trigger7 = stateno = 1452 || stateno = 2151
trigger8 = stateno = 3100 || stateno = 3200
var(50) = 0


[State -3, Hitr];リセット
type = VarSet
triggerall = var(47)
trigger1 = enemynear(var(58)),movetype = A
trigger2 = enemynear(var(58)),stateno = [0,159]
trigger3 = enemynear(var(58)),ctrl=1
trigger4 = roundstate != 2
trigger5 = enemynear(var(58)),stateno = 5120
var(47) = 0


;---------------------------------------------------------------------------
;AI用p2name
;---------------------------------------------------------------------------
;特殊地上受け身なし
[State -1, ]
Type = VarSet
triggerall = var(59)
trigger1 = 1
fvar(21) = 0

;特殊地上受け身持ち1(高め)
[State -1, ]
Type = VarSet
triggerall = var(59)
trigger1 = enemynear(var(58)),authorname = "ahuron"
trigger1 = enemynear(var(58)),name != "SHIN" || enemynear(var(58)),name != "REI" || enemynear(var(58)),name != "JAGI" || enemynear(var(58)),name != "THOUTHER"
trigger1 = enemynear(var(58)),name != "Shinnosuke Kagami" || enemynear(var(58)),name != "Mukuro"
trigger1 = enemynear(var(58)),name != "Misuzu"
trigger2 = enemynear(var(58)),authorname = "jin"
trigger3 = enemynear(var(58)),authorname = "Chin-ya"
trigger4 = enemynear(var(58)),authorname = "kayui uma"
trigger4 = enemynear(var(58)),name ="anna" || enemynear(var(58)),name ="henri" || enemynear(var(58)),name ="mora" || enemynear(var(58)),name ="saya" || enemynear(var(58)),name ="dragon"
trigger5 = enemynear(var(58)),authorname = "aoba"
trigger6 = enemynear(var(58)),authorname = "Mikita"
fvar(21) = 1

;特殊地上受け身持ち2
[State -1, ]
Type = VarSet
triggerall = var(59)
trigger1 = enemynear(var(58)),authorname = "ikaruga"
trigger2 = enemynear(var(58)),authorname = "warusaki3"
trigger3 = enemynear(var(58)),authorname = "Gonzo-"
fvar(21) = 2

;---------------------------------------------------------------------------
;行動制限
[State -1, ]
Type = VarSet
triggerall = var(59)
trigger1 = 1
fvar(22) = 0

;行動するな
[State -1, ]
Type = VarSet
triggerall = var(59)
trigger1 = enemynear(var(58)),stateno = [5200,5201]
trigger2 = enemynear(var(58)),stateno = 702
trigger2 = enemynear(var(58)),authorname = "ahuron"
trigger3 = enemynear(var(58)),stateno = 52000
fvar(22) = 1

;===============================
;=======  以后变量都写在这里  ========
;===============================

[statedef 90000]
anim = 9999
ctrl = 0

[state -1]
type = displaytoclipboard
trigger1 = 1
text = "var(7) %d enemynear,numhelper = %d var(9) %d var(52) %d var(14) %d"
params = var(7),enemynear,numhelper,var(9),var(52),var(14)
ignorehitpause = 1

[state 1]
type = nothitby
value = SCA,AA,AP,AT;
trigger1 = 1
IgnoreHitPause = 1


[State -3,varadd]
Type = VARSET
Triggerall = VAR(9) = 0 && VAR(8) = 0
Triggerall = enemynear,MoveType != A
triggerALL = roundstate = 2
trigger1 = enemynear, StateNo < 999
var(7) = enemynear,numhelper

[State -3,varadd]
Type = NULL
triggerALL = roundstate = 2
trigger1 = enemynear, StateNo >= 2000
trigger1 = var(8):= enemynear,numhelper


[State -3,varadd]
Type = NULL
triggerALL = roundstate = 2
trigger1 = enemynear, StateNo = [1000,1999]
trigger1 = var(9):= enemynear,numhelper



[State -1, 僈乕僪夞悢娔帇]
type = Null
TriggerAll = RoundState=2
Trigger1 = root,StateNo=151||root,StateNo=153||root,StateNo=154
Trigger1 = root,Time=1
Trigger1 = var(40):=1+var(40)
Ignorehitpause=1

[State -2, ガードクラッシュ値回復]
type = varadd
triggerall = var(40) >= 1
trigger1 = gametime % 30 = 0
Trigger1 = root,StateNo != [120,155]
var(40) = -1

[State -2, ガードクラッシュ値回復]
type = VARSET
triggerall = var(51) = 0
triggerall = enemynear(var(58)),movetype = A
triggerall = root,stateno = [160,162]
trigger1 = (enemynear(var(58)), StateNo = Helper(998), var(1)) 
trigger2 = (enemynear(var(58)), StateNo = Helper(998), var(3)) 
trigger3 = (enemynear(var(58)), StateNo = Helper(998), var(5)) 
trigger4 = (enemynear(var(58)), StateNo = Helper(998), var(7)) 
trigger5 = (enemynear(var(58)), StateNo = Helper(998), var(9)) 
trigger6 = (enemynear(var(58)), StateNo = Helper(998), var(11)) 
trigger7 = (enemynear(var(58)), StateNo = Helper(998), var(13)) 
trigger8 = (enemynear(var(58)), StateNo = Helper(998), var(15)) 
trigger9 = (enemynear(var(58)), StateNo = Helper(998), var(17)) 
trigger10 = (enemynear(var(58)), StateNo = Helper(998), var(19)) 
trigger11 = (enemynear(var(58)), StateNo = Helper(998), var(21)) 
trigger12 = (enemynear(var(58)), StateNo = Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo = Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo = Helper(998), var(27))
trigger15 = (enemynear(var(58)), StateNo = Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo = Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo = Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo = Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo = Helper(998), var(37)) 
trigger20 = (enemynear(var(58)), StateNo = Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo = Helper(998), var(41)) 
trigger22 = (enemynear(var(58)), StateNo = Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo = Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo = Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo = Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo = Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo = Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo = Helper(998), var(55)) 
var(51) = 1

[State -2, ガードクラッシュ値回復]
type = VARSET;VARSET
triggerall = var(51) = 1
trigger1 = enemynear(var(58)),movetype != A
trigger2 = enemynear(var(58)),movetype = H
var(51) = 0

[State -2, ガードクラッシュ値回復]
type = VARSET
triggerall = var(52) = 0
triggerall = enemynear(var(58)),movetype = A
trigger1 = (enemynear(var(58)), StateNo = Helper(998), var(1)) 
trigger2 = (enemynear(var(58)), StateNo = Helper(998), var(3)) 
trigger3 = (enemynear(var(58)), StateNo = Helper(998), var(5)) 
trigger4 = (enemynear(var(58)), StateNo = Helper(998), var(7)) 
trigger5 = (enemynear(var(58)), StateNo = Helper(998), var(9)) 
trigger6 = (enemynear(var(58)), StateNo = Helper(998), var(11)) 
trigger7 = (enemynear(var(58)), StateNo = Helper(998), var(13)) 
trigger8 = (enemynear(var(58)), StateNo = Helper(998), var(15)) 
trigger9 = (enemynear(var(58)), StateNo = Helper(998), var(17)) 
trigger10 = (enemynear(var(58)), StateNo = Helper(998), var(19)) 
trigger11 = (enemynear(var(58)), StateNo = Helper(998), var(21)) 
trigger12 = (enemynear(var(58)), StateNo = Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo = Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo = Helper(998), var(27))
trigger15 = (enemynear(var(58)), StateNo = Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo = Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo = Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo = Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo = Helper(998), var(37)) 
trigger20 = (enemynear(var(58)), StateNo = Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo = Helper(998), var(41)) 
trigger22 = (enemynear(var(58)), StateNo = Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo = Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo = Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo = Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo = Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo = Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo = Helper(998), var(55)) 
var(52) = 1

[State -2, ガードクラッシュ値回復]
type = VARSET;VARSET
triggerall = var(52) = 1
triggerall = enemynear(var(58)),movetype != A
trigger1 = (enemynear(var(58)), StateNo != Helper(998), var(1)) 
trigger2 = (enemynear(var(58)), StateNo != Helper(998), var(3)) 
trigger3 = (enemynear(var(58)), StateNo != Helper(998), var(5)) 
trigger4 = (enemynear(var(58)), StateNo != Helper(998), var(7)) 
trigger5 = (enemynear(var(58)), StateNo != Helper(998), var(9)) 
trigger6 = (enemynear(var(58)), StateNo != Helper(998), var(11)) 
trigger7 = (enemynear(var(58)), StateNo != Helper(998), var(13)) 
trigger8 = (enemynear(var(58)), StateNo != Helper(998), var(15)) 
trigger9 = (enemynear(var(58)), StateNo != Helper(998), var(17)) 
trigger10 = (enemynear(var(58)), StateNo != Helper(998), var(19)) 
trigger11 = (enemynear(var(58)), StateNo != Helper(998), var(21)) 
trigger12 = (enemynear(var(58)), StateNo != Helper(998), var(23)) 
trigger13 = (enemynear(var(58)), StateNo != Helper(998), var(25)) 
trigger14 = (enemynear(var(58)), StateNo != Helper(998), var(27))
trigger15 = (enemynear(var(58)), StateNo != Helper(998), var(29)) 
trigger16 = (enemynear(var(58)), StateNo != Helper(998), var(31)) 
trigger17 = (enemynear(var(58)), StateNo != Helper(998), var(33)) 
trigger18 = (enemynear(var(58)), StateNo != Helper(998), var(35)) 
trigger19 = (enemynear(var(58)), StateNo != Helper(998), var(37)) 
trigger20 = (enemynear(var(58)), StateNo != Helper(998), var(39)) 
trigger21 = (enemynear(var(58)), StateNo != Helper(998), var(41)) 
trigger22 = (enemynear(var(58)), StateNo != Helper(998), var(43)) 
trigger23 = (enemynear(var(58)), StateNo != Helper(998), var(45)) 
trigger24 = (enemynear(var(58)), StateNo != Helper(998), var(47)) 
trigger25 = (enemynear(var(58)), StateNo != Helper(998), var(49)) 
trigger26 = (enemynear(var(58)), StateNo != Helper(998), var(51)) 
trigger27 = (enemynear(var(58)), StateNo != Helper(998), var(53)) 
trigger28 = (enemynear(var(58)), StateNo != Helper(998), var(55)) 
var(52) = 0
