via a9e6ede60504aea9a5c19bd27275ace937e744ef (commit) via 180b7c537c0c3f0f5217f566a9ee94a93ba64500 (commit) via 1b46cc3e5bb0c07e86f4afda55f811d9011ba8cd (commit) from a4d45caf8c4f27b897e3dbc97bb91af8e7e76b2a (commit)
----------------------------------------------------------------------- commit a9e6ede60504aea9a5c19bd27275ace937e744ef Author: Raphael Langella <raphael.lange...@gmail.com> Date: Thu Feb 17 17:46:43 2011 +0100 Fix corpse placement not working well on levels with high wall density. The game creates a monster before turning it into a corpse. It wasn't given a position to place the monster and tried 45 times to find one. On levels with very high wall density (such as tutorial lesson 4), it often failed. Now it creates the monster on the cell the corpse will end up. Fix Mantis #3361. commit 180b7c537c0c3f0f5217f566a9ee94a93ba64500 Author: Raphael Langella <raphael.lange...@gmail.com> Date: Thu Feb 17 15:34:49 2011 +0100 Print the scroll name when it is identified. Should reduce the number of questions regarding random uselessness. Also remove the "This is a scroll of identify!" message as it is redundant now. commit 1b46cc3e5bb0c07e86f4afda55f811d9011ba8cd Author: Raphael Langella <raphael.lange...@gmail.com> Date: Thu Feb 17 14:34:00 2011 +0100 Print the potion name when it is identified. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/dungeon.cc | 6 +++--- crawl-ref/source/it_use2.cc | 16 ++++++++++++++-- crawl-ref/source/item_use.cc | 17 +++++++++++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index eb7f102..70aafd4 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -4051,10 +4051,10 @@ static const object_class_type _acquirement_item_classes[] = { OBJ_MISCELLANY }; -int dgn_item_corpse(const item_spec &ispec) +int dgn_item_corpse(const item_spec &ispec, const coord_def where) { mons_spec mspec(ispec.corpse_monster_spec()); - const int mindex = dgn_place_monster(mspec, 0, coord_def()); + const int mindex = dgn_place_monster(mspec, 0, where); if (invalid_monster_index(mindex)) return (NON_ITEM); @@ -4134,7 +4134,7 @@ retry: (acquire ? acquirement_create_item(base_type, spec.acquirement_source, true, where) - : spec.corpselike() ? dgn_item_corpse(spec) + : spec.corpselike() ? dgn_item_corpse(spec, where) : items(spec.allow_uniques, base_type, spec.sub_type, true, level, spec.race, 0, spec.ego, -1, spec.level == ISPEC_MUNDANE)); diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 75b3c50..81bcc19 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -34,7 +34,19 @@ #include "transform.h" #include "xom.h" -// From an actual potion, pow == 40 -- bwr +/* + * Apply the effect of a potion to the player. + * + * This is called when the player quaff a potion, but also for some cards, + * beams, sparkling fountains, god effects and miscasts. + * + * @param pot_eff The potion type. + * @param pow The power of the effect. 40 for actual potions. + * @param drank_it Wether the player actually quaffed (potions and fountains). + * @param was_known Wether the potion was already identified. + * + * @return If the potion was identified. + */ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known) { @@ -438,7 +450,7 @@ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known) break; } - return (effect); + return (!was_known && effect); } bool unwield_item(bool showMsgs) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 2b1d181..cd6c48d 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3924,9 +3924,11 @@ void drink(int slot) { set_ident_flags(potion, ISFLAG_IDENT_MASK); set_ident_type(potion, ID_KNOWN_TYPE); + mpr("It was a " + potion.name(DESC_QUALNAME) + "."); } - else + else if (!alreadyknown) { + // Because all potions are identified upon quaffing we never come here. set_ident_type(potion, ID_TRIED_TYPE); } @@ -4500,7 +4502,6 @@ static bool _scroll_modify_item(item_def scroll) case SCR_IDENTIFY: if (!fully_identified(item)) { - mpr("This is a scroll of identify!"); identify(-1, item_slot); return (true); } @@ -4747,6 +4748,9 @@ void read_scroll(int slot) bool tried_on_item = false; // used to modify item (?EA, ?RC, ?ID) bool bad_effect = false; // for Xom: result is bad (or at least dangerous) + + int prev_quantity = you.inv[item_slot].quantity; + switch (which_scroll) { case SCR_RANDOM_USELESSNESS: @@ -5081,9 +5085,18 @@ void read_scroll(int slot) if (id_the_scroll) set_ident_flags(scroll, ISFLAG_KNOW_TYPE); // for notes + std::string scroll_name = scroll.name(DESC_QUALNAME).c_str(); + if (!cancel_scroll) dec_inv_item_quantity(item_slot, 1); + if (id_the_scroll && !alreadyknown && which_scroll != SCR_ACQUIREMENT) + { + mprf("It %s a %s.", + you.inv[item_slot].quantity < prev_quantity ? "was" : "is", + scroll_name.c_str()); + } + if (!alreadyknown && dangerous) { // Xom loves it when you read an unknown scroll and there is a ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Crawl-ref-discuss mailing list Crawl-ref-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss