[newbie] point_update for portals

From: jimmy (jimmy@WWW.BLACKWING.NET)
Date: 01/30/98


Hey, I used the portal snippit from the circlemud ftp site and, for the
life of me I can't make my portals decay with the point_update insert.
If anyone here can look at it and let me know what I am missing, i would
appreciate it.

Thanks hope I didn't send too much of the code.
Jimmy


/* Update PCs, NPCs, and objects */
void point_update(void)
{
  void update_char_objects(struct char_data * ch);      /* handler.c */
  void extract_obj(struct obj_data * obj);      /* handler.c */
  struct char_data *i, *next_char;
  struct obj_data *j, *next_thing, *jj, *next_thing2;

  /* characters */
  for (i = character_list; i; i = next_char) {
    next_char = i->next;

    gain_condition(i, FULL, -1);
    gain_condition(i, DRUNK, -1);
    gain_condition(i, THIRST, -1);

    if (GET_POS(i) >= POS_STUNNED) {
      GET_HIT(i) = MIN(GET_HIT(i) + hit_gain(i), GET_MAX_HIT(i));
      GET_MANA(i) = MIN(GET_MANA(i) + mana_gain(i), GET_MAX_MANA(i));
      GET_MOVE(i) = MIN(GET_MOVE(i) + move_gain(i), GET_MAX_MOVE(i));
      if (IS_AFFECTED(i, AFF_POISON))
        damage(i, i, 2, SPELL_POISON);
      if (GET_POS(i) <= POS_STUNNED)
        update_pos(i);
    } else if (GET_POS(i) == POS_INCAP)
      damage(i, i, 1, TYPE_SUFFERING);
    else if (GET_POS(i) == POS_MORTALLYW)
      damage(i, i, 2, TYPE_SUFFERING);
    if (!IS_NPC(i)) {
      update_char_objects(i);
      if (GET_LEVEL(i) < LVL_GOD)
        check_idling(i);
    }
  }

  /* objects */
  for (j = object_list; j; j = next_thing) {
    next_thing = j->next;       /* Next in object list */

    /* If this is a corpse */
    if ((GET_OBJ_TYPE(j) == ITEM_CONTAINER) && GET_OBJ_VAL(j, 3)) {
      /* timer count down */
      if (GET_OBJ_TIMER(j) > 0)
        GET_OBJ_TIMER(j)--;

      if (!GET_OBJ_TIMER(j)) {

        if (j->carried_by)
          act("$p decays in your hands.", FALSE, j->carried_by, j, 0, TO_CHAR);
        else if ((j->in_room != NOWHERE) && (world[j->in_room].people)) {
          act("A quivering horde of maggots consumes $p.",
              TRUE, world[j->in_room].people, j, 0, TO_ROOM);
          act("A quivering horde of maggots consumes $p.",
              TRUE, world[j->in_room].people, j, 0, TO_CHAR);
        }
        for (jj = j->contains; jj; jj = next_thing2) {
          next_thing2 = jj->next_content;       /* Next in inventory */
          obj_from_obj(jj);

          if (j->in_obj)
            obj_to_obj(jj, j->in_obj);
          else if (j->carried_by)
            obj_to_room(jj, j->carried_by->in_room);
          else if (j->in_room != NOWHERE)
            obj_to_room(jj, j->in_room);
          else
            assert(FALSE);
        }
        extract_obj(j);
      }
    if (GET_OBJ_VNUM(j) == 31)
    {
      if (GET_OBJ_VAL(j,0) > 0)
        GET_OBJ_VAL(j,0)--;
      if (GET_OBJ_VAL(j,0) == 1)
      {
        if ((j->in_room != NOWHERE) &&(world[j->in_room].people)) {
          act("$p starts to fade!",
            FALSE, world[j->in_room].people, j, 0, TO_ROOM);
          act("$p starts to fade!",
            FALSE, world[j->in_room].people, j, 0, TO_CHAR);
        }
      }
      if (GET_OBJ_VAL(j,0) == 0)
      {
        if ((j->in_room != NOWHERE) &&(world[j->in_room].people)) {
          act("$p vanishes in a cloud of smoke!",
            FALSE, world[j->in_room].people, j, 0, TO_ROOM);
          act("$p vanishes in a cloud of smoke!",
            FALSE, world[j->in_room].people, j, 0, TO_CHAR);
        }
        extract_obj(j);
      }

}
}
}
}


     +------------------------------------------------------------+
     | 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/15/00 PST