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

[Data]
;Amount of life to start with
life = 1000
;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 = 20
;Number of points for juggling
airjuggle = 15
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 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 = 1.3           ;Horizontal scaling factor.
yscale = 1.3           ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = 4, -42   ;Approximate position of head
mid.pos = 1, -19    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y). Recommended 0,0

[Velocity]
walk.fwd  = 3.0      ;Walk forward
walk.back = -3.0     ;Walk backward
run.fwd  = 6, 0    ;Run forward (x, y)
run.back = -6, 0 ;Hop backward (x, y)
jump.neu = 0,-11    ;Neutral jumping velocity (x, y)
jump.back = -3    ;Jump back Speed (x, y)
jump.fwd = 3       ;Jump forward Speed (x, y)
runjump.back = -5 ;Running jump speeds (opt)
runjump.fwd = 5      ;.
airjump.neu = 0,-8      ;.
airjump.back = -3      ;Air jump speeds (opt)
airjump.fwd = 3         ;.
air.gethit.groundrecover = -.15,-3.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5      ;Extra y-velocity for holding down during air recovery **MUGEN 1.0**

[Movement]
airjump.num = 0       ;Number of air jumps allowed (opt)
airjump.height = 35   ;Minimum distance from ground before you can air jump (opt)
yaccel = .52          ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching
stand.friction.threshold = 2          ;If player's speed drops below this threshold while standing, stop his movement **MUGEN 1.0**
crouch.friction.threshold = .05       ;If player's speed drops below this threshold while crouching, stop his movement **MUGEN 1.0**
air.gethit.groundlevel = 25           ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -20 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 10   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -1  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = .35    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 15      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 20            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = .4               ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 12          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .05         ;If the player's speed drops below this threshold while lying down, stop his movement **MUGEN 1.0**

;Default language victory quotes (optional).  **MUGEN 1.0**
;If this section is included, the default language victory quotes must be in English.
[Quotes]
; Stock Winquotes
victory0 = "I fight for my friends!"
victory1 = "You have just felt the power of a Wild Cat!"
victory2 = "I defeated a giant praying mantis once, so dealing with you was no problem!"
victory3 = "I just kicked your butt, whether you like it or not!"
victory4 = "You might have stood a chance if you didn't run your face into my fist."
victory5 = "If i can break physics, i can break you too!"
victory6 = "Cram it already! you are sooo annoying!"
victory7 = "Have you met a rapper frog before?"
victory8 = "Face it, buster, you lost. Go home."
victory9 = "That was totally awesome! you were like: Ow Ow! and i was like: POW POW!"
;Special Winquotes
Victory16 = "Will you just give me a minute to explan?" ; VS Spade
Victory17 = "Can't you be miss hero pants some other time? i'm not in the mood right now." ; VS Lilac
Victory18 = "Uh oh, Lilac isn't going to be happy about this..." ; VS Milla
victory19 = "AH YEAH! IN YOUR FACE!, I'll be taking that Kingdom Stone now!" ; Lord Brevon
victory20 = "So, is Brevon trying to clone us now or something?" ; Mirror Matach
victory21 = "Fastest thing alive? i bet Lilac has something to say about that!" ; VS Sonic
victory22 = "What strength!! but don't forget there are many guys like you all over the world" ; VS Ryu
victory23 = "Oh gosh you really let yourself go! do you even know how to pounce?" ; VS Garfield
victory24 = "BUTTHEAD?? HAHAHAHAHA OH MY GOSH I CAN'T STOP LAUGHING!!" ; VS Butt-Head
victory25 = "Noooo i didn't kill your hamster, do i look like a scavenger to you?" ; VS Dee Bee Kaw

;---------------------------------------------------------------------------
; 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(0)  - inf preventer
; var(1)  - inf preventer
; var(2)  - Damage Damnpenr
; var(3)  - inf preventer
; var(4)  - can kicks hit
; var(5)  - bike sound
; var(6)  - walljump
; var(7)  - bike inf preventer
; var(10) - sushi
; var(15) - Bike sound
; var(16) - bike jump
; var(17) - bike life
; var(19) - did i win the round with a lv3 super?
; var(50) - AI randomnes
; var(57) - AI bike boost
; var(58) - AI bike movement
; var(59) - is the AI playing?
; fvar(8) - life holder

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

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

[State 0, 1]
type = ChangeAnim
trigger1 = Anim = 0
trigger1 = !animtime
value = random%3

[State 0, 1]
type = ChangeAnim
triggerall = anim != 3 && anim != 5
trigger1 = enemynear,pos y <= -35
trigger2 = enemynear,const(size.head.pos.y) <= -120
trigger2 = enemynear,anim != [10,12]
trigger2 = enemynear,statetype != L
value = 3

[State 0, 1]
type = ChangeAnim
triggerall = anim = 3
trigger1 = enemynear,pos y > -35
trigger1 = enemynear,const(size.head.pos.y) > -120
trigger2 = enemynear,anim = [10,12]
trigger2 = enemynear,const(size.head.pos.y) <= -120
trigger3 = enemynear,statetype = L
trigger3 = enemynear,const(size.head.pos.y) <= -120
value = 4

[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, StopSnd]
type = StopSnd
trigger1 = time = 0
trigger1 = prevstateno = 4000
channel = 3
ignorehitpause = 1

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

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

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

[State 40, Dust]
type = helper
trigger1 = !animtime
helpertype = normal
stateno = 7100
ID = 7100
name = "Dust"
postype = p1
ownpal = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
trigger2 = var(59)
trigger2 = p2bodydist x = [-10,10]
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = p2bodydist x > 10
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
trigger2 = var(59)
trigger2 = p2bodydist x < -10
sysvar(1) = -1

[State 40, 4]
type = VelSet
triggerall = AnimTime = 0
trigger1 = command = "holdup"
trigger2 = var(59)
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, 4]
type = VelSet
triggerall = AnimTime = 0
trigger1 = command != "holdup"
trigger1 = !var(59)
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)*0.8

[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 Up
[Statedef 50]
type    = A
physics = A

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

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

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

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

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

[State 52, 3]
type = CtrlSet
trigger1 = time = 1
value = 1

[State 52, ChangeAnim to Turning]
type = ChangeAnim
trigger1 = ctrl && P2Dist x < 0
trigger1 = Anim != 5
value = 5

[State 52, Turn]
type = Turn
trigger1 = Anim = 5 && AnimElem = 1

[State 52, 4]
type = VelSet
trigger1 = 1
x = 0

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 9102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

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

;---------------------------------------------------------------
; Run Forward
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State 106, Dust Helper]
type = Helper
trigger1 = time = 0
helperType = Normal
stateNo = 8103
ID = 8100
name = "Dash Dust"
posType = P1
pauseMoveTime = 255
superMoveTime = 255
ownPal = 1

[State 100, 1b]
type = VelSet
trigger1 = time > 3
x = const(velocity.run.fwd.x)

[State 100, 1a]
type = playsnd
trigger1 = time = 0
value = S99,1
volumescale = 125

[State 100, 1a]
type = PlaySnd
trigger1 = AnimElem = 5
trigger2 = AnimElem = 9
value = 99,0
volumescale = 125

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, Jump]
type = changestate
triggerall = time > 4
trigger1 = command = "holdup"
trigger1 = !var(59)
value = 40

[State 100, 4]
type = ChangeState
triggerall = time > 3
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist X <= 24 || p2movetype = A
trigger2 = var(59)
value = 101

;---------------------------------------------------------------------------
; Stop Run
[Statedef 101]
type = S
movetype = I
physics = S
anim = 101
ctrl = 0
sprpriority = 1

[State 106, Dust]
type = explod
trigger1 = anim = 101 && animelem = 2
anim = 9103
ID = 8103
sprpriority = 3
postype = p1
pos = 10, 0
vel = 2, 0
removetime = -2
ownpal = 1
pausemovetime = -1
supermovetime = -1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = time >= 6
value = 1

[State 106, 1]
type = PlaySnd
trigger1 = Time = 0
value = 105,0
volumescale = 125

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


;---------------------------------------------------------------------------
; Run Back
[Statedef 105]
type    = S
physics = S
anim = 105
sprpriority = 1
ctrl = 0

[State 105, Dust Helper]
type = Helper
trigger1 = time = 3
helperType = Normal
stateNo = 8103
ID = 8100
name = "Dash Dust"
posType = P1
facing = -1
pauseMoveTime = 255
superMoveTime = 255
ownPal = 1

[State 100, 1b]
type = VelSet
trigger1 = time > 1 && time < 21
x = const(velocity.run.back.x)

[State 100, 1a]
type = PlaySnd
trigger1 = time = 2
value = 0,3
volumescale = 125

;[State 100, 1a]
;type = PlaySnd
;trigger1 = time = 2
;value = 105,0
;volumescale = 125


[State 0, VelSet]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 0, ChangeState]
type = ChangeState
trigger1 = command = "holddown"
trigger1 = !animtime
value = 11
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = command != "holddown"
trigger1 = !animtime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; clinging to wall
[Statedef 110]
type    = A
movetype = I
physics = N
anim = 110
ctrl = 0
sprpriority = 1
velset = 0,0

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

[State 0, PosSet]
type = PosSet
trigger1 = facing = -1
x = 145

[State 0, PosSet]
type = PosSet
trigger1 = facing = 1
x = -145

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .12

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40,0
volumescale = 125

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 10
trigger1 = command = "holdup" || command = "holdfwd"
value = 111
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52
ctrl = 0

;---------------------------------------------------------------------------
; jumping off wall
[Statedef 111]
type    = A
movetype = I
physics = N
anim = 111
ctrl = 0
sprpriority = 1
velset = 0,0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = time < 4 
value = 0
ignorehitpause = 1

[State 0, PosSet]
type = PosSet
trigger1 = time < 4
trigger1 = facing = -1
x = 145

[State 0, PosSet]
type = PosSet
trigger1 = time < 4
trigger1 = facing = 1
x = -145


[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = command = "holdfwd"
var(6) = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = command = "holdup"
var(6) = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 4
value = 40,0
volumescale = 125

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 4
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = A         ;A,C,S,N
ignorehitpause = 1

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 4
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

[State 0, CtrlSet]
type = CtrlSet
trigger1 = time = 6
value = 1
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
triggerall = time = 0
trigger1 = !var(6) 
x = 6
y = -6
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
triggerall = time = 0
trigger1 = var(6)
x = 4
y = -8
ignorehitpause = 1

;---------------------------------------------------------------------------
; clinging to wall
[Statedef 115]
type    = A
movetype = I
physics = N
anim = 115
ctrl = 0
sprpriority = 1
velset = 0,0

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

[State 0, PosSet]
type = PosSet
trigger1 = facing = -1
x = -145

[State 0, PosSet]
type = PosSet
trigger1 = facing = 1
x = 145

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .12

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40,0
volumescale = 125

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 10
trigger1 = command = "holdup" || command = "holdback"
value = 116
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52
ctrl = 0

;---------------------------------------------------------------------------
; jumping off wall
[Statedef 116]
type    = A
movetype = I
physics = N
anim = 116
ctrl = 0
sprpriority = 1
velset = 0,0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = time < 4 
value = 0
ignorehitpause = 1

[State 0, PosSet]
type = PosSet
trigger1 = time < 4
trigger1 = facing = -1
x = -145

[State 0, PosSet]
type = PosSet
trigger1 = time < 4
trigger1 = facing = 1
x = 145

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = command = "holdfwd"
var(6) = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = command = "holdup"
var(6) = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 4
value = 40,0
volumescale = 125

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 4
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = A         ;A,C,S,N
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
triggerall = time = 0
trigger1 = !var(6) 
x = -6
y = -6
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
triggerall = time = 0
trigger1 = var(6)
x = -4
y = -8
ignorehitpause = 1

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 4
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

[State 0, CtrlSet]
type = CtrlSet
trigger1 = time = 6
value = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 120 + (statetype = C) + (statetype = A)*2

[State 120, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger1 = !AILevel
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; Stand guard (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
value = 130

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
trigger1 = !AILevel
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; Crouch guard (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != 131
value = 131

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
trigger1 = !AILevel
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
value = 130

[State 131, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; Air guard (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != 132
value = 132

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback" || (var(59)>0)
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140


;---------------------------------------------------------------------------
; Stand guard hit (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(StateType=C)

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; Stand guard hit (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

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

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger1 = !AILevel
value = 1

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = !AILevel

;---------------------------------------------------------------------------
; Crouch guard hit (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(StateType=C)

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; Crouch guard hit (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151

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

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger1 = !AILevel
value = 1

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = !AILevel

;---------------------------------------------------------------------------
; Air guard hit (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; Air guard hit (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

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

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger1 = !AILevel
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback" || var(59)>0
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

;---------------------------------------------------------------------------
; guard counter
[Statedef 160]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -1000
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 0, NotHitBy]
type = NotHitBy
trigger1 = time <= 17
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
ignorehitpause = 1 

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

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(160)
trigger1 = target(160),time = 0
var(2) = 6
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 4
value = 0, 6
Volumescale = 125
channel = 0

[State 200, 2]
type = PlaySnd
trigger1 = random <= 500
trigger1 = Time = 0
value = 120, 0
Volumescale = 200

[State 0, Explod]
type = Explod
trigger1 = time = 6
anim = 1010
ID = 1010
pos = 30,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1.5,1.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, SA
damage = 106,6
getpower = 0,0
givepower = 32,16
animtype = Hard
guardflag = 
hitflag = MAF
priority = 7, Hit
pausetime = 0, 0
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-55
hitsound = S1, 3
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-12
air.type = Low
air.velocity = -5,-12
air.hittime = 25
fall = 1
fall.recover = 0
yaccel = .8
ID = 160
envshake.time = 10
envshake.freq = 100
envshake.ampl = -4

[State 0, VarSet]
type = VarSet
trigger1 = movehit
trigger1 = numtarget(160)
trigger1 = target(160),time = 0
var(0) = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = movehit
trigger1 = numtarget(160)
trigger1 = target(160),time = 0
var(4) = 1
ignorehitpause = 1

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(5)>=0
movetype= I

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


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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S170,0+random%2
volumescale = 200
channel = 0

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

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

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = time = 0
value = 0+random%10

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Spade" ;futureproofing
trigger2 = enemy,name = "Sean and Chiplock" ;aka: Beta Spade (v1.3-v1.4.0) ?K A N O S A I B O T?, also futureproofing
value = 16

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Sash Lilac"
trigger2 = enemy,name = "FP2 Sash Lilac"
trigger3 = enemy,name  = "Black Lilac" ;FRICKIN DBZ FUSIONS COUNT
value = 17

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Milla Basset"
trigger2 = enemy,name = "FP2 Milla Basset"
value = 18

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Lord Brevon"
trigger2 = enemy,name = "Mr. Braven"
value = 19

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Carol Tea"
trigger2 = enemy,name = "FP2 Carol Tea"
trigger3 = enemy,name  = "Silver Carol" ;FRICKIN DBZ FUSIONS COUNT
value = 20

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name  = "Sonic The Hedgehog"
trigger2  = enemy,name  = "Super Sonic"
trigger3  = enemy,name  = "Sonic"
trigger4  = enemy,name  = "Neo-Sonic"
trigger5  = enemy,name  = "Time Flux Sonic"
trigger6  = enemy,name  = "Classic Sonic"
trigger7  = enemy,name  = "Sonic V2"
trigger8  = enemy,name  = "Sonic The Hedgehog V2"
trigger9  = enemy,name  = "That Darn Hedgehog"
trigger10 = enemy,name  = "Classic Sonic The Hedgehog"
trigger11 = enemy,name  = "Blue Hedgehog"
trigger12 = enemy,name  = "16 bit Sonic"
trigger13 = enemy,name  = "Sonic Master System (De GEJ)"
trigger14 = enemy,name  = "Sonic Mania"
trigger15 = enemy,name  = "Sonic.EXE"
trigger16 = enemy,name  = "Sonic TFTA"
trigger17 = enemy,name  = "Sanic"
value = 21

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Ryu"
trigger2 = enemy,name = "Ryu Hoshi"
trigger3 = enemy,name = "Ryu_Hoshi"
trigger4 = enemy, name = "cvsryu"
trigger5 = enemy, name = "svcryu"
trigger6 = enemy, name = "Bootleg Rytwo"
trigger7 = enemy, name = "Bootleg Ryu"
trigger8 = enemy, name = "Ryu_Veanko"
value = 22

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Garfield"
trigger2 = enemy,name = "Geno Garfield"
value = 23

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Butt-Head"
trigger2 = enemy,name = "ButtHead"
trigger3 = enemy,name = "Butt_Head"
trigger4 = enemy,name = "Butt Head"
value = 24

[State 0, VictoryQuote]
type = VictoryQuote
trigger1 = enemy,name = "Most_Mysterious"
trigger2 = enemy,name = "Most_Mesterums"
value = 25

[State 180, 1]
type = ChangeState
triggerall = numhelper(1933)
triggerall = Cond(Numhelper(1933),abs(Rootdist X-Helper(1933),Rootdist X)<20,0)
trigger1 = Time = 0
value = 185
ctrl = 0

[State 180, 1]
type = ChangeState
triggerall = !matchover
trigger1 = Time = 0
value = 181+random%3
ctrl = 0

[State 180, 1]
type = ChangeState
trigger1 = matchover
trigger1 = Time = 0
value = 184
ctrl = 0

;---------------------------------------------------------------------------
; strike a pose
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
velset = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 181+random%2

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 180
flag = roundnotover
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
trigger1 = anim = 182
value = S180,2+random%3
volumescale = 150
channel = 0

;---------------------------------------------------------------------------
; Dance
; CNS difficulty: basic
[Statedef 182]
type = S
ctrl = 0
velset = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 196
value = 196

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 400
flag = roundnotover
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S182,0+random%3
volumescale = 200

;---------------------------------------------------------------------------
; in your face!
; CNS difficulty: basic
[Statedef 183]
type = S
ctrl = 0
velset = 0,0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 183

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 240
flag = roundnotover
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S180,5
volumescale = 150
channel = 0

;---------------------------------------------------------------------------
; feel my power!
; CNS difficulty: basic
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0

[State 0, ChangeState]
type = ChangeState
triggerall = time = 0
trigger1 = var(19)
trigger2 = life >= lifemax
value = 186

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 350
flag = roundnotover
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S180,0+random%2
volumescale = 150
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S181,0
volumescale = 150

;---------------------------------------------------------------------------
; go to bed
; CNS difficulty: basic
[Statedef 185]
type = S
ctrl = 0
velset = 0,0
sprpriority = -4

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 197
value = 197

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 300
flag = roundnotover
ignorehitpause = 1

;---------------------------------------------------------------------------
; feel my power?
; CNS difficulty: basic
[Statedef 186]
type = S
ctrl = 0
anim = 184
velset = 0,0

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 1900
flag = roundnotover
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S180,0+random%2
volumescale = 150
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S181,0
volumescale = 150
channel = 1

[State 0, Helper]
type = Helper
trigger1 = time = 80
name = "brevon"
ID = 187
stateno = 187
pos = 0,-250
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State 0, SprPriority]
type = SprPriority
trigger1 = time = 93
value = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 93
value = S11,0
channel = 0

[State 0, PlaySnd]
type = StopSnd
trigger1 = time = 93
channel = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 93 
value = 5080

[State 0, LifeSet]
type = LifeSet
trigger1 = time = 93
value = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 93
statetype = L       ;S,A,C,L
movetype = H        ;I,A,H
physics = N         ;A,C,S,N

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 153
statetype = L       ;S,A,C,L
movetype = I        ;I,A,H
physics = N         ;A,C,S,N

;---------------------------------------------------------------------------
; brevon falling
; CNS difficulty: basic
[Statedef 187]
type = A
physics = N
ctrl = 0
anim = 186
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 0
y = 20
ignorehitpause = 1

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 188
ctrl = 0

;---------------------------------------------------------------------------
; brevon land
; CNS difficulty: basic
[Statedef 188]
type = A
physics = N
ctrl = 0
anim = 187
velset = 0,0
sprpriority = 2

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

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9,0+random%2
volumescale = 350
channel = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 1,3
channel = -1

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

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 30
freq = 90
ampl = -12

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 187
trigger1 = animelemtime(7)=0
value = S183,0
volumescale = 350
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 444
value = S183,2
volumescale = 150
channel = 3

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 444
time = 20
freq = 60
ampl = -4

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 187
trigger1 = animelemtime(36)=0
value = S183,1
volumescale = 350
channel = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1540
value = 188

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1629
value = 189

;---------------------------------------------------------------------------
; Intro decider
; CNS difficulty: basic
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

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

[State 0, ChangeState]
type = ChangeState
trigger1 = p2name = "Sash Lilac"
trigger2 = p4name = "Sash Lilac"
value = 198
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = p2name = "Joseph Lieberman"
trigger1 = p2stateno = 194
value = 194
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = p2name = "Carol Tea"
trigger2 = p4name = "Carol Tea"
value = 1949+Teamside
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 1
value = 191+random%3
ctrl = 0

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

[State 0, ChangeState]
type = ChangeState
triggerall = time = 0
trigger1 = prevstateno != 1910
trigger1 = enemy,pos y <= -35
trigger1 = enemy,stateno != 0
value = 1910
ctrl = 0

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 30
value = S190,0
volumescale = 200
channel = 0

[State 191, 3] 
type = ChangeState
trigger1 = !animtime
value = 0

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

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

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 1911
trigger1 = enemy,pos y >= -15
trigger2 = enemy,stateno = 0
trigger3 = time >= 1200
value = 1911

[State 0, ChangeState]
type = ChangeState
triggerall = anim = 1911
trigger1 = !animtime
value = 191
ctrl = 0


;---------------------------------------------------------------------------
; bikeing in
; CNS difficulty: basic
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0

[State 0, PosSet]
type = VelSet
trigger1 = teamside = 1
trigger1 = time = 0
x = -750
y = 0

[State 0, PosSet]
type = VelSet
trigger1 = teamside = 2
trigger1 = time = 0
x = -750
y = 0

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

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

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

[State 0, VarAdd]
type = VarAdd
trigger1 = 1
var(5) = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = S190,1
volumescale = 0+var(5)
channel = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 76
value = 1920
ctrl = 0

;---------------------------------------------------------------------------
; jumping off bike
; CNS difficulty: basic
[Statedef 1920]
type = S
physics = N
ctrl = 0
anim = 1920
velset = 0,0

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

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "bike"
ID = 1921
stateno = 1921
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40,0
volumescale = 125

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

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .42

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1922
ctrl = 0

;---------------------------------------------------------------------------
; the bike flying off
; CNS difficulty: basic
[Statedef 1921]
type = S
ctrl = 0
anim = 1921
velset = 0,0

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

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

[State 0, VarAdd]
type = VarAdd
trigger1 = 1
var(5) = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = S190,1
volumescale = 136-var(5)
channel = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = time >= 68
channel = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 68

;---------------------------------------------------------------------------
; Land
[Statedef 1922]
type    = S
physics = S
ctrl = 0
anim = 3001

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 9102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

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

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 52,0
volumescale = 125

[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 = 1
x = 0

[State 5900, turnsintro]
type = changestate
trigger1 = !animtime
trigger1 = teammode = turns
trigger1 = !roundsexisted && roundno >= 2
value = 191

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

;---------------------------------------------------------------------------
; sleeping
; CNS difficulty: basic
[Statedef 193]
type = S
ctrl = 0
anim = 193
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
flag2 = noshadow

[State 0, Helper]
type = Helper
trigger1 = !numhelper(1933)
name = "bed"
ID = 1933
stateno = 1933
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State 191, 3] 
type = ChangeState
trigger1 = time >= 200
trigger1 = enemy,stateno = 0
trigger2 = time >= 1200
value = 1930

;---------------------------------------------------------------------------
; falling out of bed
; CNS difficulty: basic
[Statedef 1930]
type = S
ctrl = 0
anim = 1930
velset = 0,0

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 15
flag = noshadow

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S190,2
volumescale = 150
channel = 0

[State 5100, 10]
type = PlaySnd
trigger1 = animelemtime(4)=0
value = f7,2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(5)=0
value = S190,3
volumescale = 150
channel = 0

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

;---------------------------------------------------------------------------
; got back into bed
; CNS difficulty: basic
[Statedef 1931]
type = S
ctrl = 0
anim = 1931
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
flag2 = noshadow

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 90
flag = nomusic
flag2 = nobardisplay

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 1934
ID = 1934
pos = 160,120
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 90
pausemovetime = 0
scale = 1,1
sprpriority = 999
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0

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

;---------------------------------------------------------------------------
; jumping out of bed
; CNS difficulty: basic
[Statedef 1932]
type = S
physics = N
ctrl = 0
anim = 1920
velset = 0,0

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

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40,0
volumescale = 125

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 2, 6
volumescale = 125
channel = 0

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

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .42

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1922
ctrl = 0

;---------------------------------------------------------------------------
; bed
; CNS difficulty: basic
[Statedef 1933]
type = S
movetype = I
physics = N
ctrl = 0
anim = 1933
velset = 0,0
sprpriority = -5

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = root,stateno = [3330,3332]
flag = invisible

;---------------------------------------------------------------------------
; vs flying lieberman
; CNS difficulty: basic
[Statedef 194]
type = S
ctrl = 0
anim = 194
velset = 0,0

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

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

[State 191, fail safe] 
type = ChangeState
trigger1 = time >= 88
value = 1940

;---------------------------------------------------------------------------
; Tripped get-hit (shaking)
[Statedef 1940]
type    = A
movetype= H
physics = N
velset = 0,0

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


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

[State -2, 2a]
type = PlaySnd
trigger1 = time = 0
value = 5000, 0+random%4
channel = 0
Volumescale = 125

[State -2, 2a]
type = PlaySnd
trigger1 = time = 0
value = 194, 0
channel = -1

[State 5070, 1]
type = ChangeAnim
trigger1 = 1
value = 5070

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 1941

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; Tripped get-hit (knocked away)
[Statedef 1941]
type    = A
movetype= H
physics = N

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


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

[State 5071, 1]
type = VelSet
trigger1 = Time = 0
x = 0
y = -20.6

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = 0.89

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15;Const(movement.air.gethit.trip.groundlevel)
type = ChangeState
value = 1942

;---------------------------------------------------------------------------
; Downed get-hit (lying down)
[Statedef 1942]
type    = L
movetype= H
physics = N

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

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

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = Explod
trigger1 = Time = 0
trigger1 = !SysVar(0)
anim = F 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
;postype = none
;pos = pos x + camerapos x, 0
pos = 0,0
postype = p1
facing = facing
sprpriority = ifelse (sysvar(1) <=14, -10, 10)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14] ;Friction
type = VelSet
trigger1 = abs(Vel x) < 1;Const(movement.down.friction.threshold)
persistent = 0
x = 0

[State 5110, 15]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 16]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

[State -2, 2a]
type = PlaySnd
trigger1 = time = 60
value = 5120, 7
channel = 0
Volumescale = 150

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 60
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 60
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 7]
type = SelfState
trigger1 = anim = [5120,5139]
trigger1 = AnimTime = 0
value = 0
ctrl = 0

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

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 60
value = S190,4
volumescale = 200
channel = 0

[State 191, 3] 
type = ChangeState
trigger1 = !animtime
value = 0

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

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

[State 191, 3] 
type = ChangeState
trigger1 = !animtime
value = 0


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

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 3, 0
Volumescale = 200


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

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

[State 0, CtrlSet]
type = CtrlSet
trigger1 = time >= 60
value = 1

;---------------------------------------------------------------------------
; go to sleep
; CNS difficulty: easy
[Statedef 197]
type = S
ctrl = 0
anim = 197
velset = 0,0
movetype = I
physics = S
sprpriority = -4

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

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

[State 0, CtrlSet]
type = CtrlSet
trigger1 = time >= 100
value = 1

;---------------------------------------------------------------------------
; AI taunt
[Statedef 199]
type = S
movetype = I
ctrl = 0
velset = 0,0

[State -1, sleep]
type = ChangeState
trigger1 = Cond(Numhelper(1933),abs(Rootdist X-Helper(1933),Rootdist X)<20,0)
value = 197

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 0
value = 195+random%2

;VS. Sash Lilac
[Statedef 198]
type = S
ctrl = 0
anim = 198
velset = 0,0

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

[State 0, ROFBEOTS]
type = Helper
trigger1 = time = 0
name = "Running out from back edge of the screen"
ID = 1992
stateno = 1992
pos = -390,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = playsnd
trigger1 = animelem = 3
value = S9999,0

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

;Helper for intro
[Statedef 1992]
type = S
ctrl = 0
anim = 1999
velset = 0,0

[State 100, 1a]
type = playsnd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 8
value = S99,0

[state 1000]
type = velset
trigger1 = 1
x = 5

[State 0, Hair]
type = Helper
trigger1 = !numhelper(1994)
name = "Tail"
ID = 1994
stateno = 1994
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = changestate
trigger1 = time = 70
value = 1993

;Helper for intro
[Statedef 1993]
type = S
physics = N
ctrl = 0
anim = 101
velset = 3,0

[State 0, Hair]
type = Helper
trigger1 = !numhelper(1995)
name = "Tail"
ID = 1995
stateno = 1995
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 110, Dust]
type = explod
trigger1 = anim = 101 && animelem = 2
anim = 9103
ID = 8103
sprpriority = 3
postype = p1
pos = 10, 0
vel = 2, 0
removetime = -2
ownpal = 1
pausemovetime = -1
supermovetime = -1

[State 106, 1]
type = playsnd
trigger1 = Time = 0
value = S105,0

[State 0, destroyself]
type = destroyself
trigger1 = !animtime

;Tail for special intro
[Statedef 1994]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 0

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent,anim != 1999
value = 6999
ignorehitpause = 1

[State 0, Turn]
type = turn
trigger1 = facing = -1
trigger1 = parent,facing = 1
trigger2 = facing = 1
trigger2 = parent,facing = -1
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6100
trigger1 = parent,anim = 1999
;trigger1 = root,animelem = 15
value = 6100
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = time = 70

;Hair for special intro
[Statedef 1995]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 0

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = parent,anim != 101
value = 6999
ignorehitpause = 1

[State 0, Turn]
type = turn
trigger1 = facing = -1
trigger1 = parent,facing = 1
trigger2 = facing = 1
trigger2 = parent,facing = -1
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6101
trigger1 = parent,anim = 101
value = 6101
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = time = 12

;---------------------------------------------------------------------------
; Stand Light Attack
; CNS difficulty: easy
[Statedef 200]
type    = S
movetype= A
physics = S
velset = 0,0
Juggle = 1
ctrl = 0
anim = 200
poweradd = 0
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(200)
trigger1 = target(200),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 0
Volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 14,0
getpower = 64,32
givepower = 32,16
animtype = Light
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 6, 6
sparkNo = -1 + 0 * (var(33) := 8010)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 0
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -2
air.type = low
air.velocity = -2,-2
air.hittime = 15
yaccel = 0.5
ID = 200

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(200)
trigger1 = target(200),statetype = A
trigger1 = target(200), stateno != [1115020,1115110]
value = 1115020
ID = 200
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command != "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 210
ctrl = 0

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

;---------------------------------------------------------------------------
; Stand Med Attack
; CNS difficulty: easy
[Statedef 210]
type    = S
movetype= A
physics = S
velset = 0,0
Juggle = 1
ctrl = 0
anim = 210
poweradd = 18
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(210)
trigger1 = target(210),time = 0
var(2) = 1
ignorehitpause = 1

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 35,0
getpower = 64,32
givepower = 32,16
animtype = Medium
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 8, 8
sparkNo = -1 + 0 * (var(33) := 8011)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 1
guardsound = S6, 0
guard.sparkno = S8055
ground.type = Low
ground.slidetime = 18
ground.hittime  = 22
ground.velocity = -4
air.type = low
air.velocity = -2,-2
air.hittime = 20
yaccel = 0.5
ID = 210

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(210)
trigger1 = target(210),statetype = A
trigger1 = target(210), stateno != [1115020,1115110]
value = 1115020
ID = 210
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command != "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 220
ctrl = 0

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

;---------------------------------------------------------------------------
; Stand Hard Attack
; CNS difficulty: easy
[Statedef 220]
type    = S
movetype= A
physics = S
velset = 0,0
Juggle = 1
ctrl = 0
anim = 220
poweradd = 18
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(220)
trigger1 = target(220),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 2
Volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 2, 0+random%4
Volumescale = 125
channel = 0

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 56,0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 12, 12
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -6
air.type = low
air.velocity = -5,-3
air.hittime = 25
Air.fall = 1
fall.recover = 0
yaccel = 0.5
ID = 220

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(220)
trigger1 = target(220),statetype = A
trigger1 = target(220), stateno != [1115020,1115110]
value = 1115020
ID = 220
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; Chun-li Kicks
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
velset = 0,0
Juggle = 0
ctrl = 0
anim = 240
poweradd = 0
sprpriority = 2

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 6 
value = -14
ignorehitpause = 0 

[State 200, 2]
type = PlaySnd
trigger1 = Time = 6
value = 2, 7+random%4
Volumescale = 125
channel = 0

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
value = 0, 4
Volumescale = 125

[State 0, VarAdd]
type = null;VarAdd
trigger1 = movehit
trigger1 = numtarget(240)
trigger1 = target(240),time = 0
var(2) = 1
ignorehitpause = 1

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(240)
trigger1 = target(240),statetype = A
trigger1 = target(240), stateno != [1115020,1115110]
value = 1115020
ID = 240
ignorehitpause = 1

[State 200, 1]
type = HitDef
triggerall = !var(4)
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
attr = S, SA
damage = 10,3
getpower = 0,0
givepower = 8,4
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 4, 4
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 14
ground.hittime  = 20
ground.velocity = -2
down.velocity = -2,-6
air.type = low
air.velocity = -2,-1
air.hittime = 25
Air.fall = 1
fall.recover = 0
yaccel = 0.35
ID = 240

[State 200, 3]
type = ChangeState
triggerall = time >= 36
trigger1 = command != "holdy"
trigger1 = command != "holddown"
trigger1 = !var(59)
trigger2 = power <= 0
trigger3 = var(59)
trigger3 = p2bodydist x >= 45 || p2bodydist x <= -10 || p2bodydist y <= -50 || power < 250 || time >= 36
value = 241
ctrl = 1

;---------------------------------------------------------------------------
; Stop Chun-li Kicks
; CNS difficulty: easy
[Statedef 241]
type    = S
movetype= I
physics = S
velset = 0,0
Juggle = 0
ctrl = 0
anim = 241
poweradd = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = numtarget(240) || numtarget(640) || numtarget(641)
trigger1 = target, stateno = [1115020,1115110]
var(4) = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Spindash
[Statedef 400]
type    = C
movetype= A
physics = C
poweradd= 18
Juggle = 0
ctrl = 0
anim = 400
sprpriority = 2
velset = 0,0

[State 106, Dust Helper]
type = Helper
trigger1 = time = 3
helperType = Normal
stateNo = 8103
ID = 8100
name = "Dash Dust"
posType = P1
pauseMoveTime = 255
superMoveTime = 255
ownPal = 1

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

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

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(400)
trigger1 = target(400),time = 0
var(0) = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(400)
trigger1 = target(400),time = 0
var(2) = 1
ignorehitpause = 1

[State 400, 2]
type = HitDef
triggerall = !var(0)
trigger1 = Time = 0
attr = C, NA
damage    = 41
priority  = 4
getpower = 64,32
givepower = 32,16
animtype  = Hard
hitflag = MAFD
guardflag = L
pausetime = 8,8
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound   = S1,2
guardsound = S6,0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -4,-4
air.velocity = -4,-4
fall = 1
fall.recover = 0
yaccel = 0.5
id = 400

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(400)
trigger1 = target(400),statetype = A
trigger1 = target(400), stateno != [1115020,1115110]
value = 1115020
ID = 400
ignorehitpause = 1

[State 400, 4]
type = ChangeState
trigger1 = time >= 23
value = 402

;---------------------------------------------------------------------------
;Running Spindash
[Statedef 401]
type    = C
movetype= A
physics = N
poweradd= 18
Juggle = 0
ctrl = 0
anim = 401
sprpriority = 2

[State 0, VelAdd]
type = VelAdd
trigger1 = time > 1
x = -.2


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

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(401)
trigger1 = target(401),time = 0
var(0) = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(401)
trigger1 = target(401),time = 0
var(2) = 1
ignorehitpause = 1

[State 400, 2]
type = HitDef
triggerall = !var(0)
trigger1 = Time = 4
attr = C, NA
damage    = 41
priority  = 4
getpower = 64,32
givepower = 32,16
animtype  = Hard
hitflag = MAFD
guardflag = L
pausetime = 8,8
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound   = S1,2
guardsound = S6,0
guard.sparkno = S8055
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -4,-4
air.velocity = -4,-4
fall = 1
fall.recover = 0
yaccel = 0.5
id = 401

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(401)
trigger1 = target(401),statetype = A
trigger1 = target(401), stateno != [1115020,1115110]
value = 1115020
ID = 401
ignorehitpause = 1

[State 400, 4]
type = ChangeState
trigger1 = time >= 23
value = 402

;---------------------------------------------------------------------------
; Roll Stop
[Statedef 402]
type    = C
Movetype= I
physics = C
ctrl = 0
anim = 411

[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 = 1
x = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = command = "holddown"
trigger1 = !animtime
value = 11
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = command != "holddown"
trigger1 = !animtime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Pounce
[Statedef 410]
type    = C
movetype= I
physics = C
poweradd= 0
ctrl = 0
anim = 410
velset = 0,0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(1) = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 2
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = N         ;A,C,S,N

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

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 2, 6
volumescale = 125
channel = 0

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 40, 1
volumescale = 150

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2)=0
x = 6
y = -4

[State 0, VelSet]
type = VelAdd
trigger1 = time > 5
y = .3

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 411
ctrl = 0

;---------------------------------------------------------------------------
; Pounce Land
[Statedef 411]
type    = S
physics = S
ctrl = 0
anim = 411

[State 411, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 9102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 52,0
volumescale = 125

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

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

[State 52, ChangeAnim to Turning]
type = ChangeAnim
trigger1 = P2Dist x < 0
trigger1 = Anim != 5
value = 5

[State 52, Turn]
type = Turn
trigger1 = Anim = 5 && AnimElem = 1

[State 52, 3]
type = CtrlSet
trigger1 = time = 1
value = 1

[State 52, 4]
type = VelSet
trigger1 = 1
x = 0

[State 0, ChangeState]
type = ChangeState
triggerall = anim != 5
trigger1 = command = "holddown"
trigger1 = !animtime
value = 11
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = command != "holddown" || anim = 5
trigger1 = !animtime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;EX Pounce
[Statedef 412]
type    = C
movetype= I
physics = C
poweradd= 0
ctrl = 0
anim = 410
velset = 0,0
sprpriority = 2

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -500
ignorehitpause = 1

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

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 250, 0

[State 1050, Palfix]
type = PalFX
trigger1 = gametime%2 = 0
time = 1
add = 120,80,0
sinadd = 64,32,5,3
ignorehitpause = 1

[State 1000, 1]
type = AfterImage
trigger1 = time = 0
time = 999999999
trans = add
length   = 4
timegap  = 2
framegap = 1
PalBright = 30 , 30 , 0
PalContrast = 255 , 255 , 0
PalAdd = 0 , 0 , 0
PalMul = .6 , .6 , 0
IgnoreHitPause = 1
Persistent = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(1) = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 2
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = N         ;A,C,S,N

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 2, 6
volumescale = 125
channel = 0

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 40, 0
volumescale = 150

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2)=0
x = 6
y = -4

[State 0, VelSet]
type = VelAdd
trigger1 = time > 5
y = .3

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 411
ctrl = 0
;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 11
ctrl = 0
anim = 430
sprpriority = 2

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
; Air Light Attack
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
Juggle = 1
ctrl = 0
anim = 600
poweradd = 0
sprpriority = 2

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(600)
trigger1 = target(600),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 0
Volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = 14,0
getpower = 64,32
givepower = 32,16
animtype = Light
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 6, 6
sparkNo = -1 + 0 * (var(33) := 8010)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + -35 * (var(35) := 58), var(36):=-35
sparkxy = -10, -35
hitsound = S1, 0
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2,-4
air.type = High
air.velocity = -2,-4
air.hittime = 15
ID = 600
Fall = var(2)
Fall.recover = 0
yaccel = 0.5

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(600)
trigger1 = target(600),statetype = A
trigger1 = target(600), stateno != [1115020,1115110]
value = 1115020
ID = 600
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
triggerall = movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 610
ctrl = 0

;---------------------------------------------------------------------------
; Air Med Attack
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = N
Juggle = 1
ctrl = 0
anim = 610
poweradd = 18
sprpriority = 2

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .42

[State 0, VarAdd]
type = null;VarAdd
trigger1 = movehit
trigger1 = numtarget(610)
trigger1 = target(610),time = 0
var(0) = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(610)
trigger1 = target(610),time = 0
var(2) = 1
ignorehitpause = 1

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = 35,0
getpower = 64,32
givepower = 32,16
animtype = Medium
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 8
sparkNo = -1 + 0 * (var(33) := 8011)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 1
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 18
ground.hittime  = 22
ground.velocity = -4,-2
air.type = low
air.velocity = -2,-2
air.hittime = 20
ID = 610
fall = 1
Fall.recover = 0
yaccel = 0.5

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(610)
trigger1 = target(610),statetype = A
trigger1 = target(610), stateno != [1115020,1115110]
value = 1115020
ID = 610
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
triggerall = movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 620
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 621
ctrl = 0

;---------------------------------------------------------------------------
; Air Hard Attack
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = N
Juggle = 1
ctrl = 0
anim = 220
poweradd = 18
sprpriority = 2

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .42

[State 0, VarAdd]
type = null;VarAdd
trigger1 = movehit
trigger1 = numtarget(620)
trigger1 = target(620),time = 0
var(0) = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(620)
trigger1 = target(620),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 2
Volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 2, 0+random%4
Volumescale = 125
channel = 0

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = 56,0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 10, 12
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -4
air.type = High
air.velocity = -4,6
air.hittime = 25
fall = 1
fall.recover = 0
yaccel = 0.8
ID = 620

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(620)
trigger1 = target(620),statetype = A
trigger1 = target(620), stateno != [1115020,1115110]
value = 1115020
ID = 620
ignorehitpause = 1

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 621
ctrl = 0

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

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 52,0
volumescale = 125

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

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

[State 52, ChangeAnim to Turning]
type = ChangeAnim
trigger1 = ctrl && P2Dist x < 0
trigger1 = Anim != 5
value = 5

[State 52, Turn]
type = Turn
trigger1 = Anim = 5 && AnimElem = 1

[State 52, 4]
type = VelSet
trigger1 = 1
x = 0

[State 52, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Pounce Air
[Statedef 630]
type    = A
movetype= I
physics = N
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(1) = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 410
elem = 2

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 2, 6
volumescale = 125
channel = 0

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 5
volumescale = 150

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 6
y = -2

[State 0, VelSet]
type = VelAdd
trigger1 = time > 1
y = .3

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 411
ctrl = 0

;---------------------------------------------------------------------------
;EX Pounce Air
[Statedef 632]
type    = A
movetype= I
physics = N
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -500
ignorehitpause = 1

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 250, 0

[State 1050, Palfix]
type = PalFX
trigger1 = gametime%2 = 0
time = 1
add = 120,80,0
sinadd = 64,32,5,3
ignorehitpause = 1

[State 1000, 1]
type = AfterImage
trigger1 = time = 0
time = 999999999
trans = add
length   = 4
timegap  = 2
framegap = 1
PalBright = 30 , 30 , 0
PalContrast = 255 , 255 , 0
PalAdd = 0 , 0 , 0
PalMul = .6 , .6 , 0
IgnoreHitPause = 1
Persistent = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(1) = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 410
elem = 2

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 2, 6
volumescale = 125
channel = 0

[State 410, 1]
type = PlaySnd
trigger1 = time = 0
value = 40, 0
volumescale = 150

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 6
y = -2

[State 0, VelSet]
type = VelAdd
trigger1 = time > 1
y = .3

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 411
ctrl = 0

;---------------------------------------------------------------------------
; Air Kicks
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = N
Juggle = 1
ctrl = 0
anim = 640
poweradd = 0
sprpriority = 2

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .42

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 6 
value = -14
ignorehitpause = 0 

[State 200, 2]
type = PlaySnd
trigger1 = Time = 6
value = 2, 7+random%4
Volumescale = 125
channel = 0

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
value = 0, 4
Volumescale = 125

[State 0, VarAdd]
type = null;VarAdd
trigger1 = movehit
trigger1 = numtarget(640)
trigger1 = target(640),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
triggerall = !var(4)
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
attr = A, SA
damage = 8,3
getpower = 0,0
givepower = 8,4
animtype = Hard
guardflag = HA
hitflag = MAFD
priority = 4, Hit
pausetime = 4, 4
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 14
ground.hittime  = 20
ground.velocity = -2
down.velocity = -2,-6
air.type = low
air.velocity = -2,-1
air.hittime = 25
Air.fall = 1
fall.recover = 0
yaccel = 0.35
ID = 640

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(640)
trigger1 = target(640),statetype = A
trigger1 = target(640), stateno != [1115020,1115110]
value = 1115020
ID = 640
ignorehitpause = 1

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 641
ctrl = 0

;---------------------------------------------------------------------------
; Land on the ground while kicking
; CNS difficulty: easy
[Statedef 641]
type    = S
movetype= A
physics = S
velset = 0,0
Juggle = 0
ctrl = 0
poweradd = 0
facep2 = 1
sprpriority = 2

[State 641, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 9102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 0, Turn]
type = null;Turn
triggerall = p2bodydist x < 0
triggerall = time = 1
trigger1 = command = "holdback"
trigger1 = !var(59)
trigger2 = frontedgebodydist >= 30
trigger2 = var(59)
trigger2 = p2bodydist x <= -20

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 52,0
volumescale = 125

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 240
elem = 3

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = 1
value = -14
ignorehitpause = 0

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
value = 0, 4
Volumescale = 125

[State 0, VarAdd]
type = null;VarAdd
trigger1 = movehit
trigger1 = numtarget(641)
trigger1 = target(641),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
triggerall = !var(4)
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
attr = S, SA
damage = 10,4
getpower = 0,0
givepower = 8,4
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 4, 4
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 14
ground.hittime  = 20
ground.velocity = -2
down.velocity = -2,-4
air.type = low
air.velocity = -2,-1
air.hittime = 25
Air.fall = 1
fall.recover = 0
yaccel = 0.35
ID = 641

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(641)
trigger1 = target(641),statetype = A
trigger1 = target(641), stateno != [1115020,1115110]
value = 1115020
ID = 641
ignorehitpause = 1

[State 200, 3]
type = ChangeState
trigger1 = command != "holdy"
trigger1 = command != "holddown"
trigger1 = !var(59)
trigger2 = power <= 0
trigger3 = var(59)
trigger3 = p2bodydist x >= 45 || p2bodydist x <= -10 && time > 1 || p2bodydist y <= -50 || power < 250 || time >= 17
value = 241
ctrl = 1

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

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents KFM from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkNo = -1 + 0 * (var(33) := 1008)
sparkXY = -10 + -35 * (var(35) := 58), var(36):=-35
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 820

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 3
value = S0,7
channel = -1
volumescale = 125

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
; Description: In this state, KFM throws the opponent by binding him to
;     various offsets based on his current frame of animation. For
;     example, [State 810, Bind 1] binds the opponent to an offset of
;     28 pixels in front of KFM. That puts him around where KFM's hand
;     is at. Is is important to keep the opponent bound using a
;     TargetBind controller at all times, until you let him go. This
;     is especially important if your player has a Clsn2 box that
;     allows him to get hit while throwing someone. Each time a player
;     gets hit, all his bound targets will be set to a fall state. If
;     the opponent is not bound, then he may get stuck in his thrown
;     state when his attacker is knocked out of the throw halfway.
; Notes: There is a TargetLifeAdd controller to decrease the opponent's
;     life, and a TargetState controller to change his state to a
;     falling state when KFM lets go of him.
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 0

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = time = 0

[State 0, TargetState]
type = TargetState
trigger1 = command = "holdback"
trigger1 = time = 0
value = 822
ID = 820

[State 0, Width]
type = Width
trigger1 = 1
edge = 40,0

[State 810, Grab Sound]
type = PlaySnd
trigger1 = time = 0
value = 800, 0
volumescale = 125

[State 810, Throw Sound]
type = PlaySnd
trigger1 = Animelem = 2
value = 0, 2
volumescale = 125

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1, 2

[State 200, 2]
type = PlaySnd
trigger1 = Animelem = 3
value = 2, 0+random%4
Volumescale = 125

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(3) < 0
pos = 30, 0

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 8052
ID = 8052
pos = 40,-25
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
ontop = 1


[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 3
value = -90

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 3
value = 821

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

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(4) = 1

[State 810, State End]
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

;---------------------------------------------------------------------------
;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 = -4,-8

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

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

;---------------------------------------------------------------------------
;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 822]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, Turn]
type = Turn
trigger1 = time = 0

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


;---------------------------------------------------------------------------
; Wild Claw
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 32
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = numtarget(240) || numtarget(640) || numtarget(641)
trigger1 = target, stateno = [1115020,1115110]
var(4) = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(1000)
trigger1 = target(1000),time = 0
var(2) = 3
ignorehitpause = 1

[State 0, VarAdd]
type = ctrlset
trigger1 = movehit
trigger1 = numtarget(1000)
trigger1 = time >= 24
value = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 4
value = 0, 6
Volumescale = 125
channel = 0

[State 200, 2]
type = PlaySnd
trigger1 = Time = 4
value = 2, 0+random%4
Volumescale = 125

[State 0, Explod]
type = Explod
trigger1 = time = 6
anim = 1010
ID = 1010
pos = 30,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1.5,1.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
triggerall = !var(3)
trigger1 = time = 0
attr = S, SA
damage = 70,10
getpower = 124,64
givepower = 64,32
animtype = Up
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 12, 12
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -1,-12
guard.velocity = -6
air.type = High
air.velocity = -1,-12
airguard.velocity = -6,-4
air.hittime = 25
fall = 1
fall.recover = 0
ID = 1000
yaccel = 0.5
envshake.time = 10
envshake.freq = 100
envshake.ampl = -4

[State 200, 1]
type = HitDef
triggerall = var(3)
trigger1 = time = 0
attr = S, SA
damage = 70,10
getpower = 124,64
givepower = 64,32
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 12, 12
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4,6
air.type = Low
air.velocity = -4,6
air.hittime = 25
fall = 1
fall.recover = 0
ID = 1000
yaccel = 1.5
envshake.time = 10
envshake.freq = 100
envshake.ampl = -4

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(1000)
trigger1 = target(1000),time = 0
var(3) = 1
ignorehitpause = 1

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(5)>=0
movetype= I

[State 0, TargetState]
type = TargetState
triggerall = movehit
triggerall = Movetype = A
triggerall = NumTarget(1000)
trigger1 = target(1000),statetype = A
trigger1 = target(1000), stateno != [1115020,1115110]
value = 1115020
ID = 1000
ignorehitpause = 1

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

;---------------------------------------------------------------------------
;Confuse
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 1100
sprpriority = 2

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents KFM from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, ST          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkNo = -1 + 0 * (var(33) := 1008)
sparkXY = -10 + -35 * (var(35) := 58), var(36):=-35
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 1110       ;On success, KFM changes to state 810
p2stateno = 1120       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 1100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S5,0+random%4
channel = 0
volumescale = 125

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Confusing the opponent
[Statedef 1110]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 1110
sprpriority = 2

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 90
trigger1 = p2bodydist x < -20
value = 1111
ctrl = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = time >= 90
trigger1 = backedgedist <= 40
trigger1 = anim != 20 
value = 20

[State 20, 1]
type = VelSet
trigger1 = anim = 20
x = const(velocity.walk.fwd.x)


;---------------------------------------------------------------------------
;Laugh
[Statedef 1111]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 5
sprpriority = 2

[State 0, Turn]
type = Turn
trigger1 = time = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 5
trigger1 = animtime = 0
value = 1111

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 4
value = S4,0+random%2
channel = 0
volumescale = 255

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

;---------------------------------------------------------------------------
;Im confused
[Statedef 1120]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
sprpriority = 0

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 0
value = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 90
value = 1121
ctrl = 0

;---------------------------------------------------------------------------
;Opponent moving
[Statedef 1121]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
sprpriority = 0

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 20
value = 20

[State 20, 1]
type = VelSet
trigger1 = 1
x = const(velocity.walk.fwd.x)

[State 0, ChangeState]
type = ChangeState
trigger1 = p2bodydist x < -60 || frontedgebodydist <= 0
trigger1 = p2stateno = 1111
trigger2 = time >= 90
value = 1122
ctrl = 0

;---------------------------------------------------------------------------
;i don't see anything
[Statedef 1122]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
sprpriority = 0

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

[State 0, NotHitBy]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = 12

[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = name = "Garfield"
trigger1 = anim != 1121
value = 1121

[State 0, ChangeAnim]
type = ChangeAnim2
triggerall = name = "Butt-head"
trigger1 = anim != 1120
value = 1120

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = name != "Butt-head"
triggerall = name != "Garfield"
trigger1 = anim != 0
value = 0

[State 0, SelfState]
type = SelfState
trigger1 = time >= 90
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; super pounce
; CNS difficulty: easy
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3000

[State 3000, ECreset]
type = palfx
trigger1 = !time
;trigger1 = !(var(20) := 0)
time = 1

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = -15, -30
anim = -1
sound = -1
time = 40
movetime = 40
poweradd = -1000
p2defmul = 1
darken = 0

[state 3000]
type = nothitby
trigger1 = animelem = 8
value = SCA
time = 13
ignorehitpause = 1

[State 3000, SuperPause FX]
type = Helper
trigger1 = Time = 0
helperType = Normal
stateNo = 8500
ID = 8500
name = "Superpause FX"
posType = P1
pos = 5,-28
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1
persistent = 0

[state 3000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[State 0, BGPalFX]
type = BGPalFX
trigger1 = time = 0
time = 40
add = 256,256,256
mul = 0,0,0
color = 256
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(2) = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0 
value = S3,1
channel = 0

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 3
statetype = A       ;S,A,C,L
movetype = A        ;I,A,H
physics = N         ;A,C,S,N

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 2, 6
volumescale = 125

[State 410, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 5
volumescale = 150

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3)=0
x = 6
y = -4

[State 0, VelSet]
type = VelAdd
trigger1 = time > 45
y = .3

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, HA
damage = 20,16
getpower = 0,0
givepower = 32,16
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 64
guard.pausetime = 0, 12
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 1
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -6
air.type = High
air.velocity = -5,-3
air.hittime = 25
fall = 1
fall.recover = 0
ID = 3000
kill = 0
guard.kill = 1

[State 0, TargetBind]
type = TargetBind
trigger1 = numtarget(3000)
trigger1 = movehit
time = 1
id = 3000
pos = 40,20
ignorehitpause = 1

[State 1021, 10]
type = ChangeState
triggerall = numtarget(3000)
triggerall = movehit
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3010
ctrl = 0


[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3001
ctrl = 0

;---------------------------------------------------------------------------
; Land
[Statedef 3001]
type    = S
physics = S
ctrl = 0
anim = 3001

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 52,0
volumescale = 125

[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 = 1
x = 0

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

;---------------------------------------------------------------------------
; Super Chun-li Kicks
; CNS difficulty: easy
[Statedef 3010]
type    = S
movetype= A
physics = S
velset = 0,0
Juggle = 0
ctrl = 0
anim = 3010
poweradd = 0
sprpriority = 2

[State 0, TargetState]
type = TargetState
trigger1 = NumTarget(3000)
value = 3020
ID = 3000
ignorehitpause = 1 

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

[State 200, 2]
type = PlaySnd
trigger1 = Time = 6
value = 2, 7+random%4
Volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
value = 0, 4
Volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
attr = S, HA
damage = 2,0
getpower = 0,0
givepower = 4,0
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 3, 16
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 18
ground.hittime  = 26
ground.velocity = -0
air.type = low
air.velocity = -0,-0
air.hittime = 25
fall.recover = 0
forcenofall = 1
ID = 3010
envshake.time = 10
envshake.freq = 90
envshake.ampl = -2
kill = 0

[State 0, TargetState]
type = TargetState
trigger1 = NumTarget(3010)
trigger1 = time >= 165
value = 3021
ID = 3010
ignorehitpause = 1 

[State 200, 3]
type = ChangeState
trigger1 = time >= 165
value = 3011
ctrl = 1

;---------------------------------------------------------------------------
; you're dead!
[Statedef 3011]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
velset = 0,0
anim = 3011
ctrl = 0
sprpriority = 2

[State 200, 2]
type = PlaySnd
trigger1 = Time = 43
value = 0, 2
Volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 3, 2
volumescale = 125

[State 0, Explod]
type = Explod
trigger1 = time = 46
anim = 1010
ID = 1010
pos = 30,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1.5,1.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(3011)
trigger1 = target(3011),time = 0
var(0) = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(3011)
trigger1 = target(3011),time = 0
var(4) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, HA
damage = 50,12
getpower = 0,0
givepower = 64,32
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 16, 16
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-55
hitsound = S1, 3
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -6,-5
air.type = High
air.velocity = -6,-5
air.hittime = 25
fall = 1
fall.recover = 0
ID = 3011
envshake.time = 16
envshake.freq = 120
envshake.ampl = -6
yaccel = 0.5

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(6)>=0
movetype= I

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

;---------------------------------------------------------------------------
; hit
; CNS difficulty: easy
[Statedef 3020]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0

[State 0, DefenceMulSet]
type = null;DefenceMulSet
trigger1 = 1
value = 1
ignorehitpause = 1 

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

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

[State 52, ChangeAnim2]
type = ChangeAnim2
trigger1 = anim != 3020
value = 3020

[State 52, 4]
type = VelSet
trigger1 = 1
x = 0

;---------------------------------------------------------------------------
; dizzy
; CNS difficulty: easy
[Statedef 3021]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0

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

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

[State 52, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 5300
value = 5300

[State 52, 4]
type = VelSet
trigger1 = 1
x = 0

;---------------------------------------------------------------------------
; get on the bike
; CNS difficulty: easy
[Statedef 3050]
type    = A
movetype= I
physics = N
juggle  = 0
velset = 0,-8
ctrl = 0
anim = 3050

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(17) = 0


[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = -15, -30
anim = -1
sound = -1
time = 40
movetime = 40
poweradd = -2000
p2defmul = 1
darken = 0

[State 3000, SuperPause FX]
type = Helper
trigger1 = Time = 0
helperType = Normal
stateNo = 8502
ID = 8502
name = "Superpause FX"
posType = P1
pos = 5,-28
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1
persistent = 0

[state 1000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[State 0, BGPalFX]
type = BGPalFX
trigger1 = time = 0
time = 40
add = 256,256,256
mul = 0,0,0
color = 256
ignorehitpause = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 4051,0
volumescale = 300

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,0
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

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

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

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .39

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

;---------------------------------------------------------------------------
; Air get-hit (knocked away)
[Statedef 3060]
type    = A
movetype= H
physics = N
ctrl = 0

[State 0, HitOverride]
type = HitOverride
trigger1 = time = 0
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 5020
time = 0
forceair = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "seat"
ID = 3070
stateno = 3070
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "light"
ID = 3071
stateno = 3071
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "wheel"
ID = 3072
stateno = 3072
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "exhaust"
ID = 3073
stateno = 3073
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "wheel2"
ID = 3074
stateno = 3074
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S4005,0
;volumescale = 0
channel = 3

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(17) = 0

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

[State 5030, 1]
type = ChangeAnim
trigger1 = Anim != [5000, 5199]
trigger1 = SelfAnimExist(5030)
value = 5030

[State 5030, 2]
type = VelAdd
trigger1 = 1
y = 0.8

[State 5030, 3]
type = VelSet
trigger1 = Time = 0
x = -6
y = -14

[State 5030, 5]
type = SelfState
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 0
value = 5100 ;HITA_FALL

;---------------------------------------------------------------------------
; bike part
[Statedef 3070]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 3070

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


[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = -6+random%12
y = -4-random%8


[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .44

[State 1021, 10]
type = VelSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
y = -4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 60

;---------------------------------------------------------------------------
; bike part
[Statedef 3071]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 3071

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

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = -6+random%12
y = -4-random%8


[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .44

[State 1021, 10]
type = VelSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
y = -4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 60

;---------------------------------------------------------------------------
; bike part
[Statedef 3072]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 3072

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

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = -6+random%12
y = -4-random%8


[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .44

[State 1021, 10]
type = VelSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
y = -4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 60

;---------------------------------------------------------------------------
; bike part
[Statedef 3073]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 3073

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

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = -6+random%12
y = -4-random%8


[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .44

[State 1021, 10]
type = VelSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
y = -4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 60

;---------------------------------------------------------------------------
; bike part
[Statedef 3074]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 3072

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

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = -6+random%12
y = -4-random%8


[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .44

[State 1021, 10]
type = VelSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
y = -4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 60

;---------------------------------------------------------------------------
; sushi start
; CNS difficulty: easy
[Statedef 3300]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3300

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

[State 0, reset the sushi]
type = VarSet
trigger1 = time = 0
var(10) = 0

[State 0, Food]
type = Helper
trigger1 = time = 0
name = "Sushi"
ID = 3301
stateno = 3301
pos = 50,-250
;postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 40
pausemovetime = 40

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = -15, -30
anim = -1
sound = -1
time = 40
movetime = 40
poweradd = -3000
p2defmul = 1
darken = 0

[state 3000]
type = nothitby
trigger1 = animelem = 8
value = SCA
time = 13
ignorehitpause = 1

[State 3000, SuperPause FX]
type = Helper
trigger1 = Time = 0
helperType = Normal
stateNo = 8504
ID = 8502
name = "Superpause FX"
posType = P1
pos = 5,-28
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1
persistent = 0

[state 3000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(2) = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0 
value = S7,0
channel = 0
volumescale = 150

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 41 
value = S7,1
channel = 0
volumescale = 150

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, HT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkNo = -1 + 0 * (var(33) := 1008)
sparkXY = -10 + -35 * (var(35) := 58), var(36):=-35
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 3310       ;On success, KFM changes to state 810
p2stateno = 3320       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 3320


[State 0, NotHitBy]
type = NotHitBy
trigger1 = time <= 41
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

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

;---------------------------------------------------------------------------
; eating the sushi
; CNS difficulty: easy
[Statedef 3305]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 20

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


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 24
value = 3305

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 2
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3305
x = 0
y = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3305
trigger1 = animelem = 6
value = S7,2
channel = 0
volumescale = 250

[State 0, LifeAdd]
type = LifeAdd
trigger1 = anim = 3305
trigger1 = animelem = 6
value = 100
kill = 0

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

;---------------------------------------------------------------------------
; got em with sushi
; CNS difficulty: easy
[Statedef 3310]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3310

[State 0, tell the sushi to stick to p2]
type = VarSet
trigger1 = time >= 120
var(10) = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 120 
value = S800,0
channel = 0
volumescale = 125


[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 140
value = 3311
ctrl = 0

;---------------------------------------------------------------------------
; hey!
; CNS difficulty: easy
[Statedef 3311]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3311

[State -2, 2a]
type = PlaySnd
trigger1 = time = 0
value = 5120, 10
channel = 0
Volumescale = 150

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 60
value = 3312
ctrl = 0

;---------------------------------------------------------------------------
; stop!
; CNS difficulty: easy
[Statedef 3312]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3312

[State -2, 2a]
type = PlaySnd
trigger1 = time = 0
value = 7, 3
channel = 0
Volumescale = 200

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 90
value = 3330
ctrl = 0

;---------------------------------------------------------------------------
; that worked out well
; CNS difficulty: easy
[Statedef 3313]
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3313

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 3

[State 0, Turn]
type = Turn
trigger1 = animelemtime(2)=0

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
x = 0
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S7,4
volumescale = 150

[State 0, VarSet]
type = VarSet
trigger1 = roundstate > 2
var(19) = 1


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

;---------------------------------------------------------------------------
;ooo yummy sushi
[Statedef 3320]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0
sprpriority = 0

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 0
value = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 120
value = 3321
ctrl = 0

;---------------------------------------------------------------------------
;imma just take that
[Statedef 3321]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0
sprpriority = 0

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = name = "Garfield"
trigger1 = authorname = "Veanko"
value = 64980

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim != 64980
trigger1 = selfanimexist(10) && selfanimexist(11) && selfanimexist(12)
value = 10

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 10
trigger1 = animtime = 0
value = 11

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 11
trigger1 = time >= 15
value = 12

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = time = 0
trigger1 = !selfanimexist(10) || !selfanimexist(11) || !selfanimexist(12)
value = 3321

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 0
trigger1 = anim = 64980
trigger1 = !animtime
trigger2 = anim = 12
trigger2 = !animtime
trigger3 = anim = 3321
trigger3 = !animtime
value = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 70
value = 3322
ctrl = 0

;---------------------------------------------------------------------------
;im outta here see ya
[Statedef 3322]
type    = A
movetype= H
physics = S
velset = 0,0
ctrl = 0
sprpriority = 0

[State 0, Turn]
type = Turn
trigger1 = time = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = selfanimexist(100)
trigger1 = time = 0
value = 100

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !selfanimexist(100)
trigger1 = time = 0
value = 20

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

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

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

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

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 100
value = 3340
ctrl = 0

;---------------------------------------------------------------------------
; uh oh its brevon
; CNS difficulty: easy
[Statedef 3330]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3330

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9,0+random%2
volumescale = 350
channel = 3

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = noFG
flag3 = noBG

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = timerfreeze
flag2 = nobardisplay

[State 0, PosSet]
type = PosSet
triggerall = facing = -1
trigger1 = time = 0
x = -70
y = 0

[State 0, PosSet]
type = PosSet
triggerall = facing = 1
trigger1 = time = 0
x = 70
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S8,0
volumescale = 350
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 11
value = S8,1
volumescale = 350
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 24
value = S8,2
volumescale = 350
channel = 0

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


;---------------------------------------------------------------------------
; take this
; CNS difficulty: easy
[Statedef 3331]
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3331

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = noFG
flag3 = noBG

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = timerfreeze
flag2 = nobardisplay

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S8,3
volumescale = 350
channel = 0 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 36
value = S0,2
volumescale = 125

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 36
value = S1,3

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 36
time = 20
freq = 120
ampl = -6

[State 0, Explod]
type = Explod
trigger1 = time = 36
anim = 8053
ID = 8053
pos = -40,-40
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
ontop = 1

[State 0, tell the sushi to fly up into the air]
type = VarSet
trigger1 = time = 36
var(10) = 2

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
x = -3.5
y = 0

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

[State 0, tell the sushi to stop flying]
type = VarSet
trigger1 = time = 110
var(10) = 3

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 110
value = 3332
ctrl = 0

;---------------------------------------------------------------------------
; i got the sushi!
; CNS difficulty: easy
[Statedef 3332]
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
anim = 3332

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = noFG
flag3 = noBG

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = timerfreeze
flag2 = nobardisplay

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0 
value = S800,0
volumescale = 125

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 30
value = S8,4
volumescale = 350

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 160
value = 3313
ctrl = 0
 

;---------------------------------------------------------------------------
; haha i got away with the sushi!
; CNS difficulty: easy
[Statedef 3340]
type    = A
movetype= H
physics = S
velset = 0,0
ctrl = 0

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

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 20
value = 20

[State 0, PosSet]
type = PosSet
triggerall = facing = -1
trigger1 = time = 0
x = 300
y = 0

[State 0, PosSet]
type = PosSet
triggerall = facing = 1
trigger1 = time = 0
x = -300
y = 0

[State 20, 1]
type = VelSet
trigger1 = 1
x = 2

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 100
value = 3341
ctrl = 0

;---------------------------------------------------------------------------
; hey man im not giving you my sushi
; CNS difficulty: easy
[Statedef 3341]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0

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

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = selfanimexist(130)
trigger1 = time = 747
value = 130

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 130
trigger1 = anim != 0
value = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 762
value = 3342
ctrl = 0

;---------------------------------------------------------------------------
; OH SHI-
; CNS difficulty: easy
[Statedef 3342]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 0, LifeAdd]
type = LifeAdd
trigger1 = time = 0
value = -400
kill = 0
absolute = 0

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

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

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

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = time = 0
value = 3342

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

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 270
value = 3343
ctrl = 0

;---------------------------------------------------------------------------
; AHHHHH
; CNS difficulty: easy
[Statedef 3343]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

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

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

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

[State 0, PosSet]
type = PosSet
triggerall = facing = -1
trigger1 = time = 0
x = -300
y = 0

[State 0, PosSet]
type = PosSet
triggerall = facing = 1
trigger1 = time = 0
x = 300
y = -50

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

[State 1026, Hit wall]
type = ChangeState
trigger1 = BackEdgeBodyDist <= 20
value = 3344

;---------------------------------------------------------------------------
; ow
[Statedef 3344]
type    = A
movetype= H
physics = N

[State 0, LifeAdd]
type = LifeAdd
trigger1 = time = 0
value = -200
kill = 1
absolute = 0

[State 5100, 10]
type = PlaySnd
trigger1 = time = 0
value = f7,2

[State 5110, Envshake]
type = envshake
Trigger1 = time = 0
time = 10
ampl = -6
freq = 120

[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 = 0
movecamera = 0,0

[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 = 3344

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

;---------------------------------------------------------------------------
[Statedef 3345]
type    = A
movetype= H
physics = N

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

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

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

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(5937) && time = 0
value = 5937


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

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

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

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

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

;---------------------------------------------------------------------------
; Lieing down
[Statedef 3346]
type = L
movetype = H
physics = N
velset = 0,0
ctrl = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 3346

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, 0

[State 5110, 7]
type = Explod
trigger1 = Time = 0
trigger1 = !SysVar(0)
anim = F60
pos = 0, 0
sprpriority = -10

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, SelfState]
type = SelfState
trigger1 = !Alive
trigger1 = time >= 110
value = 5150

[State 0, SelfState]
type = SelfState
trigger1 = Alive
trigger1 = time >= 130
value = 5120


;-------------------------------------------------------------------------
;Food
[Statedef 3301]
type = S
physics = N
movetype = I
sprpriority = 5

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 3301

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

[State 1000, Land]
type= changestate
trigger1= vel y > 0
trigger1= pos y > -vel y
value= 3302

;-------------------------------------------------------------------------
;Food
[Statedef 3302]
type = S
physics = N
movetype = I
sprpriority = 5

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

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

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .30

[State 1000, Land]
type= changestate
trigger1 = time >= 12
trigger1= vel y > 0
trigger1= pos y > -vel y
value= 3303

;-------------------------------------------------------------------------
;Food
[Statedef 3303]
type = S
physics = N
movetype = I
sprpriority = 5
velset = 0,0

[State 0, SprPriority]
type = null;SprPriority
trigger1 = parent,stateno = 3310
value = 5

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

[State 0, PosSet]
type = PosSet
trigger1 = time = 0 
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = parent,movetype = H
trigger2 = parent,stateno = 0
value = 3306
ctrl = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = parent,stateno = 3305
trigger1 = parent,anim = 3305

[State 0, PosSet]
type = PosSet
trigger1 = parent,var(10) = 1
x = enemy,pos x
y = enemy, const(size.mid.pos.y)+20
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = parent,var(10) = 2
value = 3304
ctrl = 0


;-------------------------------------------------------------------------
;Food
[Statedef 3304]
type = S
physics = N
movetype = I
sprpriority = -2

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = -40

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

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

[State 0, VelAdd]
type = VelAdd
trigger1 = parent,var(10) != 3
y = .30

[State 0, VelAdd]
type = Velset
trigger1 = parent,var(10) = 3
y = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno = 3313

;---------------------------------------------------------------------------
; food gone
[Statedef 3306]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0
anim = 3302

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 22

;---------------------------------------------------------------------------
; bike idle
[Statedef 4000]
type = S
physics = N
sprpriority = 0
anim = 4000

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1

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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1

[State 0, ChangeState]
type = Velset
triggerall = power >= 250
trigger1 = command = "y" && !var(59) || var(57)
x = 12

[State 0, PlaySnd]
type = PlaySnd
triggerall = power >= 250
trigger1 = command = "y" && !var(59) || var(57)
value = 4001,0
volumescale = 300
abspan = 0

[State 0, PowerAdd]
type = PowerAdd
triggerall = power >= 250
trigger1 = command = "y" && !var(59) || var(57)
value = -250


[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 4000
trigger1 = vel x = 0
value = 4000

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 4020
trigger1 = vel x != 0
value = 4020

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = var(59)
trigger2 = !var(58)
x = 0

[State 0, 2]
type = VelSet
trigger1 = vel x > 12
x = 12

[State 0, 2]
type = VelSet
trigger1 = vel x < -12
x = -12

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

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = vel x >= 9 || vel x <= -9
statetype = S       ;S,A,C,L
movetype = A        ;I,A,H
physics = N         ;A,C,S,N
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = vel x < 9 && vel x > -9
statetype = S       ;S,A,C,L
movetype = I        ;I,A,H
physics = N         ;A,C,S,N
ignorehitpause = 1



[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4000)
trigger1 = target(4000),time = 0
var(2) = 2
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = vel x >= 9 || vel x <= -9
attr = S, NA
damage = 88,0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 0, 0
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = 6,-10
guard.velocity = 16
air.type = low
air.velocity = 6,-10
air.hittime = 10
fall = 1
fall.recover = 0
yaccel = 0.8
ID = 4000
nochainid = 4000
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 100

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = p2bodydist x <= 33
trigger2 = p2bodydist Y = [-44,88]
trigger2 = p2statetype != L
trigger2 = enemynear,stateno != 5120
trigger2 = vel x < 9 && vel x > -9 || numtarget(4000) || enemynear,statetype = A
trigger2 = random<var(50)*1.1
value = 4200
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "holdup"
trigger2 = var(59)
trigger2 = inguarddist || enemynear,statetype = A || random<var(50)*0.5 && enemynear,statetype != L && vel x = [-6,6]
trigger2 = AILevel >= 4
trigger2 = random<var(50)*1.0
value = 4050
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = roundstate > 2
value = 4001
ctrl = 1

;---------------------------------------------------------------------------
; jumping off bike
; CNS difficulty: basic
[Statedef 4001]
type = S
physics = N
ctrl = 0
anim = 1920

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "bike"
ID = 4002
stateno = 4002
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0


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

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 3

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40,0
volumescale = 125

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

[State 0, VelAdd]
type = VelAdd
trigger1 = time > 0
y = .42

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
; bike itself
[Statedef 4002]
type = S
physics = N
sprpriority = 0
anim = 1921

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = root,vel x
y = 0
ignorehitpause = 1

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

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

[State 0, HitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
ignorehitpause = 1


[State 0, VelAdd]
type = VelAdd
trigger1 = vel x > 0
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = vel x < 0
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
trigger1 = vel x = [0,0.5]
x = 0

[State 0, 2]
type = VelSet
trigger1 = vel x > 12
x = 12

[State 0, 2]
type = VelSet
trigger1 = vel x < -12
x = -12

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

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 100

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [-0.4,0.4]
var(15) = 0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [0.5,0.9] 
trigger2 = vel x = [-0.9,-0.4]
var(15) = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1,1.4]
trigger2 = vel x = [-1.4,-1]
var(15) = 2
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1.5,1.9]
trigger2 = vel x = [-1.9,-1.5]
var(15) = 3
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2,2.4]
trigger2 = vel x = [-2.4,-2]
var(15) = 4
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2.5,2.9]
trigger2 = vel x = [-2.9,-2.5]
var(15) = 5
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3,3.4]
trigger2 = vel x = [-3.4,-3]
var(15) = 6
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3.5,3.9]
trigger2 = vel x = [-3.9,-3.4]
var(15) = 7
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4,4.4]
trigger2 = vel x = [-4.4,-4]
var(15) = 8
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4.5,4.9]
trigger2 = vel x = [-4.9,-4.4]
var(15) = 9
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5,5.4]
trigger2 = vel x = [-5.4,-5]
var(15) = 10
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5.5,5.9]
trigger2 = vel x = [-5.9,-5.5]
var(15) = 11
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6,6.4]
trigger2 = vel x = [-6.4,-6]
var(15) = 12
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6.5,6.9]
trigger2 = vel x = [-6.9,-6.5]
var(15) = 13
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7,7.4]
trigger2 = vel x = [-7.4,-7]
var(15) = 14
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7.5,7.9]
trigger2 = vel x = [-7.9,-7.5]
var(15) = 15
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8,8.4]
trigger2 = vel x = [-8.4,-8]
var(15) = 16
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8.5,8.9]
trigger2 = vel x = [-8.9,-8.5]
var(15) = 17
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x >= 9
trigger2 = vel x <= -9
var(15) = 18
ignorehitpause = 1

;---------------------------------------------------------------------------
; bike jump
[Statedef 4050]
type = A
physics = N
sprpriority = 0
anim = 4041

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
y = -4
ignorehitpause = 1

[State 0, VelSet]
type = VelAdd
triggerall = time <= 4
trigger1 = command = "holdup"
trigger2 = var(59)
y = -2
ignorehitpause = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 40,0
volumescale = 125


[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .7
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarSet]
type = VarSet
trigger1 = command != "holdup"
var(16) = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = p2bodydist x <= 33
trigger2 = p2bodydist Y = [-44,88]
trigger2 = time >= 7
trigger2 = p2statetype != L
trigger2 = enemynear,stateno != 5120
trigger2 = random<var(50)*1.1
value = 4600
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall = power >= 250
trigger1 = !var(59)
trigger1 = command = "y"
trigger2 = var(59)
trigger2 = !var(4)
trigger2 = AILevel>1
trigger2 = statetype = A
trigger2 = p2bodydist x = [-30,30]
trigger2 = p2bodydist Y = [-60,44]
trigger2 = time >= 7
trigger2 = power >= 250
trigger2 = enemynear,stateno != 5120
trigger2 = random<var(50)*1.5
value = 4240
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = !var(59)
trigger1 = var(16)
trigger1 = command = "holdup"
trigger2 = var(59)
trigger2 = !var(7)
trigger2 = p2bodydist x = [-24,24]
trigger2 = p2bodydist Y = [-122,44]
trigger2 = time >= 7
trigger2 = p2statetype != L
trigger2 = enemynear,stateno != 5120
trigger2 = random<var(50)*1.5
value = 4051
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

;---------------------------------------------------------------------------
; bike double jump
[Statedef 4051]
type = A
movetype = A
physics = N
sprpriority = 0
anim = 4051

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
y = -12
ignorehitpause = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 4051,0
volumescale = 300


[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1

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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .7
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = movecontact
trigger1 = numtarget(4051)
trigger1 = target(4051),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
triggerall = !var(7)
trigger1 = animelem = 2 || animelem = 6
attr = A, SA
damage = 29,0
getpower = 16,8
givepower = 16,8
animtype = diagup
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 3, 6
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 4
ground.hittime  = 4
ground.velocity = -4,-12
airguard.velocity = -4,-4
air.type = high
air.velocity = -4,-12
air.hittime = 12
fall = 1
fall.recover = 0
yaccel = .8
envshake.time = 10
envshake.freq = 90
envshake.ampl = -2
id = 4051
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 4051
trigger1 = time >= 50
value = 4041
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "x"
value = 4600
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = command = "y"
trigger1 = power >= 250
trigger1 = !var(59)
;trigger1 = Pos Y <= -50
value = 4240
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

;---------------------------------------------------------------------------
; bike Land
[Statedef 4052]
type    = S
movetype = I
physics = N
ctrl = 0
anim = 4000

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = numtarget(4051)
var(7) = 1

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(16) = 0

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 4052,0
volumescale = 125

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

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

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

[State 52, 5]
type = ChangeState
trigger1 = prevstateno != 4051
trigger1 = time >= 3
trigger2 = prevstateno = 4051
trigger2 = time >= 6
value = 4000
ctrl = 0

;---------------------------------------------------------------------------
; Bike Light Attack
; CNS difficulty: easy
[Statedef 4200]
type    = S
movetype= A
physics = N
Juggle = 2
ctrl = 0
anim = 4200
poweradd = 0
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1


[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = var(59)
trigger2 = !var(58)
x = 0

[State 0, 2]
type = VelSet
trigger1 = vel x > 12
x = 12

[State 0, 2]
type = VelSet
trigger1 = vel x < -12
x = -12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4200)
trigger1 = target(4200),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 0
Volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 14,0
getpower = 64,32
givepower = 32,16
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkNo = -1 + 0 * (var(33) := 8010)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + -35 * (var(35) := 58), var(36):=-35
sparkxy = -10, -35
hitsound = S1, 0
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -4,-8
air.type = low
air.velocity = -4,-4
air.hittime = 10
yaccel = 0.8
ID = 4200
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
trigger2 = movecontact
value = 4210
ctrl = 0

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

;---------------------------------------------------------------------------
; Stand Med Attack
; CNS difficulty: easy
[Statedef 4210]
type    = S
movetype= A
physics = N
Juggle = 2
ctrl = 0
anim = 4210
poweradd = 18
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1


[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = var(59)
trigger2 = !var(58)
x = 0

[State 0, 2]
type = VelSet
trigger1 = vel x > 12
x = 12

[State 0, 2]
type = VelSet
trigger1 = vel x < -12
x = -12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4210)
trigger1 = target(4210),time = 0
var(2) = 1
ignorehitpause = 1

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 35,0
getpower = 64,32
givepower = 32,16
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkNo = -1 + 0 * (var(33) := 8011)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 1
guardsound = S6, 0
guard.sparkno = S8055
ground.type = Low
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -6,-8
air.type = low
air.velocity = -6,-4
air.hittime = 10
yaccel = 0.8
ID = 4210
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
trigger2 = movecontact
value = 4220
ctrl = 0

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

;---------------------------------------------------------------------------
; Stand Hard Attack
; CNS difficulty: easy
[Statedef 4220]
type    = S
movetype= A
physics = N
Juggle = 8
ctrl = 0
anim = 4220
poweradd = 18
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1


[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = var(59)
trigger2 = !var(58)
x = 0

[State 0, 2]
type = VelSet
trigger1 = vel x > 12
x = 12

[State 0, 2]
type = VelSet
trigger1 = vel x < -12
x = -12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4220)
trigger1 = target(4220),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 2
Volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 2, 0+random%4
Volumescale = 125
channel = 0

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 56,0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -6,-10
air.type = low
air.velocity = -6,-10
air.hittime = 10
fall = 1
fall.recover = 0
yaccel = 0.8
ID = 4220
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

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

;---------------------------------------------------------------------------
; Air Kicks
; CNS difficulty: easy
[Statedef 4240]
type    = A
movetype= A
physics = N
Juggle = 1
ctrl = 0
anim = 4240
poweradd = 0
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

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

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .6
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time >= 6 
value = -14
ignorehitpause = 0 

[State 200, 2]
type = PlaySnd
trigger1 = Time = 6
value = 2, 7+random%4
Volumescale = 125
channel = 0

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
value = 0, 4
Volumescale = 125

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4240)
trigger1 = target(4240),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
triggerall = !var(4)
trigger1 = animelem = 3 || animelem = 5 || animelem = 7
attr = A, SA
damage = 39,4
getpower = 0,0
givepower = 16,8
animtype = Hard
guardflag = HA
hitflag = MAFD
priority = 4, Hit
pausetime = 3, 6
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -2,-10
down.velocity = -2,-14
air.type = low
air.velocity = -2,-10
air.hittime = 25
Air.fall = 1
fall.recover = 0
yaccel = 0.8
ID = 4240

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4241
ctrl = 0

;---------------------------------------------------------------------------
; bike Land
[Statedef 4241]
type    = S
movetype = I
physics = N
ctrl = 0
anim = 4000

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = numtarget(4240)
var(4) = 1

[State 0, VarSet]
type = VarSet
trigger1 = numtarget(4051)
var(7) = 1

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(16) = 0

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 4052,0
volumescale = 125

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

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

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

[State 52, 5]
type = ChangeState
trigger1 = time >= 8
value = 4000
ctrl = 0

;---------------------------------------------------------------------------
; Air Bike Light Attack
; CNS difficulty: easy
[Statedef 4600]
type    = A
movetype= A
physics = N
Juggle = 2
ctrl = 0
anim = 4200
poweradd = 0
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1

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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .7
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4600)
trigger1 = target(4600),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 0
Volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = 14,0
getpower = 64,32
givepower = 32,16
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkNo = -1 + 0 * (var(33) := 8010)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + -35 * (var(35) := 58), var(36):=-35
hitsound = S1, 0
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -4,-8
air.type = low
air.velocity = -4,-4
air.hittime = 10
yaccel = 0.8
ID = 4600
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !animtime
trigger1 = anim != 4041
value = 4041

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
trigger2 = movecontact
value = 4610
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
triggerall = power >= 250
;triggerall = Pos Y <= -50
trigger1 = command = "y"
trigger2 = var(59)
trigger2 = random<var(50)*0.2
trigger2 = movecontact
value = 4240
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

;---------------------------------------------------------------------------
; Air Bike Med Attack
; CNS difficulty: easy
[Statedef 4610]
type    = A
movetype= A
physics = N
Juggle = 4
ctrl = 0
anim = 4210
poweradd = 18
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .7
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4610)
trigger1 = target(4610),time = 0
var(2) = 1
ignorehitpause = 1

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = 35,0
getpower = 64,32
givepower = 32,16
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkNo = -1 + 0 * (var(33) := 8011)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 1
guardsound = S6, 0
guard.sparkno = S8055
ground.type = Low
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -6,-8
air.type = low
air.velocity = -6,-4
air.hittime = 10
yaccel = 0.8
ID = 4610
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !animtime
trigger1 = anim != 4041
value = 4041

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
trigger2 = movecontact
value = 4620
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
triggerall = power >= 250
;triggerall = Pos Y <= -50
trigger1 = command = "y"
trigger2 = var(59)
trigger2 = random<var(50)*0.2
trigger2 = movecontact
value = 4240
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

;---------------------------------------------------------------------------
; Air Bike Hard Attack
; CNS difficulty: easy
[Statedef 4620]
type    = A
movetype= A
physics = N
Juggle = 8
ctrl = 0
anim = 4220
poweradd = 18
sprpriority = 2

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
trigger1 = !var(59)
trigger2 = p2bodydist x < 0
trigger2 = var(59)
ignorehitpause = 1


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .7
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 9
trigger1 = !var(59)
trigger1 = command = "holdfwd"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdfwd"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(4620)
trigger1 = target(4620),time = 0
var(2) = 1
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 0, 2
Volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = Time = 0
value = 2, 0+random%4
Volumescale = 125
channel = 0

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = 56,0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkNo = -1 + 0 * (var(33) := 8012)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 58), var(36):=-35
hitsound = S1, 2
guardsound = S6, 0
guard.sparkno = S8055
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -6,-10
air.type = low
air.velocity = -6,-10
air.hittime = 10
fall = 1
fall.recover = 0
yaccel = 0.8
ID = 4620
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !animtime
trigger1 = anim != 4041
value = 4041

[State 200, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I

[State 0, ChangeState]
type = ChangeState
triggerall = time >= 6
triggerall = power >= 250
;triggerall = Pos Y <= -50
trigger1 = command = "y"
trigger2 = var(59)
trigger2 = random<var(50)*0.2
trigger2 = movecontact
value = 4240
ctrl = 0

[State 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

;---------------------------------------------------------------------------
; hit while riding bike
[Statedef 45000]
type = S
movetype= H
physics = S
sprpriority = 0
anim = 45000

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, LifeAdd]
type = null;LifeAdd
trigger1 = time = 0 
value = -GetHitVar(Damage)
kill = 1
ignorehitpause = 1

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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver || time >= 10
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 45001

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver || time >= 10
value = 45030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = gethitvar(animtype) = 0
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = gethitvar(animtype) = 1
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = gethitvar(animtype) > 1
persistent = 0
time = 15
waveform = sinesquare
ampl = 140


[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

;---------------------------------------------------------------------------
; Stand get-hit (knocked back)
[Statedef 45001]
type    = S
movetype= H
physics = S

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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45000
time = 999
forceair = 0
ignorehitpause = 1

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

[State 5001, 3] ;Stop sliding back
type = null;VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

[State 5001, 6]
type = ChangeState
trigger1 = GetHitVar(hittime) = 0
trigger2 = time >= 30
value = 4000
ctrl = 0
ignorehitpause = 1

;---------------------------------------------------------------------------
; Air get-hit (shaking)
[Statedef 45020]
type    = A
movetype= H
physics = N
velset = 0,0
anim = 45000

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

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

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger2 = time >= 10
value = 45030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = gethitvar(animtype) = 0
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = gethitvar(animtype) = 1
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = gethitvar(animtype) > 1
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150

;---------------------------------------------------------------------------
; Air get-hit (knocked away)
[Statedef 45030]
type    = A
movetype= H
physics = N
ctrl = 0

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 1
stateno = 45020
time = 999
forceair = 0
ignorehitpause = 1

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

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

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

[State 5030, 5]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052 ;HITA_FALL

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(15)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 150
;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[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, turnsintro]
type = changestate
trigger1 = !time && teammode = turns
trigger1 = !roundsexisted && roundno >= 2
value = 192

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

;---------------------------------------------------------------------------
; Tail
; CNS difficulty: easy
[Statedef 6000]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 0

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

[State 0, Turn]
type = Turn
trigger1 = facing = -1
trigger1 = root,facing = 1
trigger2 = facing = 1
trigger2 = root,facing = -1
ignorehitpause = 1


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root,anim != [0,4] 
trigger1 = root,anim != 10
trigger1 = root,anim != 11
trigger1 = root,anim != 12
trigger1 = root,anim != 20
trigger1 = root,anim != 21
trigger1 = root,anim != [40,47]
trigger1 = root,anim != 100
trigger1 = root,anim != 101
trigger1 = root,anim != 105
trigger1 = root,anim != 110
trigger1 = root,anim != 111
trigger1 = root,anim != 115
trigger1 = root,anim != 116
trigger1 = root,anim != [120,152]
trigger1 = root,anim != 181 && root,anim != [170,175]
trigger1 = root,anim != 183
trigger1 = root,anim != 191 && root,anim != 194 && root,anim != [1910,1911]
trigger1 = root,anim != 195 && root,anim != [1950,1951]
trigger1 = root,anim != 198
trigger1 = root,anim != 240
trigger1 = root,anim != 241
trigger1 = root,anim != 400
trigger1 = root,anim != 410
trigger1 = root,anim != 411
trigger1 = root,anim != 640
trigger1 = root,anim != 1110   
trigger1 = root,anim != 1111
trigger1 = root,anim != 3000
trigger1 = root,anim != 3001
trigger1 = root,anim != 3010
trigger1 = root,anim != 3300 
trigger1 = root,anim != 1100
trigger1 = root,anim != 3011
trigger1 = root,anim != 3310
trigger1 = root,anim != 3311
trigger1 = root,anim != 3312
trigger1 = root,anim != 3313 
trigger1 = root,anim != 5120
trigger1 = root,anim != 1920
trigger1 = root,anim != 5300 && root,anim != 5500
trigger2 = root,anim = 1100
trigger2 = root,time > 3
trigger3 = root,anim = 3011
trigger3 = root,time > 40
trigger4 = root,anim = 400
trigger4 = root,time > 3
trigger5 = root,anim = 105
trigger5 = root,time > 2 && root,time <= 20
value = 6999
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6000
trigger1 = root,anim = [0,4]
trigger2 = root,anim = 47
trigger3 = root,anim = 181 || root,anim = [170,175]
trigger4 = root,anim = 183
trigger5 = root,anim = 191 || root,anim = 194 || root,anim = [1910,1911]
trigger6 = root,anim = 1100
trigger6 = root,time <= 3
trigger7 = root,anim = 1110   
trigger8 = root,anim = 1111
trigger9 = root,anim = 3000
trigger9 = root,time <= 40
trigger10 = root,anim = 3011
trigger10 = root,time <= 40
trigger11 = root,anim = 3300 
trigger12 = root,anim = 195 || root,anim = [1950,1951]  
trigger13 = root,anim = 3310
trigger14 = root,anim = 3311
trigger15 = root,anim = 3312
trigger16 = root,anim = 3313 
trigger17 = root,anim = 120
trigger18 = root,anim = 130
trigger19 = root,anim = 140
trigger20 = root,anim = 150 
trigger21 = root,anim = 5300 || root,anim = 5500
value = 6000
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6010
trigger1 = root,anim = 10 
trigger2 = root,anim = 12
trigger3 = root,anim = 40
trigger4 = root,stateno = 410
trigger4 = root,time <= 4 
trigger5 = root,anim = 3001
trigger5 = root,time <= 3 || root,time > 23 
trigger6 = root,anim = 3000
trigger6 = root,time > 40
trigger6 = root,time <= 44
trigger7 = root,anim = 411
trigger8 = root,anim = 105
trigger8 = root,time <= 2 || root,time >= 21
value = 6010
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6011
trigger1 = root,anim = 11 
trigger2 = root,anim = 3001
trigger2 = root,time > 3 && root,time <= 23 
trigger3 = root,anim = 121
trigger4 = root,anim = 131
trigger5 = root,anim = 141
trigger6 = root,anim = 151
trigger7 = root,anim = 400
trigger7 = root,time < 4  
value = 6011
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6020
trigger1 = root,anim = 20    
value = 6020
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6021
trigger1 = root,anim = 21    
value = 6021
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6040
trigger1 = root,anim = 41
trigger2 = root,anim = 42 
trigger3 = root,anim = 1920
trigger3 = root,time <= 15   
value = 6040
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6041
trigger1 = root,anim = 44
trigger2 = root,anim = 45 
trigger3 = root,anim = 1920
trigger3 = root,time > 15    
value = 6041
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6042
trigger1 = root,anim = 43   
value = 6042
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6043
trigger1 = root,anim = 46    
value = 6043
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6045
trigger1 = root,anim = 122
trigger2 = root,anim = 132
trigger3 = root,anim = 142
trigger4 = root,anim = 152    
value = 6045
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6100
trigger1 = root,anim = 100         
value = 6100
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6101
trigger1 = root,anim = 101         
value = 6101
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6110
trigger1 = root,anim = 110
trigger2 = root,anim = 111           
value = 6110
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6115
trigger1 = root,anim = 115
trigger2 = root,anim = 116           
value = 6115
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6240
trigger1 = root,anim = 240
trigger2 = root,anim = 241
trigger3 = root,anim = 3010         
value = 6240
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6555
trigger1 = root,anim = 198   
value = 6555
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6410
trigger1 = root,stateno = 410
trigger1 = root,time > 4  
trigger2 = root,stateno = 630  
trigger3 = root,anim = 3000
trigger3 = root,time > 44
value = 6410
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6640
trigger1 = root,anim = 640         
value = 6640
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 6520
trigger1 = root,anim = 5120         
value = 6520
ignorehitpause = 1

;---------------------------------------------------------------------------
; Air get-hit (shaking)
[Statedef 1115020]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 1115030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; Air get-hit (knocked away)
[Statedef 1115030]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5030, 1]
type = ChangeAnim
trigger1 = Anim != [5000, 5199]
trigger1 = SelfAnimExist(5030)
value = 5030

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

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

[State 5030, 4]
type = SelfState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 5040 ;HITA_RECOV

[State 5030, 5]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 1115050 ;HITA_FALL

[State 5030, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 1115035 ;Air get-hit (transition)

;---------------------------------------------------------------------------
; Air get-hit (transition)
[Statedef 1115035]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

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

[State 5035, 3]
type = SelfState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= Const(movement.air.gethit.groundlevel)
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5040 ;Air get-hit (recovering in air, not falling)

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= Const(movement.air.gethit.groundlevel)
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 1115050 ;Air get-hit (falling)

;---------------------------------------------------------------------------
; Air get-hit (falling)
[Statedef 1115050]
type    = A
movetype= H
physics = N

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, Const720p(4), Const720p(-8))
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, Const(movement.air.gethit.groundlevel))
value = 1115100 ;Downed get-hit (hit ground from fall)

;---------------------------------------------------------------------------
; Downed get-hit (hit ground from fall)
[Statedef 1115100]
type    = L
movetype= H
physics = N

[State 5100, 2004.04.14 behavior]
type = null;VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x < -1
x = -1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 1115110 ;Downed get-hit (lying down)

[State 5100, 8]
type = Explod
trigger1 = Time = 1
anim = F(60 + (sysvar(1) > Const720p(7)) + (sysvar(1) > Const720p(44)))
pos = 0, 0
sprpriority = ifelse (sysvar(1) <= Const720p(44), -10, 10)

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7,(sysvar(1) > Const720p(7)) + (sysvar(1) > Const720p(44))

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 1115101 ;Downed get-hit (bounce off ground)

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; Downed get-hit (bounce off ground)
[Statedef 1115101]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = Const(movement.down.bounce.offset.y)

[State 5101, 5]
type = PosAdd
trigger1 = Time = 0
x = Const(movement.down.bounce.offset.x)

[State 5101, 6] ;Acceleration
type = VelAdd
trigger1 = 1
y = Const(movement.down.bounce.yaccel)

[State 5101, 7] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= Const(movement.down.bounce.groundlevel)
type = ChangeState
value = 1115110

;---------------------------------------------------------------------------
; Downed get-hit (lying down)
[Statedef 1115110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56))

[State 5110, 7]
type = Explod
trigger1 = Time = 0
trigger1 = !SysVar(0)
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = SelfState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14] ;Friction
type = VelSet
trigger1 = abs(Vel x) < Const(movement.down.friction.threshold)
persistent = 0
x = 0

[State 5110, 15]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 16]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

[State 0, SelfState]
type = SelfState
trigger1 = time >= 20
;trigger1 = time >= const(data.liedown.time)
value = 5120

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

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

[statedef -2]

;---------------------------------------------------------------------------
;Tail Code
;---------------------------------------------------------------------------

[State 0, Tail]
type = Helper
trigger1 = !numhelper(6000)
name = "Tail"
ID = 6000
stateno = 6000
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

;---------------------------------------------------------------------------
;AI code
;---------------------------------------------------------------------------

[State -1, AI ON]  ; Turn the AI on when
Type = VarSet
TriggerAll = Var(59) < 1 ; it is not on yet and
TriggerAll = RoundState=2 ; the fight has started and is not over yet and
Trigger1 = AILevel>0 ; the computer is playing the character
v = 59
value= 1 ; value of 1 will mean the AI is on
Ignorehitpause=1

[State -1, AI OFF] ; Turn the AI off when
Type=VarSet
Triggerall=var(59)>0  ; it is on and
Trigger1=RoundState!=2  ; the round is not started yet or is already over or
Trigger2=AILevel=0  ; the computer is not in control
v=59
value=0 ; value of 0 will mean the AI is off. values other than 0 and 1 are not used in this example, we have only one AI mode, the normal one.
Ignorehitpause=1

[State -1, AI go easeh on meh!]
Type=VarSet
Trigger1=1
var(50)=(AILevel=1)*6+(AILevel=2)*12+(AILevel=3)*32+(AILevel=4)*64+(AILevel=5)*90+(AILevel=6)*128+(AILevel=7)*200+(AILevel=8)*300

;---------------------------------------------------------------------------
;Food code(for garfield)
;---------------------------------------------------------------------------

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
trigger1 = p2name = "Garfield" || p3name = "Garfield" || p4name = "Garfield"
trigger1 = Enemy,AuthorName = "Veanko"
trigger1 = stateno = [1020,1022]
trigger1 = anim = 64980
value = S7,2
volumescale = 250
channel = 0

;---------------------------------------------------------------------------
;Confusion code
;---------------------------------------------------------------------------

[State 0, Explod]
type = Explod
triggerall = numenemy
triggerall = !numexplod(1130)
trigger1 = enemy,name != "Butt-Head"
trigger1 = enemy,stateno = 1122
trigger1 = enemy,statetype = S
trigger1 = enemy,movetype = I
anim = 1131-enemy,facing
ID = 1130
pos = enemy,const(size.head.pos.x)+30,enemy,const(size.head.pos.y)-20
postype = p2  ;p2,front,back,left,right
facing = enemy,facing
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
ownpal = 1
removeongethit = 0
ontop = 1

[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(1130)
trigger1 = !numenemy
trigger2 = numenemy
trigger2 = enemy,stateno != 1122
id = 1130
ignorehitpause = 1


;---------------------------------------------------------------------------
;Bike code
;---------------------------------------------------------------------------

[State -2, Life Holder];special thanks to Jesuszilla
type = VarSet
trigger1 = 1
fvar(8) = Life
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = stateno = [45000,45030]
var(17) = GetHitvar(damage)

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [-0.4,0.4]
var(15) = 0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [0.5,0.9] 
trigger2 = vel x = [-0.9,-0.4]
var(15) = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1,1.4]
trigger2 = vel x = [-1.4,-1]
var(15) = 2
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1.5,1.9]
trigger2 = vel x = [-1.9,-1.5]
var(15) = 3
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2,2.4]
trigger2 = vel x = [-2.4,-2]
var(15) = 4
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2.5,2.9]
trigger2 = vel x = [-2.9,-2.5]
var(15) = 5
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3,3.4]
trigger2 = vel x = [-3.4,-3]
var(15) = 6
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3.5,3.9]
trigger2 = vel x = [-3.9,-3.4]
var(15) = 7
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4,4.4]
trigger2 = vel x = [-4.4,-4]
var(15) = 8
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4.5,4.9]
trigger2 = vel x = [-4.9,-4.4]
var(15) = 9
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5,5.4]
trigger2 = vel x = [-5.4,-5]
var(15) = 10
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5.5,5.9]
trigger2 = vel x = [-5.9,-5.5]
var(15) = 11
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6,6.4]
trigger2 = vel x = [-6.4,-6]
var(15) = 12
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6.5,6.9]
trigger2 = vel x = [-6.9,-6.5]
var(15) = 13
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7,7.4]
trigger2 = vel x = [-7.4,-7]
var(15) = 14
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7.5,7.9]
trigger2 = vel x = [-7.9,-7.5]
var(15) = 15
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8,8.4]
trigger2 = vel x = [-8.4,-8]
var(15) = 16
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8.5,8.9]
trigger2 = vel x = [-8.9,-8.5]
var(15) = 17
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x >= 9
trigger2 = vel x <= -9
var(15) = 18
ignorehitpause = 1

;---------------------------------------------------------------------------
;System code
;---------------------------------------------------------------------------


[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(0)=0
ignorehitpause=1

[State -2]
Type=VarSet
triggerall = stateno != 410 && stateno != 412 && stateno != 630 && stateno != 632
triggerall = movetype != A
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(1)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(2)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(3)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(4)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,132]
Trigger3=P2StateType!=A
Trigger3=P2MoveType!=H && enemynear,stateno != 3122
trigger4 = enemynear,name = "Duck Hunt"
var(7)=0
ignorehitpause=1


[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) <= 0
value = 1
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 1
value = 0.95
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 2
value = 0.9
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 3
value = 0.85
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 4
value = 0.8
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 5
value = 0.75
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 6
value = 0.7
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 7
value = 0.65
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 8
value = 0.6
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 9
value = 0.55
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 10
value = 0.5
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 11
value = 0.45
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 12
value = 0.40
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 13
value = 0.35
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 14
value = 0.30
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 15
value = 0.25
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 16
value = 0.20
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 17
value = 0.15
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) = 18
value = 0.10
ignorehitpause = 1

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = var(2) >= 19
value = 0.05
ignorehitpause = 1

[State -2,Afterimage]
type = Afterimage
trigger1 = stateno != 412
trigger1 = stateno != 632
time = 0

