[Statedef -3]
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[State -3, VarSet];StateNo
type = VarSet
trigger1 = MoveType != H
trigger1 = StateNo != 2222
var(15) = StateNo
ignorehitpause = 1

[State -3, VarSet];Ctrl
type = VarSet
trigger1 = MoveType != H
trigger1 = StateNo != 2222
var(16) = Ctrl
ignorehitpause = 1

[State -3, VarSet];AnimElemNo
type = VarSet
trigger1 = MoveType != H
trigger1 = StateNo != 2222
var(17) = AnimElemNo(0)
ignorehitpause = 1

[State -3, AI起動用ヘルパー]
type=helper
trigger1=!NumHelper(10000)
trigger1=roundstate!=3
trigger1=alive
trigger1=var(59)=0
Trigger1=PrevStateNo=5900||(PrevStateNo=[190,194])
Trigger1=ctrl&&stateno=0
helpertype=normal
name="AI"
stateno=10000
ID=10000
pos=9999,9999
keyctrl=1
pausemovetime=2147483647
supermovetime=2147483647
persistent = 0

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

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

[State -3, AIフラグ]
type = VarSet
triggerall = !Ishelper
triggerall = var(59) = 0
triggerall = RoundState = [1,2]
trigger1 = Command = "AI0"
trigger2 = Command = "AI1"
trigger3 = Command = "AI2"
trigger4 = Command = "AI3"
trigger5 = Command = "AI4"
trigger6 = Command = "AI5"
trigger7 = Command = "AI6"
trigger8 = Command = "AI7"
trigger9 = Command = "AI8"
trigger10 = Command = "AI9"
trigger11 = Command = "AI10"
trigger12 = Command = "AI11"
trigger13 = Command = "AI12"
trigger14 = Command = "AI13"
trigger15 = Command = "AI14"
trigger16 = Command = "AI15"
trigger17 = Command = "AI16"
trigger18 = Command = "AI17"
trigger19 = Command = "AI18"
trigger20 = Command = "AI19"
trigger21 = Command = "AI20"
trigger22 = Command = "AI21"
trigger23 = Command = "AI22"
trigger24 = Command = "AI23"
trigger25 = Command = "AI24"
trigger26 = Command = "AI25"
trigger27 = Command = "AI26"
trigger28 = Command = "AI27"
trigger29 = Command = "AI28"
trigger30 = Command = "AI29"
trigger31 = Command = "AI30"
trigger32 = Command = "AI31"
trigger33 = Command = "AI32"
trigger34 = Command = "AI33"
trigger35 = Command = "AI34"
trigger36 = Command = "AI35"
trigger37 = Command = "AI36"
trigger38 = Command = "AI37"
trigger39 = Command = "AI38"
trigger40 = Command = "AI39"
trigger41 = Command = "AI40"
trigger42 = Command = "AI41"
trigger43 = Command = "AI42"
trigger44 = Command = "AI43"
trigger45 = Command = "AI44"
trigger46 = Command = "AI45"
trigger47 = Command = "AI46"
trigger48 = Command = "AI47"
trigger49 = Command = "AI48"
trigger50 = Command = "AI49"
trigger51 = Command = "AI50"
trigger52 = NumHelper(10000) > 0
trigger52 = Helper(10000),var(59)
;trigger53 = 1;常時AIスイッチ
var(59) = 10;AIレベル　この値を変更(有効範囲：1〜10)
IgnoreHitPause = 1


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

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

[State -3, AI用]
Type = Helper
Trigger1 = !IsHelper
Trigger1 = !NumHelper(8000)
stateno = 8000
id = 8000
name = "AI"
pos = 0,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1
SuperMoveTime = 99999999999
PauseMoveTime = 99999999999
;-------------------------------------------------------------
;ID取得
[state -3]
Type = VarSet
triggerall = !Ishelper
trigger1 = NumEnemy = 1
var(54) = EnemyNear(0),ID

[state -3]
Type = VarSet
triggerall = !Ishelper
triggerall = numenemy >= 2
trigger1 = numtarget
trigger1 = MoveHit = 1
var(54) = target,ID

[state -3]
Type = VarSet
triggerall = !Ishelper
triggerall = numenemy >= 2
trigger1 = !numtarget
trigger2 = numtarget
trigger2 = target,StateNo = [120,159]
trigger3 = numtarget
trigger3 = !target,alive
var(54) = ifelse(EnemyNear(0),alive,enemynear(0),ID,enemynear(1),ID)
;-------------------------------------------------------------
;ラウンド始めにヘルパー数を調べる
[State -3]
Type = VarSet
triggerall = !Ishelper
TriggerAll = Var(58) = 0
Trigger1 = playerID(var(54)),NumHelper > 0
Trigger1 = RoundState = 2
V = 58
Value = playerID(var(54)),NumHelper

;ヒットフラグ
[State -3]
Type = VarSet
triggerall = !Ishelper
trigger1 = playerID(var(54)),MoveType != H
V = 57
Value = 0
IgnoreHitPause = 1

[State -3]
Type = Null
triggerall = !Ishelper
Trigger1 = (StateNo = 1000) && MoveHit
Trigger1 = 1||var(57):=1
Trigger2 = (StateNo = 215) && MoveHit
Trigger2 = 1||var(57):=2
IgnoreHitPause = 1

