Commit Graph

5254 Commits

Author SHA1 Message Date
Pasi Kallinen
f056bdb429 Comment typofixes, pt 2 2015-10-17 13:15:46 +03:00
Pasi Kallinen
f8b48490aa Comment typofixes 2015-10-17 12:28:52 +03:00
Pasi Kallinen
f4ec27ea13 Comment typofix 2015-10-17 09:01:50 +03:00
PatR
b574bcc93d fountain.c formatting 2015-10-15 12:30:50 -07:00
Pasi Kallinen
f1c1f3cb8a Add missing thrownobj clears when the obj is destroyed 2015-10-15 14:56:42 +03:00
PatR
07554b4613 'v' vs '%'
Guard against the possibility of BETA_INFO (or other fields used to
construct the one-line version string) having a percent sign that would
be misinterpreted during pline processing.
2015-10-14 16:58:26 -07:00
PatR
587279601d sp_lev.c warnings
Fix a couple of warnings about prototype not matching function definition.
Prototype specified a narrow scalar ('boolean') but function uses old-style
definition which implicitly promotes narrow types (char,short,'boolean' to
int, float to double).  Switch prototypes to BOOLEAN_P.

A whole bunch of prototypes specify STATIC_DCL ('static') and then leave
the definition without STATIC_OVL (also 'static').  I only fixed up a
couple of those, but we risk getting somebody using an old compiler that
doesn't like
  static int foo();
  int foo() { return 42; }
Even if every comiler accepts that (I don't recall whether that was kosher
in the ancient K&R days), you can't tell by looking at the function
defintion (in the usual case where the forward declarations are at the top
of the file rather than immediately before the defintiion) whether it's
local to that file or global, so the missing STATIC_OVL qualifiers ought
to be added.
2015-10-13 15:15:06 -07:00
PatR
7451e6c3b0 fix inappropriate merge during aborted throw
Fix the situation reported by Pasi where cancelling a throw via ESC at
the "which direction?" prompt resulted in "object null after merge"
panic from addinv().  I wasn't able to reproduce the panic, but I could
see the throw-nowhere stack getting merged into the quiver stack when
it shouldn't.  This fixes that.

Also a couple of formatting bits.  I wish I'd quit coming across those.
2015-10-13 14:33:42 -07:00
Pasi Kallinen
7e46c4924c Fix segfault when the Wiz fails to reappear due to makemon failing 2015-10-13 22:02:02 +03:00
Pasi Kallinen
60df7b2d3b Fix infinite loop if god cannot fix your trouble
For example, if safe_teleds cannot land you in a safe spot,
because level is full of monsters.
2015-10-13 20:36:40 +03:00
Pasi Kallinen
65a30d2ba7 Fix C343-341: Stuck in minetown room
Bustling Town can be generated with inaccessible areas outside the
top edge of the fixed town map.  If you end up in one of those area
without any way to dig or teleport, you're stuck.

This adds a new level flag "inaccessibles" to force checking for
such inaccessible areas, and add secret doors, holes/trapdoors,
or some random escape item into the areas.
2015-10-13 19:00:22 +03:00
Pasi Kallinen
1703818a11 Wet towels deal more damage
Dipping a towel into a potion, fountain, or some other water source
makes the towel wet.  Hitting with a wet towel deals up to 6 points
of damage, but every hit reduces wetness, as does throwing or applying
the towel.  You can also wish for a moist or wet towel.
2015-10-13 16:28:01 +03:00
PatR
8160990f99 tribute: The Truth 2015-10-13 02:13:37 -07:00
Sean Hunt
7959648024 Avoid referencing a real mental disorder. 2015-10-12 14:43:11 -04:00
nhmall
be1ccf2388 Add at least one quote from the final novel now that it is published 2015-10-12 09:27:42 -04:00
Pasi Kallinen
2f54ed8eae Fix the makemon random coord picking again
This time try random locations up to 50 times, then start going
through the map in order to find a good position. First round
tries to pick a location not in sight, if that fails, it might
try stair or ladder location. If that fails, then it will pick
any good position, whether in sight or not.

Outside field of vision restriction and trying stair or ladder
locations does not happen when the monster is placed from special
level code.
2015-10-12 12:00:51 +03: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
1e8f4ee0b1 Fix segfault when tripping over something
If you tripped over something, and there were no rocks on
that place, the otmp object variable was set to null but used
later for checking if it was a corpse.
2015-10-11 21:53:40 +03:00
Pasi Kallinen
05adaa2a75 Extra checks when freeing objects and monsters
Just in case, so we don't leave objects or monsters inaccessible
by accident.
2015-10-11 21:41:55 +03:00
Pasi Kallinen
f0220c4203 Add monster data sanity checking 2015-10-11 20:36:28 +03:00
Pasi Kallinen
751fab7a59 No need to sanity check objects of a dead monster 2015-10-11 19:06:37 +03:00
Pasi Kallinen
c318f627a4 Ensure null nobj pointer when object is extracted from list 2015-10-11 19:03:01 +03:00
Pasi Kallinen
16018ac824 Put monsters into limbo if they cannot be placed
Whenever mnearto tries to displace a monster from underneath
another, and the displaced one cannot be placed anywhere,
make it drop special objects and put it into migration, with
the current level as the target.

This should be a good enough stopgap measure - it's not going
to happen unless the level is (nearly) full of monsters.

And it seems to cure a near-impossible-to-track data corruption,
with monster list pointing to garbage.
2015-10-11 18:52:27 +03:00
Pasi Kallinen
185515e1c7 Fix infinite loop in makemon if no goodpos available
If the level was full of monsters, goodpos never returns TRUE,
and tryct would not get incremented.
2015-10-11 16:18:13 +03:00
PatR
bc59da6418 tribute: The Fifth Elephant 2015-10-10 03:37:35 -07:00
Pasi Kallinen
cee766eb71 New true rumors, one new hallu mon 2015-10-09 10:26:38 +03:00
Pasi Kallinen
e995d88997 Fix cursed scroll of light on the rogue level
Being blind and engulfed, reading cursed scroll of light did still darken
the room on the Rogue level.  This also changes the logic a bit, so that
cursed scroll of light will douse lamps in your inventory, even when
swallowed.
2015-10-09 08:00:47 +03:00
PatR
a28b535e80 litroom() vs Blind
An item from the "A few bugs" mail was that reading a scroll of light
when swallowed didn't light the surrounding area--which is intended--
but that doing so while blind *did*.  The logic in litroom()--which
the report was based on--was wrong, but do_clear_area() prevented the
light was escaping the engulfer.  So there was no bug from the player's
perspective, but only because the vision code has special handling for
being swallowed.  This fixes litroom()'s logic and does some formatting
cleanup.
2015-10-08 18:05:05 -07:00
PatR
bd3244835e spell of protection
Another item from the "A few bugs" mail.  Casting spell of protection
when previous casting(s) hadn't timed out yet miscalculated the new AC
boost.  At low levels--when this spell probably gets its most use--the
bug wasn't noticeable.  (At high levels when someone might cast it a
whole bunch of times in succession, the effect could be noticed but
was probably just assumed to be working as intended.  Its behavior is
somewhat convoluted.)
2015-10-08 02:19:58 -07:00
PatR
b2dd4bb410 MUSE for branch stairs
Fix another item in the "A few bugs" mail.  Monsters who wanted to flee
weren't able to use 'sstairs' (extra stairway leading to different branch
of dungeon) due to a logic error in the find_defensive() choices.
  if (terrain==STAIR) {
  } else if (terrain==LADDER) {
  } else if (x==sstairs.sx && y==sstairs.sy) {
  } else { /* check traps */
  }
wouldn't find 'sstairs' because they have terrain type STAIRS.  (Also,
the sstairs check wasn't screening out immobile monsters, but that bug
didn't have a chance to manifest.)

There's a bunch of reformatting, and some code re-organization to improve
other formatting, and some additional logic fixes.
2015-10-07 16:32:10 -07:00
PatR
ea0729c5ca some mthrowu.c formatting cleanup 2015-10-07 15:49:59 -07:00
Pasi Kallinen
8212ddd69e setmnotwielded should always MON_NOWEP
Instead of making the caller remember to use MON_NOWEP, make
setmnotwielded handle that automatically.  This fixes the
"bad monster weapon restore" errors I've been seeing.

Also adds sanity checks for this.
2015-10-06 18:47:55 +03:00
PatR
a51531776d flesh golem healing
Fix one of the entries in the "A few bugs" mail.  Flesh golems hit by
electric damage calculated a healing amount of dam/6, then ignored it
and used dam instead.  Probably never noticed in actual play....
2015-10-05 18:32:40 -07:00
PatR
9656225247 sanity check for embedded dragon scales
The problem discovered with sanity checking of embedded dragon scales
was with the checking, not with the object flagged "embedded in skin".
I thought W_ARM got cleared when switching 'uarm' object to 'uskin',
but it isn't.
2015-10-05 18:18:03 -07:00
PatR
d0217160bb tribute: Capre Jugulum 2015-10-02 23:35:41 -07:00
Pasi Kallinen
1fe0f03f8c Document persistent options
Some options are applied from config file only to new games,
so document those.
2015-10-01 13:33:19 +03:00
PatR
154c9f164f tribute: The Last Continent 2015-09-30 15:33:58 -07:00
Pasi Kallinen
59af4e9a49 Refer to relevant config options in the Guidebook
Give the reader a hint what to look for if they want to configure
the message line.
2015-09-30 12:41:03 +03:00
Pasi Kallinen
d9bc2fb621 Add paranoid option for breaking a wand
Add OPTION=paranoid_confirm:wand to prevent accidental
wand breaking - suggested by scorchgeek
2015-09-27 19:13:20 +03:00
PatR
58b9391de8 tribute typos 2015-09-25 15:56:35 -07:00
PatR
08947dcdfa tribute: Jingo 2015-09-24 18:52:39 -07:00
PatR
55e1a50512 tribute: Hogfather
I changed the first quote to use the American spelling (snowplow vs
snowplough) found in the edition I have on hand.

Passages for several more books are still queued up.  Transcribing them
is very tedious.
2015-09-20 16:31:25 -07:00
Pasi Kallinen
798b2e76f9 One more scroll name, a tongue twister 2015-09-17 19:32:28 +03:00
Pasi Kallinen
c48b3c4556 Jump-and-bump should wake up monsters
It was possible to wake up single monsters by jumping at the monster.
Make such bumping somewhat noisy.
2015-09-15 16:17:16 +03:00
PatR
80ca4e9837 novel bit
Feedback phrasing:  don't refer to a novel as a "spellbook" when
rejecting the attempt to write on one with a magic marker.
2015-09-14 17:18:05 -07:00
PatR
29f1470ec6 tribute: Small Gods 2015-09-14 17:15:15 -07:00
Pasi Kallinen
6ba0baa4cd Improve wand of nothing randomizing
As per Sean's suggestion, just use rn2. This means the line
can also be moved to better place, with the other object
init stuff.
2015-09-13 08:53:23 +03:00
Pasi Kallinen
0ee1f31601 Make wand of nothing zap ID harder
Just to mess with zap identification, make wands of nothing
either ask for direction or not, determined at game start.
2015-09-11 18:42:06 +03:00
PatR
27efe608d7 VMS update from KevinS (2 of 2: sys/vms)
Update the command procedure that can be used to compile and link
everything.  The sys/vms Makefiles still need updating.

I added 'tribute' to the command procedure used to create and populate
the plaground directory but am not able to test it.
2015-09-08 16:46:07 -07:00
PatR
ba6c2c1f9f VMS updates from KevinS (1 of 2: core)
His changes add file_exists() to sys/vms/vmsfiles.c, which might be
needed in the future but is not useful here.  Checking for 'gbd' and
'grep' for PANICTRACE support (which I had working on Alpha--and
ought to work on VAX, no idea about IA64--before losing access to vms)
is pointless since neither is used.

src/files.c
  SYSCF support, parse_config_line():
    #if VMS, ignore GDBPATH and GREPPATH if present in sysconf;

  SYSCF support, assure_syscf_file():
    #if VMS, force open()'s optional third argument since the macro
    which redirects open to vms_open requires it.

src/sp_lev.c
  selection_do_randline():
    use configuration-specified 'Rand()' rather than raw 'rand()'.
2015-09-08 16:12:27 -07:00