; 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 = 3000		;Amount of maximum power
attack = 100		;attack power (more is stronger)
defence = 100		;defensive power (more is stronger)
fall.defence_up = 50	;Percentage to increase defense everytime player is knocked down
liedown.time = 60		;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
FloatPersistInde

[Size]
xscale = 1.05			;Horizontal scaling factor.
yscale = 1.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  = 2.4		;Walk forward
walk.back = -2.2		;Walk backward
run.fwd  = 4.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 = 2.5		;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 = .44		;Vertical acceleration
stand.friction = .85	;Friction coefficient when standing
crouch.friction = .82	;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Format:
; [Statedef STATENO]
; type = ?      S/C/A/L  stand/crouch/air/liedown
; movetype = ?  I/A/H    idle/attack/gethit
; physics = ?   S/C/A/N  stand/crouch/air/none
; juggle = ?             air juggle points move requires
;
; [State STATENO, ?]     ? - any number you choose
; type = ?
; ...

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 基本
[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
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

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

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

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

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

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

[state 190, 1]
type = playsnd
trigger1 = animelem = 6
value = S500, 0

[State 190, 2] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 195, 1]
type = CtrlSet
trigger1 = Time = 40
value = 1

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

;---------------------------------------------------------------------------
; Combo Spear 1
[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 = 9
trigger2 = AnimElem = 10
trigger3 = AnimElem = 11
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 15, 0                   ;Damage that move inflicts, guard damage
animtype = Hard               ;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 = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 4, 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 = 1
value = 0, 0

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

;---------------------------------------------------------------------------
; Combo Spear 2
[Statedef 201]
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 = 201                       ;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 201, 0]
type = velset
trigger1 = animelem = 1
x = 3

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 15, 0                   ;Damage that move inflicts, guard damage
animtype = Hard               ;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 = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 4, 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, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Combo Spear 3
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 205

[state 201, 0]
type = velset
trigger1 = animelem = 1
x = 3

poweradd = 5
sprpriority = 10

[state 205, 0]
type = playsnd
trigger1 = animelem = 2
value = S5, 0

[State 205, 1]
type = HitDef
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
attr = S, NA
damage = 15, 10
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 4, 8
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -1
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

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

;---------------------------------------------------------------------------
; Shot Dart
[Statedef 210]
type    = S
movetype= A  ;
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 210

[State 0, Helper]
type = Helper
trigger1 = animelem = 7
helpertype = normal ;player
name = "Dart"
ID = 212
stateno = 212
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 6
helpertype = normal ;player
name = "Dart"
ID = 212
stateno = 212
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

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

;---------------------------------------------------------------------------
; Dart
[Statedef 212]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 212

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 10

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 15, 0
animtype = medium
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 0, 20
sparkno = 10
sparkxy = -15, -35
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -1
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-0
air.hittime = 12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0


[State 210, 5]
type = destroyself
trigger1 = time = 75
trigger2 = movecontact

;---------------------------------------------------------------------------
; Shoot Bomb
[Statedef 211]
type    = S
movetype= A  ;
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 210

[State 0, Helper]
type = Helper
trigger1 = animelem = 6
helpertype = normal ;player
name = "Bomb"
ID = 213
stateno = 213
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

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

;---------------------------------------------------------------------------
; Bomb
[Statedef 213]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 213

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 10

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 15, 0
animtype = medium
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 0, 20
sparkno = S214
sparkxy = 0, 0
hitsound = S0, 11
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -1
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-0
air.hittime = 12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0


[State 210, 5]
type = destroyself
trigger1 = time = 60
trigger2 = movecontact

;---------------------------------------------------------------------------
; Shoot Lightning
[Statedef 300]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 300

[State 0, Helper]
type = Helper
trigger1 = animelem = 9
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 10
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 11
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 12
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 13
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 14
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 15
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 16
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 17
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 18
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 19
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 20
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 21
helpertype = normal ;player
name = "Lighntning"
ID = 301
stateno = 301
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

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

;---------------------------------------------------------------------------
; Lightning
[Statedef 301]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 301

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 10

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 20, 0
animtype = medium
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 0, 20
sparkno = 0
sparkxy = 0, 0
hitsound = S0, 11
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -1
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-0
air.hittime = 12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0


[State 210, 5]
type = destroyself
trigger1 = time = 60
trigger2 = movecontact

;-------------------------------------------------------------------------
; Call Pearl
[Statedef 899]
type    = C
movetype= I
physics = S
juggle  = 4
poweradd= -3000
ctrl = 0
velset = 0,0
anim = 899
sprpriority = -1

[State 4, 1]
type = AfterImage
trigger1 = time = 0
time = 72
length = 20
palcolor = 200
palinvertall = 0
palbright = 30,30,30
palcontrast = 180,120,220
palpostbright = 0,0,0
paladd = 10,10,25
palmul = .65,.65,.75
timegap = 1
trans = add1

[State 0, SuperPause]
type = SuperPause
trigger1 = animelem = 1
time = 39
movetime = 39

[State 0, Helper]
type = Helper
trigger1 = animelem = 4
name = "Pearl"
stateno = 901
pos = 60,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 210, 4]
type = SprPriority
trigger1 = AnimElem = 2
value = 2

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

;--------------------------------------------------------------------------
; Pearl
[Statedef 901]
type    = A
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 901
sprpriority = 1

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 100,30
guardflag = MA
pausetime = 0,15
sparkno = s10500
sparkxy = 31, -60
hitsound   = s200,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -8.-1
air.velocity = -10.5,-4
fall = 1

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





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

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

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

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