Changeset 898 for trunk

Show
Ignore:
Timestamp:
05/12/08 00:21:54 (5 days ago)
Author:
takkaria
Message:

Add a temporary confusion resist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/defines.h

    r891 r898  
    230230 * 
    231231 * STORE_MAX_KEEP must be < STORE_INVEN_MAX. 
    232  * 
    233232 */ 
    234233#define STORE_INVEN_MAX 24              /* Max number of discrete objs in inven */ 
     
    436435        TMD_INVULN, TMD_HERO, TMD_SHERO, TMD_SHIELD, TMD_BLESSED, TMD_SINVIS, 
    437436        TMD_SINFRA, TMD_OPP_ACID, TMD_OPP_ELEC, TMD_OPP_FIRE, TMD_OPP_COLD, 
    438         TMD_OPP_POIS, TMD_AMNESIA, TMD_TELEPATHY, 
     437        TMD_OPP_POIS, TMD_OPP_CONF, TMD_AMNESIA, TMD_TELEPATHY, 
    439438 
    440439        TMD_MAX 
     
    18101809          k_info[(T)->k_idx].aware)) 
    18111810 
     1811 
    18121812/* 
    18131813 * Determine if the attr and char should consider the item's flavor 
     
    18751875         (flavor_info[k_info[(T)->k_idx].flavor].d_char) : \ 
    18761876         (k_info[(T)->k_idx].d_char)) 
    1877  
    18781877 
    18791878/* 
  • trunk/src/xtra1.c

    r887 r898  
    11201120                p_ptr->telepathy = TRUE; 
    11211121 
     1122        /* Temporary resist confusion */ 
     1123        if (p_ptr->timed[TMD_OPP_CONF]) 
     1124                p_ptr->resist_confu = TRUE; 
     1125 
    11221126 
    11231127 
  • trunk/src/xtra2.c

    r895 r898  
    3333static bool set_oppose_fire(int v); 
    3434static bool set_oppose_cold(int v); 
     35static bool set_oppose_conf(int v); 
    3536static bool set_stun(int v); 
    3637static bool set_cut(int v); 
     
    6869        { "", "", 0, 0, 0 },  /* fire -- handled seperately */ 
    6970        { "", "", 0, 0, 0 },  /* cold -- handled seperately */ 
     71        { "", "", 0, 0, 0 },  /* conf -- handled seperately */ 
    7072        { "You feel resistant to poison!", "You feel less resistant to poison.", 0, 0, MSG_RES_POIS }, 
    7173        { "You feel your memories fade.", "Your memories come flooding back.", 0, 0, MSG_GENERIC }, 
     
    9294        else if (idx == TMD_OPP_FIRE) return set_oppose_fire(v); 
    9395        else if (idx == TMD_OPP_COLD) return set_oppose_cold(v); 
     96        else if (idx == TMD_OPP_CONF) return set_oppose_conf(v); 
    9497 
    9598        /* Find the effect */ 
     
    354357 
    355358        /* Redraw */ 
     359        p_ptr->redraw |= PR_STATUS; 
     360 
     361        /* Handle stuff */ 
     362        handle_stuff(); 
     363 
     364        /* Result */ 
     365        return (TRUE); 
     366} 
     367 
     368 
     369/* 
     370 * Set "p_ptr->timed[TMD_OPP_CONF]", notice observable changes 
     371 */ 
     372static bool set_oppose_conf(int v) 
     373{ 
     374        bool notice = FALSE; 
     375 
     376        /* Hack -- Force good values */ 
     377        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; 
     378 
     379        /* Open */ 
     380        if (v) 
     381        { 
     382                if (!p_ptr->timed[TMD_OPP_CONF] && !p_ptr->resist_confu) 
     383                { 
     384                        message(MSG_RES_ELEC, 0, "You feel remarkably clear-headed!"); 
     385                        notice = TRUE; 
     386                } 
     387        } 
     388 
     389        /* Shut */ 
     390        else 
     391        { 
     392                if (p_ptr->timed[TMD_OPP_CONF] && !p_ptr->resist_confu) 
     393                { 
     394                        message(MSG_RECOVER, 0, "You feel less clear-headed."); 
     395                        notice = TRUE; 
     396                } 
     397        } 
     398 
     399        /* Use the value */ 
     400        p_ptr->timed[TMD_OPP_CONF] = v; 
     401 
     402        /* Nothing to notice */ 
     403        if (!notice) return (FALSE); 
     404 
     405        /* Disturb */ 
     406        if (disturb_state) disturb(0, 0); 
     407 
     408        /* Redraw */ 
     409        p_ptr->update |= PU_BONUS; 
    356410        p_ptr->redraw |= PR_STATUS; 
    357411 
  • trunk/src/xtra3.c

    r887 r898  
    11/* 
    22 * File: xtra3.c 
    3  * Purpose: Handles the setting up updating, and cleaning up of the various  
     3 * Purpose: Handles the setting up updating, and cleaning up of the various 
    44 *          things that are displayed by the game. 
    55 * 
     
    2424 
    2525#include "tvalsval.h" 
    26  
    2726 
    2827/*  
     
    668667        { TMD_OPP_COLD,  S("RCold"),      TERM_WHITE }, 
    669668        { TMD_OPP_POIS,  S("RPois"),      TERM_GREEN }, 
     669        { TMD_OPP_CONF,  S("RConf"),      TERM_VIOLET }, 
    670670        { TMD_AMNESIA,   S("Amnesiac"),   TERM_ORANGE }, 
    671671};