Changeset 158

Show
Ignore:
Timestamp:
06/06/07 11:49:02 (1 year ago)
Author:
takkaria
Message:

#126: Make amnesia a timed effect, with a chance of affecting the ability to use staffs/wands/rods/books/artifacts. Almost certainly requires tweaking.

Files:

Legend:

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

    r155 r158  
    914914        } 
    915915 
     916        /* Check for amnesia */ 
     917        else if (rand_int(3) != 0 && p_ptr->timed[TMD_AMNESIA]) 
     918        { 
     919                /* Can't remember how */ 
     920                if (flush_failure) flush(); 
     921                msg_print("The words are meaningless; you cannot remember how to read."); 
     922        } 
     923 
    916924        /* Process spell */ 
    917925        else 
     
    10841092        } 
    10851093 
     1094        /* Check for amnesia */ 
     1095        else if (rand_int(3) != 0 && p_ptr->timed[TMD_AMNESIA]) 
     1096        { 
     1097                /* Can't remember how */ 
     1098                if (flush_failure) flush(); 
     1099                msg_print("The words are meaningless; you cannot remember how to read."); 
     1100        } 
     1101 
    10861102        /* Success */ 
    10871103        else 
  • trunk/src/cmd6.c

    r156 r158  
    258258                return; 
    259259        } 
     260 
    260261        if (p_ptr->timed[TMD_CONFUSED]) 
    261262        { 
     
    263264                return; 
    264265        } 
    265  
    266266 
    267267        /* Restrict choices to scrolls */ 
     
    289289        p_ptr->energy_use = 100; 
    290290 
     291        /* Check for amnesia */ 
     292        if (rand_int(4) != 0 && p_ptr->timed[TMD_AMNESIA]) 
     293        { 
     294                /* Can't remember how */ 
     295                msg_print("You can't remember how to read!"); 
     296                return; 
     297        } 
     298 
    291299        /* Not identified yet */ 
    292300        ident = FALSE; 
     
    385393        /* Take a turn */ 
    386394        p_ptr->energy_use = 100; 
     395 
     396        /* Check for amnesia */ 
     397        if (rand_int(4) != 0 && p_ptr->timed[TMD_AMNESIA]) 
     398        { 
     399                /* Can't remember how */ 
     400                msg_print("You can't remember how to use the staff!"); 
     401                return; 
     402        } 
    387403 
    388404        /* Not identified yet */ 
     
    525541        } 
    526542 
     543        /* Check for amnesia */ 
     544        if (rand_int(4) != 0 && p_ptr->timed[TMD_AMNESIA]) 
     545        { 
     546                /* Can't remember how */ 
     547                p_ptr->energy_use = 100; 
     548                msg_print("You can't remember how to activate the wand!"); 
     549                return; 
     550        } 
     551 
     552 
    527553        /* Aim the wand */ 
    528554        if (!use_object(o_ptr, &ident)) return; 
     
    571597 
    572598/* 
    573  * Activate (zap) a Rod 
     599 * Zap a Rod 
    574600 * 
    575601 * Unstack fully charged rods as needed. 
     
    694720        p_ptr->energy_use = 100; 
    695721 
     722        /* Check for amnesia */ 
     723        if (rand_int(3) && p_ptr->timed[TMD_AMNESIA]) 
     724        { 
     725                /* Can't remember how */ 
     726                if (flush_failure) flush(); 
     727                msg_print("You can't remember how to activate that."); 
     728                return; 
     729        } 
     730 
    696731        /* Extract the item level */ 
    697732        lev = k_info[o_ptr->k_idx].level; 
     
    708743        /* High level objects are harder */ 
    709744        chance = chance - ((lev > 50) ? 50 : lev); 
     745 
    710746 
    711747        /* Give everyone a (slight) chance */ 
  • trunk/src/defines.h

    r156 r158  
    450450        TMD_INVULN, TMD_HERO, TMD_SHERO, TMD_SHIELD, TMD_BLESSED, TMD_SINVIS, 
    451451        TMD_SINFRA, TMD_OPP_ACID, TMD_OPP_ELEC, TMD_OPP_FIRE, TMD_OPP_COLD, 
    452         TMD_OPP_POIS, 
     452        TMD_OPP_POIS, TMD_AMNESIA, 
    453453 
    454454        TMD_MAX 
  • trunk/src/melee2.c

    r112 r158  
    19591959 
    19601960                        if (rand_int(100) < p_ptr->skills[SKILL_SAV]) 
    1961                         { 
    19621961                                msg_print("You resist the effects!"); 
    1963                         } 
    1964                         else if (lose_all_info()) 
    1965                         { 
    1966                                 msg_print("Your memories fade away."); 
    1967                         } 
     1962                        else 
     1963                                inc_timed(TMD_AMNESIA, 25); 
     1964 
    19681965                        break; 
    19691966                } 
  • trunk/src/spells2.c

    r156 r158  
    863863        /* Load screen */ 
    864864        screen_load(); 
    865 } 
    866  
    867  
    868  
    869  
    870  
    871  
    872 /* 
    873  * Forget everything 
    874  */ 
    875 bool lose_all_info(void) 
    876 { 
    877         int i; 
    878  
    879         /* Forget info about objects */ 
    880         for (i = 0; i < INVEN_TOTAL; i++) 
    881         { 
    882                 object_type *o_ptr = &inventory[i]; 
    883  
    884                 /* Skip non-objects */ 
    885                 if (!o_ptr->k_idx) continue; 
    886  
    887                 /* Allow "protection" by the MENTAL flag */ 
    888                 if (o_ptr->ident & (IDENT_MENTAL)) continue; 
    889  
    890                 /* Remove special inscription, if any */ 
    891                 if (o_ptr->pseudo) o_ptr->pseudo = 0; 
    892  
    893                 /* Hack -- Clear the "felt" flag */ 
    894                 o_ptr->ident &= ~(IDENT_SENSE); 
    895  
    896                 /* Hack -- Clear the "known" flag */ 
    897                 o_ptr->ident &= ~(IDENT_KNOWN); 
    898  
    899                 /* Hack -- Clear the "empty" flag */ 
    900                 o_ptr->ident &= ~(IDENT_EMPTY); 
    901         } 
    902  
    903         /* Recalculate bonuses */ 
    904         p_ptr->update |= (PU_BONUS); 
    905  
    906         /* Combine / Reorder the pack (later) */ 
    907         p_ptr->notice |= (PN_COMBINE | PN_REORDER); 
    908  
    909         /* Window stuff */ 
    910         p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER_0 | PW_PLAYER_1); 
    911  
    912         /* Mega-Hack -- Forget the map */ 
    913         wiz_dark(); 
    914  
    915         /* It worked */ 
    916         return (TRUE); 
    917865} 
    918866 
  • trunk/src/use-obj.c

    r112 r158  
    503503                        if (clear_timed(TMD_STUN)) *ident = TRUE; 
    504504                        if (clear_timed(TMD_CUT)) *ident = TRUE; 
     505                        if (clear_timed(TMD_AMNESIA)) *ident = TRUE; 
    505506                        break; 
    506507                } 
     
    514515                        if (clear_timed(TMD_STUN)) *ident = TRUE; 
    515516                        if (clear_timed(TMD_CUT)) *ident = TRUE; 
     517                        if (clear_timed(TMD_AMNESIA)) *ident = TRUE; 
    516518                        break; 
    517519                } 
     
    527529                        (void)clear_timed(TMD_STUN); 
    528530                        (void)clear_timed(TMD_CUT); 
     531                        (void)clear_timed(TMD_AMNESIA); 
    529532                        (void)do_res_stat(A_STR); 
    530533                        (void)do_res_stat(A_CON); 
  • trunk/src/xtra1.c

    r136 r158  
    685685static void prt_confused(int row, int col) 
    686686{ 
    687         if (p_ptr->timed[TMD_CONFUSED]) 
    688         { 
    689                 c_put_str(TERM_ORANGE, "Confused", row, col); 
    690         } 
    691         else 
    692         { 
    693                 put_str("        ", row, col); 
    694         } 
     687        bool confused = p_ptr->timed[TMD_CONFUSED] ? TRUE : FALSE; 
     688        bool forget   = p_ptr->timed[TMD_AMNESIA]  ? TRUE : FALSE; 
     689 
     690        const char *text = "        "; 
     691 
     692        if (confused && !forget) 
     693                text = "Confused"; 
     694        else if (confused && forget) 
     695                text = "Conf Amn"; 
     696        else if (!confused && forget) 
     697                text = "Amnesiac"; 
     698 
     699        c_put_str(TERM_ORANGE, text, row, col); 
    695700} 
    696701 
  • trunk/src/xtra2.c

    r152 r158  
    5858        { "Your eyes begin to tingle!", "Your eyes stop tingling.", 0, 0, (PU_BONUS | PU_MONSTERS), MSG_INFRARED }, 
    5959        { "You feel resistant to poison!", "You feel less resistant to poison", PR_OPPOSE_ELEMENTS, 0, 0, MSG_RES_POIS }, 
     60        { "You feel your memories fade.", "Suddenly you can remember things again.", PR_CONFUSED, 0, 0, MSG_GENERIC }, 
    6061}; 
    6162