Commit Graph

823 Commits

Author SHA1 Message Date
Pasi Kallinen
3bbbb01c53 Death talks in CAPITAL LETTERS 2015-03-15 09:53:34 +02:00
Pasi Kallinen
400d842a8f Fix warnings 2015-03-12 17:57:13 +02:00
Pasi Kallinen
a335f8306f Add MAX_STATUENAME_RANK sysconf setting
MAX_STATUENAME_RANK tells how many score file entries to use
for random statue names.
2015-03-11 19:59:52 +02:00
Pasi Kallinen
d5abd07dad Add boolean option "bones"
Setting bones off prevents saving and loading bones files.
2015-03-10 19:50:29 +02:00
Pasi Kallinen
8e31929ef5 Define for generic usernames which prompt for name
Instead of hard-coding the "play", "player", etc. usernames
which will prompt the user for their name, allow defining
the names in config.h
2015-03-09 18:42:53 +02:00
Pasi Kallinen
1609081320 Implement fcntl(2) file locking
If you run a server, then you know of the somewhat annoying perm_lock
errors that creep up, requiring your attention before anyone else can
start a game.

This patch properly implements fcntl(2) locking on systems that can
handle it (*nix systems), that results in the lock being automatically
released on program termination, whether abnormal or not.

Original patch by Drew Streib, update by Edoardo Spadolini
2015-03-07 15:11:41 +02:00
Pasi Kallinen
9da976f004 Fix TTY crashing when a location has more than 32k items 2015-03-02 20:34:25 +02:00
Sean Hunt
777328bd5c Merge fire-based erosion to common codepaths.
This finally eliminates all direct increases of `oeroded` and `oeroded2`
and moves them all to go via `erode_obj()`. They are still manipulated
directly in a few places, but not to erode objects.

This now merges the `fire_damage()` function to a common codepath, used
for items on lava and burning oil, but fire needs more work. There is
still a duplication between `destroy_item()` and `fire_damage()`; the
two codepaths should eventually be merged in some manner so that there
is only one codepath to say "an object was affected by fire". This path
might require some parameters, such as whether the fire will just erode
objects or burn them outright, but that can happen another day.
2015-03-02 12:50:03 -05:00
Sean Hunt
3acd3c4a00 Fold get_wet() into water_damage().
This now ensures that dipping into water works like other sources of
water damage. There is a potentially significant gameplay change here:
dipping a container into uncursed water will wet all its contents. If
this is a problem, then we should add another parameter to water_damage
which will suppress this behaviour for dipping.
2015-03-02 12:50:01 -05:00
Sean Hunt
57dcad3774 Rename rust_dmg() to erode_obj(). 2015-03-02 12:50:01 -05:00
Sean Hunt
3a049cf66e Eliminate erode_obj() and other erosion.
Now all erosion that isn't fire-based goes through `rust_dmg()`
2015-03-02 12:50:00 -05:00
Sean Hunt
7e0d552b06 A lot more cleanup to rust and water. 2015-03-02 12:49:59 -05:00
Sean Hunt
d588210a77 Cover a couple of corner cases with rust_dmg(). 2015-03-02 12:49:57 -05:00
Sean Hunt
9c4b0113aa Remove the victim argument to rust_dmg().
The argument can be calculated from `otmp`.
2015-03-02 12:49:57 -05:00
Sean Hunt
5ffd5a3000 Factor out a new is_moat function.
The fact that Juiblex's swamp is MOAT but not moat is weird and should
probably be looked at at some point.
2015-03-02 12:49:56 -05:00
keni
6fd30ab1ce Manually fix botched NHDT-Branch expansions. 2015-03-01 20:32:28 -05:00
Derek S. Ray
4dddb97301 remove and transfer INVISIBLE_OBJECTS to branch 2015-02-27 19:34:32 -05:00
Sean Hunt
a3faa93403 Remove experimental Unicode support.
This reverts commit 7f0f43e6f9 and some related
subsequent commits.

This compiles, but I have not done extensive testing.

Conflicts:
	include/config.h
	include/decl.h
	include/extern.h
	include/global.h
	include/tradstdc.h
	include/wintty.h
	src/drawing.c
	src/files.c
	src/hacklib.c
	src/mapglyph.c
	src/options.c
	sys/winnt/nttty.c
	win/tty/getline.c
	win/tty/topl.c
	win/tty/wintty.c
2015-02-27 19:34:29 -05:00
Sean Hunt
7c09285a8c Make EXP_ON_BOTL unconditional. 2015-02-27 19:34:26 -05:00
Sean Hunt
0001534d04 Make REDO unconditional. 2015-02-27 19:33:52 -05:00
Sean Hunt
d218bedbf7 Make LOADSYMSETS unconditional.
There are some bugs here, but this functionality should make it into the release
in some form.
2015-02-27 19:33:51 -05:00
Sean Hunt
74e741bbbc Make AUTOPICKUP_EXCEPTIONS unconditional. 2015-02-27 19:33:50 -05:00
Sean Hunt
b138d380ea Make BARGETHROUGH unconditional. 2015-02-27 19:33:48 -05:00
Sean Hunt
6e9fa71b05 Make SEDUCE unconditional. 2015-02-27 19:33:48 -05:00
Pasi Kallinen
612852f7de Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG.
Move debugging output into couple preprocessor defines, which
    are no-op without DEBUG.  To show debugging output from a
    certain source files, use sysconf:

    DEBUGFILES=dungeon.c questpgr.c

    Also fix couple debug lines which did not compile.

This also includes fixes due to Derek Ray to depugpline to work better
on other platforms.
2015-02-27 19:33:45 -05:00
Sean Hunt
ac108cd365 Make GOLDOBJ unconditional. 2015-02-27 19:33:40 -05:00
Sean Hunt
4f59f5c6fd Make WIZARD unconditional. 2015-02-27 19:33:22 -05:00
Sean Hunt
ad82ca80f3 Make DUNGEON_OVERVIEW unconditional. 2015-02-27 19:33:20 -05:00
Sean Hunt
1edadd1d48 Make REINCARNATION unconditional.
There is a lot of code affected by this, and Pat Rankin correctly
observes that it would be better to store roguelike as a level flag
rather than just using Is_rogue_level. A note for the future.
2015-02-27 19:33:16 -05:00
Sean Hunt
260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -05:00
Sean Hunt
5ee71d2757 Make SINKS unconditional. 2015-02-27 19:33:06 -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
Sean Hunt
264dc66129 Make ELBERETH unconditional. 2015-02-27 19:32:53 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
Sean Hunt
a3b1cb8432 Remove the 'nul' variable. 2015-02-18 23:51:31 -05:00
Sean Hunt
862d32c2ec Fix a few compiler (clang) warnings. 2015-02-16 00:23:48 -05:00
Derek
bae3c6088f Exclude all the Win32 build artifacts (Studio and otherwise)
Squashed commit of the following:

commit e37c7626f035a29321c9ac12cca83a0af2132abb
commit 86ebb3e66aedb6b5a31d61d57c39cf84c12d2276
commit 6cd677c8fca4102f223fb1708d00a65c2ded6658
Author: Derek <derekray@gmail.com>
Date:   Fri Feb 13 13:24:29 2015 -0500
2015-02-13 13:26:05 -05:00
nethack.rankin
e8e291b018 fix #H3039 - panic() when trying to drop destroyed items
From a bug report, dropping a lit
(burning) potion of oil while levitating can produce an explosion which can
destroy inventory.  If in the process of dropping multiple items, the ones
after the oil might be gone, resulting in use of stale pointers and possibly
triggering an "extract_nobj: object lost" panic or even a crash.  While
testing my fix, I discovered that being killed by an exploding potion of oil
could produce an "object_is_local" panic if bones are saved  (and reproduced
with unmodified 3.4.3).
2013-11-05 00:57:56 +00:00
nethack.rankin
fec8981102 poly'd hero hiding feedback
When hiding as a monster, say so during the #monster command and
also list being hidden in the status section of enlightenment/^X.

     Also, prevent hiding on the floor or ceiling on the planes of air
