Changeset 968

Show
Ignore:
Timestamp:
06/28/08 06:52:33 (5 months ago)
Author:
takkaria
Message:

Clean up character dumps a bit.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/files.c

    r966 r968  
    19711971 
    19721972                        file_putf(fp, "%c) %s\n", index_to_label(i), o_name); 
    1973                         if (inventory[i].k_idx && object_info_known(&inventory[i])
    1974                                 file_putf(fp, "\n"); 
     1973                        if (inventory[i].k_idx
     1974                                object_info_chardump(&inventory[i]); 
    19751975                } 
    19761976                file_putf(fp, "\n\n"); 
     
    19861986 
    19871987                file_putf(fp, "%c) %s\n", index_to_label(i), o_name); 
    1988                 object_info_known(&inventory[i]); 
     1988                object_info_chardump(&inventory[i]); 
    19891989        } 
    19901990        file_putf(fp, "\n\n"); 
  • trunk/src/obj-info.c

    r945 r968  
    451451 * Describe things that look like lights. 
    452452 */ 
    453 static bool describe_light(const object_type *o_ptr, u32b f3
     453static bool describe_light(const object_type *o_ptr, u32b f3, bool terse
    454454{ 
    455455        int rad = 0; 
     
    478478        text_out("."); 
    479479 
    480         if (is_lite && !artifact) 
     480        if (!terse && is_lite && !artifact) 
    481481        { 
    482482                const char *name = (o_ptr->sval == SV_LITE_TORCH) ? "torch" : "lantern"; 
     
    496496 * Describe an object's activation, if any. 
    497497 */ 
    498 static bool describe_activation(const object_type *o_ptr, u32b f3, bool full
     498static bool describe_activation(const object_type *o_ptr, u32b f3, bool full, bool all
    499499{ 
    500500        const object_kind *k_ptr = &k_info[o_ptr->k_idx]; 
     
    530530        if (!desc) return FALSE; 
    531531 
     532        if (all == FALSE && !(f3 & TR3_ACTIVATE)) return FALSE; 
     533 
    532534        text_out("When "); 
     535        text_out(" (all = %d, %d) ", all, (f3 & TR3_ACTIVATE) ? 1 : 0); 
    533536 
    534537        if (f3 & TR3_ACTIVATE) 
     
    615618        if (something) text_out("\n"); 
    616619 
    617         if (describe_activation(o_ptr, f3, full)) something = TRUE; 
    618         if (describe_light(o_ptr, f3)) something = TRUE; 
     620        if (describe_activation(o_ptr, f3, full, TRUE)) something = TRUE; 
     621        if (describe_light(o_ptr, f3, FALSE)) something = TRUE; 
    619622 
    620623        return something; 
     
    727730 
    728731 
     732bool object_info_chardump(const object_type *o_ptr) 
     733{ 
     734        u32b f1, f2, f3; 
     735        bool something = FALSE; 
     736 
     737        /* Grab the object flags */ 
     738        object_flags_known(o_ptr, &f1, &f2, &f3); 
     739 
     740 
     741        if (cursed_p(o_ptr)) 
     742        { 
     743                if (f3 & TR3_PERMA_CURSE) 
     744                        text_out_c(TERM_L_RED, "Permanently cursed.\n"); 
     745                else if (f3 & TR3_HEAVY_CURSE) 
     746                        text_out_c(TERM_L_RED, "Heavily cursed.\n"); 
     747                else if (object_known_p(o_ptr)) 
     748                        text_out_c(TERM_L_RED, "Cursed.\n"); 
     749        } 
     750 
     751        if (describe_stats(f1, o_ptr->pval)) something = TRUE; 
     752        if (describe_immune(f2)) something = TRUE; 
     753        if (describe_ignores(f3)) something = TRUE; 
     754        if (describe_sustains(f2)) something = TRUE; 
     755        if (describe_misc_magic(f3)) something = TRUE; 
     756 
     757        if (describe_activation(o_ptr, f3, FALSE, FALSE)) something = TRUE; 
     758        if (describe_light(o_ptr, f3, TRUE)) something = TRUE; 
     759 
     760        /* Describe combat bits */ 
     761        if (describe_combat(o_ptr, FALSE)) something = TRUE; 
     762 
     763        return something; 
     764} 
     765 
    729766bool object_info_known(const object_type *o_ptr) 
    730767{ 
  • trunk/src/object.h

    r949 r968  
    5757void object_info_header(const object_type *o_ptr); 
    5858bool object_info_known(const object_type *o_ptr); 
     59bool object_info_chardump(const object_type *o_ptr); 
    5960bool object_info_full(const object_type *o_ptr); 
    6061bool object_info_store(const object_type *o_ptr);