Commit Graph

65 Commits

Author SHA1 Message Date
PatR
a1e83d1d3a forward declarations for struct monst, struct obj
This should eliminate the 'onefile' complaint for objects.c without
breaking anything with any standard conforming compiler.  (Fingers
crossed.)
2022-09-13 10:27:53 -07:00
nhmall
9bb96322a8 compile NetHack-3.7 without makedefs-generated .h files
This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:

date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.

pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

onames.h dependency and	its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.

artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.

The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
    makedefs -d    (database)
    makedefs -r    (rumors)
    makedefs -h    (oracles)
    makedefs -s    (epitaphs, engravings, bogusmons)

date.c

Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)

nethack --dumpenums (optional, but on by default)

Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.

Uncomment #define NODUMPENUMS in config.h to disable this.

The updates to sys/windows/Makefile.gcc have not been tested yet.
2021-08-21 07:59:18 -04:00
PatR
5a09a01a13 gold dragon and scales
Add two new monsters and two new objects:
 gold dragon
 baby gold dragon
 gold dragon scale mail
 set of gold dragon scales

A couple of variants seem to have added these already, but this came
off my ancient list of monsters to add and was done from scratch.
It's a clone of silver dragon, but instead of having reflection and
breathing cold, a gold dragon emits light and breathes fire; because
of the latter it can be seen with infravision like a red dragon.
Adult gold dragons are lawful as in the AD&D Monster Manual rather
than chaotic as the wiki pages show for the variant versions.

Worn gold dragon scales operate similar to wielded Sunsword:  when
blessed, radius is 3 (same as a lamp), if uncursed, radius is 2, and
if cursed, radius is 1 (but functions as 2 when worn by the hero,
otherwise there would be no tangible effect).  Gold dragon scale mail
gets an extra +1, making blessed gold DSM have a bigger radius than
lamps.  Embedded scales have radius 1 regardless of BUC state; light
for that case comes from the gold dragon monster form the hero is in.
When not worn, gold scales and scale-mail don't emit any light.

The tiles use a mix of yellow (for gold) and red.  The two object
tiles seem reasonable variations of the corresponding silver dragon
ones.  The two monster tiles definitely need work since the silver
ones were mostly cyan and changing that to red did not produce very
good result; subsequent attempt at a mixture was haphazard at best.
2021-07-23 10:41:57 -07:00
PatR
d6cafdc527 fix github issue #515 - grappling hook internals
Grappling hook used to have an undiscovered description of "iron hook"
and when that was removed, the oc_name_known flag was left set as if
for something that could become discovered.  I'm not sure whether that
made any difference anywhere.

Gold piece was in a similar situation, except that it wasn't because
an alternate description had been present and then removed.  That one
definitely didn't make any difference anywhere.

Fixes #515
2021-05-20 18:56:03 -07:00
nhmall
f963c5aca7 switch source tree from k&r to c99 2021-01-26 21:06:16 -05:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
PatR
42245f8e67 wizard mode vs venom object names
I tried wishing for "splashes of venom" but was told that no such
thing exists even though "splashs of venom" and "2 splash of venom"
both work to produce "2 splashes of venom".  After the spurious
failure, retrying with EDIT_GETLIN enabled showed that "splashes"
had been singularized to "splashe" so fix that.

"2 splashes of venom" IDed to "2 uncursed blinding venoms" because
the base name omits "splash of" prefix.  And due to that, explicitly
wishing for "splash of {acid,blinding} venom" didn't work either.
Change the names to include the prefix, and add a hack to makedefs
to keep generating the old macro names without the prefix.  (Wishing
for "{acid,blinding} venom" still works due to post-3.6.6 changes
to " of " matching.)
2020-07-24 14:45:59 -07:00
PatR
b8da4e9294 amulet tiles
Replace the octagonal amulet placeholder for the two new tiles.
Give the "cubical amulet" a hint of being cube shaped and rename
"pentagonal amulet" to "perforated amulet" because it's easier to
draw that way.

Bump EDITLEVEL now for the extra objects and monsters because I
forgot to do so earlier.
2020-05-03 16:34:54 -07:00
PatR
4d52332dda add two new types of amulet: flying and guarding
We haven't added any new objects or monsters in a really long time.
This adds two new useful amulets, putting more pressure on the
decision over which type of amulet to wear.

amulet of flying:  idea from slash'em, implemented from scratch.
  Should be self-explanatory.  Polymorphing into a form capable of
  eating amulets and then eating one does not confer intrinsic
  flight.  (I've no idea how slash'em behaves is in that regard.)

