From ccab59cb15dd94e541c7080261d0782addee527a Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Wed, 10 May 2023 16:10:43 -0700 Subject: [PATCH] WEAPON_SUPERSHOTGUN: make the shell eject nicer --- src/shared/w_supershotgun.qc | 23 +++++++++++++++++++---- zpak001.pk3dir/scripts/maptweaks.txt | 5 +++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/shared/w_supershotgun.qc b/src/shared/w_supershotgun.qc index 4ab283d..a9b2119 100644 --- a/src/shared/w_supershotgun.qc +++ b/src/shared/w_supershotgun.qc @@ -41,7 +41,7 @@ enum }; #ifdef CLIENT -void w_supershotgun_ejectshell(void) +void w_supershotgun_ejectshell_s(bool right) { static void w_supershotgun_ejectshell_death(void) { remove(self); @@ -60,7 +60,12 @@ void w_supershotgun_ejectshell(void) makevectors(pSeat->m_eViewModel.angles); eShell.velocity += (v_forward * 0); - eShell.velocity += (v_right * 80); + + if (right) + eShell.velocity += (v_right * 80); + else + eShell.velocity += (v_right * -80); + eShell.velocity += (v_up * 100); eShell.touch = w_supershotgun_ejectshell_touch; @@ -68,7 +73,17 @@ void w_supershotgun_ejectshell(void) eShell.think = w_supershotgun_ejectshell_death; eShell.nextthink = time + 2.5f; setsize(eShell, [0,0,0], [0,0,0]); - setorigin(eShell, pSeat->m_eViewModel.origin + (v_forward * 26) + (v_right * 8) + (v_up * -4)); + + if (right) + setorigin(eShell, pSeat->m_eViewModel.origin + (v_forward * 28) + (v_right * 4) + (v_up * -18)); + else + setorigin(eShell, pSeat->m_eViewModel.origin + (v_forward * 28) + (v_right * -4) + (v_up * -18)); +} + +void w_supershotgun_ejectshell(void) +{ + w_supershotgun_ejectshell_s(true); + w_supershotgun_ejectshell_s(false); } #endif @@ -147,7 +162,7 @@ w_supershotgun_primary(player pl) pl.ammo_shells -= 2; #ifdef CLIENT - View_AddEvent(w_supershotgun_ejectshell, 0.0f); + View_AddEvent(w_supershotgun_ejectshell, 0.325f); #else TraceAttack_FireBulletsWithDecal(14, pl.origin + pl.view_ofs, Skill_GetValue("plr_supershotgun", 4), [0.14,0.08], WEAPON_SUPERSHOTGUN, "Impact.BigShot"); Sound_Play(pl, CHAN_WEAPON, "weapon_supershotgun.shoot"); diff --git a/zpak001.pk3dir/scripts/maptweaks.txt b/zpak001.pk3dir/scripts/maptweaks.txt index d4aa452..3f51cea 100644 --- a/zpak001.pk3dir/scripts/maptweaks.txt +++ b/zpak001.pk3dir/scripts/maptweaks.txt @@ -50,8 +50,6 @@ q3a_entities replace misc_teleporter_dest info_null replace misc_portal_camera info_null replace target_delay info_null - replace target_position info_null - replace target_location info_null replace info_camp info_null replace info_player_intermission info_null replace holdable_teleporter info_null @@ -71,6 +69,9 @@ q3a_entities replace holdable_medkit info_null replace func_bobbing info_null replace item_flight info_null + replace target_push info_notnull + replace target_position info_notnull + replace target_location info_notnull replace ammo_belt item_nails replace ammo_bfg item_cells