Changeset 905

Show
Ignore:
Timestamp:
05/16/08 20:44:30 (4 months ago)
Author:
takkaria
Message:

Add a new testing function to wizard.c.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/wizard.c

    r895 r905  
    14591459} 
    14601460 
     1461/* 
     1462 * Create lots of items. 
     1463 */ 
     1464static void wiz_test_kind(int tval) 
     1465{ 
     1466        int py = p_ptr->py; 
     1467        int px = p_ptr->px; 
     1468        int sval; 
     1469 
     1470        object_type object_type_body; 
     1471        object_type *i_ptr = &object_type_body; 
     1472 
     1473        for (sval = 0; sval < 255; sval++) 
     1474        { 
     1475                int k_idx = lookup_kind(tval, sval); 
     1476 
     1477                if (k_idx) 
     1478                { 
     1479                        /* Create the item */ 
     1480                        object_prep(i_ptr, k_idx); 
     1481 
     1482                        /* Apply magic (no messages, no artifacts) */ 
     1483                        apply_magic(i_ptr, p_ptr->depth, FALSE, FALSE, FALSE); 
     1484 
     1485                        /* Mark as cheat, and where created */ 
     1486                        i_ptr->origin = ORIGIN_CHEAT; 
     1487                        i_ptr->origin_depth = p_ptr->depth; 
     1488 
     1489                        if (k_info[k_idx].tval == TV_GOLD) 
     1490                        { 
     1491                                coin_type = sval; 
     1492                                make_gold(i_ptr, p_ptr->depth); 
     1493                                coin_type = 0; 
     1494                        } 
     1495 
     1496                        /* Drop the object from heaven */ 
     1497                        drop_near(i_ptr, -1, py, px); 
     1498                } 
     1499        } 
     1500 
     1501        msg_print("Done."); 
     1502} 
    14611503 
    14621504/* 
     
    16681710                        acquirement(py, px, p_ptr->depth, p_ptr->command_arg, TRUE); 
    16691711                        break; 
     1712                } 
     1713 
     1714                case 'V': 
     1715                { 
     1716                        wiz_test_kind(p_ptr->command_arg); 
    16701717                } 
    16711718