Changeset 532

Show
Ignore:
Timestamp:
08/18/07 19:30:35 (1 year ago)
Author:
takkaria
Message:

Make ID reveal all powers of an object, and remove *ID*. (#158)

Note that this is subject to change; as, indeed, is the entire ID system. Some kind of ID-via use is what I have in mind, but I need to play Un some more first.

Files:

Legend:

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

    r522 r532  
    12271227        make_fake_artifact(o_ptr, a_idx); 
    12281228        o_ptr->ident |= (IDENT_STORE | IDENT_KNOWN); 
    1229         if (cheat_xtra) o_ptr->ident |= IDENT_MENTAL; 
    12301229 
    12311230        /* Hack -- Handle stuff */ 
  • trunk/src/defines.h

    r531 r532  
    16921692#define IDENT_KNOWN     0x08    /* Item abilities are known */ 
    16931693#define IDENT_STORE     0x10    /* Item is in the inventory of a store */ 
    1694 #define IDENT_MENTAL    0x20    /* Item information is known */ 
    16951694/* ... */ 
    16961695#define IDENT_BROKEN    0x80    /* Item is permanently worthless */ 
     
    23682367 */ 
    23692368#define object_known_p(T) \ 
    2370         (((T)->ident & (IDENT_KNOWN)) || \ 
    2371          ((k_info[(T)->k_idx].flags3 & (TR3_EASY_KNOW)) && \ 
     2369        (((T)->ident & IDENT_KNOWN) || \ 
     2370         ((k_info[(T)->k_idx].flags3 & TR3_EASY_KNOW) && \ 
    23722371          k_info[(T)->k_idx].aware)) 
    23732372 
  • trunk/src/effects.c

    r522 r532  
    712712                } 
    713713 
    714                 case EF_IDENTIFY2: 
    715                 { 
    716                         *ident = TRUE; 
    717                         if (!identify_fully()) return FALSE; 
    718                         return TRUE; 
    719                 } 
    720  
    721714                case EF_REMOVE_CURSE: 
    722715                { 
  • trunk/src/effects.h

    r453 r532  
    135135        EFFECT(ENCHANT_ARMOR,  FALSE, "attempts to magically enhance a piece of armour") 
    136136        EFFECT(ENCHANT_ARMOR2, FALSE, "attempts to magically enhance a piece of armour with high chance of success") 
    137         EFFECT(IDENTIFY,       FALSE, "reveals all unhidden powers of an object") 
    138         EFFECT(IDENTIFY2,      FALSE, "reveals all powers of an object") 
     137        EFFECT(IDENTIFY,       FALSE, "reveals to you the extent of an item's magical powers") 
    139138        EFFECT(REMOVE_CURSE,   FALSE, "removes all ordinary curses from all equipped items") 
    140139        EFFECT(REMOVE_CURSE2,  FALSE, "removes all curses from all equipped items") 
  • trunk/src/externs.h

    r526 r532  
    549549extern void do_ident_item(int item, object_type *o_ptr); 
    550550extern bool ident_spell(void); 
    551 extern bool identify_fully(void); 
    552551extern bool recharge(int num); 
    553552extern bool speed_monsters(void); 
  • trunk/src/files.c

    r500 r532  
    28062806 
    28072807                /* Fully known */ 
    2808                 o_ptr->ident |= (IDENT_MENTAL); 
     2808                o_ptr->ident |= (IDENT_KNOWN); 
    28092809        } 
    28102810 
     
    28222822 
    28232823                /* Fully known */ 
    2824                 o_ptr->ident |= (IDENT_MENTAL); 
     2824                o_ptr->ident |= (IDENT_KNOWN); 
    28252825        } 
    28262826 
     
    29502950 
    29512951                /* Fully known */ 
    2952                 o_ptr->ident |= (IDENT_MENTAL); 
     2952                o_ptr->ident |= (IDENT_KNOWN); 
    29532953 
    29542954                /* Describe */ 
  • trunk/src/obj-info.c

    r531 r532  
    715715        if (describe_ignores(o_ptr, f3)) something = TRUE; 
    716716 
    717         /* Unknown extra powers (ego-item with random extras or artifact) */ 
    718         if (object_known_p(o_ptr) && (!(o_ptr->ident & IDENT_MENTAL)) && 
    719             (o_ptr->flags2 || o_ptr->flags3 || artifact_p(o_ptr))) 
    720         { 
    721                 /* Hack -- Put this in a separate paragraph if screen dump */ 
    722                 if (text_out_hook == text_out_to_screen) 
    723                         new_paragraph = TRUE; 
    724  
    725                 p_text_out("It might have hidden powers."); 
    726                 something = TRUE; 
    727         } 
    728  
    729717        /* We are done. */ 
    730718        return something; 
     
    815803        new_paragraph = TRUE; 
    816804        if (!object_known_p(o_ptr)) 
    817                 p_text_out("This item has not been identified."); 
     805                p_text_out("You do not know the full extent of this item's powers."); 
    818806        else if (!has_description && !has_info) 
    819807                p_text_out("This item does not seem to possess any special abilities."); 
  • trunk/src/object1.c

    r531 r532  
    334334static void object_flags_aux(int mode, const object_type *o_ptr, u32b *f1, u32b *f2, u32b *f3) 
    335335{ 
    336         object_kind *k_ptr; 
    337  
    338         if (mode != OBJECT_FLAGS_FULL) 
    339         { 
    340                 /* Clear */ 
    341                 (*f1) = (*f2) = (*f3) = 0L; 
    342  
    343                 /* Must be identified */ 
    344                 if (!object_known_p(o_ptr)) return; 
    345         } 
     336        object_kind *k_ptr = &k_info[o_ptr->k_idx]; 
     337 
     338        /* Clear */ 
     339        (*f1) = (*f2) = (*f3) = 0L; 
     340 
     341        /* Unless requesting full flags, the object must be known */ 
     342        if ((mode != OBJECT_FLAGS_FULL) && !object_known_p(o_ptr)) return; 
    346343 
    347344        if (mode != OBJECT_FLAGS_RANDOM) 
    348345        { 
    349                 k_ptr = &k_info[o_ptr->k_idx]; 
    350  
    351346                /* Base object */ 
    352347                (*f1) = k_ptr->flags1; 
     
    394389        if (mode != OBJECT_FLAGS_FULL) 
    395390        { 
    396                 bool spoil = FALSE; 
    397  
    398 #ifdef SPOIL_ARTIFACTS 
    399                 /* Full knowledge for some artifacts */ 
    400                 if (artifact_p(o_ptr)) spoil = TRUE; 
    401 #endif /* SPOIL_ARTIFACTS */ 
    402  
    403 #ifdef SPOIL_EGO_ITEMS 
    404                 /* Full knowledge for some ego-items */ 
    405                 if (ego_item_p(o_ptr)) spoil = TRUE; 
    406 #endif /* SPOIL_ARTIFACTS */ 
    407  
    408                 /* Need full knowledge or spoilers */ 
    409                 if (!spoil && !(o_ptr->ident & IDENT_MENTAL)) return; 
    410  
    411391                /* Artifact */ 
    412392                if (o_ptr->name1) 
     
    424404                        } 
    425405                } 
    426  
    427                 /* Full knowledge for *identified* objects */ 
    428                 if (!(o_ptr->ident & IDENT_MENTAL)) return; 
    429406        } 
    430407 
  • trunk/src/object2.c

    r531 r532  
    13081308        if (j_ptr->ident & (IDENT_STORE)) o_ptr->ident |= (IDENT_STORE); 
    13091309 
    1310         /* Hack -- Blend "mental" status */ 
    1311         if (j_ptr->ident & (IDENT_MENTAL)) o_ptr->ident |= (IDENT_MENTAL); 
    1312  
    13131310        /* Hack -- Blend "notes" */ 
    13141311        if (j_ptr->note != 0) o_ptr->note = j_ptr->note; 
  • trunk/src/spells2.c

    r531 r532  
    414414 * 
    415415 * List various information about the player and/or his current equipment. 
    416  * See also "identify_fully()". 
    417416 * 
    418417 * This tests the flags of the equipment being carried and the innate player 
     
    16501649{ 
    16511650        if (object_known_p(o_ptr)) 
    1652                 return FALSE; 
    1653         else 
    1654                 return TRUE; 
    1655 } 
    1656  
    1657  
    1658 static bool item_tester_unknown_star(const object_type *o_ptr) 
    1659 { 
    1660         if (o_ptr->ident & IDENT_MENTAL) 
    16611651                return FALSE; 
    16621652        else 
     
    19281918 
    19291919/* 
    1930  * Fully "identify" an object in the inventory 
    1931  * 
    1932  * This routine returns TRUE if an item was identified. 
    1933  */ 
    1934 bool identify_fully(void) 
    1935 { 
    1936         int item; 
    1937  
    1938         object_type *o_ptr; 
    1939  
    1940         cptr q, s; 
    1941  
    1942  
    1943         /* Only un-*id*'ed items */ 
    1944         item_tester_hook = item_tester_unknown_star; 
    1945  
    1946         /* Get an item */ 
    1947         q = "Identify which item? "; 
    1948         s = "You have nothing to identify."; 
    1949         if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE); 
    1950  
    1951         /* Get the item (in the pack) */ 
    1952         if (item >= 0) 
    1953         { 
    1954                 o_ptr = &inventory[item]; 
    1955         } 
    1956  
    1957         /* Get the item (on the floor) */ 
    1958         else 
    1959         { 
    1960                 o_ptr = &o_list[0 - item]; 
    1961         } 
    1962  
    1963         /* Identify the object */ 
    1964         do_ident_item(item, o_ptr); 
    1965  
    1966         /* Mark the item as fully known */ 
    1967         o_ptr->ident |= (IDENT_MENTAL); 
    1968  
    1969         /* Handle stuff */ 
    1970         handle_stuff(); 
    1971  
    1972         /* Describe it fully */ 
    1973         object_info_screen(o_ptr); 
    1974  
    1975  
    1976         /* Success */ 
    1977         return (TRUE); 
    1978 } 
    1979  
    1980  
    1981  
    1982  
    1983 /* 
    19841920 * Hook for "get_item()".  Determine if something is rechargable. 
    19851921 */ 
     
    20561992                reduce_charges(o_ptr, 1); 
    20571993 
    2058                 /* *Identified* items keep the knowledge about the charges */ 
    2059                 if (!(o_ptr->ident & IDENT_MENTAL)) 
    2060                 { 
    2061                         /* We no longer "know" the item */ 
    2062                         o_ptr->ident &= ~(IDENT_KNOWN); 
    2063                 } 
    2064  
    20651994                /* Reduce and describe inventory */ 
    20661995                if (item >= 0) 
     
    20872016                /* Recharge based on the power */ 
    20882017                if (t > 0) o_ptr->pval += 2 + randint(t); 
    2089  
    2090                 /* *Identified* items keep the knowledge about the charges */ 
    2091                 if (!(o_ptr->ident & IDENT_MENTAL)) 
    2092                 { 
    2093                         /* We no longer "know" the item */ 
    2094                         o_ptr->ident &= ~(IDENT_KNOWN); 
    2095                 } 
    20962018 
    20972019                /* We no longer think the item is empty */ 
  • trunk/src/wizard2.c

    r522 r532  
    15471547                } 
    15481548 
    1549                 /* View item info */ 
    1550                 case 'f': 
    1551                 { 
    1552                         (void)identify_fully(); 
    1553                         break; 
    1554                 } 
    1555  
    15561549                /* Good Objects */ 
    15571550                case 'g':