Commit Graph

216 Commits

Author SHA1 Message Date
PatR
8d65d6dbf0 fix #H3134 - selling container for credit
If a container holds anything that a shop wouldn't ordinarily
buy and sell and you sell it for gold, the 'foreign' contents
are marked no_charge and hero still owns them.  But selling the
same container+contents for credit instead of gold would take
shop possession of all the contents without increasing the
credit amount.

The fixes entry is longer than the fix.  It solves cited case but
I won't be surprised much if it messes up some other case(s).
2020-12-11 22:32:38 -08:00
PatR
2db51cf8bd fix #K3016 - kicking a bag of gold in a shop
Kicking a container that had gold in it took the gold amount
away from hero's credit or added to hero's debt, then didn't
give a refund if the container and its gold landed within the
shop.  Throwing behaved likewise, just less verbosely.

The problem is caused by addtobill() treating gold specially
and then subfrombill() not being able to perform a reverse
operation.  Actually, it may be possible for subfrombill() to
do that, but verifying all its uses is too much work.  This
moves the gold handling for drop+selling into its own routine
and adds calls to that for the throwing and kicking refunds.
The other calls to subfrombill() outside of shk.c appear to be
ok as-is.  (The calls inside that file are the ones that still
need evaluation if the gold handling is to move to there.)

bill_dummy_object() now uses the same o_id assignment for its
dummy object as split_object() does for its new partial stack.
I don't know whether the old code led to any price glitches.
2020-11-25 14:33:14 -08:00
PatR
3e9d8f9aa5 'showscore' vs containers
When SCORE_ON_BOTL is enabled, you could tell how much gold is
inside a container with unknown contents by having 'showsore' On
and watching how much the score changed on the status line when
picking the container up.
2020-11-21 17:37:01 -08:00
Pasi Kallinen
6ec55a3624 Rework stairs structure
Use a linked list to store stair and ladder information, instead
of having fixed up/down stairs/ladders and a single "special" (branch)
stair.

Breaks saves and bones.

Adds information to migrating objects and monsters for the dungeon
and level where they are migrating from.
2020-11-13 20:27:17 +02:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
PatR
804499d9be add some new, easier achievements
Introduce eight achievements that can be attained by more players.
 Entered Gnomish Mines  - self explanatory
 Entered Mine Town      - the town portion, not just the level
 Entered a shop         - any tended shop on any level
 Entered a temple       - likewise for temple
 Consulted the Oracle   - bought at least one major or minor oracle
 Read a Discworld Novel - read at least one passage
 Entered Sokoban        - like mines
 Entered the Big Room   - not always possible since not always present

