;======================================================================
;Ultimate Sula
;By Crucifix
;
;AI file (thanks kyou!)
;
;note: to stupid MUGEN programmers, this ai won't do anything,
;if not screw up your character, if this file is placed under
;your character's directory.

[statedef -3]

 ;-AI---------------------------------------------
[State -3, Activate AI]
type = VarSet
triggerall = var(59) != 1
trigger1 = command = "CPU1"
trigger2 = command = "CPU2"
trigger3 = command = "CPU3"
v = 59
value = 1

;-----------------EX AI/HUMAN---------------------------------
[state -3, charge-minimal]
type = poweradd
;triggerall = var(59) = 1
triggerall = alive = 1
triggerall = roundstate = 2
trigger1 = life <= 500
value = 5

[state -3, charge-critical]
type = poweradd
;triggerall = var(59) = 1
triggerall = alive = 1
triggerall = roundstate = 2
trigger1 = life <= 250
value = 10

[state -3, charge-ultimate]
type = poweradd
;triggerall = var(59) = 1
triggerall = alive = 1
triggerall = roundstate = 2
trigger1 = life <= 50
value = 20

;-comment this out if not preferred---------------------------
[state -3, death prevention]
type = lifeadd
;triggerall = var(59) = 1
triggerall = alive = 1
triggerall = roundstate = 2
trigger1 = life <= 50
value = 1

;-AI----------------------------------------------------------

[state -3, energy storm]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = power >= 2000
triggerall = ctrl = 1
triggerall = var(57) = 1
trigger1 = p2bodydist x = [25,100]
value = 1420

[state -3, energy storm deactivate]
type = varset
triggerall = var(59) = 1
triggerall = alive = 1
triggerall = var(57) = 1
trigger1 = stateno = 1420
v = 57
value = 0

[state -3, energy storm reactivate]
type = varset
triggerall = var(59) = 1
triggerall = alive = 1
triggerall = var(57) = 0
trigger1 = stateno = 4000
trigger2 = stateno = 666777
trigger3 = stateno = 3100
trigger4 = stateno = 7500
trigger5 = stateno = 2050
trigger6 = stateno = 5900
trigger7 = stateno = 2150
v = 57
value = 1

[state -3, flash]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = power >= 1000
triggerall = power <= 2000
triggerall = ctrl = 1
triggerall = p2bodydist x = [200,250]
triggerall = p2bodydist y = [0,50]
trigger1 = p2statetype = S
trigger2 = p2statetype = A
value = 2050

[state -3, comets]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = power >= 2000
triggerall = power != 3000
triggerall = ctrl = 1
triggerall = p2bodydist x = [150,250]
triggerall = p2bodydist y = [0,50]
trigger1 = p2statetype = S
trigger2 = p2statetype = A
value = 4000

[state -3, shockwave blasts]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = power >= 3000
triggerall = life <= 750
triggerall = ctrl = 1
triggerall = p2bodydist x = [50,250]
triggerall = p2bodydist y = [0,50]
trigger1 = p2statetype = S
trigger2 = p2statetype = A
value = 666777

[state -3, celestial desecration]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = p2bodydist x = [200,350]
triggerall = p2bodydist y = [0, 200]
triggerall = pos y = 0
triggerall = power = 3000
triggerall = life <= 500
triggerall = stateno != 7600
triggerall = stateno != 7601
triggerall = stateno != 7602
triggerall = stateno = 0
trigger1 = ctrl = 1
trigger2 = p2statetype = S
trigger3 = p2statetype = A
value = 7600

[state -3, beam super]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = p2bodydist x >= 351
triggerall = p2bodydist y = [0, 200]
triggerall = pos y = 0
triggerall = power = 3000
triggerall = life <= 750
triggerall = stateno != 7600
triggerall = stateno != 7601
triggerall = stateno != 7602
triggerall = ctrl = 1
trigger1 = stateno = 1020 && movehit && animtime = 0
value = 7500

[state -3, earth slam]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != A
triggerall = var(59) = 1
triggerall = power >= 1000
triggerall = power != 3000
triggerall = ctrl = 1
triggerall = var(56) = 1
trigger1 = p2bodydist x = [0,50]
value = 2150

[state -3, earth slam deactivate]
type = varset
triggerall = var(59) = 1
triggerall = alive = 1
triggerall = var(56) = 1
trigger1 = stateno = 2150
v = 56
value = 0

[state -3, earth slam reactivate]
type = varset
triggerall = var(59) = 1
triggerall = alive = 1
triggerall = var(56) = 0
trigger1 = stateno = 4000
trigger2 = stateno = 2050
trigger3 = stateno = 666777
trigger4 = stateno = 3100
v = 56
value = 1

[state -3, dash-super-combo]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = power >= 2000
trigger1 = stateno = 1020 && movehit && animtime = 0
value = 3100

[state -3, super-punch]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != A
triggerall = var(59) = 1
triggerall = power >= 2000
triggerall = power != 3000
triggerall = ctrl = 1
trigger1 = p2bodydist x = [10,100]
value = 3100

[state -3, flyby]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = P2statetype = A
triggerall = p2bodydist x = [100,200]
triggerall = pos y = 0
triggerall = stateno != 246
trigger1 = ctrl = 1
trigger2 = stateno = 4002
;trigger3 = stateno = 1020 && movecontact && animtime = 0
trigger3 = stateno = 4002 && time = 0
value = 22115

[state -3, one-inch2]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = P2statetype = A
triggerall = p2bodydist x = [75,100]
triggerall = pos y = 0
triggerall = stateno != 246
trigger1 = ctrl = 1
trigger2 = stateno = 4002
;trigger3 = stateno = 1020 && movecontact && animtime = 0
trigger3 = stateno = 4002 && time = 0
value = 300

[state -3, crow bite2]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = P2statetype = A
triggerall = p2bodydist x = [50,75]
triggerall = pos y = 0
triggerall = stateno != 246
trigger1 = ctrl = 1
trigger2 = stateno = 4002
;trigger3 = stateno = 1050 && movehit && animtime = 0
value = 1550

[state -3, ray spin1]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2statetype = S
triggerall = p2bodydist x = [40,50]
trigger1 = ctrl = 1
value = 1351

[state -3, flying kick]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = stateno != 960
triggerall = P2statetype = S
triggerall = p2bodydist x = [75,100]
triggerall = p2bodydist y <= 250
trigger1 = ctrl = 1
value = 246

[state -3, speed dash type-a]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = stateno != 960
triggerall = P2statetype = S
triggerall = p2bodydist x = [75,100]
triggerall = p2bodydist y >= 250
trigger1 = ctrl = 1
value = 246

[state -3, dash-combo]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
trigger1 = stateno = 1051 && movecontact
value = 1020

[state -3, one-inch]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
trigger1 = stateno = 1020 && movehit  && animtime = 0
value = 300

[state -3, dash1]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2statetype = S
triggerall = p2bodydist x = [100,200]
trigger1 = ctrl = 1
;trigger2 = stateno = 1020 && movecontact && animtime = 0
value = 1050

[state -3, punch1]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2statetype = S
triggerall = life >= 500
triggerall = p2bodydist x = [0,50]
trigger1 = ctrl = 1
value = 960

[state -3, bloody hands]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2statetype = S
triggerall = life <= 500
triggerall = p2bodydist x = [0,50]
trigger1 = ctrl = 1
value = 960

[state -3, punch-combo]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
trigger1 = stateno = 960 && moveguarded = 1  && animtime = 0
value = 961

[state -3, punch-combo]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
trigger1 = stateno = 960 && movehit  && animtime = 0
trigger2 = stateno = 961 && movehit  && animtime = 0
value = 430

[state -3, punch-combo]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
trigger1 = stateno = 430 && movehit  && animtime = 0
value = 440

[state -3, speed dash-back]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = ctrl = 1
triggerall = stateno = [120,150]
triggerall = p2bodydist x >= 25
triggerall = p2bodydist y >= 0
trigger1 = life <= 500
value = 1063

[state -3, alpha counter]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = stateno = [120,150]
triggerall = ctrl = 1
trigger1 = p2bodydist x <= 20 && p2bodydist y >= 0
value = 1008

[state -3, dash counter]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = stateno = [120,150]
triggerall = pos y = 0
trigger1 = p2bodydist x = [50,75]
value = 1550

[state -3, ghost strike]
type = changestate
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = var(59) = 1
triggerall = statetype = A
triggerall = alive = 1
triggerall = ctrl = 1
triggerall = p2bodydist x = [100,300]
triggerall = p2bodydist y >= 75
trigger1 = ctrl = 1
value = 959

[state -3, taunt]
type = changestate
triggerall = stateno != 195
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = P2statetype = L
triggerall = p2bodydist x = [25,100]
trigger1 = ctrl = 1
value = 195

[state -3 escape]
type = changestate
triggerall = var(59) = 1
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = p2statetype = L
triggerall = p2bodydist x = [25,100]
trigger1 = stateno = 195 && animtime = 0
value = 1063

[state -3, taunt3]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = var(59) = 1
triggerall = P2statetype = L
triggerall = p2bodydist x = [200,400]
trigger1 = ctrl = 1
value = 197

[state -3, leap forward]
type = changestate
triggerall = roundstate = 2
triggerall = pos y = 0
triggerall = stateno != 1060
triggerall = var(59) = 1
triggerall = P2statetype = L
triggerall = p2bodydist x = [75,200]
trigger1 = ctrl = 1
value = 1060

[state -3, air rave1]
type = changestate
triggerall = roundstate = 2
triggerall = pos y >= 5
triggerall = var(59) = 1
triggerall = statetype = A
triggerall = p2bodydist x = [0,15]
triggerall = p2bodydist y = [-20,10]
triggerall = stateno != 959
triggerall = stateno != 3000
triggerall = ctrl = 0
trigger1 = stateno = [120,150]
trigger2 = movecontact = 1
value = 600

[state -3, air rave2]
type = changestate
triggerall = roundstate = 2
triggerall = pos y >= 5
triggerall = var(59) = 1
triggerall = statetype = A
triggerall = p2bodydist x = [0,15]
triggerall = p2bodydist y = [-20,10]
triggerall = stateno != 959
triggerall = stateno != 3000
triggerall = ctrl = 0
trigger1 = movecontact = 1
trigger2 = stateno = [120,150]
value = 610

[state -3, air rave3]
type = changestate
triggerall = roundstate = 2
triggerall = pos y >= 5
triggerall = var(59) = 1
triggerall = statetype = A
triggerall = p2bodydist x = [0,15]
triggerall = p2bodydist y = [-20,10]
triggerall = stateno != 959
triggerall = stateno != 3000
triggerall = ctrl = 0
trigger1 = movecontact = 1
trigger2 = stateno = [120,150]
value = 620

[state -3, air rave4]
type = changestate
triggerall = roundstate = 2
triggerall = pos y >= 5
triggerall = var(59) = 1
triggerall = statetype = A
triggerall = p2bodydist x = [0,15]
triggerall = p2bodydist y = [-20,10]
triggerall = stateno != 959
triggerall = stateno != 3000
triggerall = ctrl = 0
trigger1 = movecontact = 1
trigger2 = stateno = [120,150]
value = 630

[state -3, float recover towards]
type = changestate
triggerall = roundstate = 2
triggerall = stateno = 5120
triggerall = var(59) = 1
trigger1 = p2bodydist x >= 25
trigger2 = backedgedist <= 20
value = 6000

[state -3, float recover away]
type = changestate
triggerall = roundstate = 2
triggerall = stateno = 5120
triggerall = var(59) = 1
triggerall = backedgedist <= 200
trigger1 = p2bodydist x <= 15
trigger2 = life <= 100
trigger3 = frontedgedist <= 20
trigger4 = p2bodydist x <= 0
value = 6001
