;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]
;---------------------------------------------------------------------------
; 僆乕僩僞乕儞仌僈乕僪晄壜愝掕

[State -2]
type = AssertSpecial
trigger1 = Var(51) = 1
flag = NoAutoTurn

[State -2]
type = AssertSpecial
trigger1 = Var(51) = 1
trigger2 = Var(51) = 0 && Var(52) = 0
flag  = NoStandGuard
flag2 = NoCrouchGuard
flag3 = NoAirGuard

;---------------------------------------------------------------------------
; 摿庩怳傝岦偒愝掕

[State -2, VarSet]
type = VarSet
triggerall = Var(51) = 1
triggerall = RoundState = [2,3]
triggerall = StateType != A
trigger1 = Ctrl
trigger1 = Command = "holdfwd"
trigger2 = Command = "FF"
trigger3 = StateNo = [120,159]
var(0) = 0

[State -2, VarSet]
type = VarSet
triggerall = Var(51) = 1
triggerall = RoundState = [2,3]
triggerall = MoveType != A
triggerall = StateType != A
triggerall = StateNo != [120,159]
triggerall = !(Command = "holdfwd" && Command = "holdback")
trigger1 = Ctrl
trigger1 = Command = "holdback"
trigger2 = Command = "BB"
var(0) = 1

[State -2, VarSet]
type = Turn
triggerall = Var(51) = 1
triggerall = Var(0) = 1
triggerall = StateType != A
trigger1 = Ctrl
trigger1 = Command = "holdback"
trigger2 = Command = "BB"

;---------------------------------------------------------------------------
; 僕儍儞僾僐儅儞僪張棟

[State -2, VarSet]
type = VarAdd
trigger1 = Command = "holdup"
var(5) = 1

[State -2, VarSet]
type = VarSet
trigger1 = Command != "holdup"
var(5) = 0

;---------------------------------------------------------------------------
; 僕儍儞僾夞悢儕僙僢僩

[State -2, VarSet]
type = VarSet
trigger1 = StateType != A || StateNo = 5210
var(1) = 0

;---------------------------------------------------------------------------
; 嫮棴傔峌寕張棟儕僙僢僩

[State -2, VarSet]
type = VarSet
trigger1 = StateNo != 1100
trigger1 = StateNo != 1150
var(2) = 0

;---------------------------------------------------------------------------
; 杺朄峌寕敪摦惂屼

[State -2, VarSet]
type = VarSet
trigger1 = Var(3) <= 0
var(3) = 0

[State -2, VarSet]
type = VarSet
trigger1 = StateNo = 2000
trigger2 = StateNo = 2050
var(3) = 300

[State -2, VarSet]
type = VarSet
trigger1 = StateNo = 2100
trigger2 = StateNo = 2150
var(3) = 600

[State -2, VarSet]
type = VarAdd
trigger1 = Var(3) > 0
trigger1 = StateNo != 2000
trigger1 = StateNo != 2050
trigger1 = StateNo != 2100
trigger1 = StateNo != 2150
var(3) = -1

;---------------------------------------------------------------------------
; 墛僄僼僃僋僩徚嫀

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = NumExplod(11100) > 0
trigger1 = StateNo != 1100
trigger1 = StateNo != 1150
id = 11100
ignorehitpause = 1

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = NumExplod(11101) > 0
trigger1 = StateNo != 1100
trigger1 = StateNo != 1150
id = 11101
ignorehitpause = 1

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = NumExplod(11102) > 0
trigger1 = StateNo != 1100
trigger1 = StateNo != 1150
id = 11102
ignorehitpause = 1

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = NumExplod(11103) > 0
trigger1 = StateNo != 1100
trigger1 = StateNo != 1150
id = 11103
ignorehitpause = 1

;---------------------------------------------------------------------------
; 僟僂儞屻柍揋忬懺壜帇壔乮僈乕僪柍偟愝掕帪偺傒乯

[State -2, VarSet]
type = VarAdd
trigger1 = Var(52) = 0
trigger1 = Var(6) > 0
trigger1 = PrevStateNo = 5120
v = 6
value = -1
ignorehitpause = 1

