From 6cbff0150ff457bb96071b77aba36e15ef8f219a Mon Sep 17 00:00:00 2001 From: arromdee Date: Mon, 10 Mar 2003 04:13:05 +0000 Subject: [PATCH] invisible pets Invisible pet fix for the recently reported bug, as well as another one found in the process. --- doc/fixes35.0 | 4 ++++ src/dogmove.c | 4 +++- src/mhitm.c | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5444a94d7..50d7185a7 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -11,6 +11,10 @@ expert fireball/cone of cold could not target a monster seen only with infravision or ESP display "lotus juice", not "lotu juice" for the fruit juice name statue of any golem hit with stone-to-flesh spell animates as flesh golem +two invisible monsters hitting one another should not be visible +if only one monster in a monster-vs-monster fight is visible, show an I symbol + for the other one whether it is an attacker or defender +display "It" and not "The invisible " when an invisible pet eats food. Platform- and/or Interface-Specific Fixes diff --git a/src/dogmove.c b/src/dogmove.c index 0317f7822..e51b15ea2 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -157,8 +157,10 @@ boolean devour; /* TODO: Reveal presence of sea monster (especially sharks) */ } else /* hack: observe the action if either new or old location is in view */ + /* However, invisible monsters should still be "it" even though out of + sight locations should not. */ if (cansee(x, y) || cansee(mtmp->mx, mtmp->my)) - pline("%s %s %s.", noit_Monnam(mtmp), + pline("%s %s %s.", mon_visible(mtmp) ? noit_Monnam(mtmp) : "It", devour ? "devours" : "eats", (obj->oclass == FOOD_CLASS) ? singular(obj, doname) : doname(obj)); diff --git a/src/mhitm.c b/src/mhitm.c index f6c258064..e3cbc6645 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -78,6 +78,8 @@ missmm(magr, mdef, mattk) char buf[BUFSZ], mdef_name[BUFSZ]; if (vis) { + if (!canspotmon(magr)) + map_invisible(magr->mx, magr->my); if (!canspotmon(mdef)) map_invisible(mdef->mx, mdef->my); if (mdef->m_ap_type) seemimic(mdef); @@ -221,7 +223,7 @@ mattackm(magr, mdef) /* Set up the visibility of action */ - vis = (cansee(magr->mx,magr->my) && cansee(mdef->mx,mdef->my)); + vis = (cansee(magr->mx,magr->my) && cansee(mdef->mx,mdef->my) && (canspotmon(magr) || canspotmon(mdef))); /* Set flag indicating monster has moved this turn. Necessary since a * monster might get an attack out of sequence (i.e. before its move) in @@ -371,6 +373,8 @@ hitmm(magr, mdef, mattk) int compat; char buf[BUFSZ], mdef_name[BUFSZ]; + if (!canspotmon(magr)) + map_invisible(magr->mx, magr->my); if (!canspotmon(mdef)) map_invisible(mdef->mx, mdef->my); if(mdef->m_ap_type) seemimic(mdef); -- 2.40.0