; Inteligencia Artificial - Inicio

[Statedef 9999]
anim = 9999
ctrl = 0

[State 9999, 0]
type = Turn
trigger1 = facing != parent, facing

[State 9999, 1]
type = Varset
trigger1 = 1
var(9) = parent, var(9)

[State 9999, 2]
type = ParentVarSet
triggerall = parent, RoundState = 2
trigger1 = parent, command = "x"
trigger2 = parent, command = "y"
trigger3 = parent, command = "z"
trigger4 = parent, command = "a"
trigger5 = parent, command = "holdfwd"
trigger6 = parent, command = "holdback"
trigger7 = parent, command = "holdup"
trigger8 = parent, command = "holddown"
var(9) = 1

[State 9999, 3]
type = ParentVarSet
triggerall = parent, RoundState = 2
trigger1 = (command = "x" && parent, command = "x")
trigger2 = (command = "y" && parent, command = "y")
trigger3 = (command = "z" && parent, command = "z")
trigger4 = (command = "a" && parent, command = "a")
trigger5 = (command = "holdfwd" && parent, command = "holdfwd")
trigger6 = (command = "holdback" && parent, command = "holdback")
trigger7 = (command = "holdup" && parent, command = "holdup")
trigger8 = (command = "holddown" && parent, command = "holddown")
var(9) = -1

[State 9999, 4]
type = varset
trigger1 = var(9) != parent, var(9)
V = 47
value = 0

[State 9999, 5]
type = VarAdd
trigger1 = var(9) = parent, var(9)
V = 47
value = 1

[State 9999, 6]
type = Destroyself
trigger1 = parent, var(9) = -1
trigger1 = var(47) >= 23
trigger2 = parent, var(9) = 2
trigger2 = var(47) >= 23
trigger3 = RoundState = 3


;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]

[State -2, Explod - Cola del Stand]
type = Explod
triggerall =  stateno = 0
trigger1 = time = 1
trigger2 = time % 35 = 0
anim = 1
ID = 1
pos = 4, 1
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -2
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.5,0.5
sprpriority = -1
ontop = 1
shadow = 1,1,1
ownpal = 0
removeongethit = 0

[State 0, RemoveExplod - Cola del Stand]
type = RemoveExplod
trigger1 = stateno != 0
id = 1
;ignorehitpause =
;persistent =

[State -2, RemoveExplod]
type = RemoveExplod
trigger1 = numhelper(2554) = 0
id = 2561

[State -2, RemoveExplod]
type = RemoveExplod
trigger1 = stateno != 2600
id = 2660



;===================================================================================
;---------------- Inteligencia Artificial  -----------------------------------------
;===================================================================================
[State -2, AI_Check] ; El ayudante siempre presente
type = Helper ; Ayudante
trigger1 = NumHelper(9999) = 0 ; No se repitira si esta presente ya
trigger1 = var(9) = 0 ; Variable que actúa como interruptor
trigger1 = life <= 250
trigger1 = RoundState = 2 ; Solo activado en combate
name = "AI activada" ; Nombre de la AI
id = 9999 ; Su identificador
pos = 1000, 1000 ; posición en su nivel muy alta
stateno = 9999 ; Te manda al stateno 9999
helpertype = normal ; Helper tipo normal
keyctrl = 1



; Con esto le digo cuando está activada
; en este caso, cuando la variable 9 es 1
[State -2, AI prueba]
type = VarSet ; Tipo variable
trigger1 = command ="AI Prueba" ; Nombre del cmd
var(9) = 1 ; Pone la variable a 9 a 1

;Con esto veo si la IA esta activada en el Debug mode
[State -2,3]
type = DisplayToClipboard ; Pone el nombre en el debug
trigger1 = var(9)=1 ; Condición para que ponga el texto
text = "La Inteligencia Artificial funca" ; Nombre del texto


; Con esto le digo cuando está desactivada
; en este caso, cuando la variable 9 es 0
[State -2, AI desactivarlo]
type = VarSet ; Tipo variable
trigger1 = command ="AI desactivado" ; Nombre del cmd
var(9) = 0

;Con esto veo si la IA esta desactivada en el Debug mode
[State -2,3]
type = DisplayToClipboard ; Pone el nombre en el debug
trigger1 = var(9)=0 ; Condición para que ponga el texto
text = "La Inteligencia Artificial desactivada" ; Nombre del texto

;---------------------------------------------------------
; con esto la pc activa la IA

[State -2, AI activada por la PC]
type = VarSet
trigger1 = (command = "AI1") ||(Command = "AI2") || (Command = "AI3") || (Command = "AI4") || (Command = "AI5")
trigger2 = (Command = "AI6") || (Command = "AI7") || (Command = "AI8") || (Command = "AI9") || (Command = "AI10")
trigger4 = (Command = "AI11") || (Command = "AI12") || (Command = "AI13") || (Command = "AI14")
var(9) = 1

