diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-06 19:09:12 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-06 19:09:12 +0000 |
commit | 9d9efc7fd96b37de17094f6f7cff8abb43a1e8a2 (patch) | |
tree | a12c56aab56fb877e73b9b6e9e290ec543be56b6 /crawl-ref/source/describe.cc | |
parent | f442b6f700fe5e6a588c802fbcab1b5bd0097627 (diff) | |
download | crawl-ref-9d9efc7fd96b37de17094f6f7cff8abb43a1e8a2.tar.gz crawl-ref-9d9efc7fd96b37de17094f6f7cff8abb43a1e8a2.zip |
Add a line on good gods disapproving of certain items to their
description (evil_item). Same for evil_eating.
In another step on the way to monster pathfinding, take the
shortest path and extract a vector of waypoints out of it.
When experimenting with ways to do this I noticed that grid_see_grid
is not symmetrical (A may see B but not vice versa); I'm not sure
what effects that could have. It won't directly affect the player as
the checks for monster sees player and player sees monster both use
the player LoS, but it could have an effect on friendly monsters
fighting enemy ones, I guess.
Also, I don't think num_feats_between needs the shortest beam
available (called with false now). In fact, that seemed to hurt
visibility a bit, probably because of attempting to take vision
obstructing shortcuts. If this reasoning is wrong, please speak up
and/or correct it. (I sure hope not because the shortest beam
calculation has some more overhead that can be avoided this way.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5501 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 4904d24b66..3b6d4969d8 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1636,6 +1636,10 @@ std::string get_item_description( const item_def &item, bool verbose, description << "$"; break; + case OBJ_CORPSES: + if (item.sub_type == CORPSE_SKELETON) + break; + // intentional fall-through case OBJ_FOOD: if (item.sub_type == FOOD_CHUNK) { @@ -1685,6 +1689,13 @@ std::string get_item_description( const item_def &item, bool verbose, default: break; } + if (is_good_god(you.religion) && is_player_same_species(item.plus) + || you.religion == GOD_ZIN + && mons_intel(item.plus) >= I_NORMAL) + { + description << "$$" << god_name(you.religion) << " disapproves " + "of eating such meat."; + } description << "$"; } @@ -1747,7 +1758,6 @@ std::string get_item_description( const item_def &item, bool verbose, case OBJ_SCROLLS: case OBJ_ORBS: - case OBJ_CORPSES: case OBJ_GOLD: // No extra processing needed for these item types. break; @@ -1788,6 +1798,13 @@ std::string get_item_description( const item_def &item, bool verbose, } } + if (is_good_god(you.religion) && is_evil_item(item) + && item_type_known(item)) + { + description << "$$" << god_name(you.religion) << " disapproves of the " + << "use of such an item."; + } + return description.str(); } // end get_item_description() @@ -1823,7 +1840,7 @@ void describe_feature_wide(int x, int y) getch(); } -// Return true if spells can be shown to player +// Returns true if spells can be shown to player. static bool show_item_description(const item_def &item) { clrscr(); |