;-----NO MODIFICAR-----
[Data]
life = 1800
attack = 200
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 0
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;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, -90   ;Approximate position of head
mid.pos = -5, -60    ;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      ;Walk forward
walk.back = -2     ;Walk backward
run.fwd  = 4       ;Run forward (x, y)
run.back = 4       ;Hop backward (x, y)
jump.neu = 0,-9.2  ;Neutral jumping velocity (x, y)
jump.back = -2.88  ;Jump back Speed (x, y)
jump.fwd = 2.88    ;Jump forward Speed (x, y)
runjump.back = -1.88,-6.1 ;Running jump speeds (opt)
runjump.fwd = 2,-6.1      ;.
airjump.neu = 0,-6.1      ;.
airjump.back = -1.88      ;Air jump speeds (opt)
airjump.fwd = 1.88         ;.

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


;---------------------------------------------------------------------------
;CROUCHING
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0
ctrl = 1

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11
;---------------------------------------------------------------------------
;CORRER
[Statedef 101]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State 101]
type = PosSet
trigger1 = !Time
y = 0

[State 101]
type = VarAdd
triggerall = Var(59) > 5
trigger1 = Var(2) && EnemyNear,Vel X != 0
v = 18
value = 1

[State 101]
type = VarAdd
triggerall = Var(59) > 5 && Var(18)
trigger1 = EnemyNear,MoveType = A
trigger2 = !Var(2)
trigger3 = EnemyNear,Vel X = 0 && EnemyNear,Time >= 80
v = 18
value = -1

[State 101]
type = CtrlSet
triggerall = PrevStateNo != 2040 && PrevStateNo != 2041
trigger1 = (EnemyNear,Pos x-Pos x)*Facing <= 85
trigger2 = EnemyNear,StateType = L
trigger3 = EnemyNear,StateType = A
trigger4 = EnemyNear,MoveType = A
value = 1

[State 101]
type = Turn
triggerall = PrevStateNo = 2041
trigger1 = Time = 100

[State 101, 1]
type = VelSet
trigger1 = EnemyNear,Vel x < 0 && Var(18)
trigger2 = !Var(18)
trigger3 = PrevStateNo = 1541
x = const(velocity.run.fwd.x)

[State 101]
type = ChangeAnim
triggerall = Vel X = 0
trigger1 = Anim != 0
trigger2 = AnimTime = 0
value = 0

[State 101]
type = ChangeState
triggerall = Var(59) && Var(18) && BackEdgeBodyDist >= 30
trigger1 = EnemyNear,Vel X >= 0
value = 21

[State 101]
type = ChangeState
triggerall = Var(59)
trigger1 = EnemyNear,MoveType = A && EnemyNear,Vel X > 0 && (EnemyNear,Pos X-Pos X)*Facing <= 80
trigger1 = Random <= (Var(59)+Var(2))*40
value = 40
ctrl = 1

[State 101]
type = ChangeState
triggerall = Var(18) && BackEdgeBodyDist >= 30
trigger1 = Vel X = 0 && Time >= 60 && (EnemyNear,Pos X-Pos X)*Facing <= 120
value = 105

[State 101]
type = ChangeState
triggerall = Vel X = 0 && (EnemyNear,Pos X-Pos X)*Facing > 120
trigger1 = Time >= 60
value = 1520
ctrl = 0

[State 101, 2]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 101, 3]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 101]
type = ScreenBound
trigger1 = PrevStateNo = [2040,2041]
value = 0
movecamera = 0,0

[State 101]
type = ChangeAnim
trigger1 = PrevStateNo = 2040 && BackEdgeBodyDist >= 70
trigger2 = PrevStateNo = 2041 && Time > 200 && BackEdgeBodyDist >= 40
value = 2011
elem = 34
persistent = 0

[State 101]
type = PlaySnd
trigger1 = Anim = 2011
value = 2010,ifelse(FVar(2)>=.285,1,0)
persistent = 0

[State 101]
type = VelSet
trigger1 = Anim = 2011
x = 0

[State 101]
type = ChangeState
trigger1 = Win && PrevStateNo != 2041
trigger2 = (EnemyNear,Pos x-Pos x)*Facing <= 0 && PrevStateNo != 2041
trigger3 = Anim = 2011 && AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;JUMP
[Statedef 99]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 36
value = 1 ; numero de air jums, dash y vuelos que puede hacer