[State -2, 2a]
type = PlaySnd
triggerall = alive
triggerall = Random < 500
trigger1 = (stateno = 5000) || (stateno = 5010) || (stateno = 5020) || (stateno = 5070) || (stateno = 45000)
trigger1 = time = 0
trigger2 = (stateno != 5000) && (stateno != 5010) && (stateno != 5020) && (stateno != 5070) && (stateno != 45000)
trigger2 = stateno != [120,160]
trigger2 = gethitvar(damage)
value = 5000, 0+random%4
channel = 0
Volumescale = 125

[State -2, 2a]
type = PlaySnd
triggerall = alive
triggerall = Random < 500
trigger1 = stateno = 5120
trigger1 = time = 1
value = 5120, 0+random%11
channel = 0
Volumescale = 150

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1 
text = "Damage = %d P2bodydist x = %d, pos x= %d"
params = var(2),p2bodydist x, pos x
ignorehitpause = 1
[State -2, Hit Detection]
type = VarSet
trigger1 = MoveContact = 1 && var(30) < 0
var(30) = HitPauseTime
ignoreHitPause = 1

;hit spaarks and shieet
[State -2, Hit Sparks]
type = Helper
triggerAll = MoveContact = 1 && var(30) = HitPauseTime
trigger1 = MoveHit = 1 && NumEnemy
trigger1 = var(33) = 8010 || var(33) = 8011 || var(33) = 8012 || var(33) = 8013 || var(33) = 8014
trigger2 = MoveGuarded = 1 && NumEnemy
trigger2 = var(34) = 8000 || var(34) = 8001
trigger3 = MoveHit = 1 && NumEnemy
trigger3 = var(33) = 8015 || var(33) = 8016 || var(33) = 8017;slash fx
trigger4 = MoveHit = 1 && NumEnemy
trigger4 = Var(33) = 1008 ;waiter there's a hitspark in my sushi
helperType = Normal
stateNo = ifElse(MoveGuarded, var(34), var(33))
ID = 8000
name = "Spark"
postype = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < var(35), ceil(P2Dist x), var(35))), var(36)
facing = -1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1
size.xscale = 0.75
size.yscale = 0.75

