From 88fd21a557af9d87d660e896023b7e8788ea915f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 5 Sep 2007 14:17:12 +0000 Subject: Fixing more bugs. 1788159: Mummy priests don't get potions either. 1787377: Lugonu's Banish doesn't work on self 1786808: More feedback for travelling. 1784235: Randomized staff descriptions. 1774996: /random effect autoIDs for fireball 1768803: Extended inscription warning use. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2057 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 5 ++++ crawl-ref/source/invent.cc | 60 ++++++++++++++++++++++++++++++++++++++++++-- crawl-ref/source/item_use.cc | 6 +---- crawl-ref/source/makeitem.cc | 2 ++ crawl-ref/source/newgame.cc | 12 +++++---- crawl-ref/source/travel.cc | 10 ++++++-- 6 files changed, 81 insertions(+), 14 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index ecbe9d0589..9fb84288f2 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1585,6 +1585,11 @@ static bool do_ability(const ability_def& abil) case ABIL_LUGONU_BANISH: if ( !spell_direction(spd, beam, DIR_NONE, TARG_ENEMY) ) return (false); + if (beam.target_x == you.x_pos && beam.target_y == you.y_pos) + { + mpr("You cannot banish yourself!"); + return (false); + } zapping( ZAP_BANISHMENT, 16 + you.skills[SK_INVOCATIONS] * 8, beam ); exercise(SK_INVOCATIONS, 3 + random2(5)); break; diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index c1cc52102c..e757ecee26 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -1004,6 +1004,61 @@ bool has_warning_inscription(const item_def& item, return false; } +// checks if current item (to be removed) has a warning inscription +// and prompts the user for confirmation +static bool check_old_item_warning( const item_def& item, + operation_types oper ) +{ + item_def old_item; + std::string prompt = ""; + if (oper == OPER_WIELD) // can we safely unwield old item? + { + if (you.equip[EQ_WEAPON] == -1) + return (true); + + old_item = you.inv[you.equip[EQ_WEAPON]]; + if (!has_warning_inscription(old_item, OPER_WIELD)) + return (true); + + prompt += "Really unwield "; + } + else if (oper == OPER_WEAR) // can we safely take off old item? + { + equipment_type eq_slot = get_armour_slot(item); + if (you.equip[eq_slot] == -1) + return (true); + + old_item = you.inv[you.equip[eq_slot]]; + if (!has_warning_inscription(old_item, OPER_TAKEOFF)) + return (true); + + prompt += "Really take off "; + } + else if (oper == OPER_PUTON) // can we safely remove old item? + { + if (jewellery_is_amulet(item)) + { + if (you.equip[EQ_AMULET] == -1) + return (true); + + old_item = you.inv[you.equip[EQ_AMULET]]; + if (!has_warning_inscription(old_item, OPER_TAKEOFF)) + return (true); + + prompt += "Really remove "; + } + else // rings handled in prompt_ring_to_remove + return (true); + } + else // anything else doesn't have a counterpart + return (true); + + // now ask + prompt += old_item.name(DESC_INVENTORY); + prompt += '?'; + return yesno(prompt.c_str(), false, 'n'); +} + /* return true if user OK'd it (or no warning), false otherwise */ bool check_warning_inscriptions( const item_def& item, operation_types oper ) @@ -1013,10 +1068,11 @@ bool check_warning_inscriptions( const item_def& item, std::string prompt = "Really choose "; prompt += item.name(DESC_INVENTORY); prompt += '?'; - return yesno(prompt.c_str(), false, 'n'); + return (yesno(prompt.c_str(), false, 'n') + && check_old_item_warning(item, oper)); } else - return true; + return (check_old_item_warning(item, oper)); } // This function prompts the user for an item, handles the '?' and '*' diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 463dd1413f..408e6d2f25 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -255,10 +255,6 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages) if (!can_wield(&you.inv[item_slot], true)) return (false); - // check inscriptions - if ( !check_warning_inscriptions(you.inv[item_slot], OPER_WIELD) ) - return false; - // Go ahead and wield the weapon. if (you.equip[EQ_WEAPON] != -1) unwield_item(you.equip[EQ_WEAPON], show_weff_messages); @@ -2863,7 +2859,7 @@ void zap_wand(void) zapping( static_cast(type_zapped), 30 + roll_dice(2, you.skills[SK_EVOCATIONS]), beam ); - if ((beam.obvious_effect || wand.sub_type == WAND_FIREBALL) && + if ((beam.obvious_effect || type_zapped == WAND_FIREBALL) && !alreadyknown) { set_ident_type( wand.base_type, wand.sub_type, ID_KNOWN_TYPE ); diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index c6afbc2f35..4f5600ffff 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2768,6 +2768,8 @@ int items( int allow_uniques, // not just true-false, if (item_is_rod( mitm[p] )) init_rod_mp( mitm[p] ); + // add different looks + mitm[p].special = random2(10); quant = 1; break; diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 0669a91ed8..52be813fc8 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -3607,11 +3607,13 @@ bool give_items_skills() you.inv[1].plus = 0; you.inv[1].special = 0; - you.inv[2].base_type = OBJ_POTIONS; - you.inv[2].sub_type = POT_HEALING; - you.inv[2].quantity = 2; - you.inv[2].plus = 0; - + if (you.species != SP_MUMMY) + { + you.inv[2].base_type = OBJ_POTIONS; + you.inv[2].sub_type = POT_HEALING; + you.inv[2].quantity = 2; + you.inv[2].plus = 0; + } you.equip[EQ_WEAPON] = 0; you.equip[EQ_BODY_ARMOUR] = 1; diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 433e8878a0..a5f16a51d3 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -2577,8 +2577,14 @@ static bool find_transtravel_square(const level_pos &target, bool verbose) return find_transtravel_square(newlev, verbose); } - if (verbose && target.id != current) - mpr("Sorry, I don't know how to get there."); + if (verbose) + { + if (target.id != current || target.pos.x != -1 && target.pos != you.pos()) + mpr("Sorry, I don't know how to get there."); + if (target.id == current && target.pos.x != -1 && target.pos == you.pos()) + mpr("You're already here!"); + } + return (false); } -- cgit v1.2.3-54-g00ecf