Re: [CODE] Function to find random targets in rooms

From: Angus Mezick (amezick@edgil.com)
Date: 05/24/99


Ok, here is that Hollar :)
1) add more direction to the TARG_ variables.  Things like TARG_FIGHTERS,
TARG_HEALERS, TARG_THIEVES, TARG_CASTERS, TARG_NEWBIES, TARG_HIBIES,
TARG_SWITCH (change targets for each swing), TARG_HIGHHIT (greatest +hr
in room), TARG_HIGHDAM (greatest damage in room)

2)  All of this malloc'ing worries me.  more of a performance issue to me.
You might want to make an array of struct *char_data targets[30];
--Angus




Chuck Reed <master@i-55.com> on 05/21/99 06:07:26 PM


<bobbit>
If anyone sees any problems with this or has an idea of how it can be
improved,
please give me a holler to let me know at this email address.  Anyhow, here
are the
instructions on installing it.  It should work with all versions of
circlemud.

1) The following should be added somewhere in structs.h:

// Definitions for random_target() by Chuck Reed
#define TARG_MORT       (1 << 0)
#define TARG_IMM        (1 << 1)
#define TARG_MOB        (1 << 2)
#define TARG_SELF       (1 << 3)
#define TARG_ALL        (1 << 4)

struct target_data
{
   struct char_data *c;
   struct target_data *prev;
   struct target_data *next;
};

<bobbit>

         ctp = malloc(sizeof(struct target_data));

<bobbit>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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