[Data]
;Amount of life to start with
;懱椡僎乕僕偺弶婜抣
life = 1000
;attack power (more is stronger)
;峌寕僟儊乕僕
attack = 100
;defensive power (more is stronger)
;懱椡僷儚乕
defence = 100
;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50
;Time which player lies down for, before getting up
liedown.time = 60
;Number of points for juggling
airjuggle = 15
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 0
;Variables with this index and above will not have their values
;reset to 0 between rounds or matches. There are 60 int variables,
;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
;If omitted, then it defaults to 60 and 40 for integer and float
;variables repectively, meaning that none are persistent, i.e. all
;are reset. If you want your variables to persist between matches,
;you need to override state 5900 from common1.cns.
IntPersistIndex = 30
FloatPersistIndex = 30

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 16     ;Player width (back, ground)
ground.front = 18    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = 5, -86   ;Approximate position of head
mid.pos = 0, -56    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 2.0      ;Walk forward
walk.back = -1.5     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-6.8    ;Neutral jumping velocity (x, y)
jump.back = -2.1    ;Jump back Speed (x, y)
jump.fwd = 2.3       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

[Movement]
airjump.num = 1      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .26; .24         ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
velset = 0,0

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 3150 && time=0
value = 170

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3150
value = 3162
elem = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3162 && animelem = 3
value = 12,12
volume = 100

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = anim != 3150 && anim != 3162
trigger1 = time = 10
time = 100
add = 0,0,0
mul = 256,256,256
sinadd = -256,-256,-256,150
invertall = 0
color = 0

[State 0, PalFXWiz]
type = PalFX
trigger1 = anim != 3150 && anim != 3162
trigger1 = animelem = 7
time = -1
add = 0,0,0
mul = 0,0,0
sinadd = 0,0,0,1

[State 0, Explod]
type = Explod
trigger1 = anim != 3150 && anim != 3162
trigger1 = animelem = 7
anim = 171
ownpal = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = anim != 3150 && anim != 3162
trigger1 = animelem = 7
time = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim != 3150 && anim != 3162
trigger1 = animelem = 2
value = 12,0
channel = 0
freqmul = 1.3+(random/2500.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim != 3150 && anim != 3162
trigger1 = animelem = 7
value = 10,4
freqmul = 0.4
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim != 3150 && anim != 3162
trigger1 = animelemtime(7)= 15
value = 12,7
volume = 250
freqmul = 1.1
volume = 100

;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S

;SURVIVAL SCORE
[State 0, ChangeState]
type = ChangeState
trigger1 = !(enemynear, Authorname = "Andres Borghi")
value = 181
ctrl = 0

;ENDING VS FINAL
[State 0, ChangeState]
type = ChangeState
trigger1 = enemynear,name = "Final" && matchover && matchno >= 7
trigger1=!(teammode=simul)&&!(enemy,teammode=simul)
value = 4499
ctrl = 0

;ENDING TEAM MODE WALLPAPER
[State 0, ChangeState]
type = ChangeState
trigger1=teammode=simul && enemy,teammode=simul && !ishometeam
trigger1=matchover && matchno >= 5
value = 500
ctrl = 0

[State 180, 1]
type = ChangeState
trigger1 = anim != 3150 && !time
value = ifelse(random<400,181,ifelse(random<700,183,184))

[State 180, 1]
type = ChangeState
trigger1 = anim = 3150 && !time
value = 3160

;---------------------------------------------------------------------------
; Win pose 1 - Flota
[Statedef 181]
type = S
physics = N
ctrl = 0
anim = 180
velset = 0,0
sprpriority = 2

[State -3]
type = AfterImage
trigger1 = animelem = 2
time = -1
FrameGap = 1
length = 10
PalContrast = 200,0,0
PalBright = 0,0,0
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
paladd = 0,0,0

[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 150+(random/10),0+(random/3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 20,7
volume = -250
loop = 1
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 20,8
freqmul = 0.8

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, VelAdd]
type = VelAdd
trigger1 = numhelper(182)!=0
trigger1 = animelemtime(5) >= 0 && helper(182), anim = 30000
y = -.1

[State 0, VelAdd]
type = VelAdd
trigger1 = numhelper(182)!=0
trigger1 = helper(182),rootdist y < 0 && helper(182), anim = 30001
y = .2

[State 0, VelAdd]
type = VelAdd
trigger1 = numhelper(182)!=0
trigger1 = helper(182),rootdist y > 0 && helper(182), anim = 30001
y = -.2

[State 0, Helper]
type = Helper
trigger1 = !time
ID = 182
pos = 0,-60
stateno = 182

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

[State 182, 1]
type = AssertSpecial
trigger1 = time < 250
flag = roundnotover

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 5
time = -1
add = 0,-100,-100
mul = 256,256,256
sinadd = 40,40,40,30


;aura roja
[State 0, Explod]
type = Explod
trigger1 = animelem = 5
anim = 3102
pos = 10,0
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1
scale = 1.5,2

;---------------------------------------------------------------------------
; Winpose 1 - helper invisible (182)
[Statedef 182]
type = S
physics = N
anim = 30000

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = rootdist y < 0
value = 30001
persistent = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = parent, stateno = 194 && anim = 3150

;---------------------------------------------------------------------------
; Win pose 2 - cuello
[Statedef 183]
type = S
physics = S
ctrl = 0
anim = 183
velset = 0,0
sprpriority = 2

[State 182, 1]
type = AssertSpecial
trigger1 = time < 200
flag = roundnotover

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 12,1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 20,15
freqmul = 0.8
volume = -50

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 9
time = -1
add = 0,-100,-100
mul = 256,256,256
sinadd = 40,40,40,30
invertall = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 12
value = 20,7
freqmul = 0.6
volume = -70
loop = 1
abspan = -100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 12
value = 20,7
freqmul = 0.7
volume = -70
loop = 1
abspan = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 12
value = 20,4
freqmul = 0.6
abspan = -100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 12
value = 20,4
freqmul = 0.8
abspan = 100

;---------------------------------------------------------------------------
; Win pose 3 - mano
[Statedef 184]
type = S
physics = S
ctrl = 0
anim = 184
velset = 0,0
sprpriority = 2

[State 182, 1]
type = AssertSpecial
trigger1 = time < 350
flag = roundnotover

[State 182, 1]
type = AssertSpecial
trigger1 = animelemtime(6)>=1
trigger2 = anim = 185
flag = noshadow

[State 191, Snd 1]
type = PlaySnd
trigger1 = !time
value = 15,6
volume = 200

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 20,15
freqmul = 1.3
volume = -70

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 50
mul = 256,256,256
sinadd = -256,-256,-256,160

[State 0, afterimage]
type = AfterImage
trigger1 = anim = 184 && animelem = 6
time = -1
FrameGap = 1
length = 6
TimeGap = 2
PalColor = 0
Trans = sub
paladd = 0,0,0

[State 0, SprPriority]
type = SprPriority
trigger1 = anim = 184 && animelem = 6
trigger2 = anim = 185
value = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 184 && animelem = 6
value = 20,13
freqmul = 0.4+(random/5000.0)
volume = -50

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 200
value = 185

[State 0, afterimage]
type = AfterImage
trigger1 = anim = 185
time = -1
FrameGap = 1
length = 6
TimeGap = 2
PalColor = 0
Trans = sub
paladd = 0,0,0
persistent = 0

[State 0, PosSet]
type = PosSet
trigger1 = anim = 185
x = 0
y = (pos y-screenpos y)+260
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim = 185
y = -13
persistent = 0

;desaparece en 30 ticks
[State 23, trans]
type = Trans
trigger1 = anim = 185
trans = addalpha
alpha = 256-(random/9)

[State 0, VelSet]
type = VelSet
trigger1 = anim = 185 && animelem = 4
trigger2 = anim = 185 && animelem = 5
y = 0

[State 0, BGPalFX]
type = BGPalFX
trigger1 = anim = 185 && animelem = 4
time = -1
add = -100,-100,-100
color = 256

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 185 && animelem = 4
time = 4
ampl = -4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 185 && animelem = 4
value = 20,10
freqmul = 0.7+(random/5000.0)

[State 0, Explod]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 186
pos = -81,-13
facing = ifelse(random<500,1,-1)
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 186
pos = 9,-50
facing = ifelse(random<500,1,-1)
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 186
pos = 55,-64
facing = ifelse(random<500,1,-1)
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 186
pos = 98,-33
facing = ifelse(random<500,1,-1)
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 186
pos = 104,96
facing = ifelse(random<500,1,-1)
ontop = 1

;susto
[State 3900, 1]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 3204+(random/200)
pos = 0,0
postype = left
supermove = 1
bindtime = -1
ownpal = 1
ontop = 1
persistent = 0
removetime = 5

;textura terror
[State 3900, 1]
type = Explod
trigger1 = anim = 185 && animelem = 4
anim = 1104
pos = 0,0
postype = left
supermove = 1
bindtime = -1
ownpal = 1
ontop = 1
id = 3543
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim = 185 && animelemtime(4)=50
y = 10

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 185 && animelemtime(4)=50
value = 12,16

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 185 && animelemtime(4)=50
value = 10,3
freqmul = 0.7
volume = -70

[State 0, PosSet]
type = PosSet
trigger1 = anim = 185 && animelem = 5
y = 0

;---------------------------------------------------------------------------
; Intro state decider
[Statedef 191]
type = S

;intro full game
[State 180, 1]
type = ChangeState
trigger1 = P2name = "final" && matchno >= 7
trigger1=!(teammode=simul)&&!(enemy,teammode=simul)
value = 0

;intro vs himself
[State 180, 1]
type = ChangeState
trigger1 = P2name = "noroko"
trigger1 =!(teammode=simul)&&!(enemy,teammode=simul)
value = 196

[State 0, VarRandom]
type = VarRandom
trigger1 = !time
v = 19
range = 1,3

[State 180, 1]
type = ChangeState
trigger1 = !time && var(19) = 1
value = 192

[State 180, 1]
type = ChangeState
trigger1 = !time && var(19) = 2
value = 193

[State 180, 1]
type = ChangeState
trigger1 = !time && var(19) = 3
value = 194

;---------------------------------------------------------------------------
; Intro 1
[Statedef 192]
type = S
ctrl = 0
anim = 190
sprpriority = 1

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nobardisplay

[State 0, Explod]
type = Explod
trigger1 = !time
anim = 191
bindtime = 1
sprpriority = 2
ownpal = 1

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = time = 250
value = 5120

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = anim = 5120 && AnimTime = 0
value = 0

[State 191, Snd 1]
type = PlaySnd
trigger1 = time = 10
value = 15,3
volume = 200
channel = 16

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 130
value = 12,7
volume = 250
freqmul = 0.8
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 245
value = 12,0
channel = 0
freqmul = 1.3+(random/2500.0)
volume = 100

;---------------------------------------------------------------------------
; Intro 2
[Statedef 193]
type = S
physics = n
ctrl = 0
anim = 193
sprpriority = 1

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 193

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nobardisplay

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, PosSet]
type = PosSet
trigger1 = 1
y=ceil(pos y-screenpos y)+115

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 6
trigger3 = animelem = 10
value = 12,13
freqmul = 2.0+(random/3000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 13
value = 12,15
freqmul = 0.4+(random/5000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 13
value = 20,8
freqmul = 3.3+(random/5000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 13
value = 20,15
freqmul = 1.5+(random/5000.0)
volume = -120

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 20
value = 0,2
freqmul = 0.7+(random/5000.0)

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

;---------------------------------------------------------------------------
; Intro 3
[Statedef 194]
type = S
physics = n
ctrl = 0
anim = 3150
sprpriority = 1

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nobardisplay

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
x = 30

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = time = 20
value = 3163

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3163
value = 15,1
freqmul = 0.9+(random/3333.3)
persistent = 0
channel = 16

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3163
value = 12,0
freqmul = 0.9+(random/3333.3)
persistent = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, Helper]
type = Helper
trigger1 = !time
ID = 182
pos = 0,-60
stateno = 182

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2) >= 0 && helper(182), anim = 30000
trigger1 = anim = 3163
y = -.1

[State 0, VelAdd]
type = VelAdd
trigger1 = helper(182),rootdist y < 0 && helper(182), anim = 30001
trigger1 = anim = 3163
y = .2

[State 0, VelAdd]
type = VelAdd
trigger1 = helper(182),rootdist y > 0 && helper(182), anim = 30001
trigger1 = anim = 3163
y = -.2

[State 0, VelAdd]
type = VelAdd
trigger1 = time > 150 && anim = 3163
y = .2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time > 150 && pos y > -3 && anim != 3150
value = 3150
elem = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3150 && time > 150
value = 12,12
freqmul = 0.8+(random/3333.3)
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3150
y = 0

[State 0, posSet]
type = posSet
trigger1 = anim = 3150
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 230
value = 3101
ctrl = 0

;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority =0

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 0, Explod]
type = Explod
trigger1 = random <300
anim = 1221
pos = ceil(-40+(random/16.6)),0
vfacing = -1
accel = 0,-.5
removetime = 50
sprpriority = 0+(random/500)
shadow = -1
ownpal = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 60
add = 0,50,240
mul = 120,224,150
sinadd = 85,55,110,20
invertall = 0
color = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,13
volume = 100
channel = 0
freqmul = 0.4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = random<200
value = 10,ifelse((random<500),0,1)
freqmul = 0.8+(random/5000.0)

;---------------------------------------------------------------------------
; Introduction VS himself
[Statedef 196]
type = S
ctrl = 0
anim = 9123000
velset = 0,0
sprpriority = 1

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nobardisplay

[State 0, Helper]
type = Helper
trigger1 = !time && facing = 1
helpertype = normal ;player
name = "intro himself1"
ID = 196
stateno = 197
pos = 160,0
postype = left
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = time = 260 && facing = -1
helpertype = normal ;player
name = "intro himself1"
ID = 196
stateno = 197
pos = 160,0
postype = left
ownpal = 1
facing = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 363
value = 198

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = anim = 198 && AnimTime = 0
value = 0


;---------------------------------------------------------------------------
;Introduction VS himself HELPER 1
[Statedef 197]
type = S
ctrl = 0
anim = 0
velset = 0,0
sprpriority = 1

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = parent, facing = 1 && time = 180
time = 300
add = 0,0,0
mul = 256,256,256
sinadd = -256,-256,-256,250
invertall = 0
color = 256

[State 0, PlaySnd]
type = PlaySnd
trigger1 = parent, facing = 1 && time = 180
value = 20,15
freqmul = 0.9
volume = -70

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent, facing = 1 && time = 260
trigger2 = parent, facing = -1 && !time
value = 197

[State 0, Turn]
type = Turn
trigger1 = anim = 197 && animelem = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 197 && animelem = 3 && facing = -1
value = 20,7
volume = 200
channel = 16
freqmul = 0.8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 197 && animelem = 3 && facing = -1
value = 12,14
volume = 200
channel = 14
freqmul = 0.5

[State 0, VelSet]
type = VelSet
trigger1 = anim = 197 && animelem = 2
x = ((rootdist x)/100.0)

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = anim = 197 && animelem = 1
trigger2 = parent, facing = -1 && !time
time = 300
add = -256,-256,-256
mul = 256,256,256
invertall = 1
color = 0

[State 0, Explod]
type = Explod
trigger1 = parent, facing = -1 && !time
anim = 199
pos = 0,0
sprpriority = 5
ownpal = 1
facing = -1

[State 0, afterimage]
type = AfterImage
trigger1 = anim = 197 && animelem = 3
time = 100
FrameGap = 1
length = 8
TimeGap = 1
PalColor = 0
Trans = sub
paladd = 40,40,40

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 197 && animelem = 2
time = 100
freq = 60
ampl = -3

[State -2, StopSnd]
type = StopSnd
trigger1 = parent, facing = 1 && time = 363
trigger2 = parent, facing = -1 && time = 103
channel = 16

[State 0, DestroySelf]
type = DestroySelf
trigger1 = parent, facing = 1 && time = 363
trigger2 = parent, facing = -1 && time = 103

;---------------------------------------------------------------------------
; ENDING WALLPAPER
[Statedef 500]
type = S
ctrl = 0
velset = 0,0

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noBG
flag3 = noFG

[State 182, 1]
type = AssertSpecial
trigger1 = time < 800
flag = roundnotover

;WALLPAPER 06
[State 3900, 1]
type = Explod
trigger1 = !time && partner, name = "peketo"
anim = f 3006
pos = 0,0
postype = left
ownpal = 1
sprpriority = 6
removetime = -1

;PASS 06
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "peketo"
anim = f 3106
pos = 161,201
postype = left
ownpal = 1
sprpriority = 7
removetime = -1

;LETRA 06
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "peketo"
anim = f 3203
pos = 177,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 06
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "peketo"
anim = f 3213
pos = 186,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 06
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "peketo"
anim = f 3217
pos = 195,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 06
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "peketo"
anim = f 3227
pos = 204,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 06
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "peketo"
anim = f 3219
pos = 213,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;WALLPAPER 11
[State 3900, 1]
type = Explod
trigger1 = !time && partner, name = "ananzi"
anim = f 3011
pos = 0,0
postype = left
ownpal = 1
sprpriority = 6
removetime = -1

;PASS 11
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "ananzi"
anim = f 3111
pos = 161,201
postype = left
ownpal = 1
sprpriority = 7
removetime = -1

;LETRA 11
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "ananzi"
anim = f 3209
pos = 177,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 11
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "ananzi"
anim = f 3225
pos = 186,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 11
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "ananzi"
anim = f 3227
pos = 195,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 11
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "ananzi"
anim = f 3210
pos = 204,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;WALLPAPER 15
[State 3900, 1]
type = Explod
trigger1 = !time && partner, name = "animus"
anim = f 3015
pos = 0,0
postype = left
ownpal = 1
sprpriority = 6
removetime = -1

;PASS 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3115
pos = 161,201
postype = left
ownpal = 1
sprpriority = 7
removetime = -1

;LETRA 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3220
pos = 177,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3219
pos = 186,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3223
pos = 195,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3210
pos = 204,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3210
pos = 213,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 15
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "animus"
anim = f 3213
pos = 222,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;WALLPAPER 18
[State 3900, 1]
type = Explod
trigger1 = !time && partner, name = "shar-makai"
anim = f 3018
pos = 0,0
postype = left
ownpal = 1
sprpriority = 6
removetime = -1

;PASS 18
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "shar-makai"
anim = f 3118
pos = 161,201
postype = left
ownpal = 1
sprpriority = 7
removetime = -1

;LETRA 18
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "shar-makai"
anim = f 3225
pos = 177,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 18
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "shar-makai"
anim = f 3210
pos = 186,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 18
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "shar-makai"
anim = f 3207
pos = 195,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 18
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "shar-makai"
anim = f 3223
pos = 204,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 18
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "shar-makai"
anim = f 3214
pos = 213,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;WALLPAPER 20
[State 3900, 1]
type = Explod
trigger1 = !time && partner, name = "hashi"
anim = f 3020
pos = 0,0
postype = left
ownpal = 1
sprpriority = 6
removetime = -1

;PASS 20
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "hashi"
anim = f 3120
pos = 161,201
postype = left
ownpal = 1
sprpriority = 7
removetime = -1

;LETRA 20
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "hashi"
anim = f 3213
pos = 177,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 20
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "hashi"
anim = f 3214
pos = 186,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 20
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "hashi"
anim = f 3227
pos = 195,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;WALLPAPER 21
[State 3900, 1]
type = Explod
trigger1 = !time && partner, name = "noroko"
anim = f 3021
pos = 0,0
postype = left
ownpal = 1
sprpriority = 6
removetime = -1

;PASS 21
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "noroko"
anim = f 3121
pos = 161,201
postype = left
ownpal = 1
sprpriority = 7
removetime = -1

;LETRA 21
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "noroko"
anim = f 3203
pos = 177,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 21
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "noroko"
anim = f 3207
pos = 186,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 21
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "noroko"
anim = f 3210
pos = 195,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 21
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "noroko"
anim = f 3223
pos = 204,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;LETRA 21
[State 3900, 1]
type = Explod
trigger1 = time = 300 && partner, name = "noroko"
anim = f 3219
pos = 213,201
postype = left
ownpal = 1
sprpriority = 9
removetime = -1

;NEGRO IN
[State 3900, 1]
type = Explod
trigger1 = !time
anim = f 4510
pos = 0,0
postype = left
ownpal = 1
sprpriority = 7

;PELICULA VIEJA
[State 3900, 1]
type = Explod
trigger1 = !time
anim = f 4505
pos = 160,0
postype = left
ownpal = 1
sprpriority = 8
removetime = -1

;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 20                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 4, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -76               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 10             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1 = !Time
value = 7, 1
volume = -150
freqmul =0.9+(random/3333.0)

[State 200, 1]
type = PlaySnd
trigger1 = !Time
value = 0,0
freqmul =0.9+(random/3333.0)

;anti light attacks super combos
[State 0, VarAdd]
type = VarAdd
trigger1 = !time
var(25)=1

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 210

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (7) < 0)
value = 15,0

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3
freqmul = 0.9+(random/3333.3)
volume = -80

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 3 && random <500
value = 10,ifelse(random<500,6,7)
channel = 0
freqmul = 0.9+(random/3333.3)

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 8,8
sparkno = ifelse((enemynear,name = "noroko" && enemynear,var(10)=1),2,-1)
sparkxy = -10,-70
hitsound   = s 7,0
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -2,-6
air.velocity = -2.5,-4
fall = 1 
envshake.time = 8
envshake.ampl = 7
priority = 4, Hit

;sangre
[State 191]
type = Explod
trigger1 = movehit
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
trigger1 = !(enemynear,name = "animus" && enemynear,stateno = 3100)
anim = f 7009
postype = p1
pos = 75, -86
sprpriority = 3
ignorehitpause = 1
persistent = 0

;sangre
[State 191]
type = Explod
trigger1 = movehit
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
trigger1 = !(enemynear,name = "animus" && enemynear,stateno = 3100)
anim = f 7004
postype = p1
pos = 75, -86
sprpriority = 3
ignorehitpause = 1
persistent = 0

;sangre volatil
[State 0, Helper]
type = Helper
trigger1 = movehit && animelemtime(3)=1 && random < 100
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
trigger1 = !(enemynear,name = "animus" && enemynear,stateno = 3100)
name = "sangre volatil"
ID = 6101
stateno = 6101
pos = 75,-86
ownpal = 1
ignorehitpause = 1
persistent = 0

;sangre volatil
[State 0, Helper]
type = Helper
trigger1 = movehit && animelemtime(3)=1 && random < 100
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
trigger1 = !(enemynear,name = "animus" && enemynear,stateno = 3100)
name = "sangre volatil"
ID = 6101
stateno = 6101
pos = 75,-86
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(3)=1 && movecontact
value = 210
elem = 4
ignorehitpause = 1

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing light kick
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1
freqmul =0.9+(random/3333.0)

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 2 && random <500
value = 10,7
channel = 0
freqmul = 0.9+(random/3333.3)
volume = -100

[State 230, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 26
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-17
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -5
air.velocity = -2.5,-3.5
priority = 4, Hit

;anti light attacks super combos
[State 0, VarAdd]
type = VarAdd
trigger1 = !time
var(25)=1

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing strong kick
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

[State 240, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 2
freqmul =0.9+(random/3333.0)

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 3 && random <500
value = 10,ifelse(random<500,6,7)
channel = 0
freqmul = 0.9+(random/3333.3)

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 63
guardflag = MA
pausetime = 6,12
sparkno = 1
sparkxy = -10,-10
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2
envshake.time = 7
envshake.ampl = 5
priority = 4, Hit

[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light punch
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

[State 200, 1]
type = PlaySnd
trigger1 = !Time
value = 7, 1
volume = -150
freqmul =0.9+(random/3333.0)

[State 200, 1]
type = PlaySnd
trigger1 = !Time
value = 0,0
freqmul =0.9+(random/3333.0)

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
priority = 4, Hit
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkno = 0
sparkxy = -10,-42
hitsound   = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 10
ground.velocity = -4
air.velocity = -1.5,-3

;anti light attacks super combos
[State 0, VarAdd]
type = VarAdd
trigger1 = !time
var(25)=1

[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouching strong punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 2
freqmul =0.9+(random/3333.0)

[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 6,12
sparkno = ifelse((enemynear,name = "noroko" && enemynear,var(10)=1),1,-1)
sparkxy = -10,-55
hitsound   = -1,-1
guardsound = 6,0
ground.type = trip
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6,-2
air.velocity = -5,-1
envshake.time = 7
envshake.ampl = 5
priority = 4, Hit

[State 191]
type = Explod
trigger1 = movehit
trigger1 = animelemtime(3)=1
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
anim = f ifelse(random<500,7004,7005)
postype = p1
pos = 56, -45
sprpriority = 3
persistent = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = movehit
trigger1 = animelemtime(3)=1
value = 7,0
freqmul = 1.0+(random/3333.3)
ignorehitpause = 1
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(3)=1 && movecontact
value = 410
elem = 4
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(3)=1
var(13)=1

[State 0, MoveHitReset]
type = MoveHitReset
trigger1 = animelem = 4

[State 410, 2]
type = HitDef
trigger1 = animelem = 4
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 6,12
sparkno = ifelse((enemynear,name = "noroko" && enemynear,var(10)=1),1,ifelse(random<500,7004,7005))
sparkxy = -50,-40
hitsound   = -1,-1
guardsound = 6,0
ground.type = Trip
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = 6,-1
air.velocity = -5,-2
ignorehitpause = 1
persistent = 0
envshake.time = 7
envshake.ampl = 5
priority = 4, Hit

[State 0, PlaySnd]
type = PlaySnd
triggerall = movehit
trigger1 = animelemtime(4)=1
value = 7,0
freqmul = 1.0+(random/3333.3)
ignorehitpause = 1
persistent = 0

[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light kick
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2

[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1
freqmul = 0.9+(random/3333.3)

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 2 && random <500
value = 10,7
channel = 0
freqmul = 0.9+(random/3333.3)
volume = -100

[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 28
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = 0
sparkxy = -10,-8
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 20
priority = 4, Hit

;anti light attacks super combos
[State 0, VarAdd]
type = VarAdd
trigger1 = !time
var(25)=1

[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouch Strong Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 70
ctrl = 0
anim = 440
sprpriority = 2

[State 440, 2]
type = PlaySnd
trigger1 = Time = animelem = 3
value = 0, 2
freqmul = 0.9+(random/3333.3)

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 3 && random <500
value = 10,ifelse(random<500,6,7)
channel = 0
freqmul = 0.9+(random/3333.3)

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 72
hitflag = MAFD
guardflag = L
pausetime = 6,12
sparkno = 1
sparkxy = -5,-10
hitsound   = 5,2
guardsound = 6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1
envshake.time = 7
envshake.ampl = 5
priority = 4, Hit

[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Jump Light Punch
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 11
ctrl = 0
anim = 600
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0
freqmul = 0.9+(random/3333.3)

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 4, Hit
pausetime = 7,8
sparkno = 0
sparkxy = -10,-58
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -4
air.velocity = -1.3,-3

[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem = 6
value = 1

;anti light attacks super combos
[State 0, VarAdd]
type = VarAdd
trigger1 = !time
var(25)=1

;---------------------------------------------------------------------------
;Jump Strong Punch
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 610
sprpriority = 2

[State 610, 2]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 3
freqmul = 0.9+(random/3333.3)
volume = -80

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 4 && random <500
value = 10,ifelse(random<500,6,7)
channel = 0
freqmul = 0.9+(random/3333.3)

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 8,8
sparkno = ifelse((enemynear,name = "noroko" && enemynear,var(10)=1),2,-1)
sparkxy = -10,-20
hitsound   = -1,-1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -2,-6
air.velocity = -2.5,-4
fall = 1 
envshake.time = 8
envshake.ampl = 7
priority = 4, Hit

[State 191]
type = Explod
trigger1 = movehit
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
anim = f 7009
postype = p1
pos = 50, -36
sprpriority = 3
ignorehitpause = 1
persistent = 0

[State 191]
type = Explod
trigger1 = movehit
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
anim = f 7004
postype = p1
pos = 50, -36
sprpriority = 3
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 7,0
freqmul = 1.0+(random/3333.3)
persistent = 0
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelemtime(4)=1 && movecontact
value = 610
elem = 5
ignorehitpause = 1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem = 14
value = 1

;---------------------------------------------------------------------------
;Jump Light Kick
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1
freqmul = 0.9+(random/3333.3)

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 2  && random <500
value = 10,7
channel = 0
freqmul = 0.9+(random/3333.3)
volume = -100

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 26
guardflag = HA
priority = 4, Hit
pausetime = 8,8
sparkno = 1
sparkxy = -5,-35
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 6
ground.velocity = -4
air.velocity = -2,-3

[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem = 7
value = 1

;anti light attacks super combos
[State 0, VarAdd]
type = VarAdd
trigger1 = !time
var(25)=1

;---------------------------------------------------------------------------
;Jump Strong Kick
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 640
sprpriority = 2

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3
freqmul = 0.9+(random/3333.3)
volume = -80

[State 640, 2]
type = PlaySnd
trigger1 = animelem = 3
value = 10,ifelse(random<500,6,7)
channel = 0
freqmul = 0.9+(random/3333.3)

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4, Hit
pausetime = 8,8
sparkno = 2
sparkxy = -10,10
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,5
air.velocity = -8,12
fall = 1
envshake.time = 7
envshake.ampl = 7

[State 0, CtrlSet]
type = CtrlSet
trigger1 = animtime = 0
value = 1

;---------------------------------------------------------------------------
;Throw punch - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 850
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;throw punch p1
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State 810, Width 2-11]
type = Width
trigger1 = !time
edge = 60,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 1,1
freqmul = 1.1+(random/3333.3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 0,3
freqmul = 0.9+(random/3333.3)
volume = -100

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = 49,-77

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 2
pos = 22,-93

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 3
pos = 8,-104

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 4
pos = -7,-100

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 5
pos = -9,-99

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 7
pos = 3,-99

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 8
pos = 10,-99
time = 3

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 9
value = -150

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 9
value = 12,13
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 9
value = 7,0
freqmul = 0.7+(random/3333)

;cara negra
[State 0, Helper]
type = Helper
trigger1 = animelemtime(6) = 10
helpertype = normal
name = "cara"
ID = 815
pos = -1,0
postype = p1
stateno = 815
ownpal = 1
bindtime = -1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 9
time = 25
ampl = -4

[State 191]
type = Explod
trigger1 = animelem = 9
anim = f 7009
postype = p1
pos = 77, -80
sprpriority = 3

[State 34, BGPalFX]
type = BGPalFX
trigger1 = animelem = 9
time = 2
add = 50,-50,-50
;color = 0
ignorehitpause = 1

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-----------------------------------------------------
;Throw punch - cara negra
[Statedef 815]
type    = S
movetype= A
physics = N
anim = 815
poweradd = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
trigger2 = animelem = 6
value = 12,11
freqmul = 1.4+(random/1500.0)

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
time = -1

[State 0, SprPriority]
type = SprPriority
trigger1 = !time
value = 3

;aparece en 20 ticks
[State 23, trans]
type = Trans
trigger1 = anim = 815 && animelemtime(1) >= 0
trans = addalpha
alpha=ceil(12.8*(animelemtime(1))),ceil(256-12.8*animelemtime(1))

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = root, animelemtime(7) >=0 && root, animelemtime(8) <=2
flag = invisible

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root, animelem = 9
value = 816

;desaparece en 20 ticks
[State 23, trans]
type = Trans
trigger1 = anim = 816 && animelemtime(6) >= 0
trans = addalpha
alpha=ceil(256-12.8*(animelemtime(6))),ceil(0+12.8*animelemtime(6))

[State 0, DestroySelf]
type = DestroySelf
trigger1 = anim = 816 && animelemtime(6) >=21

;---------------------------------------------------------------------------
;throw punch - p2
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
movecamera = 1,0

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6280

[State 820, 1]
type = ChangeAnim2
Trigger1 = !time && anim != 6280
value = 820

[State 820, 1]
type = Changestate
Trigger1 = time = 65
value = 821
ctrl = 0

;---------------------------------------------------------------------------
;throw punch - p2 2
[Statedef 821]
type    = A
movetype= H
physics = N
velset = -5,-4
poweradd = 40

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = (anim = 6280)||(anim = 6282)
value = ifelse(prevstateno=870,6286,6281)

[State 820, 1]
type = ChangeAnim2
Trigger1 = anim !=6281 && anim !=6286 && !time
value = ifelse(prevstateno=870,871,821)

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
trigger1 = !time
trigger1 = life >= 151
trigger1 = (anim = 821)||(anim = 871)
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,20)
freqmul = 0.9+(random/3333.3)

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
movecamera = 1,0
value = 1

[State 0, PosSet]
type = PosSet
trigger1 = !time
y = ifelse(prevstateno = 820,-10,10)

[State 0, PosSet]
type = Posadd
trigger1 = !time && prevstateno = 820
x = -45

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .32

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground

;---------------------------------------------------------------------------
;Throw kick - Attempt
[Statedef 850]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 850
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 860       ;On success, KFM changes to state 810
p2stateno = 870       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;throw kick p1
[Statedef 860]
type    = S
movetype= A
physics = N
anim = 860
poweradd = 60

[State 810, Width 2-11]
type = Width
trigger1 = !time
edge = 60,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 1,1
freqmul = 1.1+(random/3333.3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,11
freqmul = 0.7+(random/5000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,11
freqmul = 0.9+(random/5000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 20,12
freqmul = 0.7
volume = -60

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = 49,0

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 45
ampl = -3

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 50
mul = 256,256,256
sinadd = -256,-256,-256,160

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 50
time = 110
add = 40,40,40
mul = 256,256,256
sinadd = -80,-80,-80,12
color = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem =2
value = 12,14
freqmul = 0.7

;sube
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 18
trigger3 = animelem = 34
value = 12,0
freqmul = 1.3+(random/5000.0)
volume = -70

;baja
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 14
trigger2 = animelem = 29
trigger3 = animelem = 44
value = 12,6
freqmul = 0.6+(random/5000.0)
volume = -50

[State 0, PlaySnd]
type = playsnd
trigger1 = animelemtime(17)=5
trigger2 = animelemtime(33)=3
trigger3 = animelemtime(48)=4
value = f 5,3
volume = -50
freqmul = 0.9+(random/2500.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(17)=5
trigger2 = animelemtime(33)=3
trigger3 = animelemtime(48)=4
value = 20,16
freqmul = 1.2+(random/2500.0)

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = animelemtime(17)=5
trigger2 = animelemtime(33)=3
value = -50
kill = 0

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = animelemtime(48)=4
value = -50

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;throw kick - p2
[Statedef 870]
type    = S
movetype= H
physics = N
velset = 0,0

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6282

[State 820, 1]
type = ChangeAnim2
Trigger1 = !time && anim != 6282
value = 870

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 44
mul = 256,256,256
sinadd = -256,-256,-256,160

[State 23, trans]
type = Trans
trigger1 = animelemtime(1) >= 45
trigger1 = animelemtime(10) <0
trans = addalpha
alpha=125,131

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelemtime(1)= 44
time = 116
add = -256,-256,-256
mul = 256,256,256
invertall = 1
color = 0

[State 0, afterimage]
type = AfterImage
trigger1 = animelemtime(1)= 45
time = -1
FrameGap = 1
length = 6
TimeGap = 2
PalColor = 0
Trans = sub
paladd = 0,0,0

;se aleja
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
x = - 6
y = -5

;se detiene
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 3
trigger2 = animelem = 4
trigger3 = animelem = 6
trigger4 = animelem = 7
trigger5 = animelem = 9
trigger6 = animelem = 10
x = 0
y = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>=1 && animelemtime(4)<0
trigger2 = animelemtime(6)>=1 && animelemtime(7)<0
trigger3 = animelemtime(9)>=1 && animelemtime(10)<0
y = .7

[State 0, posset]
type = posset
trigger1 = animelem = 4
trigger2 = animelem = 7
y = 30

[State 0, posset]
type = posset
trigger1 = animelem = 10
y = 0

;sube despues de porrazo
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 5
trigger2 = animelem = 8
y = -9

[State 0, AfterImage]
type = AfterImagetime
trigger1 = animelem = 10
time = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 4
trigger2 = animelem = 7
trigger3 = animelem = 10
time = 6
ampl = -6

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
triggerall = random < 700
triggerall = anim = 870
trigger1 = animelem = 4
trigger2 = animelem = 7
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,20)
freqmul = 0.9+(random/3333.3)

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
triggerall = random < 700
triggerall = anim = 870
trigger1 = life >= 51
trigger1 = animelem = 10
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,20)
freqmul = 0.9+(random/3333.3)

[State 0, Explod]
type = Explod
trigger1 = animelem = 4
trigger2 = animelem = 7
trigger3 = animelem = 10
anim = f 61
pos = 0, ifelse((animelem=10),0,-30)

;para que hashi siga dejando estela en df
[State 0, afterimage]
type = AfterImage
trigger1 = animtime = 0
trigger1 = name = "hashi" && var(10)=1
time = -1
FrameGap = 1
length = 8
TimeGap = 2
paladd = -30,10,-30
PalContrast = 0,200,0
PalBright = -180,0,-180
palmul = .65,.65,.65
Trans = add
persistent = 0

[State 820, 1]
type = Changestate
Trigger1 = animtime = 0
value = 821
ctrl = 0

;---------------------------------------------------------------------------
; Suicidio debil
[Statedef 1000]
type    = S
movetype= I
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 10,4
volume = 200
freqmul = 1.1+(random/2000.0)

[State 0, Width]
type = Width
trigger1 = animelem = 7
player = 35,0

[State 0, Helper]
type = Helper
trigger1 = animelem = 7
helpertype = normal
name = "sangre"
pos = 44,-63
postype = p1
stateno = 1001
ownpal = 1
id = 1001

[State 191]
type = Explod
trigger1 = animelem = 3
anim = f ifelse(random<500,7004,7005)
postype = p1
pos = 1, -52
sprpriority = 3
scale = 0.5,0.5
facing = ifelse(random<500,-1,1)

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Suicidio fuerte
[Statedef 1010]
type    = S
movetype= I
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 10,4
volume = 200
freqmul = 1.1+(random/2000.0)

[State 0, Width]
type = Width
trigger1 = animelem = 7
player = 35,0

[State 0, Helper]
type = Helper
trigger1 = animelem = 7
helpertype = normal
name = "sangre"
pos = 44,-63
postype = p1
stateno = 1001
ownpal = 1
id = 1001

[State 191]
type = Explod
trigger1 = animelem = 3
anim = f ifelse(random<500,7004,7005)
postype = p1
pos = 1, -52
sprpriority = 3
scale = 0.5,0.5
facing = ifelse(random<500,-1,1)

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Sangre suicidio
[Statedef 1001]
type    = S
movetype= A
physics = N
juggle  = 2
poweradd= 0
velset = 0,0
anim = 1001
ctrl = 0
sprpriority = 1

[State 0, afterimage]
type = AfterImage
trigger1 = !time
time = 70
FrameGap = 0
length = 35
TimeGap = 0
paladd = 0,0,0
PalContrast = 50,50,50
PalBright = 50,50,50
palmul = .65,.65,.65
Trans = add

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelem = 32
time = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 10,2
volume = 100
freqmul = 1.1+(random/2000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 0,3
volume = -150
freqmul = 1.3+(random/2000.0)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, BindToRoot]
type = BindToRoot
trigger1 = parent, stateno = 1000 && animelemtime(21)<0
time = 1
pos = 44,-63

[State 0, HitDef]
type = HitDef
trigger1 = 1
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = hard
damage = ifelse(parent,stateno=1000,70,120),7
pausetime = 5,10
sparkno = 7008
sparkxy = -10,0
ground.type = High
air.type = High
ground.velocity = ifelse(parent,stateno=1000,-3,-6),-4
air.velocity = ifelse(parent,stateno=1000,-3,-6),-4
airguard.velocity = -2,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall = 1
palfx.time = 50
palfx.add = 0,-100,-100
persistent = 0
hitsound = S10,3
priority = 4, Hit
envshake.time = 7

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 7,0
volume = -100
freqmul = 0.6+(random/2000.0)
persistent = 0
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

;---------------------------------------------------------------------------
; Llanto de Okiku FUERTE
[Statedef 1100]
type    = S
movetype= I
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 15,5
channel = 16
freqmul = 0.9+(random/5000.0)

[State 0, StopSnd]
type = StopSnd
trigger1 = animelem = 10
channel = 16

[State 0, ReversalDef]
type = ReversalDef
trigger1 = 1
reversal.attr = SAC, NA,SA
p1stateno = 1101
sparkno = -1
pausetime = 15,15

[State 800, Don't Guard]
type=attackdist
trigger1= 1
value=0

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Llanto de Okiku DEBIL
[Statedef 1102]
type    = S
movetype= I
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 15,5
channel = 16
freqmul = 0.9+(random/5000.0)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animelem = 7
value = 1100
elem = 10

[State 0, StopSnd]
type = StopSnd
trigger1 = animelem = 10
channel = 16

[State 0, ReversalDef]
type = ReversalDef
trigger1 = 1
reversal.attr = SAC, NA,SA
p1stateno = 1101
sparkno = -1
pausetime = 15,15

[State 800, Don't Guard]
type=attackdist
trigger1= 1
value=0

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;--------------------------------------
; Llanto de Okiku - reaccion
[Statedef 1101]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1101

[State 0, Turn]
type = Turn
trigger1 = !time
trigger1 = enemynear, facing = facing

[State 0, StopSnd]
type = StopSnd
trigger1 = !time
channel = 16

[State 191, Snd 1]
type = PlaySnd
trigger1 = !time
value = 20,4
volume = 70
freqmul =1.1+(random/5000.0)

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 21
add = 0,-150,-150
mul = 256,256,256
sinadd = 40,80,40,10
invertall = 0
color = 0

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
animtype  = heavy
damage    = 107
guardflag = MA
pausetime = 0,0
sparkno = -1
sparkxy = 10,-86
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -10,-3
air.velocity = -10,-3
fall = 1
priority = 4, Hit

[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 1102
removetime = 20
sprpriority = -1
ownpal = 1
ignorehitpause = 1
ID = 1102
pos = 0,-10
bindtime = -1

;textura
[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 1103
removetime = 20
ontop = 1
ownpal = 1
ignorehitpause = 1
postype = left
;pos = 0,-10
bindtime = -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem = 10
ID = 1102

[State 0, BGPalFX]
type = BGPalFX
trigger1 = time = 3
time = 21
add = -100,-100,-100
ignorehitpause = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 2
time = 21

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Mujer de nieve - sube
[Statedef 1200]
type    = A
movetype= A
physics = N
juggle  = 1
poweradd= 110
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,0
channel = 0
freqmul = 1.3+(random/2500.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 0,3
freqmul = 0.9+(random/5000.0)

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 1,0

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
y = -3

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2) >=0
y = -.2

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 7,7
sparkno = 1
sparkxy = -10,-30
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -1.5,-9
air.velocity = -1.5,-8
fall = 1
envshake.time = 5
envshake.ampl = 8
fall.recover = 0
priority = 4, Hit

[State 0, ChangeState]
type = ChangeState
trigger1 = ScreenPos Y <= 60
value = 1210
ctrl = 0

;---------------------------------------------------------------------------
; Mujer de nieve - techo - quieto
[Statedef 1210]
type    = A
physics = N
juggle  = 4
poweradd= 0
velset = 0,0
anim = 1210
ctrl = 0
sprpriority = 2

;var de ataque atras
[State 0, VarSet]
type = VarSet
trigger1 = !time
var(21)=0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,1
freqmul = 1.0+(random/5000.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,2
volume = -256
channel = 13
freqmul = 0.9+(random/3333.3)
loop = 1

;paneo de respiracion
[State 0, SndPan]
type = SndPan
trigger1 = 1
channel = 13
pan = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 5
ampl = -3

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

;correcion de posicion
;--------- -- --------
[State 0, PosSet]
type = Posadd
trigger1 = ScreenPos Y <= 59
y = 1

[State 0, PosSet]
type = Posadd
trigger1 = ScreenPos Y <= 58
y = 2

[State 0, PosSet]
type = Posadd
trigger1 = ScreenPos Y <= 57
y = 3

[State 0, PosSet]
type = Posadd
trigger1 = ScreenPos Y >= 61
y = -1

[State 0, PosSet]
type = Posadd
trigger1 = ScreenPos Y >= 62
y = -2

[State 0, PosSet]
type = Posadd
trigger1 = ScreenPos Y >= 63
y = -3

;movimiento horizontal
;---------- ----------
[State 0, VelSet]
type = VelSet
trigger1 = command = "holdfwd"
x = 1.8

[State 0, VelSet]
type = VelSet
trigger1 = command = "holdback"
x = -1.8

[State 0, VelSet]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
x = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim!=1211
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
value = 1211

[State 0, ChangeAnim]
type = ChangeAnim
trigger1= anim!=1210
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
value = 1210

;comandos
;--------

;abajo human
[State 0, ChangeState]
type = ChangeState
triggerall = var(24)=0
trigger1 = command = "holddown"
trigger2 = roundstate = 3
value = 1211
ctrl = 1

;baja por tiempo
[State 0, ChangeState]
type = ChangeState
trigger1 = time = 250
value = 1211
ctrl = 1

;abajo AI
[State 0, ChangeState]
type = ChangeState
trigger1 = var(24)!=0 && random < 10 && p2statetype = s
trigger1 = p2dist x <= 90 && p2dist x >= -90
trigger2 = roundstate = 3
value = 1211
ctrl = 1

;var de ataque atras HUMAN
[State 0, VarSet]
type = VarSet
trigger1 = command = "y"
trigger1 = facing = -1
trigger2 = command = "b"
trigger2 = facing = -1
trigger3 = command = "x"
trigger3 = facing = 1
trigger4 = command = "a"
trigger4 = facing = 1
var(21)=1

;ataca HUMAN
[State 0, ChangeState]
type = ChangeState
triggerall = var(24)<=1
trigger1 = command = "y"
trigger2 = command = "b"
trigger3 = command = "x"
trigger4 = command = "a"
value = 1215
ctrl = 0

;ataca AI
[State 0, ChangeState]
type = ChangeState
triggerall = var(24)>=2
triggerall = (p2statetype!=L)
trigger1 = p2dist x >= 90 && p2dist x <= 200 && random < 50
trigger2 = p2dist x <= -90 && p2dist x >= -200 && random < 50
;combo
trigger3 = enemynear, pos y <- 70 && enemynear, pos y >- 210 && enemynear, movetype = h
;enemigo saltando
trigger4 = p2dist x <= 90 && p2dist x >= -90 && enemynear, pos y <- 40 && enemynear, pos y >- 210 && random < 50
value = 1215
ctrl = 0

;-------
;gota de agua
[State 0, Helper]
type = Helper
trigger1 = random >= 700
trigger1 = time % 2 = 0
trigger1 = numhelper(1220) <= 15
name = "gota de agua"
ID = 1220
pos = ceil(-47+(random/10.6)),-56
stateno = 1220
ownpal = 1
size.shadowoffset = 4

;---------------------------------------------------------------------------
;Mujer de nieve - cae
[Statedef 1211]
type    = A
physics = n
anim = 1212
sprpriority = 1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .26

[State 0, PosSet]
type = PosSet
trigger1 = pos y >0
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = pos y = 0
value = 40,0

[State 0, ChangeState]
type = ChangeState
trigger1 = pos y = 0
value = 0

;---------------------------------------------------------------------------
;Mujer de nieve - ataca
[Statedef 1215]
type    = A
movetype = A
physics = N
anim = 1215
juggle = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =  random<300
flag = invisible
ignorehitpause = 1

;turn HUMAN
[State 0, Turn]
type = Turn
trigger1 = !time && var(21)=1 && var(24)=0 && prevstateno != 3300

;turn AI
[State 0, Turn]
type = Turn
trigger1 = var(24)>=2 && p2dist x < 0 && !time && prevstateno != 3300

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,10
volume = -56
freqmul = 1.0+(random/5000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 0,3
freqmul = 0.9+(random/5000.0)

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = 9
y = 8

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 23, trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha= 200,56

[State 0, AfterImage]
type = AfterImage
trigger1 = !time
time = 6
length = 10
palcolor = 0
trans = add
palbright = -60,-60,-30
framegap = 1

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = !time
time = 16

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 25
add = 0,50,240
mul = 120,224,150
sinadd = 85,55,110,10
invertall = 0
color = 0

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = ifelse(prevstateno=3300,15,80),7
guardflag = HA
priority = 4, Hit
pausetime = 5,5
guard.pausetime = 7,3
sparkno = ifelse((enemynear,name = "noroko" && enemynear,var(10)=1),2,-1)
sparkxy = -10,10
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -13,2
air.velocity = -8,5
fall = 1
envshake.time = 6
envshake.ampl = 10
fall.envshake.time = 5
fall.recovertime = 10

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 7,0
freqmul = 0.7+(random/3333)
persistent = 0
ignorehitpause = 1

[State 0, AllPalFX]
type = AllPalFX
trigger1 = movehit
time = 3
add = 0,0,250
mul = 156,156,256
ignorehitpause = 1
persistent = 0

[State 191]
type = Explod
trigger1 = movehit
trigger1 = !(enemynear,name = "noroko" && enemynear,var(10)=1)
anim = f 7008
postype = p1
pos = 40, 30
sprpriority = 3
ignorehitpause = 1
persistent = 0
ownpal = 1

[State 700, 10]
type = changestate
trigger1 = pos Y >= -1 && vel y > 0
value = 1212
ctrl = 0

;gota de agua
[State 0, Helper]
type = Helper
trigger1 = random >= 600 && prevstateno != 3300
trigger1 = time % 2 = 0
name = "gota de agua"
ID = 1220
pos = ceil(-27+(random/18.6)),ceil(-10-(random/50.0))
stateno = 1220
ownpal = 1
size.shadowoffset = 4

;---------------------------------------------------------------------------
;Mujer de nieve - aterriza
[Statedef 1212]
type    = S
physics = S
anim = 1216

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

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

;ondita
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 61
sprpriority = 0
ownpal = 1
pos = 0,0

[State 0, MakeDust]
type = MakeDust
trigger1 = !time
pos = 0,0
spacing = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 6

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 1,1
freqmul = 0.7
volume = 100

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,0
mul = 256,256,256
sinadd = 0,0,0,1

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

;---------------------------------------------------------------------------
;Mujer de nieve - gota de agua (helper)
[Statedef 1220]
type    = S
movetype= I
physics = N
sprpriority = 5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root, stateno = 1210 && !time
value = 1220

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 1220 && animtime = 0
trigger2 = root, stateno = 1215 || root, stateno = 1216
trigger2 = !time
value = 1221

[State 0, Velset]
type = Velset
trigger1 = root, stateno = 1215 && !time
x = -2-(random/250.0)
y = -2+(random/200.0)

[State 0, VelAdd]
type = Velset
trigger1 = root, stateno = 1216 && !time
x = 2+(random/250.0)
y = -2+(random/200.0)

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 1221
y = 0.4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 1221 && pos y >= -5
value = 1222

[State 0, VelSet]
type = VelSet
trigger1 = anim = 1222 || anim = 1223
y = 0
x = 0

[State 0, VelSet]
type = posSet
trigger1 = anim = 1222 && animelem = 1
y = 4+(random/166.6)

[State 0, SprPriority]
type = SprPriority
trigger1 = anim = 1222 && pos y > 0
value = -1

[State 0, Explod]
type = Explod
trigger1 = random >500
trigger1 = anim = 1222 && animelem = 1
anim = 1224
vel = -2+(random/250.0),-2-(random/1000.0)
accel = 0,0.3
removetime = 40

[State 0, Explod]
type = Explod
trigger1 = random >500
trigger1 = anim = 1222 && animelem = 1
anim = 1224
vel = -2+(random/250.0),-2-(random/1000.0)
accel = 0,0.3
removetime = 40

[State 0, PlaySnd]
type = PlaySnd
trigger1 = (anim = 1222|| anim = 1223)
value = 10,(ifelse(random<500,0,1))
freqmul = 0.6+(random/333.0)
persistent = 0

;desaparece en 30 ticks
[State 23, trans]
type = Trans
trigger1 = anim = 1222 && animelemtime(3) >= 30
trans = addalpha
alpha=ceil(256-8.53*(animelemtime(3)-30)),ceil(0+8.53*animelemtime(3)-30)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = anim = 1222 && animelemtime(3) >=60
trigger2 = anim = 1223 && animtime = 0

[State 220, 3]
type = DestroySelf
trigger1 = FrontEdgeBodyDist <= -10 || backedgedist <= -10

;pega en cabeza - STAND
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = anim = 1221
trigger1 = enemynear, statetype = S
trigger1 = pos y>=(enemynear,const(size.head.pos.y)-20)
trigger1 = p2dist x=[-enemynear,const(size.ground.back),enemynear,const(size.ground.front)]
value = 1223

;pega en cabeza - CROUCH
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 1221
trigger1 = enemynear, statetype = C
trigger1 = pos y>=(enemynear,const(size.head.pos.y)/1.5)
trigger1 = p2dist x=[-enemynear,const(size.ground.back),enemynear,const(size.ground.front)]
value = 1223

[State 0, VelSet]
type = posadd
trigger1 = anim = 1223 && animelem = 1
y = 4+(random/166.6)

;---------------------------------------------------------------------------
; Kwaidan debil
[Statedef 1300]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= 110
velset = 0,0
anim = 1300
ctrl = 0
sprpriority = 2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(7)>=0 && animelemtime(14)<0 && random<300
flag = invisible
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 12,14
volume = -50
channel = 0
freqmul = 1.0+(random/5000.0)

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(4)>=1 && animelemtime(13) <=1
x = 1.3

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 5
time = 15
add = 50,-100,-100
mul = 250,224,120
sinadd = 50,55,55,20
color = 0

[State 0, afterimage]
type = AfterImage
trigger1 = animelem = 8
time = 13
FrameGap = 1
length = 10
PalContrast = 200,0,0
PalBright = 100,-80,-180
TimeGap = 1
PalColor = 0
Trans = add
persistent = 0
paladd = 50,0,0

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelem = 14
time = 0

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S, NA
animtype  = Medium
damage    = 0
guardflag = MA
pausetime = 0,6
sparkno = 300
guard.sparkno = 40
sparkxy = 10,-86
hitsound   = 325,2
guardsound = 6,0
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0,-1
air.velocity = 0,-1
fall = 1
envshake.time = 6
numhits = 0
snap = 60
givepower = 0
guard.velocity = -4
airguard.velocity = -4
fall.animtype = Medium
ground.type = Low
priority = 4, Hit

[State 0, AllPalFX]
type = BGPalFX
trigger1 = movehit
time = 2
add = 150,-50,-50
mul = 156,56,56
ignorehitpause = 1
persistent = 0

[State 220, 3]
type = changestate
value = 1301
trigger1 = Movehit

[State 220, 3]
type = changestate
value = 1303
trigger1 = Moveguarded

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

;---------------------------------------------------------------------------
; Kwaidan fuerte
[Statedef 1310]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= 110
velset = 0,0
anim = 1310
ctrl = 0
sprpriority = 2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(7)>=0 && animelemtime(14)<0 && random<300
flag = invisible
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = 12,14
volume = -50
channel = 0
freqmul = 1.0+(random/5000.0)

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(6)>=1 && animelemtime(13) <=1
x = 1.8

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 5
time = 15
add = 50,-100,-100
mul = 250,224,120
sinadd = 50,55,55,20
color = 0

[State 0, afterimage]
type = AfterImage
trigger1 = animelem = 8
time = 13
FrameGap = 1
length = 10
PalContrast = 200,0,0
PalBright = 100,-80,-180
TimeGap = 1
PalColor = 0
Trans = add
persistent = 0
paladd = 50,0,0

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelem = 14
time = 0

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S, NA
animtype  = Medium
damage    = 0
guardflag = MA
pausetime = 0,6
sparkno = 300
guard.sparkno = 40
sparkxy = 10,-86
hitsound   = 325,2
guardsound = 6,0
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0,-1
air.velocity = 0,-1
fall = 1
envshake.time = 6
numhits = 0
snap = 60
givepower = 0
guard.velocity = -4
airguard.velocity = -4
fall.animtype = Medium
ground.type = Low
priority = 4, Hit

[State 0, AllPalFX]
type = BGPalFX
trigger1 = movehit
time = 2
add = 150,-50,-50
mul = 156,56,56
ignorehitpause = 1
persistent = 0

[State 220, 3]
type = changestate
value = 1301
trigger1 = Movehit

[State 220, 3]
type = changestate
value = 1303
trigger1 = Moveguarded

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

;---------------------------------------------------------------------------
; kwaidan 2 - lanza fantasma
[Statedef 1301]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 100
velset = 0,0
anim = 1301
ctrl = 0
sprpriority = 1

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = !time
time = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = !time && frontedgedist >= 50
x = 50

[State 0, Helper]
type = Helper
trigger1 = animelem = 2
pos = 18,-78
stateno = 1302
ownpal = 1
id = 1300

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = prevstateno = 1310 && time = 18
value = 1301
elem = 3

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

;---------------------------------------------------------------------------
; kwaidan - fantasma - helper
[Statedef 1302]
type    = S
movetype= A
physics = N
juggle  = 6
poweradd= 0
velset = 0,-7
anim = 1302
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,9
volume = 100
freqmul = 0.9+(random/5000.0)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = random<500
flag = invisible
ignorehitpause = 1

[State 0, afterimage]
type = AfterImage
trigger1 = !time
time = 30
FrameGap = 1
PalContrast = 200,0,0
PalBright = 0,-80,-180
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
palmul = .65,.65,.65

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S, SP
animtype  = up
damage    = ifelse(parent,prevstateno=1300,60,85)
guardflag = MA
pausetime = 0,0
sparkno = 300
sparkxy = 34214321,321321;10,-86
hitsound   = 325,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -2,ifelse(parent,prevstateno=1300,-7,-10)
air.velocity =  -2,ifelse(parent,prevstateno=1300,-7,-10)
fall = 1
envshake.time = 6
palfx.add = 50,-50,-50
palfx.time = 40
givepower = 0
fall.recover = 0
priority = 4, Hit

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 60

;---------------------------------------------------------------------------
; kwaidan guarded
[Statedef 1303]
type    = A
movetype= I
physics = A
juggle  = 0
poweradd= 0
velset = -3,-3
anim = 43
ctrl = 0
sprpriority = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
x = 30

;---------------------------------------------------------------------------
; Mascara de Emma-O (hyper)
[Statedef 3000]
type    = S
movetype= I
physics = S
juggle  = 4
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2

[State 3000, Width]
type = Width
trigger1 = AnimElem = 5
value = 40,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 10,5
freqmul = 1.1

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 2
pos = 25, -57
anim = -1
poweradd = -1000
time = 30
movetime = 30

[State 3900, 1]
type = Explod
trigger1 = AnimElem = 2
anim = 4000
pos = 0,0
postype = left
supermove = 1
facing = 1
bindtime = 30
sprpriority = -2
removetime = 30
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 5
anim = 1102
removetime = 98
sprpriority = -1
ownpal = 1
ignorehitpause = 1
ID = 1102
pos = 0,-10
bindtime = -1
removeongethit = 1

[State 0, BGPalFX]
type = BGPalFX
trigger1 = time = 32
time = 98
add = -100,-100,-100
ignorehitpause = 1

;Helper invisible
[State 0, Helper]
type = Helper
trigger1 = animelem = 3
helpertype = normal
name = "helper"
pos = 0,0
postype = p1
stateno = 3002

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 12,4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 40,0
volume = 200

[State 0, Helper]
type = Helper
trigger1 = animelem = 5
trigger2 = animelem = 9
trigger3 = animelem = 13
trigger4 = animelem = 17
trigger5 = animelem = 21
trigger6 = animelem = 25
trigger7 = animelem = 29
trigger8 = animelem = 33
helpertype = normal
name = "fantasma"
pos = 46,-79
postype = p1
stateno = 3001
ownpal = 1
ID = 3000

[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Emma-O fantasma
[Statedef 3001]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 0
anim = 3001
ctrl = 0
sprpriority = 3

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = random<300
flag = invisible
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 2
range = 1,4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(2) = 1
value = 3001

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(2) = 2
value = 3002

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(2) = 3
value = 3003

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = var(2) = 4
value = 3004

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;vel Emma-O
[State 0, VelAdd]
type = Velset
trigger1 = (ishelper(3000)||ishelper(3171)) && !time
y = 2.5-(random/200.0)

;vel posesion - cara normal
[State 0, VelAdd]
type = Velset
trigger1 = ishelper(3170) && !time
y = 1-(random/180.0)

;vel posesion - cara super
[State 0, VelAdd]
type = Velset
trigger1 = ishelper(3173) && !time
y = -3+(random/200.0)

[State 0, VelAdd]
type = VelAdd
trigger1 = vel y < 0
y = .1

[State 0, VelAdd]
type = VelAdd
trigger1 = vel y > 0
y = -.1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
x = .03+(random/2000.0)

;afterimage Emma-O
[State 0, afterimage]
type = AfterImage
trigger1 = ishelper(3000) && !time
time = 30
FrameGap = 2
length = 30
PalContrast = 0,0,200
PalBright = -80,-80,0
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
paladd = -50,-50,0

;afterimage posesion
[State 0, afterimage]
type = AfterImage
trigger1 = (ishelper(3170)||ishelper(3171)||ishelper(3173)) && !time
time = 30
FrameGap = 2
length = 30
PalContrast = 100,0,0
PalBright = 0,-80,-80
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
paladd = 10,-50,-50

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = 1
time = -1

;Emma-O
[State 0, HitDef]
type = HitDef
trigger1 = ishelper(3000)
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = hard
damage = 30,5
pausetime = 0,10
sparkno = -1
sparkxy = 0,0
ground.type = High
air.type = High
ground.velocity = -3,-3.5
air.velocity = -3,-3.5
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall = 1
palfx.time = 6
palfx.add = 150,150,150
persistent = 0
envshake.time = 5
envshake.freq = 60
envshake.ampl = -8
getpower = 0
priority = 4, Hit

;posesion normal
[State 0, HitDef]
type = HitDef
trigger1 = ishelper(3170)
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = hard
damage = 75,5
pausetime = 5,10
sparkno = -1
sparkxy = 0,0
ground.type = High
air.type = High
ground.velocity = -6,-6
air.velocity = -6,-6
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall = 1
palfx.time = 6
palfx.add = 150,150,150
persistent = 0
envshake.time = 5
envshake.freq = 60
envshake.ampl = -8
getpower = 0
priority = 4, Hit

;posesion super
[State 0, HitDef]
type = HitDef
trigger1 = ishelper(3173) && !time
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = hard
damage = 50,7
pausetime = 5,10
sparkno = -1
sparkxy = 0,0
ground.type = High
air.type = High
ground.velocity = -6,-6
air.velocity = -6,-6
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall = 1
palfx.time = 6
palfx.add = 150,150,150
envshake.time = 5
envshake.freq = 60
envshake.ampl = -8
getpower = 0
priority = 4, Hit

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !ishelper(3170)
trigger1 = !time && random <500
trigger2 = ishelper(3170)
trigger2 = !time
value = 12,5
channel = 1
freqmul = 0.8+(random/2500.0)
volume = ifelse(ishelper(3000),-100,0)

[State 0, SndPan]
type = SndPan
trigger1 = 1
channel = 1
pan = 0

;spark
[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 3233
sprpriority = 3
ignorehitpause = 1
ownpal = 1
pos = 10,-10
persistent = 0
facing = ifelse(random<500,-1,1)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 12,6
volume = ifelse(ishelper(3173),-150,-80)
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = moveguarded
value = s 6,0
volume = ifelse(ishelper(3173),-100,0)
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 220, 3]
type = DestroySelf
trigger1 = FrontEdgeBodyDist <= -160

;---------------------------------------------------------------------------
;Emma-O , helper invisible
[Statedef 3002]
type    = S
movetype= I
physics = N
juggle  = 4
poweradd= 0
velset = 0,0
anim = 30000
ctrl = 0

[State 0, BGPalFX]
type = BGPalFX
trigger1 = parent, stateno != 3000
time = 1
add = 0,0,0
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = parent, movetype = H
anim = 3010
removetime = 98
sprpriority = 2
ownpal = 1
ignorehitpause = 1
pos = 0,-78
velocity = -1,-1
accel = 0,.2
persistent = 0

[State 220, 3]
type = DestroySelf
trigger1 = time = 137

;---------------------------------------------------------------------------
; Posesion 1
[Statedef 3100]
type    = S
movetype= I
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3100 && animelem = 2
trigger2 = anim = 3104 && time = 27
value = 10,5
freqmul = 1.1

[State 3900, 1]
type = Explod
trigger1 = anim = 3100 && AnimElem = 2
trigger2 = anim = 3104 && time = 27
anim = 4001
pos = 0,0
postype = left
supermove = 1
facing = 1
bindtime = -1
sprpriority = -2
removetime = 97
ownpal = 1
ID = 4001

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim = 3161 && animelemtime(1) = 2
ID = 4001

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value =ifelse((numhelper(3102)=0),3100,3104)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3104 && time = 27
value = 3100
elem = 2

[State 3050, Super D]
type = NotHitBy
trigger1 = time >=4
value = , NA, SA, AT
time = 1

[State 1100, 5]
type=superpause
trigger1 = anim = 3100 && animelem = 2
movetime = 97
time = 97
anim = -1

;mu馿ca en el aire
[State 191]
type = Explod
trigger1 = animelem = 3
anim = 3160
postype = p1
pos = 14, -33
sprpriority = 0
ignorehitpause = 1
persistent = 0
ownpal = 1
shadow = -1
id = 3160
facing = -1

[State 0, PalFXWiz]
type = PalFX
trigger1 = anim = 3100 && animelem = 3
time = 19
sinadd = 256,256,256,80
invertall = 0

[State 191, 1]
type = ChangeAnim
trigger1 = anim = 3100 && !animtime
value = 3101

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3101 && animelem = 1
value = 12,11
volume = 120

[State 191, 1]
type = assertspecial
trigger1 = anim = 3101
flag = noshadow

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim = 3160
id = 3160

[State 3050, 5]
type = Changeanim
trigger1 = anim = 3101 && !animtime
value = 3160
ctrl = 0

[State 0, Turn]
type = Turn
trigger1 = anim = 3160 && animelem = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = anim = 3160 && animelem = 1
x = -14
y = -33

[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim = 3160
value = 1
movecamera = 1,0

[State 0, PosAdd]
type = veladd
trigger1 = anim = 3160
y = .3

[State 3050, 5]
type = Changeanim
trigger1 = pos Y >= -1 && vel y > 0
value = 3161
ctrl = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3161 && animelem = 1
value = 12,12
volume = -100
freqmul = 0.9+(random/5000.0)

[State 0, PosAdd]
type = velset
trigger1 = anim = 3161
y = 0

[State 0, PosAdd]
type = posset
trigger1 = anim = 3161
y = 0

[State 0, VarSet]
type = VarSet
trigger1 = anim = 3161 && animelem = 1
v = 10
value = 1

[State 3050, 5]
type = Changestate
trigger1 = anim = 3161 && !animtime
value = 3150
ctrl = 0

;aura roja
[State 0, Explod]
type = Explod
trigger1 = anim = 3161 && animelem = 1 && numexplod(3102) = 0
anim = 3102
ID = 3102
pos = 2,0
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1
scale = 0,0

[State 9999,0]
type = ModifyExplod
trigger1 = anim = 3161&&animelemtime(1) >=0
ID = 3102
scale=animelemtime(1) *.025, animelemtime(1) *.025


;---------------------------------------------------------------------------
;posesion - termina DF
[Statedef 3101]
type    = S
movetype= I
physics = N
anim = 3173
ctrl = 0
sprpriority = 1
velset = 0,0

;para intro
[State 191, 2]
type = AssertSpecial
trigger1 = prevstateno = 194
flag = Intro
flag2 = nobardisplay

[State 0, VarSet]
type = VarSet
trigger1 = time = 37
v = 10
value = 0

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

[State 0, Explod]
type = Explod
trigger1 = animelem = 3 && backedgedist >= 46 && prevstateno != 194
trigger2 = animelem = 3 && prevstateno = 194
anim = 3103
pos = -27,2
bindtime = -1
ontop = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 3 && backedgedist <= 45 && prevstateno != 194
anim = 3103
pos = 27,2
bindtime = -1
ontop = 1
ownpal = 1
facing = -1
id = 3103

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 12,11
volume = 120
freqmul = 1.2

[State 0, Helper]
type = Helper
trigger1 = time = 37
helpertype = normal
name = "mu馿ca inerte"
ID = 3102
stateno = 3102
ownpal = 1
supermove = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 38 && numexplod(3103) = 0
trigger2 = time = 38 && prevstateno = 194
x = -30

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 38 && numexplod(3103) != 0
trigger1 = prevstateno != 194
x = 30

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 38
value = 11

[State 0, Turn]
type = Turn
trigger1 = anim = 11 && numexplod(3103) !=0
persistent = 0

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 37
time = 15
add = 256,256,256
sinadd = -256,-256,-256,80
invertall = 0
color = 256

[State 0, Changeanim]
type = Changeanim
trigger1 = time = 70
value = 12

[State 0, Changestate]
type = Changestate
trigger1 = anim = 12 && animtime = 0
value = 0
ctrl = ifelse(roundstate = 2,1,0)

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelem = 3
time = 0

;---------------------------------------------------------------------------
; Posesion - mu馿ca INERTE
[Statedef 3102]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
sprpriority = 0
poweradd = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 3162
elem = ifelse((parent, stateno = 0),4,1)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3162 && animelem = 3
value = 12,12
volume = -100
freqmul = 0.9+(random/5000.0)

[State 3050, Super D]
type = NotHitBy
trigger1 = 1
value = , NA, SA, AT
time = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root, anim = 3104
value = 3160

[State 0, spr]
type = sprpriority
trigger1 = root, anim = 3104
value = 3

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3160 && facing = root, facing
x = ((rootdist x+30)/27.0)
y = -5.5
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3160 && facing != root, facing
x = ((rootdist x-30)/27.0)
y = -5.5
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3160
value = 0,3
persistent = 0
freqmul = 2.5

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3160
y = 0.3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent, anim = 3120 && parent, animelem = 4
value = 3123
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root, anim = 3104 && root, time = 27
trigger2 = anim = 3123 && animtime = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = root, anim = 3104 && root, time = 27
value = 12,1

;---------------------------------------------------------------------------
; Posesion COMBO! 1
[Statedef 3120]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
sprpriority = 2
anim = 3120

[State 1100, 5]
type=superpause
trigger1 = anim = 3120 && animelem = 4
movetime = 63
time = 63
anim = -1
poweradd = -1000

[State -2, BGPalFX]
type = BGPalFX
trigger1 = animelem = 4
time = -1
add = -40,-150,-150
color = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3120 && animelem = 4
value = 10,5
freqmul = 1.1

[State 3900, 1]
type = Explod
trigger1 = anim = 3120 && AnimElem = 4
anim = 4001
pos = 0,0
postype = left
supermove = 1
facing = 1
bindtime = -1
sprpriority = -2
removetime = 97
ownpal = 1
ID = 4001

;mu馿ca en el aire
[State 191]
type = Explod
trigger1 = animelem = 4
anim = 3121
pos = 18, -35
sprpriority = 1
ignorehitpause = 1
ownpal = 1
shadow = -1
id = 3121
supermove = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = anim = 3120 && animelem = 4
time = 29
sinadd = 256,256,256,100
invertall = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3120 && animelem = 5
value = 12,11
volume = 120

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animtime = 0
ID = 4001

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animtime = 0
ID = 3121

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

;---------------------------------------------------------------------------
; Posesion COMBO! 2
[Statedef 3121]
type    = S
movetype= a
physics = n
velset = 0,0
ctrl = 0
sprpriority = 2
anim = 3160

[State 0, VarSet]
type = VarSet
trigger1 = !time
v = 10
value = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
x = 18
y = -35

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 5
value = 3173

;aura roja
[State 0, Explod]
type = Explod
trigger1 = !time
anim = 3102
ID = 3102
pos = 2,0
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3173 && animelem = 3
value = 12,14
freqmul = 0.6
volume = -150

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelem = 3
trigger2 = anim = 3173 && animelemtime(3)= 20
trigger3 = anim = 3173 && animelemtime(3)= 40
helpertype = normal
name = "fantasma"
pos = 0,-25
postype = p1
stateno = 3122
ownpal = 1

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

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3173 && animelemtime(3)>=50
y = .3

[State 0, ChangeState]
type = ChangeState
trigger1 = anim = 3173 && pos y >= -5 && vel y > 0
value = 3150
ctrl = 0

;---------------------------------------------------------------------------
;df COMBO! fantasma
[Statedef 3122]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 0
anim = 3122
ctrl = 0
sprpriority = 6
velset = 6,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = random<300
flag = invisible
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
x = .05+(random/2000.0)

[State 0, afterimage]
type = AfterImage
trigger1 = !time
time = 30
FrameGap = 1
length = 50
PalContrast = 0,0,0
PalBright = 50,50,50
TimeGap = 1
PalColor = 0
Trans = add
persistent = 0
paladd = 20,-50,-50

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = 1
time = -1

;posesion normal
[State 0, HitDef]
type = HitDef
trigger1 = !time
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = hard
damage = 87,10
pausetime = 0,14
sparkno = -1
sparkxy = 0,0
ground.type = High
air.type = High
ground.velocity = -6,-3
air.velocity = -6,-3
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall = 1
palfx.time = 14
palfx.add = 150,150,150
envshake.time = 14
envshake.ampl = -11
getpower = 0
priority = 4, Hit

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,5
channel = 1
freqmul = 0.6+(random/3333.3)
volume = -50

[State 0, SndPan]
type = SndPan
trigger1 = 1
channel = 1
pan = 0

;spark
[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 3233
sprpriority = 3
ignorehitpause = 1
ownpal = 1
pos = 10,-10
persistent = 0
facing = ifelse(random<500,-1,1)
scale = 3.0,3.0

;motita muerte 1
[State 0, Explod1]
type = Explod
trigger1 = movehit
anim = 3232
vel = -5+(random/100.0),-4-(random/500.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 1
[State 0, Explod1]
type = Explod
trigger1 = movehit
anim = 3232
vel = -5+(random/100.0),-4-(random/500.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 2
[State 0, Explod2]
type = Explod
trigger1 = movehit
anim = 3232
vel = -5+(random/100.0),4+(random/500.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 2
[State 0, Explod2]
type = Explod
trigger1 = movehit
anim = 3232
vel = -5+(random/100.0),4+(random/500.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 3
[State 0, Explod3]
type = Explod
trigger1 = movehit
anim = 3232
vel = -4-(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 3
[State 0, Explod3]
type = Explod
trigger1 = movehit
anim = 3232
vel = -4-(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 4
[State 0, Explod4]
type = Explod
trigger1 = movehit
anim = 3232
vel = 4+(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

;motita muerte 4
[State 0, Explod4]
type = Explod
trigger1 = movehit
anim = 3232
vel = 4+(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1
persistent = 0
ignorehitpause = 1
scale = 2,2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 12,6
freqmul = 0.5
persistent = 0
ignorehitpause = 1
volume = -50

[State 0, PlaySnd]
type = PlaySnd
trigger1 = moveguarded
value = s 6,0
volume = ifelse(ishelper(3173),-100,0)
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 220, 3]
type = DestroySelf
trigger1 = FrontEdgeBodyDist <= -160

;---------------------------------------------------------------------------
; Posesion - mu馿ca normal
[Statedef 3150]
type    = S
movetype= I
physics = S
velset = 0,0
anim = 3150
ctrl = 0
sprpriority = 2

;movimiento horizontal
;---------- ----------
[State 0, VelSet]
type = VelSet
trigger1 = command = "holdfwd"
x = 1.5

[State 0, VelSet]
type = VelSet
trigger1 = command = "holdback"
x = -1.2

[State 0, VelSet]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
x = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = command = "holdfwd"
trigger1 = anim!=3151 && anim!=3153
trigger2 = anim = 3153 && animtime = 0
value = 3151

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = command = "holdback"
trigger1 = anim!=3152 && anim!=3153
trigger2 = anim = 3153 && animtime = 0
value = 3152

[State 0, ChangeAnim]
type = ChangeAnim
trigger1= anim!=3150 && anim!=3153
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger2 = anim = 3153 && animtime = 0
value = 3150

;turn
[State 0, ChangeAnim]
type = ChangeAnim
;triggerall = anim!=3151
trigger1 = P2Dist x < 0
value = 3153

[State 0, Turn]
type = Turn
trigger1 = anim = 3153 && animelem = 1

;comandos
;--------

;DF cancela DF
[State -3, cancela]
type = ChangeState
triggerall = power > 0 && life !=0
triggerall = command = "posesion"
trigger1 = var(24) = 0
trigger2 = var(24) = 3
trigger3 = var(24) = 1 && power <=1000
trigger4 = var(24) = 2 && power <=1000
value = 3101
ctrl = 0

;cancela DF se queda sin poder
[State -3, cancela]
type = ChangeState
trigger1 = power = 0
value = 3101
ctrl = 0

;super cara fantasma
[State 0, ChangeState]
type = ChangeState
trigger1 = command = "x" && command = "y"
trigger1 = power >= 350
value = 3173
ctrl = 0

;cara fantasma
[State 0, ChangeState]
type = ChangeState
trigger1 = command = "x"
trigger2 = command = "y"
value = 3170
ctrl = 0

; super mano fantasma
[State 0, ChangeState]
type = ChangeState
trigger1 = command = "a" && command = "b"
trigger1 = power >= 350
value = 3171
ctrl = 0

;giro
[State 0, ChangeState]
type = ChangeState
trigger1 = command = "a"
trigger2 = command = "b"
value = 3172
ctrl = 0

;detalles
;--------

[State 0, VarSet]
type = VarSet
trigger1 = !time
v = 20
value = 0

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

[State 0, MakeDust]
type = MakeDust
trigger1 = !time
trigger1 = prevstateno =3190 || prevstateno = 3173 || prevstateno = 3171
pos = 0,0

;sonido aterrizaje
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
trigger1 = prevstateno =3190 || prevstateno = 3173 || prevstateno = 3171 || prevstateno = 3121
value = 12,12
volume = -100
freqmul = 0.9+(random/5000.0)

;After image
[State -3]
type = AfterImage
trigger1 = !time
time = -1
FrameGap = 1
length = 10
PalContrast = 200,0,0
PalBright = 0,-80,-180
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
paladd = 0,-30,-30

;Changestates
;------------

;termina round
[State 0, ChangeState]
type = ChangeState
trigger1 = roundstate = 3
value = 0
ctrl = 0

;---------------------------------------------------------------------------
;posesion - HIT 1
[Statedef 3190]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 3160
sprpriority = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = life = 0 && anim != 3174
value = 3174
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = !time
v = 20
value = 1

[State -3, NotHitBy]
type = NotHitBy
trigger1 = var(20) >= 5
value = SCA
time = 1

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = -2
y = -3.5-(random/500.0)

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .3

[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3160
trigger2 = pos y >= 13 && vel Y > 0 && anim = 3174
value = ifelse((anim != 3174),3150,5150)
ctrl = 0

;cabeza muerte
[State 0, Helper]
type = Helper
trigger1 = anim = 3174
pos = -7,-36
name = "cabeza"
stateno = 3191
persistent = 0

;piernas muerte
[State 0, Helper]
type = Helper
trigger1 = anim = 3174
pos = 2,0
name = "piernas"
stateno = 3192
persistent = 0

;---------------------
;cabeza de mu馿ca
[Statedef 3191]
type    = S
movetype= I
physics = N
anim = 3176
ctrl = 0
sprpriority = 3

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3176
y = .3

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = -7+(random/100.0)
y = -4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >= -6 && vel y > 0 && anim = 3176
value = 3177

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3177
x = 0
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3177
value = 12,12
volume = -100
freqmul = 0.9+(random/5000.0)
persistent = 0

[State 0, PosSet]
type = PosSet
trigger1 = anim = 3177
y = 0

[State 0, SprPriority]
type = SprPriority
trigger1 = anim = 3177
value = 1

;motita muerte 1
[State 0, Explod1]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = -5+(random/100.0),-4-(random/500.0)
removetime = 40
sprpriority = 1

;motita muerte 2
[State 0, Explod2]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = -5+(random/100.0),4+(random/500.0)
removetime = 40
sprpriority = 1

;motita muerte 3
[State 0, Explod3]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = -4-(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1

;motita muerte 4
[State 0, Explod4]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = 4+(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1

;---------------------
;piernas de mu馿ca
[Statedef 3192]
type    = S
movetype= I
physics = N
anim = 3178
ctrl = 0
sprpriority = 31

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3178
y = .3

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = -2+(random/100.0)
y = -2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = pos y >= -6 && vel y > 0 && anim = 3178
value = 3179

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3179
value = 12,12
volume = -100
freqmul = 0.9+(random/5000.0)
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3179
x = 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = anim = 3179
y = 0

;motita muerte 1
[State 0, Explod1]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = -5+(random/100.0),-4-(random/500.0)
removetime = 40
sprpriority = 1

;motita muerte 2
[State 0, Explod2]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = -5+(random/100.0),4+(random/500.0)
removetime = 40
sprpriority = 1

;motita muerte 3
[State 0, Explod3]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = -4-(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1

;motita muerte 4
[State 0, Explod4]
type = Explod
trigger1 = time >0 && time < 4
anim = 3232
vel = 4+(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1

;---------------------------------------------------------------------------
;posesion - ataque - cara fantasma
[Statedef 3170]
type    = S
movetype= I
physics = S
anim = 3170
ctrl = 0
sprpriority = 2
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,0
volume = 250
channel = 0
freqmul = 1.8

[State 0, Helper]
type = Helper
trigger1 = animelem = 5
helpertype = normal
name = "fantasma"
pos = 0,-25
postype = p1
stateno = 3001
ownpal = 1
ID = 3170

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

;---------------------------------------------------------------------------
;posesion - ataque - super mano fantasma
[Statedef 3171]
type    = S
movetype= I
physics = N
anim = 3160
ctrl = 0
sprpriority = 2
velset = 0,-3

[State 3171, PowerAdd]
type = PowerAdd
trigger1 = !time
value = -350

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3160
y = .1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3160 && vel y >= 0
value = 3173

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3173 && animelem = 1
y = 0

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelemtime(3)= 1
helpertype = normal
name = "mano"
pos = ceil(20+(random/3.57)),0
postype = left
stateno = 3180
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelemtime(3)= 3
helpertype = normal
name = "mano"
pos = ceil(20+(random/3.57)),0
postype = left
stateno = 3180
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelemtime(3)= 5
helpertype = normal
name = "mano"
pos = ceil(20+(random/3.57)),0
postype = left
stateno = 3180
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelemtime(3)= 7
helpertype = normal
name = "mano"
pos = ceil(20+(random/3.57)),0
postype = left
stateno = 3180
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelemtime(3)= 9
helpertype = normal
name = "mano"
pos = ceil(20+(random/3.57)),0
postype = left
stateno = 3180
ownpal = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3173 && animelemtime(3)>=25
y = .3

[State 0, ChangeState]
type = ChangeState
trigger1 = anim = 3173 && pos y >= -5 && vel y > 0
value = 3150
ctrl = 0

;---------------------------------------------------------------------------
;mano fantasma (helper)
[Statedef 3180]
type    = S
movetype= I
physics = S
anim = 3180
ctrl = 0
sprpriority = 2
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 10,6
volume = -150
freqmul = 0.9+(random/1000.0)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

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

[State 0, Turn]
type = Turn
trigger1 = !time && random < 500

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 26
value = 12,15
volume = -150
freqmul = 0.9+(random/5000.0)

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 26
movetype = A

[State 0, Turn]
type = HitDef
trigger1 = !time
attr = S, SP
hitflag = MAFD
guardflag = MA
animtype = hard
air.animtype = hard
damage = 60,10
pausetime = 0,2
sparkno = s 3233
sparkxy = 0,-60
ground.type = High
air.type = High
ground.velocity = 8,-3
air.velocity = 8,-3
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall = 1
envshake.time = 5
envshake.freq = 60
envshake.ampl = -8
getpower = 0
priority = 4, Hit

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 20,1
freqmul = 0.7+(random/5000.0)
persistent = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 =animtime = 0

;---------------------------------------------------------------------------
;posesion - ataque - giro
[Statedef 3172]
type    = S
movetype= A
physics = N
anim = 3170
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,0
freqmul = 1.1+(random/5000.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 15,0
channel = 0
freqmul = 0.9+(random/5000.0)
volume = 100

[State 0, VelSet]
type = Veladd
trigger1 = animelemtime(7)<0 && animelemtime(2)>0
x = .32

[State 0, VelSet]
type = Veladd
trigger1 = animelemtime(7)>=0 && animelemtime(14)<0
x = -.22

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 14
x = 0
y = 0

[State 0, HitDef]
type = HitDef
trigger1 = animelem = 3
attr = s,na
hitflag = MAF
guardflag = Ma
animtype = medium
air.animtype = Medium
damage = 80,0
pausetime = 6,6
guard.pausetime = 0,5
sparkxy = 0,-15
ground.type = Trip
ground.velocity = 0,-7
air.velocity = 0,-4
fall = 1
envshake.time = 6
envshake.ampl = -4
getpower = 0
hitsound   = 5,2
priority = 4, Hit

[State 0, playerpush]
type = playerpush
trigger1 = 1
value = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value = 3161
ctrl = 0

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

;---------------------------------------------------------------------------
;posesion - ataque giro BLOQUEADO
[Statedef 3161]
type    = A
movetype= I
physics = N
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = s 6,0
volume = -50
freqmul = 0.9+(random/2500.0)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 3163
elem = 2
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = -2
y = -3.5-(random/500.0)
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .3

[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >= -4 && vel Y > 0
value = 3150
ctrl = 0

;---------------------------------------------------------------------------
;posesion - ataque - super cara fantasma
[Statedef 3173]
type    = S
movetype= I
physics = N
anim = 3160
ctrl = 0
sprpriority = 2
velset = 0,-3

[State 3171, PowerAdd]
type = PowerAdd
trigger1 = !time
value = -350

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3160
y = .1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3160 && vel y >= 0
value = 3173

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3173 && animelem = 1
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3173 && animelem = 1
value = 12,0
volume = 250
channel = 0
freqmul = 1.8

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelem = 3
helpertype = normal
name = "fantasma"
pos = 30,-22
postype = p1
stateno = 3001
ownpal = 1
id = 3173

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelem = 3
helpertype = normal
name = "fantasma"
pos = -30,-22
postype = p1
stateno = 3001
ownpal = 1
id = 3173

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelem = 3
helpertype = normal
name = "fantasma"
pos = 0,-60
postype = p1
stateno = 3001
ownpal = 1
id = 3173

[State 0, Helper]
type = Helper
trigger1 = anim = 3173 && animelem = 3
helpertype = normal
name = "fantasma"
pos = 0,20
postype = p1
stateno = 3001
ownpal = 1
id = 3173

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3173 && animelemtime(3)>=25
y = .3

[State 0, ChangeState]
type = ChangeState
trigger1 = anim = 3173 && pos y >= -5 && vel y > 0
value = 3150
ctrl = 0

;---------------------------------------------------------------------------
; mu馿ca - Win pose - Flota
[Statedef 3160]
type = S
physics = N
ctrl = 0
anim = 3163
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 15,1
freqmul = 1.0+(random/5000.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 20,8
freqmul = 0.8
persistent = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(2) >= 0 && helper(182), anim = 30000
y = -.1

[State 0, VelAdd]
type = VelAdd
trigger1 = helper(182),rootdist y < 0 && helper(182), anim = 30001
y = .2

[State 0, VelAdd]
type = VelAdd
trigger1 = helper(182),rootdist y > 0 && helper(182), anim = 30001
y = -.2

[State 0, Helper]
type = Helper
trigger1 = !time
ID = 182
pos = 0,-60
stateno = 182

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

[State 182, 1]
type = AssertSpecial
trigger1 = time < 250
flag = roundnotover

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 2
time = -1
add = 0,-100,-100
mul = 256,256,256
sinadd = 40,40,40,30

[State -3]
type = AfterImage
trigger1 = animelem = 2
time = -1
FrameGap = 1
length = 10
PalContrast = 200,0,0
PalBright = 100,-80,-180
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
paladd = 50,0,0

;---------------------------------------------------------------------------
; Castigo del alma (hyper)
[Statedef 3200]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 1300
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = 10,5
freqmul = 1.1

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 4
pos = 25, -57
anim = -1
poweradd = -1000
time = 30

[State 3900, 1]
type = Explod
trigger1 = AnimElem = 4
anim = 4002
pos = 0,0
postype = left
supermove = 1
facing = 1
bindtime = 30
sprpriority = -2
removetime = 30
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 12,14
volume = -50
channel = 0
freqmul = 0.8

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(4)>=1 && animelemtime(13) <=1
x = 1.3

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 7
time = 17
add = 0,40,200
color = 0

[State 0, afterimage]
type = AfterImage
trigger1 = animelem = 8
time = -1
FrameGap = 1
length = 6
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = animelem = 8
time = 14

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S, HT
animtype  = Medium
damage  = 0
guardflag = MA
pausetime = 0,0
guard.pausetime = 4,10
sparkno = 300
sparkxy = -10,-86
hitsound   = s 20,1
guardsound = 6,0
ground.type=High
ground.slidetime=18
ground.hittime=18
ground.velocity=-10,0
air.type=Low
air.velocity=-5,-5
fall = 1
envshake.time = 6
ID = 3200
p2facing = 1
priority = 4, Hit
hitonce = 1

[State 3300, p2state]
type=targetstate
trigger1= movehit && numtarget(3200)
ID=3200
value=3220

[State 3300, p1state]
type=changestate
trigger1= movehit && numtarget(3200)
value=3210

[State 220, 3]
type = changestate
value = 1303
trigger1 = Moveguarded
ctrl = 0

[State 3000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Castigo del alma P1 - 1
[Statedef 3210]
type    = S
movetype= A
physics = N
juggle  = 4
velset = 0,0
anim = 3210
ctrl = 0
sprpriority = 2

;musica
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 20,0
volume = 50
channel = 20
ignorehitpause = 1
freqmul = 0.98

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = -1
add = 0,40,200
color = 0

[State 0, TargetBind]
type = TargetBind
trigger1 = !time
time = 1
ID = 3200
pos = 60,0
persistent = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = !time && frontedgedist <= 40
x = -25

[State 0, Helper]
type = Helper
trigger1 = !time
helpertype = normal
name = "alma"
ID = 3230
pos = 60,-64
stateno = 3230
ownpal = 1
facing = -1
sprpriority = 2

[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim != 3215
value = 0
movecamera = 1,1

[State 0, BGPalFX]
type = bgPalFX
trigger1 = anim != 3215
time = 10
add = -100,-100,0
color = 0
ignorehitpause = 1

[State 0, BGPalFX]
type = bgPalFX
trigger1 = !time
trigger2 = anim = 3211 && animelemtime(1)=1
trigger3 = anim = 3212 && animelemtime(1)=1
trigger4 = anim = 3213 && animelemtime(1)=1
trigger5 = anim = 3214 && animelemtime(1)=1
trigger6 = anim = 3215 && animelem = 3
time = 1
add = 100,100,100
ignorehitpause = 1

[State 0, Pause]
type = Pause
trigger1 = !time
trigger2 = anim = 3211 && animelemtime(1)=1
trigger3 = anim = 3212 && animelemtime(1)=1
trigger4 = anim = 3213 && animelemtime(1)=1
trigger5 = anim = 3214 && animelemtime(1)=1
time = 15
movetime = 15

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
trigger2 = anim = 3211 && animelemtime(1)=1
trigger3 = anim = 3212 && animelemtime(1)=1
trigger4 = anim = 3213 && animelemtime(1)=1
trigger5 = anim = 3214 && animelemtime(1)=1
trigger6 = anim = 3215 && animelem = 3
time = 10
ampl = -6

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = !time
trigger2 = anim = 3211 && animelemtime(1)=1
trigger3 = anim = 3212 && animelemtime(1)=1
trigger4 = anim = 3213 && animelemtime(1)=1
trigger5 = anim = 3214 && animelemtime(1)=1
value = -40
ID = 3200
kill = 0

[State 0, HitAdd]
type = HitAdd
trigger1 = anim = 3211 && animelemtime(1)=1
trigger2 = anim = 3212 && animelemtime(1)=1
trigger3 = anim = 3213 && animelemtime(1)=1
trigger4 = anim = 3214 && animelemtime(1)=1
trigger5 = anim = 3215 && animelem = 3
value = 1

;desaparece en 15 ticks
[State 23, trans]
type = Trans
trigger1 = animelemtime(1) >= 5 && anim != 3215
trans = addalpha
alpha=ceil(256-17.06*(animelemtime(1))-5),ceil(0+17.06*animelemtime(1)-5)

;cambio 1

[State 0, ChangeAnim]
type = ChangeAnim
;trigger1 = numtarget(3200)
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 23
value = 3211

[State 0, Turn]
type = Turn
trigger1 = anim = 3211
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3211
trigger1 = facing = -1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x + 55
y = helper(3230), pos y + 30
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3211
trigger1 = facing = 1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x - 55
y = helper(3230), pos y + 30
persistent = 0

;cambio 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 45
value = 3212

[State 0, Turn]
type = Turn
trigger1 = anim = 3212
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3212
trigger1 = facing = -1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x + 40
y = helper(3230), pos y
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3212
trigger1 = facing = 1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x - 40
y = helper(3230), pos y
persistent = 0

;cambio 3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 61
value = 3213

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3213
trigger1 = facing = -1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x + 45
y = 0
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3213
trigger1 = facing = 1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x - 45
y = 0
persistent = 0

;cambio 4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 73
value = 3214

[State 0, Turn]
type = Turn
trigger1 = anim = 3214
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3214
trigger1 = facing = -1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x + 40
y = helper(3230), pos y
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3214
trigger1 = facing = 1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x - 40
y = helper(3230), pos y
persistent = 0

;cambio 5

[State 0, Turn]
type = varset
trigger1 = anim = 3215
fvar(1) = target(3200), pos x
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 85;90
value = 3215

[State 0, Explod]
type = Explod
trigger1 = anim = 3215 && animelemtime(3)=1 && random <500
trigger1 = target(3200), life > 50
anim = 3204+(random/200)
pos = 0,0
postype = left
bindtime = -1
pausemovetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
id = 3204

[State 0, PlaySnd]
type = PlaySnd
trigger1 = numexplod(3204)!=0
value = 20,10
freqmul = 1.0+(random/5000.0)
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = numexplod(3204)!=0
time = 1
freq = 0
ampl = 0

[State 0, Turn]
type = Turn
trigger1 = anim = 3215
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3215
trigger1 = facing = 1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x - 50
y = 0
persistent = 0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 3215
trigger1 = facing = -1
trigger1 = numhelper(3230)!=0
x = helper(3230), pos x + 50
y = 0
persistent = 0

[State 0, Pause]
type = Pause
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 90
time = 35

[State 0, BGPalFX]
type = bgPalFX
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 90
time = 35
add = -256,-256,-256
color = 0

[State 0, Pause]
type = Pause
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 91
time = 4

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = numhelper(3230)!=0
trigger1 = helper(3230), time = 91
value = -50
ID = 3200

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = anim = 3215 && animelem = 4
time = 1
add = 0,0,0

[State 0, ChangeState]
type = ChangeState
trigger1 = anim = 3215 && animtime = 0
trigger2 = time = 5 && target(3200), stateno != 3220
value = 0
ctrl = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3215 && animelem = 3
value = 20,3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3215 && animelem = 3
value = 20,1
freqmul = 0.5

;mata a target

[State 0, Turn]
type = varset
trigger1 = target(3200), life = 0
var(2) = 1
persistent = 0

;motita muerte 1
[State 0, Explod]
type = Explod
trigger1 = target(3200), life = 0
trigger1 = anim = 3215 && animelemtime(4) >=1
trigger1 = anim = 3215 && animelemtime(4) <=3
anim = 3232
pos = 14,-104
vel = -5+(random/100.0),-4-(random/500.0)
removetime = 40
sprpriority = 1

;motita muerte 2
[State 0, Explod]
type = Explod
trigger1 = target(3200), life = 0
trigger1 = anim = 3215 && animelemtime(4) >=1
trigger1 = anim = 3215 && animelemtime(4) <=3
anim = 3232
pos = 14,-104
vel = -5+(random/100.0),4+(random/500.0)
removetime = 40
sprpriority = 1

;motita muerte 3
[State 0, Explod]
type = Explod
trigger1 = target(3200), life = 0
trigger1 = anim = 3215 && animelemtime(4) >=1
trigger1 = anim = 3215 && animelemtime(4) <=3
anim = 3232
pos = 14,-104
vel = -4-(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1

;motita muerte 4
[State 0, Explod]
type = Explod
trigger1 = target(3200), life = 0
trigger1 = anim = 3215 && animelemtime(4) >=1
trigger1 = anim = 3215 && animelemtime(4) <=3
anim = 3232
pos = 14,-104
vel = 4+(random/500.0), 5-(random/100.0)
removetime = 40
sprpriority = 1

;helper para musica
[State 0, Helper]
type = Helper
trigger1 = !time
name = "para-musica"
stateno = 3231
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

;---------------------------------------------------------------------------
; Castigo del alma - P2
[Statedef 3220]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 1

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6283

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = !time && anim != 6283
value = 3220

[State 0, VelSet]
type = VelSet
trigger1 = time = 1
x = -2
y = -3

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = -1
color = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,0

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3220
trigger2 = anim = 6283
y = .3

;ES Peketo DF
[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = pos y > 25 && vel y > 0 && anim = 6283
value = 6284

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = pos y > 25 && vel y > 0 && anim = 3220
value = 3221

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3221
trigger2 = anim = 6284
x = 0
y = 0

[State 0, VelSet]
type = posSet
trigger1 = anim = 3221
trigger2 = anim = 6284
y = 0

[State 0, MakeDust]
type = MakeDust
trigger1 = anim = 3221 && animelemtime(1) = 1
trigger2 = anim = 6284 && animelemtime(1) = 1
pos = ceil(-30+(random/16.6)),ceil(3+(random/333.3))
pos2 = ceil(-30+(random/16.6)),ceil(3+(random/333.3))
spacing =1

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = life != 0
trigger1 = time = 153
time = 7
add = 256,256,256

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 91
trigger1 = anim != 6284
value = 11,0
freqmul = 0.9

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 91
trigger1 = anim != 6284
value = 11,0
freqmul = 1.1

[State 0, selfstate]
type = selfstate
trigger1 = life != 0
trigger1 = time = 154
value = 5110

[State 0, selfstate]
type = selfstate
trigger1 = life = 0
trigger1 = time = 200
value = 5150

;---------------------------------------------------------------------------
; Castigo del alma - ALMA - Helper
[Statedef 3230]
type    = S
movetype= H
physics = N
ctrl = 0
sprpriority = 2
velset = -7,-2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 =  random<300
flag = invisible
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = random < 50 && time <70
value = 20,2
ignorehitpause = 1
freqmul = 1.0+(random/4000.3)
abspan = ceil(-160+(random/3.125))

[State 0, afterimage]
type = AfterImage
trigger1 = !time
time = 30
FrameGap = 1
length = 30
PalContrast = 0,0,200
PalBright = -80,-80,0
TimeGap = 2
PalColor = 0
Trans = add
persistent = 0
paladd = -50,-50,0

[State 0, AfterImage]
type = AfterImagetime
trigger1 = 1
time = -1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
trigger2 = time = 46
trigger3 = time = 62
trigger4 = time = 91
value = 3231

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 24
trigger2 = time = 74
value = 3230

[State 0, VelAdd]
type = Velset
trigger1 = time = 24
x = 9
y = -2.5

[State 0, VelAdd]
type = Velset
trigger1 = time = 46
x = -5
y = 6

[State 0, VelAdd]
type = Velset
trigger1 = time = 62
x = -6
y = -7

[State 0, VelAdd]
type = Velset
trigger1 = time = 74
x = 8
y = 4
persistent = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = time >=90
y = .3

[State 0, VelAdd]
type = Velset
trigger1 = time = 90
x = ((root,fvar(1)-pos x)/60.0)*facing
y = -8

;spark comun
[State 0, Explod]
type = Explod
trigger1 = !time
trigger2 = time = 24
trigger3 = time = 46
trigger4 = time = 62
trigger5 = time = 74
anim = 3233
sprpriority = 3
ignorehitpause = 1
ownpal = 1
pausemovetime = 100

;spark final
[State 0, Explod]
type = Explod
trigger1 = time = 91
anim = 3233
sprpriority = 3
ignorehitpause = 1
ownpal = 1
pausemovetime = 100
scale = 2,2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 24
value = 20,1
volume = 256
freqmul = 1.1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 46
value = 20,1
volume = 256
freqmul = 1.2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 62
value = 20,1
volume = 256
freqmul = 1.3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 74
value = 20,1
volume = 256
freqmul = 1.4

;motita
[State 0, Explod]
type = Explod
trigger1 = random < 300
anim = 3232
pos = ceil(-5+(random/100.0)),0
vel = 0,-1-(random/333.0)
accel = 0,.3
removetime = 25
sprpriority = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 91
trigger1 = pos y >= -10 && vel y > 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root, var(2) = 1

;---------------------------------------------------------------------------
; helper para musica
[Statedef 3231]
type    = S
movetype= I
physics = N
anim = 8055024
ctrl = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [165,200]
flag = nomusic

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 201

;--------------------------------------------------
;---------------------------------------------------------------------------
; funeral (hyper)
[Statedef 3300]
type    = a
movetype= A
physics = n
juggle  = 4
velset = 0,0
anim = 3300
ctrl = 0
sprpriority = 1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim = 3300 && animelemtime(9)>=1
trigger2 = anim = 1210
value = 1
movecamera = 1,0

[State 3000, Super A]
type = SuperPause
trigger1 = anim = 3300 && AnimElem = 3
pos = 25, -57
anim = -1
poweradd = -1000
time = 30

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3300 && animelem = 3
value = 10,5
;freqmul = 0.9
channel = 19

[State 3900, 1]
type = Explod
trigger1 = anim = 3300 && AnimElem = 3
anim = 4004
pos = 0,0
postype = left
supermove = 1
facing = 1
bindtime = 30
sprpriority = -2
removetime = 30
ownpal = 1

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = anim = 3300 && animelemtime(7)=1
time = 3
add = 200,200,200

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 3300 && animelemtime(7)=1
time = 3
ampl = -5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3300 && animelemtime(7)=1
trigger2 = anim = 1210 && animelemtime(1) = 4
value = 12,6
freqmul = 0.4+(random/5000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3300 && animelemtime(7)=1
value = 20,8
freqmul = 2.0+(random/5000.0)

[State 0, Explod]
type = Explod
trigger1 = anim = 3300 && animelemtime(7)=1
anim = 3350
scale = 1.5, 1
sprpriority = -1
ownpal = 1
pos = 0,ceil((pos y -pos y -pos y) +5)

;farol 1
[State 0, Helper]
type = Helper
trigger1 = anim = 3300 && animelemtime(7)=1
stateno = 3330
ownpal = 1
pos = ceil(-20+(random/25)),ceil(0+(random/200))

;farol 2
[State 0, Helper]
type = Helper
trigger1 = anim = 3300 && animelemtime(7)=1
stateno = 3330
ownpal = 1
pos = ceil(-20+(random/25)),ceil(0+(random/200))

;farol 3
[State 0, Helper]
type = Helper
trigger1 = anim = 3300 && animelemtime(7)=1
stateno = 3330
ownpal = 1
pos = ceil(-20+(random/25)),ceil(0+(random/200))

;farol 4
[State 0, Helper]
type = Helper
trigger1 = anim = 3300 && animelemtime(7)=1
stateno = 3330
ownpal = 1
pos = ceil(-20+(random/25)),ceil(0+(random/200))

;farol 5
[State 0, Helper]
type = Helper
trigger1 = anim = 3300 && animelemtime(7)=1
stateno = 3330
ownpal = 1
pos = ceil(-20+(random/25)),ceil(0+(random/200))

;clones suben
[State 0, Helper]
type = Helper
triggerall = anim = 3300
trigger1 = animelemtime(7)=1
trigger2 = animelemtime(7)=5
trigger3 = animelemtime(7)=9
trigger4 = animelemtime(7)=13
trigger5 = animelemtime(7)=17
trigger6 = animelemtime(7)=21
trigger7 = animelemtime(7)=25
stateno = 3310
ownpal = 1

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3300 && animelem = 8
y = -3

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3300 && animelemtime(8)>=1
y = -.2

[State 0, ChangeState]
type = Changeanim
trigger1 = ScreenPos Y <= 60 && anim != 1210
value = 1210

[State 0, VelSet]
type = VelSet
trigger1 = anim = 1210
x = 0
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 1210
value = 12,1
freqmul = 1.0+(random/5000.0)
volume = 100
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 1210 && animelem = 1
time = 5
ampl = -3

;correcion de posicion
;--------- -- --------
[State 0, PosSet]
type = Posadd
trigger1 = anim = 1210 && ScreenPos Y <= 59
y = 1

[State 0, PosSet]
type = Posadd
trigger1 = anim = 1210 && ScreenPos Y <= 58
y = 2

[State 0, PosSet]
type = Posadd
trigger1 = anim = 1210 && ScreenPos Y <= 57
y = 3

[State 0, PosSet]
type = Posadd
trigger1 = anim = 1210 && ScreenPos Y >= 61
y = -1

[State 0, PosSet]
type = Posadd
trigger1 = anim = 1210 && ScreenPos Y >= 62
y = -2

[State 0, PosSet]
type = Posadd
trigger1 = anim = 1210 && ScreenPos Y >= 63
y = -3

;clones bajan
[State 0, Helper]
type = Helper
triggerall = anim = 1210
trigger1 = animelemtime(1) = 4
trigger2 = animelemtime(1) = 8
trigger3 = animelemtime(1) = 12
trigger4 = animelemtime(1) = 16
trigger5 = animelemtime(1) = 20
trigger6 = animelemtime(1) = 24
trigger7 = animelemtime(1) = 28
stateno = 3320
ownpal = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = anim = 1210 && animelemtime(1) = 32
value = 1215
ctrl = 0

;---------------------------------------------------------------------------
; funeral helper fantasma SUBE
[Statedef 3310]
type    = A
movetype= A
physics = N
juggle  = 1
poweradd= 0
anim = 1200
ctrl = 0
sprpriority = 2
velset = 0.9+(random/250.0),-4

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 1200
elem = 2

[State 23, trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha= 200,56

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = -1
add = 0,50,240
mul = 120,224,150
sinadd = 85,55,110,20
invertall = 0
color = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 12,0
channel = 0
freqmul = 1.3+(random/2000.0)
volume = 50

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = -.2

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Medium
damage    = 15,2
guardflag = MA
pausetime = 5,7
sparkno = -1
sparkxy = -10,-30
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -.3,-9
air.velocity = -.3,-8
fall = 1
envshake.time = 5
fall.recover = 0
priority = 4, Hit

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = f 5,3
volume = -50
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 191]
type = Explod
trigger1 = movehit
anim = 3233
postype = p1
pos = 20, -35
sprpriority = 3
ignorehitpause = 1
persistent = 0
ownpal = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ScreenPos Y < 0

;---------------------------------------------------------------------------
;funeral helper BAJA
[Statedef 3320]
type    = A
movetype = A
physics = N
anim = 1215
juggle = 1
sprpriority = 2

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = 12-(random/200.0)
y = 8

[State 23, trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha= 200,56

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 25
add = 0,50,240
mul = 120,224,150
sinadd = 85,55,110,10
invertall = 0
color = 0

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 15,2
guardflag = HA
priority = 4
pausetime = 5,7
sparkno = -1
sparkxy = 15,-60
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -2,3
air.velocity = -2,3
fall = 1
envshake.time = 6
envshake.ampl = 10
fall.envshake.time = 5
priority = 4, Hit

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = f 5,3
volume = -50
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 191]
type = Explod
trigger1 = movehit
trigger1 = 1
anim = 3233
postype = p1
pos = 56, 20
sprpriority = 3
ignorehitpause = 1
persistent = 0
ownpal = 1

[State 700, 10]
type = destroyself
trigger1 = pos Y >= -1 && vel y > 0
value = 1212
ctrl = 0

;---------------------------------------------------------------------------
; farolito
[Statedef 3330]
type    = s
movetype= I
physics = N
anim = 3330
ctrl = 0
sprpriority = ifelse(rootdist y <-1,3,-2)
velset = ifelse(rootdist x < 0,0.3+(random/2000.0),-0.3-(random/2000.0)),0

;desaparece en 30 ticks
[State 23, trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 170,86

[State 0, Explod]
type = Explod
trigger1 = !time
anim = ifelse(random<500,3331,3332)
bindtime = -1
sprpriority = ifelse(rootdist y <-1,3,-2)+1
ownpal = 1
removetime = -1
id = 3331

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = frontedgedist <= -25
trigger2 = backedgedist <= -25
ID = 3331

[State 0, DestroySelf]
type = DestroySelf
trigger1 = frontedgedist <= -25
trigger2 = backedgedist <= -25

;---------------------------------------------------------------------------
; fatal move (hyper)
[Statedef 3500]
type    = S
movetype= A
physics = N
velset = 0,0
anim = 3500
ctrl = 0
sprpriority = 2

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 3
pos = 25, -57
anim = -1
poweradd = -3000
time = 30
movetime = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 10,5
freqmul = 0.9
channel = 19

[State 3900, 1]
type = Explod
trigger1 = AnimElem = 3
anim = 4003
pos = 0,0
postype = left
supermove = 1
facing = 1
bindtime = 30
sprpriority = -2
removetime = 30
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 20,7
volume = 200
channel = 16
freqmul = 0.8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 12,14
volume = 200
channel = 14
freqmul = 0.5

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 4
x = 4.5

[State 23, trans]
type = Trans
trigger1 = animelemtime(4) >= 0
trans = addalpha
alpha=155,101

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = animelem = 4
time = 33
add = -256,-256,-256
mul = 256,256,256
invertall = 1
color = 0

[State 0, afterimage]
type = AfterImage
trigger1 = animelem = 5
time = 30
FrameGap = 1
length = 8
TimeGap = 1
PalColor = 0
Trans = sub
paladd = 40,40,40

[State 0, AfterImage]
type = AfterImagetime
trigger1 = animelem = 15
time = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = animelemtime(4) >=0
trigger1 = time % 2 = 0
time = 3
freq = 60
ampl = -5

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S,HA
guardflag = M
hitflag = MAF
animtype = Hard
sparkno = -1
guard.sparkno = 40
sparkxy = -10,-86
hitsound   = 325,2
guardsound = 6,0
ground.type=High
ground.slidetime=18
ground.hittime=18
ground.velocity=-10,0
air.type=Low
air.velocity=-5,-5
fall = 1
p2facing = 1
id = 3500
pausetime = 10,10
priority = 4, Hit
hitonce = 1

[State 3300, p2state]
type=targetstate
trigger1= movehit && numtarget(3500)
ID=3500
value=3550

[State 3300, p1state]
type=changestate
trigger1= moveguarded
value = 1303

[State 3300, p1state]
type=changestate
trigger1= movehit && numtarget(3500)
value=3510

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit
value = 20,13
ignorehitpause = 1
persistent = 0
freqmul = 1.5
volume = -100
channel = 0

[State 0, AllPalFX]
type = AllPalFX
trigger1 = movehit
time = 15
add = 100,100,100
ignorehitpause = 1
color = 0
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 3543
pos = 0,0
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 12
scale = 3,3
ontop = 1
ownpal = 1
persistent = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 3543
pos = 0,0
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 12
scale = 3,3
ontop = 1
ownpal = 1
persistent = 0
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; fatal move p1 - 1 (hyper)
[Statedef 3510]
type    = S
movetype= A
physics = N
velset = 0,0
anim = 3510
ctrl = 0
sprpriority = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = !time
channel = 0

;P2 tiene mas de 250
;-------------------

;spark
[State 0, Explod]
type = Explod
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
anim = f 2
pos = 30, -70
ontop = 1
pausemovetime = 10

[State 0, Pause]
type = Pause
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
time = 10
movetime = 0

[State 5210, 1] ;Blink white
type = PalFX
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
time = 3
add = 128,128,128

[State 0, EnvShake]
type = EnvShake
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
time = 5
ampl = -6

[State 0, PlaySnd]
type = PlaySnd
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
value = 1,1
volume = 100
freqmul = 0.5

[State 0, PlaySnd]
type = PlaySnd
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
value = S 5,3
freqmul = 0.6

[State 3300, p1state]
type=changestate
trigger1= numtarget(3500)
trigger1 = target(3500),life > 250
trigger1 = !time
value=1303

;------

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = timerfreeze

[State 0, StopSnd]
type = StopSnd
trigger1 = !time
channel = 14

[State 0, StopSnd]
type = StopSnd
trigger1 = !time
channel = 19

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 20,6
channel = 17
volume = 150
loop = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 20,9
volume = -200
channel = 18
loop = 1
freqmul =0.8

[State 0, AfterImage]
type = AfterImagetime
trigger1 = !time
time = 0

[State 0, PosSet]
type = PosSet
trigger1 = facing = 1 && !time
x = -75

[State 0, PosSet]
type = PosSet
trigger1 = facing = -1 && !time
x = 75

[State 0, AllPalFX]
type = AllPalFX
trigger1 = !time
time = -1
add = 256,256,256
color = 0

[State 0, AllPalFX]
type = AllPalFX
trigger1 = time >= 3
time = 1
add = 0,0,0
color = 0
ignorehitpause = 1

[State 0, AllPalFX]
type = PalFX
trigger1 = !time
time = -1
add = 256,256,256
color = 0

[State 0, AllPalFX]
type = PalFX
trigger1 = time = 3
time = -1
add = 0,0,0
color = 0

;polvo 1
[State 3900, 1]
type = Explod
trigger1 = time = 2
anim = 3540
pos = 160,0
postype = left
supermove = 1
facing = 1
bindtime = -1
sprpriority = 8
removetime = -1
ownpal = 1
id = 3540

;polvo 2
[State 3900, 1]
type = Explod
trigger1 = time = 2
anim = 3541
pos = 160,0
postype = left
supermove = 1
bindtime = -1
sprpriority = 8
removetime = -1
ownpal = 1
id = 3541

;widescreen
[State 3900, 1]
type = Explod
trigger1 = time = 2
anim = 3542
pos = -4,-5
postype = left
supermove = 1
bindtime = -1
ontop = 1
removetime = -1
ownpal = 1
id = 3542

;ruido
[State 3900, 1]
type = Explod
trigger1 = time = 2
anim = 3543
pos = 0,0
postype = left
supermove = 1
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = 3
id = 3543

;ruido
[State 3900, 1]
type = Explod
trigger1 = time = 2
anim = 3543
pos = 0,0
postype = left
supermove = 1
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = 9
id = 3544

;flicker
[State 3900, 1]
type = Explod
trigger1 = time = 2
anim = 3545
pos = 0,0
postype = left
supermove = 1
bindtime = -1
removetime = -1
ownpal = 1
sprpriority = 9
id = 3545

[State 0, EnvShake]
type = EnvShake
trigger1 = random < 6
time = 3
freq = 60
ampl = -3

[State 0, EnvShake]
type = EnvShake
trigger1 = random < 6
time = 6
freq = 200
ampl = -2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay

;helper screenbound
[State 0, Helper]
type = Helper
trigger1 = time = 2
helpertype = normal
name = "screenbound bitch"
ID = 3512
pos = 160,0
postype = back
stateno = 3512
pausemovetime = 1000
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 250 && random < 10
trigger2 = time = 400
value = 3520
ctrl = 0

;------------------------------------------
;fatal move p1 - 2
[Statedef 3520]
type = S
ctrl = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic

[State 0, AllPalFX]
type = AllPalFX
trigger1 = 1
time = 1
add = 0,0,0
color = 0
ignorehitpause = 1

[State 3000, Super A]
type = SuperPause
trigger1 = 1
anim = -1
time = 2
movetime = 2
darken = 0

;remove widescreen
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
ID = 3542
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = !time
name = "helperfinal-1"
ID = 3521
stateno = 3521
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
size.yscale = 1.07
ignorehitpause = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = helper(3521), anim = 3521
trigger2 = helper(3521), anim = 3525
channel = 17

[State 0, StopSnd]
type = StopSnd
trigger1 = helper(3521), anim = 3521
trigger2 = helper(3521), anim = 3525
channel = 18

[State 0, ChangeState]
type = ChangeState
trigger1 = helper(3521), anim = 3522 && helper(3521), animtime = 0
trigger2 = helper(3521), anim = 3525 && helper(3521), animtime = 0
value = 3511
ctrl = 0

;------------------------------------------
;HELPER final
[Statedef 3521]
type = S
ctrl = 0
anim = 3520
sprpriority = 7

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = noFG

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = 0
y=ceil(pos y-screenpos y)+120

;puede cambiar a susto lento o directo
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time >= 80 && anim =3520 && random<10
trigger2 = anim = 3520 && time = 280
value = ifelse((random<500),3521,3525)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3521 && animelem = 1
value = 20,11
channel = 19

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 10,5
freqmul = 0.5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3521 && animelem = 9
value = 20,12
channel = 19
loop=1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3521 && animelem = 9
value = 12,2
channel = 20
loop=1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3521 && animelemtime(9) >= 20 && random<10
trigger2 = anim = 3521 && animelemtime(9) >= 150
value = 3522

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3522 && animelem = 1
value = 20,13
channel = 19

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3525 && animelem = 1
value = 20,14
volume = 100

[State 0, StopSnd]
type = StopSnd
trigger1 = anim = 3522 && animtime = 0
channel = 20

[State 0, DestroySelf]
type = DestroySelf
trigger1 = anim = 3522 && animtime = 0
trigger2 = anim = 3525 && animtime = 0

;-------------------------------------
;------------------------------------------
;termina fatal move
[Statedef 3511]
type = S
ctrl = 0
anim = 3511

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = !time
value = -(target,lifemax)
ID = 3500
absolute=1

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

[State 0, AllPalFX]
type = AllPalFX
trigger1 = !time
time = 2
add = 256,256,256
color = 256

[State 0, PalFX]
type = PalFX
trigger1 = !time
time = 1
add = 0,0,0
mul = 256,256,256
color = 256

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
ID = 3540

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
ID = 3541

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
ID = 3543

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
ID = 3544

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
ID = 3545

[State 0, TargetState]
type = TargetState
trigger1 = !time
value = 3551
ID = 3500


;---------
----------------------------
;------------------------------------
;SCREENBOUND helper
[Statedef 3512]
physics=N
velset=0,0
anim = 9123000
sprpriority = 2

[State 7650, bound]
type=screenbound
trigger1=1
value=0
movecamera=1,1

[State 7650, width]
type=width
trigger1=1
edge=320,320

[State 7650, pos]
type=posset
trigger1=1
x=0
y=0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root, stateno = 3511

;---------------------------------------------------------------------------
; fatal move p2 - 1
[Statedef 3550]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 1

;tiene mas de 250
;----------------

[State 0, SelfState]
type = SelfState
trigger1 = !time && life > 250
value = 5210

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

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 31000

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 31000
value = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, PosSet]
type = PosSet
trigger1 = facing = -1 && time = 1
x = 75
y = -1

[State 0, PosSet]
type = PosSet
trigger1 = facing = 1 && time = 1
x = -75
y = -1

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = time = 200 && anim = 31000
value = 31020

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 200 && anim = 0
value = 20

[State 0, VelSet]
type = VelSet
trigger1 = anim = 20
trigger2 = anim = 31020
x = 2.4

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = time = 235 && anim = 31020
value = 31010

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 235 && anim = 20
value = 10

[State 0, VelSet]
type = VelSet
trigger1 = anim = 10
trigger2 = anim = 31010
x = 0

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = anim = 31010 && animtime = 0
value = 31011

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 10 && animtime = 0
value = 11

[State 0, playerpush]
type = playerpush
trigger1 = 1
value = 0

;---------------------------------------------------------------------------
; fatal move p2 - 2
[Statedef 3551]
type    = S
movetype= H
physics = N
velset = -3,-4
ctrl = 0

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = -1
color = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .3

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = anim = 31011 && !time
value = 6285

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = anim = 11 && !time
value = 3551

[State 700, 10]
type = selfstate
trigger1 = pos Y >= -10 && vel y > 0
value = 5100
ctrl = 0

;---------------------------------------------------
;---------------------------------------------------
;sangre constante - (helper)
[Statedef 6100]
type    = S
movetype= I
physics = N
poweradd= 0
velset = 0,0
anim = 9123000
ctrl = 0
sprpriority = 5

[State 821, 2.2]
type = veladd
trigger1 = 1
y = 0.25

;gota de AIR
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 7000
ID = 7000
pos = 0,ceil(-2+(random/250))
scale = 1,1
sprpriority = 10
bindtime = -1
removetime = -1
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = pos Y >= -2 && vel y > 0
id = 7000

;charco
[State 0, Explod]
type = Explod
trigger1 = pos Y >= -2 && vel y > 0
anim = f ifelse(random/500,7001,7002)
ID = 7001
pos = 0,ceil(-2+(random/250))
scale = 1,1
sprpriority = -1
removetime = 1000
ownpal = 1

[State 700, 10]
type = destroyself
trigger1 = pos Y >= -2 && vel y > 0

;---------------------------------------------------
;---------------------------------------------------
;sangre VOLATIL - (helper)
[Statedef 6101]
type    = S
movetype= I
physics = N
poweradd= 0
velset = -4.5-(random/500.0),-3+(random/333.3)
anim = 9123000
ctrl = 0

[State 821, 2.2]
type = veladd
trigger1 = 1
y = 0.3

;gota de AIR
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 7007
ID = 7007
scale = 1,1
sprpriority = 10
bindtime = -1
removetime = -1
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = pos Y >= -2 && vel y > 0
id = 7007

;charco
[State 0, Explod]
type = Explod
trigger1 = pos Y >= -2 && vel y > 0
anim = f ifelse(random/500,7001,7002)
ID = 7001
pos = 0,ceil(-2+(random/250))
scale = 2,1
sprpriority = -1
removetime = 700
ownpal = 1

[State 700, 10]
type = destroyself
trigger1 = pos Y >= -2 && vel y > 0

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

[Statedef -2]

;[E]
; ai stuff
; Within StateDef -2, none of your own AI-related code should be placed
; above these next two controllers.

[State -2, StopAI]
type = VarSet
triggerall = var(58) > 0 && !IsHelper
trigger1 = RoundState != 2
trigger2 = !Alive
var(58) = -2
IgnoreHitPause = 1

; This controller is optional.  It allows you treat the AI flag as a boolean
; value rather than an integer value, letting you trigger your AI directives
; with "var(0)" instead of "var(58)>0", and letting you make moves usable only
; by humans by using "!var(0)" instead of "var(58)<1", thus slightly improving
; the size and efficiency of your code.
; Another benefit is that it makes it much easier for users to disable your AI,
; if they so choose.
[State -2, Simplifier]
type = VarSet
triggerall = !IsHelper
trigger1 = var(58) = 1
trigger2 = var(59):=0
var(59) = 1	; Another option is to replace 1 with something like MatchNo, if
		; you want to design your AI to have varying levels of difficulty.
IgnoreHitPause = 1
;-------------------------------------------------------

[State 0, VarSet]
type = VarSet
trigger1 = ctrl
var(25)=0

;anti BUG
[State 0, ChangeState]
type = ChangeState
trigger1 = stateno = 3210
trigger1 = numhelper(3230)=0
trigger1 = time < 100
value = 0
ctrl = 1

;grito cuando sufre
[State -2, 1]
type = PlaySnd
trigger1 = var(10) = 0 && time = 1 && alive
trigger1 = random < 500
trigger1 = (stateno = 5000)||(stateno = 5020)||(stateno = 5070)||(stateno = 5080)
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 8
freqmul = 0.9+(random/3333.3)
ignorehitpause = 1

;paneo de respiracion
[State 0, SndPan]
type = SndPan
trigger1 = 1
channel = 0
pan = 0

;apaga var de combo para cr-hp
[State 0, VarSet]
type = VarSet
trigger1 = stateno != 410
var(13)=0

[State -2, StopSnd]
type = StopSnd
trigger1 = stateno != 1210 && stateno!= 44 && stateno!= 101
channel = 13

[State -2, StopSnd]
type = StopSnd
trigger1 = stateno != 1100 && stateno != 1102 && stateno != 192 && stateno != 194 && stateno != 3500
channel = 16

[State -2, StopSnd]
type = StopSnd
trigger1 = stateno != 100 && stateno != 101
channel = 30

[State -2, StopSnd]
type = StopSnd
trigger1 = stateno != 100 && stateno != 101
channel = 31

[State -2, StopSnd]
type = StopSnd
trigger1 = stateno != 100 && stateno != 101
channel = 29


;DF
;bg palfx
[State -2, BGPalFX]
type = BGPalFX
trigger1 = var(10) = 1
time = 1
add = -40,-150,-150
color = 0
ignorehitpause = 1

;DF
;cancela aura
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = var(10) = 0
ID = 3102

;DF
;apaga variable
[State 0, VarSet]
type = VarSet
trigger1 = life = 0
v = 10
value = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = !(enemynear, Authorname = "Andres Borghi")
trigger1 = stateno != 170 && stateno != 181
flag = invisible


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

[Statedef -3]

;[E]
;ai stuff

;[StateDef -3]
;
; Kamek and Luchini appear to have been the first ones to use the IsHomeTeam AI
; activation concept.
; Feel free to move this controller to your character's intro state for slightly
; better efficiency.
[State -3, SetAI]
type = VarSet
triggerall = Alive && !IsHelper
triggerall = IsHomeTeam
trigger1 = TeamSide = 2
trigger2 = MatchNo > 1
var(58) = 1

[State -3, AI Helper - Compatibly Partnered Version]
type = Helper
trigger1 = !var(58) && !IsHelper
trigger1 = !NumHelper(9742)
trigger1 = Alive && RoundState = 2
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

; If you want to use the Guard mode, Dummy mode, Distance, or Button jam dummy
; control options in Training mode without activating the dummy's AI while
; working on the character, then all you need to do is temporarily disable
; this controller.  Or, if you want to permanently disable this controller in
; Training mode, then you could use the Training mode detection code available
; from my site ( http://www.mugenguild.net/~winane/ ), and then just add a
; "(var(59)&63)>30" triggerall to this controller.
; Alternatively, you can just set "Dummy control" to "Manual", press a P2 button
; to kill the AI helper, and then set dummy control back to "Cooperative".  (In
; fact, setting dummy control to manual isn't even necessary, if you press the
; P2 button prior to the first time you pause.)
[State -3, AI Helper]
type = Helper
triggerall = !var(58) && !IsHelper
triggerall = !NumHelper(9741)
triggerall = Alive && RoundState = 2
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = var(58) = -2 && !IsHelper
trigger1 = Alive && RoundState = 2
var(58) = 1

; This method works somewhat in Linux Mugen version 2002.04.14,
; whereas the old humanly-impossible commands method does not.
; It is very important that this controller NOT be moved to State -2.
; Note that this part won't work nearly as well if AI.Cheat is turned off
; in mugen.cfg.
[State -3, XOR]
type = VarSet
triggerall = var(58)!=1 && !IsHelper
triggerall = !var(56)
triggerall = var(57) = GameTime-1
trigger1 = command = "a" ^^ command = "a2"
trigger2 = command = "b" ^^ command = "b2"
trigger3 = command = "c" ^^ command = "c2"
trigger4 = command = "x" ^^ command = "x2"
trigger5 = command = "y" ^^ command = "y2"
trigger6 = command = "z" ^^ command = "z2"
trigger7 = command = "start" ^^ command = "start2"
trigger8 = command = "holda" ^^ command = "holda2"
trigger9 = command = "holdb" ^^ command = "holdb2"
trigger10 = command = "holdc" ^^ command = "holdc2"
trigger11 = command = "holdx" ^^ command = "holdx2"
trigger12 = command = "holdy" ^^ command = "holdy2"
trigger13 = command = "holdz" ^^ command = "holdz2"
trigger14 = command = "holdstart" ^^ command = "holdstart2"
trigger15 = command = "holdfwd" ^^ command = "holdfwd2"
trigger16 = command = "holdback" ^^ command = "holdback2"
trigger17 = command = "holdup" ^^ command = "holdup2"
trigger18 = command = "holddown" ^^ command = "holddown2"
trigger19 = command = "recovery" ^^ command = "recovery2"
;Add more as desired. (See my notes in the CMD.)
var(58) = 1

; These next two controllers must be placed here, after the above XOR
; VarSet controller and before the below GameTime VarSet controller.
[State -3, fiXOR]
type = VarAdd
trigger1 = var(56) > 0 && !IsHelper
var(56) = -1

[State -3, fuXOR]
type = VarSet
trigger1 = var(57) < GameTime-1 && !IsHelper
var(56) = 31
IgnoreHitPause = 1

; It is very important that this controller NOT be moved to State -2, as putting
; it there would defeat the entire purpose of the controller, allowing the
; helper method or the XOR method to erroneously set the AI variable.
; And within State -3, don't put any ChangeState controllers before this
; controller, lest you unnecessarily delay your character's AI activation.
[State -3, GameTimeVar]
type = VarSet
trigger1 = !IsHelper
var(57) = GameTime
IgnoreHitPause = 1

; Within StateDef -3, none of your own AI-related code should come after the code
; provided here (and putting it before the code is also generally a bad idea).
; It's better to use State -1 (or, in special circumstances, State -2) instead.

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
value = 40, 0
freqmul = 0.6+(random/5000.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
triggerall = time=1
trigger1 = stateno = 50
value = 0,1
volume = -100
freqmul = 0.6+(random/6666.6)

;se cancela afterimage si es golpeado
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = movetype = h
time = 0

;DF
;baja el poder mientras esta en DF
[State -3, PowerAdd]
type = PowerAdd
triggerall = var(10) = 1
trigger1 = roundstate = 2
value = -3
ignorehitpause = 1

;DF
;baja el poder mientras esta en DF si es golpeado
[State -3, PowerAdd]
type = PowerAdd
triggerall = var(10) = 1
trigger1 = movetype = H && !time
value = -60

;DF
;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = var(10) = 1
slot = 0
attr = SCA, AA,AP
stateno = 3190
time = 1

;DF
;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = var(10) = 1
value = ,AT
time = 1

;DF
;width
[State 0, Width]
type = Width
trigger1 = var(10) = 1
value = -10,-10

;sangre constante
[State 0, Helper]
type = Helper
trigger1 = life <= 250 && random < 10
trigger1 = roundstate = 2 && movetype != H && alive = 1
trigger1 = var(10)=0
trigger1 = stateno != 3210 && stateno != 3510 && stateno != 3511 && stateno != 3520
name = "sangre constante"
ID = 6100
stateno = 6100
pos = ceil(-8+(random/60)), ceil(ifelse(statetype != c,-40,-20)-(ifelse(statetype != c,(random/21),(random/40))))
facing = ifelse(random<500,1,-1)
ownpal = 1


;-----------------
;fatal move Peketo
;-----------------
;decapitado - cabeza (helper)
[Statedef 912320]
type    = A
movetype= I
physics = N
poweradd= 0
ctrl = 0
velset = -1+(random/500.0),ifelse(root,stateno=3011,-10,-5)
sprpriority = 7
anim = 912320

[State 210, Width]
type = veladd
trigger1 = 1
y = .3

[State 191, Snd 2]
type = PlaySnd
trigger1 = pos Y >= -3 && vel y > 0
value = F7,0
freqmul = 1.3
volume = 100
persistent = 0

[State 220, 3]
type = velset
trigger1 = pos Y >= -3 && vel y > 0
y = -4.8
persistent = 0

[State 220, 3]
type = changeanim
trigger1 = pos Y >= 0 && vel y > 0
value = 912321

[State 0, VelSet]
type = VelSet
trigger1 = anim = 912321
x = 0
y = 0

[State 0, VelSet]
type = posSet
trigger1 = anim = 912321
y = 4

[State 191, Snd 2]
type = PlaySnd
trigger1 = anim = 912321
value = F7,0
freqmul = 1.3
volume = 100
persistent = 0

;----------------------------
;------------------------
;fatal move custom Animus
;------------------------
;cortado al medio - piernas (helper)
;helper MORPH
[Statedef 91241]
type    = S
movetype= I
physics = N
poweradd= 0
ctrl = 0

[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = !time
value = 91242

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = 3+(random/500.0)
y = -3

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .4

[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = vel y > 0 && pos y > 0
value = 91243

[State 0, VelSet]
type = VelSet
trigger1 = anim = 91243
x = 0
y = 0

[State 0, VelSet]
type = posset
trigger1 = anim = 91243
y = 0

;ondita
[State 0, Explod]
type = Explod
trigger1 = anim = 91243
anim = f 61
pos = 20,0
sprpriority = 0
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 91243
time = 10
ampl = -8
persistent = 0

[State 440, 2]
type = PlaySnd
trigger1 = anim = 91243
value = f 7, 1
persistent = 0

;---------------------------------------------------
;---------------------------------------------------
;CANALES DE SONIDO
;13: -respiracion mujer de nieve - grito de stand random
;14: -supergrave fatal
;16: -daskete intro - llanto okiku - grito juon fatal
;17: -fatal psicofonia
;18: -fatal llanto
;19: -gong fatal - finallento1
;30,31,32 - sonidos run forward


;[E]
; ai activation

;***************************************************************************
; ST
;***************************************************************************

; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.)
;
;------------------
; AI Activation Helper State - Primary Version
; (Credit to YongMing for the basic HitPause bugfix concept.)
;
; var(1) - First tick button activation prevention.
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Persistent direction command detection enabler (due to 2002.04.14).
; var(9) - AutoTurn bug fixer.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(58) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9741]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9741, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 5050

[State 9741, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = 2

[State 9741, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(3):=0
var(2) = (var(3):=1)+(var(4):=0)

[State 9741, Facing]
type = Turn
trigger1 = var(9):=(Facing != Parent,Facing)
trigger1 = !(var(4):=0)

[State 9741, DirTurnOnAI]
type = ParentVarSet
triggerall = !(var(3) || var(9))
trigger1 = Parent,command = "holdfwd"
trigger2 = Parent,command = "holdback"
trigger3 = Parent,command = "holdup"
trigger4 = Parent,command = "holddown"
trigger5 = !(var(4):=1)
var(58) = var(4)

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(58)
trigger1 = command = "holdfwd"
trigger1 = Parent,command = "holdfwd"
trigger2 = command = "holdback"
trigger2 = Parent,command = "holdback"
trigger3 = command = "holdup"
trigger3 = Parent,command = "holdup"
trigger4 = command = "holddown"
trigger4 = Parent,command = "holddown"
var(58) = var(4):=0

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
var(58) = 1

[State 9741, ButtonTurnOffAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = command = "a"
trigger1 = Parent,command = "a"
trigger2 = command = "b"
trigger2 = Parent,command = "b"
trigger3 = command = "c"
trigger3 = Parent,command = "c"
trigger4 = command = "x"
trigger4 = Parent,command = "x"
trigger5 = command = "y"
trigger5 = Parent,command = "y"
trigger6 = command = "z"
trigger6 = Parent,command = "z"
trigger7 = command = "start"
trigger7 = Parent,command = "start"
var(58) = -1

[State 9741, UnPauseCheck]
type = VarSet
triggerall = var(2)
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
trigger8 = var(2) = 2
trigger8 = var(2):=0
var(2) = 2

[State 9741, Goodbye]
type = DestroySelf
triggerall = var(1):=1
trigger1 = Parent,var(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2


;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick activation prevention
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Hitpause check.
; var(5) - No button on previous tick.
; var(6) - Any dir on this tick.
; var(7) - Any button on this tick.
; var(8) - Matching partner button detected.
; var(9) - AutoTurn bug fixer.
; var(10)- Buffered dir detection disabler.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(58) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9742]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9742, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 5050

[State 9742, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = var(3):=2

[State 9742, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(1)
trigger5 = var(3):=0
var(2) = var(3):=1

[State 9742, Facing]
type = Turn
trigger1 = var(9):=(Facing != Parent,Facing)

[State 9742, ParentDirCheck]
type = VarSet
trigger1 = Parent,command = "holdfwd"
trigger2 = Parent,command = "holdback"
trigger3 = Parent,command = "holdup"
trigger4 = Parent,command = "holddown"
trigger5 = var(6):=0
var(6) = 1

[State 9742, BufferCheck]
type = VarSet
trigger1 = var(3) || var(4) || var(10)
var(10) = var(6)

[State 9742, ParentButtonCheck]
type = VarSet
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
trigger8 = var(7):=0
var(7) = 1

[State 9742, SameButtonCheck]
type = VarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = NumPartner
trigger1 = Parent,command = "a"
trigger1 = Partner,command = "a"
trigger2 = Parent,command = "b"
trigger2 = Partner,command = "b"
trigger3 = Parent,command = "c"
trigger3 = Partner,command = "c"
trigger4 = Parent,command = "x"
trigger4 = Partner,command = "x"
trigger5 = Parent,command = "y"
trigger5 = Partner,command = "y"
trigger6 = Parent,command = "z"
trigger6 = Partner,command = "z"
trigger7 = Parent,command = "start"
trigger7 = Partner,command = "start"
trigger8 = var(8):=0
var(8) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(6)
trigger1 = !(var(9) || var(10))
var(58) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(58)
trigger1 = command = "holdfwd"
trigger1 = Parent,command = "holdfwd"
trigger2 = command = "holdback"
trigger2 = Parent,command = "holdback"
trigger3 = command = "holdup"
trigger3 = Parent,command = "holdup"
trigger4 = command = "holddown"
trigger4 = Parent,command = "holddown"
var(58) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5) && var(7)
trigger1 = !(var(2) || var(8))
var(58) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !(var(2) || var(8))
trigger1 = command = "a"
trigger1 = Parent,command = "a"
trigger2 = command = "b"
trigger2 = Parent,command = "b"
trigger3 = command = "c"
trigger3 = Parent,command = "c"
trigger4 = command = "x"
trigger4 = Parent,command = "x"
trigger5 = command = "y"
trigger5 = Parent,command = "y"
trigger6 = command = "z"
trigger6 = Parent,command = "z"
trigger7 = command = "start"
trigger7 = Parent,command = "start"
var(58) = -1

[State 9742, UnPauseCheck]
type = VarSet
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = var(2) = 2
trigger2 = var(2):=0
var(2) = 2

[State 9742, Goodbye]
type = DestroySelf
trigger1 = Parent,var(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6) || var(7)
trigger2 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = var(1):=1
var(5) = !var(7)