;砲台抑制
[State -3]
Type = VarSet
triggerall = !Ishelper
triggerall = StateNo != 1020
trigger1 = (StateNo != [0,40])
V = 56
Value = 0
IgnoreHitPause = 1

[State -3]
Type = VarAdd
triggerall = !Ishelper
trigger1 = (StateNo = 1020) && (Time = 21)
V = 56
Value = 1
IgnoreHitPause = 1

;Lv2ヒットフラグリセット
[State -3]
type = VarSet
Trigger1 = playerID(var(54)),MoveType!=H
trigger1 = var(55) != 0
var(55) = 0
IgnoreHitPause = 1

;Lv2ヒット時間合い詰め
[State -3]
Type     = ChangeState
Value    = 21
Triggerall = Var(59) >= 1
Triggerall = StateType != A
Triggerall = var(55) = 1
Triggerall = (var(11) != 0)
Triggerall = !inguarddist
Triggerall = Ctrl
Trigger1   = P2BodyDist X > 40

[State -3]
Type     = ChangeState
Value    = 40
Triggerall = Var(59) >= 1
Triggerall = StateType != A
Triggerall = var(55) = 1
Triggerall = (var(11) = 0)
Triggerall = !inguarddist
Triggerall = Ctrl
trigger1   = power >=500
Trigger1   = P2BodyDist X > 170
trigger2   = power < 500
Trigger2   = P2BodyDist X > 90
;-------------------------------------------------------------
;立ちしゃがみ切り替え
[State -3, 初期化]
Type       = VarSet
Triggerall = StateNo != [120,159]
trigger1   = time >=2
fvar(38)   = 0

[State -3, 立ち]
Type       = VarSet
Triggerall = StateNo = [120,159]
Triggerall = Random <= Var(59)*100
Trigger1   = playerID(var(54)),StateType = A
fvar(38)   = 1

[State -3, しゃがみ]
Type       = VarSet
Triggerall = StateNo = [120,159]
Triggerall = Random <= Var(59)*100
Trigger1   = playerID(var(54)),StateType != A
fvar(38)   = 2

[State -3, 立ち]
Type       = VarSet
Triggerall = StateNo = [120,159]
Triggerall = Random <= Var(59)*100
Trigger1   = playerID(var(54)),StateType != A
trigger1   = helper(8000),var(50) = 1
fvar(38)   = 1

[State -3, しゃがみ]
Type       = VarSet
Triggerall = StateNo = [120,159]
Triggerall = Random <= Var(59)*100
Trigger1   = playerID(var(54)),StateType != A
trigger1   = helper(8000),var(50) = 2
fvar(38)   = 2

;---------------------------------
[State -3]
type = ChangeState
value = 210
Triggerall = Var(59) >= 1
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
Triggerall = Ctrl || ((StateNo = 200) && MoveContact) || ((StateNo = 205) && (helper(8000),var(47)=1))
Triggerall = playerID(var(54)),MoveType=A
Triggerall =! playerID(var(54)),HitDefAttr = ,NT,ST,HT
Triggerall = Random <= Var(59)*100
Triggerall = Random <= 100
trigger1   = playerID(var(54)),stateno = helper(8000),var(56)

[State -3]
type = ChangeState
value = 1070
TriggerAll = Var(59) >= 1
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !playerID(var(54)),ctrl
Triggerall = (playerID(var(54)),AnimTime<=-4) || (Random<=50)
Triggerall = P2BodyDist X=[-40,40]
Triggerall = P2BodyDist Y>=-160
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),HitDefAttr = ,NT,ST,HT
Triggerall = Random <= Var(59)*100
Triggerall = Random <= 500
Trigger1   = Ctrl
trigger1   = playerID(var(54)),stateno = helper(8000),var(56)

[State -3]
type = ChangeState
value = 40
Triggerall = Var(59) >= 1
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
Triggerall = Ctrl
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),HitDefAttr = ,NT,ST,HT
Triggerall = Random <= Var(59)*100
Triggerall = Random <= 100
trigger1   = playerID(var(54)),stateno = helper(8000),var(56)

;;-------------------------------------------------------------
;--------------------------------------------------------------
[State -3]
type = ChangeState
value = 2000
Triggerall = Var(59) >= 1
triggerall = StateType != A
triggerall = (var(1) >= 150); || (var(11) != 0)
triggerall = (StateType = S || StateType = C)
triggerall = var(2) = 0
triggerall = var(6) = 0
triggerall = Ctrl || (StateNo = [200,299])
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=(-8-Floor((P2BodyDist X)/10.0))
Triggerall = Random <= Var(59)*100
Triggerall = P2BodyDist X=[0,100]
triggerall = P2BodyDist Y+playerID(var(54)),vel y*8+0.5*playerID(var(54)),const(movement.yaccel)*8*7 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*8*7)]
Trigger1   = (playerID(var(54)),Time>=23+Random%7-2*Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])


