Commit Graph

449 Commits

Author SHA1 Message Date
nethack.allison
c146fe012d housekeeping: mark trunk sources 3.5 (include) 2005-01-02 16:50:12 +00:00
nethack.allison
1ea5274c10 new year 2005-01-02 13:13:17 +00:00
nethack.allison
10e8c11c0a region player_flags follow-up correction [trunk only] 2005-01-02 13:04:56 +00:00
nethack.allison
a5e12a3519 region boolean field [trunk only]
Since the trunk breaks savefile compatibility anyway,
remove some code that was inappropriately loading a boolean
with multiple values in order to preserve savefile compatibility in 3.4.x

[Note: this patch increments EDITLEVEL rendering existing bones
and save files obsolete]
2004-12-30 15:54:42 +00:00
nethack.rankin
3f2aa875bb fix monster summoning message
From a bug report:
> If the Summon Nasties monster spell gates in two minions instead of one,
> the message still says "A monster appears from nowhere!"

The code wasn't counting any summoned monsters who had an opposite alignment
to the summoner.  It also assumed that the 10% chance for demon summoning
in Gehennom always yielded exactly one monster even though that can produce
zero or more than one.
2004-12-21 04:27:34 +00:00
nethack.allison
1c326a95e1 monster order rules
<Someone> wrote:
> From the mkclass() comments:
>
> /*      Assumption #2:  monsters of a given class are presented in ascending
> *                      order of strength.
> */
>
> And monst.c:
>
>  *      Rule #2:        monsters of a given class are presented in ascending
>  *                      order of strength.
>
>  *      Rule #4:        monster subclasses (e.g. giants) should be kept
>  *                      together, unless it violates Rule 2.  NOGEN monsters
>  *                      won't violate Rule 2.
>
> Inspecting my monster-difficulty spoiler, I see the following places
> that these precepts are violated: do they cause potential problems?
> (Insofar as occasionally incorrectly miscalculating the probabilities
> for monster generation is a "problem", that is...)
>
> SPECIES                DIF
> ~~~~~~~~~~~~~~~~~~~~~~ ~~~
> d                  dog   5
> d            large dog   7
> d                dingo   5
>
> d                 warg   8
> d      winter wolf cub   7
> d          winter wolf   9
>
> u        white unicorn   6
> u         gray unicorn   6
> u        black unicorn   6
> u                 pony   4
>
> H          frost giant  13
> H          storm giant  19
> H                ettin  13
>
> P        black pudding  12
> P          green slime   8
>
> S            pit viper   9
> S               python   8
> S                cobra  10
>
> Z         giant zombie   9
> Z                ghoul   5
>
> @                nurse  13
> @              soldier   8
> @             sergeant  10
>
> &         horned devil   9
> &             succubus   8
>
> &               balrog  20
> &            sandestin  15
>
> (I've just realised that these may have already been fixed, and
> waiting on a file-compatibility-breaking release; if so, ignore me :-)
2004-12-17 01:32:59 +00:00
nethack.allison
5a433fe0e0 new container flags
[Attention: This patch increments EDITLEVEL in patchlevel.h, rendering all
 previous save and bones files obsolete.]

Here's the first cut at the two recommended flags lknown and cknown.
I've attempted to stay close to Pat's recommendations:
   "Containers ought to have two new flags:  lknown for lock status known,
    and cknown for contents known (ie, `secret').  Formatted box and chest
    descriptions should include locked/unlocked/broken when that is known
    and empty/nonempty (or something like "holds N items") when contents
    are known. The contents indicator would also apply to nonlockable
    containers."

I probably overlooked a place where a flag should be adjusted, but this
should give us a good starting point.

I wasn't sure what to do with the case of the auditory feedback for
magical locking "Click" and "Clunk". The question that came to my mind
was: Should those reveal the locked or unlocked status of a box?
I suppose if you knew the type of wand you were zapping or the spell
you were casting, you could argue that they should.

In the end, I opted for setting lknown right off the zap/cast effect
for anyone playing a Wizard role, and not setting it for anyone else,
thus advancing class differentiation a little bit too.

I haven't checked the cknown results under all flags.menu_style options
at this point, only MENU_FULL.
2004-12-15 23:50:18 +00:00
nethack.rankin
00dcc2ae4c fix #U1206 - Quest artifact in WIZKIT file aborts program
Fix the wizard mode crash From a bug report.  Move the WIZKIT
message suppression to a lower level instead of trying to guard against
present and future pline() calls in the wishing code.  The way that was
being handling wasn't suitable for dealing with quest feedback.

     This also includes a couple of additional wishing synonyms.
2004-11-24 02:50:32 +00:00
nethack.rankin
7672a2c60b hats vs helms
Something from <Someone>'s list:  some messages have hardcoded references
to "helmet" which sound strange when the character is wearing a hat or cap.
helm_simple_name() is comparable to the existing cloak_simple_name().  It
returns "helm" or "hat" depending upon whether the helmet provides the
same protection that yields the assorted repetitions of "fortunately,
you are wearing a hard helmet".  This choice ends up categorizing elven
leather helm as a hat (which I think is ok given that its undiscovered
description is "leather hat"), contrary to <Someone>'s suggestion that the
distinction be made based on whether the helmet was made of cloth.

     I started on this a year and a half ago but didn't commit it.
Unfortunately I don't remember why and haven't done any significant
additional work now--just recovered from some intervening bit rot and
confirmed that the patch as is seems to be working ok (in the trunk; the
branch side has not been tested).  I suspect that I meant to look for
additional helmet messages which could benefit from conditional headgear
description.  (Those "hard helmet" ones don't need it, although they
should perhaps be moved into a common routine instead of being replicated.)
2004-11-13 04:00:52 +00:00
nethack.rankin
aa58ee1ab7 Glib messages when dropping weapons
<Someone> reported that she got "your weapon slips from your hands" when
inflicted with slippery fingers while wielding multiple daggers.  That
should be "weapons" plural and they're only being dropped from one "hand"
singular.  Fix that and also give more specific feedback than "weapon"
for non-swords based on their weapon skill category names.  This works
pretty well for most common weapons but might need some more tweaking for
ones where different types have gotten lumped together in the skills.

old feedback:
  Your weapon slips from your hands.
  Your tool slips from your hands.
  Your food slips from your hands.
twoweapon:
  Your sword slips from your hands.
  Your other sword also slips from your hands.

new feedback:
  Your daggers slip from your hand.
  Your <one-hander> slips from your hand.
  Your <two-hander> slips from your hands.
  Your pick-axe slips from your hand.
  The corpse slips from your hand.
twoweapon:
  Your sword slips from your left hand.
  Your other sword also slips from your right hand.
2004-11-02 05:15:33 +00:00
nethack.rankin
98ab86c9ec gas spores attempting to attack
From a bug report, but pulls back" while successfully
praying.  Gas spores' only "attack" is to explode when dying, so the code
that checks whether the monster has any attack needs to handle AT_BOOM as
a special case.  Unfortunately this change means that you won't interrupt
an occupation when a gas spore approaches, and a subsequent kill by your
pet might end up causing you harm while still occupied.  The callers of
`noattacks()' are messy enough that I didn't want to try to address that.

     This also moves noattacks() from mhitm.c to somewhere more sensible.
2004-10-22 02:15:33 +00:00
nethack.rankin
eaae10c837 fix #U782 - undead turning in a shop [trunk only]
Reported last December by <email deleted>.  Using
a wand or spell of undead turning inside a shop used up corpses without
checking whether they were owned by the shop.  Although the report didn't
mention it, using stone-to-flesh on statues had the same problem.

     I'm not completely satisfied by some aspects of this code, but if I
don't commit what I've got now I probably never would.  My original notes
are lost; I thought that there were some additional fixes present, but
looking at these diffs I don't see anything else significant enough to
warrant mention in the fixes file.
2004-10-22 01:04:34 +00:00
nethack.allison
d84ad3ec3c rolling boulder not in bones files
<Someone> Cced from rgrn:
  <email deleted> (<Someone>) writes:
  [killed by a boulder trap, left bones]

  > Then I realized... there's no boulder.  Did the boulder disappear
  > because I died from the attack, thus bypassing the code that moves the
  > boulder to its intended destination?  Did the creation of the bones
  > file destroy the boulder?  Do boulder traps sometimes get
  > "deactivated" when bones files are loaded?

  The first of these. If you look at launch_obj(), there's an
  obj_extract_self() early on, then all the tracking its trajectory,
  then a place_object() when it comes to rest; since the thitu() call
  kills you during the trajectory part, the boulder never gets re-placed
  onto the map. This is, I think, a bug (and one that will apply to any
  monster-thrown object that kills you, as well); reported to the
  DevTeam.
2004-08-23 16:57:59 +00:00
kmhugo
f4322a56fb Mac Carbon updates 2004-08-10 05:37:41 +00:00
nethack.allison
9b3521e503 vampires now shapeshift [trunk only]
- can shift into fog clouds, vampire bats, and vampire lords into wolves
- after being "killed" in shifted form, they transform back rather than get
  destroyed, and you must take them on in vampire form to defeat them
- can deliberately shift into fog clouds to pass under closed doors
2004-06-15 11:52:04 +00:00
nethack.allison
c8ef9338f0 cham changes (trunk only)
This is a foundation patch for patches to follow.
- use a full short index for mon->cham field.
- The current system of providing CHAM_XXX values
  was limited to the 3 bits allocated in the bitfield and invalidated
  save/bones if the field was expanded.
- The current system didn't provide an easy backwards  change
  if multiple monster types wanted to use the bit, there was a one
  to one mapping:  For instance, if you wanted a CHAM_VAMPIRE,
  and you wanted vampires, vampire lords, and Vlad to use it, you
  would have to have CHAM_VAMPIRE, CHAM_VAMPIRE_LORD,
  and CHAM_VLAD defined to achieve that with the one-to-one backward
  mapping.
- This new way just uses the mon[] index in the mon->cham field and
  eliminates the need for CHAM_XXX  (CHAM_ORDINARY is still used).
- no longer requires the cham_to_pm mappings
2004-06-15 11:38:32 +00:00
nethack.allison
9840d7611b djinn/ghosts from potions
<Someone> wrote:
>It seems silly to have two flags being used for counting djinn and
>ghosts, now that there's mvitals.born...

This does not break save and bones compatibility in the 3.4.x branch,
it changes the code, but leaves the obsolete fields in flags.
2004-06-05 18:10:04 +00:00
nethack.allison
7de00a45be C342-46: cleric cast lightning
Get rid of an old known buglist entry C342-46
> Cleric cast lightning doesn't blind as other lightning does
2004-06-05 05:22:40 +00:00
nethack.allison
13e9e30acc #U986: <email deleted> wrote
on Sunday, April 4, 2004 at 20:27:06:
> On occassion when restoring a game where the
> character is wielding Sting, floor glyphs
> will show up before the --more-- prompt.
> These floor glyphs usually correspond to the
> location of monsters (sometimes they are just
> cavern features such as walls).  Some of these
> floor glyphs are not in the character's line
> of sight upon restoring.

Also in this patch is a restore of Sting's ability
to glow blue.
2004-06-04 03:56:27 +00:00
nethack.allison
6644c4086f polywarn (trunk only)
This patch increments editlevel making existing save and bones files useless.

Add polywarn() code to grant the ability to detect certain monster
types while polymorphed into other specific monster types.

If you polymorph into a vampire or vampire lord, you are able to
sense humans.

And just for fun, if you polymorph into a purple worm, you are able to
sense shriekers :-)
2004-06-03 04:20:13 +00:00
nethack.allison
e523b6accc enlightenment
Give more information about your attributes in debug mode
via Control-X.

I'd like to see some way of getting bits of this info to the
player during the game (from the Oracle or something),
but this patch keeps it limited to debug mode.
2004-06-01 05:22:28 +00:00
nethack.allison
e54760e29d attribute check timer (trunk only)
Move the counter for the next attribute check to the context
structure.

This increments patchlevel so previous save and bones
files are unuseable after applying.
2004-05-25 02:16:22 +00:00
nethack.rankin
9620eefd50 shapechanger hit points (trunk only)
Try to fix the report of a doppelganger (created from using stone-
to-flesh on a fake statue of Demogorgon) having 1700 hit points after
reverting to its native form.  The problem was due to the special monster
level of Demogorgon rather than anything to do with shape changers; the
actual bug was use of `mdat->mlevel' where it should have been using
`mtmp->data->mlevel'.  But the whole section of code was rather suspect
since it didn't attempt to handle other types of monsters (dragons, golems,
elementals) which have non-standard hit points, so I knocked some out.
Monsters who have gained or lost levels prior to changing form will no
longer carry that adjustment along; the new form will always be a brand
new one of its type.  However, if the old form is injured at the time of
change, the new form will be too (same as before).
2004-05-22 03:24:23 +00:00
nethack.allison
3ad4bf5b3a U1039 passive() stoning check tweak
>If you hit a cockatrice with a weapon that immediately breaks
>(like a potion, mirror, or cockatrice egg) you get stoned,

Add a parameter to passive() to make it possible to pass
additional information that indicates that the weapon was
there at the start of the turn, but destroyed during the turn.
2004-05-09 16:53:16 +00:00
nethack.allison
6dc1bbd544 giant carrying boulder dies while trapped in a pit (trunk only)
<Someone> wrote:
> "You kill the invisible storm giant.  The boulder fills a pit."
> [...] why did I find the corpse *lying on* and not *buried in* the
> former pit?

Ensure that the corpse ends up buried in that case.
2004-04-11 18:39:14 +00:00
nethack.allison
1194454b2f lifting vs removing
<Someone> wrote:
> You have much trouble removing u - a helmet.
> You have much trouble lifting a plate mail. Continue? [ynq] (q)
> You have much trouble removing R - a plate mail.
> You have much trouble removing N - a leather cloak.
> Why am I told that I have trouble "lifting" a plate mail?

1. Add strsubst() routine to hacklib to replace a word or phrase in a string in place.
2. Correct the inconsistency reported.
2004-04-11 15:34:04 +00:00
arromdee
74b4ffe486 blindfold (from r.g.r.n)
Someone suggested that if your vision is only blocked by a blindfold and it's
the blindfold that glows, you should be able to see it.
2004-03-12 03:57:20 +00:00
nethack.allison
42f202f4c0 new context_info struct in compat checks (trunk only)
Add the context_info struct to the version compatibility checks.
This increments EDITLEVEL rendering prior save/bones files useless.
2004-02-02 01:30:31 +00:00
cohrs
6f0fb33e9f general musical instrument use while polymorphed
Extend the previous patch to cover all blown instruments.  Also covers
the case of the player strangling.  The test is moved to a new can_blow
function to keep the test in one place.  It supports any monster, although
all current tests are for the player.
2004-01-27 00:23:31 +00:00
nethack.allison
f2101638db avoid "It turns into it"
<Someone> drew attention to the silly message in the newsgroup

Since I'm not sure if the act of polymorphing has a sound,
I opted to use a new usmellmon() routine to put out a
message based on the smell of the resulting monster
under those circumstances.

Not every monster has a recognizable smell, so no
message at all is given in that case.

olfactory(youmonst.data) will determine whether
you are capable of detecting smells.

There is lots of room for enhancement, and some of the
existing smell-related messages in the source should perhaps
be checking olfactory(youmonst.data) too, but this patch
doesn't go that far.
2004-01-17 20:42:14 +00:00
nethack.allison
569cb15070 new year 2004-01-11 02:30:07 +00:00
nethack.allison
57b1e96238 teetering on edge of pit
- when you're teetering on the edge of a pit you can use '>' to enter the pit
- pull the numerious teetering checks into a new function
2003-12-22 19:09:39 +00:00
nethack.rankin
a4a80fdbca back into test mode
Post-release, reset to BETA status to indicate development since
there's no ALPHA.  And use BETA to enable the latent RNG checks.
2003-12-13 15:01:49 +00:00
nethack.allison
f935974e02 apply Janet's lint catches to trunk 2003-12-10 01:23:14 +00:00
cohrs
f52e1de293 OS2 bits
Ronald Van Iwaarden wrote:
... lines 1845 and 1846 of cmd.c generate a 'value out of range
warning' due to the compiler making 0x80 an integer rather than a character
and '|'ing it with the argument.  This requires a minor change to micro.h.
[ Makefile.os2 rev does not currently make sense in the trunk. ]
2003-12-07 20:20:59 +00:00
nethack.rankin
f98e7d1fe6 vms version bit (trunk only)
Similar to the branch change; partial version number update for
the vms default build configuration.
2003-12-07 19:10:31 +00:00
nethack.allison
2a91bc6a50 fix message when were_summoning 2003-12-07 09:45:34 +00:00
nethack.allison
19976253a0 wince build fix (from <Someone>)
[this is not meant to trigger re-packaging for 3.4.3]

Windows CE defines leave as part of exception handling (__leave)
It confilicts with existing sources and since we don't use exceptions
it is safe to undefine it
2003-12-07 01:33:25 +00:00
nethack.rankin
2e28abcd5a fix the "big abuse" reported a few days ago
It was possible to get a shopkeeper to carry the Amulet from the
bottom of the dungeon up to the location of his shop, thereby bypassing
the usual labor of lugging it up yourself.  [Drop the Amulet somewhere;
rob a shop so that the Kops are summoned and the shk comes after you;
when shk is next you, level teleport to the Amulet (probably two hops,
one to the Valley and another deeper into Gehennom); walk to the vicinity
of the Amulet; shk will eventually pick it up (shopkeepers like to pick
up magic items); now, pay him for the stolen goods--he'll be pacified
and migrate back to his shop, taking his inventory with him; lastly,
return to his shop and relieve him of his burder.]  This patch makes
shopkeepers drop the Amulet or invocation tools if/when they set set to
migrate to their normal location.

     Also fix another long standing risk that a monster that is sent
away (nurse when healing, Kops when you pacify a shopkeeper) might be
carrying the Amulet or one of the invocation tools and make the game
unwinnable.  I doubt that that's ever actually happened but I think it'd
be possible if a monster that likes magic items ever got polymorphed
into a Kop.  Such dismissed monsters will now drop the same stuff as
the shk above prior to leaving the game.
2003-12-06 14:08:51 +00:00
nethack.allison
3b2b16ea9d patchlevel sync 2003-12-06 13:15:55 +00:00
nethack.allison
40f3251cf4 prevent infinite recursion in impossible 2003-12-05 12:30:18 +00:00
nethack.allison
db7d800c98 autopickup_exception
use doname() instead of xname()
2003-12-02 03:14:50 +00:00
nethack.allison
063da8fc3a sync trunk patchlevel.h with branch 2003-12-02 00:42:32 +00:00
nethack.rankin
fbfb8e92ab corpse revival and statue animation (trunk only)
Try to address the problem From a bug report:  turning the Wizard
of Yendor to stone preserves monster information with his statue and
presence of that information overrides the statue animation check
intended to prevent players from creating the Wizard (or other unique
monsters).  That's ok for the current game--the monster had to have been
in play in order to be turned to stone--but is a problem if the statue
is found in a bones file.  The report was for placing such a statue at
the location of an untriggered statue trap by a player who leaves bones,
but stone-to-flesh by the player who loads bones is a simpler way to
trigger this.  (Aside from getting unique monsters earlier than usual
under some degree of player control they won't have their starting
inventory so special items like the Candelabrum might not get created.)
Using undead turning to revive corpses found in bones was another way to
get into the same trouble (I thought corpses of special monsters were
already excluded from bones?).

     It looks like it's also possible to get strange quest behavior if
a corpse or statue of the leader or nemesis is brought into the dungeon,
left in bones, then revived by the second player, but I didn't attempt
to reproduce it.  More work is probably needed; this tightens up leader
handling a bit but doesn't do anything about the nemesis.  This patch
has already been spreading tentacles and I've got to cut it off....

     The patch discards saved monster traits for corpses and statues of
