diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:57 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-02-23 09:11:57 +0100 |
commit | c4746c0f6d328baa429c96e54d86d2d7f97ccbcc (patch) | |
tree | 3f0b3a2f98298ab823662e0096bc7ba857793b98 /src/melee1.cc | |
parent | b84ac3e1b505624e2af18a4283e7ec379c00b0dc (diff) |
Remove r_name, r_text, r_head in favor of simple strings
Diffstat (limited to 'src/melee1.cc')
-rw-r--r-- | src/melee1.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/melee1.cc b/src/melee1.cc index 59c6a9a3..09caa4aa 100644 --- a/src/melee1.cc +++ b/src/melee1.cc @@ -12,7 +12,9 @@ #include "angband.h" +#include <boost/algorithm/string/predicate.hpp> +using boost::algorithm::iequals; /* * Critical blow. All hits that do 95% of total possible damage, @@ -1648,7 +1650,7 @@ bool_ make_attack_normal(int m_idx, byte divis) { act = "bites you."; do_cut = 1; - if (magik(5) && (strstr(r_name + r_ptr->name, "Vampire") || strstr(r_name + r_ptr->name, "vampire"))) + if (magik(5) && iequals(r_ptr->name, "vampire")) do_vampire = TRUE; touched = TRUE; sound(SOUND_BITE); @@ -1774,7 +1776,7 @@ bool_ make_attack_normal(int m_idx, byte divis) case RBM_MOAN: { - if (strstr((r_name + r_ptr->name), "Mathilde, the Science Student")) + if (strstr(r_ptr->name, "Mathilde, the Science Student")) act = desc_moan[rand_int(3) + 4]; else act = desc_moan[rand_int(4)]; @@ -2141,8 +2143,7 @@ bool_ make_attack_normal(int m_idx, byte divis) } else { - if (strstr((r_name + r_ptr->name), "black market") - && randint(2) != 1) + if (strstr(r_ptr->name, "black market") && randint(2) != 1) { s16b o_idx; |