On Wed, 9 Oct 1996, The Arrow wrote: > It will of course work, but then you must add some kind of list where you > add every FIGHTING(ch), or else he/she will get to fight twice! > Also, if there are many PCs fighting a single mob, then you can't just > simply switch between ch and FIGHING(ch). > On my old (and my to be) mud, mobs can have up to ten attacks, and I admit > it may be ineffective calling perform_violence() ten times, but I think > its the most generic and simple way of getting intermixed attacks. And I thought I was link list happy... :) Why not just set a PLR or MOB flag (depending on whether they are a player or mob) like PLR_HAS_HIT. Set that when you switch to them and they hit, then when the loop hits them, remove the flag and continue through the list without doing anything... Or actually, that's flawed because then players would still get more attacks if they are FIGHTING(ch) to more than one mobile. So before the first loop in perform_violence add a new loop and remove PLR_HAS_HIT from any mobs/players with it set. That way they don't get any more hits until perform_violence() is called again. Two loops are still better than 10. <*=-+Daniel+-=*> "Forgive me father, for I am sin." +-----------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://cspo.queensu.ca/~fletcher/Circle/list_faq.html | +-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST