Commit Graph

4298 Commits

Author SHA1 Message Date
nhmall
fe68925100 another BL_CHARACTERISTICS fix
With the code as it stood, receipt of BL_CHARACTERISTICS would
trigger a flush of output which may not have been the
intention.

Ensure the flush code is only on BL_FLUSH (or BL_RESET).
2018-09-22 09:11:51 -04:00
nhmall
0aa9e00099 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-09-22 09:01:37 -04:00
nhmall
0a52543076 avoid illegal array indexes now that the enum treads beyond BL_FLUSH 2018-09-22 08:58:38 -04:00
Pasi Kallinen
39d10d96df Prevent leash showing unseen monster as "it" 2018-09-22 15:55:26 +03:00
nhmall
8e4ce066c9 fix C343-331 mirrors & sleeping mon
This outstanding bug was complicated slightly because the same
code was used for a sleeping mon as for a paralyzed mon so
message phrasing was called into question.

Just flip the phrasing to be about what you are able to discern
under those circumstances, which is very little, and don't have
the sleeping or paralyzed monster react to the mirror.
2018-09-21 23:34:00 -04:00
nhmall
25fcaa614c another orctown follow-up tuning bit 2018-09-21 11:54:43 -04:00
nhmall
a18ae517f8 some orctown follow-up bits, fix Bad fruit #0 and some minor tuning 2018-09-21 11:31:01 -04:00
PatR
dbf3816cc4 do_name.c cleanup
Some formatting and several things that warrant being 'static'.
2018-09-20 16:16:58 -07:00
PatR
49e4330cb2 special levels 'grow selection'
Fixes #132

This is based on the commit for github pull request #132, which
indicates that the 'grow' pattern is reversed from what the .des
file specifies.  I don't understand how this is really supposed
to work and the only place nethack uses it is on the Valkyrie Home
level, which seems to be created roughly the same both before and
after this change.
2018-09-20 15:19:50 -07:00
nhmall
672e28d294 Merge branch 'fix-grammar-and-punctuation' of https://github.com/mogigoma/NetHack into mogigoma-fix-grammar-and-punctuation 2018-09-20 18:01:32 -04:00
nhmall
9c6fe0b377 initialize a supplement buffer 2018-09-20 17:58:10 -04:00
PatR
4abaccfc34 missile launching traps
Factor some common code for missile launching traps into a seprate
routine.

Reorder the prototypes for static routines in trap.c into the same
order as theose functions appear in the file.
2018-09-20 14:18:30 -07:00
PatR
450542a502 grow-up of unnamed pet
Change the phrasing when a pet grows up into another monster type:
(old) "The pony grows up into a horse."
(new) "Your pony grows up into a horse."
No effect if it has been assigned a name:
(before and after) "Foo grows up into a horse."
2018-09-20 14:09:25 -07:00
PatR
792eb64af5 build bits
Eliminate a few warnings:  array name used as boolean is always true,
parameter 'flags' shadows (blocks access to) global struct 'flags',
initializer discards 'const' (assigning string literal to 'char *').
Plus a couple of simplifications.
2018-09-20 14:06:17 -07:00
Mak Kolybabi
9c46a26af4 Grammar and punctuation fixes. 2018-09-19 22:48:43 -05:00
nhmall
b816283fa5 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-09-18 20:16:45 -04:00
nhmall
1cef842786 some orctown tuning bits 2018-09-18 20:15:13 -04:00
PatR
4336427745 fix #H7396 - wishing for "orange"
Wishing for "orange" might grant an orange, but it might give an
orange gem, orange potion, or orange spellbook instead (but never
orange dragon scales or orange dragon scale mail).  Force the food
object to be an exact match so wishing always produces an orange.
2018-09-18 16:30:58 -07:00
nhmall
9eb7830819 Gnomish Mines changes involving "Orctown" level variant
Changes to be committed:
	modified:   include/decl.h
	modified:   include/dungeon.h
	modified:   include/extern.h
	modified:   include/hack.h
	modified:   src/decl.c
	modified:   src/do_name.c
	modified:   src/dog.c
	modified:   src/dokick.c
	modified:   src/makemon.c
	modified:   src/mkmaze.c
	modified:   src/mkobj.c
	modified:   src/pager.c

This commit is an attempt to address the complaints about
the orc town variation taking away lots of stuff that is
normally available in mine town. The statement in the level
description says "A tragic accident has occurred in Frontier
Town...It has been overrun by orcs."

The changes in this commit attempt to uphold that premise,
while making things a bit more interesting and perhaps
more palatable for the player.

This update does the following in keeping with the mythos:
- While many of the orcs still remain to wander about the
  level, many of the orcs took off deeper into the mines with
  some of the stuff that they plundered. You may now be
  able to hunt some of it down.

- Adds some appearance of this particular horde of marauding
  orcs working as part of a larger collective.

- This evolves the Orc Town mine town variation into a
  a feature over multiple levels of The Gnomish Mines,
  rather than just the single-level "feature" that it was
  previously.

- You may have to work longer and a bit harder for some
  things than other mine town variations, but at least with
  these changes, there is hope that some of it may be found
  elsewhere.

Game mechanics notes (maybe spoily?)

- Add mechanism to place objects into limbo (okay, really
  place them onto the migrating_objs list for transferring
  between levels etc.) and destine them
  to become part of the monster inventory of a particular
  species. In this particular usage case, it's using the
  M2_ORC flag setting to identify the recipients.

- At present, there is no mechanism in the level compiler
  for placing objects onto the migrating objects, nor
  with more sophisticated landing logic, so a somewhat
  kludgy hard-coded fixup and supporting routines were used.
  Some day the need for that might change if additional
  capabilities move to the level compiler.

This is a NetHack-3.6.2-beta01 update. Please give it a workout.

Fixes #127
2018-09-18 18:35:13 -04:00
PatR
b34400094b fix #H7060 - polymorph zap vs long worm
A polymoprh zap which creates a long worm can hit and transform the
same monster again depending upon tail segment placement.  Similar
behavior occurs if monpolycontrol is set in wizard mode and player
chooses 'long worm' for what to transform an existing one into (in
which case polymorph fails and zap might hit that same worm again
in another segment, prompting player to choose its new shape again).

Simplest fix would be to make tail segments be immune to polymorph,
but that would prevent players from deliberately attacking the tail
(for polymorph attacks only).  Next simplest would be to make long
worms M2_NOPOLY so that polymorph can't create them, then just live
with multiple promptings when monpolycontrol is set.  This fix
tracks whether a long worm has just been created via polymorph (or
explicitly retained its shape via monpolycontrol) and makes further
hits on same creature on same zap have no effect.  It does so by
setting mon->mextra->mcorpsenm to PM_LONG_WORM when a long worm is
result of polymorph, and setting context.bypasses to get end-of-zap
cleanup.  (It doesn't bother discarding mon->mextra if reset of
mcorpsenm leaves mextra empty.)
2018-09-17 18:28:49 -07:00
PatR
89237fc96d fix #H7157 - cancel self as clay golem
The report was "doesn't kill even if unchanging", but it does cause
rehumanize() when not Unchanging, the same thing that happens when
you die due to loss of hit points.  But losing the activating word(s)
and then having Unchanging retain the clay golem shape does seem
wrong, so make losing the word(s) while being unable to revert to
normal form be fatal.

Poly'd hero (without Unchanging) reverts to normal when cancelled,
so make monsters behave that way.  Previously, only werecritters in
beast form were forced to human form.  This changes cancellation to
make shapechangers and hiding mimics take on normal form too.

Cancelled shapechangers now behave as if the hero has the
Protection_from_shape_changes attribute and will be unable to change
their shape (after having been forced into normal form).  Getting
polymorphed in any fashion uncancels them prior to giving new shape.
[There may be some newcham() situations that should be disallowed
when cancelled rather proceeding and consequently uncancelling.]
2018-09-15 19:23:29 -07:00
Pasi Kallinen
e031800880 Use is_hole macro to check for trapdoors and holes 2018-09-15 17:57:57 +03:00
Pasi Kallinen
adf070eb04 Use is_pit macro to check for (spiked) pit 2018-09-15 17:19:26 +03:00
PatR
3eded06669 fix #H7156 - perm_invent
Bug report #H7156 listed three items, all relating to perm_invent:
1) it shouldn't persist across save/restore since restore might be
   on a system which doesn't have enough room to display it (report
   actually complained that config file setting was ignored when
   restoring old games, which is an expected side-effect for options
   that persist across save/restore);