[State 210, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40, 0

[State 5120, 4]
type = PlaySnd
trigger1 = time = 0 && Gametime % 2 = 0
value = 40,1

[State 5120, 4]
type = PlaySnd
trigger1 = time = 0 && Gametime % 2 = 1
value = 40,1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 8]
type = ChangeState
trigger1 = Animtime = 0
value = 50
ctrl = 1

[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 45, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 4]
type = VelSet
trigger1 = Time = 2
y = const(velocity.airjump.y)

[State 45, 5]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

[Statedef 50]
type    = A
physics = A
anim = 41
ctrl = 1

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeState
trigger1 = Vel Y > -3
value = 51

;---------------------------------------------------------------------------
; LOSE BY TIME OVER - PERDER POR TIEMPO
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; WIN STATE DECIDER - ESTADO DE VICTORIA
[Statedef 180]
type = S

[State 180, 1]
type = VarRandom
trigger1 = Time = 0
v = 1
range = 0,59

[State 180, 2]
type = ChangeState
trigger1 = Var(1) = [0,19]
value = 181

[State 180, 3]
type = ChangeState
trigger1 = Var(1) = [0,59]
value = 182

;---------------------------------------------------------------------------
;POSE DE VICTORIA - PRESENTACION CUTMAN
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

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

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 5
x = 0
y = -7

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,100]
flag = roundnotover

;---------------------------------------------------------------------------
; POSE DE VICTORIA - HA
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 82
value = 300,0

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

;---------------------------------------------------------------------------
;INTRO STATE
[Statedef 191]
type = S
ctrl = 0
anim = 190

[State 191, 1]
type = AfterImage
anim = 23
Trigger1 = time = 1
length = 15
PalColor = 0
TimeGap = 1
FrameGap = 3
Trans = Add1
time = 80

[State 0, VelSet]
type = VelSet
trigger1 = time = 60
y = 9

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 60
value = 190,1

[state 191, AssertSpecial Flag]
type     = assertspecial
trigger1 = 1
flag     = intro
flag2 = nomusic

[state 191]
type = playsnd
trigger1 = time = 0
loop = 1
value = 5, 0
channel = 5

[state 191, 1]
type     = posset
trigger1 = time = 0
y = -300

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 60
value = 190,0

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

[State 191 3]
type = velset
trigger1 = Vel Y> 0
trigger1 = Pos Y> 0
x= 0
y= 0

[State 191 3]
type = changestate
trigger1 = Vel Y = 0
trigger1 = time >= 65
value = 192

;---------------------------------------------------------------------------
; STAND
[Statedef 0]
type = S
physics = N
sprpriority = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
;---------------------[ヘルパー]
[state a];音楽
type = Helper
triggerall = ishelper = 0
trigger1 = numhelper(2000) = 0
id = 2000
name = "music"
sprpriority = 5
pos = 0,0
postype = p1
stateno = 2000
helpertype = normal
pausemovetime = 0
ignorehitpause = 1
persistent = 0
keyctrl = 0
ownpal = 1

[State 0, 4]
type = ChangeState
triggerall = ishelper = 0
triggerall = ctrl = 1
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
trigger3 = command = "holdup"
trigger4 = command = "holddown"
value = 1
ctrl = 1

;-----------------------------
;Note: Putting -1,0 for the sprite means it does not draw anything
[Statedef 192]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 192, 1]
type = AfterImage
anim = 23
Trigger1 = time = 1
length = 15
PalColor = 0
TimeGap = 1
FrameGap = 3
Trans = Add1
time = 15

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 120
value = 190,2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 13
value = 300,1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 20
value = 300,1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 31
value = 300,0

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
x = 0
y = -6

[state 191, AssertSpecial Flag]
type     = assertspecial
trigger1 = 1
flag     = intro
flag2 = nomusic

[State 191 3]
type = changestate
trigger1 = animtime = 0
value = 0

[State 191, StopSnd]
type = StopSnd
trigger1 = time = 320
channel = 5

[State 191,4]
type = Explod
trigger1 = Time = 50
anim = 1000
id = 102
postype = p1
pos = -3,0
ownpal = 1
bindtime = 1
sprpriority = 5
persistent = 0
removeongethit = 0

[State 191,5]
type = Explod
trigger1 = Time = 80
anim = 1000
id = 102
postype = p1
pos = -3,0
ownpal = 1
bindtime = 1
sprpriority = 5
persistent = 0
removeongethit = 0
;---------------------------------------------------------------------------
; TAUNT
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 35
value = 190,2

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

;---------------------------------------------------------------------------
; KO STATE
[Statedef 5150]
type    = L
movetype= H
physics = N
anim = 5150
sprpriority = -3
time = 40

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 0
y = 0
time = 40

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible
time = 40

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 80,2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 7,1
volume = 255

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

[state 1810, SND]
type = playsnd
trigger1 = time = 60
loop = 1
value = 400, 0
channel = 5

[State 1810]
type = palfx
trigger1 = time = 0
add = 0,116,116
sinadd = 0,15,15, 5
color = 0
time = 60

[State 1810, 3]
type = Explod
trigger1 = time = 0
anim = 5150
removetime = 60

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 1.5,0
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 1.4,-0.5
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 1.1,-1.1
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 0.5,-1.4
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 0,-1.5
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -1.5,0
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -1.4,-0.5
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -1.1,-1.1
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -0.5,-1.4
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 1.4,0.5
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 1.1,1.1
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 0.5,1.4
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = 0,1.5
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -1.4,0.5
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -1.1,1.1
removetime = 240

[State 1810, 3]
type = Explod
trigger1 = time = 60
anim = 1810
pos = 0,-20
ontop = 1
vel = -0.5,1.4
removetime = 240

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

;-------------------------------------------------------------------------
;SUPER SALTO
[Statedef 999]
type    = A
physics = A
ctrl = 1
anim = 41
velset = 0, -14