; IA de Defensa
[State -2, IA de Defensa]
type = ChangeState
value = 132
triggerall = p2movetype = A || (enemy, NumProj >= 1) ;
triggerall = P2bodydist X <= 40 || (enemy, NumProj >= 1)
triggerall = statetype = A ; Activo unicamente si estas en el Aire
triggerall = random <= 600 ; Aquí le ponemos un poco de aleteoriedad
triggerall = var(9) = 1 ; La variable que activa la AI
triggerall = ctrl
triggerall = stateno != 132
trigger1 = p2statetype = A
trigger2 = (enemy, NumProj >= 1)

[State -2, IA de Defensa]
type = ChangeState
value = 130
triggerall = p2movetype = A || (enemy, NumProj >= 1)
triggerall = P2bodydist X <= 40 || (enemy, NumProj >= 1)
triggerall = random <= 400
triggerall = statetype != A
triggerall = var(9) = 1
triggerall = ctrl
triggerall = stateno != 120
trigger1 = p2statetype = S
trigger2 = (enemy, NumProj >= 1)

;----------------------------------
;combos normales
;[State -2, IA puño devil 1 ]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
value = 200
triggerall = P2bodydist X <= 20
triggerall = random = [600,700]
triggerall = statetype != A
triggerall = var(9) = 1
triggerall = ctrl
trigger1 = p2statetype = S

;start using basics
[State -2, puño devil doble]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1 ;&& roundstate = 2
trigger1 = ctrl && statetype = S && p2dist X< 80 && random = [0,100]
value = ifelse(random < 50,200,201)

[State -2, patada devil\puño fuerte]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype = S ;&& roundstate = 2
trigger1 = ctrl && statetype = S && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 200 && movecontact && random = [100,200]
trigger3 = stateno = 201 && movecontact && random = [100,200]
trigger4 = stateno = 240 && movecontact && random = [100,200]
trigger5 = stateno = 320 && movecontact && random = [100,200]
trigger6 = stateno = 330 && movecontact && random = [200,400]
value = ifelse(random > 250, 230,210)

[State -2, patadas]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1 && statetype = S ;&& roundstate = 2
trigger1 = ctrl && statetype = S && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 200 && movecontact && random = [100,200]
trigger3 = stateno = 201 && movecontact && random = [100,200]
trigger4 = stateno = 320 && movecontact && random = [300,400]
value = ifelse(random > 200, 230,240)

[State -2, puño abajo\giro patada]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype = S
trigger1 = ctrl && statetype = S && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 200 && movecontact && random = [100,200]
trigger3 = stateno = 201 && movecontact && random = [100,200]
trigger4 = stateno = 230 && movecontact && random = [100,200]
trigger5 = stateno = 240 && movecontact && random = [100,200]
value = ifelse(random < 150, 410,330)

[State -2, Puño Fuerte\coletaso]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype = S
trigger1 = ctrl && statetype = S && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 200 && movecontact && random = [100,200]
trigger3 = stateno = 201 && movecontact && random = [100,200]
trigger4 = stateno = 230 && movecontact && random = [100,200]
trigger5 = stateno = 240 && movecontact && random = [100,200]
value = ifelse(random < 150, 210,320)

[State -2, Corriendo\Patadon - codazo]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype = S
trigger1 = ctrl && statetype = S && p2dist X< 60 && random = [500,600]
trigger2 = stateno = 100 && random = [500,600]
value = ifelse(random < 150, 1280,1210)

[State -2, combos Agachado - basicos]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype != A
trigger1 = ctrl && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 400 && movecontact && random = [100,200]
trigger3 = stateno = 430 && movecontact && random = [100,200]
value = ifelse(random < 150, 410,440)

[State -2, combos saltando - basicos]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype = A
trigger1 = ctrl && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 600 && movecontact && random = [100,200]
trigger3 = stateno = 630 && movecontact && random = [100,200]
value = ifelse(random < 150, 610,640)

[State -2, Combos volando - specials]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1  && statetype = A
trigger1 = ctrl && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 610 && movecontact && random = [100,200]
trigger3 = stateno = 640 && movecontact && random = [100,200]
trigger4 = stateno = 2600 && (time >= 20) && random = [100,200]
value = ifelse(random < 150, 1090,1090)

[State -2, combos volando - basicos]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
trigger1 = ctrl && stateno = 1500 && p2dist X< 60 && random = [100,200]
trigger2 = stateno = 500 && movecontact && random = [100,200]
trigger3 = stateno = 530 && movecontact && random = [100,200]
value = ifelse(random < 150, 510,540)

