Changeset 449
- Timestamp:
- 08/05/07 19:05:44 (1 year ago)
- Files:
-
- trunk/src/cmd2.c (modified) (2 diffs)
- trunk/src/defines.h (modified) (1 diff)
- trunk/src/dungeon.c (modified) (1 diff)
- trunk/src/effects.c (modified) (2 diffs)
- trunk/src/externs.h (modified) (2 diffs)
- trunk/src/generate.c (modified) (15 diffs)
- trunk/src/object2.c (modified) (15 diffs)
- trunk/src/spells1.c (modified) (3 diffs)
- trunk/src/variable.c (modified) (1 diff)
- trunk/src/wizard2.c (modified) (5 diffs)
- trunk/src/xtra2.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd2.c
r446 r449 1134 1134 { 1135 1135 /* Place some gold */ 1136 place_gold(y, x );1136 place_gold(y, x, p_ptr->depth); 1137 1137 1138 1138 /* Message */ … … 1178 1178 { 1179 1179 /* Create a simple object */ 1180 place_object(y, x, FALSE, FALSE);1180 place_object(y, x, p_ptr->depth, FALSE, FALSE); 1181 1181 1182 1182 /* Observe the new object */ trunk/src/defines.h
r448 r449 256 256 257 257 /* 258 * There is a 1/20 (5%) chance of inflating the requested object _level258 * There is a 1/20 (5%) chance of inflating the requested object level 259 259 * during the creation of an object (see "get_obj_num()" in "object.c"). 260 260 * Lower values yield better objects more often. trunk/src/dungeon.c
r399 r449 1634 1634 /* Reset the monster generation level */ 1635 1635 monster_level = p_ptr->depth; 1636 1637 /* Reset the object generation level */1638 object_level = p_ptr->depth;1639 1636 1640 1637 /* Main loop */ trunk/src/effects.c
r431 r449 821 821 case EF_ACQUIRE: 822 822 { 823 acquirement(py, px, 1, TRUE);823 acquirement(py, px, p_ptr->depth, 1, TRUE); 824 824 *ident = TRUE; 825 825 return TRUE; … … 828 828 case EF_ACQUIRE2: 829 829 { 830 acquirement(py, px, randint(2) + 1, TRUE);830 acquirement(py, px, p_ptr->depth, randint(2) + 1, TRUE); 831 831 *ident = TRUE; 832 832 return TRUE; trunk/src/externs.h
r443 r449 108 108 extern u32b seed_town; 109 109 extern s16b num_repro; 110 extern s16b object_level;111 110 extern s16b monster_level; 112 111 extern char summon_kin_type; … … 448 447 extern s16b floor_carry(int y, int x, object_type *j_ptr); 449 448 extern void drop_near(object_type *j_ptr, int chance, int y, int x); 450 extern void acquirement(int y1, int x1, int num, bool great);451 extern void place_object(int y, int x, bool good, bool great);452 extern void place_gold(int y, int x );449 extern void acquirement(int y1, int x1, int level, int num, bool great); 450 extern void place_object(int y, int x, int level, bool good, bool great); 451 extern void place_gold(int y, int x, int level); 453 452 extern void pick_trap(int y, int x); 454 453 extern void place_trap(int y, int x); trunk/src/generate.c
r307 r449 1214 1214 * Allocates some objects (using "place" and "type") 1215 1215 */ 1216 static void alloc_object(int set, int typ, int num )1216 static void alloc_object(int set, int typ, int num, int depth) 1217 1217 { 1218 1218 int y, x, k; … … 1263 1263 case ALLOC_TYP_GOLD: 1264 1264 { 1265 place_gold(y, x );1265 place_gold(y, x, depth); 1266 1266 break; 1267 1267 } … … 1269 1269 case ALLOC_TYP_OBJECT: 1270 1270 { 1271 place_object(y, x, FALSE, FALSE);1271 place_object(y, x, depth, FALSE, FALSE); 1272 1272 break; 1273 1273 } … … 1620 1620 if (rand_int(100) < 67) 1621 1621 { 1622 place_object(y, x, FALSE, FALSE);1622 place_object(y, x, depth, FALSE, FALSE); 1623 1623 } 1624 1624 … … 1626 1626 else 1627 1627 { 1628 place_gold(y, x );1628 place_gold(y, x, depth); 1629 1629 } 1630 1630 … … 2433 2433 generate_hole(y1b, x1a, y2b, x2a, FEAT_SECRET); 2434 2434 2435 /* Place a treasure in the vault */ 2436 object_level = p_ptr->depth + 2; 2437 place_object(y0, x0, FALSE, FALSE); 2438 object_level = p_ptr->depth; 2435 /* Place a slightly out-of-depth treasure in the vault */ 2436 place_object(y0, x0, p_ptr->depth + 2, FALSE, FALSE); 2439 2437 2440 2438 /* Let's guard the treasure well */ … … 2571 2569 spread_monsters('\0', p_ptr->depth + 2, 4, y0, x0, 2, 6); 2572 2570 2573 /* Object (80%) */2571 /* Object (80%), slightly out-of-depth value */ 2574 2572 if (rand_int(100) < 80) 2575 2573 { 2576 object_level = p_ptr->depth + 2; 2577 place_object(y0, x0, FALSE, FALSE); 2578 object_level = p_ptr->depth; 2574 place_object(y0, x0, p_ptr->depth + 2, FALSE, FALSE); 2579 2575 } 2580 2576 … … 2639 2635 2640 2636 /* Objects */ 2641 if (rand_int(3) == 0) place_object(y0, x0 - 2, FALSE, FALSE); 2642 if (rand_int(3) == 0) place_object(y0, x0 + 2, FALSE, FALSE); 2637 if (rand_int(3) == 0) 2638 place_object(y0, x0 - 2, p_ptr->depth, FALSE, FALSE); 2639 if (rand_int(3) == 0) 2640 place_object(y0, x0 + 2, p_ptr->depth, FALSE, FALSE); 2643 2641 } 2644 2642 … … 3027 3025 if (rand_int(100) < 75) 3028 3026 { 3029 place_object(y, x, FALSE, FALSE);3027 place_object(y, x, p_ptr->depth, FALSE, FALSE); 3030 3028 } 3031 3029 else … … 3088 3086 place_monster(y, x, TRUE, TRUE); 3089 3087 monster_level = p_ptr->depth; 3090 object_level = p_ptr->depth + 7; 3091 place_object(y, x, TRUE, FALSE); 3092 object_level = p_ptr->depth; 3088 place_object(y, x, p_ptr->depth + 7, TRUE, FALSE); 3093 3089 break; 3094 3090 } … … 3100 3096 place_monster(y, x, TRUE, TRUE); 3101 3097 monster_level = p_ptr->depth; 3102 object_level = p_ptr->depth + 20; 3103 place_object(y, x, TRUE, TRUE); 3104 object_level = p_ptr->depth; 3098 place_object(y, x, p_ptr->depth + 20, TRUE, TRUE); 3105 3099 break; 3106 3100 } … … 3117 3111 if (rand_int(100) < 50) 3118 3112 { 3119 object_level = p_ptr->depth + 7; 3120 place_object(y, x, FALSE, FALSE); 3121 object_level = p_ptr->depth; 3113 /* Moderately out-of-depth item */ 3114 place_object(y, x, p_ptr->depth + 7, FALSE, FALSE); 3122 3115 } 3123 3116 break; … … 4744 4737 4745 4738 /* Put some rubble in corridors */ 4746 alloc_object(ALLOC_SET_CORR, ALLOC_TYP_RUBBLE, randint(k) );4739 alloc_object(ALLOC_SET_CORR, ALLOC_TYP_RUBBLE, randint(k), p_ptr->depth); 4747 4740 4748 4741 /* Place some traps in the dungeon */ 4749 alloc_object(ALLOC_SET_BOTH, ALLOC_TYP_TRAP, randint(k) );4742 alloc_object(ALLOC_SET_BOTH, ALLOC_TYP_TRAP, randint(k), p_ptr->depth); 4750 4743 4751 4744 … … 4803 4796 4804 4797 /* Put some objects in rooms */ 4805 alloc_object(ALLOC_SET_ROOM, ALLOC_TYP_OBJECT, Rand_normal(DUN_AMT_ROOM, 3)); 4798 alloc_object(ALLOC_SET_ROOM, 4799 ALLOC_TYP_OBJECT, Rand_normal(DUN_AMT_ROOM, 3), 4800 p_ptr->depth); 4806 4801 4807 4802 /* Put some objects/gold in the dungeon */ 4808 alloc_object(ALLOC_SET_BOTH, ALLOC_TYP_OBJECT, Rand_normal(DUN_AMT_ITEM, 3)); 4809 alloc_object(ALLOC_SET_BOTH, ALLOC_TYP_GOLD, Rand_normal(DUN_AMT_GOLD, 3)); 4803 alloc_object(ALLOC_SET_BOTH, 4804 ALLOC_TYP_OBJECT, Rand_normal(DUN_AMT_ITEM, 3), 4805 p_ptr->depth); 4806 alloc_object(ALLOC_SET_BOTH, 4807 ALLOC_TYP_GOLD, Rand_normal(DUN_AMT_GOLD, 3), 4808 p_ptr->depth); 4810 4809 } 4811 4810 … … 5116 5115 /* Reset the monster generation level */ 5117 5116 monster_level = p_ptr->depth; 5118 5119 /* Reset the object generation level */5120 object_level = p_ptr->depth;5121 5117 5122 5118 /* Nothing special here yet */ trunk/src/object2.c
r446 r449 660 660 661 661 size_t item; 662 663 662 u32b value; 664 663 … … 1584 1583 * an unenchanted item. 1585 1584 */ 1586 static int make_ego_item(object_type *o_ptr, bool only_good)1587 { 1588 int i, j , level;1585 static int make_ego_item(object_type *o_ptr, int level, bool only_good) 1586 { 1587 int i, j; 1589 1588 1590 1589 int e_idx; … … 1600 1599 if (o_ptr->name1) return (FALSE); 1601 1600 if (o_ptr->name2) return (FALSE); 1602 1603 level = object_level;1604 1601 1605 1602 /* Boost level (like with object base types) */ … … 1696 1693 * is always the first special artifact created. 1697 1694 */ 1698 static bool make_artifact_special(object_type *o_ptr )1695 static bool make_artifact_special(object_type *o_ptr, int level) 1699 1696 { 1700 1697 int i; … … 1737 1734 1738 1735 /* Enforce minimum "object" level (loosely) */ 1739 if (k_info[k_idx].level > object_level)1736 if (k_info[k_idx].level > level) 1740 1737 { 1741 1738 /* Get the "out-of-depth factor" */ 1742 int d = (k_info[k_idx].level - object_level) * 5;1739 int d = (k_info[k_idx].level - level) * 5; 1743 1740 1744 1741 /* Roll for out-of-depth creation */ … … 2609 2606 int ego_power; 2610 2607 2611 ego_power = make_ego_item(o_ptr, (bool)(good || great));2608 ego_power = make_ego_item(o_ptr, lev, (bool)(good || great)); 2612 2609 2613 2610 if (ego_power) power = ego_power; … … 2633 2630 int ego_power; 2634 2631 2635 ego_power = make_ego_item(o_ptr, (bool)(good || great));2632 ego_power = make_ego_item(o_ptr, lev, (bool)(good || great)); 2636 2633 2637 2634 if (ego_power) power = ego_power; … … 2655 2652 if ((power > 1) || (power < -1)) 2656 2653 { 2657 make_ego_item(o_ptr, (bool)(good || great));2654 make_ego_item(o_ptr, lev, (bool)(good || great)); 2658 2655 } 2659 2656 … … 2884 2881 2885 2882 /* Generate a special artifact, or a normal object */ 2886 if ((rand_int(prob) != 0) || !make_artifact_special(j_ptr ))2883 if ((rand_int(prob) != 0) || !make_artifact_special(j_ptr, lev)) 2887 2884 { 2888 2885 int k_idx; … … 3310 3307 * Scatter some "great" objects near the player 3311 3308 */ 3312 void acquirement(int y1, int x1, int num, bool great)3309 void acquirement(int y1, int x1, int level, int num, bool great) 3313 3310 { 3314 3311 object_type *i_ptr; … … 3325 3322 3326 3323 /* Make a good (or great) object (if possible) */ 3327 if (!make_object(i_ptr, object_level, TRUE, great)) continue;3324 if (!make_object(i_ptr, level, TRUE, great)) continue; 3328 3325 i_ptr->origin = ORIGIN_ACQUIRE; 3329 3326 i_ptr->origin_depth = p_ptr->depth; … … 3338 3335 * Attempt to place an object (normal or good/great) at the given location. 3339 3336 */ 3340 void place_object(int y, int x, bool good, bool great)3337 void place_object(int y, int x, int level, bool good, bool great) 3341 3338 { 3342 3339 object_type *i_ptr; … … 3356 3353 3357 3354 /* Make an object (if possible) */ 3358 if (make_object(i_ptr, object_level, good, great))3355 if (make_object(i_ptr, level, good, great)) 3359 3356 { 3360 3357 i_ptr->origin = ORIGIN_FLOOR; … … 3374 3371 * Places a treasure (Gold or Gems) at given location 3375 3372 */ 3376 void place_gold(int y, int x )3373 void place_gold(int y, int x, int level) 3377 3374 { 3378 3375 object_type *i_ptr; … … 3392 3389 3393 3390 /* Make some gold */ 3394 if (make_gold(i_ptr, object_level))3391 if (make_gold(i_ptr, level)) 3395 3392 { 3396 3393 /* Give it to the floor */ trunk/src/spells1.c
r433 r449 71 71 void teleport_away(int m_idx, int dis) 72 72 { 73 int ny , nx, oy, ox, d, i, min;73 int ny = 0, nx = 0, oy, ox, d, i, min; 74 74 75 75 bool look = TRUE; … … 1630 1630 1631 1631 /* Place some gold */ 1632 place_gold(y, x );1632 place_gold(y, x, p_ptr->depth); 1633 1633 } 1634 1634 … … 1677 1677 1678 1678 /* Place gold */ 1679 place_object(y, x, FALSE, FALSE);1679 place_object(y, x, p_ptr->depth, FALSE, FALSE); 1680 1680 } 1681 1681 } trunk/src/variable.c
r410 r449 73 73 74 74 s16b num_repro; /* Current reproducer count */ 75 s16b object_level; /* Current object creation level */76 75 s16b monster_level; /* Current monster creation level */ 77 76 trunk/src/wizard2.c
r446 r449 665 665 * statistics on item creation relative to the initial item. 666 666 */ 667 static void wiz_statistics(object_type *o_ptr )667 static void wiz_statistics(object_type *o_ptr, int level) 668 668 { 669 669 long i, matches, better, worse, other; … … 762 762 763 763 /* Create an object */ 764 make_object(i_ptr, object_level, good, great);764 make_object(i_ptr, level, good, great); 765 765 766 766 … … 938 938 if (ch == 's' || ch == 'S') 939 939 { 940 wiz_statistics(i_ptr );940 wiz_statistics(i_ptr, p_ptr->depth); 941 941 } 942 942 … … 1567 1567 { 1568 1568 if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; 1569 acquirement(py, px, p_ptr-> command_arg, FALSE);1569 acquirement(py, px, p_ptr->depth, p_ptr->command_arg, FALSE); 1570 1570 break; 1571 1571 } … … 1668 1668 { 1669 1669 if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; 1670 acquirement(py, px, p_ptr-> command_arg, TRUE);1670 acquirement(py, px, p_ptr->depth, p_ptr->command_arg, TRUE); 1671 1671 break; 1672 1672 } trunk/src/xtra2.c
r443 r449 1157 1157 void monster_death(int m_idx) 1158 1158 { 1159 int i, j, y, x ;1159 int i, j, y, x, level; 1160 1160 1161 1161 int dump_item = 0; … … 1274 1274 coin_type = force_coin; 1275 1275 1276 /* Average dungeon and monster levels*/1277 object_level = (p_ptr->depth + r_ptr->level) / 2;1276 /* Average monster level and current depth */ 1277 level = (p_ptr->depth + r_ptr->level) / 2; 1278 1278 1279 1279 /* Drop some objects */ … … 1290 1290 { 1291 1291 /* Make some gold */ 1292 if (!make_gold(i_ptr, object_level)) continue;1292 if (!make_gold(i_ptr, level)) continue; 1293 1293 1294 1294 /* Assume seen XXX XXX XXX */ … … 1300 1300 { 1301 1301 /* Make an object */ 1302 if (!make_object(i_ptr, object_level, good, great)) continue;1302 if (!make_object(i_ptr, level, good, great)) continue; 1303 1303 1304 1304 /* Assume seen XXX XXX XXX */ … … 1315 1315 } 1316 1316 1317 /* Reset the object level */1318 object_level = p_ptr->depth;1319 1320 1317 /* Reset "coin" type */ 1321 1318 coin_type = 0; 1322 1319 1323 1324 1320 /* Take note of any dropped treasure */ 1325 1321 if (visible && (dump_item || dump_gold)) … … 1329 1325 } 1330 1326 1331 1332 1327 /* Update monster list window */ 1333 1328 p_ptr->window |= PW_MONLIST; … … 1335 1330 /* Only process "Quest Monsters" */ 1336 1331 if (!(r_ptr->flags1 & (RF1_QUESTOR))) return; 1337 1338 1332 1339 1333 /* Hack -- Mark quests as complete */