The novel and bigroom ones aren't always achieveable since novels are
only guaranteed if a book or scroll shop gets created and bigroom is
only guaranteed in wizard mode.  No one ever claimed that every
possible achievement can be attained in a single game.  (If one for
entering the Fort Ludios level--or perhaps entering the Fort itself--
eventually gets add, that won't be possible in every game either.)

The mine town one probably needs some tweaking.  Two of the town's
seven variants have no town boundary (despite a rectangular area of
pre-defined map) and at present simply arriving on either of those
levels is enough to be credited with the entered-town achievement.

Bump EDITLEVEL because u.uachieved[] has increased in size.  This
time it has been expanded to the maximum that xlogfile's bitmask of
achievements can handle, enough for up to 9 more achievements without
another EDITLEVEL increment.
2020-02-12 14:35:37 -08:00
copperwater
43d06a4911 Default shk sell prompt to N
It can get annoying when you accidentally sell something you didn't mean
to by hitting space or enter at this prompt.
2020-01-04 22:54:14 +01:00
Patric Mueller
2ae7cf02ea Replace "money" in in-game texts with "gold"
When GOLDOBJ was activated unconditionally, several texts started referencing
"money" instead of "gold".

As we don't have the intention to introduce a complex coin system with
different denominations, change it back and also some other places that
reference "money".
2020-01-01 10:59:24 +01:00
nhmall
f48ac58561 Merge branch 'NetHack-3.6' 2019-12-13 17:37:46 -05:00
PatR
8a57029503 spelling and typo fixes
Submitted for 3.7.0; all but one also apply to 3.6.3.

I rewrote the curses terminal-too-small message instead of just
fixing the spelling of "minumum".
2019-12-11 12:35:45 -08:00
nhmall
a7e3129919 Merge branch 'NetHack-3.6' 2019-11-05 11:02:24 -05:00
nhmall
25edd16945 code maintenance bit to white-list current "You hear" instances
Flag existing occurrences of "You hear" as "Deaf-aware" so
that a grep for that string in the future doesn't need to
trigger further investigation of those.
2019-11-04 12:28:25 -05:00
nhmall
f07bf610b8 Merge branch 'NetHack-3.6' 2019-11-04 01:18:24 -05:00
nhmall
93f95dd051 more deafness-related message corrections 2019-11-04 00:36:54 -05:00
nhmall
3dd7325ff1 Merge branch 'NetHack-3.6' 2019-10-19 12:30:38 -04:00
PatR
f114675739 containers in shops
Fix a couple of bugs I stumbled across while testing something else.
The sell prompt for a container dropped in a shop had phrasing issues.
This fixes a couple but there are more.  The message composition
assumes that contents fall into two categories:  those already owned
by the shop and those the shopkeeper is offering to buy from the hero.
But there is a third:  stuff the shopkeeper doesn't care about so
won't buy.  The count_contents() routine can supply total contents or
shop-owned contents.  Subtracting one from the other yields combined
hero-owned without any way to separate out shk-cares and don't-care.
2019-10-18 15:00:16 -07:00
nhmall
c38c1aaf65 Merge branch 'NetHack-3.6' 2019-10-18 11:15:35 -04:00
PatR
1086f137de revert part of 4b87e858aa - partly eaten food
Partly eaten globs is seems to be can'o'worms and the hack I just
added to get_pricing_units() made things worse, so back that out.
2019-10-17 18:55:35 -07:00
PatR
4b87e858aa fix #H9312 - partly eaten food in bones shop
Dying in a shop while carrying partly eaten food would place that food
on the floor without marking it no_charge.  But marking it that way
wouldn't have helped because as bones data gets saved, every object on
the level has its no_charge flag cleared.  So 'no_charge' needs to be
explicitly set for partly eaten food in tended shops as a bones level
gets loaded.

Most of the shk.c diff is reformatting, but it does change the
get_pricing_units() routine to lie that the quantity is zero for
partly eaten food so that when multiplying with price it won't matter
whether the price has been forced to zero or been left non-zero.
2019-10-17 18:45:56 -07:00
nhmall
2f49d34019 Merge branch 'NetHack-3.6' 2019-10-04 22:31:35 -04:00
PatR
8443f73265 glob pricing
get_pricing_units() returns a long, so use long for intermediate steps
of the calculation.  Part of github issue 229, about mixing signed and
unsigned.
2019-10-04 17:53:01 -07:00
nhmall
a36792162c Merge branch 'NetHack-3.6' 2019-08-30 22:11:44 -04:00
nhmall
8a328ff7eb quite some Xcode warnings 2019-08-17 12:55:48 -04:00
nhmall
0d34f43830 remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from core 2019-07-14 17:24:58 -04:00
nhmall
77fd719e05 Merge branch 'NetHack-3.6' 2019-07-13 00:38:10 -04:00
nhmall
638d9f9363 if prototype is declared static make function static to match
Today, a compiler was encountered that considered it an error
to have the prototype declared static and the function body
not
2019-07-13 00:17:23 -04:00
nhmall
4be2f98063 Merge branch 'NetHack-3.6' 2019-05-19 10:12:39 -04:00
nhmall
336908ad3c grammar bit 2019-05-18 16:44:57 -04:00
nhmall
8e972874b2 Merge branch 'NetHack-3.6' 2019-05-18 16:30:43 -04:00
nhmall
670fc9ca34 further improve additional glob interaction scenarios within a shop
Scenarios:
1. shop_owned glob merging into shop_owned glob
2. player_owned glob merging into shop_owned glob
3. shop_owned glob merging into player_owned glob
4. player_owned glob merging into player_owned glob
2019-05-18 16:24:48 -04:00
nhmall
b2dccb21a4 Merge branch 'NetHack-3.6' 2019-05-17 16:19:17 -04:00
nhmall
f172c6fd94 comment typo and an unused variable 2019-05-17 16:15:24 -04:00
nhmall
c5fbae0a4c Merge branch 'NetHack-3.6' 2019-05-17 12:06:58 -04:00
nhmall
2aee73642d fix some billing and pricing issues when globs coalesce
payment issue caused by glob coalescing
glob pricing did not consider coalesced weight
2019-05-17 12:04:01 -04:00
nhmall
4a08af404b Merge branch 'NetHack-3.6' 2019-05-10 13:43:43 -04:00
nhmall
a60e4f5dc6 try to extract a bit more info from impossible obfree: not on bill 2019-05-10 13:11:39 -04:00
nhmall
d15496ba31 Merge branch 'NetHack-3.6.2' 2019-04-22 14:36:58 -04:00
nhmall
dcf4da2150 preserve dknown field between fakeobj instances
Preserve temporary fake object's previous dknown value by storing it
as a flag value within the m_ap_type field of the posing monster, and
recalling it when it is needed.

This is intended to help eliminate observable differences in price display
between real objects and mimics posing as objects.

98% of this is just switching the code to utilize macro M_AP_TYPE(mon)
everywhere to ensure that the flag bits are stripped off when needed.
2019-04-22 14:17:18 -04:00
nhmall
c4465c35ed Merge branch 'NetHack-3.6.2' 2019-04-13 22:40:44 -04:00
PatR
0776a864f1 slightly better shop repair feedback
During shop repair, give a message about the shopkeeper using a spell
(if hero is close enough) before "Suddenly, <various repairs occur>."
And when shop repair is for a single untrap of landmine or bear trap
adjacent to shk (and the hero can see it happen), say "<Shk> untraps
<trap>" rather than just "Suddenly, a trap is removed from the floor!"
2019-04-13 17:28:26 -07:00
PatR
fa98c6fb72 fix #H8534 - thrown pick-axe vs "scum!"
[I accidentally left this out of the earlier patch.]

Change in meaning of mnearto()'s return value wasn't progagated to
shkcatch(). Make it an int instead of boolean so that it can
communicate both 'moved successfully' and 'moved but had to move
another monster out of the way to do so'.
2019-04-12 01:33:42 -07:00
nhmall
d2262ca0ec Merge branch 'NetHack-3.6.2' 2019-03-05 22:02:09 -05:00
PatR
e2b6cf4066 fix #H8319 - hero-owned container used inside shop
showed non-empty containers in inventory (including the one being
applied) with a 'for sale' suffix during put-in operations, as if the
shop was trying to sell it to the hero.  Amount shown was cumulative
value of its contents.  (Using /menustyle:T doesn't show the container
being applied so this wasn't visible with it unless other non-empty
containers were being carried.)

Two or three fix attempts solved one problem but introduced another.
This one seems to finally get things right but considering that there
was trial and error along the way, my confidence isn't great.
2019-03-04 14:40:01 -08:00
nhmall
9bb43c39fb Merge branch 'NetHack-3.6.2' 2019-02-13 15:09:02 -05:00
PatR
4bb5560961 more #H8167 - late messages
Do late message suppression in a different fashion.  Also, there are
more messages than shk taking hero's possessions and guard taking
hero's gold that need to be suppressed if regular message delivery
is no longer possible:  "do not pass Go", "you arise from the grave
as a foo", "the corridor disappears", "you are encased in the rock".
Those last two are from vault handling but take place in a convoluted
manner:  paygd -> mongone -> grddead -> clear_fcorr.
2019-02-11 13:39:34 -08:00
nhmall
f5231ece89 Merge branch 'NetHack-3.6.2' 2019-02-11 12:06:46 -05:00
PatR
f3e7f49714 fix #H8167 - shopkeeper message after ending game
Closing nethack's window sets 'program_state.stopprint' to inhibit
disclosure interaction, but shopkeeper claiming hero's stuff or vault
guard claiming hero's gold didn't honor that and just issued normal
pline messages.  For win32, they got delivered in a popup even though
nethack's window had gone away.

Make those two end-of-game situations honor 'program_state.stopprint'.
[Fix not tested on win32...]
2019-02-10 17:45:26 -08:00
nhmall
16d5d3f2e5 Merge branch 'NetHack-3.6.2' 2019-01-31 19:48:51 -05:00
PatR
8bf16b940e stale lock picking context
Lock context wasn't being cleared if it was for a container and that
container got destroyed.  Case discovered was forcelock() ->
breakchestlock() -> delobj() (sometimes the container is destroyed
rather than just breaking its lock) followed by #wizmakemap (replace
current level) and maybe_reset_pick() trying to check whether
xlock.box was being carried.  But being interrupted, destroying the
container or dropping it down a hole to ship it to another level, then
attempting to resume picking the lock would also find a stale pointer.
2019-01-31 15:50:12 -08:00
nhmall
28ac8090f9 Merge branch 'NetHack-3.6.2' 2019-01-18 18:51:12 -05:00