Commit Graph

6350 Commits

Author SHA1 Message Date
PatR
03d7d64d15 create monster creating concealed mimic
From an old bug report (sent directly to devteam, June of 2017):
wand or scroll of create monster becomes discovered if it makes
a mimic that is concealed as an object or as furniture within
the hero's view.  Fixing this in the general case [when does
seeing a mimic as something other than a monster mean that the
mimic is being seen?] is a massive can of worms, but fixing this
specific case is trivial.
2020-11-20 18:56:35 -08:00
PatR
7b50590654 rename #wizlevelflip to #wizfliplevel
Since ^V is dead key for me with Qt on OSX, I use #wizlevelport
instead.  It's annoying to have to type all the way up to the
'p' for it to become distinct.  Rename the biggest conflict,
\#wizlevelflip to #wizfliplevel.  I still have to type as far
as the first 'e' for #wizlevelport but 6 characters are easier
to type than 10.

It wasn't in the Guidebook so I've left things that way.  I am
adding it to 'wizhelp' though.
2020-11-19 01:57:13 -08:00
PatR
27b93148c0 ki-rin's horn
Let ki-rin cure themselves (of being stunned, confused, or blinded)
with their own horn, and make them be poison resistant.  They
aren't unicorns but their horn is very much like a unicorn horn.
They're flagged no-corpse so this hasn't changed them to leave
behind a horn upon death.

They were flagged as animals who neighed but they are also spell
casters.  I took the animal flag off (they're still no-hands so
shouldn't be able to use items; also, unicorns aren't flagged as
animals either) and changed sound to 'ms_spell'.
2020-11-18 11:16:21 -08:00
Pasi Kallinen
e100d1a137 More unpolyable unifying
... and fix the potion dipping case.
2020-11-17 18:00:43 +02:00
PatR
cb8baa1d1c Qt status overhaul: add support for 'statuslines'
Condense the Qt status slightly, moving Alignment field from the
Conditons line to the Characteristics line and the Time and Score
fields from their own possibly blank line to the HP,&c,Gold line.

That's for statuslines:2, which is the default.  statuslines:3
restores the previous layout.  I tried to make that become the
default for Qt but it got messy fast and I gave up.

I also tried to make changing 'statuslines' back and forth on the
fly work but failed.  I left the code in as #if DYNAMIC_STATUSLINES
but that isn't defined anywhere.  For the time being at least,
'statuslines' is config file or NETHACKOPTIONS only for Qt, not
changeable via 'O' like for curses and tty.

Change the option description for 'statuslines'.  That depended
upon whether curses was compiled in when it should depend on which
interface is active.  This moves the alternate info to Guidebook.
2020-11-17 05:07:09 -08:00
PatR
98075ebfe8 auto-cursing helmet vs perm_invent
I though that I noticed a problem but later couldn't reproduce
it, so this might not be redundant.  Update persistent inventory
when putting on a helmet causes it to become cursed.

Minor change:  if blind at the time, hero loses knowledge of BUC
state.
2020-11-16 18:08:02 -08:00
Pasi Kallinen
d81e1672aa Unify unpolyable objects to single define 2020-11-16 18:42:12 +02:00
Pasi Kallinen
ccb5bc4b55 Avoid hard-coded bit twiddling 2020-11-15 19:56:35 +02:00
Pasi Kallinen
d6384f4061 Use enums instead of magic values 2020-11-15 19:32:21 +02:00
Patric Mueller
56494d3479 Fix an implicit-fallthrough and maybe-uninitialized warning 2020-11-15 16:07:43 +01:00
Pasi Kallinen
deb730d9b5 More hypothetical type mismatches 2020-11-15 13:51:47 +02:00
Pasi Kallinen
289c8d654d Futureproofing hypothetical type mismatches
If we ever want huge maps with COLNO or ROWNO larger than signed char,
this will at least allow the game to compile and start when typedef'ing
xchar to int. Trying to use huge maps exposes more bugs.
2020-11-14 13:53:09 +02:00
PatR
e647eab6dc fix github issue #410 - mon throwing c'trice egg
If a monster threw a cocktrice egg that hit and petrified another
monster, the hero would credit (experience) and blame (possible
alignment penalty, &c) for it.

Fixes #410
2020-11-13 16:52:45 -08:00
PatR
6cbd2c5d85 warning fixes
Using 'ladder' as a variable conflicts with 'struct flag flags'
because of a macro in rm.h.  Also remove or hide a couple of
unused variables.

The hack.c diff is unrelated; just a reformatting bit that I had
laying around.
2020-11-13 14:11:54 -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
PatR
e23f764d11 fix #K2924 - breaking a wand without free hands
Breaking a wand didn't require the hero to have free hands.
That's definitely a bug when they're both welded to the same
two-handed weapon.  It's debatable when welded separately to
a one-handed weapon and to a shield but simpler to pretend
there's no such distinction.

This also makes glass wand join balsa wand as "fragile".  Hero
doesn't need as much strength to break them as other wands and
the wording for breaking them is slightly different.

My fixes entry initially had a trailing space.  When I took
that out, I spotted a couple of others so take those out too.
2020-11-12 04:30:25 -08:00
PatR
ea0ef81ecd fix github issue #408 - stuck to distant mimic
Attacking a concealed mimic at range by applying a polearm
could make the hero be stuck to that mimic in addition to
bringing it out of hiding.  Only do that when adjacent.

This also adds a new sanity check when setting u.ustuck.
It may get triggered by other sticking activity since only
attacking has been tested.  The check must be explicitly
enabled by setting the wizard mode 'sanity_check' option.

Fixes #408
2020-11-08 16:07:42 -08:00
PatR
0eee7b7edc Qt paper doll comments 2020-11-07 02:32:50 -08:00
PatR
bf2094d3dd remove obsolete 3.6 compat - Schroedinger's cat
Remove unneeded code.  Noticed while looking for an explanation
of the reported attempt to light eggs.
2020-11-04 10:17:21 -08:00
PatR
c8d05ac352 ignitable() macro
ignitable() was excluding magic lamp and then every place that
used it did so as 'ignitable(obj) || obj->otyp == MAGIC_LAMP'
so just include magic lamp.

I noticed that while hunting for an explanation for report #K2734
where returning to a previously visited level triggered the
warning "begin_burn: unexpected eggs".  I've decided that the
zombie apocalypse is probably the cause.  It inserted a new type
of timer in the list of such but it didn't bump EDITLEVEL to
invalidate save and bones files which relied on indices into the
old list.  I'm not sure whether we should bump that now.
2020-11-03 14:25:06 -08:00
PatR
750b86f0a8 comment accuracy 2020-10-31 12:49:13 -07:00
nhmall
6c62b991c2 Merge branch 'wasm-bug-fixes' of https://github.com/apowers313/NetHack into wasm-pr403 2020-10-31 09:22:55 -04:00
PatR
8907a5df9c more alignment conversion
The overview code could reveal the true alignment of an altar
if hero saw a mimic pretending to be an altar on that spot, or
reveal junk for the alignment when mimicking at altar on some
other spot.

Avoid passing macros that might evaluate their arguments more
than once to other macros which might also do that.  The hidden
code expansion can easily get out of hand (although in this case
it was modest).

Also, get rid of the unused MSA_foo alignment values since two
of them had the values swapped.  Lastly, make Amask2align() more
robust in case a value with the shrine bit set gets passed to it.
2020-10-30 17:46:21 -07:00
Pasi Kallinen
05263bc276 Fix memory leak when adding basic color menucolors 2020-10-30 23:04:22 +02:00
nhmall
01c4a50f98 warning and a bit of alignment-related header consolidation 2020-10-30 09:08:23 -04:00
Pasi Kallinen
91c46ab54b Restful sleep regenerates hp
When sleeping due to wearing an amulet of restful sleep,
hit points will regenerate, one point faster than with normal regeneration.
2020-10-29 19:14:32 +02:00
PatR
ec5772d6d2 Qt hitpointbar
Add support for the 'hitpointbar' to the Qt interface.  Rather
than rendering the status title (name+rank or name+monster_species)
using inverse video for leading substring to produce distinct left
and right sides, draw a horizontal bar above that field.

The left portion (current health) is thicker and uses red for <10%
or <5hp, orange for <25% or <10hp, yellow for <50%, green for <75%,
blue for <100%, and black for 100%.

The right portion (missing maximum health) is thinner and runs
from white (paired with red), light gray (paired with orange),
dark gray (with yellow), plain gray (which turns out to be darker
than dark gray, with green), dark blue (with blue), and black (but
black is never shown for injury portion because that's suppressed
when at full health).

Qt already supports a square frame around the hero's map tile that
changes color according to health.  Turning the hitpointbar option
Off or On has no effect on that.
2020-10-25 15:47:49 -07:00
Patric Mueller
4e1cf071ae List lamps and lanterns in charging prompt
Brass lanterns and oil lamps are always chargeable.
Magic lamps are only listed if they are not yet identified.
2020-10-25 19:25:39 +01:00
Pasi Kallinen
22ca1ae4da Fix monster hiding under hatching egg staying hidden 2020-10-24 18:32:08 +03:00
PatR
1b37ac6280 disclosure prompt phrasing
With to-be-3.7, if game ends without any achievements, the conduct
disclosure prompt is the same as it has always been
  Do you want to see your conduct?
If it ends after attaining one achievement (probably entering the
mines or acquiring the second rank title when gaining Xp level 3)
you're asked
  Do you want to see your conduct and achievement?
which looks awkward after the fact if 'y' reveals multiple conducts.

