Changeset 1015

Show
Ignore:
Timestamp:
10/01/08 19:42:09 (3 months ago)
Author:
takkaria
Message:

Make all metal monsters drop gold of the appropriate kind.

Files:

Legend:

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

    r1014 r1015  
    25292529 
    25302530/* 
    2531  * Hack -- Return the "automatic coin type" of a monster race 
    2532  * Used to allocate proper treasure when "Creeping coins" die 
    2533  * 
    2534  * Note the use of actual "monster names".  XXX XXX XXX 
     2531 * Return the coin type of a monster race, based on the monster being 
     2532 * killed. 
    25352533 */ 
    25362534static int get_coin_type(const monster_race *r_ptr) 
    25372535{ 
    2538         cptr name = (r_name + r_ptr->name); 
    2539  
    2540         /* Analyze "coin" monsters */ 
    2541         if (r_ptr->d_char == '$') 
    2542         { 
    2543                 /* Look for textual clues */ 
    2544                 if (strstr(name, " copper ")) return (SV_COPPER); 
    2545                 if (strstr(name, " silver ")) return (SV_SILVER); 
    2546                 if (strstr(name, " gold ")) return (SV_GOLD); 
    2547                 if (strstr(name, " mithril ")) return (SV_MITHRIL); 
    2548                 if (strstr(name, " adamantite ")) return (SV_ADAMANTITE); 
    2549  
    2550                 /* Look for textual clues */ 
    2551                 if (strstr(name, "Copper ")) return (SV_COPPER); 
    2552                 if (strstr(name, "Silver ")) return (SV_SILVER); 
    2553                 if (strstr(name, "Gold ")) return (SV_GOLD); 
    2554                 if (strstr(name, "Mithril ")) return (SV_MITHRIL); 
    2555                 if (strstr(name, "Adamantite ")) return (SV_ADAMANTITE); 
    2556         } 
     2536        const char *name = (r_name + r_ptr->name); 
     2537 
     2538        /* Look for textual clues */ 
     2539        if (my_stristr(name, "copper "))        return SV_COPPER; 
     2540        if (my_stristr(name, "silver "))        return SV_SILVER; 
     2541        if (my_stristr(name, "gold "))          return SV_GOLD; 
     2542        if (my_stristr(name, "mithril "))       return SV_MITHRIL; 
     2543        if (my_stristr(name, "adamantite "))    return SV_ADAMANTITE; 
    25572544 
    25582545        /* Assume nothing */ 
    2559         return (SV_GOLD_ANY)
     2546        return SV_GOLD_ANY
    25602547} 
    25612548