diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-23 21:23:06 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-23 21:23:06 +0000 |
commit | 1b6a9218017b078613a735323eed1c334a06c793 (patch) | |
tree | cc9a1e6c443f522df8ac108ac4ff584a694944df /crawl-ref/source/religion.cc | |
parent | 11adfeb2d7e54e3a43e518785c4d34cb3d4e8df1 (diff) | |
download | crawl-ref-1b6a9218017b078613a735323eed1c334a06c793.tar.gz crawl-ref-1b6a9218017b078613a735323eed1c334a06c793.zip |
Receiving a pure deck from Nemelex now decays the appropriate sacrifice
weight by 20%.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2525 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 2b7ec23128..7fc6188660 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -532,6 +532,48 @@ static void get_pure_deck_weights(int weights[]) you.sacrifice_value[OBJ_FOOD]; } +static void update_sacrifice_weights(int which) +{ + switch ( which ) + { + case 0: + you.sacrifice_value[OBJ_ARMOUR] /= 5; + you.sacrifice_value[OBJ_ARMOUR] *= 4; + break; + case 1: + you.sacrifice_value[OBJ_WEAPONS] /= 5; + you.sacrifice_value[OBJ_STAVES] /= 5; + you.sacrifice_value[OBJ_MISSILES] /= 5; + you.sacrifice_value[OBJ_WEAPONS] *= 4; + you.sacrifice_value[OBJ_STAVES] *= 4; + you.sacrifice_value[OBJ_MISSILES] *= 4; + break; + case 2: + you.sacrifice_value[OBJ_MISCELLANY] /= 5; + you.sacrifice_value[OBJ_JEWELLERY] /= 5; + you.sacrifice_value[OBJ_BOOKS] /= 5; + you.sacrifice_value[OBJ_GOLD] /= 5; + you.sacrifice_value[OBJ_MISCELLANY] *= 4; + you.sacrifice_value[OBJ_JEWELLERY] *= 4; + you.sacrifice_value[OBJ_BOOKS] *= 4; + you.sacrifice_value[OBJ_GOLD] *= 4; + case 3: + you.sacrifice_value[OBJ_CORPSES] /= 5; + you.sacrifice_value[OBJ_CORPSES] *= 4; + break; + case 4: + you.sacrifice_value[OBJ_POTIONS] /= 5; + you.sacrifice_value[OBJ_SCROLLS] /= 5; + you.sacrifice_value[OBJ_WANDS] /= 5; + you.sacrifice_value[OBJ_FOOD] /= 5; + you.sacrifice_value[OBJ_POTIONS] *= 4; + you.sacrifice_value[OBJ_SCROLLS] *= 4; + you.sacrifice_value[OBJ_WANDS] *= 4; + you.sacrifice_value[OBJ_FOOD] *= 4; + break; + } +} + #if DEBUG_GIFTS || DEBUG_CARDS static void show_pure_deck_chances() { @@ -573,11 +615,12 @@ static void give_nemelex_gift() }; int weights[5]; get_pure_deck_weights(weights); - gift_type = pure_decks[choose_random_weighted(weights, weights+5)]; - + const int choice = choose_random_weighted(weights, weights+5); + gift_type = pure_decks[choice]; #if DEBUG_GIFTS || DEBUG_CARDS show_pure_deck_chances(); #endif + update_sacrifice_weights(choice); } else { |