and water.  (Didn't apply to monsters, who only hide on ROOM spots.)

     Half the change to dohide() is just revised indentation.
2013-03-16 01:44:28 +00:00
nethack.rankin
0add521787 fix #H2645 - invulnerability during prayer is vulernable to stinking cloud
From a bug report, stinking cloud
harms hero even when u.uninvulnerable is set during successful prayer.
This makes the cloud harmless during prayer as he suggested.

     It also makes being inside a stinking cloud become a major trouble
that prayer can fix.  (With magical breathing such a cloud is harmless and
with poison resistance it is just a nuisance; it won't be considered to be
trouble in such cases.)  The fix is to clear away the cloud, or to teleport
the hero if he's inside multiple overlapping clouds or in one that is
marked as permanent (which I think isn't currently possible).
2012-05-07 01:44:38 +00:00
nethack.rankin
669c2ab560 container_impact_dmg
A post-3.4.3 change made the contents of thrown (or dropped while
levitating) containers subject to breakage, but it had sequence issues.
When something was thrown from outside a shop (or from its doorway or
entry spot) and arrived inside, the shopkeeper was taking possession too
soon, charging the hero for any broken contents, and then going ballistic
(summoning kops and attacking) because the hero was outside the shop while
owing money.  We need to break contents before shk claims ownership, which
turned out to be trickier than it sounds since it has to occur after any
item-hits-floor message if such feedback is given.

    Also, clear the container's contents-known flag when contents break.
Conceivably it should stay set when there is only one item, since hearing
something break could only be that item, but this resets container->cknown
unconditionally if anything inside breaks.
2012-05-05 23:26:26 +00:00
nethack.rankin
9f2ca00138 fix [part of] #H2554 - hunger when declining to attack peaceful monst
Reported last December by <email deleted>, attempting to move
into a peaceful monster's position and then declining to attack at the
confirmation prompt uses no time, as expected, but does burn nutrition
the same as if you carried out the attack.  A player could abuse that to
make room to eat an intrinisic-conferring corpse before it rots away.
This fixes that, and also makes attacking a monster via applying a polearm
and via kicking burn the same extra nutrition as ordinary attack.  I didn't
add it for attacking via throwing.

     He/she also reported that kicking at a peaceful monster and declining
to attack at the prompt wakes up nearby monsters even though no actual kick
ultimately takes place.  I can confirm that, but this does not fix it.
2012-05-01 02:22:33 +00:00
nethack.rankin
ebf42e6746 fix #H2642 - escaping from drowning by moving diagonally
From a bug report, you could crawl
out of water to avoid drowning by moving diagonally into an intact doorway
even though regular movement won't allow that.  (Second version of Medusa's
level has a door adjacent to water.)  You could also escape diagonally when
polymorphed into a grid bug.
2012-04-30 21:25:05 +00:00
nethack.rankin
4c3939bb76 more #overview changes
Change how overview data is handled if/when you get expelled from
the quest:  mark quest levels as unreachable rather than discarding their
overview data, so that it can be included in end of game disclosure (and
can be revived if you manage to return to your quest branch by invoking
the W quest artifact).

     Order of endgame levels was odd:  earth followed by astral, water,
fire, and air, because the code didn't know how to insert in front of the
first one visited.  Now it does.  Placement of endgame levels was sub-
optimal:  since that has the highest internal dungeon branch number, it
came out last.  Now it is forced to come out first, so that it appears
above the dungeon.  And use "Plane of Earth" for level name rather than
"Plane 1", and so on for the others, when in the endgame.

     Since I'm bumping EDITLEVEL due to adding mapseen.flags.unreachable,
I am also inserting u.uevent.uvibrated now so that it won't trigger another
EDITLEVEL increment.  At the moment it doesn't do anything except get set
when you receive the "you feel strange vibrations <under you>" message.
The level where that occurs will eventually have an automatic annotation
of some sort.
2012-04-14 08:31:05 +00:00
nethack.rankin
6218a0eee2 overview disclosure (trunk only)
Add 'o' to "i a v g c" disclosure set, to display final dungeon
overview at end of game.  It lists all levels visited rather than just
those that #overview considers to be interesting, but it doesn't reveal
any undiscovered aspects of those levels except for the presence of bones.
(I think revealing shops and altars and such would be worthwhile, but the
data for that isn't handy at the time.)  If the game ends due to death,
the bones section of the current level will have "you, <reason you died>"
(before any real bones entries for that level).  That occurs before bones
file creation so it doesn't give away whether bones are being saved.

     end.c includes some unrelated lint cleanup.

     Guidebook.{mn,tex} updates the section for autopickup_exceptions as
well as for disclose.  It had some odd looking indentation due to various
explicit paragraph breaks.  I took "experimental" out of its description
since it was moved out of the experimental section of config.h long ago.
The revised Guidebook.tex is untested.
2012-04-09 02:56:37 +00:00
nethack.rankin
ec966362a6 #overview enhancements too (trunk only)
I accidentally left his out of yesterday's commit.
2012-02-16 23:06:00 +00:00
nethack.rankin
337e158009 #overview enhancements (trunk only)
1) add graves to the dungeon features being tracked;
2) report on known bones (determined by seeing map spot(s) where previous
   hero(es) died since there's no guarantee of graves or ghosts);
3) add automatic annotations for oracle, sokoban, bigroom, rogue level,
   Ft.Ludios, castle, valley, and Moloch's sanctum.  For bigroom and rogue
   level you just need to visit that level, for the others you need to get
   far enough along to learn something specific (oracle: her room, sokoban:
   annotation is either "solved" or "unsolved" depending upon whether all
   the holes and pits have been filled, fort and castle: see the drawbridge,
   valley and sanctum: see inside the tended temple).  Discovering the
   relevant locations via magic mapping counts as "far enough along".

     There should probably also be automatic annotations for Medusa and the
