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

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 14     ;Player width (back, ground)
ground.front = 14    ;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 = -2, -52   ;Approximate position of head
mid.pos = -1, -26    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 3.0     ;Walk forward
walk.back = -3.0     ;Walk backward
run.fwd  = 6.5, 0    ;Run forward (x, y)
run.back = -6.0,-3.8 ;Hop backward (x, y)
jump.neu = 0,-10.0    ;Neutral jumping velocity (x, y)
jump.back = -3.0    ;Jump back Speed (x, y)
jump.fwd = 3.0       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 5.5,-7      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

[Movement]
airjump.num = 0      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .44         ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching

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


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

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

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

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

[State 0, 1]
type = changeanim
triggerall = anim != 2 && 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 = 2

[State 0, 1]
type = changeanim
triggerall = anim = 2
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 = 3

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

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

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

; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 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 = "holdforward"
trigger2 = var(59)
trigger2 = p2bodydist x > 10
sysvar(1) = 1

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

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

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

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

; Jump Up
[Statedef 50]
type    = A
physics = A

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

[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 > Const720p(-8)
trigger1 = SelfAnimExist(anim + 3)
trigger1 = anim >= 41 && anim <= 43
persistent = 0
value = Anim + 3

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

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

[state 1000]
type = playsnd
trigger1 = animelem = 4
trigger2 = animelem = 9
value = S100,0
volumescale = 125

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
pos = 0,0
value = 120
ignorehitpause = 1

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

[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 != "holdforward"
trigger1 = !var(59)
trigger2 = p2bodydist X <= 24 || p2movetype = A
trigger2 = var(59)
value = 101

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

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
trigger2 = time = 2
trigger3 = time = 4
trigger4 = time = 6
pos = 0,0
value = 120
ignorehitpause = 1

[state 101,0]
type = playsnd
trigger1 = time = 0
value = S101,0
volumescale = 125

[state 1000]
type = veladd
trigger1 = time = 0
x = 1.7

[State 200, 1]
type = NULL
trigger1 = animelem = 2
trigger2 = animelem = 4
attr = S, NA
damage = 15,0
getpower = 36,36
givepower = 36,36
animtype = Light
guardflag = M
hitflag = MAF
pausetime = 3, 3
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2.5,0
air.velocity = -1.5,-1.5
air.type = low
air.hittime = 15
yaccel = 0.5
ID = 101

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

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

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

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
pos = 0,0
value = 120
ignorehitpause = 1

[state 1000]
type = nothitby
trigger1 = time = 0
time = 12
value = SCA
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 2
value = 100,0
volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 2
value = 200,2
volumescale = 125

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

[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

;Wall Code taken from Veanko's Carol

; 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 1000]
type = gameMakeAnim
trigger1 = timemod = 5,0
pos = -15,-10
value = 120
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 = "holdforward"
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 = "holdforward"
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 = 50,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 = "holdbackward"
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 = "holdforward"
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 = 50,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 != "holdbackward"
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 != "holdbackward"
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 != "holdbackward"
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 = "holdbackward" || (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 != "holdbackward"
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 = "holdbackward" || 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 = 1
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 1000]
type = playsnd
trigger1 = animelem = 3
value = S0,4
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 3
value = S1000,0+random%2
volumescale = 125

[state 1000]
type = varadd
trigger1 = movehit
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20) <= 1
attr = S, SA
damage = 106,6
getpower = 0,0
givepower = 32,16
animtype = Hard
guardflag = 
hitflag = MAF
priority = 7, Hit
pausetime = 12, 12
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-30
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-8
ground.cornerpush.veloff = -15
air.cornerpush.veloff = -15
guard.cornerpush.veloff = -15
air.type = Low
air.velocity = -5,-8
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
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

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

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

;---------------------------------------------------------------------------
; Win pose 1 - Empty
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[state 1000]
type = playsnd
trigger1 = !time
;trigger1 = life < 800
value = S180,0;+random%3
volumescale = 125

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

;---------------------------------------------------------------------------
;Intro Decider
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

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

[State 190, 1]
type = ChangeState
trigger1 = PalNo = 3
value = 192

[State 0, ChangeState]
type = changestate
trigger1 = p2name = "FP2 Carol Tea"
value = 193
ctrl = 0

[State 0, ChangeState]
type = changestate
trigger1 = p2name = "FP2 Sash Lilac"
value = 194
ctrl = 0

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

; Introduction - Enable
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 1000]
type = playsnd
trigger1 = animelem = 2
value = S40,0
volumescale = 125

[State -3, Pause]
type = Helper
trigger1 = time = 0
helpertype = normal 
name = "Pounce"
stateno = 1911
pos = -180,0
postype = p1
facing = 1
keyctrl = 1
ownpal = 1
pausemovetime = 9999
ignorehitpause = 1

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

; Introduction - Enable
[Statedef 192]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 1000]
type = playsnd
trigger1 = animelem = 13
value = S3,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 14
value = S0,3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 14
value = S180,1
volumescale = 125

[State -3, Pause]
type = Helper
trigger1 = time = 0
helpertype = normal 
name = "Box"
stateno = 1922
pos = 0,0
postype = p1
facing = 1
keyctrl = 1
ownpal = 1
pausemovetime = 9999
ignorehitpause = 1

[State -3, Pause]
type = Helper
trigger1 = animelem = 13
helpertype = normal 
name = "!"
stateno = 1944
pos = 0,0
postype = p1
facing = 1
keyctrl = 1
ownpal = 1
pausemovetime = 9999
ignorehitpause = 1

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

;Pounce in
[Statedef 1911]
type    = A
movetype= A
physics = N
anim = 900
sprpriority = 2
ctrl = 0

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

[state 1000]
type = veladd
trigger1 = 1
y = .3

[state 1000]
type = velset
trigger1 = time = 0
x = 6
y = -4

[State 1100, 5]
type = destroyself
trigger1 = Vel Y > 0 && Pos Y >= 0

;Box
[Statedef 1922]
type    = S
movetype= I
physics = S
anim = 1911
velset = 0,0
sprpriority = 2
ctrl = 0

[state 1000]
type = assertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 1000]
type = changestate
trigger1 = time = 112
value = 1923

;Box Flying in Air
[Statedef 1923]
type    = A
movetype= I
physics = N
anim = 1911
velset = 0,0
sprpriority = 2
ctrl = 0

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = velset
trigger1 = time = 0
y = -10
x = -1.5

[State 0, AngleAdd]
type = Angledraw
trigger1 = 1
value = Time * (-7)
ignorehitpause = 1
persistent = 1

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

;!
[Statedef 1944]
type    = S
movetype= I
physics = S
anim = 1912
velset = 0,0
sprpriority = 2
ctrl = 0

[state 1000]
type = velset
trigger1 = time = 0
y = -0.2

[state 1000]
type = trans
trigger1 = time > 10
trans = addalpha
alpha = 256 - 32 * (Time - 8), 32 * (Time - 8)
ignorehitpause = 1

[state 1000]
type = veladd
trigger1 = 1
y = -0.02

[state 1000]
type = assertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = animtime = 0

; Introduction - Mirror
[Statedef 193]
type = S
ctrl = 0
anim = 192
velset = 0,0

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

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

; Introduction - Another one
[Statedef 194]
type = S
ctrl = 0
anim = 193
velset = 0,0

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

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

