// these default settings get executed whenever "config.cfg" is not available
// do not modify anything below, instead change settings in game, or add to autoexec.cfg

name "unnamed"
team "betawaves"
gui2d 1
gui3d 0

invmouse 0         // 1 for flightsim mode
sensitivity 3      // similar number to quake
fov 100            // 90 is default in other games

musicvol 60       // set higher if you want (max 255)
soundvol 255      // sounds average volume is actually set per sound, average 100

gamma 100          // set to your liking, 100 = default


// WASD

bind W forward
bind A left
editbind S backward
bind D right

bind UP "forward"
bind DOWN "backward"
bind RIGHT "right"
bind LEFT "left"

//bind 0 "weapon 0 1 2"
//bind 1 "weapon 1 2 4"
//bind 2 "weapon 2 1 4"
//bind 3 "weapon 3 4 2"
//bind 4 "weapon 4 3 2"
//bind 5 "weapon 5 3 1"
//bind 6 "weapon 6 2 4"

//bind SPACE "jump"
//bind MOUSE2 "jump"
//bind MOUSE1 "attack"
//bind MOUSE3 "weapon"

bind R repammo

bind TAB "showscores"

bind T "saycommand"
bind BACKQUOTE "saycommand /"
bind SLASH "saycommand /"

bind I taunt

bind E "edittoggle"

bind KP_MINUS "conskip 1"
bind KP_PLUS "conskip -1000"

bindvar F1 paused

bind F11 "toggleconsole"
bind F12 "screenshot"

hudgun 0

demo         = [ stopdemo; mode -3; map $arg1 ]

sp           = [ mode -2; map $arg1 ]
dmsp         = [ mode -1; map $arg1 ]
slowsp       = [ mode -5; map $arg1 ]
slowdmsp     = [ mode -4; map $arg1 ]

ffa          = [ mode  0; map $arg1 ]
coop         = [ mode  1; map $arg1 ]
insta        = [ mode  4; map $arg1 ]
instateam    = [ mode 5; map $arg1 ]
efficiency   = [ mode 6; map $arg1 ]
capture      = [ mode 12; map $arg1 ]
instacapture = [ mode 13; map $arg1 ]
regencapture = [ mode 14; map $arg1 ] 
asn          = [ mode 15; map $arg1 ]
instaasn     = [ mode 16; map $arg1 ]

mapcomplete = [ complete $arg1 packages/base ogz ]
mapcomplete map
mapcomplete sp
mapcomplete dmsp
mapcomplete ffa
mapcomplete coop
mapcomplete insta
mapcomplete instateam
mapcomplete efficiency
mapcomplete capture
mapcomplete instacapture
mapcomplete regencapture
mapcomplete asn
mapcomplete instaasn
complete importcube packages/cube cgz
complete demo . dmo

//////////////////////////////////
// universal scrollwheel + modifier commands:

defaultmodifier = 0
modifier = $defaultmodifier
domodifier = [ modifier = $arg1; onrelease [ modifier = $defaultmodifier ] ]

universaldelta = [
  do [delta_@(if $editing [ result edit ] [ result game ])_@modifier @arg1]
]

bind MOUSE4 [ universaldelta 1 ]	// also used for editing, see below
bind MOUSE5 [ universaldelta -1 ]

//////////////////////////////////

delta_game_0 = [ if (= $arg1 1) [ weapon 2 3 5 ] [ weapon 4 1 5 ] ]

zfov = 120
delta_game_1 = [
  zfov = (+ $zfov (* $arg1 (div $zfov -5)))
  if (< $zfov 10)  [ zfov = 10 ]
  if (> $zfov 120) [ zfov = 120 ]
  fov $zfov
]

bind G [ domodifier 1 ]


//////////////////////////////////
// Sauerbraten Editing related bindings
// found in autoexec.cfg in your sauerbraten directory

editbind SPACE  [ cancelsel; passthroughsel 0 ] // meh.. will need to make better fix
editbind MOUSE1 [ editdrag ]
editbind MOUSE3 [ selcorners ]
editbind MOUSE2 [ editextend ]

editbind KP_ENTER [ entselect insel ]
editbind N        [ entselect insel ]
editbind M        [ selentfindall ]

editbind    LSHIFT  [ editcut ]
editbindmod LCTRL   [ hmapctrl ]
editbindmod LALT    [ passthrough ]
editbindmod RALT    [ passthrough ]
editbind BACKSPACE  [ editdel ]

editbind X [ editflip ]
editbind C [ editcopy ]
editbind V [ editpaste ]
editbind Z [ undo; passthroughsel 0] 
editbind U [ undo; passthroughsel 0]
editbind I [ redo ]
editbind H [ hmapedit ( ! $hmapedit ) ]

// commands below are used with scroll wheel (and universaldelta).
// if you have no scroll wheel or don't want to use it,
// you can either change the binds of universaldelta
// ex:  bind MOUSE4 [ universaldelta 1 ]
//      bind MOUSE5 [ universaldelta -1 ]
// can be changed to:
//      bind INSERT [ universaldelta 1 ]
//      bind DELETE [ universaldelta -1 ]
// so that the INSERT and DELETE key act just like a scroll wheel
//
// or you can rebind all the commands to seperate keys
// ex:  bind T [ domodifier 6 ]
// can be changed to:
//      bind HOME [ edittex 1 ]
//      bind END [ edittex -1 ]


editbind G [ domodifier 1 ] // domodifier 1 -> executes delta_edit_1
editbind F [ domodifier 2 ] // etc...
editbind Q [ domodifier 3 ]
editbind R [ domodifier 4 ] 
editbind Y [ domodifier 6 ]
editbind B [ domodifier 9; brushcopy = 0; ]
editbind J [ domodifier 9; brushcopy = 0; ]
editbind COMMA  [ domodifier 10; onrelease entautoview ]

delta_edit_0 = [ editfacewentpush $arg1 1 ] // Fill and Empty cube
delta_edit_1 = [ gridpower (+ $arg1 $gridpower) ]
delta_edit_2 = [ editfacewentpush $arg1 0 ] // push face/corners selected
delta_edit_3 = [ editfacewentpush $arg1 2 ] // push corner pointed at by cursor
delta_edit_4 = [ editrotate $arg1 ] // rotate 90 degrees
delta_edit_5 = [ entproperty 0 $arg1 ]  // and the others
delta_edit_6 = [ edittex $arg1 ] // change textures
delta_edit_9 = [ selectbrush $arg1 ] // change heightmap brushes
delta_edit_10 = [ entautoview $arg1 ]


entcomplete = [ listcomplete $arg1 "light mapmodel playerstart envmap particles sound spotlight shells bullets rockets riflerounds grenades cartridges health healthboost greenarmour yellowarmour quaddamage teleport teledest monster carrot jumppad base respawnpoint box barrel platform elevator" ]
entcomplete newent
entcomplete entfind

listcomplete editmat "air water clip glass noclip lava aiclip"
air = [ editmat air ]
water = [ editmat water ]
clip = [ editmat clip ]
glass = [ editmat glass ]
noclip = [ editmat noclip ]
lava = [ editmat lava ]
aiclip = [ editmat aiclip ]

editbindvar 6 entselsnap
editbindvar 7 outline
editbindvar 8 wireframe
bindvar S thirdperson
editbindvar 0 allfaces
editbindvar L fullbright

editbind PERIOD selentedit

editbind F3 [ cleargui; showentgui ]
editbind F2 showtexgui
editbind F5 savemap

showgui main
