calculating shop price adjustments (trunk only)
Fix the second of a couple of minor things I noticed when viewing
that guy's ttyrec about a hidden inventory item which turned out to be
scrolls of scare monster on the used-up items section of his shop bill.
He had a lot of scroll prices which started as $X00 and were changed
to $Y99 due to integer division roundoff when being hit with a 1/3 price
increase for unID'd items followed by 1/2 price increase for low charisma:
100 -> 133 -> 199
200 -> 266 -> 399
Forcing things to round up instead of truncate would help in some cases
but yield $Z01 in others. Rather than doing that, this accumulates the
adjustment factors and then uses them to make one calculation which gives
a better result:
100 -> 200
200 -> 400
Other values and/or other adjustments might not work out so well, but I
don't think they'll ever become prices which look worse than before.
For a single increase of 1/3, 100 still yields 133 but 200 now gives 267
(so ends up differing from the combined price for two 100->133 items).
This commit is contained in:
@@ -373,6 +373,7 @@ for poly'd hero hiding on ceiling, attack by sea monsters won't move them
|
||||
into hero's position unless it is over water or they're already on land
|
||||
for poly'd hero hiding on ceiling, attack by long worm might fill hero's
|
||||
destination with worm's tail, so double check and maybe choose again
|
||||
when shop prices are adjusted, handle roundoff (integer truncation) better
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
Reference in New Issue
Block a user