Use the new View_AddEvent() for shell ejections

This commit is contained in:
Marco Cawthorne 2021-03-29 21:54:53 +02:00
parent 09417b5443
commit 7bc7388125
29 changed files with 311 additions and 80 deletions

View file

@ -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;

View file

@ -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);
}

View file

@ -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,

View file

@ -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;

View file

@ -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;

View file

@ -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) {

View file

@ -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) {

View file

@ -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);

View file

@ -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);

View file

@ -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 {

View file

@ -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);

View file

@ -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) {

View file

@ -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)

View file

@ -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;
}

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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) {

View file

@ -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) {

View file

@ -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;
}

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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);

View file

@ -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) {

View file

@ -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;
}

View file

@ -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
}

View file

@ -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