;Look -Disabled-
[Statedef 195]
type = S
movetype = I
physics = S
sprpriority = 0
poweradd = 0
anim = 195
ctrl = 0

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------

;Weak Claw
[Statedef 200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 0                     
velset = 0,0                     
ctrl = 0                        
anim = 200                   
poweradd = 0                   
sprpriority = 2

[State 200, 2]
type = playsnd
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
volumescale = 125

[state 1000]
type = null
trigger1 = prevstateno = 400 && time = 0
x = 4.0

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = M
hitflag = MAF
pausetime = 7, 7
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-42
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -2.0
air.type = low
air.velocity = -2.0,-2
air.hittime = 15
yaccel = 0.5
ID = 200

[State 0, ChangeState]
type = changestate
triggerall = movehit
trigger1 = command = "DF_x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 430
ctrl = 0

[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 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, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Medium Claw
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[state 1000]
type = velset
trigger1 = time = 0
x = 2.5

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
getpower = 72,36
givepower = 36,36
animtype = Medium
guardflag = M
hitflag = MAF
pausetime = 7, 7
sparkNo = 1
guard.sparkNo = 40
sparkXY = -8,-45
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -2.0,0
air.type = low
air.velocity = -2.0,-3
air.hittime = 25
Air.fall = 0
fall.recover = 0
yaccel = 0.4
ID = 210

[State 0, ChangeState]
type = changestate
triggerall = movehit
trigger1 = command = "DF_x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 430
ctrl = 0

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

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

[State 0, ChangeState]
type = null
triggerall = !var(59)
triggerall = movecontact
triggerall = power > 850
trigger1 = command = "y"
trigger1 = command = "holdup"
value = 1023
ctrl = 0

[State 0, ChangeState]
type = null
triggerall = movecontact
triggerall = power > 850
trigger1 = command = "y"
trigger1 = command != "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 1020
ctrl = 0

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

;Strong Claw
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[state 1000]
type = velset
trigger1 = time = 0
x = 2.5

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 72,36
givepower = 36,36
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4, hit
pausetime = 10, 10
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-38
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 18
ground.velocity = -5.5,0
air.type = low
air.velocity = -5.5,-2.5
air.hittime = 25
yaccel = 0.5
ID = 230

[State 0, ChangeState]
type = changestate
triggerall = movehit
trigger1 = command = "DF_x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 430
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = random<var(50)*2.0
value = 1000
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = random<var(50)*2.0
value = 1019
ctrl = 0

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

;Dodge
[Statedef 250]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 250
sprpriority = -1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 250
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
removetime = 12
bindtime = -1
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

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

[State 700, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AT
time = 1

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

;Boom!
[Statedef 255]
type    = A
movetype= H
physics = N
velset = 0,0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[state 1000]
type = envshake
trigger1 = time = 0
time = 10

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

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

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

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

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

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
;Forward Dodge
[StateDef 260]
type = S
physics = N
moveType = I
anim = 260
ctrl = 0
velSet = 0,0
sprPriority = -1

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

[State 710, HitBy]
type = HitBy
trigger1 = AnimElemTime(7)<0
value = SCA,AT
time = 1

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 1
x = 5.0

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 8
x = 1.5

;[State 710, End Roll]
;type = VelSet
;trigger1 = AnimElem = 9
;x = 0

[State 1120, Blink]
type = PalFX
trigger1 = anim = 260
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
bindtime = -1
removetime = 12
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

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

;Backward Dodge
[StateDef 261]
type = S
physics = N
moveType = I
anim = 261
ctrl = 0
velSet = 0,0
sprPriority = -1

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

[State 710, HitBy]
type = HitBy
trigger1 = AnimElemTime(7)<0
value = SCA,AT
time = 1

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 1
x = -5

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 8
x = -1.5

[State 1120, Blink]
type = PalFX
trigger1 = anim = 261
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
bindtime = -1
removetime = 12
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

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

;Crouch Dodge
[Statedef 270]
type    = C
movetype= I
physics = C
juggle  = 0
velset = 0,0
ctrl = 0
anim = 14
sprpriority = -1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 14
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[State 710, Start Roll]
type = VelSet
trigger1 = 1
x = 5

[State 710, Start Roll]
type = VelSet
trigger1 = animelem = 9
x = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,30
postype = p1
removetime = 12
bindtime = -1
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

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

[State 700, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AT
time = 1

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

;Crouch Dodge
[Statedef 275]
type    = C
movetype= I
physics = C
juggle  = 0
velset = 0,0
ctrl = 0
anim = 16
sprpriority = -1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 16
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[State 710, Start Roll]
type = VelSet
trigger1 = 1
x = -5

[State 710, Start Roll]
type = VelSet
trigger1 = animelem = 9
x = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,30
postype = p1
removetime = 12
bindtime = -1
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

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

[State 700, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AT
time = 1

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

;Crouch Weak Claw
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 0
poweradd= 0
ctrl = 0
anim = 400
sprpriority = 2

[State 400, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[state 1000]
type = varadd
trigger1 = movehit
trigger1 = numtarget(400)
trigger1 = target(400),time = 0
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20)<=1
attr = C, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = L
hitflag = MAFD
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -15,-30
hitsound = 5,0
guardsound = 6,0
ground.type = low
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -2
air.type = low
air.velocity = -2,-4
air.hittime = 15
down.velocity = -1,-6
down.hittime = 20
yaccel = 0.42
ID = 400

[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 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 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;Running Spindash
[Statedef 420]
type    = C
movetype= A
physics = C
poweradd= 18
Juggle = 0
ctrl = 0
anim = 431
velset = 14,0
sprpriority = 2

[state 1000]
type = veladd
trigger1 = time > 0
x = 0.3

[State 400, 1]
type = PlaySnd
trigger1 = animelem = 1
value = S1,0
volumescale = 125

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
pos = 0,0
value = 120
ignorehitpause = 1

[State 200, 2]
type = playsnd
trigger1 = animelem = 1
value = S1000,0 +random%2
volumescale = 125

[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 1000]
type = varadd
trigger1 = movehit
trigger1 = numtarget(401)
trigger1 = target(401),time = 0
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20)<=1
attr = C, NA
damage = ceil(ifElse(fvar(11) * 47 < 20, 20, fvar(11) * 47)), 5
priority = 4
getpower = 72,36
givepower = 36,36
animtype  = Hard
hitflag = MAFD
guardflag = L
pausetime = 10,10
sparkno = 1
sparkxy = -5,-18
hitsound   = 5,1
guardsound = 6,0
guard.sparkno = 40
ground.type = low
air.type = low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3,-4
air.velocity = -3,-4
fall = 1
fall.recover = 0
ID = 401

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

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

[State 400, 1]
type = PlaySnd
trigger1 = time = 5
value = S1,0
volumescale = 125

[state 1000]
type = gameMakeAnim
trigger1 = time = 5
pos = 0,0
value = 120
ignorehitpause = 1

[State 200, 2]
type = playsnd
trigger1 = time = 5
value = S1000,0 +random%2
volumescale = 125

[state 1000]
type = velset
trigger1 = time = 5
x = 16

[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 1000]
type = varadd
trigger1 = movehit
trigger1 = numtarget(430)
trigger1 = target(430),time = 0
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20)<=1
attr = C, NA
damage = ceil(ifElse(fvar(11) * 47 < 20, 20, fvar(11) * 47)), 5
priority = 4
getpower = 72,36
givepower = 36,36
animtype  = Hard
hitflag = MAFD
guardflag = L
pausetime = 10,10
sparkno = 1
sparkxy = -5,-18
hitsound   = 5,1
guardsound = 6,0
guard.sparkno = 40
ground.type = low
air.type = low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3,-4
air.velocity = -3,-4
fall = 1
fall.recover = 0
ID = 430

[state 1000]
type = changestate
trigger1 = time >= 23
value = 431
ctrl = 0

;Get up
[Statedef 431]
type    = C
movetype= I
physics = C
juggle  = 0
poweradd= 0
ctrl = 0
anim = 12
sprpriority = 2

[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

;Get up
[Statedef 432]
type    = C
movetype= I
physics = C
juggle  = 0
poweradd= 0
ctrl = 0
anim = 1014
sprpriority = 2

[state 1000]
type = playsnd
trigger1 = time = 0
value = S40,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

;Air Weak Claw
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 11
ctrl = 0
anim = 200
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = anim = 200
trigger1 = animelem = 2
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 200
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 200
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,36
givepower = 36,36
animtype = light
guardflag = HA
hitflag = MAF
pausetime = 7, 7
sparkNo = 0
guard.sparkNo = 40
sparkXY = -15,-45
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2
air.type = low
air.velocity = -1.5,-2
air.hittime = 25
fall = 0
fall.recover = 0
;yaccel = 0.8

[state 1000]
type = changeanim
trigger1 = anim = 200
trigger1 = animtime = 0
value = 635

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

;Air Medium Claw
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 11
ctrl = 0
anim = 210
sprpriority = 2
velset = 2,-2

[State 600, 1]
type = PlaySnd
trigger1 = anim = 210
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 210
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 210
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
getpower = 72,36
givepower = 36,36
animtype = medium
guardflag = HA
hitflag = MAF
pausetime = 7, 7
sparkNo = 1
guard.sparkNo = 40
sparkXY = -8,-45
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3
air.type = low
air.velocity = -3.0,-2
air.hittime = 25
fall = 0
fall.recover = 0
;yaccel = 0.8
ID = 610

[state 1000]
type = changeanim
trigger1 = anim = 210
trigger1 = animelem = 5
value = 635

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

;Air Strong Claw
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 11
ctrl = 0
anim = 230
sprpriority = 2
velset = 2,-2

[State 600, 1]
type = PlaySnd
trigger1 = anim = 230
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 230
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 230
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 72,36
givepower = 36,36
animtype = hard
guardflag = HA
hitflag = MAF
pausetime = 10, 10
sparkNo = 1
guard.sparkNo = 40
sparkXY = -15,-38
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-5
air.type = low
air.velocity = -2.5,-4
air.hittime = 25
fall = 1
fall.recover = 1
air.fall = 1
;yaccel = 0.4
ID = 620
;envshake.time = 10

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = var(59)
trigger1 = random<var(50)*2.0
value = 1005
ctrl = 0

[state 1000]
type = changeanim
trigger1 = anim = 230
trigger1 = animtime = 0
value = 635

;Falling State
[Statedef 635]
type    = A
movetype= A
physics = N
juggle  = 1
poweradd= 0
ctrl = 0
anim = 635
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Air Dodge
[Statedef 650]
type    = A
movetype= I
physics = N
juggle  = 0
ctrl = 0
anim = 650
sprpriority = -1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 650
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
removetime = 12
bindtime = -1
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

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

[State 700, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AT
time = 1

[State 700, Attack]
type = Changeanim
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Throw attack - Ech
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[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          ;No spark
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
guardflag = 

[state 1000]
type = stateTypeSet
trigger1 = animelemtime(3) >= 0
movetype = I

[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 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Throw attack - Ech
[Statedef 801]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[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          ;No spark
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 = 815       ;On success, KFM changes to state 810
p2stateno = 830       ;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 = 830
guardflag = 

[state 1000]
type = stateTypeSet
trigger1 = animelemtime(3) >= 0
movetype = I

[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 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 0

[state 1000]
type = varadd
trigger1 = time = 0
var(20) = 1
ignorehitpause = 1

[State 0, Turn]
type = null;Turn
trigger1 = command = "holdbackward"
trigger1 = time = 0

[State 0, TargetState]
type = null;TargetState
trigger1 = command = "holdbackward"
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 = S9, 0
volumescale = 200

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

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = F5,2

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

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

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

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

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 4
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

[Statedef 815]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 0

[state 1000]
type = varadd
trigger1 = time = 0
var(20) = 1
ignorehitpause = 1

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

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 830
ID = 830

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

[State 810, Grab Sound]
type = PlaySnd
trigger1 = time = 0
value = S9, 0
volumescale = 200

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

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = F5,2

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

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

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

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

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 4
value = 831

[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 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 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 = -5,-8

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[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 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

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

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

[Statedef 830]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

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

[Statedef 831]
type    = A
movetype= H
physics = N
velset = 5,-8

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

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[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

;Pounce Part 1
[Statedef 900]
type    = C
movetype= I
physics = C
poweradd= 0
ctrl = 0
anim = 900
velset = 0,0
sprpriority = 2

[state 1000]
type = changestate
trigger1 = animelem = 2
value = 901
ctrl = 0

;Pounce Part 2
[Statedef 901]
type    = A
movetype= I
physics = N
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

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

[state 1000]
type = playsnd
trigger1 = time = 0
value = S1000,0+random%2
volumescale = 125

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

[state 1000]
type = veladd
trigger1 = 1
y = .4

[state 1000]
type = velset
trigger1 = time = 0
x = 6
y = -5

[State 1100, 5]
type = ChangeState
triggerall = time >= 9
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = p2bodydist x <= 50
trigger2 = p2bodydist Y = [-44,88]
trigger2 = random<var(50)*2.0
value = 1001
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 432
ctrl = 1

;Normal Pounce
[Statedef 902]
type    = A
movetype= I
physics = N
poweradd= 0
ctrl = 0
velset = 0,0
anim = 901
sprpriority = 2

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

[state 1000]
type = playsnd
trigger1 = time = 0
value = S1000,0+random%2
volumescale = 125

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

[state 1000]
type = veladd
trigger1 = 1
y = .4

[state 1000]
type = velset
trigger1 = time = 0
x = 6
y = -5

[State 1100, 5]
type = ChangeState
triggerall = time >= 9
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = p2bodydist x <= 50
trigger2 = p2bodydist Y = [-44,88]
trigger2 = random<var(50)*2.0
value = 1001
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 432
ctrl = 1

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

[state 1000]
type = playsnd
trigger1 = animelem = 3
value = S0,4
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 3
value = S1000,0+random%2
volumescale = 125

[state 1000]
type = velset
triggerall = time = 0
trigger1 = prevstateno = 200 || prevstateno = 210 || prevstateno = 230
x = 6.0

[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, 1]
type = HitDef
triggerall = !var(3)
trigger1 = time = 0
attr = S, SA
damage = ceil(ifElse(fvar(11) * 90 < 30, 30, fvar(11) * 90)), 5
animtype = hard
getpower = 36,18
givepower = 18,18
guardflag = MAF
hitflag = MAF
pausetime = 12, 12
guard.pausetime = 8,8
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-30
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
guard.hittime = 10
ground.hittime  = 20
ground.velocity = -1,-12
air.type = high
air.velocity = -1,-12
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1000
envshake.time = 12

[State 200, 1]
type = HitDef
triggerall = var(3)
trigger1 = time = 0
attr = S, SA
damage = ceil(ifElse(fvar(11) * 90 < 30, 30, fvar(11) * 90)), 5
animtype = hard
getpower = 36,18
givepower = 18,18
guardflag = MAF
hitflag = MAF
pausetime = 12, 12
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-30
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
guard.hittime = 10
ground.velocity = -1,12.0
air.type = high
air.velocity = -1,12.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1000
envshake.time = 12

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

[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 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;Air Wild Claw (only for pounce)
[Statedef 1001]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
;velset = 0,0
anim = 1000
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = .5

[state 1000]
type = playsnd
triggerall = anim = 1000
trigger1 = animelem = 3
value = S0,4
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1000
trigger1 = animelem = 3
value = S1000,0+random%2
volumescale = 125

[State 200, 1]
type = HitDef
triggerall = anim = 1000
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 90 < 30, 30, fvar(11) * 90)), 5
animtype = hard
getpower = 36,18
givepower = 18,18
guardflag = MAF
hitflag = MAF
pausetime = 12, 12
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-30
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -1,12.0
guard.ctrltime = 10
air.type = high
air.velocity = -1,12.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1000
envshake.time = 12

[state 1000]
type = changeanim
trigger1 = anim = 1000
trigger1 = animelem = 7
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1016
ctrl = 0

;Genocide Cat-ur Part 1
[Statedef 1005]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1005
sprpriority = 2

[state 1000]
type = playsnd
trigger1 = time = 3
value = 200,0+random%3
volumescale = 125

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

[state 1000]
type = changestate
trigger1 = animelem = 2
value = 1006
ctrl = 0

;Genocide Cat-ur part 2
[Statedef 1006]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 72
velset = 1.5,-6.0
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = 0.42

[State 200, 1]
type = HitDef
trigger1 = anim = 1005
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 60 < 25, 25, fvar(11) * 60)), 5
animtype = diagup
getpower = 36,18
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 10, 10
sparkNo = 1
guard.sparkNo = 40
sparkXY = -12,-70
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.5,-8.0
air.type = low
air.velocity = -2.5,-8.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.6
ID = 1006

[state 1000]
type = changeanim
trigger1 = anim = 1005
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = movecontact && time > 10
trigger1 = command = "QCB_x"
value = 1015
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact && time > 10
trigger1 = var(59)
trigger1 = random<var(50)*2.0
value = 1015
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1016
ctrl = 0

; Jump Land from dive kick
[Statedef 1012]
type    = S
physics = S
ctrl = 0
anim = 1012

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

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

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

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

[State 0, ChangeState]
type = changestate
triggerall = !var(59)
triggerall = time > 2
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 400
ctrl = 0

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

; Jump Land from dive kick
[Statedef 1014]
type    = S
physics = S
ctrl = 0
anim = 1014

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

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

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

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

[state 1000]
type = nothitby
trigger1 = time = 0
time = 0
value = SCA
ignorehitpause = 1

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

; Jump Land from dive kick
[Statedef 1016]
type    = S
physics = S
ctrl = 0
anim = 1014

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

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

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

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

[State 0, ChangeState]
type = null
triggerall = !var(59)
triggerall = time > 2
trigger1 = command = "x"
trigger1 = command = "holddown"
value = 400
ctrl = 0

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

;PAW!
[Statedef 1015]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 1025
velset = 2.5,-4.5
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = 0.42

[state 1000]
type = playsnd
triggerall = anim = 1025
trigger1 = animelem = 2
value = 200,0+random%3
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1025
trigger1 = animelem = 2
value = 0,3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 60 < 25, 25, fvar(11) * 60)), 5
getpower = 72,36
givepower = 36,36
animtype = hard
guardflag = M
hitflag = MAF
pausetime = 10, 10
sparkNo = 2
sparkXY = -10,-30
guard.sparkNo = 40
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -18,-4
air.type = low
air.velocity = -18,-4
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.6
ID = 1015
p2stateno = 255
p2facing = 1  
envshake.time = 10

[state 1000]
type = changeanim
trigger1 = anim = 1025
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1016
ctrl = 1

;Stay
[Statedef 1019]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 1010
velset = 0,0
sprpriority = 2

[state 1000]
type = changestate
trigger1 = animelem = 2
value = 1020
ctrl = 0

;Carol Kick Part 1
[Statedef 1020]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
velset = 4.8,-5.0
sprpriority = 2

[state 1000]
type = playsnd
triggerall = anim = 1010
trigger1 = animelem = 2
value = 200,0
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1010
trigger1 = animelem = 5
value = S0,5
volumescale = 150

[State 200, 1]
type = HitDef
trigger1 = anim = 1010
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 40 < 15, 15, fvar(11) * 40)), 0
getpower = 36,36
givepower = 36,36
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 7, 7
guard.sparkNo = 40
sparkNo = 1
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3,-6
air.type = low
air.velocity = -4,-4
air.hittime = 25
Air.fall = 1
fall = 0
fall.recover = 0
yaccel = 0.5
ID = 1020

[state 1000]
type = veladd
trigger1 = 1
y = 0.40

[state 1000]
type = changeanim
trigger1 = anim = 1010
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = movecontact && time >= 10
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 1021
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;Carol Kick Part 2
[Statedef 1021]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 1015
velset = 3.8,-4.0
sprpriority = 2

[state 1000]
type = playsnd
triggerall = anim = 1015
trigger1 = animelem = 2
value = 200,1
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1015
trigger1 = animelem = 2
value = S0,5
volumescale = 150

[State 200, 1]
type = HitDef
trigger1 = anim = 1015
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 40 < 15, 15, fvar(11) * 40)), 0
getpower = 36,36
givepower = 36,36
animtype = hard
guardflag = MA
hitflag = MAF
guard.sparkNo = 40
pausetime = 7, 7
sparkNo = 1
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3,-5
air.type = low
air.velocity = -4,-5.5
air.hittime = 25
Air.fall = 1
fall = 0
fall.recover = 0
yaccel = 0.5
ID = 1020

[state 1000]
type = veladd
trigger1 = 1
y = 0.40

[state 1000]
type = changeanim
trigger1 = anim = 1015
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = movecontact && time >= 10
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 1022
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;Carol Kick Part 3
[Statedef 1022]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 1020
velset = 3.8,-4.0
sprpriority = 2

[state 1000]
type = playsnd
triggerall = anim = 1020
trigger1 = animelem = 2
value = 200,2
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1020
trigger1 = animelem = 2
value = S0,5
volumescale = 150

[State 200, 1]
type = HitDef
trigger1 = anim = 1020
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 40 < 15, 15, fvar(11) * 40)), 0
getpower = 36,36
givepower = 36,36
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 7, 7
guard.sparkNo = 40
sparkNo = 1
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-4
air.type = low
air.velocity = -5,-4
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.5
ID = 1020

[state 1000]
type = veladd
trigger1 = 1
y = 0.40

[state 1000]
type = changeanim
trigger1 = anim = 1020
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = null
triggerall = movecontact && time > 10
trigger1 = command = "upper_x"
value = 1005
ctrl = 0

[State 0, ChangeState]
type = null
triggerall = movecontact && time > 10
trigger1 = command = "QCB_x"
value = 1015
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;Carol Kick (Air)
[Statedef 1023]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 1011
velset = 3.8,-4.0
sprpriority = 2

[state 1000]
type = playsnd
triggerall = anim = 1011
trigger1 = animelem = 2
value = 200,0
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1011
trigger1 = animelem = 4
value = S0,5
volumescale = 150

[State 200, 1]
type = HitDef
trigger1 = anim = 1011
trigger1 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 40 < 15, 15, fvar(11) * 40)), 0
getpower = 36,36
givepower = 36,36
animtype = hard
guardflag = MAF
hitflag = MAF
pausetime = 7, 7
guard.sparkNo = 40
sparkNo = 1
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3,-6
air.type = low
air.velocity = -3,-4
air.hittime = 25
Air.fall = 1
fall = 0
fall.recover = 1
yaccel = 0.5
ID = 1020

[state 1000]
type = veladd
trigger1 = 1
y = 0.40

[state 1000]
type = changeanim
trigger1 = anim = 1011
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = movecontact && time >= 10
trigger1 = command = "x"
value = 1021
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;Disc Throw
[Statedef 1500]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 1500
ctrl = 0
poweradd = -500
sprpriority = 2

[state 1000]
type = playsnd
trigger1 = animelem = 3
value = S1500,0+random%2
volumescale = 125

[State 0, Hair]
type = Helper
trigger1 = animelem = 3
name = "Disc"
helpertype = Normal
ID = 15003
stateno = 15003
pos = 15,-35
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;Disc Throw
[Statedef 1501]
type    = A
movetype= A
physics = N
juggle  = 0
anim = 1500
ctrl = 0
poweradd = -500
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = playsnd
triggerall = anim = 1500
trigger1 = animelem = 3
value = S1500,0+random%2
volumescale = 125

[State 0, Hair]
type = Helper
triggerall = anim = 1500
trigger1 = animelem = 3
name = "Disc"
helpertype = Normal
ID = 15003
stateno = 15003
pos = 15,-35
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = changeanim
triggerall = anim = 1500
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Cat Combo or whatever part 1
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3000
sprpriority = 2

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

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 16
add = 84,84,84
sinadd = 92,92,92,4

[state 1000]
type = explod
trigger1 = time = 0
anim = F100
pos = -3,-35
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 16
pausemovetime = 16

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 16
ignorehitpause = 1

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

[state 1000]
type = changestate
trigger1 = time = 16
value = 3002
ctrl = 0

;Cat Combo or whatever part 2 --Unused--
[Statedef 3001]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 1.5,-5.5
sprpriority = 2

[state 1000]
type = nothitby
trigger1 = time <= 8
value = SCA
time = 1
ignorehitpause = 1

[state 1000]
type = veladd
trigger1 = 1
y = 0.42

[State 200, 1]
type = HitDef
trigger1 = anim = 3000
trigger1 = time = 0
attr = A, HA
damage = 50, 0
animtype = diagup
getpower = 0,0
givepower = 18,18
guardflag = MA
hitflag = MAF
pausetime = 8, 8
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-60
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1.5,-5.0
air.type = low
air.velocity = -1.5,-5.0
air.hittime = 35
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.35
ID = 3001

[state 1000]
type = changeanim
trigger1 = anim = 3000
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
triggerall = anim = 3000
trigger1 = animelemtime(6) >= 0 && movehit
value = 3002
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Cat Combo or whatever part 3
[Statedef 3002]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 3001
velset = 0,0
sprpriority = 2

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

