Gez
Why don't I have a custom title by now?!
Posts: 9166
Registered: 07-07 |
Weapons 8 and 9 are the chainsaw and supershotgun, presumably, following their order in the code:
code:
// The defined weapons,
// including a marker indicating
// user has not changed weapon.
typedef enum
{
wp_fist,
wp_pistol,
wp_shotgun,
wp_chaingun,
wp_missile,
wp_plasma,
wp_bfg,
wp_chainsaw,
wp_supershotgun,
NUMWEAPONS,
// No pending weapon change.
wp_nochange
} weapontype_t;
In vanilla Doom, when you have the chainsaw in your inventory and press the 1 key, you do not select the chainsaw: you still select the fist. But there is a hack to replace it with the chainsaw, unless you have the berserk item or you are already using the chainsaw.
code: if (newweapon == wp_fist
&& player->weaponowned[wp_chainsaw]
&& !(player->readyweapon == wp_chainsaw
&& player->powers[pw_strength]))
{
newweapon = wp_chainsaw;
}
In plain English: "If the fists are selected, and the player owns a chainsaw but does not have the berserk or is not already using a chainsaw, then replace the selection of the fists by that of the chainsaw."
Likewise for the supershotgun:
code: if ( (gamemode == commercial)
&& newweapon == wp_shotgun
&& player->weaponowned[wp_supershotgun]
&& player->readyweapon != wp_supershotgun)
{
newweapon = wp_supershotgun;
}
"If we're in Doom II and the player selects the shotgun but has a supershotgun he isn't currently using, select the supershotgun instead."
|