[State -2, VarSet]
type = VarSet
trigger1 = Var(52) = 0
trigger1 = !(Var(6) > 0)
trigger1 = StateNo = 5120
v = 6
value = 15
ignorehitpause = 1

[State -2]
type = AssertSpecial
trigger1 = Var(52) = 0
trigger1 = Var(6) > 0
trigger1 = Time%3 = 0
flag = Invisible

;---------------------------------------------------------------------------
; 峌寕椡傾僢僾

[State -2, VarSet]
type = VarSet
trigger1 = Var(52) != 0
fvar(1) = 1.00

[State -2, VarSet]
type = VarSet
trigger1 = Var(52) = 0
fvar(1) = 1.35

;---------------------------------------------------------------------------
; 儘僢僜丒僼傽儞僞僘儅暘恎梡愝掕

[State -2]
type = PalFX
trigger1 = IsHelper(12100)
add = -32,-32,-32
mul = 256,256,256
invertall = 0
color = 256
time = 999999999
ignorehitpause = 1

[State -2]
type = AssertSpecial
trigger1 = IsHelper(12100)
flag  = NoStandGuard
flag2 = NoCrouchGuard
flag3 = NoAirGuard
ignorehitpause = 1

[State -2]
type = AssertSpecial
trigger1 = IsHelper(12100)
trigger1 = Root,Var(3) <= 30
trigger1 = Time%3 = 0
flag = Invisible
ignorehitpause = 1

[State -2]
type = ChangeState
trigger1 = IsHelper(12100)
trigger1 = Root,Var(3) = 1
value = 12102
ignorehitpause = 1

[State -2]
type = HitOverRide
trigger1 = IsHelper(12100)
attr = SCA, AA, AP, AT
stateno = 12101
time = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; 憡庤暻寖撍壒
[State -2]
type = PlaySnd
trigger1 = P2StateNo = 1411
trigger1 = P2MoveType = H
trigger1 = Enemy,Time = 1
value = S1410,0
volume = -200
persistent = 0

;---------------------------------------------------------------------------
; 廱傪徟偑偡(崟廐梩)丂憡庤僗僥乕僞僗曄壔

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "tukemon&HAL" && Enemy,Name = "Akiha"
Trigger1 = Enemy,Var(56) = 1
Value = -8
Kill = 0

[State -2]
Type = PowerAdd
TriggerAll = Enemy,AuthorName = "tukemon&HAL" && Enemy,Name = "Akiha"
Trigger1 = Enemy,Var(51)%10 = 2
Trigger1 = Enemy,Var(56) = 1
Value = -33

;---------------------------------------------------------------------------
; 棯扗/廱傪徟偑偡/廱傪媷傔傞丂憡庤梡

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Akiha_Vermilion"
Trigger1 = Enemy,Var(47) = 1
Value = -8
Kill = 0

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Akiha_Vermilion"
Trigger1 = Enemy,Var(48) = 1 && Enemy,NumExplod(4005)
Value = -8
Kill = 0

[State -2]
Type = PowerAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Akiha_Vermilion"
Trigger1 = Enemy,Var(47) = 1
Value = -26

;---------------------------------------------------------------------------
; 僷僂僟乕僗僲僂丂憡庤梡

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Len"
Trigger1 = Enemy,Var(47) = 1 || Enemy,Var(48) = 1
Value = -Enemy,Var(47)*4-Enemy,Var(48)*4
Kill = 0

;---------------------------------------------------------------------------
; 偠傚偆傠丂憡庤梡

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Hisui"
Trigger1 = Enemy,Var(47) = 1
Value = -10
Kill = 0

[State -2]
Type = PowerAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Hisui"
Trigger1 = Enemy,Var(47) = 1
Value = -150

;---------------------------------------------------------------------------
; 僽儔僢僋丒僋儔僢僋丂憡庤梡

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Warachia"
Trigger1 = Enemy,Var(47) = 1
Value = -10
Kill = 0

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Warachia"
Trigger1 = Enemy,Var(47) = 2 || Enemy,Var(47) = 4
Value = -15
Kill = 0

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Warachia"
Trigger1 = Enemy,Var(47) = 3
Value = -30
Kill = 0

