Go over all the weapons, make sure the crosshairs are consistent - fix some sound issues with WEAPON_ASSCAN and set the muzzleflashes to something sensible.

Depending on which TFC version you grew up with, you may remember different muzzleflashes - don't file reports about this sort of thing yet.
This commit is contained in:
Marco Cawthorne 2023-01-18 17:04:46 -08:00
parent 5c08ab38c4
commit 8cf8cab514
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
16 changed files with 47 additions and 69 deletions

View File

@ -25,3 +25,5 @@ var string g_tfchud4_spr;
var string g_tfchud5_spr;
var string g_tfchud6_spr;
var string g_tfchud7_spr;
var int MUZZLE_ROUND;

View File

@ -67,4 +67,5 @@ ClientGame_RendererRestart(string rstr)
MUZZLE_RIFLE = (int)getmodelindex("sprites/muzzleflash1.spr");
MUZZLE_SMALL = (int)getmodelindex("sprites/muzzleflash2.spr");
MUZZLE_WEIRD = (int)getmodelindex("sprites/muzzleflash3.spr");
MUZZLE_ROUND = (int)getmodelindex("sprites/muzzleflash.spr");
}

View File

@ -198,7 +198,6 @@ player::PredictPreFrame(void)
{
/* the generic client attributes */
NSClientPlayer::PredictPreFrame();
SAVE_STATE(classtype);
SAVE_STATE(anim_top);
SAVE_STATE(anim_top_delay);
@ -219,6 +218,7 @@ player::PredictPreFrame(void)
SAVE_STATE(m_iAmmoMedikit);
SAVE_STATE(mode_tempstate);
SAVE_STATE(classtype);
}
/*
@ -233,7 +233,6 @@ player::PredictPostFrame(void)
{
/* the generic client attributes */
NSClientPlayer::PredictPostFrame();
ROLL_BACK(classtype);
ROLL_BACK(anim_top);
ROLL_BACK(anim_top_delay);
@ -254,6 +253,7 @@ player::PredictPostFrame(void)
ROLL_BACK(m_iAmmoMedikit);
ROLL_BACK(mode_tempstate);
ROLL_BACK(classtype);
}
#else
@ -312,13 +312,13 @@ player::EvaluateEntity(void)
SAVE_STATE(m_iAmmoMedikit);
SAVE_STATE(mode_tempstate);
SAVE_STATE(classtype);
SAVE_STATE(anim_top);
SAVE_STATE(anim_top_delay);
SAVE_STATE(anim_top_time);
SAVE_STATE(anim_bottom);
SAVE_STATE(anim_bottom_time);
SAVE_STATE(classtype);
}
void

View File

@ -53,7 +53,6 @@ player::Physics_Jump(void)
float
player::Physics_MaxSpeed(void)
{
float maxspeed = serverkeyfloat("phy_maxspeed");
float desiredspeed;
/* values courtesy of https://wiki.teamfortress.com/ */
@ -92,5 +91,5 @@ player::Physics_MaxSpeed(void)
if (GetFlags() & FL_CROUCHING)
desiredspeed /= 3;
return min(desiredspeed, maxspeed);
return desiredspeed;
}

View File

@ -67,10 +67,13 @@ w_asscan_precache(void)
Sound_Precache("weapon_asscan.reload");
Sound_Precache("weapon_asscan.spindown");
Sound_Precache("weapon_asscan.spinup");
#endif
precache_model("models/v_tfac.mdl");
precache_model("models/w_tfac.mdl");
precache_model("models/p_tfac.mdl");
#endif
#ifdef CLIENT
precache_model("models/v_tfac.mdl");
#endif
}
int
@ -132,9 +135,7 @@ w_asscan_release(player pl)
/* end firing */
if (pl.mode_tempstate == 1) {
pl.mode_tempstate = 0;
#ifdef SERVER
Sound_Play(pl, CHAN_WEAPON, "weapon_asscan.spindown");
#endif
Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.spindown");
Weapons_ViewAnimation(pl, ASSCAN_SPINDOWN);
pl.w_attack_next = 1.0f;
pl.w_idle_next = pl.w_attack_next;
@ -158,16 +159,16 @@ w_asscan_primary(player pl)
return;
/* ammo check */
if (pl.m_iAmmoShells <= 0)
if (pl.m_iAmmoShells <= 0) {
w_asscan_release(pl);
return;
}
/* spin up first */
if (pl.mode_tempstate == 0) {
pl.mode_tempstate = 1;
Weapons_ViewAnimation(pl, ASSCAN_SPINUP);
#ifdef SERVER
Sound_Play(pl, CHAN_WEAPON, "weapon_asscan.spinup");
#endif
Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.spinup");
pl.w_attack_next = 0.5f;
pl.w_idle_next = pl.w_attack_next;
return;
@ -176,13 +177,13 @@ w_asscan_primary(player pl)
Weapons_ViewAnimation(pl, ASSCAN_FIRE);
Weapons_ViewPunchAngle(pl, [random(-2, 2),0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.fire");
#ifdef CLIENT
View_AddEvent(w_asscan_ejectshell, 0.0f);
View_SetMuzzleflash(MUZZLE_RIFLE);
View_SetMuzzleflash(MUZZLE_WEIRD);
#else
TraceAttack_FireBullets(1, Weapons_GetCameraPos(pl), 8, [0.15,0.15], WEAPON_ASSCAN);
Sound_Play(pl, CHAN_WEAPON, "weapon_asscan.fire");
#endif
pl.w_attack_next = 0.1f;
@ -197,7 +198,7 @@ w_asscan_hud(player pl)
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
Cross_DrawSub(g_cross_spr, [24,24], [0.1875,0], [0.1875, 0.1875]);
Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]);
HUD_DrawAmmo2();
@ -254,7 +255,6 @@ w_asscan_hudpic(player pl, int selected, vector pos, float a)
int
w_asscan_isempty(player pl)
{
if (pl.m_iAmmoShells <= 0)
return 1;

View File

@ -90,7 +90,7 @@ w_autorifle_primary(player pl)
case AUTO_LAST:
Weapons_ViewAnimation(pl, SNIPER_AUTOFIRE);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_WEIRD);
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif
Weapons_Sound(pl, CHAN_WEAPON, "weapon_sniper.fire");
pl.w_attack_next = 0.1f;

View File

@ -101,16 +101,14 @@ w_dbs_primary(player pl)
case AUTO_FIRE_FAILED:
return;
break;
case AUTO_LAST:
case AUTO_FIRED:
pl.mag_dbs--;
Weapons_ViewAnimation(pl, DBS_FIRE1);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire");
pl.w_attack_next = 0.7f;
break;
case AUTO_LAST:
Weapons_ViewAnimation(pl, DBS_FIRE1);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_ROUND);
#endif
Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire");
pl.w_attack_next = 0.7f;
break;
@ -166,9 +164,7 @@ void
w_dbs_crosshair(player pl)
{
#ifdef CLIENT
static vector cross_pos;
cross_pos = (g_hudres / 2) + [-12,-12];
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]);
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];

View File

@ -159,9 +159,8 @@ void
w_flamer_crosshair(player pl)
{
#ifdef CLIENT
static vector cross_pos;
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [72/128,48/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]);
//Cross_DrawSub(g_cross_spr, [24,24], [72/128,48/128], [0.1875, 0.1875]);
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [0,96/128], [24/256, 24/128], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);

View File

@ -187,6 +187,8 @@ w_glauncher_postdraw(player pl)
#ifdef CLIENT
vector aicon_pos;
Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]);
/* ammo counters */
HUD_DrawAmmo1();
HUD_DrawAmmo2();

View File

@ -122,6 +122,9 @@ w_nailgun_primary(player pl)
}
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif
#ifndef CLIENT
Sound_Play(pl, CHAN_WEAPON, "weapon_nailgun.fire");
#endif

View File

@ -161,6 +161,8 @@ w_pipebomb_postdraw(player pl)
#ifdef CLIENT
vector aicon_pos;
Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]);
/* ammo counters */
HUD_DrawAmmo1();
HUD_DrawAmmo2();

View File

@ -181,21 +181,9 @@ void
w_rpg_hud(player pl)
{
#ifdef CLIENT
vector cross_pos;
vector aicon_pos;
/* crosshair/laser */
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
drawsubpic(
cross_pos,
[24,24],
g_cross_spr,
[0,0],
[0.1875, 0.1875],
[1,1,1],
1,
DRAWFLAG_NORMAL
);
Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]);
/* ammo counters */
HUD_DrawAmmo1();

View File

@ -90,13 +90,11 @@ w_sbs_primary(player pl)
case AUTO_FIRE_FAILED:
return;
break;
case AUTO_FIRED:
Weapons_ViewAnimation(pl, SBS_FIRE1);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire");
pl.w_attack_next = 0.5f;
break;
case AUTO_LAST:
case AUTO_FIRED:
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_ROUND);
#endif
Weapons_ViewAnimation(pl, SBS_FIRE1);
Weapons_ViewPunchAngle(pl, [-2,0,0]);
Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire");
@ -154,9 +152,7 @@ void
w_sbs_crosshair(player pl)
{
#ifdef CLIENT
static vector cross_pos;
cross_pos = (g_hudres / 2) + [-12,-12];
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]);
HUD_DrawAmmo1();
HUD_DrawAmmo2();
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];

View File

@ -92,7 +92,7 @@ w_sniper_primary(player pl)
w_baseauto_fire(pl, player::m_iAmmoShells, 8, [0,0]);
Weapons_ViewAnimation(pl, SNIPER_FIRE);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_WEIRD);
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif
Weapons_Sound(pl, CHAN_WEAPON, "weapon_sniper.fire");
pl.w_attack_next = 2.0f;

View File

@ -125,6 +125,9 @@ w_supernail_primary(player pl)
}
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
Weapons_ViewPunchAngle(pl, [-1,0,0]);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#endif
#ifndef CLIENT
Sound_Play(pl, CHAN_WEAPON, "weapon_nailgun.fire");
#endif
@ -142,22 +145,9 @@ void
w_supernail_hud(player pl)
{
#ifdef CLIENT
vector cross_pos;
vector aicon_pos;
/* crosshair/laser */
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
drawsubpic(
cross_pos,
[24,24],
g_cross_spr,
[0.1875,0],
[0.1875, 0.1875],
[1,1,1],
1.0f,
DRAWFLAG_NORMAL
);
Cross_DrawSub(g_cross_spr, [24,24], [0.1875,0], [0.1875, 0.1875]);
HUD_DrawAmmo2();
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];

View File

@ -1,6 +1,6 @@
weapon_asscan.fire
{
pitch 1.15
//pitch 1.15
sample weapons/asscan2.wav
}