[State 999, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 0,5

[State 999, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 190,2

[State 999, 1]
type = AfterImage
anim = 23
Trigger1 = time = 1
length = 15
PalColor = 0
TimeGap = 1
FrameGap = 3
Trans = Add1
time = 80

[State 999, 1]
type = afterimagetime
anim = 23
trigger1 = movecontact
trigger2 = FrontEdgeDist <= 15
trigger3 = time >= 60
value = 0

[State 200, 1]
type = PlaySnd
trigger1 = time = 0 && command = "holdback"
value = 2, 0

[State 200, 1]
type = PlaySnd
trigger1 = time = 0 && command = "holdfwd"
value = 2, 0

[State 200, 1]
type = PlaySnd
trigger1 = time = 0 && command != "holdback" && command != "holdfwd"
value = 2, 0

[State 999, 1a]
type = VelAdd
triggerall = Vel X >= -4
trigger1 = Time > 1
trigger1 = Time < 15
trigger1 = command = "holdback"
trigger1 = Anim != 43
x = -0.6

[State 999, 1a]
type = VelAdd
triggerall = Vel X >= -4
trigger1 = Var(20) = 1
trigger1 = Time > 1
trigger1 = Time < 15
trigger1 = P2BodyDist X = [-90,0]
trigger1 = Anim != 43
x = -0.6

[State 999, 1b]
type = VelAdd
triggerall = Vel X <= 4.5
trigger1 = Time > 1
trigger1 = Time < 15
trigger1 = command = "holdfwd"
trigger1 = Anim != 42
x = 0.6

[State 999, 1b]
type = VelAdd
triggerall = Vel X <= 4.5
trigger1 = Var(20) = 1
trigger1 = Time > 1
trigger1 = Time < 15
trigger1 = P2BodyDist X = [0,999]
x = 0.6

[State 999, 2a]
type = VelSet
trigger1 = Anim = 42
trigger1 = Time = [0,5]
x = 5

[State 999, 2b]
type = VelSet
trigger1 = Anim = 43
trigger1 = Time = [0,5]
x = -5.5

[State 999, ChangeAnim] ;Change to jumping forward anim
type = ChangeAnim
trigger1 = Vel X > 0
trigger1 = Time = [0,5]
value = 42

[State 998, ChangeAnim2] ;Change to jumping back anim
type = ChangeAnim
trigger1 = Vel X < 0
trigger1 = Time = [0,2]
value = 43

;----------------------------------------------------------------------------
;MUSIC
[Statedef 2000]
type = S
movetype = I
ctrl = 0
anim = 2000
velset = 0,0
physics = N
sprpriority = 0

[state a]
type = AssertSpecial
trigger1 = 1
flag = nomusic

;---------------------[音]
[State a]
type = PlaySnd
trigger1 = time = 0
value = 2000, 0
loop = 1
channel = 5

;---------------------[消滅]
[state a]
type = changestate
trigger1 = root,stateno = 1100
trigger1 = root,animelem = 15
value = 2001

;----------------------------------------------------------------------------
;HELPER MUSIC
[Statedef 2001]
type = S
movetype = A
ctrl = 0
anim = 2000
velset = 0,0
physics = N
sprpriority = 0

[state a]
type = AssertSpecial
trigger1 = 1
flag = nomusic

;---------------------[音]
[state a]
type = stopsnd
trigger1 = time = 0
channel = 5

;---------------------[消滅]
[state a]
type = destroyself
trigger1 = root,stateno = -2
trigger1 = root,animelem = 15

;---------------------------------------------------------------------------
;CUT A
[Statedef 2011]
type    = C
physics = C
anim = 200
sprpriority = 1
ctrl = 0

[State 2011, 0]
type = PlaySnd
trigger1 = animelem = 8
value = 600, 1
volume = 200

[State 1100, 1]
type = helper
trigger1 = Animelem = 8
trigger1 = Var(11) = 0
postype = p1
pos = 18,-9
id = 30
stateno = 30
helpertype = normal
ownpal = 1
supermovetime = 450

[State 1100, 3]
type = CtrlSet
trigger1 = time = 80
value = 1

[State 1100, 4]
type = VarSet
trigger1 = Animelem = 1
v = 11
value = 0

[State 1110, 5]
type = ChangeState
trigger1 = Animtime = 0
value = 11

;---------------------------------------------------------------------------
;CUT A HELPER
[statedef 30]
type    = s
movetype= a
physics = s
juggle  = 8
anim = 23
ctrl = 0
sprpriority = 5

[State 302, AI]
type = AfterImage
trigger1 = time = 1
time = 100
TimeGap = 1
FrameGap = 2
length = 15
Trans = Add1

[State 2011, 0]
type = PlaySnd
trigger1 = time = 1
value = 600, 0
volume = 200

[State 35, 0]
type = PowerAdd
trigger1 = time = 0
value = 50

[State 30, 0]
type = VelSet
trigger1 = 1
x = 6.0
y = 0

[State 30, 1]
type = HitDef
trigger1 = 1
attr = S, SP
damage = 15,2
animtype = Low
guardflag = MA
pausetime = 0,0
sparkno = 9999
guard.sparkno = 9999
hitsound   = 5000,0
guardsound = 120,0
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
ground.velocity = -1
air.velocity = -1,-5
givepower = 2,1
getpower = 3,1

[State 30, end]
type = Destroyself
trigger1 = FrontEdgeDist < 0
trigger2 = MoveContact

;---------------------------------------------------------------------------
;CUT AEREAS A
[Statedef 2012]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -150
ctrl = 0
velset = 0
anim = 600

[State 2012, 0]
type = PlaySnd
trigger1 = Time = 6
value = 600, 0

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

[State 2012, 1]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 2012, 2]
type = Projectile
;trigger1 = AnimElem = 1
trigger1 = Time = 1
trigger1 = NumHelper < 10
projanim = 23
offset = 24, -25
velocity = 2, 2
remvelocity = 3,0
attr = A, NP
damage    = 15,4
givepower = 10,5
animtype = Medium
guardflag = MA
pausetime = 0,10
;sparkno = 0
sparkxy = 0, 0
hitflag = MAFD
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -8
airguard.velocity = -3.5
air.velocity = -2.5,-5.5
air.juggle = 3

[State 2012, 11]
type = CtrlSet
trigger1 = AnimTime = -1
value = 1

[State 2012, 12]
type = ChangeState
trigger1 = Time = 12
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;CUT B
[Statedef 2013]
type    = C
physics = C
anim = 200
sprpriority = 1
ctrl = 0

[State 2013, 0]
type = PlaySnd
trigger1 = animelem = 8
value = 600, 1
volume = 200

[State 1100, 1]
type = helper
trigger1 = Animelem = 8
trigger1 = Var(11) = 0
postype = p1
pos = 18,-9
id = 31
stateno = 31
helpertype = normal
ownpal = 1
supermovetime = 450

[State 1100, 3]
type = CtrlSet
trigger1 = time = 80
value = 1

[State 1100, 4]
type = VarSet
trigger1 = Animelem = 1
v = 11
value = 0

[State 1110, 5]
type = ChangeState
trigger1 = Animtime = 0
value = 11
;---------------------------------------------------------------------------
;CUT AEREAS B
[Statedef 2014]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -150
ctrl = 0
velset = 0
anim = 600

[State 2014, 0]
type = PlaySnd
trigger1 = Time = 6
value = 600, 0

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

[State 2014, 1]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 2014, 2]
type = Projectile
;trigger1 = AnimElem = 1
trigger1 = Time = 1
trigger1 = NumHelper < 10
projanim = 23
offset = 24, -25
velocity = 6, 6
remvelocity = 3,0
attr = A, NP
damage    = 15,4
givepower = 10,5
animtype = Medium
guardflag = MA
pausetime = 0,10
;sparkno = 0
sparkxy = 0, 0
hitflag = MAFD
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -8
airguard.velocity = -3.5
air.velocity = -2.5,-5.5
air.juggle = 3

[State 2014, 2]
type = afterimagetime
anim = 23
trigger1 = movecontact
trigger2 = FrontEdgeDist <= 15
trigger3 = time >= 60
value = 0

[State 2014, 11]
type = CtrlSet
trigger1 = AnimTime = -1
value = 1

[State 2014, 12]
type = ChangeState
trigger1 = Time = 12
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;CUT A HELPER
[statedef 31]
type    = s
movetype= a
physics = s
juggle  = 8
anim = 23
ctrl = 0
sprpriority = 5

[State 302, AI]
type = AfterImage
trigger1 = time = 1
time = 100
TimeGap = 1
FrameGap = 2
length = 15
Trans = Add1

[State 2013, 0]
type = PlaySnd
trigger1 = time = 1
value = 600, 0
volume = 200

[State 35, 0]
type = PowerAdd
trigger1 = time = 0
value = 50

[State 30, 0]
type = VelSet
trigger1 = 1
x = 6.0
y = 0

[State 31, 1]
type = HitDef
trigger1 = 1
attr = S, SP
damage = 15,2
animtype = Low
guardflag = MA
pausetime = 0,0
sparkno = 9999
guard.sparkno = 9999
hitsound   = 5000,0
guardsound = 120,0
ground.type = High
ground.slidetime = 22
ground.hittime  = 22
ground.velocity = -1
air.velocity = -1,-10
givepower = 2,1
getpower = 3,1

[State 31, end]
type = Destroyself
trigger1 = FrontEdgeDist < 0
trigger2 = MoveContact

;---------------------------------------------------------------------------
;CUT C
[Statedef 2015]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 150
ctrl = 0
velset = 0
anim = 200

[State 2015, 0]
type = PlaySnd
trigger1 = animelem = 8
value = 600, 0

[State 2015, 0]
type = PlaySnd
trigger1 = animelem = 8
value = 190, 2

[State 2015, 1]
type = Projectile
;trigger1 = AnimElem = 1
trigger1 = animelem = 8
trigger1 = NumHelper < 10
projanim = 23
offset = 24, -2
velocity = 6,0
remvelocity = 3,0
attr = S, NP
damage    = 15,4
givepower = 10,5
animtype = Medium
guardflag = MA
pausetime = 0,10
;sparkno = 0
sparkxy = 0, 0
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -8
air.type = low
air.velocity = -2.5,-5
air.juggle = 3

[State 2015, 1]
type = AfterImage
anim = 23
Trigger1 = time = 1
length = 15
PalColor = 0
TimeGap = 1
FrameGap = 3
Trans = Add1
time = 20

[State 2015, 1]
type = afterimagetime
anim = 23
trigger1 = movecontact
trigger2 = FrontEdgeDist <= 15
trigger3 = time >= 60
value = 0

[State 2015,9]
type = CtrlSet
trigger1 = AnimTime = 0
value = 1

[State 2015,10]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
Time = 1
ctrl = 1

;-------------------------------------------
;CUT AEREAS C
[Statedef 2016]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -150
ctrl = 0
velset = 0
anim = 600

[State 2016, 0]
type = PlaySnd
trigger1 = Time = 6
value = 600, 0

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

[State 2016, 1]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 2016, 2]
type = Projectile
;trigger1 = AnimElem = 1
trigger1 = Time = 1
trigger1 = NumHelper < 10
projanim = 23
offset = 24, -25
velocity = 4, 4
remvelocity = 3,0
attr = A, NP
damage    = 15,4
givepower = 10,5
animtype = Medium
guardflag = MA
pausetime = 0,10
;sparkno = 0
sparkxy = 0, 0
hitflag = MAFD
hitsound   = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -8
airguard.velocity = -3.5
air.velocity = -2.5,-5.5
air.juggle = 3

[State 2016, 2]
type = AfterImage
anim = 23
Trigger1 = time = 1
length = 15
PalColor = 0
TimeGap = 1
FrameGap = 3
Trans = Add1
time = 20

