Changeset 567

Show
Ignore:
Timestamp:
09/17/07 07:48:37 (1 year ago)
Author:
takkaria
Message:

attack.c, obj-info.c, object.txt:

Make bad potions have a more damaging effect than good potions. This potentially gives another way to see which potions are bad, but you have to be observant and careful. It also means that junk potions have a useful effect if you come across a pile. If this doesn't work out, then most likely "proper" thrown effects will have to be implemented.

cmd4.c, cmd-obj.c, store.c, obj-info.c, externs.h:

Fix object recall display.

object.txt:

Reduce the cost of WoR and CSW a little.

object.txt:

Make more potions appear in piles -- including bad ones. This makes it harder to tell them apart.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/edit/object.txt

    r555 r567  
    17551755G:?:w 
    17561756I:70:11:0 
    1757 W:5:0:5:150 
     1757W:5:0:5:125 
    17581758A:100:5 to 100 
    17591759F:EASY_KNOW 
     
    17761776W:0:0:4:2 
    17771777A:50:1 to 10 
     1778M:55:2d3 
    17781779F:EASY_KNOW 
    17791780E:DRINK_GOOD 
     
    19051906G:!:d 
    19061907I:75:35:100 
    1907 W:3:0:4:45 
     1908W:3:0:4:40 
    19081909A:100:5 to 25 
    19091910M:85:2d3 
     
    19161917W:5:0:4:130 
    19171918A:100:10 to 35 
    1918 M:70:2d3 
     1919M:75:2d3 
    19191920F:EASY_KNOW 
    19201921E:CURE_CRITICAL 
     
    19491950W:0:0:4:0 
    19501951A:50:0 to 10 
     1952M:70:2d3 
     1953P:0:3d4:0:0:0 
    19511954F:EASY_KNOW 
    19521955E:PARALYZE 
     
    19561959I:75:7:0 
    19571960W:0:0:4:0 
     1961M:70:2d3 
    19581962A:50:0 to 10 
    1959 P:0:1d1:0:0:0 
     1963P:0:3d4:0:0:0 
    19601964F:EASY_KNOW 
    19611965E:BLIND 
     
    19651969I:75:9:50 
    19661970W:0:0:4:0 
     1971M:70:2d3 
    19671972A:50:0 to 10 
    1968 P:0:1d1:0:0:0 
     1973P:0:3d4:0:0:0 
    19691974F:EASY_KNOW 
    19701975E:CONFUSE 
     
    19741979I:75:6:0 
    19751980W:3:0:4:0 
     1981M:70:2d3 
    19761982A:50:0 to 10 
    1977 P:0:1d1:0:0:0 
     1983P:0:3d4:0:0:0 
    19781984F:EASY_KNOW 
    19791985E:POISON 
     
    19851991W:1:0:4:75 
    19861992A:100:1 to 100 
    1987 P:0:1d1:0:0:0 
    19881993F:EASY_KNOW 
    19891994E:HASTE 
     
    19931998I:75:4:50 
    19941999W:1:0:4:0 
     2000M:70:2d3 
    19952001A:50:0 to 10 
    1996 P:0:1d1:0:0:0 
     2002P:0:3d4:0:0:0 
    19972003F:EASY_KNOW 
    19982004E:SLOW 
     
    20032009W:30:0:4:8000 
    20042010A:80:30 to 90 
    2005 P:0:1d1:0:0:0 
    20062011F:EASY_KNOW 
    20072012E:GAIN_DEX 
     
    20122017W:25:0:4:300 
    20132018A:75:20 to 60 
    2014 P:0:1d1:0:0:0 
    20152019F:EASY_KNOW 
    20162020E:RESTORE_DEX 
     
    20212025W:25:0:4:300 
    20222026A:75:21 to 60 
    2023 P:0:1d1:0:0:0 
    20242027F:EASY_KNOW 
    20252028E:RESTORE_CON 
     
    20302033W:10:0:4:0 
    20312034A:50:10 to 15 
    2032 P:0:1d1:0:0:0 
    20332035F:EASY_KNOW 
    20342036E:LOSE_EXP 
     
    20382040I:75:5:0 
    20392041W:0:0:4:0 
     2042M:100:1d2 
    20402043A:20:3 to 15 
    2041 P:0:1d1:0:0:0 
    20422044F:EASY_KNOW 
    20432045E:DRINK_SALT 
     
    20482050W:25:0:4:800 
    20492051A:100:25 to 100 
    2050 P:0:1d1:0:0:0 
    20512052F:EASY_KNOW 
    20522053E:ENLIGHTENMENT 
     
    20572058W:1:0:4:35 
    20582059A:100:1 to 100 
    2059 P:0:1d1:0:0:0 
    20602060F:EASY_KNOW 
    20612061E:HERO 
     
    20662066W:3:0:4:100 
    20672067A:100:3 to 100 
    2068 P:0:1d1:0:0:0 
    20692068F:EASY_KNOW 
    20702069E:SHERO 
     
    20752074W:1:0:4:10 
    20762075A:100:1 to 100 
    2077 P:0:1d1:0:0:0 
    20782076F:EASY_KNOW 
    20792077E:CURE_PARANOIA 
     
    20842082W:40:0:4:400 
    20852083A:100:40 to 100 
    2086 P:0:1d1:0:0:0 
    20872084F:EASY_KNOW 
    20882085E:RESTORE_EXP 
     
    20932090W:1:0:4:30 
    20942091A:100:1 to 100 
    2095 P:0:1d1:0:0:0 
    20962092F:EASY_KNOW 
    20972093E:RESIST_FIRE 
     
    21022098W:1:0:4:30 
    21032099A:100:1 to 100 
    2104 P:0:1d1:0:0:0 
    21052100F:EASY_KNOW 
    21062101E:RESIST_COLD 
     
    21112106W:3:0:4:50 
    21122107A:100:3 to 25 
    2113 P:0:1d1:0:0:0 
    21142108F:EASY_KNOW 
    21152109E:TMD_SINVIS 
     
    21222116W:5:0:4:75 
    21232117A:100:1 to 35 
    2124 P:0:1d1:0:0:0 
    21252118F:EASY_KNOW 
    21262119E:CURE_POISON 
     
    21312124W:25:0:4:350 
    21322125A:100:25 to 100 
    2133 P:0:1d1:0:0:0 
    21342126F:EASY_KNOW 
    21352127E:RESTORE_MANA 
     
    21402132W:3:0:4:20 
    21412133A:100:3 to 25 
    2142 P:0:1d1:0:0:0 
    21432134F:EASY_KNOW 
    21442135E:TMD_INFRA 
  • trunk/src/attack.c

    r522 r567  
    984984 
    985985        /* Hack -- Base damage from thrown object */ 
    986         tdam = damroll(i_ptr->dd, i_ptr->ds) + i_ptr->to_d; 
     986        tdam = damroll(i_ptr->dd, i_ptr->ds); 
     987        if (!tdam) tdam = 1; 
     988        tdam += i_ptr->to_d; 
    987989 
    988990        /* Chance of hitting */ 
  • trunk/src/cmd-obj.c

    r556 r567  
    7272        object_info_header(o_ptr); 
    7373        if (!object_info_known(o_ptr)) 
    74                 text_out("This item does not seem to possess any special abilities."); 
     74                text_out("\n\nThis item does not seem to possess any special abilities."); 
    7575 
    7676        text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 
  • trunk/src/cmd4.c

    r556 r567  
    12371237        object_info_header(o_ptr); 
    12381238        if (!object_info_known(o_ptr)) 
    1239                 text_out("This item does not seem to possess any special abilities."); 
     1239                text_out("\n\nThis item does not seem to possess any special abilities."); 
    12401240 
    12411241        text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 
     
    16021602        object_info_header(o_ptr); 
    16031603        if (!object_info_known(o_ptr)) 
    1604                 text_out("This item does not seem to possess any special abilities."); 
     1604                text_out("\n\nThis item does not seem to possess any special abilities."); 
    16051605 
    16061606        text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 
  • trunk/src/externs.h

    r556 r567  
    396396extern bool object_info_known(const object_type *o_ptr); 
    397397extern bool object_info_full(const object_type *o_ptr); 
     398extern bool object_info_store(const object_type *o_ptr); 
    398399 
    399400/* object1.c */ 
  • trunk/src/obj-info.c

    r556 r567  
    6868static void output_desc_list(cptr intro, cptr list[], int n) 
    6969{ 
    70         if (n != 0) 
    71         { 
    72                 /* Output intro */ 
    73                 p_text_out(intro); 
    74  
    75                 /* Output list */ 
    76                 output_list(list, n); 
    77  
    78                 /* Output end */ 
    79                 text_out(".  "); 
    80         } 
     70        if (!n) return; 
     71 
     72        p_text_out(intro); 
     73        output_list(list, n); 
     74        text_out(".  "); 
    8175} 
    8276 
     
    185179 * Describe combat advantages. 
    186180 */ 
    187 static bool describe_combat(const object_type *o_ptr, u32b f1
     181static bool describe_combat(const object_type *o_ptr, bool full
    188182{ 
    189183        cptr desc[15]; 
     
    193187        object_type *j_ptr = &inventory[INVEN_BOW]; 
    194188 
     189        u32b f1, f2, f3; 
     190 
    195191        bool weapon = (wield_slot(o_ptr) == INVEN_WIELD); 
    196192        bool ammo   = (p_ptr->ammo_tval == o_ptr->tval) && 
     
    198194 
    199195        /* Abort if we've nothing to say */ 
    200         if (!weapon && !ammo) return FALSE; 
    201  
     196        if (!weapon && !ammo) 
     197        { 
     198                /* Potions can have special text */ 
     199                if (o_ptr->tval != TV_POTION) return FALSE; 
     200                if (!o_ptr->dd || !o_ptr->ds) return FALSE; 
     201                if (!object_known_p(o_ptr)) return FALSE; 
     202 
     203                p_text_out("It can be thrown at monsters with damaging effect.  "); 
     204                return TRUE; 
     205        } 
     206 
     207        if (full) 
     208                object_flags(o_ptr, &f1, &f2, &f3); 
     209        else 
     210                object_flags_known(o_ptr, &f1, &f2, &f3); 
    202211 
    203212 
     
    520529 * Describe an object's activation, if any. 
    521530 */ 
    522 static bool describe_activation(const object_type *o_ptr, u32b f3
     531static bool describe_activation(const object_type *o_ptr, u32b f3, bool full
    523532{ 
    524533        const object_kind *k_ptr = &k_info[o_ptr->k_idx]; 
     
    530539        { 
    531540                const artifact_type *a_ptr = &a_info[o_ptr->name1]; 
    532                 if (!object_known_p(o_ptr)) return FALSE; 
     541                if (!object_known_p(o_ptr) && !full) return FALSE; 
    533542 
    534543                effect = a_ptr->effect; 
     
    539548        else 
    540549        { 
    541         if (!object_aware_p(o_ptr)) return FALSE; 
     550               if (!object_aware_p(o_ptr) && !full) return FALSE; 
    542551         
    543552                effect = k_ptr->effect; 
     
    601610        } 
    602611 
    603         /* No activation */ 
    604         return (FALSE); 
     612        return TRUE; 
    605613} 
    606614 
     
    684692 * Output object information 
    685693 */ 
    686 bool object_info_out(const object_type *o_ptr, 
    687                      void (*flags)(const object_type *, u32b *, u32b *, u32b *)) 
     694static bool object_info_out(const object_type *o_ptr, bool full) 
    688695{ 
    689696        u32b f1, f2, f3; 
     
    691698 
    692699        /* Grab the object flags */ 
    693         flags(o_ptr, &f1, &f2, &f3); 
    694  
    695  
    696         /* New para */ 
    697         new_paragraph = TRUE; 
    698  
    699         /* Describe boring bits */ 
    700         if ((o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) && 
    701                 o_ptr->pval) 
    702         { 
    703                 p_text_out("It provides nourishment for about "); 
    704                 text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 
    705                 text_out(" turns under normal conditions.  "); 
    706         } 
    707  
    708  
    709         /* Describe combat bits */ 
    710         new_paragraph = TRUE; 
    711         if (describe_combat(o_ptr, f1)) something = TRUE; 
     700        if (full) 
     701                object_flags(o_ptr, &f1, &f2, &f3); 
     702        else 
     703                object_flags_known(o_ptr, &f1, &f2, &f3); 
    712704 
    713705        /* Describe other bits */ 
     
    717709        if (describe_sustains(o_ptr, f2)) something = TRUE; 
    718710        if (describe_misc_magic(o_ptr, f3)) something = TRUE; 
    719         if (describe_activation(o_ptr, f3)) something = TRUE; 
     711        if (describe_activation(o_ptr, f3, full)) something = TRUE; 
    720712        if (describe_ignores(o_ptr, f3)) something = TRUE; 
    721713 
     
    785777        bool has_info = FALSE; 
    786778 
    787         has_info = object_info_out(o_ptr, object_flags_known); 
     779        has_info = object_info_out(o_ptr, FALSE); 
     780 
     781        /* Describe boring bits */ 
     782        if ((o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) && 
     783                o_ptr->pval) 
     784        { 
     785                p_text_out("It provides nourishment for about "); 
     786                text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 
     787                text_out(" turns under normal conditions.  "); 
     788                has_info = TRUE; 
     789        } 
     790 
     791        new_paragraph = TRUE; 
     792        if (!object_known_p(o_ptr)) 
     793        { 
     794                p_text_out("You do not know the full extent of this item's powers."); 
     795                has_info = TRUE; 
     796        } 
     797 
     798        /* Describe combat bits */ 
     799        new_paragraph = TRUE; 
     800        if (describe_combat(o_ptr, FALSE)) has_info = TRUE; 
    788801 
    789802        new_paragraph = TRUE; 
    790803        if (describe_origin(o_ptr)) has_info = TRUE; 
    791804 
     805        return has_info; 
     806} 
     807 
     808bool object_info_full(const object_type *o_ptr) 
     809{ 
     810        return object_info_out(o_ptr, TRUE); 
     811} 
     812 
     813bool object_info_store(const object_type *o_ptr) 
     814{ 
     815        bool has_info = FALSE; 
     816 
     817        has_info = object_info_out(o_ptr, TRUE); 
     818 
     819        /* Describe boring bits */ 
     820        if ((o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) && 
     821                o_ptr->pval) 
     822        { 
     823                p_text_out("It provides nourishment for about "); 
     824                text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 
     825                text_out(" turns under normal conditions.  "); 
     826                has_info = TRUE; 
     827        } 
     828 
    792829        new_paragraph = TRUE; 
    793         if (!object_known_p(o_ptr)) 
    794         { 
    795                 p_text_out("You do not know the full extent of this item's powers."); 
    796                 has_info = TRUE; 
    797         } 
     830        if (describe_combat(o_ptr, TRUE)) has_info = TRUE; 
    798831 
    799832        return has_info; 
    800833} 
    801  
    802 bool object_info_full(const object_type *o_ptr) 
    803 { 
    804         return object_info_out(o_ptr, object_flags); 
    805 } 
  • trunk/src/store.c

    r559 r567  
    23162316        Term_erase(0, 0, 255); 
    23172317        Term_gotoxy(0, 0); 
    2318         object_info_full(o_ptr); 
     2318 
     2319        text_out_hook = text_out_to_screen; 
     2320        screen_save(); 
     2321 
     2322        object_info_header(o_ptr); 
     2323        if (!object_info_store(o_ptr)) 
     2324                text_out("\n\nThis item does not seem to possess any special abilities."); 
     2325 
     2326        text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 
     2327        (void)anykey(); 
     2328       
     2329        screen_load(); 
    23192330 
    23202331        /* Hack -- Browse book, then prompt for a command */