[State -2]
Type = PowerAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Warachia"
Trigger1 = Enemy,Var(47) = 1
Value = 6

[State -2]
Type = PowerAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Warachia"
Trigger1 = Enemy,Var(47) = 2 || Enemy,Var(47) = 3 || Enemy,Var(47) = 4
Value = 15

;---------------------------------------------------------------------------
; 尰戙堛妛偺媇惖幰偱偡丅丂憡庤梡

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "嘓" && Enemy,Name = "Kohaku"
Trigger1 = Enemy,Var(47) = 1
Value = -5
Kill = 0

;---------------------------------------------------------------------------
; 撆岠壥乮僪儘僂傿儞傾儖僇僫)

[State -2]
Type = PowerAdd
TriggerAll = Enemy,AuthorName = "Drowin arcana"
TriggerAll = Enemy,FVar(20) > 0
Trigger1 = Power > 0
Value = -1

[State -2]
Type = LifeAdd
TriggerAll = Enemy,AuthorName = "Drowin arcana"
TriggerAll = Enemy,FVar(20) > 0
Trigger1 = GameTime % 7 = 0
Value = -1
Kill = 0

[State -2]
Type = Palfx
TriggerAll = Enemy,AuthorName = "Drowin arcana"
Trigger1 = Enemy,FVar(20) > 0
Add = 100,0,110
Mul = 220,220,220
Time = 5
IgnoreHitPause = 1

;---------------------------------------------------------------------------
;仭惣峴帥桯乆巕丂楈晞媦傃庻柦憡庤僗僥乕僩

[State -2]
Type       = LifeAdd
TriggerAll = Enemy,AuthorName    = "Souki" && Enemy,Name = "Yuyuko Saigyouji"
Trigger1   = Enemy,Var(3)        = 1 || Enemy,Var(3) = 2
Trigger1   = GameTime%6          = 0
Value      = IfElse(Enemy,Var(3) = 1, -2, -3)
Kill       = 0

;---------------------------------------------------------------------------
; 偆偳傫偘丂撆墝枊梡乮僔儘僩偝傫乯

[State -2]
Type = LifeAdd
TriggerAll = EnemyNear,AuthorName = "Shiroto"
TriggerAll = EnemyNear,Name = "Reisen Udongein Inaba"
Trigger1 = EnemyNear,Var(40) != 0
Trigger1 = Pos Y = [-30,10]
Trigger1 = GameTime%3 = 0
Value = -EnemyNear,Var(40)
Kill = 0

;---------------------------------------------------------------------------
;仭扙嵃偺媀 惂屼乮AuthorName = "mikage_th"乯

;怳傝岦偒梷惂
[State pos moving]
Type = AssertSpecial
TriggerAll = (EnemyNear,Name = "Komachi Onoduka")*(EnemyNear,AuthorName = "mikage_th")*(TeamMode = Single)
Trigger1 = (EnemyNear,StateNo = 820)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,13)
Trigger2 = (EnemyNear,StateNo = 821)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,43)
Flag = NoAutoTurn

;堏摦
[State pos moving]
Type = PosAdd
TriggerAll = (Enemynear,Name = "Komachi Onoduka")*(Enemynear,AuthorName = "mikage_th")*(TeamMode = single)
Trigger1 = (EnemyNear,StateNo = 820)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,13)
Trigger2 = (EnemyNear,StateNo = 821)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,43)
X = -Ceil(EnemyNear,FVar(36))*Facing*EnemyNear,Facing
Y = -Ceil(EnemyNear,FVar(37))*(StateType != L)

;StateType != A + StateType != L 偺応崌嫮惂棊壓State傊
[State pos moving]
Type = ChangeState
TriggerAll = (Enemynear,Name = "Komachi Onoduka")*(Enemynear,AuthorName = "mikage_th")*(TeamMode = single)
TriggerAll = (StateType != A)*(Pos Y != 0)*(StateType != L)
Trigger1 = (EnemyNear,StateNo = 820)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,13)
Trigger2 = (EnemyNear,StateNo = 821)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,43)
Value = 50

;---------------------------------------------------------------------------
;仭扙嵃偺媀 惂屼乮AuthorName = "mikage_th105"乯

;怳傝岦偒梷惂
[State pos moving]
Type = AssertSpecial
TriggerAll = (Enemynear,Name = "Komachi Onoduka")*(Enemynear,AuthorName = "mikage_th105")*(TeamMode = Single)
Trigger1 = (EnemyNear,StateNo = 820)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,13)
Trigger2 = (EnemyNear,StateNo = 821)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,43)
Flag = NoAutoTurn

;堏摦
[State pos moving]
Type = PosAdd
TriggerAll = (Enemynear,Name = "Komachi Onoduka")*(Enemynear,AuthorName = "mikage_th105")*(TeamMode = Single)
Trigger1 = (EnemyNear,StateNo = 820)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,13)
Trigger2 = (EnemyNear,StateNo = 821)*(EnemyNear,Anim = 823)*(EnemyNear,AnimElem = 6,43)
X = -Ceil(EnemyNear,FVar(24))*Facing*EnemyNear,Facing
Y = -Ceil(EnemyNear,FVar(25))*(StateType != L)

;StateType != A + StateType != L 偺応崌嫮惂棊壓State傊
[State pos moving]
Type = ChangeState
TriggerAll = (Enemynear,Name = "Komachi Onoduka")*(Enemynear,AuthorName = "mikage_th105")*(TeamMode = Single)
TriggerAll = (StateType != A)*(Pos Y != 0)*(StateType != L)
Trigger1 = (EnemyNear,StateNo = 820)*(EnemyNear,anim = 823)*(EnemyNear,AnimElem = 6,13)
Trigger2 = (EnemyNear,StateNo = 821)*(EnemyNear,anim = 823)*(EnemyNear,AnimElem = 6,43)
Value = 50

;---------------------------------------------------------------------------
;仭撆墝枊乽姠巣怐暔偺嬍乿 惂屼乮AuthorName = "mikage_th"乯

[State LifeAdd]
Type = LifeAdd
Trigger1 = NumEnemy = 1
Trigger1 = Pos Y > -240
Trigger1 = (Enemy(0),Name = "Reisen Udongein Inaba")*(Enemy(0),AuthorName = "mikage_th")*(Enemy(0),FVar(35))
Value = -Floor(Enemy(0),FVar(35))*2
IgnoreHitPause = 1
Absolute = 1
Kill = 0

[State LifeAdd]
Type = LifeAdd
TriggerAll = NumEnemy = 2
TriggerAll = Pos Y > -240
Trigger1 = (Enemy(0),Name = "Reisen Udongein Inaba")*(Enemy(0),AuthorName = "mikage_th")*(Enemy(0),FVar(35))
Trigger2 = (Enemy(1),Name = "Reisen Udongein Inaba")*(Enemy(1),AuthorName = "mikage_th")*(Enemy(1),FVar(35))
Value = -Floor(Enemy(0),FVar(35))*2-Floor(Enemy(1),FVar(35))*2
IgnoreHitPause = 1
Absolute = 1
Kill = 0

;---------------------------------------------------------------------------
;仭撆墝枊乽姠巣怐暔偺嬍乿 惂屼乮AuthorName = "mikage_th105"乯

[State LifeAdd]
Type = LifeAdd
Trigger1 = NumEnemy = 1
Trigger1 = Pos Y > -240
Trigger1 = (Enemy(0),Name = "Reisen Udongein Inaba")*(Enemy(0),AuthorName = "mikage_th105")*(Enemy(0),FVar(21))
Value = -Floor(Enemy(0),FVar(21))*2
IgnoreHitPause = 1
Absolute = 1
Kill = 0

[State LifeAdd]
Type = LifeAdd
TriggerAll = NumEnemy = 2
TriggerAll = Pos Y > -240
Trigger1 = (Enemy(0),Name = "Reisen Udongein Inaba")*(Enemy(0),AuthorName = "mikage_th105")*(Enemy(0),FVar(21))
Trigger2 = (Enemy(1),Name = "Reisen Udongein Inaba")*(Enemy(1),AuthorName = "mikage_th105")*(Enemy(1),FVar(21))
Value = -Floor(Enemy(0),FVar(21))*2-Floor(Enemy(1),FVar(21))*2
IgnoreHitPause = 1
Absolute = 1
Kill = 0

