Re: Jesus walked on water...

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 10/15/97


On Wed, 15 Oct 1997, Cris Jacobin wrote:

>        If you go to to river off the levee, and donate your boat nothing
>happens besides you being stuck in the room.  If you drop a heavy item such
>as 10,000 coins, it doesn't sink.  Jesus might have walked on water, but I
>doubt he had an encumbrance approaching 400 ;)

Hmm...after reading this I came up with a preliminary approach to fix this.
I have compiled (but not run) with this patch and am looking mostly for
comments on the approach and not the implementation.  Basically, any gold
dropped in water is lost.  Anything that weighs > 0 dropped in water is
lost.  Every pulse, a character is tested to see if they have a boat and
are over water, if they do not have a boat, they lose hit points equal to
their maximum divided by 5. (So 20% each tick.) That may seem odd, but in
this case the character is drowning for one hour (game time) in unswimmable
water.   I'll release the (tested) patch later on my page when satisfied.

diff -upPr -x *.o ../stk/act.item.c ./act.item.c
--- ../stk/act.item.c   Fri Apr 12 23:39:21 1996
+++ ./act.item.c        Wed Oct 15 17:20:50 1997
@@ -343,7 +343,14 @@ void perform_drop_gold(struct char_data
        send_to_char("You drop some gold.\r\n", ch);
        sprintf(buf, "$n drops %s.", money_desc(amount));
        act(buf, FALSE, ch, 0, 0, TO_ROOM);
-       obj_to_room(obj, ch->in_room);
+       /* If we're in water, gold sinks. */
+       if (SECT(ch->in_room) == SECT_WATER_SWIM ||
+               SECT(ch->in_room) == SECT_WATER_NOSWIM) {
+         sprintf(buf, "%s sinks into the watery depths.", money_desc(amount));
+         send_to_room(buf, ch->in_room);
+         extract_obj(obj);
+       } else
+         obj_to_room(obj, ch->in_room);
       }
     } else {
       sprintf(buf, "$n drops %s which disappears in a puff of smoke!",
@@ -375,7 +382,13 @@ int perform_drop(struct char_data * ch,
   act(buf, TRUE, ch, obj, 0, TO_ROOM);

   obj_from_char(obj);
+  /* Cannot donate non-donate flagged items. */
   if ((mode == SCMD_DONATE) && IS_OBJ_STAT(obj, ITEM_NODONATE))
+    mode = SCMD_JUNK;
+  /* Anything dropped in water that weighs something is junked. */
+  if (mode == SCMD_DROP && GET_OBJ_WEIGHT(obj) &&
+       (SECT(ch->in_room) == SECT_WATER_SWIM ||
+       SECT(ch->in_room) == SECT_WATER_NOSWIM))
     mode = SCMD_JUNK;

   switch (mode) {
diff -upPr -x *.o ../stk/limits.c ./limits.c
--- ../stk/limits.c     Fri Apr 12 23:39:21 1996
+++ ./limits.c  Wed Oct 15 17:23:36 1997
@@ -22,6 +22,7 @@
        titles[(int)GET_CLASS(ch)][(int)GET_LEVEL(ch)].title_m :  \
        titles[(int)GET_CLASS(ch)][(int)GET_LEVEL(ch)].title_f)

+extern int has_boat(struct char_data *ch);

 extern struct char_data *character_list;
 extern struct obj_data *object_list;
@@ -400,6 +401,12 @@ void point_update(void)
     else if (GET_POS(i) == POS_MORTALLYW)
       damage(i, i, 2, TYPE_SUFFERING);
     if (!IS_NPC(i)) {
+      if (SECT(i->in_room) == SECT_WATER_NOSWIM && !has_boat(i)) {
+       act("$n thrashes about in the water straining to stay afloat.", FALSE,
+               i, 0, 0, TO_ROOM);
+       send_to_char("You are drowning!\r\n", i);
+       damage(i, i, GET_MAX_HIT(i) / 5, TYPE_SUFFERING); /* TYPE_DROWNING ? */
+      }
       update_char_objects(i);
       if (GET_LEVEL(i) < LVL_GOD)
        check_idling(i);
--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


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



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