コード例 #1
0
ファイル: cmd3.c プロジェクト: NickMcConnell/poschengband
/*
 * Observe an item which has been *identify*-ed
 */
void do_cmd_observe(void)
{
    int            item;

    object_type        *o_ptr;

    char        o_name[MAX_NLEN];

    cptr q, s;

    item_tester_no_ryoute = TRUE;
    /* Get an item */
    q = "Examine which item? ";
    s = "You have nothing to examine.";

    if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return;

    /* Get the item (in the pack) */
    if (item >= 0)
    {
        o_ptr = &inventory[item];
    }

    /* Get the item (on the floor) */
    else
    {
        o_ptr = &o_list[0 - item];
    }


    /* Note, descriptions for potions, scrolls, wands, staves and rods all spoil 
       the object's effects. Some of the light and jewelry descriptions are also TMI.
       Descriptions for weapons and armor should always be displayed. */
    if (!object_is_weapon_armour_ammo(o_ptr) && !object_is_known(o_ptr))
    {
        msg_print("You have no special knowledge about that item.");
        return;
    }

    /* Description */
    object_desc(o_name, o_ptr, 0);

    /* Describe */
    msg_format("Examining %s...", o_name);

    /* Describe it fully */
    if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print("You see nothing special.");
}
コード例 #2
0
ファイル: obj_kind.c プロジェクト: erikbroo/chengband
/*
 * Check if an object is made by a smith's special ability
 */
bool object_is_smith(object_type *o_ptr)
{
	if (object_is_weapon_armour_ammo(o_ptr) && o_ptr->xtra3) return TRUE;

	return FALSE;
}