[state 1000]
type = nothitby
trigger1 = time <= 8
value = SCA
time = 1
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = time = 0
x = 4.8
y = -4

[state 1000]
type = veladd
trigger1 = 1
y = 0.18

[state 1000]
type = playsnd
triggerall = anim = 3001
trigger1 = animelem = 3
trigger2 = animelem = 8
trigger3 = animelem = 14
value = 200,0+random%3
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 3001
trigger1 = animelem = 3
trigger2 = animelem = 8
trigger3 = animelem = 14
value = S0,5
volumescale = 125

[State 200, 1]
type = HitDef
triggerall = anim = 3001
trigger1 = animelem = 4
trigger2 = animelem = 10
attr = A, HA
damage = 50, 0
getpower = 0,0
givepower = 36,36
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 8, 8
guard.sparkNo = 40
sparkNo = 2
sparkXY = -10,-35
hitsound = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4.0,-4
air.type = low
air.velocity = -2.5,-2.0
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.3
ID = 3002

[State 200, 1]
type = HitDef
triggerall = anim = 3001
trigger1 = animelem = 16
attr = A, HA
damage = 50, 0
getpower = 0,0
givepower = 36,36
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 10, 10
guard.sparkNo = 40
sparkNo = 2
sparkXY = -10,-35
hitsound = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -18,0
air.type = low
air.velocity = -4,-1.8
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.3
ID = 3002

[state 1000]
type = changeanim
trigger1 = anim = 3001
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
triggerall = animelemtime(20) >= 0 && movehit
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 3003
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Blast
[Statedef 3003]
type    = S
movetype= A
physics = S
juggle  = 0
ctrl = 0
anim = 3002
velset = 0,0
sprpriority = 2

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

[state 1000]
type = posset
trigger1 = time = 0
y = 0

[state 1000]
type = velset
trigger1 = time = 0
x = 15

[state 1000]
type = velset
trigger1 = movehit
x = 0

[state 1000]
type = playsnd
triggerall = anim = 3002
trigger1 = animelem = 2
value = 1000,0+random%2
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 3002
trigger1 = animelem = 2
value = S0,5
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, HA
damage = 50, 0
getpower = 0,0
givepower = 36,36
animtype = heavy
guardflag = MA
hitflag = MAF
pausetime = 20, 20
guard.sparkNo = 40
sparkNo = 2
sparkXY = -15,-20
hitsound = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,-7.5
air.type = low
air.velocity = -5,-7.5
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.65
ID = 3002
envshake.time = 15

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;Wild Mix part 1
[Statedef 3020]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3020
sprpriority = 2

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

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 16
add = 84,84,84
sinadd = 92,92,92,4

[state 1000]
type = explod
trigger1 = time = 0
anim = F100
pos = -3,-35
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 21
pausemovetime = 21

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 16
ignorehitpause = 1

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

[state 1000]
type = changestate
trigger1 = time = 16
value = 3021
ctrl = 0

;Wild Mix part 2
[Statedef 3021]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 2

[state 1000]
type = nothitby
trigger1 = time <= 8
value = SCA
time = 1
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = animelemtime(23) < 0
x = 3.3

[state 1000]
type = velset
trigger1 = animelem = 24
x = 1

[state 1000]
type = playsnd
trigger1 = animelem = 5
trigger2 = animelem = 12
trigger3 = animelem = 19
value = S0,5
volumescale = 150

[state 1000]
type = playsnd
trigger1 = animelem = 5
value = S200,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 12
value = S200,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 19
value = S200,2
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = animelem = 7
trigger2 = animelem = 9
trigger3 = animelem = 14
trigger4 = animelem = 16
trigger5 = animelem = 21
trigger6 = animelem = 23
attr = A, HA; - Take on me!
damage = 20, 2
animtype = medium
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 4, 4
sparkNo = 1
guard.sparkNo = 40
sparkXY = -15,-35
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
guard.ctrltime = 3
ground.velocity = -5.5,0
guard.velocity = -6.5
guard.cornerpush.veloff = -10
ground.cornerpush.veloff = -6
airguard.velocity = -4,-2.0
air.type = low
air.velocity = -2.5,-2.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 0
yaccel = 0.4
ID = 3000

