diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-01 10:10:02 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-01 10:10:59 -0600 |
commit | a0de356f3d007e58152f257212ed13d8b44fdfc0 (patch) | |
tree | f58fc43277e2f4fcb5f99ef57b51eeeef05a9905 /crawl-ref/source/item_use.cc | |
parent | 7e8ebade4e8c0001439b89f333174f9443b74eb0 (diff) | |
download | crawl-ref-a0de356f3d007e58152f257212ed13d8b44fdfc0.tar.gz crawl-ref-a0de356f3d007e58152f257212ed13d8b44fdfc0.zip |
Move checks for a player or monster's being chaotic into another
convenience function in the actor interface.
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index e621b1e663..eb405b395e 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -42,9 +42,9 @@ #include "message.h" #include "misc.h" #include "mon-behv.h" +#include "mon-util.h" #include "monplace.h" #include "monstuff.h" -#include "mon-util.h" #include "notes.h" #include "ouch.h" #include "player.h" @@ -1710,17 +1710,7 @@ static bool _item_penetrates_victim(const bolt &beam, const actor *victim, static bool _silver_damages_victim(bolt &beam, actor* victim, int &dmg, std::string &dmg_msg) { - bool chaotic; - - if (victim->atype() == ACT_MONSTER) - { - monsters* mon = dynamic_cast<monsters*>(victim); - chaotic = mons_is_chaotic(mon); // Includes shapeshifters. - } - else - chaotic = transform_changed_physiology(); - - if (chaotic || victim->is_unholy()) + if (victim->is_unholy() || victim->is_chaotic()) { dmg *= 2; |