Instead of deciding whether to pluralize "conduct(s)", simplify the
prompt when one or more achievements have been attained to be
  Do you want to see your conduct and achievements?
That works even when there is only one achievement.
2020-10-24 03:17:19 -07:00
Patric Mueller
8cc75bf583 Fix "may be used uninitialized" warning 2020-10-24 11:38:22 +02:00
PatR
74c2716004 fix #K2622 - fire/frost horn feedback for monster
When a monster used a fire horn or frost horn to attack the hero,
the feedback claimed that the attack was being directed at itself.
The error occurred in code that was added to 3.7 during 3.6
development but wasn't present in 3.6.x so fixes entry is in the
"exposed by git" section.
2020-10-23 20:15:01 -07:00
PatR
0e713dc4e9 fix #K2617 - metallivores eating iron bars
Monsters with rust attacks (rust monster) and corrosion attacks
(black pudding, gray ooze) can eat or otherwise destroy iron bars
but xorns could only move through the iron bars spot without being
able to eat the metal there.  Change xorn to eat bars instead of
phazing through them.  Lets rock moles eat bars too.

Hero polymorphed into a rust monster would eat bars if trying to
move to their location but couldn't do so if already there (maybe
was in xorn form and now in rust monster form).  Xorns could pass
through them but not eat them.  Allow hero metallivores to eat
bars at the current location via 'e', similar to eating food off
the floor.  Hero as rock mole behaves like rust monster.
2020-10-23 19:43:10 -07:00
Pasi Kallinen
aeb0ea65e3 Mild Zombie Apocalypse
When a zombie (or lich) kills a monster in melee without a weapon,
the monster can rise few turns later as a zombie.

The only creatures that can be zombified are ones that actually have
a zombie counterpart monster. A zombie cannot turn a jackal into
a zombie, for instance. But it could turn a shopkeeper into a human
zombie, or a dwarf king into a dwarf zombie.

Zombies will fight with monsters that can be turned into zombies.

Originally this was a SliceHack feature, but this is based on xNetHack
version of it, with some modifications.
2020-10-23 19:47:10 +03:00
Patric Mueller
1cc26106bf Tossed upwards objects got two times half physical damage reduction 2020-10-23 11:04:29 +02:00
Bart House
7e3a739ef9 Add stringization of nhassert expression. 2020-10-20 20:14:27 -07:00
nhmall
d1c7f26d4b clear a couple of new warnings
mondata.c:198:17: warning: unused variable 's' [-Wunused-variable]
    const char *s;
                ^
1 warning generated.

steed.c:43:17: warning: unused variable 's' [-Wunused-variable]
    const char *s;
                ^
1 warning generated.
2020-10-20 19:37:51 -04:00
Pasi Kallinen
566dde8683 Match object description via single function
making the code more readable.

Instead of doing strcmp(OBJ_DESCR(objects[otyp]), "foo"),
just call objdescr_is(obj, "foo")

(via xNetHack)
2020-10-20 19:19:57 +03:00
Bart House
d1404d345c Fix compiler warning. 2020-10-19 16:20:49 -07:00
Bart House
b4c4491229 Fix sign/unsigned comparison bug.
We are comparing a signed char with unsigned int.  The signed char will be
sign exetended when converted to unsigned int causing an unexpected
result.
2020-10-19 16:19:01 -07:00
Bart House
93ce6857d3 Tweaks to nhassert implementation. Change to warnings on MSC build. 2020-10-19 15:55:32 -07:00
Bart House
3842da9dbd Added nhassert to core. 2020-10-19 15:51:41 -07:00
Adam Powers
03e9eb6dd6 fix NO_SIGNAL 2020-10-19 13:21:07 -07:00
Pasi Kallinen
3a31587ca9 Prevent ghosts from being renamed
(via xNetHack)
2020-10-18 20:28:32 +03:00
Pasi Kallinen
f38cb63714 Spitting monsters try to stay away from melee range 2020-10-18 19:18:38 +03:00
Pasi Kallinen
fc6b491303 Fix thinko in reset travel dest condition 2020-10-17 16:48:07 +03:00
Pasi Kallinen
5ddafa5c81 Only reset if we actually went to travel destination 2020-10-17 12:13:17 +03:00
Pasi Kallinen
a9e4904131 Reset travel destination if reached via teleport 2020-10-17 12:08:51 +03:00
Pasi Kallinen
b6125b8f78 Pre-populate teleport destination prompt with travel destination
This has been implemented in multiple variants, and seems like
a small but useful quality of life improvement.
2020-10-16 19:14:01 +03:00
PatR
267228d0dd Qt toolbar 'rest' button
An issue in the core made the "Zz" button in the Qt toolbar only
work if rest_on_space was enabled.  cmd_from_func() was returning
' ' instead of '.' for the keystroke to run the rest command.
2020-10-13 13:41:57 -07:00