Commit Graph

8657 Commits

Author SHA1 Message Date
Pasi Kallinen
ba60bfac25 Themeroom: buried zombies
- add a themeroom with random buried zombifying corpses
- disturbing buried zombies makes them revive much faster
- lua des.object() now returns the object it created
2023-04-01 14:05:18 +03:00
copperwater
4542d14d23 Make "cookie-only" rumors explicit in rumors file
The prior behavior was an ugly kludge that treated rumors as
only-eligible-to-appear-from-fortune-cookies if they contained the
string "fortune" or "pity". This commit gets rid of that system and
introduces a system where each rumor can be specified as such by
prefixing it with "[cookie]".

In order to avoid changing existing behavior, I have applied the
[cookie] prefix to all the rumors which were affected under the old
rules. However, several rumors seem like they were misclassified under
the old rules, and I am in favor of changing them as follows:

Should be made cookie-only (they only really make sense in context of
eating a fortune cookie):
- "Ouch. I hate when that happens."
- "PLEASE ignore previous rumor."
- "Suddenly, the dungeon will collapse..."
- "Unfortunately, this message was left intentionally blank."

Should be made non-cookie-only (they make sense if they appear as
engravings, Oracle messages, or artifact whispers):
- "They say that a gypsy could tell your fortune for a price."
- "They say that fortune cookies are food for thought."
2023-04-01 10:13:01 +03:00
copperwater
886394c9c7 Give a message when a monster is zapped with make invisible
Every other case I'm aware of where a visible monster that the hero can
see turns invisible has some associated message, but not when zapping it
with the wand of make invisible and lacking see invisible. This adds a
message "[monster] vanishes!" in this case, which is the same as the
most common message one gets for zapping a monster with teleportation,
by design to keep the wand's identity ambiguous.

Technically, prior to this commit, there was a leak of information if
one zapped a wand that made a monster disappear: the identity of the
want could be determined immediately by the presence or absence of a
vanishing message. Practically, though, it was easy to check if there
was a new invisible monster in the same spot or not.

Also, zapping teleportation at a monster and having it land somewhere
visible to the hero now has attention explicitly drawn to it with a
message (in prior versions it didn't, so it could potentially be a
different monster appearing by some other means), so I additionally made
the wand of teleportation automatically identify itself when the hero
sees the monster appear as a result of their zap.
2023-04-01 10:00:57 +03:00
PatR
82fc66da0e wands zapped by monsters
Reverse part of commit 4021a63bcf
"wand/spell/breath killer reason" so that wand of magic missile
zapped by a monster isn't ambiguous about who is responsible.
2023-03-31 10:59:48 -07:00
nhmall
9250d85eaa comment bit 2023-03-30 13:10:20 -04:00
Pasi Kallinen
dc12f4f86c Protection from shape changers via wizintrinsics
Setting protection from shape changers via wizintrinsics
caused a sanity error on the next turn, if any monsters affected
by it were in changed shaped on the level.

Call rescham after setting the timeout, so the monsters will
immediately revert to their own form.
2023-03-30 19:56:04 +03:00
PatR
cc2410e349 freeing objects and monsters
Making the zeroing out of memory used by an object that is about to
be freed unconditional, and do the same for monsters.  Should never
matter aside from an undetectable amount of extra overhead.
2023-03-29 15:18:25 -07:00
PatR
dad67436e6 fix #K3895 - 'o' at own spot during pass-walls
If standing at the location of a closed door while having Passes_walls
ability, attemping to open that door with 'o' reported "you don't find
anything here to loot".

Using 'o' to loot for direction ./>/< is intentional but it ignored
the possibility of there also being a closed door present.  When the
latter applies, only switch from open to loot for direction '>' so
that '.' (and '<') will open the door.  Doesn't matter for creatures
that can ooze under a closed door--trying to use 'o' gets rejected for
them because they lack hands.

Also allow hero in Passes_walls form to use 'c' when at open door spot.
(For creatures that ooze under doors, 'c' is rejected just like 'o'.)

Unrelated:  fix a typo in a recently added comment.
2023-03-29 13:48:42 -07:00
Pasi Kallinen
5c39096fd4 Prevent infinite loop making Medusa statues
While fuzzing, the game got stuck here trying to generate
a random stoneable monster for a Medusa level statue.
I didn't investigate deeper why it failed to find a matching
monster type.
2023-03-28 19:55:39 +03:00
PatR
0532eae7d2 feedback when escaping lava
Fix the duplicate feedback given when landing on one or more items
after teleporting out of lava.

This also avoids "you find yourself back on solid water" if you are
able to survive at a water location and safe_teleds() puts you on one.
2023-03-27 17:08:18 -07:00
nhmall
2855f71764 ceiling and surface relocations and adjustments
relocate surface(), ceiling(), and avoid_ceiling() to dungeon.c
adjacent to has_ceiling() etc.

astral and fire, like airlevel and waterlevel return FALSE
for has_ceiling()

if a caller does happen to call ceiling() on fire level,
return "flames above"

if a caller does happen to call ceiling() on quest level,
return a more-generic "expanse above", instead of the
word "ceiling"

add "stairs" return to surface()

remove recent update to engrave.c to special-case "stairs"
since surface() will return that now
2023-03-27 18:09:58 -04:00
PatR
f74628b9d1 shrieker summoning purple worm
Consolidate a couple of makemon() calls.  I thought that this would
end up being clearer but it isn't actually much of an improvement.
Should be no change in behavior.
2023-03-26 22:56:50 -07:00
nhmall
be3659d731 restrict where the engraving symbol shows up
rooms and corridor locations that have been seen
don't hide stairs
2023-03-26 17:32:54 -04:00
PatR
a3d8557ea6 pet->meating doesn't imply helplessness
The overly simplistic fix to prevent pets from picking up objects
while they were busy eating had unwanted side-effects, making them
seem to be paralyzed in some situations such as #chat.  Reverse the
recent change done in commit 754e9333f5
("fix pet picking something up while eating") and handle it in the
pet pick-up code instead.
2023-03-25 12:47:17 -07:00
PatR
a77aef09d7 wornarm_destroyed() vs destroy_arm()
Refine the fix #K3888 by moving multiple instances of the check for
cancel_don() from destroy_arm() to one instance in wornarm_destroyed().
Should be no change in behavior.
2023-03-20 22:59:16 -07:00
PatR
3ce02acbc5 fix #K3888 - object lost panic cased by lava
Report was for spell-casting monster using the destroy armor spell on
hero's levitation boots while hero was floating over lava.  The boots
became unworn but still in inventory, hero dropped into lava, the
boots happened to be an inventory item which got burned up, then the
call stack unwound back to the destroy armor routine which tried to
finish by deleting them but they were already gone by then.  Could
also happen for black dragon breath, hero reading scroll of destroy
armor, or overenchanting the boots with scroll of enchant armor, so
not so unlikely that nobody would be expected to notice.

Initially I couldn't reproduce the object lost panic.  It only happens
if the memory used by the boots is cleared or clobbered during first
time it's freed, otherwise second free doesn't notice any problem.

The 'wornarm_destroyed()' portion of this commit is sufficient to fix
this.  The other bits are things I tried before figuring out how to
reproduce it, plus zeroing out any object passed to dealloc_obj().
2023-03-20 17:05:02 -07:00
Pasi Kallinen
5d3bebd0aa Fix shop closed engraving on secret corridor
The fuzzer stopped due to the "Closed for inventory" shop engraving
being on a secret corridor; ensure that location is either corridor
or room floor.
2023-03-20 11:09:05 +02:00
Pasi Kallinen
fa0ae08f94 Lua object generation didn't obey locked state
Defining des.object({ id="large box", locked=false })
was the same as random locked state. Make it actually mean unlocked,
and not defining locked at all means random.
2023-03-19 20:13:47 +02:00
Pasi Kallinen
59fd05dd5e Fix the prot from shape changers test 2023-03-19 19:36:52 +02:00
nhmall
5f69dc6228 make attack result macros more distinguishable from makemon macros
Use the MM_ prefix only for the makemon macros, and change these five as follows:

 MM_MISS 0x0     -> M_ATTK_MISS      /* aggressor missed */
 MM_HIT 0x1      -> M_ATTK_HIT       /* aggressor hit defender */
 MM_DEF_DIED 0x2 -> M_ATTK_DEF_DIED  /* defender died */
 MM_AGR_DIED 0x4 -> M_ATTK_AGR_DIED  /* aggressor died */
 MM_AGR_DONE 0x8 -> M_ATTK_AGR_DONE  /* aggressor is done with their turn */

include/hack.h:#define NO_MM_FLAGS     0x000000L /* use this rather than plain 0 */
include/hack.h:#define MM_NOWAIT       0x000002L /* don't set STRAT_WAITMASK flags */
include/hack.h:#define MM_NOCOUNTBIRTH 0x000004L /* don't increment born count (for revival) */
include/hack.h:#define MM_IGNOREWATER  0x000008L /* ignore water when positioning */
include/hack.h:#define MM_ADJACENTOK   0x000010L /* acceptable to use adjacent coordinates */
include/hack.h:#define MM_ANGRY        0x000020L /* monster is created angry */
include/hack.h:#define MM_NONAME       0x000040L /* monster is not christened */
include/hack.h:#define MM_EGD          0x000100L /* add egd structure */
include/hack.h:#define MM_EPRI         0x000200L /* add epri structure */
include/hack.h:#define MM_ESHK         0x000400L /* add eshk structure */
include/hack.h:#define MM_EMIN         0x000800L /* add emin structure */
include/hack.h:#define MM_EDOG         0x001000L /* add edog structure */
include/hack.h:#define MM_ASLEEP       0x002000L /* monsters should be generated asleep */
include/hack.h:#define MM_NOGRP        0x004000L /* suppress creation of monster groups */
include/hack.h:#define MM_NOTAIL       0x008000L /* if a long worm, don't give it a tail */
include/hack.h:#define MM_MALE         0x010000L /* male variation */
include/hack.h:#define MM_FEMALE       0x020000L /* female variation */
include/hack.h:#define MM_NOMSG        0x040000L /* no appear message */

include/hack.h:#define MM_NOEXCLAM     0x400000L /* more sedate "<mon> appears." mesg for ^G */
include/hack.h:#define MM_IGNORELAVA   0x800000L /* ignore lava when positioning */
2023-03-19 12:19:34 -04:00
Pasi Kallinen
e29bfcab54 Split eating non-food into separate function 2023-03-19 15:12:08 +02:00
Pasi Kallinen
bf3e784798 Swamp rooms did not delete engravings on pools 2023-03-19 13:03:22 +02:00
Pasi Kallinen
083676e21b Protection from shape changers and the Wizard 2023-03-19 13:01:44 +02:00
Pasi Kallinen
f3d457dbd4 Split trap victim generation into separate function 2023-03-19 10:06:50 +02:00
PatR
0e761c3e30 talking artifact inconsistency
To get the Magic Mirror of Merlin to speak, you could apply it in
any direction (or wield it).  To get the Master Key of Thievery to
speak, you had to apply it toward an adjacent doorway or down while
on a container (or wield it).  Make the key behave like the mirror.
2023-03-18 21:47:34 -07:00
Pasi Kallinen
2a7be0b050 Tutorial: hunger and eating food
Reset hunger when exiting the tutorial.
Add an optional second parameter to lua pline, forcing a more-prompt.
2023-03-18 14:08:13 +02:00
Pasi Kallinen
5ca4e166b1 More fuzzer branch teleporting 2023-03-18 10:46:10 +02:00
Pasi Kallinen
9340197c4c Remove extra full stop 2023-03-18 09:11:18 +02:00
Pasi Kallinen
e37428d5cd Fix fuzzer teleporting out of Fort Ludios 2023-03-18 08:51:37 +02:00
Pasi Kallinen
f360dee4dd Engraving sanity checking 2023-03-18 07:30:25 +02:00
PatR
0d9801e17f vampshifting via polymorph
When a vampire that's already in bat or fog form gets polymorphed,
sometimes take on base vampire form instead of always toggling to
fog or bat.
2023-03-17 16:21:43 -07:00
PatR
1c24f208f3 genetic engineer attacks
When a genetic engineer polymorphs someone it normally teleports away.
Also set mspec_used so that it can't polymorph someone [else] on its
next turn, it case of a no-teleport level or it happens to randomly
land adjacent to the target.
2023-03-17 16:00:44 -07:00
Pasi Kallinen
aa83dadc1e Add stormy level flag
Which makes clouds create lightning bolts at random.
This flag is used on the plane of air.

Breaks saves and bones.
2023-03-17 20:13:32 +02:00
Pasi Kallinen
4799fc937a Add level flag for plane of fire fumaroles
Also reduce the size of the gas clouds.

Breaks saves and bones.
2023-03-17 19:36:00 +02:00
Pasi Kallinen
f2b75c3b0e Fuzzer randomly teleports between dungeon branches
Previously the fuzzer usually stayed in the Dungeons of Doom,
only very rarely going to other dungeon branches. Now, it will
randomly choose a dungeon branch and a level in that branch
to level teleport to.
2023-03-17 14:17:23 +02:00
Pasi Kallinen
da0a681688 Make lua map and terrain commands use same routine 2023-03-17 13:25:43 +02:00
Pasi Kallinen
a5934470dd Fix boulder-on-lava sanity error
Special level creation could make levels with boulders on top
of lava or water; this was caused by mazewalk populating the maze
before the rest of the level was created.

