; KFM'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.

; これはKFMの定数と状態のファイルです。
; このファイルの中には注釈が散らされているので、CNSを習いたいお方は
; 読んでみたらいいです。

[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1000
;Amount of power stocks to have (divided by 1000). Defaults to 3000
power = 10000
;attack power (more is stronger)
;攻撃ダメージ
attack = 100
;defensive power (more is stronger)
;体力パワー
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 = 12
;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 = 0
;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 = 2           ;Horizontal scaling factor.
yscale = 2           ;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 = 30          ;Height of player (for opponent to jump over)
attack.dist = 70  ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 2.5      ;Walk forward
walk.back = -2.3     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.4    ;Neutral jumping velocity (x, y)
jump.back = -2.31    ;Jump back Speed (x, y)
jump.fwd = 2.31      ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

[Movement]
airjump.num = 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

;---------------------------------------------------------------------------
; 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).

; Stand to Crouch

;No Crouch code shamelessly stolen from Borghi's Final

;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 0, StopSnd from intro]
type = StopSnd
trigger1 = prevstateno = [190,192]
channel = 1
persistent = 1
[State 0, StopSnd from intro]
type = StopSnd
trigger1 = prevstateno = [190,192]
channel = 2
persistent = 1

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
ctrl = 0

[Statedef 10]
type    = C
physics = C

[State 40]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State 40]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S

[State 40]
type=changestate
trigger1=1
value=ifelse(command="holdfwd"||command="holdback",20,0)
ctrl=1

;---------------------------------------------------------------------------
;Walk

[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
triggerall = Var(59) <= 0
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
triggerall = Var(59) <= 0
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 1]
type = VelSet
Triggerall = var(59)>0
trigger1 = random<var(50) * 95
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
Triggerall = var(59)>0
trigger1 = random<var(50) * 5
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;-----------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40]
Type=Changestate
Triggerall=time=0
Triggerall=var(59)>0
trigger1 = command = "holdup"
value=0
ctrl=1

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger1 = var(59)=0
trigger2 = var(59)>0
trigger2 = random<var(50) * 100
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
trigger1 = var(59)=0
trigger2 = var(59)>0
trigger2 = random<var(50) * 0
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A
anim = 51

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 0, Turn]
type = Turn
trigger1 = p2dist x <= 0

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

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

[State 52, 4]
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
x = 0

[State -1, Punch]
type = ChangeState
value = 200
triggerall = Var(59) <= 0
trigger1 = command = "a" 
trigger1 = command != "holddown"


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

;No Jump code shamelessly stolen from Borghi's Final

;[Statedef 40];Totally stolen from Borghi's Final
;type    = S
;physics = S
;ctrl = 0
;sprpriority = 1

;[State 40]
;type=changestate
;trigger1=1
;value=ifelse(command="holdfwd"||command="holdback",20,0)
;ctrl=1

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

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181+(random%3)

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

[State 181]
type = assertspecial
trigger1 = time < 430
flag = roundnotover
flag2 = nomusic

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

[State 181, 1]
type = PlaySnd
trigger1= time = 1
value = 2, 0
channel=1
abspan = 1

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

[State 182]
type = assertspecial
trigger1 = time < 960
flag = roundnotover
flag2 = nomusic

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

[State 182, 1]
type = PlaySnd
trigger1= time = 1
value = 3, 0
channel=1
abspan = 1
[State 182, 1]
type = PlaySnd
trigger1= time = 1
value = 3, 0
channel=2
abspan = 1

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

[State 181]
type = assertspecial
trigger1 = time < 360
flag = roundnotover

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

[State 181, 1]
type = PlaySnd
trigger1= time = 1
value = 183, 0
channel=1
[State 181, 1]
type = PlaySnd
trigger1= time = 1
value = 183, 0
channel=2


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

[State 191, SB]
type = screenbound
trigger1 = 1
value = 0

[State 191, PS]
type = posadd
trigger1 = time = 0
x = -181

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

[State 10191, VS]
type = velset
trigger1 = 1
x = ifelse(time<=180,1,0)


[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time > 180
value = 192

[state 191, 4]
type = PlaySnd
trigger1= time = 1
value = 4, 0
abspan = 1
channel=1
[state 191, 4]
type = PlaySnd
trigger1= time = 1
value = 4, 0
channel=2
abspan = 1

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

[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 = time > 4
value = 0

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900]
type = PowerAdd
trigger1 = time = 0
value = 500+random%1500

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 1,1
dest = 1,palno

[State 5900, 4] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190

[State 5900, 5] ;All other rounds
type = ChangeState
trigger1 = 1
value = 0

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

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

[State 201, 1]
type = HitDef
trigger1 = Time = 0
attr = S,SA
animtype  = Hard
damage    = 90, 0
priority  = 4
hitflag = MAF  
guardflag = MA
pausetime = 0,0
sparkxy = -10,-60
hitsound   = s0,4
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = var(1),-11
guard.velocity = -4
air.velocity = var(1),-11
airguard.velocity = -5, -4
fall = 1
p2stateno = 2025    ;Make p2 go to state 1025 on hit
p2facing = 1        ;Force to face p1
getpower = 150,0

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


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

[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 50                   ;Power to add (Def: 0)
sprpriority = 2  

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S0,5
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S,NA                     ;Attribute: Standing, Normal Attack
damage = 45, 2                  ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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 = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-50              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 17            ;Time that the opponent slides back
ground.hittime  = 17             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -2.9,0    ;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 = -2.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 17  
ground.cornerpush.veloff = -10
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = -15
airguard.cornerpush.veloff = 0


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

[Statedef 205]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = A                      ;Physics: S-stand, C-crouch, A-air
juggle = 0                  ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 50                   ;Power to add (Def: 0)
sprpriority = 2  

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S0,5
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S,NA                     ;Attribute: Standing, Normal Attack
damage = 55, 2                  ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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 = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-50              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 17            ;Time that the opponent slides back
ground.hittime  = 17             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.5,-5  ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = Trip                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.5,-5        ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 17  
airguard.velocity = 0,0
airguard.velocity = 0,0

[State 0, PosSet]
type = VelSet
triggerall = movehit
trigger1 = enemynear, backedgedist < 5
x = -3
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 51
ctrl = 1
    
[Statedef 210]
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 = 3,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 210                       ;Change animation (Def: no change)
poweradd = 60                   ;Power to add (Def: 0)
sprpriority = 2  

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S0,6
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 210, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 40, 2                  ;Damage that move inflicts, guard damage
animtype = Medium               ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;Flags on how move is to be guarded against
hitflag = MA                   ;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 = 0,0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-65            ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 17            ;Time that the opponent slides back
ground.hittime  = 17             ;Time opponent is in hit state
ground.velocity = -2,-7           ;Velocity at which opponent is pushed
airguard.velocity = -2.9,0    ;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 = -2,-7           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 17
Fall = 1
fall.recover = 0

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

[Statedef 215]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = A                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 210                       ;Change animation (Def: no change)
poweradd = 50                   ;Power to add (Def: 0)
sprpriority = 2  

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S0,5
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S,NA                     ;Attribute: Standing, Normal Attack
damage = 60, 2                  ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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 = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-50              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 20           ;Time that the opponent slides back
ground.hittime  = 20            ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1,-6  ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = Trip                 ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1,-6       ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 20  
airguard.velocity = 0,0

[State 0, PosSet]
type = VelSet
triggerall = movehit
trigger1 = enemynear, backedgedist < 5
x = -3
y = 0

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


[Statedef 225]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = A                     ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 225                       ;Change animation (Def: no change)                 ;Power to add (Def: 0)
sprpriority = 2  

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
y = -16

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 5
y = -7

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
x = 0
y = 0.1

[State 200, 1]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 4
attr = S,NA                     ;Attribute: Standing, Normal Attack
damage = 35, 2                  ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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 = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-50              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 12         ;Time that the opponent slides back
ground.hittime  = 12           ;Time opponent is in hit state
ground.velocity = -0.2             ;Velocity at which opponent is pushed
airguard.velocity = -1,-1.2 ;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 = -3,-1.2     ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 17

[Statedef 226]
type    = S
physics = S
ctrl = 0
anim = 48

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

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

[State 52, 4]
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
x = 0

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

;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 220]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2

[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileNormal" 
ID = 300 
stateno = 300
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3


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

[Statedef 221]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2


[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileSlow" 
ID = 301
stateno = 301
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

[Statedef 222]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2


[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileMeter" 
ID = 302
stateno = 302
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

[Statedef 223]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2

[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileLob" 
ID = 303
stateno = 303
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

[Statedef 224]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2

[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileUnrbeakable" 
ID = 304
stateno = 304
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

[Statedef 227]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2

[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileAir" 
ID = 305
stateno = 305
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileAir" 
ID = 306
stateno = 306
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

[Statedef 228]
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 = 220                       ;Change animation (Def: no change)
poweradd = 80                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 220, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;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,-50               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 13             ;Time that the opponent slides back
ground.hittime  = 16             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

[State 200, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1

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

[State 300, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0,2

[State 0, Helper]
type = Helper
trigger1 = Animelem = 3
helpertype = normal ;player
name = "ProjectileRandom" 
ID = 307
stateno = 307
pos = 30, 28
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

[Statedef 300]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 90,8
pausetime = 0,14
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -5
air.velocity = -2.2,-3.2
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 50,20

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -100
trigger4 = BackEdgeDist <= -100
value = 310
ctrl = 0

[Statedef 301]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                     ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,100,200
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 70,8
pausetime = 0,14
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -5
air.velocity = -2.2,-3.2
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 50,20

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -100
trigger4 = BackEdgeDist <= -100
value = 310
ctrl = 0

[Statedef 302]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                     ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 40,150,0
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 25,2
pausetime = 0,11
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -5
air.velocity = -2.2,-3.2
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 250,0
givepower = 0,150

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -100
trigger4 = BackEdgeDist <= -100
value = 310
ctrl = 0


[Statedef 303]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

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

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = 0.2

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 256,120,0
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 95,8
pausetime = 0,14
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -1
air.velocity = -1.2,0
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 50,20

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -300
trigger4 = BackEdgeDist <= -300
value = 310
ctrl = 0

[Statedef 304]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 80,80,80
mul = 100,100,100
invertall = 0
color = 256

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 55,0
pausetime = 0,0
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 15,-75
hitsound   = s1,0
guardsound = 6,0
ground.type = High
ground.slidetime = 0
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -0.5
air.velocity = -0.5,0
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 20,0

[State 0, ChangeState]
type = ChangeState
trigger1 = FrontEdgeDist <= -100
trigger2 = BackEdgeDist <= -100
value = 310
ctrl = 0

[Statedef 305]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 3
y = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1


[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 256,40,100
mul = 100,100,100
invertall = 0
color = 256

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 45,0
pausetime = 0,0
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -5
air.velocity = -2.2,-3.2
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 70,20

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -100
trigger4 = BackEdgeDist <= -100
value = 310
ctrl = 0

[Statedef 306]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 1.5
y = -3

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1


[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 256,40,100
mul = 100,100,100
invertall = 0
color = 256

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 45,0
pausetime = 0,0
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.hittime = 12
ground.velocity = -5
air.velocity = -2.2,-3.2
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 70,20

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -100
trigger4 = BackEdgeDist <= -100
value = 310
ctrl = 0

[Statedef 307]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                    ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 5

[State 0, VelAdd]
type = VelAdd
triggerall = random  <= 700
trigger1 = 1 
x = 2
y = 0 

[State 0, VelAdd]
type = VelAdd
triggerall = random  <= 700
trigger1 = 1
x = 0 
y = 0.5

[State 0, VelAdd]
type = VelAdd
triggerall = random  <= 700
trigger1 = 1 
x = -2
y = 0

[State 0, VelAdd]
type = VelAdd
triggerall = random <= 700
trigger1 = 1
x = 0
y = -0.5

[State -2, Rainbow]
type = PalFX
trigger1 = 1
time = 1
add = Floor(sin(GameTime/2)*128),Floor(sin((GameTime-85)/2)*128),Floor(sin((GameTime-170)/2)*128)
ignorehitpause = 1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AA,AP
time = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage   = 10+random%90,8
pausetime = 0,0
animtype = Hard
hitflag = MAF
guardflag = MA
sparkno = 1
;guard.sparkno = S507
sparkxy = 0,-75
hitsound   = s1,0
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 1+random&20
ground.hittime  = 1+random&20
guard.hittime = 1+random&20
ground.velocity = var(2),0
air.velocity =  var(2),-3
air.fall = 1
fall.recover = 0
air.juggle = 10
getpower = 10+random&100,20

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit
trigger2 = moveguarded
trigger3 = FrontEdgeDist <= -300
trigger4 = BackEdgeDist <= -300
trigger5 = time = 300
value = 310
ctrl = 0


[Statedef 310]
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  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 300                       ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 1

[Statedef 311]
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  = 0                     ;Number of air juggle points move takes
;Commonly-used controllers:
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 9999                      ;Change animation (Def: no change)
poweradd = 0                   ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 25

[Statedef 400]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                     ;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 = 400                       ;Change animation (Def: no change)                 ;Power to add (Def: 0)
sprpriority = 2  

[State 0, PalFX]
type = PalFX
trigger1 = time = [5,25]
time = 1
add = 0,0,0
mul = 50,50,256
invertall = 0
color = 256

[State 955, ReversalDef]
type = ReversalDef
trigger1 = time = [5,25]
reversal.attr = SCA,AA,AP
pausetime = 0,0
sparkno = 1
sparkxy = 30, 0
hitsound = 5,2
p1stateno = 401

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

[Statedef 401]
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 = 401                       ;Change animation (Def: no change)                 ;Power to add (Def: 0)
sprpriority = 2  

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S400,0
volume = 80
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S400,0
volume = 80
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 402
ID = 402
pos = 50,-53
postype = p1  ;p2,front,back,left,right
facing = facing
vfacing = 1
bindtime = 25
removetime = -2
pausemovetime = 0
scale = 0.5,0.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 0, Helper]
type = Helper
trigger1 = Time = 0
helpertype = normal ;player
name = "CounterProjectile" 
ID = 403
stateno = 403
pos = -20,0
postype = p1    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 1
size.yscale = 1

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



[Statedef 403]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                     ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0                     ;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 = 403                      ;Change animation (Def: no change)                 ;Power to add (Def: 0)

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 310
time = 1
forceair = 0

[State 0, HitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage   = 80,8
pausetime = 0,60
animtype = Hard
hitflag = MAFD
guardflag = 
sparkno = -1
;guard.sparkno = S507
sparkxy = 0,0
hitsound   = -1
guardsound = 6,0
pausetime = 0,8
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
guard.hittime = 15
ground.velocity = -1
air.velocity = -5,-5
air.fall = 0
fall.recover = 0
air.juggle = 10
getpower = 300,0
givepower = 0

[State 998, Explod]
type = Explod
triggerall = numenemy>0
triggerall = enemy,alive
trigger1 = movehit = 1
anim = F3
pos = enemy,screenpos X, enemy,screenpos Y + enemy,const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 0, ChangeState]
type = ChangeState
trigger1 = FrontEdgeDist <= -300
trigger2 = BackEdgeDist <= -300
value = 310
ctrl = 0


;---------------------------------------------------------------------
; Power up (start)
[Statedef 500]
type = S
movetype = I
physics = S
anim = 500
poweradd = 0
velset = 0
ctrl = 0

[State 500, 2]
type = ChangeState
trigger1 = time = 5
value = 501

; Power up
[Statedef 501]
type = S
movetype = I
physics = S
anim = 500

[State 501, 3]
type = PowerAdd
trigger1 = 1
value = 12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S500,0
volume = 100
channel = 0
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 501, 2]
type = ChangeState
trigger1 = Var(59) <= 0
trigger1 = command != "/z"
trigger2 = power >= 10000
Trigger3 = var(59)>0
trigger3 = p2movetype = A
Trigger4 = var(59)>0
trigger4 = p2stateno = [10,105]
trigger5 = var(59)>0
trigger5 = random<var(50) * 0.2
trigger6 = var(59)>0
trigger6 = p2movetype!= H
trigger6 = random<var(50) * 5
trigger6 = p2bodydist x > 80
trigger7 = random<var(50) * 0.2
trigger7 = p2stateno= [5100,5120]
trigger7 = random<var(50) * 15
value = 502

[Statedef 502]
type = S
movetype = I
physics = S
anim = 500

[State 7240, End]
type = stopsnd
trigger1 = stateno != 501
channel = 0


[State 740, 2]
type = ChangeState
trigger1 = time = 10
value = 0
ctrl = 1



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

;Galactica PHANTOM

[Statedef 201]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle = 5                  ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 201                       ;Change animation (Def: no change)
poweradd = -1000                  ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 1
channel=1
volume = 100

[State 201, SuperPause]
type = SuperPause
trigger1 = AnimElem = 1
pos = 25, -57
anim = -1
darken = 0
;sound = s7, 0

[State 201, Blink Orange]
type = PalFX
trigger1 = AnimElem = 1
time = 1
add = 248,144,0
sinadd = 64,32,5,3

[state 201]
type = VelSet
trigger1 = AnimElem = 3
x = 35

[State 201, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, SA
animtype  = Hard
damage    = 250, 5
getpower  = 0
priority  = 4
guardflag = 
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
getpower = 0,0

[State 201, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=1
volume = 100
[State 201, 1]
type = PlaySnd
trigger1= animelem=3
value = 0, 0
channel=2
volume = 100


[State 201, 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 = 3
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 = 30 - 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 = 2

[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

----------------------------------------------------------------------------

; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 2025]
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 = 2026

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

[State 1026, Velocity]
type = HitVelSet
trigger1 = Time = 0
x = 3
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 = 2027

[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 2027]
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 = 2028

;------------------
; Hit by Fast Kung Fu Palm - bounce off wall
; (a custom gethit state)
[Statedef 2028]
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 = -8

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

[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
;--------------------------------------------------------------------------

;Super "kick"

[Statedef 1050]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 0
channel=1
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 0
channel=4
volume = 100


[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 2
channel =2
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 2
channel = 3
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 2
channel =4
volume = 100

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 5, 3
channel=2
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 5, 3
channel=3
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 5, 3
channel=4
volume = 100

[State 201, SuperPause]
type = SuperPause
trigger1 = AnimElem = 1
time = 50
pos = 25, -57
anim = -1
darken = 0
;sound = s7, 0

[State 201, Blink Orange]
type = PalFX
trigger1 = AnimElem = 1
time = 1
add = 248,144,0
sinadd = 64,32,5,3

[State 1050, 2]
type = VelAdd
trigger1 = AnimElem = 2
y = -27

[State 1050, NotHitBy]
type = NotHitBy
trigger1 = animelem = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 6

[State 1050, 4]
type = HitDef
trigger1 = Time = 0
attr = S, HA
animtype  = Up               ;Make p2 use "Up" type animation on hit
damage    = 320, 12
getpower  = 0
priority  = 5
hitflag = MAF
guardflag = M
pausetime = 30,30
sparkno = 3
sparkxy = -15,-55
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -1.3,-25
guard.velocity = -11
air.velocity = -1.3,-25
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
getpower = 0,0

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

[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -2000
velset = 0,0
anim = 9999
ctrl = 0
sprpriority = 2

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 0
channel=1
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100,0
channel=2
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100, 1
channel =3
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 0
channel=4
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100,0
channel=5
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100, 1
channel =6
volume = 100

[State 0, Explod]
type = Explod
trigger1 = time = 0 
anim = 1100
ID = 1100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 50
pausemovetime = 9999
supermovetime = 9999
scale = 2,2
sprpriority = 2
ontop = 0
ownpal = 0
removeongethit = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 201, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 50
pos = 25, -57
anim = -1
darken = 0
;sound = s7, 0

[State 201, Blink Blue]
type = PalFX
trigger1 = time = 0
time = 1
add = 0,0,255
sinadd = 0,0,0,0

[State 1050, 5]
type = ChangeState
trigger1 = time = 1
value = 1101
Ctrl = 1

[Statedef 1101]
type    = S
movetype= A
physics = S
juggle  = 4
anim = 1101
ctrl = 0
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 17
y = 0

[State 200, 1]
type = HitDef
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 4
attr = S,NA                     ;Attribute: Standing, Normal Attack
damage = 22,2                  ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                  ;Flags on how move is to be guarded against
hitflag = MAFD                   ;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 = 0,0              ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-50              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 15       ;Time that the opponent slides back
ground.hittime  = 15          ;Time opponent is in hit state
ground.velocity = -16.3,-0.3         ;Velocity at which opponent is pushed
airguard.velocity = -1,0 ;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 = -16.3,-0.3      ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 16
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
getpower = 0,0

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 80
value = 1102
ctrl = 0

[Statedef 1102]
type    = S
movetype= A
physics = S
juggle  = 4
anim = 1102
velset = 8,0
ctrl = 0
sprpriority = 2

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

[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -2000
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 0
channel=1
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 0
channel=2
volume = 100

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1000, 0
channel =2
volume = 100
[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 5, 2
channel = 3
volume = 100


[State 201, SuperPause]
type = SuperPause
trigger1 = AnimElem = 1
time = 50
pos = 25, -57
anim = -1
darken = 0
;sound = s7, 0

[State 201, Blink Purple]
type = PalFX
trigger1 = time = 0
time = 1
add = 150,0,255
sinadd = 64,32,5,3


[State 201, BG]
type = BGPalFX
trigger1 = AnimElem = 2
time = 75
add = 150,0,250
sinadd = 0,0,0,0

[State 1050, 4]
type = HitDef
trigger1 = gametime%5 = 0
attr = S, HA
animtype  = Medium               ;Make p2 use "Up" type animation on hit
damage    = 32,0
getpower  = 0
priority  = 5
hitflag = MAF
guardflag = MA
pausetime = 0,0
guard.sparkno = -1
sparkno = -1
sparkxy = 0,0
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -3,0
guard.velocity = -1
air.velocity = -3,-3
airguard.velocity = -3,-2
p2facing = 1                 ;Force p2 to face p1 on hit
fall = 0
fall.recover = 0             ;Prevent p2 from recovering
;fall.damage = 70             ;p2 will take 70 damage on hitting the ground
getpower = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0

[State 998, Explod]
type = Explod
triggerall = numenemy>0
triggerall = enemy(0),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(0),screenpos X, enemy(0),screenpos Y + enemy(0),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>1
triggerall = enemy(1),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(1),screenpos X, enemy(1),screenpos Y + enemy(1),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>2
triggerall = enemy(2),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(2),screenpos X, enemy(2),screenpos Y + enemy(2),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>3
triggerall = enemy(3),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(3),screenpos X, enemy(3),screenpos Y + enemy(3),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>4
triggerall = enemy(4),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(4),screenpos X, enemy(4),screenpos Y + enemy(4),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>0
triggerall = enemy(0),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(0),screenpos X, enemy(0),screenpos Y + enemy(0),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>1
triggerall = enemy(1),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(1),screenpos X, enemy(1),screenpos Y + enemy(1),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>2
triggerall = enemy(2),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(2),screenpos X, enemy(2),screenpos Y + enemy(2),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>3
triggerall = enemy(3),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(3),screenpos X, enemy(3),screenpos Y + enemy(3),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>4
triggerall = enemy(4),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(4),screenpos X, enemy(4),screenpos Y + enemy(4),const(size.mid.pos.y)
postype = left
sprpriority = 5


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

[Statedef 2000]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -3000
velset = 0,0
anim = 2000
ctrl = 0
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 1.5
y = 0

[State 201, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 0
channel=1
volume = 100

[State 201, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2000, 0
channel = 0
volume = 100
loop = 1

[State 201, SuperPause]
type = SuperPause
trigger1 = AnimElem = 1
time = 50
pos = 25, -57
anim = -1
darken = 0


[State 201, Blink Red]
type = PalFX
trigger1 = time = 0
time = 1
add = 255,0,0
sinadd = 0,0,0,0

[State 1050, 4]
type = HitDef
trigger1 = animelem = 2
attr = S, HA
animtype  = Medium               ;Make p2 use "Up" type animation on hit
damage    = 17,2
getpower  = 0,0
priority  = 5
hitflag = MAF
guardflag = MA
pausetime = 0,10
guard.sparkno = 40
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -20,-50               ;X-offset for the "hit spark" rel. to p2,
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 26
ground.hittime  = 28
ground.velocity = -1,0
guard.velocity = -0.
air.velocity = -1,-0.2
airguard.velocity = -3,-2
p2facing = 1                 ;Force p2 to face p1 on hit
fall = 0
fall.recover = 0             ;Prevent p2 from recovering
;fall.damage = 70             ;p2 will take 70 damage on hitting the ground
getpower = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0

[State 1050, 5]
type = ChangeState
trigger1 = Time = 220
value = 2001
Ctrl = 0

[Statedef 2001]
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 = 3,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 2001                    ;Change animation (Def: no change)
sprpriority = 2  

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S0,6
volume = 100
channel = 2
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S2000,1
volume = 100
channel = 0
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 210, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 70, 2                  ;Damage that move inflicts, guard damage
animtype = Medium               ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;Flags on how move is to be guarded against
hitflag = MA                   ;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 = 0,0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10,-65            ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 17            ;Time that the opponent slides back
ground.hittime  = 17             ;Time opponent is in hit state
ground.velocity = -5,-9           ;Velocity at which opponent is pushed
airguard.velocity =-2.9,0    ;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 = -5,-9          ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 17
Fall = 1
fall.recover = 35
getpower = 0,0

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

[Statedef 2100]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -3000
velset = 0,0
anim = 2100
ctrl = 0
sprpriority = 2

[State 201, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 0
channel=1
volume = 100

[State 201, 1]
type = PlaySnd
trigger1 = Time = 0
value = 2100, 0
channel=0
volume = 100


[State 0, Explod]
type = Explod
trigger1 = time = 0 
anim = 0
ID = 2100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,-3
accel = 0,-0.3
random = 0,0
removetime = 50
pausemovetime = 9999
supermovetime = 9999
scale = 2,2
sprpriority = 2
ontop = 0
ownpal = 0
removeongethit = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 201, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 50
pos = 25, -57
anim = -1
darken = 0
;sound = s7, 0

[State 201, Blink T.White]
type = PalFX
trigger1 = time = 0
time = 1
add = 256,256,256
mul = 100,100,100
sinadd = 0,0,0,0

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 1
value = 2101
ctrl = 0

[Statedef 2101]
type    = S
movetype= A
physics = S
juggle  = 0
anim = 2101
ctrl = 0
sprpriority = 2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 0, beeg]
type = Helper
trigger1 = time = 0
name = "Beeg"
ID = 2102
stateno = 2102
pos = -360,0
postype = p1
facing = 1
ownpal = 1
size.xscale = 6
size.yscale = 6
ignoreHitPause = 1 
pausemovetime = 0
supermovetime = 0
sprpriority = 2

[State 0, PosSet]
type = PosSet
trigger1 = Helper(2102), FrontEdgeDist <= -370
trigger2 = Helper(2102), BackEdgeDist <= -370
y = -200

[State 0, ChangeState]
type = ChangeState
trigger1 = Helper(2102), FrontEdgeDist <= -370
trigger2 = Helper(2102), BackEdgeDist <= -370
value = 50
ctrl = 1

[Statedef 2102]
type    = S
movetype= A
physics = S
juggle  = 0
anim = 2101
ctrl = 0
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 3
y = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = 0
flag = invisible

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 200, 1]
type = HitDef
trigger1 = animelem = 1
trigger2 = animelem = 2
attr = S,NA                     ;Attribute: Standing, Normal Attack
damage = 26,10              ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                  ;Flags on how move is to be guarded against
hitflag = MAFD                   ;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 = 0,5              ;Time attacker pauses, time opponent shakes
sparkno = -1       
guard.sparkno = -1              ;Spark anim no (Def: set above)
sparkxy = 0,0            ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s1,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 = 15       ;Time that the opponent slides back
ground.hittime  = 15          ;Time opponent is in hit state
ground.velocity = -0.5,-0.2         ;Velocity at which opponent is pushed
airguard.velocity = -1,0 ;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 = -0.5,-0.2     ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 16
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
getpower = 0,0

[State 998, Explod]
type = Explod
triggerall = numenemy>0
triggerall = enemy(0),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(0),screenpos X, enemy(0),screenpos Y + enemy(0),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>1
triggerall = enemy(1),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(1),screenpos X, enemy(1),screenpos Y + enemy(1),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>2
triggerall = enemy(2),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(2),screenpos X, enemy(2),screenpos Y + enemy(2),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>3
triggerall = enemy(3),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(3),screenpos X, enemy(3),screenpos Y + enemy(3),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>4
triggerall = enemy(4),alive
trigger1 = movehit = 1
anim = F3
pos = enemy(4),screenpos X, enemy(4),screenpos Y + enemy(4),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>0
triggerall = enemy(0),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(0),screenpos X, enemy(0),screenpos Y + enemy(0),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>1
triggerall = enemy(1),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(1),screenpos X, enemy(1),screenpos Y + enemy(1),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>2
triggerall = enemy(2),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(2),screenpos X, enemy(2),screenpos Y + enemy(2),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>3
triggerall = enemy(3),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(3),screenpos X, enemy(3),screenpos Y + enemy(3),const(size.mid.pos.y)
postype = left
sprpriority = 5

[State 998, Explod]
type = Explod
triggerall = numenemy>4
triggerall = enemy(4),alive
trigger1 = moveguarded = 1
anim = F40
pos = enemy(4),screenpos X, enemy(4),screenpos Y + enemy(4),const(size.mid.pos.y)
postype = left
sprpriority = 5

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

[State 0, ChangeState]
type = ChangeState
trigger1 = FrontEdgeDist <= -390
trigger2 = BackEdgeDist <= -390
value = 311
ctrl = 0



;------------------
; 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 = 0,-12
anim = 1051
hitdefpersist = 1 ;Keep the HitDef from previous state active

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

[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
;---------------------------------------------------------------------------
;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

;---------------------------------------------------------------------------
; 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 -2]


[State -2, DD]
type = DisplayToClipboard
trigger1 = 1
text= "Damage Mul=%f"
params = fvar(14)

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = 0,-5

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 2
range = 2,-7
[State -2]
type = AssertSpecial
trigger1 = 1
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard

[State 501, Aura]
type = explod
triggerall = stateno = 501
trigger1 = !numexplod(501)
ID = 501
anim = 501
sprpriority = 3
postype = p1
bindtime = -1
removetime = -1
scale = 0.3, 0.3
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 501, Aura]
type = Modifyexplod
trigger1 = stateno!= 501
ID = 501
anim = 501
sprpriority = 3
postype = p1
bindtime = 1
removetime = 1
scale = 0.000001, 0.000001
pausemovetime = -1
supermovetime = -1
ownpal = 1

[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 = 40
trigger2 = stateno = 225
value = 0, 1

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

[State -3, Attack Scale]
type = AttackMulSet
trigger1 = 1
value = fvar(14)
ignorehitpause = 1

[State -3, Variable Scale]
type = varset
Triggerall = stateno!= 2000
trigger1 = numenemy
trigger1 = movehit = 1
fvar(14) = fvar(14)*(0.9980**(enemynear(0),gethitvar(hitcount)))
ignorehitpause = 1

[State -3, Reset var when the opponent recovers]
type = Varset
trigger1 = numenemy
trigger1 = (enemynear,movetype!=H)
trigger2 = !numenemy
fvar(14) = 1
ignorehitpause = 1

