; Constants and state file.
; There are comments scattered through this file, so you may like to
; take a look if would like to learn more about the cns.

[Data]
life = 1000			;Amount of life to start with
power = 5000		;Amount of maximum power
attack = 80		      ;attack power (more is stronger)
defence = 100		;defensive power (more is stronger)
fall.defence_up = 200	;Percentage to increase defense everytime player is knocked down
liedown.time = 50		;Time which player lies down for, before getting up
airjuggle = 15		;Number of points for juggling
sparkno = 2			;Default hit spark number for HitDefs
guard.sparkno = 40	;Default guard spark number
KO.echo = 0			;1 to enable echo on KO
volume = 0			;Volume offset (negative for softer)
IntPersistIndex = 60	;Variables with this index and above will not have their values
FloatPersistIndex = 40  ;reset to 0 between rounds or matches. There are 60 int variables,

[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,1		;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 10.4		;Walk forward
walk.back = -10.2		;Walk backward
run.fwd  = 6.6, 0		;Run forward (x, y)
run.back = -4.5,-3.8	;Hop backward (x, y)
jump.neu = 0,-8.4		;Neutral jumping velocity (x, y)
jump.back = -2.55		;Jump back Speed (x, y)
jump.fwd = 4.5		;Jump forward Speed (x, y)
runjump.back = -2.55,-2.1;Running jump speeds (opt)
runjump.fwd = 5,-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 = .35		;Vertical acceleration
stand.friction = .85	;Friction coefficient when standing
crouch.friction = .82	;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 1000, ChangeAnim]
type = ChangeAnim
triggerall = var(0) = 75
triggerall = var(0) != 76
trigger1 = Anim != 1000
value = 1000

[State 1000, ChangeAnim]
type = ChangeAnim
triggerall = var(0) != 75
triggerall = var(0) = 76
trigger1 = Anim != 7501
value = 7501

[State 0, Explod]
type = Explod
triggerall = var(0) != 76
triggerall = var(0) != 75
trigger1 = animelem = 4
anim = 171
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
sprpriority = 1
removeongethit = 1

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181

;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, a]
type = AssertSpecial
triggerall = var(0) = 76
triggerall = var(0) != 75
trigger1 = time >= 0
trigger1 = time <=400
flag = RoundNotOver

[State 7501, ChangeAnim]
type = ChangeAnim
triggerall = var(0) = 76
triggerall = var(0) != 75
trigger1 = Anim != 7244
value = 7244

[State -2, LifeAdd]
type = LifeAdd
triggerall = var(0) != 76
triggerall = var(0) = 75
trigger1 = ((GameTime%5) = 0)
value = 1
absolute = 0
ignorehitpause = 1
persistent = 1

[State -2, LifeAdd]
type = lifeAdd
triggerall = var(0) != 75
triggerall = var(0) = 76
trigger1 = ((GameTime%15) = 0)
value = 2
ignorehitpause = 1
persistent = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(0) = 76
triggerall = var(0) != 75
trigger1 = animelem = 2
value = S3000,1
volume = 900

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(0) = 76
triggerall = var(0) != 76
trigger1 = animelem = 1
value = S300,10
volume = 900

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(0) != 76
trigger1 = animelem = 3
value = S300,0+random%2
volume = 900

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(0) != 76
trigger1 = animelem = 3
value = S6,4
volume = 900

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(0) != 76
trigger1 = animelem = 1
value = S3,0
volume = 900

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(0) != 76
trigger1 = animelem = 12
value = S3,7
volume = 900

[State 0, Explod]
type = Explod
triggerall = var(0) = 75
triggerall = var(0) != 76
trigger1 = animelem = 2
anim = 7240
pos = 0,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = var(0) = 75
triggerall = var(0) != 76
trigger1 = animelem = 2
anim = 7242
pos = 0,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = 2000
sprpriority = 5
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = var(0) = 75
triggerall = var(0) != 76
trigger1 = animelem = 2
anim = 7243
pos = 0,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = 2000
sprpriority = 0
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = var(0) = 75
trigger1 = animelem = 4
anim = 8006
pos = 0,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 0
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = var(0) != 76
triggerall = var(0) != 76
trigger1 = animelem = 4
anim = 1951
pos = 0,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 0
removeongethit = 1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 420, Explod]
type = Explod
trigger1 = animelem = 4
anim = 1951
ID = 1951
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 700, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = s2,9
volume = 900

