summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shopping.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-22 18:20:06 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-22 18:20:06 +0000
commit461b3e21bdc62c92c0237ac61960489771579fbb (patch)
treeaf089546dc64aa0585dfacc3b356eb072aed0546 /crawl-ref/source/shopping.cc
parent03d0dc004fc0e97aea58665ea1b09f61afbf34f4 (diff)
downloadcrawl-ref-461b3e21bdc62c92c0237ac61960489771579fbb.tar.gz
crawl-ref-461b3e21bdc62c92c0237ac61960489771579fbb.zip
In the shopping code, add price modifiers for weapons of returning,
branded and racial missiles (of the former, only those that are currently randomly generated), and scrolls of vulnerability. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8698 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r--crawl-ref/source/shopping.cc73
1 files changed, 63 insertions, 10 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 742f991b14..56aeb2df3c 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -831,6 +831,7 @@ unsigned int item_value( item_def item, bool ident )
case SPWPN_FROST:
case SPWPN_HOLY_WRATH:
case SPWPN_REACHING:
+ case SPWPN_RETURNING:
valued *= 50;
break;
@@ -940,16 +941,6 @@ unsigned int item_value( item_def item, bool ident )
break;
case OBJ_MISSILES: // ammunition
- if (item_ident( item, ISFLAG_KNOW_PLUSES ))
- {
- // assume not cursed (can they be anyway?)
- if (item.plus < 0)
- valued -= 11150;
-
- if (item.plus >= 0)
- valued += (item.plus * 2);
- }
-
switch (item.sub_type)
{
case MI_DART:
@@ -973,6 +964,67 @@ unsigned int item_value( item_def item, bool ident )
valued += 5;
break;
}
+
+ if (item_type_known(item))
+ {
+ switch (get_ammo_brand( item ))
+ {
+ case SPMSL_NORMAL:
+ default:
+ valued *= 10;
+ break;
+
+ case SPMSL_RETURNING:
+ valued *= 50;
+ break;
+
+ case SPMSL_CHAOS:
+ valued *= 40;
+ break;
+
+ case SPMSL_CURARE:
+ valued *= 30;
+ break;
+
+ case SPMSL_FLAME:
+ case SPMSL_FROST:
+ valued *= 25;
+ break;
+
+ case SPMSL_POISONED:
+ valued *= 23;
+ break;
+ }
+
+ valued /= 10;
+ }
+
+ if (get_equip_race(item) == ISFLAG_ELVEN
+ || get_equip_race(item) == ISFLAG_DWARVEN)
+ {
+ valued *= 12;
+ valued /= 10;
+ }
+
+ if (get_equip_race(item) == ISFLAG_ORCISH)
+ {
+ valued *= 8;
+ valued /= 10;
+ }
+
+ if (item_ident( item, ISFLAG_KNOW_PLUSES ))
+ {
+ if (item.plus >= 0)
+ valued += (item.plus * 2);
+
+ if (item.plus < 0)
+ {
+ valued += item.plus * item.plus * item.plus;
+
+ if (valued < 1)
+ valued = 1;
+ }
+ }
break;
case OBJ_ARMOUR:
@@ -1407,6 +1459,7 @@ unsigned int item_value( item_def item, bool ident )
break;
case SCR_TORMENT:
case SCR_HOLY_WORD:
+ case SCR_VULNERABILITY:
valued += 75;
break;
case SCR_ENCHANT_WEAPON_II: