Changeset 680

Show
Ignore:
Timestamp:
02/01/08 05:48:37 (7 months ago)
Author:
takkaria
Message:
  • Stop making rings of Stupidity, Weakness, and Woe.
  • Remove a bunch of redundant code, and allow any/all rings/amulets to be cursed if the game wants to generate a "bad" item. This is liable to be rethought in the future, but right now it's useful for code clarity.
Files:

Legend:

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

    r642 r680  
    12071207I:45:2:-5 
    12081208W:5:0:2:0 
    1209 A:100:5 to 100 
     1209#A:100:5 to 100 
    12101210F:LIGHT_CURSE | STR | HIDE_TYPE 
    12111211 
     
    12441244I:45:0:-5 
    12451245W:50:0:2:0 
    1246 A:100:50 to 100 
     1246#A:100:50 to 100 
    12471247F:LIGHT_CURSE | TELEPORT | WIS | CHR | HIDE_TYPE 
    12481248 
     
    12511251I:45:3:-5 
    12521252W:5:0:2:0 
    1253 A:100:5 to 100 
     1253#A:100:5 to 100 
    12541254F:LIGHT_CURSE | INT | HIDE_TYPE 
    12551255 
  • trunk/src/obj-make.c

    r678 r680  
    551551                        { 
    552552                                /* Hack -- Reverse digging bonus */ 
    553                                 o_ptr->pval = 0 - (o_ptr->pval)
     553                                o_ptr->pval = -o_ptr->pval
    554554                        } 
    555555 
     
    674674static void a_m_aux_3(object_type *o_ptr, int level, int power) 
    675675{ 
     676        if (power < 0) 
     677                o_ptr->flags3 |= TR3_LIGHT_CURSE; 
     678 
    676679        /* Apply magic (good or bad) according to type */ 
    677680        switch (o_ptr->tval) 
     
    693696                                        /* Cursed */ 
    694697                                        if (power < 0) 
    695                                         { 
    696                                                 /* Cursed */ 
    697                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    698  
    699                                                 /* Reverse pval */ 
    700                                                 o_ptr->pval = 0 - (o_ptr->pval); 
    701                                         } 
     698                                                o_ptr->pval = -o_ptr->pval; 
    702699 
    703700                                        break; 
     
    716713                                        if (power < 0) 
    717714                                        { 
    718                                                 /* Cursed */ 
    719                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    720  
    721715                                                /* Reverse pval */ 
    722                                                 o_ptr->pval = 0 - (o_ptr->pval); 
    723  
    724                                                 break; 
     716                                                o_ptr->pval = -o_ptr->pval; 
    725717                                        } 
    726718                                        else 
     
    728720                                                /* Rating boost */ 
    729721                                                rating += 25; 
     722 
     723                                                /* Mention the item */ 
     724                                                if (cheat_peek) object_mention(o_ptr); 
    730725                                        } 
    731  
    732                                         /* Mention the item */ 
    733                                         if (cheat_peek) object_mention(o_ptr); 
    734726 
    735727                                        break; 
     
    744736                                        /* Cursed */ 
    745737                                        if (power < 0) 
    746                                         { 
    747                                                 /* Cursed */ 
    748                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    749  
    750                                                 /* Reverse pval */ 
    751                                                 o_ptr->pval = 0 - (o_ptr->pval); 
    752                                         } 
     738                                                o_ptr->pval = -o_ptr->pval; 
    753739 
    754740                                        break; 
     
    766752                                } 
    767753 
    768                                 /* Weakness, Stupidity */ 
    769                                 case SV_RING_WEAKNESS: 
    770                                 case SV_RING_STUPIDITY: 
    771                                 { 
    772                                         /* Cursed */ 
    773                                         o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    774  
    775                                         /* Penalize */ 
    776                                         o_ptr->pval = 0 - (1 + m_bonus(5, level)); 
    777  
    778                                         break; 
    779                                 } 
    780  
    781                                 /* WOE, Stupidity */ 
    782                                 case SV_RING_WOE: 
    783                                 { 
    784                                         /* Cursed */ 
    785                                         o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    786  
    787                                         /* Penalize */ 
    788                                         o_ptr->to_a = 0 - (5 + m_bonus(10, level)); 
    789                                         o_ptr->pval = 0 - (1 + m_bonus(5, level)); 
    790  
    791                                         break; 
    792                                 } 
    793  
    794754                                /* Ring of damage */ 
    795755                                case SV_RING_DAMAGE: 
     
    800760                                        /* Cursed */ 
    801761                                        if (power < 0) 
    802                                         { 
    803                                                 /* Cursed */ 
    804                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    805  
    806                                                 /* Reverse bonus */ 
    807                                                 o_ptr->to_d = 0 - (o_ptr->to_d); 
    808                                         } 
     762                                                o_ptr->to_d = -o_ptr->to_d; 
    809763 
    810764                                        break; 
     
    819773                                        /* Cursed */ 
    820774                                        if (power < 0) 
    821                                         { 
    822                                                 /* Cursed */ 
    823                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    824  
    825                                                 /* Reverse tohit */ 
    826                                                 o_ptr->to_h = 0 - (o_ptr->to_h); 
    827                                         } 
     775                                                o_ptr->to_h = -o_ptr->to_h; 
    828776 
    829777                                        break; 
     
    838786                                        /* Cursed */ 
    839787                                        if (power < 0) 
    840                                         { 
    841                                                 /* Cursed */ 
    842                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    843  
    844                                                 /* Reverse toac */ 
    845                                                 o_ptr->to_a = 0 - (o_ptr->to_a); 
    846                                         } 
     788                                                o_ptr->to_a = -o_ptr->to_a; 
    847789 
    848790                                        break; 
     
    856798                                        o_ptr->to_h = randint(5) + m_bonus(5, level); 
    857799 
    858                                         /* Cursed */ 
     800                                        /* Cursed -- reverse bonuses */ 
    859801                                        if (power < 0) 
    860802                                        { 
    861                                                 /* Cursed */ 
    862                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    863  
    864                                                 /* Reverse bonuses */ 
    865                                                 o_ptr->to_h = 0 - (o_ptr->to_h); 
    866                                                 o_ptr->to_d = 0 - (o_ptr->to_d); 
     803                                                o_ptr->to_h = -o_ptr->to_h; 
     804                                                o_ptr->to_d = -o_ptr->to_d; 
    867805                                        } 
    868806 
     
    888826                                        /* Cursed */ 
    889827                                        if (power < 0) 
    890                                         { 
    891                                                 /* Cursed */ 
    892                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    893  
    894                                                 /* Reverse bonuses */ 
    895                                                 o_ptr->pval = 0 - (o_ptr->pval); 
    896                                         } 
     828                                                o_ptr->pval = -o_ptr->pval; 
    897829 
    898830                                        break; 
     
    906838                                        /* Cursed */ 
    907839                                        if (power < 0) 
    908                                         { 
    909                                                 /* Cursed */ 
    910                                                 o_ptr->flags3 |= TR3_LIGHT_CURSE; 
    911  
    912                                                 /* Reverse bonuses */ 
    913                                                 o_ptr->pval = 0 - (o_ptr->pval); 
    914                                         } 
     840                                                o_ptr->pval = -o_ptr->pval; 
    915841 
    916842                                        break;