diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-07 14:18:52 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-07 14:18:52 +0000 |
commit | e08c65894072dadd48aafd7e4b41b35c0a5aed91 (patch) | |
tree | e3ebed6ca00b23d108296a633dffba201129654f | |
parent | dfa4b1e2e5e933189d93b170f5ef05c7e89f2709 (diff) | |
download | crawl-ref-e08c65894072dadd48aafd7e4b41b35c0a5aed91.tar.gz crawl-ref-e08c65894072dadd48aafd7e4b41b35c0a5aed91.zip |
Trunk->0.3 bugfix merge: r2357-2362.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2363 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/it_use2.cc | 30 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/menu.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/terrain.cc | 6 |
7 files changed, 36 insertions, 17 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index b6628c6d57..6b32144a26 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -373,18 +373,20 @@ void unwield_item(bool showMsgs) you.special_wield = SPWLD_NONE; you.wield_change = true; - if ( you.inv[unw].base_type == OBJ_MISCELLANY && - you.inv[unw].sub_type == MISC_LANTERN_OF_SHADOWS ) + item_def &item(you.inv[unw]); + + if ( item.base_type == OBJ_MISCELLANY && + item.sub_type == MISC_LANTERN_OF_SHADOWS ) { you.current_vision += 2; setLOSRadius(you.current_vision); } - if (you.inv[unw].base_type == OBJ_WEAPONS) + if (item.base_type == OBJ_WEAPONS) { - if (is_fixed_artefact( you.inv[unw] )) + if (is_fixed_artefact( item )) { - switch (you.inv[unw].special) + switch (item.special) { case SPWPN_SINGING_SWORD: if (showMsgs) @@ -396,12 +398,12 @@ void unwield_item(bool showMsgs) break; case SPWPN_SCYTHE_OF_CURSES: case SPWPN_STAFF_OF_OLGREB: - you.inv[unw].plus = 0; - you.inv[unw].plus2 = 0; + item.plus = 0; + item.plus2 = 0; break; case SPWPN_STAFF_OF_WUCAD_MU: - you.inv[unw].plus = 0; - you.inv[unw].plus2 = 0; + item.plus = 0; + item.plus2 = 0; miscast_effect( SPTYP_DIVINATION, 9, 90, 100, "the Staff of Wucad Mu" ); break; @@ -412,14 +414,14 @@ void unwield_item(bool showMsgs) return; } - const int brand = get_weapon_brand( you.inv[unw] ); + const int brand = get_weapon_brand( item ); - if (is_random_artefact( you.inv[unw] )) + if (is_random_artefact( item )) unuse_randart(unw); if (brand != SPWPN_NORMAL) { - const std::string msg = you.inv[unw].name(DESC_CAP_YOUR); + const std::string msg = item.name(DESC_CAP_YOUR); switch (brand) { @@ -481,14 +483,14 @@ void unwield_item(bool showMsgs) if (you.duration[DUR_WEAPON_BRAND]) { you.duration[DUR_WEAPON_BRAND] = 0; - set_item_ego_type( you.inv[unw], OBJ_WEAPONS, SPWPN_NORMAL ); + set_item_ego_type( item, OBJ_WEAPONS, SPWPN_NORMAL ); // we're letting this through even if hiding messages mpr("Your branding evaporates."); } } // end if } - if (player_equip( EQ_STAFF, STAFF_POWER )) + if (item.base_type == OBJ_STAVES && item.sub_type == STAFF_POWER) calc_mp(); return; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 9925d12ff8..483ff90572 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1674,7 +1674,8 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) // // Unwield needs to be done before copy in order to clear things // like temporary brands. -- bwr - if (item_dropped == you.equip[EQ_WEAPON]) + if (item_dropped == you.equip[EQ_WEAPON] + && quant_drop >= you.inv[item_dropped].quantity) { unwield_item(); canned_msg( MSG_EMPTY_HANDED ); diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 7936be1bb1..6b368433cb 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -636,7 +636,12 @@ void Menu::draw_stock_item(int index, const MenuEntry *me) const if ( flags & MF_ALLOW_FORMATTING ) formatted_string::parse_string(items[index]->get_text()).display(); else - cprintf( "%s", items[index]->get_text().c_str() ); + { + std::string text = items[index]->get_text(); + if ((int) text.length() > get_number_of_cols()) + text = text.substr(0, get_number_of_cols()); + cprintf( "%s", text.c_str() ); + } } bool Menu::page_down() diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 152462a1a7..fc7239567b 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1181,6 +1181,8 @@ std::string weird_writing() bool scramble(void) { + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_STATUE) + return (false); int max_carry = carrying_capacity(); if ((max_carry / 2) + random2(max_carry / 2) <= you.burden) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 1774677897..7a61cca71b 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3054,6 +3054,10 @@ void level_change(bool skip_ability_increase) if (Options.use_notes) { + unwind_var<int> hpmax(you.hp_max); + unwind_var<int> hp(you.hp); + unwind_var<int> mpmax(you.max_magic_points); + unwind_var<int> mp(you.magic_points); // calculate "real" values for note-taking, i.e. ignore Berserk, // transformations or equipped items calc_hp(true); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index e1f0406c1f..4a102a0ce3 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -212,6 +212,7 @@ int cast_smiting(int power, dist &beam) // Maxes out at around 40 damage at 27 Invocations, which is plenty // in my book (the old max damage was around 70, which seems excessive) hurt_monster(monster, 7 + (random2(power) * 33 / 191)); + behaviour_event( monster, ME_ANNOY, MHITYOU ); if (monster->hit_points < 1) monster_die(monster, KILL_YOU, 0); diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 1c90d7d3d5..4a9a930174 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -29,6 +29,7 @@ #include "religion.h" #include "spells3.h" #include "stuff.h" +#include "transfor.h" #include "view.h" bool grid_is_wall( dungeon_feature_type grid ) @@ -515,7 +516,10 @@ bool fall_into_a_pool( int entry_x, int entry_y, bool allow_shift, } else { - mpr("You try to escape, but your burden drags you down!"); + if (you.attribute[ATTR_TRANSFORMATION] == TRAN_STATUE) + mpr("You sink like a stone!"); + else + mpr("You try to escape, but your burden drags you down!"); } if (escape) |