[State 700, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = s2,9
volume = 900

[State 700, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = s6,4
volume = 900

[State 700, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = s6,4
volume = 900

[State 700, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = s3,0
volume = 900

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

;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

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

[Statedef -2]

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = 1 && var(0) = 75
trigger2 = 1 && var(0) = 76
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard

[State -2, HitOverride]
type = HitOverride
trigger1 = 1 && var(0) = 75
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 2500
time = 2


[State -2, HitOverride]
type = HitOverride
trigger1 = 1 && var(0) = 76
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 2505
time = 2

[State 0, ChangeState]
type = ChangeState
trigger1 = var(33)=1 && stateno != 370002 && stateno != 370003
value = 370002
ctrl = 1
;anim =
;ignorehitpause =
;persistent =

[State 0, ParentVarSet]
type = VarSet
trigger1 = var(33) = 1
v = 33    ;fv =
value = 0
;ignorehitpause =
;persistent =

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

[Statedef -3]

;This controller plays a sound everytime the player lands from a jump, or
;from a back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 100, 0

[State -2,explod]
type = Explod
triggerall = var(0) = 75
triggerall = statetype != L
trigger1 = timemod = 4,2
anim = 1243
ID = 1243
pos = -10,-50
vel = -0,var(1)
random = 10,60
scale = .2,.2
accel = 0,-.2;.3,-.05
sprpriority = var(2)
supermovetime = 9999999
ownpal = 1
ontop = 1

[State -2,explod]
type = Explod
triggerall = var(0) = 75
triggerall = statetype != L
trigger1 = timemod = 4,2
anim = 1243
ID = 1243
pos = -10,-5
vel = -0,var(1)
random = 10,60
scale = .2,.2
accel = 0,-.2;.3,-.05
sprpriority = var(2)
supermovetime = 9999999
ownpal = 1
ontop = 1

[State 0, FX]
type = Afterimage
triggerall = var(0) = 75
triggerall = var(0) != 76
TRIGGER1 = !TIME
time =  9000
length  = 10
paladd = 40,0,0
palcontrast =  340, 0, 0
palbright = 30,30,30
timegap = 1
framegap = 1
trans = addalpha
alpha = 255, 200

[State -2,explod]
type = Explod
triggerall = var(0) = 75
triggerall = statetype != L
trigger1 = timemod = 4,2
anim = 1243
ID = 1243
pos = 10,-50
vel = -0,var(1)
random = 20,60
scale = .2,.2
accel = 0,-.2;.3,-.05
sprpriority = var(2)
supermovetime = 9999999
ownpal = 1
ontop = 1


[State -2,explod]
type = Explod
triggerall = var(0) = 75
triggerall = statetype != L
trigger1 = timemod = 4,2
anim = 1243
ID = 1243
pos = 10,-5
vel = -0,var(1)
random = 20,60
scale = .2,.2
accel = 0,-.2;.3,-.05
sprpriority = var(2)
supermovetime = 9999999
ownpal = 1
ontop = 1

[State 0, 1]
type = Explod
trigger1 = (WinKO) && (Var(51) !=1) && NumExplod(9700) = 0
triggerall = var(0) = 75
triggerall = var(0) != 76
anim = 9700
ID = 9700
pos = 120,106
postype = left
pausemovetime = 9999999
ontop = 1
ignorehitpause = 1
sprpriority = 1
bindtime = -1
removetime = -1
supermovetime = 999999

[State 0, 1]
type = Explod
trigger1 = (WinKO) && (Var(75) !=1) && NumExplod(9710) = 0
triggerall = var(0) = 75
triggerall = var(0) != 76
anim = 9710
ID = 9710
pos = 149,106
postype = left
pausemovetime = 9999999
ontop = 1
ignorehitpause = 1
sprpriority = 1
bindtime = -1
removetime = -1
supermovetime = 999999
size.xscale = 10
size.yscale = 10

[State 7003, Helper]
type = Helper
trigger1 = (WinKO) && (Var(51) !=1) && NumHELPER(9997) <1
triggerall = var(0) != 76
helpertype = normal
ID = 9997
stateno = 9997
pos = 0,0
postype = BACK
sprpriority = 4

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = stateno != 1030
trigger1 = 1
id = 8000

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = stateno != 1030
trigger1 = 1
id = 8008

[State -2, LifeAdd]
type = powerAdd
triggerall = var(0) = 75
trigger1 = ((GameTime%2) = 0)
value = 3
kill = 0
absolute = 0
ignorehitpause = 1
persistent = 1

[State -2, LifeAdd]
type = LifeAdd
triggerall = var(0) != 76
triggerall = var(0) = 75
trigger1 = ((GameTime%10) = 0)
value = -1
kill = 1
absolute = 0
ignorehitpause = 1
persistent = 1

[State -2, LifeAdd]
type = LifeAdd
triggerall = var(0) != 75
triggerall = var(0) = 76
trigger1 = ((GameTime%15) = 0)
value = 0
kill = 1
absolute = 0
ignorehitpause = 1
persistent = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 0    ;fv = 10
value = 75
;ignorehitpause =
;persistent =


[State -2, LifeAdd]
type = powerAdd
triggerall = var(0) != 75
triggerall = var(0) = 76
trigger1 = ((GameTime%1) = 0)
value = 5
kill = 0
absolute = 0
ignorehitpause = 1
persistent = 1