;---------------------------------------------------------------------------
;仭搚拝恄偺釳傝仌儈僔儍僌僕偝傑偺釳傝 惂屼

;搚拝恄偺釳傝
[State LifeAdd]
Type = LifeAdd
Trigger1 = NumEnemy
Trigger1 = (Enemynear,Name = "Suwako Moriya")*(Enemynear,AuthorName = "mikage_th")*(TeamMode = Single)
Trigger1 = Floor((Enemynear,Var(42)%100)*0.1) = [0,1]
Trigger1 = (Floor(Enemynear,FVar(38)))%1000 > 0
Trigger1 = Floor(Enemynear,FVar(38)*0.001) = 2
Value = Floor(Enemynear,FVar(36)*(LifeMax/10000.000000))
IgnoreHitPause = 1
Absolute = 1
Kill = 0

[State 儈僔儍僌僕偝傑偺釳傝]
Type = LifeAdd
TriggerAll = NumEnemy
TriggerAll = (Enemynear,Name = "Suwako Moriya")*(Enemynear,AuthorName = "mikage_th")*(TeamMode = Single)
Trigger1 = Floor(EnemyNear,FVar(35)) = 1
Trigger1 = MoveType = H
Trigger1 = StateNo != [150,155]
Trigger2 = Floor(EnemyNear,FVar(35)) = 2
Trigger2 = MoveType = H
Trigger2 = StateNo = [150,155]
Value = Floor(EnemyNear,FVar(33))
IgnoreHitPause = 1
Absolute = 1
Kill = 0

;---------------------------------------------------------------------------
; 恄旜娤楅丂庺偄岠壥晅壛

[State -2, LifeAdd]
Type = LifeAdd
TriggerAll = (Enemy,TeamMode = Simul) = 0
TriggerAll = (TeamMode = Simul) = 0
TriggerAll = NumEnemy
TriggerAll = Enemy,AuthorName = "586"
TriggerAll = Enemy,Name = "Misuzu Kamio"
TriggerAll = Enemy,fvar(11) > 0
Trigger1 = Enemy,var(13) = 1
Trigger1 = GameTime % 13 = 0
Trigger2 = Enemy,var(13) = 2
Trigger2 = GameTime % 11 = 0
Trigger3 = Enemy,var(13) = 3
Trigger3 = GameTime % 8 = 0
Trigger4 = Enemy,var(13) = 4
Trigger4 = GameTime % 6 = 0
Trigger5 = Enemy,var(13) = 5
Trigger5 = GameTime % 3 = 0
Value = -1
Kill = 0
IgnoreHitPause = 1

[State -2, PalFX]
Type = PalFX
TriggerAll = (Enemy,TeamMode = Simul) = 0
TriggerAll = (TeamMode = Simul) = 0
TriggerAll = NumEnemy
TriggerAll = Enemy,AuthorName = "586"
TriggerAll = Enemy,Name = "Misuzu Kamio"
Trigger1 = Enemy,fvar(11) > 0
Add = -50,150,150
Time = 1
IgnoreHitPause = 1

;---------------------------------------------------------------------------
; 僀僠僐儘撆乮SAIKEI儐僟乯

[State -2]
Type = LifeAdd
Trigger1 = Enemy,Name = "JUDA"
Trigger1 = Enemy,AuthorName = "SAIKEI"
Trigger1 = Enemy,FVar(23) > 0
Trigger1 = Floor(Enemy,FVar(23))%4 = 0
Trigger1 = Enemy,Var(0) <= 0
Trigger1 = Enemy,MoveType != H || Enemy,MoveType = H && Enemy,HitShakeOver
Value = -1
Kill = 0

[State -2]
Type = PalFX
TriggerAll = GameTime%20 = 0
Trigger1 = Enemy,Name = "JUDA"
Trigger1 = Enemy,AuthorName = "SAIKEI"
Trigger1 = Enemy,FVar(23) > 0
Time = 8
Add = 255,0,0

