WEAPON_SATCHEL: Draw satchel viewmodel again if there's no more satchels we can detonate.
This commit is contained in:
parent
120e6988c4
commit
b0dbd92aca
4 changed files with 16 additions and 13 deletions
|
@ -158,7 +158,6 @@ w_satchel_holster(player pl)
|
||||||
void
|
void
|
||||||
w_satchel_primary(player pl)
|
w_satchel_primary(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.w_attack_next) {
|
if (pl.w_attack_next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -184,6 +183,7 @@ w_satchel_primary(player pl)
|
||||||
s_satchel_drop(pl, pl.origin, throw);
|
s_satchel_drop(pl, pl.origin, throw);
|
||||||
pl.satchel_chg++;
|
pl.satchel_chg++;
|
||||||
pl.ammo_satchel--;
|
pl.ammo_satchel--;
|
||||||
|
pl.mode_tempstate = 1; /* mark us as having deployed something */
|
||||||
|
|
||||||
if (pl.flags & FL_CROUCHING)
|
if (pl.flags & FL_CROUCHING)
|
||||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTSQUEAK, 0.41f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOTSQUEAK, 0.41f);
|
||||||
|
@ -218,7 +218,6 @@ w_satchel_primary(player pl)
|
||||||
void
|
void
|
||||||
w_satchel_secondary(player pl)
|
w_satchel_secondary(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.w_attack_next) {
|
if (pl.w_attack_next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -245,9 +244,10 @@ w_satchel_secondary(player pl)
|
||||||
|
|
||||||
pl.satchel_chg++;
|
pl.satchel_chg++;
|
||||||
pl.ammo_satchel--;
|
pl.ammo_satchel--;
|
||||||
|
pl.mode_tempstate = 1; /* mark us as having deployed something */
|
||||||
|
|
||||||
pl.w_attack_next = 1.0f;
|
pl.w_attack_next = 1.0f;
|
||||||
pl.w_idle_next = 2.5f;
|
pl.w_idle_next = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -259,11 +259,19 @@ w_satchel_reload(player pl)
|
||||||
void
|
void
|
||||||
w_satchel_release(player pl)
|
w_satchel_release(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.w_idle_next > 0.0) {
|
if (pl.w_idle_next > 0.0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* keep track of the model via tempstates */
|
||||||
|
if (pl.satchel_chg < 1i && pl.mode_tempstate != 0) {
|
||||||
|
pl.mode_tempstate = 0;
|
||||||
|
Weapons_SetModel("models/v_satchel.mdl");
|
||||||
|
Weapons_ViewAnimation(pl, SATCHEL_DRAW);
|
||||||
|
pl.w_idle_next = 15.0f;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pl.satchel_chg <= 0) {
|
if (pl.satchel_chg <= 0) {
|
||||||
Weapons_ViewAnimation(pl, SATCHEL_FIDGET);
|
Weapons_ViewAnimation(pl, SATCHEL_FIDGET);
|
||||||
} else {
|
} else {
|
||||||
|
@ -321,7 +329,7 @@ w_satchel_type(player pl)
|
||||||
weapon_t w_satchel =
|
weapon_t w_satchel =
|
||||||
{
|
{
|
||||||
.name = "satchel",
|
.name = "satchel",
|
||||||
.id = ITEM_SATCHEL,
|
.id = ITEM_SATCHEL,
|
||||||
.slot = 4,
|
.slot = 4,
|
||||||
.slot_pos = 1,
|
.slot_pos = 1,
|
||||||
.weight = -20,
|
.weight = -20,
|
||||||
|
|
|
@ -124,7 +124,6 @@ int
|
||||||
w_shotgun_pickup(player pl, int new, int startammo)
|
w_shotgun_pickup(player pl, int new, int startammo)
|
||||||
{
|
{
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
|
|
||||||
if (new) {
|
if (new) {
|
||||||
pl.shotgun_mag = 8;
|
pl.shotgun_mag = 8;
|
||||||
return (1);
|
return (1);
|
||||||
|
@ -160,7 +159,6 @@ void w_shotgun_release(player pl);
|
||||||
void
|
void
|
||||||
w_shotgun_reload(player pl)
|
w_shotgun_reload(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.shotgun_mag >= 8) {
|
if (pl.shotgun_mag >= 8) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -308,7 +306,6 @@ w_shotgun_secondary(player pl)
|
||||||
void
|
void
|
||||||
w_shotgun_release(player pl)
|
w_shotgun_release(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* auto-reload if need be */
|
/* auto-reload if need be */
|
||||||
if (pl.w_attack_next <= 0.0)
|
if (pl.w_attack_next <= 0.0)
|
||||||
if (pl.mode_tempstate == SHOTTY_IDLE && pl.shotgun_mag == 0 && pl.ammo_buckshot > 0) {
|
if (pl.mode_tempstate == SHOTTY_IDLE && pl.shotgun_mag == 0 && pl.ammo_buckshot > 0) {
|
||||||
|
@ -416,7 +413,6 @@ w_shotgun_hudpic(player pl, int selected, vector pos, float a)
|
||||||
int
|
int
|
||||||
w_shotgun_isempty(player pl)
|
w_shotgun_isempty(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.shotgun_mag <= 0 && pl.ammo_buckshot <= 0)
|
if (pl.shotgun_mag <= 0 && pl.ammo_buckshot <= 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|
|
@ -213,14 +213,17 @@ void w_snark_primary(player pl)
|
||||||
pl.w_attack_next = 0.25f;
|
pl.w_attack_next = 0.25f;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void w_snark_secondary(player pl)
|
void w_snark_secondary(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void w_snark_reload(player pl)
|
void w_snark_reload(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void w_snark_release(player pl)
|
void w_snark_release(player pl)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
@ -298,7 +301,6 @@ void w_snark_hud(player pl)
|
||||||
void w_snark_hudpic(player pl, int selected, vector pos, float a)
|
void w_snark_hudpic(player pl, int selected, vector pos, float a)
|
||||||
{
|
{
|
||||||
#ifdef CLIENT
|
#ifdef CLIENT
|
||||||
|
|
||||||
if (selected) {
|
if (selected) {
|
||||||
drawsubpic(pos, [170,45], g_hud6_spr,
|
drawsubpic(pos, [170,45], g_hud6_spr,
|
||||||
[0,135/256], [170/256,45/256],
|
[0,135/256], [170/256,45/256],
|
||||||
|
|
|
@ -305,7 +305,6 @@ w_tripmine_primary(player pl)
|
||||||
void
|
void
|
||||||
w_tripmine_release(player pl)
|
w_tripmine_release(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.w_idle_next > 0.0) {
|
if (pl.w_idle_next > 0.0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -360,7 +359,6 @@ void
|
||||||
w_tripmine_hudpic(player pl, int selected, vector pos, float a)
|
w_tripmine_hudpic(player pl, int selected, vector pos, float a)
|
||||||
{
|
{
|
||||||
#ifdef CLIENT
|
#ifdef CLIENT
|
||||||
|
|
||||||
if (selected) {
|
if (selected) {
|
||||||
drawsubpic(pos, [170,45], g_hud6_spr, [0,90/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
drawsubpic(pos, [170,45], g_hud6_spr, [0,90/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -374,7 +372,6 @@ w_tripmine_hudpic(player pl, int selected, vector pos, float a)
|
||||||
int
|
int
|
||||||
w_tripmine_isempty(player pl)
|
w_tripmine_isempty(player pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pl.ammo_tripmine <= 0)
|
if (pl.ammo_tripmine <= 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue