aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-03-27 10:17:25 -0400
committerB. Watson <yalhcru@gmail.com>2021-03-27 10:17:25 -0400
commit7c439dc0c032792749beefe5590632cab8377c43 (patch)
treee54fb4ff7a7748c3c822c33a02cc93bb4cec7905
parent3d61fe0383c6d35f774b18913f8a1e6c01f1d121 (diff)
downloadtaipan-7c439dc0c032792749beefe5590632cab8377c43.tar.gz
Make set_prices() more like Apple version
-rw-r--r--taipan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/taipan.c b/taipan.c
index 7ef42f0..8ee33c8 100644
--- a/taipan.c
+++ b/taipan.c
@@ -401,10 +401,13 @@ unsigned long cash = 0,
unsigned long price[4];
-const int base_price[4][8] = { {1000, 11, 16, 15, 14, 12, 10, 13},
- {100, 11, 14, 15, 16, 10, 13, 12},
- {10, 12, 16, 10, 11, 13, 14, 15},
- {1, 10, 11, 12, 13, 14, 15, 16} };
+const int base_price[4][8] = {
+ /* each row: first number is base price, the rest are
+ multiplier at each port (1-7) */
+ {1000, 11, 16, 15, 14, 12, 10, 13}, /* opium */
+ {100, 11, 14, 15, 16, 10, 13, 12}, /* silk */
+ {10, 12, 16, 10, 11, 13, 14, 15}, /* arms */
+ {1, 10, 11, 12, 13, 14, 15, 16} }; /* general */
/* hkw_ is the warehouse, hold_ is how much of each item is
in your hold. both need to be unsigned (makes no sense to
@@ -1637,7 +1640,7 @@ void cash_or_guns(void) {
void set_prices(void) {
char i;
for(i = 0; i < 4; ++i)
- price[i] = base_price[i][port] / 2 * rand1to3() * base_price[i][0];
+ price[i] = (base_price[i][port] * rand1to3() * base_price[i][0]) / 2;
}
unsigned int warehouse_in_use() {