remove and transfer INVISIBLE_OBJECTS to branch

This commit is contained in:
Derek S. Ray
2015-02-27 19:34:32 -05:00
committed by Sean Hunt
parent 5ee52039ca
commit 4dddb97301
15 changed files with 12 additions and 133 deletions
+6 -2
View File
@@ -16,9 +16,13 @@
#include "mondata.h" /* for mindless() */ #include "mondata.h" /* for mindless() */
#endif #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]) #define vobj_at(x,y) (level.objects[x][y])
#endif
/* /*
* sensemon() * sensemon()
-3
View File
@@ -295,9 +295,6 @@ E void FDECL(bury_obj, (struct obj *));
/* ### display.c ### */ /* ### 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(magic_map_background, (XCHAR_P,XCHAR_P,int));
E void FDECL(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)); E void FDECL(map_trap, (struct trap *,int));
+1 -5
View File
@@ -94,11 +94,7 @@ struct obj {
Bitfield(recharged,3); /* number of times it's been recharged */ Bitfield(recharged,3); /* number of times it's been recharged */
#define on_ice recharged /* corpse on ice */ #define on_ice recharged /* corpse on ice */
Bitfield(lamplit,1); /* a light-source -- can be lit */ Bitfield(lamplit,1); /* a light-source -- can be lit */
#ifdef INVISIBLE_OBJECTS Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */
Bitfield(oinvis,1); /* invisible */
#else
Bitfield(oreserved1,1);
#endif
Bitfield(greased,1); /* covered with grease */ Bitfield(greased,1); /* covered with grease */
Bitfield(nomerge,1); /* set temporarily to prevent merging */ Bitfield(nomerge,1); /* set temporarily to prevent merging */
Bitfield(was_thrown,1); /* thrown by hero since last picked up */ Bitfield(was_thrown,1); /* thrown by hero since last picked up */
-3
View File
@@ -715,9 +715,6 @@ struct obj *obj;
if(!getdir((char *)0)) return 0; if(!getdir((char *)0)) return 0;
invis_mirror = Invis; invis_mirror = Invis;
#ifdef INVISIBLE_OBJECTS
if (obj->oinvis) invis_mirror = TRUE;
#endif
useeit = !Blind && (!invis_mirror || See_invisible); useeit = !Blind && (!invis_mirror || See_invisible);
uvisage = (ACURR(A_CHA) > 14) ? uvisage = (ACURR(A_CHA) > 14) ?
(poly_gender() == 1 ? "beautiful" : "handsome") : "ugly"; (poly_gender() == 1 ? "beautiful" : "handsome") : "ugly";
-24
View 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) #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() * magic_map_background()
* *
-6
View File
@@ -854,9 +854,6 @@ register struct obj *obj;
/* can now see invisible monsters */ /* can now see invisible monsters */
set_mimic_blocking(); /* do special mimic handling */ set_mimic_blocking(); /* do special mimic handling */
see_monsters(); see_monsters();
#ifdef INVISIBLE_OBJECTS
see_objects();
#endif
if (Invis && !oldprop && !HSee_invisible && !Blind) { if (Invis && !oldprop && !HSee_invisible && !Blind) {
newsym(u.ux,u.uy); newsym(u.ux,u.uy);
@@ -966,9 +963,6 @@ boolean gone;
if (!See_invisible) { if (!See_invisible) {
set_mimic_blocking(); /* do special mimic handling */ set_mimic_blocking(); /* do special mimic handling */
see_monsters(); see_monsters();
#ifdef INVISIBLE_OBJECTS
see_objects();
#endif
} }
if (Invisible && !Blind) { if (Invisible && !Blind) {
-6
View File
@@ -2315,9 +2315,6 @@ boolean picked_some;
/* only one object */ /* only one object */
if (dfeature) pline1(fbuf); if (dfeature) pline1(fbuf);
read_engr_at(u.ux, u.uy); /* Eric Backus */ 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)); You("%s here %s.", verb, doname(otmp));
iflags.last_msg = PLNMSG_ONE_ITEM_HERE; iflags.last_msg = PLNMSG_ONE_ITEM_HERE;
if (otmp->otyp == CORPSE) feel_cockatrice(otmp, FALSE); 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->obroken != otmp->obroken ||
obj->otrapped != otmp->otrapped || obj->otrapped != otmp->otrapped ||
obj->lamplit != otmp->lamplit || obj->lamplit != otmp->lamplit ||
#ifdef INVISIBLE_OBJECTS
obj->oinvis != otmp->oinvis ||
#endif
obj->greased != otmp->greased || obj->greased != otmp->greased ||
obj->oeroded != otmp->oeroded || obj->oeroded != otmp->oeroded ||
obj->oeroded2 != otmp->oeroded2 || obj->oeroded2 != otmp->oeroded2 ||
-3
View File
@@ -606,9 +606,6 @@ boolean artif;
otmp->known = 1; otmp->known = 1;
otmp->lknown = 0; otmp->lknown = 0;
otmp->cknown = 0; otmp->cknown = 0;
#ifdef INVISIBLE_OBJECTS
otmp->oinvis = !rn2(1250);
#endif
otmp->corpsenm = NON_PM; otmp->corpsenm = NON_PM;
if (init) switch (let) { if (init) switch (let) {
-8
View File
@@ -303,11 +303,6 @@ unsigned corpseflags;
*/ */
if (Blind && !sensemon(mtmp)) obj->dknown = 0; if (Blind && !sensemon(mtmp)) obj->dknown = 0;
#ifdef INVISIBLE_OBJECTS
/* Invisible monster ==> invisible corpse */
obj->oinvis = mtmp->minvis;
#endif
stackobj(obj); stackobj(obj);
newsym(x, y); newsym(x, y);
return obj; return obj;
@@ -858,9 +853,6 @@ mpickstuff(mtmp, str)
if (!touch_artifact(otmp,mtmp)) continue; if (!touch_artifact(otmp,mtmp)) continue;
if (!can_carry(mtmp,otmp)) continue; if (!can_carry(mtmp,otmp)) continue;
if (is_pool(mtmp->mx,mtmp->my)) 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) if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
pline("%s picks up %s.", Monnam(mtmp), pline("%s picks up %s.", Monnam(mtmp),
(distu(mtmp->mx, mtmp->my) <= 5) ? (distu(mtmp->mx, mtmp->my) <= 5) ?
-18
View File
@@ -683,10 +683,6 @@ register struct obj *obj;
} else } else
Strcpy(prefix, "a "); 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 */ /* "empty" goes at the beginning, but item count goes at the end */
if (cknown && if (cknown &&
(Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj)) (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 cnt, spe, spesgn, typ, very, rechrg;
int blessed, uncursed, iscursed, ispoisoned, isgreased; int blessed, uncursed, iscursed, ispoisoned, isgreased;
int eroded, eroded2, erodeproof; int eroded, eroded2, erodeproof;
#ifdef INVISIBLE_OBJECTS
int isinvisible;
#endif
int halfeaten, mntmp, contents; int halfeaten, mntmp, contents;
int islit, unlabeled, ishistoric, isdiluted, trapped; int islit, unlabeled, ishistoric, isdiluted, trapped;
int tmp, tinv, tvariety; int tmp, tinv, tvariety;
@@ -2271,9 +2264,6 @@ struct obj *no_wish;
cnt = spe = spesgn = typ = very = rechrg = cnt = spe = spesgn = typ = very = rechrg =
blessed = uncursed = iscursed = blessed = uncursed = iscursed =
#ifdef INVISIBLE_OBJECTS
isinvisible =
#endif
ispoisoned = isgreased = eroded = eroded2 = erodeproof = ispoisoned = isgreased = eroded = eroded2 = erodeproof =
halfeaten = islit = unlabeled = ishistoric = isdiluted = halfeaten = islit = unlabeled = ishistoric = isdiluted =
trapped = 0; trapped = 0;
@@ -2324,10 +2314,6 @@ struct obj *no_wish;
iscursed = 1; iscursed = 1;
} else if (!strncmpi(bp, "uncursed ", l=9)) { } else if (!strncmpi(bp, "uncursed ", l=9)) {
uncursed = 1; uncursed = 1;
#ifdef INVISIBLE_OBJECTS
} else if (!strncmpi(bp, "invisible ", l=10)) {
isinvisible = 1;
#endif
} else if (!strncmpi(bp, "rustproof ", l=10) || } else if (!strncmpi(bp, "rustproof ", l=10) ||
!strncmpi(bp, "erodeproof ", l=11) || !strncmpi(bp, "erodeproof ", l=11) ||
!strncmpi(bp, "corrodeproof ", l=13) || !strncmpi(bp, "corrodeproof ", l=13) ||
@@ -3137,10 +3123,6 @@ typfnd:
curse(otmp); curse(otmp);
} }
#ifdef INVISIBLE_OBJECTS
if (isinvisible) otmp->oinvis = 1;
#endif
/* set eroded */ /* set eroded */
if (is_damageable(otmp) || otmp->otyp == CRYSKNIFE) { if (is_damageable(otmp) || otmp->otyp == CRYSKNIFE) {
if (eroded && (is_flammable(otmp) || is_rustprone(otmp))) if (eroded && (is_flammable(otmp) || is_rustprone(otmp)))
-3
View 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 /* In case of auto-pickup, where we haven't had a chance
to look at it yet; affects docall(SCR_SCARE_MONSTER). */ to look at it yet; affects docall(SCR_SCARE_MONSTER). */
if (!Blind) if (!Blind)
#ifdef INVISIBLE_OBJECTS
if (!obj->oinvis || See_invisible)
#endif
obj->dknown = 1; obj->dknown = 1;
if (obj == uchain) { /* do not pick up attached chain */ if (obj == uchain) { /* do not pick up attached chain */
-22
View File
@@ -1909,28 +1909,6 @@ dodip()
return 1; 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(is_poisonable(obj)) {
if(potion->otyp == POT_SICKNESS && !obj->opoisoned) { if(potion->otyp == POT_SICKNESS && !obj->opoisoned) {
char buf[BUFSZ]; char buf[BUFSZ];
+5 -17
View File
@@ -242,26 +242,14 @@ nothing_to_steal:
retry: retry:
tmp = 0; tmp = 0;
for(otmp = invent; otmp; otmp = otmp->nobj) for(otmp = invent; otmp; otmp = otmp->nobj)
if ((!uarm || otmp != uarmc) && otmp != uskin if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS)
&& otmp->oclass != COIN_CLASS tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
#ifdef INVISIBLE_OBJECTS
&& (!otmp->oinvis || perceives(mtmp->data))
#endif
)
tmp += ((otmp->owornmask &
(W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
if (!tmp) goto nothing_to_steal; if (!tmp) goto nothing_to_steal;
tmp = rn2(tmp); tmp = rn2(tmp);
for(otmp = invent; otmp; otmp = otmp->nobj) for(otmp = invent; otmp; otmp = otmp->nobj)
if ((!uarm || otmp != uarmc) && otmp != uskin if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS)
&& otmp->oclass != COIN_CLASS if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0)
#ifdef INVISIBLE_OBJECTS break;
&& (!otmp->oinvis || perceives(mtmp->data))
#endif
)
if((tmp -= ((otmp->owornmask &
(W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0)
break;
if(!otmp) { if(!otmp) {
impossible("Steal fails!"); impossible("Steal fails!");
return(0); return(0);
-5
View File
@@ -183,11 +183,6 @@ struct monst *mon;
if (is_pick(otmp) && if (is_pick(otmp) &&
(passes_walls(ptr) && thick_skinned(ptr))) tmp += 2; (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 */ /* Check specially named weapon "to hit" bonuses */
if (otmp->oartifact) tmp += spec_abon(otmp, mon); if (otmp->oartifact) tmp += spec_abon(otmp, mon);
-8
View File
@@ -979,10 +979,6 @@ register struct obj *obj;
} }
unbless(obj); unbless(obj);
uncurse(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; return;
} }
@@ -1833,10 +1829,6 @@ struct obj *obj, *otmp;
(void) rloco(obj); (void) rloco(obj);
break; break;
case WAN_MAKE_INVISIBLE: case WAN_MAKE_INVISIBLE:
#ifdef INVISIBLE_OBJECTS
obj->oinvis = TRUE;
newsym(obj->ox,obj->oy); /* make object disappear */
#endif
break; break;
case WAN_UNDEAD_TURNING: case WAN_UNDEAD_TURNING:
case SPE_TURN_UNDEAD: case SPE_TURN_UNDEAD: