]> granicus.if.org Git - nethack/commitdiff
remove and transfer INVISIBLE_OBJECTS to branch
authorDerek S. Ray <derekray@gmail.com>
Tue, 17 Feb 2015 18:58:27 +0000 (13:58 -0500)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Sat, 28 Feb 2015 00:34:32 +0000 (19:34 -0500)
15 files changed:
include/display.h
include/extern.h
include/obj.h
src/apply.c
src/display.c
src/do_wear.c
src/invent.c
src/mkobj.c
src/mon.c
src/objnam.c
src/pickup.c
src/potion.c
src/steal.c
src/weapon.c
src/zap.c

index 94ee1a15c65fd4bd041cbbb6ed9432260380363c..5be06d08abc77b3a87a5fb8b344d95fe1154a7bb 100644 (file)
 #include "mondata.h"   /* for mindless() */
 #endif
 
-#ifndef INVISIBLE_OBJECTS
+/*
+ * vobj_at()
+ *
+ * Returns the head of the list of objects that the player can see
+ * at location (x,y).
+ */
 #define vobj_at(x,y) (level.objects[x][y])
-#endif
 
 /*
  * sensemon()
index c3004a0a04c3825373816d1349a659bcd8341451..39a42641c83a6e95abdbdbd67befee8a6e086668 100644 (file)
@@ -295,9 +295,6 @@ E void FDECL(bury_obj, (struct obj *));
 
 /* ### display.c ### */
 
-#ifdef INVISIBLE_OBJECTS
-E struct obj * FDECL(vobj_at, (XCHAR_P,XCHAR_P));
-#endif /* INVISIBLE_OBJECTS */
 E void FDECL(magic_map_background, (XCHAR_P,XCHAR_P,int));
 E void FDECL(map_background, (XCHAR_P,XCHAR_P,int));
 E void FDECL(map_trap, (struct trap *,int));
index 3d0e5d88d4f473531a5debe3174189a0784bf219..dc522b338b139762c9033ed16dffe88bc67a616c 100644 (file)
@@ -94,11 +94,7 @@ struct obj {
        Bitfield(recharged,3);  /* number of times it's been recharged */
 #define on_ice recharged       /* corpse on ice */
        Bitfield(lamplit,1);    /* a light-source -- can be lit */
-#ifdef INVISIBLE_OBJECTS
-       Bitfield(oinvis,1);     /* invisible */
-#else
-       Bitfield(oreserved1,1); 
-#endif
+       Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */
        Bitfield(greased,1);    /* covered with grease */
        Bitfield(nomerge,1);    /* set temporarily to prevent merging */
        Bitfield(was_thrown,1); /* thrown by hero since last picked up */
index d2377b51e7f9e8e65335a88dd7b58e6530c19f44..2ac4088dd041a3307eb13e997cff67ffab1cf80b 100644 (file)
@@ -715,9 +715,6 @@ struct obj *obj;
 
        if(!getdir((char *)0)) return 0;
        invis_mirror = Invis;
-#ifdef INVISIBLE_OBJECTS
-       if (obj->oinvis) invis_mirror = TRUE;
-#endif
        useeit = !Blind && (!invis_mirror || See_invisible);
        uvisage = (ACURR(A_CHA) > 14) ?
                    (poly_gender() == 1 ? "beautiful" : "handsome") : "ugly";
index 48b9f0b654cb304522a67101096b9cde3c1889bd..23dcef3a071037eb85105931773b051a915e1c2f 100644 (file)
@@ -139,30 +139,6 @@ STATIC_DCL int FDECL(wall_angle, (struct rm *));
 
 #define remember_topology(x,y)         (lastseentyp[x][y] = levl[x][y].typ)
 
-#ifdef INVISIBLE_OBJECTS
-/*
- * vobj_at()
- *
- * Returns a pointer to an object if the hero can see an object at the
- * given location.  This takes care of invisible objects.  NOTE, this
- * assumes that the hero is not blind and on top of the object pile.
- * It does NOT take into account that the location is out of sight, or,
- * say, one can see blessed, etc.
- */
-struct obj *
-vobj_at(x,y)
-    xchar x,y;
-{
-    register struct obj *obj = level.objects[x][y];
-
-    while (obj) {
-       if (!obj->oinvis || See_invisible) return obj;
-       obj = obj->nexthere;
-    }
-    return ((struct obj *) 0);
-}
-#endif /* else vobj_at() is defined in display.h */
-
 /*
  * magic_map_background()
  *
index 6b622d7af65b0d26f4be31746158a1eb9717c90e..414f5a5221ecabe513e7bf553aed1954162a0cab 100644 (file)
@@ -854,9 +854,6 @@ register struct obj *obj;
                /* can now see invisible monsters */
                set_mimic_blocking(); /* do special mimic handling */
                see_monsters();
-#ifdef INVISIBLE_OBJECTS
-               see_objects();
-#endif
 
                if (Invis && !oldprop && !HSee_invisible && !Blind) {
                    newsym(u.ux,u.uy);
@@ -966,9 +963,6 @@ boolean gone;
                if (!See_invisible) {
                    set_mimic_blocking(); /* do special mimic handling */
                    see_monsters();
-#ifdef INVISIBLE_OBJECTS                
-                   see_objects();
-#endif
                }
 
                if (Invisible && !Blind) {
index e3cd202471d2e546de7f1c2c7179369e12af38f1..62295915c003942be833c809642407425c9bfc76 100644 (file)
@@ -2315,9 +2315,6 @@ boolean picked_some;
            /* only one object */
            if (dfeature) pline1(fbuf);
            read_engr_at(u.ux, u.uy); /* Eric Backus */
-#ifdef INVISIBLE_OBJECTS
-           if (otmp->oinvis && !See_invisible) verb = "feel";
-#endif
            You("%s here %s.", verb, doname(otmp));
            iflags.last_msg = PLNMSG_ONE_ITEM_HERE;
            if (otmp->otyp == CORPSE) feel_cockatrice(otmp, FALSE);
@@ -2421,9 +2418,6 @@ mergable(otmp, obj)       /* returns TRUE if obj  & otmp can be merged */
            obj->obroken != otmp->obroken ||
            obj->otrapped != otmp->otrapped ||
            obj->lamplit != otmp->lamplit ||
-#ifdef INVISIBLE_OBJECTS
-               obj->oinvis != otmp->oinvis ||
-#endif
            obj->greased != otmp->greased ||
            obj->oeroded != otmp->oeroded ||
            obj->oeroded2 != otmp->oeroded2 ||
index 08bb41bfb97e25b3aec53109d7625d24b3713f49..5c7cffb7c4ebdd5d62da50faece71145ab25818e 100644 (file)
@@ -606,9 +606,6 @@ boolean artif;
                otmp->known = 1;
        otmp->lknown = 0;
        otmp->cknown = 0;
-#ifdef INVISIBLE_OBJECTS
-       otmp->oinvis = !rn2(1250);
-#endif
        otmp->corpsenm = NON_PM;
 
        if (init) switch (let) {
index 4823ae1c70b1288b93c0f3e5833b5d855e46b28e..f617dad4c066c24fe8a42d465aa23c11f6135fc5 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -303,11 +303,6 @@ unsigned corpseflags;
         */
        if (Blind && !sensemon(mtmp)) obj->dknown = 0;
 
-#ifdef INVISIBLE_OBJECTS
-       /* Invisible monster ==> invisible corpse */
-       obj->oinvis = mtmp->minvis;
-#endif
-
        stackobj(obj);
        newsym(x, y);
        return obj;
@@ -858,9 +853,6 @@ mpickstuff(mtmp, str)
                if (!touch_artifact(otmp,mtmp)) continue;
                if (!can_carry(mtmp,otmp)) continue;
                if (is_pool(mtmp->mx,mtmp->my)) continue;
-#ifdef INVISIBLE_OBJECTS
-               if (otmp->oinvis && !perceives(mtmp->data)) continue;
-#endif
                if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
                        pline("%s picks up %s.", Monnam(mtmp),
                              (distu(mtmp->mx, mtmp->my) <= 5) ?
index 321d7ff29386d79d46042c3a7bd0254837d2737f..84c3599f44190a6a0b858ecfe8ff7711ee02c4ae 100644 (file)
@@ -683,10 +683,6 @@ register struct obj *obj;
        } else
                Strcpy(prefix, "a ");
 
-#ifdef INVISIBLE_OBJECTS
-       if (obj->oinvis) Strcat(prefix,"invisible ");
-#endif
-
        /* "empty" goes at the beginning, but item count goes at the end */
        if (cknown &&
            (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj))
@@ -2241,9 +2237,6 @@ struct obj *no_wish;
        int cnt, spe, spesgn, typ, very, rechrg;
        int blessed, uncursed, iscursed, ispoisoned, isgreased;
        int eroded, eroded2, erodeproof;
-#ifdef INVISIBLE_OBJECTS
-       int isinvisible;
-#endif
        int halfeaten, mntmp, contents;
        int islit, unlabeled, ishistoric, isdiluted, trapped;
        int tmp, tinv, tvariety;
@@ -2271,9 +2264,6 @@ struct obj *no_wish;
 
        cnt = spe = spesgn = typ = very = rechrg =
                blessed = uncursed = iscursed =
-#ifdef INVISIBLE_OBJECTS
-               isinvisible =
-#endif
                ispoisoned = isgreased = eroded = eroded2 = erodeproof =
                halfeaten = islit = unlabeled = ishistoric = isdiluted =
                trapped = 0;
@@ -2324,10 +2314,6 @@ struct obj *no_wish;
                        iscursed = 1;
                } else if (!strncmpi(bp, "uncursed ", l=9)) {
                        uncursed = 1;
-#ifdef INVISIBLE_OBJECTS
-               } else if (!strncmpi(bp, "invisible ", l=10)) {
-                       isinvisible = 1;
-#endif
                } else if (!strncmpi(bp, "rustproof ", l=10) ||
                           !strncmpi(bp, "erodeproof ", l=11) ||
                           !strncmpi(bp, "corrodeproof ", l=13) ||
@@ -3137,10 +3123,6 @@ typfnd:
                curse(otmp);
        }
 
-#ifdef INVISIBLE_OBJECTS
-       if (isinvisible) otmp->oinvis = 1;
-#endif
-
        /* set eroded */
        if (is_damageable(otmp) || otmp->otyp == CRYSKNIFE) {
            if (eroded && (is_flammable(otmp) || is_rustprone(otmp)))
index 2c1564f84cdf72e8f85f11ba82fb5a82ab467add..fea45dce31814af2762156302e0ad0836289335d 100644 (file)
@@ -1266,9 +1266,6 @@ boolean telekinesis;      /* not picking it up directly by hand */
        /* In case of auto-pickup, where we haven't had a chance
           to look at it yet; affects docall(SCR_SCARE_MONSTER). */
        if (!Blind)
-#ifdef INVISIBLE_OBJECTS
-               if (!obj->oinvis || See_invisible)
-#endif
                obj->dknown = 1;
 
        if (obj == uchain) {    /* do not pick up attached chain */
index 7a40146352842b3ac39c82dfd566e9c416a1112c..7542ea4512a0be5ada48497e2fac22d3e73cf13c 100644 (file)
@@ -1909,28 +1909,6 @@ dodip()
            return 1;
        }
 
-#ifdef INVISIBLE_OBJECTS
-       if (potion->otyp == POT_INVISIBILITY && !obj->oinvis) {
-               obj->oinvis = TRUE;
-               if (!Blind) {
-                   if (!See_invisible) pline("Where did %s go?",
-                               the(xname(obj)));
-                   else You("notice a little haziness around %s.",
-                               the(xname(obj)));
-               }
-               goto poof;
-       } else if (potion->otyp == POT_SEE_INVISIBLE && obj->oinvis) {
-               obj->oinvis = FALSE;
-               if (!Blind) {
-                   if (!See_invisible) pline("So that's where %s went!",
-                               the(xname(obj)));
-                   else pline_The("haziness around %s disappears.",
-                               the(xname(obj)));
-               }
-               goto poof;
-       }
-#endif
-
        if(is_poisonable(obj)) {
            if(potion->otyp == POT_SICKNESS && !obj->opoisoned) {
                char buf[BUFSZ];
index bf7238b012b561df7a333b504b4576d1867041c0..c73878310c7ff05d8041c7c249bc7171e9244b98 100644 (file)
@@ -242,26 +242,14 @@ nothing_to_steal:
  retry:
        tmp = 0;
        for(otmp = invent; otmp; otmp = otmp->nobj)
-           if ((!uarm || otmp != uarmc) && otmp != uskin
-                               && otmp->oclass != COIN_CLASS
-#ifdef INVISIBLE_OBJECTS
-                               && (!otmp->oinvis || perceives(mtmp->data))
-#endif
-                               )
-               tmp += ((otmp->owornmask &
-                       (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
+           if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS)
+            tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
        if (!tmp) goto nothing_to_steal;
        tmp = rn2(tmp);
        for(otmp = invent; otmp; otmp = otmp->nobj)
-           if ((!uarm || otmp != uarmc) && otmp != uskin
-                               && otmp->oclass != COIN_CLASS
-#ifdef INVISIBLE_OBJECTS
-                               && (!otmp->oinvis || perceives(mtmp->data))
-#endif
-                       )
-               if((tmp -= ((otmp->owornmask &
-                       (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0)
-                       break;
+           if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS)
+            if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0)
+                break;
        if(!otmp) {
                impossible("Steal fails!");
                return(0);
index 746d1b5cdfdc1fc2d1bdea6d8f6f3da6e7238b30..5f611ddcf2ad15661391f698a8455149906309ca 100644 (file)
@@ -183,11 +183,6 @@ struct monst *mon;
        if (is_pick(otmp) &&
           (passes_walls(ptr) && thick_skinned(ptr))) tmp += 2;
 
-#ifdef INVISIBLE_OBJECTS
-       /* Invisible weapons against monsters who can't see invisible */
-       if (otmp->oinvis && !perceives(ptr)) tmp += 3;
-#endif
-
        /* Check specially named weapon "to hit" bonuses */
        if (otmp->oartifact) tmp += spec_abon(otmp, mon);
 
index cbc533041666bf279674dcf85163c81fdaccea78..dfdf95d4cc2d47956c4d2897fce85a0ab8d7d313 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -979,10 +979,6 @@ register struct obj *obj;
        }
        unbless(obj);
        uncurse(obj);
-#ifdef INVISIBLE_OBJECTS
-       /*[this will be insufficient if it ever reduces obj's shop value]*/
-       if (obj->oinvis) obj->oinvis = 0;
-#endif
        return;
 }
 
@@ -1833,10 +1829,6 @@ struct obj *obj, *otmp;
                (void) rloco(obj);
                break;
        case WAN_MAKE_INVISIBLE:
-#ifdef INVISIBLE_OBJECTS
-               obj->oinvis = TRUE;
-               newsym(obj->ox,obj->oy);        /* make object disappear */
-#endif
                break;
        case WAN_UNDEAD_TURNING:
        case SPE_TURN_UNDEAD: