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

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

[Command]
Name = "Debug"
Command = s,s,s
Time = 30

[Command]
Name = "NO"
Command = ~D,$F
Time = 30
buffer.time=30

[Command]
Name = "NO"
Command = ~D,$D
Time = 30
buffer.time=30

[Command]
Name = "NO"
Command = ~D,$B
Time = 30
buffer.time=30

[Command]
Name = "Ball"
Command = ~D,$F,a
Time = 30

[Command]
Name = "DDrain"
Command = ~D,$F,z
Time = 30

[Command]
Name = "Delete"
Command = ~F,$D,$B,z
Time = 45

[Command]
Name = "DHeart"
Command = ~D,$B,$D,$F,z
Time = 45

[Command]
Name = "Summon"
Command = ~D,D,a
Time = 30

[Command]
Name = "Highway"
Command = ~D,D,z
Time = 30

[Command]
Name = "Beam"
Command = ~D,$F,b
Time = 30

[Command]
Name = "AI01"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI02"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI03"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI04"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI05"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI06"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI07"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI08"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI09"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI10"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI11"
Command = U , U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI12"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI13"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI14"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI15"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI16"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI17"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI18"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI19"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI20"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI21"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI22"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI23"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI24"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI25"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI26"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI27"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI28"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI29"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI30"
Command = U, U, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
Name = "AI31"
Command = U, x, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI32"
Command = U, y, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI33"
Command = U, z, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI34"
Command = U, a, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI35"
Command = U, b, D, D, F, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI36"
Command = U, b, D, D, a, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI37"
Command = U, b, D, D, c, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI38"
Command = U, b, D, D, x, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI39"
Command = U, b, D, D, b, B, F, B, a+b+c+x+y+z
Time = 1
[Command]
Name = "AI40"
Command = U, b, D, D, z, B, F, B, a+b+c+x+y+z
Time = 1

[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 20

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

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

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

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

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

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

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


;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_a"
command = /$D,a
time = 1

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

;-| Single Button |---------------------------------------------------------

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

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

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

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

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

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

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

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

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

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

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

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

[Command]
name = "holdz";Required (do not remove)
command = /z
time = 1

[Command]
name = "holdc";Required (do not remove)
command = /c
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

[Statedef -1]

[State -1, Aicheck]
Type = VarSet
TriggerAll = Var(59) < 1
TriggerAll = RoundState=[1,2]
;Trigger43  = PalNo=9
Trigger2  = Command = "AI01"
Trigger3  = Command = "AI02"
Trigger4  = Command = "AI03"
Trigger5  = Command = "AI04"
Trigger6  = Command = "AI05"
Trigger7  = Command = "AI06"
Trigger8  = Command = "AI07"
Trigger9  = Command = "AI08"
Trigger10 = Command = "AI09"
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 = Var(59)=-1
Trigger1 = IsHelper(1)
Trigger1 = root,var(59)>0
v = 59
value= 1
Ignorehitpause=1

[State -1, SetAI]
type = VarSet
triggerall = Alive && RoundState = [1,2]
triggerall = IsHomeTeam && !IsHelper
trigger1 = MatchNo > 1
trigger2 = TeamSide=2
var(59) = 1
ignorehitpause=1
persistent=0

[State -1, AIoff]
Type=VarSet
Triggerall=var(59)>0
Trigger1=RoundState!=2
Trigger2=StateNo=5500
v=59
value=-1

[State -1]
Type=Ctrlset
Triggerall=IsHelper(1)
Trigger1=Helper(2),var(10)=1
Trigger1=ctrl
value=0

[State -1]
Type=Ctrlset
Triggerall=IsHelper(1)
Triggerall=Helper(2),var(10)=0
Trigger1=StateNo=0
Trigger2=StateNo=190
value=1

[State -1]
Type=VarSet
Trigger1=root,var(0)=1
var(1)=101

[State -1]
Type=VarSet
Trigger1=root,var(0)=0
Trigger1=var(1)>=100
var(1)=0

[State -1]
Type=ChangeState
Trigger1=StateNo=[40,55]
Trigger1=var(1)>=100
value=59

[State -1]
Type=ChangeState
value=1300
triggerall = Pos Y>-150
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || (Stateno=[120,160])
triggerall = ((power>=5000) && (NumHelper(1111)>0)) || (root,var(0)=1)
triggerall = P2StateNo!=1199
triggerall = P2Life>1
trigger1 = command="Delete"
trigger1 = var(59) = 0
trigger2 = var(59) > 0
trigger2 = ((NumHelper(1111)>0) && (Helper(1111),var(4)>120))
trigger2 = (P2Life>500) || (root,life<root,lifemax*0.4) || (RoundNo>1)
trigger2 = !InGuarddist
trigger2 = random<var(50)+1

[State -1]
Type=ChangeState
value=1200
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl
triggerall = (power>=3000)
trigger1 = command="DHeart"
trigger1 = var(59) = 0
trigger2 = var(59) > 0
trigger2 = (root,life<root,lifemax*0.4) && (P2Life>300)
trigger2 = power!=[6000,8999]
trigger2 = random<var(50)+5

[State -1]
Type=ChangeState
value=1100
triggerall = Pos Y>-150
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || (Stateno=[120,160])
triggerall = (power>=2000) || (NumHelper(1111)>0)
triggerall = P2StateNo!=1199
triggerall = P2Life>1
trigger1 = command="DDrain"
trigger1 = var(59) = 0
trigger2 = var(59) > 0
trigger2 = ((NumHelper(1111)>0) && (Helper(1111),var(4)>120)) || (P2Life<300)
trigger2 = power!=[6000,7999]
trigger2 = !InGuarddist
trigger2 = random<var(50)+8

[State -1]
Type=ChangeState
value=1000
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || (Stateno=[120,160])
triggerall = power>=1000
trigger1 = command="Highway"
trigger1 = var(59) = 0
trigger2 = var(59) > 0
trigger2 = abs(P2BodyDist X)<72
trigger2 = root,life<=root,lifemax*0.5
trigger2 = P2MoveType=A
trigger2 = enemynear,pos Y<=pos Y
trigger2 = power!=[6000,6999]
trigger2 = random<var(50)+5

[State -1, run FWD]
type = ChangeState
value = 100+ (StateType=A)*10
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = statetype !=C
triggerall = ctrl
triggerall = stateno!=[100,109]
triggerall = Pos Y>-190
triggerall = var(1)<5
trigger1 = command = "FF"
trigger1 = var(59) = 0
trigger2 = var(59) = 0
trigger2 = command = "holdfwd"
trigger2 = command = "holdz"
trigger2 = !(command = "NO")
trigger3 = abs(P2BodyDist X>60)
trigger3 = var(16)>700
trigger3 = var(59) >0
trigger3 = random<var(50)*2

[State -1, run Back]
type = ChangeState
value = 105+ (StateType=A)*10
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = statetype !=C
triggerall = ctrl
triggerall = stateno!=[100,109]
triggerall = Pos Y>-190
triggerall = var(1)<5
trigger1 = command = "BB"
trigger1 = var(59) = 0
trigger2 = var(59) = 0
trigger2 = command = "holdback"
trigger2 = command = "holdz"
trigger2 = !(command = "NO")
trigger3 = abs(P2BodyDist X<120)
trigger3 = var(16)<700
trigger3 = var(59) >0
trigger3 = ((facing=1) && (Pos X>-120)) || ((facing=-1) && (Pos X<120))
trigger3 = random<var(50)*2

[State -1, Teleport]
type = ChangeState
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || (StateNo=[120,160]) || (StateNo=5120)
trigger1 = var(59) = 0
trigger1 = (command = "holdfwd") || (command = "holdback")
Trigger1 = (command = "y") || (StateNo=5120)
trigger2 = var(59) > 0
Trigger2 = InGuardDist || (StateNo=5120)
;Trigger2 = ctrl
Trigger2 = (Random<200) || (StateNo=5120)
Trigger2 = (Stateno!=[120,160]) || (random<20)
trigger2 = random<var(50)*2
value = 550

[State -1, AI Defense]
type = ChangeState
triggerall = roundstate=2
triggerall = (var(59) > 0)
triggerall = ctrl
trigger1 = InGuardDist
trigger1 = random<850+root,var(13)/2
trigger1 = random<100+var(50)*2
value = 120

[State -1]
type = ChangeState
value = 600
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl
Triggerall = var(16)<=1000
trigger1 = (command = "Summon")
Trigger1 = var(59)=0
Trigger2 = var(59)>0
Trigger2 = Abs(P2Dist X)>100
;Trigger2 = enemy,numproj=0
Trigger2 = var(16)<=250
trigger2 = random<var(50)+10

[State -1]
type = ChangeState
value = 500
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || ((Stateno=500) && (Time>8))
Triggerall = var(16)<=1000
trigger1 = (command = "x")
Trigger1 = var(59)=0
Trigger2 = var(59)>0
Trigger2 = Abs(P2BodyDist X)>60
Trigger2 = P2StateType!=A
Trigger2 = P2StateType!=L
Trigger2 = var(16)<=955
Trigger2 = (NumHelper(501)=0) || ((P2StateNo!=[120,160]) && (P2MoveType=H))
trigger2 = random<var(50)+25

[State -1]
type = ChangeState
value = 520
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || ((Stateno=500) && (Time>8))
Triggerall = var(16)<=1000
trigger1 = (command = "Beam")
Trigger1 = var(59)=0
Trigger2 = var(59)>0
Trigger2 = Abs(P2BodyDist X)>100
Trigger2 = Abs(P2BodyDist Y)<70
Trigger2 = enemy,pos Y<Pos Y+40
Trigger2 = var(16)<=720
trigger2 = random<var(50)+20

[State -1]
type = ChangeState
value = 510
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || ((Stateno=500) && (Time>8))
Triggerall = var(16)<=1000
trigger1 = (command = "Ball")
Trigger1 = var(59)=0
Trigger2 = var(59)>0
Trigger2 = Abs(P2BodyDist X)>100
Trigger2 = var(16)<=780
trigger2 = random<var(50)+20

[State -1]
Type= changestate
value=201
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = statetype=S
triggerall = ctrl || ((StateNo=[200,201]) && Movecontact>3) || (Stateno=100)
triggerall = var(48)<=10
trigger1=command="b"
trigger1=var(59)=0
trigger2=var(59)>0
trigger2=abs(P2Bodydist X)<17
trigger2=abs(P2dist Y)<50
trigger2=P2StateType=S
trigger2 = random<var(50)*2

[State -1]
Type= changestate
value=200
triggerall = ctrl || ((StateNo=[200,201]) && Movecontact>3) || (Stateno=100)
triggerall = var(48)<=10
trigger1=command="a"
trigger1=var(59)=0
trigger2=var(59)>0
trigger2=abs(P2Bodydist X)<28
trigger2=abs(P2dist Y)<50
trigger2=P2StateType!=L
trigger2 = random<var(50)*2

[State -1]
Type= changestate
value=202
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || ((StateNo=[200,201]) && Movecontact>3) || (Stateno=100)
trigger1=command="y"
trigger1=var(59)=0
trigger2=var(59)>0
trigger2=abs(P2Bodydist X)<36
trigger2=abs(P2dist Y)<50
trigger2=P2StateType!=L
trigger2 = random<var(50)*2

[State -1]
Type= changestate
value=300
triggerall = (root,var(0)=0) || (helper(2),var(10)=0)
triggerall = ctrl || ((StateNo=[200,201]) && Movecontact>3) || (StateNo=[120,160])
triggerall = var(16)<=1000
trigger1=command="holdc"
trigger1=var(59)=0
trigger2=var(59)>0
trigger2=abs(P2Bodydist X)<60
trigger2=abs(P2dist Y)<120
trigger2=enemynear,pos Y<=pos Y+10
Trigger2=var(16)<900-100*(StateNo=[120,160])
trigger2 = random<var(50)+15
