diff options
-rw-r--r-- | crawl-ref/source/describe.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 1 |
3 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index a488a4aa3a..809394b94f 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -3096,9 +3096,9 @@ void describe_god( god_type which_god, bool give_title ) if (which_god == GOD_ZIN) { - have_any = true; - if (you.piety >= piety_breakpoint(0)) + if (zin_sustenance(false)) { + have_any = true; cprintf("Praying to %s will provide sustenance if starving." EOL, god_name(which_god).c_str()); } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index ee3c88255c..10dc786da3 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -739,6 +739,12 @@ void dec_penance(int val) dec_penance(you.religion, val); } +bool zin_sustenance(bool actual) +{ + return (you.piety >= piety_breakpoint(0) + && (!actual || you.hunger_state == HS_STARVING)); +} + bool yred_injury_mirror(bool actual) { return (you.religion == GOD_YREDELEMNUL && !player_under_penance() @@ -1724,8 +1730,7 @@ static void _do_god_gift(bool prayed_for) case GOD_ZIN: //jmf: this "good" god will feed you (a la Nethack) - if (you.hunger_state == HS_STARVING - && you.piety >= piety_breakpoint(0)) + if (zin_sustenance()) { god_speaks(you.religion, "Your stomach feels content."); set_hunger(6000, true); diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 3a1700734b..1276501f85 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -94,6 +94,7 @@ void god_smites_you(god_type god, const char *message = NULL, kill_method_type death_type = NUM_KILLBY); void divine_retribution(god_type god); +bool zin_sustenance(bool actual = true); bool yred_injury_mirror(bool actual = true); bool beogh_water_walk(); void beogh_idol_revenge(); |