[state 1000]
type = changestate
trigger1 = animelemtime(24) > 0
trigger1 = movehit
value = 3022
ctrl = 0

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;Wild Mix part 3
[Statedef 3022]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
anim = 3021
velset = 7,0
sprpriority = 2

[state 1000]
type = playsnd
trigger1 = animelem = 2
value = S0,5
volumescale = 150

[state 1000]
type = playsnd
trigger1 = animelem = 2
value = S1000,0
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, HA
damage = 20, 0
getpower = 0,0
givepower = 36,36
animtype = diagup
guardflag = MA
hitflag = MAF
pausetime = 10, 10
guard.sparkNo = 40
sparkNo = 2
sparkXY = -15,-20
hitsound = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -0.5,-8
air.type = low
air.velocity = -0.5,-8
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.40
ID = 3002
envshake.time = 10

[state 1000]
type = changestate
trigger1 = animelemtime(8) > 0
trigger1 = movehit
value = 3023
ctrl = 0

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;Wild Mix part 4
[Statedef 3023]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 5,0
anim = 3022
sprpriority = 2

[state 1000]
type = changestate
trigger1 = time = 4
value = 3024
ctrl = 0

;Wild Mix part 5
[Statedef 3024]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 1.0,-11
sprpriority = 2

[state 1000]
type = playsnd
triggerall = anim = 3022
trigger1 = animelem = 2
value = S0,5
volumescale = 150

[state 1000]
type = playsnd
triggerall = anim = 3022
trigger1 = animelem = 2
value = S1000,1
volumescale = 125

[state 1000]
type = veladd
trigger1 = 1
y = 0.42

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, HA
damage = 40, 5
animtype = diagup
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 15, 15
sparkNo = 2
guard.sparkNo = 40
sparkXY = -8,-58
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.0,-15.0
air.type = low
air.velocity = -2.0,-15.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.60
ID = 3023
envshake.time = 15

[state 1000]
type = changestate
trigger1 = anim = 3022
trigger1 = animtime = 0
value = 635
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 1

;Huge shoutouts to Veanko for Bike Code

;Get on a bike
[Statedef 3050]
type    = A
movetype= I
physics = N
juggle  = 0
velset = 0,-8
ctrl = 0
anim = 4051

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

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

[state 1000]
type = explod
trigger1 = time = 0
anim = F101
pos = -2,-20
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 16
pausemovetime = 16

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

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

[state 1000]
type = playsnd
trigger1 = time = 0
value = S4005,2
volumescale = 200

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 40
add = 84,84,84
sinadd = 92,92,92,4

[State 0, PlaySnd]
type = null
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,3
;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

; bike idle
[Statedef 4000]
type = S
physics = N
sprpriority = 0
anim = 4000
poweradd = 0

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

[State 0, 1]
type = null
triggerall = anim != 2 && 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 = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[State 0, Turn]
type = Turn
trigger1 = command = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
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 != "holdforward"
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 = ceil(ifElse(fvar(11) * 60 < 30, 30, fvar(11) * 60)), 0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 0, 0
sparkno = 2
sparkxy = -10, -30
hitsound = 5,2
guardsound = 6, 0
guard.sparkno = 40
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, 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 = "b"
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 = 4300
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall = power >= 250
trigger1 = !var(59)
trigger1 = command = "y"
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 = 4100
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
triggerall = !var(59)
trigger1 = command = "a"
value = 4400
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 = 4003
stateno = 4003
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 = -8

[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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [-0.4,0.4]
var(25) = 0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [0.5,0.9] 
trigger2 = vel x = [-0.9,-0.4]
var(25) = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1,1.4]
trigger2 = vel x = [-1.4,-1]
var(25) = 2
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1.5,1.9]
trigger2 = vel x = [-1.9,-1.5]
var(25) = 3
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2,2.4]
trigger2 = vel x = [-2.4,-2]
var(25) = 4
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2.5,2.9]
trigger2 = vel x = [-2.9,-2.5]
var(25) = 5
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3,3.4]
trigger2 = vel x = [-3.4,-3]
var(25) = 6
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3.5,3.9]
trigger2 = vel x = [-3.9,-3.4]
var(25) = 7
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4,4.4]
trigger2 = vel x = [-4.4,-4]
var(25) = 8
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4.5,4.9]
trigger2 = vel x = [-4.9,-4.4]
var(25) = 9
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5,5.4]
trigger2 = vel x = [-5.4,-5]
var(25) = 10
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5.5,5.9]
trigger2 = vel x = [-5.9,-5.5]
var(25) = 11
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6,6.4]
trigger2 = vel x = [-6.4,-6]
var(25) = 12
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6.5,6.9]
trigger2 = vel x = [-6.9,-6.5]
var(25) = 13
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7,7.4]
trigger2 = vel x = [-7.4,-7]
var(25) = 14
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7.5,7.9]
trigger2 = vel x = [-7.9,-7.5]
var(25) = 15
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8,8.4]
trigger2 = vel x = [-8.4,-8]
var(25) = 16
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8.5,8.9]
trigger2 = vel x = [-8.9,-8.5]
var(25) = 17
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x >= 9
trigger2 = vel x <= -9
var(25) = 18
ignorehitpause = 1

;woah
[Statedef 4003]
type = A
physics = N
sprpriority = 0
anim = 1921

[state 1000]
type = playsnd
trigger1 = time = 0
value = S4005,6
volumescale = 200

[state 1000]
type = velset
trigger1 = time = 0
y = -7
x = 0

[state 1000]
type = velset
trigger1 = time = 20
y = 0
x = 0

[state 1000]
type = changestate
trigger1 = time = 50
value = 15005
ctrl = 0
;---------------------------------------------------------------------------
; 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 = S4005,0
volumescale = 200


[State 0, Turn]
type = Turn
trigger1 = command = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

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

[State 0, ChangeState]
type = ChangeState
triggerall = !var(59)
trigger1 = command = "a"
value = 4450
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "b"
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 = 4700
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "y"
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 = 4051
ctrl = 0

[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 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 Attack
[Statedef 4051]
type = A
movetype = A
physics = N
sprpriority = 0
anim = 4052

[State 5020, 5]
type = ChangeState
trigger1 = var(17) >= 250
trigger2 = !Alive
value = 3060
ignorehitpause = 1

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

[State 50, 0]
type = PlaySnd
trigger1 = Time = 0
value = 4005,2
volumescale = 200

[state 1000]
type = playsnd
trigger1 = animelem = 3
value = S1000,0+random%2
volumescale = 125

[State 0, Turn]
type = Turn
trigger1 = command = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
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 = time = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 50 < 25, 25, fvar(11) * 50)), 0
getpower = 16,8
givepower = 16,8
animtype = diagup
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 3, 3
sparkno = 2
sparkxy = -10, -25
hitsound = 5,2
guardsound = 6, 0
guard.sparkno = 40
ground.type = High
ground.slidetime = 4
ground.hittime  = 4
ground.velocity = -5,-8
airguard.velocity = -5,-4
air.type = high
air.velocity = -5,-8
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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[State 0, ChangeState]
type = ChangeState
trigger1 = !var(59)
trigger1 = command = "x"
value = 4600
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

