--
Email: Remove the Capitalist Empire to return email to me.
> Just a thought - maybe (E)ngraving with a wand of light could cause glowing
> letters to be ethced into the ground, rather than conjuring a light field.
> It could last about as long as using, say, a wand of digging...
I like this idea, but this would double the probability of a permament
writing wand, and wands of light are cheaper than both wands of digging
and wands of fire. However, the idea of glowing text interested me, so I
have written (am writing) a patch to do so.
So far the only problem I've run into is I want a glowing etching to
illuminate that square, but I don't know an easy way to make it stop
illuminating if it is /oDigging engraved or teleported, etc.
I suppose adding an engraving light source (LS_ENGRAVING) would be the
right thing to do. Tell me if I've forgotten anything (other than the
#define WEBB_ENGR_LIGHT in config.h). Please don't mind the WEBB_ in the
precompiler stuff, I'm not a meglomaniac, it just helps me remember what
stuff I added in my own code.
*** /cygdrive/d/nethack/nethack-3.4.2-orig/include/engrave.h Mon Sep 1
10:29:46 2003
--- include/engrave.h Tue Nov 18 20:48:22 2003
***************
*** 17,25 ****
--- 17,31 ----
#define BURN 3
#define MARK 4
#define ENGR_BLOOD 5
#define HEADSTONE 6
+ #ifndef WEBB_ENGR_LIGHT
#define N_ENGRAVE 6
+ #else
+ #define ENGR_LIGHT 7
+ #define N_ENGRAVE 7
+ #endif
+
};
#define newengr(lth) (struct engr *)alloc((unsigned)(lth) +
sizeof(struct engr))
#define dealloc_engr(engr) free((genericptr_t) (engr))
*** /cygdrive/d/nethack/nethack-3.4.2-orig/src/engrave.c Mon Sep 1
10:29:48 2003
--- src/engrave.c Tue Nov 18 21:04:38 2003
***************
*** 326,333 ****
--- 330,346 ----
sensed = 1;
You("see a message scrawled in blood here.");
}
break;
+ #ifdef WEBB_ENGR_LIGHT
+ case ENGR_LIGHT:
+ if(!Blind){
+ sensed = 1;
+ You("see a glowing message etched on the %s here.",
+ surface(x,y));
+ }
+ break;
+ #endif
default:
impossible("%s is written in a very strange way.",
Something);
sensed = 1;
***************
*** 607,614 ****
--- 629,648 ----
break;
/* NODIR wands */
case WAN_LIGHT:
+ #ifdef WEBB_ENGR_LIGHT
+ type = ENGR_LIGHT;
+ if(!objects[otmp->otyp].oc_name_known && !Blind) {
+ if (flags.verbose)
+ pline("This %s is a wand of light!", xname(otmp));
+ doknown = TRUE;
+ Sprintf(post_engr_text, "You write glowing words
on the %s.",
+ surface(u.ux,u.uy));
+ ptext = TRUE;
+ }
+ break;
+ #endif
case WAN_SECRET_DOOR_DETECTION:
case WAN_CREATE_MONSTER:
case WAN_WISHING:
case WAN_ENLIGHTENMENT:
***************
*** 908,925 ****
oep = (struct engr *)0;
} else
/* Don't delete engr until after we *know* we're
engraving */
eow = TRUE;
! } else
! if ( (type == DUST) || (type == MARK) || (type ==
ENGR_BLOOD) ) {
! You(
! "cannot wipe out the message that is %s the %s
here.",
oep->engr_type == BURN ?
(is_ice(u.ux,u.uy) ? "melted into" : "burned
into") :
"engraved in", surface(u.ux,u.uy));
return(1);
! } else
! if ( (type != oep->engr_type) || (c == 'n') ) {
if (!Blind || can_reach_floor())
You("will overwrite the current
message.");
eow = TRUE;
}
--- 943,961 ----
oep = (struct engr *)0;
} else
/* Don't delete engr until after we *know* we're engraving */
eow = TRUE;
! } else if ( (type == DUST) || (type == MARK) || (type ==
ENGR_BLOOD) ) {
! You( "cannot wipe out the message that is %s the %s here.",
oep->engr_type == BURN ?
(is_ice(u.ux,u.uy) ? "melted into" : "burned into") :
+ #ifdef WEBB_ENGR_LIGHT
+ oep->engr_type == ENGR_LIGHT ?
+ "glowing on" :
+ #endif
"engraved in", surface(u.ux,u.uy));
return(1);
! } else if ( (type != oep->engr_type) || (c == 'n') ) {
if (!Blind || can_reach_floor())
You("will overwrite the current message.");
eow = TRUE;
}
***************
*** 958,965 ****
--- 994,1007 ----
case ENGR_BLOOD:
everb = (oep && !eow ? "add to the scrawl on" :
"scrawl on");
break;
+ #ifdef WEBB_ENGR_LIGHT
+ case ENGR_LIGHT:
+ everb = (oep && !eow ? "add to the glowing writing on" :
+ "write on");
+ break;
+ #endif
}
/* Tell adventurer what is going on */
if (otmp != &zeroobj)
***************
*** 1079,1086 ****
--- 1121,1136 ----
case ENGR_BLOOD:
multi = -(len/10);
if (multi) nomovemsg = "You finish scrawling.";
break;
+ #ifdef WEBB_ENGR_LIGHT
+ case ENGR_LIGHT:
+ /*levl[u.ux][u.uy].lit = TRUE; /* not bright enough to illuminate
+ also doesn't need to be possibly deluminated if message is
erased */
+ multi = -(len/10);
+ if (multi) nomovemsg = "You finish writing.";
+ break;
+ #endif
}
/* Chop engraving down to size if necessary */
if (len > maxelen) {
I like that idea.
I'm no source diver, but from what i can see, your code only
illuminates the text if the room is unlit. What would happen if you
then read a cursed scroll of light? Would the text become illuminated,
or would it just be unlit text in a dark room?
Look at what happens if you have a lit candle on a square and cast darkness.
It should just be similar to that. Once the writing gets rubbed out,
darkness still prevails.
Well, as I have it right now, nothing is illuminated, even if the text is
glowing, and there are no checks if the room is lit or not. However, as it
currently stands, I don't properly snuff out the engraving for darkness.
Looks like I'll make it a proper light source after all.
-Nick