Add a post-level-creation map cleanup routine, where boulders
and traps on liquid terrain are removed.
2023-03-17 13:13:24 +02:00
nhmall
da0e2571a0 fix a spelling mistake in the code 2023-03-16 22:44:42 -04:00
nhmall
de79240dea some comment spelling fixes 2023-03-16 22:27:01 -04:00
PatR
3d24607494 fix #K3860 - figurine of an Angel
If asked to create an Angel when MM_EMIN isn't specified, makemon()
will either create an ordinary monster of type Angel without any
emin extension or add emin and create a minion affiliated with the
god for randomly chosen alignment.  Figurines didn't specify emin
so could result in either type, but wishing for them offered no
opportunity to specify alignment for the second type.

Change figurine activation to force the first type:  an ordinary
monster of type Angel, not affiliated with any particular deity.
2023-03-16 02:24:52 -07:00
PatR
3a30e434d8 "<mon> hits [again]"
Add "again" to the hit message when an attack sequence has
consecutive attacks of same type and they hit.  A {bite, claw, claw}
sequence won't give that for first claw attack regardless of whether
the bite hits but will give it for the second claw attack when both
of the claw attacks hit.

The message sequence
|The fire ant bites!  The fire ant bites!  You're on fire!
or |The fire ant bites!  The fire ant bites!  You avoid harm.
when the first bite was for physical damage and the second was
for fire damage seemed a little confusing.

This changes that to be
|The fire ant bites!  The fire ant bites again!  You're on fire!
or |The fire ant bites!  The fire ant bites again!  You avoid harm.
It still isn't crystal clear that both bites are from a single
attack and that the second bite is for different type of damage
but I think it's an improvement.
2023-03-16 01:54:29 -07:00
PatR
9d11d6bf13 fix #K3884 - sequencing of "You avoid harm" by MC
Many damage handling routines were calling mhitm_mgc_atk_negated()
in advance so that the result could be used for u-vs-m and m-vs-u,
and m-vs-m variations of an attack.  But the monster versus you case
called hitmsg() to deliver a "<mon> <bites, claws, &c> you" message
after that.  When the negation checking routine recently began
issuing messages for some types of damage, they would be delivered
before that hit message when your armor/jewelry negated its damage.
|You avoid harm.      [when MC is about to block the shock]
|The grid bug bites.  [bite for electric damage]
or
|The fire ant bites.  [for physical damage]
|You avoid harm.      [when MC is about to block the fire]
|The fire ant bites.  [second bite for fire damage]

This fixes the sequencing issue at cost of making the code become
even more complicated.  It will probably require further refinement.
2023-03-15 13:59:06 -07:00
PatR
01af084f43 non-digest engulfing
Be more consistent with the engulf attack feedback by creatures who
fold themselves around the victim (trapper, lurker above) rather than
swallow or directly engulf.

Replace an instance of a non-literal format string and the warnings
manipulation it needed with a literal one.
2023-03-13 12:49:22 -07:00
PatR
d86f966ee6 uhitm.c formatting
Shorten or wrap a bunch of too-wide lines in uhitm.c.
2023-03-11 15:51:08 -08:00
nhmall
ae9b236ee6 a few more coordxy inconsistencies 2023-03-11 15:12:02 -05:00
PatR
74ed2999de knockback feedback
Adjust the message given when an attack knocks its target back.  Say
|<defender> is knocked backward by <attacker>
if target will actually move or
|<defender> is knocked back by <attacker>
if there's something preventing the move.  Most players probably won't
even notice the difference.  (Possibly "rocked back" would be better
when not changing location but this hasn't gone that far.)

Also make the knock back distance be 1 step 2/3 of the time or 2 steps
1/3 instead of 50:50 chance for 1 or 2 steps.
2023-03-11 11:21:09 -08:00
Pasi Kallinen
62476fe101 Stop blinking cursor on hero when farlooking
I happened to notice when looking at a ttyrec that farlooking
with automatic description would blink the cursor on hero for
one frame, and then back on the farlooked map location.
2023-03-10 14:11:56 +02:00
nhmall
ecf74d5308 some pline()-like function usage 2023-03-08 19:12:52 -05:00
nhmall
d9b43ce357 adjust wording preceding "Being confused,..." 2023-03-08 19:09:15 -05:00
PatR
6a13ecaf12 \#retravel feedback
Using #retravel when no destination was set up just silenty finished,
effectively a no-op.  Could happen for the first travel attempt on
the current dungeon level, or after most recent #travel successfully
reached and cleared its destination.

Using #retravel when already at previously set but unreached--via
travel--destination, or explicitly picking your own spot as travel
destination using #travel, actually traveled from your current spot
to the same spot.  Usually nothing interesting occurred and you got
no feedback.  However, if you happened to be stuck in a trap at that
spot you tried to walk out of it and got trap feedback about that.
(Then probably right back into the trap if you succeeded in escaping
it.  I didn't try to test that.)
2023-03-08 14:35:24 -08:00