;Do eet
[Statedef 4100]
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 = "holdbackward"
trigger1 = command != "holdforward"
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
trigger1 = time = 0
x = 12

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 15010
stateno = 15010
pos = 0,-60
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 15011
stateno = 15011
pos = 0,-35
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 15012
stateno = 15012
pos = 0,-10
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 4005,1
volumescale = 125
abspan = 0

[State 1120, Blink]
type = PalFX
trigger1 = time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[state 1000]
type = explod
trigger1 = time = 0
anim = 251
ontop = 0
pos = 0,0
postype = p1
bindtime = -1
removetime = 12
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = -250

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

[State 200, 3]
type = ChangeState
trigger1 = time = 1
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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdforward"
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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 0
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,32
givepower = 32,32
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkno = 1
sparkxy = -10, -45
hitsound = 5,0
guardsound = 6,0
guard.sparkno = 40
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 >= 7
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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdforward"
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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 1
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
getpower = 72,32
givepower = 32,32
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkno = 1
sparkxy = -10, -42
hitsound = 5,1
guardsound = 6, 0
guard.sparkno = 40
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 >= 7
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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdforward"
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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 0
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 72,32
givepower = 32,32
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkno = 1
sparkxy = -10, -45
hitsound = 5, 1
guardsound = 6, 0
guard.sparkno = 40
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

; Bike Uppercut
[Statedef 4300]
type    = S
movetype= A
physics = N
Juggle = 2
ctrl = 0
anim = 4300
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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, 2]
type = VelSet
triggerall = vel x = [0,0.5]
trigger1 = command != "holdforward"
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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S1000,0 +random%2
volumescale = 125

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

[State 200, 1]
type = HitDef
trigger1 = animelem = 6
trigger2 = animelem = 7
trigger3 = animelem = 8
attr = S, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 0
getpower = 72,32
givepower = 32,32
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 2, 2
sparkno = 1
sparkxy = -10, -45
hitsound = 5,1
guardsound = 6,0
guard.sparkno = 40
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -4,-2
air.type = low
air.velocity = -4,-2
air.hittime = 10
yaccel = 0.42
fall = 1
ID = 4300
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

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

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

; Done
[Statedef 4400]
type    = S
movetype= I
physics = S
Juggle = 2
ctrl = 0
anim = 4400
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, 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, VarSet]
type = VarSet
trigger1 = 1
var(17) = 0


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

[State 200, 2]
type = playsnd
trigger1 = time = 0
value = S4005,4
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 5
value = S1000, 0+random%2
volumescale = 125

[State 0, Hair]
type = Helper
trigger1 = animelem = 6
name = "Bike"
helpertype = Normal
ID = 15006
stateno = 15006
pos = 0,-35
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

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

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

; Air Done
[Statedef 4450]
type    = A
movetype= I
physics = N
Juggle = 2
ctrl = 0
anim = 4401
poweradd = 0
sprpriority = 2

[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, 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 1000]
type = veladd
triggerall = anim = 4401
trigger1 = 1
y = .30

[state 1000]
type = velset
trigger1 = time = 0
y = -2

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

[State 200, 2]
type = playsnd
trigger1 = time = 0
value = S4005,4
volumescale = 125

[State 200, 1]
type = PlaySnd
triggerall = anim = 4401
trigger1 = animelem = 8
value = S1000, 0+random%2
volumescale = 125

[State 0, Hair]
type = Helper
triggerall = anim = 4401
trigger1 = animelem = 9
name = "Bike"
helpertype = Normal
ID = 15006
stateno = 15006
pos = 0,-35
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

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

[state 1000]
type = veladd
trigger1 = anim = 635
y = .42

[state 1000]
type = changeanim
triggerall = anim = 4401
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
triggerall = animelemtime(8)>=0
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 4451
ctrl = 0

[State 1100, 5]
type = ChangeState
triggerall = animelemtime(14)>=0
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Woah
[Statedef 4451]
type    = S
movetype= I
physics = S
Juggle = 2
ctrl = 0
poweradd = 0
sprpriority = 2
velset = 0,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, VarSet]
type = VarSet
trigger1 = 1
var(17) = 0

[state 1000]
type = posset
trigger1 = time = 0
y = 0

[state 1000]
type = playsnd
trigger1 = time = 0
value = S40,0

[State 0, Hair]
type = Helper
triggerall = !numhelper(15006)
trigger1 = animelem = 9
name = "Bike"
helpertype = Normal
ID = 15006
stateno = 15006
pos = 0,-35
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

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

; 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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S200,0 +random%3
volumescale = 125

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,32
givepower = 32,32
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkno = 0
sparkxy = -10, -45
hitsound = 5,0
guardsound = 6, 0
guard.sparkno = 40
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 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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 0
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
getpower = 72,32
givepower = 32,32
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkno = 1
sparkxy = -10, -45
hitsound = 5,1
guardsound = 6, 0
guard.sparkno = 40
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 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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 0
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 64,32
givepower = 32,16
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0, 6
sparkno = 1
sparkxy = -10, -45
hitsound = 5, 1
guardsound = 6, 0
guard.sparkno = 40
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 1021, 10]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 4052
ctrl = 0

