On Sat, 8 Dec 2001, Cyberlord wrote: > Yes, this is where I am lacking at the moment, and will have to > imlement something here to check on this. There's no good way to check on it. The only thing you can do is go through each chain lightning structure and remove the character from the hit list when they're extracted (extract_char_final). > I like your idea of reducing mana per round (mind if I steal it?) Go right ahead. Show me a person who thinks he owns an idea, and I'll show you a fool. > In our mud, for every spell of this type I keep in a list. In this case, you need: struct foo_spell_data { struct hit_data *hitlist; struct foo_spell_data *next; /* For a global list if needed. */ struct char_data *caster; struct room_data *room; /* ... others? ... */ }; struct hit_data { struct char_data *ch; struct hit_data *next; }; I'm guessing, then, that no elements need to be added to the char_data structure. Instead, the foo_spell_data element is passed to the event or, if you're using heartbeat(), we're maintaining a global list and iterating through it every pulse of the chain lightning spell. This complicates the code significantly. > For some reason setting bits didn't cross my mind here, and that > *would* affect if a person could/could not get hit by another "C L" > spell. I do want to be able to hit people once with each spell. Perhaps add a caused_by char_data pointer to the affected_data structure? Then you can do (Mailer Code(tm) -- just fleshing out the idea): void MarkHit(struct char_data *caster, struct char_data *vict, int spell, int flag) { struct affected_type af; af.type = SPELL_CHAIN_LIGHTNING; af.duration = -1; /* Not removed by affect_update() */ af.modifier = 0; af.location = APPLY_NONE; af.bitvector = 0; af.caused_by = caster; affect_to_char(vict, &af); } void RemoveHit(struct char_data *vict, int spell, struct char_data *caster) { struct affected_type *af = vict->affected; while (af && (af->type != spell || af->caused_by != caster)) af = af->next; if (!af) return; affect_remove(vict, af); } bool HasBeenHit(struct char_data *vict, int spell, struct char_data *caster) { struct affected_type *af = vict->affected; while (af && (af->type != spell || af->caused_by != caster)) af = af->next; return (af != NULL); } I think this will work for multiple spells. Note that no modifier or bits are set. We only look for the affected_type structure. > I might even put in code for the mobs that are not fighting to have a > chance at excaping the room too. Who knows. :) It would be a very good idea. Mobiles don't need to be crippled more than they already are. -dak -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 06/24/03 PDT