From e4495a63890d9ed401b52936dabc35c55c46d047 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Thu, 23 Oct 2003 12:13:21 +0000 Subject: [PATCH] 's were_summon rules >Hemmed in by one invisible wererat? >: Should I feel hemmed in if I can see that a wererat summons >zero rats? Can the invisible wererat hem me in all by itself? And >even if it had summoned anything, wouldn't a different message had >been clearer (for isntance, "Rats appear around you!"); after all, >I could see *what* was hemming me in. >I agree that the current messages (and even the ones aspired to by the >comment) are non-ideal. 's suggested set-up: Seen summoner, seen help : "The wererat summons help!" Seen summoner, unseen help: "The wererat summons help! You feel hemmed in." Seen summoner, no help: "The wererat summons help! But none comes." Unseen summoner, seen help: "(A rat appears|Rats appear) from nowhere!" Unseen summoner, unseen help: "You feel hemmed in." Unseen summoner, no help: No message. --- doc/fixes34.3 | 1 + src/mhitu.c | 37 +++++++++++++++++++++++++++++-------- src/polyself.c | 3 ++- src/were.c | 17 +++++++++++------ 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 212fafacf..21c022b32 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -73,6 +73,7 @@ reading a cursed scroll of light in a corridor wouldn't display correctly barbarians can become export in short sword skill samurai are now limited to master in martial arts skill; barbarians and cavemen are now limited to master in bare-handed combat skill +tweak messages when werefoo summons help Platform- and/or Interface-Specific Fixes diff --git a/src/mhitu.c b/src/mhitu.c index 859d82639..d0b93cb3a 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -477,15 +477,36 @@ mattacku(mtmp) mdat = mtmp->data; if(!rn2(10) && !mtmp->mcan) { - if(youseeit) { + int numseen, numhelp; + char buf[BUFSZ]; + + numhelp = were_summon(mdat, FALSE, &numseen); + if (youseeit) { pline("%s summons help!", Monnam(mtmp)); - } else - You_feel("hemmed in."); - /* Technically wrong; we really should check if you can see the - * help, but close enough... - */ - if (!were_summon(mdat,FALSE) && youseeit) - pline("But none comes."); + if (numhelp > 0) { + if (numseen == 0) + You_feel("hemmed in."); + } else pline("But none comes."); + } else { + char *from_nowhere; + if (!Deaf) { + pline("%s %s!", Something, + makeplural(growl_sound(mtmp))); + from_nowhere = ""; + } else from_nowhere = " from nowhere"; + if (numhelp > 0) { + if (numseen < 1) You_feel("hemmed in."); + else { + if (numseen == 1) + Sprintf(buf, "%s appears", + an(mdat->mname)); + else + Sprintf(buf, "%s appear", + s_suffix(mdat->mname)); + pline("%s%s!", upstart(buf), from_nowhere); + } + } /* else no help came; but you didn't know it tried */ + } } } diff --git a/src/polyself.c b/src/polyself.c index 4b7bf7357..f6a311b2d 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -913,6 +913,7 @@ dospinweb() int dosummon() { + int placeholder; if (u.uen < 10) { You("lack the energy to send forth a call for help!"); return(0); @@ -922,7 +923,7 @@ dosummon() You("call upon your brethren for help!"); exercise(A_WIS, TRUE); - if (!were_summon(youmonst.data,TRUE)) + if (!were_summon(youmonst.data, TRUE, &placeholder)) pline("But none arrive."); return(1); } diff --git a/src/were.c b/src/were.c index 14c994be0..0e4ffb503 100644 --- a/src/were.c +++ b/src/were.c @@ -81,17 +81,19 @@ register struct monst *mon; possibly_unwield(mon, FALSE); } -boolean -were_summon(ptr,yours) /* were-creature (even you) summons a horde */ +int +were_summon(ptr,yours,visible) /* were-creature (even you) summons a horde */ register struct permonst *ptr; register boolean yours; +int *visible; /* number of visible helpers created */ { register int i, typ, pm = monsndx(ptr); register struct monst *mtmp; - boolean success = FALSE; + int total = 0; + *visible = 0; if(Protection_from_shape_changers && !yours) - return FALSE; + return 0; for(i = rnd(5); i > 0; i--) { switch(pm) { @@ -111,11 +113,14 @@ register boolean yours; continue; } mtmp = makemon(&mons[typ], u.ux, u.uy, NO_MM_FLAGS); - if (mtmp) success = TRUE; + if (mtmp) { + total++; + if (canseemon(mtmp)) *visible += 1; + } if (yours && mtmp) (void) tamedog(mtmp, (struct obj *) 0); } - return success; + return total; } void -- 2.40.0