Changeset 24

Show
Ignore:
Timestamp:
03/29/07 13:22:01 (1 year ago)
Author:
takkaria
Message:

Fix #60:

  1. Make player effects an array
  2. Remove duplicated code in xtra2.c
  3. Add inc_timed(), dec_timed, clear_timed() functions to simplify use

Also, up the defines.h version to 3.0.8, and the savefile/edit file version
to 3.0.7.

+641 lines, -1414 lines, -773 net.

Files:

Legend:

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

    r1 r24  
    6565# Version stamp (required) 
    6666 
    67 V:3.0.6 
     67V:3.0.7 
    6868 
    6969 
  • trunk/lib/edit/cost_adj.txt

    r1 r24  
    1717# Version stamp (required) 
    1818 
    19 V:3.0.6 
     19V:3.0.7 
    2020 
    2121 
  • trunk/lib/edit/ego_item.txt

    r1 r24  
    5252# Version stamp (required) 
    5353 
    54 V:3.0.6 
     54V:3.0.7 
    5555 
    5656# 1 (unused) 
  • trunk/lib/edit/flavor.txt

    r1 r24  
    1515# Version stamp (required) 
    1616 
    17 V:3.0.6 
     17V:3.0.7 
    1818 
    1919 
  • trunk/lib/edit/limits.txt

    r1 r24  
    1212# Version stamp (required) 
    1313 
    14 V:3.0.6 
     14V:3.0.7 
    1515 
    1616 
  • trunk/lib/edit/monster.txt

    r1 r24  
    9797# Version stamp (required) 
    9898 
    99 V:3.0.6 
     99V:3.0.7 
    100100 
    101101 
  • trunk/lib/edit/object.txt

    r1 r24  
    8080# Version stamp (required) 
    8181 
    82 V:3.0.6 
     82V:3.0.7 
    8383 
    8484 
  • trunk/lib/edit/p_class.txt

    r1 r24  
    6363# Version stamp (required) 
    6464 
    65 V:3.0.6 
     65V:3.0.7 
    6666 
    6767 
  • trunk/lib/edit/p_hist.txt

    r1 r24  
    3030# Version stamp (required) 
    3131 
    32 V:3.0.6 
     32V:3.0.7 
    3333 
    3434 
  • trunk/lib/edit/p_race.txt

    r1 r24  
    5151# Version stamp (required) 
    5252 
    53 V:3.0.6 
     53V:3.0.7 
    5454 
    5555 
  • trunk/lib/edit/shop_own.txt

    r1 r24  
    1717# Version stamp (required) 
    1818 
    19 V:3.0.6 
     19V:3.0.7 
    2020 
    2121# General Store 
  • trunk/lib/edit/spell.txt

    r1 r24  
    3838# Version stamp (required) 
    3939 
    40 V:3.0.6 
     40V:3.0.7 
    4141 
    4242 
  • trunk/lib/edit/terrain.txt

    r1 r24  
    3636# Version stamp (required) 
    3737 
    38 V:3.0.6 
     38V:3.0.7 
    3939 
    4040 
  • trunk/lib/edit/vault.txt

    r1 r24  
    4747# Version stamp (required) 
    4848 
    49 V:3.0.6 
     49V:3.0.7 
    5050 
    5151 
  • trunk/src/cave.c

    r16 r24  
    473473 
    474474        /* Handle "dark" grids and "blindness" */ 
    475         else if ((p_ptr->blind) || (!(info & CAVE_GLOW))) 
     475        else if ((p_ptr->timed[TMD_BLIND]) || (!(info & CAVE_GLOW))) 
    476476        { 
    477477                /* Use a dark tile */ 
     
    518518 
    519519        /* Handle "blind" */ 
    520         else if (p_ptr->blind
     520        else if (p_ptr->timed[TMD_BLIND]
    521521        { 
    522522                switch (use_graphics) 
     
    748748        s16b m_idx; 
    749749 
    750         s16b image = p_ptr->image
     750        s16b image = p_ptr->timed[TMD_IMAGE]
    751751 
    752752        int floor_num = 0; 
     
    30953095 
    30963096        /* Handle blindness */ 
    3097         if (p_ptr->blind
     3097        if (p_ptr->timed[TMD_BLIND]
    30983098        { 
    30993099                /* Process "new" grids */ 
  • trunk/src/cmd1.c

    r1 r24  
    422422 
    423423        /* Penalize various conditions */ 
    424         if (p_ptr->blind || no_lite()) chance = chance / 10; 
    425         if (p_ptr->confused || p_ptr->image) chance = chance / 10; 
     424        if (p_ptr->timed[TMD_BLIND] || no_lite()) chance = chance / 10; 
     425        if (p_ptr->timed[TMD_CONFUSED] || p_ptr->timed[TMD_IMAGE]) chance = chance / 10; 
    426426 
    427427        /* Search the nearby grids, which are always in bounds */ 
     
    899899 
    900900                                        dam = dam * 2; 
    901                                         (void)set_cut(p_ptr->cut + randint(dam)); 
     901                                        (void)inc_timed(TMD_CUT, randint(dam)); 
    902902                                } 
    903903 
     
    929929 
    930930                                        dam = dam * 2; 
    931                                         (void)set_cut(p_ptr->cut + randint(dam)); 
    932  
    933                                         if (p_ptr->resist_pois || p_ptr->oppose_pois
     931                                        (void)inc_timed(TMD_CUT, randint(dam)); 
     932 
     933                                        if (p_ptr->resist_pois || p_ptr->timed[TMD_OPP_POIS]
    934934                                        { 
    935935                                                msg_print("The poison does not affect you!"); 
     
    938938                                        { 
    939939                                                dam = dam * 2; 
    940                                                 (void)set_poisoned(p_ptr->poisoned + randint(dam)); 
     940                                                (void)inc_timed(TMD_POISONED, randint(dam)); 
    941941                                        } 
    942942                                } 
     
    993993                                dam = damroll(1, 4); 
    994994                                take_hit(dam, name); 
    995                                 (void)set_slow(p_ptr->slow + rand_int(20) + 20); 
     995                                (void)inc_timed(TMD_SLOW, rand_int(20) + 20); 
    996996                        } 
    997997                        else 
     
    10551055                        if (!p_ptr->resist_blind) 
    10561056                        { 
    1057                                 (void)set_blind(p_ptr->blind + rand_int(50) + 25); 
     1057                                (void)inc_timed(TMD_BLIND, rand_int(50) + 25); 
    10581058                        } 
    10591059                        break; 
     
    10651065                        if (!p_ptr->resist_confu) 
    10661066                        { 
    1067                                 (void)set_confused(p_ptr->confused + rand_int(20) + 10); 
     1067                                (void)inc_timed(TMD_CONFUSED, rand_int(20) + 10); 
    10681068                        } 
    10691069                        break; 
     
    10731073                { 
    10741074                        msg_print("You are surrounded by a pungent green gas!"); 
    1075                         if (!p_ptr->resist_pois && !p_ptr->oppose_pois
    1076                         { 
    1077                                 (void)set_poisoned(p_ptr->poisoned + rand_int(20) + 10); 
     1075                        if (!p_ptr->resist_pois && !p_ptr->timed[TMD_OPP_POIS]
     1076                        { 
     1077                                (void)inc_timed(TMD_POISONED, rand_int(20) + 10); 
    10781078                        } 
    10791079                        break; 
     
    10851085                        if (!p_ptr->free_act) 
    10861086                        { 
    1087                                 (void)set_paralyzed(p_ptr->paralyzed + rand_int(10) + 5); 
     1087                                (void)inc_timed(TMD_PARALYZED, rand_int(10) + 5); 
    10881088                        } 
    10891089                        break; 
     
    11421142 
    11431143        /* Handle player fear */ 
    1144         if (p_ptr->afraid
     1144        if (p_ptr->timed[TMD_AFRAID]
    11451145        { 
    11461146                /* Message */ 
  • trunk/src/cmd2.c

    r1 r24  
    290290        { 
    291291                msg_print("A puff of green gas surrounds you!"); 
    292                 if (!(p_ptr->resist_pois || p_ptr->oppose_pois)) 
    293                 { 
    294                         (void)set_poisoned(p_ptr->poisoned + 10 + randint(20)); 
     292                if (!(p_ptr->resist_pois || p_ptr->timed[TMD_OPP_POIS])) 
     293                { 
     294                        (void)inc_timed(TMD_POISONED, 10 + randint(20)); 
    295295                } 
    296296        } 
     
    302302                if (!p_ptr->free_act) 
    303303                { 
    304                         (void)set_paralyzed(p_ptr->paralyzed + 10 + randint(20)); 
     304                        (void)inc_timed(TMD_PARALYZED, 10 + randint(20)); 
    305305                } 
    306306        } 
     
    357357 
    358358                /* Penalize some conditions */ 
    359                 if (p_ptr->blind || no_lite()) i = i / 10; 
    360                 if (p_ptr->confused || p_ptr->image) i = i / 10; 
     359                if (p_ptr->timed[TMD_BLIND] || no_lite()) i = i / 10; 
     360                if (p_ptr->timed[TMD_CONFUSED] || p_ptr->timed[TMD_IMAGE]) i = i / 10; 
    361361 
    362362                /* Extract the difficulty */ 
     
    426426 
    427427        /* Penalize some conditions */ 
    428         if (p_ptr->blind || no_lite()) i = i / 10; 
    429         if (p_ptr->confused || p_ptr->image) i = i / 10; 
     428        if (p_ptr->timed[TMD_BLIND] || no_lite()) i = i / 10; 
     429        if (p_ptr->timed[TMD_CONFUSED] || p_ptr->timed[TMD_IMAGE]) i = i / 10; 
    430430 
    431431        /* Extract the difficulty */ 
     
    676676 
    677677                /* Penalize some conditions */ 
    678                 if (p_ptr->blind || no_lite()) i = i / 10; 
    679                 if (p_ptr->confused || p_ptr->image) i = i / 10; 
     678                if (p_ptr->timed[TMD_BLIND] || no_lite()) i = i / 10; 
     679                if (p_ptr->timed[TMD_CONFUSED] || p_ptr->timed[TMD_IMAGE]) i = i / 10; 
    680680 
    681681                /* Extract the lock power */ 
     
    13771377 
    13781378        /* Penalize some conditions */ 
    1379         if (p_ptr->blind || no_lite()) i = i / 10; 
    1380         if (p_ptr->confused || p_ptr->image) i = i / 10; 
     1379        if (p_ptr->timed[TMD_BLIND] || no_lite()) i = i / 10; 
     1380        if (p_ptr->timed[TMD_CONFUSED] || p_ptr->timed[TMD_IMAGE]) i = i / 10; 
    13811381 
    13821382        /* XXX XXX XXX Variable power? */ 
     
    16431643 
    16441644                /* Hack -- Lose balance ala paralysis */ 
    1645                 (void)set_paralyzed(p_ptr->paralyzed + 2 + rand_int(2)); 
     1645                (void)inc_timed(TMD_PARALYZED, 2 + rand_int(2)); 
    16461646        } 
    16471647 
     
    21332133 
    21342134        /* Hack XXX XXX XXX */ 
    2135         if (p_ptr->confused
     2135        if (p_ptr->timed[TMD_CONFUSED]
    21362136        { 
    21372137                msg_print("You are too confused!"); 
  • trunk/src/cmd5.c

    r1 r24  
    6464 
    6565        /* Stunning makes spells harder (after minfail) */ 
    66         if (p_ptr->stun > 50) chance += 25; 
    67         else if (p_ptr->stun) chance += 15; 
     66        if (p_ptr->timed[TMD_STUN] > 50) chance += 25; 
     67        else if (p_ptr->timed[TMD_STUN]) chance += 15; 
    6868 
    6969        /* Always a 5 percent chance of working */ 
     
    609609 
    610610        /* No lite */ 
    611         if (p_ptr->blind || no_lite()) 
     611        if (p_ptr->timed[TMD_BLIND] || no_lite()) 
    612612        { 
    613613                msg_print("You cannot see!"); 
     
    616616 
    617617        /* Confused */ 
    618         if (p_ptr->confused
     618        if (p_ptr->timed[TMD_CONFUSED]
    619619        { 
    620620                msg_print("You are too confused!"); 
     
    673673        } 
    674674 
    675         if (p_ptr->blind || no_lite()) 
     675        if (p_ptr->timed[TMD_BLIND] || no_lite()) 
    676676        { 
    677677                msg_print("You cannot see!"); 
     
    679679        } 
    680680 
    681         if (p_ptr->confused
     681        if (p_ptr->timed[TMD_CONFUSED]
    682682        { 
    683683                msg_print("You are too confused!"); 
     
    832832 
    833833        /* Require lite */ 
    834         if (p_ptr->blind || no_lite()) 
     834        if (p_ptr->timed[TMD_BLIND] || no_lite()) 
    835835        { 
    836836                msg_print("You cannot see!"); 
     
    839839 
    840840        /* Not when confused */ 
    841         if (p_ptr->confused
     841        if (p_ptr->timed[TMD_CONFUSED]
    842842        { 
    843843                msg_print("You are too confused!"); 
     
    958958 
    959959                /* Hack -- Bypass free action */ 
    960                 (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1)); 
     960                (void)inc_timed(TMD_PARALYZED, randint(5 * oops + 1)); 
    961961 
    962962                /* Damage CON (possibly permanently) */ 
     
    10031003 
    10041004        /* Must have lite */ 
    1005         if (p_ptr->blind || no_lite()) 
     1005        if (p_ptr->timed[TMD_BLIND] || no_lite()) 
    10061006        { 
    10071007                msg_print("You cannot see!"); 
     
    10101010 
    10111011        /* Must not be confused */ 
    1012         if (p_ptr->confused
     1012        if (p_ptr->timed[TMD_CONFUSED]
    10131013        { 
    10141014                msg_print("You are too confused!"); 
     
    11281128 
    11291129                /* Hack -- Bypass free action */ 
    1130                 (void)set_paralyzed(p_ptr->paralyzed + randint(5 * oops + 1)); 
     1130                (void)inc_timed(TMD_PARALYZED, randint(5 * oops + 1)); 
    11311131 
    11321132                /* Damage CON (possibly permanently) */ 
  • trunk/src/cmd6.c

    r1 r24  
    246246 
    247247        /* Check some conditions */ 
    248         if (p_ptr->blind
     248        if (p_ptr->timed[TMD_BLIND]
    249249        { 
    250250                msg_print("You can't see anything."); 
     
    256256                return; 
    257257        } 
    258         if (p_ptr->confused
     258        if (p_ptr->timed[TMD_CONFUSED]
    259259        { 
    260260                msg_print("You are too confused!"); 
     
    393393 
    394394        /* Confusion hurts skill */ 
    395         if (p_ptr->confused) chance = chance / 2; 
     395        if (p_ptr->timed[TMD_CONFUSED]) chance = chance / 2; 
    396396 
    397397        /* High level objects are harder */ 
     
    698698 
    699699        /* Confusion hurts skill */ 
    700         if (p_ptr->confused) chance = chance / 2; 
     700        if (p_ptr->timed[TMD_CONFUSED]) chance = chance / 2; 
    701701 
    702702        /* High level objects are harder */ 
  • trunk/src/defines.h

    r16 r24  
    4848 * Current version string 
    4949 */ 
    50 #define VERSION_STRING  "3.0.7s
     50#define VERSION_STRING  "3.0.8
    5151 
    5252 
     
    5656#define VERSION_MAJOR   3 
    5757#define VERSION_MINOR   0 
    58 #define VERSION_PATCH   6 
    59 #define VERSION_EXTRA   4 
     58#define VERSION_PATCH   7 
     59#define VERSION_EXTRA   0 
    6060 
    6161 
     
    448448 */ 
    449449#define MAX_FLOOR_STACK                 23 
     450 
     451 
     452/* 
     453 * Timed effects 
     454 */ 
     455enum 
     456{ 
     457        TMD_FAST = 0, TMD_SLOW, TMD_BLIND, TMD_PARALYZED, TMD_CONFUSED, 
     458        TMD_AFRAID, TMD_IMAGE, TMD_POISONED, TMD_CUT, TMD_STUN, TMD_PROTEVIL, 
     459        TMD_INVULN, TMD_HERO, TMD_SHERO, TMD_SHIELD, TMD_BLESSED, TMD_SINVIS, 
     460        TMD_SINFRA, TMD_OPP_ACID, TMD_OPP_ELEC, TMD_OPP_FIRE, TMD_OPP_COLD, 
     461        TMD_OPP_POIS, 
     462 
     463        TMD_MAX 
     464}; 
    450465 
    451466 
  • trunk/src/dungeon.c

    r16 r24  
    106106 
    107107        /* No sensing when confused */ 
    108         if (p_ptr->confused) return; 
     108        if (p_ptr->timed[TMD_CONFUSED]) return; 
    109109 
    110110        if (cp_ptr->flags & CF_PSEUDO_ID_IMPROV) 
     
    753753 
    754754        /* Take damage from poison */ 
    755         if (p_ptr->poisoned
     755        if (p_ptr->timed[TMD_POISONED]
    756756        { 
    757757                /* Take damage */ 
     
    760760 
    761761        /* Take damage from cuts */ 
    762         if (p_ptr->cut
     762        if (p_ptr->timed[TMD_CUT]
    763763        { 
    764764                /* Mortal wound or Deep Gash */ 
    765                 if (p_ptr->cut > 200) 
     765                if (p_ptr->timed[TMD_CUT] > 200) 
    766766                { 
    767767                        i = 3; 
     
    769769 
    770770                /* Severe cut */ 
    771                 else if (p_ptr->cut > 100) 
     771                else if (p_ptr->timed[TMD_CUT] > 100) 
    772772                { 
    773773                        i = 2; 
     
    851851                { 
    852852                        /* Faint occasionally */ 
    853                         if (!p_ptr->paralyzed && (rand_int(100) < 10)) 
     853                        if (!p_ptr->timed[TMD_PARALYZED] && (rand_int(100) < 10)) 
    854854                        { 
    855855                                /* Message */ 
     
    858858 
    859859                                /* Hack -- faint (bypass free action) */ 
    860                                 (void)set_paralyzed(p_ptr->paralyzed + 1 + rand_int(5)); 
     860                                (void)inc_timed(TMD_PARALYZED, 1 + rand_int(5)); 
    861861                        } 
    862862                } 
     
    882882 
    883883        /* Various things interfere with healing */ 
    884         if (p_ptr->paralyzed) regen_amount = 0; 
    885         if (p_ptr->poisoned) regen_amount = 0; 
    886         if (p_ptr->stun) regen_amount = 0; 
    887         if (p_ptr->cut) regen_amount = 0; 
     884        if (p_ptr->timed[TMD_PARALYZED]) regen_amount = 0; 
     885        if (p_ptr->timed[TMD_POISONED]) regen_amount = 0; 
     886        if (p_ptr->timed[TMD_STUN]) regen_amount = 0; 
     887        if (p_ptr->timed[TMD_CUT]) regen_amount = 0; 
    888888 
    889889        /* Regenerate Hit Points if needed */ 
     
    897897 
    898898        /* Hack -- Hallucinating */ 
    899         if (p_ptr->image
    900         { 
    901                 (void)set_image(p_ptr->image - 1); 
     899        if (p_ptr->timed[TMD_IMAGE]
     900        { 
     901                (void)dec_timed(TMD_IMAGE, 1); 
    902902        } 
    903903 
    904904        /* Blindness */ 
    905         if (p_ptr->blind
    906         { 
    907                 (void)set_blind(p_ptr->blind - 1); 
     905        if (p_ptr->timed[TMD_BLIND]
     906        { 
     907                (void)dec_timed(TMD_BLIND, 1); 
    908908        } 
    909909 
    910910        /* Times see-invisible */ 
    911         if (p_ptr->tim_invis
    912         { 
    913                 (void)set_tim_invis(p_ptr->tim_invis - 1); 
     911        if (p_ptr->timed[TMD_SINVIS]
     912        { 
     913                (void)dec_timed(TMD_SINVIS, 1); 
    914914        } 
    915915 
    916916        /* Timed infra-vision */ 
    917         if (p_ptr->tim_infra
    918         { 
    919                 (void)set_tim_infra(p_ptr->tim_infra - 1); 
     917        if (p_ptr->timed[TMD_SINFRA]
     918        { 
     919                (void)dec_timed(TMD_SINFRA, 1); 
    920920        } 
    921921 
    922922        /* Paralysis */ 
    923         if (p_ptr->paralyzed
    924         { 
    925                 (void)set_paralyzed(p_ptr->paralyzed - 1); 
     923        if (p_ptr->timed[TMD_PARALYZED]
     924        { 
     925                (void)dec_timed(TMD_PARALYZED, 1); 
    926926        } 
    927927 
    928928        /* Confusion */ 
    929         if (p_ptr->confused
    930         { 
    931                 (void)set_confused(p_ptr->confused - 1); 
     929        if (p_ptr->timed[TMD_CONFUSED]
     930        { 
     931                (void)dec_timed(TMD_CONFUSED, 1); 
    932932        } 
    933933 
    934934        /* Afraid */ 
    935         if (p_ptr->afraid
    936         { 
    937                 (void)set_afraid(p_ptr->afraid - 1); 
     935        if (p_ptr->timed[TMD_AFRAID]
     936        { 
     937                (void)dec_timed(TMD_AFRAID, 1); 
    938938        } 
    939939 
    940940        /* Fast */ 
    941         if (p_ptr->fast
    942         { 
    943                 (void)set_fast(p_ptr->fast - 1); 
     941        if (p_ptr->timed[TMD_FAST]
     942        { 
     943                (void)dec_timed(TMD_FAST, 1); 
    944944        } 
    945945 
    946946        /* Slow */ 
    947         if (p_ptr->slow
    948         { 
    949                 (void)set_slow(p_ptr->slow - 1); 
     947        if (p_ptr->timed[TMD_SLOW]
     948        { 
     949                (void)dec_timed(TMD_SLOW, 1); 
    950950        } 
    951951 
    952952        /* Protection from evil */ 
    953         if (p_ptr->protevil
    954         { 
    955                 (void)set_protevil(p_ptr->protevil - 1); 
     953        if (p_ptr->timed[TMD_PROTEVIL]
     954        { 
     955                (void)dec_timed(TMD_PROTEVIL, 1); 
    956956        } 
    957957 
    958958        /* Invulnerability */ 
    959         if (p_ptr->invuln
    960         { 
    961                 (void)set_invuln(p_ptr->invuln - 1); 
     959        if (p_ptr->timed[TMD_INVULN]
     960        { 
     961                (void)dec_timed(TMD_INVULN, 1); 
    962962        } 
    963963 
    964964        /* Heroism */ 
    965         if (p_ptr->hero
    966         { 
    967                 (void)set_hero(p_ptr->hero - 1); 
     965        if (p_ptr->timed[TMD_HERO]
     966        { 
     967                (void)dec_timed(TMD_HERO, 1); 
    968968        } 
    969969 
    970970        /* Super Heroism */ 
    971         if (p_ptr->shero
    972         { 
    973                 (void)set_shero(p_ptr->shero - 1); 
     971        if (p_ptr->timed[TMD_SHERO]
     972        { 
     973                (void)dec_timed(TMD_SHERO, 1); 
    974974        } 
    975975 
    976976        /* Blessed */ 
    977         if (p_ptr->blessed
    978         { 
    979                 (void)set_blessed(p_ptr->blessed - 1); 
     977        if (p_ptr->timed[TMD_BLESSED]
     978        { 
     979                (void)dec_timed(TMD_BLESSED, 1); 
    980980        } 
    981981 
    982982        /* Shield */ 
    983         if (p_ptr->shield
    984         { 
    985                 (void)set_shield(p_ptr->shield - 1); 
     983        if (p_ptr->timed[TMD_SHIELD]
     984        { 
     985                (void)dec_timed(TMD_SHIELD, 1); 
    986986        } 
    987987 
    988988        /* Oppose Acid */ 
    989         if (p_ptr->oppose_acid
    990         { 
    991                 (void)set_oppose_acid(p_ptr->oppose_acid - 1); 
     989        if (p_ptr->timed[TMD_OPP_ACID]
     990        { 
     991                (void)dec_timed(TMD_OPP_ACID, 1); 
    992992        } 
    993993 
    994994        /* Oppose Lightning */ 
    995         if (p_ptr->oppose_elec
    996         { 
    997                 (void)set_oppose_elec(p_ptr->oppose_elec - 1); 
     995        if (p_ptr->timed[TMD_OPP_ELEC]
     996        { 
     997                (void)dec_timed(TMD_OPP_ELEC, 1); 
    998998        } 
    999999 
    10001000        /* Oppose Fire */ 
    1001         if (p_ptr->oppose_fire
    1002         { 
    1003                 (void)set_oppose_fire(p_ptr->oppose_fire - 1); 
     1001        if (p_ptr->timed[TMD_OPP_FIRE]
     1002        { 
     1003                (void)dec_timed(TMD_OPP_FIRE, 1); 
    10041004        } 
    10051005 
    10061006        /* Oppose Cold */ 
    1007         if (p_ptr->oppose_cold
    1008         { 
    1009                 (void)set_oppose_cold(p_ptr->oppose_cold - 1); 
     1007        if (p_ptr->timed[TMD_OPP_COLD]
     1008        { 
     1009                (void)dec_timed(TMD_OPP_COLD, 1); 
    10101010        } 
    10111011 
    10121012        /* Oppose Poison */ 
    1013         if (p_ptr->oppose_pois
    1014         { 
    1015                 (void)set_oppose_pois(p_ptr->oppose_pois - 1); 
     1013        if (p_ptr->timed[TMD_OPP_POIS]
     1014        { 
     1015                (void)dec_timed(TMD_OPP_POIS, 1); 
    10161016        } 
    10171017 
     
    10201020 
    10211021        /* Poison */ 
    1022         if (p_ptr->poisoned
     1022        if (p_ptr->timed[TMD_POISONED]
    10231023        { 
    10241024                int adjust = (adj_con_fix[p_ptr->stat_ind[A_CON]] + 1); 
    10251025 
    10261026                /* Apply some healing */ 
    1027                 (void)set_poisoned(p_ptr->poisoned - adjust); 
     1027                (void)dec_timed(TMD_POISONED, adjust); 
    10281028        } 
    10291029 
    10301030        /* Stun */ 
    1031         if (p_ptr->stun
     1031        if (p_ptr->timed[TMD_STUN]
    10321032        { 
    10331033                int adjust = (adj_con_fix[p_ptr->stat_ind[A_CON]] + 1); 
    10341034 
    10351035                /* Apply some healing */ 
    1036                 (void)set_stun(p_ptr->stun - adjust); 
     1036                (void)dec_timed(TMD_STUN, adjust); 
    10371037        } 
    10381038 
    10391039        /* Cut */ 
    1040         if (p_ptr->cut
     1040        if (p_ptr->timed[TMD_CUT]
    10411041        { 
    10421042                int adjust = (adj_con_fix[p_ptr->stat_ind[A_CON]] + 1); 
    10431043 
    10441044                /* Hack -- Truly "mortal" wound */ 
    1045                 if (p_ptr->cut > 1000) adjust = 0; 
     1045                if (p_ptr->timed[TMD_CUT] > 1000) adjust = 0; 
    10461046 
    10471047                /* Apply some healing */ 
    1048                 (void)set_cut(p_ptr->cut - adjust); 
     1048                (void)dec_timed(TMD_CUT, adjust); 
    10491049        } 
    10501050 
     
    10731073 
    10741074                        /* Hack -- Special treatment when blind */ 
    1075                         if (p_ptr->blind
     1075                        if (p_ptr->timed[TMD_BLIND]
    10761076                        { 
    10771077                                /* Hack -- save some light for later */ 
     
    20032003                        if ((p_ptr->chp == p_ptr->mhp) && 
    20042004                            (p_ptr->csp == p_ptr->msp) && 
    2005                             !p_ptr->blind && !p_ptr->confused && 
    2006                             !p_ptr->poisoned && !p_ptr->afraid && 
    2007                             !p_ptr->stun && !p_ptr->cut && 
    2008                             !p_ptr->slow && !p_ptr->paralyzed && 
    2009                             !p_ptr->image && !p_ptr->word_recall) 
     2005                            !p_ptr->timed[TMD_BLIND] && !p_ptr->timed[TMD_CONFUSED] && 
     2006                            !p_ptr->timed[TMD_POISONED] && !p_ptr->timed[TMD_AFRAID] && 
     2007                            !p_ptr->timed[TMD_STUN] && !p_ptr->timed[TMD_CUT] && 
     2008                            !p_ptr->timed[TMD_SLOW] && !p_ptr->timed[TMD_PARALYZED] && 
     2009                            !p_ptr->timed[TMD_IMAGE] && !p_ptr->word_recall) 
    20102010                        { 
    20112011                                disturb(0, 0); 
     
    21212121 
    21222122                /* Paralyzed or Knocked Out */ 
    2123                 if ((p_ptr->paralyzed) || (p_ptr->stun >= 100)) 
     2123                if ((p_ptr->timed[TMD_PARALYZED]) || (p_ptr->timed[TMD_STUN] >= 100)) 
    21242124                { 
    21252125                        /* Take a turn */ 
     
    22012201 
    22022202                        /* Hack -- constant hallucination */ 
    2203                         if (p_ptr->image
     2203                        if (p_ptr->timed[TMD_IMAGE]
    22042204                        { 
    22052205                                p_ptr->redraw |= (PR_MAP); 
     
    29692969 
    29702970                                /* Hack -- Healing */ 
    2971                                 (void)set_blind(0); 
    2972                                 (void)set_confused(0); 
    2973                                 (void)set_poisoned(0); 
    2974                                 (void)set_afraid(0); 
    2975                                 (void)set_paralyzed(0); 
    2976                                 (void)set_image(0); 
    2977                                 (void)set_stun(0); 
    2978                                 (void)set_cut(0); 
     2971                                (void)clear_timed(TMD_BLIND); 
     2972                                (void)clear_timed(TMD_CONFUSED); 
     2973                                (void)clear_timed(TMD_POISONED); 
     2974                                (void)clear_timed(TMD_AFRAID); 
     2975                                (void)clear_timed(TMD_PARALYZED); 
     2976                                (void)clear_timed(TMD_IMAGE); 
     2977                                (void)clear_timed(TMD_STUN); 
     2978                                (void)clear_timed(TMD_CUT); 
    29792979 
    29802980