; Queda prohibida la manipulación total o parcial de los sprites. ¡Los caballeros no son clones!
; The total or partial manipulation of sprites is forbidden. The saints aren't clones! 
; On interdit la manipulation totale ou partielle des sprites. Les chevaliers ne sont pas copie! 
; La manipolazione totale o parziale degli sprites è proibita. I cavalieri non sono clona! 

;-| AI |---La véritable intelligence d'un chevalier------------------------------------------------------------

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

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

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

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

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

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

[Command]
name = "AI7"
command = a, b, c
time = 1

[Command]
name = "AI8"
command = a, c, b
time = 1

[Command]
name = "AI9"
command = b, a, c
time = 1

[Command]
name = "AI10"
command = b, c, a
time = 1

[Command]
name = "AI11"
command = c, b, a
time = 1

[Command]
name = "AI12"
command = c, a, b
time = 1

[Command]
name = "AI13"
command = x, y, z
time = 1

[Command]
name = "AI14"
command = x, z, y
time = 1

[Command]
name = "AI15"
command = y, z, x
time = 1

[Command]
name = "AI16"
command = y, x, z
time = 1

[Command]
name = "AI17"
command = z, y, x
time = 1

[Command]
name = "AI18"
command = z, x, y
time = 1

[Command]
name = "AI19"
command = a, b, a
time = 1

[Command]
name = "AI20"
command = a, c, a
time = 1

[Command]
name = "AI21"
command = b, a, b
time = 1

[Command]
name = "AI22"
command = b, c, b
time = 1

[Command]
name = "AI23"
command = c, a, c
time = 1

[Command]
name = "AI24"
command = c, b, c
time = 1

[Command]
name = "AI25"
command = x, y, x
time = 1

[Command]
name = "AI26"
command = x, z, x
time = 1

[Command]
name = "AI27"
command = y, x, y
time = 1

[Command]
name = "AI28"
command = y, z, y
time = 1

[Command]
name = "AI29"
command = z, x, z
time = 1

[Command]
name = "AI30"
command = B, DB, D, z, y, z
time = 1


[Command]
name = "qcbp2"
command = a+b+c+x+y+z
time = 30
[Command]
name = "qcbp2"
command = a+c
time = 30
;-----------------------------
[Command]
name = "qcfp2"
command = a+y
time = 30
[Command]
name = "qcbhcfp"
command = ~D, DF, F, a+z
time = 45
[Command]
name = "qcb_y"
command = b+x
time = 15
[Command]
name = "charge_x"
command = c+x
time = 15

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


[Command]
name = "SuperJump"
command = $D, $U

;carga
[Command]
name = "wall1"
command = /b
time = 1

[Command]
name = "wall2"
command = /c
time = 1
;---------------------


; Especiales
; Magia en el aire con dos brazos
[Command]
name = "2_brazos"
command = B, DB, D, DF, F, a
time = 30

; Magia en el aire con un brazo
[Command]
name = "1_brazo"
command = B, DB, D, DF, F, b
time = 30

; Magia golpe al suelo
[Command]
name = "g_suelo"
command = B, DB, D, DF, F, z
time = 40

; Llamas del infierno
[Command]
name = "llamas_inf"
command = B, DB, D, DF, F, c
time = 30

;  bola de fuego
[Command]
name = "bola1"
command = D,DB,B, a
time = 20

;  bola de fuego - nivel 2
[Command]
name = "bola2"
command = D,DB,B, b
time = 20

;  agarrão
[Command]
name = "Grab"
command = D,DB,B, c
time = 20

; Combo agachao
[Command]
name = "combo_agachao"
command = D, DF, F, a
time = 30

; Combo puños
[Command]
name = "combo_puños"
command = D, DF, F, b
time = 20



;Combinación de botones

;Defensa reversa (reversal def)
[Command]
name = "qcf_a"
command = c
time = 15	

;Recargar
[Command]
name = "recover"
command = a+x
time = 30

;Dir + botón
;----------------------
;----------------------

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

; Botones
;----------------------
;----------------------

