Changeset 520
- Timestamp:
- 08/12/07 16:28:00 (1 year ago)
- Files:
-
- trunk/src/cave.c (modified) (6 diffs)
- trunk/src/config.h (modified) (3 diffs)
- trunk/src/generate.c (modified) (1 diff)
- trunk/src/init2.c (modified) (2 diffs)
- trunk/src/main.c (modified) (3 diffs)
- trunk/src/melee2.c (modified) (14 diffs)
- trunk/src/monster2.c (modified) (2 diffs)
- trunk/src/types.h (modified) (1 diff)
- trunk/src/variable.c (modified) (2 diffs)
- trunk/src/wizard2.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cave.c
r507 r520 3103 3103 3104 3104 3105 #ifdef MONSTER_FLOW3106 3107 3105 /* 3108 3106 * Size of the circular queue used by "update_flow()" … … 3126 3124 static int flow_save = 0; 3127 3125 3128 #endif /* MONSTER_FLOW */3129 3130 3126 3131 3127 … … 3135 3131 void forget_flow(void) 3136 3132 { 3137 3138 #ifdef MONSTER_FLOW3139 3140 3133 int x, y; 3141 3134 … … 3156 3149 /* Start over */ 3157 3150 flow_save = 0; 3158 3159 #endif3160 3161 3151 } 3162 3152 … … 3178 3168 void update_flow(void) 3179 3169 { 3180 3181 #ifdef MONSTER_FLOW3182 3183 3170 int py = p_ptr->py; 3184 3171 int px = p_ptr->px; … … 3292 3279 } 3293 3280 } 3294 3295 #endif3296 3297 3281 } 3298 3282 trunk/src/config.h
r519 r520 108 108 109 109 110 /*111 * OPTION: Allow use of the "adult_ai_smell" and "adult_ai_sound"112 * software options, which enable "monster flowing".113 */114 #define MONSTER_FLOW115 116 117 110 118 111 /* … … 126 119 */ 127 120 #define SUPPORT_GAMMA 128 129 130 /*131 * OPTION: Check the modification time of *_info.raw files132 */133 #define CHECK_MODIFICATION_TIME134 135 136 /*137 * OPTION: Enable the "adult_ai_learn" and "adult_ai_cheat" options.138 *139 * They let monsters make more "intelligent" choices about attacks (including140 * spell attacks) based on their observations of the player's reactions to141 * previous attacks. The "cheat" option lets the monster know how the player142 * would react to an attack without actually needing to make the attack. The143 * "learn" option requires that a monster make a "failed" attack before144 * learning that the player is not harmed by that attack.145 */146 #define DRS_SMART_OPTIONS147 148 121 149 122 /* … … 204 177 /* # define USE_PRIVATE_PATHS */ 205 178 #endif /* PRIVATE_USER_PATH */ 206 207 208 209 /*210 * OPTION: Prevent usage of the "ANGBAND_PATH" environment variable and211 * the '-d<what>=<path>' command line option (except for '-du=<path>').212 *213 * This prevents cheating in multi-user installs as well as possible214 * security problems when running setgid.215 */216 #ifdef SET_UID217 #define FIXED_PATHS218 #endif /* SET_UID */219 179 220 180 trunk/src/generate.c
r507 r520 5085 5085 cave_info2[y][x] = 0; 5086 5086 5087 #ifdef MONSTER_FLOW5088 5087 /* No flow */ 5089 5088 cave_cost[y][x] = 0; 5090 5089 cave_when[y][x] = 0; 5091 #endif /* MONSTER_FLOW */5092 5093 5090 } 5094 5091 } trunk/src/init2.c
r505 r520 1045 1045 cave_m_idx = C_ZNEW(DUNGEON_HGT, s16b_wid); 1046 1046 1047 #ifdef MONSTER_FLOW1048 1049 1047 /* Flow arrays */ 1050 1048 cave_cost = C_ZNEW(DUNGEON_HGT, byte_wid); 1051 1049 cave_when = C_ZNEW(DUNGEON_HGT, byte_wid); 1052 1050 1053 #endif /* MONSTER_FLOW */1054 1051 1055 1052 /*** Prepare "vinfo" array ***/ … … 1606 1603 FREE(o_list); 1607 1604 1608 #ifdef MONSTER_FLOW1609 1610 1605 /* Flow arrays */ 1611 1606 FREE(cave_when); 1612 1607 FREE(cave_cost); 1613 1614 #endif /* MONSTER_FLOW */1615 1608 1616 1609 /* Free the cave */ trunk/src/main.c
r507 r520 136 136 cptr tail = NULL; 137 137 138 #ifndef FIXED_PATHS139 140 /* Get the environment variable */141 tail = getenv("ANGBAND_PATH");142 143 #endif /* FIXED_PATHS */144 138 145 139 /* Use the angband_path, or a default */ … … 169 163 static void change_path(cptr info) 170 164 { 171 cptr s; 172 173 /* Find equal sign */ 174 s = strchr(info, '='); 175 176 /* Verify equal sign */ 177 if (!s) quit_fmt("Try '-d<what>=<path>' not '-d%s'", info); 178 179 /* Analyze */ 180 switch (tolower((unsigned char)info[0])) 181 { 182 #ifndef FIXED_PATHS 183 case 'a': 184 { 185 string_free(ANGBAND_DIR_APEX); 186 ANGBAND_DIR_APEX = string_make(s+1); 187 break; 188 } 189 190 case 'f': 191 { 192 string_free(ANGBAND_DIR_FILE); 193 ANGBAND_DIR_FILE = string_make(s+1); 194 break; 195 } 196 197 case 'h': 198 { 199 string_free(ANGBAND_DIR_HELP); 200 ANGBAND_DIR_HELP = string_make(s+1); 201 break; 202 } 203 204 case 'i': 205 { 206 string_free(ANGBAND_DIR_INFO); 207 ANGBAND_DIR_INFO = string_make(s+1); 208 break; 209 } 210 211 case 'x': 212 { 213 string_free(ANGBAND_DIR_XTRA); 214 ANGBAND_DIR_XTRA = string_make(s+1); 215 break; 216 } 217 218 case 'b': 219 { 220 string_free(ANGBAND_DIR_BONE); 221 ANGBAND_DIR_BONE = string_make(s+1); 222 break; 223 } 224 225 case 'd': 226 { 227 string_free(ANGBAND_DIR_DATA); 228 ANGBAND_DIR_DATA = string_make(s+1); 229 break; 230 } 231 232 case 'e': 233 { 234 string_free(ANGBAND_DIR_EDIT); 235 ANGBAND_DIR_EDIT = string_make(s+1); 236 break; 237 } 238 239 case 's': 240 { 241 string_free(ANGBAND_DIR_SAVE); 242 ANGBAND_DIR_SAVE = string_make(s+1); 243 break; 244 } 245 246 #endif /* FIXED_PATHS */ 247 248 case 'u': 249 { 250 string_free(ANGBAND_DIR_USER); 251 ANGBAND_DIR_USER = string_make(s+1); 252 break; 253 } 254 255 default: 256 { 257 quit_fmt("Bad semantics in '-d%s'", info); 258 } 259 } 165 if (!info || !info[0]) 166 quit_fmt("Try '-d<path>'.", info); 167 168 string_free(ANGBAND_DIR_USER); 169 ANGBAND_DIR_USER = string_make(info); 260 170 } 261 171 … … 461 371 puts(" -s<num> Show <num> high scores (default: 10)"); 462 372 puts(" -u<who> Use your <who> savefile"); 463 puts(" -d< def>=<path> Instead of lib/<def>, use<path>");373 puts(" -d<path> Store pref files and screendumps in <path>"); 464 374 puts(" -m<sys> Use module <sys>, where <sys> can be:"); 465 375 trunk/src/melee2.c
r518 r520 17 17 */ 18 18 #include "angband.h" 19 20 21 #ifdef DRS_SMART_OPTIONS22 19 23 20 … … 320 317 (*f6p) = f6; 321 318 } 322 323 324 #endif /* DRS_SMART_OPTIONS */325 319 326 320 … … 762 756 763 757 764 #ifdef DRS_SMART_OPTIONS765 766 758 /* Remove the "ineffective" spells */ 767 759 remove_bad_spells(m_idx, &f4, &f5, &f6); … … 769 761 /* No spells left */ 770 762 if (!f4 && !f5 && !f6) return (FALSE); 771 772 #endif /* DRS_SMART_OPTIONS */773 763 774 764 /* Check whether summons and bolts are worth it. */ … … 2368 2358 2369 2359 2370 #ifdef MONSTER_FLOW2371 2372 2360 /* 2373 2361 * Choose the "best" direction for "flowing" … … 2554 2542 } 2555 2543 2556 #endif /* MONSTER_FLOW */2557 2558 2544 2559 2545 … … 2708 2694 static bool find_safety(int m_idx, int *yp, int *xp) 2709 2695 { 2710 2711 #ifdef MONSTER_FLOW2712 2713 2696 monster_type *m_ptr = &mon_list[m_idx]; 2714 2697 … … 2784 2767 } 2785 2768 2786 #endif /* MONSTER_FLOW */2787 2788 2769 /* No safe place */ 2789 2770 return (FALSE); … … 2895 2876 bool done = FALSE; 2896 2877 2897 #ifdef MONSTER_FLOW2898 2899 2878 /* Flow towards the player */ 2900 2879 if (adult_ai_sound) … … 2903 2882 (void)get_moves_aux(m_idx, &y2, &x2); 2904 2883 } 2905 2906 #endif /* MONSTER_FLOW */2907 2884 2908 2885 /* Extract the "pseudo-direction" */ … … 2952 2929 } 2953 2930 2954 #ifdef MONSTER_FLOW2955 2956 2931 else 2957 2932 { … … 2963 2938 } 2964 2939 } 2965 2966 #endif /* MONSTER_FLOW */2967 2940 2968 2941 done = TRUE; … … 4086 4059 4087 4060 4088 #ifdef MONSTER_FLOW4089 4090 4061 static bool monster_can_flow(int m_idx) 4091 4062 { … … 4111 4082 return FALSE; 4112 4083 } 4113 4114 #else /* MONSTER_FLOW */4115 4116 static bool monster_can_flow(int m_idx)4117 {4118 /* Unused parameter */4119 (void)m_idx;4120 4121 return FALSE;4122 }4123 4124 #endif /* MONSTER_FLOW */4125 4084 4126 4085 trunk/src/monster2.c
r507 r520 2391 2391 void update_smart_learn(int m_idx, int what) 2392 2392 { 2393 2394 #ifdef DRS_SMART_OPTIONS2395 2396 2393 monster_type *m_ptr = &mon_list[m_idx]; 2397 2394 … … 2531 2528 } 2532 2529 } 2533 2534 #endif /* DRS_SMART_OPTIONS */ 2535 2536 } 2537 2538 2530 } 2531 2532 trunk/src/types.h
r489 r520 552 552 s16b hold_o_idx; /* Object being held (if any) */ 553 553 554 #ifdef DRS_SMART_OPTIONS555 556 554 u32b smart; /* Field for "adult_ai_learn" */ 557 558 #endif /* DRS_SMART_OPTIONS */559 560 555 }; 561 556 trunk/src/variable.c
r500 r520 423 423 424 424 425 #ifdef MONSTER_FLOW426 427 425 /* 428 426 * Array[DUNGEON_HGT][DUNGEON_WID] of cave grid flow "cost" values … … 434 432 */ 435 433 byte (*cave_when)[DUNGEON_WID]; 436 437 #endif /* MONSTER_FLOW */438 434 439 435 trunk/src/wizard2.c
r507 r520 28 28 static void do_cmd_wiz_hack_ben(void) 29 29 { 30 31 #ifdef MONSTER_FLOW32 33 30 int py = p_ptr->py; 34 31 int px = p_ptr->px; … … 88 85 /* Redraw map */ 89 86 prt_map(); 90 91 #else /* MONSTER_FLOW */92 93 /* Oops */94 msg_print("Oops");95 96 #endif /* MONSTER_FLOW */97 98 87 } 99 88
