From: Lyberta Date: Thu, 29 Jun 2017 11:52:57 +0000 (+0300) Subject: Merge branch 'master' into Lyberta/StandaloneOverkillWeapons X-Git-Tag: xonotic-v0.8.5~2119^2~65 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=acddeee8ad8acd0099fdd25d5049e302d6246f24;hp=4dc2084ad47bfe864765967c819363ca3f0418d7 Merge branch 'master' into Lyberta/StandaloneOverkillWeapons --- diff --git a/.tx/merge-base b/.tx/merge-base index a73edd9b0..bae0563ae 100644 --- a/.tx/merge-base +++ b/.tx/merge-base @@ -1 +1 @@ -Sat Jun 3 07:23:47 CEST 2017 +Thu Jun 29 07:24:55 CEST 2017 diff --git a/bal-wep-overkill.cfg b/bal-wep-overkill.cfg index d55cf9266..67cc81523 100644 --- a/bal-wep-overkill.cfg +++ b/bal-wep-overkill.cfg @@ -32,7 +32,7 @@ set g_balance_blaster_weaponstartoverride -1 set g_balance_blaster_weaponthrowable 0 // }}} // {{{ #2: Shotgun -set g_balance_shotgun_primary_ammo 6.25 +set g_balance_shotgun_primary_ammo 3 set g_balance_shotgun_primary_animtime 0.65 set g_balance_shotgun_primary_bullets 10 set g_balance_shotgun_primary_damage 17 @@ -40,7 +40,7 @@ set g_balance_shotgun_primary_force 80 set g_balance_shotgun_primary_refire 0.75 set g_balance_shotgun_primary_solidpenetration 3.8 set g_balance_shotgun_primary_spread 0.07 -set g_balance_shotgun_reload_ammo 50 +set g_balance_shotgun_reload_ammo 24 set g_balance_shotgun_reload_time 2 set g_balance_shotgun_secondary 1 set g_balance_shotgun_secondary_animtime 1.15 diff --git a/common.it.po b/common.it.po index 30e558629..cc153f5aa 100644 --- a/common.it.po +++ b/common.it.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Xonotic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-30 07:23+0200\n" -"PO-Revision-Date: 2017-03-31 17:53+0000\n" +"PO-Revision-Date: 2017-06-04 00:29+0000\n" "Last-Translator: Antonio \n" "Language-Team: Italian (http://www.transifex.com/team-xonotic/xonotic/" "language/it/)\n" @@ -344,7 +344,7 @@ msgstr "ucciso bandiera, icona" #: qcsrc/client/hud/panel/quickmenu.qc:804 msgid "QMCMD^killed flagcarrier (l:%y^7)" -msgstr "ucciso portatore bandiera (l:%y^7)" +msgstr "ucciso portabandiera (l:%y^7)" #: qcsrc/client/hud/panel/quickmenu.qc:805 #, c-format @@ -778,8 +778,7 @@ msgstr "^3captime^7 Tempo della cattura più veloce (CTF)\n" #: qcsrc/client/hud/panel/scoreboard.qc:319 msgid "^3fckills^7 Number of flag carrier kills\n" -msgstr "" -"^3fckills^7 Numero di uccisioni dei portatori di bandiera\n" +msgstr "^3fckills^7 Numero di uccisioni dei portabandiera\n" #: qcsrc/client/hud/panel/scoreboard.qc:320 msgid "^3returns^7 Number of flag returns\n" @@ -811,8 +810,7 @@ msgstr "" #: qcsrc/client/hud/panel/scoreboard.qc:326 msgid "^3kckills^7 Number of keys carrier kills\n" -msgstr "" -"^3kckills^7 Numero di uccisioni di portatori di chiavi\n" +msgstr "^3kckills^7 Numero di uccisioni di portachiavi\n" #: qcsrc/client/hud/panel/scoreboard.qc:327 msgid "^3losses^7 Number of times a key was lost\n" @@ -841,8 +839,7 @@ msgstr "^3takes^7 Numero di punti di dominio presi (DOM)\n" #: qcsrc/client/hud/panel/scoreboard.qc:333 msgid "^3bckills^7 Number of ball carrier kills\n" -msgstr "" -"^3bckills^7 Numbero di uccisioni di portatori di palla\n" +msgstr "^3bckills^7 Numbero di uccisioni di portapalla\n" #: qcsrc/client/hud/panel/scoreboard.qc:334 msgid "" @@ -1770,7 +1767,7 @@ msgstr "Spingi" #: qcsrc/common/mutators/mutator/waypoints/all.inc:21 msgid "Flag carrier" -msgstr "Portatore bandiera" +msgstr "Portabandiera" #: qcsrc/common/mutators/mutator/waypoints/all.inc:22 msgid "Enemy carrier" @@ -1778,7 +1775,7 @@ msgstr "Portatore nemico" #: qcsrc/common/mutators/mutator/waypoints/all.inc:23 msgid "Dropped flag" -msgstr "Bandiera persa" +msgstr "Bandiera lasciata" #: qcsrc/common/mutators/mutator/waypoints/all.inc:24 msgid "White base" @@ -1825,7 +1822,7 @@ msgstr "Chiave lasciata" #: qcsrc/common/mutators/mutator/waypoints/all.inc:42 #: qcsrc/common/mutators/mutator/waypoints/all.inc:43 msgid "Key carrier" -msgstr "Portatore chiave" +msgstr "Portchiave" #: qcsrc/common/mutators/mutator/waypoints/all.inc:39 msgid "Run here" @@ -1838,7 +1835,7 @@ msgstr "Palla" #: qcsrc/common/mutators/mutator/waypoints/all.inc:46 msgid "Ball carrier" -msgstr "Portatore palla" +msgstr "Portapalla" #: qcsrc/common/mutators/mutator/waypoints/all.inc:49 msgid "Goal" @@ -2604,7 +2601,7 @@ msgstr "^BG%s^BG ha perso il colpetto %s^BG!" #: qcsrc/common/notifications/all.inc:692 #, c-format msgid "^BGYou dropped the %s^BG buff!" -msgstr "^BGHai abbandonato il colpetto %s^BG!" +msgstr "^BGHai lasciato il colpetto %s^BG!" #: qcsrc/common/notifications/all.inc:380 #: qcsrc/common/notifications/all.inc:693 @@ -3446,8 +3443,7 @@ msgstr "^BGStallo! I nemici ora possono vederti nel radar!" #: qcsrc/common/notifications/all.inc:586 msgid "^BGStalemate! Flag carriers can now be seen by enemies on radar!" msgstr "" -"^BGStallo! I portatori di bandiera ora possono essere visti dai nemici nel " -"radar!" +"^BGStallo! I portabandiera ora possono essere visti dai nemici nel radar!" #: qcsrc/common/notifications/all.inc:590 #, c-format @@ -3845,7 +3841,7 @@ msgid "" "Help the key carriers to meet!" msgstr "" "^BGTutte le chiavi sono in mano alla tua squadra!\n" -"Aiuta i portatori di chiavi a incontrarsi!" +"Aiuta i portachiavi a incontrarsi!" #: qcsrc/common/notifications/all.inc:712 msgid "" @@ -3861,7 +3857,7 @@ msgid "" "Meet the other key carriers ^F4NOW^BG!" msgstr "" "^BGTutte le chiavi sono in mano alla tua squadra!\n" -"Incxontra gli altri portatori di chiavi ^F4ORA^BG!" +"Incxontra gli altri portachiavi ^F4ORA^BG!" #: qcsrc/common/notifications/all.inc:714 msgid "^F4Round will start in ^COUNT" diff --git a/common.pl.po b/common.pl.po index 9361db6d4..a1c9eb46f 100644 --- a/common.pl.po +++ b/common.pl.po @@ -19,8 +19,8 @@ msgstr "" "Project-Id-Version: Xonotic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-30 07:23+0200\n" -"PO-Revision-Date: 2017-04-05 18:45+0000\n" -"Last-Translator: Kriss Chr \n" +"PO-Revision-Date: 2017-06-28 19:15+0000\n" +"Last-Translator: Amadeusz Sławiński \n" "Language-Team: Polish (http://www.transifex.com/team-xonotic/xonotic/" "language/pl/)\n" "Language: pl\n" @@ -28,7 +28,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" -"%100<12 || n%100>=14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" +"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" "%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" #: qcsrc/client/hud/hud_config.qc:233 @@ -9236,7 +9236,7 @@ msgid "" "^1ERROR: Texture compression is required but not supported.\n" "^1Expect visual problems.\n" msgstr "" -"^1BŁĄÐ:: Kompresja z tekstury jest wymagana, ale nie wspomagana.\n" +"^1BŁĄD:: Kompresja z tekstury jest wymagana, ale nie wspomagana.\n" "^1Oczekuj problemów wizualnych.\n" #: qcsrc/menu/xonotic/util.qc:780 diff --git a/common.sr.po b/common.sr.po index e57071b8d..7ed1c9ede 100644 --- a/common.sr.po +++ b/common.sr.po @@ -13,7 +13,7 @@ msgstr "" "Project-Id-Version: Xonotic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-30 07:23+0200\n" -"PO-Revision-Date: 2017-05-21 11:21+0000\n" +"PO-Revision-Date: 2017-06-17 17:00+0000\n" "Last-Translator: Марко М. Костић (Marko M. Kostić) \n" "Language-Team: Serbian (http://www.transifex.com/team-xonotic/xonotic/" @@ -1179,7 +1179,7 @@ msgstr "Игра на смрт" #: qcsrc/common/mapinfo.qh:99 msgid "Score as many frags as you can" -msgstr "Достигните што више рокања" +msgstr "Достигните што више фрегова" #: qcsrc/common/mapinfo.qh:111 msgid "Last Man Standing" @@ -1208,7 +1208,7 @@ msgstr "Тркајте се за најбоље време." #: qcsrc/common/mapinfo.qh:184 msgid "Help your team score the most frags against the enemy team" msgstr "" -"Помозите вашпј екипи да постигне највише рокања против непријатељске екипе" +"Помозите вашпј екипи да постигне највише фрегова против непријатељске екипе" #: qcsrc/common/mapinfo.qh:184 msgid "Team Deathmatch" @@ -3314,7 +3314,7 @@ msgstr "" #: qcsrc/common/notifications/all.inc:590 #, c-format msgid "^K3%sYou fragged ^BG%s" -msgstr "^K3%sРокнули сте играча ^BG%s" +msgstr "^K3%sФреговали сте играча ^BG%s" #: qcsrc/common/notifications/all.inc:591 #: qcsrc/common/notifications/all.inc:600 @@ -3326,7 +3326,7 @@ msgstr "" #: qcsrc/common/notifications/all.inc:592 #, c-format msgid "^K1%sYou were fragged by ^BG%s" -msgstr "^K1%sРокнуо вас је играч ^BG%s" +msgstr "^K1%sФреговао вас је играч ^BG%s" #: qcsrc/common/notifications/all.inc:593 #: qcsrc/common/notifications/all.inc:602 @@ -4021,31 +4021,31 @@ msgstr "" #: qcsrc/common/notifications/all.qh:444 msgid "TRIPLE FRAG! " -msgstr "ТРОСТРУКА РОКЊАВА! " +msgstr "ТРОСТРУКИ ФРЕГ! " #: qcsrc/common/notifications/all.qh:445 #, c-format msgid "%s^K1 made FIVE SCORES IN A ROW! %s^BG" -msgstr "" +msgstr "ИГРАЧ %s^K1 ЈЕ НАПРАВИО 5 ПОГОДАКА У НИЗУ! %s^BG" #: qcsrc/common/notifications/all.qh:445 #, c-format msgid "%s^K1 unlocked RAGE! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је откључао БЕС! %s^BG" #: qcsrc/common/notifications/all.qh:445 msgid "RAGE! " -msgstr "БЕСНИЛО! " +msgstr "БЕС! " #: qcsrc/common/notifications/all.qh:446 #, c-format msgid "%s^K1 made TEN SCORES IN A ROW! %s^BG" -msgstr "" +msgstr "ИГРАЧ %s^K1 ЈЕ НАПРАВИО 10 ПОГОДАКА У НИЗУ! %s^BG" #: qcsrc/common/notifications/all.qh:446 #, c-format msgid "%s^K1 started a MASSACRE! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је започео МАСАКР! %s^BG" #: qcsrc/common/notifications/all.qh:446 msgid "MASSACRE! " @@ -4054,12 +4054,12 @@ msgstr "МАСАКР! " #: qcsrc/common/notifications/all.qh:447 #, c-format msgid "%s^K1 executed MAYHEM! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је извршио САКАЋЕЊЕ! %s^BG" #: qcsrc/common/notifications/all.qh:447 #, c-format msgid "%s^K1 made FIFTEEN SCORES IN A ROW! %s^BG" -msgstr "" +msgstr "ИГРАЧ %s^K1 ЈЕ НАПРАВИО 15 ПОГОДАКА У НИЗУ! %s^BG" #: qcsrc/common/notifications/all.qh:447 msgid "MAYHEM! " @@ -4068,12 +4068,12 @@ msgstr "САКАЋЕЊЕ! " #: qcsrc/common/notifications/all.qh:448 #, c-format msgid "%s^K1 is a BERSERKER! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је ЛУДАК! %s^BG" #: qcsrc/common/notifications/all.qh:448 #, c-format msgid "%s^K1 made TWENTY SCORES IN A ROW! %s^BG" -msgstr "" +msgstr "ИГРАЧ %s^K1 ЈЕ НАПРАВИО 20 ПОГОДАКА У НИЗУ! %s^BG" #: qcsrc/common/notifications/all.qh:448 msgid "BERSERKER! " @@ -4082,12 +4082,12 @@ msgstr "ЛУДАК! " #: qcsrc/common/notifications/all.qh:449 #, c-format msgid "%s^K1 inflicts CARNAGE! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је извршио ПОКОЉ! %s^BG" #: qcsrc/common/notifications/all.qh:449 #, c-format msgid "%s^K1 made TWENTY FIVE SCORES IN A ROW! %s^BG" -msgstr "" +msgstr "ИГРАЧ %s^K1 ЈЕ НАПРАВИО 25 ПОГОДАКА У НИЗУ! %s^BG" #: qcsrc/common/notifications/all.qh:449 msgid "CARNAGE! " @@ -4096,12 +4096,12 @@ msgstr "ПОКОЉ! " #: qcsrc/common/notifications/all.qh:450 #, c-format msgid "%s^K1 made THIRTY SCORES IN A ROW! %s^BG" -msgstr "" +msgstr "ИГРАЧ %s^K1 ЈЕ НАПРАВИО 30 ПОГОДАКА У НИЗУ! %s^BG" #: qcsrc/common/notifications/all.qh:450 #, c-format msgid "%s^K1 unleashes ARMAGEDDON! %s^BG" -msgstr "" +msgstr "Играч%s^K1 је започео АРМАГЕДОН! %s^BG" #: qcsrc/common/notifications/all.qh:450 msgid "ARMAGEDDON! " @@ -4123,6 +4123,8 @@ msgid "" "\n" "(Health ^1%d^BG / Armor ^2%d^BG)%s" msgstr "" +"\n" +"(Здравље ^1%d^BG / Оклоп ^2%d^BG)%s" #: qcsrc/common/notifications/all.qh:468 #, c-format @@ -4130,6 +4132,8 @@ msgid "" "\n" "(^F4Dead^BG)%s" msgstr "" +"\n" +"(^F4Мртвих^BG)%s" #: qcsrc/common/notifications/all.qh:489 qcsrc/common/notifications/all.qh:502 #, c-format @@ -4160,22 +4164,22 @@ msgstr "Прва жртва! " #: qcsrc/common/notifications/all.qh:559 #, c-format msgid "%s^K1 has %d frags in a row! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је направио %d фрегова у низу! %s^BG" #: qcsrc/common/notifications/all.qh:560 #, c-format msgid "%s^K1 made %d scores in a row! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је направио %d погодака у низу! %s^BG" #: qcsrc/common/notifications/all.qh:578 #, c-format msgid "%s^K1 drew first blood! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је пролио прву крв! %s^BG" #: qcsrc/common/notifications/all.qh:579 #, c-format msgid "%s^K1 got the first score! %s^BG" -msgstr "" +msgstr "Играч %s^K1 је остварио први погодак! %s^BG" #: qcsrc/common/notifications/all.qh:595 #, c-format @@ -5777,13 +5781,13 @@ msgstr "Неограничено" #: qcsrc/menu/xonotic/dialog_multiplayer_create.qc:78 #: qcsrc/menu/xonotic/dialog_multiplayer_create.qc:128 msgid "Frag limit:" -msgstr "Граница рокања:" +msgstr "Граница фреговања:" #: qcsrc/menu/xonotic/dialog_multiplayer_create.qc:65 #: qcsrc/menu/xonotic/dialog_multiplayer_create.qc:66 #: qcsrc/menu/xonotic/dialog_multiplayer_create.qc:78 msgid "The amount of frags needed before the match will end" -msgstr "Број рокања потребних пре него што се игра заврши" +msgstr "Број фрегова потребних пре него што се игра заврши" #: qcsrc/menu/xonotic/dialog_multiplayer_create.qc:67 msgid "Capture limit:" @@ -6596,7 +6600,7 @@ msgstr "Назад на посао..." #: qcsrc/menu/xonotic/dialog_quit.qc:17 msgid "I got some more fragging to do!" -msgstr "Хоћу да рокам још мало!" +msgstr "Хоћу да фрегујем још мало!" #: qcsrc/menu/xonotic/dialog_quit.qh:7 msgid "Quit the game" @@ -6961,7 +6965,7 @@ msgstr "Аутоматска ругања:" #: qcsrc/menu/xonotic/dialog_settings_audio.qc:166 msgid "Automatically taunt enemies after fragging them" -msgstr "Аутоматски се ругајте непријатељима након што их рокнете" +msgstr "Аутоматски се ругајте непријатељима након што их изфрегујете" #: qcsrc/menu/xonotic/dialog_settings_audio.qc:168 msgid "Sometimes" @@ -7607,7 +7611,7 @@ msgstr "Да ли желите да покренете локалну игру #: qcsrc/menu/xonotic/dialog_settings_game_messages.qc:24 msgid "Frag Information" -msgstr "Подаци о рокању" +msgstr "Подаци о фреговима" #: qcsrc/menu/xonotic/dialog_settings_game_messages.qc:26 msgid "Display information about killing sprees" @@ -7651,11 +7655,12 @@ msgstr "Прикажи у засебном реду" #: qcsrc/menu/xonotic/dialog_settings_game_messages.qc:58 msgid "Add extra frag information to centerprint when available" -msgstr "Прикажи додатне податке о рокању у средишњој поруци, када су доступни" +msgstr "" +"Прикажи додатне податке о фреговању у средишњој поруци, када су доступни" #: qcsrc/menu/xonotic/dialog_settings_game_messages.qc:62 msgid "Add frag location to death messages when available" -msgstr "Додај податак о месту рокања у смртним порукама, када је доступан" +msgstr "Додај податак о месту фреговања у посмртним порукама, када је доступан" #: qcsrc/menu/xonotic/dialog_settings_game_messages.qc:65 msgid "Gamemode Settings" @@ -7940,7 +7945,7 @@ msgstr "" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:57 msgid "Auto switch weapons on pickup" -msgstr "" +msgstr "Самостално промени оружје при купљењу" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:58 msgid "" @@ -7950,21 +7955,21 @@ msgstr "" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:61 msgid "Release attack buttons when you switch weapons" -msgstr "" +msgstr "Отпусти тастере за напад при промени оружја" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:64 msgid "Draw 1st person weapon model" -msgstr "" +msgstr "Исцртај модел оружја из првог лица" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:65 msgid "Draw the weapon model" -msgstr "" +msgstr "Исцртај модел оружја" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:69 #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:72 #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:75 msgid "Position of the weapon model; requires reconnect" -msgstr "" +msgstr "Положај модела оружја, потребно поновно повезивање" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qc:80 msgid "Gun model swaying" @@ -7977,73 +7982,73 @@ msgstr "" #: qcsrc/menu/xonotic/dialog_settings_game_weapons.qh:7 #: qcsrc/menu/xonotic/keybinder.qc:43 msgid "Weapons" -msgstr "" +msgstr "Оружја" #: qcsrc/menu/xonotic/dialog_settings_input.qc:33 msgid "Key Bindings" -msgstr "" +msgstr "Повези тастера" #: qcsrc/menu/xonotic/dialog_settings_input.qc:37 msgid "Change key..." -msgstr "" +msgstr "Промени тастер..." #: qcsrc/menu/xonotic/dialog_settings_input.qc:41 msgid "Edit..." -msgstr "" +msgstr "Уреди..." #: qcsrc/menu/xonotic/dialog_settings_input.qc:47 msgid "Clear" -msgstr "" +msgstr "Очисти" #: qcsrc/menu/xonotic/dialog_settings_input.qc:52 msgid "Reset all" -msgstr "" +msgstr "Ресетуј све" #: qcsrc/menu/xonotic/dialog_settings_input.qc:57 msgid "Mouse" -msgstr "" +msgstr "Миш" #: qcsrc/menu/xonotic/dialog_settings_input.qc:59 msgid "Sensitivity:" -msgstr "" +msgstr "Осетљивост:" #: qcsrc/menu/xonotic/dialog_settings_input.qc:61 msgid "Mouse speed multiplier" -msgstr "" +msgstr "Чинилац брзине миша" #: qcsrc/menu/xonotic/dialog_settings_input.qc:63 msgid "Smooth aiming" -msgstr "" +msgstr "Глатко циљање" #: qcsrc/menu/xonotic/dialog_settings_input.qc:64 msgid "Smoothes the mouse movement, but makes aiming slightly less responsive" -msgstr "" +msgstr "Чини померање миша глатким али је онда циљање мање осетљиво" #: qcsrc/menu/xonotic/dialog_settings_input.qc:66 msgid "Invert aiming" -msgstr "" +msgstr "Обрни циљање" #: qcsrc/menu/xonotic/dialog_settings_input.qc:67 msgid "Invert mouse movement on the Y-axis" -msgstr "" +msgstr "Обрће померање миша по ипсилон оси" #: qcsrc/menu/xonotic/dialog_settings_input.qc:69 msgid "Use system mouse positioning" -msgstr "" +msgstr "Користи системско позиционирање миша" #: qcsrc/menu/xonotic/dialog_settings_input.qc:74 msgid "Enable built in mouse acceleration" -msgstr "" +msgstr "Омогући уграђено убрзање миша" #: qcsrc/menu/xonotic/dialog_settings_input.qc:78 #: qcsrc/menu/xonotic/dialog_settings_input.qc:82 #: qcsrc/menu/xonotic/dialog_settings_input.qc:85 msgid "Disable system mouse acceleration" -msgstr "" +msgstr "Онемогући системско убрзање миша" #: qcsrc/menu/xonotic/dialog_settings_input.qc:79 msgid "Make use of DGA mouse input" -msgstr "" +msgstr "Искористи DGA унос на мишу" #: qcsrc/menu/xonotic/dialog_settings_input.qc:93 msgid "Pressing \"enter console\" key also closes it" @@ -8055,41 +8060,41 @@ msgstr "" #: qcsrc/menu/xonotic/dialog_settings_input.qc:96 msgid "Automatically repeat jumping if holding jump" -msgstr "" +msgstr "Самостално понављај скакање ако се држи скакање" #: qcsrc/menu/xonotic/dialog_settings_input.qc:99 msgid "Jetpack on jump:" -msgstr "" +msgstr "Ракетни појас при скоку:" #: qcsrc/menu/xonotic/dialog_settings_input.qc:101 msgid "JPJUMP^Disabled" -msgstr "" +msgstr "JPJUMP^Онемогућен" #: qcsrc/menu/xonotic/dialog_settings_input.qc:102 msgid "Air only" -msgstr "" +msgstr "Само у ваздуху" #: qcsrc/menu/xonotic/dialog_settings_input.qc:103 msgid "JPJUMP^All" -msgstr "" +msgstr "JPJUMP^Све" #: qcsrc/menu/xonotic/dialog_settings_input.qc:109 #: qcsrc/menu/xonotic/dialog_settings_input.qc:114 #: qcsrc/menu/xonotic/dialog_settings_input.qc:119 msgid "Use joystick input" -msgstr "" +msgstr "Користи унос преко џојстика" #: qcsrc/menu/xonotic/dialog_settings_input_userbind.qc:31 msgid "Command when pressed:" -msgstr "" +msgstr "Наредба док је притиснут:" #: qcsrc/menu/xonotic/dialog_settings_input_userbind.qc:34 msgid "Command when released:" -msgstr "" +msgstr "Наредба када је отпуштен:" #: qcsrc/menu/xonotic/dialog_settings_input_userbind.qc:40 msgid "Cancel" -msgstr "" +msgstr "Откажи" #: qcsrc/menu/xonotic/dialog_settings_input_userbind.qh:7 msgid "User defined key bind" diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index ab7f0e569..1312d6fa2 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -229,6 +229,7 @@ seta cl_hitsound_max_pitch 1.5 "maximum pitch of hit sound" seta cl_hitsound_nom_damage 25 "damage amount at which hitsound bases pitch off" seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore" +seta cl_eventchase_frozen 0 "camera goes into 3rd person mode when the player is frozen" seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode" seta cl_eventchase_distance 140 "final camera distance" seta cl_eventchase_generator_distance 400 "final camera distance while viewing generator explosion" @@ -299,6 +300,7 @@ set sv_friction_slick 0.5 set sv_slick_applygravity 0 set sv_aircontrol_backwards 0 "apply forward aircontrol options to backward movement" +set sv_aircontrol_sidewards 0 "apply forward aircontrol options to sideward movement" set sv_player_viewoffset "0 0 35" "view offset of the player model" set sv_player_mins "-16 -16 -24" "playermodel mins" diff --git a/effects-high.cfg b/effects-high.cfg index a514ce5cb..48c8253a3 100644 --- a/effects-high.cfg +++ b/effects-high.cfg @@ -5,7 +5,7 @@ cl_particles 1 cl_particles_quality 1.0 cl_damageeffect 1 cl_spawn_point_particles 1 -cl_playerdetailreduction 4.0 +cl_playerdetailreduction 4 gl_flashblend 0 gl_picmip -1 mod_q3bsp_nolightmaps 0 diff --git a/hud_luma.cfg b/hud_luma.cfg index 5ebdeaeec..957265716 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.86 0.35 0" seta hud_progressbar_vehicles_ammo1_color "0.77 0.67 0" seta hud_progressbar_vehicles_ammo2_color "0.86 0.35 0" -seta _hud_panelorder "17 15 12 9 5 10 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 23 24 " +seta _hud_panelorder "17 15 12 9 5 10 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 24 " seta hud_configure_grid "1" seta hud_configure_grid_xsize "0.005000" @@ -179,7 +179,7 @@ seta hud_panel_racetimer_bg_padding "" seta hud_panel_vote_pos "0.740000 0.690000" seta hud_panel_vote_size "0.190000 0.090000" -seta hud_panel_vote_bg " " +seta hud_panel_vote_bg "border_default" seta hud_panel_vote_bg_color "" seta hud_panel_vote_bg_color_team "" seta hud_panel_vote_bg_alpha "" @@ -201,7 +201,7 @@ seta hud_panel_modicons_freezetag_layout "1" seta hud_panel_pressedkeys_pos "0.445000 0.710000" seta hud_panel_pressedkeys_size "0.110000 0.090000" -seta hud_panel_pressedkeys_bg " " +seta hud_panel_pressedkeys_bg "border_default" seta hud_panel_pressedkeys_bg_color "" seta hud_panel_pressedkeys_bg_color_team "" seta hud_panel_pressedkeys_bg_alpha "" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 8f64ddebb..3f4fe39fa 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0" seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0" -seta _hud_panelorder "17 15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 23 24 " +seta _hud_panelorder "17 15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 18 23 19 20 21 22 24 " seta hud_configure_grid "1" seta hud_configure_grid_xsize "0.010000" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 31926d2f5..609ab766d 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0" seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0" -seta _hud_panelorder "17 10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 18 23 19 20 21 22 23 24 " +seta _hud_panelorder "17 10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 18 23 19 20 21 22 24 " seta hud_configure_grid "1" seta hud_configure_grid_xsize "0.010000" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 380b65814..b7a7d20ab 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0" seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0" -seta _hud_panelorder "17 15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 18 23 19 20 21 22 23 24 " +seta _hud_panelorder "17 15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 18 23 19 20 21 22 24 " seta hud_configure_grid "1" seta hud_configure_grid_xsize "0.010000" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index 96b4f508f..ce8186811 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0" seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0" -seta _hud_panelorder "17 15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 18 23 19 20 21 22 23 24 " +seta _hud_panelorder "17 15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 18 23 19 20 21 22 24 " seta hud_configure_grid "1" seta hud_configure_grid_xsize "0.010000" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index ae786574f..4159b01c7 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -29,7 +29,7 @@ seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5" seta hud_progressbar_vehicles_ammo1_color "0.8 0.7 0" seta hud_progressbar_vehicles_ammo2_color "0.7 0.4 0" -seta _hud_panelorder "17 15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 18 23 19 20 21 22 23 24 " +seta _hud_panelorder "17 15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 18 23 19 20 21 22 24 " seta hud_configure_grid "1" seta hud_configure_grid_xsize "0.010000" diff --git a/languages.txt b/languages.txt index c88e0246f..6835f8cbd 100644 --- a/languages.txt +++ b/languages.txt @@ -17,5 +17,5 @@ el Greek "Ελληνική" 33% be Belarusian "Беларуская" 62% bg Bulgarian "Български" 68% ru Russian "Русский" 100% -sr Serbian "Српски" 69% +sr Serbian "Српски" 71% uk Ukrainian "Українська" 57% diff --git a/physics.cfg b/physics.cfg index 1a38a7f61..b3439d691 100644 --- a/physics.cfg +++ b/physics.cfg @@ -29,6 +29,7 @@ set g_physics_xonotic_airaccel_sideways_friction 0 set g_physics_xonotic_aircontrol 100 set g_physics_xonotic_aircontrol_power 2 set g_physics_xonotic_aircontrol_backwards 0 +set g_physics_xonotic_aircontrol_sidewards 0 set g_physics_xonotic_aircontrol_penalty 0 set g_physics_xonotic_warsowbunny_airforwardaccel 1.00001 set g_physics_xonotic_warsowbunny_topspeed 925 @@ -58,6 +59,7 @@ set g_physics_nexuiz_airaccel_sideways_friction 0.35 set g_physics_nexuiz_aircontrol 0 set g_physics_nexuiz_aircontrol_power 2 set g_physics_nexuiz_aircontrol_backwards 0 +set g_physics_nexuiz_aircontrol_sidewards 0 set g_physics_nexuiz_aircontrol_penalty 0 set g_physics_nexuiz_warsowbunny_airforwardaccel 1.00001 set g_physics_nexuiz_warsowbunny_topspeed 925 @@ -87,6 +89,7 @@ set g_physics_quake_airaccel_sideways_friction 0 set g_physics_quake_aircontrol 0 set g_physics_quake_aircontrol_power 2 set g_physics_quake_aircontrol_backwards 0 +set g_physics_quake_aircontrol_sidewards 0 set g_physics_quake_aircontrol_penalty 0 set g_physics_quake_warsowbunny_airforwardaccel 1.00001 set g_physics_quake_warsowbunny_topspeed 925 @@ -116,6 +119,7 @@ set g_physics_warsow_airaccel_sideways_friction 0 set g_physics_warsow_aircontrol 0 set g_physics_warsow_aircontrol_power 2 set g_physics_warsow_aircontrol_backwards 0 +set g_physics_warsow_aircontrol_sidewards 0 set g_physics_warsow_aircontrol_penalty 0 set g_physics_warsow_warsowbunny_airforwardaccel 1.00001 set g_physics_warsow_warsowbunny_topspeed 925 @@ -145,6 +149,7 @@ set g_physics_defrag_airaccel_sideways_friction 0 set g_physics_defrag_aircontrol 150 set g_physics_defrag_aircontrol_power 2 set g_physics_defrag_aircontrol_backwards 0 +set g_physics_defrag_aircontrol_sidewards 0 set g_physics_defrag_aircontrol_penalty 0 set g_physics_defrag_warsowbunny_airforwardaccel 1.00001 set g_physics_defrag_warsowbunny_topspeed 925 @@ -174,6 +179,7 @@ set g_physics_quake3_airaccel_sideways_friction 0 set g_physics_quake3_aircontrol 0 set g_physics_quake3_aircontrol_power 2 set g_physics_quake3_aircontrol_backwards 0 +set g_physics_quake3_aircontrol_sidewards 0 set g_physics_quake3_aircontrol_penalty 0 set g_physics_quake3_warsowbunny_airforwardaccel 1.00001 set g_physics_quake3_warsowbunny_topspeed 925 @@ -203,6 +209,7 @@ set g_physics_vecxis_airaccel_sideways_friction 0.3 set g_physics_vecxis_aircontrol 0 set g_physics_vecxis_aircontrol_power 2 set g_physics_vecxis_aircontrol_backwards 0 +set g_physics_vecxis_aircontrol_sidewards 0 set g_physics_vecxis_aircontrol_penalty 0 set g_physics_vecxis_warsowbunny_airforwardaccel 1.00001 set g_physics_vecxis_warsowbunny_topspeed 925 @@ -232,6 +239,7 @@ set g_physics_quake2_airaccel_sideways_friction 0 set g_physics_quake2_aircontrol 0 set g_physics_quake2_aircontrol_power 2 set g_physics_quake2_aircontrol_backwards 0 +set g_physics_quake2_aircontrol_sidewards 0 set g_physics_quake2_aircontrol_penalty 0 set g_physics_quake2_warsowbunny_airforwardaccel 1.00001 set g_physics_quake2_warsowbunny_topspeed 925 @@ -261,6 +269,7 @@ set g_physics_bones_airaccel_sideways_friction 0 set g_physics_bones_aircontrol 150 set g_physics_bones_aircontrol_power 2 set g_physics_bones_aircontrol_backwards 0 +set g_physics_bones_aircontrol_sidewards 0 set g_physics_bones_aircontrol_penalty 0 set g_physics_bones_warsowbunny_airforwardaccel 1.00001 set g_physics_bones_warsowbunny_topspeed 925 @@ -290,6 +299,7 @@ set g_physics_overkill_airaccel_sideways_friction 0 set g_physics_overkill_aircontrol 125 set g_physics_overkill_aircontrol_power 2 set g_physics_overkill_aircontrol_backwards 0 +set g_physics_overkill_aircontrol_sidewards 0 set g_physics_overkill_aircontrol_penalty 180 set g_physics_overkill_warsowbunny_airforwardaccel 1.00001 set g_physics_overkill_warsowbunny_topspeed 925 diff --git a/physicsCPMA.cfg b/physicsCPMA.cfg index f2a4209c2..612a779da 100644 --- a/physicsCPMA.cfg +++ b/physicsCPMA.cfg @@ -24,6 +24,7 @@ sv_aircontrol 150 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsFruit.cfg b/physicsFruit.cfg index efe5b46ac..8e0a7f0fe 100644 --- a/physicsFruit.cfg +++ b/physicsFruit.cfg @@ -23,6 +23,7 @@ sv_airstrafeaccel_qw -0.97 sv_aircontrol 125 sv_aircontrol_power 2.5 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsHavoc.cfg b/physicsHavoc.cfg index 8d02ff462..e5d431b3e 100644 --- a/physicsHavoc.cfg +++ b/physicsHavoc.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsLeeStricklin-ModdedFruit.cfg b/physicsLeeStricklin-ModdedFruit.cfg index 61ce6557d..81d54d2ee 100644 --- a/physicsLeeStricklin-ModdedFruit.cfg +++ b/physicsLeeStricklin-ModdedFruit.cfg @@ -32,6 +32,7 @@ sv_aircontrol 125 sv_aircontrol_penalty 150 sv_aircontrol_power 2.5 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 800 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsLeeStricklin.cfg b/physicsLeeStricklin.cfg index 53ec90148..741224b11 100644 --- a/physicsLeeStricklin.cfg +++ b/physicsLeeStricklin.cfg @@ -32,6 +32,7 @@ sv_aircontrol 125 sv_aircontrol_penalty 150 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 800 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsLeeStricklinOld.cfg b/physicsLeeStricklinOld.cfg index 6a24567a9..83689d161 100644 --- a/physicsLeeStricklinOld.cfg +++ b/physicsLeeStricklinOld.cfg @@ -27,6 +27,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsLzd.cfg b/physicsLzd.cfg index f6f74cd21..de271c298 100644 --- a/physicsLzd.cfg +++ b/physicsLzd.cfg @@ -25,6 +25,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz10.cfg b/physicsNexuiz10.cfg index 9292016af..28d7c7f2c 100644 --- a/physicsNexuiz10.cfg +++ b/physicsNexuiz10.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz11.cfg b/physicsNexuiz11.cfg index 660e7b818..7633e5a28 100644 --- a/physicsNexuiz11.cfg +++ b/physicsNexuiz11.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz151.cfg b/physicsNexuiz151.cfg index 2c2e94c5f..aaec2756f 100644 --- a/physicsNexuiz151.cfg +++ b/physicsNexuiz151.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz151b.cfg b/physicsNexuiz151b.cfg index 45a46cb46..3cd9df61e 100644 --- a/physicsNexuiz151b.cfg +++ b/physicsNexuiz151b.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz16rc1.cfg b/physicsNexuiz16rc1.cfg index 86f1c31c7..17b8de8e4 100644 --- a/physicsNexuiz16rc1.cfg +++ b/physicsNexuiz16rc1.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz20.cfg b/physicsNexuiz20.cfg index fe4617688..168ec2d34 100644 --- a/physicsNexuiz20.cfg +++ b/physicsNexuiz20.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz25.cfg b/physicsNexuiz25.cfg index ed45598a9..6038e7b6a 100644 --- a/physicsNexuiz25.cfg +++ b/physicsNexuiz25.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNexuiz26.cfg b/physicsNexuiz26.cfg index 3f7cd58f1..cb088f9df 100644 --- a/physicsNexuiz26.cfg +++ b/physicsNexuiz26.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsNoQWBunny-nexbased.cfg b/physicsNoQWBunny-nexbased.cfg index 77660a426..2b054788a 100644 --- a/physicsNoQWBunny-nexbased.cfg +++ b/physicsNoQWBunny-nexbased.cfg @@ -33,6 +33,7 @@ sv_aircontrol 125 sv_aircontrol_penalty 100 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsOverkill.cfg b/physicsOverkill.cfg index c40b755bf..526f7e222 100644 --- a/physicsOverkill.cfg +++ b/physicsOverkill.cfg @@ -38,6 +38,7 @@ sv_aircontrol 125 sv_aircontrol_penalty 180 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 900 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsQ.cfg b/physicsQ.cfg index 609a8f3d3..c880f511e 100644 --- a/physicsQ.cfg +++ b/physicsQ.cfg @@ -25,6 +25,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsQ2.cfg b/physicsQ2.cfg index a9fbe166d..992cb3e62 100644 --- a/physicsQ2.cfg +++ b/physicsQ2.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsQ2a.cfg b/physicsQ2a.cfg index 87817dfcf..ce3232696 100644 --- a/physicsQ2a.cfg +++ b/physicsQ2a.cfg @@ -25,6 +25,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsQ3.cfg b/physicsQ3.cfg index 7363b216d..a6d46ca82 100644 --- a/physicsQ3.cfg +++ b/physicsQ3.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsQBF.cfg b/physicsQBF.cfg index adc9df69c..39b705637 100644 --- a/physicsQBF.cfg +++ b/physicsQBF.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsQBFplus.cfg b/physicsQBFplus.cfg index 596d6ca3b..2e092b123 100644 --- a/physicsQBFplus.cfg +++ b/physicsQBFplus.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsSamual.cfg b/physicsSamual.cfg index 9041601e2..8506e2255 100644 --- a/physicsSamual.cfg +++ b/physicsSamual.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsWarsow.cfg b/physicsWarsow.cfg index 5fbe22bab..1bd23b647 100644 --- a/physicsWarsow.cfg +++ b/physicsWarsow.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 9 // activates warsow movement mode sv_warsowbunny_accel 0.1593 diff --git a/physicsWarsowClassicBunny.cfg b/physicsWarsowClassicBunny.cfg index 3b28d9099..985be7e95 100644 --- a/physicsWarsowClassicBunny.cfg +++ b/physicsWarsowClassicBunny.cfg @@ -24,6 +24,7 @@ sv_aircontrol 150 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsWarsowDev.cfg b/physicsWarsowDev.cfg index cf31a3f93..dff451087 100644 --- a/physicsWarsowDev.cfg +++ b/physicsWarsowDev.cfg @@ -24,6 +24,7 @@ sv_aircontrol 0 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 6 // activates warsow movement mode sv_warsowbunny_accel 0.1585 diff --git a/physicsX.cfg b/physicsX.cfg index 2ef068975..6b154508e 100644 --- a/physicsX.cfg +++ b/physicsX.cfg @@ -39,6 +39,7 @@ sv_aircontrol 100 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 900 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsX010.cfg b/physicsX010.cfg index 0dfe0b46c..9c5a7d334 100644 --- a/physicsX010.cfg +++ b/physicsX010.cfg @@ -32,6 +32,7 @@ sv_aircontrol 125 sv_aircontrol_penalty 150 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 800 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsX07.cfg b/physicsX07.cfg index 132aa9eff..1fd86cd80 100644 --- a/physicsX07.cfg +++ b/physicsX07.cfg @@ -38,6 +38,7 @@ sv_aircontrol 125 sv_aircontrol_penalty 180 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 800 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsXDF.cfg b/physicsXDF.cfg index db55fd849..e192ab476 100644 --- a/physicsXDF.cfg +++ b/physicsXDF.cfg @@ -30,6 +30,7 @@ sv_aircontrol 150 sv_aircontrol_penalty 0 sv_aircontrol_power 2 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/physicsXDFLight.cfg b/physicsXDFLight.cfg index 4d1f652bb..24705deb8 100644 --- a/physicsXDFLight.cfg +++ b/physicsXDFLight.cfg @@ -30,6 +30,7 @@ sv_aircontrol 100 sv_aircontrol_penalty 100 sv_aircontrol_power 2.5 sv_aircontrol_backwards 0 +sv_aircontrol_sidewards 0 sv_airspeedlimit_nonqw 0 sv_warsowbunny_turnaccel 0 sv_warsowbunny_accel 0.1593 diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 193b7ef7c..d95958392 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -413,6 +413,7 @@ float autocvar_cl_hitsound_nom_damage = 25; float autocvar_cl_hitsound_antispam_time; int autocvar_cl_eventchase_death = 1; float autocvar_cl_eventchase_distance = 140; +bool autocvar_cl_eventchase_frozen = false; float autocvar_cl_eventchase_speed = 1.3; vector autocvar_cl_eventchase_maxs = '12 12 8'; vector autocvar_cl_eventchase_mins = '-12 -12 -8'; diff --git a/qcsrc/client/hud/hud.qc b/qcsrc/client/hud/hud.qc index 36de6b3f1..f6469a58b 100644 --- a/qcsrc/client/hud/hud.qc +++ b/qcsrc/client/hud/hud.qc @@ -109,10 +109,7 @@ vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspe rows = ceil(item_count/columns); } - if(vertical) - return eX * best_rows + eY * best_columns; - else - return eX * best_columns + eY * best_rows; + return (vertical) ? vec2(best_rows, best_columns) : vec2(best_columns, best_rows); } /* @@ -490,8 +487,9 @@ void calc_followmodel_ofs(entity view); void Hud_Dynamic_Frame() { vector ofs = '0 0 0'; - hud_scale = '1 1 0'; - hud_shift = '0 0 0'; + hud_scale_current = '1 1 0'; + hud_shift_current = '0 0 0'; + if (autocvar_hud_dynamic_follow) { entity view = CSQCModel_server2csqc(player_localentnum - 1); @@ -508,12 +506,12 @@ void Hud_Dynamic_Frame() ofs.y = bound(-0.1, ofs.y, 0.1); ofs.z = bound(-0.1, ofs.z, 0.1); - hud_shift.x = ofs.y * vid_conwidth; - hud_shift.y = ofs.z * vid_conheight; - hud_shift.z = ofs.x; + hud_shift_current.x = ofs.y * vid_conwidth; + hud_shift_current.y = ofs.z * vid_conheight; + hud_shift_current.z = ofs.x; - hud_scale.x = (1 + hud_shift.z); - hud_scale.y = hud_scale.x; + hud_scale_current.x = (1 + hud_shift_current.z); + hud_scale_current.y = hud_scale_current.x; } if(autocvar_hud_dynamic_shake > 0) @@ -550,16 +548,15 @@ void Hud_Dynamic_Frame() if(hud_dynamic_shake_factor > 0) { - hud_shift.x += hud_dynamic_shake_realofs.x; - hud_shift.y += hud_dynamic_shake_realofs.y; + hud_shift_current.x += hud_dynamic_shake_realofs.x; + hud_shift_current.y += hud_dynamic_shake_realofs.y; } } hud_scale_center.x = 0.5 * vid_conwidth; hud_scale_center.y = 0.5 * vid_conheight; - hud_scale_current = hud_scale; - hud_shift_current = hud_shift; + HUD_Scale_Disable(); } void HUD_Main() diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index 9f0f4e7bf..8eaef9068 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -11,12 +11,12 @@ REGISTRY(hud_panels, BITS(6)) #define hud_panels_from(i) _hud_panels_from(i, NULL) REGISTER_REGISTRY(hud_panels) -#define REGISTER_HUD_PANEL(id, draw_func, name, configflags, showflags) \ +#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \ void draw_func(); \ REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \ this.panel_id = this.m_id; \ this.panel_draw = draw_func; \ - this.panel_name = #name; \ + this.panel_name = strzone(strtolower(#id)); \ this.panel_configflags = configflags; \ this.panel_showflags = showflags; \ } @@ -31,7 +31,7 @@ REGISTER_REGISTRY(hud_panels) panel.current_panel_bg, \ HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \ panel_bg_color, panel_bg_alpha, \ - HUD_Scale('1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)) \ + HUD_Scale('1 1 0' * BORDER_MULTIPLIER * panel_bg_border) \ ); \ } MACRO_END @@ -81,7 +81,7 @@ float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomrigh entity highlightedPanel; float highlightedAction; // 0 = nothing, 1 = move, 2 = resize -const float BORDER_MULTIPLIER = 0.25; +const float BORDER_MULTIPLIER = 4; float scoreboard_bottom; int weapon_accuracy[Weapons_MAX]; @@ -169,9 +169,9 @@ vector cl_followmodel_ofs; float cl_followmodel_time; vector hud_scale; -vector hud_scale_current; +vector hud_scale_current = '1 1 0'; vector hud_shift; -vector hud_shift_current; +vector hud_shift_current = '0 0 0'; vector hud_scale_center; float stringwidth_colors(string s, vector theSize); @@ -206,31 +206,31 @@ int prev_p_health, prev_p_armor; void HUD_ItemsTime(); -REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, weapons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // WEAPONS -REGISTER_HUD_PANEL(AMMO, HUD_Ammo, ammo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // AMMO -REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, powerups, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // POWERUPS -REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, healtharmor, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // HEALTHARMOR -REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // NOTIFY -REGISTER_HUD_PANEL(TIMER, HUD_Timer, timer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // TIMER -REGISTER_HUD_PANEL(RADAR, HUD_Radar, radar, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RADAR -REGISTER_HUD_PANEL(SCORE, HUD_Score, score, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // SCORE -REGISTER_HUD_PANEL(RACETIMER, HUD_RaceTimer, racetimer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RACETIMER -REGISTER_HUD_PANEL(VOTE, HUD_Vote, vote, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE -REGISTER_HUD_PANEL(MODICONS, HUD_ModIcons, modicons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // MODICONS -REGISTER_HUD_PANEL(PRESSEDKEYS, HUD_PressedKeys, pressedkeys, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PRESSEDKEYS -REGISTER_HUD_PANEL(CHAT, HUD_Chat, chat, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT -REGISTER_HUD_PANEL(ENGINEINFO, HUD_EngineInfo, engineinfo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO -REGISTER_HUD_PANEL(INFOMESSAGES, HUD_InfoMessages, infomessages, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // INFOMESSAGES -REGISTER_HUD_PANEL(PHYSICS, HUD_Physics, physics, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PHYSICS -REGISTER_HUD_PANEL(CENTERPRINT, HUD_CenterPrint, centerprint, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // CENTERPRINT -REGISTER_HUD_PANEL(MINIGAME_BOARD, HUD_MinigameBoard, minigameboard, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAME_BOARD -REGISTER_HUD_PANEL(MINIGAME_STATUS, HUD_MinigameStatus, minigamestatus, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAME_STATUS -REGISTER_HUD_PANEL(MINIGAME_HELP, HUD_MinigameHelp, minigamehelp, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAME_HELP -REGISTER_HUD_PANEL(MINIGAME_MENU, HUD_MinigameMenu, minigamemenu, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAME_MENU -REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, mapvote, PANEL_CONFIG_NO , PANEL_SHOW_MAPVOTE ) // MAPVOTE -REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, itemstime, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // ITEMSTIME -REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, quickmenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME ) // QUICKMENU -REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD +REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // WEAPONS +REGISTER_HUD_PANEL(AMMO, HUD_Ammo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // AMMO +REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // POWERUPS +REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // HEALTHARMOR +REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // NOTIFY +REGISTER_HUD_PANEL(TIMER, HUD_Timer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // TIMER +REGISTER_HUD_PANEL(RADAR, HUD_Radar, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RADAR +REGISTER_HUD_PANEL(SCORE, HUD_Score, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // SCORE +REGISTER_HUD_PANEL(RACETIMER, HUD_RaceTimer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RACETIMER +REGISTER_HUD_PANEL(VOTE, HUD_Vote, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE +REGISTER_HUD_PANEL(MODICONS, HUD_ModIcons, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // MODICONS +REGISTER_HUD_PANEL(PRESSEDKEYS, HUD_PressedKeys, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PRESSEDKEYS +REGISTER_HUD_PANEL(CHAT, HUD_Chat, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT +REGISTER_HUD_PANEL(ENGINEINFO, HUD_EngineInfo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO +REGISTER_HUD_PANEL(INFOMESSAGES, HUD_InfoMessages, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // INFOMESSAGES +REGISTER_HUD_PANEL(PHYSICS, HUD_Physics, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PHYSICS +REGISTER_HUD_PANEL(CENTERPRINT, HUD_CenterPrint, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_WITH_SB) // CENTERPRINT +REGISTER_HUD_PANEL(MINIGAMEBOARD, HUD_MinigameBoard, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAMEBOARD +REGISTER_HUD_PANEL(MINIGAMESTATUS, HUD_MinigameStatus, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAMESTATUS +REGISTER_HUD_PANEL(MINIGAMEHELP, HUD_MinigameHelp, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // MINIGAMEHELP +REGISTER_HUD_PANEL(MINIGAMEMENU, HUD_MinigameMenu, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAMEMENU +REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAPVOTE ) // MAPVOTE +REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // ITEMSTIME +REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME ) // QUICKMENU +REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD // always add new panels to the end of list // Because calling lots of functions in QC apparently cuts fps in half on many machines: @@ -356,7 +356,7 @@ REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, scoreboard, PANEL_CO new_size.x = max_panel_width; \ new_size.y = panel_size.y * (new_size.x / panel_size.x); \ } \ - vector new_pos = eX * (panel_bg_border + 0.5 * max_panel_width) + eY * 0.5 * vid_conheight - 0.5 * new_size; \ + vector new_pos = vec2(panel_bg_border + 0.5 * max_panel_width, 0.5 * vid_conheight) - 0.5 * new_size; \ panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \ panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \ } MACRO_END diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index 4897ba551..073b2d0f7 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -5,12 +5,13 @@ #define HUD_Write(s) fputs(fh, s) #define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n")) -#define HUD_Write_PanelCvar(cvar_suf) HUD_Write_Cvar(strcat("hud_panel_", panel.panel_name, cvar_suf)) +#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str) // Save the config void HUD_Panel_ExportCfg(string cfgname) { float fh; string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg"); + string str = ""; fh = fopen(filename, FILE_WRITE); if(fh >= 0) { @@ -71,157 +72,162 @@ void HUD_Panel_ExportCfg(string cfgname) HUD_Write_PanelCvar("_bg_padding"); switch(panel) { case HUD_PANEL_WEAPONS: - HUD_Write_PanelCvar("_accuracy"); - HUD_Write_PanelCvar("_label"); - HUD_Write_PanelCvar("_label_scale"); - HUD_Write_PanelCvar("_complainbubble"); - HUD_Write_PanelCvar("_complainbubble_padding"); - HUD_Write_PanelCvar("_complainbubble_time"); - HUD_Write_PanelCvar("_complainbubble_fadetime"); - HUD_Write_PanelCvar("_complainbubble_color_outofammo"); - HUD_Write_PanelCvar("_complainbubble_color_donthave"); - HUD_Write_PanelCvar("_complainbubble_color_unavailable"); - HUD_Write_PanelCvar("_ammo"); - HUD_Write_PanelCvar("_ammo_color"); - HUD_Write_PanelCvar("_ammo_alpha"); - HUD_Write_PanelCvar("_aspect"); - HUD_Write_PanelCvar("_timeout"); - HUD_Write_PanelCvar("_timeout_effect"); - HUD_Write_PanelCvar("_timeout_fadebgmin"); - HUD_Write_PanelCvar("_timeout_fadefgmin"); - HUD_Write_PanelCvar("_timeout_speed_in"); - HUD_Write_PanelCvar("_timeout_speed_out"); - HUD_Write_PanelCvar("_onlyowned"); - HUD_Write_PanelCvar("_noncurrent_alpha"); - HUD_Write_PanelCvar("_noncurrent_scale"); + HUD_Write_Cvar("hud_panel_weapons_accuracy"); + HUD_Write_Cvar("hud_panel_weapons_label"); + HUD_Write_Cvar("hud_panel_weapons_label_scale"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble_padding"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble_time"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble_fadetime"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_outofammo"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_donthave"); + HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_unavailable"); + HUD_Write_Cvar("hud_panel_weapons_ammo"); + HUD_Write_Cvar("hud_panel_weapons_ammo_color"); + HUD_Write_Cvar("hud_panel_weapons_ammo_alpha"); + HUD_Write_Cvar("hud_panel_weapons_aspect"); + HUD_Write_Cvar("hud_panel_weapons_timeout"); + HUD_Write_Cvar("hud_panel_weapons_timeout_effect"); + HUD_Write_Cvar("hud_panel_weapons_timeout_fadebgmin"); + HUD_Write_Cvar("hud_panel_weapons_timeout_fadefgmin"); + HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in"); + HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out"); + HUD_Write_Cvar("hud_panel_weapons_onlyowned"); + HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha"); + HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale"); + HUD_Write_Cvar("hud_panel_weapons_selection_radius"); + HUD_Write_Cvar("hud_panel_weapons_selection_speed"); break; case HUD_PANEL_AMMO: - HUD_Write_PanelCvar("_onlycurrent"); - HUD_Write_PanelCvar("_noncurrent_alpha"); - HUD_Write_PanelCvar("_noncurrent_scale"); - HUD_Write_PanelCvar("_iconalign"); - HUD_Write_PanelCvar("_progressbar"); - HUD_Write_PanelCvar("_progressbar_name"); - HUD_Write_PanelCvar("_progressbar_xoffset"); - HUD_Write_PanelCvar("_text"); + HUD_Write_Cvar("hud_panel_ammo_onlycurrent"); + HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha"); + HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale"); + HUD_Write_Cvar("hud_panel_ammo_iconalign"); + HUD_Write_Cvar("hud_panel_ammo_progressbar"); + HUD_Write_Cvar("hud_panel_ammo_progressbar_name"); + HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset"); + HUD_Write_Cvar("hud_panel_ammo_text"); break; case HUD_PANEL_POWERUPS: - HUD_Write_PanelCvar("_iconalign"); - HUD_Write_PanelCvar("_baralign"); - HUD_Write_PanelCvar("_progressbar"); - HUD_Write_PanelCvar("_text"); + HUD_Write_Cvar("hud_panel_powerups_iconalign"); + HUD_Write_Cvar("hud_panel_powerups_baralign"); + HUD_Write_Cvar("hud_panel_powerups_progressbar"); + HUD_Write_Cvar("hud_panel_powerups_text"); break; case HUD_PANEL_HEALTHARMOR: - HUD_Write_PanelCvar("_flip"); - HUD_Write_PanelCvar("_iconalign"); - HUD_Write_PanelCvar("_baralign"); - HUD_Write_PanelCvar("_progressbar"); - HUD_Write_PanelCvar("_progressbar_health"); - HUD_Write_PanelCvar("_progressbar_armor"); - HUD_Write_PanelCvar("_progressbar_gfx"); - HUD_Write_PanelCvar("_progressbar_gfx_smooth"); - HUD_Write_PanelCvar("_combined"); - HUD_Write_PanelCvar("_text"); + HUD_Write_Cvar("hud_panel_healtharmor_combined"); + HUD_Write_Cvar("hud_panel_healtharmor_flip"); + HUD_Write_Cvar("hud_panel_healtharmor_iconalign"); + HUD_Write_Cvar("hud_panel_healtharmor_baralign"); + HUD_Write_Cvar("hud_panel_healtharmor_progressbar"); + HUD_Write_Cvar("hud_panel_healtharmor_progressbar_health"); + HUD_Write_Cvar("hud_panel_healtharmor_progressbar_armor"); + HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx"); + HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx_smooth"); + HUD_Write_Cvar("hud_panel_healtharmor_text"); break; case HUD_PANEL_NOTIFY: - HUD_Write_PanelCvar("_flip"); - HUD_Write_PanelCvar("_fontsize"); - HUD_Write_PanelCvar("_time"); - HUD_Write_PanelCvar("_fadetime"); - HUD_Write_PanelCvar("_icon_aspect"); + HUD_Write_Cvar("hud_panel_notify_flip"); + HUD_Write_Cvar("hud_panel_notify_fontsize"); + HUD_Write_Cvar("hud_panel_notify_time"); + HUD_Write_Cvar("hud_panel_notify_fadetime"); + HUD_Write_Cvar("hud_panel_notify_icon_aspect"); break; case HUD_PANEL_TIMER: break; case HUD_PANEL_RADAR: - HUD_Write_PanelCvar("_foreground_alpha"); - HUD_Write_PanelCvar("_rotation"); - HUD_Write_PanelCvar("_zoommode"); - HUD_Write_PanelCvar("_scale"); - HUD_Write_PanelCvar("_maximized_scale"); - HUD_Write_PanelCvar("_maximized_size"); - HUD_Write_PanelCvar("_maximized_rotation"); - HUD_Write_PanelCvar("_maximized_zoommode"); + HUD_Write_Cvar("hud_panel_radar_foreground_alpha"); + HUD_Write_Cvar("hud_panel_radar_rotation"); + HUD_Write_Cvar("hud_panel_radar_zoommode"); + HUD_Write_Cvar("hud_panel_radar_scale"); + HUD_Write_Cvar("hud_panel_radar_maximized_scale"); + HUD_Write_Cvar("hud_panel_radar_maximized_size"); + HUD_Write_Cvar("hud_panel_radar_maximized_rotation"); + HUD_Write_Cvar("hud_panel_radar_maximized_zoommode"); break; case HUD_PANEL_SCORE: - HUD_Write_PanelCvar("_rankings"); + HUD_Write_Cvar("hud_panel_score_rankings"); break; case HUD_PANEL_VOTE: - HUD_Write_PanelCvar("_alreadyvoted_alpha"); + HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha"); break; case HUD_PANEL_MODICONS: - HUD_Write_PanelCvar("_ca_layout"); - HUD_Write_PanelCvar("_dom_layout"); - HUD_Write_PanelCvar("_freezetag_layout"); + HUD_Write_Cvar("hud_panel_modicons_ca_layout"); + HUD_Write_Cvar("hud_panel_modicons_dom_layout"); + HUD_Write_Cvar("hud_panel_modicons_freezetag_layout"); break; case HUD_PANEL_PRESSEDKEYS: - HUD_Write_PanelCvar("_aspect"); - HUD_Write_PanelCvar("_attack"); + HUD_Write_Cvar("hud_panel_pressedkeys_aspect"); + HUD_Write_Cvar("hud_panel_pressedkeys_attack"); break; case HUD_PANEL_ENGINEINFO: - HUD_Write_PanelCvar("_framecounter_time"); - HUD_Write_PanelCvar("_framecounter_decimals"); + HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time"); + HUD_Write_Cvar("hud_panel_engineinfo_framecounter_decimals"); break; case HUD_PANEL_INFOMESSAGES: - HUD_Write_PanelCvar("_flip"); + HUD_Write_Cvar("hud_panel_infomessages_flip"); break; case HUD_PANEL_PHYSICS: - HUD_Write_PanelCvar("_speed_unit_show"); - HUD_Write_PanelCvar("_speed_max"); - HUD_Write_PanelCvar("_speed_vertical"); - HUD_Write_PanelCvar("_topspeed"); - HUD_Write_PanelCvar("_topspeed_time"); - HUD_Write_PanelCvar("_acceleration_max"); - HUD_Write_PanelCvar("_acceleration_vertical"); - HUD_Write_PanelCvar("_flip"); - HUD_Write_PanelCvar("_baralign"); - HUD_Write_PanelCvar("_progressbar"); - HUD_Write_PanelCvar("_acceleration_progressbar_mode"); - HUD_Write_PanelCvar("_acceleration_progressbar_scale"); - HUD_Write_PanelCvar("_acceleration_progressbar_nonlinear"); - HUD_Write_PanelCvar("_text"); - HUD_Write_PanelCvar("_text_scale"); + HUD_Write_Cvar("hud_panel_physics_speed_unit_show"); + HUD_Write_Cvar("hud_panel_physics_speed_max"); + HUD_Write_Cvar("hud_panel_physics_speed_vertical"); + HUD_Write_Cvar("hud_panel_physics_topspeed"); + HUD_Write_Cvar("hud_panel_physics_topspeed_time"); + HUD_Write_Cvar("hud_panel_physics_acceleration_max"); + HUD_Write_Cvar("hud_panel_physics_acceleration_vertical"); + HUD_Write_Cvar("hud_panel_physics_flip"); + HUD_Write_Cvar("hud_panel_physics_baralign"); + HUD_Write_Cvar("hud_panel_physics_progressbar"); + HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode"); + HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale"); + HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear"); + HUD_Write_Cvar("hud_panel_physics_text"); + HUD_Write_Cvar("hud_panel_physics_text_scale"); break; case HUD_PANEL_CENTERPRINT: - HUD_Write_PanelCvar("_align"); - HUD_Write_PanelCvar("_flip"); - HUD_Write_PanelCvar("_fontscale"); - HUD_Write_PanelCvar("_time"); - HUD_Write_PanelCvar("_fade_in"); - HUD_Write_PanelCvar("_fade_out"); - HUD_Write_PanelCvar("_fade_subsequent"); - HUD_Write_PanelCvar("_fade_subsequent_passone"); - HUD_Write_PanelCvar("_fade_subsequent_passone_minalpha"); - HUD_Write_PanelCvar("_fade_subsequent_passtwo"); - HUD_Write_PanelCvar("_fade_subsequent_passtwo_minalpha"); - HUD_Write_PanelCvar("_fade_subsequent_minfontsize"); - HUD_Write_PanelCvar("_fade_minfontsize"); + HUD_Write_Cvar("hud_panel_centerprint_align"); + HUD_Write_Cvar("hud_panel_centerprint_flip"); + HUD_Write_Cvar("hud_panel_centerprint_fontscale"); + HUD_Write_Cvar("hud_panel_centerprint_time"); + HUD_Write_Cvar("hud_panel_centerprint_fade_in"); + HUD_Write_Cvar("hud_panel_centerprint_fade_out"); + HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent"); + HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone"); + HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone_minalpha"); + HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo"); + HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo_minalpha"); + HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_minfontsize"); + HUD_Write_Cvar("hud_panel_centerprint_fade_minfontsize"); break; case HUD_PANEL_ITEMSTIME: - HUD_Write_PanelCvar("_iconalign"); - HUD_Write_PanelCvar("_progressbar"); - HUD_Write_PanelCvar("_progressbar_name"); - HUD_Write_PanelCvar("_progressbar_reduced"); - HUD_Write_PanelCvar("_text"); - HUD_Write_PanelCvar("_ratio"); - HUD_Write_PanelCvar("_dynamicsize"); + HUD_Write_Cvar("hud_panel_itemstime_iconalign"); + HUD_Write_Cvar("hud_panel_itemstime_progressbar"); + HUD_Write_Cvar("hud_panel_itemstime_progressbar_name"); + HUD_Write_Cvar("hud_panel_itemstime_progressbar_reduced"); + HUD_Write_Cvar("hud_panel_itemstime_text"); + HUD_Write_Cvar("hud_panel_itemstime_ratio"); + HUD_Write_Cvar("hud_panel_itemstime_dynamicsize"); + break; + case HUD_PANEL_MAPVOTE: + HUD_Write_Cvar("hud_panel_mapvote_highlight_border"); break; case HUD_PANEL_QUICKMENU: - HUD_Write_PanelCvar("_align"); + HUD_Write_Cvar("hud_panel_quickmenu_align"); break; case HUD_PANEL_SCOREBOARD: - HUD_Write_PanelCvar("_fadeinspeed"); - HUD_Write_PanelCvar("_fadeoutspeed"); - HUD_Write_PanelCvar("_respawntime_decimals"); - HUD_Write_PanelCvar("_table_bg_alpha"); - HUD_Write_PanelCvar("_table_bg_scale"); - HUD_Write_PanelCvar("_table_fg_alpha"); - HUD_Write_PanelCvar("_table_fg_alpha_self"); - HUD_Write_PanelCvar("_table_highlight"); - HUD_Write_PanelCvar("_table_highlight_alpha"); - HUD_Write_PanelCvar("_table_highlight_alpha_self"); - HUD_Write_PanelCvar("_bg_teams_color_team"); - HUD_Write_PanelCvar("_accuracy_doublerows"); - HUD_Write_PanelCvar("_accuracy_nocolors"); + HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed"); + HUD_Write_Cvar("hud_panel_scoreboard_fadeoutspeed"); + HUD_Write_Cvar("hud_panel_scoreboard_respawntime_decimals"); + HUD_Write_Cvar("hud_panel_scoreboard_table_bg_alpha"); + HUD_Write_Cvar("hud_panel_scoreboard_table_bg_scale"); + HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha"); + HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha_self"); + HUD_Write_Cvar("hud_panel_scoreboard_table_highlight"); + HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha"); + HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha_self"); + HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team"); + HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows"); + HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors"); break; } HUD_Write("\n"); @@ -1229,11 +1235,11 @@ void HUD_Configure_DrawGrid() hud_configure_realGridSize.y = hud_configure_gridSize.y * vid_conheight; vector s; // x-axis - s = eX + eY * vid_conheight; + s = vec2(1, vid_conheight); for(i = 1; i < 1/hud_configure_gridSize.x; ++i) drawfill(eX * i * hud_configure_realGridSize.x, s, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL); // y-axis - s = eY + eX * vid_conwidth; + s = vec2(vid_conwidth, 1); for(i = 1; i < 1/hud_configure_gridSize.y; ++i) drawfill(eY * i * hud_configure_realGridSize.y, s, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL); } @@ -1285,11 +1291,13 @@ const string hlBorder = "gfx/hud/default/border_highlighted"; const string hlBorder2 = "gfx/hud/default/border_highlighted2"; void HUD_Panel_HlBorder(float myBorder, vector color, float theAlpha) { - drawfill(panel_pos - '1 1 0' * myBorder, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * theAlpha, DRAWFLAG_NORMAL); - drawpic_tiled(panel_pos - '1 1 0' * myBorder, hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size.x + 2 * myBorder) + eY * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL); - drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * (panel_size.y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size.x + 2 * myBorder) + eY * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL); - drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize, hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size.y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL); - drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize + eX * (panel_size.x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size.y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL); + vector pos = panel_pos - vec2(myBorder, myBorder); + drawfill(pos, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * theAlpha, DRAWFLAG_NORMAL); + drawpic_tiled(pos, hlBorder, '8 1 0' * hlBorderSize, vec2(panel_size.x + 2 * myBorder, hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL); + drawpic_tiled(pos + eY * (panel_size.y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, vec2(panel_size.x + 2 * myBorder, hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL); + pos.y += hlBorderSize; + drawpic_tiled(pos, hlBorder2, '1 8 0' * hlBorderSize, vec2(hlBorderSize, panel_size.y + 2 * myBorder - 2 * hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL); + drawpic_tiled(pos + eX * (panel_size.x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, vec2(hlBorderSize, panel_size.y + 2 * myBorder - 2 * hlBorderSize), color, theAlpha, DRAWFLAG_NORMAL); } void HUD_Configure_PostDraw() diff --git a/qcsrc/client/hud/panel/ammo.qc b/qcsrc/client/hud/panel/ammo.qc index 94545ac4b..7bae78cb6 100644 --- a/qcsrc/client/hud/panel/ammo.qc +++ b/qcsrc/client/hud/panel/ammo.qc @@ -150,7 +150,7 @@ void HUD_Ammo() rows = HUD_GetRowCount(total_ammo_count, mySize, 3); columns = ceil((total_ammo_count)/rows); - ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows); + ammo_size = vec2(mySize.x / columns, mySize.y / rows); vector offset = '0 0 0'; float newSize; @@ -207,7 +207,7 @@ void HUD_Ammo() { ammotype = GetAmmoFieldFromNum(i); DrawAmmoItem( - pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y), + pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)), ammo_size, ammotype, (wep.ammo_field == ammotype), @@ -229,7 +229,7 @@ void HUD_Ammo() float f = bound(0, nade_statuschange_elapsedtime*2, 1); - DrawAmmoNades(pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f); + DrawAmmoNades(pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f); } draw_endBoldFont(); diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index f67cbffbd..3c13fd9c2 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -161,16 +161,16 @@ void HUD_CenterPrint () if (hud_panel_radar_bottom >= 0.96 * vid_conheight) return; - panel_pos = eY * hud_panel_radar_bottom + eX * 0.5 * (vid_conwidth - panel_size_x); - panel_size_y = min(panel_size_y, vid_conheight - hud_panel_radar_bottom); + panel_pos.x = 0.5 * (vid_conwidth - panel_size.x); + panel_pos.y = hud_panel_radar_bottom; + panel_size.y = min(panel_size.y, vid_conheight - hud_panel_radar_bottom); } else if(!autocvar__hud_configure && scoreboard_fade_alpha) { // move the panel below the scoreboard if (scoreboard_bottom >= 0.96 * vid_conheight) return; - vector target_pos; - target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size.x); + vector target_pos = vec2(0.5 * (vid_conwidth - panel_size.x), scoreboard_bottom); if(target_pos.y > panel_pos.y) { panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha); diff --git a/qcsrc/client/hud/panel/healtharmor.qc b/qcsrc/client/hud/panel/healtharmor.qc index 69fced532..5e2bfd3a5 100644 --- a/qcsrc/client/hud/panel/healtharmor.qc +++ b/qcsrc/client/hud/panel/healtharmor.qc @@ -110,7 +110,7 @@ void HUD_HealthArmor() DrawNumIcon(pos, mySize, hp, biggercount, 0, iconalign, HUD_Get_Num_Color(hp, maxtotal), 1); if(fuel) - HUD_Panel_DrawProgressBar(pos, eX * mySize.x + eY * 0.2 * mySize.y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(pos, vec2(mySize.x, 0.2 * mySize.y), "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL); } else { diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index b736dced6..c3e91d3e9 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -38,8 +38,8 @@ void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int if(layout) { - drawpic_aspect_skin(myPos, pic, eX * 0.7 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(myPos + eX * 0.7 * mySize.x, ftos(stat), eX * 0.3 * mySize.x + eY * mySize.y, color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(myPos, pic, vec2(0.7 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(myPos + eX * 0.7 * mySize.x, ftos(stat), vec2(0.3 * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL); } else drawstring_aspect(myPos, ftos(stat), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL); @@ -63,11 +63,12 @@ void HUD_Mod_CA(vector myPos, vector mySize) int i; float row = 0, column = 0; - vector pos, itemSize; - itemSize = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows); + vector pos = '0 0 0', itemSize; + itemSize = vec2(mySize.x / columns, mySize.y / rows); for(i=0; i mySize.y) { // Horizontal arrangement - slot_size = eX * mySize.x / all_keys + eY * mySize.y; + slot_size = vec2(mySize.x / all_keys, mySize.y); for(i = 0; i < all_keys; ++i) KH_SLOTS[i] = pos + eX * slot_size.x * i; } else { // Vertical arrangement - slot_size = eX * mySize.x + eY * mySize.y / all_keys; + slot_size = vec2(mySize.x, mySize.y / all_keys); for(i = 0; i < all_keys; ++i) KH_SLOTS[i] = pos + eY * slot_size.y * i; } @@ -432,10 +433,10 @@ void HUD_Mod_Keepaway(vector pos, vector mySize) if(mySize.x > mySize.y) { kaball_pos = pos + eX * 0.25 * mySize.x; - kaball_size = eX * 0.5 * mySize.x + eY * mySize.y; + kaball_size = vec2(0.5 * mySize.x, mySize.y); } else { kaball_pos = pos + eY * 0.25 * mySize.y; - kaball_size = eY * 0.5 * mySize.y + eX * mySize.x; + kaball_size = vec2(mySize.x, 0.5 * mySize.y); } float kaball_statuschange_elapsedtime = time - kaball_statuschange_time; @@ -445,7 +446,7 @@ void HUD_Mod_Keepaway(vector pos, vector mySize) drawpic_aspect_skin_expanding(kaball_pos, "keepawayball_carrying", kaball_size, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f); if(kaball) - drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos, "keepawayball_carrying", vec2(mySize.x, mySize.y), '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL); } @@ -548,15 +549,19 @@ void HUD_Mod_Race(vector pos, vector mySize) if(mySize.x > mySize.y) { // text on left side squareSize = min(mySize.y, mySize.x/2); - textPos = pos + eX * 0.5 * max(0, mySize.x/2 - squareSize) + eY * 0.5 * (mySize.y - squareSize); - medalPos = pos + eX * 0.5 * max(0, mySize.x/2 - squareSize) + eX * 0.5 * mySize.x + eY * 0.5 * (mySize.y - squareSize); + vector ofs = vec2(0.5 * max(0, mySize.x/2 - squareSize), 0.5 * (mySize.y - squareSize)); + textPos = pos + ofs; + ofs.y += 0.5 * mySize.x; + medalPos = pos + ofs; } else { // text on top squareSize = min(mySize.x, mySize.y/2); - textPos = pos + eY * 0.5 * max(0, mySize.y/2 - squareSize) + eX * 0.5 * (mySize.x - squareSize); - medalPos = pos + eY * 0.5 * max(0, mySize.y/2 - squareSize) + eY * 0.5 * mySize.y + eX * 0.5 * (mySize.x - squareSize); + vector ofs = vec2(0.5 * (mySize.x - squareSize), 0.5 * max(0, mySize.y/2 - squareSize)); + textPos = pos + ofs; + ofs.y += 0.5 * mySize.y; + medalPos = pos + ofs; } - vector textSize = eX * squareSize + eY * 0.25 * squareSize; + vector textSize = vec2(squareSize, 0.25 * squareSize); race_showTime(_("Personal best"), textPos, eY * 0.25 * squareSize, t, textSize, time - crecordtime_change_time); @@ -665,9 +670,9 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, in //draw the text color *= 0.5 + pps_ratio * (1 - 0.5); // half saturated color at min, full saturated at max if (layout == 2) // average pps - drawstring_aspect(myPos + eX * mySize.y, ftos_decimals(stat, 2), eX * (2/3) * mySize.x + eY * mySize.y, color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(myPos + eX * mySize.y, ftos_decimals(stat, 2), vec2((2/3) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL); else // percentage of average pps - drawstring_aspect(myPos + eX * mySize.y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), eX * (2/3) * mySize.x + eY * mySize.y, color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(myPos + eX * mySize.y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), vec2((2/3) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL); } //draw the icon @@ -694,10 +699,10 @@ void HUD_Mod_Dom(vector myPos, vector mySize) int i; float row = 0, column = 0; vector pos, itemSize; - itemSize = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows); + itemSize = vec2(mySize.x / columns, mySize.y / rows); for(i=0; i 0) // next one? - { s = MakeRaceString(race_nextcheckpoint, (time + TIME_DECODE(race_penaltyaccumulator)) - race_laptime, TIME_DECODE(race_nextbesttime), 0, race_nextbestname); - } } } if(s != "" && a > 0) { - drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); + str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y); + drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } if(race_penaltytime) @@ -172,7 +175,8 @@ void HUD_RaceTimer () if(a > 0) { s = sprintf(_("^1PENALTY: %.1f (%s)"), race_penaltytime * 0.1, race_penaltyreason); - drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.8 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); + str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.8 * mySize.y); + drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } } @@ -181,7 +185,8 @@ void HUD_RaceTimer () if(forcetime != "") { a = bound(0, (time - race_checkpointtime) / 0.5, 1); - drawstring_expanding(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(forcetime, false, '1 1 0' * 0.6 * mySize.y), forcetime, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, 0, a); + str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(forcetime, false, '1 1 0' * 0.6 * mySize.y)); + drawstring_expanding(str_pos, forcetime, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, 0, a); } else a = 1; @@ -189,7 +194,8 @@ void HUD_RaceTimer () if(race_laptime && race_checkpoint != 255) { s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime)); - drawstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, false, '0.6 0.6 0' * mySize.y), s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); + str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(s, false, '0.6 0.6 0' * mySize.y)); + drawstring(str_pos, s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); } draw_endBoldFont(); @@ -200,13 +206,15 @@ void HUD_RaceTimer () { a = bound(0, 2 - (time - race_mycheckpointtime), 1); s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -(race_mycheckpointenemy == ""), race_mycheckpointlapsdelta, race_mycheckpointenemy); - drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); + str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y); + drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } if(race_othercheckpointtime && race_othercheckpointenemy != "") { a = bound(0, 2 - (time - race_othercheckpointtime), 1); s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -(race_othercheckpointenemy == ""), race_othercheckpointlapsdelta, race_othercheckpointenemy); - drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); + str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y); + drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } if(race_penaltytime && !race_penaltyaccumulator) @@ -219,7 +227,8 @@ void HUD_RaceTimer () s = sprintf(_("^1PENALTY: %.1f (%s)"), (t - time) * 0.1, race_penaltyreason); else s = sprintf(_("^2PENALTY: %.1f (%s)"), 0, race_penaltyreason); - drawcolorcodedstring(pos + eX * 0.5 * mySize.x - '0.5 0 0' * stringwidth(s, true, '1 1 0' * 0.2 * mySize.y) + eY * 0.6 * mySize.y, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); + str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y); + drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha * a, DRAWFLAG_NORMAL); } } } diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index 972e4effb..24be15432 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -35,8 +35,8 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me) players_per_team = max(2, ceil((entries - 1) / team_count)); for(i=0; i 3) @@ -272,7 +272,7 @@ void HUD_Score() } } else - score_size = eX * mySize.x*(1/4) + eY * mySize.y*(1/3); + score_size = vec2(mySize.x / 4, mySize.y / 3); float max_fragcount; max_fragcount = -99; @@ -293,7 +293,7 @@ void HUD_Score() if (spectatee_status == -1) { - score_pos = pos + eX * column * (score_size.x + offset.x) + eY * row * (score_size.y + offset.y); + score_pos = pos + vec2(column * (score_size.x + offset.x), row * (score_size.y + offset.y)); if (max_fragcount == score) HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); drawstring_aspect(score_pos, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); @@ -306,12 +306,12 @@ void HUD_Score() } else if(tm.team == myteam) { if (max_fragcount == score) - HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize.x + eY * mySize.y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); + HUD_Panel_DrawHighlight(pos, vec2(0.75 * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos, ftos(score), vec2(0.75 * mySize.x, mySize.y), Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); } else { if (max_fragcount == score) - HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(pos + eX * 0.75 * mySize.x + eY * (1/3) * rows * mySize.y, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); + HUD_Panel_DrawHighlight(pos + vec2(0.75 * mySize.x, (1/3) * rows * mySize.y), score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos + vec2(0.75 * mySize.x, (1/3) * rows * mySize.y), ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); ++rows; } } diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index b8c9a3ea1..e6e5f3649 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -725,10 +725,11 @@ string Scoreboard_FixColumnWidth(int i, string str) sbt_fixcolumnwidth_iconlen = f; } - sbt_fixcolumnwidth_iconlen *= hud_fontsize.y / hud_fontsize.x; // fix icon aspect - if(sbt_fixcolumnwidth_iconlen != 0) + { + sbt_fixcolumnwidth_iconlen *= hud_fontsize.y / hud_fontsize.x; // fix icon aspect sbt_fixcolumnwidth_marginlen = stringwidth(" ", false, hud_fontsize); + } else sbt_fixcolumnwidth_marginlen = 0; @@ -823,7 +824,7 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i bool is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR); vector h_pos = item_pos; - vector h_size = eX * panel_size.x + eY * hud_fontsize.y * 1.25; + vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25); // alternated rows highlighting if(is_self) drawfill(h_pos, h_size, rgb, sbt_highlight_alpha_self, DRAWFLAG_NORMAL); @@ -863,11 +864,11 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i tmp.x = sbt_field_size[i] + hud_fontsize.x; if(sbt_field_icon0 != "") - drawpic(pos - tmp, sbt_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); + drawpic(pos - tmp, sbt_field_icon0, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); if(sbt_field_icon1 != "") - drawpic(pos - tmp, sbt_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); + drawpic(pos - tmp, sbt_field_icon1, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); if(sbt_field_icon2 != "") - drawpic(pos - tmp, sbt_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL); + drawpic(pos - tmp, sbt_field_icon2, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL); } if(sbt_field[i] == SP_SEPARATOR) @@ -897,11 +898,11 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i tmp.x = sbt_field_size[i]; if(sbt_field_icon0 != "") - drawpic(pos - tmp, sbt_field_icon0, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); + drawpic(pos - tmp, sbt_field_icon0, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); if(sbt_field_icon1 != "") - drawpic(pos - tmp, sbt_field_icon1, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); + drawpic(pos - tmp, sbt_field_icon1, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon1_rgb, fg_alpha, DRAWFLAG_NORMAL); if(sbt_field_icon2 != "") - drawpic(pos - tmp, sbt_field_icon2, eY * hud_fontsize.y + eX * hud_fontsize.x * sbt_fixcolumnwidth_iconlen, sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL); + drawpic(pos - tmp, sbt_field_icon2, vec2(hud_fontsize.x * sbt_fixcolumnwidth_iconlen, hud_fontsize.y), sbt_field_icon2_rgb, fg_alpha, DRAWFLAG_NORMAL); pos.x -= sbt_field_size[i] + hud_fontsize.x; } } @@ -914,7 +915,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity { int i = 0; vector h_pos = item_pos; - vector h_size = eX * panel_size.x + eY * hud_fontsize.y * 1.25; + vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25); bool complete = (this_team == NUM_SPECTATOR); @@ -1006,7 +1007,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity pos.x += column_width; pos.x += hud_fontsize.x; } - return eX * item_pos.x + eY * (item_pos.y + i * hud_fontsize.y * 1.25); + return vec2(item_pos.x, item_pos.y + i * hud_fontsize.y * 1.25); } vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size) @@ -1048,7 +1049,7 @@ vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size) } pos = panel_pos; - vector tmp = eX * panel_size.x + eY * 1.25 * hud_fontsize.y; + vector tmp = vec2(panel_size.x, 1.25 * hud_fontsize.y); // rounded header if (sbt_bg_alpha) @@ -1185,11 +1186,11 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) // column highlighting for (int i = 0; i < columnns; ++i) if ((i % 2) == 0) - drawfill(pos + eX * weapon_width * rows * i, eY * height * rows + eX * weapon_width * rows, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL); + drawfill(pos + eX * weapon_width * rows * i, vec2(weapon_width * rows, height * rows), '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL); // row highlighting for (int i = 0; i < rows; ++i) - drawfill(pos + eY * weapon_height + eY * height * i, eX * tmp.x + eY * hud_fontsize.y, rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL); + drawfill(pos + eY * (weapon_height + height * i), vec2(tmp.x, hud_fontsize.y), rgb, sbt_highlight_alpha, DRAWFLAG_NORMAL); } average_accuracy = 0; @@ -1220,7 +1221,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) weapon_alpha = 0.2 * sbt_fg_alpha; // weapon icon - drawpic_aspect_skin(tmpos, it.model2, eX * weapon_width + eY * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(tmpos, it.model2, vec2(weapon_width, weapon_height), '1 1 1', weapon_alpha, DRAWFLAG_NORMAL); // the accuracy if (weapon_stats >= 0) { weapons_with_stats += 1; @@ -1235,7 +1236,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) if(!autocvar_hud_panel_scoreboard_accuracy_nocolors) rgb = Accuracy_GetColor(weapon_stats); - drawstring(tmpos + eX * padding + eY * weapon_height, s, hud_fontsize, rgb, sbt_fg_alpha, DRAWFLAG_NORMAL); + drawstring(tmpos + vec2(padding, weapon_height), s, hud_fontsize, rgb, sbt_fg_alpha, DRAWFLAG_NORMAL); } tmpos.x += weapon_width * rows; pos.x += weapon_width * rows; @@ -1373,7 +1374,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz float ranksize = 3 * hud_fontsize.x; float timesize = 5 * hud_fontsize.x; - vector columnsize = eX * (ranksize + timesize + namesize + hud_fontsize.x) + eY * 1.25 * hud_fontsize.y; + vector columnsize = vec2(ranksize + timesize + namesize + hud_fontsize.x, 1.25 * hud_fontsize.y); int columns = max(1, floor((panel_size.x - 2 * panel_bg_padding) / columnsize.x)); columns = min(columns, RANKINGS_RECEIVED_CNT); @@ -1402,7 +1403,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz if (sbt_bg_alpha) drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, panel_size, rgb, sbt_bg_alpha, DRAWFLAG_NORMAL); - vector text_ofs = eX * 0.5 * hud_fontsize.x + eY * (1.25 - 1) / 2 * hud_fontsize.y; // center text vertically + vector text_ofs = vec2(0.5 * hud_fontsize.x, (1.25 - 1) / 2 * hud_fontsize.y); // center text vertically string str = ""; int column = 0, j = 0; for(i = 0; i < RANKINGS_RECEIVED_CNT; ++i) @@ -1509,6 +1510,7 @@ void Scoreboard_Draw() vector pos = panel_pos; entity pl, tm; string str; + vector str_pos; // Heading vector sb_heading_fontsize; @@ -1543,12 +1545,14 @@ void Scoreboard_Draw() draw_beginBoldFont(); vector rgb = Team_ColorRGB(tm.team); str = ftos(tm.(teamscores(ts_primary))); - drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, panel_fg_alpha, DRAWFLAG_NORMAL); + str_pos = pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize * 1.5); + drawstring(str_pos, str, hud_fontsize * 1.5, rgb, panel_fg_alpha, DRAWFLAG_NORMAL); if(ts_primary != ts_secondary) { str = ftos(tm.(teamscores(ts_secondary))); - drawstring(pos + team_score_baseoffset - eX * stringwidth(str, false, hud_fontsize) + eY * hud_fontsize.y * 1.5, str, hud_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL); + str_pos = pos + team_score_baseoffset - vec2(stringwidth(str, false, hud_fontsize), hud_fontsize.y * 1.5); + drawstring(str_pos, str, hud_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL); } draw_endBoldFont(); if(autocvar_hud_panel_scoreboard_bg_teams_color_team > 0) diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index d974bee4b..22f1678b6 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -74,8 +74,8 @@ void HUD_Vote() if(uid2name_dialog) { - panel_pos = eX * 0.3 * vid_conwidth + eY * 0.1 * vid_conheight; - panel_size = eX * 0.4 * vid_conwidth + eY * 0.3 * vid_conheight; + panel_pos = vec2(0.3 * vid_conwidth, 0.1 * vid_conheight); + panel_size = vec2(0.4 * vid_conwidth, 0.3 * vid_conheight); } vector pos, mySize; @@ -115,20 +115,20 @@ void HUD_Vote() s = _("A vote has been called for:"); if(uid2name_dialog) s = _("Allow servers to store and display your name?"); - drawstring_aspect(pos, s, eX * mySize.x + eY * (2/8) * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos, s, vec2(mySize.x, (2/8) * mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); s = textShortenToWidth(ColorTranslateRGB(vote_called_vote), mySize.x, '1 1 0' * mySize.y * (1/8), stringwidth_colors); if(autocvar__hud_configure) s = _("^1Configure the HUD"); - drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize.y, s, eX * mySize.x + eY * (1.75/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL); + drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize.y, s, vec2(mySize.x, (1.75/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL); // print the yes/no counts s = sprintf("^2%s ^7(%d)", getcommandkey_forcename(_("Yes"), "vyes"), vote_yescount); - drawcolorcodedstring_aspect(pos + eY * (4/8) * mySize.y, s, eX * 0.5 * mySize.x + eY * (1.5/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL); + drawcolorcodedstring_aspect(pos + eY * (4/8) * mySize.y, s, vec2(0.5 * mySize.x, (1.5/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL); s = sprintf("^1%s ^7(%d)", getcommandkey_forcename(_("No"), "vno"), vote_nocount); - drawcolorcodedstring_aspect(pos + eX * 0.5 * mySize.x + eY * (4/8) * mySize.y, s, eX * 0.5 * mySize.x + eY * (1.5/8) * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL); + drawcolorcodedstring_aspect(pos + vec2(0.5 * mySize.x, (4/8) * mySize.y), s, vec2(0.5 * mySize.x, (1.5/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += (5/8) * mySize.y; - vector tmp_size = eX * mySize.x + eY * (3/8) * mySize.y; + vector tmp_size = vec2(mySize.x, (3/8) * mySize.y); // draw the progress bar backgrounds drawpic_skin(pos, "voteprogress_back", tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 69fd82c9e..b4997467e 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -407,7 +407,7 @@ void HUD_Weapons() } // figure out the drawing position of weapon - weapon_pos = (panel_pos + eX * column * weapon_size.x + eY * row * weapon_size.y); + weapon_pos = panel_pos + vec2(column * weapon_size.x, row * weapon_size.y); // update position of the currently selected weapon if(it == panel_switchweapon) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index a098bd7f9..c53943221 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -31,7 +31,7 @@ void draw_cursor(vector pos, vector ofs, string img, vector col, float a) { - ofs = eX * (ofs.x * SIZE_CURSOR.x) + eY * (ofs.y * SIZE_CURSOR.y); + ofs = vec2(ofs.x * SIZE_CURSOR.x, ofs.y * SIZE_CURSOR.y); drawpic(pos - ofs, strcat(draw_currentSkin, img), SIZE_CURSOR, col, a, DRAWFLAG_NORMAL); } diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 7b07b6800..29728dfde 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -398,7 +398,7 @@ void MapVote_Draw() // higher than the image itself ratio for mapvote items to reserve space for long map names int item_aspect = (gametypevote) ? 3/1 : 5/3; - vector table_size = HUD_GetTableSize_BestItemAR(mv_num_maps, eX * (xmax - xmin) + eY * (ymax - ymin), item_aspect); + vector table_size = HUD_GetTableSize_BestItemAR(mv_num_maps, vec2(xmax - xmin, ymax - ymin), item_aspect); mv_columns = table_size.x; rows = table_size.y; diff --git a/qcsrc/client/miscfunctions.qh b/qcsrc/client/miscfunctions.qh index cbb0e071d..f23a3976b 100644 --- a/qcsrc/client/miscfunctions.qh +++ b/qcsrc/client/miscfunctions.qh @@ -45,8 +45,8 @@ float cvar_or(string cv, float v); vector project_3d_to_2d(vector vec); vector drawfontscale; -#define draw_beginBoldFont() MACRO_BEGIN { drawfont = FONT_USER + 2; } MACRO_END -#define draw_endBoldFont() MACRO_BEGIN { drawfont = FONT_USER + 1; } MACRO_END +#define draw_beginBoldFont() drawfont = FONT_USER + 2 +#define draw_endBoldFont() drawfont = FONT_USER + 1 float expandingbox_sizefactor_from_fadelerp(float fadelerp); diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 6920a98d1..ceaf0a674 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -74,7 +74,7 @@ void Draw_ShowNames(entity this) vector eo = project_3d_to_2d(it.origin); if (eo.z < 0 || eo.x < 0 || eo.y < 0 || eo.x > vid_conwidth || eo.y > vid_conheight) continue; eo.z = 0; - if (vdist(((eX * o.x + eY * o.y) - eo), <, autocvar_hud_shownames_antioverlap_distance) + if (vdist((vec2(o) - eo), <, autocvar_hud_shownames_antioverlap_distance) && vlen2(it.origin - view_origin) < vlen2(this.origin - view_origin)) { overlap = 1; @@ -135,8 +135,8 @@ void Draw_ShowNames(entity this) if (o.z >= 0) { o.z = 0; - vector mySize = (eX * autocvar_hud_shownames_aspect + eY) * autocvar_hud_shownames_fontsize; - vector myPos = o - '0.5 0 0' * mySize.x - '0 1 0' * mySize.y; + vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize; + vector myPos = o - vec2(0.5 * mySize.x, mySize.y); // size scaling mySize.x *= resize; mySize.y *= resize; @@ -147,17 +147,17 @@ void Draw_ShowNames(entity this) float namewidth = mySize.x; if (autocvar_hud_shownames_status && this.sameteam) { - vector v = namepos + '0 1 0' * autocvar_hud_shownames_fontsize * resize; - vector s = eX * 0.5 * mySize.x + eY * resize * autocvar_hud_shownames_statusbar_height; + vector pos = namepos + eY * autocvar_hud_shownames_fontsize * resize; + vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height); if (this.healthvalue > 0) { - HUD_Panel_DrawProgressBar(v, s, "nametag_statusbar", + HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar", this.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', a, DRAWFLAG_NORMAL); } if (this.armorvalue > 0) { - HUD_Panel_DrawProgressBar(v + eX * 0.5 * mySize.x, s, "nametag_statusbar", + HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize.x, sz, "nametag_statusbar", this.armorvalue / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a, DRAWFLAG_NORMAL); } diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 6648b7ecb..efdf2e108 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -63,10 +63,9 @@ float autocvar_cl_leanmodel_highpass = 0.2; float autocvar_cl_leanmodel_lowpass = 0.05; #define avg_factor(avg_time) (1 - exp(-frametime / max(0.001, avg_time))) -#define lowpass(value, frac, ref_store, ret) MACRO_BEGIN \ -{ \ - ret = ref_store = ref_store * (1 - frac) + (value) * frac; \ -} MACRO_END + +#define lowpass(value, frac, ref_store, ret) \ + ret = ref_store = ref_store * (1 - frac) + (value) * frac; #define lowpass_limited(value, frac, limit, ref_store, ret) MACRO_BEGIN \ { \ @@ -772,6 +771,8 @@ bool WantEventchase(entity this) return true; if(MUTATOR_CALLHOOK(WantEventchase, this)) return true; + if(autocvar_cl_eventchase_frozen && STAT(FROZEN)) + return true; if(autocvar_cl_eventchase_death && (STAT(HEALTH) <= 0)) { if(autocvar_cl_eventchase_death == 2) @@ -1206,7 +1207,7 @@ void HUD_Crosshair(entity this) } 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 @@ -1386,29 +1387,33 @@ void HUD_Draw(entity this) if(!intermission) if (MUTATOR_CALLHOOK(HUD_Draw_overlay)) { - drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE); + drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE); } else if(STAT(FROZEN)) { - drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((STAT(REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * STAT(REVIVE_PROGRESS)) + ('0 1 1' * STAT(REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + vector col = '0.25 0.90 1'; + if(STAT(REVIVE_PROGRESS)) + col += vec3(STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS)); + drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); } HUD_Scale_Enable(); if(!intermission) if(STAT(NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death { - DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * STAT(NADE_TIMER)) - ('0 1 1' * STAT(NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); - drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL); + vector col = '0.25 0.90 1' + vec3(STAT(NADE_TIMER), -STAT(NADE_TIMER), -STAT(NADE_TIMER)); + DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL); } else if(STAT(CAPTURE_PROGRESS)) { - DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); - drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL); + DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL); } else if(STAT(REVIVE_PROGRESS)) { - DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); - drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL); + DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL); } HUD_Scale_Disable(); @@ -2111,7 +2116,7 @@ void CSQC_UpdateView(entity this, float w, float h) contentavgalpha = contentavgalpha * (1 - contentalpha_temp) + incontent * contentalpha_temp; if(contentavgalpha) - drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL); + drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL); if(autocvar_hud_postprocessing) { @@ -2187,13 +2192,13 @@ void CSQC_UpdateView(entity this, float w, float h) if(autocvar_cl_gentle_damage == 2) { if(myhealth_flash < pain_threshold) // only randomize when the flash is gone - myhealth_gentlergb = eX * random() + eY * random() + eZ * random(); + myhealth_gentlergb = randomvec(); } else myhealth_gentlergb = stov(autocvar_hud_damage_gentle_color); if(myhealth_flash_temp > 0) - drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); + drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); } else if(myhealth_flash_temp > 0) drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index e7c0f946b..98710d25b 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -256,6 +256,11 @@ vector autocvar_sv_player_crouch_maxs = '16 16 25'; vector autocvar_sv_player_crouch_mins = '-16 -16 -24'; vector autocvar_sv_player_crouch_viewoffset = '0 0 20'; //vector autocvar_sv_player_headsize = '24 24 12'; + +// temporary array used to dump weapon and turret settings +const int MAX_CONFIG_SETTINGS = 256; +string config_queue[MAX_CONFIG_SETTINGS]; + #endif diff --git a/qcsrc/common/csqcmodel_settings.qh b/qcsrc/common/csqcmodel_settings.qh index 9c4909671..9e96756ba 100644 --- a/qcsrc/common/csqcmodel_settings.qh +++ b/qcsrc/common/csqcmodel_settings.qh @@ -62,13 +62,13 @@ CSQCMODEL_PROPERTY_SCALED(BIT(12), float, ReadByte, WriteByte, scale, 16, 0, 255) \ CSQCMODEL_PROPERTY(BIT(13), int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \ CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) \ - CSQCMODEL_PROPERTY(BIT(15), int, ReadByte, WriteByte, multijump_count) \ + CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, multijump_count) \ CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, move_movetype) // TODO get rid of colormod/glowmod here; also get rid of some useless properties on non-players that only exist for CopyBody // add hook function calls here #define CSQCPLAYER_HOOK_POSTCAMERASETUP() \ - CSQCPlayer_SetViewLocation() + viewloc_SetViewLocation() // force updates of player entities this frequently (per second) even if unchanged #ifndef CSQCPLAYER_FORCE_UPDATES diff --git a/qcsrc/common/effects/all.inc b/qcsrc/common/effects/all.inc index 060367a3c..7d2f1d592 100644 --- a/qcsrc/common/effects/all.inc +++ b/qcsrc/common/effects/all.inc @@ -153,6 +153,8 @@ EFFECT(0, ICEORGLASS, "iceorglass") EFFECT(0, ICEFIELD, "icefield") EFFECT(0, FIREFIELD, "firefield") EFFECT(0, HEALING, "healing_fx") +EFFECT(0, ARMOR_REPAIR, "armorrepair_fx") +EFFECT(0, AMMO_REGEN, "ammoregen_fx") EFFECT(1, LASER_BEAM_FAST, "nex242_misc_laser_beam_fast") EFFECT(0, RESPAWN_GHOST, "respawn_ghost") diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index afbd31842..ae4d7a491 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -1,6 +1,6 @@ #include "onslaught.qh" -#ifndef MENUQC +#ifdef GAMEQC REGISTER_NET_LINKED(ENT_ONSCAMERA) #endif diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 5525c4d6a..223a81f7c 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -143,8 +143,8 @@ void onslaught_updatelinks() { l.islinked = false; l.isshielded = true; - int i; - for(i = 0; i < 17; ++i) { l.isgenneighbor[i] = false; l.iscpneighbor[i] = false; } + l.aregensneighbor = 0; + l.arecpsneighbor = 0; LOG_DEBUG(etos(l), " (point) belongs to team ", ftos(l.team)); l.sprite.SendFlags |= 16; } @@ -188,9 +188,9 @@ void onslaught_updatelinks() l.enemy.isshielded = false; } if(l.goalentity.classname == "onslaught_generator") - l.enemy.isgenneighbor[l.goalentity.team] = true; + l.enemy.aregensneighbor |= BIT(l.goalentity.team); else - l.enemy.iscpneighbor[l.goalentity.team] = true; + l.enemy.arecpsneighbor |= BIT(l.goalentity.team); } if (l.enemy.islinked) { @@ -200,9 +200,9 @@ void onslaught_updatelinks() l.goalentity.isshielded = false; } if(l.enemy.classname == "onslaught_generator") - l.goalentity.isgenneighbor[l.enemy.team] = true; + l.goalentity.aregensneighbor |= BIT(l.enemy.team); else - l.goalentity.iscpneighbor[l.enemy.team] = true; + l.goalentity.arecpsneighbor |= BIT(l.enemy.team); } } // now update the generators @@ -328,8 +328,8 @@ void ons_DelayedLinkSetup(entity this) int ons_ControlPoint_CanBeLinked(entity cp, int teamnumber) { - if(cp.isgenneighbor[teamnumber]) { return 2; } - if(cp.iscpneighbor[teamnumber]) { return 1; } + if(cp.aregensneighbor & BIT(teamnumber)) return 2; + if(cp.arecpsneighbor & BIT(teamnumber)) return 1; return 0; } @@ -841,7 +841,7 @@ void ons_camSetup(entity this) float best_trace_fraction = 0; while(ang.y < 360) { - dir = eX * cos(ang.y * DEG2RAD) + eY * sin(ang.y * DEG2RAD); + dir = vec2(cos(ang.y * DEG2RAD), sin(ang.y * DEG2RAD)); dir *= 500; traceline(this.origin, this.origin - dir, MOVE_WORLDONLY, this); if(trace_fraction > best_trace_fraction) @@ -1308,7 +1308,7 @@ void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale continue; // Ignore owned controlpoints - if(!(cp2.isgenneighbor[this.team] || cp2.iscpneighbor[this.team])) + if(!((cp2.aregensneighbor & BIT(this.team)) || (cp2.arecpsneighbor & BIT(this.team)))) continue; // Count team mates interested in this control point diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh index 5f05f7658..0757d7bc6 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh @@ -70,8 +70,8 @@ bool ons_stalemate; .float teleport_antispam; -.bool isgenneighbor[17]; -.bool iscpneighbor[17]; +.int aregensneighbor; +.int arecpsneighbor; float ons_notification_time[17]; .float ons_overtime_damagedelay; diff --git a/qcsrc/common/minigames/cl_minigames.qc b/qcsrc/common/minigames/cl_minigames.qc index 42f8c514e..2e5b30c61 100644 --- a/qcsrc/common/minigames/cl_minigames.qc +++ b/qcsrc/common/minigames/cl_minigames.qc @@ -8,7 +8,7 @@ void minigame_hud_simpleboard(vector pos, vector mySize, string board_texture) panel.current_panel_bg, mySize + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha, - '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)); + '1 1 0' * BORDER_MULTIPLIER * panel_bg_border); drawpic(pos, board_texture, mySize, '1 1 1', panel_bg_alpha, DRAWFLAG_NORMAL); } diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index 1a6d4ff52..5b0ee3c5b 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -427,7 +427,7 @@ void HUD_MinigameMenu_Open() // Handles mouse input on to minigame menu panel void HUD_MinigameMenu_MouseInput() { - panel = HUD_PANEL(MINIGAME_MENU); + panel = HUD_PANEL(MINIGAMEMENU); HUD_Panel_LoadCvars(); @@ -575,7 +575,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary { mousepos_x = nPrimary; mousepos_y = nSecondary; - if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) ) + if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAMEBOARD)) ) active_minigame.minigame_event(active_minigame,"mouse_moved",mousepos); return true; @@ -613,7 +613,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary string action = bInputType == 0 ? "pressed" : "released"; if ( nPrimary >= K_MOUSE1 && nPrimary <= K_MOUSE16 ) { - if ( HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) ) + if ( HUD_mouse_over(HUD_PANEL(MINIGAMEBOARD)) ) device = "mouse"; } else @@ -629,7 +629,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary if ( bInputType == 0 ) { if ( nPrimary == K_MOUSE1 && HUD_MinigameMenu_activeitem && - HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) ) + HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) ) { HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem); return true; @@ -685,7 +685,7 @@ void HUD_Minigame_Mouse() if (!autocvar_hud_cursormode) update_mousepos(); - if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) ) + if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) ) HUD_MinigameMenu_MouseInput(); draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha); diff --git a/qcsrc/common/minigames/minigame/pong.qc b/qcsrc/common/minigames/minigame/pong.qc index dd57fb5c6..55d41617d 100644 --- a/qcsrc/common/minigames/minigame/pong.qc +++ b/qcsrc/common/minigames/minigame/pong.qc @@ -95,8 +95,8 @@ void pong_add_score(entity minigame, int team_thrower, int team_receiver, int de // get point in the box nearest to the given one (2D) vector box_nearest(vector box_min, vector box_max, vector p) { - return eX * ( p_x > box_max_x ? box_max_x : ( p_x < box_min_x ? box_min_x : p_x ) ) - + eY * ( p_y > box_max_y ? box_max_y : ( p_y < box_min_y ? box_min_y : p_y ) ); + return vec2( p.x > box_max.x ? box_max.x : ( p.x < box_min.x ? box_min.x : p.x ), + p.y > box_max.y ? box_max.y : ( p.y < box_min.y ? box_min.y : p.y ) ); } void pong_paddle_bounce(entity ball, int pteam) @@ -293,8 +293,8 @@ void pong_paddle_think(entity this) vector pong_team_to_box_halfsize(int nteam, float length, float width) { if ( nteam > 2 ) - return eY*width/2 + eX*length/2; - return eX*width/2 + eY*length/2; + return vec2(length/2, width/2); + return vec2(width/2, length/2); } vector pong_team_to_paddlepos(int nteam) diff --git a/qcsrc/common/minigames/minigames.qc b/qcsrc/common/minigames/minigames.qc index 227f3d9c6..6d14b2582 100644 --- a/qcsrc/common/minigames/minigames.qc +++ b/qcsrc/common/minigames/minigames.qc @@ -26,8 +26,8 @@ int minigame_tile_number(string id) // Get relative position of the center of a given tile vector minigame_tile_pos(string id, int rows, int columns) { - return eX*(minigame_tile_letter(id)+0.5)/columns + - eY - eY*(minigame_tile_number(id)+0.5)/rows; + return vec2((minigame_tile_letter(id) + 0.5) / columns, + (1 - (minigame_tile_number(id) + 0.5) / rows)); } // Get a tile name from indices diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index 841e7ef40..aba9c9aa9 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -48,8 +48,6 @@ CLASS(Monster, Object) METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; } /** (SERVER) called when monster dies */ METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; } - /** (BOTH) precaches models/sounds used by this monster */ - METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; } /** (SERVER) called when monster is damaged */ METHOD(Monster, mr_pain, float(Monster this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Monster, this); return damage_take; } /** (BOTH?) sets animations for monster */ diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 251b1edc7..f6f8b803b 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -219,14 +219,14 @@ void M_Mage_Defend_Heal(entity this) FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_mage_heal_range, M_Mage_Defend_Heal_Check(this, it), { washealed = true; - string fx = ""; + entity fx = EFFECT_Null; if(IS_PLAYER(it)) { switch(this.skin) { case 0: if(it.health < autocvar_g_balance_health_regenstable) it.health = bound(0, it.health + (autocvar_g_monster_mage_heal_allies), autocvar_g_balance_health_regenstable); - fx = EFFECT_HEALING.eent_eff_name; + fx = EFFECT_HEALING; break; case 1: if(it.ammo_cells) it.ammo_cells = bound(it.ammo_cells, it.ammo_cells + 1, g_pickup_cells_max); @@ -234,22 +234,22 @@ void M_Mage_Defend_Heal(entity this) if(it.ammo_rockets) it.ammo_rockets = bound(it.ammo_rockets, it.ammo_rockets + 1, g_pickup_rockets_max); if(it.ammo_shells) it.ammo_shells = bound(it.ammo_shells, it.ammo_shells + 2, g_pickup_shells_max); if(it.ammo_nails) it.ammo_nails = bound(it.ammo_nails, it.ammo_nails + 5, g_pickup_nails_max); - fx = "ammoregen_fx"; + fx = EFFECT_AMMO_REGEN; break; case 2: if(it.armorvalue < autocvar_g_balance_armor_regenstable) { it.armorvalue = bound(0, it.armorvalue + (autocvar_g_monster_mage_heal_allies), autocvar_g_balance_armor_regenstable); - fx = "armorrepair_fx"; + fx = EFFECT_ARMOR_REPAIR; } break; case 3: it.health = bound(0, it.health - ((it == this) ? (autocvar_g_monster_mage_heal_self) : (autocvar_g_monster_mage_heal_allies)), autocvar_g_balance_health_regenstable); - fx = EFFECT_RAGE.eent_eff_name; + fx = EFFECT_RAGE; break; } - Send_Effect_(fx, it.origin, '0 0 0', 1); + Send_Effect(fx, it.origin, '0 0 0', 1); } else { @@ -464,10 +464,4 @@ METHOD(Mage, mr_setup, bool(Mage this, entity actor)) return true; } - -METHOD(Mage, mr_precache, bool(Mage this)) -{ - TC(Mage, this); - return true; -} #endif diff --git a/qcsrc/common/monsters/monster/mage.qh b/qcsrc/common/monsters/monster/mage.qh index 194b6b2b2..98fb76673 100644 --- a/qcsrc/common/monsters/monster/mage.qh +++ b/qcsrc/common/monsters/monster/mage.qh @@ -17,11 +17,7 @@ CLASS(Mage, Monster) ATTRIB(Mage, monster_name, string, _("Mage")); ENDCLASS(Mage) -REGISTER_MONSTER(MAGE, NEW(Mage)) { -#ifdef GAMEQC - this.mr_precache(this); -#endif -} +REGISTER_MONSTER(MAGE, NEW(Mage)); #include #include diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index a5863623e..b03766bcf 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -116,11 +116,9 @@ void M_Shambler_Attack_Lightning_Think(entity this) void M_Shambler_Attack_Lightning(entity this) { - entity gren; - monster_makevectors(this, this.enemy); - gren = new(grenade); + entity gren = new(grenade); gren.owner = gren.realowner = this; gren.bot_dodge = true; gren.bot_dodgerating = (autocvar_g_monster_shambler_attack_lightning_damage); @@ -265,10 +263,4 @@ METHOD(Shambler, mr_setup, bool(Shambler this, entity actor)) return true; } - -METHOD(Shambler, mr_precache, bool(Shambler this)) -{ - TC(Shambler, this); - return true; -} #endif diff --git a/qcsrc/common/monsters/monster/shambler.qh b/qcsrc/common/monsters/monster/shambler.qh index fde28e9f4..554fe5fe6 100644 --- a/qcsrc/common/monsters/monster/shambler.qh +++ b/qcsrc/common/monsters/monster/shambler.qh @@ -17,8 +17,4 @@ CLASS(Shambler, Monster) ATTRIB(Shambler, monster_name, string, _("Shambler")); ENDCLASS(Shambler) -REGISTER_MONSTER(SHAMBLER, NEW(Shambler)) { -#ifdef GAMEQC - this.mr_precache(this); -#endif -} +REGISTER_MONSTER(SHAMBLER, NEW(Shambler)); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 7ec7f95ac..a65513920 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -18,16 +18,12 @@ void M_Spider_Attack_Web(entity this); REGISTER_MUTATOR(spiderweb, true); -MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics) +MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics_UpdateStats) { - entity player = M_ARGV(0, entity); - - if (time >= player.spider_slowness) - return false; - PHYS_MAXSPEED(player) *= 0.5; // half speed while slow from spider - PHYS_MAXAIRSPEED(player) *= 0.5; - PHYS_AIRSPEEDLIMIT_NONQW(player) *= 0.5; - PHYS_AIRSTRAFEACCELERATE(player) *= 0.5; + entity player = M_ARGV(0, entity); + + if(time < player.spider_slowness) + STAT(MOVEVARS_HIGHSPEED, player) *= 0.5; } MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove) @@ -242,10 +238,4 @@ METHOD(Spider, mr_setup, bool(Spider this, entity actor)) return true; } - -METHOD(Spider, mr_precache, bool(Spider this)) -{ - TC(Spider, this); - return true; -} #endif diff --git a/qcsrc/common/monsters/monster/spider.qh b/qcsrc/common/monsters/monster/spider.qh index cd7fa9e6b..3a688de32 100644 --- a/qcsrc/common/monsters/monster/spider.qh +++ b/qcsrc/common/monsters/monster/spider.qh @@ -17,11 +17,7 @@ CLASS(Spider, Monster) ATTRIB(Spider, monster_name, string, _("Spider")); ENDCLASS(Spider) -REGISTER_MONSTER(SPIDER, NEW(Spider)) { -#ifdef GAMEQC - this.mr_precache(this); -#endif -} +REGISTER_MONSTER(SPIDER, NEW(Spider)); #include diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index b4a76c99f..38df673dd 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -162,10 +162,4 @@ METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor)) return true; } - -METHOD(Wyvern, mr_precache, bool(Wyvern this)) -{ - TC(Wyvern, this); - return true; -} #endif diff --git a/qcsrc/common/monsters/monster/wyvern.qh b/qcsrc/common/monsters/monster/wyvern.qh index 012c9c2a5..2326b0dd1 100644 --- a/qcsrc/common/monsters/monster/wyvern.qh +++ b/qcsrc/common/monsters/monster/wyvern.qh @@ -17,11 +17,7 @@ CLASS(Wyvern, Monster) ATTRIB(Wyvern, monster_name, string, _("Wyvern")); ENDCLASS(Wyvern) -REGISTER_MONSTER(WYVERN, NEW(Wyvern)) { -#ifdef GAMEQC - this.mr_precache(this); -#endif -} +REGISTER_MONSTER(WYVERN, NEW(Wyvern)); #include diff --git a/qcsrc/common/monsters/monster/zombie.qc b/qcsrc/common/monsters/monster/zombie.qc index 6893d31b6..d5011c7f3 100644 --- a/qcsrc/common/monsters/monster/zombie.qc +++ b/qcsrc/common/monsters/monster/zombie.qc @@ -203,10 +203,4 @@ METHOD(Zombie, mr_setup, bool(Zombie this, entity actor)) return true; } - -METHOD(Zombie, mr_precache, bool(Zombie this)) -{ - TC(Zombie, this); - return true; -} #endif diff --git a/qcsrc/common/monsters/monster/zombie.qh b/qcsrc/common/monsters/monster/zombie.qh index dfa37556d..1572a95ea 100644 --- a/qcsrc/common/monsters/monster/zombie.qh +++ b/qcsrc/common/monsters/monster/zombie.qh @@ -17,8 +17,4 @@ CLASS(Zombie, Monster) ATTRIB(Zombie, monster_name, string, _("Zombie")); ENDCLASS(Zombie) -REGISTER_MONSTER(ZOMBIE, NEW(Zombie)) { -#ifdef GAMEQC - this.mr_precache(this); -#endif -} +REGISTER_MONSTER(ZOMBIE, NEW(Zombie)); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 469dd7b9c..5307ccd2d 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -125,7 +125,7 @@ entity Monster_FindTarget(entity this) vector my_center = CENTER_OR_VIEWOFS(this); // find the closest acceptable target to pass to - FOREACH_ENTITY_RADIUS(this.origin, this.target_range, it.monster_attack, + IL_EACH(g_monster_targets, it.monster_attack && vdist(it.origin - this.origin, <, this.target_range), { if(Monster_ValidTarget(this, it)) { @@ -173,6 +173,8 @@ void monster_changeteam(entity this, int newteam) if(!teamplay) { return; } this.team = newteam; + if(!this.monster_attack) + IL_PUSH(g_monster_targets, this); this.monster_attack = true; // new team, activate attacking monster_setupcolors(this); @@ -245,7 +247,7 @@ void Monster_Sound_Precache(string f) { if(tokenize_console(s) != 3) { - LOG_TRACE("Invalid sound info line: ", s); + //LOG_DEBUG("Invalid sound info line: ", s); // probably a comment, no need to spam warnings continue; } PrecacheGlobalSound(strcat(argv(1), " ", argv(2))); @@ -299,7 +301,7 @@ bool Monster_Sounds_Load(entity this, string f, int first) float fh = fopen(f, FILE_READ); if(fh < 0) { - LOG_TRACE("Monster sound file not found: ", f); + //LOG_DEBUG("Monster sound file not found: ", f); // no biggie, monster has no sounds, let's not spam it return false; } while((s = fgets(fh))) @@ -565,7 +567,7 @@ vector Monster_Move_Target(entity this, entity targ) || ((trace_fraction < 1) && (trace_ent != this.enemy))) { this.enemy = NULL; - this.pass_distance = 0; + //this.pass_distance = 0; } if(this.enemy) @@ -656,12 +658,13 @@ vector Monster_Move_Target(entity this, entity targ) void Monster_CalculateVelocity(entity this, vector to, vector from, float turnrate, float movespeed) { - float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis - float initial_height = 0; //min(50, (targ_distance * tanh(20))); - float current_height = (initial_height * min(1, (this.pass_distance) ? (current_distance / this.pass_distance) : current_distance)); + //float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis + //float initial_height = 0; //min(50, (targ_distance * tanh(20))); + //float current_height = (initial_height * min(1, (this.pass_distance) ? (current_distance / this.pass_distance) : current_distance)); //print("current_height = ", ftos(current_height), ", initial_height = ", ftos(initial_height), ".\n"); - vector targpos; + vector targpos = to; +#if 0 if(current_height) // make sure we can actually do this arcing path { targpos = (to + ('0 0 1' * current_height)); @@ -677,6 +680,7 @@ void Monster_CalculateVelocity(entity this, vector to, vector from, float turnra } } else { targpos = to; } +#endif //this.angles = normalize(('0 1 0' * to_y) - ('0 1 0' * from_y)); @@ -697,52 +701,11 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) if(this.target2 && this.target2 != "" && this.goalentity.targetname != this.target2) this.goalentity = find(NULL, targetname, this.target2); - if(STAT(FROZEN, this) == 2) - { - this.revive_progress = bound(0, this.revive_progress + this.ticrate * this.revive_speed, 1); - this.health = max(1, this.revive_progress * this.max_health); - this.iceblock.alpha = bound(0.2, 1 - this.revive_progress, 1); - - if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite) - WaypointSprite_UpdateHealth(this.sprite, this.health); - - movelib_brake_simple(this, stpspeed); - setanim(this, this.anim_idle, true, false, false); - - this.enemy = NULL; - this.nextthink = time + this.ticrate; - - if(this.revive_progress >= 1) - Unfreeze(this); - - return; - } - else if(STAT(FROZEN, this) == 3) + if(STAT(FROZEN, this)) { - this.revive_progress = bound(0, this.revive_progress - this.ticrate * this.revive_speed, 1); - this.health = max(0, autocvar_g_nades_ice_health + (this.max_health-autocvar_g_nades_ice_health) * this.revive_progress ); - - if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite) - WaypointSprite_UpdateHealth(this.sprite, this.health); - movelib_brake_simple(this, stpspeed); setanim(this, this.anim_idle, true, false, false); - - this.enemy = NULL; - this.nextthink = time + this.ticrate; - - if(this.health < 1) - { - Unfreeze(this); - this.health = 0; - if(this.event_damage) - this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, this.origin, '0 0 0'); - } - - else if ( this.revive_progress <= 0 ) - Unfreeze(this); - - return; + return; // no physics while frozen! } if(this.flags & FL_SWIM) @@ -806,27 +769,6 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) if(DIFF_TEAM(this.monster_follow, this)) this.monster_follow = NULL; - if(time >= this.last_enemycheck) - { - if(!this.enemy) - { - this.enemy = Monster_FindTarget(this); - if(this.enemy) - { - WarpZone_RefSys_Copy(this.enemy, this); - WarpZone_RefSys_AddInverse(this.enemy, this); // wz1^-1 ... wzn^-1 receiver - this.moveto = WarpZone_RefSys_TransformOrigin(this.enemy, this, (0.5 * (this.enemy.absmin + this.enemy.absmax))); - this.monster_moveto = '0 0 0'; - this.monster_face = '0 0 0'; - - this.pass_distance = vlen((('1 0 0' * this.enemy.origin_x) + ('0 1 0' * this.enemy.origin_y)) - (('1 0 0' * this.origin_x) + ('0 1 0' * this.origin_y))); - Monster_Sound(this, monstersound_sight, 0, false, CH_VOICE); - } - } - - this.last_enemycheck = time + 1; // check for enemies every second - } - if(this.state == MONSTER_ATTACK_RANGED && IS_ONGROUND(this)) { this.state = 0; @@ -891,9 +833,6 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) turny = bound(turny * -1, shortangle_f(real_angle.y, this.angles.y), turny); this.angles_y += turny; } - - .entity weaponentity = weaponentities[0]; // TODO? - Monster_Attack_Check(this, this.enemy, weaponentity); } void Monster_Remove(entity this) @@ -1205,6 +1144,64 @@ void Monster_Anim(entity this) */ } +void Monster_Frozen_Think(entity this) +{ + if(STAT(FROZEN, this) == 2) + { + this.revive_progress = bound(0, this.revive_progress + this.ticrate * this.revive_speed, 1); + this.health = max(1, this.revive_progress * this.max_health); + this.iceblock.alpha = bound(0.2, 1 - this.revive_progress, 1); + + if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite) + WaypointSprite_UpdateHealth(this.sprite, this.health); + + if(this.revive_progress >= 1) + Unfreeze(this); + } + else if(STAT(FROZEN, this) == 3) + { + this.revive_progress = bound(0, this.revive_progress - this.ticrate * this.revive_speed, 1); + this.health = max(0, autocvar_g_nades_ice_health + (this.max_health-autocvar_g_nades_ice_health) * this.revive_progress ); + + if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite) + WaypointSprite_UpdateHealth(this.sprite, this.health); + + if(this.health < 1) + { + Unfreeze(this); + this.health = 0; + if(this.event_damage) + this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, this.origin, '0 0 0'); + } + + else if ( this.revive_progress <= 0 ) + Unfreeze(this); + } + // otherwise, no revival! + + this.enemy = NULL; // TODO: save enemy, and attack when revived? +} + +void Monster_Enemy_Check(entity this) +{ + if(!this.enemy) + { + this.enemy = Monster_FindTarget(this); + if(this.enemy) + { + WarpZone_RefSys_Copy(this.enemy, this); + WarpZone_RefSys_AddInverse(this.enemy, this); // wz1^-1 ... wzn^-1 receiver + // update move target immediately? + this.moveto = WarpZone_RefSys_TransformOrigin(this.enemy, this, (0.5 * (this.enemy.absmin + this.enemy.absmax))); + this.monster_moveto = '0 0 0'; + this.monster_face = '0 0 0'; + + //this.pass_distance = vlen((('1 0 0' * this.enemy.origin_x) + ('0 1 0' * this.enemy.origin_y)) - (('1 0 0' * this.origin_x) + ('0 1 0' * this.origin_y))); + Monster_Sound(this, monstersound_sight, 0, false, CH_VOICE); + } + } +} + void Monster_Think(entity this) { setthink(this, Monster_Think); @@ -1216,10 +1213,23 @@ void Monster_Think(entity this) return; } + if(STAT(FROZEN, this)) + Monster_Frozen_Think(this); + else if(time >= this.last_enemycheck) + { + Monster_Enemy_Check(this); + this.last_enemycheck = time + 1; // check for enemies every second + } + Monster mon = Monsters_from(this.monsterid); if(mon.mr_think(mon, this)) + { Monster_Move(this, this.speed2, this.speed, this.stopspeed); + .entity weaponentity = weaponentities[0]; // TODO? + Monster_Attack_Check(this, this.enemy, weaponentity); + } + Monster_Anim(this); CSQCMODEL_AUTOUPDATE(this); @@ -1261,7 +1271,11 @@ bool Monster_Spawn_Setup(entity this) Monster_Sounds_Update(this); if(teamplay) + { + if(!this.monster_attack) + IL_PUSH(g_monster_targets, this); this.monster_attack = true; // we can have monster enemies in team games + } Monster_Sound(this, monstersound_spawn, 0, false, CH_VOICE); @@ -1355,7 +1369,7 @@ bool Monster_Spawn(entity this, bool check_appear, int mon_id) this.candrop = true; this.view_ofs = '0 0 0.7' * (this.maxs_z * 0.5); this.oldtarget2 = this.target2; - this.pass_distance = 0; + //this.pass_distance = 0; this.deadflag = DEAD_NO; this.spawn_time = time; this.gravity = 1; diff --git a/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc index daf538cb3..1eb739633 100644 --- a/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/cl_damagetext.qc @@ -49,7 +49,11 @@ CLASS(DamageText, Object) this.time_prev = time; setorigin(this, this.origin + dt * this.velocity); this.alpha -= dt * this.fade_rate; - if (this.alpha < 0) delete(this); + if (this.alpha < 0) + { + delete(this); + return; + } vector pos = project_3d_to_2d(this.origin) + autocvar_cl_damagetext_offset; if (pos.z >= 0 && this.m_size > 0) { pos.z = 0; diff --git a/qcsrc/common/mutators/mutator/itemstime/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime/itemstime.qc index 3ffeb9371..472fc646d 100644 --- a/qcsrc/common/mutators/mutator/itemstime/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime/itemstime.qc @@ -238,7 +238,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon, if (autocvar_hud_panel_itemstime_progressbar_reduced) { p_pos = numpos; - p_size = eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y; + p_size = vec2(((ar - 1)/ar) * mySize.x, mySize.y); } else { @@ -251,9 +251,9 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon, if(autocvar_hud_panel_itemstime_text) { if(t > 0) - drawstring_aspect(numpos, ftos(t), eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(numpos, ftos(t), vec2(((ar - 1)/ar) * mySize.x, mySize.y), color, panel_fg_alpha, DRAWFLAG_NORMAL); else if(precache_pic("gfx/hud/default/checkmark")) // COMPAT: check if this image exists, as 0.8.1 clients lack it - drawpic_aspect_skin(numpos, "checkmark", eX * (ar - 1) * mySize_y + eY * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(numpos, "checkmark", vec2((ar - 1) * mySize.y, mySize.y), '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL); else // legacy code, if the image is missing just center the icon picpos.x = myPos.x + mySize.x / 2 - mySize.y / 2; } @@ -332,7 +332,7 @@ void HUD_ItemsTime() rows = HUD_GetRowCount(count, mySize, ar); columns = ceil(count/rows); - vector itemstime_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows); + vector itemstime_size = vec2(mySize.x / columns, mySize.y / rows); vector offset = '0 0 0'; float newSize; @@ -420,7 +420,7 @@ LABEL(iteration) if (!(Item_ItemsTime_GetTime(id) > time)) continue; - DrawItemsTimeItem(pos + eX * column * (itemstime_size.x + offset.x) + eY * row * (itemstime_size.y + offset.y), itemstime_size, ar, icon, item_time, item_available, f); + DrawItemsTimeItem(pos + vec2(column * (itemstime_size.x + offset.x), row * (itemstime_size.y + offset.y)), itemstime_size, ar, icon, item_time, item_available, f); ++row; if (row >= rows) { diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index da244ea1f..052a132b9 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -133,7 +133,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan DrawNadeProgressBar(myPos, mySize, bonusProgress, nadeColor); if(autocvar_hud_panel_ammo_text) - drawstring_aspect(textPos, ftos(bonusNades), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(textPos, ftos(bonusNades), vec2((2/3) * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); if(draw_expanding) drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time); diff --git a/qcsrc/common/net_linked.qh b/qcsrc/common/net_linked.qh index 9cd2094a6..de8cf8f92 100644 --- a/qcsrc/common/net_linked.qh +++ b/qcsrc/common/net_linked.qh @@ -40,8 +40,6 @@ REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED) REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY) REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS) -REGISTER_NET_LINKED(ENT_CLIENT_MODEL) - REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE) REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA) REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED) @@ -53,3 +51,5 @@ REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE) REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT) REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT) REGISTER_NET_LINKED(ENT_CLIENT_WALL) + +#include diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 9f3eb37c2..8b5edbf6f 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -785,7 +785,7 @@ MSG_CENTER_NOTIF(VEHICLE_ENTER_GUNNER, N_ENABLE, 0, 0, "pass_key", CPID_VEHICLES, "0 0", _("^BGPress ^F2%s^BG to enter the vehicle gunner"), "") MSG_CENTER_NOTIF(VEHICLE_ENTER_STEAL, N_ENABLE, 0, 0, "pass_key", CPID_VEHICLES, "0 0", _("^BGPress ^F2%s^BG to steal this vehicle"), "") MSG_CENTER_NOTIF(VEHICLE_STEAL, N_ENABLE, 0, 0, "", CPID_VEHICLES_OTHER, "0 0", _("^F2The enemy is stealing one of your vehicles!\n^F4Stop them!"), "") - MSG_CENTER_NOTIF(VEHICLE_STEAL_SELF, N_ENABLE, 0, 0, "", CPID_VEHICLES_OTHER, "4 0", _("^F2You have stolen the enemy's vehicle, you are now visible on their radar!"), "") + MSG_CENTER_NOTIF(VEHICLE_STEAL_SELF, N_ENABLE, 0, 0, "", CPID_VEHICLES_OTHER, "4 0", _("^F2Intruder detected, disabling shields!"), "") MSG_CENTER_NOTIF(WEAPON_MINELAYER_LIMIT, N_ENABLE, 0, 1, "f1", CPID_Null, "0 0", _("^BGYou cannot place more than ^F2%s^BG mines at a time"), "") diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 407a703cf..995c65b4d 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -1,16 +1,4 @@ #include "movetypes.qh" -#include "../player.qh" - -#if defined(CSQC) - #include - #include - #include - #include - #include -#elif defined(MENUQC) -#elif defined(SVQC) - #include -#endif #ifdef SVQC void set_movetype(entity this, int mt) @@ -48,7 +36,7 @@ void _Movetype_WallFriction(entity this, vector stepnormal) // SV_WallFriction vector planes[MAX_CLIP_PLANES]; int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight) // SV_FlyMove { - int blocked = 0, bumpcount; + int blocked = 0; int i, j, numplanes = 0; float time_left = dt, grav = 0; vector push; @@ -73,7 +61,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma original_velocity = primal_velocity = restore_velocity = this.velocity; - for(bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++) + for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++) { if(this.velocity == '0 0 0') break; @@ -138,7 +126,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma break; } float trace2_fraction = trace_fraction; - steppush = '0 0 1' * (org_z - this.origin_z); + steppush = '0 0 1' * (org.z - this.origin_z); _Movetype_PushEntity(this, steppush, true); if(trace_startsolid) { @@ -147,7 +135,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma } // accept the new position if it made some progress... - if(fabs(this.origin_x - org_x) >= 0.03125 || fabs(this.origin_y - org_y) >= 0.03125) + if(fabs(this.origin_x - org.x) >= 0.03125 || fabs(this.origin_y - org.y) >= 0.03125) { trace_endpos = this.origin; time_left *= 1 - trace2_fraction; diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index d26de7b96..712817386 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -7,6 +7,13 @@ #define SET_ONSLICK(s) ((s).flags |= FL_ONSLICK) #define UNSET_ONSLICK(s) ((s).flags &= ~FL_ONSLICK) +#define GAMEPLAYFIX_DOWNTRACEONGROUND(s) STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, s) +#define GAMEPLAYFIX_EASIERWATERJUMP(s) STAT(GAMEPLAYFIX_EASIERWATERJUMP, s) +#define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN, s) +#define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s) +#define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s) +#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION, s) + #ifdef CSQC .float bouncestop; .float bouncefactor; diff --git a/qcsrc/common/physics/movetypes/toss.qc b/qcsrc/common/physics/movetypes/toss.qc index 498852135..71e7fa9d0 100644 --- a/qcsrc/common/physics/movetypes/toss.qc +++ b/qcsrc/common/physics/movetypes/toss.qc @@ -1,5 +1,4 @@ #include "toss.qh" -#include "../player.qh" void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss { diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index b8a14a4ce..56219b2c9 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -57,6 +57,7 @@ void Physics_UpdateStats(entity this, float maxspd_mod) STAT(MOVEVARS_AIRCONTROL, this) = Physics_ClientOption(this, "aircontrol", autocvar_sv_aircontrol); STAT(MOVEVARS_AIRCONTROL_POWER, this) = Physics_ClientOption(this, "aircontrol_power", autocvar_sv_aircontrol_power); STAT(MOVEVARS_AIRCONTROL_BACKWARDS, this) = Physics_ClientOption(this, "aircontrol_backwards", autocvar_sv_aircontrol_backwards); + STAT(MOVEVARS_AIRCONTROL_SIDEWARDS, this) = Physics_ClientOption(this, "aircontrol_sidewards", autocvar_sv_aircontrol_sidewards); STAT(MOVEVARS_AIRCONTROL_PENALTY, this) = Physics_ClientOption(this, "aircontrol_penalty", autocvar_sv_aircontrol_penalty); STAT(MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL, this) = Physics_ClientOption(this, "warsowbunny_airforwardaccel", autocvar_sv_warsowbunny_airforwardaccel); STAT(MOVEVARS_WARSOWBUNNY_TOPSPEED, this) = Physics_ClientOption(this, "warsowbunny_topspeed", autocvar_sv_warsowbunny_topspeed); @@ -137,6 +138,11 @@ void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed) float movity = IsMoveInDirection(this.movement, 0); if(PHYS_AIRCONTROL_BACKWARDS(this)) movity += IsMoveInDirection(this.movement, 180); + if(PHYS_AIRCONTROL_SIDEWARDS(this)) + { + movity += IsMoveInDirection(this.movement, 90); + movity += IsMoveInDirection(this.movement, -90); + } float k = 32 * (2 * movity - 1); if (k <= 0) diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index 39cc573ee..7c093c15d 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -29,14 +29,18 @@ float AdjustAirAccelQW(float accelqw, float factor); bool IsFlying(entity a); -#define BUFFS_STAT(s) STAT(BUFFS, s) +#define PHYS_PL_MAX(s) STAT(PL_MAX, s) +#define PHYS_PL_MIN(s) STAT(PL_MIN, s) +#define PHYS_PL_CROUCH_MAX(s) STAT(PL_CROUCH_MAX, s) +#define PHYS_PL_CROUCH_MIN(s) STAT(PL_CROUCH_MIN, s) + +#define PHYS_PL_VIEWOFS(s) STAT(PL_VIEW_OFS, s) +#define PHYS_PL_CROUCH_VIEWOFS(s) STAT(PL_CROUCH_VIEW_OFS, s) -#define GAMEPLAYFIX_DOWNTRACEONGROUND(s) STAT(GAMEPLAYFIX_DOWNTRACEONGROUND, s) -#define GAMEPLAYFIX_EASIERWATERJUMP(s) STAT(GAMEPLAYFIX_EASIERWATERJUMP, s) -#define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN, s) -#define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s) -#define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s) -#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION, s) +#define PHYS_VIEWHEIGHT(s) STAT(VIEWHEIGHT, s) +#define PHYS_HEALTH(s) STAT(HEALTH, s) + +#define BUFFS_STAT(s) STAT(BUFFS, s) #define PHYS_ACCELERATE(s) STAT(MOVEVARS_ACCELERATE, s) #define PHYS_AIRACCELERATE(s) STAT(MOVEVARS_AIRACCELERATE, s) @@ -47,6 +51,7 @@ bool IsFlying(entity a); #define PHYS_AIRCONTROL_PENALTY(s) STAT(MOVEVARS_AIRCONTROL_PENALTY, s) #define PHYS_AIRCONTROL_POWER(s) STAT(MOVEVARS_AIRCONTROL_POWER, s) #define PHYS_AIRCONTROL_BACKWARDS(s) STAT(MOVEVARS_AIRCONTROL_BACKWARDS, s) +#define PHYS_AIRCONTROL_SIDEWARDS(s) STAT(MOVEVARS_AIRCONTROL_SIDEWARDS, s) #define PHYS_AIRSPEEDLIMIT_NONQW(s) STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, s) #define PHYS_AIRSTOPACCELERATE(s) STAT(MOVEVARS_AIRSTOPACCELERATE, s) #define PHYS_AIRSTRAFEACCELERATE(s) STAT(MOVEVARS_AIRSTRAFEACCELERATE, s) diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index bea426a34..8b6b1cfdf 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -297,6 +297,7 @@ REGISTER_STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, float) REGISTER_STAT(MOVEVARS_AIRSTRAFEACCEL_QW, float) REGISTER_STAT(MOVEVARS_AIRCONTROL_POWER, float) REGISTER_STAT(MOVEVARS_AIRCONTROL_BACKWARDS, bool) +REGISTER_STAT(MOVEVARS_AIRCONTROL_SIDEWARDS, bool) noref bool autocvar_sv_gameplayfix_nogravityonground; REGISTER_STAT(MOVEFLAGS, int, MOVEFLAG_VALID | (autocvar_sv_gameplayfix_q2airaccelerate ? MOVEFLAG_Q2AIRACCELERATE : 0) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 2746eabfc..5e03def24 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -63,6 +63,8 @@ void Item_SetAlpha(entity this) this.colormod = this.glowmod = autocvar_cl_weapon_stay_color; this.alpha = autocvar_cl_weapon_stay_alpha; } + + this.drawmask = ((this.alpha <= 0) ? 0 : MASK_NORMAL); } void ItemDraw(entity this) @@ -127,9 +129,7 @@ void Item_PreDraw(entity this) { if(warpzone_warpzones_exist) { - // just incase warpzones were initialized last, reset these - //this.alpha = 1; // alpha is already set by the draw function - this.drawmask = MASK_NORMAL; + setpredraw(this, func_null); // no need to keep running this return; } float alph; @@ -145,8 +145,8 @@ void Item_PreDraw(entity this) this.alpha = alph; if(alph <= 0) this.drawmask = 0; - else - this.drawmask = MASK_NORMAL; + //else + //this.drawmask = MASK_NORMAL; // reset by the setalpha function } void ItemRemove(entity this) @@ -213,7 +213,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) this.fade_end = ReadShort(); this.fade_start = ReadShort(); - if(this.fade_start && !autocvar_cl_items_nofade) + if(!warpzone_warpzones_exist && this.fade_start && !autocvar_cl_items_nofade) setpredraw(this, Item_PreDraw); if(this.mdl) diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 81a610190..79c2feb4e 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -271,7 +271,7 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float this.takedamage = DAMAGE_NO; this.event_damage = func_null; - if(IS_CLIENT(attacker) && this.classname == "func_assault_destructible") + if(IS_CLIENT(attacker)) //&& this.classname == "func_assault_destructible") { this.owner = attacker; this.realowner = attacker; diff --git a/qcsrc/common/triggers/target/_mod.inc b/qcsrc/common/triggers/target/_mod.inc index 71bd8c11e..34c02ba79 100644 --- a/qcsrc/common/triggers/target/_mod.inc +++ b/qcsrc/common/triggers/target/_mod.inc @@ -1,6 +1,7 @@ // generated file; do not modify #include #include +#include #include #include #include diff --git a/qcsrc/common/triggers/target/include.qc b/qcsrc/common/triggers/target/include.qc index c643e4785..4558b71bf 100644 --- a/qcsrc/common/triggers/target/include.qc +++ b/qcsrc/common/triggers/target/include.qc @@ -1,6 +1,7 @@ #include "include.qh" #include "changelevel.qc" +#include "kill.qc" #include "levelwarp.qc" #include "location.qc" #include "music.qc" diff --git a/qcsrc/common/triggers/target/kill.qc b/qcsrc/common/triggers/target/kill.qc new file mode 100644 index 000000000..a086bb3c8 --- /dev/null +++ b/qcsrc/common/triggers/target/kill.qc @@ -0,0 +1,25 @@ +#include "location.qh" +#ifdef SVQC + +void target_kill_use(entity this, entity actor, entity trigger) +{ + if(actor.takedamage == DAMAGE_NO) + return; + + if(!actor.iscreature && !actor.damagedbytriggers) + return; + + Damage(actor, this, trigger, 1000, DEATH_HURTTRIGGER.m_id, actor.origin, '0 0 0'); +} + +spawnfunc(target_kill) +{ + this.classname = "target_kill"; + + if (this.message == "") + this.message = "was in the wrong place"; + + this.use = target_kill_use; +} + +#endif diff --git a/qcsrc/common/turrets/checkpoint.qc b/qcsrc/common/turrets/checkpoint.qc index 6c246a75b..d9a20dc97 100644 --- a/qcsrc/common/turrets/checkpoint.qc +++ b/qcsrc/common/turrets/checkpoint.qc @@ -12,8 +12,6 @@ #define checkpoint_cache_to selected_player */ -.entity pathgoal; - /* entity path_makeorcache(entity forwho,entity start, entity end) { diff --git a/qcsrc/common/turrets/config.qc b/qcsrc/common/turrets/config.qc index 68cac0846..7d1a81d49 100644 --- a/qcsrc/common/turrets/config.qc +++ b/qcsrc/common/turrets/config.qc @@ -5,9 +5,9 @@ void T_Config_Queue_Swap(float root, float child, entity pass) { - string oldroot = tur_config_queue[root]; - tur_config_queue[root] = tur_config_queue[child]; - tur_config_queue[child] = oldroot; + string oldroot = config_queue[root]; + config_queue[root] = config_queue[child]; + config_queue[child] = oldroot; } float T_Config_Queue_Compare(float root, float child, entity pass) @@ -16,8 +16,8 @@ float T_Config_Queue_Compare(float root, float child, entity pass) for(i = 1; i <= 100; ++i) { - r = str2chr(tur_config_queue[root], i); - c = str2chr(tur_config_queue[child], i); + r = str2chr(config_queue[root], i); + c = str2chr(config_queue[child], i); if(r == c) { continue; } else if(c > r) { return -1; } else { return 1; } @@ -32,8 +32,8 @@ void Dump_Turret_Settings() FOREACH(Turrets, it != TUR_Null, { // step 1: clear the queue TUR_CONFIG_COUNT = 0; - for(int j = 0; j <= MAX_TUR_CONFIG; ++j) - { tur_config_queue[j] = string_null; } + for(int j = 0; j <= MAX_CONFIG_SETTINGS; ++j) + config_queue[j] = string_null; // step 2: build new queue it.tr_config(it); @@ -44,7 +44,7 @@ void Dump_Turret_Settings() // step 4: write queue TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name)) for(int j = 0; j <= TUR_CONFIG_COUNT; ++j) - { TUR_CONFIG_WRITETOFILE(tur_config_queue[j]) } + TUR_CONFIG_WRITETOFILE(config_queue[j]) TUR_CONFIG_WRITETOFILE("// }}}\n") // step 5: debug info @@ -54,8 +54,8 @@ void Dump_Turret_Settings() // clear queue now that we're finished TUR_CONFIG_COUNT = 0; - for(int j = 0; j <= MAX_TUR_CONFIG; ++j) - { tur_config_queue[j] = string_null; } + for(int j = 0; j <= MAX_CONFIG_SETTINGS; ++j) + config_queue[j] = string_null; // extra information LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings)); diff --git a/qcsrc/common/turrets/config.qh b/qcsrc/common/turrets/config.qh index caa68a864..ac09e9e37 100644 --- a/qcsrc/common/turrets/config.qh +++ b/qcsrc/common/turrets/config.qh @@ -6,10 +6,7 @@ void Dump_Turret_Settings(); float tur_config_file; float tur_config_alsoprint; -const int MAX_TUR_CONFIG = 256; float TUR_CONFIG_COUNT; -string tur_config_queue[MAX_TUR_CONFIG]; - #define TUR_CONFIG_WRITETOFILE(a) { \ fputs(tur_config_file, a); \ if(tur_config_alsoprint) { LOG_INFO(a); } } diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index ae8cd5323..b9250f0a8 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -789,7 +789,7 @@ float turret_validate_target(entity e_turret, entity e_target, float validate_fl } // Can we even aim this thing? - tvt_thadv = angleofs3(e_turret.tur_head.origin, e_turret.angles + e_turret.tur_head.angles, e_target); + tvt_thadv = angleofs3(e_turret.tur_head.origin, e_turret.angles + e_turret.tur_head.angles, e_target.origin); tvt_tadv = shortangle_vxy(angleofs(e_turret, e_target), e_turret.angles); tvt_thadf = vlen(tvt_thadv); tvt_tadf = vlen(tvt_tadv); diff --git a/qcsrc/common/turrets/sv_turrets.qh b/qcsrc/common/turrets/sv_turrets.qh index 62759c058..edd06bd6d 100644 --- a/qcsrc/common/turrets/sv_turrets.qh +++ b/qcsrc/common/turrets/sv_turrets.qh @@ -94,6 +94,8 @@ bool turret_initialize(entity this, Turret tur); .entity pathcurrent; +.entity pathgoal; + float turret_count; // debugging diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index cf53508b6..403a0ddf6 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -140,10 +140,9 @@ spawnfunc(turret_ewheel) { if(!turret_initialize(this, TUR_EWHEEL)) delete(this) METHOD(EWheel, tr_think, void(EWheel thistur, entity it)) { - float vz; vector wish_angle, real_angle; - vz = it.velocity_z; + float vz = it.velocity_z; it.angles_x = anglemods(it.angles_x); it.angles_y = anglemods(it.angles_y); @@ -198,8 +197,9 @@ METHOD(EWheel, tr_setup, void(EWheel this, entity it)) it.iscreature = true; it.teleportable = TELEPORT_NORMAL; - it.damagedbycontents = true; - IL_PUSH(g_damagedbycontents, it); + if(!it.damagedbycontents) + IL_PUSH(g_damagedbycontents, it); + it.damagedbycontents = true; set_movetype(it, MOVETYPE_WALK); it.solid = SOLID_SLIDEBOX; it.takedamage = DAMAGE_AIM; diff --git a/qcsrc/common/turrets/util.qh b/qcsrc/common/turrets/util.qh index 5f52695ba..be207b711 100644 --- a/qcsrc/common/turrets/util.qh +++ b/qcsrc/common/turrets/util.qh @@ -1,9 +1,4 @@ #pragma once -float shortangle_f(float ang1, float ang2); -float anglemods(float v); float turret_tag_fire_update(entity this); -vector shortangle_vxy(vector ang1, vector ang2); -vector angleofs(entity from, entity to); -vector angleofs3(vector from, vector from_a, entity to); void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float f_velfactor, float deathtype); diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 13c4c0900..a5ca2cf35 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -105,9 +105,6 @@ void get_mi_min_max_texcoords(float mode); float almost_equals(float a, float b); float almost_in_bounds(float a, float b, float c); -float power2of(float e); -float log2of(float e); - vector rgb_to_hsl(vector rgb); vector hsl_to_rgb(vector hsl); vector rgb_to_hsv(vector rgb); @@ -159,16 +156,6 @@ vector healtharmor_applydamage(float a, float armorblock, int deathtype, float d string getcurrentmod(); -#ifdef GAMEQC -#ifdef CSQC -int ReadInt24_t(); -#else -void WriteInt24_t(float dest, float val); -void WriteInt48_t(float dest, vector val); -void WriteInt72_t(float dest, vector val); -#endif -#endif - float float2range11(float f); float float2range01(float f); @@ -259,7 +246,9 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t #define fprintf(file, ...) fputs(file, sprintf(__VA_ARGS__)) #define bprintf(...) bprint(sprintf(__VA_ARGS__)) +#ifdef GAMEQC string CCR(string input); +#endif #ifdef GAMEQC #ifdef CSQC diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index afb48c918..b2f87821e 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -33,13 +33,14 @@ void AuxiliaryXhair_Draw2D(entity this) if (scoreboard_active) return; - vector size = draw_getimagesize(this.axh_image) * autocvar_cl_vehicles_crosshair_size; - vector pos = project_3d_to_2d(this.origin) - 0.5 * size; + vector pos = project_3d_to_2d(this.origin); if (!(pos.z < 0 || pos.x < 0 || pos.y < 0 || pos.x > vid_conwidth || pos.y > vid_conheight)) { + vector size = draw_getimagesize(this.axh_image) * autocvar_cl_vehicles_crosshair_size; + pos.x -= 0.5 * size.x; + pos.y -= 0.5 * size.y; pos.z = 0; - size.z = 0; drawpic(pos, this.axh_image, size, this.colormod, autocvar_crosshair_alpha * this.alpha, this.axh_drawflag); } diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 659b3c148..47991b423 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -403,12 +403,14 @@ vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string return vtag; } -void vehicles_reset_colors(entity this) +void vehicles_reset_colors(entity this, entity player) { int eff = 0, cmap; const vector cmod = '0 0 0'; if(this.team && teamplay) cmap = 1024 + (this.team - 1) * 17; + else if(player) + cmap = player.colormap; else cmap = 1024; if(autocvar_g_nodepthtestplayers) @@ -419,25 +421,25 @@ void vehicles_reset_colors(entity this) // Find all ents attacked to main model and setup effects, colormod etc. FOREACH_ENTITY_ENT(tag_entity, this, { - if(it != this.vehicle_shieldent) - { - it.effects = eff; - it.colormod = cmod; - it.colormap = cmap; - it.alpha = 1; - } + if(it == this.vehicle_shieldent) + continue; + + it.effects = eff; + it.colormod = cmod; + it.colormap = cmap; + it.alpha = 1; }); // Also check head tags FOREACH_ENTITY_ENT(tag_entity, this.tur_head, { - if(it != this.vehicle_shieldent) - { - it.effects = eff; - it.colormod = cmod; - it.colormap = cmap; - it.alpha = 1; - } + if(it == this.vehicle_shieldent) + continue; + + it.effects = eff; + it.colormod = cmod; + it.colormap = cmap; + it.alpha = 1; }); this.vehicle_hudmodel.effects = this.effects = eff; // | EF_LOWPRECISION; @@ -449,6 +451,9 @@ void vehicles_reset_colors(entity this) this.avelocity = '0 0 0'; this.velocity = '0 0 0'; this.effects = eff; + + Vehicle info = Vehicles_from(this.vehicleid); + info.vr_setcolors(info, this); } void vehicles_clearreturn(entity veh) @@ -572,7 +577,7 @@ void vehicle_use(entity this, entity actor, entity trigger) else { vehicles_setreturn(this); - vehicles_reset_colors(this); + vehicles_reset_colors(this, actor); } } } @@ -780,6 +785,7 @@ vector vehicles_findgoodexit(entity this, entity player, vector prefer_spot) return this.origin; } +.int old_vehicle_flags; void vehicles_exit(entity vehic, bool eject) { entity player = vehic.owner; @@ -858,6 +864,10 @@ void vehicles_exit(entity vehic, bool eject) vehic.team = vehic.tur_head.team; + if(vehic.old_vehicle_flags & VHF_SHIELDREGEN) + vehic.vehicle_flags |= VHF_SHIELDREGEN; + vehic.old_vehicle_flags = 0; + sound (vehic, CH_TRIGGER_SINGLE, SND_Null, 1, ATTEN_NORM); vehic.vehicle_hudmodel.viewmodelforclient = vehic; vehic.phase = time + 1; @@ -865,7 +875,7 @@ void vehicles_exit(entity vehic, bool eject) vehic.vehicle_exit(vehic, eject); vehicles_setreturn(vehic); - vehicles_reset_colors(vehic); + vehicles_reset_colors(vehic, NULL); vehic.owner = NULL; CSQCMODEL_AUTOINIT(vehic); @@ -964,6 +974,10 @@ void vehicles_enter(entity pl, entity veh) Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_VEHICLE_STEAL_SELF); + veh.vehicle_shield = 0; + veh.old_vehicle_flags = veh.vehicle_flags; // make a backup just so we're not permanently crippling this vehicle + veh.vehicle_flags &= ~VHF_SHIELDREGEN; + if (autocvar_g_vehicles_steal_show_waypoint) { entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', NULL, veh.team, veh, wps_intruder, true, RADARICON_DANGER); wp.colormod = Team_ColorRGB(pl.team); @@ -1031,6 +1045,8 @@ void vehicles_enter(entity pl, entity veh) veh.team = pl.team; veh.flags -= FL_NOTARGET; + vehicles_reset_colors(veh, pl); + if (IS_REAL_CLIENT(pl)) { Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_VEHICLE_ENTER); @@ -1144,11 +1160,12 @@ void vehicles_spawn(entity this) } }); - vehicles_reset_colors(this); Vehicle info = Vehicles_from(this.vehicleid); info.vr_spawn(info, this); + vehicles_reset_colors(this, NULL); + CSQCMODEL_AUTOINIT(this); } diff --git a/qcsrc/common/vehicles/sv_vehicles.qh b/qcsrc/common/vehicles/sv_vehicles.qh index 948427db3..653532b43 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qh +++ b/qcsrc/common/vehicles/sv_vehicles.qh @@ -20,12 +20,12 @@ float autocvar_g_vehicles_thinkrate = 0.1; AUTOCVAR(g_vehicles_teams, bool, true, "allow team specific vehicles"); float autocvar_g_vehicles_teleportable; -float autocvar_g_vehicles_vortex_damagerate = 0.5; -float autocvar_g_vehicles_machinegun_damagerate = 0.5; +float autocvar_g_vehicles_vortex_damagerate = 0.75; +float autocvar_g_vehicles_machinegun_damagerate = 0.75; float autocvar_g_vehicles_rifle_damagerate = 0.75; -float autocvar_g_vehicles_vaporizer_damagerate = 0.001; +float autocvar_g_vehicles_vaporizer_damagerate = 0.5; float autocvar_g_vehicles_tag_damagerate = 5; -float autocvar_g_vehicles_weapon_damagerate = 1; +float autocvar_g_vehicles_weapon_damagerate = 2; .float vehicle_last_trace; diff --git a/qcsrc/common/vehicles/vehicle.qh b/qcsrc/common/vehicles/vehicle.qh index 4e3b7b872..5b30b845e 100644 --- a/qcsrc/common/vehicles/vehicle.qh +++ b/qcsrc/common/vehicles/vehicle.qh @@ -51,6 +51,8 @@ CLASS(Vehicle, Object) METHOD(Vehicle, vr_spawn, void(Vehicle this, entity instance)) { } /** (SERVER) called when a vehicle hits something */ METHOD(Vehicle, vr_impact, void(Vehicle this, entity instance)) { } + /** (SERVER) called when a vehicle's colors are being reset, so modules can be updated */ + METHOD(Vehicle, vr_setcolors, void(Vehicle this, entity instance)) { } /** (CLIENT) logic to run every frame */ METHOD(Vehicle, vr_hud, void(Vehicle this)) { } /** (CLIENT) logic to run every frame */ diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index b62eac09a..01488e624 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -11,7 +11,7 @@ float autocvar_g_vehicle_racer_thinkrate = 0.05; // TODO: any higher causes it t float autocvar_g_vehicle_racer_speed_afterburn = 3000; // energy consumed per second -float autocvar_g_vehicle_racer_afterburn_cost = 100; +float autocvar_g_vehicle_racer_afterburn_cost = 130; float autocvar_g_vehicle_racer_waterburn_cost = 5; float autocvar_g_vehicle_racer_waterburn_speed = 750; @@ -29,8 +29,8 @@ float autocvar_g_vehicle_racer_downforce = 0.01; float autocvar_g_vehicle_racer_speed_forward = 650; float autocvar_g_vehicle_racer_speed_strafe = 650; -float autocvar_g_vehicle_racer_springlength = 70; -float autocvar_g_vehicle_racer_upforcedamper = 10; +float autocvar_g_vehicle_racer_springlength = 90; +float autocvar_g_vehicle_racer_upforcedamper = 2; float autocvar_g_vehicle_racer_friction = 0.45; float autocvar_g_vehicle_racer_water_time = 5; @@ -47,8 +47,8 @@ float autocvar_g_vehicle_racer_turnspeed = 220; float autocvar_g_vehicle_racer_pitchspeed = 125; float autocvar_g_vehicle_racer_energy = 100; -float autocvar_g_vehicle_racer_energy_regen = 50; -float autocvar_g_vehicle_racer_energy_regen_pause = 1; +float autocvar_g_vehicle_racer_energy_regen = 90; +float autocvar_g_vehicle_racer_energy_regen_pause = 0.35; float autocvar_g_vehicle_racer_health = 200; float autocvar_g_vehicle_racer_health_regen = 0; @@ -59,7 +59,7 @@ float autocvar_g_vehicle_racer_shield_regen = 30; float autocvar_g_vehicle_racer_shield_regen_pause = 1; bool autocvar_g_vehicle_racer_rocket_locktarget = true; -float autocvar_g_vehicle_racer_rocket_locking_time = 0.9; +float autocvar_g_vehicle_racer_rocket_locking_time = 0.35; float autocvar_g_vehicle_racer_rocket_locking_releasetime = 0.5; float autocvar_g_vehicle_racer_rocket_locked_time = 4; @@ -75,7 +75,7 @@ float autocvar_g_vehicle_racer_bouncefactor = 0.25; // if != 0, New veloctiy after bounce = 0 if new velocity < this float autocvar_g_vehicle_racer_bouncestop = 0; // "minspeed_for_pain speedchange_to_pain_factor max_damage" -vector autocvar_g_vehicle_racer_bouncepain = '60 0.75 300'; +vector autocvar_g_vehicle_racer_bouncepain = '200 0.15 150'; .float racer_watertime; diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qh b/qcsrc/common/vehicles/vehicle/racer_weapon.qh index f8b18a86f..3bd712011 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qh +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qh @@ -16,7 +16,7 @@ void racer_fire_rocket(entity player, vector org, vector dir, entity trg); #endif #ifdef SVQC -float autocvar_g_vehicle_racer_cannon_cost = 2; +float autocvar_g_vehicle_racer_cannon_cost = 1.5; float autocvar_g_vehicle_racer_cannon_damage = 15; float autocvar_g_vehicle_racer_cannon_radius = 100; float autocvar_g_vehicle_racer_cannon_refire = 0.05; diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 5424d1cdf..da556c4fc 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -17,9 +17,9 @@ float autocvar_g_vehicle_raptor_pitchspeed = 50; float autocvar_g_vehicle_raptor_pitchlimit = 45; float autocvar_g_vehicle_raptor_speed_forward = 1700; -float autocvar_g_vehicle_raptor_speed_strafe = 900; -float autocvar_g_vehicle_raptor_speed_up = 1700; -float autocvar_g_vehicle_raptor_speed_down = 1700; +float autocvar_g_vehicle_raptor_speed_strafe = 2200; +float autocvar_g_vehicle_raptor_speed_up = 2300; +float autocvar_g_vehicle_raptor_speed_down = 2000; float autocvar_g_vehicle_raptor_friction = 2; bool autocvar_g_vehicle_raptor_swim = false; @@ -29,7 +29,7 @@ float autocvar_g_vehicle_raptor_cannon_turnlimit = 20; float autocvar_g_vehicle_raptor_cannon_pitchlimit_up = 12; float autocvar_g_vehicle_raptor_cannon_pitchlimit_down = 32; -float autocvar_g_vehicle_raptor_cannon_locktarget = 0; +bool autocvar_g_vehicle_raptor_cannon_locktarget = true; float autocvar_g_vehicle_raptor_cannon_locking_time = 0.2; float autocvar_g_vehicle_raptor_cannon_locking_releasetime = 0.45; float autocvar_g_vehicle_raptor_cannon_locked_time = 1; @@ -39,11 +39,11 @@ float autocvar_g_vehicle_raptor_energy = 100; float autocvar_g_vehicle_raptor_energy_regen = 25; float autocvar_g_vehicle_raptor_energy_regen_pause = 0.25; -float autocvar_g_vehicle_raptor_health = 150; +float autocvar_g_vehicle_raptor_health = 250; float autocvar_g_vehicle_raptor_health_regen = 0; float autocvar_g_vehicle_raptor_health_regen_pause = 0; -float autocvar_g_vehicle_raptor_shield = 75; +float autocvar_g_vehicle_raptor_shield = 200; float autocvar_g_vehicle_raptor_shield_regen = 25; float autocvar_g_vehicle_raptor_shield_regen_pause = 1.5; @@ -794,10 +794,10 @@ METHOD(Raptor, vr_crosshair, void(Raptor thisveh, entity player)) where = project_3d_to_2d(trace_endpos); setorigin(dropmark, trace_endpos); - tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size; if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) { + tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size; where.x -= tmpSize.x * 0.5; where.y -= tmpSize.y * 0.5; where.z = 0; @@ -811,10 +811,10 @@ METHOD(Raptor, vr_crosshair, void(Raptor thisveh, entity player)) if(dropmark.cnt > time) { where = project_3d_to_2d(dropmark.origin); - tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size * 1.25; if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) { + tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size * 1.25; where.x -= tmpSize.x * 0.5; where.y -= tmpSize.y * 0.5; where.z = 0; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh index 199d9cfa4..8cca16a4c 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh @@ -8,9 +8,9 @@ void spiderbot_rocket_do(entity this); #ifdef SVQC // 400 (x2) DPS -float autocvar_g_vehicle_spiderbot_minigun_damage = 24; +float autocvar_g_vehicle_spiderbot_minigun_damage = 16; float autocvar_g_vehicle_spiderbot_minigun_refire = 0.06; -float autocvar_g_vehicle_spiderbot_minigun_spread = 0.015; +float autocvar_g_vehicle_spiderbot_minigun_spread = 0.012; int autocvar_g_vehicle_spiderbot_minigun_ammo_cost = 1; int autocvar_g_vehicle_spiderbot_minigun_ammo_max = 100; int autocvar_g_vehicle_spiderbot_minigun_ammo_regen = 40; diff --git a/qcsrc/common/weapons/calculations.qc b/qcsrc/common/weapons/calculations.qc index 367bab6af..513af5209 100644 --- a/qcsrc/common/weapons/calculations.qc +++ b/qcsrc/common/weapons/calculations.qc @@ -90,15 +90,11 @@ vector solve_cubic_pq(float p, float q) // cos(a) // cos(a + 2pi/3) // cos(a + 4pi/3) - return - u * - ( - '1 0 0' * cos(a + 2.0/3.0*M_PI) - + - '0 1 0' * cos(a + 4.0/3.0*M_PI) - + - '0 0 1' * cos(a) - ); + return u * vec3( + cos(a + 2.0/3.0*M_PI), + cos(a + 4.0/3.0*M_PI), + cos(a) + ); } else if(D == 0) { @@ -107,17 +103,15 @@ vector solve_cubic_pq(float p, float q) return '0 0 0'; u = 3*q/p; v = -u/2; - if(u >= v) - return '1 1 0' * v + '0 0 1' * u; - else - return '0 1 1' * v + '1 0 0' * u; + return (u >= v) ? vec3(v, v, u) : vec3(u, v, v); } else { // cardano - u = cbrt(-q/2.0 + sqrt(D)); - v = cbrt(-q/2.0 - sqrt(D)); - return '1 1 1' * (u + v); + //u = cbrt(-q/2.0 + sqrt(D)); + //v = cbrt(-q/2.0 - sqrt(D)); + a = cbrt(-q/2.0 + sqrt(D)) + cbrt(-q/2.0 - sqrt(D)); + return vec3(a, a, a); } } vector solve_cubic_abcd(float a, float b, float c, float d) @@ -137,11 +131,7 @@ vector solve_cubic_abcd(float a, float b, float c, float d) vector findperpendicular(vector v) { - vector p; - p.x = v.z; - p.y = -v.x; - p.z = v.y; - return normalize(cliptoplane(p, v)); + return normalize(cliptoplane(vec3(v.z, -v.x, v.y), v)); } #ifdef SVQC diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index 4f6177b47..7f87388db 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -12,14 +12,14 @@ void W_Config_Queue_Swap(int root, int child, entity pass) { - string oldroot = wep_config_queue[root]; - wep_config_queue[root] = wep_config_queue[child]; - wep_config_queue[child] = oldroot; + string oldroot = config_queue[root]; + config_queue[root] = config_queue[child]; + config_queue[child] = oldroot; } float W_Config_Queue_Compare(int root, int child, entity pass) { - return strcmp(wep_config_queue[root], wep_config_queue[child]); + return strcmp(config_queue[root], config_queue[child]); } void Dump_Weapon_Settings() @@ -28,8 +28,8 @@ void Dump_Weapon_Settings() FOREACH(Weapons, it != WEP_Null, { // step 1: clear the queue WEP_CONFIG_COUNT = 0; - for (int x = 0; x <= MAX_WEP_CONFIG; ++x) - { wep_config_queue[x] = string_null; } + for (int x = 0; x <= MAX_CONFIG_SETTINGS; ++x) + config_queue[x] = string_null; // step 2: build new queue it.wr_config(it); @@ -44,7 +44,7 @@ void Dump_Weapon_Settings() it.m_name, ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "") )); - for (int x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]); } + for (int x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(config_queue[x]); } WEP_CONFIG_WRITETOFILE("// }}}\n"); // step 5: debug info @@ -55,8 +55,8 @@ void Dump_Weapon_Settings() // clear queue now that we're finished WEP_CONFIG_COUNT = 0; - for(int x = 0; x <= MAX_WEP_CONFIG; ++x) - { wep_config_queue[x] = string_null; } + for(int x = 0; x <= MAX_CONFIG_SETTINGS; ++x) + config_queue[x] = string_null; // extra information LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", totalweapons, totalsettings)); diff --git a/qcsrc/common/weapons/config.qh b/qcsrc/common/weapons/config.qh index 753147307..948984365 100644 --- a/qcsrc/common/weapons/config.qh +++ b/qcsrc/common/weapons/config.qh @@ -9,12 +9,9 @@ void Dump_Weapon_Settings(); int wep_config_file; bool wep_config_alsoprint; -const int MAX_WEP_CONFIG = 256; int WEP_CONFIG_COUNT; -string wep_config_queue[MAX_WEP_CONFIG]; - #define WEP_CONFIG_QUEUE(a) { \ - wep_config_queue[WEP_CONFIG_COUNT] = a; \ + config_queue[WEP_CONFIG_COUNT] = a; \ ++WEP_CONFIG_COUNT; } #define WEP_CONFIG_WRITETOFILE(a) MACRO_BEGIN { \ diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 69fcc1d07..634fbf812 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -195,6 +195,7 @@ const int WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutato const int WEP_TYPE_MELEE_PRI = 0x400; // primary attack is melee swing (for animation) const int WEP_TYPE_MELEE_SEC = 0x800; // secondary attack is melee swing (for animation) const int WEP_FLAG_DUALWIELD = 0x1000; // weapon can be dual wielded +const int WEP_FLAG_NODUAL = 0x2000; // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything // variables: string weaponorder_byid; diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 291504521..b3381fbc2 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -3,7 +3,7 @@ CLASS(Crylink, Weapon) /* ammotype */ ATTRIB(Crylink, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Crylink, impulse, int, 6); -/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB); +/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000); /* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1'); /* modelname */ ATTRIB(Crylink, mdl, string, "crylink"); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index f22f0cedc..dbdb7374b 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -3,7 +3,7 @@ CLASS(Devastator, Weapon) /* ammotype */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets); /* impulse */ ATTRIB(Devastator, impulse, int, 9); -/* flags */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH); +/* flags */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000); /* color */ ATTRIB(Devastator, wpcolor, vector, '1 1 0'); /* modelname */ ATTRIB(Devastator, mdl, string, "rl"); diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 2add2e468..e968f881f 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -3,7 +3,7 @@ CLASS(Fireball, Weapon) /* ammotype */ //ATTRIB(Fireball, ammo_field, .int, ammo_none); /* impulse */ ATTRIB(Fireball, impulse, int, 9); -/* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH); +/* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000); /* color */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0'); /* modelname */ ATTRIB(Fireball, mdl, string, "fireball"); diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index e2ac5ee79..f5a19b2c7 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -3,7 +3,7 @@ CLASS(PortoLaunch, Weapon) /* ammotype */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none); /* impulse */ ATTRIB(PortoLaunch, impulse, int, 0); -/* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON); +/* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL); /* rating */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0); /* color */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5'); /* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto"); diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 2949a8a24..ef3c4dc83 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -2,7 +2,7 @@ #ifndef IMPLEMENTATION CLASS(Tuba, Weapon) /* impulse */ ATTRIB(Tuba, impulse, int, 1); -/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH); +/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000); /* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0'); /* modelname */ ATTRIB(Tuba, mdl, string, "tuba"); @@ -157,7 +157,7 @@ void W_Tuba_NoteOff(entity this) if (actor.(weaponentity).tuba_note == this) { actor.(weaponentity).tuba_lastnotes_last = (actor.(weaponentity).tuba_lastnotes_last + 1) % MAX_TUBANOTES; - actor.(weaponentity).(tuba_lastnotes[actor.(weaponentity).tuba_lastnotes_last]) = eX * this.spawnshieldtime + eY * time + eZ * this.cnt; + actor.(weaponentity).(tuba_lastnotes[actor.(weaponentity).tuba_lastnotes_last]) = vec3(this.spawnshieldtime, time, this.cnt); actor.(weaponentity).tuba_note = NULL; actor.(weaponentity).tuba_lastnotes_cnt = bound(0, actor.(weaponentity).tuba_lastnotes_cnt + 1, MAX_TUBANOTES); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 60e993484..51ce8893d 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -3,7 +3,7 @@ CLASS(Vaporizer, Weapon) /* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Vaporizer, impulse, int, 7); -/* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN); +/* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000); /* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1'); /* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex"); diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 357f2723f..ee7bf22ea 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -3,7 +3,7 @@ CLASS(Vortex, Weapon) /* ammotype */ ATTRIB(Vortex, ammo_field, .int, ammo_cells); /* impulse */ ATTRIB(Vortex, impulse, int, 7); -/* flags */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN); +/* flags */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL); /* rating */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000); /* color */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1'); /* modelname */ ATTRIB(Vortex, mdl, string, "nex"); diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 136c4e7f6..b8d78cd04 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -61,18 +61,20 @@ MACRO_END #endif -#define is_float(this) (true || ftoe(this)) -#define isnt_float(this) -#define is_vector(this) (true || vtos(this)) -#define isnt_vector(this) -#define is_string(this) (true || stof(this)) -#define isnt_string(this) -#define is_entity(this) (true || etof(this)) -#define isnt_entity(this) -bool is_int(float this) { return this == floor(this); } -void isnt_int(float this) { print(ftos(this)); } -bool is_bool(float this) { return this == true || this == false; } -void isnt_bool(float this) { print(ftos(this)); } +#if !(NDEBUG) + #define is_float(this) (true || ftoe(this)) + #define isnt_float(this) + #define is_vector(this) (true || vtos(this)) + #define isnt_vector(this) + #define is_string(this) (true || stof(this)) + #define isnt_string(this) + #define is_entity(this) (true || etof(this)) + #define isnt_entity(this) + bool is_int(float this) { return this == floor(this); } + void isnt_int(float this) { print(ftos(this)); } + bool is_bool(float this) { return this == true || this == false; } + void isnt_bool(float this) { print(ftos(this)); } +#endif #include "warpzone/mathlib.qc" diff --git a/qcsrc/lib/angle.qc b/qcsrc/lib/angle.qc index f921d74b0..302d78323 100644 --- a/qcsrc/lib/angle.qc +++ b/qcsrc/lib/angle.qc @@ -57,32 +57,16 @@ vector shortangle_vxy(vector ang1, vector ang2) } /* -* Return the angle between two enteties +* Return the angle offset between angle ang and angle of the vector from->to */ -vector angleofs(entity from, entity to) -{ - vector v_res; - - v_res = normalize(to.origin - from.origin); - v_res = vectoangles(v_res); - v_res = v_res - from.angles; - - if (v_res_x < 0) v_res_x += 360; - if (v_res_x > 180) v_res_x -= 360; - if (v_res_y < 0) v_res_y += 360; - if (v_res_y > 180) v_res_y -= 360; - - return v_res; -} - -vector angleofs3(vector from, vector from_a, entity to) +vector angleofs3(vector from, vector ang, vector to) { vector v_res; - v_res = normalize(to.origin - from); + v_res = normalize(to - from); v_res = vectoangles(v_res); - v_res = v_res - from_a; + v_res = v_res - ang; if (v_res_x < 0) v_res_x += 360; if (v_res_x > 180) v_res_x -= 360; @@ -92,3 +76,5 @@ vector angleofs3(vector from, vector from_a, entity to) return v_res; } + +#define angleofs(from, to) angleofs3(from.origin, from.angles, to.origin) diff --git a/qcsrc/lib/bits.qh b/qcsrc/lib/bits.qh index 266fe9c8c..0e07cb43e 100644 --- a/qcsrc/lib/bits.qh +++ b/qcsrc/lib/bits.qh @@ -56,6 +56,7 @@ int randombits(int bits, int k, bool error_return) return r; } +/* void randombit_test(int bits, int iter) { while (iter > 0) @@ -64,6 +65,7 @@ void randombit_test(int bits, int iter) --iter; } } +*/ enum { OP_SET, diff --git a/qcsrc/lib/csqcmodel/cl_model.qc b/qcsrc/lib/csqcmodel/cl_model.qc index e4e1d536a..05aba388c 100644 --- a/qcsrc/lib/csqcmodel/cl_model.qc +++ b/qcsrc/lib/csqcmodel/cl_model.qc @@ -24,10 +24,7 @@ #include "cl_player.qh" #include "common.qh" #include "interpolate.qh" -#include -#include #include -#include float autocvar_cl_lerpanim_maxdelta_framegroups = 0.1; float autocvar_cl_nolerp = 0; diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 9e26e70fb..faefdcad4 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -25,15 +25,6 @@ #include "cl_model.qh" #include "common.qh" #include "interpolate.qh" -#include -#include -#include -#include -#include -#include -#include -#include -#include float autocvar_cl_movement_errorcompensation = 0; bool autocvar_cl_movement_intermissionrunning = false; @@ -109,15 +100,15 @@ void CSQCPlayer_SetMinsMaxs(entity this) { if (IS_DUCKED(this) || !this.isplayermodel) { - this.mins = STAT(PL_CROUCH_MIN, this); - this.maxs = STAT(PL_CROUCH_MAX, this); - this.view_ofs = STAT(PL_CROUCH_VIEW_OFS, this); + this.mins = PHYS_PL_CROUCH_MIN(this); + this.maxs = PHYS_PL_CROUCH_MAX(this); + this.view_ofs = PHYS_PL_CROUCH_VIEWOFS(this); } else { - this.mins = STAT(PL_MIN, this); - this.maxs = STAT(PL_MAX, this); - this.view_ofs = STAT(PL_VIEW_OFS, this); + this.mins = PHYS_PL_MIN(this); + this.maxs = PHYS_PL_MAX(this); + this.view_ofs = PHYS_PL_VIEWOFS(this); } } @@ -216,18 +207,13 @@ bool CSQCPlayer_IsLocalPlayer(entity this) return (this == csqcplayer); } -void CSQCPlayer_SetViewLocation() -{ - viewloc_SetViewLocation(); -} - /** Called once per CSQC_UpdateView() */ void CSQCPlayer_SetCamera() { const vector v0 = ((intermission && !autocvar_cl_movement_intermissionrunning) ? '0 0 0' : pmove_vel); // TRICK: pmove_vel is set by the engine when we get here. No need to network velocity - const float vh = STAT(VIEWHEIGHT); - const vector pl_viewofs = STAT(PL_VIEW_OFS); - const vector pl_viewofs_crouch = STAT(PL_CROUCH_VIEW_OFS); + const float vh = PHYS_VIEWHEIGHT(NULL); + const vector pl_viewofs = PHYS_PL_VIEWOFS(NULL); + const vector pl_viewofs_crouch = PHYS_PL_CROUCH_VIEWOFS(NULL); const entity e = csqcplayer; if (e) { @@ -303,7 +289,7 @@ void CSQCPlayer_SetCamera() if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED; if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING; // note: these two only work in WIP2, but are harmless in WIP1 - if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342) refdefflags |= REFDEFFLAG_DEAD; + if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD; if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION; V_CalcRefdef(view, refdefflags); } diff --git a/qcsrc/lib/csqcmodel/net.qh b/qcsrc/lib/csqcmodel/net.qh new file mode 100644 index 000000000..43ad1b99f --- /dev/null +++ b/qcsrc/lib/csqcmodel/net.qh @@ -0,0 +1,3 @@ +#pragma once + +REGISTER_NET_LINKED(ENT_CLIENT_MODEL) diff --git a/qcsrc/lib/csqcmodel/sv_model.qc b/qcsrc/lib/csqcmodel/sv_model.qc index dd8d5d33a..0ff438994 100644 --- a/qcsrc/lib/csqcmodel/sv_model.qc +++ b/qcsrc/lib/csqcmodel/sv_model.qc @@ -22,12 +22,6 @@ #include "sv_model.qh" #include "common.qh" -#include -#include -#include -#include -#include -#include // generic CSQC model code diff --git a/qcsrc/lib/cvar.qh b/qcsrc/lib/cvar.qh index adcb7dfee..666e14ab9 100644 --- a/qcsrc/lib/cvar.qh +++ b/qcsrc/lib/cvar.qh @@ -73,6 +73,12 @@ const noref vector default_vector = '0 0 0'; #define repr_cvar_string(x) (x) #define repr_cvar_vector(x) (sprintf("%v", x)) +//pseudo prototypes: +// void AUTOCVAR(, , default_cvar_value, string desc) +// void AUTOCVAR_SAVE(, , default_cvar_value, string desc) +// where default_cvar_value has type +// e.g.: AUTOCVAR(mycvar, float, 2.5, "cvar description") + #define __AUTOCVAR(file, archive, var, type, desc, default) \ [[accumulate]] void RegisterCvars(void(string, string, string, bool, string) f) \ { \ diff --git a/qcsrc/lib/math.qh b/qcsrc/lib/math.qh index 06994887c..e5cf88847 100644 --- a/qcsrc/lib/math.qh +++ b/qcsrc/lib/math.qh @@ -198,10 +198,7 @@ float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float else return 1; } -float power2of(float e) -{ - return (2 ** e); -} +#define power2of(e) (2 ** e) float log2of(float e) { diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh index 7a7a72641..f57bf8e90 100644 --- a/qcsrc/lib/oo.qh +++ b/qcsrc/lib/oo.qh @@ -171,11 +171,19 @@ STATIC_INIT(RegisterClasses) #define _INIT_STATIC(cname) [[accumulate]] void spawn##cname##_static(cname this) #define INIT(cname) [[accumulate]] cname spawn##cname##_1(cname this) +#if NDEBUG + #define DEBUG_STUFF(cname) +#else + #define DEBUG_STUFF(cname) \ + bool is_##cname(entity e) { return e.instanceOf##cname; } \ + void isnt_##cname(entity e) { eprint(e); } +#endif + + #define CLASS(cname, base) \ entityclass(cname, base); \ class(cname).bool instanceOf##cname; \ - bool is_##cname(entity e) { return e.instanceOf##cname; } \ - void isnt_##cname(entity e) { eprint(e); } \ + DEBUG_STUFF(cname) \ VTBL(cname, base) \ _INIT_STATIC(cname) \ { \ diff --git a/qcsrc/lib/spawnfunc.qh b/qcsrc/lib/spawnfunc.qh index e8aeaecae..e0605c938 100644 --- a/qcsrc/lib/spawnfunc.qh +++ b/qcsrc/lib/spawnfunc.qh @@ -134,6 +134,7 @@ noref bool require_spawnfunc_prefix; FIELD_SCALAR(fld, loddistance1) \ FIELD_SCALAR(fld, lodmodel1) \ FIELD_SCALAR(fld, ltime) \ + FIELD_SCALAR(fld, map) \ FIELD_SCALAR(fld, mdl) \ FIELD_SCALAR(fld, message2) \ FIELD_SCALAR(fld, message) \ @@ -168,6 +169,7 @@ noref bool require_spawnfunc_prefix; FIELD_SCALAR(fld, spawnmob) \ FIELD_SCALAR(fld, speed) \ FIELD_SCALAR(fld, strength) \ + FIELD_SCALAR(fld, style) \ FIELD_SCALAR(fld, target2) \ FIELD_SCALAR(fld, target3) \ FIELD_SCALAR(fld, target4) \ @@ -184,10 +186,13 @@ noref bool require_spawnfunc_prefix; FIELD_SCALAR(fld, warpzone_fadeend) \ FIELD_SCALAR(fld, warpzone_fadestart) \ FIELD_SCALAR(fld, weapon) \ + FIELD_SCALAR(fld, worldtype) \ FIELD_VEC(fld, absmax) \ FIELD_VEC(fld, absmin) \ FIELD_VEC(fld, angles) \ FIELD_VEC(fld, avelocity) \ + FIELD_VEC(fld, color) \ + FIELD_VEC(fld, mangle) \ FIELD_VEC(fld, maxs) \ FIELD_VEC(fld, maxs) \ FIELD_VEC(fld, mins) \ diff --git a/qcsrc/lib/string.qh b/qcsrc/lib/string.qh index 617891d8b..9f0c5ca13 100644 --- a/qcsrc/lib/string.qh +++ b/qcsrc/lib/string.qh @@ -72,6 +72,7 @@ string ColorTranslateRGB(string s) return (ColorTranslateMode & 1) ? strdecolorize(s) : s; } +#ifdef GAMEQC // color code replace, place inside of sprintf and parse the string... defaults described as constants // foreground/normal colors string autocvar_hud_colorset_foreground_1 = "2"; // F1 - Green // primary priority (important names, etc) @@ -106,6 +107,7 @@ string CCR(string input) input = strreplace("^N", "^7", input); // "none"-- reset to white... return input; } +#endif #define startsWith(haystack, needle) (strstrofs(haystack, needle, 0) == 0) diff --git a/qcsrc/lib/vector.qh b/qcsrc/lib/vector.qh index 0a887cfeb..6c32e4312 100644 --- a/qcsrc/lib/vector.qh +++ b/qcsrc/lib/vector.qh @@ -93,6 +93,10 @@ float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) { ret up = v_up; \ } MACRO_END +//pseudo prototypes: +// vector vec2(vector v); // returns a vector with just the x and y components of the given vector +// vector vec2(float x, float y); // returns a vector with the given x and y components + noref vector _vec2; #define vec2(...) EVAL(OVERLOAD(vec2, __VA_ARGS__)) #define vec2_1(v) (_vec2 = (v), _vec2.z = 0, _vec2) @@ -104,10 +108,7 @@ noref vector _vec3; vector Rotate(vector v, float a) { float a_sin = sin(a), a_cos = cos(a); - vector r = '0 0 0'; - r.x = v.x * a_cos + v.y * a_sin; - r.y = -1 * v.x * a_sin + v.y * a_cos; - return r; + return vec2(v.x * a_cos + v.y * a_sin, -v.x * a_sin + v.y * a_cos); } noref vector _yinvert; @@ -164,10 +165,10 @@ vector vec_epsilon(vector this, float eps) vector m1 = box.mins + box.origin; vector m2 = box.maxs + box.origin; - vector ret; - ret.x = bound(m1.x, org.x, m2.x); - ret.y = bound(m1.y, org.y, m2.y); - ret.z = bound(m1.z, org.z, m2.z); - return ret; + return vec3( + bound(m1.x, org.x, m2.x), + bound(m1.y, org.y, m2.y), + bound(m1.z, org.z, m2.z) + ); } #endif diff --git a/qcsrc/menu/draw.qh b/qcsrc/menu/draw.qh index b12534f7d..69178cb03 100644 --- a/qcsrc/menu/draw.qh +++ b/qcsrc/menu/draw.qh @@ -9,8 +9,8 @@ vector draw_scale; float draw_alpha; void draw_reset(float cw, float ch, float ox, float oy); -#define draw_beginBoldFont() MACRO_BEGIN { drawfont = FONT_USER + 3; } MACRO_END -#define draw_endBoldFont() MACRO_BEGIN { drawfont = FONT_USER + 0; } MACRO_END +#define draw_beginBoldFont() drawfont = FONT_USER + 3 +#define draw_endBoldFont() drawfont = FONT_USER void draw_setMousePointer(string pic, vector theSize, vector theOffset); void draw_drawMousePointer(vector where); diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index cd042661f..0c2c1ed4f 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -518,6 +518,7 @@ float autocvar_sv_airaccel_sideways_friction; float autocvar_sv_aircontrol; float autocvar_sv_aircontrol_power; float autocvar_sv_aircontrol_backwards; +float autocvar_sv_aircontrol_sidewards; float autocvar_sv_aircontrol_penalty; float autocvar_sv_warsowbunny_airforwardaccel; float autocvar_sv_warsowbunny_topspeed; diff --git a/qcsrc/server/bot/default/scripting.qh b/qcsrc/server/bot/default/scripting.qh index b3f0e90fa..cb5bf625f 100644 --- a/qcsrc/server/bot/default/scripting.qh +++ b/qcsrc/server/bot/default/scripting.qh @@ -34,9 +34,9 @@ const int BOT_CMD_BARRIER = 20; const int BOT_CMD_CONSOLE = 21; const int BOT_CMD_SOUND = 22; const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23; -const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet -const int BOT_CMD_WEND = 25; // TODO: Not implemented yet -const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet +//const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet +//const int BOT_CMD_WEND = 25; // TODO: Not implemented yet +//const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index af5cdb131..7401c2cd1 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -660,6 +660,8 @@ void PutClientInServer(entity this) if(!this.bot_attack) IL_PUSH(g_bot_targets, this); this.bot_attack = true; + if(!this.monster_attack) + IL_PUSH(g_monster_targets, this); this.monster_attack = true; navigation_dynamicgoal_init(this, false); diff --git a/qcsrc/server/command/radarmap.qc b/qcsrc/server/command/radarmap.qc index ad86afb23..d8b179716 100644 --- a/qcsrc/server/command/radarmap.qc +++ b/qcsrc/server/command/radarmap.qc @@ -1,3 +1,5 @@ +#ifdef RADARMAP + #include "radarmap.qh" #include #include "radarmap.qh" @@ -366,7 +368,7 @@ void RadarMap_Think(entity this) } } -float RadarMap_Make(float argc) +bool RadarMap_Make(float argc) { float i; @@ -454,3 +456,4 @@ float RadarMap_Make(float argc) return false; } +#endif diff --git a/qcsrc/server/command/radarmap.qh b/qcsrc/server/command/radarmap.qh index 4332003f8..520884b32 100644 --- a/qcsrc/server/command/radarmap.qh +++ b/qcsrc/server/command/radarmap.qh @@ -1,4 +1,7 @@ #pragma once +#ifndef RADARMAP +bool RadarMap_Make(float argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it.\n"); return true; } +#else // =========================================== // Declarations for radarmap generation code @@ -14,4 +17,6 @@ string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D // FF is contained twice, to map 256 to FF too // removes the need to bound() -float RadarMap_Make(float argc); +bool RadarMap_Make(float argc); + +#endif diff --git a/qcsrc/server/compat/_mod.inc b/qcsrc/server/compat/_mod.inc index 69d031eaf..daf9e940f 100644 --- a/qcsrc/server/compat/_mod.inc +++ b/qcsrc/server/compat/_mod.inc @@ -1,5 +1,6 @@ // generated file; do not modify #include #include +#include #include #include diff --git a/qcsrc/server/compat/_mod.qh b/qcsrc/server/compat/_mod.qh index bd658580e..c1614764d 100644 --- a/qcsrc/server/compat/_mod.qh +++ b/qcsrc/server/compat/_mod.qh @@ -1,5 +1,6 @@ // generated file; do not modify #include #include +#include #include #include diff --git a/qcsrc/server/compat/quake2.qc b/qcsrc/server/compat/quake2.qc new file mode 100644 index 000000000..df99f1570 --- /dev/null +++ b/qcsrc/server/compat/quake2.qc @@ -0,0 +1,15 @@ +#include "quake2.qh" + +spawnfunc(item_armor_medium); + +spawnfunc(item_invincible); + + +//*********************** +//QUAKE 2 ENTITIES - So people can play quake2 maps with the xonotic weapons +//*********************** +spawnfunc(item_armor_jacket) {spawnfunc_item_armor_medium(this);} + +spawnfunc(item_invulnerability) {spawnfunc_item_invincible(this);} + +// rest of the quake 2 entities are handled by q1 and q3 compat diff --git a/qcsrc/server/compat/quake2.qh b/qcsrc/server/compat/quake2.qh new file mode 100644 index 000000000..6f70f09be --- /dev/null +++ b/qcsrc/server/compat/quake2.qh @@ -0,0 +1 @@ +#pragma once diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index 8815aceac..905523bfb 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -5,6 +5,7 @@ spawnfunc(weapon_crylink); spawnfunc(weapon_electro); spawnfunc(weapon_hagar); +spawnfunc(weapon_hook); spawnfunc(weapon_machinegun); spawnfunc(weapon_vortex); spawnfunc(weapon_minelayer); @@ -60,6 +61,9 @@ spawnfunc(ammo_slugs) { spawnfunc_item_cells(this); } spawnfunc(weapon_bfg) { spawnfunc_weapon_crylink(this); } spawnfunc(ammo_bfg) { spawnfunc_item_cells(this); } +// grappling hook -> hook +spawnfunc(weapon_grapplinghook) { spawnfunc_weapon_hook(this); } + // RL -> RL spawnfunc(ammo_rockets) { spawnfunc_item_rockets(this); } diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index db879a05b..8cdb562f5 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -220,9 +220,9 @@ float TemporaryDB; .float team_saved; -float some_spawn_has_been_used; -float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found -float have_team_spawns_forteam[17]; // 0 = this team has no spawns, 1 = this team has spawns; team 0 is the "no-team" +bool some_spawn_has_been_used; +int have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found +int have_team_spawns_forteams; // if Xth bit is 1 then team X has spawns else it has no spawns; team 0 is the "no-team" // set when showing a kill countdown .entity killindicator; @@ -482,3 +482,9 @@ STATIC_INIT(g_locations) { g_locations = IL_NEW(); } IntrusiveList g_saved_team; STATIC_INIT(g_saved_team) { g_saved_team = IL_NEW(); } + +IntrusiveList g_monster_targets; +STATIC_INIT(g_monster_targets) { g_monster_targets = IL_NEW(); } + +IntrusiveList g_pathlib_nodes; +STATIC_INIT(g_pathlib_nodes) { g_pathlib_nodes = IL_NEW(); } diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index f8206db04..42c64e6a3 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -210,6 +210,8 @@ void cvar_changes_init() BADCVAR("mastervolume"); BADCVAR("volume"); BADCVAR("bgmvolume"); + BADCVAR("in_pitch_min"); + BADCVAR("in_pitch_max"); // private BADCVAR("developer"); @@ -250,6 +252,7 @@ void cvar_changes_init() // these can contain player IDs, so better hide BADPREFIX("g_forced_team_"); + BADCVAR("sv_muteban_list"); // mapinfo BADCVAR("fraglimit"); @@ -279,6 +282,7 @@ void cvar_changes_init() BADCVAR("g_race_laps_limit"); BADCVAR("g_race_qualifying_timelimit"); BADCVAR("g_race_qualifying_timelimit_override"); + BADCVAR("g_runematch"); BADCVAR("g_snafu"); BADCVAR("g_tdm"); BADCVAR("g_tdm_teams"); @@ -314,6 +318,7 @@ void cvar_changes_init() // does nothing gameplay relevant BADCVAR("captureleadlimit_override"); + BADCVAR("condump_stripcolors"); BADCVAR("gameversion"); BADCVAR("g_allow_oldvortexbeam"); BADCVAR("g_balance_kill_delay"); @@ -361,6 +366,7 @@ void cvar_changes_init() BADPREFIX("g_mod_"); BADPREFIX("g_respawn_"); BADPREFIX("net_"); + BADPREFIX("notification_"); BADPREFIX("prvm_"); BADPREFIX("skill_"); BADPREFIX("sv_allow_"); diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index a8e2b4cec..638b40f65 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -15,25 +15,25 @@ float mapvote_nextthink; float mapvote_keeptwotime; float mapvote_timeout; -const float MAPVOTE_SCREENSHOT_DIRS_COUNT = 4; +const int MAPVOTE_SCREENSHOT_DIRS_COUNT = 4; string mapvote_screenshot_dirs[MAPVOTE_SCREENSHOT_DIRS_COUNT]; -float mapvote_screenshot_dirs_count; +int mapvote_screenshot_dirs_count; -float mapvote_count; -float mapvote_count_real; +int mapvote_count; +int mapvote_count_real; string mapvote_maps[MAPVOTE_COUNT]; -float mapvote_maps_screenshot_dir[MAPVOTE_COUNT]; +int mapvote_maps_screenshot_dir[MAPVOTE_COUNT]; string mapvote_maps_pakfile[MAPVOTE_COUNT]; -float mapvote_maps_suggested[MAPVOTE_COUNT]; +bool mapvote_maps_suggested[MAPVOTE_COUNT]; string mapvote_suggestions[MAPVOTE_COUNT]; -float mapvote_suggestion_ptr; -float mapvote_voters; -float mapvote_selections[MAPVOTE_COUNT]; -float mapvote_maps_flags[MAPVOTE_COUNT]; -float mapvote_run; -float mapvote_detail; -float mapvote_abstain; -.float mapvote; +int mapvote_suggestion_ptr; +int mapvote_voters; +int mapvote_selections[MAPVOTE_COUNT]; +int mapvote_maps_flags[MAPVOTE_COUNT]; +bool mapvote_run; +bool mapvote_detail; +bool mapvote_abstain; +.int mapvote; entity mapvote_ent; @@ -76,9 +76,9 @@ int GameTypeVote_AvailabilityStatus(string type_name) return flag | GTV_AVAILABLE; } -float GameTypeVote_GetMask() +int GameTypeVote_GetMask() { - float n, j, gametype_mask; + int n, j, gametype_mask; n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " "); n = min(MAPVOTE_COUNT, n); gametype_mask = 0; @@ -104,8 +104,7 @@ void MapVote_ClearAllVotes() void MapVote_UnzoneStrings() { - float j; - for(j = 0; j < mapvote_count; ++j) + for(int j = 0; j < mapvote_count; ++j) { if ( mapvote_maps[j] ) { @@ -122,7 +121,7 @@ void MapVote_UnzoneStrings() string MapVote_Suggest(entity this, string m) { - float i; + int i; if(m == "") return "That's not how to use this command."; if(!autocvar_g_maplist_votable_suggestions) @@ -160,9 +159,9 @@ string MapVote_Suggest(entity this, string m) return strcat("Suggestion of ", m, " accepted."); } -void MapVote_AddVotable(string nextMap, float isSuggestion) +void MapVote_AddVotable(string nextMap, bool isSuggestion) { - float j, i, o; + int j, i, o; string pakfile, mapfile; if(nextMap == "") @@ -203,15 +202,15 @@ void MapVote_AddVotable(string nextMap, float isSuggestion) void MapVote_Init() { - float i; - float nmax, smax; + int i; + int nmax, smax; MapVote_ClearAllVotes(); MapVote_UnzoneStrings(); mapvote_count = 0; mapvote_detail = !autocvar_g_maplist_votable_nodetail; - mapvote_abstain = autocvar_g_maplist_votable_abstain; + mapvote_abstain = boolean(autocvar_g_maplist_votable_abstain); if(mapvote_abstain) nmax = min(MAPVOTE_COUNT - 1, autocvar_g_maplist_votable); @@ -247,7 +246,7 @@ void MapVote_Init() mapvote_count_real = mapvote_count; if(mapvote_abstain) - MapVote_AddVotable("don't care", 0); + MapVote_AddVotable("don't care", false); //dprint("mapvote count is ", ftos(mapvote_count), "\n"); @@ -343,7 +342,7 @@ void GameTypeVote_SendOption(int i) bool MapVote_SendEntity(entity this, entity to, int sf) { - float i; + int i; if(sf & 1) sf &= ~2; // if we send 1, we don't need to also send 2 @@ -423,14 +422,14 @@ void MapVote_TouchVotes(entity voter) mapvote_ent.SendFlags |= 4; } -float MapVote_Finished(float mappos) +bool MapVote_Finished(int mappos) { if(alreadychangedlevel) return false; string result; - float i; - float didntvote; + int i; + int didntvote; if(autocvar_sv_eventlog) { @@ -502,12 +501,12 @@ void MapVote_CheckRules_1() }); } -float MapVote_CheckRules_2() +bool MapVote_CheckRules_2() { - float i; - float firstPlace, secondPlace, currentPlace; - float firstPlaceVotes, secondPlaceVotes, currentVotes; - float mapvote_voters_real; + int i; + int firstPlace, secondPlace, currentPlace; + int firstPlaceVotes, secondPlaceVotes, currentVotes; + int mapvote_voters_real; string result; if(mapvote_count_real == 1) @@ -558,14 +557,13 @@ float MapVote_CheckRules_2() if(mapvote_keeptwotime) if(time > mapvote_keeptwotime || (mapvote_voters_real - firstPlaceVotes - secondPlaceVotes) < secondPlaceVotes) { - float didntvote; MapVote_TouchMask(); mapvote_keeptwotime = 0; result = strcat(":vote:keeptwo:", mapvote_maps[firstPlace]); result = strcat(result, ":", ftos(firstPlaceVotes)); result = strcat(result, ":", mapvote_maps[secondPlace]); result = strcat(result, ":", ftos(secondPlaceVotes), "::"); - didntvote = mapvote_voters; + int didntvote = mapvote_voters; for(i = 0; i < mapvote_count; ++i) { didntvote -= mapvote_selections[i]; @@ -590,13 +588,12 @@ float MapVote_CheckRules_2() void MapVote_Tick() { - float totalvotes; MapVote_CheckRules_1(); // count if(MapVote_CheckRules_2()) // decide return; - totalvotes = 0; + int totalvotes = 0; FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA( // hide scoreboard again if(it.health != 2342) @@ -693,7 +690,7 @@ void MapVote_Think() MapVote_Tick(); } -float GameTypeVote_SetGametype(Gametype type) +bool GameTypeVote_SetGametype(Gametype type) { if (MapInfo_CurrentGametype() == type) return true; @@ -728,8 +725,8 @@ float GameTypeVote_SetGametype(Gametype type) return true; } -float gametypevote_finished; -float GameTypeVote_Finished(float pos) +bool gametypevote_finished; +bool GameTypeVote_Finished(int pos) { if(!gametypevote || gametypevote_finished) return false; @@ -747,12 +744,12 @@ float GameTypeVote_Finished(float pos) return true; } -float GameTypeVote_AddVotable(string nextMode) +bool GameTypeVote_AddVotable(string nextMode) { - float j; if ( nextMode == "" || GameTypeVote_Type_FromString(nextMode) == NULL ) return false; - for(j = 0; j < mapvote_count; ++j) + + for(int j = 0; j < mapvote_count; ++j) if(mapvote_maps[j] == nextMode) return false; @@ -769,24 +766,23 @@ float GameTypeVote_AddVotable(string nextMode) } -float GameTypeVote_Start() +bool GameTypeVote_Start() { - float j; MapVote_ClearAllVotes(); MapVote_UnzoneStrings(); mapvote_count = 0; mapvote_timeout = time + autocvar_sv_vote_gametype_timeout; - mapvote_abstain = 0; + mapvote_abstain = false; mapvote_detail = !autocvar_g_maplist_votable_nodetail; - float n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " "); + int n = tokenizebyseparator(autocvar_sv_vote_gametype_options, " "); n = min(MAPVOTE_COUNT, n); - float really_available, which_available; + int really_available, which_available; really_available = 0; which_available = -1; - for(j = 0; j < n; ++j) + for(int j = 0; j < n; ++j) { if ( GameTypeVote_AddVotable(argv(j)) ) if ( mapvote_maps_flags[j] & GTV_AVAILABLE ) diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index c66a6328f..24f16c487 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1262,7 +1262,7 @@ float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundma { setorigin(e, start); e.angles = vectoangles(end - start); - LOG_TRACE("Needed ", ftos(i + 1), " attempts"); + LOG_DEBUG("Needed ", ftos(i + 1), " attempts"); return true; } else diff --git a/qcsrc/server/mutators/mutator/gamemode_invasion.qc b/qcsrc/server/mutators/mutator/gamemode_invasion.qc index cbff696fc..05a89c75d 100644 --- a/qcsrc/server/mutators/mutator/gamemode_invasion.qc +++ b/qcsrc/server/mutators/mutator/gamemode_invasion.qc @@ -18,6 +18,8 @@ int autocvar_g_invasion_monster_count; bool autocvar_g_invasion_zombies_only; float autocvar_g_invasion_spawn_delay; +bool inv_warning_shown; // spammy + .string spawnmob; spawnfunc(invasion_wave) @@ -103,7 +105,11 @@ void invasion_SpawnChosenMonster(Monster mon) if(spawn_point == NULL) { - LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations"); + if(!inv_warning_shown) + { + inv_warning_shown = true; + LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations"); + } entity e = spawn(); setsize(e, mon.m_mins, mon.m_maxs); @@ -156,6 +162,8 @@ void invasion_SpawnChosenMonster(Monster mon) } } + if(monster.monster_attack) + IL_REMOVE(g_monster_targets, monster); monster.monster_attack = false; // it's the player's job to kill all the monsters if(inv_roundcnt >= inv_maxrounds) diff --git a/qcsrc/server/pathlib/main.qc b/qcsrc/server/pathlib/main.qc index 833ad9b3f..706e10d9e 100644 --- a/qcsrc/server/pathlib/main.qc +++ b/qcsrc/server/pathlib/main.qc @@ -6,6 +6,9 @@ void pathlib_deletepath(entity start) { + if(!start) + return; + FOREACH_ENTITY_ENT(owner, start, { setthink(it, SUB_Remove); @@ -17,6 +20,8 @@ const float PATHLIB_NODEEXPIRE = 20; // 0.05 void dumpnode(entity n) { + if(n.is_path_node) + IL_REMOVE(g_pathlib_nodes, n); n.is_path_node = false; setthink(n, SUB_Remove); n.nextthink = time; @@ -44,6 +49,7 @@ entity pathlib_mknode(vector where,entity parent) setthink(node, SUB_Remove); node.nextthink = time + PATHLIB_NODEEXPIRE; + IL_PUSH(g_pathlib_nodes, node); node.is_path_node = true; node.owner = openlist; node.path_prev = parent; @@ -69,7 +75,7 @@ bool pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goa if(inwater(parent.origin)) { - LOG_TRACE("FromWater"); + LOG_DEBUG("FromWater"); pathlib_expandnode = pathlib_expandnode_box; pathlib_movenode = pathlib_swimnode; } @@ -77,13 +83,13 @@ bool pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goa { if(inwater(to)) { - LOG_TRACE("ToWater"); + LOG_DEBUG("ToWater"); pathlib_expandnode = pathlib_expandnode_box; pathlib_movenode = pathlib_walknode; } else { - LOG_TRACE("LandToLoand"); + LOG_DEBUG("LandToLoand"); //if(edge_check(parent.origin)) // return 0; @@ -96,7 +102,7 @@ bool pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goa entity node = pathlib_nodeatpoint(to); if(node) { - LOG_TRACE("NodeAtPoint"); + LOG_DEBUG("NodeAtPoint"); ++pathlib_merge_cnt; if(node.owner == openlist) @@ -129,7 +135,7 @@ bool pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goa { //pathlib_showsquare(where, 0 ,30); //pathlib_showsquare(parent.origin, 1 ,30); - LOG_TRACE("pathlib_movenode_goodnode = 0"); + LOG_DEBUG("pathlib_movenode_goodnode = 0"); return false; } @@ -137,9 +143,9 @@ bool pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goa if(pathlib_nodeatpoint(where)) { - LOG_TRACE("NAP WHERE :",vtos(where)); - LOG_TRACE("not NAP TO:",vtos(to)); - LOG_TRACE("NAP-NNAP:",ftos(vlen(to-where))); + LOG_DEBUG("NAP WHERE :",vtos(where)); + LOG_DEBUG("not NAP TO:",vtos(to)); + LOG_DEBUG("NAP-NNAP:",ftos(vlen(to-where))); return false; } @@ -147,7 +153,7 @@ bool pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goa if(dodge) if (!tile_check(parent, where)) { - LOG_TRACE("tile_check fail"); + LOG_DEBUG("tile_check fail"); #if DEBUGPATHING pathlib_showsquare(where, 0 ,30); #endif @@ -263,19 +269,21 @@ void pathlib_cleanup() //return; - FOREACH_ENTITY_FLOAT(is_path_node, true, + IL_EACH(g_pathlib_nodes, it.is_path_node, { dumpnode(it); }); + IL_CLEAR(g_pathlib_nodes); + if(openlist) delete(openlist); if(closedlist) delete(closedlist); - openlist = NULL; - closedlist = NULL; + openlist = NULL; + closedlist = NULL; } float Cosine_Interpolate(float a, float b, float c) @@ -283,7 +291,7 @@ float Cosine_Interpolate(float a, float b, float c) float ft = c * 3.1415927; float f = (1 - cos(ft)) * 0.5; - return a*(1-f) + b*f; + return a*(1-f) + b*f; } bool buildpath_nodefilter_directional(vector n,vector c,vector p) @@ -421,18 +429,18 @@ entity pathlib_astar(entity this, vector from, vector to) from.x = fsnap(from.x, pathlib_gridsize); from.y = fsnap(from.y, pathlib_gridsize); - //from_z += 32; + //from.z += 32; to.x = fsnap(to.x, pathlib_gridsize); to.y = fsnap(to.y, pathlib_gridsize); - //to_z += 32; + //to.z += 32; - LOG_TRACE("AStar init"); + LOG_DEBUG("AStar init"); entity path = pathlib_mknode(from, NULL); pathlib_close_node(path, to); if(pathlib_foundgoal) { - LOG_TRACE("AStar: Goal found on first node!"); + LOG_DEBUG("AStar: Goal found on first node!"); open = new(path_end); open.owner = open; @@ -463,7 +471,7 @@ entity pathlib_astar(entity this, vector from, vector to) { if((gettime(GETTIME_REALTIME) - pathlib_starttime) > pathlib_maxtime) { - LOG_TRACE("Path took to long to compute!"); + LOG_TRACE("Path took too long to compute!"); LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt)); LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt)); LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt)); @@ -484,7 +492,7 @@ entity pathlib_astar(entity this, vector from, vector to) if(pathlib_foundgoal) { - LOG_TRACE("Target found. Rebuilding and filtering path..."); + LOG_DEBUG("Target found. Rebuilding and filtering path..."); float ftime = gettime(GETTIME_REALTIME); ptime = ftime - ptime; diff --git a/qcsrc/server/pathlib/movenode.qc b/qcsrc/server/pathlib/movenode.qc index ca9180eef..f27ab4879 100644 --- a/qcsrc/server/pathlib/movenode.qc +++ b/qcsrc/server/pathlib/movenode.qc @@ -86,7 +86,7 @@ vector pathlib_walknode(entity this, vector start, vector end, float doedge) { vector point; - LOG_TRACE("Walking node from ", vtos(start), " to ", vtos(end)); + LOG_DEBUG("Walking node from ", vtos(start), " to ", vtos(end)); pathlib_movenode_goodnode = false; diff --git a/qcsrc/server/pathlib/pathlib.qh b/qcsrc/server/pathlib/pathlib.qh index a014c7ce2..21ef8b3cb 100644 --- a/qcsrc/server/pathlib/pathlib.qh +++ b/qcsrc/server/pathlib/pathlib.qh @@ -26,7 +26,7 @@ entity closedlist; entity goal_node; entity start_node; -.float is_path_node; +.bool is_path_node; .float pathlib_node_g; .float pathlib_node_h; .float pathlib_node_f; diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 9ebaac9f2..da64db697 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -28,12 +28,14 @@ entity pathlib_nodeatpoint(vector where) where.x = fsnap(where.x,pathlib_gridsize); where.y = fsnap(where.y,pathlib_gridsize); - FOREACH_ENTITY_RADIUS(where, pathlib_gridsize * 0.5, it.is_path_node, + entity found = NULL; // TODO: using FOREACH_ENTITY_RADIUS here causes mutex loop warnings, this may need a proper fix! + IL_EACH(g_pathlib_nodes, it.is_path_node && vdist(it.origin - where, <, pathlib_gridsize * 0.5), { - return it; + found = it; + break; }); - return NULL; + return found; } bool tile_check_cross(entity this, vector where) diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 5aae35599..faba40f3f 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -311,7 +311,6 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, { float take, save, dh, da; vector v; - float valid_damage_for_weaponstats; float excess; dh = max(this.health, 0); @@ -484,7 +483,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, bool abot = (IS_BOT_CLIENT(attacker)); bool vbot = (IS_BOT_CLIENT(this)); - valid_damage_for_weaponstats = 0; + bool valid_damage_for_weaponstats = false; Weapon awep = WEP_Null; .entity weaponentity = weaponentities[0]; // TODO: unhardcode @@ -497,7 +496,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, awep = attacker.(weaponentity).m_weapon; else awep = DEATH_WEAPONOF(deathtype); - valid_damage_for_weaponstats = 1; + valid_damage_for_weaponstats = true; } dh = dh - max(this.health, 0); @@ -560,10 +559,13 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, damage); excess = M_ARGV(4, float); - Weapon wep = this.(weaponentity).m_weapon; + //Weapon wep = this.(weaponentity).m_weapon; for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity went = weaponentities[slot]; + if(!this.(weaponentity)) + continue; // TODO: clones have no weapon, but we don't want to have to check this all the time + Weapon wep = this.(weaponentity).m_weapon; wep.wr_playerdeath(wep, this, went); } @@ -649,13 +651,17 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, } // reset fields the weapons may use just in case - FOREACH(Weapons, it != WEP_Null, LAMBDA( - it.wr_resetplayer(it, this); - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + if(this.classname != "body") + { + FOREACH(Weapons, it != WEP_Null, { - ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0; - } - )); + it.wr_resetplayer(it, this); + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0; + } + }); + } MUTATOR_CALLHOOK(PlayerDied, this); } } diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 786635af0..16564cd39 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -76,7 +76,7 @@ void round_handler_Init(float the_delay, float the_count, float the_round_timeli } // NOTE: this is only needed because if round_handler spawns at time 1 -// gamestarttime isn't initialized yet +// game_starttime isn't initialized yet void round_handler_FirstThink(entity this) { round_starttime = max(time, game_starttime) + this.count; diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 09f230dd6..7854b875e 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -339,9 +339,12 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) LOG_WARN("Adding score to unknown player!"); return 0; } - if(score) - if(scores_label(scorefield) != "") - s.SendFlags |= (2 ** (scorefield.m_id % 16)); + if(!score) + { + return s.(scores(scorefield)); + } + if(scores_label(scorefield) != "") + s.SendFlags |= (2 ** (scorefield.m_id % 16)); if(!warmup_stage) PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score); return (s.(scores(scorefield)) += score); diff --git a/qcsrc/server/scores.qh b/qcsrc/server/scores.qh index cf7676590..2f9c07872 100644 --- a/qcsrc/server/scores.qh +++ b/qcsrc/server/scores.qh @@ -24,6 +24,14 @@ void PlayerScore_Detach(entity player); */ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score); +/** + * \brief Returns the player's score. + * \param[in] player Player to inspect. + * \param[in] scorefield Field of the score. + * \return Player's score. + */ +#define PlayerScore_Get(player, scorefield) PlayerScore_Add(player, scorefield, 0) + /** * Initialize the score of this player if needed. * Does nothing in teamplay. diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 3d62c149c..bdb9cdab7 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -64,7 +64,7 @@ void spawnpoint_use(entity this, entity actor, entity trigger) if(have_team_spawns > 0) { this.team = actor.team; - some_spawn_has_been_used = 1; + some_spawn_has_been_used = true; } //LOG_INFO("spawnpoint was used!\n"); } @@ -113,7 +113,7 @@ void relocate_spawnpoint(entity this) if (have_team_spawns != 0) if (this.team) have_team_spawns = 1; - have_team_spawns_forteam[this.team] = 1; + have_team_spawns_forteams |= BIT(this.team); if (autocvar_r_showbboxes) { @@ -344,11 +344,11 @@ entity SelectSpawnPoint(entity this, bool anypoint) teamcheck = -1; else if(have_team_spawns > 0) { - if(have_team_spawns_forteam[this.team] == 0) + if(!(have_team_spawns_forteams & BIT(this.team))) { // we request a spawn for a team, and we have team // spawns, but that team has no spawns? - if(have_team_spawns_forteam[0]) + if(have_team_spawns_forteams & BIT(0)) // try noteam spawns teamcheck = 0; else @@ -358,7 +358,7 @@ entity SelectSpawnPoint(entity this, bool anypoint) else teamcheck = this.team; // MUST be team } - else if(have_team_spawns == 0 && have_team_spawns_forteam[0]) + else if(have_team_spawns == 0 && (have_team_spawns_forteams & BIT(0))) teamcheck = 0; // MUST be noteam else teamcheck = -1; diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 7ba19dafd..0ae9b356c 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -378,6 +378,9 @@ LABEL(cvar_fail) set_movetype(this, this.movetype); + if(this.monster_attack) + IL_PUSH(g_monster_targets, this); + // support special -1 and -2 angle from radiant if (this.angles == '0 -1 0') this.angles = '-90 0 0';