]> granicus.if.org Git - nethack/commitdiff
Delphi msg (trunk only)
authornethack.allison <nethack.allison>
Wed, 10 May 2006 23:13:28 +0000 (23:13 +0000)
committernethack.allison <nethack.allison>
Wed, 10 May 2006 23:13:28 +0000 (23:13 +0000)
<email deleted> wrote:
> * Angering the Oracle then entering her room still gives
> "Hello, <Dudley>, welcome to Delphi!"

doc/fixes35.0
src/hack.c

index 57b360f185a98e1a18623fe38e8f13aad5a7bb56..b2b74a275a47c9929bd419b1b6ab79beaa0c4e22 100644 (file)
@@ -136,6 +136,7 @@ preform autopickup and/or report on objects at the spot when a failed #untrap
        attempt causes the hero to move onto a trap's location
 thrown silver weapon hitting silver-hating poly'd hero got double silver damage
 wielded silver weapon hitting silver-hating poly'd hero lacked silver message
+don't welcome the hero to Delphi if the Oracle was angered before first entry
 
 
 Platform- and/or Interface-Specific Fixes
index 37097eb86e82970749d26c005b2b74082836228f..6bc6b0abea9ba474a40b6e6187f22f73f4f050d8 100644 (file)
@@ -13,7 +13,7 @@ STATIC_DCL int FDECL(still_chewing,(XCHAR_P,XCHAR_P));
 STATIC_DCL void NDECL(dosinkfall);
 #endif
 STATIC_DCL boolean FDECL(findtravelpath, (BOOLEAN_P));
-STATIC_DCL boolean FDECL(monstinroom, (struct permonst *,int));
+STATIC_DCL boolean FDECL(monstinroom, (struct permonst *,int,struct monst **));
 STATIC_DCL boolean FDECL(doorless_door, (int,int));
 STATIC_DCL void FDECL(move_update, (BOOLEAN_P));
 
@@ -1649,16 +1649,23 @@ stillinwater:;
 }
 
 STATIC_OVL boolean
-monstinroom(mdat,roomno)
+monstinroom(mdat,roomno,mon)
 struct permonst *mdat;
+struct monst **mon;
 int roomno;
 {
        register struct monst *mtmp;
 
+       if (mon) *mon = (struct monst *)0;
        for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
                if(!DEADMONSTER(mtmp) && mtmp->data == mdat &&
-                  index(in_rooms(mtmp->mx, mtmp->my, 0), roomno + ROOMOFFSET))
+                  index(in_rooms(mtmp->mx, mtmp->my, 0), roomno + ROOMOFFSET)) {
+                       /*  If the monster is one-of-a-kind then update mon
+                        *  with a pointer to that monster.
+                        */
+                       if (mon && (mdat->geno & G_UNIQ)) *mon = mtmp;
                        return(TRUE);
+               }
        return(FALSE);
 }
 
@@ -1801,7 +1808,7 @@ void
 check_special_room(newlev)
 register boolean newlev;
 {
-       register struct monst *mtmp;
+       struct monst *mtmp, *uniquemon = (struct monst *)0;
        char *ptr;
 
        move_update(newlev);
@@ -1855,18 +1862,23 @@ register boolean newlev;
                    You("enter an anthole!");
                    break;
                case BARRACKS:
-                   if(monstinroom(&mons[PM_SOLDIER], roomno) ||
-                       monstinroom(&mons[PM_SERGEANT], roomno) ||
-                       monstinroom(&mons[PM_LIEUTENANT], roomno) ||
-                       monstinroom(&mons[PM_CAPTAIN], roomno))
+                   if(monstinroom(&mons[PM_SOLDIER], roomno, &uniquemon) ||
+                       monstinroom(&mons[PM_SERGEANT], roomno, &uniquemon) ||
+                       monstinroom(&mons[PM_LIEUTENANT], roomno, &uniquemon) ||
+                       monstinroom(&mons[PM_CAPTAIN], roomno, &uniquemon))
                        You("enter a military barracks!");
                    else
                        You("enter an abandoned barracks.");
                    break;
                case DELPHI:
-                   if(monstinroom(&mons[PM_ORACLE], roomno))
-                       verbalize("%s, %s, welcome to Delphi!",
+                   if(monstinroom(&mons[PM_ORACLE], roomno, &uniquemon)) {
+                       if (uniquemon && !uniquemon->mpeaceful)
+                           verbalize("You're in Delphi, %s.",
+                                       plname);
+                       else
+                           verbalize("%s, %s, welcome to Delphi!",
                                        Hello((struct monst *) 0), plname);
+                   }
                    break;
                case TEMPLE:
                    intemple(roomno + ROOMOFFSET);