;----------------------------------------
;Specials
[State -2, Codazo devil]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = pos y >= -10
trigger1 = ctrl && statetype = S
trigger1 = P2bodydist X <= 150 && random = [500,600]
trigger2 = stateno = 200 && movecontact && random = [10,15]
trigger3 = stateno = 201 && movecontact && random = [10,15]
trigger4 = stateno = 230 && movecontact && random = [10,15]
trigger5 = stateno = 210 && movecontact && random = [10,15]
trigger6 = stateno = 320 && movecontact && random = [10,15]
trigger7 = stateno = 410 && movecontact && random = [10,15]
trigger8 = stateno = 430 && movecontact && random = [10,15]
value = 1200

[State -2, Codazo fuerte]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = pos y >= -10
trigger1 = ctrl && statetype = S
trigger1 = P2bodydist X <= 150 && random = [500,600]
trigger2 = stateno = 200 && movecontact && random = [10,15]
trigger3 = stateno = 201 && movecontact && random = [10,15]
trigger4 = stateno = 230 && movecontact && random = [10,15]
trigger5 = stateno = 210 && movecontact && random = [10,15]
trigger6 = stateno = 320 && movecontact && random = [10,15]
trigger7 = stateno = 410 && movecontact && random = [10,15]
trigger8 = stateno = 430 && movecontact && random = [10,15]
value = 1300

;codaso combo 2º hit / codaso traba
[state -2, codaso combo 2º hit / codaso traba]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = pos y >= -50
trigger1 = stateno = 1210 && movecontact && random = [0,20]
value = ifelse(random < 10, 1220,1270)

;codaso traba / codaso patada
[state -2, codaso traba / codaso patada]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
trigger1 = stateno = 1210 && movecontact && random = [0,20]
value = ifelse(random < 10, 1270,1280)

;codaso patada / codaso combo 2º hit
[state -2, codaso patada / codaso combo 2º hit]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
trigger1 = stateno = 1210 && movecontact && random = [0,20]
value = ifelse(random < 10, 1280,1220)

;codaso combo remate/ codaso patada
[state -2, codaso combo remate/ codaso patada]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
trigger1 = stateno = 1220 && movecontact && random = [0,10]
value = ifelse(random < 10, 1230,1280)

;rodillazo/ patada hacia arriba
[state -2, rodillazo/ patada hacia arriba]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
trigger1 = stateno = 1270 && movecontact && random = [0,20]
value = ifelse(random < 10, 1500,1600)
;---------------------------------------------------


[State -2, rodillazo para adelante Corto]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = pos y >= -10
triggerall = ctrl && statetype = S
trigger1 = P2bodydist X >= 100 && random = [500,600]
trigger2 = stateno = 200 && movecontact && random = [10,15]
trigger3 = stateno = 201 && movecontact && random = [10,15]
trigger4 = stateno = 230 && movecontact && random = [10,15]
trigger5 = stateno = 210 && movecontact && random = [10,15]
trigger6 = stateno = 320 && movecontact && random = [10,15]
trigger7 = stateno = 410 && movecontact && random = [10,15]
trigger8 = stateno = 430 && movecontact && random = [10,15]
value = 1900

[State -2, rodillazo para adelante Largo]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = pos y >= -10
triggerall = ctrl && statetype = S
trigger1 = P2bodydist X >= 200 && random = [500,600]
trigger2 = stateno = 200 && movecontact && random = [10,15]
trigger3 = stateno = 201 && movecontact && random = [10,15]
trigger4 = stateno = 230 && movecontact && random = [10,15]
trigger5 = stateno = 210 && movecontact && random = [10,15]
trigger6 = stateno = 320 && movecontact && random = [10,15]
trigger7 = stateno = 410 && movecontact && random = [10,15]
trigger8 = stateno = 430 && movecontact && random = [10,15]
value = 1950

[State -2, rodillazo arriba]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = P2bodydist y >= -2
triggerall = var(9) = 1
triggerall = ctrl && statetype = S
trigger1 = random = [500,600]
value = 1500

[State -2, rodillazo arriba]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = P2bodydist y >= -2
triggerall = var(9) = 1
triggerall = ctrl && statetype = S
trigger1 = random = [500,600]
value = 1600

[State -2, rodillazo adelante aire / Ki bomb]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype = A
trigger1 = random = [500,600]
value = ifelse(random < 550, 1800,2400)

;-----------------------------------------------
;Speciales de ki

[State -2, manejo de ki / kienzan]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype != A
triggerall = P2bodydist x >= 150
triggerall = power >= 200
trigger1 = random = [500,600]
value = ifelse(random < 550, 2100,2200)

