[Circle] MOUNT/UNMOUNT

From: Bruce, Ray, Phil (bherbert@ns.technonet.com)
Date: 11/16/96


I got the MOUNT/UNMOUNT commands to work, but there are some errors...
Maybe you can find them...

****ACT.MOVEMENT.C****
/* simple function to determine if char is mounted or not */
int is_mounted(struct char_data *ch)
{

  if (!(ch->char_specials.mountee))
    return 1;

  return 0;
}
*-*-* In DO_SIMPLE_MOVE *-*-*-

 if ((!IS_AFFECTED(ch, AFF_SNEAK)) || (is_mounted(ch) == 0)) {
   sprintf(buf2, "$n leaves %s.", dirs[dir]);
   act(buf2, TRUE, ch, 0, 0, TO_ROOM);
 } else {
 if (!IS_AFFECTED(ch, AFF_SNEAK)) {
   sprintf(buf2, "$n rides %s %s.", ((ch)->char_specials.mountee), dirs[dir]);
   }
 }
 was_in = ch->in_room;
 char_from_room(ch);
 char_to_room(ch, world[was_in].dir_option[dir]->to_room);

 if ((!IS_AFFECTED(ch, AFF_SNEAK)) || (is_mounted(ch) == 0)) {
   act("$n has arrived.", TRUE, ch, 0, 0, TO_ROOM);
 } else {
 if (!IS_AFFECTED(ch, AFF_SNEAK)) {
   sprintf(buf2, "$n arrives riding %s.", ((ch)->char_specials.mountee));
   act(buf2, TRUE, ch, 0, 0, TO_ROOM);
   }
 }

****INTERPRETER.C*****

void mount_animal(struct char_data *ch, struct char_data *vict)
{
  (ch)->char_specials.mountee = vict;
  GET_POS(ch) = POS_MOUNTED;
  sprintf(buf, "You mount %s.\r\n", vict);
  send_to_char(buf, ch);
  sprintf(buf, "$n mounts %s.\r\n", vict);
  send_to_room(buf, ch->in_room);
}

void unmount_animal(struct char_data *ch, struct char_data *vict)
{
  GET_POS(ch) = POS_STANDING;
  (ch)->char_specials.mountee = 0;
  sprintf(buf, "You unmount %s.\r\n", vict);
  send_to_char(buf, ch);
  sprintf(buf, "$n unmounts %s.\r\n", vict);
  send_to_room(buf, ch->in_room);
}

And its also in the top
ACMD(do_mount)
ACMD(do_unmount)

And in the LIST thingy... In other words, I can type mount <mob> in the
game and it does something... just not the right thing :) grin.

**** UTILS.H ****
int     is_mounted(struct char_data *ch);

#define GET_MOUNT(ch)     ((ch)->char_specials.mountee)
#define GET_MOUNTMOB(ch)  (GET_NAME(GET_MOUNT(ch)))

And that's about all I've put in... It should do the BASIC mount and
unmount... Sure there is still LOTS to do, and I know that the mob wont
follow you yet, but at least I want the IS_MOUNTED flags to work, and they
dont since it doesn't show 'John rides a spirit east.' Which it should, but
its not because of that piece of code in ACT.MOVEMENT.C, it just says the
usual 'John leave east.' Which is not what we want... Plus, the SNEAK
doesn't work anymore, you can always see them leave or entering the room
even if sneak is on.


	      *Frostiana*  BETA
		http://www.durand.net/Frostiana
		telnet://206.31.114.50:5000

+-----------------------------------------------------------+
| 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