[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 = "lunas"
command = ~D, DF, F, x

[Command]
name = "hcf_y"
command = ~D, DF, F, y
time = 25



[Command]
name = "FF"
command = F, F
time = 10
[Command]
name = "BB"
command = B, B
time = 10
[Command]
name = "recovery"
command = x+y
time = 1
[Command]
name = "dodge"
command = x+a
time = 1

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

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


[Command]
name = "fwd_b"
command = /F, b
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

;boh
[Command]
name = "s"
command = s
time = 1


[Command]
name = "holdfwd_x"
command = /$F, x
time = 1

[Command]
name = "holdfwd"
command = /$F
time = 1
[Command]
name = "holdback"
command = /$B      
time = 1
;--------------------
; Holdback3
[Command]
name = "holdback3"
command = /$B   
time = 50
;---------------------

[Command]
name = "holdup"
command = /$U
time = 1
[Command]
name = "holddown"
command = 

;--------------------------------------------------
;Comandos
;--------------------------------------------------
[Statedef -1]
;--------------------

; AI
[State -1, AI]
type = Varset

trigger1 = command = "AI1"
trigger2 = command = "AI2"
trigger3 = command = "AI3"
trigger4 = command = "AI4"
trigger5 = command = "AI5"
trigger6 = command = "AI6"
trigger7 = command = "AI7"
trigger8 = command = "AI8"
trigger9 = command = "AI9"
trigger10 = command = "AI10"
trigger11 = command = "AI11"
trigger12 = command = "AI12"
trigger13 = command = "AI13"
trigger14 = command = "AI14"
trigger15 = command = "AI15"
trigger16 = command = "AI16"
trigger17 = command = "AI17"
trigger18 = command = "AI18"
trigger19 = command = "AI19"
trigger20 = command = "AI20"
trigger21 = command = "AI21"
trigger22 = command = "AI22"
trigger23 = command = "AI23"
trigger24 = command = "AI24"
trigger25 = command = "AI25"
trigger26 = command = "AI26"
trigger27 = command = "AI27"
trigger28 = command = "AI28"
trigger29 = command = "AI29"
trigger30 = command = "AI30"
v = 59
value = 1


;carga
[State -1]
type = ChangeState
value = 30
triggerall = power < 3000
triggerall = command = "wall1"
triggerall = command = "wall2"
trigger1 = statetype != A
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 1200
triggerall = command = "Grab"
triggerall = power >= 1000
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = [200,250]
trigger2 = moveContact
trigger3 = stateno = [400,450]
trigger3 = moveContact
trigger4 = stateno = 1400
trigger4 = moveContact


; Espacial
;-------------------------
;-------------------------

; Magia en el aire con un brazo
[State -1]
type = ChangeState
value = 210
triggerall = command = "1_brazo"
triggerall = power >= 1000
trigger1 = statetype = S
trigger1 = ctrl = 1

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

; Magia en el aire con dos brazos
[State -1]
type = ChangeState
value = 7210
triggerall = command = "2_brazos"
triggerall = power >= 1000
trigger1 = P2bodydist X >= 110
trigger1 = statetype = S
trigger1 = ctrl = 1

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

; Magia golpe al suelo
[State -1]
type = ChangeState
value = 8000
triggerall = command = "g_suelo"
triggerall = power >= 2000
trigger1 = statetype = S
trigger1 = ctrl = 1

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


; Llamas del infierno
[State -1]
type = ChangeState
value = 7733
triggerall = command = "llamas_inf"
triggerall = power >= 3000
trigger1 = statetype = S
trigger1 = ctrl = 1

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

[State -1]
type = ChangeState
value = 2050
trigger1 = command = "qcbp2"
trigger1 = power >= 3000
trigger1 = life <= 170
trigger1 = statetype != A
trigger1 = statetype != C
trigger1 = ctrl = 1




; bola de fuego
[State -1]
type = ChangeState
value = 225
triggerall = command = "bola1"
trigger1 = statetype != A
trigger1 = statetype != C
trigger1 = ctrl = 1


; soldados
[State -1]
type = ChangeState
value = 226
triggerall = command = "bola2"
triggerall = power >= 400
trigger1 = statetype != A
trigger1 = statetype != C
trigger1 = ctrl = 1


; combo agachao
[State -1]
type = ChangeState
value = 8898
triggerall = command = "combo_agachao"
trigger1 = P2bodydist X <= 43
trigger1 = statetype = S
trigger1 = ctrl = 1

; combo puños
[State -1]
type = ChangeState
value = 8899
triggerall = command = "combo_puños"
trigger1 = P2bodydist X <= 48
trigger1 = statetype = S
trigger1 = ctrl = 1


;Luna's Hammer
[State -1]
type = ChangeState
value = 1050
triggerall = command = "lunas"
trigger1 = statetype = S
trigger1 = ctrl = 1


;[State -1]
;type = ChangeState
;value = 1650
;triggerall = command = "hcf_y"
;trigger1 = statetype != A
;trigger1 = ctrl = 1
;trigger2 = stateno = 200
;trigger2 = MoveContact = 1
;trigger3 = stateno = 230
;trigger3 = MoveContact = 1
;trigger4 = stateno = 250
;trigger4 = MoveContact = 1
;trigger5 = stateno = 400
;trigger5 = MoveContact = 1
;trigger6 = stateno = 440
;trigger6 = MoveContact = 1
;trigger7 = stateno = 460
;trigger7 = MoveContact = 1

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

; Combinación de botones
;-------------------------
;-------------------------

; Revés
[State -1]
type = ChangeState
value = 1400
triggerall = command = "qcf_a"
triggerall = command = "holdback"
trigger1 = statetype != A
trigger1 = ctrl = 1

; Recuperar
[State -1]
type = ChangeState
value = 2000
trigger1 = Var(1) != 1
triggerall = command = "recover"
trigger1 = power >= 3000
trigger1 = statetype != A
trigger1 = ctrl = 1
;--------------------------

; Direcciones y botones
;-------------------------

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

; Patada alta
[State -1]
type = ChangeState
value = 250
triggerall = command = "fwd_y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl = 1
;-----------------------------------------


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

; Puño en el aire (con a)
[State -1]
type = ChangeState
value = 640
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl = 1

; Puño en el aire (con b)
[State -1]
type = ChangeState
value = 640
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl = 1

; Puño en el aire (con c)
[State -1]
type = ChangeState
value = 640
triggerall = command = "c"
trigger1 = statetype = A
trigger1 = ctrl = 1

; Puño agachado flojo
[State -1]
type = ChangeState
value = 400
triggerall = command = "a"
trigger1 = statetype = C
trigger1 = ctrl = 1

; Puño agachado medio
[State -1]
type = ChangeState
value = 405
triggerall = command = "b"
trigger1 = statetype = C
trigger1 = ctrl = 1

; Puño agachado fuerte
[State -1]
type = ChangeState
value = 410
triggerall = command = "c"
trigger1 = statetype = C
trigger1 = ctrl = 1

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

; Patada en el aire (con x)
[State -1]
type = ChangeState
value = 660
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl = 1
trigger2 = stateno = 640
trigger2 = movecontact = 1

; Patada en el aire (con y)
[State -1]
type = ChangeState
value = 650
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl = 1

; Patada en el aire (con z)
[State -1]
type = ChangeState
value = 630
triggerall = command = "z"
trigger1 = statetype = A
trigger1 = ctrl = 1

; Golpe x
[State -1]
type = ChangeState
value = 438
triggerall = command = "x"
trigger1 = statetype = C
trigger1 = ctrl = 1

; Golpe y
[State -1]
type = ChangeState
value = 439
triggerall = command = "y"
trigger1 = statetype = C
trigger1 = ctrl = 1

; Golpe z
[State -1]
type = ChangeState
value = 440
triggerall = command = "z"
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------
; super salto
[State -1, Supersalto]
type = ChangeState
value = 670
triggerall = StateType = S || StateType = C
triggerall = ctrl
trigger1 = command = "SuperJump"

; Botón
;--------------------------
;--------------------------

; Puño débil
[State -1]
type = ChangeState
value = 200
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

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

;Puño medio
[State -1]
type = ChangeState
value = 215
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
;-----------------------------------------

;Puño fuerte
[State -1]
type = ChangeState
value = 201
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
;----------------------------------------

; Rodillazo  x
[State -1]
type = ChangeState
value = 230
triggerall = command = "z"
trigger1 = statetype = S
trigger1 = P2bodydist X <= 30
trigger1 = ctrl = 1

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


; Patada débil
[State -1]
type = ChangeState
value = 220
triggerall = command = "x"
trigger1 = statetype = S
trigger1 = ctrl = 1

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

; Patada media
[State -1]
type = ChangeState
value = 250
triggerall = command = "y"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 215
trigger2 = movecontact = 1
trigger3 = stateno = 220
trigger3 = movecontact = 1
;----------------------------------------

; Patada fuerte
[State -1]
type = ChangeState
value = 240
triggerall = command = "z"
trigger1 = P2bodydist X >= 30
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 250
trigger2 = movecontact = 1
trigger3 = stateno = 201
trigger3 = movecontact = 1
;-----------------------------------------

[State -1]
type = ChangeState
value = 1140
triggerall = command = "qcb_y"
trigger1 = statetype = A
trigger1 = ctrl = 1
trigger2 = stateno = 620
trigger2 = MoveContact = 1
trigger3 = stateno = 630
trigger3 = MoveContact = 1
trigger4 = stateno = 640
trigger4 = MoveContact = 1
trigger5 = stateno = 660
trigger5 = MoveContact = 1


[State -1]
type = ChangeState
value = 1300
triggerall = command = "charge_x"
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger2 = stateno = 200
trigger2 = MoveContact = 1
trigger3 = stateno = 230
trigger3 = MoveContact = 1
trigger4 = stateno = 250
trigger4 = MoveContact = 1
trigger5 = stateno = 400
trigger5 = MoveContact = 1
trigger6 = stateno = 440
trigger6 = MoveContact = 1
trigger7 = stateno = 460
trigger7 = MoveContact = 1

[State -1]
type = ChangeState
value = 420
triggerall = command = "a"
trigger1 = statetype = C
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 640
trigger1 = command = "x"
trigger1 = statetype = A
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 620
trigger1 = command = "a"
trigger1 = statetype = A
trigger1 = Vel X = 0
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 199
trigger1 = command = "s"
trigger1 = statetype != A
trigger1 = stateno != 199
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 100
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 105
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = command != "holddown"
trigger1 = ctrl = 1

;-----------------------------
; Se cubre
[State -1]
type = ChangeState
value = 3675
triggerall = StateType != A
triggerall = StateType != C
triggerall = P2StateNo = 1330
trigger1 = command = "holdback3"
trigger1 = statetype = S
trigger1 = command != "holddown"
trigger1 = ctrl = 1
;----------------------------------------------

; AI MOVEMENTS
;-----------------------------------------------------------------------------------------
;-------------------------------------------------------------------------------------

[State -1,AI ]
type = VarSet
v = 30
value = 2
triggerall = var(30) = 1
trigger1 = roundstate > 2

[State -1,AI TP1 ]
type = ChangeState
value = 7733
Triggerall = roundstate = 2
triggerall = var(1) = 0
triggerall = ctrl && power >= 3000 && statetype = S
triggerall = (var(59) != 0)  && (ctrl) && (random = [200, 350])
trigger1 = (P2bodydist X >= 50) && (prevstateno != 5120)

[State -1,AI TP1 ]
type = ChangeState
value = 7210
Triggerall = roundstate = 2
triggerall = var(1) = 0
triggerall = ctrl && power >= 1500 && statetype = S
triggerall = (var(59) != 0)  && (ctrl) && (random = [150, 200])
trigger1 = (P2bodydist X >= 110)&& (prevstateno != 5120)

[State -1,AI TP1 ]
type = ChangeState
value = 210
Triggerall = roundstate = 2
triggerall = var(1) = 0
triggerall = ctrl && power >= 1000 && statetype = S
triggerall = (var(59) != 0)  && (ctrl) && (random = [100, 110])
trigger1 = (P2bodydist X >= 100)&& (prevstateno != 5120)

[State -1,AI TP1 ]
type = ChangeState
value = 8000
Triggerall = roundstate = 2
triggerall = var(1) = 0
triggerall = ctrl && power >= 2000 && statetype = S
triggerall = (var(59) != 0)  && (ctrl) && (random = [150, 210])
trigger1 = (P2bodydist X <= 80)&& (prevstateno != 5120)

[State -1,AI TP1 ]
type = ChangeState
value = 30
Triggerall = roundstate = 2
triggerall = var(1) = 0
triggerall = ctrl && power < 3000 && statetype = S
triggerall = (var(59) != 0)  && (ctrl) && (random = [200, 300])
trigger1 = (P2bodydist X >= 100)
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

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

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------
;                                   ALL SELFSTATE
;---------------------------------------------------------------------------