[State -2, Ki gaiser]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype != A
triggerall = P2bodydist x >= 100
triggerall = power >= 400
trigger1 = random = [500,600]
value = 2000


[State -2, Aros de ki / Final Shine]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype != A
triggerall = P2bodydist x >= 100
triggerall = power >= 500
trigger1 = random = [500,600]
value = ifelse(random < 550, 2300,2500)

[State -2, Explosión de ki corta]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype != A
triggerall = P2bodydist x <= 100
triggerall = power >= 100
trigger1 = random = [500,600]
value = 1400

[State -2, Explosión de ki Larga]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype != A
triggerall = P2bodydist x >= 100
triggerall = power >= 100
trigger1 = random = [500,600]
value = 1700

[State -2, Ki bomb / Nova bomb]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1
triggerall = ctrl && statetype = A
triggerall = numhelper(2650) = 0
trigger1 = random = [500,600]
trigger2 = stateno = 1100 && random = [450,650]
value = ifelse(random < 500, 2400,2600)

[State -2, rodillazo volando]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = stateno = 1100
triggerall = var(9) = 1
trigger1 = random = [400,500]
value = 1800


;fireball
[state -2]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1 && power >= 100
triggerall = random = [900,999]
triggerall = ctrl
triggerall = pos y >= -2
trigger1 = P2bodydist X >= 200
value = 1000
;fireball  2
[state -2]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1 && power >= 100
trigger1 = stateno = 1000 && time > 15 && random = [100,200]
value = 1001
;fireball  3
[state -2]
type = changestate
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = var(9) = 1 && power >= 100
trigger1 = stateno = 1001 && time > 15 && random = [100,200]
value = 1002


;----------------------------------------
;Supers

[State -2, Big Bang / Fireballs desesperation]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = pos y >= -2
triggerall = ctrl && var(9) = 1 && statetype = S && power >= 1000
trigger1 = statetype = S && p2dist X > 150 && random = [700,800]
trigger2 = stateno = 1270 && movecontact && random = [700,800]
trigger3 = prevstateno = 2000 && time > 30 && random = [700,800]
value = ifelse(random < 750, 3000, 3300)

[State -2, garlick hoo / Fireballs desesperation - En el aire]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = pos y <= -60
triggerall = var(9) = 1 && power >= 1000
trigger1 = ctrl && pos Y <= -60 && random = [800,900]
trigger2 = stateno = 2300 && time > 22 && random = [500,600]
trigger3 = stateno = 2400 && time > 22 && random = [500,600]
trigger4 = stateno = 1100
value = ifelse(random < 550, 3100,3350)

[State -2, Final Flash]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3200
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = pos y >= -2
triggerall = ctrl && var(9) = 1 && statetype = S && power >= 2000
triggerall = numhelper(3020) = 0
trigger1 = statetype = S && p2dist X > 150 && random = [0,200]
trigger2 = stateno = 1270 && movecontact && random = [0,200]
trigger3 = prevstateno = 2000 && time > 30 && random = [0,200]
value = 3200

[State -2, Suicide]
type = ChangeState
triggerall = stateno != 3000 || stateno != 3001 ; esto es para que no corte los supers
triggerall = stateno != 3100
triggerall = stateno != 3300 || stateno != 3349 || stateno != 3350 || stateno != 3360 || stateno != 33700
triggerall = stateno != 3500 || stateno != 3501
triggerall = stateno != 3600
triggerall = pos y >= -2
triggerall = var(9) = 1 && statetype = S && power >= 3000
trigger1 = ctrl && P2bodydist X >= 100 && random = [0,200]
trigger2 = stateno = 310 && movecontact && random = [0,200]
trigger3 = prevstateno = 2000 && time > 30 && random = [0,200]
value = 3500

[State -2, terminación]
type = VarAdd
trigger1 =  p2life = 0
v =  9
value = 0
;ignorehitpause =
;persistent =



;-------------------------------- Inteligencia Artificial --------------------------------------------
;Run Forward
;[State -3:		ChangeState]
;type = ChangeState
;triggerall = (Var(9) = 1) && (StateType != A) && (StateNo != [100,101]) && (P2MoveType != A) && (EnemyNear, NumProj = 0) && (StateNo != [3000,3400])
;triggerall = random = [300,400]
;trigger1 = (P2BodyDist X > 75) && (EnemyNear, Pos Y = 0) && (EnemyNear, Anim = 5300) && (P2MoveType != A)
;trigger2 = ((P2Dist X > 150) || ((P2Dist X > 75) && (P2StateNo = 105)))
;value = 100