amulet of guarding:  adds +2 AC, which is fairly negligible, also
  +2 MC, which is not.  Initially called amulet of protection but MC
  of 2 is referred to as 'guarded' by enlightenment so I changed it.
  (By that reasoning, rings of protection ought to be called rings of
  warding; oh, well.)  Successfully eating one confers +2 AC without
  any MC benefit.  When wearing one of these, rings of protection
  only confer AC, their +1 MC gets superseded rather than combined.

Monsters will wear an amulet of guarding and gain both the AC and
MC benefit, but if not cursed and they acquire one of life-saving or
reflection, they'll swap.  They won't wear an amulet of flying.

I cloned two extra copies of the tile for one of the existing amulets
and ran sys/share/objects.txt through renumtiles.pl.  The result
appears to be ok but on X11 the tiles map ends up looking psychedelic
so something beyond the tile art itself needs to be fixed here.
2020-05-02 02:07:33 -07:00
PatR
0ae84411a0 option fixes and missing prototypes
I added -Wmissing-prototypes to my CFLAGS and got a bunch of warnings.
This fixes the core ones (there are more for X11 that I haven't looked
at yet).  While fixing these, I discovered a few option processing
issues:  the non-Amiga 'altmeta' should be settable while the game is
in progress (not sure about the Amiga variation so left that as-is),
'altmeta' and 'menucolor' are booleans so shouldn't have had optfn_XXX
functions; 'MACgraphics' and 'subkeyvalue' were conditionally defined
differently in options.c than in optlist.h.
2020-04-22 13:39:38 -07:00
PatR
caaf1b375a randonly occurring Discworld novels
Give 'novel' a 1 in 1000 chance of being created in place of each
random spellbook (except for hero's initial inventory and NPC
priests' monster inventory and divine reward for prayer--those all
force regular spellbooks; statue contents aren't among the
exceptions--those books can now be novels).  Shop inventory (where
first book or scroll shop created is guaranteed one novel) hasn't
been touched.  If there is any other special spellbook handling
somewhere, I've overlooked it.
2020-01-12 11:00:38 -08:00
copperwater
f044576309 Remove "iron hook" unidentified description
It's confusing and served no purpose; a spoiled player knew what it is,
an unspoiled player might think it was a hook-hand or something. Now
they all show up as grappling hook.
2020-01-04 22:54:14 +01:00
PatR
60ec7256ab fix github issue #268 - worm tooth & crysknife
Change the composition of worm tooth from none-of-the-above to bone
and crysknife from mineral to bone, same as is used for unicorn horn.
I think the only significant difference will be that worm teeth used
up during polypiling will produce skeletons rather than flesh golems.

Fixes #268
2019-12-24 02:41:19 -08:00
nhmall
75d22a2dbf separate MAIL functionality from MAIL-related structure inclusion
With 3.7+ aspirations of improving savefile interoperability between 32-bit
and 64-bit builds, as well as between platforms, it is better to not have
the underlying struct/array content be conditional.

This splits off some of the MAIL code into MAIL_STRUCTURES code. In theory,
since MAIL_STRUCTURES is unconditionally included, the macro could
just go away and leave that code unconditional, but this commit doesn't
go that far.
2019-11-09 16:19:05 -05:00
Bart House
912886a73f First set of changes to move globals to instance_globals. 2018-12-19 20:00:35 -08:00
Mak Kolybabi
9c46a26af4 Grammar and punctuation fixes. 2018-09-19 22:48:43 -05:00
PatR
95b9205168 fix #H7354 - incorrect material
for parchment and vellum spellbooks.  Parchment and vellum are made
from animal skin rather than from plants, so classifying spellbooks
with those descriptions as paper is inaccurate.  Changing them to be
made out of leather has a couple of side-effects:  eating them while
polymorphed will break vegetarian conduct and polymorphing them might
result in a leather golem rather than a paper one.

I left "leathery spell book" as paper since that directly refers to
the cover.  The composition shouldn't be changed--the pages of such
a book are still made out of paper--but the effect of eating one
possibly should.  (That description originally was "leather" and got
changed.  I don't remember the details and assumed it was due to odd
wishing behavior, but there's a commented-out routine in eat.c which
suggests it was related to eating instead.  Anyway, "leathery" is
still non-leather.)
2018-08-27 19:13:54 -07:00
Pasi Kallinen
84dc214e5c Fix wrong material for novels
HI_PAPER is color, PAPER is material - the novel object definition
was using the wrong one. The caused the novel material to be gold.
2016-11-13 15:25:43 +02:00
PatR
b9d5b35078 src/objects.c formatting
Fit the new comments within 80 (actually 78) columns.
2015-11-11 23:30:59 -08:00
nhmall
39a1667677 Repair recent tile mapping error when MAIL is undefined
Changes to be committed:
	modified:   src/objects.c
	modified:   win/share/tilemap.c

Warnings during tile builds (and incorrect tile mappings
at run time when MAIL wasn't defined):
	Creating 16x16 binary tile files (this may take some time)
	warning: for tile 325 (numbered 325) of objects.txt,
	        found 'ETAOIN SHRDLU' while expecting 'stamped / mail'
	warning: for tile 326 (numbered 326) of objects.txt,
	        found 'LOREM IPSUM' while expecting 'ETAOIN SHRDLU'

The recent addition of the first new extra scroll descriptions in a
very long time caused this problem to show up when MAIL was undefined.

There was a magic number in use that made an assumption that there
were only 4 such extra scroll descriptions, those being
"FOOBIE BLETCH", "TEMOV","GARVEN DEH","READ ME"
2015-11-12 00:42:52 -05:00
Pasi Kallinen
99925ff155 Update version numbers in source comments 2015-11-06 16:05:36 +02:00
PatR
b2aea3e9d7 wishing for novels
Make novels be wishable in normal and explore modes in addition to
wizard mode.  I don't think this weakens the tribute and it prevents
someone who attempts such a wish from getting misleading feedback of
"Nothing fitting that description exists in the game."

Wishing for "novel" will yield "novel named Foo" where "Foo" is a
randomly chosen Discworld title.  Wishing for "novel named Bar" will
yield "novel named Bar" or "novel named The Bar" if "Bar" or "The Bar"
is a valid Discworld title, or else override "Bar" and pick random
Discworld "novel named Foo" if it isn't.

Since first read of a novel bestows some experience (once per game, no
matter how many novels become available), a pacifist with an early
wish can get a head start.  I don't think that's a big deal.  And it
will require an awful lot of wishes for any player who wants to acquire
all 41 titles in one game.  I imagine someone will manage it.
2015-10-11 19:39:23 -07:00
Pasi Kallinen
798b2e76f9 One more scroll name, a tongue twister 2015-09-17 19:32:28 +03:00
Pasi Kallinen
9a4d29b365 Add new scroll names
via UnNetHack, with some slight changes:

1) Folded the two Portal references into one
2) Removed "ACHAT SHTAYIM SHALOSH" ("One Two Three" in Hebrew and apparently
   Uri Geller's catchphrase) - I know nothing about Hebrew nor Geller, or
   whether this would be appropriate to add.
3) Added "XOR OTA" ("Atorox", reference to Finnish fandom and early scifi)
2015-08-30 21:29:08 +03:00
PatR
8f758cce25 boot weights
Make both pairs of iron boots weigh the same (kicking boots become
heavier).  Make boots of water walking weigh the same as levitation
and elven boots (slightly lighter; 3/4 as much as speed, fumbling,
and mundane high boots).
2015-07-04 16:28:08 -07:00
PatR
60e974e9f1 reformat objects.c
Manually reformat objects.c so that it's a bit easier to work with,
prior to possibly modifying it.  I wrote objects[] and obj_descr[].*
to files before and after and they were byte-for-byte identical, so
the revised objects.c hasn't introduced any changes.  It was done
from scratch rather than reverting to the pre-clang-format edition.

There was nothing particularly wrong with the uniform spacing
produced by the automated reformat, but organizing things in columns
and/or controlling where the line splits occur make changes and
comparisons easier.

artilist.h and monst.c should probably be redone too, but I don't
think I going to get around to tackling them.
2015-06-18 19:07:43 -07:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
Pasi Kallinen
2a4bf5efa7 Comment for the pudding glob order 2015-05-06 09:54:28 +03:00
nhmall
0fdcea70c6 suggested booktribute mods
Changes to be committed:
	modified:   include/extern.h
	modified:   src/files.c
	modified:   src/objects.c
	modified:   src/spell.c

- charge a little more.
- no free read in the bookstore.
2015-04-18 17:45:27 -04:00
nhmall
11560933cc Merge branch 'master' into nhmall-booktribute
Conflicts:
	doc/fixes35.0
	include/extern.h
	src/mkobj.c
	src/mon.c
	src/objnam.c
	win/share/objects.txt
