diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-14 18:19:16 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-14 18:19:16 +0000 |
commit | 8760aefa6b0c601891cb580f638a31696ec90107 (patch) | |
tree | 30d1f4c34cf1931d06d94c674341c3bba17f0299 /crawl-ref/source/item_use.cc | |
parent | 866686d5df24c38a2838f6f06ef9186b2c392a1c (diff) | |
download | crawl-ref-8760aefa6b0c601891cb580f638a31696ec90107.tar.gz crawl-ref-8760aefa6b0c601891cb580f638a31696ec90107.zip |
* Add a prompt when attacking monsters with an inappropriate weapon or
when attempting to use (controlled) berserk while wielding an
inappropriate weapon. (FR 1956656)
* Make monsters stop patrolling/travelling if they change levels (or are
banished).
* Disable the friendly pickup toggle for characters unable to use them.
Currently, only worshippers of TSO and Beogh are capable of gaining
allies that are permanent (not summoned), permanently friendly (not
charmed) and intelligent enough to pick up stuff (no zombies). I don't
know if you keep your friends if you leave TSO. If so, the toggle
should be enabled while that is the case (i.e. if you're still
worshipping a good god)
* Re-order the wizmode commands in the help screen. They're now not
listed strictly alphabetically anymore, but rather sorted into
different categories that should make actually finding commands easier.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5819 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index b524f4a78a..cf3620f270 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -184,15 +184,15 @@ bool can_wield(const item_def *weapon, bool say_reason, static bool _valid_weapon_swap(const item_def &item) { - // weapons and staves are valid weapons + // Weapons and staves are valid weapons. if (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES) - return true; + return (true); - // misc. items need to be wielded to be evoked + // Misc. items need to be wielded to be evoked. if (item.base_type == OBJ_MISCELLANY && item.sub_type != MISC_RUNE_OF_ZOT) - return true; + return (true); - // some missiles need to be wielded for spells + // Some missiles need to be wielded for spells. if (item.base_type == OBJ_MISSILES) { if (item.sub_type == MI_STONE) @@ -201,19 +201,19 @@ static bool _valid_weapon_swap(const item_def &item) if (item.sub_type == MI_ARROW) return (player_knows_spell(SPELL_STICKS_TO_SNAKES)); - return false; + return (false); } - // Boneshards + // Boneshards. if (item.base_type == OBJ_CORPSES) { return (item.sub_type == CORPSE_SKELETON && player_knows_spell(SPELL_BONE_SHARDS)); } - // Sublimation of Blood + // Sublimation of Blood. if (!player_knows_spell(SPELL_SUBLIMATION_OF_BLOOD)) - return false; + return (false); if (item.base_type == OBJ_FOOD) return (item.sub_type == FOOD_CHUNK); @@ -224,7 +224,7 @@ static bool _valid_weapon_swap(const item_def &item) || item.sub_type == POT_BLOOD_COAGULATED); } - return false; + return (false); } bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages) @@ -3584,7 +3584,7 @@ void drink( int slot ) const bool alreadyknown = item_type_known(you.inv[item_slot]); - if (you.hunger_state == HS_ENGORGED && alreadyknown + if (alreadyknown && you.hunger_state == HS_ENGORGED && (is_blood_potion(you.inv[item_slot]) || you.inv[item_slot].sub_type == POT_PORRIDGE)) { @@ -3592,6 +3592,14 @@ void drink( int slot ) return; } + if (alreadyknown && you.inv[item_slot].sub_type == POT_BERSERK_RAGE + && !berserk_check_wielded_weapon()) + { + return; + } + + + // The "> 1" part is to reduce the amount of times that Xom is // stimulated when you are a low-level 1 trying your first unknown // potions on monsters. |