[State 2016, 11]
type = CtrlSet
trigger1 = AnimTime = -1
value = 1

[State 2016, 12]
type = ChangeState
trigger1 = Time = 12
value = 50
ctrl = 1


;------------------------
;PAL FX
[Statedef 16001]
type = U
movetype = H
physics = U
ctrl = 1

[State 6000, 1]
type = palfx
trigger1 = time = 0
add = 0,116,116
sinadd = 0,15,15, 5
color = 0
time = 5

[State 6000, 2]
type = NotHitBy
trigger1 = time = 0
value = SCA
time = 5

[State 6000, 5]
type = changestate
trigger1 = time = 1
value = 50
ctrl = 1

;--------------------------
;KO STATE
[Statedef -2]

[State -2, KO]
type = ChangeState
triggerall = StateNo = [0,39]
trigger1 = pos y <= -2
value = 50

;NO SLOW KO - NO KO LENTO
[State -2, KO]
type = ChangeState
triggerall = StateNo != 5150
triggerall = StateNo = [5000, 6002]
trigger1 = Lose
trigger2 = !Life
value = 5150

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

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

[Statedef -3]

[State -3, Nobodygethurt suelo]
type = HitOverride
trigger1 = statetype != A
time = 1
attr = SCA, NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 16000

[State -3, Nobodygethurt aire]
type = HitOverride
trigger1 = statetype = A
time = 1
attr = SCA, NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 16001

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard

[Statedef 16000]
type = U
movetype = H
physics = U
ctrl = 1

[State 6000, 1]
type = palfx
trigger1 = time = 0
add = 0,116,116
sinadd = 0,15,15, 5
color = 0
time = 5

[State 6000, 2]
type = NotHitBy
trigger1 = time = 0
value = SCA
time = 5

[State 6000, 5]
type = changestate
trigger1 = time = 1
value = 0
ctrl = 1
;----------------------------
;AI
[Statedef 9741]
type=A
movetype=I
physics=N
anim=9741
ctrl=0

[State 9741, wrong]
type=destroyself
trigger1= (parent,ID)!=(root,ID)
[State 9741, safety]
type=selfstate
trigger1= !ishelper
value=0

[State 9741, uglyhack]
type=varset
trigger1= !var(1)
var(2)=1
[State 9741, pausecheck]
type=varset
trigger1= gametime>root,var(58)
trigger2= !(root,alive)
trigger3= roundstate!=2
trigger4= root,var(59)
var(2)=1

[State 9741, facing]
type=turn
trigger1= var(9):=(facing!=root,facing)

[State 9741, dirturnonAI]
type=parentvarset
triggerall= !var(2) && !var(9)
trigger1= root,command="fwd"
trigger2= root,command="back"
trigger3= root,command="up"
trigger4= root,command="down"
var(59)=1
[State 9741, dirturnoffAI]
type=parentvarset
triggerall= !var(2) && !var(9) && (root,var(59)>=1)
trigger1= command="fwd" && root,command="fwd"
trigger2= command="back" && root,command="back"
trigger3= command="up" && root,command="up"
trigger4= command="down" && root,command="down"
var(59)=-1

[State 9741, buttonturnonAI]
type=parentvarset
triggerall= !var(2)
trigger1= root,command="a"
trigger2= root,command="b"
trigger3= root,command="c"
trigger4= root,command="x"
trigger5= root,command="y"
trigger6= root,command="z"
trigger7= root,command="start"
var(59)=1
[State 9741, buttonturnoffAI]
type=parentvarset
triggerall= !var(2) && (root,var(59)>=1)
trigger1= command="a" && root,command="a"
trigger2= command="b" && root,command="b"
trigger3= command="c" && root,command="c"
trigger4= command="x" && root,command="x"
trigger5= command="y" && root,command="y"
trigger6= command="z" && root,command="z"
trigger7= command="start" && root,command="start"
var(59)=-1

[State 9741, unpausecheck]
type=varset
triggerall= var(2)
trigger1= root,command="fwd" || root,command="back" || root,command="up" || root,command="down"
trigger2= root,command="a" || root,command="b" || root,command="c"
trigger3= root,command="x" || root,command="y" || root,command="z"
trigger4= root,command="start"
trigger5= var(2)=1
trigger5= var(2):=0
var(2)=1

[State 9741, goodbye]
type=destroyself
triggerall= var(1):=1
trigger1= root,var(59)
trigger2= !(root,alive)
trigger3= roundstate!=2

