;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Crocodile CNS
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------


[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 255
IntPersistIndex = 60
FloatPersistIndex = 40

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

[Size]
xscale = .45       
yscale = .43          
ground.back = 17     
ground.front = 17    
air.back = 12        
air.front = 12       
height = 60          
attack.dist = 160    
proj.attack.dist = 90 
proj.doscale = 0     
head.pos = -5, -90   
mid.pos = -5, -60    
shadowoffset = 0     
draw.offset = 0,0    

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

[Velocity]
walk.fwd  = 1.7  
walk.back = -1.4
run.fwd  = 7.4, 0 
run.back = -6.3,-4.8
jump.neu = 0,-7.2   
jump.back = -2.5 
jump.fwd = 2.5    
runjump.back = -4.5,-10.0 
runjump.fwd = 4,-8.2      
airjump.neu = 0,-8.1      
airjump.back = -2.55      
airjump.fwd = 2.5         

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

[Movement]
airjump.num = 0      
airjump.height = 40  
yaccel = .40         
stand.friction = .85  
crouch.friction = .82 


;---------------------------------------------------------------------------
; LOSE BY TIME OVER
;---------------------------------------------------------------------------

[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; WIN STATE
;---------------------------------------------------------------------------

[Statedef 180]
type = S

[State 210, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 2



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

;---------------------------------------------------------------------------
; WIN POSE
;---------------------------------------------------------------------------

[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 210, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 2

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

[State 181] 
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;---------------------------------------------------------------------------
; INTRO
;---------------------------------------------------------------------------

[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 210, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 2


[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

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


;---------------------------------------------------------------------------
; TAUNT
;---------------------------------------------------------------------------

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

[State 210, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 3

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

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

;---------------------------------------------------------------------------
; STANDING LIGHT PUNCH
;---------------------------------------------------------------------------

[Statedef 200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 6                    
velset = 0,0                     
ctrl = 0                         
anim = 200                       
poweradd = 20                    
sprpriority = 2                  

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = 18, 0                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit                
pausetime = 8, 8                 
sparkno = S6012                
sparkxy = 0, -90                 
hitsound = 5, 0                 
guardsound = 6, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 15            
ground.velocity = -4             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12 
getpower = (Var(5)> 0)* 0,0               


[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = 10, 3

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

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


;---------------------------------------------------------------------------
; STANDING STRONG PUNCH
;---------------------------------------------------------------------------

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= 40
ctrl = 0
velset = 0,0
anim = 210
sprpriority = -1

[State 200: VelSet]
type = Velset
trigger1 = animelem= 2
x = 2

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

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

[State 210, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 22
guardflag = MA
pausetime = 12,12
sparkno = S6012
sparkxy = -10,-95
hitsound   = S6,0
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -8
air.velocity = -2.5,-4
getpower = (Var(5)> 0)* 0,0   

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2


[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; STANDING KICK
;---------------------------------------------------------------------------

[Statedef 230]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 6                    
velset = 0,0                     
ctrl = 0                         
anim = 230                       
poweradd = 20                    
sprpriority = 2                  

[State 230, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = 18, 0                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit                
pausetime = 8, 8                 
sparkno = S6012                
sparkxy = 0, -90                 
hitsound = 5, 0                 
guardsound = 6, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 15            
ground.velocity = -8             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12 
getpower = (Var(5)> 0)* 0,0               


[State 230, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 1

[State 230, 1]
type = PlaySnd
trigger1 = Time = 0
value = 10, 4

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

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



;---------------------------------------------------------------------------
; STANDING STRONG BARCHAN
;---------------------------------------------------------------------------

[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 7
poweradd= 60
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2


[state 1100, DUST]
type = explod
trigger1 = Animelem = 8
postype = p1
bindtime = 1
removetime = 17
removeongethit = 1
pos = 30,-18
anim = 245
scale= .5,.5
sprpriority = -1

[State 240, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 200, 1]
type = PlaySnd
trigger1 = Time = 3
value = 10, 2

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 22
guardflag = MA
pausetime = 12,12
sparkno = S6012
sparkxy = -10,-55
hitsound   = S6,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -8
air.velocity = -2.2,-3.2
fall=1
getpower = (Var(5)> 0)* 0,0 

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

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

;---------------------------------------------------------------------------
;CROUCHING LIGHT PUNCH
;---------------------------------------------------------------------------

[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 20
ctrl = 0
anim = 400
sprpriority = 2


[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 2

[State 400, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 3


[State 400, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = C, NA
damage    = 18
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkno = S6012
sparkxy = -8,-50
hitsound   = S6,0
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4
getpower = (Var(5)> 0)* 0,0 

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

[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= 20
ctrl = 0
anim = 410
sprpriority = 2


[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 2

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 8


[State 410, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = C, NA
damage    = 18
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkno = S6012
sparkxy = -8,-20
hitsound   = S6,0
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4
getpower = (Var(5)> 0)* 0,0 
fall=1

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

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

;---------------------------------------------------------------------------
;CROUCHING LIGHT KICK
;---------------------------------------------------------------------------

[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 20
ctrl = 0
anim = 430
sprpriority = 2


[State 430, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 18
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = S6012
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
getpower = (Var(5)> 0)* 0,0  

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

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

;---------------------------------------------------------------------------
;CROUCHING STRONG KICK
;---------------------------------------------------------------------------

[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 40
ctrl = 0
anim = 440
sprpriority = 2


[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2

[State 440, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 2

[State 440, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 12,12
sparkno = S6012
sparkxy = -10,-55
hitsound   = S6,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -8
air.velocity = -2.2,-3.2
fall=1
getpower = (Var(5)> 0)* 0,0 

[State 200: VelSet]
type = Velset
trigger1 = Var(5) > 0
x = 2

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

;---------------------------------------------------------------------------
;JUMP LIGHT PUNCH
;---------------------------------------------------------------------------

[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 600
sprpriority = 2

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

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 8


[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 3
pausetime = 7,8
sparkno = S6012
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
getpower = (Var(5)> 0)* 0,0   


[State 600, 3]
type = CtrlSet
trigger1 = Time = 17
value = 1

;---------------------------------------------------------------------------
;JUMP STRONG PUNCH
;---------------------------------------------------------------------------

[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 6
poweradd= 25
ctrl = 0
anim = 610
sprpriority = 2

[State 610, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 4

[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 22
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S6012
sparkxy = -10,-55
hitsound   = S6,0
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4
getpower = (Var(5)> 0)* 0,0  

;---------------------------------------------------------------------------
;JUMP KICK
;---------------------------------------------------------------------------

[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 6
poweradd= 25
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 1

[State 630, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 20
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S6012
sparkxy = -10,-55
hitsound   = S6,0
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4
getpower = (Var(5)> 0)* 0,0 

;---------------------------------------------------------------------------
;JUMP STRONG KICK
;---------------------------------------------------------------------------

[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 6
poweradd= 25
ctrl = 0
anim = 640
sprpriority = 2

[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 1

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 10, 4

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 22
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = S6011
sparkxy = -10,-40
hitsound   = S6,0
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,-4
getpower = (Var(5)> 0)* 0,0 
;---------------------------------------------------------------------------
;HIGH JUMP
;---------------------------------------------------------------------------
[Statedef 4000]
type = A
physics = S
ctrl = 0
anim = 40
 
[State 4000, VarSet]
type = VarSet
trigger1 = Time = 0
var(9) = 1
 
[State 4000, VelSet]
type = VelSet
trigger1 = AnimTime = 0
x = 0
y = -11
 
 
[State 4000, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1
;---------------------------------------------------------------------------
;JUMP WALL
;---------------------------------------------------------------------------
[State -1: StateTypeSet]
type = StateTypeSet
trigger1 = (StateNo = 40) && (Pos Y < 0)
statetype = A
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

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



; -[ Super Jump Control ]-
[State -2]
type = VarSet
trigger1 = StateType != A
var(9) = 0
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------


;---------------------------------------------------------------------------
; CUSTOM
;---------------------------------------------------------------------------
[Statedef -3]

[State -3: VarAdd]
type = VarAdd
trigger1 = (Var(5) > 0)
v = 5
value = -1
ignorehitpause = 1

[State -3: VarSet]
type = VarSet
trigger1 = (MoveType = H) || (Roundstate = 3)
v = 5
value = 0


[State -3: ChangeAnim]
type = ChangeAnim
triggerall = (Var(5) > 0) && (RoundState = 2) && (MoveType != H)
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
trigger1 = AnimElemTime(AnimElemNo(0)) > floor ((AnimElemTime(AnimElemNo(0)) - AnimElemTime(AnimElemNo(0) + 1))/3)
ignorehitpause = 1
value = Anim
elem = AnimElemNo(0) + 1


[State -3: AfterImageTime]
type = AfterImageTime
trigger1 = (Var(5) > 0)
time = 2

[State -3: AssertSpecial]
type = AssertSpecial
trigger1 = (Var(5) > 0)
flag = NoJuggleCheck


[State -3: AttackMulSet]
type = AttackMulSet
trigger1 = (Var(5) > 0)
value = 0.85


[State -3: AttackMulSet]
type = AttackMulSet
trigger1 = (Var(5) = 0)
value = 1

;---------------------------------------------------------------------------
; DASH
;---------------------------------------------------------------------------


;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
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

