-Sun Aug 9 07:25:00 CEST 2020
+Tue Aug 25 07:23:38 CEST 2020
# Larson März <larson@protonmail.ch>, 2016
# Larson März <larson@protonmail.ch>, 2016
# afba88cf42cbdff57149d4a6d53a94f9, 2018
-# Mirio <opivy@hotmail.de>, 2014-2017,2019
+# Mirio <opivy@hotmail.de>, 2014-2017,2019-2020
# Robert Katzinsky <hbmctextures.unknown@gmail.com>, 2020
# divVerent <divVerent@xonotic.org>, 2011
# Sless <sless@gmx.net>, 2014
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-20 23:59+0000\n"
+"Last-Translator: Mirio <opivy@hotmail.de>\n"
"Language-Team: German (http://www.transifex.com/team-xonotic/xonotic/"
"language/de/)\n"
"Language: de\n"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "Nur in Duell"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
# Larson März <larson@protonmail.ch>, 2016
# Larson März <larson@protonmail.ch>, 2016
# afba88cf42cbdff57149d4a6d53a94f9, 2018
-# Mirio <opivy@hotmail.de>, 2014-2017,2019
+# Mirio <opivy@hotmail.de>, 2014-2017,2019-2020
# Robert Katzinsky <hbmctextures.unknown@gmail.com>, 2020
# divVerent <divVerent@xonotic.org>, 2011
# Sless <sless@gmx.net>, 2014
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-20 23:59+0000\n"
+"Last-Translator: Mirio <opivy@hotmail.de>\n"
"Language-Team: German (http://www.transifex.com/team-xonotic/xonotic/"
"language/de/)\n"
"Language: de\n"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "Nur in Duell"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-06-07 05:23+0000\n"
+"PO-Revision-Date: 2020-08-09 05:23+0000\n"
"Last-Translator: divVerent <divVerent@xonotic.org>\n"
"Language-Team: Esperanto (http://www.transifex.com/team-xonotic/xonotic/"
"language/eo/)\n"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-24 11:18+0000\n"
+"Last-Translator: LegendGuard\n"
"Language-Team: Spanish (http://www.transifex.com/team-xonotic/xonotic/"
"language/es/)\n"
"Language: es\n"
#: qcsrc/client/hud/panel/infomessages.qc:110
#: qcsrc/client/hud/panel/infomessages.qc:114
msgid "next weapon"
-msgstr "arma siguiente"
+msgstr "siguiente arma"
#: qcsrc/client/hud/panel/infomessages.qc:110
#: qcsrc/client/hud/panel/infomessages.qc:114
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "Sólo en Duelo"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-09 08:32+0000\n"
+"Last-Translator: Yannick Le Guen <leguen.yannick@gmail.com>\n"
"Language-Team: French (http://www.transifex.com/team-xonotic/xonotic/"
"language/fr/)\n"
"Language: fr\n"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "Seulement en Duel"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-06-07 05:23+0000\n"
+"PO-Revision-Date: 2020-08-09 05:23+0000\n"
"Last-Translator: divVerent <divVerent@xonotic.org>\n"
"Language-Team: Gaelic, Scottish (http://www.transifex.com/team-xonotic/"
"xonotic/language/gd/)\n"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-24 11:27+0000\n"
+"Last-Translator: LegendGuard\n"
"Language-Team: Galician (http://www.transifex.com/team-xonotic/xonotic/"
"language/gl/)\n"
"Language: gl\n"
#: qcsrc/client/hud/hud_config.qc:80
#, c-format
msgid "^2Successfully exported to %s! (Note: It's saved in data/data/)"
-msgstr ""
+msgstr "^2Exportado con éxito a %s! (Nota: Está gardado en data/data/)"
#: qcsrc/client/hud/hud_config.qc:84
#, c-format
msgid "^1Couldn't write to %s"
-msgstr ""
+msgstr "^1Non se puido escribir a %s"
#: qcsrc/client/hud/panel/centerprint.qc:173
#, c-format
msgid "^3Countdown message at time %s, seconds left: ^COUNT"
-msgstr ""
+msgstr "^3Mensaxe de conta atrás á hora %s, segundos restantes: ^COUNT"
#: qcsrc/client/hud/panel/centerprint.qc:175
#, c-format
"^1Multiline message at time %s that\n"
"^1lasts longer than normal"
msgstr ""
+"^1Mensaxe de múltiples liñas á hora %s que\n"
+"^1dura máis do normal"
#: qcsrc/client/hud/panel/centerprint.qc:177
#, c-format
msgid "Message at time %s"
-msgstr ""
+msgstr "Mensaxe á hora %s"
#: qcsrc/client/hud/panel/centerprint.qc:182
msgid "Generic message"
#: qcsrc/client/hud/panel/infomessages.qc:95
msgid "^1Observing"
-msgstr ""
+msgstr "^1Observando"
#: qcsrc/client/hud/panel/infomessages.qc:97
#, c-format
msgid "^1Spectating: ^7%s"
-msgstr ""
+msgstr "^1Espectando: ^7%s"
#: qcsrc/client/hud/panel/infomessages.qc:108
#, c-format
#: qcsrc/client/hud/panel/infomessages.qc:108
#: qcsrc/menu/xonotic/keybinder.qc:47
msgid "primary fire"
-msgstr "tiro principal"
+msgstr "disparo primario"
#: qcsrc/client/hud/panel/infomessages.qc:110
#, c-format
msgid "^1Press ^3%s^1 or ^3%s^1 for next or previous player"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 ou ^3%s^1 para ver o xogador seguinte ou anterior"
#: qcsrc/client/hud/panel/infomessages.qc:110
#: qcsrc/client/hud/panel/infomessages.qc:114
msgid "next weapon"
-msgstr ""
+msgstr "seguinte arma"
#: qcsrc/client/hud/panel/infomessages.qc:110
#: qcsrc/client/hud/panel/infomessages.qc:114
msgid "previous weapon"
-msgstr ""
+msgstr "arma anterior"
#: qcsrc/client/hud/panel/infomessages.qc:114
#, c-format
msgid "^1Use ^3%s^1 or ^3%s^1 to change the speed"
-msgstr ""
+msgstr "^1Usa ^3%s^1 ou ^3%s^1 para cambiar a velocidade"
#: qcsrc/client/hud/panel/infomessages.qc:116
#, c-format
msgid "^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 para observar ou ^3%s^1 para cambiar o modo de cámara"
#: qcsrc/client/hud/panel/infomessages.qc:116
#: qcsrc/common/vehicles/cl_vehicles.qc:190
msgid "drop weapon"
-msgstr ""
+msgstr "soltar arma"
#: qcsrc/client/hud/panel/infomessages.qc:116
#: qcsrc/menu/xonotic/keybinder.qc:48
msgid "secondary fire"
-msgstr "tiro secundario"
+msgstr "disparo secundario"
#: qcsrc/client/hud/panel/infomessages.qc:119
#, c-format
msgid "^1Press ^3%s^1 for gamemode info"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 para mostrar información do modo de xogo"
#: qcsrc/client/hud/panel/infomessages.qc:119
#: qcsrc/menu/xonotic/keybinder.qc:103
#: qcsrc/client/hud/panel/infomessages.qc:131
#, c-format
msgid "^1Press ^3%s^1 to join"
-msgstr ""
+msgstr "^1Pulsa ^3%s^1 para unirche"
#: qcsrc/client/hud/panel/infomessages.qc:131
#: qcsrc/common/notifications/all.qh:430
#: qcsrc/client/hud/panel/infomessages.qc:140
#, c-format
msgid "^1Game starts in ^3%d^1 seconds"
-msgstr ""
+msgstr "^1O xogo comeza en ^3%d^1 segundos"
#: qcsrc/client/hud/panel/infomessages.qc:146
msgid "^2Currently in ^1warmup^2 stage!"
-msgstr ""
+msgstr "^2Actualmente en etapa de ^1quecemento^2!"
#: qcsrc/client/hud/panel/infomessages.qc:161
#, c-format
msgid "%sPress ^3%s%s to end warmup"
-msgstr ""
+msgstr "%sPulsa ^3%s%s para terminar o quecemento"
#: qcsrc/client/hud/panel/infomessages.qc:161
#: qcsrc/client/hud/panel/infomessages.qc:163
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-21 21:35+0000\n"
+"Last-Translator: LegendGuard\n"
"Language-Team: Japanese (Japan) (http://www.transifex.com/team-xonotic/"
"xonotic/language/ja_JP/)\n"
"Language: ja_JP\n"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "決闘でのみ"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
-# Muhammad Nur Hidayat Yasuyoshi <mnh48mail@gmail.com>, 2018
+# 4b0721bd8a44304c1fd21d8581e7aba4_e088d28 <64a9a0c5da22e761316957ae436b6281_676465>, 2018
+# 4b0721bd8a44304c1fd21d8581e7aba4_e088d28 <64a9a0c5da22e761316957ae436b6281_676465>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Xonotic\n"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-21 01:30+0000\n"
+"Last-Translator: Jean Trindade Pereira <jean_trindade2@hotmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/team-xonotic/"
"xonotic/language/pt_BR/)\n"
"Language: pt_BR\n"
#: qcsrc/client/hud/panel/quickmenu.qc:799
msgid "QMCMD^strength soon"
-msgstr ""
+msgstr "Força em breve"
#: qcsrc/client/hud/panel/quickmenu.qc:800
msgid "QMCMD^free item %x^7 (l:%y^7)"
#: qcsrc/client/hud/panel/quickmenu.qc:836
msgid "QMCMD^Change spectator camera"
-msgstr ""
+msgstr "Alterar câmera de espectador"
#: qcsrc/client/hud/panel/quickmenu.qc:841
#: qcsrc/client/hud/panel/quickmenu.qc:845
#: qcsrc/common/notifications/all.inc:407
#, c-format
msgid "^TC^TT^BG team control point has been destroyed by %s"
-msgstr ""
+msgstr "O ponto de controle da equipe ^TC^TT^BG foi destruído por %s"
#: qcsrc/common/notifications/all.inc:408
msgid "^TC^TT^BG generator has been destroyed"
#: qcsrc/common/notifications/all.inc:667
#, c-format
msgid "^F2Extra lives taken: ^K1%s"
-msgstr ""
+msgstr "^F2Vidas extras tomadas: ^K1%s"
#: qcsrc/common/notifications/all.inc:669
#, c-format
#: qcsrc/common/notifications/all.inc:672
#, c-format
msgid "^K3You were automatically revived after %s seconds"
-msgstr ""
+msgstr "^K3Você foi automaticamente ressuscitado após %s segundos"
#: qcsrc/common/notifications/all.inc:674
msgid "^BGThe generator is under attack!"
#: qcsrc/common/notifications/all.inc:721
#, c-format
msgid "^BGPress ^F2%s^BG to enter the game"
-msgstr ""
+msgstr "^BGAperte ^F2%s^BG para entrar no jogo"
#: qcsrc/common/notifications/all.inc:724
#, c-format
"Enable dodging (quick acceleration in a given direction). Double-tap a "
"directional key to dodge"
msgstr ""
+"Ativa a esquiva (aceleração rápida em uma determinada direção). Aperte duas "
+"vezes uma tecla direcional para esquivar."
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:168
msgid "An explosion occurs when two players collide"
"Enable buff pickups (random bonuses like Medic, Invisible, etc.) on the maps "
"that support it"
msgstr ""
+"Ativa itens coletáveis de bônus (bônus aleatórios como Médico, Invisível "
+"etc.) nos mapas que são compatíveis com este recurso."
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:181
msgid "Only possible to inflict damage on your enemy while they're airborne"
"Amount of health below which players start bleeding out (health rots and "
"they can't jump)"
msgstr ""
+"Quantidade de saúde abaixo em que os jogadores começam a sangrar (a saúde "
+"cai e os jogadores não podem pular)"
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:199
msgid "Make things fall to the ground slower (percentage of normal gravity)"
msgstr ""
+"Faz com que as coisas caiam no chão mais devagar (porcentagem da gravidade "
+"normal)."
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:208
msgid "Weapon & item mutators:"
"Projectiles can't be destroyed. However, you can still explode Electro orbs "
"with the Electro primary fire"
msgstr ""
+"Os projéteis não podem ser destruídos. Entretanto, ainda é possível destruir "
+"os orbes da Electro com o disparo primário dela."
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:225
msgid ""
"Some weapon spawns will be randomly replaced with new weapons: Heavy Laser "
"Assault Cannon, Mine Layer, Rifle, T.A.G. Seeker"
msgstr ""
+"Alguns surgimentos de arma serão aleatoriamente substituídos por novas "
+"armas: Heavy Laser Assault Cannon, Mine Layer, Rifle, T.A.G. Seeker."
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:230
msgid ""
"delay). This allows players to fire and detonate a Devastator rocket while "
"in the air for a strong mid-air boost even while moving fast"
msgstr ""
+"Os foguetes do Devastador podem ser detonados instantaneamente (caso "
+"contrário, há um pequeno atraso). Isso permite aos jogadores atirarem e "
+"detonarem um foguete de Devastador enquanto estiverem no ar para ganharem um "
+"forte impulso, mesmo que em rápida velocidade."
#: qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc:235
msgid "Players will drop all weapons they possessed when they are killed"
#: qcsrc/menu/xonotic/dialog_multiplayer_profile.qc:136
msgid "Allow player statistics to rank you in leaderboards"
msgstr ""
+"Permitir que as estatísticas de jogador classifiquem você no placar de "
+"líderes"
#: qcsrc/menu/xonotic/dialog_multiplayer_profile.qc:152
msgid "Country"
#: qcsrc/menu/xonotic/dialog_settings_effects.qc:129
msgid "Disable sky for performance and visibility"
-msgstr ""
+msgstr "Desativar céu para ganhar desempenho e visibilidade"
#: qcsrc/menu/xonotic/dialog_settings_effects.qc:129
msgid "Show sky"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "Somente em Duelo"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
#: qcsrc/menu/xonotic/keybinder.qc:135
msgid "waypoint editor menu"
-msgstr ""
+msgstr "menu do editor de ponto de interesse"
#: qcsrc/menu/xonotic/mainwindow.qc:96 qcsrc/menu/xonotic/mainwindow.qc:99
msgid "Do not press this button again!"
#: qcsrc/menu/xonotic/serverlist.qc:257
msgid "Remove the currently highlighted server from bookmarks"
-msgstr ""
+msgstr "Remove dos favoritos o servidor atualmente destacado"
#: qcsrc/menu/xonotic/serverlist.qc:261
msgid "SERVER^Favorite"
"Project-Id-Version: Xonotic\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-09 07:23+0200\n"
-"PO-Revision-Date: 2020-08-09 05:23+0000\n"
-"Last-Translator: divVerent <divVerent@xonotic.org>\n"
+"PO-Revision-Date: 2020-08-09 07:31+0000\n"
+"Last-Translator: Andrei Stepanov <adem4ik@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/team-xonotic/xonotic/"
"language/ru/)\n"
"Language: ru\n"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:58
msgid "Only in Duel"
-msgstr ""
+msgstr "Только в дуэли"
#: qcsrc/menu/xonotic/dialog_settings_game_model.qc:61
msgid "Body fading:"
ast "Asturian" "Asturianu" 64%
-de "German" "Deutsch" 99%
-de_CH "German (Switzerland)" "Deutsch (Schweiz)" 99%
+de "German" "Deutsch" 100%
+de_CH "German (Switzerland)" "Deutsch (Schweiz)" 100%
en "English" "English" 100%
en_AU "English (Australia)" "English (Australia)" 75%
-es "Spanish" "Español" 99%
-fr "French" "Français" 99%
+es "Spanish" "Español" 100%
+fr "French" "Français" 100%
ga "Irish" "Irish" 32%
it "Italian" "Italiano" 99%
hu "Hungarian" "Magyar" 47%
nl "Dutch" "Nederlands" 62%
pl "Polish" "Polski" 72%
pt "Portuguese" "Português" 84%
-pt_BR "Portuguese (Brazil)" "Português (Brasil)" 99%
+pt_BR "Portuguese (Brazil)" "Português (Brasil)" 100%
ro "Romanian" "Romana" 74%
fi "Finnish" "Suomi" 99%
+tr "Turkish" "Türkçe" 30%
+cs "Czech" "Čeština" 30%
el "Greek" "Ελληνική" 47%
be "Belarusian" "Беларуская" 54%
bg "Bulgarian" "Български" 63%
-ru "Russian" "Русский" 99%
+ru "Russian" "Русский" 100%
sr "Serbian" "Српски" 64%
uk "Ukrainian" "Українська" 50%
zh_CN "Chinese (China)" "中文" 57%
zh_TW "Chinese (Taiwan)" "國語" 61%
-ja_JP "Japanese" "日本語" 99%
+ja_JP "Japanese" "日本語" 100%
ko "Korean" "한국의" 29%
// todo: make crosshair hit indication dependent on damage dealt
if(autocvar_crosshair_hitindication)
{
- vector hitindication_color = ((autocvar_crosshair_color_special == 1) ? stov(autocvar_crosshair_hitindication_per_weapon_color) : stov(autocvar_crosshair_hitindication_color));
+ vector col = ((autocvar_crosshair_color_special == 1) ? stov(autocvar_crosshair_hitindication_per_weapon_color) : stov(autocvar_crosshair_hitindication_color));
if(unaccounted_damage)
{
hitindication_crosshair_size = 0;
wcross_scale += sin(hitindication_crosshair_size) * autocvar_crosshair_hitindication;
- wcross_color.x += sin(hitindication_crosshair_size) * hitindication_color.x;
- wcross_color.y += sin(hitindication_crosshair_size) * hitindication_color.y;
- wcross_color.z += sin(hitindication_crosshair_size) * hitindication_color.z;
+ wcross_color.x += sin(hitindication_crosshair_size) * col.x;
+ wcross_color.y += sin(hitindication_crosshair_size) * col.y;
+ wcross_color.z += sin(hitindication_crosshair_size) * col.z;
}
// no effects needed for targeting enemies, this can't possibly span all valid targets!
int weapon_clipsize = wepent.clip_size;
float arc_heat = wepent.arc_heat_percent;
- float vcharge = wepent.vortex_charge;
- float vchargepool = wepent.vortex_chargepool_ammo;
- float oknex_charge_ = wepent.oknex_charge;
- float oknex_chargepool_ = wepent.oknex_chargepool_ammo;
if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
- vortex_charge_movingavg = vcharge;
+ vortex_charge_movingavg = wepent.vortex_charge;
- // handle the values
- if (autocvar_crosshair_ring && wepent.activeweapon == WEP_VORTEX && vcharge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
+ float charge = 0;
+ float chargepool = 0;
+ bool ring_vortex_enabled = false;
+ if (autocvar_crosshair_ring && autocvar_crosshair_ring_vortex)
{
- if (vchargepool || use_vortex_chargepool) {
- use_vortex_chargepool = 1;
- ring_inner_value = vchargepool;
- } else {
- vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * vcharge;
- ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (vcharge - vortex_charge_movingavg), 1);
+ if (wepent.activeweapon == WEP_VORTEX)
+ {
+ charge = wepent.vortex_charge;
+ chargepool = wepent.vortex_chargepool_ammo;
}
-
- ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
- ring_inner_rgb = vec3(autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_blue);
- ring_inner_image = "gfx/crosshair_ring_inner.tga";
-
- // draw the outer ring to show the current charge of the weapon
- ring_value = vcharge;
- ring_alpha = autocvar_crosshair_ring_vortex_alpha;
- ring_rgb = wcross_color;
- ring_image = "gfx/crosshair_ring_nexgun.tga";
+ else if (wepent.activeweapon == WEP_OVERKILL_NEX)
+ {
+ charge = wepent.oknex_charge;
+ chargepool = wepent.oknex_chargepool_ammo;
+ }
+ if (charge)
+ ring_vortex_enabled = true;
}
- else if (autocvar_crosshair_ring && (wepent.activeweapon == WEP_OVERKILL_NEX) && oknex_charge_ && autocvar_crosshair_ring_vortex)
+
+ if (ring_vortex_enabled)
{
- if (oknex_chargepool_ || use_vortex_chargepool) {
+ if (chargepool || use_vortex_chargepool) {
use_vortex_chargepool = 1;
- ring_inner_value = oknex_chargepool_;
+ ring_inner_value = chargepool;
} else {
- vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * oknex_charge_;
- ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (oknex_charge_ - vortex_charge_movingavg), 1);
+ float rate = autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate;
+ vortex_charge_movingavg = (1 - rate) * vortex_charge_movingavg + rate * charge;
+ ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (charge - vortex_charge_movingavg), 1);
}
ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
- ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
+ ring_inner_rgb = vec3(autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_blue);
ring_inner_image = "gfx/crosshair_ring_inner.tga";
// draw the outer ring to show the current charge of the weapon
- ring_value = oknex_charge_;
+ ring_value = charge;
ring_alpha = autocvar_crosshair_ring_vortex_alpha;
ring_rgb = wcross_color;
ring_image = "gfx/crosshair_ring_nexgun.tga";
}
else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
{
- ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
+ ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1);
ring_alpha = autocvar_crosshair_ring_minelayer_alpha;
ring_rgb = wcross_color;
ring_image = "gfx/crosshair_ring.tga";
myPos.y += (mySize.y / resize - mySize.y);
// this is where the origin of the string
float namewidth = mySize.x;
- if (autocvar_hud_shownames_status && this.sameteam)
+ if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
{
vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
void View_Lock()
{
- int lock_type = (!autocvar_hud_cursormode && ((autocvar__hud_configure && spectatee_status <= 0) || intermission > 1 || QuickMenu_IsOpened()));
- if (lock_type == 0)
- lock_type = autocvar_cl_lockview;
+ int lock_type = autocvar_cl_lockview;
+
+ if (!autocvar_hud_cursormode
+ && ((autocvar__hud_configure && spectatee_status <= 0)
+ || intermission > 1
+ || HUD_Radar_Clickable()
+ || HUD_MinigameMenu_IsOpened()
+ || QuickMenu_IsOpened()
+ )
+ )
+ lock_type = 1;
// lock_type 1: lock origin and angles
// lock_type 2: lock only origin
{
if (voicetype == VOICETYPE_AUTOTAUNT)
{
- if (!sv_autotaunt) break;
+ if (!autocvar_sv_autotaunt) break;
}
else if (IS_PLAYER(this) && !IS_DEAD(this))
animdecide_setaction(this, ANIMACTION_TAUNT, true);
- if (!sv_taunt) break;
+ if (!autocvar_sv_taunt) break;
if (autocvar_sv_gentle) break;
float tauntrand = 0;
if (voicetype == VOICETYPE_AUTOTAUNT) tauntrand = random();
#pragma once
#include <common/mutators/base.qh>
+#include <server/elimination.qh>
#include <server/round_handler.qh>
#include <server/miscfunctions.qh>
#include <server/command/sv_cmd.qh>
#include <server/command/vote.qh>
#include <server/client.qh>
#include <server/gamelog.qh>
+#include <server/intermission.qh>
#include <server/damage.qh>
#include <server/world.qh>
#include <server/items/items.qh>
#include <server/race.qh>
#include <server/world.qh>
#include <server/gamelog.qh>
+#include <server/intermission.qh>
#include <server/items/spawning.qh>
#include <server/weapons/common.qh>
#include <common/mapobjects/triggers.qh>
#include "sv_freezetag.qh"
+#include <server/elimination.qh>
#include <server/resources.qh>
float autocvar_g_freezetag_frozen_maxtime;
#include <server/client.qh>
#include <server/world.qh>
#include <server/gamelog.qh>
+#include <server/intermission.qh>
#include <server/race.qh>
#include <common/ent_cs.qh>
#include <common/mapobjects/triggers.qh>
{
spawnfunc_trigger_relay(this);
}
+
+spawnfunc(target_delay)
+{
+ if(!this.wait)
+ this.wait = 1;
+ if(!this.delay)
+ this.delay = this.wait; // fall back to quake 3 field
+ spawnfunc_trigger_relay(this);
+}
#endif
#include "triggers.qh"
+bool isPushable(entity e)
+{
+ if(e.pushable)
+ return true;
+#ifdef SVQC
+ if(IS_VEHICLE(e))
+ return false;
+ if(e.iscreature)
+ return true;
+ if (Item_IsLoot(e))
+ {
+ return true;
+ }
+ switch(e.classname)
+ {
+ case "body":
+ return true;
+ case "bullet": // antilagged bullets can't hit this either
+ return false;
+ }
+ if (e.projectiledeathtype)
+ return true;
+#endif
+#ifdef CSQC
+ if(e.flags & FL_PROJECTILE)
+ return true;
+ if(e.isplayermodel)
+ return true;
+#endif
+ return false;
+}
+
void SUB_DontUseTargets(entity this, entity actor, entity trigger) { }
void SUB_UseTargets(entity this, entity actor, entity trigger);
int deathtype = M_ARGV(5, int);
float potential_damage = M_ARGV(6, float);
if(DEATH_WEAPONOF(deathtype) == WEP_VAPORIZER) return;
+ if(deathtype == DEATH_FIRE.m_id || deathtype == DEATH_BUFF.m_id) return; // TODO: exclude damage over time and thorn effects
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if (
(SV_DAMAGETEXT_ALL()) ||
_force /= autocvar_g_nades_nade_lifetime;
_force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
vector dir = (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05);
- dir = W_CalculateSpread(dir, autocvar_g_nades_spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
+ dir = W_CalculateSpread(dir, autocvar_g_nades_spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
toss_nade(this, true, dir * _force, 0);
}
}
_force /= autocvar_g_nades_nade_lifetime;
_force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
vector dir = (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1);
- dir = W_CalculateSpread(dir, autocvar_g_nades_spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
+ dir = W_CalculateSpread(dir, autocvar_g_nades_spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
toss_nade(player, false, dir * _force, 0);
}
}
FOREACH_CLIENT(true, LAMBDA(
if (it == actor || (IS_SPEC(it) && it.enemy == actor))
{
- wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+ wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
}
));
animdecide_setaction(actor, ANIMACTION_SHOOT, true);
FOREACH_CLIENT(true, LAMBDA(
if (it == actor || (IS_SPEC(it) && it.enemy == actor))
{
- wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+ wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
}
));
animdecide_setaction(actor, ANIMACTION_SHOOT, true);
FOREACH_CLIENT(true, LAMBDA(
if (it == actor || (IS_SPEC(it) && it.enemy == actor))
{
- wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+ wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
}
));
animdecide_setaction(actor, ANIMACTION_SHOOT, true);
FOREACH_CLIENT(true, LAMBDA(
if (it == actor || (IS_SPEC(it) && it.enemy == actor))
{
- wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+ wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
}
));
animdecide_setaction(actor, ANIMACTION_SHOOT, true);
FOREACH_CLIENT(true, LAMBDA(
if (it == actor || (IS_SPEC(it) && it.enemy == actor))
{
- wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, g_weaponratefactor, true);
+ wframe_send(it, actor.(weaponentity), WFRAME_FIRE2, autocvar_g_weaponratefactor, true);
}
));
animdecide_setaction(actor, ANIMACTION_SHOOT, true);
#include "sv_sandbox.qh"
+#include <server/intermission.qh>
+
string autocvar_g_sandbox;
int autocvar_g_sandbox_info;
bool autocvar_g_sandbox_readonly;
SET_JUMP_HELD(this);
#ifdef SVQC
-
- this.oldvelocity_z = this.velocity_z;
-
animdecide_setaction(this, ANIMACTION_JUMP, true);
if (autocvar_g_jump_grunt)
void PM_Footsteps(entity this)
{
#ifdef SVQC
- if (!g_footsteps) return;
+ if (!autocvar_g_footsteps) return;
if (IS_DUCKED(this)) return;
if (time >= this.lastground + 0.2) return;
if (vdist(this.velocity, <=, autocvar_sv_maxspeed * 0.6)) return;
#define IS_CLIENT(s) (((s).isplayermodel & ISPLAYER_CLIENT) || (s) == csqcplayer)
#define IS_PLAYER(s) ((s).isplayermodel & ISPLAYER_PLAYER)
#define IS_NOT_A_CLIENT(s) (!(s).isplayermodel && (s) != csqcplayer)
- #define isPushable(s) ((s).isplayermodel || (s).pushable || ((s).flags & FL_PROJECTILE))
//float player_multijump;
//float player_jumpheight;
#include <server/client.qh>
#include "../server/anticheat.qh"
#include <common/stats.qh>
+ #include <server/intermission.qh>
#include "../server/scores.qh"
#include <server/world.qh>
#include "../server/weapons/accuracy.qh"
#include "sound.qh"
+#ifdef SVQC
+void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
+
+void stopsoundto(float _dest, entity e, float chan);
+
+void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch);
+
+bool sound_allowed(int dest, entity e);
+
+float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
+
+void play2(entity e, string filename);
+
+void play2all(string samp);
+
+void play2team(float t, string filename);
+
+void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float _pitch);
+
+void stopsound(entity e, float chan);
+#endif
+
REGISTRY(Sounds, BITS(9))
REGISTER_REGISTRY(Sounds)
#elif defined(MENUQC)
#elif defined(SVQC)
#include <common/items/_mod.qh>
- #include <lib/warpzone/anglestransform.qh>
- #include <lib/warpzone/common.qh>
- #include <lib/warpzone/util_server.qh>
- #include <lib/warpzone/server.qh>
- #include "../constants.qh"
- #include "../stats.qh"
- #include "../teams.qh"
- #include <common/util.qh>
- #include "../monsters/_mod.qh"
- #include "config.qh"
- #include <server/weapons/common.qh>
- #include <server/weapons/csqcprojectile.qh>
- #include <server/weapons/tracing.qh>
- #include <server/items/spawning.qh>
- #include <server/autocvars.qh>
- #include "../notifications/all.qh"
- #include "../deathtypes/all.qh"
- #include <server/mutators/_mod.qh>
- #include "../mapinfo.qh"
- #include <server/command/_mod.qh>
- #include <lib/csqcmodel/sv_model.qh>
- #include <server/portals.qh>
- #include <server/hook.qh>
+ #include <lib/warpzone/anglestransform.qh>
+ #include <lib/warpzone/common.qh>
+ #include <lib/warpzone/util_server.qh>
+ #include <lib/warpzone/server.qh>
+ #include "../constants.qh"
+ #include "../stats.qh"
+ #include "../teams.qh"
+ #include <common/util.qh>
+ #include "../monsters/_mod.qh"
+ #include "config.qh"
+ #include <server/weapons/common.qh>
+ #include <server/weapons/csqcprojectile.qh>
+ #include <server/weapons/tracing.qh>
+ #include <server/items/spawning.qh>
+ #include <server/autocvars.qh>
+ #include "../notifications/all.qh"
+ #include "../deathtypes/all.qh"
+ #include <server/mutators/_mod.qh>
+ #include "../mapinfo.qh"
+ #include <server/command/_mod.qh>
+ #include <lib/csqcmodel/sv_model.qh>
+ #include <server/portals.qh>
+#include <server/hook.qh>
#endif
#ifdef GAMEQC
#include "calculations.qc"
Weapon e2 = REGISTRY_GET(Weapons, sj);
int d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10;
if (d != 0) return -d; // high impulse first!
- return strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),
- sprintf(" %d ", si), 0)
- -
- strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "),
- sprintf(" %d ", sj), 0)
- ; // low char index first!
+ string s = strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " ");
+ return strstrofs(s, sprintf(" %d ", si), 0)
+ - strstrofs(s, sprintf(" %d ", sj), 0); // low char index first!
}
string W_FixWeaponOrder_BuildImpulseList(string o)
{
int idx = 0;
// v_ model attached to invisible h_ model
if (this.weaponchild
- && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
+ && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
{
this.spawnorigin = gettaginfo(this.weaponchild, idx);
}
int compressed_shotorg = compressShotOrigin(this.movedir);
// make them match perfectly
#ifdef SVQC
- // null during init
- if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
- this.movedir = decompressShotOrigin(compressed_shotorg);
-#else
- this.movedir = decompressShotOrigin(compressed_shotorg);
+ // null during init
+ if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
#endif
+ this.movedir = decompressShotOrigin(compressed_shotorg);
this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount
{
WFRAME fr = ReadByte();
float t = ReadFloat();
- int slot = ReadByte();
+ int slot = ReadByte();
bool restartanim = ReadByte();
entity wepent = viewmodels[slot];
if(fr == WFRAME_IDLE)
case WS_DROP:
wepent.weapon_switchdelay = wepent.activeweapon.switchdelay_drop;
break;
- default:
- wepent.weapon_switchdelay = 0;
- break;
+ default:
+ wepent.weapon_switchdelay = 0;
+ break;
}
return true;
}
{
return = true;
int weapon_id = ReadByte();
- int slot = ReadByte();
- vector sv_shotorg = ReadVector();
+ int slot = ReadByte();
+ vector sv_shotorg = ReadVector();
Weapon thiswep = REGISTRY_GET(Weapons, weapon_id);
- vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
+ vector viewangles = getpropertyvec(VF_CL_VIEWANGLES);
vector forward, right, up;
MAKE_VECTORS(viewangles, forward, right, up);
pointparticles(thiswep.m_muzzleeffect, sv_shotorg, forward * 1000, 1);
return;
}
- if(!autocvar_r_drawviewmodel) return;
+ if(!autocvar_r_drawviewmodel) return;
entity wepent = viewmodels[slot];
// get the local player entity to calculate shot origin
float sigma;
vector v1 = '0 0 0', v2;
float dx, dy, r;
- spread *= spreadfactor; //g_weaponspreadfactor;
+ spread *= spreadfactor; //autocvar_g_weaponspreadfactor;
if(spread <= 0)
return forward;
if(!v_shot_idx || this.beam_usevieworigin != 2)
{
this.beam_shotorigin = wepent.movedir;
- origin_offset =
- right * -this.beam_shotorigin.y
- + up * this.beam_shotorigin.z;
+ origin_offset = right * -this.beam_shotorigin.y + up * this.beam_shotorigin.z;
}
else
this.beam_shotorigin = '0 0 0';
s.y = v_forward.x;
s.z = v_forward.y;
}
- s = s * WEP_CVAR_PRI(crylink, spread) * g_weaponspreadfactor;
+ s = s * WEP_CVAR_PRI(crylink, spread) * autocvar_g_weaponspreadfactor;
W_SetupProjVelocity_Explicit(proj, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_PRI(crylink, speed), 0, 0, 0, false);
settouch(proj, W_Crylink_Touch);
s.y = v_forward.x;
s.z = v_forward.y;
}
- s = s * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor;
+ s = s * WEP_CVAR_SEC(crylink, spread) * autocvar_g_weaponspreadfactor;
s = w_shotdir + right * s.y + up * s.z;
}
else
{
- s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * g_weaponspreadfactor);
+ s = (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * WEP_CVAR_SEC(crylink, spread) * autocvar_g_weaponspreadfactor);
}
W_SetupProjVelocity_Explicit(proj, s, v_up, WEP_CVAR_SEC(crylink, speed), 0, 0, 0, false);
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH;
+ proj.missile_flags = MIF_SPLASH;
CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH | MIF_PROXY;
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY;
CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
proj.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, proj);
IL_PUSH(g_bot_dodge, proj);
- proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
+ proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
// per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
spread_pershot = ((shots - 1) / (WEP_CVAR_SEC(hagar, load_max) - 1));
spread_pershot = (1 - (spread_pershot * WEP_CVAR_SEC(hagar, load_spread_bias)));
- spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * g_weaponspreadfactor);
+ spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * autocvar_g_weaponspreadfactor);
// pattern spread calculation
s = '0 0 0';
s.y = v_forward.x;
s.z = v_forward.y;
}
- s = s * WEP_CVAR_SEC(hagar, load_spread) * g_weaponspreadfactor;
+ s = s * WEP_CVAR_SEC(hagar, load_spread) * autocvar_g_weaponspreadfactor;
W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, false);
void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity)
{
entity missile;
- float spread;
W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(hlac, ammo), weaponentity);
- spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
- spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
- if(IS_DUCKED(actor))
- spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
+ float spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * actor.(weaponentity).misc_bulletcounter);
+ spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
+ if(IS_DUCKED(actor))
+ spread = spread * WEP_CVAR_PRI(hlac, spread_crouchmod);
W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hlac, damage), thiswep.m_id);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
missile.owner = missile.realowner = actor;
missile.bot_dodge = true;
- missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
+ missile.bot_dodgerating = WEP_CVAR_PRI(hlac, damage);
set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
settouch(missile, W_HLAC_Touch);
setthink(missile, SUB_Remove);
- missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
+ missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
missile.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, missile);
void W_HLAC_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
{
entity missile;
- float spread;
+ float spread = WEP_CVAR_SEC(hlac, spread);
- spread = WEP_CVAR_SEC(hlac, spread);
-
-
- if(IS_DUCKED(actor))
- spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
+ if(IS_DUCKED(actor))
+ spread = spread * WEP_CVAR_SEC(hlac, spread_crouchmod);
W_SetupShot(actor, weaponentity, false, 3, SND_LASERGUN_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hlac, damage), thiswep.m_id | HITTYPE_SECONDARY);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
missile.owner = missile.realowner = actor;
missile.bot_dodge = true;
- missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
+ missile.bot_dodgerating = WEP_CVAR_SEC(hlac, damage);
set_movetype(missile, MOVETYPE_FLY);
PROJECTILE_MAKETRIGGER(missile);
settouch(missile, W_HLAC_Touch);
setthink(missile, SUB_Remove);
- missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
+ missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
missile.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, missile);
ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(hlac, refire) * W_WeaponRateFactor(actor);
W_HLAC_Attack(thiswep, actor, weaponentity);
actor.(weaponentity).misc_bulletcounter = actor.(weaponentity).misc_bulletcounter + 1;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame);
}
else
{
void W_HLAC_Attack2_Frame(Weapon thiswep, entity actor, .entity weaponentity)
{
- float i;
-
W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hlac, ammo), weaponentity);
- for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
- W_HLAC_Attack2(thiswep, actor, weaponentity);
+ for(float i = WEP_CVAR_SEC(hlac, shots); i > 0; --i)
+ W_HLAC_Attack2(thiswep, actor, weaponentity);
if(!autocvar_g_norecoil)
{
fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pHeadshotDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK));
if(autocvar_g_casings >= 2)
- {
- makevectors(actor.v_angle); // for some reason, this is lost
+ {
+ makevectors(actor.v_angle); // for some reason, this is lost
SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor, weaponentity);
- }
+ }
}
void W_Rifle_Attack(Weapon thiswep, entity actor, .entity weaponentity)
for(int sc = 0;sc < bullets;sc = sc + 1)
fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, 0, force, thiswep.m_id, bullet_trail_effect, false);
-
+
if(lag && bullets > 0)
antilag_restore_all(actor);
NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
{
float charge;
- vector shotorg = ReadVector();
- vector endpos = ReadVector();
+ vector shotorg = ReadVector();
+ vector endpos = ReadVector();
charge = ReadByte() / 255.0;
//pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
myforcehalflife = WEP_CVAR_BOTH(vortex, !issecondary, damagefalloff_forcehalflife);
myammo = WEP_CVAR_BOTH(vortex, !issecondary, ammo);
- float dtype = thiswep.m_id;
- if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
- dtype |= HITTYPE_ARMORPIERCE;
+ float dtype = thiswep.m_id;
+ if(WEP_CVAR_BOTH(vortex, !issecondary, armorpierce))
+ dtype |= HITTYPE_ARMORPIERCE;
float flying;
flying = IsFlying(actor); // do this BEFORE to make the trace values from FireRailgunBullet last
actor.vortex_lasthit = damage_goodhits;
//beam done on client
- vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
+ vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
SendCSQCVortexBeamParticle(charge);
//idea: eukara
//darkplaces implementation: Cloudwalk
-// Do NOT use in production yet.
-string __fullspawndata;
+//Do NOT use in production yet. Uncomment if you intend to use it
+//string __fullspawndata;
//description:
-// http://icculus.org/finger/marco?date=2019-01-25&time=05-38-02
+//http://icculus.org/finger/marco?date=2019-01-25&time=05-38-02
//DP_QC_FS_SEARCH_PACKFILE
//idea: Mario
//////////////////////////////////////////////////
// AK FIXME: Create perhaps a special builtin file for the common cmds
-void checkextension(string ext) = #1;
+float checkextension(string ext) = #1;
// error cmds
void error(string err,...) = #2;
//idea: Mario
//darkplaces implementation: Mario
//builtin definitions:
-float(string pattern, float caseinsensitive, float quiet, string packfile) search_packfile_begin = #444;
+float(string pattern, float caseinsensitive, float quiet, string packfile) search_packfile_begin = #74;
//description:
//extension to search_begin (DP_QC_FS_SEARCH), performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
//only searches for files within the specified packfile, which is expected to match the results of whichpack().
{
int buttons = PHYS_INPUT_BUTTON_MASK(this);
anticheat_physics(this);
- if (sv_maxidle > 0) {
+ if (autocvar_sv_maxidle > 0) {
if (buttons != CS(this).buttons_old
|| CS(this).movement != CS(this).movement_old
|| this.v_angle != CS(this).v_angle_old) { CS(this).parm_idlesince = time; }
return input;
}
+/**
+ * Evaluate an expression of the form: [+ | -]? [var[op]val | [op]var | val | var] ...
+ * +: all must match. this is the default
+ * -: one must NOT match
+ *
+ * var>x
+ * var<x
+ * var>=x
+ * var<=x
+ * var==x
+ * var!=x
+ * var===x
+ * var!==x
+ */
+ERASEABLE
+bool expr_evaluate(string s)
+{
+ bool ret = false;
+ if (str2chr(s, 0) == '+') {
+ s = substring(s, 1, -1);
+ } else if (str2chr(s, 0) == '-') {
+ ret = true;
+ s = substring(s, 1, -1);
+ }
+ bool expr_fail = false;
+ for (int i = 0, n = tokenize_console(s); i < n; ++i) {
+ int o;
+ string k, v;
+ s = argv(i);
+ #define X(expr) \
+ if (expr) \
+ continue; \
+ expr_fail = true; \
+ break;
+
+ #define BINOP(op, len, expr) \
+ if ((o = strstrofs(s, op, 0)) >= 0) { \
+ k = substring(s, 0, o); \
+ v = substring(s, o + len, -1); \
+ X(expr); \
+ }
+ BINOP(">=", 2, cvar(k) >= stof(v));
+ BINOP("<=", 2, cvar(k) <= stof(v));
+ BINOP(">", 1, cvar(k) > stof(v));
+ BINOP("<", 1, cvar(k) < stof(v));
+ BINOP("==", 2, cvar(k) == stof(v));
+ BINOP("!=", 2, cvar(k) != stof(v));
+ BINOP("===", 3, cvar_string(k) == v);
+ BINOP("!==", 3, cvar_string(k) != v);
+ {
+ k = s;
+ bool b = true;
+ if (str2chr(k, 0) == '!') {
+ k = substring(s, 1, -1);
+ b = false;
+ }
+ float f = stof(k);
+ bool isnum = ftos(f) == k;
+ X(boolean(isnum ? f : cvar(k)) == b);
+ }
+ #undef BINOP
+ #undef X
+ }
+ if (!expr_fail) {
+ ret = !ret;
+ }
+ // now ret is true if we want to keep the item, and false if we want to get rid of it
+ return ret;
+}
+
ERASEABLE
void RegisterCvars_Set(string name, string def, string desc, bool archive, string file)
{
/** If this global exists, only functions with spawnfunc_ name prefix qualify as spawn functions */
noref bool require_spawnfunc_prefix;
.bool spawnfunc_checked;
+/** Not for production use, provides access to a dump of the entity's fields when it is parsed from map data */
+//noref string __fullspawndata;
.string fullspawndata;
#include <server/client.qc>
#include <server/clientkill.qc>
#include <server/damage.qc>
+#include <server/elimination.qc>
#include <server/gamelog.qc>
#include <server/handicap.qc>
#include <server/hook.qc>
#include <server/impulse.qc>
+#include <server/intermission.qc>
#include <server/ipban.qc>
#include <server/main.qc>
#include <server/mapvoting.qc>
#include <server/client.qh>
#include <server/clientkill.qh>
#include <server/damage.qh>
+#include <server/elimination.qh>
#include <server/gamelog.qh>
#include <server/handicap.qh>
#include <server/hook.qh>
#include <server/impulse.qh>
+#include <server/intermission.qh>
#include <server/ipban.qh>
#include <server/main.qh>
#include <server/mapvoting.qh>
bool autocvar_g_weaponswitch_debug_alternate;
bool autocvar_g_allow_checkpoints;
bool autocvar_sv_q3compat_changehitbox;
+int autocvar_sv_clones;
+bool autocvar_g_footsteps;
+float autocvar_sv_maxidle;
+bool autocvar_sv_maxidle_spectatorsareidle;
+int autocvar_sv_maxidle_slots;
+bool autocvar_sv_maxidle_slots_countbots;
+bool autocvar_sv_autotaunt;
+bool autocvar_g_warmup_allguns;
+bool autocvar_g_warmup_allow_timeout;
+float autocvar_g_weaponspreadfactor;
+float autocvar_g_weaponforcefactor;
+float autocvar_g_weapondamagefactor;
+float autocvar_g_weaponratefactor;
+float autocvar_g_weaponspeedfactor;
+float autocvar_sv_foginterval;
+bool autocvar_sv_ready_restart_repeatable;
+bool autocvar_g_jetpack;
+bool autocvar_sv_taunt;
+bool autocvar_sv_ready_restart;
this.wp_goal_prev0 = e;
}
- if(g_jetpack)
- if(e==this.navigation_jetpack_goal)
+ if((this.items & IT_JETPACK) && e == this.navigation_jetpack_goal)
return true;
// if it can reach the goal there is nothing more to do
#include <common/stats.qh>
#include "cheats.qh"
+#include <server/intermission.qh>
#include "miscfunctions.qh"
#include "world.qh"
return 0;
if(i == CHIMPULSE_CLONE_MOVING.impulse || i == CHIMPULSE_CLONE_STANDING.impulse)
- if(this.lip < sv_clones)
+ if(this.lip < autocvar_sv_clones)
return 1;
// haha
#include "damage.qh"
#include "handicap.qh"
#include "hook.qh"
+#include <server/intermission.qh>
#include "command/common.qh"
#include "command/vote.qh"
#include "clientkill.qh"
#include <common/weapons/weapon/vortex.qh>
+#define CHAT_NOSPECTATORS() ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
+
STATIC_METHOD(Client, Add, void(Client this, int _team))
{
ClientConnect(this);
/** putting a client as observer in the server */
void PutObserverInServer(entity this)
{
- bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
+ bool mutator_returnvalue = MUTATOR_CALLHOOK(MakePlayerObserver, this);
PlayerState_detach(this);
if (IS_PLAYER(this))
if (vote_called) { VoteCount(false); }
ReadyCount();
}
- }
+ }
- {
- entity spot = SelectSpawnPoint(this, true);
- if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
- this.angles = vec2(spot.angles);
- this.fixangle = true;
- // offset it so that the spectator spawns higher off the ground, looks better this way
- setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
- if (IS_REAL_CLIENT(this))
- {
- msg_entity = this;
- WriteByte(MSG_ONE, SVC_SETVIEW);
- WriteEntity(MSG_ONE, this);
- }
- // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
- // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
- if(!autocvar_g_debug_globalsounds)
- {
- // needed for player sounds
- this.model = "";
- FixPlayermodel(this);
- }
- setmodel(this, MDL_Null);
- setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
- this.view_ofs = '0 0 0';
- }
+ entity spot = SelectSpawnPoint(this, true);
+ if (!spot) LOG_FATAL("No spawnpoints for observers?!?");
+ this.angles = vec2(spot.angles);
+ this.fixangle = true;
+ // offset it so that the spectator spawns higher off the ground, looks better this way
+ setorigin(this, spot.origin + STAT(PL_VIEW_OFS, this));
+ if (IS_REAL_CLIENT(this))
+ {
+ msg_entity = this;
+ WriteByte(MSG_ONE, SVC_SETVIEW);
+ WriteEntity(MSG_ONE, this);
+ }
+ // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
+ // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
+ if(!autocvar_g_debug_globalsounds)
+ {
+ // needed for player sounds
+ this.model = "";
+ FixPlayermodel(this);
+ }
+ setmodel(this, MDL_Null);
+ setsize(this, STAT(PL_CROUCH_MIN, this), STAT(PL_CROUCH_MAX, this));
+ this.view_ofs = '0 0 0';
- RemoveGrapplingHooks(this);
+ RemoveGrapplingHooks(this);
Portal_ClearAll(this);
Unfreeze(this, false);
SetSpectatee(this, NULL);
WaypointSprite_PlayerDead(this);
- if (CS(this).killcount != FRAGS_SPECTATOR)
- {
- if(!game_stopped)
- if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2))
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
- }
+ if (CS(this).killcount != FRAGS_SPECTATOR && !game_stopped && CHAT_NOSPECTATORS())
+ Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
accuracy_resend(this);
if(this.monster_attack)
IL_REMOVE(g_monster_targets, this);
this.monster_attack = false;
- STAT(HUD, this) = HUD_NORMAL;
+ STAT(HUD, this) = HUD_NORMAL;
TRANSMUTE(Observer, this);
this.iscreature = false;
this.teleportable = TELEPORT_SIMPLE;
WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[2]));
WriteInt24_t(channel, compressShotOrigin(arc_shotorigin[3]));
- if(sv_foginterval && world.fog != "")
+ if(autocvar_sv_foginterval && world.fog != "")
WriteString(channel, world.fog);
else
WriteString(channel, "");
CS(this).parm_idlesince = time;
// whatever happens, allow 60 seconds of idling directly after connect for map loading
- CS(this).parm_idlesince = max(CS(this).parm_idlesince, time - sv_maxidle + 60);
+ CS(this).parm_idlesince = max(CS(this).parm_idlesince, time - autocvar_sv_maxidle + 60);
MUTATOR_CALLHOOK(DecodeLevelParms);
}
modifications = strcat(modifications, ", Low gravity");
if(g_weapon_stay && !g_cts)
modifications = strcat(modifications, ", Weapons stay");
- if(g_jetpack)
+ if(autocvar_g_jetpack)
modifications = strcat(modifications, ", Jet pack");
if(autocvar_g_powerups == 0)
modifications = strcat(modifications, ", No powerups");
stuffcmd(this, "cl_cmd settemp chase_active 1\n");
}
- if (!sv_foginterval && world.fog != "")
+ if (!autocvar_sv_foginterval && world.fog != "")
stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AvailableTeams() == 2))
if(IS_SPEC(this))
SetSpectatee(this, NULL);
- MUTATOR_CALLHOOK(ClientDisconnect, this);
+ MUTATOR_CALLHOOK(ClientDisconnect, this);
strfree(CS(this).netname_previous); // needs to be before the CS entity is removed!
strfree(CS(this).weaponorder_byimpulse);
switch (MUTATOR_CALLHOOK(SpectatePrev, this, ent, first))
{
case MUT_SPECPREV_FOUND:
- ent = M_ARGV(1, entity);
- break;
+ ent = M_ARGV(1, entity);
+ break;
case MUT_SPECPREV_RETURN:
- return true;
+ return true;
case MUT_SPECPREV_CONTINUE:
default:
{
}
if (timeout_status == TIMEOUT_ACTIVE) {
- // don't allow the player to turn around while game is paused
+ // don't allow the player to turn around while game is paused
// FIXME turn this into CSQC stuff
this.v_angle = this.lastV_angle;
this.angles = this.lastV_angle;
{
Player_Physics(this);
- if (sv_maxidle > 0)
+ if (autocvar_sv_maxidle > 0)
if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
if (IS_REAL_CLIENT(this))
- if (IS_PLAYER(this) || sv_maxidle_spectatorsareidle)
+ if (IS_PLAYER(this) || autocvar_sv_maxidle_spectatorsareidle)
{
int totalClients = 0;
- if(sv_maxidle_slots > 0)
+ if(autocvar_sv_maxidle_slots > 0)
{
- FOREACH_CLIENT(IS_REAL_CLIENT(it) || sv_maxidle_slots_countbots,
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) || autocvar_sv_maxidle_slots_countbots,
{
++totalClients;
});
}
- if (sv_maxidle_slots > 0 && (maxclients - totalClients) > sv_maxidle_slots)
+ if (autocvar_sv_maxidle_slots > 0 && (maxclients - totalClients) > autocvar_sv_maxidle_slots)
{ /* do nothing */ }
else if (time - CS(this).parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
{
}
else
{
- float timeleft = ceil(sv_maxidle - (time - CS(this).parm_idlesince));
- if (timeleft == min(10, sv_maxidle - 1)) { // - 1 to support sv_maxidle <= 10
+ float timeleft = ceil(autocvar_sv_maxidle - (time - CS(this).parm_idlesince));
+ if (timeleft == min(10, autocvar_sv_maxidle - 1)) { // - 1 to support sv_maxidle <= 10
if (!CS(this).idlekick_lasttimeleft)
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
}
return;
}
else if (timeleft <= 10) {
- if (timeleft != CS(this).idlekick_lasttimeleft) {
- Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
- }
+ if (timeleft != CS(this).idlekick_lasttimeleft)
+ Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
CS(this).idlekick_lasttimeleft = timeleft;
}
}
var .float flood_field = floodcontrol_chat;
if(floodcontrol && source)
{
- float flood_spl;
- float flood_burst;
- float flood_lmax;
- float lines;
+ float flood_spl, flood_burst, flood_lmax;
if(privatesay)
{
flood_spl = autocvar_g_chat_flood_spl_tell;
{
getWrappedLine_remaining = msgstr;
msgstr = "";
- lines = 0;
+ int lines = 0;
while(getWrappedLine_remaining && (!flood_lmax || lines <= flood_lmax))
{
msgstr = strcat(msgstr, " ", getWrappedLineLen(82.4289758859709, strlennocol)); // perl averagewidth.pl < gfx/vera-sans.width
sourcecmsgstr = cmsgstr;
}
- if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer))
+ if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped
+ && (teamsay || CHAT_NOSPECTATORS()))
{
- if (!game_stopped)
- if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
- teamsay = -1; // spectators
+ teamsay = -1; // spectators
}
if(flood)
ret = 1;
}
- if (privatesay && source && !(IS_PLAYER(source) || source.caplayer))
+ if (privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped
+ && (IS_PLAYER(privatesay) || privatesay.caplayer) && CHAT_NOSPECTATORS())
{
- if (!game_stopped)
- if ((privatesay && (IS_PLAYER(privatesay) || privatesay.caplayer)) && ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)))
- ret = -1; // just hide the message completely
+ ret = -1; // just hide the message completely
}
MUTATOR_CALLHOOK(ChatMessage, source, ret);
#pragma once
#include "utils.qh"
+#include <server/intermission.qh>
#include <common/replicate.qh>
#include <common/sounds/all.qh>
.float pauserotarmor_finished;
.float pauserotfuel_finished;
-// idle kicking
-float sv_maxidle;
-float sv_maxidle_spectatorsareidle;
-int sv_maxidle_slots;
-bool sv_maxidle_slots_countbots;
-
// g_<gametype>_str:
// If 0, default is used.
// If <0, 0 is used.
int nJoinAllowed(entity this, entity ignore);
-void FixIntermissionClient(entity e);
-
void checkSpectatorBlock(entity this);
void PlayerUseKey(entity this);
{
if (IS_CLIENT(caller))
{
- if (warmup_stage || sv_ready_restart || g_race_qualifying == 2)
+ if (warmup_stage || autocvar_sv_ready_restart || g_race_qualifying == 2)
{
- if (!readyrestart_happened || sv_ready_restart_repeatable)
+ if (!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
{
if (time < game_starttime) // game is already restarting
return;
{
print_to(caller, "^7Error: You can not call a timeout while a vote is active.");
}
- else if (warmup_stage && !g_warmup_allow_timeout)
+ else if (warmup_stage && !autocvar_g_warmup_allow_timeout)
{
print_to(caller, "^7Error: You can not call a timeout in warmup-stage.");
}
#include <common/weapons/_all.qh>
#include <common/stats.qh>
+#include <server/intermission.qh>
#include <server/world.qh>
#include <server/miscfunctions.qh>
#include "../world.qh"
+#include <server/intermission.qh>
+
#include <common/util.qh>
#include <lib/csqcmodel/sv_model.qh>
#include "../world.qh"
#include "../ipban.qh"
#include "../teamplay.qh"
+#include <server/intermission.qh>
#include "../bot/api.qh"
bool shuffleteams_on_reset_map;
void shuffleteams();
-string GotoMap(string m);
-
void race_deleteTime(string map, float pos);
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
#include "common.qh"
#include "../damage.qh"
+#include <server/intermission.qh>
#include "../world.qh"
#include "../teamplay.qh"
#include "../race.qh"
if (!DEATH_ISSPECIAL(deathtype))
{
- damage *= g_weapondamagefactor;
- mirrordamage *= g_weapondamagefactor;
- complainteamdamage *= g_weapondamagefactor;
- force = force * g_weaponforcefactor;
- mirrorforce *= g_weaponforcefactor;
+ damage *= autocvar_g_weapondamagefactor;
+ mirrordamage *= autocvar_g_weapondamagefactor;
+ complainteamdamage *= autocvar_g_weapondamagefactor;
+ force = force * autocvar_g_weaponforcefactor;
+ mirrorforce *= autocvar_g_weaponforcefactor;
}
// should this be changed at all? If so, in what way?
--- /dev/null
+#include "elimination.qh"
+
+#include <common/net_linked.qh>
+#include <server/utils.qh>
+
+.float(entity) isEliminated;
+bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
+{
+ Stream out = MSG_ENTITY;
+ WriteHeader(out, ENT_CLIENT_ELIMINATEDPLAYERS);
+ serialize(byte, out, sendflags);
+ if (sendflags & 1) {
+ for (int i = 1; i <= maxclients; i += 8) {
+ int f = 0;
+ entity e = edict_num(i);
+ for (int b = 0; b < 8; ++b, e = nextent(e)) {
+ if (eliminatedPlayers.isEliminated(e)) {
+ f |= BIT(b);
+ }
+ }
+ serialize(byte, out, f);
+ }
+ }
+ return true;
+}
+
+void EliminatedPlayers_Init(float(entity) isEliminated_func)
+{
+ if(eliminatedPlayers)
+ {
+ backtrace("Can't spawn eliminatedPlayers again!");
+ return;
+ }
+ Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
+ eliminatedPlayers.isEliminated = isEliminated_func;
+}
--- /dev/null
+#pragma once
+
+entity eliminatedPlayers;
+void EliminatedPlayers_Init(float(entity) isEliminated_func);
#include "gamelog.qh"
#include <server/autocvars.qh>
-#include <server/miscfunctions.qh>
+#include <server/main.qh>
string GameLog_ProcessIP(string s)
{
Net_LinkEntity(missile, false, 0, GrapplingHookSend);
}
-void GrappleHookInit()
+// NOTE: using PRECACHE here to make sure it's called after everything else
+PRECACHE(GrappleHookInit)
{
if(g_grappling_hook)
{
.float hook_state;
.int state;
-void GrappleHookInit();
vector hook_shotorigin[4];
--- /dev/null
+#include "mapvoting.qh"
+
+#include <common/mapinfo.qh>
+#include <common/util.qh>
+#include <server/bot/api.qh>
+#include <server/campaign.qh>
+#include <server/client.qh>
+#include <server/mapvoting.qh>
+#include <server/scores_rules.qh>
+#include <server/world.qh>
+
+string GetGametype()
+{
+ return MapInfo_Type_ToString(MapInfo_LoadedGametype);
+}
+
+string GetMapname()
+{
+ return mapname;
+}
+
+float Map_Count, Map_Current;
+string Map_Current_Name;
+
+// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
+int GetMaplistPosition()
+{
+ string map = GetMapname();
+ int idx = autocvar_g_maplist_index;
+
+ if(idx >= 0)
+ {
+ if(idx < Map_Count)
+ {
+ if(map == argv(idx))
+ {
+ return idx;
+ }
+ }
+ }
+
+ for(int pos = 0; pos < Map_Count; ++pos)
+ {
+ if(map == argv(pos))
+ return pos;
+ }
+
+ // resume normal maplist rotation if current map is not in g_maplist
+ return idx;
+}
+
+bool MapHasRightSize(string map)
+{
+ int minplayers = max(0, floor(autocvar_minplayers));
+ if (teamplay)
+ minplayers = max(0, floor(autocvar_minplayers_per_team) * AvailableTeams());
+ if (autocvar_g_maplist_check_waypoints
+ && (currentbots || autocvar_bot_number || player_count < minplayers))
+ {
+ string checkwp_msg = strcat("checkwp ", map);
+ if(!fexists(strcat("maps/", map, ".waypoints")))
+ {
+ LOG_TRACE(checkwp_msg, ": no waypoints");
+ return false;
+ }
+ LOG_TRACE(checkwp_msg, ": has waypoints");
+ }
+
+ if(autocvar_g_maplist_ignore_sizes)
+ return true;
+
+ // open map size restriction file
+ string opensize_msg = strcat("opensize ", map);
+ float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
+ int player_limit = ((autocvar_g_maplist_sizes_count_maxplayers) ? GetPlayerLimit() : 0);
+ int pcount = ((player_limit > 0) ? min(player_count, player_limit) : player_count); // bind it to the player limit so that forced spectators don't influence the limits
+ if(!autocvar_g_maplist_sizes_count_bots)
+ pcount -= currentbots;
+ if(fh >= 0)
+ {
+ opensize_msg = strcat(opensize_msg, ": ok, ");
+ int mapmin = stoi(fgets(fh));
+ int mapmax = stoi(fgets(fh));
+ fclose(fh);
+ if(pcount < mapmin)
+ {
+ LOG_TRACE(opensize_msg, "not enough");
+ return false;
+ }
+ if(mapmax && pcount > mapmax)
+ {
+ LOG_TRACE(opensize_msg, "too many");
+ return false;
+ }
+ LOG_TRACE(opensize_msg, "right size");
+ return true;
+ }
+ LOG_TRACE(opensize_msg, ": not found");
+ return true;
+}
+
+string Map_Filename(int position)
+{
+ return strcat("maps/", argv(position), ".bsp");
+}
+
+void Map_MarkAsRecent(string m)
+{
+ cvar_set("g_maplist_mostrecent", strwords(cons(m, autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
+}
+
+bool Map_IsRecent(string m)
+{
+ return strhasword(autocvar_g_maplist_mostrecent, m);
+}
+
+bool Map_Check(int position, float pass)
+{
+ string filename;
+ string map_next;
+ map_next = argv(position);
+ if(pass <= 1)
+ {
+ if(Map_IsRecent(map_next))
+ return false;
+ }
+ filename = Map_Filename(position);
+ if(MapInfo_CheckMap(map_next))
+ {
+ if(pass == 2)
+ return true;
+ if(MapHasRightSize(map_next))
+ return true;
+ return false;
+ }
+ else
+ LOG_DEBUG( "Couldn't select '", filename, "'..." );
+
+ return false;
+}
+
+void Map_Goto_SetStr(string nextmapname)
+{
+ if(getmapname_stored != "")
+ strunzone(getmapname_stored);
+ if(nextmapname == "")
+ getmapname_stored = "";
+ else
+ getmapname_stored = strzone(nextmapname);
+}
+
+void Map_Goto_SetFloat(float position)
+{
+ cvar_set("g_maplist_index", ftos(position));
+ Map_Goto_SetStr(argv(position));
+}
+
+void Map_Goto(float reinit)
+{
+ MapInfo_LoadMap(getmapname_stored, reinit);
+}
+
+// return codes of map selectors:
+// -1 = temporary failure (that is, try some method that is guaranteed to succeed)
+// -2 = permanent failure
+float MaplistMethod_Iterate() // usual method
+{
+ float pass, i;
+
+ LOG_TRACE("Trying MaplistMethod_Iterate");
+
+ for(pass = 1; pass <= 2; ++pass)
+ {
+ for(i = 1; i < Map_Count; ++i)
+ {
+ float mapindex;
+ mapindex = (i + Map_Current) % Map_Count;
+ if(Map_Check(mapindex, pass))
+ return mapindex;
+ }
+ }
+ return -1;
+}
+
+float MaplistMethod_Repeat() // fallback method
+{
+ LOG_TRACE("Trying MaplistMethod_Repeat");
+
+ if(Map_Check(Map_Current, 2))
+ return Map_Current;
+ return -2;
+}
+
+float MaplistMethod_Random() // random map selection
+{
+ float i, imax;
+
+ LOG_TRACE("Trying MaplistMethod_Random");
+
+ imax = 42;
+
+ for(i = 0; i <= imax; ++i)
+ {
+ float mapindex;
+ mapindex = (Map_Current + floor(random() * (Map_Count - 1) + 1)) % Map_Count; // any OTHER map
+ if(Map_Check(mapindex, 1))
+ return mapindex;
+ }
+ return -1;
+}
+
+float MaplistMethod_Shuffle(float exponent) // more clever shuffling
+// the exponent sets a bias on the map selection:
+// the higher the exponent, the less likely "shortly repeated" same maps are
+{
+ float i, j, imax, insertpos;
+
+ LOG_TRACE("Trying MaplistMethod_Shuffle");
+
+ imax = 42;
+
+ for(i = 0; i <= imax; ++i)
+ {
+ string newlist;
+
+ // now reinsert this at another position
+ insertpos = (random() ** (1 / exponent)); // ]0, 1]
+ insertpos = insertpos * (Map_Count - 1); // ]0, Map_Count - 1]
+ insertpos = ceil(insertpos) + 1; // {2, 3, 4, ..., Map_Count}
+ LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
+
+ // insert the current map there
+ newlist = "";
+ for(j = 1; j < insertpos; ++j) // i == 1: no loop, will be inserted as first; however, i == 1 has been excluded above
+ newlist = strcat(newlist, " ", argv(j));
+ newlist = strcat(newlist, " ", argv(0)); // now insert the just selected map
+ for(j = insertpos; j < Map_Count; ++j) // i == Map_Count: no loop, has just been inserted as last
+ newlist = strcat(newlist, " ", argv(j));
+ newlist = substring(newlist, 1, strlen(newlist) - 1);
+ cvar_set("g_maplist", newlist);
+ Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+
+ // NOTE: the selected map has just been inserted at (insertpos-1)th position
+ Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
+ if(Map_Check(Map_Current, 1))
+ return Map_Current;
+ }
+ return -1;
+}
+
+void Maplist_Init()
+{
+ float i = Map_Count = 0;
+ if(autocvar_g_maplist != "")
+ {
+ Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+ for (i = 0; i < Map_Count; ++i)
+ {
+ if (Map_Check(i, 2))
+ break;
+ }
+ }
+
+ if (i == Map_Count)
+ {
+ bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" );
+ cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST));
+ if(autocvar_g_maplist_shuffle)
+ ShuffleMaplist();
+ if(!server_is_dedicated)
+ localcmd("\nmenu_cmd sync\n");
+ Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
+ }
+ if(Map_Count == 0)
+ error("empty maplist, cannot select a new map");
+ Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1);
+
+ strcpy(Map_Current_Name, argv(Map_Current)); // will be automatically freed on exit thanks to DP
+ // this may or may not be correct, but who cares, in the worst case a map
+ // isn't chosen in the first pass that should have been
+}
+
+string GetNextMap()
+{
+ Maplist_Init();
+ float nextMap = -1;
+
+ if(nextMap == -1)
+ if(autocvar_g_maplist_shuffle > 0)
+ nextMap = MaplistMethod_Shuffle(autocvar_g_maplist_shuffle + 1);
+
+ if(nextMap == -1)
+ if(autocvar_g_maplist_selectrandom)
+ nextMap = MaplistMethod_Random();
+
+ if(nextMap == -1)
+ nextMap = MaplistMethod_Iterate();
+
+ if(nextMap == -1)
+ nextMap = MaplistMethod_Repeat();
+
+ if(nextMap >= 0)
+ {
+ Map_Goto_SetFloat(nextMap);
+ return getmapname_stored;
+ }
+
+ return "";
+}
+
+float DoNextMapOverride(float reinit)
+{
+ if(autocvar_g_campaign)
+ {
+ CampaignPostIntermission();
+ alreadychangedlevel = true;
+ return true;
+ }
+ if(autocvar_quit_when_empty)
+ {
+ if(player_count <= currentbots)
+ {
+ localcmd("quit\n");
+ alreadychangedlevel = true;
+ return true;
+ }
+ }
+ if(autocvar_quit_and_redirect != "")
+ {
+ redirection_target = strzone(autocvar_quit_and_redirect);
+ alreadychangedlevel = true;
+ return true;
+ }
+ if (!reinit && autocvar_samelevel) // if samelevel is set, stay on same level
+ {
+ localcmd("restart\n");
+ alreadychangedlevel = true;
+ return true;
+ }
+ if(autocvar_nextmap != "")
+ {
+ string m;
+ m = GameTypeVote_MapInfo_FixName(autocvar_nextmap);
+ cvar_set("nextmap",m);
+
+ if(!m || gametypevote)
+ return false;
+ if(autocvar_sv_vote_gametype)
+ {
+ Map_Goto_SetStr(m);
+ return false;
+ }
+
+ if(MapInfo_CheckMap(m))
+ {
+ Map_Goto_SetStr(m);
+ Map_Goto(reinit);
+ alreadychangedlevel = true;
+ return true;
+ }
+ }
+ if(!reinit && autocvar_lastlevel)
+ {
+ cvar_settemp_restore();
+ localcmd("set lastlevel 0\ntogglemenu 1\n");
+ alreadychangedlevel = true;
+ return true;
+ }
+ return false;
+}
+
+void GotoNextMap(float reinit)
+{
+ //string nextmap;
+ //float n, nummaps;
+ //string s;
+ if (alreadychangedlevel)
+ return;
+ alreadychangedlevel = true;
+
+ string nextMap = GetNextMap();
+ if(nextMap == "")
+ error("Everything is broken - cannot find a next map. Please report this to the developers.");
+ Map_Goto(reinit);
+}
+
+void ShuffleMaplist()
+{
+ cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
+}
+
+string GotoMap(string m)
+{
+ m = GameTypeVote_MapInfo_FixName(m);
+ if (!m)
+ return "The map you suggested is not available on this server.";
+ if (!autocvar_sv_vote_gametype)
+ if(!MapInfo_CheckMap(m))
+ return "The map you suggested does not support the current game mode.";
+ cvar_set("nextmap", m);
+ cvar_set("timelimit", "-1");
+ if(mapvote_initialized || alreadychangedlevel)
+ {
+ if(DoNextMapOverride(0))
+ return "Map switch initiated.";
+ else
+ return "Hm... no. For some reason I like THIS map more.";
+ }
+ else
+ return "Map switch will happen after scoreboard.";
+}
+
+
+/*
+============
+IntermissionThink
+
+When the player presses attack or jump, change to the next level
+============
+*/
+.float autoscreenshot;
+void IntermissionThink(entity this)
+{
+ FixIntermissionClient(this);
+
+ float server_screenshot = (autocvar_sv_autoscreenshot && CS(this).cvar_cl_autoscreenshot);
+ float client_screenshot = (CS(this).cvar_cl_autoscreenshot == 2);
+
+ if( (server_screenshot || client_screenshot)
+ && ((this.autoscreenshot > 0) && (time > this.autoscreenshot)) )
+ {
+ this.autoscreenshot = -1;
+ if(IS_REAL_CLIENT(this)) { stuffcmd(this, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(false, "%s"))); }
+ return;
+ }
+
+ if (time < intermission_exittime)
+ return;
+
+ if(!mapvote_initialized)
+ if (time < intermission_exittime + 10 && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this)))
+ return;
+
+ MapVote_Start();
+}
+
+void FixIntermissionClient(entity e)
+{
+ if(!e.autoscreenshot) // initial call
+ {
+ e.autoscreenshot = time + 0.8; // used for autoscreenshot
+ SetResourceExplicit(e, RES_HEALTH, -2342);
+ // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
+ for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(e.(weaponentity))
+ {
+ e.(weaponentity).effects = EF_NODRAW;
+ if (e.(weaponentity).weaponchild)
+ e.(weaponentity).weaponchild.effects = EF_NODRAW;
+ }
+ }
+ if(IS_REAL_CLIENT(e))
+ {
+ stuffcmd(e, "\nscr_printspeed 1000000\n");
+ RandomSelection_Init();
+ FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, {
+ RandomSelection_AddString(it, 1, 1);
+ });
+ if (RandomSelection_chosen_string != "")
+ {
+ stuffcmd(e, sprintf("\ncd loop %s\n", RandomSelection_chosen_string));
+ }
+ msg_entity = e;
+ WriteByte(MSG_ONE, SVC_INTERMISSION);
+ }
+ }
+}
--- /dev/null
+#pragma once
+
+float intermission_running;
+float intermission_exittime;
+float alreadychangedlevel;
+
+string GetGametype();
+
+string GetMapname();
+
+void IntermissionThink(entity this);
+
+void FixIntermissionClient(entity e);
+
+void GotoNextMap(float reinit);
+
+bool Map_IsRecent(string m);
+
+string GetNextMap();
+
+void ShuffleMaplist();
+
+void Map_Goto_SetStr(string nextmapname);
+
+void Map_Goto(float reinit);
+
+void Map_MarkAsRecent(string m);
+
+float DoNextMapOverride(float reinit);
+
+string GotoMap(string m);
IntrusiveList g_items;
STATIC_INIT(g_items) { g_items = IL_NEW(); }
+
+#define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
+#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
if (!server_is_dedicated) Pause_TryPause(false);
}
+void dedicated_print(string input)
+{
+ if (server_is_dedicated) print(input);
+}
+
+void make_safe_for_remove(entity e)
+{
+ if (e.initialize_entity)
+ {
+ entity ent, prev = NULL;
+ for (ent = initialize_entity_first; ent; )
+ {
+ if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e)))
+ {
+ //print("make_safe_for_remove: getting rid of initializer ", etos(ent), "\n");
+ // skip it in linked list
+ if (prev)
+ {
+ prev.initialize_entity_next = ent.initialize_entity_next;
+ ent = prev.initialize_entity_next;
+ }
+ else
+ {
+ initialize_entity_first = ent.initialize_entity_next;
+ ent = initialize_entity_first;
+ }
+ }
+ else
+ {
+ prev = ent;
+ ent = ent.initialize_entity_next;
+ }
+ }
+ }
+}
+
+void remove_except_protected(entity e)
+{
+ if(e.remove_except_protected_forbidden)
+ error("not allowed to remove this at this point");
+ builtin_remove(e);
+}
+
+void remove_unsafely(entity e)
+{
+ if(e.classname == "spike")
+ error("Removing spikes is forbidden (crylink bug), please report");
+ builtin_remove(e);
+}
+
+void remove_safely(entity e)
+{
+ make_safe_for_remove(e);
+ builtin_remove(e);
+}
+
/*
=============
StartFrame
.string gametypefilter;
.string cvarfilter;
-/**
- * Evaluate an expression of the form: [+ | -]? [var[op]val | [op]var | val | var] ...
- * +: all must match. this is the default
- * -: one must NOT match
- *
- * var>x
- * var<x
- * var>=x
- * var<=x
- * var==x
- * var!=x
- * var===x
- * var!==x
- */
-bool expr_evaluate(string s)
-{
- bool ret = false;
- if (str2chr(s, 0) == '+') {
- s = substring(s, 1, -1);
- } else if (str2chr(s, 0) == '-') {
- ret = true;
- s = substring(s, 1, -1);
- }
- bool expr_fail = false;
- for (int i = 0, n = tokenize_console(s); i < n; ++i) {
- int o;
- string k, v;
- s = argv(i);
- #define X(expr) \
- if (expr) \
- continue; \
- expr_fail = true; \
- break;
-
- #define BINOP(op, len, expr) \
- if ((o = strstrofs(s, op, 0)) >= 0) { \
- k = substring(s, 0, o); \
- v = substring(s, o + len, -1); \
- X(expr); \
- }
- BINOP(">=", 2, cvar(k) >= stof(v));
- BINOP("<=", 2, cvar(k) <= stof(v));
- BINOP(">", 1, cvar(k) > stof(v));
- BINOP("<", 1, cvar(k) < stof(v));
- BINOP("==", 2, cvar(k) == stof(v));
- BINOP("!=", 2, cvar(k) != stof(v));
- BINOP("===", 3, cvar_string(k) == v);
- BINOP("!==", 3, cvar_string(k) != v);
- {
- k = s;
- bool b = true;
- if (str2chr(k, 0) == '!') {
- k = substring(s, 1, -1);
- b = false;
- }
- float f = stof(k);
- bool isnum = ftos(f) == k;
- X(boolean(isnum ? f : cvar(k)) == b);
- }
- #undef BINOP
- #undef X
- }
- if (!expr_fail) {
- ret = !ret;
- }
- // now ret is true if we want to keep the item, and false if we want to get rid of it
- return ret;
-}
-
void SV_OnEntityPreSpawnFunction(entity this)
{
if (this)
#pragma once
+/** print(), but only print if the server is not local */
+void dedicated_print(string input);
+
+.float remove_except_protected_forbidden;
+void remove_except_protected(entity e);
+
+void remove_safely(entity e);
+
+void remove_unsafely(entity e);
+
bool expr_evaluate(string s);
#ifdef PROFILING
#include <common/weapons/_all.qh>
#include <common/stats.qh>
#include <server/gamelog.qh>
+#include <server/intermission.qh>
#include <server/miscfunctions.qh>
#include "world.qh"
#include "command/cmd.qh"
#include "world.qh"
#include <server/gamelog.qh>
#include "ipban.qh"
+#include <server/intermission.qh>
#include <server/items/items.qh>
#include <server/mutators/_mod.qh>
#include <server/spawnpoints.qh>
WarpZone_traceline_antilag(pl, CS(pl).cursor_trace_start, CS(pl).cursor_trace_start + normalize(CS(pl).cursor_trace_endpos - CS(pl).cursor_trace_start) * max_shot_distance, MOVE_NORMAL, pl, ANTILAG_LATENCY(pl));
}
-void dedicated_print(string input)
-{
- if (server_is_dedicated) print(input);
-}
-
entity findnearest(vector point, bool checkitems, vector axismod)
{
vector dist;
warmup_start_weapons_default = '0 0 0';
warmup_start_weapons_defaultmask = '0 0 0';
FOREACH(Weapons, it != WEP_Null, {
- int w = want_weapon(it, g_warmup_allguns);
+ int w = want_weapon(it, autocvar_g_warmup_allguns);
WepSet s = it.m_wepset;
if(w & 1)
warmup_start_weapons |= s;
});
}
- if (g_jetpack)
+ if (autocvar_g_jetpack)
start_items |= ITEM_Jetpack.m_itemid;
MUTATOR_CALLHOOK(SetStartItems);
}
}
-
-void make_safe_for_remove(entity e)
-{
- if (e.initialize_entity)
- {
- entity ent, prev = NULL;
- for (ent = initialize_entity_first; ent; )
- {
- if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e)))
- {
- //print("make_safe_for_remove: getting rid of initializer ", etos(ent), "\n");
- // skip it in linked list
- if (prev)
- {
- prev.initialize_entity_next = ent.initialize_entity_next;
- ent = prev.initialize_entity_next;
- }
- else
- {
- initialize_entity_first = ent.initialize_entity_next;
- ent = initialize_entity_first;
- }
- }
- else
- {
- prev = ent;
- ent = ent.initialize_entity_next;
- }
- }
- }
-}
-
-.float remove_except_protected_forbidden;
-void remove_except_protected(entity e)
-{
- if(e.remove_except_protected_forbidden)
- error("not allowed to remove this at this point");
- builtin_remove(e);
-}
-
-void remove_unsafely(entity e)
-{
- if(e.classname == "spike")
- error("Removing spikes is forbidden (crylink bug), please report");
- builtin_remove(e);
-}
-
-void remove_safely(entity e)
-{
- make_safe_for_remove(e);
- builtin_remove(e);
-}
-
void InitializeEntity(entity e, void(entity this) func, int order)
{
entity prev, cur;
delete_fn = remove_unsafely;
}
-.float(entity) isEliminated;
-bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
-{
- Stream out = MSG_ENTITY;
- WriteHeader(out, ENT_CLIENT_ELIMINATEDPLAYERS);
- serialize(byte, out, sendflags);
- if (sendflags & 1) {
- for (int i = 1; i <= maxclients; i += 8) {
- int f = 0;
- entity e = edict_num(i);
- for (int b = 0; b < 8; ++b, e = nextent(e)) {
- if (eliminatedPlayers.isEliminated(e)) {
- f |= BIT(b);
- }
- }
- serialize(byte, out, f);
- }
- }
- return true;
-}
-
-void EliminatedPlayers_Init(float(entity) isEliminated_func)
-{
- if(eliminatedPlayers)
- {
- backtrace("Can't spawn eliminatedPlayers again!");
- return;
- }
- Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
- eliminatedPlayers.isEliminated = isEliminated_func;
-}
-
-
-
-
void adaptor_think2use_hittype_splash(entity this) // for timed projectile detonation
{
if(!(IS_ONGROUND(this))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
return 0;
}
-.bool pushable;
-bool isPushable(entity e)
-{
- if(e.pushable)
- return true;
- if(IS_VEHICLE(e))
- return false;
- if(e.iscreature)
- return true;
- if (Item_IsLoot(e))
- {
- return true;
- }
- switch(e.classname)
- {
- case "body":
- return true;
- case "bullet": // antilagged bullets can't hit this either
- return false;
- }
- if (e.projectiledeathtype)
- return true;
- return false;
-}
-
string GetField_fullspawndata(entity e, string f, ...)
/* Retrieves the value of a map entity field from fullspawndata
* This bypasses field value changes made by the engine,
#include <server/client.qh>
#include <server/world.qh>
+#include <server/intermission.qh>
#include <server/items/items.qh>
#include <server/mutators/_mod.qh>
.vector dropped_origin;
-entity eliminatedPlayers;
-void EliminatedPlayers_Init(float(entity) isEliminated_func);
-
void write_recordmarker(entity pl, float tstart, float dt);
-void play2all(string samp);
-
-void play2team(float t, string filename);
-
void GetCvars_handleFloat(entity this, entity store, string thisname, float f, .float field, string name);
-float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
-
void GetCvars_handleString(entity this, entity store, string thisname, float f, .string field, string name);
void precache_all_playermodels(string pattern);
-void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
-
void InitializeEntitiesRun();
-void stopsoundto(float _dest, entity e, float chan);
-void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch);
-
void droptofloor(entity this);
float trace_hits_box_1d(float end, float thmi, float thma);
string formatmessage(entity this, string msg);
-/** print(), but only print if the server is not local */
-void dedicated_print(string input);
-
void GetCvars(entity this, entity store, int f);
-string GetMapname();
-
-float isPushable(entity e);
-
float LostMovetypeFollow(entity ent);
string uid2name(string myuid);
string NearestLocation(vector p);
-void play2(entity e, string filename);
-
string playername(entity p, bool team_colorize);
-void remove_safely(entity e);
-
-void remove_unsafely(entity e);
-
void SetMovetypeFollow(entity ent, entity e);
-void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float _pitch);
-
-void stopsound(entity e, float chan);
-
float tracebox_hits_box(vector start, vector mi, vector ma, vector end, vector thmi, vector thma);
void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
-#define IS_DEAD(s) ((s).deadflag != DEAD_NO)
-
-
-#define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
-#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
-
#define PROJECTILE_TOUCH(e,t) MACRO_BEGIN if (WarpZone_Projectile_Touch(e,t)) return; MACRO_END
-#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
-
// copies a string to a tempstring (so one can strunzone it)
string strcat1(string s) = #115; // FRIK_FILE
-/*
-// NOTE: DO NOT USE THIS FUNCTION TOO OFTEN.
-// IT WILL MOST PROBABLY DESTROY _ALL_ OTHER TEMP
-// STRINGS AND TAKE QUITE LONG. haystack and needle MUST
-// BE CONSTANT OR strzoneD!
-float strstrofs(string haystack, string needle, float offset)
-{
- float len, endpos;
- string found;
- len = strlen(needle);
- endpos = strlen(haystack) - len;
- while(offset <= endpos)
- {
- found = substring(haystack, offset, len);
- if(found == needle)
- return offset;
- offset = offset + 1;
- }
- return -1;
-}
-*/
-
const float NUM_NEAREST_ENTITIES = 4;
entity nearest_entity[NUM_NEAREST_ENTITIES];
float nearest_length[NUM_NEAREST_ENTITIES];
WepSet g_weaponarena_weapons;
float g_weaponarena_random; // TODO
string g_weaponarena_list;
-float g_weaponspeedfactor;
-float g_weaponratefactor;
-float g_weapondamagefactor;
-float g_weaponforcefactor;
-float g_weaponspreadfactor;
WepSet start_weapons;
WepSet start_weapons_default;
WepSet warmup_start_weapons;
WepSet warmup_start_weapons_default;
WepSet warmup_start_weapons_defaultmask;
-#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
+#define WARMUP_START_WEAPONS ((autocvar_g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
float warmup_start_ammo_shells;
float warmup_start_ammo_nails;
float warmup_start_ammo_rockets;
float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done?
void readplayerstartcvars();
-float sv_autotaunt;
-float sv_taunt;
-
-float g_footsteps, g_grappling_hook;
-float g_warmup_allguns;
-float g_warmup_allow_timeout;
+float g_grappling_hook;
float warmup_stage;
-float g_jetpack;
-bool sv_ready_restart;
bool sv_ready_restart_after_countdown;
-bool sv_ready_restart_repeatable;
-
-float sv_clones;
-float sv_foginterval;
void readlevelcvars()
{
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
- sv_clones = cvar("sv_clones");
- sv_foginterval = cvar("sv_foginterval");
- g_footsteps = cvar("g_footsteps");
- g_jetpack = cvar("g_jetpack");
- sv_maxidle = cvar("sv_maxidle");
- sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
- sv_maxidle_slots = cvar("sv_maxidle_slots");
- sv_maxidle_slots_countbots = cvar("sv_maxidle_slots_countbots");
- sv_autotaunt = cvar("sv_autotaunt");
- sv_taunt = cvar("sv_taunt");
- sv_ready_restart = cvar("sv_ready_restart");
sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown");
- sv_ready_restart_repeatable = cvar("sv_ready_restart_repeatable");
warmup_stage = cvar("g_warmup");
warmup_limit = cvar("g_warmup_limit");
- g_warmup_allguns = cvar("g_warmup_allguns");
- g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
if(cvar("g_campaign"))
warmup_stage = 0; // no warmup during campaign
g_pickup_respawntimejitter_long = cvar("g_pickup_respawntimejitter_long");
g_pickup_respawntimejitter_powerup = cvar("g_pickup_respawntimejitter_powerup");
- g_weaponspeedfactor = cvar("g_weaponspeedfactor");
- g_weaponratefactor = cvar("g_weaponratefactor");
- g_weapondamagefactor = cvar("g_weapondamagefactor");
- g_weaponforcefactor = cvar("g_weaponforcefactor");
- g_weaponspreadfactor = cvar("g_weaponspreadfactor");
-
g_pickup_shells = cvar("g_pickup_shells");
g_pickup_shells_max = cvar("g_pickup_shells_max");
g_pickup_nails = cvar("g_pickup_nails");
.entity initialize_entity_next;
entity initialize_entity_first;
-
-
-
-
-bool sound_allowed(int dest, entity e);
void InitializeEntity(entity e, void(entity this) func, int order);
IntrusiveList g_ctrace_changed;
#include <common/weapons/_all.qh>
#include <common/stats.qh>
#include <server/damage.qh>
+#include <server/intermission.qh>
#include <server/world.qh>
#include <server/miscfunctions.qh>
#include <server/weapons/common.qh>
#include "command/common.qh"
#include <common/weapons/_all.qh>
#include "client.qh"
+#include <server/intermission.qh>
#include <server/world.qh>
#include <server/miscfunctions.qh>
#include <server/mutators/_mod.qh>
#include "../common/util.qh"
#include "../lib/warpzone/common.qh"
#include "../lib/warpzone/util_server.qh"
+#include <server/intermission.qh>
#include <server/utils.qh>
#include <server/command/vote.qh>
#define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
#define IS_MOVABLE(v) ((IS_PLAYER(v) || IS_MONSTER(v)) && !STAT(FROZEN, v))
+#define IS_DEAD(s) ((s).deadflag != DEAD_NO)
+
+#define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
// NOTE: FOR_EACH_CLIENTSLOT deprecated! Use the following instead: FOREACH_CLIENTSLOT(true, { code; });
// NOTE: FOR_EACH_CLIENT deprecated! Use the following instead: FOREACH_CLIENT(true, { code; });
mspercallsum -= gettime(GETTIME_HIRES);
#endif
- dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
+ dir = W_CalculateSpread(dir, spread, autocvar_g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
#if 0
mspercallsum += gettime(GETTIME_HIRES);
#include "weaponstats.qh"
+#include <server/intermission.qh>
#include <common/weapons/_all.qh>
#include <common/stats.qh>
#include <server/miscfunctions.qh>
float W_WeaponRateFactor(entity this)
{
float t = 1;
- if(g_weaponratefactor > 0)
- t = 1.0 / g_weaponratefactor;
+ if(autocvar_g_weaponratefactor > 0)
+ t = 1.0 / autocvar_g_weaponratefactor;
MUTATOR_CALLHOOK(WeaponRateFactor, t, this);
t = M_ARGV(0, float);
float W_WeaponSpeedFactor(entity this)
{
- float t = 1.0 * g_weaponspeedfactor;
+ float t = 1.0 * autocvar_g_weaponspeedfactor;
MUTATOR_CALLHOOK(WeaponSpeedFactor, t, this);
t = M_ARGV(0, float);
{
FOREACH_CLIENT(true, {
if(it == actor || (IS_SPEC(it) && it.enemy == actor))
- wframe_send(it, this, fr, g_weaponratefactor, restartanim);
+ wframe_send(it, this, fr, autocvar_g_weaponratefactor, restartanim);
});
}
#include <server/gamelog.qh>
#include <server/damage.qh>
#include "ipban.qh"
+#include <server/intermission.qh>
+#include <server/main.qh>
#include "mapvoting.qh"
#include <server/mutators/_mod.qh>
#include "race.qh"
}
const float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
-string redirection_target;
float world_initialized;
void SetDefaultAlpha()
}
}
-void default_delayedinit(entity this)
+void GameplayMode_DelayedInit(entity this)
{
if(!scores_initialized)
ScoreRules_generic();
cache_mutatormsg = strzone("");
cache_lastmutatormsg = strzone("");
- InitializeEntity(NULL, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
+ InitializeEntity(NULL, GameplayMode_DelayedInit, INITPRIO_GAMETYPE_FALLBACK);
}
-void Map_MarkAsRecent(string m);
-float world_already_spawned;
+bool world_already_spawned;
spawnfunc(worldspawn)
{
server_is_dedicated = boolean(stof(cvar_defstring("is_dedicated")));
static_init_late();
static_init_precache();
readlevelcvars();
- GrappleHookInit();
GameRules_limit_fallbacks();
delete(this);
}
-string GetGametype()
-{
- return MapInfo_Type_ToString(MapInfo_LoadedGametype);
-}
-
-string GetMapname()
-{
- return mapname;
-}
-
-float Map_Count, Map_Current;
-string Map_Current_Name;
-
-// NOTE: this now expects the map list to be already tokenized and the count in Map_Count
-int GetMaplistPosition()
-{
- string map = GetMapname();
- int idx = autocvar_g_maplist_index;
-
- if(idx >= 0)
- {
- if(idx < Map_Count)
- {
- if(map == argv(idx))
- {
- return idx;
- }
- }
- }
-
- for(int pos = 0; pos < Map_Count; ++pos)
- {
- if(map == argv(pos))
- return pos;
- }
-
- // resume normal maplist rotation if current map is not in g_maplist
- return idx;
-}
-
-bool MapHasRightSize(string map)
-{
- int minplayers = max(0, floor(autocvar_minplayers));
- if (teamplay)
- minplayers = max(0, floor(autocvar_minplayers_per_team) * AvailableTeams());
- if (autocvar_g_maplist_check_waypoints
- && (currentbots || autocvar_bot_number || player_count < minplayers))
- {
- string checkwp_msg = strcat("checkwp ", map);
- if(!fexists(strcat("maps/", map, ".waypoints")))
- {
- LOG_TRACE(checkwp_msg, ": no waypoints");
- return false;
- }
- LOG_TRACE(checkwp_msg, ": has waypoints");
- }
-
- if(autocvar_g_maplist_ignore_sizes)
- return true;
-
- // open map size restriction file
- string opensize_msg = strcat("opensize ", map);
- float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
- int player_limit = ((autocvar_g_maplist_sizes_count_maxplayers) ? GetPlayerLimit() : 0);
- int pcount = ((player_limit > 0) ? min(player_count, player_limit) : player_count); // bind it to the player limit so that forced spectators don't influence the limits
- if(!autocvar_g_maplist_sizes_count_bots)
- pcount -= currentbots;
- if(fh >= 0)
- {
- opensize_msg = strcat(opensize_msg, ": ok, ");
- int mapmin = stoi(fgets(fh));
- int mapmax = stoi(fgets(fh));
- fclose(fh);
- if(pcount < mapmin)
- {
- LOG_TRACE(opensize_msg, "not enough");
- return false;
- }
- if(mapmax && pcount > mapmax)
- {
- LOG_TRACE(opensize_msg, "too many");
- return false;
- }
- LOG_TRACE(opensize_msg, "right size");
- return true;
- }
- LOG_TRACE(opensize_msg, ": not found");
- return true;
-}
-
-string Map_Filename(float position)
-{
- return strcat("maps/", argv(position), ".bsp");
-}
-
-void Map_MarkAsRecent(string m)
-{
- cvar_set("g_maplist_mostrecent", strwords(cons(m, autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
-}
-
-float Map_IsRecent(string m)
-{
- return strhasword(autocvar_g_maplist_mostrecent, m);
-}
-
-float Map_Check(float position, float pass)
-{
- string filename;
- string map_next;
- map_next = argv(position);
- if(pass <= 1)
- {
- if(Map_IsRecent(map_next))
- return 0;
- }
- filename = Map_Filename(position);
- if(MapInfo_CheckMap(map_next))
- {
- if(pass == 2)
- return 1;
- if(MapHasRightSize(map_next))
- return 1;
- return 0;
- }
- else
- LOG_DEBUG( "Couldn't select '", filename, "'..." );
-
- return 0;
-}
-
-void Map_Goto_SetStr(string nextmapname)
-{
- if(getmapname_stored != "")
- strunzone(getmapname_stored);
- if(nextmapname == "")
- getmapname_stored = "";
- else
- getmapname_stored = strzone(nextmapname);
-}
-
-void Map_Goto_SetFloat(float position)
-{
- cvar_set("g_maplist_index", ftos(position));
- Map_Goto_SetStr(argv(position));
-}
-
-void Map_Goto(float reinit)
-{
- MapInfo_LoadMap(getmapname_stored, reinit);
-}
-
-// return codes of map selectors:
-// -1 = temporary failure (that is, try some method that is guaranteed to succeed)
-// -2 = permanent failure
-float MaplistMethod_Iterate() // usual method
-{
- float pass, i;
-
- LOG_TRACE("Trying MaplistMethod_Iterate");
-
- for(pass = 1; pass <= 2; ++pass)
- {
- for(i = 1; i < Map_Count; ++i)
- {
- float mapindex;
- mapindex = (i + Map_Current) % Map_Count;
- if(Map_Check(mapindex, pass))
- return mapindex;
- }
- }
- return -1;
-}
-
-float MaplistMethod_Repeat() // fallback method
-{
- LOG_TRACE("Trying MaplistMethod_Repeat");
-
- if(Map_Check(Map_Current, 2))
- return Map_Current;
- return -2;
-}
-
-float MaplistMethod_Random() // random map selection
-{
- float i, imax;
-
- LOG_TRACE("Trying MaplistMethod_Random");
-
- imax = 42;
-
- for(i = 0; i <= imax; ++i)
- {
- float mapindex;
- mapindex = (Map_Current + floor(random() * (Map_Count - 1) + 1)) % Map_Count; // any OTHER map
- if(Map_Check(mapindex, 1))
- return mapindex;
- }
- return -1;
-}
-
-float MaplistMethod_Shuffle(float exponent) // more clever shuffling
-// the exponent sets a bias on the map selection:
-// the higher the exponent, the less likely "shortly repeated" same maps are
-{
- float i, j, imax, insertpos;
-
- LOG_TRACE("Trying MaplistMethod_Shuffle");
-
- imax = 42;
-
- for(i = 0; i <= imax; ++i)
- {
- string newlist;
-
- // now reinsert this at another position
- insertpos = (random() ** (1 / exponent)); // ]0, 1]
- insertpos = insertpos * (Map_Count - 1); // ]0, Map_Count - 1]
- insertpos = ceil(insertpos) + 1; // {2, 3, 4, ..., Map_Count}
- LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
-
- // insert the current map there
- newlist = "";
- for(j = 1; j < insertpos; ++j) // i == 1: no loop, will be inserted as first; however, i == 1 has been excluded above
- newlist = strcat(newlist, " ", argv(j));
- newlist = strcat(newlist, " ", argv(0)); // now insert the just selected map
- for(j = insertpos; j < Map_Count; ++j) // i == Map_Count: no loop, has just been inserted as last
- newlist = strcat(newlist, " ", argv(j));
- newlist = substring(newlist, 1, strlen(newlist) - 1);
- cvar_set("g_maplist", newlist);
- Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
-
- // NOTE: the selected map has just been inserted at (insertpos-1)th position
- Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
- if(Map_Check(Map_Current, 1))
- return Map_Current;
- }
- return -1;
-}
-
-void Maplist_Init()
-{
- float i = Map_Count = 0;
- if(autocvar_g_maplist != "")
- {
- Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
- for (i = 0; i < Map_Count; ++i)
- {
- if (Map_Check(i, 2))
- break;
- }
- }
-
- if (i == Map_Count)
- {
- bprint( "Maplist contains no usable maps! Resetting it to default map list.\n" );
- cvar_set("g_maplist", MapInfo_ListAllAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags() | MAPINFO_FLAG_NOAUTOMAPLIST));
- if(autocvar_g_maplist_shuffle)
- ShuffleMaplist();
- if(!server_is_dedicated)
- localcmd("\nmenu_cmd sync\n");
- Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
- }
- if(Map_Count == 0)
- error("empty maplist, cannot select a new map");
- Map_Current = bound(0, GetMaplistPosition(), Map_Count - 1);
-
- strcpy(Map_Current_Name, argv(Map_Current)); // will be automatically freed on exit thanks to DP
- // this may or may not be correct, but who cares, in the worst case a map
- // isn't chosen in the first pass that should have been
-}
-
-string GetNextMap()
-{
- Maplist_Init();
- float nextMap = -1;
-
- if(nextMap == -1)
- if(autocvar_g_maplist_shuffle > 0)
- nextMap = MaplistMethod_Shuffle(autocvar_g_maplist_shuffle + 1);
-
- if(nextMap == -1)
- if(autocvar_g_maplist_selectrandom)
- nextMap = MaplistMethod_Random();
-
- if(nextMap == -1)
- nextMap = MaplistMethod_Iterate();
-
- if(nextMap == -1)
- nextMap = MaplistMethod_Repeat();
-
- if(nextMap >= 0)
- {
- Map_Goto_SetFloat(nextMap);
- return getmapname_stored;
- }
-
- return "";
-}
-
-float DoNextMapOverride(float reinit)
-{
- if(autocvar_g_campaign)
- {
- CampaignPostIntermission();
- alreadychangedlevel = true;
- return true;
- }
- if(autocvar_quit_when_empty)
- {
- if(player_count <= currentbots)
- {
- localcmd("quit\n");
- alreadychangedlevel = true;
- return true;
- }
- }
- if(autocvar_quit_and_redirect != "")
- {
- redirection_target = strzone(autocvar_quit_and_redirect);
- alreadychangedlevel = true;
- return true;
- }
- if (!reinit && autocvar_samelevel) // if samelevel is set, stay on same level
- {
- localcmd("restart\n");
- alreadychangedlevel = true;
- return true;
- }
- if(autocvar_nextmap != "")
- {
- string m;
- m = GameTypeVote_MapInfo_FixName(autocvar_nextmap);
- cvar_set("nextmap",m);
-
- if(!m || gametypevote)
- return false;
- if(autocvar_sv_vote_gametype)
- {
- Map_Goto_SetStr(m);
- return false;
- }
-
- if(MapInfo_CheckMap(m))
- {
- Map_Goto_SetStr(m);
- Map_Goto(reinit);
- alreadychangedlevel = true;
- return true;
- }
- }
- if(!reinit && autocvar_lastlevel)
- {
- cvar_settemp_restore();
- localcmd("set lastlevel 0\ntogglemenu 1\n");
- alreadychangedlevel = true;
- return true;
- }
- return false;
-}
-
-void GotoNextMap(float reinit)
-{
- //string nextmap;
- //float n, nummaps;
- //string s;
- if (alreadychangedlevel)
- return;
- alreadychangedlevel = true;
-
- string nextMap = GetNextMap();
- if(nextMap == "")
- error("Everything is broken - cannot find a next map. Please report this to the developers.");
- Map_Goto(reinit);
-}
-
-
-/*
-============
-IntermissionThink
-
-When the player presses attack or jump, change to the next level
-============
-*/
-.float autoscreenshot;
-void IntermissionThink(entity this)
-{
- FixIntermissionClient(this);
-
- float server_screenshot = (autocvar_sv_autoscreenshot && CS(this).cvar_cl_autoscreenshot);
- float client_screenshot = (CS(this).cvar_cl_autoscreenshot == 2);
-
- if( (server_screenshot || client_screenshot)
- && ((this.autoscreenshot > 0) && (time > this.autoscreenshot)) )
- {
- this.autoscreenshot = -1;
- if(IS_REAL_CLIENT(this)) { stuffcmd(this, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(false, "%s"))); }
- return;
- }
-
- if (time < intermission_exittime)
- return;
-
- if(!mapvote_initialized)
- if (time < intermission_exittime + 10 && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this)))
- return;
-
- MapVote_Start();
-}
-
/*
===============================================================================
}
}
-void FixIntermissionClient(entity e)
-{
- if(!e.autoscreenshot) // initial call
- {
- e.autoscreenshot = time + 0.8; // used for autoscreenshot
- SetResourceExplicit(e, RES_HEALTH, -2342);
- // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not)
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- {
- .entity weaponentity = weaponentities[slot];
- if(e.(weaponentity))
- {
- e.(weaponentity).effects = EF_NODRAW;
- if (e.(weaponentity).weaponchild)
- e.(weaponentity).weaponchild.effects = EF_NODRAW;
- }
- }
- if(IS_REAL_CLIENT(e))
- {
- stuffcmd(e, "\nscr_printspeed 1000000\n");
- RandomSelection_Init();
- FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, {
- RandomSelection_AddString(it, 1, 1);
- });
- if (RandomSelection_chosen_string != "")
- {
- stuffcmd(e, sprintf("\ncd loop %s\n", RandomSelection_chosen_string));
- }
- msg_entity = e;
- WriteByte(MSG_ONE, SVC_INTERMISSION);
- }
- }
-}
-
/*
go to the next level for deathmatch
only called if a time or frag limit has expired
FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; });
}
-void ShuffleMaplist()
-{
- cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
-}
-
int fragsleft_last;
float WinningCondition_Scores(float limit, float leadlimit)
{
}
}
-string GotoMap(string m)
-{
- m = GameTypeVote_MapInfo_FixName(m);
- if (!m)
- return "The map you suggested is not available on this server.";
- if (!autocvar_sv_vote_gametype)
- if(!MapInfo_CheckMap(m))
- return "The map you suggested does not support the current game mode.";
- cvar_set("nextmap", m);
- cvar_set("timelimit", "-1");
- if(mapvote_initialized || alreadychangedlevel)
- {
- if(DoNextMapOverride(0))
- return "Map switch initiated.";
- else
- return "Hm... no. For some reason I like THIS map more.";
- }
- else
- return "Map switch will happen after scoreboard.";
-}
-
bool autocvar_sv_gameplayfix_multiplethinksperframe = true;
void RunThink(entity this)
{
// make a second pass to see if any ents spawned this frame and make
// sure they run their move/think. this is verified by checking .move_time, which will never be 0 if the entity has moved
+ // MOVETYPE_NONE is also checked as .move_time WILL be 0 with that movetype
IL_EACH(g_moveables, it.move_qcphysics,
{
if(IS_CLIENT(it) || it.move_time || it.move_movetype == MOVETYPE_NONE || it.move_movetype == MOVETYPE_PHYSICS)
.string fog;
-float intermission_running;
-float intermission_exittime;
-float alreadychangedlevel;
+string redirection_target;
string cache_mutatormsg;
string cache_lastmutatormsg;
float WinningCondition_Scores(float limit, float leadlimit);
void SetWinners(.float field, float value);
-void IntermissionThink(entity this);
-void GotoNextMap(float reinit);
void ReadyRestart();
-string GetGametype();
-
void DumpStats(float final);
-float Map_IsRecent(string m);
-string GetNextMap();
-void ShuffleMaplist();
-void Map_Goto_SetStr(string nextmapname);
-void Map_Goto(float reinit);
-void Map_MarkAsRecent(string m);
-float DoNextMapOverride(float reinit);
void CheckRules_World();
float RedirectionThink();