change in do_follow

From: Marcelo Valle Moreira (pira@dcc.unicamp.br)
Date: 05/08/96


Here goes the change as I said in my last mail with the double attack subject or something like this =o)

if you have no idea what this code is doing here read my previous mail you may have deleted when you read my name in sender =o)

here goes my change:


ACMD(do_follow)
{
  struct follow_type *fol;
  struct char_data *leader;

  void stop_follower(struct char_data *ch);
  void add_follower(struct char_data *ch, struct char_data *leader);

  one_argument(argument, buf);

   if (*buf) {
    if (!(leader = get_char_room_vis(ch, buf))) {
      send_to_char(NOPERSON, ch);
      return;
    }
  } else {
    send_to_char("Whom do you wish to follow?\r\n", ch);
    return;
  }

  if ( (GET_CLASS(leader) == CLASS_VAMPIRE && GET_CLASS(ch) == CLASS_WEREWOLF) || (GET_CLASS(leader) == CLASS_WEREWOLF && GET_CLASS(ch) == CLASS_VAMPIRE) ){
  send_to_char("You can't follow this Kind of being!", ch);
  return;
} else {

  if (GET_CLASS(ch) == CLASS_VAMPIRE)
    for (fol = leader->followers; fol; fol = fol->next) {
      if (GET_CLASS(fol->follower) == CLASS_WEREWOLF) {
         send_to_char("There's a damned Dog following this person!", ch);
           return;
      }
    }

  if (GET_CLASS(ch) == CLASS_WEREWOLF)
    for (fol = leader->followers; fol; fol = fol->next) {
      if (GET_CLASS(fol->follower) == CLASS_VAMPIRE) {
         send_to_char("There's a damned Bat following this person!", ch);
         return;
      }
    }
  }

  if (ch->master == leader) {
    act("You are already following $M.", FALSE, ch, 0, leader, TO_CHAR);
    return;
  }
  if (IS_AFFECTED(ch, AFF_CHARM) && (ch->master)) {
    act("But you only feel like following $N!", FALSE, ch, 0, ch->master, TO_CHAR);
  } else {			/* Not Charmed follow person */
    if (leader == ch) {
      if (!ch->master) {
	send_to_char("You are already following yourself.\r\n", ch);
	return;
      }
      stop_follower(ch);
    } else {
      if (circle_follow(ch, leader)) {
	act("Sorry, but following in loops is not allowed.", FALSE, ch, 0, 0, TO_CHAR);
	return;
      }
      if (ch->master)
	stop_follower(ch);
      REMOVE_BIT(AFF_FLAGS(ch), AFF_GROUP);
      add_follower(ch, leader);
    }
  }
}



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