Artifact prices

Each artifact has its own individual price, rather than being solely
based on the cost of its base item.
This commit is contained in:
kmhugo
2002-02-02 19:21:33 +00:00
parent 8f1ad60a0e
commit 532242f07f
7 changed files with 72 additions and 48 deletions

View File

@@ -1342,6 +1342,19 @@ uchar inv_prop;
return((boolean)(arti && (arti->inv_prop == inv_prop)));
}
/* Return the price sold to the hero of a given artifact or unique item */
long
arti_cost(otmp)
struct obj *otmp;
{
if (!otmp->oartifact)
return ((long)objects[otmp->otyp].oc_cost);
else if (artilist[otmp->oartifact].cost)
return (artilist[otmp->oartifact].cost);
else
return (100L * (long)objects[otmp->otyp].oc_cost);
}
#endif /* OVLB */
/*artifact.c*/

View File

@@ -469,8 +469,7 @@ struct obj *list;
otmp->otyp == BELL_OF_OPENING ||
otmp->otyp == SPE_BOOK_OF_THE_DEAD ||
otmp->otyp == CANDELABRUM_OF_INVOCATION) {
/* shopkeepers charge 100x; 250x is arbitrary */
u.urexp += 250L * (long)objects[otmp->otyp].oc_cost;
u.urexp += (arti_cost(otmp) * 5 / 2);
if (Has_contents(otmp))
add_artifact_score(otmp->cobj);
}
@@ -498,8 +497,8 @@ winid endwin;
Sprintf(pbuf, "%s (worth %ld %s and %ld points)",
otmp->oartifact ? artifact_name(xname(otmp), &dummy) :
OBJ_NAME(objects[otmp->otyp]),
100L * (long)objects[otmp->otyp].oc_cost, currency(2L),
250L * (long)objects[otmp->otyp].oc_cost);
arti_cost(otmp), currency(2L),
arti_cost(otmp) * 5 / 2);
putstr(endwin, 0, pbuf);
}
if (Has_contents(otmp))

View File

@@ -553,7 +553,7 @@ OBJECT(OBJ("cheap plastic imitation of the Amulet of Yendor",
AMULET_CLASS, 0, 0, 20, 0, 0, 0, 0, 0, 1, HI_METAL),
OBJECT(OBJ("Amulet of Yendor", /* note: description == name */
"Amulet of Yendor"), BITS(0,0,1,0,1,0,1,1,0,0,0,0,MITHRIL), 0,
AMULET_CLASS, 0, 0, 20, 3500, 0, 0, 0, 0, 20, HI_METAL),
AMULET_CLASS, 0, 0, 20, 30000, 0, 0, 0, 0, 20, HI_METAL),
#undef AMULET
/* tools ... */
@@ -653,10 +653,10 @@ WEPTOOL("unicorn horn", (char *)0,
/* two special unique artifact "tools" */
OBJECT(OBJ("Candelabrum of Invocation", "candelabrum"),
BITS(0,0,1,0,1,0,1,1,0,0,0,P_NONE,GOLD), 0,
TOOL_CLASS, 0, 0,10, 3000, 0, 0, 0, 0, 200, HI_GOLD),
TOOL_CLASS, 0, 0,10, 5000, 0, 0, 0, 0, 200, HI_GOLD),
OBJECT(OBJ("Bell of Opening", "silver bell"),
BITS(0,0,1,0,1,1,1,1,0,0,0,P_NONE,SILVER), 0,
TOOL_CLASS, 0, 0,10, 1000, 0, 0, 0, 0, 50, HI_SILVER),
TOOL_CLASS, 0, 0,10, 5000, 0, 0, 0, 0, 50, HI_SILVER),
#undef TOOL
#undef WEPTOOL
@@ -835,7 +835,7 @@ SPELL("freeze sphere", "hardcover", P_MATTER_SPELL, 20, 2, 1, 1, NODIR, CLR
SPELL("blank paper", "plain", P_NONE, 18, 0, 0, 0, 0, HI_PAPER),
/* a special, one of a kind, spellbook */
OBJECT(OBJ("Book of the Dead", "papyrus"), BITS(0,0,1,0,1,0,1,1,0,0,0,P_NONE,PAPER), 0,
SPBOOK_CLASS, 0, 0,20, 3500, 0, 0, 0, 7, 20, HI_PAPER),
SPBOOK_CLASS, 0, 0,20, 10000, 0, 0, 0, 7, 20, HI_PAPER),
#undef SPELL
/* wands ... */

View File

@@ -2800,6 +2800,10 @@ boolean shk_buying;
{
register long tmp = (long) objects[obj->otyp].oc_cost;
if (obj->oartifact) {
tmp = arti_cost(obj);
if (shk_buying) tmp /= 4;
}
switch(obj->oclass) {
case FOOD_CLASS:
/* simpler hunger check, (2-4)*cost */
@@ -2823,7 +2827,6 @@ boolean shk_buying;
tmp /= 2L;
break;
}
if (obj->oartifact) tmp *= 25L;
return tmp;
}