[State -3]
type = ChangeState
value = 1040
Triggerall = Var(59) >= 1
triggerall = power >= ifelse(var(5)=1,500,0)
triggerall = var(1) >= 150
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = var(2) = 0
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=-22
Triggerall = P2BodyDist X=[0,60]
triggerall = P2BodyDist Y+playerID(var(54)),vel y*22+0.5*playerID(var(54)),const(movement.yaccel)*22*19 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*22*19)]
Triggerall = Ctrl || ((StateNo = 200) && MoveContact) || ((StateNo = 205) && (helper(8000),var(47)=1))
Triggerall = (Random<=100)||(((Life*1.0/LifeMax*1.0)<0.5) && (Random<=200))
Triggerall = Random <= Var(59)*100
Trigger1   = (playerID(var(54)),Time>=23+Random%7-2*Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])
trigger4   = var(11) = 1
Trigger4   = (PrevStateNo=3000)

[State -3]
type = ChangeState
value = 1040
Triggerall = Var(59) >= 1
triggerall = power >= ifelse(var(5)=1,500,0)
triggerall = var(1) = [100, 149]
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = var(2) = 0
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=-22
Triggerall = P2BodyDist X=[0,60]
triggerall = P2BodyDist Y+playerID(var(54)),vel y*22+0.5*playerID(var(54)),const(movement.yaccel)*22*19 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*22*19)]
Triggerall = Ctrl || ((StateNo = 200) && MoveContact) || ((StateNo = 205) && (helper(8000),var(47)=1))
Triggerall = (Random<=50)||(((Life*1.0/LifeMax*1.0)<0.5) && (Random<=200))
Triggerall = Random <= Var(59)*100
Trigger1   = (playerID(var(54)),Time>=23+Random%7-Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])
trigger4   = var(11) = 1
Trigger4   = (PrevStateNo=3000)

[State -3]
type = ChangeState
value = 1000
Triggerall = Var(59) >= 1
triggerall = (var(1)>=45)||(Random<=10)
triggerall = helper(8000),var(48)=0
triggerall = var(1) !=150
triggerall = power >=100
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
Triggerall = Ctrl || ((StateNo = 200) && MoveContact) || ((StateNo = 205) && (helper(8000),var(47)=1))
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=-9
Triggerall = !((((Enemy,NumHelper>Var(58))&&(Enemy,NumHelper>0))||(Enemy,NumProj>0))&&InGuardDist)||(Random<=50)
Triggerall = P2BodyDist X=[-5,70]
Triggerall = P2BodyDist Y>=-80
Triggerall = (Random<=100)||(((Life*1.0/LifeMax*1.0)<0.3) && (Random<=200))
Triggerall = Random <= Var(59)*100
Trigger1   = (playerID(var(54)),Time>=23+Random%7-Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])
trigger4   = var(11) = 1
Trigger4   = (PrevStateNo=3000)

[State -3, 210]
Type = ChangeState
Value = 210
Triggerall = Var(59) >= 1
triggerall = (var(1)>=45)||(Random<=10)
triggerall = var(1) < 150
triggerall = helper(8000),var(48)=0
Triggerall = StateType != A
Triggerall = Ctrl || ((StateNo = 200) && MoveContact) || ((StateNo = 205) && (helper(8000),var(47)=1))
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=-23
Triggerall = P2BodyDist X=[-5,80]
Triggerall = P2BodyDist Y>=-80
Triggerall = (Random<=100)||(((Life*1.0/LifeMax*1.0)<0.3) && (Random<=300))
Triggerall = Random <= Var(59)*100
Triggerall = (Life>50)
Trigger1   = (playerID(var(54)),Time>=23+Random%7-Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])
trigger4   = var(11) = 1
Trigger4   = (PrevStateNo=3000)

[State -3, 210]
Type = ChangeState
Value = 205
Triggerall = Var(59) >= 1
triggerall = var(1) =[0,45]
triggerall = helper(8000),var(48)=0
Triggerall = StateType != A
Triggerall = Ctrl || ((StateNo = 200) && MoveContact)
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=-12
Triggerall = P2BodyDist X=[-5,50]
Triggerall = P2BodyDist Y>=-50
Triggerall = (Random<=100)||(((Life*1.0/LifeMax*1.0)<0.3) && (Random<=300))
Triggerall = Random <= Var(59)*100
Triggerall = (Life>50)
Trigger1   = (playerID(var(54)),Time>=23+Random%7-Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])
trigger4   = var(11) = 1
Trigger4   = (PrevStateNo=3000)

[State -3, 210]
Type = ChangeState
Value = 200
Triggerall = Var(59) >= 1
triggerall = var(1) =[0,45]
triggerall = helper(8000),var(48)=0
Triggerall = StateType != A
Triggerall = Ctrl
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = playerID(var(54)),AnimTime<=-7
Triggerall = P2BodyDist X=[-5,25]
Triggerall = P2BodyDist Y>=-40
Triggerall = (Random<=100)||(((Life*1.0/LifeMax*1.0)<0.3) && (Random<=300))
Triggerall = Random <= Var(59)*100
Triggerall = (Life>50)
Trigger1   = (playerID(var(54)),Time>=23+Random%7-Var(59))
Trigger2   = (PrevStateNo=[5000,5270])
Trigger3   = (PrevStateNo=[120,159])
trigger4   = var(11) = 1
Trigger4   = (PrevStateNo=3000)



;---------------------------------------------------------------------------
;空中攻撃
[State -3, 220]
Type = ChangeState
Value = 220
Triggerall = Var(59) >= 1
TriggerAll = StateType = A
TriggerAll = Ctrl
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),StateType != L
Triggerall = playerID(var(54)),MoveType=A
Triggerall = (playerID(var(54)),AnimTime<=-16) || (Random<=50)
Triggerall = P2BodyDist X=[-50,20]
Triggerall = P2BodyDist Y>=50
Triggerall = ((Random<=200) && ((Life*1.0/LifeMax*1.0)>=0.1)) || ((Random<=50) && ((Life*1.0/LifeMax*1.0)<0.1))
Triggerall = Random <= Var(59)*100
Trigger1   = (StateNo = 50 && Time >= 25) || (StateNo = 51)
Trigger2   = StateNo = [120,159]

[State -3, 215]
Type = ChangeState
Value = 215
Triggerall = Var(59) >= 1
TriggerAll = StateType = A
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),StateType != L
TriggerAll = P2BodyDist X >= 50
TriggerAll = P2BodyDist Y > 0
TriggerAll = (P2BodyDist X + 127)*100/(P2BodyDist Y + 72) = [125, 135]
TriggerAll = var(55) != 1
Triggerall = Random <= Var(59)*150
TriggerAll = Ctrl
Trigger1   = (StateNo = 50 && Time >= 25) || (StateNo = 51)
Trigger1   = Random<=300
Trigger2   = StateNo = [120,159]
Trigger2   = Random<=300


;===========================================================================
;　咆哮
;===========================================================================
[State -3]
type = ChangeState
value = 1080
TriggerAll = Var(59) >= 1
triggerall = StateType = A
triggerall = !(StateType = S || StateType = C)
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !playerID(var(54)),ctrl
Triggerall = (playerID(var(54)),AnimTime<=-4) || (Random<=50)
Triggerall = P2BodyDist X=[-40,40]
Triggerall = P2BodyDist Y+playerID(var(54)),vel y*4+0.5*playerID(var(54)),const(movement.yaccel)*16 = [-160,20]
Triggerall = Random <= Var(59)*150
trigger1   = ctrl
Trigger1   = playerID(var(54)),MoveType=A
Trigger1   = playerID(var(54)),HitDefAttr = ,NT,ST,HT
Trigger1   = (Random<=60)
Trigger2    = Time<10
trigger2   = (StateNo = [5020,5050])||(StateNo = [5070,5071])||(StateNo = [5080,5081])||(StateNo = [5200,5201])
Trigger2   = (Time > Random%5*(10-Var(59)))||(((Life*1.0/LifeMax*1.0)<0.3)&&(Time>0))
Trigger2   = ((Random<=60)&&(var(1)<100))||((Random<=2)&&(var(1)=[100,150]))||((Random<=100)&&(helper(8000),var(46)>=100))

;------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 1070
TriggerAll = Var(59) >= 1
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !playerID(var(54)),ctrl
Triggerall = (playerID(var(54)),AnimTime<=-4) || (Random<=50)
Triggerall = P2BodyDist X=[-40,40]
Triggerall = P2BodyDist Y>=-160
Triggerall = Random <= Var(59)*150
trigger1   = ctrl
Trigger1   = playerID(var(54)),MoveType=A
Trigger1   = playerID(var(54)),HitDefAttr = ,NT,ST,HT
Trigger1   = (Random<=60)
trigger2   = (StateNo = 5000)||(StateNo = 5001)||(StateNo = 5010)||(StateNo = 5011)
Trigger2   = (Time > Random%5*(10-Var(59)))||(((Life*1.0/LifeMax*1.0)<0.3)&&(Time>0))
Trigger2   = ((Random<=60)&&(var(1)<100))||((Random<=2)&&(var(1)=[100,150]))||((Random<=100)&&(helper(8000),var(46)>=100))

;---------------------------------------------------------------------------
;ガード
[State -3]
Type = ChangeState
Value = 120
TriggerAll = Var(59) >= 1
TriggerAll = StateNo!=[120,155]
TriggerAll = Ctrl
Triggerall = Random <= Var(59)*100
TriggerAll = InGuardDist
Trigger1 =! playerID(var(54)),HitDefAttr = ,NT,ST,HT
Trigger2 = Enemy,NumHelper > 0
Trigger2 = Enemy,NumHelper > Var(58)

;めくり対策
[State -3]
Type = ChangeState
Value = 120
TriggerAll = Var(59) >= 1
TriggerAll = Ctrl
Triggerall = Random <= Var(59)*100
Trigger1 =! playerID(var(54)),HitDefAttr = ,NT,ST,HT
Trigger1 = playerID(var(54)),MoveType = A
Trigger1 = P2Dist X < 0
Trigger2 = Enemy,NumHelper > 0 || Enemy,NumProj > 0
Trigger2 = InGuardDist

;---------------------------------------------------------------------------
;===========================================================================
;　瞬食殺
;===========================================================================
;------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 2000
Triggerall = Var(59) >= 1
triggerall = StateType != A
triggerall = (var(1) >= 100) || (var(11) != 0)
triggerall = (StateType = S || StateType = C)
triggerall = var(2) = 0
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !InGuardDist
Triggerall = Random <= Var(59)*150
Triggerall = P2BodyDist X=[0,50]
triggerall = P2BodyDist Y+playerID(var(54)),vel y*8+0.5*playerID(var(54)),const(movement.yaccel)*8*7 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*8*7)]
trigger1   = numhelper(3002) = 0
Trigger1   = (StateNo = 205) && MoveHit
trigger1   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger1   = (Random<500) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
trigger2   = numhelper(3002) = 0
Trigger2   = (StateNo = 210) && (MoveHit=1)
Trigger2   = (Random<500) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
Trigger2   = P2BodyDist X=[0,10]
Trigger2   = P2BodyDist Y+Helper(8000),Var(52)*7+0.5*playerID(var(54)),const(movement.yaccel)*8*8 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*8*8)]
trigger3   = numhelper(3002) = 0
Trigger3   = (StateNo = 216)
Trigger3   = Var(57) = 2
Trigger3   = FrontEdgeBodyDist > 40
Trigger3   = (Random<500) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
trigger4   = numhelper(3002) = 0
Trigger4   = (StateNo = 205) && (MoveGuarded=1)
trigger4   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger4   = (Random<300) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
trigger5   = numhelper(3002) = 0
Trigger5   = (StateNo = 205) && MoveHit
Trigger5   = (var(1) >= 140) || ((Life*1.0/LifeMax*1.0)<0.3)
trigger6  = numhelper(3002) = 1
trigger6  = helper(3002),StateNo != 3027
Trigger6   = (StateNo = 205) && MoveHit
trigger6   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger6   = (Random<500) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
trigger7  = numhelper(3002) = 1
trigger7  = helper(3002),StateNo != 3027
Trigger7   = (StateNo = 210) && (MoveHit=1)
Trigger7   = (Random<500) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
Trigger7   = P2BodyDist X=[0,10]
Trigger7   = P2BodyDist Y+Helper(8000),Var(52)*7+0.5*playerID(var(54)),const(movement.yaccel)*8*8 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*8*8)]
trigger8  = numhelper(3002) = 1
trigger8  = helper(3002),StateNo != 3027
Trigger8   = (StateNo = 216)
Trigger8   = Var(57) = 2
Trigger8   = FrontEdgeBodyDist > 40
Trigger8   = (Random<500) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
trigger9  = numhelper(3002) = 1
trigger9  = helper(3002),StateNo != 3027
Trigger9   = (StateNo = 205) && (MoveGuarded=1)
trigger9   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger9   = (Random<300) || (var(1) >= 120) || (((Life*1.0/LifeMax*1.0)<0.3)&&(Random<500))
trigger10 = numhelper(3002) = 1
trigger10 = helper(3002),StateNo != 3027
Trigger10  = (StateNo = 205) && MoveHit
Trigger10  = (var(1) >= 140) || ((Life*1.0/LifeMax*1.0)<0.3)

;===========================================================================
;　食み慟哭
;===========================================================================
;------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 1040
Triggerall = Var(59) >= 1
triggerall = power >= ifelse(var(5)=1,500,0)
triggerall = (var(1) >= 50) || (var(11) != 0)
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = var(2) = 0
triggerall = var(6) = 0
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !InGuardDist
Triggerall = Random <= Var(59)*150
Triggerall = P2BodyDist X=[0,50]
triggerall = P2BodyDist Y+playerID(var(54)),vel y*22+0.5*playerID(var(54)),const(movement.yaccel)*22*19 = [-70,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*22*19)]
trigger1   = numhelper(3002) = 0
Trigger1   = (StateNo = 205) && MoveHit
trigger1   = (Anim = 205) && (AnimElem = 11, >= 0)
Trigger1   = (Random<400) || (var(1) >= 80)
trigger2   = numhelper(3002) = 1
trigger2   = helper(3002),stateno != [3026,3027]
Trigger2   = (StateNo = 205) && MoveHit
trigger2   = (Anim = 205) && (AnimElem = 11, >= 0)
Trigger2   = (Random<400) || (var(1) >= 80)
Trigger3   = (StateNo = 200) && MoveGuarded
Trigger3   = Random<=50 || (Random<=10 && var(1) >= 100)
Trigger4   = (StateNo = 205) && (MoveGuarded=1)
trigger4   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger4   = Random<=50 || (Random<=100 && var(1) >= 100)
trigger5   = numhelper(3002) = 0
Trigger5   = Ctrl
Trigger5   = playerID(var(54)),StateType = S
Trigger5   = (playerID(var(54)),MoveType != A) || (var(1) >= 100)
trigger5   = var(55) != 1
Trigger5   = (Random<=50) || (Random<=20 && var(1) = [80,99]) || (Random<=50 && var(1) >= 100)
trigger6   = numhelper(3002) = 1
trigger6   = helper(3002),stateno != [3026,3027]
Trigger6   = Ctrl
Trigger6   = playerID(var(54)),StateType = S
Trigger6   = (playerID(var(54)),MoveType != A) || (var(1) >= 100)
trigger6   = var(55) != 1
Trigger6   = (Random<=50) || (Random<=20 && var(1) = [80,99]) || (Random<=50 && var(1) >= 100)