2015-04-12 10:02:17 -04:00
PatR
cd9e67a12a color of mithril armor
From a bug report two years ago, mithril armor should have color
HI_SILVER rather than HI_METAL.  Tolkien describes mithril as "like
silver which never tarnishes".  (The bug report had a more precise
quote, and a github URL for a patch which I've ignored.)  The Amulet
of Yendor has material set to MITHRIL but I haven't changed its color.
All amulets are HI_METAL, so if any modification is needed for it,
change the material rather than the color.

Mithril-coats are displayed as cyan both before and after this patch,
so it's hard to tell whether any change actually happened.
2015-04-11 18:51:03 -07:00
Derek S. Ray
0b4383e32e clean up handling, roll everything into merged()
it should be possible to wish for globs now; also hero's
inventory, containers, ground, monster inventories will all
honor the globbiness.

basically, any way you bring two globs together (adjacent on floor,
same inventory, same bag) should cause them to merge, combining
weight and nutrition as appropriate.

20 seems low-ish on nutrition for a pudding (kelp fronds are 30!)
at first glance but this is easy enough to fix later; don't really
want players to be able to stock up on food _this_ way and accidentally
obsolete all the other food-generation methods.
2015-04-03 13:03:55 -04:00
Derek S. Ray
daf3343dae pull the globs outside the Meaty Sequence
update tiles textfile, too
2015-03-20 11:37:50 -04:00
nhmall
c72c531c2c change printed novel to paperback novel 2015-03-19 19:47:52 -04:00
nhmall
d01bec9fae rare books store tribute 2015-03-18 21:47:18 -04:00
Derek S. Ray
68b8931918 further ongoing changes
Swap out single object for four separate ones to support tiles
rename to 'glob' to avoid confusion with acid/quivering blobs
2015-03-15 21:46:26 -04:00
Derek S. Ray
b8dc3a6e43 Initial farming-mitigation changes
Remove deathdrops completely for cloned monsters
Revert corpse frequency decrementing for cloned monsters
Add new object 'blob of pudding' and corresponding tile
Set 'P' monsters to create that object on corpsification

