; She-Ra's CMD file

[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

[Defaults]
command.time = 15
command.buffer.time = 1

;-| Hypers |-----------------------------------------------------------
[Command]
name = "DoubleDragon"
command = ~D, DF, F, c+z
time = 15

[Command]
name = "DoubleDragonCounter"
command = ~B, DB, D, c+z
time = 15

[Command]
name = "DoubleDragonCross"
command = ~D, DB, B, c+z
time = 15

[Command]
name = "TripleKFPalm"
command = ~D, DF, F, x+y
time = 20

[Command]
name = "TripleKFPalm"
command = ~D, DF, F, z+y
time = 20

[Command]
name = "TripleKFPalm"
command = ~D, DF, F, x+z
time = 20

[Command]
name = "KFPower"
command = ~D, DB, B, x+y
time = 20

[Command]
name = "KFPower"
command = ~D, DB, B, x+z
time = 20

[Command]
name = "KFPower"
command = ~D, DB, B, z+y
time = 20

[Command]
name = "Starburst"
command = ~D, DB, B, a+b
time = 20

[Command]
name = "Starburst"
command = ~D, DB, B, a+c
time = 20

[Command]
name = "Starburst"
command = ~D, DB, B, b+c
time = 20

[Command]
name = "Suplex_Doom"
command = ~D, DF, F, a+b
time = 20

[Command]
name = "Suplex_Doom"
command = ~D, DF, F, b+c
time = 20

[Command]
name = "Suplex_Doom"
command = ~D, DF, F, a+c
time = 20

;--------------------------------
;Counter 1 & Recovery Roll (BACK)
[Command]
name = "Counter1"
command = ~B, DB, D, z
time = 15

[Command]
name = "Counter1"
command = ~B, DB, D, y
time = 15

[Command]
name = "Counter1"
command = ~B, DB, D, x
time = 15

;Counter 2 & Recovery Roll (Foward)
[Command]
name = "Counter2"
command = ~B, DB, D, c
time = 15

[Command]
name = "Counter2"
command = ~B, DB, D, b
time = 15

[Command]
name = "Counter2"
command = ~B, DB, D, a
time = 15

;-| Special Motions |------------------------------------------------------
[Command]
name = "upper_x"
command = ~F, D, DF, x

[Command]
name = "upper_y"
command = ~F, D, DF, y

[Command]
name = "upper_z"
command = ~F, D, DF, z

[Command]
name = "back_upper_a"
command = ~B, D, DB, a

[Command]
name = "back_upper_b"
command = ~B, D, DB, b

[Command]
name = "back_upper_c"
command = ~B, D, DB, c

[Command]
name = "QCF_x"
command = ~D, DF, F, x

[Command]
name = "QCF_y"
command = ~D, DF, F, y

[Command]
name = "QCF_z"
command = ~D, DF, F, z

[Command]
name = "QCB_x"
command = ~D, DB, B, x

[Command]
name = "QCB_y"
command = ~D, DB, B, y

[Command]
name = "QCB_z"
command = ~D, DB, B, z

[Command]
name = "QCF_a"
command = ~D, DF, F, a

[Command]
name = "QCF_b"
command = ~D, DF, F, b

[Command]
name = "QCF_c"
command = ~D, DF, F, c

[Command]
name = "QCB_a"
command = ~D, DB, B, a

[Command]
name = "QCB_b"
command = ~D, DB, B, b

[Command]
name = "QCB_c"
command = ~D, DB, B, c

[Command]
name = "HCB_a"
command = ~F, DF, D, DB, B, a

[Command]
name = "HCB_b"
command = ~F, DF, D, DB, B, b

[Command]
name = "HCB_c"
command = ~F, DF, D, DB, B, c

[Command]
name = "HCB_a"
command = ~F, D, B, a

[Command]
name = "HCB_b"
command = ~F, D, B, b

[Command]
name = "HCB_c"
command = ~F, D, B, c

[Command]
name = "cat_paw_c"
command = ~60$B, $F, c
time = 10

[Command]
name = "cat_paw_b"
command = ~60$B, $F, b
time = 10

[Command]
name = "cat_paw_a"
command = ~60$B, $F, a
time = 10
; -| CPU Commands |------

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

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

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

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

[Command]
name = "BB"     ;Required (do not remove)
command = B, B
time = 10

;-| MvC S-Jump |------------
[Command]
name = "DU"
command = D, U
time = 15

[Command]
name = "DUF"
command = D, UF
time = 15

[Command]
name = "DUB"
command = D, UB
time = 15

[Command]
name = "ChargedDU"
command = ~10$D, $U

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y
time = 1

[Command]
name = "recovery";Required (do not remove)
command = x+z
time = 1

[Command]
name = "recovery";Required (do not remove)
command = z+y
time = 1

[Command]
name = "3P"
command = x+y+z
time = 1

[Command]
name = "3K"
command = a+b+c
time = 1

[Command]
name = "LKWeak2"
command = a, a
time = 25

[Command]
name = "LKWeak"
command = a, a, a
time = 25

[Command]
name = "LKmed"
command = b, b, b
time = 20

[Command]
name = "LKhard"
command = c, c, c
time = 20

;-| Swift Wind |-----------------------------------------------
[Command]
name = "Swift_Wind"
command = x+a
time = 1

;-| PartnerChange |-----------------------------------------------
[Command]
name = "troca";Sorceress
command = z+c
time = 1

[Command] 
name = "Assist";He-man
command = y+b
time = 1

;-| Strikers (with tag-team) |-----------------------------------
[Command]
name = "Sorceress"
command = y+c
time = 1

[Command] 
name = "He-man"
command = x+b
time = 1

;-| ADVGUARD |------------
[Command] 
name = "AdvGuard"
command = y+z
time = 10

[Command] 
name = "AdvGuard"
command = x+y
time = 10

[Command] 
name = "AdvGuard"
command = x+z
time = 10

;-| Dir + Button |------------
[Command]
name = "fwd_b"
command = /F,b
time = 1

[Command]
name = "fwd_c"
command = /F,c
time = 1

[Command]
name = "back_b"
command = /B,b
time = 1

[Command]
name = "back_c"
command = /B,c
time = 1

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

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

[Command]
name = "down_c"
command = /$D,c
time = 1

[Command]
name = "fwd_y"
command = /F,y
time = 1

[Command]
name = "fwd_z"
command = /F,z
time = 1

[Command]
name = "back_y"
command = /B,y
time = 1

[Command]
name = "back_z"
command = /B,z
time = 1

[Command]
name = "down_x"
command = /$D,x
time = 1

[Command]
name = "down_y"
command = /$D,y
time = 1

[Command]
name = "down_z"
command = /$D,z
time = 1

;-| Single Button |---------------------------------------------------------
[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 = "hold-start"
command = /s
time = 1

[Command]
name = "release-start"
command = ~s
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1

[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1

[Command]
name = "hold_z"
command = /$z
time = 1

[Command]
name = "hold_y"
command = /$y
time = 1

[Command]
name = "hold_x"
command = /$x
time = 1

[Command]
name = "hold_a"
command = /$a
time = 1

[Command]
name = "hold_b"
command = /$b
time = 1

[Command]
name = "hold_c"
command = /$c
time = 1

;==============================================================================================================;
;=========================================;
;=code_bao_maru_cmd_by_shadaloo666========;
;=========================================;
;ȉ[Command]ǉ

;-| bao |--------------------------------------------------------------
[Command]
name = "bao"
command = D, D, s;==BAOMARU_HELPHER_START
time = 20

[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="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

[Command]
name = "holdfwd"   ;vς (L[̕ύX͉\łOς薳ɂĂ͂܂)
command = /$F
time = 1

[Command]
name = "holdback"  ;vς (L[̕ύX͉\łOς薳ɂĂ͂܂)
command = /$B
time = 1

[Command]
name = "holdup"    ;vς (L[̕ύX͉\łOς薳ɂĂ͂܂)
command = /$U
time = 1

[Command]
name = "holddown"  ;vς (L[̕ύX͉\łOς薳ɂĂ͂܂)
command = /$D
time = 1

[Command]
name = "hold_a"
command = /$a
time = 1

[Command]
name = "hold_b"
command = /$b
time = 1

[Command]
name = "hold_c"
command = /$c
time = 1

[Command]
name = "hold_x"
command = /$x
time = 1

[Command]
name = "hold_y"
command = /$y
time = 1

[Command]
name = "hold_z"
command = /$z
time = 1

;---------------------------------------------------------------------------
;end_baomaru_code_by_shadaloo666
;---------------------------------------------------------------------------
;=========================================;
;===========end_cmd_baomaru_code==========;
;=========================================;
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[Statedef -1]


;============================================================================;
;baomaru_trigger_by_shadaloo666
;============================================================================;

;[Statedef -1]̂ɈȉRsy
;---------------------------------------------------------------------------
;bao
;---------------------------------------------------------------------------
[State -1, bao]
type = ChangeState
value = 948494501
triggerall = AILevel=0
triggerall = command = "bao"
trigger1 = statetype != A
trigger1 = movetype != H
trigger1 = ctrl

;AI
[State -1, bao]
type = ChangeState
value = 948494501
triggerall = AILevel>0
TriggerAll = P2MoveType != H
triggerall = P2statetype != A
TriggerAll = RoundState = 2
triggerall = enemynear,selfanimexist(19230)
triggerAll = p2bodydist X = [0,30]
triggerall = EnemyNear,life > 0
triggerall = P2stateno != 5120
trigger1 = statetype != A
trigger1 = movetype != H
trigger1 = ctrl
trigger1 = random >= 500
;---------------------------------------------------------------------------

;end_baomaru_triger==========================================================;
;============================================================================;
;---------------------------------------------------------------------------


;Recovery Roll
[State -1, Falling]
type = VarSet
trigger1 = command = "Counter2" ^^ command = "Counter1"
trigger2 = var(20)=1 && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1))
triggerall = alive; && life!=0
triggerall = roundstate = 2
triggerall = (stateno = 5050) || (stateno = 5071) || (stateno = 5100) || (stateno = 5120)
var(3) = 1 + (command = "Counter2")

[State -1, Rolling]
type = ChangeState
value = 8123
triggerall = Var(3) != 0 && alive; && life!=0
triggerall = roundstate = 2
triggerall = (canrecover && ((stateno = 5050) || (stateno = 5071))) || (stateno = 5100) || (stateno = 5120)
trigger1 = (Pos Y >= 0) && (Vel Y > 0)

[State -1, Rolling] 
type = ChangeState 
triggerall = Var(3) != 0 && alive && roundstate = 2
triggerall = stateno = 5120 && time <= 8
triggerall = command = "holdback" ^^ command = "holdfwd"
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = command = "hold_z" || command = "hold_y" || command = "hold_x"
trigger2 = command = "hold_a" || command = "hold_b" || command = "hold_c"
value = 8123 + (command = "holdfwd")

;--------------------------------
;AI AIR Combo
[State -1];	fracos areos
type = ChangeState
value = 600 + 30 * (P2bodyDist x < 42 || var(3) > 1)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = roundstate = 2
triggerall = var(20) = 1 && random > life && time % 4
triggerall = (!movecontact && ctrl)
trigger1 = statetype = A && var(3) < 3
trigger1 = P2BodyDist X <= 50 + vel x * 3
trigger1 = abs(p2bodydist Y) < abs(const(size.head.pos.y))
trigger2 = stateno= 8850 || (stateno= 8800 && p2movetype=H)
ignorehitpause=1

[State -1];	mdios areos
type = ChangeState
value = 610 + 30 * (P2bodyDist x > 40 || var(3) >= 7)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = var(20) = 1 && random > life && time % 4
triggerall = statetype = A && var(3) < 12 && roundstate = 2
triggerall = (!movecontact && ctrl) 
trigger1 = P2BodyDist X <= 55 + vel x * 3
trigger1 = abs(p2bodydist Y) < abs(const(size.head.pos.y))
trigger2 = stateno = 600 || stateno = 630
trigger2 = var(3) >= 3
ignorehitpause=1

[State -1];	Fortes areos
type = ChangeState
value = 620 + 30 * (P2bodyDist x < 61)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = var(20) = 1 && random > life && time % 4
triggerall = statetype = A && var(3) < 16 && roundstate = 2
triggerall = stateno != 620 && stateno < 650 && (!movecontact && ctrl) 
trigger1 = P2BodyDist X <= 81 + vel x * 3
trigger1 = abs(p2bodydist Y) < abs(const(size.head.pos.y))
trigger2 = var(3) >= 12 && stateno = [600,640]
ignorehitpause=1

;AI Ground Combo 1
[State -1];	fracos em p
type = ChangeState
value = 200 + 30 * (P2StateType != A || var(3) > 1)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = roundstate = 2 && var(20) = 1 && time > 7
triggerall = random > life && time % 4 && ctrl
triggerall = const(size.mid.pos.y) > p2bodydist y + enemynear,const(size.head.pos.y)
trigger1 = StateType != A && P2Movetype != A
trigger1 = P2StateType != C && p2bodydist Y > -20
trigger1 = P2BodyDist X <= 56
ignorehitpause=1

[State -1];	fracos abaixados
type = ChangeState
value = 430 - 30 * (P2StateType = A || var(3) > 1)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = var(20) = 1 && P2BodyDist X <= 68 
triggerall = random > life && time % 4 && ctrl
triggerall = roundstate = 2 && stateno = 100
trigger1 = P2Movetype != A && P2StateType != A
trigger2 = P2Movetype = A && P2StateType = S
trigger2 = P2life < life
ignorehitpause=1

[State -1];	mdios abaixados
type = ChangeState
value = 440 - (P2Movetype != A || var(3) >= 7) * 30
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = roundstate = 2 && var(20) = 1
triggerall = stateno = 400 || stateno = 430 || stateno = 200 || stateno = 230
trigger1 = movecontact || ctrl
trigger1 = random > life && time % 4 && P2BodyDist X <= 65
trigger2 = P2Dist Y <= -125
trigger3 = stateno = 430 && movehit
ignorehitpause=1

[State -1];	mdios em p
type = ChangeState
value = 240 - (p2statetype != C || P2BodyDist X <= 45 || var(3) >= 7) * 30
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = var(20) = 1 && random > life && time % 4
triggerall = statetype != C && roundstate = 2
triggerall = movecontact || ctrl
triggerall = P2BodyDist X <= 85
triggerall = const(size.mid.pos.y) > p2bodydist y + enemynear,const(size.head.pos.y)
trigger1 = stateno = 100
trigger2 = stateno = 400 || stateno = 430
trigger3 = stateno = 200 || stateno = 230
ignorehitpause=1

[State -1];	gancho abaixado
type = ChangeState
value = 420 + (enemynear,statetype=A || P2BodyDist X >= 50) * 30
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = roundstate = 2 && StateType != A
triggerall = var(20) = 1 && random > life && time % 4
triggerall = movecontact || ctrl
triggerall = P2BodyDist X <= 64
trigger1 = stateno != 420 && var(3) >= 12 && stateno = [400,440]
trigger2 = stateno != 220 && var(3) >= 12 && stateno = [200,240]
ignorehitpause=1

[State -1];	fortes em p
type = ChangeState
value = 220 + 30 * (P2BodyDist X < 39 && P2Dist y != 0)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = roundstate = 2
triggerall = var(20) = 1 && random > life && time % 4
triggerall = movecontact || ctrl
triggerall = P2StateType != C && StateType != A
triggerall = P2BodyDist X <= 62
triggerall = const(size.mid.pos.y) > p2bodydist y + enemynear,const(size.head.pos.y)
trigger1 = stateno != 420 && var(3) >= 12 && stateno = [400,440]
trigger2 = stateno != 220 && var(3) >= 12 && stateno = [200,240]
ignorehitpause=1

;--------------------------------
;S-Jump UP/FWD
[State -1];Aerial Rave Follow-Jump
type = ChangeState
value = 8800
trigger1 = (Command = "holdup" || command = "3K") && movehit
trigger1 = stateno = 420
trigger2 = statetype != A && ctrl
trigger2 = command = "DU" || command = "DUF"

[State -1]; a.i.
type = ChangeState
value = 8800
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = roundstate = 2 && StateType != A; && P2MoveType!=A
triggerall = var(20) = 1 && random > life && time % 4
trigger1 = ctrl && p2bodydist Y < 1.66 * (const(size.head.pos.y))
trigger2 = ctrl && p2StateNo >= 5000 && (enemynear, vel y < -5)
trigger3 = stateno = 420 && movehit
trigger4 = ctrl && P2BodyDist X > 120 && stateno = [150,151]
trigger4 = (var(6) != 0) || p2stateno = [3000,4000]

;S-Jump BWD
[State -1]
type = ChangeState
value = 8900
triggerall = statetype != A
triggerall = ctrl
trigger1 = command = "DUB"

;-------------------------------
;Normal Jump
[State -1]
type = ChangeState
value = 40
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = var(20) = 1 && random > life && time % 5 && statetype!=A && ctrl
trigger1 = (stateno=100 ||stateno=20||Command = "holdfwd")
trigger1 = VAR(6) != 0
trigger1 = p2bodydist X > 220
trigger2 = p2bodydist x < 28 && p2bodydist y < 0 && vel y >=0
;---------------------------------------------------------------

;--------------------------------
;Double Hyper Combo
[State -1]
type = ChangeState
value = 4460
triggerall = Numpartner = 1 && var(38)!=0 && var(38)!=5
triggerall = power >= 2000
triggerall = command = "DoubleDragon"
triggerall = Roundstate = 2
trigger1 = (partner, stateno = 4404) && statetype != A && ctrl
trigger2 = (partner, stateno = 4404) && stateno = [3000,4400]
trigger3 = (partner, stateno = 4404) && stateno = [4500,4999]
trigger4 = (partner, stateno = 4404) && statetype !=A && stateno = [200,1200]
trigger5 = (partner, alive=1) && statetype !=A && stateno = [1600,2000]
ignorehitpause=1

;Double Dragon Counter
[State -1]
type = ChangeState
value = 4420
triggerall = Numpartner = 1 && var(37)!=0
triggerall = command = "DoubleDragonCounter"
triggerall = Roundstate = 2 && statetype !=A && power >= 1000 
trigger1 = (partner, stateno = 4404) && StateNo = [150,151]
ignorehitpause=1

; Double Dragon Cross
[State -1]
type = ChangeState
value = 4490
triggerall = Numpartner = 1 && var(38)!=0 && var(38)!=5
triggerall = power >= 2000
triggerall = command = "DoubleDragonCross"
triggerall = Roundstate = 2
trigger1 = (partner, stateno = 4404) && statetype != A && ctrl
trigger2 = (partner, stateno = 4404) && stateno = [3000,4400]
trigger3 = (partner, stateno = 4404) && stateno = [4500,4999]
trigger4 = (partner, stateno = 4404) && statetype !=A && stateno = [200,1200]
trigger5 = (partner, alive=1) && statetype !=A && stateno = [1600,2000]
ignorehitpause=1

;partner Change
[State -1]
type = ChangeState
value = 4410
triggerall = Numpartner = 1 && var(37)!=0
triggerall = command = "troca"
triggerall = Roundstate = 2 && statetype !=A
trigger1 = statetype != A
trigger1 = (partner, stateno = 4404) && ctrl

;partner Assist
[State -1]
type = ChangeState
value = 4480
triggerall = Numpartner = 1 && var(37)!=0
triggerall = command = "Assist"
triggerall = Roundstate = 2 && statetype !=A
trigger1 = (partner, stateno = 4404) && ctrl

;Double Hyper Combo (AI)
[State -1]
type = ChangeState
value = 4460
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = Numpartner = 1 && var(38)=1 && var(37)!=0
triggerall = var(20)=1 && power >= 2000 && numtarget!=0
triggerall = stateno != [4400,4499]
triggerall = Roundstate = 2 && stateno != [800,999]
trigger1 = life < var(33) && ctrl && enemynear, movetype = H && p2bodydist y < 0
trigger1 = partner, stateno = 4404
trigger1 = partner, life = var(34) 
trigger3 = life < partner, life && stateno = [3000,4999]
trigger3 = partner, stateno = 4404
trigger3 = partner, life = var(34) 
trigger4 = statetype !=A && stateno < 3000
trigger4 = partner, stateno = 4404
trigger4 = partner, life = var(34) 
trigger5 = statetype !=A && enemynear, movetype = H
trigger5 = partner, stateno = 4404
trigger5 = partner, life = var(34) 
ignorehitpause=1

;Double Dragon Counter (AI)
[State -1]
type = ChangeState
value = 4420
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = power>=1000 && numpartner!=0
triggerall = statetype != A  && roundstate=2
triggerall = stateno = [150,152]
trigger1 = var(34) = (partner, life) && (partner, life)!=0
trigger1 = var(20) = 1 && var(33) > life && time % 4
trigger1 = partner, stateno = 4404
ignorehitpause=1

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

; Counter: Ground / anti-Air
[State -1]
type = ChangeState
value = 8300 + 10 * (command="Counter2")
triggerall = power>=1000
triggerall = statetype != A && var(38) != 3
trigger1 = var(20) = 0 && (command="Counter1" || command="Counter2")
triggerall = stateno = [150,152]
trigger2 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger2 = var(20) = 1 && P2life > (life*1.5) && time % 4
ignorehitpause=1

;--------------------------------
; AUTO AI

[State -1, Activate AI] 
type = VarSet 
triggerall = var(20) != 1 
trigger1 = IsHomeTeam = 1 && matchno > 1
trigger2 = command = "CPU1" || command = "CPU2" || command = "CPU3"
var(20) = 1
ignorehitpause=1

[State -1, Level AI] 
type = helper 
triggerall = var(20) != 0 && var(11)=0
trigger1 = IsHomeTeam = 1 && matchno > 1
ignorehitpause=1
ID=6
stateno=6
name = "Level AI"

; Reset Air combo

[State -1, reset] 
type = VarSet 
trigger1 = var(3) != 0 && statetype != A
trigger1 = stateNo != [5000,5125]
trigger1 = stateNo != [200,670]
var(3) = 0

;===========================================================================
;RunFwd
[State -1]
type = ChangeState
value = 100
triggerall = statetype != A && ctrl && anim!=100 && numexplod(8450)=0
triggerall = roundstate = 2 && numexplod(101)=0
trigger1 = command = "FF"
trigger2 = (P2Movetype = H || var(6)=0) && P2BodyDist X = [70,170]
trigger2 = pos y =0 && var(20) = 1 && random > life && time % 4
trigger2 = stateno != 100 && (enemynear, alive = 1)
trigger2 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger3 = var(20) = 1 && p2life > life && p2StateNo = [5100,5110]
trigger3 = stateno != 100 && (enemynear, alive = 1)
trigger3 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
; -- correr aps state 1000
trigger4 = anim=1000 && var(6)=0 && animtime = 0 
trigger4 = var(20) = 1 && random > life && time % 4
trigger4 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)

;RunBack
[State -1]
type = ChangeState
value = 105
trigger1 = command = "BB"
triggerall = statetype != A && numexplod(8450)=0
triggerall = roundstate = 2 && numexplod(101)=0
triggerall = ctrl
trigger2 = stateno = 150 && P2Movetype = A && P2life > life
trigger2 = pos y =0 && var(20) = 1
trigger2 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)

;===========================================================================
; SUPERS
;---------------------------------------------------------------------------
;Smash Kung Fu Upper (uses one super bar)
[State -1, Smash Kung Fu Upper]
type = ChangeState
value = 3500
triggerall = alive && roundstate = 2 && power >= 1000
triggerall = statetype != A && var(38) != 3 && stateno < 3000
triggerall = (stateno != [800,999]) && (stateno != [3000,4000])
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = command = "KFPower"
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA && command = "KFPower"
trigger2 = movecontact
trigger4 = command = "KFPower" && var(20)=0 && stateno = [1000,2999]
trigger5 = var(20)=1 && time > 30 && stateno = [1000,2999]
trigger5 = numpartner=0 || (numpartner=1 && life < p2life)
trigger6 = var(20)=1 && P2BodyDist Y < -95  && anim = 47
trigger6 = pos y = 0 && p2statetype=A
trigger7 = var(20) = 1 && P2StateType = A && random > life
trigger7 = enemynear, vel y < 2 && P2BodyDist x<130 + vel x * 3
trigger7 = p2bodydist y < const(size.mid.pos.y)
trigger8 = var(20) = 1 && P2StateType = A && random > life
trigger8 = stateno = 420 && movecontact
ignorehitpause=1

;--------------------------------------------------------
;Starburst (uses one super bar)
[State -1, Starburst]
type = ChangeState
value = 4000
triggerall = roundstate = 2 && power >= 1000
triggerall = statetype != A && var(38) != 3
triggerall = (stateno != [800,999]) && (stateno != [3000,4000])
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = command = "Starburst"
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA && command = "Starburst"
trigger2 = movecontact
trigger4 = command = "Starburst" && var(20)=0 && stateno = [1000,2999]
trigger5 = var(20)=1 && time > 30 && stateno = [1000,2999]
trigger6 = var(20)=1 && var(6)>0 && p2statetype=A

;--------------------------------------------------------
;Triple Kung Fu Palm 
[State -1, Triple Kung Fu Palm]
type = ChangeState
value = 3000
trigger1 = command = "TripleKFPalm"
triggerall = alive && roundstate = 2 && power >= 1000
triggerall = statetype != A && var(38) != 3 && stateno < 3000
triggerall = (stateno != [800,999]) && (stateno != [3000,4000])
triggerall = !var(20) || (var(20) && (!IsHomeTeam || stateno!=420 && (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA && command = "TripleKFPalm"
trigger2 = movecontact
trigger3 = hitdefattr = SC, NA, SA, HA 
trigger3 = stateno != [3000,3050]
trigger3 = movecontact && p2life!=0 && p2bodydist y >= -80
trigger3 = (var(20)=1 && animtime=0 && (random + p2life) > life)
trigger3 = numpartner=0 || (numpartner=1 && life < p2life)
trigger4 = var(20)=0 && command = "TripleKFPalm" && stateno = [1000,2999]
trigger5 = var(20)=1 && time > 30 && life < p2life&& p2bodydist y > -80 && stateno = [1000,2999]
trigger5 = numpartner=0 || (numpartner=1 && life < p2life)
ignorehitpause=1

;--------------------------------------------------------
;Etherian Suplex Of Doom
[State -1, Triple Kung Fu Palm]
type = ChangeState
value = 4500
trigger1 = command = "Suplex_Doom"
triggerall = alive && roundstate = 2 && power >= 1000
triggerall = statetype != A && var(38) != 3 && stateno < 3000
triggerall = (stateno != [800,999]) && (stateno != [3000,4000])
triggerall = var(20)=0 || (var(20)=1 && p2statetype!=A && stateno!=420)
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA && command = "Suplex_Doom"
trigger2 = movecontact
trigger3 = hitdefattr = SC, NA, SA
trigger3 = stateno != [3000,3050]
trigger3 = movecontact && p2life!=0 && p2bodydist x < 50
trigger3 = (var(20)=1 && (random + p2life) > life) && P2Movetype != H
trigger3 = numpartner=0 || (numpartner=1 && life < p2life)
trigger4 = var(20)=0 && command = "Suplex_Doom" && stateno = [1000,2999]
trigger5 = var(20)=1 && p2bodydist x < 10 && P2Movetype != H && stateno = 100
trigger5 = numpartner=0 || (numpartner=1 && life < p2life)
ignorehitpause=1

;---------------------------------------------------------
; Lighthope Upper
[State -1, Lighthope Upper]
type = ChangeState
value = 2005 + 5 * (command = "upper_y") + 15 * (command = "upper_z")
trigger1 = command = "upper_z" ^^ command = "upper_y" ^^ command = "upper_x"
triggerall = roundstate = 2 && statetype != A && stateno != [800,999]
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl || (movecontact && stateno = [200,499])
trigger2 = var(20) = 1 && NumHelper(2000) = 0
trigger2 = P2StateType = A && random > life && stateno < 1000
trigger2 = enemynear, vel y < 2 && P2BodyDist x<130 + vel x * 3
trigger2 = p2bodydist y < const(size.mid.pos.y)
ignorehitpause=1

;--------------------------------------------------------------
; Etherian Sword
[State -1, Etherian Sword]
type = ChangeState
value = 1905 + 5 * (command = "back_upper_b") + 15 * (command = "back_upper_c")
trigger1 = command = "back_upper_c" ^^ command = "back_upper_b" ^^ command = "back_upper_a"
triggerall = roundstate = 2
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl || (movecontact && stateno = [200,699])
trigger2 = var(20)=1 && (var(6) > 0 || enemynear, numproj!=0) && random > life && ctrl
ignorehitpause=1

;---------------------------------------------------------------------------
; Sword to Rope,Boomerang,Discus
[State -1, Sword RBD]
type = ChangeState
value = 1005 + 5 * (command = "QCF_y") + 15 * (command = "QCF_z")
trigger1 = (command = "QCF_x" ^^ command = "QCF_y" ^^ command = "QCF_z")||(var(20)=1 && (gametime%40)=0 && (random > life))
triggerall = roundstate = 2 && numhelper(1030)=0 && numprojid(1000)=0
triggerall = statetype != A
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl || (movecontact && stateno = [200,699])
trigger2 = var(20)=1 && (var(6) > 0 || enemynear, numproj!=0) && random > life && ctrl
ignorehitpause=1

;---------------------------------------------------------------------------
; Etherian Rush
[State -1, Sword to Bow]
type = ChangeState
value = 1610 + 5 * (command = "cat_paw_b") + 10 * (command = "cat_paw_c")
trigger1 = (command = "cat_paw_a" ^^ command = "cat_paw_b" ^^ command = "cat_paw_c")||(var(20)=1 && (enemynear, vel x < -7) && (gametime%35)=0 && (random > life))
triggerall = roundstate = 2 && numexplod(1001)=0
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl || (movecontact && stateno = [200,699])
trigger2 = var(20)=1 && (var(6) > 0 || enemynear, numproj!=0) && random > life && ctrl
ignorehitpause=1

;---------------------------------------------------------------------------
; Etherian Spin
[State -1, Etherian Spin]
type = ChangeState
value = 1805 + 5 * (command = "HCB_b") + 15 * (command = "HCB_c")
trigger1 = (command = "HCB_a" ^^ command = "HCB_b" ^^ command = "HCB_c")||(var(20)=1 && (gametime%40)=0 && (random > life))
triggerall = roundstate = 2 && numhelper(1300)=0 && numprojid(1000)=0
triggerall = statetype != A
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl || (movecontact && stateno = [200,699])
trigger2 = var(20)=1 && (var(6) > 0 || enemynear, numproj!=0) && random > life && ctrl
ignorehitpause=1

;---------------------------------------------------------------------------
; Sword to Laser,Icemaker,Lightning Rod
[State -1, Sword to LIL]
type = ChangeState
value = 1305 + 5 * (command = "QCB_y") + 15 * (command = "QCB_z")
trigger1 = (command = "QCB_x" ^^ command = "QCB_y" ^^ command = "QCB_z")||(var(20)=1 && (gametime%40)=0 && (random > life))
triggerall = roundstate = 2 && numhelper(1300)=0 && numprojid(1000)=0
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = ctrl || (movecontact && stateno = [200,699])
trigger2 = var(20)=1 && (var(6) > 0 || enemynear, numproj!=0) && random > life && ctrl
ignorehitpause=1

;---------------------------------------------------------------------------
; Sword to Bow
[State -1, Sword to Bow]
type = ChangeState
value = 1505 + 5 * (command = "QCF_b") + 15 * (command = "QCF_c")
trigger1 = (command = "QCF_a" ^^ command = "QCF_b" ^^ command = "QCF_c")||(var(20)=1 && (enemynear, vel x < -7) && (gametime%40)=0 && (random > life))
triggerall = roundstate = 2 && numhelper(1550)=0
triggerall = statetype != A
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
triggerall = ctrl || (movecontact && stateno = [200,699])
trigger1 = !var(20) 
;trigger2 = var(20)=1 && random > life && p2bodydist x > 50 && abs(p2bodydist x - p2bodydist y)=[0,50]
trigger2 = var(20)=1 && random > life && p2bodydist x > 90 && p2bodydist y < -50 && abs(p2bodydist x - p2bodydist y)=[0,50];random > life && 
trigger3 = var(20)=1 && (var(6) > 0 || enemynear, numproj!=0) && random > life
ignorehitpause=1

;---------------------------------------------------------------------------
; Sword to Pole
[State -1, RicochetSlash]
type = ChangeState 
value = 2110 + 5 * (command = "LKmed") + 10 * (command = "LKhard")
trigger2 = (command = "LKWeak") || (command = "LKmed") || (command = "LKhard") || (command = "LKWeak2")
triggerall = ctrl || (movecontact && stateno = [200,699])
triggerall = StateType != A && roundstate=2 && p2life!=0
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger1 = var(20) = 1 && ( random>life) && P2BodyDist X < 100 && P2BodyDist y=0
trigger1 = stateno = 450 || stateno = 250
trigger2 = !var(20)
ignorehitpause=1

;---------------------------------------------------------------------------
; (He-man Striker)
[State -1]
type = ChangeState
value = 2300
trigger1 = command = "Assist" && var(37)=0
trigger3 = command = "He-man" && var(37)!=0
triggerall = Roundstate = 2 && statetype !=A && numhelper(2200)=0
triggerall = ctrl
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger2 = var(20) = 1 && (random+life<p2life)
trigger2 = stateno = 52 && anim = 47 && vel x < 0 && P2BodyDist X < 75

; (Swift Wind Striker)
[State -1]
type = ChangeState
value = 2200
trigger1 = command = "Swift_Wind"
triggerall = Roundstate = 2 && statetype !=A && numhelper(2200)=0
triggerall = ctrl
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger2 = var(20) = 1 && (random+life<p2life)
trigger2 = stateno = 100

; (Sorceress Striker)
[State -1]
type = ChangeState
value = 2500
trigger1 = var(37)=0 && command = "troca"
trigger3 = var(37)!=0 && command = "Sorceress"
triggerall = Roundstate = 2 && statetype !=A && numhelper(2200)=0
triggerall = ctrl
triggerall = !var(20) || (var(20) && (!IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)))
trigger2 = var(20) = 1 && (random+life<p2life)
trigger2 = stateno = 100

;--------------------------------
;Stand_Throw
;--------------------------------
[State -1]
type = ChangeState
value = 800
triggerall = stateno != 100 && p2bodydist X <= 10 && ctrl
trigger1 = command = "fwd_z"
trigger2 = command = "fwd_y"
trigger3 = command = "back_z"
trigger4 = command = "back_y"
trigger5 = var(20)=1 && random < (p2life - life) && vel x = 0
trigger5 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)

;--------------------------------
; Ground basics
;--------------------------------
;Crounch Light Punch
[State -1, Crounch Light Punch]
type = ChangeState
value = 200 + 200 * (command = "holddown")
triggerall = roundstate = 2
triggerall = command = "x"
triggerall = (statetype != A) && var(3) < 3
trigger1 = ctrl
trigger2 = (stateno = 230) && movecontact
trigger3 = (stateno = 430) && movecontact
trigger4 = (stateno = 200 || stateno = 400) && time > 7
ignorehitpause=1

;--------------------------------
;Crounch Light Kick
[State -1, Crounch Light Kick]
type = ChangeState
value = 230 + 200 * (command = "holddown")
triggerall = roundstate = 2
triggerall = command = "a"
triggerall = (statetype != A) && var(3) < 3
trigger1 = ctrl
trigger2 = (stateno = 200) && movecontact
trigger3 = (stateno = 400) && movecontact
trigger4 = (stateno = 230 || stateno = 430) && time > 7
ignorehitpause=1

;--------------------------------
;Crounch Medium Punch
[State -1, Crounch Medium Punch]
type = ChangeState
value = 210 + 200 * (command = "holddown")
triggerall = roundstate = 2
triggerall = command = "y"
triggerall = (statetype != A) && var(3) < 12
trigger1 = ctrl
trigger2 = (stateno = 200) && movecontact
trigger3 = movecontact && stateno = [230,240]
trigger4 = movecontact && stateno = [430,440]
trigger5 = (stateno = 400) && movecontact
ignorehitpause=1

;--------------------------------
;Crounch Medium Kick
[State -1, Crounch Medium Kick]
type = ChangeState
value = 240 + 200 * (command = "holddown")
triggerall = roundstate = 2
triggerall = command = "b"
triggerall = (statetype != A) && var(3) < 12
trigger1 = ctrl
trigger2 = movecontact && stateno = [200,210]
trigger3 = movecontact && stateno = 230
trigger4 = movecontact && stateno = [400,410]
trigger5 = movecontact && stateno = 430
ignorehitpause=1

;--------------------------------
;Crounch Strong Punch
[State -1, Crounch Strong Punch]
type = ChangeState
value = 220 + 200 * (command = "holddown")
triggerall = roundstate = 2
triggerall = command = "z"
trigger1 = (statetype != A)
trigger1 = ctrl
trigger2 = movecontact && stateno = [400,410]
trigger3 = movecontact && stateno = [430,440]
trigger5 = movecontact && stateno = [200,210]
trigger4 = movecontact && stateno = [230,240]
ignorehitpause=1

;--------------------------------
;Crounch Strong Kick
[State -1, Crounch Strong Kick]
type = ChangeState
value = 250 + 200 * (command = "holddown")
triggerall = roundstate = 2
triggerall = command = "c"
trigger1 = (statetype != A)
trigger1 = ctrl
trigger2 = movecontact && stateno = [400,410]
trigger3 = movecontact && stateno = [430,440]
trigger5 = movecontact && stateno = [200,210]
trigger4 = movecontact && stateno = [230,240]
ignorehitpause=1

;--------------------------------
; Air basics
;--------------------------------
;Jump Light Punch
[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = command = "x"
triggerall = statetype = A && var(3) < 3
trigger1 = ctrl
trigger2 = stateno = 8800 && var(20)=1 && P2MoveType=H
trigger2 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger3 = (stateno = 630) && movecontact
ignorehitpause=1

;--------------------------------
;Jump Light Kick
[State -1, Jump Light Kick]
type = ChangeState
value = 630
triggerall = command = "a"
triggerall = statetype = A  && var(3) < 3
trigger1 = ctrl
trigger2 = (stateno = 600) && movecontact
trigger3 = stateno = 8800 && var(20)=1 && P2MoveType=H
trigger3 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
ignorehitpause=1

;--------------------------------
;Jump Medium Kick
[State -1, Jump Medium Kick]
type = ChangeState
value = 640
triggerall = command = "b"
triggerall = statetype = A && var(3) < 12
trigger1 = ctrl
trigger2 = movecontact && stateno = [600,610]
trigger3 = movecontact && stateno = 630
ignorehitpause=1

;--------------------------------
;Jump Medium Punch
[State -1, Jump Medium Punch]
type = ChangeState
value = 610
triggerall = command = "y"
triggerall = statetype = A && var(3) < 12
trigger1 = ctrl
trigger2 = (stateno = 600) && movecontact
trigger3 = movecontact && stateno = [630,640]
ignorehitpause=1

;--------------------------------
;Jump Strong Punch
[State -1, Jump Strong Punch]
type = ChangeState
value = 620
triggerall = command = "z"
trigger1 = statetype = A && var(3) < 16
trigger1 = ctrl
trigger2 = movecontact && stateno = [600,610]
trigger3 = movecontact && stateno = [630,640]
ignorehitpause=1

;--------------------------------
;Jump Strong Kick
[State -1, Jump Strong Kick]
type = ChangeState
value = 650
triggerall = command = "c"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = movecontact && stateno = [600,610]
trigger3 = movecontact && stateno = [630,640]
ignorehitpause=1

;--------------------------------
;Taunt
[State -1, Taunt]
type = ChangeState
value = 195
triggerall = command = "start"
triggerall = statetype != A && ctrl
trigger1 = var(20) != 1
trigger2 = random < life && var(20)=1
trigger2 = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))<random)


; AI Standing Guard
; ==========================
[State -1]
type = ChangeState
triggerall = var(20) = 1 && Statetype != A
triggerall = P2statetype != C && Statetype = S
triggerall = P2Movetype = A && Pos Y != [-1,-999]
triggerall = ctrl && facing != (enemynear, facing)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger1 = random > (enemynear, movecontact)*500
value = 130 ;Default standing guard state


; AI Stand to Crouch Guard Transition
; =============================
[State -1]
type = ChangeState
triggerall = var(20) = 1 && StateType != A
triggerall = P2statetype = C && P2Movetype = A
triggerall = Pos Y != [-1,-999]
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger1 = stateno = 150
trigger1 = 1
value = 152


; AI Crouching Guard
; =============================
[State -1]
type = ChangeState
triggerall = var(20) = 1 && StateType != A
triggerall = P2statetype = C && P2Movetype = A
triggerall = ctrl && Pos Y != [-1,-999]
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
triggerall = facing != (enemynear, facing)
trigger1 = random > (enemynear, movecontact)*500
value = 131


; AI Crouch to Stand Guard Transition
; =============================
[State -1]
type = ChangeState
triggerall = var(20) = 1 && Statetype != A
triggerall = P2statetype != C && P2Movetype = A
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger1 = random > life
trigger1 = stateno = 152
value = 150


; AI Aerial Guard
; =============================
[State -1]
type = ChangeState
triggerall = var(20) = 1 && Statetype = A
triggerall = P2Movetype = A && ctrl
triggerall = facing != (enemynear, facing)
triggerall = !IsHomeTeam || (IsHomeTeam && (matchno*var(11))>random && matchno>1)
trigger1 = random > life
value = 132

; Remover Helper
; =============================
[State -1]
type = Destroyself
triggerall = ishelper = 1
trigger1 = stateno = 0