2) permanent inventory wasn't updated when using scroll of charging;
3) attempts to update permanent inventory during restore could lead
   to crash if it tries to access shop cost for unpaid items.
Items (2) and (3) have already been fixed.  This fixes (1).

Replace 'flags.perm_invent' with a dummy flag, preserving save files
while removing it from flags.  Add 'iflags.perm_invent' to hold the
value of the perm_invent option.

The win32 files that are updated here haven't been tested.  Whichever
branch contains the curses interface needs to be updated; ditto for
any other pending/potential interfaces which support perm_invent.
2018-09-14 17:34:33 -07:00
PatR
2c231f57bd git pull request #133 - reassess worn equipment
Fixes #133

Monsters who lost an amulet of life saving while having their life
saved wouldn't attempt to put on another amulet unless/until they
picked up some object.  Likewise if they had a worn item stolen.
(There are probably other events which should re-check worn gear.)

The suggested commit had a life-saved monster re-check equipment
during life-saving which might have led to reports about them
effectively getting extra moves, especially if two-weapon fighting
or zap rebound with sequence of kill/life-save/kill-again allowed
the target to put on a replacement amulet of life-saving prior to
the second kill.  It also wasn't amenable to dealing with stolen
equipment.  This alternate fix sets a flag to have monster check
its equipment on its next move.
2018-09-14 15:08:22 -07:00
Pasi Kallinen
e37087e999 Handle monsters inside the invocation area 2018-09-14 21:49:02 +03:00
Pasi Kallinen
97b2ba2e54 Mimics created by #wizgenesis blocked vision incorrectly 2018-09-14 21:07:08 +03:00
PatR
37f8d0edb3 fix #H7385 - double trap activation when jumping
Jumping performs the placement of the last step after using hurtle()
to move to the destination, so if hurtle() triggered a trap then it
would happen twice.  Report was for a Sokoban pit but it would happen
for fire traps too.  Other traps would yield "you pass over <trap>"
while hurtling and then trigger the trap when landing.  Have
hurtle_step() ignore a trap for the last step of a jump, leaving it
to the jump's landing to handle.

Also, give feedback when hurtling over water or lava, similar to what
happens when passing over a previously seen trap which doesn't
activate.
2018-09-13 17:10:25 -07:00
Pasi Kallinen
c7c21c264e Remove unnecessary spaces from couple messages 2018-09-11 15:39:13 +03:00
nhmall
59019910b5 heed OPTIONS=symset:default in config file in windows and msdos 2018-09-10 15:27:05 -04:00
Ray Chason
8dbaafbb7b Ignore Win32 build products 2018-09-10 21:13:10 +03:00
Ray Chason
cdfb9cb744 Linux and Mac: ignore .moc files created in src 2018-09-10 21:12:53 +03:00
PatR
b572ccb014 web spinning
This started as some formatting cleanup but I've added a couple of
additional terrain features which can act as web support (stairs up
and ladder up).

The message "<Spider> spins a web" was given if you could detect or
sense <spider> rather than see it.  I've changed that to only happen
if you see the new web appear rather than the critter spinning it
(it only becomes an unseen trap if you don't watch it appear).

After spinning a web, a spider can't spin another one until 4d4 moves
have elapsed.  That seems suitable when the spider can be seen but
isn't really adequate throttling when the spider is far away--it can
end up spinning a lot of webs by the time you get to its vicinity.
Perhaps it shouldn't be able to spin a new web if there is already
one with N steps of its location?
2018-09-07 18:12:03 -07:00
Pasi Kallinen
2122506ebe Spiders will occasionally spin webs
Idea and code inspired by aosdict
2018-09-07 20:26:18 +03:00
PatR
533234f13d arg type mismatch
This was right in 3.4.3 but got changed way back in 2004.
No effect on play and unlikely to be complained about by any
compiler.
2018-09-06 16:28:42 -07:00
PatR
4ce6d81d60 hilite_status type 'up' or 'down' vs strings
The temporary highlight types 'goes-up' and 'goes-down' aren't useful
for the three string status fields (title, dungeon-level, alignment)
since the string values might go up when the underlying value goes up
or might go down instead (and similarly for down, down, up).  The code
involved can compare strings but the values are effectively arbitrary
so the comparison is only really useful for same vs changed.  This
treats types 'up' and 'down' for strings as 'changed' when coming from
config file and no longer offers them as choices when using 'O'.

Config file parsing perhaps ought to treat them as errors instead.
2018-09-06 05:26:21 -07:00
nhmall
a417d67572 status_update distinguish new BL_RESET from BL_FLUSH
This adds BL_RESET to status_update to send a flag to a window
port that every field should be updated because something has
happened in the core to make current values shown to be
untrustworthy or potentially obliterated.

That is now distinguished from BL_FLUSH, which now has no
bearing on whether every field needs to be redone, and instead
can be used by a window port indicator that it is time to render
any buffered status field changes to the display.

tty port now sets WC2_FLUSH_STATUS indicator for BL_FLUSH support
and now does one rendering per bot() call, instead of up to 22.

Side note: The tty hitpoint bar code was relying on the old
behavior of redrawing everything upon BL_FLUSH apparently, so it
initially had some color change lag issues, corrected by marking
BL_STATUS as dirty (in need of updating) in tty_status_update()
whenever BL_HP was marked as dirty.
2018-09-03 08:18:18 -04:00
nhmall
0b32735ff8 ensure BL_FLUSH always sent when context.botlx is set
ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change

Fixes #107
2018-09-02 18:26:42 -04:00
nhmall
6594805811 transformation message when you apply a figurine
make the transformation message of a deliberate apply of a figurine seem
a bit less definite when blind. Put 'I' unseen monster marker at the spot
you expect it to be.
2018-09-02 18:20:40 -04:00
nhmall
7bc0ce66e6 Revert "transformation message when you apply a figurine"
This reverts commit e2b187f2f1.
2018-09-02 18:11:03 -04:00
nhmall
9323f074f7 Revert "ensure BL_FLUSH always gets sent down to the window port whenever bot() is"
This reverts commit ee4c12b238.
2018-09-02 18:10:40 -04:00
nhmall
ee4c12b238 ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change

Fixes #107
2018-09-02 18:05:16 -04:00
nhmall
e2b187f2f1 transformation message when you apply a figurine
make transformation message of a deliberate apply of a figurine seem a bit
less definite when blind. Put 'I' unseen monster marker at the spot you
expect it to be.
2018-09-02 17:54:00 -04:00
nhmall
b77f559d58 quiet a new visual studio compiler complaint from recent code change
..\src\hack.c(2553): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int (__cdecl *)(void)'
2018-09-01 15:07:19 -04:00
Pasi Kallinen
27d7f216c7 Split pickup checks out of dopickup 2018-09-01 20:45:51 +03:00
Pasi Kallinen
9e35a94097 Fix pickup awful hack
If pickup has been bound to some other key than ',', the awful hack
did not work correctly. Testing, I couldn't notice the difference,
but probably just not doing the right thing...
2018-09-01 20:15:19 +03:00
nhmall
cd9c0e880a adjust wizidentify title and prompt 2018-09-01 11:16:08 -04:00
nhmall
5a44a34420 wizidentify suppress unnecessary prompt; allow individual items for perm ID
Don't display the selection to identify all items if there are none.

Complete an item marked ToDo in cmd.c: allow selection of one or more
particular items to permanently identify rather than just all or nothing.
2018-09-01 10:43:26 -04:00
Pasi Kallinen
d2eba695c8 Use DEADMONSTER instead of checking mhp 2018-08-30 20:05:18 +03:00
PatR
f1d0636ba0 fix wiz identify bugs
Fixes #124

Fix github pull request #124 which was also reported directly (but not
through the contact form so #Hxxx number).  Using ^I or #wizidentify
displays inventory with everything ID'd for that command only and adds
a menu entry "_ - use '^I' to identify" that can be chosen to make
those ID's persistent.  Picking underscore would work but picking the
alternate '^I' wouldn't work if the platform had unsigned characters
for plain 'char'.  Switch the return value from magic number -1 to
magic number ^I which isn't a valid inventory letter and isn't subject
to sign conversion.  Casting -1 to '(char) -1' would have worked too
despite some confusion expressed in discussion of the pull request.

If ^I has been bound to some other command and #wizidentify hasn't
been bound to any keystroke, temporary ID didn't disclose any extra
information (ie, acted like ordinary inventory display) and the extra
menu entry to make temporary ID become persistent wasn't available.
This fixes that too.
2018-08-29 19:19:49 -07:00