Changeset 153

Show
Ignore:
Timestamp:
06/05/07 14:41:58 (1 year ago)
Author:
takkaria
Message:
  • Remove hardcoded values for p_ptr->noscore (#141).
  • Remove some horrible defines from defines.h and put them in h-basic
  • Remove verify_special, and thus break the (already-broken) automatic borg mode for Windows port
Files:

Legend:

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

    r143 r153  
    200200{ 
    201201        /* Verify first time */ 
    202         if (verify_special && !(p_ptr->noscore & 0x0002)) 
     202        if (!(p_ptr->noscore & NOSCORE_WIZARD)) 
    203203        { 
    204204                /* Mention effects */ 
     
    212212 
    213213                /* Mark savefile */ 
    214                 p_ptr->noscore |= 0x0002
     214                p_ptr->noscore |= NOSCORE_WIZARD
    215215        } 
    216216 
     
    245245{ 
    246246        /* Ask first time */ 
    247         if (verify_special && !(p_ptr->noscore & 0x0008)) 
     247        if (!(p_ptr->noscore & NOSCORE_DEBUG)) 
    248248        { 
    249249                /* Mention effects */ 
     
    257257 
    258258                /* Mark savefile */ 
    259                 p_ptr->noscore |= 0x0008
     259                p_ptr->noscore |= NOSCORE_DEBUG
    260260        } 
    261261 
     
    276276{ 
    277277        /* Ask first time */ 
    278         if (verify_special && !(p_ptr->noscore & 0x0010)) 
     278        if (!(p_ptr->noscore & NOSCORE_BORG)) 
    279279        { 
    280280                /* Mention effects */ 
     
    288288 
    289289                /* Mark savefile */ 
    290                 p_ptr->noscore |= 0x0010
     290                p_ptr->noscore |= NOSCORE_BORG
    291291        } 
    292292 
  • trunk/src/defines.h

    r152 r153  
    240240 
    241241/* 
    242  * Maximum value storable in a "byte" (hard-coded) 
    243  */ 
    244 #define MAX_UCHAR       255 
    245  
    246 /* 
    247  * Maximum value storable in a "s16b" (hard-coded) 
    248  */ 
    249 #define MAX_SHORT       32767 
    250  
    251  
    252 /* 
    253242 * Store constants 
    254243 * 
     
    483472 * Indexes of the various "stats" (hard-coded by savefiles, etc). 
    484473 */ 
    485 #define A_STR   0 
    486 #define A_INT   1 
    487 #define A_WIS   2 
    488 #define A_DEX   3 
    489 #define A_CON   4 
    490 #define A_CHR   5 
    491  
    492 /* 
    493  * Total number of stats. 
    494  */ 
    495 #define A_MAX   6 
     474enum 
     475
     476        A_STR = 0, 
     477        A_INT, 
     478        A_WIS, 
     479        A_DEX, 
     480        A_CON, 
     481        A_CHR, 
     482 
     483        A_MAX 
     484}; 
    496485 
    497486 
     
    618607 
    619608/* 
    620  * Number of keymap modes 
    621  */ 
    622 #define KEYMAP_MODES    2 
    623  
    624 /* 
    625  * Mode for original keyset commands 
    626  */ 
    627 #define KEYMAP_MODE_ORIG        0 
    628  
    629 /* 
    630  * Mode for roguelike keyset commands 
    631  */ 
    632 #define KEYMAP_MODE_ROGUE       1 
     609 * Keymap modes. 
     610 */ 
     611enum 
     612
     613        KEYMAP_MODE_ORIG = 0, 
     614        KEYMAP_MODE_ROGUE, 
     615 
     616        KEYMAP_MODES            /* Total */ 
     617}; 
     618 
    633619 
    634620 
     
    24442430#define OPT_disturb_minor                       24 
    24452431 
    2446 #define OPT_verify_destroy                      28 
    2447 #define OPT_verify_special                      29 
    2448  
    24492432#define OPT_view_perma_grids            38 
    24502433#define OPT_view_torch_grids            39 
     
    25352518#define disturb_state                   op_ptr->opt[OPT_disturb_state] 
    25362519#define disturb_minor                   op_ptr->opt[OPT_disturb_minor] 
    2537 #define verify_special                  op_ptr->opt[OPT_verify_special] 
    25382520#define view_perma_grids                op_ptr->opt[OPT_view_perma_grids] 
    25392521#define view_torch_grids                op_ptr->opt[OPT_view_torch_grids] 
     
    31233105 
    31243106#define ACT_MAX                 50 
     3107 
     3108 
     3109 
     3110/* player_type.noscore flags */ 
     3111#define NOSCORE_RESURRECT       0x0001 
     3112#define NOSCORE_WIZARD          0x0002 
     3113#define NOSCORE_DEBUG           0x0008 
     3114#define NOSCORE_BORG            0x0010 
  • trunk/src/dungeon.c

    r152 r153  
    1  
    21/* File: dungeon.c */ 
    32 
     
    21062105 
    21072106                                /* Mark savefile */ 
    2108                                 p_ptr->noscore |= 0x0001
     2107                                p_ptr->noscore |= NOSCORE_RESSURECT
    21092108 
    21102109                                /* Message */ 
  • trunk/src/files.c

    r136 r153  
    27482748 
    27492749        /* Ignore wizards and borgs */ 
    2750         if (!(p_ptr->noscore & 0x00FF)) 
     2750        if (!(p_ptr->noscore & (NOSCORE_WIZARD | NOSCORE_BORG))) 
    27512751        { 
    27522752                /* Ignore people who die in town */ 
     
    34283428 
    34293429        /* Wizard-mode pre-empts scoring */ 
    3430         if (p_ptr->noscore & 0x000F
     3430        if (p_ptr->noscore & NOSCORE_WIZARD
    34313431        { 
    34323432                msg_print("Score not registered for wizards."); 
     
    34413441 
    34423442        /* Borg-mode pre-empts scoring */ 
    3443         if (p_ptr->noscore & 0x00F0
     3443        if (p_ptr->noscore & NOSCORE_BORG
    34443444        { 
    34453445                msg_print("Score not registered for borgs."); 
  • trunk/src/h-basic.h

    r128 r153  
    193193  typedef int32_t s32b; 
    194194 
     195#define MAX_UCHAR               INT8_MAX 
     196#define MAX_SHORT               SINT16_MAX 
     197 
    195198#else /* __STDC__ */ 
    196199 
     
    199202  typedef signed short s16b; 
    200203  typedef unsigned short u16b; 
     204 
     205#define MAX_UCHAR               UCHAR_MAX 
     206#define MAX_SHORT               32767 
    201207 
    202208  /* Detect >32-bit longs */ 
  • trunk/src/load.c

    r144 r153  
    22912291 
    22922292                                /* Mark the savefile */ 
    2293                                 p_ptr->noscore |= 0x0002
     2293                                p_ptr->noscore |= NOSCORE_RESURRECT
    22942294 
    22952295                                /* Done */ 
  • trunk/src/main-win.c

    r141 r153  
    32683268         * Make sure the "verify_special" options is off, so that we can 
    32693269         * get into Borg mode without confirmation. 
     3270         *  
     3271         * Try just marking the savefile correctly. 
    32703272         */ 
    3271  
    3272         screensaver_inkey_hack_buffer[j++] = '='; /* Enter options screen */ 
    3273         screensaver_inkey_hack_buffer[j++] = '2'; /* Disturbance options */ 
    3274  
    3275         /* Cursor down to "verify_special" */ 
    3276         for (i = 0; i < 10; i++) 
    3277                 screensaver_inkey_hack_buffer[j++] = '2'; 
    3278  
    3279         screensaver_inkey_hack_buffer[j++] = 'n'; /* Switch off "verify_special" */ 
    3280         screensaver_inkey_hack_buffer[j++] = ESCAPE; /* Leave disturbance options */ 
     3273        p_ptr->noscore |= (NOSCORE_BORG); 
    32813274 
    32823275        /* 
     
    32843277         * automatically restart. 
    32853278         */ 
    3286  
    3287         screensaver_inkey_hack_buffer[j++] = '7'; /* Cheat options */ 
     3279        screensaver_inkey_hack_buffer[j++] = '5'; /* Cheat options */ 
    32883280 
    32893281        /* Cursor down to "cheat live" */ 
  • trunk/src/tables.c

    r152 r153  
    14261426        NULL,                                           /* xxx alert_failure */ 
    14271427        NULL,                                           /* xxx verify_destroy */ 
    1428         "verify_special",                      /* OPT_verify_special */ 
     1428        NULL,                                          /* xxx verify_special */ 
    14291429        NULL,                                           /* xxx allow_quantity */ 
    14301430        NULL,                                           /* xxx */ 
     
    16901690        NULL,                                                                           /* xxx alert_failure */ 
    16911691        NULL,                                                                           /* xxx verify_destroy */ 
    1692         "Verify use of special commands",                      /* OPT_verify_special */ 
     1692        NULL,                                                                          /* xxx verify_special */ 
    16931693        NULL,                                                                           /* xxx allow_quantity */ 
    16941694        NULL,                                                                           /* xxx */ 
     
    19541954        FALSE,          /* xxx alert_failure */ 
    19551955        FALSE,          /* xxx verify_destroy */ 
    1956         TRUE,          /* OPT_verify_special */ 
     1956        FALSE,         /* xxx verify_special */ 
    19571957        FALSE,          /* xxx allow_quantity */ 
    19581958        FALSE,          /* xxx */ 
     
    21982198                OPT_easy_alter, 
    21992199                OPT_easy_open, 
    2200                 OPT_verify_special
     2200                OPT_NONE
    22012201                OPT_NONE, 
    22022202                OPT_NONE,