;===========================================================================
;　ムベンベウィング
;===========================================================================
;------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 1010
Triggerall = Var(59) >= 1
triggerall = var(1) !=150
triggerall = power >=500
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
Triggerall = playerID(var(54)),MoveType=H
Triggerall = playerID(var(54)),StateType != L
Triggerall = !InGuardDist
Triggerall = Random <= Var(59)*150
Triggerall = (var(55) = 1) || (Random<=200)
trigger1   = ctrl || (StateNo = 21)
Trigger1   = P2BodyDist X=[-20,60]
trigger1   = P2BodyDist Y+playerID(var(54)),vel y*35+0.5*playerID(var(54)),const(movement.yaccel)*35*30 = [-70,-30]
trigger1   = var(55) := 0 || 1
trigger2   = ctrl || (StateNo = 21)
Trigger2   = P2BodyDist X=[60,110]
trigger2   = P2BodyDist Y+playerID(var(54)),vel y*35+0.5*playerID(var(54)),const(movement.yaccel)*35*30 = [-100,-70]
trigger2   = var(55) := 0 || 1
trigger3   = ctrl || (StateNo = 21)
Trigger3   = P2BodyDist X=[110,170]
trigger3   = P2BodyDist Y+playerID(var(54)),vel y*35+0.5*playerID(var(54)),const(movement.yaccel)*35*30 = [-160,-100]
trigger3   = var(55) := 0 || 1

[State -3]
type = ChangeState
value = 1000
Triggerall = Var(59) >= 1
triggerall = var(1) !=150
triggerall = power >=100
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
Triggerall = Ctrl || ((StateNo = 200) && MoveContact) || ((StateNo = 205) && (helper(8000),var(47)=1))
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = playerID(var(54)),MoveType=A
Triggerall = P2BodyDist X=[-5,70]
Triggerall = P2BodyDist Y>=-80
Triggerall = Random <= Var(59)*100
Trigger1   = ((StateNo = 200) && MoveGuarded) || ((StateNo = 205) && (helper(8000),var(47)=1))
Trigger1   = playerID(var(54)),StateType = A
Trigger1   = (playerID(var(54)),Time>=20+Random%7-1*Var(59))
Trigger1   = Random <= 60

;===========================================================================
;　モケーレブレス
;===========================================================================
;------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 1030
Triggerall = Var(59) >= 1
triggerall = var(1) !=150
triggerall = power >=200
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = !InGuardDist
Triggerall = P2BodyDist X >= 130
Triggerall = P2BodyDist Y>=-50
Triggerall = Random <= Var(59)*150
Triggerall = Ctrl
trigger1   = TeamMode = simul
trigger1   = NumPartner
trigger1   = (playerID(var(54)), stateno = [120,159])
Trigger1   = Random<=100

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

[State -3]
type = ChangeState
value = 1020
Triggerall = Var(59) >= 1
triggerall = var(1) !=150
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = (playerID(var(54)),MoveType!=A)||(playerID(var(54)), facing = facing)
Triggerall = !InGuardDist
TriggerAll = var(55) != 1
Triggerall = (P2BodyDist Y>=-80)||(playerID(var(54)),MoveType=H)
Triggerall = Random <= Var(59)*150
trigger1   = ctrl
Trigger1   = P2BodyDist X >= 130
Trigger1   = Random<=(250-Var(56)*6-(var(1) >= 50)*100)
Trigger2   = (StateNo = 205) && (MoveGuarded=1)
trigger2   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger2   = Random<=120+20*helper(8000),var(51)
trigger3   = ctrl
trigger3   = NumPartner
Trigger3   = P2BodyDist X >= 100
trigger3   = (playerID(var(54)), facing = facing)
Trigger3   = Random<=(250-Var(56)*6-(var(1) >= 50)*100)

[State -3,歩き]
Type     = ChangeState
Value    = 21
Triggerall = Var(59) >= 1
Triggerall = (var(11) != 0)
Triggerall = StateType != A
;Triggerall = playerID(var(54)),StateType != L
;Triggerall = playerID(var(54)),MoveType != H
Triggerall = !inguarddist
Triggerall = Random <= Var(59)*150
Triggerall = Ctrl
Trigger1   = P2BodyDist X >= 130
Trigger1   = Random<=200
Trigger2   = BackEdgeBodydist <= 50
;Trigger2   = (playerID(var(54)), stateno = [5100, 5120])
Trigger2   = playerID(var(54)),StateType = L
Trigger2   = Random<=300

[State -3,ｼﾞｬﾝﾌﾟ]
Type     = ChangeState
Value    = 40
Triggerall = Var(59) >= 1
Triggerall = StateType != A
;Triggerall = playerID(var(54)),StateType != L
Triggerall = playerID(var(54)),MoveType != H
Triggerall = (playerID(var(54)),MoveType != A) || (playerID(var(54)),HitDefAttr = ,NT,ST,HT)
Triggerall = !inguarddist
Triggerall = Random <= Var(59)*150
Triggerall = Ctrl
Triggerall = ((!playerID(var(54)),Ctrl)&&(playerID(var(54)),AnimTime <= -17))||(Random<=300)
Trigger1   = P2BodyDist X >= 130
Trigger1   = Random<=100
Trigger2   = BackEdgeBodydist <= 50
;Trigger2   = (playerID(var(54)), stateno = [5100, 5120])
Trigger2   = playerID(var(54)),StateType = L
Trigger2   = (playerID(var(54)),AnimTime <= -17)
Trigger2   = Random<=150



