diff --git a/src/client/defs.h b/src/client/defs.h index 8c82035..f3032d8 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -61,10 +61,8 @@ struct entity m_eMuzzleflash; int m_iVMBones; - /* viewmodel shell ejection */ - float m_fEjectModel; - vector m_vecEjectPos; - vector m_vecEjectVel; + void(void) m_pEventCall; + float m_flEventTime; int m_iLastWeapon; int m_iOldWeapon; diff --git a/src/client/hud.qc b/src/client/hud.qc index a6f419e..4e9e5b2 100644 --- a/src/client/hud.qc +++ b/src/client/hud.qc @@ -686,28 +686,75 @@ string g_specmodes[] = { "Third Person", "First Person" }; + +#define SPEC_SEP_COL [0.204,0.196,0.114] +#define SPEC_FG_COL [0.561,0.561,0.212] void HUD_DrawSpectator(void) { - // FIXME + vector vecPos; + float flSep; + string strText; + int iMinutes, iSeconds; + Textmenu_Draw(); Obituary_Draw(); - HUD_DrawTimer(1); Textmenu_Draw(); + /* parts on top and bottom */ + drawfill(g_hudmins, [g_hudres[0], 32], [0,0,0], 0.75f, DRAWFLAG_NORMAL); + drawfill(g_hudmins + [0, g_hudres[1]-32], [g_hudres[0], 32], [0,0,0], 0.75f, DRAWFLAG_NORMAL); + + /* tracking player box */ + drawrect(g_hudmins + [(g_hudres[0] / 2) - 111, g_hudres[1]-26], [222,20], 1.0f, SPEC_SEP_COL, 1.0f, DRAWFLAG_NORMAL); spectator spec = (spectator)pSeat->m_ePlayer; - drawfont = FONT_20; - vector vecPos; - string strText; + strText = strcat(HUD_GetChatColorHEX(getplayerkeyfloat(spec.spec_ent - 1, "*team")), getplayerkeyvalue(spec.spec_ent - 1, "name")); + vecPos[0] = g_hudmins[0] + (g_hudres[0] / 2) - (stringwidth(strText, TRUE, [12,12]) / 2); + vecPos[1] = g_hudres[1]-21; + drawstring(vecPos, strText, [12,12], [1,1,1], 1.0f, DRAWFLAG_NORMAL); - strText = sprintf("Tracking: %s", getplayerkeyvalue(spec.spec_ent - 1, "name")); - vecPos[0] = g_hudmins[0] + (g_hudres[0] / 2) - (stringwidth(strText, TRUE, [20,20]) / 2); - vecPos[1] = g_hudmins[1] + g_hudres[1] - 60; - drawstring(vecPos, strText, [20,20], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE); + /* tracking mode box */ + drawrect(g_hudmins + [(g_hudres[0] / 2) + 128, g_hudres[1]-26], [172,20], 1.0f, SPEC_SEP_COL, 1.0f, DRAWFLAG_NORMAL); + strText = g_specmodes[spec.spec_mode]; + vecPos[0] = (g_hudmins[0] + (g_hudres[0] / 2) + 214) - (stringwidth(strText, TRUE, [12,12]) / 2); + vecPos[1] = g_hudres[1]-21; + drawstring(vecPos, strText, [12,12], SPEC_FG_COL, 1.0f, DRAWFLAG_NORMAL); - strText = sprintf("Mode: %s", g_specmodes[spec.spec_mode]); - vecPos[0] = g_hudmins[0] + (g_hudres[0] / 2) - (stringwidth(strText, TRUE, [20,20]) / 2); - vecPos[1] = g_hudmins[1] + g_hudres[1] - 40; - drawstring(vecPos, strText, [20,20], [1,1,1], 1.0f, DRAWFLAG_ADDITIVE); + /* money */ + strText = sprintf("$ %i", getstati(STAT_MONEY)); + flSep = stringwidth(strText, TRUE, [12,12]); + + if (flSep < 42) + flSep = 42; + + flSep = g_hudmins[0] + (g_hudres[0] - flSep) - 10; + + vecPos[0] = flSep + 8; + vecPos[1] = g_hudmins[1] + 3; + drawstring(vecPos, strText, [12,12], SPEC_FG_COL, 1.0f, DRAWFLAG_NORMAL); + + /* score/money separator */ + drawfill([flSep,1], [4,30], SPEC_SEP_COL, 1.0f, DRAWFLAG_NORMAL); + + /* team scores */ + drawfont = FONT_CON; + strText = sprintf("Terrorist Forces: %s", serverkey("teamscore_1")); + vecPos[0] = flSep - stringwidth(strText, TRUE, [12,12]) - 2; + vecPos[1] = g_hudmins[1] + 3; + drawstring(vecPos, strText, [12,12], SPEC_FG_COL, 1.0f, DRAWFLAG_NORMAL); + + strText = sprintf("CT Forces: %s", serverkey("teamscore_2")); + vecPos[0] = flSep - stringwidth(strText, TRUE, [12,12]) - 2; + vecPos[1] = g_hudmins[1] + 16; + drawstring(vecPos, strText, [12,12], SPEC_FG_COL, 1.0f, DRAWFLAG_NORMAL); + + /* time display */ + drawpic([flSep + 8, 15], "gfx/vgui/640_timer", [14, 14], [1,1,1], 1.0f, DRAWFLAG_NORMAL); + iMinutes = getstatf(STAT_GAMETIME) / 60; + iSeconds = getstatf(STAT_GAMETIME) - 60 * iMinutes; + strText = sprintf("%i:%02i", iMinutes, iSeconds); + vecPos[0] = flSep + 8 + 17; + vecPos[1] = g_hudmins[1] + 17; + drawstring(vecPos, strText, [12,12], SPEC_FG_COL, 1.0f, DRAWFLAG_NORMAL); } diff --git a/src/server/server.qc b/src/server/server.qc index 833f29a..a3ac87b 100644 --- a/src/server/server.qc +++ b/src/server/server.qc @@ -41,6 +41,9 @@ void Game_Worldspawn(void) Sound_Precache("buy.kevlar"); Sound_Precache("buy.weapon"); Sound_Precache("buy.ammo"); + Sound_Precache("player.headshot"); + Sound_Precache("player.hitarmor"); + Sound_Precache("player.headshotarmor"); /* some Counter-Strike maps do not have weapon pickups, so we want to * precache these regardless in case of someone dropping a weapon, diff --git a/src/shared/animations.qc b/src/shared/animations.qc index 83e7422..0b064c1 100755 --- a/src/shared/animations.qc +++ b/src/shared/animations.qc @@ -46,7 +46,7 @@ depending on what the player is doing ================= */ void Animation_PlayerUpdate(void) { - self.basebone = cvar("spinebone"); // gettagindex(self, "Bip01 Spine"); + self.basebone = 39; if (self.baseframe_time < time) { base_player pl = (base_player)self; diff --git a/src/shared/player.h b/src/shared/player.h index 2199bc8..8141f5f 100644 --- a/src/shared/player.h +++ b/src/shared/player.h @@ -225,29 +225,6 @@ void player::ReceiveEntity(float new) { float fl; - if (new == FALSE) { - /* Go through all the physics code between the last received frame - * and the newest frame and keep the changes this time around instead - * of rolling back, because we'll apply the new server-verified values - * right after anyway. */ - /* FIXME: splitscreen */ - if (entnum == player_localentnum) { - /* FIXME: splitscreen */ - pSeat = &g_seats[0]; - - for (int i = sequence+1; i <= servercommandframe; i++) { - /* ...maybe the input state is too old? */ - if (!getinputstate(i)) { - break; - } - input_sequence = i; - PMove_Run(); - } - - /* any differences in things that are read below are now - * officially from prediction misses. */ - } - } /* seed for our prediction table */ sequence = servercommandframe; diff --git a/src/shared/w_ak47.qc b/src/shared/w_ak47.qc index bfc2b9c..53dc210 100644 --- a/src/shared/w_ak47.qc +++ b/src/shared/w_ak47.qc @@ -27,6 +27,38 @@ Terrorists only weapon */ +#ifdef CLIENT +void w_rifle_ejectshell(void) +{ + static void w_rifle_ejectshell_death(void) { + remove(self); + } + static void w_rifle_ejectshell_touch(void) { + if (other == world) + Sound_Play(self, CHAN_BODY, "modelevent_shell.land"); + } + entity eShell = spawn(); + setmodel(eShell, "models/rshell.mdl"); + eShell.solid = SOLID_BBOX; + eShell.movetype = MOVETYPE_BOUNCE; + eShell.drawmask = MASK_ENGINE; + eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0]; + eShell.velocity = pSeat->m_vecPredictedVelocity; + + makevectors(pSeat->m_eViewModel.angles); + eShell.velocity += (v_forward * 0); + eShell.velocity += (v_right * -80); + eShell.velocity += (v_up * 80); + eShell.touch = w_rifle_ejectshell_touch; + + eShell.avelocity = [0,45,900]; + eShell.think = w_rifle_ejectshell_death; + eShell.nextthink = time + 2.5f; + setsize(eShell, [0,0,0], [0,0,0]); + setorigin(eShell, gettaginfo(pSeat->m_eViewModel, pSeat->m_iVMBones + 1)); +} +#endif + enum { AK47_IDLE, @@ -44,6 +76,7 @@ w_ak47_precache(void) Sound_Precache("weapon_ak47.fire"); precache_model("models/w_ak47.mdl"); #else + Sound_Precache("modelevent_shell.land"); precache_model("models/v_ak47.mdl"); precache_model("models/p_ak47.mdl"); #endif @@ -126,7 +159,7 @@ w_ak47_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_aug.qc b/src/shared/w_aug.qc index a5fd858..6a10302 100644 --- a/src/shared/w_aug.qc +++ b/src/shared/w_aug.qc @@ -126,7 +126,7 @@ w_aug_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_awp.qc b/src/shared/w_awp.qc index b0a2401..9096840 100644 --- a/src/shared/w_awp.qc +++ b/src/shared/w_awp.qc @@ -26,6 +26,38 @@ Price: $4750 */ +#ifdef CLIENT +void w_sniper_ejectshell(void) +{ + static void w_sniper_ejectshelldeath(void) { + remove(self); + } + static void w_sniper_ejectshell_touch(void) { + if (other == world) + Sound_Play(self, CHAN_BODY, "modelevent_shell.land"); + } + entity eShell = spawn(); + setmodel(eShell, "models/rshell_big.mdl"); + eShell.solid = SOLID_BBOX; + eShell.movetype = MOVETYPE_BOUNCE; + eShell.drawmask = MASK_ENGINE; + eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0]; + eShell.velocity = pSeat->m_vecPredictedVelocity; + + makevectors(pSeat->m_eViewModel.angles); + eShell.velocity += (v_forward * 0); + eShell.velocity += (v_right * -80); + eShell.velocity += (v_up * 100); + eShell.touch = w_sniper_ejectshell_touch; + + eShell.avelocity = [0,45,900]; + eShell.think = w_sniper_ejectshelldeath; + eShell.nextthink = time + 2.5f; + setsize(eShell, [0,0,0], [0,0,0]); + setorigin(eShell, gettaginfo(pSeat->m_eViewModel, pSeat->m_iVMBones + 1)); +} +#endif + enum { AWP_IDLE, @@ -195,6 +227,7 @@ w_awp_primary(void) Weapons_ViewAnimation(AWP_SHOOT3); break; } + View_AddEvent(w_sniper_ejectshell, 0.9f); #else TraceAttack_SetPenetrationPower(2); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 115, [accuracy,accuracy], WEAPON_AWP); diff --git a/src/shared/w_deagle.qc b/src/shared/w_deagle.qc index daeddad..33d6f33 100644 --- a/src/shared/w_deagle.qc +++ b/src/shared/w_deagle.qc @@ -26,6 +26,38 @@ Price: $650 */ +#ifdef CLIENT +void w_pistol_ejectshell(void) +{ + static void w_pistol_ejectshell_death(void) { + remove(self); + } + static void w_pistol_ejectshell_touch(void) { + if (other == world) + Sound_Play(self, CHAN_BODY, "modelevent_shell.land"); + } + entity eShell = spawn(); + setmodel(eShell, "models/pshell.mdl"); + eShell.solid = SOLID_BBOX; + eShell.movetype = MOVETYPE_BOUNCE; + eShell.drawmask = MASK_ENGINE; + eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0]; + eShell.velocity = pSeat->m_vecPredictedVelocity; + + makevectors(pSeat->m_eViewModel.angles); + eShell.velocity += (v_forward * 0); + eShell.velocity += (v_right * -80); + eShell.velocity += (v_up * 100); + eShell.touch = w_pistol_ejectshell_touch; + + eShell.avelocity = [0,45,900]; + eShell.think = w_pistol_ejectshell_death; + eShell.nextthink = time + 2.5f; + setsize(eShell, [0,0,0], [0,0,0]); + setorigin(eShell, gettaginfo(pSeat->m_eViewModel, pSeat->m_iVMBones + 1)); +} +#endif + enum { DEAGLE_IDLE, @@ -129,7 +161,6 @@ w_deagle_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); if (pl.deagle_mag <= 0) { Weapons_ViewAnimation(DEAGLE_SHOOT_EMPTY); @@ -144,6 +175,7 @@ w_deagle_primary(void) break; } } + View_AddEvent(w_pistol_ejectshell, 0.0f); #else TraceAttack_SetPenetrationPower(1); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 54, [accuracy,accuracy], WEAPON_DEAGLE); diff --git a/src/shared/w_elites.qc b/src/shared/w_elites.qc index d68fe0a..7427db0 100644 --- a/src/shared/w_elites.qc +++ b/src/shared/w_elites.qc @@ -26,6 +26,48 @@ Price: $1000 */ +#ifdef CLIENT +void w_elites_ejectshell(int side) +{ + static void w_elites_ejectshell_death(void) { + remove(self); + } + static void w_elites_ejectshell_touch(void) { + if (other == world) + Sound_Play(self, CHAN_BODY, "modelevent_shell.land"); + } + entity eShell = spawn(); + setmodel(eShell, "models/pshell.mdl"); + eShell.solid = SOLID_BBOX; + eShell.movetype = MOVETYPE_BOUNCE; + eShell.drawmask = MASK_ENGINE; + eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0]; + eShell.velocity = pSeat->m_vecPredictedVelocity; + + makevectors(pSeat->m_eViewModel.angles); + eShell.velocity += (v_forward * 0); + eShell.velocity += (v_right * -80); + eShell.velocity += (v_up * 100); + eShell.touch = w_elites_ejectshell_touch; + + eShell.avelocity = [0,45,900]; + eShell.think = w_elites_ejectshell_death; + eShell.nextthink = time + 2.5f; + setsize(eShell, [0,0,0], [0,0,0]); + setorigin(eShell, gettaginfo(pSeat->m_eViewModel, pSeat->m_iVMBones + 1 + side)); +} + +void w_pistol_ejectshell_left(void) +{ + w_elites_ejectshell(1); +} + +void w_pistol_ejectshell_right(void) +{ + w_elites_ejectshell(0); +} +#endif + enum { ELITES_IDLE, @@ -144,7 +186,7 @@ w_elites_primary(void) int r = (float)input_sequence % 5; if (pl.mode_temp) { - View_EjectShellAttachment(SHELL_PISTOL, 1, [0, -80, 100]); + View_AddEvent(w_pistol_ejectshell_left, 0.0f); if (pl.elites_mag <= 0) { Weapons_ViewAnimation(ELITES_SHOOT_LEFTLAST); @@ -168,7 +210,7 @@ w_elites_primary(void) } } } else { - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, 80, 100]); + View_AddEvent(w_pistol_ejectshell_right, 0.0f); if (pl.elites_mag <= 0) { Weapons_ViewAnimation(ELITES_SHOOT_RIGHTLAST); } else { diff --git a/src/shared/w_fiveseven.qc b/src/shared/w_fiveseven.qc index 785e63a..e99f229 100644 --- a/src/shared/w_fiveseven.qc +++ b/src/shared/w_fiveseven.qc @@ -129,7 +129,6 @@ w_fiveseven_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); if (pl.fiveseven_mag <= 0) { Weapons_ViewAnimation(FIVESEVEN_SHOOT_EMPTY); @@ -144,6 +143,7 @@ w_fiveseven_primary(void) break; } } + View_AddEvent(w_pistol_ejectshell, 0.0f); #else TraceAttack_SetPenetrationPower(0); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 25, [accuracy,accuracy], WEAPON_FIVESEVEN); diff --git a/src/shared/w_g3sg1.qc b/src/shared/w_g3sg1.qc index cfc1cf9..6a7aa0d 100644 --- a/src/shared/w_g3sg1.qc +++ b/src/shared/w_g3sg1.qc @@ -124,7 +124,7 @@ w_g3sg1_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); int r = (float)input_sequence % 2; switch (r) { diff --git a/src/shared/w_glock18.qc b/src/shared/w_glock18.qc index ef5f0e9..69988d1 100644 --- a/src/shared/w_glock18.qc +++ b/src/shared/w_glock18.qc @@ -159,7 +159,7 @@ w_glock18_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); + View_AddEvent(w_pistol_ejectshell, 0.0f); #else if (pl.flags & FL_CROUCHING) diff --git a/src/shared/w_m3.qc b/src/shared/w_m3.qc index 4f32215..403f65a 100644 --- a/src/shared/w_m3.qc +++ b/src/shared/w_m3.qc @@ -26,6 +26,39 @@ Price: $1700 */ +#ifdef CLIENT +void w_m3_ejectshell(void) +{ + static void w_m3_ejectshell_death(void) { + remove(self); + } + static void w_m3_ejectshell_touch(void) { + if (other == world) + Sound_Play(self, CHAN_BODY, "modelevent_shotgunshell.land"); + } + entity eShell = spawn(); + setmodel(eShell, "models/shotgunshell.mdl"); + eShell.solid = SOLID_BBOX; + eShell.movetype = MOVETYPE_BOUNCE; + eShell.drawmask = MASK_ENGINE; + eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1] + 20, 0]; + eShell.velocity = pSeat->m_vecPredictedVelocity; + + makevectors(pSeat->m_eViewModel.angles); + eShell.velocity += (v_forward * 0); + eShell.velocity += (v_right * -80); + eShell.velocity += (v_up * 100); + eShell.touch = w_m3_ejectshell_touch; + + eShell.avelocity = [0,45,900]; + eShell.think = w_m3_ejectshell_death; + eShell.renderflags |= RF_DEPTHHACK; + eShell.nextthink = time + 2.5f; + setsize(eShell, [0,0,0], [0,0,0]); + setorigin(eShell, pSeat->m_eViewModel.origin + (v_forward * 10) + (v_right * 10) + (v_up * -8)); +} +#endif + enum { M3_IDLE, @@ -54,6 +87,7 @@ w_m3_precache(void) #else precache_model("models/v_m3.mdl"); precache_model("models/p_m3.mdl"); + Sound_Precache("modelevent_shotgunshell.land"); #endif } @@ -158,6 +192,10 @@ w_m3_primary(void) break; } +#ifdef CLIENT + View_AddEvent(w_m3_ejectshell, 0.6f); +#endif + pl.w_attack_next = 1.0f; pl.w_idle_next = pl.w_attack_next; } diff --git a/src/shared/w_m4a1.qc b/src/shared/w_m4a1.qc index 873c2b0..4c0edd2 100644 --- a/src/shared/w_m4a1.qc +++ b/src/shared/w_m4a1.qc @@ -146,7 +146,7 @@ w_m4a1_primary(void) } else { View_SetMuzzleflash(MUZZLE_RIFLE); } - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); /* this stuff is predicted */ int r = (float)input_sequence % 3; diff --git a/src/shared/w_mac10.qc b/src/shared/w_mac10.qc index 4cc63b7..e96da3f 100644 --- a/src/shared/w_mac10.qc +++ b/src/shared/w_mac10.qc @@ -125,7 +125,6 @@ w_mac10_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { @@ -139,6 +138,7 @@ w_mac10_primary(void) Weapons_ViewAnimation(MAC10_SHOOT3); break; } + View_AddEvent(w_pistol_ejectshell, 0.0f); #else TraceAttack_SetPenetrationPower(0); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 29, [accuracy,accuracy], WEAPON_MAC10); diff --git a/src/shared/w_mp5.qc b/src/shared/w_mp5.qc index b33b327..ad78465 100644 --- a/src/shared/w_mp5.qc +++ b/src/shared/w_mp5.qc @@ -125,7 +125,6 @@ w_mp5_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { @@ -139,6 +138,7 @@ w_mp5_primary(void) Weapons_ViewAnimation(MP5_SHOOT3); break; } + View_AddEvent(w_pistol_ejectshell, 0.0f); #else TraceAttack_SetPenetrationPower(0); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_MP5); diff --git a/src/shared/w_p228.qc b/src/shared/w_p228.qc index 24b4711..1335601 100644 --- a/src/shared/w_p228.qc +++ b/src/shared/w_p228.qc @@ -129,7 +129,6 @@ w_p228_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); if (pl.p228_mag <= 0) { Weapons_ViewAnimation(P228_SHOOT_EMPTY); @@ -147,6 +146,7 @@ w_p228_primary(void) break; } } + View_AddEvent(w_pistol_ejectshell, 0.0f); #else TraceAttack_SetPenetrationPower(0); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [accuracy,accuracy], WEAPON_P228); diff --git a/src/shared/w_p90.qc b/src/shared/w_p90.qc index 0291087..bd3e4a0 100644 --- a/src/shared/w_p90.qc +++ b/src/shared/w_p90.qc @@ -125,7 +125,7 @@ w_p90_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); + View_AddEvent(w_pistol_ejectshell, 0.0f); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_para.qc b/src/shared/w_para.qc index 2d7241e..9eff45e 100644 --- a/src/shared/w_para.qc +++ b/src/shared/w_para.qc @@ -124,7 +124,7 @@ w_para_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); int r = (float)input_sequence % 2; switch (r) { diff --git a/src/shared/w_scout.qc b/src/shared/w_scout.qc index dac8a93..34bf9ba 100644 --- a/src/shared/w_scout.qc +++ b/src/shared/w_scout.qc @@ -203,6 +203,10 @@ w_scout_primary(void) Sound_Play(pl, CHAN_WEAPON, "weapon_scout.fire"); #endif +#ifdef CLIENT + View_AddEvent(w_rifle_ejectshell, 0.5f); +#endif + pl.w_attack_next = 1.25f; pl.w_idle_next = pl.w_attack_next; } diff --git a/src/shared/w_sg550.qc b/src/shared/w_sg550.qc index 7470682..28a887e 100644 --- a/src/shared/w_sg550.qc +++ b/src/shared/w_sg550.qc @@ -124,7 +124,7 @@ w_sg550_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); int r = (float)input_sequence % 2; switch (r) { diff --git a/src/shared/w_sg552.qc b/src/shared/w_sg552.qc index 7c775be..2038cf6 100644 --- a/src/shared/w_sg552.qc +++ b/src/shared/w_sg552.qc @@ -125,7 +125,7 @@ w_sg552_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); + View_AddEvent(w_rifle_ejectshell, 0.0f); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_tmp.qc b/src/shared/w_tmp.qc index bad10a0..0b0d064 100644 --- a/src/shared/w_tmp.qc +++ b/src/shared/w_tmp.qc @@ -127,7 +127,7 @@ w_tmp_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); + View_AddEvent(w_pistol_ejectshell, 0.0f); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_ump45.qc b/src/shared/w_ump45.qc index f61cfd6..dbf250f 100644 --- a/src/shared/w_ump45.qc +++ b/src/shared/w_ump45.qc @@ -127,7 +127,7 @@ w_ump45_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); + View_AddEvent(w_pistol_ejectshell, 0.0f); #else TraceAttack_SetPenetrationPower(0); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 30, [accuracy,accuracy], WEAPON_UMP45); diff --git a/src/shared/w_usp45.qc b/src/shared/w_usp45.qc index d0e6d86..2a76a55 100644 --- a/src/shared/w_usp45.qc +++ b/src/shared/w_usp45.qc @@ -155,7 +155,7 @@ w_usp45_primary(void) View_SetMuzzleflash(MUZZLE_SMALL); } - View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); + View_AddEvent(w_pistol_ejectshell, 0.0f); #else /* Different sounds without silencer */ if (pl.mode_usp45 == 1) { diff --git a/src/shared/w_xm1014.qc b/src/shared/w_xm1014.qc index 8be01de..7701c77 100644 --- a/src/shared/w_xm1014.qc +++ b/src/shared/w_xm1014.qc @@ -26,6 +26,38 @@ Price: $3000 */ +#ifdef CLIENT +void w_xm1014_ejectshell(void) +{ + static void w_xm1014_ejectshell_death(void) { + remove(self); + } + static void w_xm1014_ejectshell_touch(void) { + if (other == world) + Sound_Play(self, CHAN_BODY, "modelevent_shotgunshell.land"); + } + entity eShell = spawn(); + setmodel(eShell, "models/shotgunshell.mdl"); + eShell.solid = SOLID_BBOX; + eShell.movetype = MOVETYPE_BOUNCE; + eShell.drawmask = MASK_ENGINE; + eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0]; + eShell.velocity = pSeat->m_vecPredictedVelocity; + + makevectors(pSeat->m_eViewModel.angles); + eShell.velocity += (v_forward * 0); + eShell.velocity += (v_right * 80); + eShell.velocity += (v_up * 100); + eShell.touch = w_xm1014_ejectshell_touch; + + eShell.avelocity = [0,45,900]; + eShell.think = w_xm1014_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 * -8)); +} +#endif + enum { XM1014_IDLE, @@ -160,6 +192,10 @@ w_xm1014_primary(void) break; } +#ifdef CLIENT + View_AddEvent(w_xm1014_ejectshell, 0.0f); +#endif + pl.w_attack_next = 0.25f; pl.w_idle_next = pl.w_attack_next; } diff --git a/zpak001.pk3dir/sound/modelevent_shell.sndshd b/zpak001.pk3dir/sound/modelevent_shell.sndshd deleted file mode 100644 index ac6f4b8..0000000 --- a/zpak001.pk3dir/sound/modelevent_shell.sndshd +++ /dev/null @@ -1,12 +0,0 @@ -modelevent_shell.eject -{ - sample misc/null.wav -} - -modelevent_shell.land -{ - attenuation idle - sample player/pl_shell1.wav - sample player/pl_shell2.wav - sample player/pl_shell3.wav -} diff --git a/zpak001.pk3dir/sound/player.sndshd b/zpak001.pk3dir/sound/player.sndshd index 9170904..11df259 100644 --- a/zpak001.pk3dir/sound/player.sndshd +++ b/zpak001.pk3dir/sound/player.sndshd @@ -4,21 +4,15 @@ player.headshot sample player/headshot2.wav sample player/headshot3.wav } + player.headshotarmor { sample player/bhit_helmet-1.wav } -player.hitbody -{ - sample player/pl_pain2.wav - sample player/pl_pain4.wav - sample player/pl_die1.wav -} - player.hitarmor { - sample player/bhitkevlar-1.wav + sample player/bhit_kevlar-1.wav } player.fall @@ -26,10 +20,12 @@ player.fall sample player/pl_pain2.wav sample player/pl_pain7.wav } + player.lightfall { sample player/pl_fallpain1.wav } + player.die { sample player/die1.wav @@ -37,19 +33,23 @@ player.die sample player/die3.wav sample player/death6.wav } + player.gasplight { sample misc/null.wav } + player.gaspheavy { sample misc/null.wav } + player.waterexit { sample player/pl_wade1.wav sample player/pl_wade3.wav } + player.waterenter { sample player/pl_wade2.wav