From 09c586c9f0a5e8dc3abc20b7928b1474641077e1 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 3 Nov 2008 20:39:33 +0000 Subject: Simplify again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7372 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/religion.cc | 23 +++++++++++++---------- crawl-ref/source/religion.h | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 512c29a470..bce9bc8bbd 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2238,23 +2238,26 @@ void god_speaks(god_type god, const char *mesg) mpr(mesg, MSGCH_GOD, god); } -god_type do_god_vengeance(conduct_type thing_done) +bool do_god_vengeance(conduct_type thing_done) { - god_type god = GOD_NO_GOD; + bool retval = false; - if (thing_done == DID_DESTROY_ORCISH_IDOL) + switch (thing_done) { - god = GOD_BEOGH; + case DID_DESTROY_ORCISH_IDOL: + retval = true; beogh_idol_revenge(); - } - else if (thing_done == DID_KILL_HOLY - || thing_done == DID_HOLY_KILLED_BY_SERVANT) - { - god = GOD_SHINING_ONE; + break; + case DID_KILL_HOLY: + case DID_HOLY_KILLED_BY_SERVANT: + retval = true; tso_holy_revenge(); + break; + default: + break; } - return (god); + return (retval); } // This function is the merger of done_good() and naughty(). diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index e0fe410e96..4d13e2a7b7 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -63,7 +63,7 @@ std::string get_god_dislikes(god_type which_god, bool verbose = false); void dec_penance(int val); void dec_penance(god_type god, int val); -god_type do_god_vengeance(conduct_type thing_done); +bool do_god_vengeance(conduct_type thing_done); bool did_god_conduct(conduct_type thing_done, int pgain, bool known = true, const monsters *victim = NULL); void set_attack_conducts(god_conduct_trigger conduct[3], const monsters *mon, -- cgit v1.2.3-54-g00ecf