;---------------------------------------------------------------------------
; 垽尨撧搒旤乽挧敪乿懳墳僗僥乕僩

[State -2]
Type = PowerAdd
TriggerAll = NumEnemy
TriggerAll = EnemyNear,Name = "AIHARA NATSUMI" &&  EnemyNear,AuthorName = "YU-TOHARU"
Trigger1 = EnemyNear,StateNo = 197 && EnemyNear,StateTime = 70
Value = -45

;---------------------------------------------------------------------------
; 傾儖A僕僼乽挧敪乿懳墳僗僥乕僩

[State -2]
Type = PowerAdd
TriggerAll = NumEnemy
TriggerAll = EnemyNear,Name = "AL AZIF" &&  EnemyNear,AuthorName = "YU-TOHARU"
Trigger1 = EnemyNear,StateNo = 195 && EnemyNear,StateTime = 30
Value = -45

;---------------------------------------------------------------------------
; 儅儈儎乽挧敪乿懳墳僗僥乕僩

[State -2]
Type = PowerAdd
TriggerAll = NumEnemy
TriggerAll = EnemyNear,Name = "MAMIYA" &&  EnemyNear,AuthorName = "YU-TOHARU"
Trigger1 = EnemyNear,StateNo = 195 && EnemyNear,StateTime = 30
Value = 1000

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------
[Statedef -3]

[State -3, DisplayToClipBoard]
type = DisplayToClipBoard
trigger1 = 1
text = "P2-X=%f P2-Y=%f PosY=%f VelX=%f VelY=%f \n"
params = P2BodyDist X, P2BodyDist Y, Enemy,Pos Y, Enemy,Pos X, Pos X;Vel X, Vel Y
ignorehitpause = 1

[State -3, DisplayToClipBoard]
type = AppendToClipBoard
trigger1 = 1
text = "V1=%d V2=%d V3=%d V4=%d V5=%d"
params = Var(1), Var(2), Var(3), Var(4), Var(6)
ignorehitpause = 1

;伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂伂
; 儘僢僜丒僼傽儞僞僘儅暘恎梡俙俬

[State -3, Rosso_AI]
type = Turn
triggerall = IsHelper(12100)
triggerall = StateNo = 0 && Ctrl
trigger1 = !(Facing = 1 && ((EnemyNear,Pos X - Pos X) > 0) || Facing = -1 && ((EnemyNear,Pos X - Pos X) < 0))

;壓嫮峌寕乮抧忋乯
[State -3, 2B]
type = ChangeState
value = 1300
triggerall = IsHelper(12100)
triggerall = StateType != A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
triggerall = Random = [100,105]
trigger1 = Ctrl
trigger1 = P2BodyDist X - (EnemyNear,Vel X * 5) = [-20,130]
trigger2 = StateNo = 1000 && AnimElemTime(4) > 0
trigger3 = StateNo = 1001 && AnimElemTime(4) > 0
trigger4 = StateNo = 1010 && AnimElemTime(8) > 0
trigger5 = StateNo = 1011 && AnimElemTime(5) > 0
trigger6 = StateNo = 1012 && AnimElemTime(5) > 0
trigger7 = StateNo = 1100 && AnimElemTime(11) > 0

;壓嫮峌寕乮嬻拞乯
[State -3, 2B(Air)]
type = ChangeState
value = 1200
triggerall = IsHelper(12100)
triggerall = StateType = A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
triggerall = Random = [100,105]
trigger1 = Ctrl
trigger1 = P2BodyDist X - (EnemyNear,Vel X * 5) = [-20,130]
trigger2 = StateNo = 1050 && AnimElemTime(4) > 0
trigger3 = StateNo = 1051 && AnimElemTime(4) > 0
trigger4 = StateNo = 1060 && AnimElemTime(8) > 0
trigger5 = StateNo = 1061 && AnimElemTime(5) > 0
trigger6 = StateNo = 1062 && AnimElemTime(5) > 0
trigger7 = StateNo = 1150 && AnimElemTime(11) > 0

;忋嫮峌寕乮抧忋乯
[State -3, 8B]
type = ChangeState
value = 1500
triggerall = IsHelper(12100)
triggerall = StateType != A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
triggerall = Random = [200,205]
trigger1 = Ctrl
trigger1 = P2BodyDist X - (EnemyNear,Vel X * 5) = [-20,130]
trigger2 = StateNo = 1000 && AnimElemTime(4) > 0
trigger3 = StateNo = 1001 && AnimElemTime(4) > 0
trigger4 = StateNo = 1010 && AnimElemTime(8) > 0
trigger5 = StateNo = 1011 && AnimElemTime(5) > 0
trigger6 = StateNo = 1012 && AnimElemTime(5) > 0
trigger7 = StateNo = 1100 && AnimElemTime(11) > 0

;忋嫮峌寕乮嬻拞乯
[State -3, 8B(Air)]
type = ChangeState
value = 1550
triggerall = IsHelper(12100)
triggerall = StateType = A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
triggerall = Random = [200,205]
trigger1 = Ctrl
trigger1 = P2BodyDist X - (EnemyNear,Vel X * 5) = [-20,130]
trigger2 = StateNo = 1050 && AnimElemTime(4) > 0
trigger3 = StateNo = 1051 && AnimElemTime(4) > 0
trigger4 = StateNo = 1060 && AnimElemTime(8) > 0
trigger5 = StateNo = 1061 && AnimElemTime(5) > 0
trigger6 = StateNo = 1062 && AnimElemTime(5) > 0
trigger7 = StateNo = 1150 && AnimElemTime(11) > 0

;墶嫮峌寕乮抧忋乯
[State -3, 6B]
type = ChangeState
value = 1400
triggerall = IsHelper(12100)
triggerall = StateType != A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
triggerall = Random = [300,305]
trigger1 = Ctrl
trigger1 = P2BodyDist X - (EnemyNear,Vel X * 5) = [-50,130]
trigger2 = StateNo = 1000 && AnimElemTime(4) > 0
trigger3 = StateNo = 1001 && AnimElemTime(4) > 0
trigger4 = StateNo = 1010 && AnimElemTime(8) > 0
trigger5 = StateNo = 1011 && AnimElemTime(5) > 0
trigger6 = StateNo = 1012 && AnimElemTime(5) > 0
trigger7 = StateNo = 1100 && AnimElemTime(11) > 0

;墶嫮峌寕乮嬻拞乯
[State -3, 6B(Air)]
type = ChangeState
value = 1450
triggerall = IsHelper(12100)
triggerall = StateType = A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
triggerall = Random = [300,305]
trigger1 = Ctrl
trigger1 = P2BodyDist X - (EnemyNear,Vel X * 5) = [-50,130]
trigger2 = StateNo = 1050 && AnimElemTime(4) > 0
trigger3 = StateNo = 1051 && AnimElemTime(4) > 0
trigger4 = StateNo = 1060 && AnimElemTime(8) > 0
trigger5 = StateNo = 1061 && AnimElemTime(5) > 0
trigger6 = StateNo = 1062 && AnimElemTime(5) > 0
trigger7 = StateNo = 1150 && AnimElemTime(11) > 0

;僟僢僔儏
[State -3, Rosso_AI]
type = ChangeState
value = 100
triggerall = IsHelper(12100)
triggerall = StateType != A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [100,105]
triggerall = StateNo != [12100,12102]
triggerall = Ctrl
triggerall = P2BodyDist X - (EnemyNear,Vel X * 5) != [-100,100]
triggerall = Random > 900
trigger1 = Facing = 1
trigger1 = (EnemyNear,Pos X - Pos X) > 0
trigger2 = Facing = -1
trigger2 = (EnemyNear,Pos X - Pos X) < 0

;僕儍儞僾
[State -3, Rosso_AI]
type = ChangeState
value = 41
triggerall = IsHelper(12100)
triggerall = StateType != A
triggerall = Alive
triggerall = RoundState = 2
triggerall = StateNo != [12100,12102]
trigger1 = Ctrl
trigger1 = Random < 10
