Commit Graph

5284 Commits

Author SHA1 Message Date
keni
b5f266ee45 Add a Ben Aaronovitch quote as an engraving. 2015-10-30 09:33:43 -04:00
Pasi Kallinen
230cd0abed Fix syntax error in MacGraphics conditional part 2015-10-30 10:15:28 +02:00
PatR
8a5f340579 commit 84bec89d403a219ff75ae3fa97109de0cfb7941f
Author: PatR <rankin@nethack.org>
Date:   Fri Oct 30 00:50:52 2015 -0700

    more formatting

    Fix up the files containing '[?:] */' to get trailing trinary operator
    followed by end-of-line comment.  Tab replacement and removal of excess
    parentheses on return statements also done.
2015-10-30 00:58:06 -07:00
PatR
7b82fed49d '#turn' for non-priests/non-knights
Another code change while reformatting:  '#turn' by non-priest/non-knight
casts the "turn undead" spell if the hero has learned it, but it was
forcing the spell code to aim at self rather than ask for a direction.
Evidently nobody has ever used that while knowing the spell and able to
cast it....
2015-10-30 00:44:58 -07:00
PatR
1da6486e7b OSX vs apple core dump
Some reformatting mutated into a code change:  OSX gets code from two
conditional blocks
  '#if UNIX: eat apple or pear, give "core dump" message'
  '#if MAC || OSX: eat apple, give "It's a Macintosh" message'
but the second wouldn't be chosen due to the if-then-else logic having
already handled obj->otyp==APPLE before it was reached.  Reorder them
so that OSX gets the Macintosh message for apples and the core dump
message for pears.
2015-10-30 00:20:59 -07:00
PatR
41a40d41a0 monsters moving after player leaves level
Fix the problem reported by ais where it was possible for one monster
to knock the hero onto a level teleporter (or trapdoor or hole),
destination was selected and allowed-to-level-teleport checks were made,
then for another monster to knock or teleport the not-yet-relocated-hero
onto the Amulet and have auto-pickup move it into inventory.  At the end
of that turn's monster movement, hero would level teleport successfully
despite carrying the Amulet.

This short-circuits monster movement if the hero is scheduled to be
moved to a different level.  The monsters who haven't moved yet don't
lose their pending movement points; they'll catch up if/when the hero
returns to the level.
2015-10-29 18:18:12 -07:00
Pasi Kallinen
9008ba321b Fix uninitialized variable 2015-10-29 21:45:35 +02:00
Pasi Kallinen
2d83b83cc2 Fix uninitialized variable 2015-10-29 20:26:25 +02:00
PatR
a447534b2f formatting: src/t*.c - z*.c continuation lines
End of first pass, but '[&|?:][ \t]*$' doesn't catch trailing operater
followed by end-of-line comment so more needs to be done.  As with the
past couple of batches, I've removed redundant parentheses from 'return'
statements but only for files that had continuation fix-ups.

I've also removed tabs from comments in some of the files, but didn't
start until part way through this subset of the sources.
2015-10-28 17:33:38 -07:00
Pasi Kallinen
530ba8e3d3 Add sanity checking for light sources 2015-10-27 18:36:07 +02:00
Pasi Kallinen
ec58bfaa22 Pass LFLAGS from hints file to util Makefile 2015-10-27 18:13:35 +02:00
PatR
bb09cab067 formatting: src/r*.c - src/s*.c continuation lines 2015-10-26 17:49:40 -07:00
Pasi Kallinen
3fd92e3ef8 Fix mon weapon inconsistency when monster got disintegrated
This happened when the monster, who was wielding a weapon, got hit
by a disintegration blast, and then lifesaved by a worn amulet.
2015-10-24 09:30:38 +03:00
keni
c574b566be First bits of a hints file for 10.11. Still needs (at minimum) new packaging code. 2015-10-23 13:47:38 -04:00
PatR
e15f6cc965 tribute: The Wee Free Men 2015-10-23 01:37:31 -07:00
PatR
ea8a1beb0a formatting: src/m*.c - p*.c continuation lines
Somewhere along the line I started removing redundant parentheses from
return statements, but only in files that needed continuation fixups
so it's not comprehensive.
2015-10-22 16:35:01 -07:00
PatR
1e07a9637a tribute typo 2015-10-21 16:56:39 -07:00
PatR
ac27d2af43 trubute: Night Watch 2015-10-21 01:02:18 -07:00
PatR
b7b9d8faa9 formatting: src/e*.c - l*.c continuation lines
Relatively small number of continuation fixes needed for this subset.