unique monsters while saving bones; reviving or reanimating them will
produce doppelgangers instead of the original monsters, same as stone-to-
flesh on wished-for statues behaves.  It also discards saved traits for
shopkeepers (also temple priests and vault guards--their traits weren't
saved in 3.4.2 though).  That info might be useable when the corpse or
statue is on the same level as the monster started (ie, where its special
room is located), but that's a complication I'm going to bypass.  This
patch also adds chameleon handling for statue activation--it wouldn't
have mattered in 3.4.2 since shapechangers didn't get their traits saved;
it does matter now but was omitted when trait-saving was extended to all
statues a while back.  (It adds chameleon handling to corpse revival too,
but they still don't get their traits saved with corpses so that's just
protection in case of future modifications.)

     Other bits:  `cant_create()' is renamed to `cant_revive()' since
the latter is a more signicant use than wizard mode <ctrl/G> handling.
Now save traits with nymph corses so that cancellation can be propagated
if they're revived; that doesn't matter much but matches statue handling
(where it was more important since it dealt with succubi as well as with
nymphs).  Explicitly initialize the shape-changer field of all monsters
instead of relying on implicit initialization to 0 (CHAM_ORDINARY).

     There'll be a *much* shorter patch for 3.4.3 which will have to get
by with most of these obscure problems--fortunately they're unlikely to
impact many (any?) players.
2003-11-30 21:19:01 +00:00
nethack.rankin
b56641dc2e status bits
Declare structure before using it in prototypes, and declare atol()
for configurations which don't have or don't use <stdlib.h>.  (Some
#ifdef MICRO code for atoi at the end of system.h might need to be done
for atol too.)
2003-11-30 11:04:54 +00:00
nethack.allison
73e2a01501 unintentional change removal
A recursive guard check was accidentally checked in with the
status field stuff. Remove it.
2003-11-30 05:54:02 +00:00
nethack.allison
10480f4397 core support for status field highlighting (trunk only)
This provides the core support needed for status field highlighting.
This patch doesn't actually perform status field highlighting for any port,
but provides the core hooks for doing so.

The syntax is:
OPTIONS=hilite_status:{fieldname}/{threshold}/{below}/{above}
where {fieldname} is the name of a status field.
           {threshold} is the value used as the threshold to trigger a display
                             change.  It can also be set to "updown" to trigger
                             a display change whenever it rises or whenever it falls.
                             If you end the threshold value with %, then it signifies
                             that you want to trigger the display change based on the
                             percentage of maximum.
         {below}, {above}
                        are the color or display attribute that you want to use when
                        the field value is underneath the threshold. Supported display
                        fields are:  normal, inverse, bold, black, red, green,
                                         brown, blue, magenta, cyan, gray, orange,
                                         bright-green, yellow, bright-blue, bright-magenta,
                                         bright-cyan, or white.
Valid field names are:
        alignment, armor-class, carrying-capacity,
        charisma, condition, constitution, dexterity,
        dungeon-level, experience-level, experience,
        gold, HD, hitpoints-max, hitpoints, hunger,
        intelligence, power-max, power, score,
        strength, time, title, wisdom

Refer to window.doc for details. Guidebook updates to come later.
2003-11-30 05:51:53 +00:00
nethack.rankin
3c29cbfeab poison messages (trunk only)
<Someone> reported something along the lines of

  "You are hit by a little dart."
[ "The dart was poisoned." -- this expected message was missing ]
  "The poison doesn't seem to affect you."

Remove the overloading of ``chance for fatal poison'' and ``thrown weapon''
(which reduces that chance, among other things) for the arguments passed to
poisoned() and change how it decides whether feedback about being poisoned
is needed.  Also, move poisoned() and poisontell() from mon.c to attrib.c.
2003-11-27 05:00:29 +00:00
nethack.allison
71b947af0e more status_via_windowport (trunk only)
It was possible for status_finish to get called twice, therefore free() could end up called twice.

Add a macro symbol for the argument to status_initialize().

Adjust some field widths so that there is a little bit of breathing space.
2003-11-25 00:31:19 +00:00
nethack.rankin
d74990926c paniclog enhancement
Include the version number in paniclog entries, so there'll be more
information whenever someone forwards them to us.
2003-11-23 10:01:58 +00:00