diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-17 21:55:31 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-17 21:55:31 +0000 |
commit | bcd3e391a7c63905b95527de38a92b34f535ddd0 (patch) | |
tree | de07bfa61d804a27acafb685056f880c69cacc45 /crawl-ref/source/shopping.cc | |
parent | 44f56edce815f5ff8fb4124829523439f1cc8ad2 (diff) | |
download | crawl-ref-bcd3e391a7c63905b95527de38a92b34f535ddd0.tar.gz crawl-ref-bcd3e391a7c63905b95527de38a92b34f535ddd0.zip |
Some more cards and bugfixes.
Still not implemented:
Shuffle, trowel, minefield, spade, blade.
Partially implemented:
Battlelust, helm, shadow, damage cards.
Breaks savefiles.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1595 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r-- | crawl-ref/source/shopping.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index e7b2765ee7..549dd35976 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -115,12 +115,12 @@ static void in_a_shop( char shoppy ) FixedVector < int, 20 > shop_items; char st_pass[ ITEMNAME_SIZE ] = ""; - unsigned int gp_value = 0; unsigned char ft; std::string purchasable; clrscr(); int itty = 0; + int gp_value; // Should eliminate gotos instead of initializing here ShopInfo &si = stashes.get_shop(the_shop.x, the_shop.y); @@ -174,6 +174,13 @@ static void in_a_shop( char shoppy ) gp_value = the_shop.greed * item_value(mitm[itty], id_stock); gp_value /= 10; + + if ( you.duration[DUR_BARGAIN] ) // 20% discount + { + gp_value *= 8; + gp_value /= 10; + } + if (gp_value <= 1) gp_value = 1; @@ -283,7 +290,12 @@ static void in_a_shop( char shoppy ) goto purchase; } - gp_value = the_shop.greed * item_value(mitm[shop_items[ft]], id_stock)/10; + gp_value = the_shop.greed*item_value(mitm[shop_items[ft]],id_stock)/10; + if ( you.duration[DUR_BARGAIN] ) // 20% discount + { + gp_value *= 8; + gp_value /= 10; + } if (gp_value > you.gold) { |