Example #1
0
void do_inventory( CHAR_DATA * ch, const char *argument )
{
   set_char_color( AT_RED, ch );
   send_to_char( "You are carrying:\r\n", ch );
   show_list_to_char( ch->first_carrying, ch, TRUE, TRUE );
   return;
}
void look_room(struct char_data *ch, struct room_index_data *in_room) {
    if (!validate_look(ch)) {
	return;
    }

    if (in_room == NULL) {
	send_to_char("NOWHERE.", ch);
	return;
    }

    if (room_is_dark(ch, in_room) && !IS_SET(ch->act, PLR_HOLYLIGHT)) {
	send_to_char("It is pitch ```8black...`` \n\r", ch);
	show_char_to_char(in_room->people, ch);
	return;
    }


    send_to_char(in_room->name, ch);
    if ((IS_IMMORTAL(ch) && (IS_NPC(ch) || IS_SET(ch->act, PLR_HOLYLIGHT))) || IS_BUILDER(ch, in_room->area)) {
	printf_to_char(ch, " [`1Room `!%d``]", in_room->vnum);
    }

    send_to_char("\n\r", ch);
    if ((!IS_NPC(ch) && !IS_SET(ch->comm, COMM_BRIEF))) {
	send_to_char("  ", ch);
	send_to_char(in_room->description, ch);
    }

    send_to_char("\n\r", ch);

    if ((is_affected(ch, gsp_detect_magic) || IS_SET(ch->act, PLR_HOLYLIGHT))) {
	struct affect_data *paf;
	for (paf = in_room->affected; paf != NULL; paf = paf->next) {
	    send_to_char(room_affect(paf), ch);
	}
	send_to_char("\n\r", ch);
    }

    if (!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT))
	do_exits(ch, "auto");

    if (is_affected_room(in_room, gsp_faerie_fog))
	send_to_char("There is a `Ppurple haze`` floating throughout the room.\n\r", ch);

    show_list_to_char(in_room->contents, ch, false, false);
    show_char_to_char(in_room->people, ch);
    return;
}
void show_char_to_char_2(struct char_data *victim, struct char_data *ch)
{
    struct gameobject *obj;
    struct dynamic_skill *skill_peek;
    int iWear;
    bool found;

    if (can_see(victim, ch)) {
	if (ch == victim) {
	    act("$n glances at $mself.", ch, NULL, NULL, TO_ROOM);
	} else {
	    act("$n glances at you.", ch, NULL, victim, TO_VICT);
	    act("$n glances at $N.", ch, NULL, victim, TO_NOTVICT);
	}
    }

    show_damage_display(ch, victim);

    found = false;
    for (iWear = 0; where_name[iWear].wear_loc >= 0; iWear++) {
	if ((obj = get_eq_char(victim, where_name[iWear].wear_loc)) != NULL
		&& can_see_obj(ch, obj)) {
	    if (!found) {
		send_to_char("\n\r", ch);
		act("$N is using:", ch, NULL, victim, TO_CHAR);
		found = true;
	    }
	    send_to_char(where_name[iWear].desc, ch);
	    send_to_char("(", ch);
	    send_to_char(format_obj_to_char(obj, ch, true), ch);
	    send_to_char(")", ch);
	    send_to_char("\n\r", ch);
	}
    }

    if (victim != ch && !IS_NPC(ch)
	    && (skill_peek = gsp_peek) != NULL
	    && number_percent() < get_learned_percent(ch, skill_peek)) {
	send_to_char("\n\rYou peek at the inventory:\n\r", ch);
	check_improve(ch, skill_peek, true, 4);
	show_list_to_char(victim->carrying, ch, true, true);
    }

    return;
}
Example #4
0
void do_inventory( CHAR_DATA* ch, const char* argument)
{
   CHAR_DATA *victim;

   if( !argument || argument[0] == '\0' || !IS_IMMORTAL( ch ) )
      victim = ch;
   else
   {
      if( !( victim = get_char_world( ch, argument ) ) )
      {
         ch_printf( ch, "There is nobody named %s online.\r\n", argument );
         return;
      }
   }

   if( victim != ch )
      ch_printf( ch, "&R%s is carrying:\r\n", IS_NPC( victim ) ? victim->short_descr : victim->name );
   else
      send_to_char( "&RYou are carrying:\r\n", ch );

   show_list_to_char( victim->first_carrying, ch, TRUE, TRUE );
   return;
}
void look_object(struct char_data *ch, struct gameobject *obj, const char *argument) {
    struct gameobject *portal;
    struct room_index_data *location;

    if (!validate_look(ch)) {
	return;
    }

    switch (obj->item_type) {
	default:
	    send_to_char("That is not a container.\n\r", ch);
	    break;

	case ITEM_DRINK_CON:
	    if (obj->value[1] == 0) {
		send_to_char("It is empty.\n\r", ch);
	    } else {
		printf_to_char(ch, "It's %sfilled with  a %s liquid.\n\r",
			obj->value[1] < obj->value[0] / 4
			? "less than half-" :
			obj->value[1] < 3 * obj->value[0] / 4
			? "about half-" : "more than half-",
			liq_table[obj->value[2]].liq_color);
	    }
	    break;

	case ITEM_CONTAINER:
	case ITEM_CORPSE_NPC:
	case ITEM_CORPSE_PC:
	    if (IS_SET(obj->value[1], CONT_CLOSED)) {
		send_to_char("It is closed.\n\r", ch);
	    } else {
		act("$p holds```8:``", ch, obj, NULL, TO_CHAR);
		show_list_to_char(obj->contains, ch, true, true);
	    }
	    break;
	case ITEM_PORTAL:
	    portal = get_obj_list(ch, argument, ch->in_room->contents);
	    if (portal != NULL) {
		location = get_room_index(portal->value[3]);
		if (location == NULL) {
		    send_to_char("It looks very empty..\n\r", ch);
		} else {
		    send_to_char(location->name, ch);
		    send_to_char("\n\r", ch);
		    if (!IS_SET(location->room_flags, ROOM_INDOORS))
			print_weather(ch);
		    else
			send_to_char("You can not discern weather conditions beyond this portal.\n\r", ch);
		    if (!IS_NPC(ch) && !IS_SET(ch->comm, COMM_BRIEF)) {
			send_to_char(location->description, ch);
		    }
		    send_to_char("\n\r", ch);

		    if (!IS_NPC(ch) && IS_SET(ch->act, PLR_AUTOEXIT)) {
			char showexit[100];

			sprintf(showexit, "%ld exits auto", location->vnum);
			do_at(ch, showexit);
		    }

		    show_list_to_char(location->contents, ch, false, false);
		    show_char_to_char(location->people, ch);
		}
	    }
	    break;
    }
}