;VARS:
;13 - tiempo de muerte del clon
;14 - nombre del target para el CLON
;15 - numero de state previo a HIT
;16 - cantidad de veces que entro a HIT armor
;17 - numero de animelem previo al hit
;18 - vida de cada clon
;19 - cantidad de clones muertos. cuando llega a 3 se resetea

;------------------------------------------------
; Stand to Crouch (FALSO)
[Statedef 10]
type    = C
physics = C

[State 40, GTFO!]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
; Crouching (FALSO)
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State 40, GTFO!]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
; Crouch to Stand (FALSO)
[Statedef 12]
type    = S
physics = S

[State 40, GTFO!]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
; Jump Start (FALSO)
[Statedef 40]
type    = S
physics = S
ctrl = 0
sprpriority = 1

[State 40, GTFO!]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
;HIT armor
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0
hitcountpersist = 1

;apaga varset en hyper-rayo
;para que no entre en hit y arruine
;el ataque
[State 0, VarSet]
type = VarSet
trigger1 = anim = 3500 && animelemtime(73)>=0
var(16)=0
ignorehitpause = 1

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 3
add = 37,-123,-123
mul = 256,100,100
color = 256
ignorehitpause = 1

[State 0, VarSet]
type = Varadd
trigger1 = !time
var(16) = 1
ignorehitpause = 1

;muere
[State 0, ChangeState]
type = ChangeState
trigger1 = life = 0
value = 5150
ctrl = 0
ignorehitpause = 1

;hit verdadero
[State 0, ChangeState]
type = ChangeState
trigger1 = var(16)>=5
trigger2 = anim = 5400
value = 5005
ctrl = 0
ignorehitpause = 1

[State 5000, 1]
type = ChangeAnim
trigger1 = 1
value = Anim
elem = var(17)
ignorehitpause = 1

[State 5000, 2]
type = ChangeState
trigger1 = time = 7
trigger2 = anim = 3500 && animelemtime(73)>=0 && time = 2
value = Var(15)
ctrl = 1

;---------------------------------------------------------------------------
;HIT verdadero
[Statedef 5005]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0

;muere
[State 0, ChangeState]
type = ChangeState
trigger1 = life = 0
value = 5150
ctrl = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(1)=2
value = 11,1
freqmul = 0.9+(random/3333.3)
volume = 200
channel = 11

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(1)=2
value = 6,ifelse(random<500,4,8)
freqmul = 0.9+(random/3333.3)
volume = 100

[State 0, PowerAdd]
type = PowerAdd
trigger1 = !time && prevstateno != 5005
value = 20
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(16)=0
ignorehitpause = 1

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 3
add = 37,-123,-123
mul = 256,100,100
color = 256
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
trigger1 = anim != 5400
value = 5400
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; muerto
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = 0
velset = 0,0

;agarre fatal
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !time
trigger1 = prevstateno = 1130
value = 91232

;hyper fatal, anim null 3011
[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = !time
trigger1 = prevstateno = 3021
value = 3011

;muere normal
;------------

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 3011 && anim != 91232 &&!time
value = 5150

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 5150 && animelem = 1
value = 11,2
volume = 150

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 5150 && animelem = 22
value = 10,10
volume = 60
freqmul = 0.7
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 5150 && animelem = 22
value = 0,3
freqmul = 0.7
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = anim = 5150 && animelem = 22
anim = f 120
pos = 40,0
sprpriority = 3

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 5150 && animelem = 22
time = 12
ampl = -10

;agarre fatal
;------------

;ondita
[State 0, Explod]
type = Explod
trigger1 = anim = 91232 && animelem = 1
anim = f 61
sprpriority = 0
ownpal = 1
pos = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 91232 && animelem = 1
value = f 7,0

;hyper fatal
;-----------

[State 0, Helper]
type = Helper
trigger1 = anim = 3011 && !time
trigger1 = selfanimexist(9123000)
trigger1 = numhelper(3100)=0
name = "cabeza"
pos = 0,0
stateno = 912320

[State 0, PalFX]
type = PalFX
trigger1 = !time && anim = 3011
time = 1
add = 0,0,0

;---

[State 0, PosSet]
type = PosSet
trigger1 = !time
y = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

