Hi there,
The other day there was some request about the code that adds affect
flags to objects. My brother Remko promised that I would post the code,
so here it is. Based upon earlier discussions and examples in this list:
in db.c, go to parse_object()
look for the switch statement of the additional flags, then insert:
[the part between the #defines is the inserted code, the other is
vanilla]
#ifdef HYPNO
/*
** affect player flags (see AFF_XXX flags in structs.h )
** This allows players flags to be affected by an item, for example
** create a ring which gives the player permanent sense life when worn.
**
** Note: more 'C' fields are allowed because all found 'C' (set char bits)
** fields are added to the current values. (nice for builders who
** don't want those large bitvector numbers in the obj file).
*/
case 'C':
get_line(obj_f, line);
sscanf(line, "%d ", t);
obj_proto[i].obj_flags.bitvector = obj_proto[i].obj_flags.bitvector | t[0];
break;
#endif
case '$':
case '#':
top_of_objt = i++;
return line;
break;
default:
fprintf(stderr, "Format error in %s\n", buf2);
--8< cut here 8<--
Ok, then make in one of your object files something like (values of
flags may vary, depending on your situation, see structs.h):
Check out the C flag, that's the one that matters.
---8< snip, snip 8<----------
#1214
ring wedding~
Piney's wedding ring~
Piney's wedding ring is lying here.~
~
9 94664 16391
10 0 0 0
1 0 0
C
2
E
ring wedding~
This ring is a masterpiece! the shiny golden blue ring is attached to a
platinum cord and has an inscription of silvery symbols.
~
E
cord platinum~
The cord looks really strange as if it can grow and shrink.
~
E
silvery symbols~
Jade my beloved wife - the day of the Sun, month of the Old Forces 317
~
#99999
$~
Hope it helps.
Jean-Jack.
This archive was generated by hypermail 2b30 : 12/07/00 PST