summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/object2.cc5
-rw-r--r--src/options.cc1
-rw-r--r--src/options.hpp1
-rw-r--r--src/store.cc9
-rw-r--r--src/tables.cc3
5 files changed, 16 insertions, 3 deletions
diff --git a/src/object2.cc b/src/object2.cc
index a3abdbba..7093b94e 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -16,6 +16,7 @@
#include "mimic.hpp"
#include "monster2.hpp"
#include "object1.hpp"
+#include "options.hpp"
#include "randart.hpp"
#include "skills.hpp"
#include "spells2.hpp"
@@ -5070,6 +5071,10 @@ bool_ make_gold(object_type *j_ptr)
/* Determine how much the treasure is "worth" */
j_ptr->pval = (base + (8L * randint(base)) + randint(8));
+
+ /* Multiply value by 5 if selling is disabled */
+ if (no_selling)
+ j_ptr->pval *= 5;
/* Success */
return (TRUE);
diff --git a/src/options.cc b/src/options.cc
index 490b0245..0e3df5d0 100644
--- a/src/options.cc
+++ b/src/options.cc
@@ -89,3 +89,4 @@ bool_ ironman_rooms;
bool_ joke_monsters;
bool_ point_based;
bool_ preserve;
+bool_ no_selling;
diff --git a/src/options.hpp b/src/options.hpp
index a8a0c9f8..2035d4d8 100644
--- a/src/options.hpp
+++ b/src/options.hpp
@@ -89,3 +89,4 @@ extern bool_ ironman_rooms;
extern bool_ joke_monsters;
extern bool_ point_based;
extern bool_ preserve;
+extern bool_ no_selling;
diff --git a/src/store.cc b/src/store.cc
index 1a26f536..195598f1 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -297,6 +297,9 @@ static s32b price_item(object_type *o_ptr, int greed, bool_ flip)
/* Mega-Hack -- Black market sucks */
if (st_info[st_ptr->st_idx].flags1 & SF1_ALL_ITEM) price = price / 2;
+
+ /* No selling means you get no money */
+ if (no_selling) price = 0;
}
/* Shop is selling */
@@ -310,14 +313,14 @@ static s32b price_item(object_type *o_ptr, int greed, bool_ flip)
/* Mega-Hack -- Black market sucks */
if (st_info[st_ptr->st_idx].flags1 & SF1_ALL_ITEM) price = price * 2;
+
+ /* Never give items away for free */
+ if (price <= 0L) price = 1L;
}
/* Compute the final price (with rounding) */
price = (price * adjust + 50L) / 100L;
- /* Note -- Never become "free" */
- if (price <= 0L) return (1L);
-
/* Return the price */
return (price);
}
diff --git a/src/tables.cc b/src/tables.cc
index adb4ecf7..6796df31 100644
--- a/src/tables.cc
+++ b/src/tables.cc
@@ -1479,6 +1479,9 @@ option_type option_info[] =
{ &fate_option, TRUE, 6, 18,
"fate_option", "You can receive fates, good or bad" },
+
+ { &no_selling, FALSE, 6, 20,
+ "no_selling", "Items always sell for 0 gold" },
/*** End of Table ***/