diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-08 11:19:12 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-08 11:19:12 +0000 |
commit | d4577487e64c62a629be512f5f21404e3192a0fe (patch) | |
tree | 504eb853c918e5b2e46729f42ad86173470edc27 /crawl-ref | |
parent | d5f262eb187ed2a96b0216103210c8ba8057d59c (diff) | |
download | crawl-ref-d4577487e64c62a629be512f5f21404e3192a0fe.tar.gz crawl-ref-d4577487e64c62a629be512f5f21404e3192a0fe.zip |
Apply tiles inscription fixes to trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9922 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/it_use3.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 53 | ||||
-rw-r--r-- | crawl-ref/source/monplace.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spells1.cc | 4 |
4 files changed, 28 insertions, 44 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index b0b1d34fa5..a9d132fc8d 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -811,7 +811,10 @@ bool evoke_item(int slot) if (prompt_failed(slot)) return (false); } - ASSERT (slot >= 0); + else if (!check_warning_inscriptions(you.inv[slot], OPER_EVOKE)) + return (false); + + ASSERT(slot >= 0); const bool wielded = (you.equip[EQ_WEAPON] == slot); @@ -820,13 +823,9 @@ bool evoke_item(int slot) if (!item_is_evokable(item, false, false, true)) return (false); - // Check inscriptions. - if (!check_warning_inscriptions(item, OPER_EVOKE)) - return (false); - int power = 0; int pract = 0; // By how much Evocations is practised. - bool did_work = false; // Used for default "nothing happens" message. + bool did_work = false; // Used for default "nothing happens" message. bool unevokable = false; switch (item.base_type) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 37ab147cc9..d82638b0d0 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -24,9 +24,7 @@ REVISION("$Rev$"); #include "cloud.h" #include "command.h" #include "debug.h" -#ifdef USE_TILE #include "decks.h" -#endif #include "delay.h" #include "describe.h" #include "directn.h" @@ -181,9 +179,12 @@ static bool _valid_weapon_swap(const item_def &item) if (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES) return (true); - // Misc. items need to be wielded to be evoked. - if (item.base_type == OBJ_MISCELLANY && item.sub_type != MISC_RUNE_OF_ZOT) + // Some misc. items need to be wielded to be evoked. + if (is_deck(item) || item.base_type == OBJ_MISCELLANY + && item.sub_type == MISC_LANTERN_OF_SHADOWS) + { return (true); + } // Some missiles need to be wielded for spells. if (item.base_type == OBJ_MISSILES) @@ -5424,23 +5425,11 @@ void tile_item_use_secondary(int idx) if (check_warning_inscriptions(item, OPER_FIRE)) fire_thing(idx); // fire weapons } - else if (item.base_type == OBJ_MISCELLANY - || item.base_type == OBJ_STAVES - && item_is_rod(item)) // unwield rods/misc. items - { - if (you.equip[EQ_WEAPON] == idx - && check_warning_inscriptions(item, OPER_WIELD)) - { - wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield - } - } - else if (you.equip[EQ_WEAPON] == idx - && check_warning_inscriptions(item, OPER_WIELD)) + else if (you.equip[EQ_WEAPON] == idx) { wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield } - else if (_valid_weapon_swap(item) - && check_warning_inscriptions(item, OPER_WIELD)) + else if (_valid_weapon_swap(item)) { // secondary wield for several spells and such wield_weapon(true, idx); // wield @@ -5473,37 +5462,36 @@ void tile_item_use(int idx) && (item.base_type == OBJ_ARMOUR || item.base_type == OBJ_JEWELLERY)) { - if (!check_warning_inscriptions(item, OPER_WIELD)) - return; - wield_weapon(true, PROMPT_GOT_SPECIAL); return; } + const int type = item.base_type; + // Use it - switch (item.base_type) + switch (type) { case OBJ_WEAPONS: case OBJ_STAVES: case OBJ_MISCELLANY: + case OBJ_WANDS: // Wield any unwielded item of these types. if (!equipped - && (item.base_type != OBJ_MISCELLANY || is_deck(item) - || item.sub_type == MISC_LANTERN_OF_SHADOWS)) + && (type == OBJ_WEAPONS || type == OBJ_STAVES || is_deck(item) + || type == OBJ_MISCELLANY + && item.sub_type == MISC_LANTERN_OF_SHADOWS)) { - if (check_warning_inscriptions(item, OPER_WIELD)) - wield_weapon(true, idx); + wield_weapon(true, idx); return; } - // Evoke misc. items and rods. + // Evoke misc. items, rods, or wands. if (item_is_evokable(item)) { - if (check_warning_inscriptions(item, OPER_EVOKE)) - evoke_item(idx); + evoke_item(idx); return; } // Unwield wielded items. - if (equipped && check_warning_inscriptions(item, OPER_WIELD)) + if (equipped) wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield return; @@ -5527,11 +5515,6 @@ void tile_item_use(int idx) wear_armour(idx); return; - case OBJ_WANDS: - if (check_warning_inscriptions(item, OPER_ZAP)) - zap_wand(idx); - return; - case OBJ_CORPSES: if (you.species != SP_VAMPIRE || item.sub_type == CORPSE_SKELETON diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index af76646e13..3168a28796 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -2502,8 +2502,8 @@ bool empty_surrounds(const coord_def& where, dungeon_feature_type spc_wanted, int good_count = 0; - for ( radius_iterator ri(where, radius, true, false, !allow_centre); - ri; ++ri) + for (radius_iterator ri(where, radius, true, false, !allow_centre); + ri; ++ri) { bool success = false; diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 57a69b3377..84c4788296 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -138,9 +138,11 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink) continue; } - // Wizard blink can move past translucent walls. if (see_grid_no_trans(beam.target)) + { + // Grid in los, no problem. break; + } else if (trans_wall_blocking( beam.target )) { // Wizard blink can move past translucent walls. |