summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player-equip.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-04-04 13:47:08 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-07 18:23:21 -0600
commit154a4d40c93085bffb07c142aa784e5d561fd3b6 (patch)
treeeec7971f6f493083f25ce6e48ad236f87567fb1a /crawl-ref/source/player-equip.cc
parent6c4c28ead39be3cd334424aea31b5898990d2b05 (diff)
downloadcrawl-ref-154a4d40c93085bffb07c142aa784e5d561fd3b6.tar.gz
crawl-ref-154a4d40c93085bffb07c142aa784e5d561fd3b6.zip
Gozag: interactions with amulet of faith.
Prices are 2/3 what they would be otherwise, and removing the amulet counts as two uses of the relevant ability for price purposes.
Diffstat (limited to 'crawl-ref/source/player-equip.cc')
-rw-r--r--crawl-ref/source/player-equip.cc50
1 files changed, 50 insertions, 0 deletions
diff --git a/crawl-ref/source/player-equip.cc b/crawl-ref/source/player-equip.cc
index 9be761d570..ac505c28ee 100644
--- a/crawl-ref/source/player-equip.cc
+++ b/crawl-ref/source/player-equip.cc
@@ -1100,6 +1100,56 @@ static void _remove_amulet_of_faith(item_def &item)
{
simple_god_message(" seems less interested in you.");
+ if (you_worship(GOD_GOZAG))
+ {
+ const int potion_increment = 2;
+ const int shop_increment =
+ GOZAG_SHOP_BASE_MULTIPLIER
+ + GOZAG_SHOP_MOD_MULTIPLIER*you.attribute[ATTR_GOZAG_SHOPS]
+ >= 100
+ ? 0
+ : min(2, (100
+ - GOZAG_SHOP_BASE_MULTIPLIER
+ - GOZAG_SHOP_MOD_MULTIPLIER
+ *you.attribute[ATTR_GOZAG_SHOPS])
+ / GOZAG_SHOP_MOD_MULTIPLIER);
+
+ // XXX: this isn't a 100% match for the list generation; in
+ // particular it does not take into account the presence/absence
+ // of bad potions.
+ if (you.props.exists(make_stringf(GOZAG_PRICE_KEY, 0)))
+ {
+ const int denom = GOZAG_POTION_BASE_MULTIPLIER
+ + you.attribute[ATTR_GOZAG_POTIONS];
+ const int num = denom + potion_increment;
+ for (int i = 0; i < GOZAG_MAX_POTIONS; i++)
+ {
+ int &price =
+ you.props[make_stringf(GOZAG_PRICE_KEY, i)].get_int();
+ price *= num;
+ price /= denom;
+ }
+ }
+ if (you.props.exists(make_stringf(GOZAG_SHOP_COST_KEY, 0))
+ && shop_increment > 0)
+ {
+ const int denom = GOZAG_SHOP_BASE_MULTIPLIER
+ + GOZAG_SHOP_MOD_MULTIPLIER
+ * you.attribute[ATTR_GOZAG_SHOPS];
+ const int num = denom + shop_increment;
+ for (int i = 0; i < GOZAG_MAX_SHOPS; i++)
+ {
+ int &price =
+ you.props[make_stringf(GOZAG_SHOP_COST_KEY, i)]
+ .get_int();
+ price *= num;
+ price /= denom;
+ }
+ }
+ simple_god_message(" adjusts your offered prices.");
+ return;
+ }
+
const int piety_loss = div_rand_round(you.piety, 3);
// Piety penalty for removing the Amulet of Faith.
if (you.piety - piety_loss > 10)