...add script to go through and auto-renumber objects.txt
because there's no way i'm doing that by hand
2015-03-15 18:29:43 -04:00
Sean Hunt
260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -05:00
Sean Hunt
b066b7c170 Make KOPS unconditional. 2015-02-27 19:33:04 -05:00
Sean Hunt
9e65758947 Make STEED unconditional. 2015-02-27 19:33:01 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
28ab93325e Sleeping vs Sleepy (trunk only)
While looking at fixing the mfrozen issue for monsters (there's no
way to tell whether it's been caused by sleep or paralysis, necessitating
that some messages be vague or suppressed when actions impact monsters
who can't move), I noticed a drawbridge bug for the hero.  It was using
the misleadingly named Sleeping intrinsic incorrectly.  When that is
nonzero, the hero is prone to falling asleep at random intervals, not
necessarily asleep right now.  I've always intended to rename it to
something that's not misleading, but hadn't ever gotten around to doing
so, until now:  change the SLEEPING property to SLEEPY and the Sleeping
intrinsic/attribute to Sleepy.

     This may be moot for the drawbridge.  I can't remember any hero ever
jumping to safety instead of being crushed by either the bridge or its
portcullis, and I'm sure sleepiness hasn't been a factor.  So I haven't
included any fixes entry about misusing Sleeping when it meant u.usleep
(or better yet, unconscious(); or even better, Unaware [a post-3.4.3
pseudo-property that tests both unconscious() and fainted() when checking
whether hero is incapacitated]).
2011-07-28 04:00:21 +00:00
nethack.rankin
5bd6ba0d1c magic cancellation and Protection (trunk only)
Magic cancellation comes from some types of worn armor and has a
value of 0 through 3.  A non-zero value guards against some forms of
monster magic attacks (most notably, level drain by vampires and wraiths
and lycanthropy from werecritter bites).  This reduces the effectiveness
of mc a moderate amount (the new values happen to be the same as those
adopted by the Spork variant):
 chance to block various touch effects
  mc  old     new
   1  34.67%  30%
   2  67.33%  60%
   3  98%     90%

    This also makes the Protection intrinsic (strictly speaking, extrinsic)
be the only way to attain an mc factor of 3.  Cloak of protection is the
only way to get mc 3 from a single item.  Otherwise you need an mc 2 item
and a ring of protection (or one of the recently modified quest artifacts).

     Cancellation factor for elven and dwarvish mithril coats and for
robes and oilskin cloaks is reduced from 3 to 2; for elven cloak and
cloak of magic resistance from 3 to 1 (play balance; they're valuable
even without magic cancellation); for dwarven and orcish cloaks and
clocks of invisibility and displacement and for cornuthaum (wizard hat)
from 2 to 1.  Plate mail and crystal plate mail stay at 2.  A variety of
suits which were at 0 are increased to 1; leather jacket and dragon
scales/scale mail stay at 0 (the latter for play balance rather than for
the amount of your body that's covered).

     Having extrinsic protection will increase mc by 1 (unless it's
already 3).  That's obtained by wearing a cloak of protection (where the
increase is redundant), a ring (or two) of protection (even if conferring
a negative AC amount), or wearing the Mitre of Holiness or wielding the
Tsurugi of Muramasa.  Having multiple sources doesn't make the benefit
cumulative; it's just +1.

     Intrinsic protection (bought from priest, gained from prayer, gained
from eating rings of protection while polymorphed into metallivore, or
temporary while spell of protection is active) doesn't increase mc from
armor but does provide minimum mc 1 instead of naked 0 (play balance
again; buying it is too easy to let it increase mc 1 or 2 to 2 or 3).
(Extrinsic protection is a superset; its +1 bonus also increases 0 to 1.)

    TODO: add an amulet of protection so player has another option for
extrinsic protection.
2011-04-07 20:59:40 +00:00
keni
4eabcee787 Add RCS version lines 2009-05-06 10:50:32 +00:00
nethack.rankin
80322ee47d rusty pearl rings (trunk only)
Recent newsgroup discussion complained about a pearl ring becoming
rusty.  That has no effect on game play but does feel weird.  Rings which
are described by their gems specify a material based on the gem rather
than on the band, so making pearl rings be made out of iron didn't fit.
The substance pearls are made of is the same as in the shells of the
oysters or whatever critters excrete them.  The closest matches available
seem to be mineral and bone; I've gone with bone here.
2009-04-01 00:33:53 +00:00
nethack.rankin
5ce14e99fc final? multi-shot throwing (trunk only)
Make worm teeth and crysknives be stackable.  Positively enchanting
a stack of multiple worm teeth produces a single crysknife, negatively
enchanting a stack of multiple crysknives produces a single worm tooth.
A dropped stack of N fixed crysknives has 90% of remaining N crysknives,
10% of becoming a stack of N worm teeth, rather than produce an average
of 0.9*N crysknives and 0.1*N worm teeth.  (The code which handles that
transformation operates on loose objects so cannot handle stack splitting
because it wouldn't have any idea of what to do with extra objects.)

     Terminate multi-shot volley throwing of boomerangs if one comes back
and isn't caught.  The sequence throw-catch-throw-catch is odd, but would
take a substantial amount of code and effort to be changed to the more
intuitive (for rapid volley throwing) throw-throw-catch-catch.  Even if
feasible, doing that for underused boomerangs would be a waste of effort.
2006-12-19 05:07:53 +00:00
nethack.rankin
54bbb38ee0 merge javelin and spear skills (trunk only)
Part of "multi-shot throwing proposal" last January.  Unfortunately
some of the bits that I had implemented back then have vanished, so I'm
doing it over from scratch.  There were three main parts:
1) allow multi-shot volley throwing for all stackable weapons (affects
   knives, javelins, spears, and boomerangs; other weapons either don't
   stack or are already multi-shot);
2) make worm teeth and crysknives be stackable like ordinary knives;
3) merge spear and javelin skills, so that allocating skill points to
   their use becomes more attractive and they might get used more.
This patch only does #3.

     Since the monk skill set shrinks by more than any of the other roles,
I bumped max skill for escape spells (haste self, invisibility, jumping,
levitation, and teleport away) from basic to skilled; that's the only
skill adjustment included here.  For the couple of roles had different
max values for spear and javelin skill; this keeps the higher of the two.
2006-12-15 04:54:22 +00:00
nethack.rankin
d83513b471 leather spellbook revisited
Change the description of leather spellbook to leathery.  Eating it
does not violate vegan or vegetarian conduct.  [By shear coincidence, I got
``Blecch!  Rotten paper!'' for it while testing this.]
2006-02-23 05:10:21 +00:00
nethack.allison
5fa8f73af8 housekeeping: mark trunk sources 3.5 (src) 2005-01-02 16:44:46 +00:00