summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mstuff2.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 12:48:15 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 12:48:15 +0000
commit445895d95df53255dd570691f1ebb3eb538348d0 (patch)
tree2d840a26c0f7a44b50c3d88a48038a5c13a5c24c /crawl-ref/source/mstuff2.cc
parente6584efd5c0dfe8d24d07ceca6db2d563d2b9cd9 (diff)
downloadcrawl-ref-445895d95df53255dd570691f1ebb3eb538348d0.tar.gz
crawl-ref-445895d95df53255dd570691f1ebb3eb538348d0.zip
Revert the change on ammo handling for Tiles, and replace it with a more
generic logic that uses item tiles for BEAM_MISSILE, else bolts according to flavour. Identify monster fired ammunition ego if the launcher ego is known, not that it has much of an effect because plain ammo gets no special description. In the message list the fired item as it will look to the player (i.e. "arrow of ice" for a plain arrow fired off a bow of frost), even though the item actually dropped will still be a plain one. I hope this isn't too confusing. (And if it is, it should be easy to revert. :p) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6331 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mstuff2.cc')
-rw-r--r--crawl-ref/source/mstuff2.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 52be635898..909e09d6ff 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -1192,10 +1192,10 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used)
int diceMult = 100;
// Some initial convenience & initializations.
- int wepClass = mitm[hand_used].base_type;
- int wepType = mitm[hand_used].sub_type;
+ int wepClass = mitm[hand_used].base_type;
+ int wepType = mitm[hand_used].sub_type;
- int weapon = monster->inv[MSLOT_WEAPON];
+ int weapon = monster->inv[MSLOT_WEAPON];
int lnchType = (weapon != NON_ITEM) ? mitm[weapon].sub_type : 0;
const bool skilled = mons_class_flag(monster->type, M_FIGHTER);
@@ -1450,9 +1450,18 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used)
pbolt.name = item.name(DESC_PLAIN, false, false, false);
}
msg += ".";
+
if (monster->visible())
+ {
mpr(msg.c_str());
+ if (projected == LRET_LAUNCHED
+ && item_type_known(mitm[monster->inv[MSLOT_WEAPON]]))
+ {
+ set_ident_flags(mitm[hand_used], ISFLAG_KNOW_TYPE);
+ }
+ }
+
// [dshaligram] When changing bolt names here, you must edit
// hiscores.cc (scorefile_entry::terse_missile_cause()) to match.
if (projected == LRET_LAUNCHED)