Quite a bit of mangling to engrave.c unrelated to continuation lines,
with three or four coding changes.
2015-10-20 17:55:26 -07:00
Pasi Kallinen
581b1830ff Fix segfault when chameleon form fails on the Rogue level 2015-10-20 17:28:16 +03:00
PatR
3986546325 formatting: src/a*.c - d*.c continuation lines
Mostly && and || at end of the first half of a continued line rather
than at the start of the second half.  The automated reformat got
confused by comments in the midst of such lines.
  foo ||
  bar
was converted to
  foo
  || bar
but
  foo ||
  /* comment */
  bar
stayed as is.

Some excluded code [#if 0] was also manually reformatted, but this is
mainly stuff that can be found via regexp '[&|?:][ \t]*$' (with a lot
of false hits for labels whose colon ends their line).
2015-10-19 17:32:21 -07:00
PatR
2c20805b16 unsplitting split object stack
Replace the code that Dean objected to with something a little bit more
robust.  It doesn't rely on the two stacks being adjacent or having the
same inventory letter.  It is still vulnerable to having another
splitobj() occur between the offending split and its attempted unsplit,
or to either of the two halves of a split being extracted from their
object chain.  As before, failure to unsplit only results in the two
halves of the split remaining separate stacks, not anything more drastic
like the panic() that prompted all this.

Simplification of hallucinated currency names got mixed in with this
patch.  I haven't bothered separating it back out.

Whoever reset PATCHLEVEL to 0 jumped the gun.  This patch increments it
since change to the 'context' structure breaks save file compatibility,
so it will need to undergo another reset before release.
2015-10-18 17:37:15 -07:00
PatR
ab5cafaa62 clear_bypasses() comment
While looking at clear_bypasses() I noticed some excluded code [#if 0]
which could be risky to include, so update the comment there.  Also,
excluded code tends to need formatting fix-up.
2015-10-18 17:29:19 -07:00
Pasi Kallinen
fb14c41bd4 Add more hallu monsters 2015-10-18 18:11:56 +03:00
Pasi Kallinen
95983f6ae6 Use macros for monster appearances 2015-10-18 13:55:11 +03:00
PatR
822b372644 tribute: Thief of Time
For passage 4, I ended up including a lot more than originally intended.
The text is only two full pages (top of 74 to bottom of 75) though.
2015-10-18 02:15:15 -07:00
Pasi Kallinen
857225ad0f Use existing function for stumbling on door mimic 2015-10-18 09:57:07 +03:00
PatR
4b8db661dd wet towel enhancements
Flesh out wet towels a bit:
1) wielding a wet towel--or a dry one which becomes wet--won't give a
   "you begin bashing with your wet towel" message when attacking;
2) if a formerly wet towel dries out completely while wielded, *do* give
   "you begin bashing with your towel" on the next attack;
3) successfully hitting with a wet towel no longer always loses wetness;
4) water damage to dry towel always confers at least 1 point of wetness;
5) taking fire damage (via burnarmor() which is used for most types of
   fire damage) has a chance to partially or fully dry a wet towel
   (regardless of whether it's wielded at the time; applies to monsters
   as well as hero; each towel being carried is checked until one is
   affected, then any others escape drying.

Not done:
-) attacking with a wielded wet towel perhaps ought to be treated as a
   weapon attack using whip skill rather than an augmented arbitrary-
   junk-by-weight attack;
-) throwing a wet towel should probably ignore wetness--it's just a wet
   piece of cloth when not finishing with a whip snap; right now, it
   loses a point of wetness when thrown and usually--#3 above--another
   point if it hits...;
-) hitting burning creatures is no different than hitting anything else;
-) likewise for hitting wet creatures.
2015-10-17 17:00:53 -07:00
Pasi Kallinen
af1c77808b Comment typofixes, pt 4 2015-10-17 18:47:31 +03:00
Pasi Kallinen
66dd87454b Comment typofixes, pt 3 2015-10-17 13:47:25 +03:00
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