summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-09 14:59:08 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-09 14:59:08 +0000
commitd9cb0f334db46b516dd51e18ff1615601243452c (patch)
treeee230a1dc4a724773aba2adf27d6793eaba7e0d3
parent451dcff29746799272b48c9b59753f2a09ae9ae8 (diff)
downloadcrawl-ref-d9cb0f334db46b516dd51e18ff1615601243452c.tar.gz
crawl-ref-d9cb0f334db46b516dd51e18ff1615601243452c.zip
Allow bargains in bazaars, ranging from 60% to 95%.
The value of created items is also increased by a fair bit. I also changed species MR as in the last post of FR 1787813: all Elves get 4, Ogre Mage 5, and Demigods also 4. Someone (Darshan?) will probably want to twiddle with the numbers, at least for the bazaars, so for now, I'll put off committing this into 0.3. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2394 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/dungeon.cc25
-rw-r--r--crawl-ref/source/player.cc4
2 files changed, 28 insertions, 1 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index d81c0c96a8..eb7c4639e2 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4901,6 +4901,21 @@ void place_spec_shop( int level_number,
{
env.shop[i].greed = 15 + random2avg(19, 2) + random2(level_number);
}
+
+ // allow bargains in bazaars, prices randomly between 60% and 95%
+ if (you.level_type == LEVEL_PORTAL_VAULT && you.level_type_name == "bazaar")
+ {
+ // need to calculate with factor as greed (unsigned char) is capped at 255
+ int factor = random2(8)+12;
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS, "shop type %d: original greed = %d, factor = %d",
+ env.shop[i].type, env.shop[i].greed, factor);
+ mprf(MSGCH_DIAGNOSTICS, "discount at shop %d is %d%%", i, (20-factor)*5);
+#endif
+ factor *= env.shop[i].greed;
+ factor /= 20;
+ env.shop[i].greed = factor;
+ }
int plojy = 5 + random2avg(12, 3);
if (representative)
@@ -4927,6 +4942,16 @@ void place_spec_shop( int level_number,
item_level = level_number + random2((level_number + 1) * 3);
}
+ // make bazaar items more valuable (up to double value)
+ if (you.level_type == LEVEL_PORTAL_VAULT && you.level_type_name == "bazaar")
+ {
+ int help = random2(item_level) + 1;
+ item_level += help;
+
+ if (item_level > level_number * 5)
+ item_level = level_number * 5;
+ }
+
// don't generate gold in shops! This used to be possible with
// General Stores (see item_in_shop() below) (GDL)
while (true)
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 1553b85763..83841f6f4b 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -980,16 +980,18 @@ int player_res_magic(void)
case SP_HIGH_ELF:
case SP_GREY_ELF:
case SP_SLUDGE_ELF:
+ case SP_DEEP_ELF:
case SP_MOUNTAIN_DWARF:
case SP_VAMPIRE:
+ case SP_DEMIGOD:
rm = you.experience_level * 4;
break;
case SP_NAGA:
+ case SP_OGRE_MAGE:
rm = you.experience_level * 5;
break;
case SP_PURPLE_DRACONIAN:
case SP_GNOME:
- case SP_DEEP_ELF:
rm = you.experience_level * 6;
break;
case SP_SPRIGGAN: