; Josh Geary's 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.

;VARIABLES
;var(0): Temp
;var(3); Makes Josh Do Super Jump once he hits the player on State 420
;var(4); Makes Josh Do Super Jump once he hits the player on State 450
;var(8); IDK What It Does
;var(11): Speed
;var(12): MoveContact
;var(13); Air Combos
;var(18); temp bound states
;var(19); Makes his AttackMulSet less cheap in his 1p-11p
;var(40) Cheap Moment Mode, For 1p-11p Mode Only
;Var(41) Cheap Moment Mode, For 12p Mode Only
;var(43) - var(48); run
;var(51); IDK What It Does 2
;Var(55)     = Combo Announcer, Text Display
;Var(56)     = Combo Announcer, Sound
;Var(57)    = Combo Announcer, Danger
;Var(58)    = Combo Announcer, Normalize Score
;var(59): AI

[Data]
life = 1200 ;1500 ;2013 ;1000			;Amount of life to start with
power = 5000 ;3000		;Amount of maximum power
attack = 120 ;150 ;100		;attack power (more is stronger)
defence = 120 ;150 ;200 ;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
FloatPersistIndex = 40  ;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.


[Size]
xscale = 0.4 ;1			;Horizontal scaling factor.
yscale = 0.4 ;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.7		;Walk forward
walk.back = -2.6		;Walk backward
run.fwd  = 4.9, 0		;Run forward (x, y)
run.back = -4.7,-5.3	;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 = 2 ;3		;Number of air jumps allowed (opt)
airjump.height = 40	;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
;------------------------------------------------------------------------------
;lose
[Statedef 170]
type = S
movetype = U
physics = S
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type=changestate
trigger1=name!="defeatchallenge1"
value = 5150
ignorehitpause = 1

[State ]
type = Changeanim
trigger1 = anim != 170
value = 170
ignorehitpause = 1