;===========================================================================
;　パチュカブラ
;===========================================================================
[State -1]
type = ChangeState
value = 3020
Triggerall = Var(59) >= 1
triggerall = var(1) < 100
triggerall = power >=ifelse(Var(28)=1 ,2000,3000)
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = (numhelper(3000) = 0) || (var(11) = 1)
triggerall = (numhelper(3001) = 0) || (var(11) = 1)
triggerall = numhelper(3002) = 0
Triggerall = Random <= Var(59)*150
trigger1   = ctrl
trigger1   = (power >=3000) || ((var(28) = 1) && (power >=2500))
Trigger1   = Random<=200
trigger2   = var(11) = 1
trigger2   = (StateNo = 5000 || StateNo = 5001)
Trigger2   = Random<=100
trigger3   = var(11) = 1
trigger3   = (StateNo = 5010 || StateNo = 5011)
Trigger3   = Random<=100

;------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 3010
Triggerall = Var(59) >= 1
triggerall = var(1) < 100
triggerall = power >=ifelse(Var(28)=1 ,1000,1500)
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = (numhelper(3000) = 0) || (var(11) = 1)
triggerall = numhelper(3001) = 0
triggerall = (numhelper(3002) = 0) || (var(11) = 1)
Triggerall = (BackEdgeBodydist > 30)||(Var(28)!=1)
Triggerall = Var(55) != 1
Triggerall = Random <= Var(59)*150
trigger1   = ctrl
trigger1   = (power >=2200) || ((var(28) = 1) && (power >=1700))
Trigger1   = Random<=100;30
trigger2   = var(11) = 1
trigger2   = (StateNo = 5000 || StateNo = 5001)
Trigger2   = Random<=100
trigger3   = var(11) = 1
trigger3   = (StateNo = 5010 || StateNo = 5011)
Trigger3   = Random<=100

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

[State -3]
type = ChangeState
value = 3000
Triggerall = Var(59) >= 1
triggerall = var(1) < 100
triggerall = StateType != A
triggerall = (StateType = S || StateType = C)
triggerall = numhelper(3000) = 0
triggerall = (numhelper(3001) = 0) || (var(11) = 1)
triggerall = (numhelper(3002) = 0) || (var(11) = 1)
triggerall = (playerID(var(54)), stateno != [5100, 5120])
trigger1   = ctrl
Trigger1   = P2BodyDist X = [-10, 170]
Trigger1   = playerID(var(54)),StateType != L
Trigger1   = Random<=50
Trigger1   = Random <= Var(59)*150
trigger2   = var(11) = 1
trigger2   = (StateNo = 5000)||(StateNo = 5001)||(StateNo = 5010)||(StateNo = 5011)
Trigger2   = (Random<=60)||(life<300)||(PrevStateNo=216)
Trigger2   = Random <= Var(59)*100
trigger3   = ctrl
Trigger3   = playerID(var(54)),StateType != L
trigger3   = (power<1700) || ((var(28) != 1) && (power<2200))
Trigger3   = Random<=10
Trigger3   = Random <= Var(59)*150

;===========================================================================
;　通常攻撃
;===========================================================================
;------------------------------------------------------------------------------
[State -3, 200]
Type = ChangeState
Value = 200
Triggerall = Var(59) >= 1
TriggerAll = StateType != A
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !InGuardDist
Triggerall = Random <= Var(59)*150
Trigger1   = Ctrl
trigger1   = var(55) != 1
Trigger1   = P2BodyDist X = [-5, 25]
Trigger1   = P2BodyDist Y>=-40
Trigger1   = Random<=500
Trigger2   = Ctrl
Trigger2   = playerID(var(54)),movetype = H
Trigger2   = playerID(var(54)),StateType != L
Trigger2   = P2BodyDist X = [-5, 25]
Trigger2   = P2BodyDist Y+playerID(var(54)),vel y*7+0.5*playerID(var(54)),const(movement.yaccel)*7*6 = [-10,5]
Trigger3   = (StateNo = 200) && MoveContact
Trigger3   = (playerID(var(54)),BackEdgeBodydist > 10 && P2BodyDist X = [-5, 5])||(playerID(var(54)),BackEdgeBodydist <= 10 && P2BodyDist X = [-5, 0])
Trigger3   = P2BodyDist Y+playerID(var(54)),vel y*7+0.5*playerID(var(54)),const(movement.yaccel)*7*6 = [-10,Ceil(0.5*playerID(var(54)),const(movement.yaccel)*7*6)]
Trigger3   = (Random<=500) || (MoveHit)
Trigger4   = Ctrl
Trigger4   = P2BodyDist X = [-5, 5]
trigger4   = P2BodyDist Y+playerID(var(54)),vel y*7+0.5*playerID(var(54)),const(movement.yaccel)*7*6 = [-10,5]
Trigger4   = playerID(var(54)),AnimTime <= -7
trigger4   = playerID(var(54)),MoveType = I
trigger4   = var(55) != 1
Trigger4   = playerID(var(54)),StateType = A
Trigger4   = !playerID(var(54)),Ctrl

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

