summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abl-show.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-14 18:19:16 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-14 18:19:16 +0000
commit8760aefa6b0c601891cb580f638a31696ec90107 (patch)
tree30d1f4c34cf1931d06d94c674341c3bba17f0299 /crawl-ref/source/abl-show.cc
parent866686d5df24c38a2838f6f06ef9186b2c392a1c (diff)
downloadcrawl-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/abl-show.cc')
-rw-r--r--crawl-ref/source/abl-show.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 69c9ea6bd3..1f745ed30e 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -806,7 +806,7 @@ std::vector<const char*> get_ability_names()
{
std::vector<talent> talents = your_talents(false);
std::vector<const char*> result;
- for ( unsigned int i = 0; i < talents.size(); ++i )
+ for (unsigned int i = 0; i < talents.size(); ++i)
result.push_back(get_ability_def(talents[i].which).name);
return result;
}
@@ -930,7 +930,7 @@ static bool _activate_talent(const talent& tal)
return (false);
}
- // some abilities don't need a hunger check
+ // Some abilities don't need a hunger check.
bool hungerCheck = true;
switch (tal.which)
{
@@ -957,7 +957,7 @@ static bool _activate_talent(const talent& tal)
const ability_def& abil = get_ability_def(tal.which);
- // check that we can afford to pay the costs
+ // Check that we can afford to pay the costs.
if (!enough_mp( abil.mp_cost, false ))
{
crawl_state.zero_turns_taken();
@@ -977,8 +977,8 @@ static bool _activate_talent(const talent& tal)
return (false);
}
- // don't insta-starve the player
- // (happens at 100, losing consciousness possible from 500 downward)
+ // Don't insta-starve the player.
+ // (Happens at 100, losing consciousness possible from 500 downward.)
if (hungerCheck && you.species != SP_VAMPIRE)
{
const int expected_hunger = you.hunger - abil.food_cost * 2;
@@ -987,7 +987,7 @@ static bool _activate_talent(const talent& tal)
"hunger: %d, max. food_cost: %d, expected hunger: %d",
you.hunger, abil.food_cost * 2, expected_hunger);
#endif
- // safety margin for natural hunger, mutations etc.
+ // Safety margin for natural hunger, mutations etc.
if (expected_hunger <= 150)
{
mpr("You're too hungry.");
@@ -996,7 +996,14 @@ static bool _activate_talent(const talent& tal)
}
}
- // no turning back now... {dlb}
+ if ((tal.which == ABIL_EVOKE_BERSERK || tal.which == ABIL_TROG_BERSERK)
+ && !berserk_check_wielded_weapon())
+ {
+ crawl_state.zero_turns_taken();
+ return (false);
+ }
+
+ // No turning back now... {dlb}
if (random2avg(100, 3) < tal.fail)
{
mpr("You fail to use your ability.");