[State 1056, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S7,0

[State 1056, 1]
type = PlaySnd
trigger1 = animelem = 4
value = S170, 0

[State ]
type = SelfState
trigger1 = roundstate > 2
value = 120
ignorehitpause = 1
;------------------------------------------------------------------------------
;win
[Statedef 181]
type = S
movetype = U
physics = S
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type=changestate
trigger1=name!="defeatchallenge1"
value = 5150
ignorehitpause = 1

[State ]
type = Changeanim
trigger1 = anim != 181
value = 181
ignorehitpause = 1

[State 100,1]
type = PlaySnd
trigger1 = AnimElem = 4,=1
value = 184,0 ;0,10

[State ]
type = SelfState
trigger1 = roundstate > 2
value = 120
ignorehitpause = 1

;---------------------------------------------------------------------------
;intro
[Statedef 191]
type = S
movetype = U
physics = S
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type=changestate
trigger1=name!="defeatchallenge1"
value = 5150
ignorehitpause = 1

[State ]
type = Changeanim
trigger1 = anim != 191
value = 191
ignorehitpause = 1

[State 191, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 194,1] ;"Let's all go out for frosty chocolate milkshakes!"
type = PlaySnd
trigger1 = AnimElem = 1
value = 191, 0
channel = 15

[State 194,2]; POOF!
type = PlaySnd
trigger1 = AnimElem = 18
value = 191, 1
channel = 15

[State 194,2]; "OH MY GOD!"
type = PlaySnd
trigger1 = AnimElem = 24
value = 191, 2
channel = 16

[State 106, 3]
type = Explod
trigger1 = AnimElem = 18
anim = 3006
pos = 0,0
bindtime = -1
sprpriority = 5
ownpal = 1
scale = 1,1
supermovetime = 999999999
pausemovetime = 999999999

[State 194, 4]
type = EnvShake
trigger1 = AnimElem = 18
trigger2 = AnimElem = 19
trigger3 = AnimElem = 20
trigger4 = AnimElem = 21
time = 15
ampl = -2
freq = 60
phase = 60

[State 191, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 69420

[State ]
type = SelfState
trigger1 = roundstate > 2
value = 120
ignorehitpause = 1
;-------------------------------------------------------------------------------
;stand
[Statedef 69420]
type = S
movetype = U
physics = S
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type=changestate
trigger1=name!="defeatchallenge1"
value = 5150
ignorehitpause = 1

[State ]
type = Changeanim
trigger1 = anim != 69420
value = 69420
ignorehitpause = 1

[State ]
type = ScreenBound
trigger1 = 1
value = 0
ignorehitpause = 1

[State ]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1

[State ]
type = StateTypeSet
trigger1 = 1
movetype = I
ignorehitpause = 1

[State ]
type = Turn
trigger1 = gethitvar(damage)
ignorehitpause = 1

[state ]
type=hitoverride
trigger1 = !ishelper
attr=sca,aa,at,ap
stateno=4000
time=-1
ignorehitpause=1

[State ]
type = SelfState
trigger1 = roundstate > 2
value = 120
ignorehitpause = 1

;-------------------------------------------------------------------------------
; thats it im outta here
[Statedef 4000]
type = S
movetype = U
physics = S
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type=changestate
trigger1=name!="defeatchallenge1"
value = 5150
ignorehitpause = 1

[State ]
type = Changeanim
trigger1 = anim != 4000
value = 4000
ignorehitpause = 1

[State ]
type = ScreenBound
trigger1 = 1
value = 0
ignorehitpause = 1

[State ]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1

[State ]
type = StateTypeSet
trigger1 = 1
movetype = I
ignorehitpause = 1

[State ]
type = velset
trigger1 = 1
x = 4.55
ignorehitpause = 1

[State 200,PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1,=1
value = 4, 10 ;5000, 25 ;0,ifelse(Var(39)=1,103,5)-------de lado a lado
channel = 0

[State 4050,0]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4050,2]
type = PlayerPush
trigger1 = AnimElem = 13,< 0
value = 0

[State 4050,4]
type = VelSet
trigger1 = AnimElem = 13,=0
x = 0

[State 4050, 6]
type = AfterImage
trigger1 = AnimElem = 2
time = 18
length = 10
framegap = 6 ;3
trans = add1
palcontrast = 128,128,128
paladd = 0,0,0
palmul = 1,1,1

[State 4050,8]
type = ChangeState
trigger1 = AnimTime = 0
value = 69420
ignorehitpause = 1

[State ]
type = SelfState
trigger1 = roundstate > 2
value = 120
ignorehitpause = 1
;-------------------------------------------------------------------------------
;anti-pause
[Statedef 420]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1
persistent = 256

[State 12000, 自キャラ以外だった場合]
type = Changestate
trigger1 = name != "defeatchallenge1"
value = 17000
persistent = 256
ignorehitpause = 1

[State ]
type = Statetypeset
trigger1 = 1
statetype = S
movetype = I
physics = N
ignorehitpause = 1

[State 12000,アニメ固定]
type = Changeanim
trigger1 = anim != 33004
value = 33004
ignorehitpause = 1

[State , コントロール不可]
type = Ctrlset
trigger1 = 1
value = 0
ignorehitpause = 1

[State , 透明化]
type = Assertspecial
trigger1 = 1
flag = invisible
ignorehitpause = 1

[State , カメラ固定]
type = Screenbound
trigger1 = 1
value = 0
ignorehitpause = 1

[State , 無敵]
type = Nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
pos = 0,10
ignorehitpause = 1

[State ]
type = parentvarset
trigger1 = roundstate >= 3
var(5) = 1
ignorehitpause = 1
persistent = 1

[State 12000, 時止め解除]
type = Pause
triggerall = anim != [39500,39501]
trigger1 = 1
time = 0
movetime = 0
ignorehitpause = 1

[State 12000, 時止め解除]
type = Superpause
triggerall = anim != [39500,39501]
trigger1 = 1
anim = -1
time = 0
movetime = 0
darken = 0
p2defmul = 1
unhittable = 0
ignorehitpause = 1

[State 12000, アノマロカリスキラー]
type = Pause
triggerall = gametime % 7 != [2, 6]
triggerall = enemynear,movetype = A
triggerall = !root,var(5)
trigger1 = enemynear(numenemy > 1),movetype = A
time = 2
movetime = 2
ignorehitpause = 1

[State 12000, アノマロカリスキラー]
type = Superpause
triggerall = gametime % 7 != [2, 6]
triggerall = enemynear,movetype = A
triggerall = !root,var(5)
trigger1 = enemynear(numenemy > 1),movetype = A
anim = -1
time = ifelse(enemynear,name = "Hyper Kung Fu Man", 0, 2)
movetime = ifelse(enemynear,name = "Hyper Kung Fu Man", 0, 2)
darken = 0
p2defmul = 1
ignorehitpause = 1

[State ]
type = Pause
trigger1 = !enemy,alive
trigger1 = !enemy(numenemy = 2),alive
trigger2 = roundstate > 2
trigger2 = root,var(5)
time = 9999999999999
movetime = 9999999999999
ignorehitpause = 1

[State 12000, 超即死＆死亡時時止め]
type = Superpause
trigger1 = !enemy,alive
trigger1 = !enemy(numenemy = 2),alive
trigger2 = roundstate > 2
trigger2 = root,var(5)
anim = -1
time = 9999999999999
movetime = 9999999999999
darken = 0
p2defmul = 1
ignorehitpause = 1

[State 12000, 強制死の宣告用時止め]
type = Pause
triggerall = roundstate < 3
trigger1 = !root,alive
time = 9999999999999
movetime = 9999999999999
ignorehitpause = 1

[State 12000, 強制死の宣告用時止め]
type = Superpause
triggerall = RoundState < 3
trigger1 = !root,alive
anim = -1
time = 9999999999999
movetime = 9999999999999
darken = 0
p2defmul = 1
unhittable = 0
ignorehitpause = 1

[State 12000, 強制死の宣告用時止め解除]
type = Pause
triggerall = enemy,alive != 0
triggerall = enemy(numenemy = 2),alive != 0
triggerall = ishelper(420)
trigger1 = sysvar(2) > 60
time = 0
movetime = 0
ignorehitpause = 1

[State 12000, 強制死の宣告用時止め解除]
type = Superpause
triggerall = enemy,alive != 0
triggerall = enemy(numenemy = 2),alive != 0
triggerall = ishelper(420)
trigger1 = sysvar(2) > 60
anim = -1
time = 0
movetime = 0
darken = 0
p2defmul = 1
unhittable = 0
ignorehitpause = 1

[State 12000,変数加算]
type = Varadd
trigger1 = ishelper(420)
trigger1 = RoundState = [3,4]
sysvar(2) = 1
ignorehitpause = 1

[State ]
type = Selfstate
trigger1 = 1
value = 5150
persistent = 256
ignorehitpause = 1
