Changeset 580
- Timestamp:
- 09/28/07 09:19:45 (1 year ago)
- Files:
-
- trunk (modified) (3 props)
- trunk/lib/edit/object.txt (modified) (5 diffs)
- trunk/lib/edit/p_class.txt (modified) (3 diffs)
- trunk/lib/edit/spell.txt (modified) (1 diff)
- trunk/src/effects.c (modified) (4 diffs)
- trunk/src/effects.h (modified) (1 diff)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/load.c (modified) (2 diffs)
- trunk/src/spells2.c (modified) (13 diffs)
- trunk/src/x-spell.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk
- Property bzr:revision-id:v3-trunk0 set to
513 me@rephial.org-20070928112818-0w6plp46k8exdip2 - Property bzr:file-ids set
- Property bzr:revision-info set to
timestamp: 2007-09-28 12:28:18.029999971 +0100
committer: Andrew Sidwell <me@rephial.org>
properties:
branch-nick: 263-radius
- Property bzr:revision-id:v3-trunk0 set to
trunk/lib/edit/object.txt
r567 r580 1549 1549 G:?:w 1550 1550 I:70:26:0 1551 W:0:0:5: 151551 W:0:0:5:30 1552 1552 A:100:0 to 100 1553 1553 F:EASY_KNOW 1554 E:DET_ GOLD1554 E:DET_TREASURE 1555 1555 1556 1556 N:193:Object Detection … … 1558 1558 I:70:27:0 1559 1559 W:0:0:5:15 1560 A:100:0 to 100 1561 F:EASY_KNOW 1562 E:DET_OBJ 1560 F:EASY_KNOW 1561 E:DET_TREASURE 1563 1562 1564 1563 N:194:Trap Detection … … 1577 1576 G:?:w 1578 1577 I:70:29:0 1579 W:5:0:5: 351578 W:5:0:5:60 1580 1579 A:100:5 to 100 1581 1580 F:EASY_KNOW … … 2424 2423 W:5:0:50:400 2425 2424 A:100:5 to 100 2426 E:DET_ GOLD:352425 E:DET_TREASURE:50 2427 2426 2428 2427 N:302:Object Location … … 2430 2429 I:66:29:0 2431 2430 W:5:0:50:200 2432 A:100:5 to 100 2433 E:DET_OBJ:35 2431 E:DET_TREASURE:35 2434 2432 2435 2433 trunk/lib/edit/p_class.txt
r305 r580 116 116 B:5:3:3:25:3 117 117 B:6:99:0:0:0 118 B:7:99:0:0:0119 118 B:8:11:7:25:6 120 119 B:9:15:5:40:6 … … 288 287 B:5:11:4:65:1 289 288 B:6:10:3:60:1 290 B:7:12:4:65:1291 289 B:8:18:18:60:2 292 290 B:9:20:10:50:4 … … 375 373 B:5:5:3:40:1 376 374 B:6:99:0:0:0 377 B:7:99:0:0:0378 375 B:8:23:25:90:3 379 376 B:9:25:15:50:4 trunk/lib/edit/spell.txt
r367 r580 78 78 I:90:0:4 79 79 D:Detects all treasure in the immediate area. 80 81 N:7:Detect Objects82 I:90:0:683 D:Detects all objects in the immediate area.84 80 85 81 N:8:Identify trunk/src/effects.c
r558 r580 565 565 (void)do_inc_stat(A_WIS); 566 566 (void)detect_traps(); 567 (void)detect_doors(); 568 (void)detect_stairs(); 567 (void)detect_doorstairs(); 569 568 (void)detect_treasure(); 570 (void)detect_objects_gold();571 (void)detect_objects_normal();572 569 identify_pack(); 573 570 self_knowledge(TRUE); … … 627 624 } 628 625 629 630 case EF_DET_GOLD: 626 case EF_DET_TREASURE: 631 627 { 632 628 if (detect_treasure()) *ident = TRUE; 633 if (detect_objects_gold()) *ident = TRUE;634 return TRUE;635 }636 637 case EF_DET_OBJ:638 {639 if (detect_objects_normal()) *ident = TRUE;640 629 return TRUE; 641 630 } … … 649 638 case EF_DET_DOORSTAIR: 650 639 { 651 if (detect_doors()) *ident = TRUE; 652 if (detect_stairs()) *ident = TRUE; 640 if (detect_doorstairs()) *ident = TRUE; 653 641 return TRUE; 654 642 } … … 971 959 wiz_lite(); 972 960 (void)detect_traps(); 973 (void)detect_doors(); 974 (void)detect_stairs(); 961 (void)detect_doorstairs(); 975 962 return TRUE; 976 963 } trunk/src/effects.h
r543 r580 122 122 EFFECT(RESIST_ALL, FALSE, "grants resistance to everything!!!") 123 123 124 EFFECT(DET_GOLD, FALSE, "detects all treasure in the surrounding area") 125 EFFECT(DET_OBJ, FALSE, "detects all objects in the surrounding area") 124 EFFECT(DET_TREASURE, FALSE, "detects all gold and objects on the level") 126 125 EFFECT(DET_TRAP, FALSE, "detects all traps in the surrounding area") 127 EFFECT(DET_DOORSTAIR, FALSE, "detects all doors and stairs in the surrounding area")126 EFFECT(DET_DOORSTAIR, FALSE, "detects all doors and stairs on the level") 128 127 EFFECT(DET_INVIS, FALSE, "detects all invisible creatures in the surrounding area") 129 128 EFFECT(DET_EVIL, FALSE, "detects all evil creatures in the immidiate area") trunk/src/externs.h
r567 r580 535 535 extern void set_recall(void); 536 536 extern bool detect_traps(void); 537 extern bool detect_doors(void); 538 extern bool detect_stairs(void); 537 extern bool detect_doorstairs(void); 539 538 extern bool detect_treasure(void); 540 extern bool detect_objects_gold(void);541 extern bool detect_objects_normal(void);542 539 extern bool detect_objects_magic(void); 543 540 extern bool detect_monsters_normal(void); trunk/src/load.c
r557 r580 1091 1091 else 1092 1092 { 1093 int cnt; 1094 1093 1095 /* Read the number of spells */ 1094 1096 rd_u16b(&tmp16u); … … 1100 1102 1101 1103 /* Read the spell flags */ 1102 for (i = 0; i < tmp16u; i++) 1103 { 1104 rd_byte(&p_ptr->spell_flags[i]); 1104 for (i = 0, cnt = 0; i < tmp16u; i++, cnt++) 1105 { 1106 rd_byte(&p_ptr->spell_flags[cnt]); 1107 if (p_ptr->spell_order[cnt] == 7) 1108 cnt--; 1105 1109 } 1106 1110 1107 1111 /* Read the spell order */ 1108 for (i = 0; i < tmp16u; i++) 1109 { 1110 rd_byte(&p_ptr->spell_order[i]); 1112 for (i = 0, cnt = 0; i < tmp16u; i++, cnt++) 1113 { 1114 rd_byte(&p_ptr->spell_order[cnt]); 1115 if (p_ptr->spell_order[cnt] == 7) 1116 cnt--; 1111 1117 } 1112 1118 } trunk/src/spells2.c
r532 r580 1012 1012 1013 1013 /* 1014 * Detect all doors inside radius 22.1015 */ 1016 bool detect_doors (void)1014 * Detect all doors and stairs. 1015 */ 1016 bool detect_doorstairs(void) 1017 1017 { 1018 1018 int y, x; 1019 1020 bool detect = FALSE; 1019 bool doors = FALSE, stairs = FALSE; 1021 1020 1022 1021 … … 1028 1027 if (!in_bounds_fully(y, x)) continue; 1029 1028 1030 /* Restrict to being in a certain radius */1031 if (distance(p_ptr->py, p_ptr->px, y, x) > DET_RADIUS) continue;1032 1033 1029 /* Detect secret doors */ 1034 1030 if (cave_feat[y][x] == FEAT_SECRET) 1035 {1036 /* Pick a door */1037 1031 place_closed_door(y, x); 1038 }1039 1032 1040 1033 /* Detect doors */ … … 1051 1044 1052 1045 /* Obvious */ 1053 d etect= TRUE;1046 doors = TRUE; 1054 1047 } 1055 }1056 }1057 1058 /* Describe */1059 if (detect)1060 {1061 msg_print("You sense the presence of doors!");1062 }1063 1064 /* Result */1065 return (detect);1066 }1067 1068 1069 /*1070 * Detect all stairs inside radius 22.1071 */1072 bool detect_stairs(void)1073 {1074 int y, x;1075 1076 bool detect = FALSE;1077 1078 1079 /* Scan the dungeon */1080 for (y = 1; y < DUNGEON_HGT - 1; y++)1081 {1082 for (x = 1; x < DUNGEON_WID - 1; x++)1083 {1084 if (!in_bounds_fully(y, x)) continue;1085 1086 /* Restrict to being in a certain radius */1087 if (distance(p_ptr->py, p_ptr->px, y, x) > DET_RADIUS) continue;1088 1048 1089 1049 /* Detect stairs */ … … 1098 1058 1099 1059 /* Obvious */ 1100 detect= TRUE;1060 stairs = TRUE; 1101 1061 } 1062 1102 1063 } 1103 1064 } 1104 1065 1105 1066 /* Describe */ 1106 if (detect) 1107 { 1108 msg_print("You sense the presence of stairs!"); 1109 } 1067 if (doors && !stairs) msg_print("You sense the presence of doors!"); 1068 else if (!doors && stairs) msg_print("You sense the presence of stairs!"); 1069 else if (doors && stairs) msg_print("You sense the presence of doors and stairs!"); 1110 1070 1111 1071 /* Result */ 1112 return (d etect);1072 return (doors || stairs); 1113 1073 } 1114 1074 … … 1119 1079 bool detect_treasure(void) 1120 1080 { 1081 int i; 1121 1082 int y, x; 1122 1083 1123 bool detect = FALSE; 1084 bool gold_buried = FALSE; 1085 bool gold_object = FALSE; 1086 bool objects = FALSE; 1124 1087 1125 1088 … … 1130 1093 { 1131 1094 if (!in_bounds_fully(y, x)) continue; 1132 1133 /* Restrict to being in a certain radius */1134 if (distance(p_ptr->py, p_ptr->px, y, x) > DET_RADIUS) continue;1135 1095 1136 1096 /* Notice embedded gold */ … … 1153 1113 1154 1114 /* Detect */ 1155 detect= TRUE;1115 gold_buried = TRUE; 1156 1116 } 1157 1117 } 1158 1118 } 1159 1160 /* Describe */1161 if (detect)1162 {1163 msg_print("You sense the presence of buried treasure!");1164 }1165 1166 /* Result */1167 return (detect);1168 }1169 1170 1171 1172 /*1173 * Detect all "gold" objects inside radius 22.1174 */1175 bool detect_objects_gold(void)1176 {1177 int i, y, x;1178 1179 bool detect = FALSE;1180 1181 1119 1182 1120 /* Scan objects */ … … 1195 1133 x = o_ptr->ix; 1196 1134 1197 /* Only detect nearby objects */ 1198 if (distance(p_ptr->py, p_ptr->px, y, x) > DET_RADIUS) continue; 1199 1200 /* Detect "gold" objects */ 1201 if (o_ptr->tval == TV_GOLD) 1202 { 1203 /* Hack -- memorize it */ 1204 o_ptr->marked = TRUE; 1205 1206 /* Redraw */ 1207 lite_spot(y, x); 1208 1209 /* Detect */ 1210 detect = TRUE; 1211 } 1212 } 1213 1214 /* Describe */ 1215 if (detect) 1216 { 1135 /* Hack -- memorize it */ 1136 o_ptr->marked = TRUE; 1137 1138 /* Redraw */ 1139 lite_spot(y, x); 1140 1141 /* Detect */ 1142 if (!squelch_hide_item(o_ptr)) 1143 objects = TRUE; 1144 } 1145 1146 if (gold_object) 1217 1147 msg_print("You sense the presence of treasure!"); 1218 } 1219 1220 /* Result */ 1221 return (detect); 1222 } 1223 1224 1225 /* 1226 * Detect all "normal" objects inisde radius 22. 1227 */ 1228 bool detect_objects_normal(void) 1229 { 1230 int i, y, x; 1231 1232 bool detect = FALSE; 1233 1234 1235 /* Scan objects */ 1236 for (i = 1; i < o_max; i++) 1237 { 1238 object_type *o_ptr = &o_list[i]; 1239 1240 /* Skip dead objects */ 1241 if (!o_ptr->k_idx) continue; 1242 1243 /* Skip held objects */ 1244 if (o_ptr->held_m_idx) continue; 1245 1246 /* Location */ 1247 y = o_ptr->iy; 1248 x = o_ptr->ix; 1249 1250 /* Only detect nearby objects */ 1251 if (distance(p_ptr->py, p_ptr->px, y, x) > DET_RADIUS) continue; 1252 1253 /* Detect "real" objects */ 1254 if (o_ptr->tval != TV_GOLD) 1255 { 1256 /* Hack -- memorize it */ 1257 o_ptr->marked = TRUE; 1258 1259 /* Redraw */ 1260 lite_spot(y, x); 1261 1262 /* Detect */ 1263 if (!squelch_hide_item(o_ptr)) 1264 detect = TRUE; 1265 } 1266 } 1267 1268 /* Describe */ 1269 if (detect) 1270 { 1148 1149 if (gold_buried) 1150 msg_print("You sense the presence of buried treasure!"); 1151 1152 if (objects) 1271 1153 msg_print("You sense the presence of objects!"); 1272 } 1273 1274 /* Result */ 1275 return (detect); 1154 1155 return (gold_object || gold_buried || objects); 1276 1156 } 1277 1157 … … 1334 1214 } 1335 1215 1336 /* Describe */1337 1216 if (detect) 1338 {1339 1217 msg_print("You sense the presence of magic objects!"); 1340 } 1341 1342 /* Return result */ 1343 return (detect); 1218 1219 return detect; 1344 1220 } 1345 1221 … … 1388 1264 } 1389 1265 1390 /* Describe */1391 1266 if (flag) 1392 {1393 /* Describe result */1394 1267 msg_print("You sense the presence of monsters!"); 1395 }1396 1268 1397 1269 /* Result */ 1398 return (flag);1270 return flag; 1399 1271 } 1400 1272 … … 1454 1326 } 1455 1327 1456 /* Describe */1457 1328 if (flag) 1458 {1459 /* Describe result */1460 1329 msg_print("You sense the presence of invisible creatures!"); 1461 } 1462 1463 /* Result */ 1330 1464 1331 return (flag); 1465 1332 } … … 1521 1388 } 1522 1389 1523 /* Describe */1524 1390 if (flag) 1525 {1526 /* Describe result */1527 1391 msg_print("You sense the presence of evil creatures!"); 1528 } 1529 1530 /* Result */ 1531 return (flag); 1392 1393 return flag; 1532 1394 } 1533 1395 … … 1543 1405 /* Detect everything */ 1544 1406 if (detect_traps()) detect = TRUE; 1545 if (detect_doors()) detect = TRUE; 1546 if (detect_stairs()) detect = TRUE; 1407 if (detect_doorstairs()) detect = TRUE; 1547 1408 if (detect_treasure()) detect = TRUE; 1548 if (detect_objects_gold()) detect = TRUE;1549 if (detect_objects_normal()) detect = TRUE;1550 1409 if (detect_monsters_invis()) detect = TRUE; 1551 1410 if (detect_monsters_normal()) detect = TRUE; trunk/src/x-spell.c
r507 r580 32 32 #define SPELL_CURE_LIGHT_WOUNDS 5 33 33 #define SPELL_TREASURE_DETECTION 6 34 #define SPELL_OBJECT_DETECTION 7 34 /* #define SPELL_OBJECT_DETECTION 7 */ 35 35 #define SPELL_IDENTIFY 8 36 36 #define SPELL_DETECT_INVISIBLE 9 … … 510 510 { 511 511 (void)detect_treasure(); 512 (void)detect_objects_gold();513 512 break; 514 513 } … … 522 521 } 523 522 524 case SPELL_OBJECT_DETECTION:525 {526 (void)detect_objects_normal();527 break;528 }529 530 523 case SPELL_FIND_TRAPS_DOORS: 531 524 { 532 525 (void)detect_traps(); 533 (void)detect_doors(); 534 (void)detect_stairs(); 526 (void)detect_doorstairs(); 535 527 break; 536 528 } … … 968 960 case PRAYER_DETECT_DOORS_STAIRS: 969 961 { 970 (void)detect_doors(); 971 (void)detect_stairs(); 962 (void)detect_doorstairs(); 972 963 break; 973 964 }
