From 78300337226a64ca5534cad53c65864fee7eac3c Mon Sep 17 00:00:00 2001 From: Lippeth Date: Mon, 4 Apr 2022 09:02:54 -0700 Subject: [PATCH] - added vertical bullet spread relative to ssg --- src/d_main.cpp | 1 + src/d_netinfo.cpp | 2 ++ src/doomdef.h | 1 + wadsrc/static/language.0 | 1 + wadsrc/static/language.csv | 1 + wadsrc/static/menudef.txt | 3 +++ wadsrc/static/zscript/actors/doom/weaponpistol.zs | 5 +++++ wadsrc/static/zscript/actors/heretic/weaponblaster.zs | 5 +++++ wadsrc/static/zscript/actors/heretic/weaponwand.zs | 5 +++++ 9 files changed, 24 insertions(+) diff --git a/src/d_main.cpp b/src/d_main.cpp index 8fc0fcef72..38ab1898c1 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -557,6 +557,7 @@ CVAR (Flag, sv_nocountendmonst, dmflags2, DF2_NOCOUNTENDMONST); CVAR (Flag, sv_respawnsuper, dmflags2, DF2_RESPAWN_SUPER); CVAR (Flag, sv_nothingspawn, dmflags2, DF2_NO_COOP_THING_SPAWN); CVAR (Flag, sv_alwaysspawnmulti, dmflags2, DF2_ALWAYS_SPAWN_MULTI); +CVAR (Flag, sv_novertspread, dmflags2, DF2_NOVERTSPREAD); //========================================================================== // diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 27c91d851a..356a179c95 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -68,6 +68,7 @@ CVAR (Float, wbobspeed, 1.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, wbobfire, 0.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (String, playerclass, "Fighter", CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Bool, classicflight, false, CVAR_USERINFO | CVAR_ARCHIVE); +CVAR (Bool, vertspread, false, CVAR_USERINFO | CVAR_ARCHIVE); enum { @@ -85,6 +86,7 @@ enum INFO_PlayerClass, INFO_ColorSet, INFO_ClassicFlight, + INFO_VertSpread, }; const char *GenderNames[GENDER_MAX] = { "male", "female", "neutral", "other" }; diff --git a/src/doomdef.h b/src/doomdef.h index 3d5aad647c..83498798b4 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -172,6 +172,7 @@ enum DF2_RESPAWN_SUPER = 1 << 27, // Respawn invulnerability and invisibility DF2_NO_COOP_THING_SPAWN = 1 << 28, // Don't spawn multiplayer things in coop games DF2_ALWAYS_SPAWN_MULTI = 1 << 29, // Always spawn multiplayer items + DF2_NOVERTSPREAD = 1 << 30, // Don't allow vertical spread for hitscan weapons (excluding ssg) }; // [RH] Compatibility flags. diff --git a/wadsrc/static/language.0 b/wadsrc/static/language.0 index 6fd2eef044..f66a5be24a 100644 --- a/wadsrc/static/language.0 +++ b/wadsrc/static/language.0 @@ -400,6 +400,7 @@ Gameplay Options,GMPLYMNU_TITLE,,,,Nastavení herních mechanik,Gameplay-Optione Always,OPTVAL_ALWAYS,,,,Vždy,Immer,,Ĉiam,Siempre,,Aina,Toujours,Mindig,Sempre,常に,언제나,Altijd,Zawsze,Sempre,,Mereu,Всегда,Увек Never,OPTVAL_NEVER,,,,Nikdy,Nie,,Neniam,Nunca,,Ei koskaan,Jamais,Soha,Mai,しない,없음,Nooit,Nigdy,Nunca,,Niciodată,Никогда,Никад Autoaim,PLYRMNU_AUTOAIM,,,,Automatické míření,Automatisch zielen,,Celasisto,Autoapuntar,,Automaattitähtäys,Auto-visée,Automatikus célzás,Mira automatica,自動照準,자동 조준,Autoaim,Automatyczne Celowanie,Mira automática,,Autoțintire,Автоприцеливание,Аутоматско циљање +Vertical Bullet Spread,PLYRMNU_VERTSPREAD,,,,,,,,,,,,,,,,,,,,,,,, Always Run,PLYRMNU_ALWAYSRUN,,,,Vždy běžet,Immer Rennen,,Ĉiam Kuri,Siempre correr,,Jatkuva juoksu,Toujours courir,Mindig fusson,Corri sempre,常に駆け足,달리기 토글,Altijd lopen,Zawsze Biegaj,Sempre correr,Correr Sempre,Fugă în permanență,Постоянный бег,Увек трчи ,,Display,,,,,,,,,,,,,,,,,,,,, Display Options,DSPLYMNU_TITLE,,,,Nastavení grafiky,Anzeigeoptionen,,Ekrano-Agordoj,Opciones de visualización,,Näyttöasetukset,Options Affichage,Megjelenítés beállítások,Opzioni display,ディスプレイ オプション,디스플레이 설정,Weergaveopties,Opcje Wyświetlania,Opções de vídeo,,Setări afișare,Настройки экрана,Подешавања приказа diff --git a/wadsrc/static/language.csv b/wadsrc/static/language.csv index 5d780df339..b955497ba2 100644 --- a/wadsrc/static/language.csv +++ b/wadsrc/static/language.csv @@ -2496,6 +2496,7 @@ Fast monsters,GMPLYMNU_FASTMONSTERS,,,,Rychlé příšery,Schnelle Monster,,Rapi Monsters Nightmare Reflexes,GMPLYMNU_INSTANTREACTION,,,,,Monsterreflexe in 'Alptraum!'.,,Refleksoj de monstroj en Inkubo-modo,Reflejos de los monsturos en Pesadilla,,Painajaisvaikeustason hirviöiden reaktioajat,,Rémálom szintű szörny reakciók,,敵が悪夢と同じ機敏さ,,,Refleks Potworów z Trybu Koszmar,,,Monștri cu Reflexe de Coșmar,, Degeneration,GMPLYMNU_DEGENERATION,,,,Degenerace,,,Degenero,Degeneración,,Rappeutuva terveys,Dégéneration,Degeneráció,Degrado della salute,プレイヤーの自動体力減少,약화,Degeneratie,Degeneracja,Degeneração,,Degenerare,Уменьшать дополнительное здоровье,Смањење додатног здравља Allow Autoaim,GMPLYMNU_NOAUTOAIM,,,,Povolit automatické míření,Zielautomatik zulassen,,Permesi Celasiston,Permitir Autoapuntar,,Salli automaattitähtäys,Autoriser Auto-visée,Autocélzás engedélyezése,Mira automatica consentita,オートエイム有効化,자동 조준 허용,Autoaim toestaan,Pozwól na Autocelowanie,Permitir Mira Automática,,Permite asistența pentru țintire,Разрешить автоприцеливание,Дозволи аутоматско циљање +Allow Vertical Bullet Spread,GMPLYMNU_NOVERTSPREAD,,,,,,,,,,,,,,,,,,,,,,,, Allow Suicide,GMPLYMNU_ALLOWSUICIDE,,,,Povolit sebevraždu,Selbstmord zulassen,,Permesi Memmortigon,Permitir Suicidio,,Salli itsemurha,Autoriser Suicide,Öngyilkosság engedélyezése,Suicidio consentito,自殺コマンド有効化,자살 허용,Zelfmoord toestaan,Pozwól na Samobójstwo,Permitir suicídio,,Permite sinuciderile,Разрешить суицид,Дозволи самоубиство Allow jump,GMPLYMNU_ALLOWJUMP,,,,Povolit skákání,Springen zulassen,,Permesi salton,Permitir salto,,Salli hyppiminen,Autoriser Sauts,Ugrás engedélyezése,Salto consentito,ジャンプ有効化,점프 허용,Springen toestaan,Pozwól na skakanie,Permitir pulo,Permitir salto,Permite săriturile,Прыжки,Дозволи скок Allow crouch,GMPLYMNU_ALLOWCROUCH,,,,Povolit klečení,Ducken zulassen,,Permesi kaŭron,Permitir agacharse,,Salli kyyristyminen,Autoriser Acroupissement,Guggolás engedélyezése,Abbassamento consentito,しゃがみ有効化,앉기 허용,Hurken toestaan,Pozwól na kucanie,Permitir agachamento,,Permite ghemuirile,Приседание,Дозволи чучање diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 8b39980847..90ca64d1ef 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -443,6 +443,7 @@ OptionMenu "NewPlayerMenu" protected PlayerSkinItem "$PLYRMNU_PLAYERSKIN", "PlayerSkin" PlayerGenderItem "$PLYRMNU_PLAYERGENDER", "Gender" AutoaimSlider "$PLYRMNU_AUTOAIM" + Option "$PLYRMNU_VERTSPREAD", vertspread, "OnOff" PlayerSwitchOnPickupItem "$PLYRMNU_SWITCHONPICKUP", "OffOn" Option "$PLYRMNU_ALWAYSRUN", cl_run, "OnOff" Class "NewPlayerMenu" @@ -488,6 +489,7 @@ ListMenu "PlayerMenu" ValueText "$PLYRMNU_PLAYERSKIN", "Skin" ValueText "$PLYRMNU_PLAYERGENDER", "Gender", "Gender" Slider "$PLYRMNU_AUTOAIM", "Autoaim", 0, 35, 1 + ValueText "$PLYRMNU_VERTSPREAD", vertspread, "OnOff" ValueText "$PLYRMNU_SWITCHONPICKUP", "Switch", "OffOn" ValueText "$PLYRMNU_ALWAYSRUN", "AlwaysRun", "OnOff" Class "PlayerMenu" @@ -1644,6 +1646,7 @@ OptionMenu GameplayOptions protected Option "$GMPLYMNU_INSTANTREACTION", "sv_instantreaction", "YesNo" Option "$GMPLYMNU_DEGENERATION", "sv_degeneration", "YesNo" Option "$GMPLYMNU_NOAUTOAIM", "sv_noautoaim", "NoYes" + Option "$GMPLYMNU_NOVERTSPREAD", "sv_novertspread", "NoYes" Option "$GMPLYMNU_ALLOWSUICIDE", "sv_disallowsuicide", "NoYes" Option "$GMPLYMNU_ALLOWJUMP", "sv_jump", "JumpCrouchFreeLook" Option "$GMPLYMNU_ALLOWCROUCH", "sv_crouch", "JumpCrouchFreeLook" diff --git a/wadsrc/static/zscript/actors/doom/weaponpistol.zs b/wadsrc/static/zscript/actors/doom/weaponpistol.zs index cddd8647ab..0665a67aff 100644 --- a/wadsrc/static/zscript/actors/doom/weaponpistol.zs +++ b/wadsrc/static/zscript/actors/doom/weaponpistol.zs @@ -65,6 +65,11 @@ extend class StateProvider if (!accurate) { ang += Random2[GunShot]() * (5.625 / 256); + + if (GetCVar ("vertspread") && !sv_novertspread) + { + pitch += Random2[GunShot]() * (3.549 / 256); + } } LineAttack(ang, PLAYERMISSILERANGE, pitch, damage, 'Hitscan', pufftype); diff --git a/wadsrc/static/zscript/actors/heretic/weaponblaster.zs b/wadsrc/static/zscript/actors/heretic/weaponblaster.zs index 23830eb086..d2048e594c 100644 --- a/wadsrc/static/zscript/actors/heretic/weaponblaster.zs +++ b/wadsrc/static/zscript/actors/heretic/weaponblaster.zs @@ -65,6 +65,11 @@ class Blaster : HereticWeapon if (player.refire) { ang += Random2[FireBlaster]() * (5.625 / 256); + + if (GetCVar ("vertspread") && !sv_novertspread) + { + pitch += Random2[FireBlaster]() * (3.549 / 256); + } } LineAttack (ang, PLAYERMISSILERANGE, pitch, damage, 'Hitscan', "BlasterPuff"); A_StartSound ("weapons/blastershoot", CHAN_WEAPON); diff --git a/wadsrc/static/zscript/actors/heretic/weaponwand.zs b/wadsrc/static/zscript/actors/heretic/weaponwand.zs index 52d5136e2b..65829a8d45 100644 --- a/wadsrc/static/zscript/actors/heretic/weaponwand.zs +++ b/wadsrc/static/zscript/actors/heretic/weaponwand.zs @@ -64,6 +64,11 @@ class GoldWand : HereticWeapon if (player.refire) { ang += Random2[FireGoldWand]() * (5.625 / 256); + + if (GetCVar ("vertspread") && !sv_novertspread) + { + pitch += Random2[FireGoldWand]() * (3.549 / 256); + } } LineAttack(ang, PLAYERMISSILERANGE, pitch, damage, 'Hitscan', "GoldWandPuff1"); A_StartSound("weapons/wandhit", CHAN_WEAPON);