[State -2, Hit Detection]
type = VarSet
trigger1 = 1
var(30) = -1
;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]


[state -3]
type = removeexplod
trigger1 = time = 1 && stateno != 1025
ID = 1567
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && stateno != 1030
ID = 1568
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && stateno != 1069
ID = 1588
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && stateno != 3007
ID = 1569
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && stateno != 3017
ID = 1570
ignorehitpause = 1

[State -3, Level 1 Super AfterImage]
type = AfterImage
trigger1 = StateNo = 3000 && Time = 52
trigger2 = stateno = 3006 && Time = 1
trigger3 = StateNo = 3010 && Time = 52
trigger4 = stateno = 3016 && Time = 1
time = 2
timeGap = 1
frameGap = 10
length = 21
palBright = 0,0,0
palContrast = 128,128,128
palPostBright = 0,0,0
palAdd = 0,0,0
palMul = 0.75,0.75,0.75
trans = Add1
ignorehitpause = 1

[State -3, Level 2 Super AfterImage]
type = null
trigger1 = StateNo = 3010 && Time = 52
trigger2 = stateno = 3016 && Time = 1
time = 2
timeGap = 1
frameGap = 10
length = 21
palBright = 0,0,0
palContrast = 32,32,160
palPostBright = 0,0,0
palAdd = 0,0,0
palMul = 0.75,0.75,0.75
trans = Add1
ignorehitpause = 1

[State -3, AfterImage Persist]
type = AfterImageTime
;trigger1 = StateNo = 50 || (StateNo = [600,699])
;trigger1 = (var(3) = 2 || var(3) = 3) && vel y < -1
;trigger2 = var(20)
;trigger3 = StateNo = [700,715]
trigger1 = StateNo = [3000,4999]
time = 2
ignorehitpause = 1
[State 0, PowerSet]
type = PowerSet
triggerall = power > 1000
trigger1 = stateno = [4000,4620]
trigger2 = stateno = [45000,45030]
value = 1000
ignorehitpause = 1

[State 50, 0]
type = PlaySnd
trigger1 = Time = 1
trigger1 = stateno = 50
value = 40,0
volumescale = 125

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
value = 52, 0
volumescale = 125
