Changeset 321

Show
Ignore:
Timestamp:
07/10/07 20:32:26 (2 years ago)
Author:
takkaria
Message:

Move potions across to the new effect code. (#234)

Files:

Legend:

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

    r320 r321  
    255255A:15/1 
    256256F:EASY_KNOW 
    257 E:CW_SERIOUS 
     257E:CURE_SERIOUS 
    258258 
    259259 
     
    18031803I:75:2:400 
    18041804W:0:0:4:2 
    1805 A:0/1 
    1806 P:0:1d1:0:0:0 
    1807 F:EASY_KNOW 
    1808 D:It has no effect apart from providing nourishment (for about 200 turns 
    1809 D: under normal conditions). 
    1810 D:  Note: These are always Icky Green Potions. 
     1805P:0:1d1:0:0:0 
     1806F:EASY_KNOW 
     1807E:DRINK_GOOD 
    18111808 
    18121809N:223:Apple Juice 
     
    18141811I:75:1:250 
    18151812W:0:0:4:1 
    1816 A:0/1 
    1817 P:0:1d1:0:0:0 
    1818 F:EASY_KNOW 
    1819 D:It has no effect apart from providing nourishment (for about 125 turns 
    1820 D: under normal conditions). 
    1821 D:  Note: These are always Light Brown Potions. 
     1813P:0:1d1:0:0:0 
     1814F:EASY_KNOW 
     1815E:DRINK_GOOD 
    18221816 
    18231817N:224:Water 
     
    18251819I:75:0:200 
    18261820W:0:0:4:1 
    1827 A:0/1 
    1828 P:0:1d1:0:0:0 
    1829 F:EASY_KNOW 
    1830 D:It has no effect apart from providing nourishment (for about 100 turns 
    1831 D: under normal conditions). 
    1832 D:  Note: These are always Clear Potions. 
     1821P:0:1d1:0:0:0 
     1822F:EASY_KNOW 
     1823E:DRINK_GOOD 
    18331824 
    18341825N:225:Strength 
     
    18391830P:0:1d1:0:0:0 
    18401831F:EASY_KNOW 
    1841 D:It first acts as a Potion of Restore Strength, then permanently 
    1842 D: increases strength. 
     1832E:GAIN_STR 
    18431833 
    18441834N:226:Weakness 
     
    18491839P:0:1d1:0:0:0 
    18501840F:EASY_KNOW 
    1851 D:It reduces strength (unless you have sustain strength). 
     1841E:LOSE_STR 
    18521842 
    18531843N:227:Restore Strength 
     
    18581848P:0:1d1:0:0:0 
    18591849F:EASY_KNOW 
    1860 D:It restores strength to maximum if it is currently below maximum. 
     1850E:RESTORE_STR 
    18611851 
    18621852N:228:Intelligence 
     
    18671857P:0:1d1:0:0:0 
    18681858F:EASY_KNOW 
    1869 D:It first acts as a Potion of Restore Intelligence, then permanently 
    1870 D: increases intelligence. 
     1859E:GAIN_INT 
    18711860 
    18721861N:229:Stupidity 
     
    18771866P:0:1d1:0:0:0 
    18781867F:EASY_KNOW 
    1879 D:It reduces intelligence (unless you have sustain intelligence). 
     1868E:LOSE_INT 
    18801869 
    18811870N:230:Restore Intelligence 
     
    18861875P:0:1d1:0:0:0 
    18871876F:EASY_KNOW 
    1888 D:It restores intelligence to maximum if it is currently below maximum. 
     1877E:RESTORE_INT 
    18891878 
    18901879N:231:Wisdom 
     
    18951884P:0:1d1:0:0:0 
    18961885F:EASY_KNOW 
    1897 D:It first acts as a Potion of Restore Wisdom, then permanently 
    1898 D: increases wisdom. 
     1886E:GAIN_WIS 
    18991887 
    19001888N:232:Naivety 
     
    19051893P:0:1d1:0:0:0 
    19061894F:EASY_KNOW 
    1907 D:It reduces wisdom (unless you have sustain wisdom). 
     1895E:LOSE_WIS 
    19081896 
    19091897N:233:Restore Wisdom 
     
    19141902P:0:1d1:0:0:0 
    19151903F:EASY_KNOW 
    1916 D:It restores wisdom to maximum if it is currently below maximum. 
     1904E:RESTORE_WIS 
    19171905 
    19181906N:234:Charisma 
     
    19231911P:0:1d1:0:0:0 
    19241912F:EASY_KNOW 
    1925 D:It first acts as a Potion of Restore Charisma, then permanently 
    1926 D: increases charisma. 
     1913E:GAIN_CHR 
    19271914 
    19281915N:235:Ugliness 
     
    19331920P:0:1d1:0:0:0 
    19341921F:EASY_KNOW 
    1935 D:It reduces charisma (unless you have sustain charisma). 
     1922E:LOSE_CHR 
    19361923 
    19371924N:236:Restore Charisma 
     
    19421929P:0:1d1:0:0:0 
    19431930F:EASY_KNOW 
    1944 D:It restores charisma to maximum if it is currently below maximum. 
     1931E:RESTORE_CHR 
    19451932 
    19461933N:237:Cure Light Wounds 
     
    19511938P:0:1d1:0:0:0 
    19521939F:EASY_KNOW 
    1953 D:It cures 2d8 points of damage, heals 10 points worth of cuts, and 
    1954 D: cures blindness. 
    1955 D:  It also provides nourishment for about 25 turns under normal 
    1956 D: conditions. 
     1940E:CURE_LIGHT 
    19571941 
    19581942N:238:Clumsiness 
     
    19631947P:0:1d1:0:0:0 
    19641948F:EASY_KNOW 
    1965 D:It reduces dexterity (unless you have sustain dexterity). 
     1949E:LOSE_DEX 
    19661950 
    19671951N:239:Sickliness 
     
    19721956P:0:1d1:0:0:0 
    19731957F:EASY_KNOW 
    1974 D:It reduces constitution (unless you have sustain constitution). 
     1958E:LOSE_CON 
    19751959 
    19761960N:240:Cure Serious Wounds 
     
    19811965P:0:1d1:0:0:0 
    19821966F:EASY_KNOW 
    1983 D:It cures 4d8 points of damage, heals half of all cut damage plus 
    1984 D: another 50 points, and cures blindness and confusion. 
    1985 D:  It also provides nourishment for about 50 turns under normal 
    1986 D: conditions. 
     1967E:CURE_SERIOUS 
    19871968 
    19881969N:241:Cure Critical Wounds 
     
    19931974P:0:1d1:0:0:0 
    19941975F:EASY_KNOW 
    1995 D:It cures 6d8 points of damage, cures all stunning, heals all cut 
    1996 D: damage, neutralizes poison, and cures blindness and confusion. 
    1997 D:  It also provides nourishment for about 50 turns under normal 
    1998 D: conditions. 
     1976E:CURE_CRITICAL 
    19991977 
    20001978N:242:Healing 
     
    20051983P:0:1d1:0:0:0 
    20061984F:EASY_KNOW 
    2007 D:It cures 300 points of damage, cures all stunning, heals all cut 
    2008 D: damage, neutralizes poison, and cures blindness and confusion. 
    2009 D:  It also provides nourishment for about 100 turns under normal 
    2010 D: conditions. 
     1985E:CURE_FULL 
    20111986 
    20121987N:243:Constitution 
     
    20171992P:0:1d1:0:0:0 
    20181993F:EASY_KNOW 
    2019 D:It first acts as a Potion of Restore Constitution, then permanently 
    2020 D: increases constitution. 
     1994E:GAIN_CON 
    20211995 
    20221996N:244:Experience 
     
    20272001P:0:1d1:0:0:0 
    20282002F:EASY_KNOW 
    2029 D:It grants either 100000 experience points or half the current 
    2030 D: experience point total plus 10, whichever is less. 
     2003E:GAIN_EXP 
    20312004 
    20322005N:245:Sleep 
     
    20372010P:0:1d1:0:0:0 
    20382011F:EASY_KNOW 
    2039 D:It induces paralyzation for 3+1d4 turns, unless you have free action. 
    2040 D:  It also provides nourishment for about 50 turns under normal 
    2041 D: conditions. 
     2012E:PARALYZE 
    20422013 
    20432014N:246:Blindness 
     
    20482019P:0:1d1:0:0:0 
    20492020F:EASY_KNOW 
    2050 D:It induces blindness for 99+1d100 turns, unless you have resistance to 
    2051 D: blindness. 
     2021E:BLIND 
    20522022 
    20532023N:247:Confusion 
     
    20582028P:0:1d1:0:0:0 
    20592029F:EASY_KNOW 
    2060 D:It induces confusion for 14+1d20 turns, unless you have resistance to 
    2061 D: confusion. 
    2062 D:  It also provides nourishment for about 25 turns under normal 
    2063 D: conditions. 
     2030E:CONFUSE 
    20642031 
    20652032N:248:Poison 
     
    20702037P:0:1d1:0:0:0 
    20712038F:EASY_KNOW 
    2072 D:It poisons you (adding 9+1d15 points to the poison counter), unless 
    2073 D: you have resistance to poison. 
     2039E:POISON 
    20742040 
    20752041N:249:Speed 
     
    20802046P:0:1d1:0:0:0 
    20812047F:EASY_KNOW 
    2082 D:It hastes you (+10 to speed) for 15+1d25 turns (or 5 additional turns 
    2083 D: if you already are under the effect of a temporary haste 
    2084 D: enchantment). 
     2048E:HASTE 
    20852049 
    20862050N:250:Slowness 
     
    20912055P:0:1d1:0:0:0 
    20922056F:EASY_KNOW 
    2093 D:It slows you down (-10 to speed) for 15+1d25 turns; this duration is 
    2094 D: cumulative with other temporary slowing enchantments. 
    2095 D:  It also provides nourishment for about 25 turns under normal 
    2096 D: conditions. 
     2057E:SLOW 
    20972058 
    20982059N:251:Dexterity 
     
    21032064P:0:1d1:0:0:0 
    21042065F:EASY_KNOW 
    2105 D:It first acts as a Potion of Restore Dexterity, then permanently 
    2106 D: increases dexterity. 
     2066E:GAIN_DEX 
    21072067 
    21082068N:252:Restore Dexterity 
     
    21132073P:0:1d1:0:0:0 
    21142074F:EASY_KNOW 
    2115 D:It restores dexterity to maximum if it is currently below maximum. 
     2075E:RESTORE_DEX 
    21162076 
    21172077N:253:Restore Constitution 
     
    21222082P:0:1d1:0:0:0 
    21232083F:EASY_KNOW 
    2124 D:It restores constution to maximum if it is currently below maximum. 
     2084E:RESTORE_CON 
    21252085 
    21262086N:254:Lose Memories 
     
    21312091P:0:1d1:0:0:0 
    21322092F:EASY_KNOW 
    2133 D:It drains 25% of your experience total, unless you have hold life. 
     2093E:LOSE_EXP 
    21342094 
    21352095N:255:Salt Water 
     
    21402100P:0:1d1:0:0:0 
    21412101F:EASY_KNOW 
    2142 D:It induces vomiting, which will result in severe hunger but will also 
    2143 D: clear away all poison. 
    2144 D:  This will also cause 4 turns of paralysis, even if you have free 
    2145 D: action. 
     2102E:DRINK_SALT 
    21462103 
    21472104N:256:Enlightenment 
     
    21522109P:0:1d1:0:0:0 
    21532110F:EASY_KNOW 
    2154 D:It completely lights up and magically maps the current dungeon level. 
     2111E:ENLIGHTENMENT 
    21552112 
    21562113N:257:Heroism 
     
    21612118P:0:1d1:0:0:0 
    21622119F:EASY_KNOW 
    2163 D:It cures 10 points of damage, removes fear and grants you heroism 
    2164 D: (resistance to fear, and a bonus of +12 to-hit) for 25+1d25 turns. 
     2120E:HERO 
    21652121 
    21662122N:258:Berserk Strength 
     
    21712127P:0:1d1:0:0:0 
    21722128F:EASY_KNOW 
    2173 D:It cures 30 points of damage, removes fear and grants you berserk 
    2174 D: strength (resistance to fear, a bonus of +12 to-hit, and a penalty of 
    2175 D: -10 to AC) for 25+1d25 turns. 
     2129E:SHERO 
    21762130 
    21772131N:259:Boldness 
     
    21822136P:0:1d1:0:0:0 
    21832137F:EASY_KNOW 
    2184 D:It removes fear. 
     2138E:CURE_PARANOIA 
    21852139 
    21862140N:260:Restore Life Levels 
     
    21912145P:0:1d1:0:0:0 
    21922146F:EASY_KNOW 
    2193 D:It restores experience to maximum if it is currently below maximum. 
     2147E:RESTORE_EXP 
    21942148 
    21952149N:261:Resist Heat 
     
    22002154P:0:1d1:0:0:0 
    22012155F:EASY_KNOW 
    2202 D:It grants you temporary resistance to fire for 10+1d10 turns. 
    2203 D:  Temporary resistance is cumulative with permanent resistance, if one 
    2204 D: of your equipped items provides that.  The duration is cumulative 
    2205 D: with other magic providing temporary fire resistance. 
     2156E:RESIST_FIRE 
    22062157 
    22072158N:262:Resist Cold 
     
    22122163P:0:1d1:0:0:0 
    22132164F:EASY_KNOW 
    2214 D:It grants you temporary resistance to cold for 10+1d10 turns. 
    2215 D:  Temporary resistance is cumulative with permanent resistance, if one 
    2216 D: of your equipped items provides that.  The duration is cumulative 
    2217 D: with other magic providing temporary cold resistance. 
    2218  
    2219 N:263:Detect Invisible 
     2165E:RESIST_COLD 
     2166 
     2167N:263:See Invisible 
    22202168G:!:d 
    22212169I:75:25:0 
     
    22242172P:0:1d1:0:0:0 
    22252173F:EASY_KNOW 
    2226 D:It enables you to see invisible creatures for 12+1d12 turns. 
     2174E:TMD_SINVIS 
    22272175 
    22282176N:264:Slow Poison 
     
    22332181P:0:1d1:0:0:0 
    22342182F:EASY_KNOW 
    2235 D:It halves the severity of any current poisoning. 
     2183E:CURE_POISON2 
    22362184 
    22372185N:265:Neutralize Poison 
     
    22422190P:0:1d1:0:0:0 
    22432191F:EASY_KNOW 
    2244 D:It neutralizes poison. 
     2192E:CURE_POISON 
    22452193 
    22462194N:266:Restore Mana 
     
    22512199P:0:1d1:0:0:0 
    22522200F:EASY_KNOW 
    2253 D:It restores mana points to maximum if they are currently below 
    2254 D: maximum. 
     2201E:RESTORE_MANA 
    22552202 
    22562203N:267:Infravision 
     
    22612208P:0:1d1:0:0:0 
    22622209F:EASY_KNOW 
    2263 D:It extends the radius of your infravision by 50 feet for 100+1d100 
    2264 D: turns. 
     2210E:TMD_INFRA 
    22652211 
    22662212## XXX 268 XXX ## 
     
    36523598P:0:1d1:0:0:0 
    36533599F:EASY_KNOW 
    3654 D:It inflicts 5000 points of damage. 
    3655 D:  Death can only be avoided if you have magical invulnerability, which 
    3656 D: just happens to be unavailable in the current version of Angband. 
     3600E:DRINK_DEATH 
    36573601 
    36583602N:416:Ruination 
     
    36633607P:0:1d1:0:0:0 
    36643608F:EASY_KNOW 
    3665 D:It inflicts 10d10 points of damage and permanently decreases all stats 
    3666 D: (even if you have stat sustains). 
     3609E:DRINK_RUIN 
    36673610 
    36683611N:417:Detonations 
     
    36733616P:0:25d25:0:0:0 
    36743617F:EASY_KNOW 
    3675 D:It inflicts 50d20 points of damage from massive explosions, severe 
    3676 D: cuts (+5000 to the cut counter), and stunning (+75 to the stun 
    3677 D: counter). 
    3678 D:  It can also be thrown for 25d25 points of damage. 
     3618E:DRINK_DETONATE 
    36793619 
    36803620N:418:Augmentation 
     
    36853625P:0:1d1:0:0:0 
    36863626F:EASY_KNOW 
    3687 D:It first restores to maximum any stats below maximum, then permanently 
    3688 D: increases all stats. 
     3627E:GAIN_ALL 
    36893628 
    36903629N:419:*Healing* 
     
    36953634P:0:1d1:0:0:0 
    36963635F:EASY_KNOW 
    3697 D:It cures 1200 points of damage, cures all stunning, heals all cut 
    3698 D: damage, neutralizes poison, and cures blindness and confusion. 
     3636E:CURE_FULL2 
    36993637 
    37003638N:420:Life 
     
    37053643P:0:1d1:0:0:0 
    37063644F:EASY_KNOW 
    3707 D:It restores experience and all stats to maximum, cures 5000 points of 
    3708 D: damage, cures all stunning, heals all cut damage, neutralizes poison, 
    3709 D: stops hallucination, and cures blindness and confusion. 
     3645E:CURE_NONORLYBIG 
    37103646 
    37113647N:421:Self Knowledge 
     
    37163652P:0:1d1:0:0:0 
    37173653F:EASY_KNOW 
    3718 D:It grants knowledge of all special powers (whether intrinsic, 
    3719 D: temporary, or provided by a magical item) that you currently possess. 
     3654E:SELF_KNOW 
    37203655 
    37213656N:422:*Enlightenment* 
     
    37263661P:0:1d1:0:0:0 
    37273662F:EASY_KNOW 
    3728 D:It has the powers of the Potions of Enlightenment, Intelligence, 
    3729 D: Wisdom, and Self Knowledge; also identifies all items you are 
    3730 D: carrying, and detects all treasure, objects, secret doors, stairs, 
    3731 D: and traps in the immediate area. 
     3663E:ENLIGHTENMENT2 
    37323664 
    37333665##### Items 423 to 430 are new amulets thought up by JLE ##### 
  • trunk/src/cmd6.c

    r320 r321  
    1818 */ 
    1919#include "angband.h" 
     20#include "effects.h" 
    2021#include "script.h" 
    2122 
     
    185186        int item; 
    186187        object_type *o_ptr; 
     188        int effect; 
    187189        bool ident = FALSE, used; 
    188190        int dir = 5; 
     
    196198        else o_ptr = &o_list[0 - item]; 
    197199 
     200        /* Figure out effect to use */ 
     201        if (o_ptr->name1) 
     202                effect = a_info[o_ptr->name1].effect; 
     203        else 
     204                effect = k_info[o_ptr->k_idx].effect; 
     205 
    198206        /* If the item requires a direction, get one (allow cancelling) */ 
    199         if ((o_ptr->tval == TV_WAND) ||  
     207        if (effect_aim(effect) || 
     208            (o_ptr->tval == TV_WAND) || 
    200209            (o_ptr->tval == TV_ROD && (o_ptr->sval >= SV_ROD_MIN_DIRECTION || !object_aware_p(o_ptr)))) 
    201210        { 
     
    215224        } 
    216225 
    217         /* Make a noise! */ 
    218         sound(snd); 
    219  
    220         /* Use the object */ 
    221         used = use_object(o_ptr, &ident, dir); 
     226        /* Special message for artifacts */ 
     227        if (artifact_p(o_ptr)) 
     228        { 
     229                message(snd, 0, "You activate it."); 
     230                msg_print(a_text + a_info[o_ptr->name1].effect_msg); 
     231        } 
     232        else 
     233        { 
     234                /* Make a noise! */ 
     235                sound(snd); 
     236        } 
     237 
     238        /* Use the object */ 
     239        if (effect) 
     240        { 
     241                /* Do effect */ 
     242        used = do_effect(effect, &ident, dir); 
     243 
     244                /* Food feeds the player */ 
     245                if (o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) 
     246                        (void)set_food(p_ptr->food + o_ptr->pval); 
     247        } 
     248        else 
     249        { 
     250                /* Use the more prosaic method */ 
     251                used = use_object(o_ptr, &ident, dir); 
     252        } 
     253 
    222254        if (!used && !ident) return; 
    223255 
     
    389421 
    390422        /* Use the object */ 
    391         do_cmd_use("Activate which item? ", "You have nothing to activate.", USE_EQUIP, MSG_GENERIC, USE_TIMEOUT); 
    392 } 
     423        do_cmd_use("Activate which item? ", "You have nothing to activate.", USE_EQUIP, MSG_ACT_ARTIFACT, USE_TIMEOUT); 
     424} 
  • trunk/src/effects.c

    r320 r321  
    5959 
    6060 
    61  
    6261/* 
    6362 * Do an effect, given an object. 
    6463 */ 
    65 bool do_effect(object_type *o_ptr, bool *ident, int dir) 
     64bool do_effect(int effect, bool *ident, int dir) 
    6665{ 
    67         effect_type effect = k_info[o_ptr->k_idx].effect; 
    6866        int py = p_ptr->py; 
    6967        int px = p_ptr->px; 
    7068 
    71         if (o_ptr->name1) 
    72                 effect = a_info[o_ptr->name1].effect; 
     69        if (effect < 1 || effect > EF_MAX) 
     70        { 
     71                msg_print("Bad effect passed to do_effect().  Please report this bug."); 
     72                return FALSE; 
     73        } 
    7374 
    7475        switch (effect) 
     
    7879                        if (!(p_ptr->resist_pois || p_ptr->timed[TMD_OPP_POIS])) 
    7980                        { 
    80                                 if (inc_timed(TMD_POISONED, rand_int(10) + 10)) 
     81                                if (inc_timed(TMD_POISONED, damroll(2, 7) + 10)) 
    8182                                        *ident = TRUE; 
    8283                        } 
     
    8788                case EF_BLIND: 
    8889                { 
    89                         if (!p_ptr->resist_blind && inc_timed(TMD_BLIND, rand_int(200) + 200)) 
     90                        if (!p_ptr->resist_blind && inc_timed(TMD_BLIND, damroll(4, 25) + 75)) 
    9091                                *ident = TRUE; 
    9192 
     
    103104                case EF_CONFUSE: 
    104105                { 
    105                         if (!p_ptr->resist_confu && inc_timed(TMD_CONFUSED, rand_int(10) + 10)) 
     106                        if (!p_ptr->resist_confu && inc_timed(TMD_CONFUSED, damroll(4, 5) + 10)) 
    106107                                *ident = TRUE; 
    107108 
     
    119120                case EF_PARALYZE: 
    120121                { 
    121                         if (!p_ptr->free_act && inc_timed(TMD_PARALYZED, rand_int(10) + 10)) 
    122                                 *ident = TRUE; 
    123  
    124                         return TRUE; 
     122                        if (!p_ptr->free_act && inc_timed(TMD_PARALYZED, rand_int(5) + 5)) 
     123                                *ident = TRUE; 
     124 
     125                        return TRUE; 
     126                } 
     127 
     128                case EF_SLOW: 
     129                { 
     130                        if (inc_timed(TMD_SLOW, randint(25) + 15)) *ident = TRUE; 
     131                        break; 
     132                } 
     133 
     134                case EF_CURE_POISON: 
     135                { 
     136                        if (clear_timed(TMD_POISONED)) *ident = TRUE; 
     137                        return TRUE; 
     138                } 
     139 
     140                case EF_CURE_POISON2: 
     141                { 
     142                        if (set_timed(TMD_POISONED, p_ptr->timed[TMD_POISONED] / 2)) *ident = TRUE; 
     143                        return TRUE; 
     144                } 
     145 
     146                case EF_CURE_BLINDNESS: 
     147                { 
     148                        if (clear_timed(TMD_BLIND)) *ident = TRUE; 
     149                        return TRUE; 
     150                } 
     151 
     152                case EF_CURE_PARANOIA: 
     153                { 
     154                        if (clear_timed(TMD_AFRAID)) *ident = TRUE; 
     155                        return TRUE; 
     156                } 
     157 
     158                case EF_CURE_CONFUSION: 
     159                { 
     160                        if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 
     161                        return TRUE; 
     162                } 
     163 
     164                case EF_CURE_LIGHT: 
     165                { 
     166                        if (hp_player(damroll(2, 8))) *ident = TRUE; 
     167                        if (clear_timed(TMD_BLIND)) *ident = TRUE; 
     168                        if (dec_timed(TMD_CUT, 10)) *ident = TRUE; 
     169                        break; 
     170                } 
     171 
     172                case EF_CURE_SERIOUS: 
     173                { 
     174                        if (hp_player(damroll(4, 8))) *ident = TRUE; 
     175                        if (set_timed(TMD_CUT, (p_ptr->timed[TMD_CUT] / 2) - 50)) *ident = TRUE; 
     176                        if (clear_timed(TMD_BLIND)) *ident = TRUE; 
     177                        if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 
     178 
     179                        return TRUE; 
     180                } 
     181 
     182                case EF_CURE_CRITICAL: 
     183                { 
     184                        if (hp_player(damroll(6, 8))) *ident = TRUE; 
     185                        if (clear_timed(TMD_BLIND)) *ident = TRUE; 
     186                        if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 
     187                        if (clear_timed(TMD_POISONED)) *ident = TRUE; 
     188                        if (clear_timed(TMD_STUN)) *ident = TRUE; 
     189                        if (clear_timed(TMD_CUT)) *ident = TRUE; 
     190                        if (clear_timed(TMD_AMNESIA)) *ident = TRUE; 
     191                        return TRUE; 
     192                } 
     193 
     194                case EF_CURE_FULL: 
     195                { 
     196                        if (hp_player(300)) *ident = TRUE; 
     197                        if (clear_timed(TMD_BLIND)) *ident = TRUE; 
     198                        if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 
     199                        if (clear_timed(TMD_POISONED)) *ident = TRUE; 
     200                        if (clear_timed(TMD_STUN)) *ident = TRUE; 
     201                        if (clear_timed(TMD_CUT)) *ident = TRUE; 
     202                        if (clear_timed(TMD_AMNESIA)) *ident = TRUE; 
     203                        return TRUE; 
     204                } 
     205 
     206                case EF_CURE_FULL2: 
     207                { 
     208                        if (hp_player(1200)) *ident = TRUE; 
     209                        if (clear_timed(TMD_BLIND)) *ident = TRUE; 
     210                        if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 
     211                        if (clear_timed(TMD_POISONED)) *ident = TRUE; 
     212                        if (clear_timed(TMD_STUN)) *ident = TRUE; 
     213                        if (clear_timed(TMD_CUT)) *ident = TRUE; 
     214                        if (clear_timed(TMD_AMNESIA)) *ident = TRUE; 
     215                        return TRUE; 
     216                } 
     217 
     218 
     219                case EF_GAIN_EXP: 
     220                { 
     221                        if (p_ptr->exp < PY_MAX_EXP) 
     222                        { 
     223                                s32b ee = (p_ptr->exp / 2) + 10; 
     224                                if (ee > 100000L) ee = 100000L; 
     225                                msg_print("You feel more experienced."); 
     226                                gain_exp(ee); 
     227                                *ident = TRUE; 
     228                        } 
     229                        return TRUE; 
     230                } 
     231 
     232                case EF_LOSE_EXP: 
     233                { 
     234                        if (!p_ptr->hold_life && (p_ptr->exp > 0)) 
     235                        { 
     236                                msg_print("You feel your memories fade."); 
     237                                lose_exp(p_ptr->exp / 4); 
     238                                *ident = TRUE; 
     239                        } 
     240                        return TRUE; 
     241                } 
     242 
     243                case EF_RESTORE_EXP: 
     244                { 
     245                        if (restore_level()) *ident = TRUE; 
     246                        return TRUE; 
     247                } 
     248 
     249                case EF_RESTORE_MANA: 
     250                { 
     251                        if (p_ptr->csp < p_ptr->msp) 
     252                        { 
     253                                p_ptr->csp = p_ptr->msp; 
     254                                p_ptr->csp_frac = 0; 
     255                                msg_print("Your feel your head clear."); 
     256                                p_ptr->redraw |= (PR_MANA); 
     257                                p_ptr->window |= (PW_PLAYER_0 | PW_PLAYER_1); 
     258                                *ident = TRUE; 
     259                        } 
     260                        return TRUE; 
     261                } 
     262 
     263                case EF_GAIN_STR: 
     264                case EF_GAIN_INT: 
     265                case EF_GAIN_WIS: 
     266                case EF_GAIN_DEX: 
     267                case EF_GAIN_CON: 
     268                case EF_GAIN_CHR: 
     269                { 
     270                        int stat = effect - EF_GAIN_STR; 
     271                        if (do_inc_stat(stat)) *ident = TRUE; 
     272                        return TRUE; 
     273                } 
     274 
     275                case EF_GAIN_ALL: 
     276                { 
     277                        if (do_inc_stat(A_STR)) *ident = TRUE; 
     278                        if (do_inc_stat(A_INT)) *ident = TRUE; 
     279                        if (do_inc_stat(A_WIS)) *ident = TRUE; 
     280                        if (do_inc_stat(A_DEX)) *ident = TRUE; 
     281                        if (do_inc_stat(A_CON)) *ident = TRUE; 
     282                        if (do_inc_stat(A_CHR)) *ident = TRUE; 
     283                        break; 
    125284                } 
    126285 
    127286                case EF_LOSE_STR: 
    128                 { 
    129                         take_hit(damroll(6, 6), "poisonous food"); 
    130                         (void)do_dec_stat(A_STR); 
     287                case EF_LOSE_INT: 
     288                case EF_LOSE_WIS: 
     289                case EF_LOSE_DEX: 
     290                case EF_LOSE_CON: 
     291                case EF_LOSE_CHR: 
     292                { 
     293                        int stat = effect - EF_LOSE_STR; 
     294 
     295                        take_hit(damroll(5, 5), "stat drain"); 
     296                        (void)do_dec_stat(stat); 
    131297                        *ident = TRUE; 
    132298 
     
    143309                } 
    144310 
    145                 case EF_LOSE_CON: 
    146                 { 
    147                         take_hit(damroll(6, 6), "poisonous food"); 
    148                         (void)do_dec_stat(A_CON); 
    149                         *ident = TRUE; 
    150  
    151                         return TRUE; 
    152                 } 
    153  
    154311                case EF_LOSE_CON2: 
    155312                { 
     
    161318                } 
    162319 
    163                 case EF_LOSE_INT: 
    164                 { 
    165                         take_hit(damroll(8, 8), "poisonous food"); 
    166                         (void)do_dec_stat(A_INT); 
    167                         *ident = TRUE; 
    168  
    169                         return TRUE; 
    170                 } 
    171  
    172                 case EF_LOSE_WIS: 
    173                 { 
    174                         take_hit(damroll(8, 8), "poisonous food"); 
    175                         (void)do_dec_stat(A_WIS); 
    176                         *ident = TRUE; 
    177  
    178                         return TRUE; 
    179                 } 
    180  
    181                 case EF_CURE_POISON: 
    182                 { 
    183                         if (clear_timed(TMD_POISONED)) *ident = TRUE; 
    184                         return TRUE; 
    185                 } 
    186  
    187                 case EF_CURE_BLINDNESS: 
    188                 { 
    189                         if (clear_timed(TMD_BLIND)) *ident = TRUE; 
    190                         return TRUE; 
    191                 } 
    192  
    193                 case EF_CURE_PARANOIA: 
    194                 { 
    195                         if (clear_timed(TMD_AFRAID)) *ident = TRUE; 
    196                         return TRUE; 
    197                 } 
    198  
    199                 case EF_CURE_CONFUSION: 
    200                 { 
    201                         if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 
    202                         return TRUE; 
    203                 } 
    204  
    205                 case EF_CW_SERIOUS: 
    206                 { 
    207                         if (hp_player(damroll(4, 8))) *ident = TRUE; 
    208                         if (set_timed(TMD_CUT, (p_ptr->timed[TMD_CUT] / 2) - 50)) *ident = TRUE; 
    209                         return TRUE; 
    210                 } 
    211  
    212320                case EF_RESTORE_STR: 
    213                 { 
    214                         if (do_res_stat(A_STR)) *ident = TRUE; 
    215                         return TRUE; 
    216                 } 
    217  
     321                case EF_RESTORE_INT: 
     322                case EF_RESTORE_WIS: 
     323                case EF_RESTORE_DEX: 
    218324                case EF_RESTORE_CON: 
    219                 { 
    220                         if (do_res_stat(A_CON)) *ident = TRUE; 
    221                         return TRUE; 
     325                case EF_RESTORE_CHR: 
     326                { 
     327                        int stat = effect - EF_RESTORE_STR; 
     328                        if (do_res_stat(stat)) *ident = TRUE; 
     329                        return TRUE; 
     330                } 
     331 
     332                case EF_CURE_NONORLYBIG: 
     333                { 
     334                        msg_print("You feel life flow through your body!"); 
     335                        restore_level(); 
     336                        (void)clear_timed(TMD_POISONED); 
     337                        (void)clear_timed(TMD_BLIND); 
     338                        (void)clear_timed(TMD_CONFUSED); 
     339                        (void)clear_timed(TMD_IMAGE); 
     340                        (void)clear_timed(TMD_STUN); 
     341                        (void)clear_timed(TMD_CUT); 
     342                        (void)clear_timed(TMD_AMNESIA); 
     343 
     344                        /* Recalculate max. hitpoints */ 
     345                        update_stuff(); 
     346 
     347                        hp_player(5000); 
     348 
     349                        *ident = TRUE; 
     350 
     351                        /* Now restore all */ 
    222352                } 
    223353 
     
    233363                } 
    234364 
     365 
     366                case EF_TMD_INFRA: 
     367                { 
     368                        if (inc_timed(TMD_SINFRA, 100 + damroll(4, 25))) 
     369                                *ident = TRUE; 
     370                        return TRUE; 
     371                } 
     372 
     373                case EF_TMD_SINVIS: 
     374                { 
     375                        if (inc_timed(TMD_SINVIS, 12 + damroll(2, 6))) 
     376                                *ident = TRUE; 
     377                        return TRUE; 
     378                } 
     379 
     380                case EF_ENLIGHTENMENT: 
     381                { 
     382                        msg_print("An image of your surroundings forms in your mind..."); 
     383                        wiz_lite(); 
     384                        *ident = TRUE; 
     385                        break; 
     386                } 
     387 
     388 
     389                case EF_ENLIGHTENMENT2: 
     390                { 
     391                        msg_print("You begin to feel more enlightened..."); 
     392                        message_flush(); 
     393                        wiz_lite(); 
     394                        (void)do_inc_stat(A_INT); 
     395                        (void)do_inc_stat(A_WIS); 
     396                        (void)detect_traps(); 
     397                        (void)detect_doors(); 
     398                        (void)detect_stairs(); 
     399                        (void)detect_treasure(); 
     400                        (void)detect_objects_gold(); 
     401                        (void)detect_objects_normal(); 
     402                        identify_pack(); 
     403                        self_knowledge(TRUE); 
     404                        *ident = TRUE; 
     405                        break; 
     406                } 
     407 
     408                case EF_SELF_KNOW: 
     409                { 
     410                        msg_print("You begin to know yourself a little better..."); 
     411                        message_flush(); 
     412                        self_knowledge(TRUE); 
     413                        *ident = TRUE; 
     414                        break; 
     415                } 
     416 
     417 
     418                case EF_HERO: 
     419                { 
     420                        if (hp_player(10)) *ident = TRUE; 
     421                        if (clear_timed(TMD_AFRAID)) *ident = TRUE; 
     422                        if (inc_timed(TMD_HERO, randint(25) + 25)) *ident = TRUE; 
     423                        break; 
     424                } 
     425 
     426                case EF_SHERO: 
     427                { 
     428                        if (hp_player(30)) *ident = TRUE; 
     429                        if (clear_timed(TMD_AFRAID)) *ident = TRUE; 
     430                        if (inc_timed(TMD_SHERO, randint(25) + 25)) *ident = TRUE; 
     431                        break; 
     432                } 
     433 
     434 
     435                case EF_RESIST_FIRE: 
     436                { 
     437                        if (inc_timed(TMD_OPP_FIRE, randint(10) + 10)) 
     438                                *ident = TRUE; 
     439                        return TRUE; 
     440                } 
     441 
     442                case EF_RESIST_COLD: 
     443                { 
     444                        if (inc_timed(TMD_OPP_COLD, randint(10) + 10)) 
     445                                *ident = TRUE; 
     446                        return TRUE; 
     447                } 
     448 
     449                case EF_RESIST_ALL: 
     450                { 
     451                        if (inc_timed(TMD_OPP_ACID, randint(20) + 20)) *ident = TRUE; 
     452                        if (inc_timed(TMD_OPP_ELEC, randint(20) + 20)) *ident = TRUE; 
     453                        if (inc_timed(TMD_OPP_FIRE, randint(20) + 20)) *ident = TRUE; 
     454                        if (inc_timed(TMD_OPP_COLD, randint(20) + 20)) *ident = TRUE; 
     455                        if (inc_timed(TMD_OPP_POIS, randint(20) + 20)) *ident = TRUE; 
     456                        return TRUE; 
     457                } 
     458 
     459 
    235460                case EF_ENCHANT_TOHIT: 
    236461                { 
     
    557782                } 
    558783 
    559                 case EF_HASTE2: 
    560                 { 
    561                         *ident = TRUE; 
     784                case EF_HASTE: 
     785