; The Bopper'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.

[Data]
;Amount of life to start with
life = 1000
;attack power (more is stronger)
attack = 100
;defensive power (more is stronger)f
defence = 100
;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50
;Time which player lies down for, before getting up
liedown.time = 60
;Number of points for juggling
airjuggle = 15
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 190
;Variables with this index and above will not have their values
;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.
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = .5           ;Horizontal scaling factor.
yscale = .5           ;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). Recommended 0,0

[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,-12    ;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,-10      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.
air.gethit.groundrecover = -.15,-3.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5      ;Extra y-velocity for holding down during air recovery **MUGEN 1.0**

[Movement]
airjump.num = 0       ;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
stand.friction.threshold = 2          ;If player's speed drops below this threshold while standing, stop his movement **MUGEN 1.0**
crouch.friction.threshold = .05       ;If player's speed drops below this threshold while crouching, stop his movement **MUGEN 1.0**
air.gethit.groundlevel = 25           ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -20 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 10   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -1  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = .35    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 15      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 20            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = .4               ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 12          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .05         ;If the player's speed drops below this threshold while lying down, stop his movement **MUGEN 1.0**

[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "Keep this up and you'll get yourself killed. No joke, man, no joke."
victory2 = "Christ, I could've fixed myself up supper this whole time. Why don't you go do that for me?"
victory3 = "Cry about it on IRC, bitch. I'll be reading it and laughing!"
victory4 = "Your face is going to look like a fucking Tim Burton movie by the time I'm completely done with you!"
victory5 = "Yes, but did you know that alexlexusisblack.mp4"
victory6 = "Shitty edit by day, actual character at night... I AM ALTER AMIBA."
victory7 = "You died as hopelessly as you lived."
victory8 = "I won't ever do what you want me to do, unless you want me to put a fucking gun in your mouth!"
victory9 = "Let this be a lesson to you: nobody ever wins in a dairy challenge!"
victory10 = "CvS-style that, motherfucker!"
victory11 = "You'll pay for the time I wasted on your sorry ass and a million times more!"
victory12 = "Now to go upload this to YouTube."
victory13 = "AY YAH LASSIE, I'LL FECK YER ARSE"
victory14 = "You're probably a racist too. Piece of SHIT!"
victory15 = "....surely you noticed a good bit of my win quotes are plagiarized?"
victory16 = "Infinitycat sucks. IKEMEN's stoopid."
victory17 = "Oh no, you did NOT just slap me out here in this here woods."
victory18 = "We try to do our very best at Amiba's!"
victory19 = "You did quite well for a corpse, my friend. Rest in peace."
victory20 = "Man, I'm all lightheaded now. You just suck THAT bad."
victory21 = "lemme take u 2 da movies shortay"
victory22 = "You don't deserve a winquote, so you get my date/time. 9:35 AM 1/10/2011"
victory23 = "I am fucking invincible. I bet that didn't occur to you before anyway!"
victory24 = "If only you knew the pain I carry within my netherregions....if only!"
victory25 = "Your eyes....it's like they're mocking me....I must close them!"
victory26 = "Aquapazza sucks and is a shitty-ass game."
victory27 = "Now THIS I can dig."
victory28 = "Idiot! I was made to humiliate you!"
victory29 = "Oh so you say there's a Touhou fighting game that isn't horrible? Sorry. I have to sever your tongue now."
victory30 = "Do you expect me to say 'u mad' or something? I'd much rather stomp your skull to dust underneath my boot."
victory31 = "No, you're no good... You aren't the opponent worth risking my life."
victory32 = "Don't ever try to get cocky with me again. Go to hell."
victory33 = "I have sinned... again..."
victory34 = "Ignorance is such a scary thing... It made you go against me!"
victory35 = "If you don't see there's no way out, just no way of gettin' round me....then you got it bad."
victory36 = "I'll smash you to the end of the universe if that's what you really want!"
victory37 = "The funny thing is, I don't even like video games."
victory38 = "Shall I show you the true battle? Could you imitate it? I wonder..."
victory39 = "Welcome to? the wonderful world of 'You're not my friend anymore.' Unless you can give me a good reason why I should add you back, you're of the list forever. Have a nice day."
victory40 = "You think I'm joking? Give me a fucking answer! Oh wait, no you won't. That just proves to me that you were a?waste of my time, and not worth my trust. Goodbye."

; Variable usage:
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(1)  - Used in kfm.cmd for combo condition (updated every tick)
; var(2)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;           held (remembered from state 800 through state 810).

[Statedef 8250];ダストグレイヴグレイブ
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
anim = 300
sprpriority = 2

[state 0,0]
type = posadd
trigger1 = var(27) >= 1
x = ceil(enemy,gethitvar(hitcount)*-0.05)
ignorehitpause = 1

[state 0,basuke]
type = varadd
triggerall = movehit
trigger1 = enemy,statetype = A
trigger1 = var(27) = 0
ignorehitpause = 1
v = 7
value = 1
persistent = 0

[state 0,0]
type = posadd
trigger1 = var(27) >= 1
trigger1 = movehit
x = ceil(enemy,gethitvar(hitcount)*-0.35)
ignorehitpause = 1

[State 200, HitDef]
type = HitDef
persistent = 0
trigger1 = time >= 7
attr = S, SA
damage = 60, 5
getpower = ifelse(var(50)=0,50,0),10
givepower = 20,5
animtype = medium
guardflag = M
hitflag = MAFD
priority = 4, Hit
pausetime = ifelse(var(37)=1,7,5), ifelse(var(37)=1,7,5)
;;guard.sparkno = S8003
sparkno = -1;S8004
sparkxy = -3, -65
hitsound = S101, 2
guardsound = S0, 0
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = 0,-13.5
air.velocity = 0,-13.5
fall = 1
air.fall = 1
fall.recovertime = 90
;p2stateno = 251
guard.hittime = 15
yaccel = .6

[State 210, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 11
channel = 1

[State 210, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 100, 2

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

;----------------------------
;Air Dash

[Statedef 110]
type = A
physics = N
ctrl = 0
anim = 1050
velset = 0, 0

[State 0]
type = varset
trigger1 = Time = 0
var(27) = 1

[State 110]
type = velset
trigger1 = Time = 1
x = 5
y = -2

[state 12]
type = veladd
trigger1 = 1
y = 0.2

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

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 90,3
volume = 255

[State 110, 0]
type = CtrlSet
trigger1 = Time = 3
value = 1

;[State 110, 2]
;type = HitBy
;trigger1 = Time = 0
;value = SCA;, NT, ST, HT
;time = 30

[State 110, 8]
type = ChangeState
trigger1 = Time = 20
value = 50
ctrl = 1

;----------------------------
;Air Dash Back
[Statedef 115]
type = A
physics = N
ctrl = 0
anim = 5320
velset = 0, 0

[State 0]
type = varset
trigger1 = Time = 0
var(27) = 1

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

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 90,3
volume = 255

[State 110]
type = velset
trigger1 = Time = 1
x = -5
y = -2

[state 12]
type = veladd
trigger1 = 1
y = 0.2

[State 9000, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 1,45

[State 110, 0]
type = CtrlSet
trigger1 = Time = 3
value = 1

;[State 110, 2]
;type = HitBy
;trigger1 = Time = 0
;value = SCA;, NT, ST, HT
;time = 30

[State 110, 8]
type = ChangeState
trigger1 = Time = 20
value = 50
ctrl = 1


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

[State 190, 2]
type = ChangeState
trigger1 = Time = 0
value = 171+random%3

;what the fuck
[Statedef 171]
type = S
ctrl = 0
anim = 666
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 15
volume = 255

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

;would you sign my petition
[Statedef 172]
type = S
ctrl = 0
anim = 678
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 2
value = 701, 25

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

;amiba's spine collapses
[Statedef 173]
type = S
ctrl = 0
anim = 694
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 1
value = 701, 41

[State 2000, 1]
type = explod
trigger1 = Time = 0
anim = 694
pos = 160, 120
postype = left
sprpriority = -10
bindtime = -1
supermove = 1
ontop = 1
facing = 1

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg

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


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

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

[State 190, 2]
type = ChangeState
trigger1 = Time = 0
value = 181+random%8


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

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 650
flag = RoundNotOver

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 669, 0

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 48
value = 700, (random%7)

; Win pose 2 - well that was fun
; CNS difficulty: basic
[Statedef 182]
type = S
ctrl = 0
anim = 677
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 400
flag = RoundNotOver

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 16

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 18
value = 701, 17

; Win pose 3 - cyrus amiba
; CNS difficulty: basic
[Statedef 183]
type = S
ctrl = 0
anim = 679
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 840
flag = RoundNotOver

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 24

; Win pose 4 - name's amiba. that's all you need to know.
; CNS difficulty: basic
[Statedef 184]
type = S
ctrl = 0
anim = 686
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 200
flag = RoundNotOver

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 28

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 100, 3

; Win pose 5 - overly defensive over a shitty-ass loli game
; CNS difficulty: basic
[Statedef 185]
type = S
ctrl = 0
anim = 691
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 220
flag = RoundNotOver

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 13

; Win pose 6 - necro storm
; CNS difficulty: basic
[Statedef 186]
type = S
ctrl = 0
anim = 693
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 250
flag = RoundNotOver

[State 0, Explod]
type = Explod
trigger1 = Time = 1
anim = 692
ID = 692
pos = -20,7
postype = p1
bindtime = -1
vfacing = 1
bindtime = 1
vel = 0,0
ownpal = 1
sprpriority = 1
shadow = 255,255,255
ignorehitpause = 1

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 1
value = 701, 39

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 35
value = 701, 37

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 10
value = 701, 38

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 9
value = 100, 3

; Win pose 7 - Melvana is lazy if you haven't noticed
[Statedef 187]
type = S
ctrl = 0
anim = 702
velset = 1,0

[State 0, Hi-res lol]
type = AngleDraw
trigger1 = anim = 702
scale = 2, 2
ignorehitpause = 1

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 300
flag = RoundNotOver

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

[State 5120]
type = PlaySnd
trigger1 = Time = 0
value = 701, 42
channel = 0

; Win pose 8 - i feel like a pussy when i make an amiba winpose
[Statedef 188]
type = S
ctrl = 0
anim = 703
velset = 0,0

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 120
flag = RoundNotOver

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

[State 5120]
type = PlaySnd
trigger1 = Time = 0
value = 701, 43
channel = 0

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim = 4904
velset = 0,0

[State 190, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(190)
value = 191

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 4904

[State 190, 2]
type = ChangeState
trigger1 = p2name = "Jagi"
value = 1966

[State 190, 2]
type = ChangeState
trigger1 = Time = 0
value = 192+random%4


; Introduction
; CNS difficulty: basic
[Statedef 192]
type = S
ctrl = 0
anim = 4904
velset = 0,0

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 4904

[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

;[State 191, VarRandom]
;type = VarRandom
;trigger1 = Time = 0
;v = 3
;range = 1,2

; You can delete the following two controllers if you're building your own
; character using KFM. These play back the sounds of the wood block being
; broken.

[State 191, Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 666, (random%8)
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 668,0
volume = 255

; Introduction #2 (solis)
; CNS difficulty: basic
[Statedef 193]
type = S
ctrl = 0
anim = 4905
velset = 0,0

[State 192, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 4905

[State 192, 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

[State 191, VarRandom]
type = VarRandom
trigger1 = Time = 0
v = 3
range = 0,7

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701,6
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 35
value = 701,7
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 60,0
volume = 255

[State 191, Shake Screen]
type = EnvShake
trigger1 = AnimElem = 9
trigger2 = AnimElem = 11
trigger3 = AnimElem = 13
trigger4 = AnimElem = 15
trigger5 = AnimElem = 17
trigger6 = AnimElem = 19
trigger7 = AnimElem = 21
trigger8 = AnimElem = 23
trigger9 = AnimElem = 25
trigger10 = AnimElem = 27
trigger11 = AnimElem = 29
trigger12 = AnimElem = 31
time = 4     ;Time to shake screen
ampl = 2     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

; Introduction #3 (amiba aho shokougun)
; CNS difficulty: basic
[Statedef 194]
type = S
ctrl = 0
anim = 688
velset = 0,0

[State 192, 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

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 1
value = 701,26
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701,27
volume = 255

[State 0, Explod]
type = Explod
trigger1 = Time = 1
anim = 687
ID = 687
pos = -80,0
postype = p1
bindtime = -1
vfacing = 1
scale = .5, .5
bindtime = 1
vel = 0,0
ownpal = 1
sprpriority = 1
scale = 
shadow = 255,255,255
ignorehitpause = 1

; piss-ass mac!
; CNS difficulty: basic
[Statedef 195]
type = S
ctrl = 0
anim = 690
velset = 0,0

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 690

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg

[State 2000, 1]
type = explod
trigger1 = time = 0
anim = 689
pos = 160, 120
postype = left
sprpriority = 6666666666
bindtime = -1
supermove = 1

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 0
value = 701,33
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 181
value = 701,34
volume = 255


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

; -----SPECIAL INTRO YOU FUCKING IDIOT---------
; CNS difficulty: basic
[Statedef 1966]
type = S
ctrl = 0
anim = 696
velset = 0,0

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 690

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg

[State 2000, 1]
type = explod
trigger1 = time = 0
anim = 695
pos = 160, 120
postype = left
sprpriority = 6666666666
bindtime = -1
supermove = 1

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 0
value = 701,40
volume = 255


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


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

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

[State 191, VarRandom]
type = VarRandom
trigger1 = Time = 0
v = 3
range = 0,5

[State 191, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 667, var(3)
volume = 255
channel = 1

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


;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[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 = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;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 = 8, 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  = 11             ;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 = 15                 ;Time before opponent regains control in air

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

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

;---------------------------------------------------------------------------
; Standing strong punch
; CNS difficulty: easy
; Note the width controller. It makes KFM's push box larger, so he doesn't
; stand so close to the opponent. Hit Ctrl-C and look at the red bar at his
; feet.
; The sprpriority for this state is at -1, instead of the usual 2 for
; attacks. This makes KFM appear behind the opponent initially.
; The SprPriority controller in [State 210, 4] brings KFM to the front when
; his arm has swung over.
; To stop KFM from pausing in his swing frame, there is a ChangeAnim in
; [State 210, 3] that detects if the hit has come in contact with the
; opponent during that frame, and switches to the next animation element
; (notice the elem=6 parameter). If you don't see what I mean, try commenting
; out that controller, then hit someone with this attack.
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 30
ctrl = 0
velset = 0,0
anim = 201
sprpriority = -1


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

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 16
ground.velocity = -5.5
air.velocity = -2.5,-4
forcenofall = 1

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

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 11
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2

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

[State 230, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 26
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-37
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 14
ground.velocity = -5
air.velocity = -2.5,-3.5

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

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 211
sprpriority = 2

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

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 63
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -6
air.velocity = -2.2,-3.2

[State 240, 3]
type = PosAdd
trigger1 = AnimElem = 7
x = 12

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

;---------------------------------------------------------------------------
;Crouching light punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning
;     KFM will get hit instead of trading hits with his opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 8
ctrl = 0
anim = 400
sprpriority = 2

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

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

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkno = 0
sparkxy = -10,-42
hitsound   = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 9
ground.velocity = -4
air.velocity = -1.5,-3

[State 400, 3]
type = CtrlSet
trigger1 = Time = 6
value = 1

[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 25
ctrl = 0
anim = 420
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 100, 3

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

;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4
air.velocity = -3,-4

;This is the second hit, triggered on the 4th element of animation.
[State 410, 3]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage    = 36
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -10,-83
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -7
air.velocity = -3,-4

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

;Shovin'
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
[Statedef 420]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 25
ctrl = 0
anim = 6100
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 100, 3

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 5, 9
channel = 1
volume = 225

[State 240, 3]
type = PosAdd
trigger1 = AnimElem = 3
x = 13

;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 17
ground.velocity = -10
air.velocity = -3,-4
fall = 1

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


;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 11
ctrl = 0
anim = 180
sprpriority = 2

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

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

[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 28
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = 0
sparkxy = -10,-8
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 2
ground.hittime  = 10
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 22

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

;---------------------------------------------------------------------------
;Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 35
ctrl = 0
anim = 411
sprpriority = 2

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

[State 430, 1]
type = PlaySnd
trigger1 = Time = 2
value = 100, 3

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 72
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = 1
sparkxy = -5,-10
hitsound   = 5,2
guardsound = 6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 17
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1

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

;---------------------------------------------------------------------------
;I WON
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
[Statedef 450]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 25
ctrl = 0
anim = 430
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 100, 3

[State 410, 1]
type = PlaySnd
trigger1 = Time = 1
value = 701, 31

;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 110
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4
air.velocity = -3,-4
fall = 1

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

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 5
ctrl = 0
anim = 600
sprpriority = 2

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

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

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 3
pausetime = 7,8
sparkno = 0
sparkxy = -10,-58
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 8
ground.velocity = -4
air.velocity = -1.3,-3
air.hittime = 14

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

;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 620
sprpriority = 2

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

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

[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 72
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-55
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 14
ground.velocity = -6
air.velocity = -3,-4

;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 10
ctrl = 0
anim = 630
sprpriority = 2

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

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 26
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = 1
sparkxy = -5,-35
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -4
air.velocity = -2,-3
air.hittime = 14

;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 410
sprpriority = 2

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

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4

;flying kick
; CNS difficulty: easy
[Statedef 680]
type    = A
movetype= A
physics = N
juggle  = 3
poweradd= 10
;velset = 9,-3
velset = 8,0
ctrl = 0
anim = 610
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 90, 7
volume = 255

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 701, 32
volume = 255
channel = 1

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 130
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = 1
sparkxy = -5,-35
hitsound   = s701,44
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -9
air.velocity = -2,-3
air.hittime = 14
fall = 1

[State 110, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;bounce-off kick
; CNS difficulty: easy
[Statedef 690]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 213
sprpriority = 2

[State 640, 2]
type = PlaySnd
trigger1 = Time = 2
value = 5, 14

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4
fall = 1


;Dumbass Drop
; CNS difficulty: easy
[Statedef 650]
type=A
movetype=A
physics=N
juggle=10
ctrl=0
poweradd=0
sprpriority=2
anim=7802

[STate 610]
type=VelAdd
trigger1=1
y=1

[State 0]
type=PlaySnd
trigger1=Time=0
value=701,3
channel=1

[State 600,1]
type=HitDef
trigger1=Time=0
attr=A,NA
damage=110,0
getpower=120,60
animtype=hard
guardflag=HA
hitflag=MAF
priority=5,Hit
pausetime=8,8
guard.pausetime=8,8
sparkno=S81
guard.sparkno=S84
sparkxy=-10,-36
hitsound=S701,4
guardsound=S1,14
ground.type=low
ground.slidetime=15
ground.hittime=20
ground.velocity=-9,5
airguard.velocity=-4.6,-5
air.type=low
air.velocity=-4.9,10
air.hittime=12
fall=1
fall.recover=0

[STate 610]
type=ChangeState
trigger1=Pos Y>=0&&Vel Y>0
value=5050

;---------------------------------------------------------------------------
; Pokey
; CNS difficulty: medium
; Description: mothafucka

[Statedef 660]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 108411
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 8
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 0
value = 701, 5
channel = 1

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 8

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1000, 6]
type = PosAdd
trigger1 = AnimElem = 9
x = -5

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

; Grab A Handful
; CNS difficulty: medium
; Description: This is like a standard attack, but with some differences.
;   There are two HitDefs in this attack. One is triggered when the
;   opponent is near (using a p2bodydist trigger), and the other
;   when the opponent is farther away. The main differences between
;   the near and far versions of the HitDefs is that the near version
;   has a "fall" parameter set to 1, causing the opponent to be knocked
;   down. Other minor differences are the damage, and the velocity to
;   give the opponent.
;   The line "attr = S, SA" line means this is a Standing, Special Attack.
;   It is important you have the attr parameter set correctly for all
;   you HitDefs.
[Statedef 670]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1087
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 13
channel = 1

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 8
value = 100, 3

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 8

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = Time = 0
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = s701,23
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

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




;---------------------------------------------------------------------------
;this throw is retarded
;START
; CNS difficulty: medium-advanced
; Description: Throws are not difficult to make, although then can be
;     tedious at times. Throw attempt states have a HitDef of a
;     special format. The key parameters in a throw are p1stateno
;     and p2stateno. If the HitDef successfully connects, then
;     the attacker will change to the state number specified by
;     p1stateno, and the opponent will be change to the state
;     number assigned to p2stateno. The special thing about p2stateno
;     is that the opponent will be temporarily brought into the
;     attacker's state file. In this case, no matter who the
;     opponent is, he will be taken to state 820 of this file (kfm.cns)
;     and remain here until the end of the throw (look at his debug
;     information when he is being thrown; the text changes to yellow
;     to mean that he is in another player's state file).
[Statedef 800]
type    = S
movetype= A
physics = S
ctrl = 0
juggle = 4
anim = 1076
sprpriority = 1

[State 800, 1]
type = HitDef
;trigger1 = command = "holdfwd" || command = "holdback"
trigger1 = time <= 2
trigger1 = P2MoveType != H
attr = S, NT
hitflag = M
priority = 1, Miss
sparkno = -1
air.juggle = 14
hitsound = S101, 1
sprpriority = 1
p1facing = ifelse (command = "holdback", -1, 1)
;p2facing = -1
p1stateno = 900
p2stateno = 901
fall = 1
fall.recover = 0

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

;--------------------------------------WHOOP

[Statedef 900]
type    = S
movetype= A
physics = S
ctrl = 0
anim = 1077
sprpriority = 2
velset = 0,0

[State 210, 2]
type = PlaySnd
trigger1 = time = 0
value = 5, 31
channel = 0

[State 210, 2]
type = PlaySnd
trigger1 = time = 6
value = 701, 8
channel = 0

[state 0,0]
type = screenbound
trigger1 = 1
value = 0

[state 0,0]
type = velset
trigger1 = time <= 14
x = 7.5
y = 0

;[state 0,0]
;type = veladd
;trigger1 = time = [5,15]
;x = -0.2

[state 0,0]
type = velset
trigger1 = time = [16,22]
x = -4.6

[state 0,0]
type = velset
trigger1 = time = 23
x = 0



[State 3000, effect]
type = null;Explod
trigger1 = time = 35
anim = 1056
postype = p1
pos = 10,-72
ownpal = 1
sprpriority = 5
id = 12
facing = -1
scale = 0.02+(time*0.03),0.02+(time*0.03)
[State 3000, effect]
type = null;Explod
trigger1 = time = [36,38]
anim = 1060
postype = p1
pos = 10,-72
ownpal = 1
sprpriority = 5
id = 12
scale = 0.02+(time*0.03),0.02+(time*0.03)
facing = -1
[State 3000, effect]
type = null;Explod
trigger1 = time = [39,42]
anim = 1061
postype = p1
pos = 10,-72
ownpal = 1
sprpriority = 5
id = 12
scale = 0.02+(time*0.03),0.02+(time*0.03)
facing = -1
[State 3000, effect]
type = null;Explod
trigger1 = time = [43,46]
anim = 1062
postype = p1
pos = 10,-72
ownpal = 1
sprpriority = 5
id = 12
scale = 0.02+(time*0.03),0.02+(time*0.03)
facing = -1


[state 0,reverse]
type = varset
trigger1 = time = 1
var(27) = 1

[state 0,reverse]
type = varset
trigger1 = var(41) = 0
trigger1 = time = 1
fvar(5) = fvar(5)*0.3
persistent = 0

[State 210, 2]
type = PlaySnd
trigger1 = time = 4
value = 200, 32
channel = 0

[State 0, 1]
type = TargetBind
trigger1 = time = 1
pos = 30,0

[State 200, 3]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

[State 200, 3]
type = ChangeState
trigger1 = var(41) = 2
trigger1 = command = "a"
trigger1 = time >= 38
value = 1001
ctrl = 0

[State 200, 3]
type = ChangeState
trigger1 = var(41) = 2
trigger1 = var(59) != 0
trigger1 = random >= 300
trigger1 = time >= 39
value = 1003
ctrl = 0

;------------------------------------------
; 投げられてる相手
[Statedef 901]
type    = A
movetype= H
physics = S
ctrl = 0
sprpriority = 1
velset =0,0

[state 0,0]
type = screenbound
trigger1 = 1
value = 0

[state 0,0]
type = posadd
trigger1 = time <= 18
x = 2

[state 0,0]
type = velset
trigger1 = time = 36
x = 11
y = -7.6

[state 0,0]
type = veladd
trigger1 = time > 36
y = 0.45

[state 0,0]
type = turn
trigger1 = time = 0
trigger1 = facing = enemy,facing

[state 0,0]
type = changeanim2
trigger1 = time = 0
value = 7215

[state 0,0]
type = playerpush
trigger1 = 1
value = 0

[state 0,0]
type = lifeadd
trigger1 = time = 1
value = -5
kill = 0
[state 0,0]
type = lifeadd
trigger1 = time = 35
value = -90

[state 0,0]
type = envshake
trigger1 = time = 35
time = 10

[state 0,0]
type = selfstate
trigger1 = time >= 36
value = 5050





;---------------------------------------------------------------------------
;投げ
[Statedef 810]
type    = S
movetype= A
physics = S
ctrl = 0
anim = 1077
sprpriority = 2
velset = 0,0

[State 210, 2]
type = PlaySnd
trigger1 = time = 0
value = 5, 31
channel = 0

[State 210, 2]
type = PlaySnd
trigger1 = time = 6
value = 5, 40
channel = 0

[state 0,0]
type = screenbound
trigger1 = 1
value = 0

[state 0,0]
type = velset
trigger1 = time <= 14
x = 7.5
y = 0

;[state 0,0]
;type = veladd
;trigger1 = time = [5,15]
;x = -0.2

[state 0,0]
type = velset
trigger1 = time = [16,22]
x = -4.6

[state 0,0]
type = velset
trigger1 = time = 23
x = 0

[state 0,reverse]
type = varset
trigger1 = time = 1
var(27) = 1

[state 0,reverse]
type = varset
trigger1 = var(41) = 0
trigger1 = time = 1
fvar(5) = fvar(5)*0.3
persistent = 0

[State 210, 2]
type = PlaySnd
trigger1 = time = 4
value = 200, 32
channel = 0

[State 0, 1]
type = TargetBind
trigger1 = time = 1
pos = 30,0

[State 200, 3]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

[State 200, 3]
type = ChangeState
trigger1 = var(41) = 2
trigger1 = var(59) != 0
trigger1 = random >= 300
trigger1 = time >= 39
value = 1001
ctrl = 0

;ﾅｷﾞA
[Statedef 1001]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1050
sprpriority = 2
poweradd = 0
velset = 0,0



[state 0,0]
type = turn
trigger1 = prevstateno = 900
persistent = 0

[State 0, 0]
type = Explod
trigger1 = time = 4
postype = p1
pos = 0,0
anim = 7766
scale = 0.5,0.5
ownpal = 1
keyctrl = 0
sprpriority = 4

[state 0,0]
type = playerpush
trigger1 = 1
value = 0

[state 0,0]
type = posset
trigger1 = time <= 1
y = 0

[State 0, 0]
type = Explod
trigger1 = time = 4
postype = p1
pos = 0,0
anim = 7765
scale = 0.5,0.5
ownpal = 1
keyctrl = 0
sprpriority = 4

[state 0,0]
type = posadd
triggerall = var(27) = 1
trigger1 = time <= 4
x = floor(enemy,gethitvar(hitcount)*-0.38)

[state 0,0]
type = posadd
triggerall = var(27) = 0
trigger1 = time >= 5
trigger1 = frontedgedist >= 20
x = 14
[state 0,0]
type = posadd
triggerall = var(27) >= 1
trigger1 = time >= 5
trigger1 = frontedgedist >= 22
x = 14 - floor(enemy,gethitvar(hitcount)) *0.28
;[state 0,0]
;type = posadd
;trigger1 = time >= 6
;trigger1 = frontedgedist < 22
;x = frontedgedist - 2 - floor(enemy,gethitvar(hitcount)) *0.9
;persistent = 0

[state 0,0]
type = playsnd
trigger1 = time = 5
value = 90,9;60, 2
[state 0,0]
type = playsnd
trigger1 = time = 1
trigger1 = random >= 500
value = 6, 1
channel = 0
[state 0,0]
type = assertspecial
trigger1 = time = [2,6]
flag = invisible
[State 0,0]
type = nothitby
trigger1 = time = [2,6]
value = SCA
time = 2


[state 0,0]
type = null;ctrlset
trigger1 = time >= 8
value = 1

[State 210, 3]
type = ChangeState
trigger1 = time >= 13
value = 1002
ctrl = 1

[State 210, 3]
type = ChangeState
trigger1 = var(59) = 1
;trigger1 = var(27) >= 1
trigger1 = time >= 12
value = 1009

;ﾅｷﾞA
[Statedef 1001]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1050
sprpriority = 2
poweradd = 0
velset = 0,0



[state 0,0]
type = turn
trigger1 = prevstateno = 900
persistent = 0

[State 0, 0]
type = Explod
trigger1 = time = 4
postype = p1
pos = 0,0
anim = 7766
scale = 0.5,0.5
ownpal = 1
keyctrl = 0
sprpriority = 4

[state 0,0]
type = playerpush
trigger1 = 1
value = 0

[state 0,0]
type = posset
trigger1 = time <= 1
y = 0

[State 0, 0]
type = Explod
trigger1 = time = 4
postype = p1
pos = 0,0
anim = 7765
scale = 0.5,0.5
ownpal = 1
keyctrl = 0
sprpriority = 4

[state 0,0]
type = posadd
triggerall = var(27) = 1
trigger1 = time <= 4
x = floor(enemy,gethitvar(hitcount)*-0.38)

[state 0,0]
type = posadd
triggerall = var(27) = 0
trigger1 = time >= 5
trigger1 = frontedgedist >= 20
x = 14
[state 0,0]
type = posadd
triggerall = var(27) >= 1
trigger1 = time >= 5
trigger1 = frontedgedist >= 22
x = 14 - floor(enemy,gethitvar(hitcount)) *0.28
;[state 0,0]
;type = posadd
;trigger1 = time >= 6
;trigger1 = frontedgedist < 22
;x = frontedgedist - 2 - floor(enemy,gethitvar(hitcount)) *0.9
;persistent = 0

[state 0,0]
type = playsnd
trigger1 = time = 5
value = 90,9;60, 2
[state 0,0]
type = playsnd
trigger1 = time = 1
trigger1 = random >= 500
value = 6, 1
channel = 0
[state 0,0]
type = assertspecial
trigger1 = time = [2,6]
flag = invisible
[State 0,0]
type = nothitby
trigger1 = time = [2,6]
value = SCA
time = 2


[state 0,0]
type = null;ctrlset
trigger1 = time >= 8
value = 1

[State 210, 3]
type = ChangeState
trigger1 = time >= 13
value = 1002
ctrl = 1

[State 210, 3]
type = ChangeState
trigger1 = var(59) = 1
;trigger1 = var(27) >= 1
trigger1 = time >= 12
value = 1009




;---------------------------------------------------------------------------
;AI ;壁コン中
[Statedef 1009]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1051;7507
sprpriority = 2
velset = 0,0


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

[state 0,0];リセット
type = varset
trigger1 = time >= 0
var(15) = 0

[state 0,0];リセット
type = varset
trigger1 = time >= 0
var(5) = 0


[state 0,0]
type = posset
trigger1 = time <= 1
y = 0

[State 210, 3]
type = Changeanim
trigger1 = animtime = 0
trigger1 = anim != 0
value = 0

[State 210, 3]
type = ChangeState
trigger1 = time >= 50
trigger2 = time >= 2
trigger2 = enemy,movetype != H
trigger3 = enemy,life = 0
value = 0
ctrl = 1

[State 200, AI]
type = ChangeState
trigger1 = var(59) = 1
trigger1 = enemy,statetype != A
trigger1 = enemy,movetype != A
trigger1 = var(27) = 0
trigger1 = enemy,stateno = [120,155]
trigger1 = p2dist x <= 30
trigger1 = random >= 600
trigger1 = time = [0,1]
value = 8400
[State 200, AI]
type = ChangeState
trigger1 = var(59) = 1
trigger1 = random >= 320
trigger1 = p2bodydist x = [-5,9]
;trigger1 = enemy,stateno = [120,131]
trigger1 = time = [0,1]
trigger1 = enemy,movetype != H
value = 980

[State -1]
type = ChangeState
value = 8800
triggerall = p2dist y = [-200,-64]
trigger1 = var(41) = 2
trigger1 = var(59) = 1
trigger1 = var(24) = 7
trigger1 = enemy,life >= 90 || life < 200

[State 200, AI]
type = ChangeState
trigger1 = var(59) = 1
trigger1 = p2dist y = [-165,-140]
trigger1 = var(27) = 0
trigger1 = var(7) = [4,8]
trigger1 = p2dist x = [-20,50]
trigger1 = random >= 60
value = 8710
[State 200, AI];gure
type = ChangeState
trigger1 = var(59) = 1
trigger1 = p2dist y = [-65,-10]
trigger1 = var(27) = 0
trigger1 = var(7) = [2,5]
trigger1 = p2dist x = [-20,50]
trigger1 = random >= 60
value = 8250
[State 200, AI]
type = ChangeState
triggerall = var(59) = 1
triggerall = p2dist x = [-50,50]
triggerall = random >= 60
trigger1 = p2dist y = [-95,-19]
trigger1 = time >= 6
trigger1 = var(27) = 0
trigger1 = var(7) < 2
trigger2 = var(27) = 0
trigger2 = p2dist y = [-125,-19]
trigger2 = var(7) >= 3
value = 8410
[State 200, AI]
type = ChangeState
trigger1 = time >= 4
trigger1 = var(59) = 1
trigger1 = p2dist y = [-75,-40]
trigger1 = var(27) = 0
trigger1 = var(7) < 2
trigger1 = p2dist x = [-50,50]
trigger1 = random >= 60
value = 8210



[State 200, AI];壁コン
type = ChangeState
trigger1 = var(59) = 1
trigger1 = p2dist y = [-70,-20]
trigger1 = var(27) >= 1
trigger1 = enemy,gethitvar(hitcount) <= 6
trigger1 = p2dist x <= 30
trigger1 = random >= 600
value = 8400
[State 200, AI];壁コン
type = ChangeState
trigger1 = var(59) = 1
trigger1 = p2dist y = [-75,-45]
trigger1 = p2dist x <= 100
trigger1 = var(27) >= 1
trigger1 = random >= 300
value = 8210
[State 200, AI];壁コン
type = ChangeState
trigger1 = var(59) = 1
trigger1 = p2dist y = [-69,-28]
trigger1 = p2dist x <= 40
trigger1 = var(27) >= 1
trigger1 = random >= 200
value = 8226
[State 200, AI];壁コン
type = ChangeState
trigger1 = var(59) = 1
;trigger1 = p2dist y = [-65,0]
trigger1 = p2dist x = [40,70]
trigger1 = var(27) >= 1
value = 8228
[State 200, AI];壁コン
type = ChangeState
trigger1 = var(59) = 1
trigger1 = p2dist y <= -59 || p2dist x >= 150
trigger1 = var(27) >= 1
trigger1 = power >= 1000
trigger1 = enemy,gethitvar(hitcount) >= 21
value = 2000
[State 200, AI];壁コン
type = ChangeState
trigger1 = var(59) = 1
;trigger1 = p2dist y = [-75,0]
trigger1 = p2dist x >= 45
trigger1 = var(27) >= 1
value = 8430


[state 0,0]
type = turn
trigger1 = p2dist x < 0
persistent = 5

;END


;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 2.8,-7
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .4

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground


;---------------------------------------------------------------------------
; Kung Fu Palm
; CNS difficulty: medium
; Description: This is like a standard attack, but with some differences.
;   There are two HitDefs in this attack. One is triggered when the
;   opponent is near (using a p2bodydist trigger), and the other
;   when the opponent is farther away. The main differences between
;   the near and far versions of the HitDefs is that the near version
;   has a "fall" parameter set to 1, causing the opponent to be knocked
;   down. Other minor differences are the damage, and the velocity to
;   give the opponent.
;   The line "attr = S, SA" line means this is a Standing, Special Attack.
;   It is important you have the attr parameter set correctly for all
;   you HitDefs.
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 670
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
value = 701, 20

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1000, 3]
type = PosAdd
trigger1 = AnimElem = 3
x = 39

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 3
attr = S, SA
animtype  = Hard
damage    = 130, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = s701,20
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1000, 6]
type = PosAdd
trigger1 = AnimElem = 9
x = -5

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

;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1010]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
velset = 0,0
anim = 669
ctrl = 0
sprpriority = 2

[State 1010, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 701, 18

[State 1000, Axe Tossin]
type = Projectile
trigger1 = AnimElem = 3
projanim = 673
projhitanim = 674
;projremanim = 689
sparkno = s6970
guard.sparkno = 1
projpriority = 1
projshadow = -1
offset = 40, -76
velocity = 6
attr = S, SP
damage   = 146
animtype = light
guardflag = MA
hitflag = MAFDP
pausetime = 0,10
hitsound   = S701,19
sparkxy = 100, -200
guardsound = 6,0
ground.type = Low
ground.slidetime = 28
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0
fall = 1

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Fast Kung Fu Palm
; CNS difficulty: advanced
; Description: This is a complicated attack move. If you're a beginner,
;     you should skip looking at this for now and check it later when
;     you are more comfortable with the cns.
;     This move puts the other player in a custom get-hit state.
;     The line "p2stateno = 1025" in the HitDef does this. KFM has some
;     palette effects as well as after-image effects.
[Statedef 1020]
type    = S
movetype= A
physics = N
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1020
ctrl = 0
sprpriority = 2

[State 1020, Friction]
type = VelMul
trigger1 = 1
x = .85 * ifelse (AnimElemTime(6) < 0, 1, .8)

[State 1020, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1020, Afterimage]
type = AfterImageTime
trigger1 = AnimElemTime(8) < 0
time = 2

[State 1020, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

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

[State 1020, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1020, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 10

[State 1020, 4]
type = PosAdd
trigger1 = AnimElem = 4
x = 5

[State 1020, 5]
type = VelSet
trigger1 = AnimElem = 4
x = 13

[State 1020, 6]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
animtype  = Hard
damage    = 95, 5
getpower  = 0
priority  = 4
guardflag = MA
pausetime = 8,7
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = -8,-7
guard.velocity = -7
air.velocity = -8,-7
airguard.velocity = -5, -4
fall = 1
p2stateno = 1025    ;Make p2 go to state 1025 on hit
p2facing = 1        ;Force to face p1

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

;------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 1025]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1025

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1026

;------------------
; Hit by Fast Kung Fu Palm - flying through the air
; (a custom gethit state)
[Statedef 1026]
type    = A
movetype= H
physics = N

[State 1026, Velocity]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1027

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;------------------
; Hit by Fast Kung Fu Palm - hit wall
; (a custom gethit state)
[Statedef 1027]
type    = A
movetype= H
physics = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027

[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,0

[State 1027, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 1028

;------------------
; Hit by Fast Kung Fu Palm - bounce off wall
; (a custom gethit state)
[Statedef 1028]
type    = A
movetype= H
physics = N

[State 1028, 1]
type = NotHitBy
trigger1 = 1
value = , NA, NP

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6

[State 1028, Vel X]
type = VelSet
trigger1 = Time = 0
x = 1.6

[State 1028, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;---------------------------------------------------------------------------
; Kung Fu Knee
; CNS difficulty: medium
; Description: Like the Kung Fu Palm, this is a special attack. This attack
;     begins on the ground, launches KFM into the air, then ends when KFM
;     lands on the ground. To achieve this, we use three states. The first
;     has KFM starting on the ground (note that type = S in the Statedef).
;     The ChangeState controller brings KFM into the second state (state
;     1051) when his ground animation ends. The second state controls KFM's
;     movement into the air and back towards the ground. The last state
;     (state 1052) stops KFM from moving when he touches the ground, and
;     brings him back to his stand state (state 0) when the animation is
;     over. More details are given in comments before each of the following
;     states.
[Statedef 1050]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2

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

[State 1050, 2]
type = null;PosAdd
trigger1 = AnimElem = 2
x = 15

[State 1050, 3]
type = PosAdd
trigger1 = AnimElem = 4
x = 20

[State 1050, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
damage    = 80, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = 1

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1051

;------------------
; Light Kung Fu Knee - jump
; Description: This state uses a velset parameter in the Statedef to make
;     KFM move upwards. A value of 2,-6 means 2 pixels/tick forwards, and
;     6 pixels/tick upwards. Since this is an aerial state, the type is set
;     to A in the Statedef.
;     Notice that physics = N (N for None) here. This means we are not using
;     the built-in aerial physics model (physics = A), so we have complete
;     control over what KFM does in this state. Since we do not have
;     physics = A to take care of gravity for us, we need to put in our own
;     controller for that. Controller 1051,1 does the work of pulling KFM
;     down towards the ground. Controller 1051,2 checks if KFM has reached
;     the ground, and changes to state 1052 if so.
;     In this state's Statedef, we will use the hitdefpersist parameter to
;     retain the HitDef information from the last state. If we did not have
;     hitdefpersist, the HitDef will be turned off between state changes.
[Statedef 1051]
type    = A
movetype= A
physics = N
velset = 2,-6
anim = 1051
hitdefpersist = 1 ;Keep the HitDef from previous state active

[State 1051, 1] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1051, 2]
type = ChangeState
trigger1 = Command = "a" || Command = "b"
trigger1 = Vel y < -1
value = 1055

[State 1051, 3] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10
value = 1052

;------------------
; Light Kung Fu Knee - land
; Description: This is KFM's landing state. There is a velset in the
;     Statedef to stop KFM from moving. Since KFM's y-position can be any
;     number greater than -10 upon entering this state (see the ChangeState
;     controller in State 1051), we need to reset it to 0, the ground
;     level. That is what controller 1052,1 is for.
[Statedef 1052]
type    = S
movetype= I
physics = S
anim = 1052
sprpriority = 1
velset = 0,0

[State 1052, 1] ;Reset y-position to ground level
type = PosSet
trigger1 = Time = 0
y = 0

[State 1052, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = Time = 0
value = 40, 0

[State 1052, 3] ;Give KFM back control early
type = CtrlSet
trigger1 = AnimElem = 3, -1
value = 1

[State 1052, 4] ;Move KFM back a little
type = PosAdd
trigger1 = AnimElem = 4
x = -15

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

;------------------
; Kung Fu Knee - kick
[Statedef 1055]
type    = A
movetype= A
physics = N
anim = 1055

[State 1055, 1]
type = PlaySnd
trigger1 = Time = 0
value = 100,0
channel = 0

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

[State 1055, 3]
type = PosAdd
trigger1 = Time = 0
x = 10
y = -10

[State 1055, 4] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1055, 5]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Med
damage    = 35 + (prevstateno = 1061)*5, 2
priority  = 4
guardflag = MA
pausetime = 12,12
sparkxy = 0,-90
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -8
guard.ctrltime = 12
air.velocity = -4,-5
airguard.velocity = -4,-4.5
air.fall = 1

[State 1055, 6] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -5
value = 1056

;------------------
; Kung Fu Knee - land from kick
[Statedef 1056]
type    = S
movetype= I
physics = S
anim = 1056
sprpriority = 1
velset = 0,0

[State 1056, 1] ;Reset y-position to ground level
type = PosSet
trigger1 = Time = 0
y = 0

[State 1056, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = Time = 0
value = 40, 0

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

;---------------------------------------------------------------------------
; Strong Kung Fu Knee
[Statedef 1060]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
velset = 0,0
anim = 1060
ctrl = 0
sprpriority = 2

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

[State 1060, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 6

[State 1060, 3]
type = PosAdd
trigger1 = AnimElem = 4
x = 21

[State 1060, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = -3.5,-7.5
guard.velocity = -7
air.velocity = -3.5,-7.5
fall = 1

[State 1060, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1061

;------------------
; Strong Kung Fu Knee - jump
[Statedef 1061]
type    = A
movetype= A
physics = N
velset = 2.5,-7.5
anim = 1061
hitdefpersist = 1 ;Keep the HitDef from previous state active

[State 1061, 1]
type = VelAdd
trigger1 = 1
y = .45

[State 1061, 2]
type = ChangeState
trigger1 = Command = "a" || Command = "b"
trigger1 = Vel y < -1
value = 1055

[State 1061, 3]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10
value = 1052

;---------------------------------------------------------------------------
; Fast Kung Fu Knee
; Description: This version of the Kung Fu Knee hits up to 3 times (including
;     the kick).
[Statedef 1070]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1070
ctrl = 0
sprpriority = 2

[State 1070, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1070, Afterimage]
type = AfterImageTime
trigger1 = 1
time = 2

[State 1070, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

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

[State 1070, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 6

[State 1070, 3]
type = PosAdd
trigger1 = AnimElem = 4
x = 21

[State 1070, 4]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Medium
getpower  = 0
damage    = 35, 3
priority  = 5
hitflag   = MA
guardflag = MA
pausetime = 8,7
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 20
ground.velocity = -2,-6
guard.velocity = -7
air.velocity = -2,-6
fall = 1
fall.animtype = Med
fall.recovertime = 30

[State 1070, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1071

;------------------
; Fast Kung Fu Knee - jump
[Statedef 1071]
type    = A
movetype= A
physics = N
velset = 2.5,-9
anim = 1071

[State 1071, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 18
add = 32,16,0
sinadd = 64,32,5,3

[State 1071, Afterimage]
type = AfterImageTime
trigger1 = Vel Y < 0
time = 2

[State 1071, 1]
type = VelAdd
trigger1 = 1
y = .5

[State 1071, 2]
type = VelAdd
trigger1 = Vel Y >= -1
y = .2

[State 1071, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
getpower  = 0
damage    = 68, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 20
ground.velocity = -3,-9.5
guard.velocity = -7
air.velocity = -3,-9.5
fall = 1
fall.recovertime = 30

[State 1071, 4]
type = ChangeState
trigger1 = Command = "a" || Command = "b"
trigger1 = Vel y < -1
trigger1 = Time > 0
value = 1075

[State 1071, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10
value = 1052

;------------------
; Fast Kung Fu Knee - kick
[Statedef 1075]
type    = A
movetype= A
physics = N
anim = 1055

[State 1075, Afterimage]
type = AfterImageTime
trigger1 = 1
time = 2

[State 1075, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1075, 1]
type = PlaySnd
trigger1 = Time = 0
value = 100,0
channel = 0

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

[State 1075, 3]
type = PosAdd
trigger1 = Time = 0
x = 10
y = -10

[State 1075, 4] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1075, 5]
type = VelAdd
trigger1 = Vel Y >= -1
y = .2

[State 1075, 6]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Med
damage    = 42, 2
getpower  = 0
priority  = 4
guardflag = MA
pausetime = 12,12
sparkxy = 0,-90
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -6
guard.velocity = -6
air.velocity = -4,-6
airguard.velocity = -4,-4.5
air.fall = 1

[State 1075, 7] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -5
value = 1056


;---------------------------------------------------------------------------
; Light Kung Fu Upper
; CNS difficulty: easy
; Description: This is a simple special attack that can hit twice. Notice
;     the use of the Width controller to keep opponents from getting too
;     close to KFM during his uppercut (press Ctrl-C, and look at the
;     yellow bar at KFM's feet during the move).
;     The second HitDef has some interesting parameters. fall.recovertime
;     is used to prevent the opponent (p2) from recovering immediately
;     after being hit (eg. press x+y with KFM to recover). This gives the
;     attacking KFM a chance to follow up with an extra attack, such as
;     a Kung Fu Knee. The yaccel parameter, set at 0.4, makes p2 fall at a
;     greater value of acceleration than the default, which is 0.35.
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

[State 1100, Width]
type = Width
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(13) < 0
value = 5,0

[State 1100, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 2

[State 1100, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 1100, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

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

;---------------------------------------------------------------------------
; Strong Kung Fu Upper
[Statedef 1110]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
velset = 0,0
anim = 1110
ctrl = 0
sprpriority = 2

[State 1110, Width]
type = Width
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(14) < 0
value = 5,0

[State 1110, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 2

[State 1110, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 57, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1

[State 1110, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 60, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-10.5
guard.velocity = -6
air.velocity = -1,-8.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1
fall.recovertime = 50
yaccel = .4

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

;---------------------------------------------------------------------------
; Fast Kung Fu Upper
[Statedef 1120]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1120
ctrl = 0
sprpriority = 2

[State 1120, Width]
type = Width
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(14) < 0
value = 5,0

[State 1120, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1120, Afterimage]
type = AfterImageTime
trigger1 = AnimTime < -2
time = 2

[State 1120, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1120, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 2

[State 1120, 2]
type = HitDef
trigger1 = Time = 0
trigger2 = AnimElem = 4
attr = S, SA
animtype  = Med
damage    = 30, 4
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 6,10
sparkxy = 0, ifelse(Time = 0, -48, -55)
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 23
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1

[State 1120, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 68, 4
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 23
ground.velocity = -1.2,-11
guard.velocity = -6
air.velocity = -1.2,-9
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1
fall.recovertime = 60
yaccel = .4

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

;---------------------------------------------------------------------------
; Light Kung Fu Blow
; CNS difficulty: easy
; Notes: This uses the EnvShake controller to shake the screen. It makes the
;        move look stronger.
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 50
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2

[State 1200, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 3

[State 1200, Width 1]
type = Width
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
value = 10,0

[State 1200, Width 2]
type = Width
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(9) < 0
value = 20,0

[State 1200, Shake Screen]
type = EnvShake
trigger1 = AnimElem = 6
time = 4     ;Time to shake screen
ampl = 2     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

[State 1200, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 100, 6
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-65
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = -10
ground.cornerpush.veloff = -12 ;To push far away when p2 is in corner
guard.velocity = -7
air.velocity = -3.5,-4.5
airguard.velocity = -3.5,-4.5

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

;---------------------------------------------------------------------------
; Strong Kung Fu Blow
; CNS difficulty: easy
[Statedef 1210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
velset = 0,0
anim = 668
ctrl = 0
sprpriority = 2

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 701, 29
volume = 255

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 100, 3
volume = 255

[State 1210, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 70, 9
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-65
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 32
ground.hittime  = 22
ground.velocity = -14,-4.5
air.velocity = -14,-4.5
airguard.velocity = -12,-4.5
id = 1210
nochainid = 1210
ground.cornerpush.veloff = -19 ;To push far away when p2 is in corner
guard.velocity = -8
yaccel = .3
p2stateno = 1215
p2facing = 1

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

;---------------------------------------------------------------------------
; Hit by power move (shaking)
[Statedef 1215]
type    = A
movetype= H ;Get hit
physics = N

[State 940, 0]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0
z = 0

;[State 940, 1]
;type = NotHitBy
;trigger1 = 1
;value = SCA
;Time = 1

[State 940, 2]
type = PosAdd
trigger1 = Time = 0
y = -20

[State 940, 3]
type = ChangeAnim
Trigger1 = Time >= 0
value = 5030

[State 940, 4]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1216

; Hit by power move (flying)
[Statedef 1216]
type    = A
movetype= H ;Get hit
physics = N

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

;[State 941, 0]
;type = NotHitBy
;trigger1 = 1
;value = SCA
;Time = 1

[State 941, 1]
type = ChangeAnim
Trigger1 = Time = 0
value = ifelse(SelfAnimExist(5052),5052,5050)

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 941, 5]
type = ChangeState
trigger1 = backedgedist <= 5
value = 1217

[State 943, 5]
type = SelfState
trigger1 = Pos Y > 10
trigger1 = Vel Y > 0
value = 5100
ctrl = 0

; Hit by power move (hitting the wall)
[Statedef 1217]
type    = A
movetype= H ;Get hit
physics = N

[State 942, 0]
type = PlaySnd
Trigger1 = Time = 0
value = F5, 4

[State 942, 1]
type = PosAdd
trigger1 = Time = 0
y = -20

[State 942, 2]
type = ChangeAnim
Trigger1 = Time = 0
value = 5070

[State 942, 3]
type = VelSet
trigger1 = Time = 0
x = 2
y = -3
z = 0

[State 942, 4]
type = EnvShake
Trigger1 = Time = 0
time = 20
ampl = -4
freq = 90
phase = 90

[State 942,19]
type = GameMakeAnim
trigger1 = Time = 0
value = 72
pos = -10, -50

[State 942, 6]
type = ChangeState
trigger1 = Time = 10
value = 1218

; Hit by power move (falling to the ground)
[Statedef 1218]
type    = A
movetype= H ;Get hit
physics = N

[State 943, 0]
type = ChangeAnim
Trigger1 = Time = 0
value = 5090

[State 943, 1]
type = Gravity
trigger1 = Time >= 0

[State 943, 5]
type = SelfState
trigger1 = Pos Y > 10
trigger1 = Vel Y > 0
value = 5100
ctrl = 0

;---------------------------------------------------------------------------
; Fast Kung Fu Blow
; CNS difficulty: easy
[Statedef 1220]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1220
ctrl = 0
sprpriority = 2

[State 1220, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1220, Afterimage]
type = AfterImageTime
trigger1 = AnimTime < -2
time = 2

[State 1220, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1220, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0, 3

[State 1220, Width 1]
type = Width
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
value = 10,0

[State 1220, Width 2]
type = Width
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(9) < 0
value = 20,0

[State 1220, Shake Screen]
type = EnvShake
trigger1 = AnimElem = 6
time = 8
ampl = 3
freq = 170

[State 1220, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 125, 9
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = 0,-65
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 32
ground.velocity = -15
ground.cornerpush.veloff = -20 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -5,-5
airguard.velocity = -5,-5
air.fall = 1
fall.animtype = Hard           ;Show "hard" animtype when hit for a fall
yaccel = .4                    ;Fall faster

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


;---------------------------------------------------------------------------
; Kung Fu Blocking High
; CNS difficulty: medium
; Notes: This move uses a ReversalDef controller to counter attacks. Any
;        attacks not caught by the ReversalDef are handled by the HitOverride.
;        The movetype is Idle because this is not an attack.
[Statedef 1300]
type    = S
movetype= I
physics = S
velset = 0,0
anim = 1300
ctrl = 0
sprpriority = 1

[State 1300, Width]
type = Width
trigger1 = AnimElemTime(3) < 0
value = 15,0

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

[State 1300, 2]
type = ReversalDef
trigger1 = Time = 0
reversal.attr = SA, AA
pausetime = 0,0
sparkno = 40
sparkxy = 40,0
hitsound = 6,0
p1stateno = 1310
p1sprpriority = 2 ;Set P1's sprite in front of P2's
p2sprpriority = 1

[State 1300, 3] ;Stop ReversalDef
type = ReversalDef
trigger1 = Time = 4
trigger1 = Time = command = "holdfwd"
trigger2 = Time = 8
reversal.attr =

[State 1300, 4]
type = HitOverride
trigger1 = Time = 0
attr = SA, AP
stateno = 1310
time = 8

[State 1300, 5]
type = HitOverride
trigger1 = Time = 4
trigger1 = Time = command = "holdfwd"
attr =
time = 0

[State 1300, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Kung Fu Blocking High (blocked)
; Notes: This state uses a Pause controller to freeze the action dramatically.
[Statedef 1310]
type    = S
movetype= I
physics = S
velset = 0,0
anim = 1310
ctrl = 0
sprpriority = 2

[State 1310, 1]
type = Pause
trigger1 = Time = 0
time = 20
endcmdbuftime = 20 ;Buffer commands input during the pause
pausebg = 0        ;Don't pause backgrounds

[State 1310, 2]    ;Go to guarding
type = ChangeState
trigger1 = Time = 1
trigger1 = command = "holdback"
value = 130
ctrl = 1

[State 1310, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 1

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

;---------------------------------------------------------------------------
; Kung Fu Blocking Low
[Statedef 1320]
type    = C
movetype= I
physics = C
velset = 0,0
anim = 1320
ctrl = 0
sprpriority = 1

[State 1320, Width]
type = Width
trigger1 = AnimElemTime(3) < 0
value = 10,0

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

[State 1320, 2]
type = ReversalDef
trigger1 = Time = 0
reversal.attr = C, AA
pausetime = 0,0
sparkno = 40
sparkxy = 40,0
hitsound = 6,0
p1stateno = 1330
p1sprpriority = 2
p2sprpriority = 1

[State 1320, 3] ;Stop
type = ReversalDef
trigger1 = Time = 5
reversal.attr =

[State 1320, 4]
type = HitOverride
trigger1 = Time < 5
attr = C, AP
stateno = 1330

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

;---------------------------------------------------------------------------
; Kung Fu Blocking Low (blocked)
[Statedef 1330]
type    = C
movetype= I
physics = C
velset = 0,0
anim = 1330
ctrl = 0
sprpriority = 2

[State 1330, 1]
type = Pause
trigger1 = Time = 0
time = 20
endcmdbuftime = 20 ;Buffer commands input during the pause
pausebg = 0        ;Don't pause backgrounds

[State 1330, 2]
type = ChangeState
trigger1 = Time = 1
trigger1 = command = "holdback"
value = 131
ctrl = 1

[State 1330, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 1

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

;---------------------------------------------------------------------------
; Kung Fu Blocking Air
[Statedef 1340]
type    = A
movetype= I
physics = N
anim = 1340
ctrl = 0
sprpriority = 1

[State 1340, Width]
type = Width
trigger1 = AnimElemTime(3) < 0
value = 10,0

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

[State 1340, 2]
type = ReversalDef
trigger1 = Time = 0
reversal.attr = A, AA
pausetime = 0,0
sparkno = 40
sparkxy = 40,0
hitsound = 6,0
p1stateno = 1350
p1sprpriority = 2
p2sprpriority = 1

[State 1340, 3] ;Stop
type = ReversalDef
trigger1 = Time = 5
reversal.attr =

[State 1340, 4]
type = HitOverride
trigger1 = Time < 5
attr = SA, AP
stateno = 1350

[State 1340, 5]
type = CtrlSet
trigger1 = AnimElem = 4
value = 1

[State 1340, 6] ;Gravity
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 1340, 6] ;Land from jump
type = ChangeState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 1351

;---------------------------------------------------------------------------
; Kung Fu Blocking Air (blocked)
[Statedef 1350]
type    = A
movetype= I
physics = N
anim = 1350
ctrl = 0
sprpriority = 2

[State 1350, 1]
type = Pause
trigger1 = Time = 0
time = 20
endcmdbuftime = 20 ;Buffer commands input during the pause
pausebg = 0        ;Don't pause backgrounds

[State 1350, 2]
type = ChangeState
trigger1 = Time = 1
trigger1 = command = "holdback"
value = 132
ctrl = 1

[State 1350, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 1

[State 1350, 4] ;Stop KFM in the air
type = PosFreeze
trigger1 = AnimElemTime(3) < 0

[State 1350, 5]
type = CtrlSet
trigger1 = AnimElem = 3
value = 1

[State 1350, 6] ;Gravity
type = VelAdd
trigger1 = AnimElemTime(3) > 0
y = Const(movement.yaccel)

[State 1350, 7] ;Land from jump
type = ChangeState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 1351

;---------------------------------------------------------------------------
; Kung Fu Blocking Air (land)
[Statedef 1351]
type    = S
physics = S
ctrl = 0
anim = 47

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

[State 1351, 2]
type = PosSet
trigger1 = Time = 0
y = 0

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

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

[State 1351, 5] ;Go to high block
type = ChangeState
trigger1 = command = "blocking"
trigger1 = command != "holddown"
value = 1300

[State 1351, 6] ;Go to low block
type = ChangeState
trigger1 = command = "blocking"
value = 1320

;---------------------------------------------------------------------------
; Light Kung Fu Zankou
; CNS difficulty: easy
[Statedef 1400]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 50
velset = 0,0
anim = 1400
ctrl = 0
sprpriority = 2

[State 1400, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 1400, Friction]
type = VelMul
trigger1 = 1
x = 0.5

[State 1400, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 100, 6
priority  = 4
guardflag = MA
pausetime = 12,12
sparkxy = 0,-65
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -9
ground.cornerpush.veloff = -15 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -2,-5
airguard.velocity = -3.5,-4.5
air.fall = 1

[State 1400, 3]
type = PosAdd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
x = 10

[State 1400, 4]
type = VelSet
trigger1 = AnimElem = 4
x = 2

[State 1400, 5]
type = PosAdd
trigger1 = AnimElem = 8
x = 10

[State 1400, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Strong Kung Fu Zankou
; CNS difficulty: easy
[Statedef 1410]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 50
velset = 0,0
anim = 1410
ctrl = 0
sprpriority = 2

[State 1410, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 1410, Friction]
type = VelMul
trigger1 = 1
x = 0.65

[State 1410, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 100, 6
priority  = 4
guardflag = MA
pausetime = 12,12
sparkxy = 0,-65
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -9
ground.cornerpush.veloff = -15 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -2,-5
airguard.velocity = -3.5,-4.5
air.fall = 1

[State 1410, 3]
type = PosAdd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
x = 10

[State 1410, 4]
type = VelSet
trigger1 = AnimElem = 3
x = 8

[State 1410, 5]
type = PosAdd
trigger1 = AnimElem = 9
x = 10

[State 1410, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Far Kung Fu Zankou
; CNS difficulty: easy
[Statedef 1420]
type    = S
movetype= A
physics = N
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1420
ctrl = 0
sprpriority = 2

[State 1420, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1420, Afterimage]
type = AfterImageTime
trigger1 = AnimElemTime(8) < 0
time = 2

[State 1420, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1420, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 3

[State 1420, Friction]
type = VelMul
trigger1 = 1
x = 0.7

[State 1420, 2]
type = HitDef
trigger1 = AnimElemTime(4) = -2
attr = S, SA
animtype  = Hard
damage    = 25, 2
getpower  = 0
priority  = 4
guardflag = MA
pausetime = 9,9
sparkxy = -15,-45
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 24
ground.velocity = -7
ground.cornerpush.veloff = -8 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -5,-4
airguard.velocity = -3.5,-4.5

[State 1420, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
animtype  = Hard
damage    = 100, 8
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-65
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 24
ground.velocity = -5,-4
ground.cornerpush.veloff = -15 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -5,-4
airguard.velocity = -3.5,-4.5
fall = 1

[State 1420, 3]
type = PosAdd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
x = 10

[State 1420, 4]
type = VelSet
trigger1 = AnimElemTime(3) = [1,2]
x = 20

[State 1420, 5]
type = PosAdd
trigger1 = AnimElem = 10
x = 10

[State 1420, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Uwaraba Smash
; CNS difficulty: medium
; Notes: Notice that the HitDefs in supers have "getpower = 0". This makes
;        sure KFM doesn't recharge his super guage as he hits.
;        Also, the attributes for the HitDefs is "HA" for "hyper attack",
;        ie. "attr = S, HA".
;        Notice how the first HitDef is reused twice by allowing it to
;        trigger on two animation elements.
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 680
ctrl = 0
sprpriority = 2

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 25, -57
anim = 100
sound = 20, 0
poweradd = -1000

[State 2000, 1]
type = explod
trigger1 = AnimElem = 1
anim = 682
pos = 160, 120
postype = left
sprpriority = -10
bindtime = -1
supermove = 1
facing = 1

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
attr = S, SA
animtype  = Hard
damage    = 70, 4
priority  = 5
guardflag = MA
pausetime = 15,26
sparkxy = -10,-60
getpower = 0
hitsound   = s701,20
hitflag = MAFDP
guardsound = 6,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,0
air.velocity = 0,0

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype  = Hard
damage    = 100, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitflag = MAFDPG
hitsound   = s701,20
getpower = 0
guardsound = 6,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,3.5
air.velocity = 0,3
fall = 1

[State 3000, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2000, 0
volume = 255

[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 90, 9
volume = 255

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

;---------------------------------------------------------------------------
; Barack Obama
; CNS difficulty: medium
; Description: This is very similar to KFM's Strong and Light Kung Fu Uppers.
;     There is just one HitDef, for a screen-shaking hit. The envshake
;     parameters are used to make this effect. You can find out more about
;     each parameter in the CNS documentation.
;     The fall.recover parameter is set at 0, meaning that p2 cannot recover
;     from the fall by entering his recovery command (for KFM, that is x+y).
;     This gives the attacking KFM a chance to follow up with another attack,
;     such as the Fast Kung Fu Palm.
;     Note that there is a ChangeState controller used to make KFM change to
;     a success state if he hits. The success state has KFM hold his arm
;     up longer for a dramatic effect.
[Statedef 3050]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 672
ctrl = 0
sprpriority = 2

[State 3050, Super A]
type = SuperPause
trigger1 = AnimElem = 2
pos = -5, -55
anim = 100
sound = 20, 0
poweradd = -1000

[State 2000, 1]
type = explod
trigger1 = AnimElem = 2
anim = 681
pos = 160, 120
postype = left
sprpriority = -10
bindtime = -1
supermove = 1
facing = 1

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype  = Hard
damage    = 50, 4
priority  = 5
guardflag = MA
pausetime = 5,40
hitsound   = s701,20
hitflag = MAFDP
getpower = 0
guardsound = 6,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,3.5
air.velocity = 0,3

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = 701, 10
volume = 255

[State 191, Shake Screen]
type = EnvShake
trigger1 = Time = 107
trigger2 = Time = 180
time = 4     ;Time to shake screen
ampl = 2     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

[State 191, Shake Screen]
type = EnvShake
trigger1 = Time = 147
time = 13     ;Time to shake screen
ampl = 6     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

[State 1000, Axe Tossin]
type = Projectile
trigger1 = Time = 31
trigger2 = Time = 72
trigger3 = Time = 107
trigger4 = Time = 123
trigger5 = Time = 160
projanim = 675
projhitanim = 676
getpower = 0
;projremanim = 689
sparkno = s6970
guard.sparkno = 1
projpriority = 1
projshadow = -1
offset = 10, 0
velocity = 20
attr = S, SP
damage   = 65
animtype = light
guardflag = MA
hitflag = MAFDP
pausetime = 0,60
hitsound   = S701,19
sparkxy = 100, -200
guardsound = S701,17
ground.type = Low
ground.slidetime = 28
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 1000, Axe Tossin]
type = Projectile
trigger1 = Time = 182
projanim = 675
projhitanim = 676
;projremanim = 689
sparkno = s6970
guard.sparkno = 1
projpriority = 1
projshadow = -1
offset = 10, 0
velocity = 20
attr = S, SP
damage   = 65
animtype = light
guardflag = MA
hitflag = MAFDP
pausetime = 0,20
hitsound   = S701,19
sparkxy = 100, -200
guardsound = S701,17
ground.type = Low
ground.slidetime = 28
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0
fall = 1

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

;---------------------------------------------------------------------------
; Y?s? Sankaku Kyaku (start)
; CNS difficulty: medium
; Description: This is very similar to KFM's Strong and Light Kung Fu Uppers.
;     There is just one HitDef, for a screen-shaking hit. The envshake
;     parameters are used to make this effect. You can find out more about
;     each parameter in the CNS documentation.
;     The fall.recover parameter is set at 0, meaning that p2 cannot recover
;     from the fall by entering his recovery command (for KFM, that is x+y).
;     This gives the attacking KFM a chance to follow up with another attack,
;     such as the Fast Kung Fu Palm.
;     Note that there is a ChangeState controller used to make KFM change to
;     a success state if he hits. The success state has KFM hold his arm
;     up longer for a dramatic effect.
[Statedef 9990]
type    = A
movetype= A
physics = A
juggle  = 4
velset = -3,-10
anim = 43
ctrl = 0
sprpriority = 2

[State 3050, Super A]
type = SuperPause
trigger1 = AnimElem = 9
pos = -5, -55
anim = 100
sound = 20, 0
poweradd = -2000

[State 2000, 1]
type = explod
trigger1 = AnimElem = 9
anim = 683
pos = 160, 120
postype = left
sprpriority = -10
bindtime = -1
supermove = 1
ontop = 1
facing = 1

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

[State 3050, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 9991

; Y?s? Sankaku Kyaku (proceed)
; CNS difficulty: medium
; Description: This is very similar to KFM's Strong and Light Kung Fu Uppers.
;     There is just one HitDef, for a screen-shaking hit. The envshake
;     parameters are used to make this effect. You can find out more about
;     each parameter in the CNS documentation.
;     The fall.recover parameter is set at 0, meaning that p2 cannot recover
;     from the fall by entering his recovery command (for KFM, that is x+y).
;     This gives the attacking KFM a chance to follow up with another attack,
;     such as the Fast Kung Fu Palm.
;     Note that there is a ChangeState controller used to make KFM change to
;     a success state if he hits. The success state has KFM hold his arm
;     up longer for a dramatic effect.
[Statedef 9991]
type    = A
movetype= A
physics = A
juggle  = 4
velset = 14,14
anim = 630
ctrl = 0
sprpriority = 2

[State 3050, 1]
type = PlaySnd
trigger1 = Time = 0
value = 2000, 2
channel = 1

[State 3050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 100, 3

[State 3050, 2]
type = HitDef
trigger1 = Time = 0
attr = S, HA
animtype  = Hard               ;Make p2 use "Up" type animation on hit
damage    = 400, 12
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 60,60
sparkno = 3
sparkxy = 0,-110
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 24
ground.velocity = -5,-4
ground.cornerpush.veloff = -15 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -5,-4
airguard.velocity = -3.5,-4.5
fall = 1
fall.recover = 0             ;Prevent p2 from recovering
fall.damage = 70             ;p2 will take 70 damage on hitting the ground
fall.envshake.ampl = 6       ;Parameters for shaking the screen on fall
fall.envshake.freq = 178
fall.envshake.time = 15
yaccel = 20

;This controller below makes Kung Fu man change to a success state if he
;successfully hits the Smash Kung Fu Upper.
[State 3050, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Harahara (hyper)
; CNS difficulty: medium
; Description: This is very similar to KFM's Strong and Light Kung Fu Uppers.
;     There is just one HitDef, for a screen-shaking hit. The envshake
;     parameters are used to make this effect. You can find out more about
;     each parameter in the CNS documentation.
;     The fall.recover parameter is set at 0, meaning that p2 cannot recover
;     from the fall by entering his recovery command (for KFM, that is x+y).
;     This gives the attacking KFM a chance to follow up with another attack,
;     such as the Fast Kung Fu Palm.
;     Note that there is a ChangeState controller used to make KFM change to
;     a success state if he hits. The success state has KFM hold his arm
;     up longer for a dramatic effect.
[Statedef 3333]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 667
poweradd = -1000
ctrl = 0
sprpriority = 2

;[State 3050, Super A]
;type = SuperPause
;trigger1 = AnimElem = 2
;pos = -5, -55
;anim = 100
;sound = 20, 0
;poweradd = -1000

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
time = 2

[State 3050, Super D]
type = NotHitBy
trigger1 = AnimElem = 2
value = , NA, SA, AT
time = 6

[State 3050, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 701, 35

[State 3050, 1]
type = PlaySnd
trigger1 = AnimElem = 11
value = 701, 9
channel = 1

[State 3050, 2]
type = HitDef
trigger1 = AnimElem = 28
trigger2 = AnimElem = 29
trigger3 = AnimElem = 30
trigger4 = AnimElem = 31
attr = S, HA             ;Make p2 use "Up" type animation on hit
damage    = 88, 12
getpower  = 0
priority  = 5
pausetime = 30,30
sparkno = 3
sparkxy = 0,-110
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 26
ground.velocity = -1.3,-25
guard.velocity = -11
air.velocity = -1.3,-1
airguard.velocity = -4.5,-5
envshake.time = 25           ;Parameters for shaking the screen on hit
envshake.ampl = 7
envshake.freq = 176
p2facing = 1                 ;Force p2 to face p1 on hit
fall = 1
fall.recover = 0             ;Prevent p2 from recovering
fall.damage = 70             ;p2 will take 70 damage on hitting the ground
fall.envshake.ampl = 6       ;Parameters for shaking the screen on fall
fall.envshake.freq = 178
fall.envshake.time = 15
mindist = 50,-100            ;Keep p2 a minimum of 50 pixels away from p1, and no higher than 100 pixels up
maxdist = 100,-10            ;Keep p2 a maximum of 100 pixels away from p1, and no lower than 10 pixels below
yaccel = .8                  ;Accelerate p2 downwards rapidly

[State 0, Explod]
type = Explod
trigger1 = Time = 1
anim = 685
ID = 685
bindtime = 102
pos = 160, 120
postype = left
sprpriority = -1
removetime = 102
removeongethit = 1

[State 3050, 5]
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)
;---------------------------------------------------------------------------

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

[Statedef -3]

;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

[State 0, VarRandom]
type = VarRandom
trigger1 = Time = 1
trigger1 = Anim = [5000,5099]
v = 3
range = 0,12

[State -3]
type = PlaySnd
triggerall = time = 0
triggerall = alive = 1
trigger1 = stateno = [5000,5099]
value = 702, var(3)
volume = 255
channel = 1