vibrating square but I'm not sure what criteria should be used for the
former or what phrasing to use for the latter.  Demon lord/prince lairs fall
into similar category as Medusa.

     TODO: add final #overview as an end of game disclosure option.  (I was
planning this even before I saw that nitrohack has implemented it....)
2012-02-16 02:40:24 +00:00
nethack.rankin
6540843cbf oracle bones (trunk only)
Noticed while working on #overview/#annotate revisions, one of which
will key off the oracle's welcome message.  On a bones level, the oracle
could be outside her room, or the room's one time welcome message could be
used up, or both.  During bones creation, discard her if she's on the wrong
level (probably not possible, aside from wizard mode ^G), try to put her
back into her room if she's outside it on the right level, and restore the
room's type (if she's still in it, or has been successfully moved back into
it) so that next hero who loads the bones will get her welcome message the
first time that room is entered.

     Other special rooms could be fixed up too, provided that they're
sufficiently intact (stealthy hero might enter and get the one-time message
then run away and die elsewhere on the level; at present, next hero won't
get the room's entry message) but this doesn't attempt to deal with that.
2012-02-15 01:55:34 +00:00
nethack.rankin
a2f15cfd61 theft vs donning, round 2 (trunk only)
The message "you stop taking off <that armor>" when interrupted by a
nymph's or monkey's theft attack would only be given if you were using 'A'
to take off the armor.  If you used 'T', you'd get "you stop putting on
<that armor>" instead.  The fix for that also makes it easy to vary the
nymph message "<the nymph persuades> you to start taking off" to be "<the
nymph persuades you to continue taking off" when taking that same piece
of armor off was interrupted by the theft.
2012-02-05 04:26:48 +00:00