Changeset 117
- Timestamp:
- 05/06/07 16:32:34 (1 year ago)
- Files:
-
- trunk/src/cmd3.c (modified) (2 diffs)
- trunk/src/defines.h (modified) (1 diff)
- trunk/src/dungeon.c (modified) (3 diffs)
- trunk/src/load.c (modified) (1 diff)
- trunk/src/object1.c (modified) (2 diffs)
- trunk/src/object2.c (modified) (4 diffs)
- trunk/src/save.c (modified) (1 diff)
- trunk/src/spells2.c (modified) (2 diffs)
- trunk/src/store.c (modified) (9 diffs)
- trunk/src/tables.c (modified) (3 diffs)
- trunk/src/types.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd3.c
r59 r117 289 289 msg_print("Oops! It feels deathly cold!"); 290 290 291 /* Remove special inscription, if any */ 292 if (o_ptr->discount >= INSCRIP_NULL) o_ptr->discount = 0; 293 294 /* Sense the object if allowed */ 295 if (o_ptr->discount == 0) o_ptr->discount = INSCRIP_CURSED; 291 /* Sense the object */ 292 o_ptr->pseudo = INSCRIP_CURSED; 296 293 297 294 /* The object has been "sensed" */ … … 577 574 /* Already sensed objects always get improved feelings */ 578 575 if (cursed_p(o_ptr) || broken_p(o_ptr)) 579 o_ptr-> discount= INSCRIP_TERRIBLE;576 o_ptr->pseudo = INSCRIP_TERRIBLE; 580 577 else 581 o_ptr-> discount= INSCRIP_SPECIAL;578 o_ptr->pseudo = INSCRIP_SPECIAL; 582 579 } 583 580 else 584 581 { 585 582 /* Mark the object as indestructible */ 586 o_ptr-> discount= INSCRIP_INDESTRUCTIBLE;583 o_ptr->pseudo = INSCRIP_INDESTRUCTIBLE; 587 584 } 588 585 trunk/src/defines.h
r112 r117 1714 1714 * The special inscriptions. 1715 1715 */ 1716 #define INSCRIP_NULL 1001717 #define INSCRIP_TERRIBLE 1 00+11718 #define INSCRIP_WORTHLESS 100+21719 #define INSCRIP_CURSED 100+31720 #define INSCRIP_BROKEN 100+41721 #define INSCRIP_AVERAGE 100+51722 #define INSCRIP_GOOD 100+61723 #define INSCRIP_EXCELLENT 100+71724 #define INSCRIP_SPECIAL 100+81725 #define INSCRIP_UNCURSED 100+91726 #define INSCRIP_INDESTRUCTIBLE 10 0+101716 #define INSCRIP_NULL 0 1717 #define INSCRIP_TERRIBLE 1 1718 #define INSCRIP_WORTHLESS 2 1719 #define INSCRIP_CURSED 3 1720 #define INSCRIP_BROKEN 4 1721 #define INSCRIP_AVERAGE 5 1722 #define INSCRIP_GOOD 6 1723 #define INSCRIP_EXCELLENT 7 1724 #define INSCRIP_SPECIAL 8 1725 #define INSCRIP_UNCURSED 9 1726 #define INSCRIP_INDESTRUCTIBLE 10 1727 1727 1728 1728 /* trunk/src/dungeon.c
r116 r117 162 162 if (!okay) continue; 163 163 164 /* It already has a discount or special inscription*/165 if ( (o_ptr->discount > 0)&&166 (o_ptr->discount != INSCRIP_INDESTRUCTIBLE)) continue;164 /* It's already been pseudo-ID'd */ 165 if (o_ptr->pseudo && 166 o_ptr->pseudo != INSCRIP_INDESTRUCTIBLE) continue; 167 167 168 168 /* It has already been sensed, do not sense it again */ … … 176 176 177 177 /* Indestructible objects are either excellent or terrible */ 178 if (o_ptr-> discount== INSCRIP_INDESTRUCTIBLE)178 if (o_ptr->pseudo == INSCRIP_INDESTRUCTIBLE) 179 179 heavy = TRUE; 180 180 … … 217 217 218 218 /* Sense the object */ 219 o_ptr-> discount= feel;219 o_ptr->pseudo = feel; 220 220 221 221 /* The object has been "sensed" */ trunk/src/load.c
r72 r117 271 271 272 272 273 rd_byte(&o_ptr->discount); 273 rd_byte(&o_ptr->pseudo); 274 275 /* Fix the field */ 276 if (o_ptr->pseudo > 99) 277 o_ptr->pseudo -= 100; 278 else 279 o_ptr->pseudo = 0; 274 280 275 281 rd_byte(&o_ptr->number); trunk/src/object1.c
r87 r117 1491 1491 1492 1492 /* Use special inscription, if any */ 1493 if (o_ptr-> discount >= INSCRIP_NULL)1494 { 1495 v = inscrip_text[o_ptr-> discount - INSCRIP_NULL];1493 if (o_ptr->pseudo) 1494 { 1495 v = inscrip_text[o_ptr->pseudo]; 1496 1496 } 1497 1497 … … 1512 1512 { 1513 1513 v = "tried"; 1514 }1515 1516 /* Use the discount, if any */1517 else if (o_ptr->discount > 0)1518 {1519 char *q = discount_buf;1520 object_desc_num_macro(q, o_ptr->discount);1521 object_desc_str_macro(q, "% off");1522 *q = '\0';1523 v = discount_buf;1524 1514 } 1525 1515 trunk/src/object2.c
r110 r117 765 765 { 766 766 /* Remove special inscription, if any */ 767 if (o_ptr-> discount >= INSCRIP_NULL) o_ptr->discount= 0;767 if (o_ptr->pseudo) o_ptr->pseudo = 0; 768 768 769 769 /* The object is not "sensed" */ … … 1143 1143 1144 1144 1145 /* Apply discount (if any) */1146 if (o_ptr->discount > 0 && o_ptr->discount < INSCRIP_NULL)1147 {1148 value -= (value * o_ptr->discount / 100L);1149 }1150 1151 1152 1145 /* Return the final value */ 1153 1146 return (value); … … 1325 1318 1326 1319 1327 /* Hack -- Require compatible "discount" fields */ 1328 if (o_ptr->discount != j_ptr->discount) 1329 { 1330 /* Both are (different) special inscriptions */ 1331 if ((o_ptr->discount >= INSCRIP_NULL) && 1332 (j_ptr->discount >= INSCRIP_NULL)) 1333 { 1334 /* Normally require matching inscriptions */ 1335 return (0); 1336 } 1337 1338 /* One is a special inscription, one is a discount or nothing */ 1339 else if ((o_ptr->discount >= INSCRIP_NULL) || 1340 (j_ptr->discount >= INSCRIP_NULL)) 1341 { 1342 /* Normally require matching inscriptions */ 1343 if (!stack_force_notes) return (0); 1344 1345 /* Hack -- Never merge a special inscription with a discount */ 1346 if ((o_ptr->discount > 0) && (j_ptr->discount > 0)) return (0); 1347 } 1348 1349 /* One is a discount, one is a (different) discount or nothing */ 1350 else 1351 { 1352 /* Normally require matching discounts */ 1353 if (!stack_force_costs) return (0); 1354 } 1355 } 1320 /* Different pseudo-ID statuses preclude combination */ 1321 if (o_ptr->pseudo != j_ptr->pseudo) 1322 return (0); 1356 1323 1357 1324 … … 1403 1370 1404 1371 /* Mega-Hack -- Blend "discounts" */ 1405 if (o_ptr->discount < j_ptr->discount) o_ptr->discount = j_ptr->discount;1372 o_ptr->pseudo = j_ptr->pseudo; 1406 1373 1407 1374 /* trunk/src/save.c
r48 r117 102 102 wr_s16b(o_ptr->pval); 103 103 104 wr_byte(o_ptr-> discount);104 wr_byte(o_ptr->pseudo); 105 105 106 106 wr_byte(o_ptr->number); trunk/src/spells2.c
r24 r117 285 285 o_ptr->ident &= ~(IDENT_CURSED); 286 286 287 /* Remove special inscription, if any */ 288 if (o_ptr->discount >= INSCRIP_NULL) o_ptr->discount = 0; 289 290 /* Take note if allowed */ 291 if (o_ptr->discount == 0) o_ptr->discount = INSCRIP_UNCURSED; 287 /* Mark as uncursed */ 288 o_ptr->pseudo = INSCRIP_UNCURSED; 292 289 293 290 /* The object has been "sensed" */ … … 902 899 903 900 /* Remove special inscription, if any */ 904 if (o_ptr-> discount >= INSCRIP_NULL) o_ptr->discount= 0;901 if (o_ptr->pseudo) o_ptr->pseudo = 0; 905 902 906 903 /* Hack -- Clear the "felt" flag */ trunk/src/store.c
r110 r117 482 482 /* 483 483 * Some cheap objects should be created in piles. 484 *485 * Some objects can be sold at a "discount" (in smaller piles).486 * Standard percentage discounts include 10, 25, 50, 75, and 90.487 484 */ 488 485 static void mass_produce(object_type *o_ptr) 489 486 { 490 487 int size = 1; 491 492 int discount = 0;493 494 488 s32b cost = object_value(o_ptr); 495 496 489 497 490 /* Analyze the type */ … … 563 556 564 557 565 /* Pick a discount */566 if (cost < 5)567 discount = 0;568 569 else if (rand_int(25) == 0)570 discount = 10;571 572 else if (rand_int(50) == 0)573 discount = 25;574 575 else if (rand_int(150) == 0)576 discount = 50;577 578 else if (rand_int(300) == 0)579 discount = 75;580 581 else if (rand_int(500) == 0)582 discount = 90;583 584 585 /* Save the discount */586 o_ptr->discount = discount;587 588 558 /* Save the total pile size */ 589 o_ptr->number = size - (size * discount / 100);559 o_ptr->number = size; 590 560 591 561 /* Hack -- rods need to increase PVAL if stacked */ … … 638 608 if ((o_ptr->timeout || j_ptr->timeout) && o_ptr->tval != TV_LITE) 639 609 return (0); 610 640 611 /* Never stack items with different fuel */ 641 612 else if ((o_ptr->timeout != j_ptr->timeout) && o_ptr->tval == TV_LITE) … … 649 620 /* Hack -- Never stack chests */ 650 621 if (o_ptr->tval == TV_CHEST) return (0); 651 652 /* Require matching "discount" fields */653 if (o_ptr->discount != j_ptr->discount) return (0);654 622 655 623 /* They match, so they must be similar */ … … 857 825 if (value <= 0) return (-1); 858 826 859 /* Erase the inscription */827 /* Erase the inscription & pseudo-ID bit */ 860 828 o_ptr->note = 0; 861 862 /* Remove special inscription, if any */ 863 if (o_ptr->discount >= INSCRIP_NULL) o_ptr->discount = 0; 864 829 o_ptr->pseudo = 0; 865 830 866 831 /* Check each existing object (try to combine) */ … … 1523 1488 void store_shuffle(int which) 1524 1489 { 1525 int i , j;1490 int i; 1526 1491 1527 1492 store_type *st_ptr = &store[which]; … … 1532 1497 1533 1498 /* Pick a new owner */ 1534 for (j = st_ptr->owner; j == st_ptr->owner; ) 1535 { 1536 st_ptr->owner = (byte)rand_int(z_info->b_max); 1537 } 1538 1539 1540 /* Discount all the items */ 1541 for (i = 0; i < st_ptr->stock_num; i++) 1542 { 1543 object_type *o_ptr; 1544 1545 /* Get the object */ 1546 o_ptr = &st_ptr->stock[i]; 1547 1548 /* Discount non-discounted items by 40 percent */ 1549 if (o_ptr->discount == 0) o_ptr->discount = 40; 1550 } 1499 i = st_ptr->owner; 1500 1501 while (i == st_ptr->owner) 1502 i = rand_int(z_info->b_max); 1503 1504 st_ptr->owner = i; 1551 1505 } 1552 1506 … … 1947 1901 /* Erase the inscription */ 1948 1902 i_ptr->note = 0; 1949 1950 /* Remove special inscription, if any */1951 if (o_ptr->discount >= INSCRIP_NULL) o_ptr->discount = 0;1952 1903 1953 1904 /* Give it to the player */ … … 2158 2109 store_flags |= STORE_GOLD_CHANGE; 2159 2110 2160 /* Erase the inscription */2161 i_ptr->note = 0;2162 2163 /* Remove special inscription, if any */2164 if (o_ptr->discount >= INSCRIP_NULL) o_ptr->discount = 0;2165 2166 2111 /* Identify original object */ 2167 2112 object_aware(o_ptr); trunk/src/tables.c
r111 r117 1670 1670 "Show dungeon level in feet", /* OPT_depth_in_feet */ 1671 1671 "Merge inscriptions when stacking", /* OPT_stack_force_notes */ 1672 "Merge discounts when stacking", /* OPT_stack_force_costs */1672 NULL, /* xxx stack_force_costs */ 1673 1673 "Show labels in equipment listings", /* OPT_show_labels */ 1674 1674 NULL, /* xxx show_weights */ … … 1934 1934 FALSE, /* OPT_depth_in_feet */ 1935 1935 FALSE, /* OPT_stack_force_notes */ 1936 FALSE, /* OPT_stack_force_costs */1936 FALSE, /* xxx stack_force_costs */ 1937 1937 TRUE, /* OPT_show_labels */ 1938 1938 FALSE, /* xxx show_weights */ … … 2221 2221 OPT_always_pickup, 2222 2222 OPT_stack_force_notes, 2223 OPT_stack_force_costs,2224 2223 OPT_show_piles, 2225 2224 OPT_show_flavors, 2226 2225 OPT_verify_destroy, 2227 2226 OPT_verify_special, 2227 OPT_NONE, 2228 2228 OPT_NONE, 2229 2229 OPT_NONE, trunk/src/types.h
r112 r117 476 476 s16b pval; /* Item extra-parameter */ 477 477 478 byte discount; /* Discount (if any)*/478 byte pseudo; /* Pseudo-ID marker */ 479 479 480 480 byte number; /* Number of items */