; Air Bike Uppercut
[Statedef 4700]
type    = A
movetype= A
physics = N
Juggle = 2
ctrl = 0
anim = 4301
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 = "holdbackward"
trigger1 = command != "holdforward"
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 = "holdforward"
trigger2 = var(59)
trigger2 = var(58)
x = .4
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x > 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = -.05
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
triggerall = vel x < 0
trigger1 = !var(59)
trigger1 = command != "holdforward"
trigger2 = var(59)
trigger2 = !var(58)
x = .05
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 4000,var(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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 = anim = 4301
trigger1 = animelem = 3
value = S1000,0 +random%2
volumescale = 125

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

[State 200, 1]
type = HitDef
trigger1 = animelem = 6
trigger2 = animelem = 7
trigger3 = animelem = 8
attr = A, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 0
getpower = 72,32
givepower = 32,32
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 2, 2
sparkno = 1
sparkxy = -10, -45
hitsound = 5,1
guardsound = 6,0
guard.sparkno = 40
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -4,-2
air.type = low
air.velocity = -4,-2
air.hittime = 10
yaccel = 0.42
fall = 1
ID = 4700
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(9)>=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 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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

;---------------------------------------------------------------------------
; 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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

[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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300

;---------------------------------------------------------------------------
; 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(25)
channel = 3
loop = 1
ignorehitpause = 1
volumescale = 300
;---------------------------------------------------------------------------
;Tail Helper
[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, ChangeAnim]
type = ChangeAnim
trigger1 = root,anim != 0 
;trigger1 = root,anim != 1
trigger1 = root,anim != 2
trigger1 = root,anim != 3
;trigger1 = root,anim != 4
trigger1 = root,anim != 5
;trigger1 = root,anim != 10
;trigger1 = root,anim != 11
;trigger1 = root,anim != 12
trigger1 = root,anim != 20
trigger1 = root,anim != 21
;trigger1 = root,anim != 41
;trigger1 = root,anim != 42
;trigger1 = root,anim != 43
;trigger1 = root,anim != 44
;trigger1 = root,anim != 45
;trigger1 = root,anim != 46
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 != 170
;trigger1 = root,anim != 191 && root,anim != 194 && root,anim != [1910,1911]
;trigger1 = root,anim != 195 && root,anim != [1950,1951]
trigger1 = root,anim != 240
trigger1 = root,anim != 241
trigger1 = root,anim != 400
trigger1 = root,anim != 410
trigger1 = root,anim != 411
trigger1 = root,anim != 600
trigger1 = root,anim != 640
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 != 5120
trigger1 = root,anim != 5120
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 = 19999
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
triggerall = anim != 9991
trigger1 = root,anim = 0
trigger2 = root,anim = 2
trigger3 = root,anim = 3
trigger5 = root,anim = 195
trigger6 = root,anim = 170
value = 9991
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10110
trigger1 = root,anim = 110
trigger2 = root,anim = 111           
value = 10110
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10115
trigger1 = root,anim = 115
trigger2 = root,anim = 116           
value = 10115
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9996
trigger1 = root,anim = 20
value = 9996
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9992
trigger1 = root,anim = 100
value = 9992
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9997
trigger1 = root,anim = 21
value = 9997
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10003
trigger1 = root,anim = 600
value = 10003
ignorehitpause = 1

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

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9991
trigger1 = root,anim = 175
value = 9991
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10006
trigger1 = root,anim = 5
value = 10006
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) :
;---------------------------------------------------------------------------
[statedef -2]

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

[State -2, 2a]
type = PlaySnd
triggerall = alive
triggerall = Random < 500
trigger1 = stateno = 5120
trigger1 = time = 1
value = 5120, 0+random%2
channel = 0
Volumescale = 150

[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%6
channel = 0
Volumescale = 125

;---------------------------------------------------------------------------
;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(25) = 0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [0.5,0.9] 
trigger2 = vel x = [-0.9,-0.4]
var(25) = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1,1.4]
trigger2 = vel x = [-1.4,-1]
var(25) = 2
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [1.5,1.9]
trigger2 = vel x = [-1.9,-1.5]
var(25) = 3
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2,2.4]
trigger2 = vel x = [-2.4,-2]
var(25) = 4
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [2.5,2.9]
trigger2 = vel x = [-2.9,-2.5]
var(25) = 5
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3,3.4]
trigger2 = vel x = [-3.4,-3]
var(25) = 6
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [3.5,3.9]
trigger2 = vel x = [-3.9,-3.4]
var(25) = 7
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4,4.4]
trigger2 = vel x = [-4.4,-4]
var(25) = 8
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [4.5,4.9]
trigger2 = vel x = [-4.9,-4.4]
var(25) = 9
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5,5.4]
trigger2 = vel x = [-5.4,-5]
var(25) = 10
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [5.5,5.9]
trigger2 = vel x = [-5.9,-5.5]
var(25) = 11
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6,6.4]
trigger2 = vel x = [-6.4,-6]
var(25) = 12
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [6.5,6.9]
trigger2 = vel x = [-6.9,-6.5]
var(25) = 13
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7,7.4]
trigger2 = vel x = [-7.4,-7]
var(25) = 14
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [7.5,7.9]
trigger2 = vel x = [-7.9,-7.5]
var(25) = 15
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8,8.4]
trigger2 = vel x = [-8.4,-8]
var(25) = 16
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x = [8.5,8.9]
trigger2 = vel x = [-8.9,-8.5]
var(25) = 17
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = vel x >= 9
trigger2 = vel x <= -9
var(25) = 18
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(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, Counter Flag] 
type = VarSet
trigger1 = NumEnemy
fvar(8) = (EnemyNear, MoveType = A)
ignoreHitPause = 1
 
;Damage Dampener Variable (by POTS)
[State -2, Hit Count] 
type = VarAdd 
trigger1 = !IsHelper
trigger1 = MoveHit = 1 
trigger1 = !HitPauseTime 
trigger1 = !(HitDefAttr = SCA, AT) 
fvar(13) = 1 
 
[State -2, Hit Count Reset] 
type = VarSet 
trigger1 = NumEnemy && fvar(13) 
trigger1 = (EnemyNear, MoveType != H) && (EnemyNear, StateNo != 5300) 
fvar(13) = 0 
ignoreHitPause = 1

[State -2, Dampener] 
type = VarSet 
trigger1 = 1 
fvar(10) = ifElse(fvar(13) < 3, 24, ifElse(fvar(13) >= 23, 1, 24 - fvar(13))) / 24.0 
ignoreHitPause = 1 
 
[State -2, Dampener Limit] 
type = VarSet 
trigger1 = fvar(10) < 0 
fvar(10) = 0 
ignoreHitPause = 1 
 
[State -2, Root Dampener] 
type = VarSet 
trigger1 = 1 
fvar(11) = fvar(10) * ifElse(fvar(8), 1.2, 1) 
ignoreHitPause = 1

[state -2]
type = varset
triggerall = p2stateno = 5080
trigger1 = movehit
trigger1 = p2statetype = L && p2movetype = H
trigger1 = time = 0
var(20) = 0
ignorehitpause = 1

[state -2]
type = varset
trigger1 = !p2movetype = H
var(20) = 0
ignorehitpause = 1

[state -2]
type = varset
triggerall = p2stateno = 5080
trigger1 = movehit
trigger1 = p2statetype = L && p2movetype = H
trigger1 = time = 0
var(21) = 0
ignorehitpause = 1

[state -2]
type = varset
trigger1 = !p2movetype = H
var(21) = 0
ignorehitpause = 1

[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

[Statedef -3]

[State 0, PowerSet]
type = PowerSet
triggerall = power > 1000
trigger1 = stateno = [4000,4620]
trigger2 = stateno = [45000,45030]
value = 1000
ignorehitpause = 1

[State -3, Pause]
type = Helper
triggerall = !var(59)
triggerall = teamside = 1
triggerall = (!AILevel) && !(NumHelper(8000)) && (RoundState = 2)
trigger1 = command = "start" && (!HitPauseTime || HitPauseTime = 1) && !NumHelper(6002)
helpertype = normal 
name = "Pause Menu"
ID = 8000
stateno = 8000
pos = 0,0
postype = left
facing = 1
keyctrl = 1
ownpal = 1
pausemovetime = 9999
ignorehitpause = 1

[State -3, Level 1 Super AfterImage]
type = AfterImage
trigger1 = StateNo = 3000 && Time = 16
trigger2 = StateNo = 3020 && Time = 16
time = 2
timegap = 1
framegap = 4
length = 16
palbright = 200, 200, 250
palcontrast = 0, 100,150
palcolor = 0
trans = add

[State -3, Level 2 Super AfterImage]
type = AfterImage
trigger1 = StateNo = 3050 && Time = 1
time = 2
timegap = 1
framegap = 4
length = 16
palbright = 250, 150, 200
palcontrast = 250, 100,0
palcolor = 0
trans = add

[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,3050]
time = 2
ignorehitpause = 1

[State -3, AfterImage Off]
type = AfterImageTime
triggerAll = Time <= 1
trigger1 = StateNo = 3000 || StateNo = 3001 || Stateno = 3002 || Stateno = 3003 || stateno = 3020 || stateno = 3021 || stateno = 3022 || stateno = 3023 || stateno = 3024 || stateno = 3050
;trigger2 = StateNo = 3300
time = 0
ignorehitpause = 1

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
trigger3 = stateno = 1012
trigger4 = stateno = 1014
trigger5 = stateno = 1016
value = 40, 0
volumescale = 125