[State -3, 205]
Type = ChangeState
Value = 205
Triggerall = Var(59) >= 1
TriggerAll = StateType != A
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
Triggerall = !InGuardDist
Triggerall = Random <= Var(59)*150
Trigger1   = (StateNo = 200) && MoveContact
Trigger2   = Ctrl
Trigger2   = P2BodyDist X = [25, 50]
trigger2   = var(55) != 1
Trigger2   = Random<=100
trigger3 = numhelper(3002) = 1
trigger3 = helper(3002),StateNo = 3027
Trigger3   = Ctrl
Trigger3   = P2BodyDist X = [-5, 80]
Trigger3   = Random<=500
Trigger4   = Ctrl
Trigger4   = playerID(var(54)),movetype = H
Trigger4   = playerID(var(54)),StateType != L
Trigger4   = (playerID(var(54)), stateno != [120,159])
Trigger4   = P2BodyDist X = [-5, 50]
Trigger4   = P2BodyDist Y+playerID(var(54)),vel y*12+0.5*playerID(var(54)),const(movement.yaccel)*12*11 = [-10,10]
Trigger5   = Ctrl
Trigger5   = P2BodyDist X = [-5, 30]
trigger5   = P2BodyDist Y+playerID(var(54)),vel y*12+0.5*playerID(var(54)),const(movement.yaccel)*12*12 = [-10,10]
Trigger5   = playerID(var(54)),AnimTime <= -12
trigger5   = playerID(var(54)),MoveType = I
trigger5   = var(55) != 1
Trigger5   = playerID(var(54)),StateType = A
Trigger5   = !playerID(var(54)),Ctrl

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

[State -3, 210]
Type = ChangeState
Value = 210
Triggerall = Var(59) >= 1
TriggerAll = StateType != A
triggerall = (playerID(var(54)), stateno != [5100, 5120])
Triggerall = (playerID(var(54)),StateType != L)
triggerall = helper(8000),var(48)=0
triggerall = var(1) < 150
Triggerall = Random <= Var(59)*150
trigger1 = numhelper(3002) = 0
Trigger1   = (StateNo = 205) && (helper(8000),var(47)=1)
trigger1   = (Anim = 205) && (AnimElem = 11, >= 0)
trigger1   = MoveHit || ((MoveGuarded=1)&&(Random<=100-20*helper(8000),var(51)))
trigger2 = numhelper(3002) = 0
Trigger2   = Ctrl
Trigger2   = P2BodyDist X = [50, 100]
Trigger2   = P2BodyDist Y>=-80
Trigger2   = Var(57) != 1
trigger2   = var(55) != 1
Trigger2   = (Random<=100-20*helper(8000),var(51))
trigger3 = numhelper(3002) = 0
Trigger3   = Ctrl
Trigger3   = P2BodyDist X = [-5, 50]
Trigger3   = P2BodyDist Y = [-80,-40]
Trigger3   = Var(57) != 1
trigger3   = var(55) != 1
Trigger3   = (Random<=200-20*helper(8000),var(51))
trigger4 = numhelper(3002) = 1
trigger4 = helper(3002),StateNo != 3027
Trigger4   = (StateNo = 205) && (helper(8000),var(47)=1)
trigger4   = (Anim = 205) && (AnimElem = 11, >= 0)
trigger4   = MoveHit || ((MoveGuarded=1)&&(Random<=100-20*helper(8000),var(51)))
trigger5 = numhelper(3002) = 1
trigger5 = helper(3002),StateNo != 3027
Trigger5   = Ctrl
Trigger5   = P2BodyDist X = [50, 100]
Trigger5   = P2BodyDist Y>=-80
trigger5   = var(55) != 1
Trigger5   = (Random<=100-20*helper(8000),var(51))
trigger6 = numhelper(3002) = 1
trigger6 = helper(3002),StateNo != 3027
Trigger6   = Ctrl
Trigger6   = P2BodyDist X = [-5, 50]
Trigger6   = P2BodyDist Y = [-80,-40]
Trigger6   = Var(57) != 1
trigger6   = var(55) != 1
Trigger6   = (Random<=200-20*helper(8000),var(51))
trigger7 = numhelper(3002) = 0
Trigger7   = Ctrl
Trigger7   = playerID(var(54)),MoveType=H
Trigger7   = playerID(var(54)),StateType != L
Trigger7   = P2BodyDist X = [50, 90]
Trigger7   = P2BodyDist Y+playerID(var(54)),vel y*23+0.5*playerID(var(54)),const(movement.yaccel)*23*20 = [-70,10]
Trigger7   = Var(57) != 1
;trigger7   = var(55) != 1
trigger8 = numhelper(3002) = 1
trigger8 = helper(3002),StateNo != 3027
Trigger8   = Ctrl
Trigger8   = playerID(var(54)),MoveType=H
Trigger8   = playerID(var(54)),StateType != L
Trigger8   = P2BodyDist X = [50, 90]
Trigger8   = P2BodyDist Y+playerID(var(54)),vel y*23+0.5*playerID(var(54)),const(movement.yaccel)*23*20 = [-70,10]
Trigger8   = Var(57) != 1
;trigger8   = var(55) != 1
trigger9 = numhelper(3002) = 0
Trigger9   = (StateNo = 205) && (helper(8000),var(47)=1)
;trigger9   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger9   = playerID(var(54)),MoveType=A
trigger10 = numhelper(3002) = 1
trigger10 = helper(3002),StateNo != 3027
Trigger10   = (StateNo = 205) && (helper(8000),var(47)=1)
;trigger10   = (Anim = 205) && (AnimElem = 10, >= 0)
Trigger10   = playerID(var(54)),MoveType=A

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