diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-03-22 13:05:39 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-03-22 13:05:39 +0100 |
commit | b11197ae79d621c50d89f6a092a3f95f954712f0 (patch) | |
tree | 44b20f31bc6b4f946d2f4fb6c19afdce558a34f2 /src/xtra2.cc | |
parent | fb2a78c52a32026a57fd9cc7763a783456199dd7 (diff) |
Inline various GOD macros
Diffstat (limited to 'src/xtra2.cc')
-rw-r--r-- | src/xtra2.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/xtra2.cc b/src/xtra2.cc index 07747a32..80179045 100644 --- a/src/xtra2.cc +++ b/src/xtra2.cc @@ -3254,35 +3254,38 @@ bool_ mon_take_hit(int m_idx, int dam, bool_ *fear, cptr note) /* Manwe appreciate evil monster death */ if (r_ptr->flags3 & RF3_EVIL) { - int inc = m_ptr->level / 2; + int inc = std::max(1, m_ptr->level / 2); - if (!inc) inc = 1; - PRAY_GOD(GOD_MANWE) inc_piety(GOD_MANWE, inc); + if (praying_to(GOD_MANWE)) + { + inc_piety(GOD_MANWE, inc); + } + + inc = std::max(2, inc); - if (inc < 2) inc = 2; inc_piety(GOD_TULKAS, inc / 2); - PRAY_GOD(GOD_TULKAS) + + if (praying_to(GOD_TULKAS)) { inc_piety(GOD_TULKAS, inc / 2); - if (r_ptr->flags3 & RF3_DEMON) inc_piety(GOD_TULKAS, inc); + if (r_ptr->flags3 & RF3_DEMON) + { + inc_piety(GOD_TULKAS, inc); + } } } /* Yavanna likes when corruption is destroyed */ if ((r_ptr->flags3 & RF3_NONLIVING) || (r_ptr->flags3 & RF3_DEMON) || (r_ptr->flags3 & RF3_UNDEAD)) { - int inc = m_ptr->level / 2; - - if (!inc) inc = 1; + int inc = std::max(1, m_ptr->level / 2); inc_piety(GOD_YAVANNA, inc); } /* Yavanna doesnt like any killing in her name */ - PRAY_GOD(GOD_YAVANNA) + if (praying_to(GOD_YAVANNA)) { - int inc = m_ptr->level / 2; - - if (!inc) inc = 1; + int inc = std::max(1, m_ptr->level / 2); inc_piety(GOD_YAVANNA, -inc); /* Killing animals in her name is a VERY bad idea */ |