diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2014-01-14 09:20:33 -0700 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2014-01-14 09:20:33 -0700 |
commit | 83766a38d9213124723d8d94dc14faa9add99ab7 (patch) | |
tree | 9893c8e13ddc74fc29bff1628a0f8287478e73ad /crawl-ref/source/goditem.cc | |
parent | 9db5db5078c7d47dc4db81bef724508f26a35f02 (diff) | |
download | crawl-ref-83766a38d9213124723d8d94dc14faa9add99ab7.tar.gz crawl-ref-83766a38d9213124723d8d94dc14faa9add99ab7.zip |
Split tracking of "illuminating" and "fiery" conducts.
This should be a little more clear for players, besides which there's
been some hesitation expressed about the latter.
Diffstat (limited to 'crawl-ref/source/goditem.cc')
-rw-r--r-- | crawl-ref/source/goditem.cc | 83 |
1 files changed, 61 insertions, 22 deletions
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc index ef5e8951df..d23597912e 100644 --- a/crawl-ref/source/goditem.cc +++ b/crawl-ref/source/goditem.cc @@ -393,7 +393,47 @@ bool is_poisoned_item(const item_def& item) return false; } -static bool _is_potentially_illuminating_item(const item_def& item) +bool is_illuminating_item(const item_def& item) +{ + // No halo for you! Also no glowy unrands. + if (is_unrandom_artefact(item) + && (item.special == UNRAND_BRILLIANCE + || item.special == UNRAND_PLUTONIUM_SWORD + || item.special == UNRAND_HIGH_COUNCIL)) + { + return true; + } + + switch (item.base_type) + { + case OBJ_WEAPONS: + { + const int item_brand = get_weapon_brand(item); + if (item_brand == SPWPN_HOLY_WRATH) // divine radiance! + { + return true; + } + } + break; + case OBJ_MISSILES: + { + const int item_brand = get_ammo_brand(item); + if (item_brand == SPMSL_FLAME) + return true; + } + break; + case OBJ_BOOKS: + case OBJ_RODS: + return _is_bookrod_type(item, is_illuminating_spell); + break; + default: + break; + } + + return false; +} + +static bool _is_potentially_fiery_item(const item_def& item) { switch (item.base_type) { @@ -408,29 +448,20 @@ static bool _is_potentially_illuminating_item(const item_def& item) return false; } -bool is_illuminating_item(const item_def& item) +bool is_fiery_item(const item_def& item) { - // No halo for you! Also no glowy unrands. - if (is_unrandom_artefact(item) - && (item.special == UNRAND_BRILLIANCE - || item.special == UNRAND_PLUTONIUM_SWORD - || item.special == UNRAND_HIGH_COUNCIL)) - { + // Flaming Death is handled through its fire brand. + if (is_unrandom_artefact(item) && item.special == UNRAND_HELLFIRE) return true; - } switch (item.base_type) { case OBJ_WEAPONS: { const int item_brand = get_weapon_brand(item); - if (item_brand == SPWPN_FLAMING - || item_brand == SPWPN_FLAME - || item_brand == SPWPN_HOLY_WRATH) // divine radiance! - { + if (item_brand == SPWPN_FLAMING || item_brand == SPWPN_FLAME) return true; } - } break; case OBJ_MISSILES: { @@ -453,7 +484,7 @@ bool is_illuminating_item(const item_def& item) break; case OBJ_BOOKS: case OBJ_RODS: - return _is_bookrod_type(item, is_illuminating_spell); + return _is_bookrod_type(item, is_fiery_spell); break; case OBJ_MISCELLANY: if (item.sub_type == MISC_LAMP_OF_FIRE) @@ -510,14 +541,18 @@ bool is_hasty_spell(spell_type spell) bool is_illuminating_spell(spell_type spell) { - unsigned int disciplines = get_spell_disciplines(spell); - - return (disciplines & SPTYP_FIRE) - || spell == SPELL_CORONA + return spell == SPELL_CORONA || spell == SPELL_SUNRAY || spell == SPELL_HOLY_LIGHT; } +bool is_fiery_spell(spell_type spell) +{ + unsigned int disciplines = get_spell_disciplines(spell); + + return (disciplines & SPTYP_FIRE); +} + static bool _your_god_hates_spell(spell_type spell) { return god_hates_spell(spell, you.religion); @@ -597,12 +632,16 @@ conduct_type god_hates_item_handling(const item_def &item) break; case GOD_DITHMENGOS: + if (item_type_known(item) && is_illuminating_item(item)) + return DID_ILLUMINATE; + if (item_type_known(item) - && (_is_potentially_illuminating_item(item) - || is_illuminating_item(item))) + && (_is_potentially_fiery_item(item) + || is_fiery_item(item))) { - return DID_ILLUMINATE; + return DID_FIRE; } + break; default: break; |