Add more weapon weights and remove the knife when empty.

This commit is contained in:
Marco Cawthorne 2024-02-28 22:46:56 -08:00
parent 42e7b79622
commit ef668a19d4
Signed by: eukara
GPG key ID: CE2032F0A2882A22
10 changed files with 26 additions and 10 deletions

View file

@ -213,7 +213,7 @@ weapon_t w_broom =
.id = ITEM_BROOM,
.slot = 0,
.slot_pos = 0,
.weight = -10,
.weight = 1,
.draw = w_broom_draw,
.holster = w_broom_holster,
.primary = w_broom_primary,

View file

@ -349,7 +349,7 @@ weapon_t w_forks =
.deathmsg = w_forks_deathmsg,
.aimanim = w_forks_aimanim,
.hudpic = w_forks_hudpic,
.weight = -10,
.weight = 3,
.isempty = w_forks_isempty,
.type = w_forks_type
};

View file

@ -252,7 +252,7 @@ weapon_t w_fryingpan =
.deathmsg = w_fryingpan_deathmsg,
.aimanim = w_fryingpan_aimanim,
.hudpic = w_fryingpan_hudpic,
.weight = -10,
.weight = 2,
.isempty = w_fryingpan_isempty,
.type = w_fryingpan_type
};

View file

@ -267,7 +267,7 @@ weapon_t w_glove =
.deathmsg = w_glove_deathmsg,
.aimanim = w_glove_aimanim,
.hudpic = w_glove_hudpic,
.weight = -10,
.weight = -1,
.isempty = w_glove_isempty,
.type = w_glove_type
};

View file

@ -287,7 +287,7 @@ weapon_t w_hairspray =
.deathmsg = w_hairspray_deathmsg,
.aimanim = w_hairspray_aimanim,
.hudpic = w_hairspray_hudpic,
.weight = -10,
.weight = 8,
.isempty = w_hairspray_isempty,
.type = w_hairspray_type
};

View file

@ -94,6 +94,12 @@ w_knife_draw(player pl)
{
Weapons_SetModel("models/v_knife.mdl");
Weapons_ViewAnimation(pl, KNIFE_DRAW);
#ifdef SERVER
if (!pl.ammo_knives) {
Weapons_RemoveItem(pl, WEAPON_KNIFE);
}
#endif
}
void
@ -181,6 +187,16 @@ w_knife_primary(player pl)
void
w_knife_release(player pl)
{
if (pl.w_idle_next > 0.0) {
if (pl.w_attack_next <= 0.0) {
#ifdef SERVER
if (!pl.ammo_knives) {
Weapons_RemoveItem(pl, WEAPON_KNIFE);
}
#endif
}
return;
}
if (pl.w_idle_next > 0.0) {
return;
@ -302,7 +318,7 @@ weapon_t w_knife =
.deathmsg = w_knife_deathmsg,
.aimanim = w_knife_aimanim,
.hudpic = w_knife_hudpic,
.weight = -10,
.weight = 5,
.isempty = w_knife_isempty,
.type = w_knife_type
};

View file

@ -281,7 +281,7 @@ weapon_t w_lego =
.deathmsg = w_lego_deathmsg,
.aimanim = w_lego_aimanim,
.hudpic = w_lego_hudpic,
.weight = -10,
.weight = 7,
.isempty = w_lego_isempty,
.type = w_lego_type
};

View file

@ -290,7 +290,7 @@ weapon_t w_legolauncher =
.deathmsg = w_legolauncher_deathmsg,
.aimanim = w_legolauncher_aimanim,
.hudpic = w_legolauncher_hudpic,
.weight = -10,
.weight = 9,
.isempty = w_legolauncher_isempty,
.type = w_legolauncher_type
};

View file

@ -295,7 +295,7 @@ weapon_t w_machette =
.deathmsg = w_machette_deathmsg,
.aimanim = w_machette_aimanim,
.hudpic = w_machette_hudpic,
.weight = -10,
.weight = -1,
.isempty = w_machette_isempty,
.type = w_machette_type
};

View file

@ -346,7 +346,7 @@ weapon_t w_sodalauncher = {
.deathmsg = w_sodalauncher_deathmsg,
.aimanim = w_sodalauncher_aimanim,
.hudpic = w_sodalauncher_hudpic,
.weight = -10,
.weight = 6,
.isempty = w_sodalauncher_isempty,
.type = w_sodalauncher_type
};