From 4dddb97301f42d7d42b160667d8f29b0370cb5d5 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Tue, 17 Feb 2015 13:58:27 -0500 Subject: [PATCH] remove and transfer INVISIBLE_OBJECTS to branch --- include/display.h | 8 ++++++-- include/extern.h | 3 --- include/obj.h | 6 +----- src/apply.c | 3 --- src/display.c | 24 ------------------------ src/do_wear.c | 6 ------ src/invent.c | 6 ------ src/mkobj.c | 3 --- src/mon.c | 8 -------- src/objnam.c | 18 ------------------ src/pickup.c | 3 --- src/potion.c | 22 ---------------------- src/steal.c | 22 +++++----------------- src/weapon.c | 5 ----- src/zap.c | 8 -------- 15 files changed, 12 insertions(+), 133 deletions(-) diff --git a/include/display.h b/include/display.h index 94ee1a15c..5be06d08a 100644 --- a/include/display.h +++ b/include/display.h @@ -16,9 +16,13 @@ #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() diff --git a/include/extern.h b/include/extern.h index c3004a0a0..39a42641c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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)); diff --git a/include/obj.h b/include/obj.h index 3d0e5d88d..dc522b338 100644 --- a/include/obj.h +++ b/include/obj.h @@ -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 */ diff --git a/src/apply.c b/src/apply.c index d2377b51e..2ac4088dd 100644 --- a/src/apply.c +++ b/src/apply.c @@ -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"; diff --git a/src/display.c b/src/display.c index 48b9f0b65..23dcef3a0 100644 --- a/src/display.c +++ b/src/display.c @@ -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() * diff --git a/src/do_wear.c b/src/do_wear.c index 6b622d7af..414f5a522 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -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) { diff --git a/src/invent.c b/src/invent.c index e3cd20247..62295915c 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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 || diff --git a/src/mkobj.c b/src/mkobj.c index 08bb41bfb..5c7cffb7c 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -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) { diff --git a/src/mon.c b/src/mon.c index 4823ae1c7..f617dad4c 100644 --- 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) ? diff --git a/src/objnam.c b/src/objnam.c index 321d7ff29..84c3599f4 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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))) diff --git a/src/pickup.c b/src/pickup.c index 2c1564f84..fea45dce3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -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 */ diff --git a/src/potion.c b/src/potion.c index 7a4014635..7542ea451 100644 --- a/src/potion.c +++ b/src/potion.c @@ -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]; diff --git a/src/steal.c b/src/steal.c index bf7238b01..c73878310 100644 --- a/src/steal.c +++ b/src/steal.c @@ -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); diff --git a/src/weapon.c b/src/weapon.c index 746d1b5cd..5f611ddcf 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -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); diff --git a/src/zap.c b/src/zap.c index cbc533041..dfdf95d4c 100644 --- 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: