CODE: RE: Different kinds of invisibility

From: Billy H. Chan (bhchan@po.EECS.Berkeley.EDU)
Date: 07/07/96


On Sat, 6 Jul 1996, Brian Menges wrote:
[paraphrased: Want invisiblity to certain races, need to change CAN_SEE, not 
 enough AFF_FLAGS]

An interesting idea, and one I really like, so I'll psuedo-implement it here
and see what people think.
First, the assumptions: You have races in your mud, but you have less than
32 of them (who the heck needs more than 31 races? BaskinRobins?)
Second, you have a few long spares left (2 I think, might end up needing 
more).
Off we go!

First, use one long spare as race_invised_to.  The other one, of course, is
race_can_detect (to counter act the invisibility).   Problem just came up...
i think you'll have to move it to the struct which has the 'char_data 
*fighting' so both PC's and NPC's have this (which means either it won't be
saved or you have to fix the saving routines, not sure yet)  Onwards.
Let each race be represented by 1 << RACE_*
(I hope you used numerical and not bitvectors for your races... wait, that
 doesn't really matter either.)

Casting these new invisibility spells will probably have to be made
Manual (unless you add another affectable field in magic.c (actually more
easy if you had previously needed to expand the aff set... see LL as a 
reference and grep for AFF2 in magic.c)) eitherway, you have to fix the
aff_to_char(sp?) and remove_aff(sp?) functions (I forgot their actual name,
sorry).

Last of all, CAN_SEE... we might have to change it to a full fledged 
function.  This might cause a huge overhead in running time, since CAN_SEE
is called very often (Jeremy, do you have a profile on that?  PRobably not
since it's preprocessed...)  Anyhow, you'd have to add something like a
if (INVS_FLAGGED(GET_RACE_INVISED_TO(vict), GET_RACE(ch)) && 
    !SEE_INVIS_FLAGGED(GET_RACE_CAN_DETECT(ch), GET_RACE(vict)) return 0
	 /* assuming 0 = can't detect... again, sorry, don't have the  circle 
	    code in my face or RAM */

That should be it.  Add this to those spell casting items I remember seeing
sometime back, and we should all be happy campers.  You also just  expanded
your spells possibly by 64 (a invis and a detect for each race).
This, unfortunately assumes that all your undead are of one race.
Phew, that was fun.
-- Billy  H. Chan     bhchan@po.eecs.berkeley.edu  bhchan@csua.berkeley.edu
   CogSci/CompSci     http://www.csua.berkeley.edu/~bhchan     ResumeInside



This archive was generated by hypermail 2b30 : 12/07/00 PST