diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-09 15:38:21 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-09 15:38:21 +0000 |
commit | 3fcc28592001fa644a08d88517d15380de417107 (patch) | |
tree | d4b19c1730d9c92fccff13f080386a508ba32a72 /crawl-ref/source/religion.cc | |
parent | eb847d5f2f0331435f6bc081d1009bdf3982fd31 (diff) | |
download | crawl-ref-3fcc28592001fa644a08d88517d15380de417107.tar.gz crawl-ref-3fcc28592001fa644a08d88517d15380de417107.zip |
Nemelex now remembers what you've sacrificed and gifts decks accordingly.
High-value sacrifices can reduce the gift countdown.
Nemelex is easier to please.
Breaks savefiles.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1821 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index cfd0bfd0e1..2de5c3d88a 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -476,7 +476,17 @@ static void do_god_gift() MISC_DECK_OF_SUMMONING, MISC_DECK_OF_WONDERS }; - gift_type = RANDOM_ELEMENT(pure_decks); + int weights[5]; + weights[0] = you.sacrifice_value[OBJ_SCROLLS] + + you.sacrifice_value[OBJ_ARMOUR] + 1; + weights[1] = you.sacrifice_value[OBJ_WEAPONS] + + you.sacrifice_value[OBJ_STAVES] + + you.sacrifice_value[OBJ_MISSILES] + 1; + weights[2] = you.sacrifice_value[OBJ_MISCELLANY]; + weights[3] = you.sacrifice_value[OBJ_CORPSES] * 100; + weights[4] = you.sacrifice_value[OBJ_POTIONS]; + gift_type = pure_decks[choose_random_weighted(weights, + weights+5)]; } else { @@ -2445,21 +2455,42 @@ void offer_items() const int value = item_value( mitm[i], true ); +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Sacrifice item value: %d", value); +#endif + switch (you.religion) { + case GOD_NEMELEX_XOBEH: + you.sacrifice_value[mitm[i].base_type] += value; + if ( you.attribute[ATTR_CARD_COUNTDOWN] && + random2(800) < value ) + { + you.attribute[ATTR_CARD_COUNTDOWN]--; +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Countdown down to %d", + you.attribute[ATTR_CARD_COUNTDOWN]); +#endif + } + + mprf(MSGCH_GOD, "%s%s", mitm[i].name(DESC_CAP_THE).c_str(), + sacrifice_message(you.religion, mitm[i]).c_str()); + if ((mitm[i].base_type == OBJ_CORPSES && coinflip()) + // Nemelex piety gain is fairly fast. + || random2(value) >= random2(60)) + { + gain_piety(1); + } + destroy_item(i); + break; + case GOD_ZIN: case GOD_OKAWARU: case GOD_MAKHLEB: - case GOD_NEMELEX_XOBEH: mprf(MSGCH_GOD, "%s%s", mitm[i].name(DESC_CAP_THE).c_str(), sacrifice_message(you.religion, mitm[i]).c_str()); - -#ifdef DEBUG_DIAGNOSTICS - mprf(MSGCH_DIAGNOSTICS, "Sacrifice item value: %d", value); -#endif if (mitm[i].base_type == OBJ_CORPSES || random2(value) >= 50 - || (you.religion == GOD_NEMELEX_XOBEH && one_chance_in(50)) || player_under_penance()) { gain_piety(1); |