;===============================================================================
; INTELIGENCIA ARTIFICIAL:
;===============================================================================
[Statedef -2]

[State 0, Run]
type = ChangeState
triggerall = var(3) = 0
triggerall = var(5) = 0
triggerall = stateno != 60
triggerall = stateno != 65
triggerall = stateno != 70
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x > 100
trigger1 = random < (ailevel * 100)/2
value = ifelse(pos y >= 0,60,65)

[State 0, Run Atras]
type = ChangeState
triggerall = var(3) = 0
triggerall = var(5) = 0
triggerall = stateno != 60
triggerall = stateno != 65
triggerall = stateno != 70
triggerall = backedgebodydist > 50
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 100 && p2movetype = A
trigger1 = random < (ailevel * 100)/4
value = 70

[State 0, Guard]
type = ChangeState
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = (p2bodydist x < 50 && p2movetype = A) || (enemy,numproj > 0)
trigger1 = random < (ailevel * 100)/2
value = ifelse(statetype = A,132,130)

[State 0, Power Charge]
type = ChangeState
triggerall = statetype != A
triggerall = power < 3000
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x > 100
trigger1 = random < (ailevel * 100)/4
value = 500

[State 0, Power Charge End]
type = ChangeState
triggerall = time >= 12
triggerall = stateno = 500
triggerall = ailevel > 0
trigger1 = (p2bodydist x < 50) || (enemy,numproj > 0)
trigger2 = power = 3000
value = 501

[State 0, A]
type = ChangeState
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 30
trigger1 = random < (ailevel * 100)
value = 200

[State 0, B]
type = ChangeState
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 30
trigger1 = random < (ailevel * 100)
value = 300

[State 0, Down + B Shurinen Throw]
type = ChangeState
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x >= 100
trigger1 = random < (ailevel * 100)/4
value = 350

[State 0, C]
type = ChangeState
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 30
trigger1 = random < (ailevel * 100)
value = 400

[State 0, A Aire]
type = ChangeState
triggerall = statetype = A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 30
trigger1 = random < (ailevel * 100)
value = 600

[State 0, B Aire]
type = ChangeState
triggerall = statetype = A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 30
trigger1 = random < (ailevel * 100)
value = 610

[State 0, Down + B Shurinen Throw Aire]
type = ChangeState
triggerall = statetype = A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x = [-30,30]
triggerall = p2bodydist y > 30
trigger1 = random < (ailevel * 100)/4
value = 1002

[State 0, C Aire]
type = ChangeState
triggerall = statetype = A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x < 30
trigger1 = random < (ailevel * 100)
value = 620

[State 0, Shishi Rendan]
type = ChangeState
triggerall = power >= 1000
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x = [50,100]
trigger1 = random < (ailevel * 100)/2
value = 1000

[State 0, Kawarimi no Jutsu]
type = ChangeState
triggerall = numhelper(1150) = 0
triggerall = power >= 500
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x >= 100
trigger1 = random < (ailevel * 100)/8
value = 1100

[State 0, Chidori]
type = ChangeState
triggerall = power >= 1000
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x = [60,120]
trigger1 = random < (ailevel * 100)/2
value = 1200

[State 0, Chidori Nagashi]
type = ChangeState
triggerall = power >= 1500
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x = [-50,50]
trigger1 = random < (ailevel * 100)
value = 1300

[State 0, Katon Gokakyu no Jutsu]
type = ChangeState
triggerall = power >= 1000
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x >= 100
trigger1 = random < (ailevel * 100)/2
value = 1400

[State 0, Katon Goryuka no Jutsu]
type = ChangeState
triggerall = power >= 1500
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
trigger1 = p2bodydist x = [100,250]
trigger1 = random < (ailevel * 100)/2
trigger2 = p2bodydist x >= 100
trigger2 = p2bodydist y < 0
trigger2 = random < (ailevel * 100)
value = 1500

[State 0, Kuchiyose White Snake]
type = ChangeState
triggerall = numhelper(1650) = 0
triggerall = power >= 1000
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x = [50,100]
trigger1 = random < (ailevel * 100)/2
value = 1600

[State 0, Kirin]
type = ChangeState
triggerall = power >= 3000
triggerall = statetype != A
triggerall = ailevel > 0 && roundstate = 2
triggerall = ctrl
triggerall = p2bodydist x = [100,200]
trigger1 = random < (ailevel * 100)*2
value = 3000

; Kawarimi no Jutsu
[State 0, HitOverride]
type = HitOverride
trigger1 = numhelper(1150) > 0 && random < 100
attr = SCA,NA,SA,NP,SP
stateno = 1120
time = 5
;===============================================================================
;---------------------------Estados usados Siempre------------------------------
;===============================================================================
[Statedef -3]
[State 0, HELPER ESCALA]
type = Helper
trigger1 = NUMHELPER(999999) = 0
helpertype = normal
name = "HELPER ESCALA"
ID = 999999
stateno = 999999
pos = 9999,9999
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
supermove = 999999
pausemove = 999999
supermovetime = 999999
pausemovetime = 999999

; INTRO
[State 0, StopSnd]
type = StopSnd
trigger1 = prevstateno = 190 && time < 5
channel = 12
;-------------------------------------------------------------------------------
; Sonidos Comunes:
;-------------------------------------------------------------------------------
[State 0, Andando]
type = PlaySnd
triggerall = stateno = 20||stateno = 60
trigger1 = animelem = 4 || animelem = 8
value = S20,1
volume = 50

[State 0, Saltando]
type = PlaySnd
triggerall = stateno = 40
trigger1 = Time = 1
value = S40,1
volume = 55
channel = -1

[State 0, Super Jump]
type = PlaySnd
triggerall = stateno = 80
trigger1 = Time = 1
value = S60,1
volume = 55
channel = -1

[State 0, Land]
type = PlaySnd
triggerall = stateno = 52
trigger1 = time = 1
value = S52,1
volume = 50

[State 0, Run FWD]
type = PlaySnd
triggerall = stateno = 60
trigger1 = time = 1
value = S60,1
volume = 50

[State 0, Run FWD Air y BACK]
type = PlaySnd
triggerall = stateno = 65 || stateno = 70
trigger1 = time = 1
value = S40,1
volume = 50

[State 0, RemoveExplod]
type = RemoveExplod
TRIGGERALL = stateno != 500
trigger1 = time = 1
id = 550

[State 0, StopSnd]
type = StopSnd
TRIGGERALL = stateno != 500
trigger1 = time = 1
channel = 1

[State 0, StopSnd]
type = StopSnd
TRIGGERALL = stateno != 500
trigger1 = time = 1
channel = 2

[State 0, StopSnd]
type = StopSnd
TRIGGERALL = stateno != 500
trigger1 = time = 1
channel = 3

[State 0, Golpeado]
type = PlaySnd
triggerall = stateno != [4000,4999] ; Kage Bunshin
trigger1 = movetype=H && (stateno!=[0,155]) && !time && HitOver=0 && random%3=0
value = 5000,ifelse(random < 500,1,ifelse(random < 500,2,3))

[State 0, Solucion Stand Aire]
type = ChangeState
triggerall = stateno = 0||stateno = 20
trigger1 = pos y < 0
value = 50
ctrl = 1
