two new monsters from slash'em

Adds two monsters originally from slash'em.  I used the slash'em
tiles this time, also its code as a starting point but made various
revisions.  Both the tiles could benefit from some touch-ups.

displacer beast:  blue 'f'.  Attempting a melee hit (ie, trying to
  move to its spot) has a 50:50 chance for it to swap places with you.
  Fairly tough monster to begin with, then half your ordinary attacks
  effectively miss and if you try to face a mob by retreating to a
  corridor or backing into a corner you can end up being drawn back
  into the open.  I added bargethrough capability, and also it won't
  be fooled about hero's location by Displacement.  [It only swaps
  places during combat when contact is initiated by the hero, not
  when attacked by another monster or when attacking.]

genetic engineer:  green 'Q'.  Its attack causes the target to be
  polymorphed unless that target resists.  Hero will almost always
  have magic resistance by the time this monster is encountered, but
  it can make conflict become risky by hitting and polymorphing other
  monsters.  Slash'em flagged it hell-only but I took that flag off;
  I also took away its ability to teleport.  Slash'em polymorphs the
  hero if a genetic engineer corpse is eaten; that's included and I
  introduced that for monsters too.

I added both of these to the list of candidates for monster spell
'summon nasties' and for post-Wizard harassment.

I also gave all the 'f's infravision.  Probably only matters if the
hero polymorphs into a feline.

Displacer beast is originally from AD&D which depicts it as a six-
legged cougar with a pair of tentacles; it has Displacement rather
be able to affect an attacker's location.  I think genetic engineer
is original to slash'em where it expands Q class but seems mainly to
be the base monster for Dr.Frankenstein (a unique monster with a
one-level side-branch lair in slash'em's incarnation of Gehennom).
This commit is contained in:
PatR
2020-05-03 14:13:08 -07:00
parent d31e3d172a
commit 7817e69c41
17 changed files with 594 additions and 411 deletions

View File

@@ -1393,6 +1393,7 @@ domove_core()
ballx = 0, bally = 0; /* ball&chain new positions */
int bc_control = 0; /* control for ball&chain */
boolean cause_delay = FALSE, /* dragging ball will skip a move */
displaceu = FALSE, /* involuntary swap */
u_with_boulder = (sobj_at(BOULDER, u.ux, u.uy) != 0);
if (g.context.travel) {
@@ -1642,9 +1643,24 @@ domove_core()
if (g.context.forcefight || !mtmp->mundetected || sensemon(mtmp)
|| ((hides_under(mtmp->data) || mtmp->data->mlet == S_EEL)
&& !is_safepet(mtmp))) {
/* try to attack; note that it might evade */
/* also, we don't attack tame when _safepet_ */
if (attack(mtmp))
/* target monster might decide to switch places with you... */
if (mtmp->data == &mons[PM_DISPLACER_BEAST] && !rn2(2)
&& mtmp->mux == u.ux0 && mtmp->muy == u.uy0
&& mtmp->mcanmove && !mtmp->msleeping && !mtmp->meating
&& !mtmp->mtrapped && !u.utrap && !u.ustuck && !u.usteed
&& !(u.dx && u.dy
&& (NODIAG(u.umonnum)
|| (bad_rock(mtmp->data, x, u.uy0)
&& bad_rock(mtmp->data, u.ux0, y))
|| (bad_rock(g.youmonst.data, u.ux0, y)
&& bad_rock(g.youmonst.data, x, u.uy0))))
&& goodpos(u.ux0, u.uy0, mtmp, GP_ALLOW_U))
displaceu = TRUE;
/* try to attack; note that it might evade;
also, we don't attack tame when _safepet_ */
else if (attack(mtmp))
return;
}
}
@@ -1788,6 +1804,22 @@ domove_core()
exercise_steed(); /* train riding skill */
}
if (displaceu && mtmp) {
remove_monster(u.ux, u.uy);
place_monster(mtmp, u.ux0, u.uy0);
newsym(u.ux, u.uy);
newsym(u.ux0, u.uy0);
/* monst still knows where hero is */
mtmp->mux = u.ux, mtmp->muy = u.uy;
pline("%s swaps places with you...", Monnam(mtmp));
/* monster chose to swap places; hero doesn't get any credit
or blame if something bad happens to it */
g.context.mon_moving = 1;
if (!minliquid(mtmp))
(void) mintrap(mtmp);
g.context.mon_moving = 0;
/*
* If safepet at destination then move the pet to the hero's
* previous location using the same conditions as in attack().
@@ -1798,7 +1830,8 @@ domove_core()
* Ceiling-hiding pets are skipped by this section of code, to
* be caught by the normal falling-monster code.
*/
if (is_safepet(mtmp) && !(is_hider(mtmp->data) && mtmp->mundetected)) {
} else if (is_safepet(mtmp)
&& !(is_hider(mtmp->data) && mtmp->mundetected)) {
/* if it turns out we can't actually move */
boolean didnt_move = FALSE;
@@ -1821,8 +1854,8 @@ domove_core()
You("stop. %s can't move diagonally.", upstart(y_monnam(mtmp)));
didnt_move = TRUE;
} else if (u_with_boulder
&& !(verysmall(mtmp->data)
&& (!mtmp->minvent || curr_mon_load(mtmp) <= 600))) {
&& !(verysmall(mtmp->data)
&& (!mtmp->minvent || curr_mon_load(mtmp) <= 600))) {
/* can't swap places when pet won't fit there with the boulder */
You("stop. %s won't fit into the same spot that you're at.",
upstart(y_monnam(mtmp)));
@@ -1840,7 +1873,7 @@ domove_core()
You("stop. %s can't move out of that trap.",
upstart(y_monnam(mtmp)));
didnt_move = TRUE;
} else if (mtmp->mpeaceful
} else if (mtmp->mpeaceful && !mtmp->mtame
&& (!goodpos(u.ux0, u.uy0, mtmp, 0)
|| t_at(u.ux0, u.uy0) != NULL
|| mundisplaceable(mtmp))) {