More interesting rolling boulder traps

Rolling boulder traps now react to having boulders pushed onto them;
the boulder will roll until reaching the trap's launch spot
(resetting the trap if the boulder was removed), or until it hits a
wall otherwise.

Because they can now be reset, they aren't removed when stepping on
them with a misplaced boulder (although no boulder moves unless
there's one on the appropriate spot).
This commit is contained in:
Alex Smith
2026-04-14 11:28:07 +01:00
parent 10a47c0713
commit bc94d7a355
3 changed files with 31 additions and 5 deletions

View File

@@ -1583,8 +1583,8 @@ allow rogues to also backstab sleeping or paralyzed monsters
rogues cannot backstab monsters that have no backside rogues cannot backstab monsters that have no backside
give experience if opening Schroedinger's Box causes death of the cat inside give experience if opening Schroedinger's Box causes death of the cat inside
priest donation amounts are explicitly stated, randomized slightly, based on priest donation amounts are explicitly stated, randomized slightly, based on
peak rather than current level, and allow for bulk donations (buying peak rather than current level, and allow for bulk donations (buying
larger amounts of clairvoyance/protection) if you have a lot of gold larger amounts of clairvoyance/protection) if you have a lot of gold
amulet of magical breathing increases power regeneration amulet of magical breathing increases power regeneration
change some command keys, 'v' is now chronicle, 'V' is versionshort, change some command keys, 'v' is now chronicle, 'V' is versionshort,
m-prefix 'V' is longer version, remove key binding of #history m-prefix 'V' is longer version, remove key binding of #history
@@ -1596,6 +1596,8 @@ prevent phaseable monsters hiding deep inside nondiggable walls
blessed potion of see invisible does not guarantee the intrinsic blessed potion of see invisible does not guarantee the intrinsic
prevent selecting all options in #optionsfull menu prevent selecting all options in #optionsfull menu
shapeshifters change shape less shapeshifters change shape less
rolling boulder traps aren't removed when stepped on and move boulders
pushed onto them
Fixes to 3.7.0-x General Problems Exposed Via git Repository Fixes to 3.7.0-x General Problems Exposed Via git Repository

View File

@@ -592,6 +592,26 @@ moverock_core(coordxy sx, coordxy sy)
} }
seetrap(ttmp); seetrap(ttmp);
return sobj_at(BOULDER, sx, sy) ? -1 : 0; return sobj_at(BOULDER, sx, sy) ? -1 : 0;
case ROLLING_BOULDER_TRAP:
{
int tox = rx;
int toy = ry;
/* the boulder continues until it reaches one of
the trap's launch spots or hits a wall / out-of-bounds */
while (isok(tox + u.dx, toy + u.dy)) {
tox += u.dx;
toy += u.dy;
if (tox == ttmp->launch.x && toy == ttmp->launch.y)
break;
if (tox == ttmp->launch2.x && toy == ttmp->launch2.y)
break;
}
pline("%s away from you!",
Tobjnam(otmp, "suddenly roll"));
feeltrap(ttmp);
launch_obj(BOULDER, sx, sy, tox, toy, ROLL | LAUNCH_KNOWN);
return sobj_at(BOULDER, sx, sy) ? -1 : 0;
}
default: default:
break; /* boulder not affected by this trap */ break; /* boulder not affected by this trap */
} }

View File

@@ -2671,9 +2671,13 @@ trapeffect_rolling_boulder_trap(
!Deaf ? "Click! " : ""); !Deaf ? "Click! " : "");
if (!launch_obj(BOULDER, trap->launch.x, trap->launch.y, if (!launch_obj(BOULDER, trap->launch.x, trap->launch.y,
trap->launch2.x, trap->launch2.y, style)) { trap->launch2.x, trap->launch2.y, style)) {
deltrap(trap); /* if this is a known trap, the player may have known there wasn't
newsym(u.ux, u.uy); /* get rid of trap symbol */ a lined up boulder, so use a shorter message to avoid --More--
pline("Fortunately for you, no boulder was released."); spam */
if (style & LAUNCH_KNOWN)
pline("No boulder was released.");
else
pline("Fortunately for you, no boulder was released.");
} }
} else { } else {
if (!m_in_air(mtmp)) { if (!m_in_air(mtmp)) {