diff options
author | Chris Campbell <chriscampbell89@gmail.com> | 2014-05-21 16:17:58 +0100 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-05-21 16:17:58 +0100 |
commit | 20a0feea4c139e3bbc133b1b3fbf01ef8ec065d2 (patch) | |
tree | eac3a5a0c7534fe701da84224b7798b92029896d /crawl-ref/source/religion.cc | |
parent | 6f877a7c7aa60250b21f85ddcee17c237126b3cc (diff) | |
download | crawl-ref-20a0feea4c139e3bbc133b1b3fbf01ef8ec065d2.tar.gz crawl-ref-20a0feea4c139e3bbc133b1b3fbf01ef8ec065d2.zip |
Remove a breakpoint for missile gifting from gods
Allows ammo gifts (rarely) with throwing/missile skills below 8, and
also removes an inventory check for launchers. Also reduce the chance
of getting ammo from forced gifts, for wizmode convenience.
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 16715d805e..14117d5e58 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1466,32 +1466,17 @@ int yred_random_servants(unsigned int threshold, bool force_hostile) return created; } -static const item_def* _find_missile_launcher(int skill) -{ - for (int i = 0; i < ENDOFPACK; ++i) - { - if (!you.inv[i].defined()) - continue; - - const item_def &item = you.inv[i]; - if (is_range_weapon(item) - && range_skill(item) == skill_type(skill)) - { - return &item; - } - } - return NULL; -} - static bool _need_missile_gift(bool forced) { - const skill_type sk = best_skill(SK_SLINGS, SK_THROWING); - if (sk != SK_THROWING && !_find_missile_launcher(sk)) - return false; - return (forced || you.piety >= piety_breakpoint(2) - && random2(you.piety) > 70 - && one_chance_in(8)) - && you.skills[sk] /* no skill boosts */ >= 8; + skill_type sk = best_skill(SK_SLINGS, SK_THROWING); + // Default to throwing if all missile skills are at zero. + if (you.skills[sk] == 0) + sk = SK_THROWING; + return (forced + || (you.piety >= piety_breakpoint(2) + && random2(you.piety) > 70 + && one_chance_in(8) + && x_chance_in_y(1 + you.skills[sk], 12))); } static bool _give_nemelex_gift(bool forced = false) @@ -2266,7 +2251,7 @@ bool do_god_gift(bool forced) const bool need_missiles = _need_missile_gift(forced); object_class_type gift_type; - if (forced && (!need_missiles || one_chance_in(4)) + if (forced && coinflip() || (!forced && you.piety >= piety_breakpoint(4) && random2(you.piety) > 120 && one_chance_in(4))) |