Changeset 755
- Timestamp:
- 03/09/08 17:16:25 (7 months ago)
- Files:
-
- trunk/src/cmd6.c (modified) (2 diffs)
- trunk/src/effects.c (modified) (9 diffs)
- trunk/src/effects.h (modified) (1 diff)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/spells2.c (modified) (15 diffs)
- trunk/src/wizard.c (modified) (1 diff)
- trunk/src/x-spell.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd6.c
r721 r755 38 38 case TV_WAND: msg = "use the wand"; what = "wand"; break; 39 39 case TV_STAFF: msg = "use the staff"; what = "staff"; break; 40 default: msg = "activate eit"; break;40 default: msg = "activate it"; break; 41 41 } 42 42 … … 164 164 165 165 /* Do effect */ 166 used = effect_do(effect, &ident, dir, beam_chance(o_ptr->tval));166 used = effect_do(effect, &ident, was_aware, dir, beam_chance(o_ptr->tval)); 167 167 168 168 /* Food feeds the player */ trunk/src/effects.c
r752 r755 144 144 * Do an effect, given an object. 145 145 */ 146 bool effect_do(effect_type effect, bool *ident, int dir, int beam)146 bool effect_do(effect_type effect, bool *ident, bool aware, int dir, int beam) 147 147 { 148 148 int py = p_ptr->py; … … 595 595 (void)do_inc_stat(A_INT); 596 596 (void)do_inc_stat(A_WIS); 597 (void)detect_traps( );598 (void)detect_doorstairs( );599 (void)detect_treasure( );597 (void)detect_traps(TRUE); 598 (void)detect_doorstairs(TRUE); 599 (void)detect_treasure(TRUE); 600 600 identify_pack(); 601 601 self_knowledge(TRUE); … … 678 678 case EF_DETECT_TREASURE: 679 679 { 680 if (detect_treasure( )) *ident = TRUE;680 if (detect_treasure(aware)) *ident = TRUE; 681 681 return TRUE; 682 682 } … … 684 684 case EF_DETECT_TRAP: 685 685 { 686 if (detect_traps( )) *ident = TRUE;686 if (detect_traps(aware)) *ident = TRUE; 687 687 return TRUE; 688 688 } … … 690 690 case EF_DETECT_DOORSTAIR: 691 691 { 692 if (detect_doorstairs( )) *ident = TRUE;692 if (detect_doorstairs(aware)) *ident = TRUE; 693 693 return TRUE; 694 694 } … … 696 696 case EF_DETECT_INVIS: 697 697 { 698 if (detect_monsters_invis( )) *ident = TRUE;698 if (detect_monsters_invis(aware)) *ident = TRUE; 699 699 return TRUE; 700 700 } … … 702 702 case EF_DETECT_EVIL: 703 703 { 704 if (detect_monsters_evil( )) *ident = TRUE;704 if (detect_monsters_evil(aware)) *ident = TRUE; 705 705 return TRUE; 706 706 } … … 708 708 case EF_DETECT_ALL: 709 709 { 710 if (detect_all( )) *ident = TRUE;710 if (detect_all(aware)) *ident = TRUE; 711 711 return TRUE; 712 712 } … … 1010 1010 *ident = TRUE; 1011 1011 wiz_lite(); 1012 (void)detect_traps( );1013 (void)detect_doorstairs( );1012 (void)detect_traps(TRUE); 1013 (void)detect_doorstairs(TRUE); 1014 1014 return TRUE; 1015 1015 } trunk/src/effects.h
r721 r755 31 31 /*** Functions ***/ 32 32 33 bool effect_do(effect_type effect, bool *ident, int dir, int beam);33 bool effect_do(effect_type effect, bool *ident, bool aware, int dir, int beam); 34 34 bool effect_aim(effect_type effect); 35 35 const char *effect_desc(effect_type effect); trunk/src/externs.h
r728 r755 475 475 extern bool lose_all_info(void); 476 476 extern void set_recall(void); 477 extern bool detect_traps( void);478 extern bool detect_doorstairs( void);479 extern bool detect_treasure( void);480 extern bool detect_objects_magic( void);481 extern bool detect_monsters_normal( void);482 extern bool detect_monsters_invis( void);483 extern bool detect_monsters_evil( void);484 extern bool detect_all( void);477 extern bool detect_traps(bool aware); 478 extern bool detect_doorstairs(bool aware); 479 extern bool detect_treasure(bool aware); 480 extern bool detect_objects_magic(bool aware); 481 extern bool detect_monsters_normal(bool aware); 482 extern bool detect_monsters_invis(bool aware); 483 extern bool detect_monsters_evil(bool aware); 484 extern bool detect_all(bool aware); 485 485 extern void stair_creation(void); 486 486 extern bool enchant(object_type *o_ptr, int n, int eflag); trunk/src/spells2.c
r725 r755 1017 1017 * Detect traps around the player. 1018 1018 */ 1019 bool detect_traps( void)1019 bool detect_traps(bool aware) 1020 1020 { 1021 1021 int y, x; … … 1070 1070 if (detect) 1071 1071 msg_print("You sense the presence of traps!"); 1072 else 1073 /* Trap detection always makes you aware, even if no traps are present */ 1074 msg_print("You sense no traps."); 1072 1075 1073 1076 /* Mark the redraw flag */ … … 1083 1086 * Detect doors and stairs around the player. 1084 1087 */ 1085 bool detect_doorstairs( void)1088 bool detect_doorstairs(bool aware) 1086 1089 { 1087 1090 int y, x; … … 1149 1152 else if (!doors && stairs) msg_print("You sense the presence of stairs!"); 1150 1153 else if (doors && stairs) msg_print("You sense the presence of doors and stairs!"); 1154 else if (aware && !doors && !stairs) msg_print("You sense no doors or stairs."); 1151 1155 1152 1156 /* Result */ … … 1158 1162 * Detect all treasure around the player. 1159 1163 */ 1160 bool detect_treasure( void)1164 bool detect_treasure(bool aware) 1161 1165 { 1162 1166 int i; … … 1248 1252 msg_print("You sense the presence of objects!"); 1249 1253 1254 if (aware && !gold_object && !gold_buried && !objects) 1255 msg_print("You sense no treasure or objects."); 1256 1250 1257 return (gold_object || gold_buried || objects); 1251 1258 } … … 1261 1268 * It can probably be argued that this function is now too powerful. 1262 1269 */ 1263 bool detect_objects_magic( void)1270 bool detect_objects_magic(bool aware) 1264 1271 { 1265 1272 int i, y, x, tv; … … 1323 1330 if (detect) 1324 1331 msg_print("You sense the presence of magic objects!"); 1332 else if (aware && !detect) 1333 msg_print("You sense no magic objects."); 1325 1334 1326 1335 return detect; … … 1331 1340 * Detect "normal" monsters around the player. 1332 1341 */ 1333 bool detect_monsters_normal( void)1342 bool detect_monsters_normal(bool aware) 1334 1343 { 1335 1344 int i, y, x; … … 1385 1394 if (flag) 1386 1395 msg_print("You sense the presence of monsters!"); 1387 1396 else if (aware && !flag) 1397 msg_print("You sense no monsters."); 1398 1388 1399 /* Result */ 1389 1400 return flag; … … 1394 1405 * Detect "invisible" monsters around the player. 1395 1406 */ 1396 bool detect_monsters_invis( void)1407 bool detect_monsters_invis(bool aware) 1397 1408 { 1398 1409 int i, y, x; … … 1457 1468 if (flag) 1458 1469 msg_print("You sense the presence of invisible creatures!"); 1470 else if (aware && !flag) 1471 msg_print("You sense no invisible creatures."); 1459 1472 1460 1473 return (flag); … … 1466 1479 * Detect "evil" monsters around the player. 1467 1480 */ 1468 bool detect_monsters_evil( void)1481 bool detect_monsters_evil(bool aware) 1469 1482 { 1470 1483 int i, y, x; … … 1529 1542 if (flag) 1530 1543 msg_print("You sense the presence of evil creatures!"); 1544 else if (aware && !flag) 1545 msg_print("You sense no evil creatures."); 1531 1546 1532 1547 return flag; … … 1538 1553 * Detect everything 1539 1554 */ 1540 bool detect_all( void)1555 bool detect_all(bool aware) 1541 1556 { 1542 1557 bool detect = FALSE; 1543 1558 1544 1559 /* Detect everything */ 1545 if (detect_traps( )) detect = TRUE;1546 if (detect_doorstairs( )) detect = TRUE;1547 if (detect_treasure( )) detect = TRUE;1548 if (detect_monsters_invis( )) detect = TRUE;1549 if (detect_monsters_normal( )) detect = TRUE;1560 if (detect_traps(aware)) detect = TRUE; 1561 if (detect_doorstairs(aware)) detect = TRUE; 1562 if (detect_treasure(aware)) detect = TRUE; 1563 if (detect_monsters_invis(aware)) detect = TRUE; 1564 if (detect_monsters_normal(aware)) detect = TRUE; 1550 1565 1551 1566 /* Result */ trunk/src/wizard.c
r673 r755 1539 1539 case 'd': 1540 1540 { 1541 detect_all( );1541 detect_all(TRUE); 1542 1542 break; 1543 1543 } trunk/src/x-spell.c
r580 r755 491 491 case SPELL_DETECT_MONSTERS: 492 492 { 493 (void)detect_monsters_normal( );493 (void)detect_monsters_normal(TRUE); 494 494 break; 495 495 } … … 509 509 case SPELL_TREASURE_DETECTION: 510 510 { 511 (void)detect_treasure( );511 (void)detect_treasure(TRUE); 512 512 break; 513 513 } … … 523 523 case SPELL_FIND_TRAPS_DOORS: 524 524 { 525 (void)detect_traps( );526 (void)detect_doorstairs( );525 (void)detect_traps(TRUE); 526 (void)detect_doorstairs(TRUE); 527 527 break; 528 528 } … … 767 767 case SPELL_DETECT_INVISIBLE: 768 768 { 769 (void)detect_monsters_invis( );769 (void)detect_monsters_invis(TRUE); 770 770 break; 771 771 } … … 773 773 case SPELL_DETECT_ENCHANTMENT: 774 774 { 775 (void)detect_objects_magic( );775 (void)detect_objects_magic(TRUE); 776 776 break; 777 777 } … … 923 923 case PRAYER_DETECT_EVIL: 924 924 { 925 (void)detect_monsters_evil( );925 (void)detect_monsters_evil(TRUE); 926 926 break; 927 927 } … … 954 954 case PRAYER_FIND_TRAPS: 955 955 { 956 (void)detect_traps( );956 (void)detect_traps(TRUE); 957 957 break; 958 958 } … … 960 960 case PRAYER_DETECT_DOORS_STAIRS: 961 961 { 962 (void)detect_doorstairs( );962 (void)detect_doorstairs(TRUE); 963 963 break; 964 964 } … … 1128 1128 case PRAYER_DETECT_MONSTERS: 1129 1129 { 1130 (void)detect_monsters_normal( );1130 (void)detect_monsters_normal(TRUE); 1131 1131 break; 1132 1132 } … … 1134 1134 case PRAYER_DETECTION: 1135 1135 { 1136 (void)detect_all( );1136 (void)detect_all(TRUE); 1137 1137 break; 1138 1138 }
