From ae37a1197a6c0e809b71678667337c762b5d7efa Mon Sep 17 00:00:00 2001 From: vultur-cadens Date: Thu, 14 Apr 2022 21:39:06 -0700 Subject: [PATCH] Unidentified gem selling prices Make the token selling prices for unidentified gems not depend on how many items were defined before FIRST_GEM. Now the unidentified gem selling prices will depend only on the number and defined order of the types of gems, and won't inexplicably change when objects are added, or depend on compile-time options such as MAIL. Also don't do the regular item price reduction for unidentified gems, since they are already not based on the actual value. This restores the pre-3.6 behavior, allowing players to gain a bit more information from the nominal selling prices of unidentified gems. Whoever first introduced this special handling for gems probably intended for players to be able to gain information from gem prices this way, but probably nobody has been doing it since 3.6. --- src/shk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shk.c b/src/shk.c index a7b02c10e..40d965e75 100644 --- a/src/shk.c +++ b/src/shk.c @@ -2337,8 +2337,9 @@ set_cost(register struct obj* obj, register struct monst* shkp) /* different shop keepers give different prices */ if (objects[obj->otyp].oc_material == GEMSTONE || objects[obj->otyp].oc_material == GLASS) { - tmp = (obj->otyp % (6 - shkp->m_id % 3)); + tmp = ((obj->otyp - FIRST_GEM) % (6 - shkp->m_id % 3)); tmp = (tmp + 3) * obj->quan; + divisor = 1L; } } else if (tmp > 1L && !(shkp->m_id % 4)) multiplier *= 3L, divisor *= 4L;