home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / HACKSRC.ZIP / OBJECTS.H < prev    next >
C/C++ Source or Header  |  1985-10-16  |  25KB  |  840 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2. /* objects.h - version 1.0.3 */
  3.  
  4. /* objects have letter " % ) ( 0 _ ` [ ! ? / = * */
  5. #include "config.h"
  6. #include "objclass.h"
  7. #define    NULL    (char *)0
  8.  
  9. #ifdef MSDOS
  10. /* Separate all the names of all objects into a separate static location
  11.  * and make the objects[] array point into this location.  This is to
  12.  * make it possible to replace any pointers that objects[] uses with
  13.  * indices into this array for storing.
  14.  */
  15. struct {
  16.     char    *name, *descr;
  17. } objname[] = {
  18.     NULL, NULL,        /* A place holder */
  19.  
  20. /* illegal object */
  21. #define STRANGE_OBJECTn        (char *) 1
  22.     "strange object",    NULL,
  23.  
  24. /* amulet */
  25. #define AMULET_OF_YENDORn    (char *) 2
  26.     "amulet of Yendor",    NULL,
  27.  
  28. /* foods */
  29. #define FOODBASE        3
  30. #define Food(i)            (char *) (FOODBASE+i)
  31.     "food ration",        NULL,
  32.     "tripe ration",        NULL,
  33.     "pancake",        NULL,
  34.     "dead lizard",        NULL,
  35.     "fortune cookie",    NULL,
  36.     "carrot",        NULL,
  37.     "tin",            NULL,
  38.     "orange",        NULL,
  39.     "apple",        NULL,
  40.     "pear",            NULL,
  41.     "melon",        NULL,
  42.     "banana",        NULL,
  43.     "candy bar",        NULL,
  44.     "egg",            NULL,
  45.     "clove of garlic",    NULL,
  46.     "lump of royal jelly",    NULL,
  47.         
  48.     "dead human",        NULL,
  49.     "dead giant ant",    NULL,
  50.     "dead giant bat",    NULL,
  51.     "dead centaur",        NULL,
  52.     "dead dragon",        NULL,
  53.     "dead floating eye",    NULL,
  54.     "dead freezing sphere",    NULL,
  55.     "dead gnome",        NULL,
  56.     "dead hobgoblin",    NULL,
  57.     "dead stalker",        NULL,
  58.     "dead jackal",        NULL,
  59.     "dead kobold",        NULL,
  60.     "dead leprechaun",    NULL,
  61.     "dead mimic",        NULL,
  62.     "dead nymph",        NULL,
  63.     "dead orc",        NULL,
  64.     "dead purple worm",    NULL,
  65.     "dead quasit",        NULL,
  66.     "dead rust monster",    NULL,
  67.     "dead snake",        NULL,
  68.     "dead troll",        NULL,
  69.     "dead umber hulk",    NULL,
  70.     "dead vampire",        NULL,
  71.     "dead wraith",        NULL,
  72.     "dead xorn",        NULL,
  73.     "dead yeti",        NULL,
  74.     "dead zombie",        NULL,
  75.     "dead acid blob",    NULL,
  76.     "dead giant beetle",    NULL,
  77.     "dead cockatrice",    NULL,
  78.     "dead dog",        NULL,
  79.     "dead ettin",        NULL,
  80.     "dead fog cloud",    NULL,
  81.     "dead gelatinous cube",    NULL,
  82.     "dead homunculus",    NULL,
  83.     "dead imp",        NULL,
  84.     "dead jaguar",        NULL,
  85.     "dead killer bee",    NULL,
  86.     "dead leocrotta",    NULL,
  87.     "dead minotaur",    NULL,
  88.     "dead nurse",        NULL,
  89.     "dead owlbear",        NULL,
  90.     "dead piercer",        NULL,
  91.     "dead quivering blob",    NULL,
  92.     "dead giant rat",    NULL,
  93.     "dead giant scorpion",    NULL,
  94.     "dead tengu",        NULL,
  95.     "dead unicorn",        NULL,
  96.     "dead violet fungi",    NULL,
  97.     "dead long worm",    NULL,
  98.     "dead xan",        NULL,
  99.     "dead yellow light",    NULL,
  100.     "dead zruty",        NULL,
  101. #define FOODCOUNT        69
  102.  
  103. /* weapons */
  104. #define WEAPONBASE        FOODBASE+FOODCOUNT
  105. #define    Weapon(i)        (char *) (WEAPONBASE+i)
  106.     "arrow",        NULL,
  107.     "sling bullet",        NULL,
  108.     "crossbow bolt",    NULL,
  109.     "dart",            NULL,
  110.     "rock",            NULL,
  111.     "boomerang",        NULL,
  112.     "mace",            NULL,
  113.     "axe",            NULL,
  114.     "flail",        NULL,
  115.     "long sword",        NULL,
  116.     "two handed sword",    NULL,
  117.     "dagger",        NULL,
  118.     "worm tooth",        NULL,
  119.     "crysknife",        NULL,
  120.     "spear",        NULL,
  121.     "bow",            NULL,
  122.     "sling",        NULL,
  123.     "crossbow",        NULL,
  124. #define WEAPONCOUNT    18
  125.  
  126. /* Miscellaneous other objects */
  127. #define OTHERBASE        WEAPONBASE+WEAPONCOUNT
  128. #define Other(i)        (char *) (OTHERBASE+i)
  129.     "whistle",        "whistle",
  130.     "magic whistle",    "whistle",
  131.     "expensive camera",    NULL,
  132.     "ice box",        "large box",
  133.     "pick-axe",        NULL,
  134.     "can opener",        NULL,
  135.     "heavy iron ball",    NULL,
  136.     "iron chain",        NULL,
  137.     "enormous rock",    NULL,
  138. #define OTHERCOUNT    9
  139.  
  140. /* armor */
  141. #define ARMORBASE        OTHERBASE+OTHERCOUNT
  142. #define    Armor(i)        (char *) (ARMORBASE+i)
  143.     "helmet",        NULL,
  144.     "plate mail",        NULL,
  145.     "splint mail",        NULL,
  146.     "banded mail",        NULL,
  147.     "chain mail",        NULL,
  148.     "scale mail",        NULL,
  149.     "ring mail",        NULL,
  150.     "studded leather armor",NULL,
  151.     "leather armor",    NULL,
  152.     "elven cloak",        NULL,
  153.     "shield",        NULL,
  154.     "pair of gloves",    NULL,
  155. #define ARMORCOUNT        12
  156.  
  157. /* potions */
  158. #define POTIONBASE        ARMORBASE+ARMORCOUNT
  159. #define    Potion(i)        (char *) (POTIONBASE+i)
  160.     "restore strength",    "orange",
  161.     "booze",        "bubbly",
  162.     "invisibility",        "glowing",
  163.     "fruit juice",        "smoky",
  164.     "healing",        "pink",
  165.     "paralysis",        "puce",
  166.     "monster detection",    "purple",
  167.     "object detection",    "yellow",
  168.     "sickness",        "white",
  169.     "confusion",        "swirly",
  170.     "gain strength",    "purple-red",
  171.     "speed",        "ruby",
  172.     "blindness",        "dark green",
  173.     "gain level",        "emerald",
  174.     "extra healing",    "sky blue",
  175.     "levitation",        "brown",
  176.     NULL,            "brilliant blue",
  177.     NULL,            "clear",
  178.     NULL,            "magenta",
  179.     NULL,            "ebony",
  180. #define POTIONCOUNT        20
  181.  
  182. /* scrolls */
  183. #define SCROLLBASE        POTIONBASE+POTIONCOUNT
  184. #define    Scroll(i)        (char *) (SCROLLBASE+i)
  185.     "mail",            "KIRJE",
  186.     "enchant armor",    "ZELGO MER",
  187.     "destroy armor",    "JUYED AWK YACC",
  188.     "confuse monster",    "NR 9",
  189.     "scare monster",    "XIXAXA XOXAXA XUXAXA",
  190.     "blank paper",        "READ ME",
  191.     "remove curse",        "PRATYAVAYAH",
  192.     "enchant weapon",    "DAIYEN FOOELS",
  193.     "damage weapon",    "HACKEM MUCHE",
  194.     "create monster",    "LEP GEX VEN ZEA",
  195.     "taming",        "PRIRUTSENIE",
  196.     "genocide",        "ELBIB YLOH",
  197.     "light",        "VERR YED HORRE",
  198.     "teleportation",    "VENZAR BORGAVVE",
  199.     "gold detection",    "THARR",
  200.     "food detection",    "YUM YUM",
  201.     "identify",        "KERNOD WEL",
  202.     "magic mapping",    "ELAM EBOW",
  203.     "amnesia",        "DUAM XNAHT",
  204.     "fire",            "ANDOVA BEGARIN",
  205.     "punishment",        "VE FORBRYDERNE",
  206.     NULL,            "VELOX NEB",
  207.     NULL,            "FOOBIE BLETCH",
  208.     NULL,            "TEMOV",
  209.     NULL,            "GARVEN DEH",
  210. #define SCROLLCOUNT        25
  211.  
  212. /* wands */
  213. #define    WANDBASE        SCROLLBASE+SCROLLCOUNT
  214. #define    Wand(i)         (char *) (WANDBASE+i)
  215.     "light",        "iridium",
  216.     "secret door detection","tin",
  217.     "create monster",    "platinum",
  218.     "wishing",        "glass",
  219.     "striking",        "zinc",
  220.     "slow monster",        "balsa",
  221.     "speed monster",    "copper",
  222.     "undead turning",    "silver",
  223.     "polymorph",        "brass",
  224.     "cancellation",        "maple",
  225.     "teleportation",    "pine",
  226.     "make invisible",    "marble",
  227.     "digging",        "iron",
  228.     "magic missile",    "aluminium",
  229.     "fire",            "steel",
  230.     "sleep",        "curved",
  231.     "cold",            "short",
  232.     "death",        "long",
  233.     NULL,            "oak",
  234.     NULL,            "ebony",
  235.     NULL,            "runed",
  236. #define WANDCOUNT    21
  237.  
  238. /* rings */
  239. #define RINGBASE        WANDBASE+WANDCOUNT
  240. #define    Ring(i)            (char *) (RINGBASE+i)
  241.     "adornment",        "engagement",
  242.     "teleportation",    "wooden",
  243.     "regeneration",        "black onyx",
  244.     "searching",        "topaz",
  245.     "see invisible",    "pearl",
  246.     "stealth",        "sapphire",
  247.     "levitation",        "moonstone",
  248.     "poison resistance",    "agate",
  249.     "aggravate monster",    "tiger eye",
  250.     "hunger",        "shining",
  251.     "fire resistance",    "gold",
  252.     "cold resistance",    "copper",
  253.     "protection from shape changers", "diamond",
  254.     "conflict",        "jade",
  255.     "gain strength",    "ruby",
  256.     "increase damage",    "silver",
  257.     "protection",        "granite",
  258.     "warning",        "wire",
  259.     "teleport control",    "iron",
  260.     NULL,            "ivory",
  261.     NULL,            "blackened",
  262. #define RINGCOUNT        21
  263.  
  264. /* gems */
  265. #define GEMBASE            RINGBASE+RINGCOUNT
  266. #define    Gem(i)            (char *) (GEMBASE+i)
  267.     "diamond",        "blue",
  268.     "ruby",            "red",
  269.     "sapphire",        "blue",
  270.     "emerald",        "green",
  271.     "turquoise",        "green",
  272.     "aquamarine",        "blue",
  273.     "tourmaline",        "green",
  274.     "topaz",        "yellow",
  275.     "opal",            "yellow",
  276.     "garnet",        "dark",
  277.     "amethyst",        "violet",
  278.     "agate",        "green",
  279.     "onyx",            "white",
  280.     "jasper",        "yellowish brown",
  281.     "jade",             "green",
  282.     "worthless piece of blue glass", "blue",
  283.     "worthless piece of red glass", "red",
  284.     "worthless piece of yellow glass", "yellow",
  285.     "worthless piece of green glass", "green",
  286. #define GEMCOUNT        19
  287. };
  288.  
  289. struct objclass objects[] = {
  290.  
  291.     {STRANGE_OBJECTn, NULL, NULL, 1, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 },
  292.     {AMULET_OF_YENDORn, NULL, NULL, 1, 0, AMULET_SYM, 100, 0, 2, 0, 0, 0 },
  293.  
  294. #define    FOOD(number,prob,delay,weight,nutrition) {Food(number),\
  295.     NULL, NULL, 1, 1, FOOD_SYM, prob, delay, weight, 0, 0, nutrition }
  296.  
  297. /* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */
  298. /* food 4 can be read */
  299. /* food 5 improves your vision */
  300. /* food 6 makes you stronger (like Popeye) */
  301. /* foods CORPSE up to CORPSE+52 are cadavers */
  302.  
  303.     FOOD(0,    50, 5, 4, 800),
  304.     FOOD(1,    20, 1, 2, 200),
  305.     FOOD(2,    3, 1, 1, 200),
  306.     FOOD(3,    3, 0, 1, 40),
  307.     FOOD(4,    7, 0, 1, 40),
  308.     FOOD(5,    2, 0, 1, 50),
  309.     FOOD(6,    7, 0, 1, 0),
  310.     FOOD(7,    1, 0, 1, 80),
  311.     FOOD(8,    1, 0, 1, 50),
  312.     FOOD(9,    1, 0, 1, 50),
  313.     FOOD(10, 1, 0, 1, 100),
  314.     FOOD(11, 1, 0, 1, 80),
  315.     FOOD(12, 1, 0, 1, 100),
  316.     FOOD(13, 1, 0, 1, 80),
  317.     FOOD(14, 1, 0, 1, 40),
  318.     FOOD(15, 0, 0, 1, 200),
  319.  
  320.     FOOD(16, 0, 4, 40, 400),
  321.     FOOD(17, 0, 1, 3, 30),
  322.     FOOD(18, 0, 1, 3, 30),
  323.     FOOD(19, 0, 5, 50, 500),
  324.     FOOD(20, 0, 15, 150, 1500),
  325.     FOOD(21, 0, 1, 1, 10),
  326.     FOOD(22, 0, 1, 1, 10),
  327.     FOOD(23, 0, 1, 10, 100),
  328.     FOOD(24, 0, 2, 20, 200),
  329.     FOOD(25, 0, 4, 40, 400),
  330.     FOOD(26, 0, 1, 10, 100),
  331.     FOOD(27, 0, 1, 10, 100),
  332.     FOOD(28, 0, 4, 40, 400),
  333.     FOOD(29, 0, 4, 40, 400),
  334.     FOOD(30, 0, 4, 40, 400),
  335.     FOOD(31, 0, 2, 20, 200),
  336.     FOOD(32, 0, 7, 70, 700),
  337.     FOOD(33, 0, 2, 20, 200),
  338.     FOOD(34, 0, 5, 50, 500),
  339.     FOOD(35, 0, 1, 10, 100),
  340.     FOOD(36, 0, 4, 40, 400),
  341.     FOOD(37, 0, 5, 50, 500),
  342.     FOOD(38, 0, 4, 40, 400),
  343.     FOOD(39, 0, 1, 1, 10),
  344.     FOOD(40, 0, 7, 70, 700),
  345.     FOOD(41, 0, 7, 70, 700),
  346.     FOOD(42, 0, 1, 3, 30),
  347.     FOOD(43, 0, 1, 3, 30),
  348.     FOOD(44, 0, 1, 1, 10),
  349.     FOOD(45, 0, 1, 3, 30),
  350.     FOOD(46, 0, 2, 20, 200),
  351.     FOOD(47, 0, 1, 3, 30),
  352.     FOOD(48, 0, 1, 1, 10),
  353.     FOOD(49, 0, 1, 10, 100),
  354.     FOOD(50, 0, 2, 20, 200),
  355.     FOOD(51, 0, 1, 1, 10),
  356.     FOOD(52, 0, 3, 30, 300),
  357.     FOOD(53, 0, 1, 1, 10),
  358.     FOOD(54, 0, 5, 50, 500),
  359.     FOOD(55, 0, 7, 70, 700),
  360.     FOOD(56, 0, 4, 40, 400),
  361.     FOOD(57, 0, 7, 70, 700),
  362.     FOOD(58, 0, 2, 20, 200),
  363.     FOOD(59, 0, 1, 10, 100),
  364.     FOOD(60, 0, 1, 3, 30),
  365.     FOOD(61, 0, 1, 10, 100),
  366.     FOOD(62, 0, 3, 30, 300),
  367.     FOOD(63, 0, 3, 30, 300),
  368.     FOOD(64, 0, 1, 10, 100),
  369.     FOOD(65, 0, 5, 50, 500),
  370. /* %% wt of long worm should be proportional to its length */
  371.     FOOD(66, 0, 3, 30, 300),
  372.     FOOD(67, 0, 1, 1, 10),
  373.     FOOD(68, 0, 6, 60, 600),
  374.  
  375. /* weapons ... - ROCK come several at a time */
  376. /* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */
  377. /* weapons AXE, SWORD, THSWORD are good for worm-cutting */
  378. /* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */
  379. #define WEAPON(number,prob,wt,ldam,sdam) { Weapon(number), NULL, NULL, 1,\
  380.         0 /*%%*/, WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 }
  381.  
  382.     WEAPON(0, 7, 0, 6, 6),
  383.     WEAPON(1, 7, 0, 4, 6),
  384.     WEAPON(2, 7, 0, 4, 6),
  385.      WEAPON(3, 7, 0, 3, 2),
  386.     WEAPON(4, 6, 1, 3, 3),
  387.     WEAPON(5, 2, 3, 9, 9),
  388.     WEAPON(6, 9, 3, 6, 7),
  389.     WEAPON(7, 6, 3, 6, 4),
  390.     WEAPON(8, 6, 3, 6, 5),
  391.     WEAPON(9, 8, 3, 8, 12),
  392.     WEAPON(10, 6, 4, 12, 6),
  393.     WEAPON(11, 6, 3, 4, 3),
  394.     WEAPON(12, 0, 4, 2, 2),
  395.     WEAPON(13, 0, 3, 10, 10),
  396.     WEAPON(14, 6, 3, 6, 8),
  397.     WEAPON(15, 6, 3, 4, 6),
  398.     WEAPON(16, 5, 3, 6, 6),
  399.     WEAPON(17, 6, 3, 4, 6),
  400.  
  401.     {Other(0), Other(0),    NULL, 0, 0, TOOL_SYM, 90, 0, 2, 0, 0, 0 },
  402.     {Other(1), Other(1),    NULL, 0, 0, TOOL_SYM, 10, 0, 2, 0, 0, 0 },
  403.     {Other(2), NULL,    NULL, 1, 1, TOOL_SYM, 0, 0, 3, 0, 0, 0 },
  404.     {Other(3), Other(3),    NULL, 0, 0, TOOL_SYM, 0, 0, 40, 0, 0, 0 },
  405.     {Other(4), NULL,     NULL, 1, 1, TOOL_SYM, 0, 0, 5, 6, 3, 0 },
  406.     {Other(5), NULL,    NULL, 1, 1, TOOL_SYM, 0, 0, 1, 0, 0, 0 },
  407.     {Other(6), NULL,    NULL, 1, 0, BALL_SYM, 100, 0, 20, 0, 0, 0 },
  408.     {Other(7), NULL,    NULL, 1, 0, CHAIN_SYM, 100, 0, 20, 0, 0, 0 },
  409.     {Other(8), NULL,    NULL, 1, 0,
  410.             ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 },
  411.  
  412. #define ARMOR(number,prob,delay,ac,can)    { Armor(number), NULL, NULL, 1, 0,\
  413.         ARMOR_SYM, prob, delay, 8, ac, can, 0 }
  414.     ARMOR(0, 3, 1, 9, 0),
  415.     ARMOR(1, 5, 5, 3, 2),
  416.     ARMOR(2, 8, 5, 4, 1),
  417.     ARMOR(3, 10, 5, 4, 0),
  418.     ARMOR(4, 10, 5, 5, 1),
  419.      ARMOR(5, 10, 5, 6, 0),
  420.     ARMOR(6, 15, 5, 7, 0),
  421.     /* the armors below do not rust */
  422.     ARMOR(7, 13, 3, 7, 1),
  423.     ARMOR(8, 17, 3, 8, 0),
  424.     ARMOR(9,  5, 0, 9, 3),
  425.     ARMOR(10, 3, 0, 9, 0),
  426.     ARMOR(11, 1, 1, 9, 0),
  427.  
  428. #define POTION(number)    { Potion(number), Potion(number), NULL,\
  429.         0, 1, POTION_SYM, 0, 0, 2, 0, 0, 0 }
  430.  
  431.     POTION(0),
  432.     POTION(1),
  433.     POTION(2),
  434.     POTION(3),
  435.     POTION(4),
  436.     POTION(5),
  437.     POTION(6),
  438.     POTION(7),
  439.     POTION(8),
  440.     POTION(9),
  441.     POTION(10),
  442.     POTION(11),
  443.     POTION(12),
  444.     POTION(13),
  445.     POTION(14),
  446.     POTION(15),
  447.     POTION(16),
  448.     POTION(17),
  449.     POTION(18),
  450.     POTION(19),
  451.  
  452. #define SCROLL(number,prob) { Scroll(number), Scroll(number), NULL, 0,\
  453.         1, SCROLL_SYM, prob, 0, 3, 0, 0, 0 }
  454.     SCROLL(0,    0),
  455.     SCROLL(1,    6),
  456.     SCROLL(2,    5),
  457.     SCROLL(3,    5),
  458.     SCROLL(4,    4),
  459.     SCROLL(5,    3),
  460.     SCROLL(6,    6),
  461.     SCROLL(7,    6),
  462.     SCROLL(8,    5),
  463.     SCROLL(9,    5),
  464.     SCROLL(10,    1),
  465.     SCROLL(11,    2),
  466.     SCROLL(12,    10),
  467.     SCROLL(13,    5),
  468.     SCROLL(14,    4),
  469.     SCROLL(15,    1),
  470.     SCROLL(16,    18),
  471.     SCROLL(17,    5),
  472.     SCROLL(18,    3),
  473.     SCROLL(19,    5),
  474.     SCROLL(20,    1),
  475.     SCROLL(21,    0),
  476.     SCROLL(22,    0),
  477.     SCROLL(23,    0),
  478.     SCROLL(24,    0),
  479.  
  480. #define    WAND(number,prob,flags)    { Wand(number), Wand(number), NULL,\
  481.         0, 0, WAND_SYM, prob, 0, 3, flags, 0, 0 }
  482.  
  483.     WAND(0,        10,    NODIR),
  484.     WAND(1,        5,    NODIR),
  485.     WAND(2,        5,    NODIR),
  486.     WAND(3,        1,    NODIR),
  487.     WAND(4,        9,    IMMEDIATE),
  488.     WAND(5,        5,    IMMEDIATE),
  489.     WAND(6,        5,    IMMEDIATE),
  490.     WAND(7,        5,    IMMEDIATE),
  491.     WAND(8,        5,    IMMEDIATE),
  492.     WAND(9,        5,    IMMEDIATE),
  493.     WAND(10,    5,    IMMEDIATE),
  494.     WAND(11,    9,    IMMEDIATE),
  495.     WAND(12,    5,    RAY),
  496.     WAND(13,    10,    RAY),
  497.     WAND(14,    5,    RAY),
  498.     WAND(15,    5,    RAY),
  499.     WAND(16,    5,    RAY),
  500.     WAND(17,    1,    RAY),
  501.     WAND(18,    0,    0),
  502.     WAND(19,    0,    0),
  503.     WAND(20,    0,    0),
  504.  
  505. #define    RING(number,spec)    { Ring(number), Ring(number), NULL,\
  506.         0, 0, RING_SYM, 0, 0, 1, spec, 0, 0 }
  507.  
  508.     RING(0,        0),
  509.     RING(1,        0),
  510.     RING(2,        0),
  511.     RING(3,        0),
  512.     RING(4,        0),
  513.     RING(5,        0),
  514.     RING(6,        0),
  515.     RING(7,        0),
  516.     RING(8,        0),
  517.     RING(9,        0),
  518.     RING(10,    0),
  519.     RING(11,    0),
  520.     RING(12,    0),
  521.     RING(13,    0),
  522.     RING(14,    SPEC),
  523.     RING(15,    SPEC),
  524.     RING(16,    SPEC),
  525.     RING(17,    0),
  526.     RING(18,    0),
  527.     RING(19,    0),
  528.     RING(20,    0),
  529.  
  530. /* gems ************************************************************/
  531. #define    GEM(number,prob,gval)    { Gem(number), Gem(number), NULL, 0,\
  532.                 1, GEM_SYM, prob, 0, 1, 0, 0, gval }
  533.     GEM(0,    1,    4000),
  534.     GEM(1,    1,    3500),
  535.     GEM(2,    1,    3000),
  536.     GEM(3,    1,    2500),
  537.     GEM(4,    1,    2000),
  538.     GEM(5,    1,    1500),
  539.     GEM(6,    1,    1000),
  540.     GEM(7,    1,    900),
  541.     GEM(8,    1,    800),
  542.     GEM(9,    1,    700),
  543.     GEM(10,    2,    650),
  544.     GEM(11,    2,    600),
  545.     GEM(12,    2,    550),
  546.     GEM(13,    2,    500),
  547.     GEM(14,    2,    450),
  548.     GEM(15,    20,    0),
  549.     GEM(16,    20,    0),
  550.     GEM(17,    20,    0),
  551.     GEM(18,    20,    0),
  552.     { NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }
  553. };
  554.  
  555. #else
  556.  
  557. struct objclass objects[] = {
  558.  
  559.     { "strange object", NULL, NULL, 1, 0,
  560.         ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 },
  561.     { "amulet of Yendor", NULL, NULL, 1, 0,
  562.         AMULET_SYM, 100, 0, 2, 0, 0, 0 },
  563.  
  564. #define    FOOD(name,prob,delay,weight,nutrition)    { name, NULL, NULL, 1, 1,\
  565.         FOOD_SYM, prob, delay, weight, 0, 0, nutrition }
  566.  
  567. /* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */
  568. /* food 4 can be read */
  569. /* food 5 improves your vision */
  570. /* food 6 makes you stronger (like Popeye) */
  571. /* foods CORPSE up to CORPSE+52 are cadavers */
  572.  
  573.     FOOD("food ration",     50, 5, 4, 800),
  574.     FOOD("tripe ration",    20, 1, 2, 200),
  575.     FOOD("pancake",        3, 1, 1, 200),
  576.     FOOD("dead lizard",    3, 0, 1, 40),
  577.     FOOD("fortune cookie",    7, 0, 1, 40),
  578.     FOOD("carrot",        2, 0, 1, 50),
  579.     FOOD("tin",        7, 0, 1, 0),
  580.     FOOD("orange",        1, 0, 1, 80),
  581.     FOOD("apple",        1, 0, 1, 50),
  582.     FOOD("pear",        1, 0, 1, 50),
  583.     FOOD("melon",        1, 0, 1, 100),
  584.     FOOD("banana",        1, 0, 1, 80),
  585.     FOOD("candy bar",    1, 0, 1, 100),
  586.     FOOD("egg",        1, 0, 1, 80),
  587.     FOOD("clove of garlic",    1, 0, 1, 40),
  588.     FOOD("lump of royal jelly", 0, 0, 1, 200),
  589.  
  590.     FOOD("dead human",    0, 4, 40, 400),
  591.     FOOD("dead giant ant",    0, 1, 3, 30),
  592.     FOOD("dead giant bat",    0, 1, 3, 30),
  593.     FOOD("dead centaur",    0, 5, 50, 500),
  594.     FOOD("dead dragon",    0, 15, 150, 1500),
  595.     FOOD("dead floating eye",    0, 1, 1, 10),
  596.     FOOD("dead freezing sphere",    0, 1, 1, 10),
  597.     FOOD("dead gnome",    0, 1, 10, 100),
  598.     FOOD("dead hobgoblin",    0, 2, 20, 200),
  599.     FOOD("dead stalker",    0, 4, 40, 400),
  600.     FOOD("dead jackal",    0, 1, 10, 100),
  601.     FOOD("dead kobold",    0, 1, 10, 100),
  602.     FOOD("dead leprechaun",    0, 4, 40, 400),
  603.     FOOD("dead mimic",    0, 4, 40, 400),
  604.     FOOD("dead nymph",    0, 4, 40, 400),
  605.     FOOD("dead orc",    0, 2, 20, 200),
  606.     FOOD("dead purple worm",    0, 7, 70, 700),
  607.     FOOD("dead quasit",    0, 2, 20, 200),
  608.     FOOD("dead rust monster",    0, 5, 50, 500),
  609.     FOOD("dead snake",    0, 1, 10, 100),
  610.     FOOD("dead troll",    0, 4, 40, 400),
  611.     FOOD("dead umber hulk",    0, 5, 50, 500),
  612.     FOOD("dead vampire",    0, 4, 40, 400),
  613.     FOOD("dead wraith",    0, 1, 1, 10),
  614.     FOOD("dead xorn",    0, 7, 70, 700),
  615.     FOOD("dead yeti",    0, 7, 70, 700),
  616.     FOOD("dead zombie",    0, 1, 3, 30),
  617.     FOOD("dead acid blob",    0, 1, 3, 30),
  618.     FOOD("dead giant beetle",    0, 1, 1, 10),
  619.     FOOD("dead cockatrice",    0, 1, 3, 30),
  620.     FOOD("dead dog",    0, 2, 20, 200),
  621.     FOOD("dead ettin",    0, 1, 3, 30),
  622.     FOOD("dead fog cloud",    0, 1, 1, 10),
  623.     FOOD("dead gelatinous cube",    0, 1, 10, 100),
  624.     FOOD("dead homunculus",    0, 2, 20, 200),
  625.     FOOD("dead imp",    0, 1, 1, 10),
  626.     FOOD("dead jaguar",    0, 3, 30, 300),
  627.     FOOD("dead killer bee",    0, 1, 1, 10),
  628.     FOOD("dead leocrotta",    0, 5, 50, 500),
  629.     FOOD("dead minotaur",    0, 7, 70, 700),
  630.     FOOD("dead nurse",    0, 4, 40, 400),
  631.     FOOD("dead owlbear",    0, 7, 70, 700),
  632.     FOOD("dead piercer",    0, 2, 20, 200),
  633.     FOOD("dead quivering blob",    0, 1, 10, 100),
  634.     FOOD("dead giant rat",    0, 1, 3, 30),
  635.     FOOD("dead giant scorpion",    0, 1, 10, 100),
  636.     FOOD("dead tengu",    0, 3, 30, 300),
  637.     FOOD("dead unicorn",    0, 3, 30, 300),
  638.     FOOD("dead violet fungi",    0, 1, 10, 100),
  639.     FOOD("dead long worm",    0, 5, 50, 500),
  640. /* %% wt of long worm should be proportional to its length */
  641.     FOOD("dead xan",    0, 3, 30, 300),
  642.     FOOD("dead yellow light",    0, 1, 1, 10),
  643.     FOOD("dead zruty",    0, 6, 60, 600),
  644.  
  645. /* weapons ... - ROCK come several at a time */
  646. /* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */
  647. /* weapons AXE, SWORD, THSWORD are good for worm-cutting */
  648. /* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */
  649. #define WEAPON(name,prob,wt,ldam,sdam)    { name, NULL, NULL, 1, 0 /*%%*/,\
  650.         WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 }
  651.  
  652.     WEAPON("arrow",        7, 0, 6, 6),
  653.     WEAPON("sling bullet",    7, 0, 4, 6),
  654.     WEAPON("crossbow bolt",    7, 0, 4, 6),
  655.     WEAPON("dart",        7, 0, 3, 2),
  656.     WEAPON("rock",        6, 1, 3, 3),
  657.     WEAPON("boomerang",    2, 3, 9, 9),
  658.     WEAPON("mace",        9, 3, 6, 7),
  659.     WEAPON("axe",        6, 3, 6, 4),
  660.     WEAPON("flail",        6, 3, 6, 5),
  661.     WEAPON("long sword",    8, 3, 8, 12),
  662.     WEAPON("two handed sword",    6, 4, 12, 6),
  663.     WEAPON("dagger",    6, 3, 4, 3),
  664.     WEAPON("worm tooth",    0, 4, 2, 2),
  665.     WEAPON("crysknife",    0, 3, 10, 10),
  666.     WEAPON("spear",        6, 3, 6, 8),
  667.     WEAPON("bow",        6, 3, 4, 6),
  668.     WEAPON("sling",        5, 3, 6, 6),
  669.     WEAPON("crossbow",    6, 3, 4, 6),
  670.  
  671.     { "whistle", "whistle", NULL, 0, 0,
  672.         TOOL_SYM, 90, 0, 2, 0, 0, 0 },
  673.     { "magic whistle", "whistle", NULL, 0, 0,
  674.         TOOL_SYM, 10, 0, 2, 0, 0, 0 },
  675.     { "expensive camera", NULL, NULL, 1, 1,
  676.         TOOL_SYM, 0, 0, 3, 0, 0, 0 },
  677.     { "ice box", "large box", NULL, 0, 0,
  678.         TOOL_SYM, 0, 0, 40, 0, 0, 0 },
  679.     { "pick-axe", NULL, NULL, 1, 1,
  680.         TOOL_SYM, 0, 0, 5, 6, 3, 0 },
  681.     { "can opener", NULL, NULL, 1, 1,
  682.         TOOL_SYM, 0, 0, 1, 0, 0, 0 },
  683.     { "heavy iron ball", NULL, NULL, 1, 0,
  684.         BALL_SYM, 100, 0, 20, 0, 0, 0 },
  685.     { "iron chain", NULL, NULL, 1, 0,
  686.         CHAIN_SYM, 100, 0, 20, 0, 0, 0 },
  687.     { "enormous rock", NULL, NULL, 1, 0,
  688.         ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 },
  689.  
  690. #define ARMOR(name,prob,delay,ac,can)    { name, NULL, NULL, 1, 0,\
  691.         ARMOR_SYM, prob, delay, 8, ac, can, 0 }
  692.     ARMOR("helmet",         3, 1, 9, 0),
  693.     ARMOR("plate mail",         5, 5, 3, 2),
  694.     ARMOR("splint mail",     8, 5, 4, 1),
  695.     ARMOR("banded mail",    10, 5, 4, 0),
  696.     ARMOR("chain mail",        10, 5, 5, 1),
  697.     ARMOR("scale mail",        10, 5, 6, 0),
  698.     ARMOR("ring mail",        15, 5, 7, 0),
  699.     /* the armors below do not rust */
  700.     ARMOR("studded leather armor", 13, 3, 7, 1),
  701.     ARMOR("leather armor",    17, 3, 8, 0),
  702.     ARMOR("elven cloak",     5, 0, 9, 3),
  703.     ARMOR("shield",         3, 0, 9, 0),
  704.     ARMOR("pair of gloves",     1, 1, 9, 0),
  705.  
  706. #define POTION(name,color)    { name, color, NULL, 0, 1,\
  707.         POTION_SYM, 0, 0, 2, 0, 0, 0 }
  708.  
  709.     POTION("restore strength",    "orange"),
  710.     POTION("booze",        "bubbly"),
  711.     POTION("invisibility",    "glowing"),
  712.     POTION("fruit juice",    "smoky"),
  713.     POTION("healing",    "pink"),
  714.     POTION("paralysis",    "puce"),
  715.     POTION("monster detection",    "purple"),
  716.     POTION("object detection",    "yellow"),
  717.     POTION("sickness",    "white"),
  718.     POTION("confusion",    "swirly"),
  719.     POTION("gain strength",    "purple-red"),
  720.     POTION("speed",        "ruby"),
  721.     POTION("blindness",    "dark green"),
  722.     POTION("gain level",    "emerald"),
  723.     POTION("extra healing",    "sky blue"),
  724.     POTION("levitation",    "brown"),
  725.     POTION(NULL,    "brilliant blue"),
  726.     POTION(NULL,    "clear"),
  727.     POTION(NULL,    "magenta"),
  728.     POTION(NULL,    "ebony"),
  729.  
  730. #define SCROLL(name,text,prob) { name, text, NULL, 0, 1,\
  731.         SCROLL_SYM, prob, 0, 3, 0, 0, 0 }
  732.     SCROLL("mail",    "KIRJE", 0),
  733.     SCROLL("enchant armor", "ZELGO MER", 6),
  734.     SCROLL("destroy armor", "JUYED AWK YACC", 5),
  735.     SCROLL("confuse monster", "NR 9", 5),
  736.     SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 4),
  737.     SCROLL("blank paper", "READ ME", 3),
  738.     SCROLL("remove curse", "PRATYAVAYAH", 6),
  739.     SCROLL("enchant weapon", "DAIYEN FOOELS", 6),
  740.     SCROLL("damage weapon", "HACKEM MUCHE", 5),
  741.     SCROLL("create monster", "LEP GEX VEN ZEA", 5),
  742.     SCROLL("taming", "PRIRUTSENIE", 1),
  743.     SCROLL("genocide", "ELBIB YLOH",2),
  744.     SCROLL("light", "VERR YED HORRE", 10),
  745.     SCROLL("teleportation", "VENZAR BORGAVVE", 5),
  746.     SCROLL("gold detection", "THARR", 4),
  747.     SCROLL("food detection", "YUM YUM", 1),
  748.     SCROLL("identify", "KERNOD WEL", 18),
  749.     SCROLL("magic mapping", "ELAM EBOW", 5),
  750.     SCROLL("amnesia", "DUAM XNAHT", 3),
  751.     SCROLL("fire", "ANDOVA BEGARIN", 5),
  752.     SCROLL("punishment", "VE FORBRYDERNE", 1),
  753.     SCROLL(NULL, "VELOX NEB", 0),
  754.     SCROLL(NULL, "FOOBIE BLETCH", 0),
  755.     SCROLL(NULL, "TEMOV", 0),
  756.     SCROLL(NULL, "GARVEN DEH", 0),
  757.  
  758. #define    WAND(name,metal,prob,flags)    { name, metal, NULL, 0, 0,\
  759.         WAND_SYM, prob, 0, 3, flags, 0, 0 }
  760.  
  761.     WAND("light",    "iridium",        10,    NODIR),
  762.     WAND("secret door detection",    "tin",    5,    NODIR),
  763.     WAND("create monster",    "platinum",    5,    NODIR),
  764.     WAND("wishing",        "glass",    1,    NODIR),
  765.     WAND("striking",    "zinc",        9,    IMMEDIATE),
  766.     WAND("slow monster",    "balsa",    5,    IMMEDIATE),
  767.     WAND("speed monster",    "copper",    5,    IMMEDIATE),
  768.     WAND("undead turning",    "silver",    5,    IMMEDIATE),
  769.     WAND("polymorph",    "brass",    5,    IMMEDIATE),
  770.     WAND("cancellation",    "maple",    5,    IMMEDIATE),
  771.     WAND("teleportation",    "pine",        5,    IMMEDIATE),
  772.     WAND("make invisible",    "marble",    9,    IMMEDIATE),
  773.     WAND("digging",        "iron",        5,    RAY),
  774.     WAND("magic missile",    "aluminium",    10,    RAY),
  775.     WAND("fire",    "steel",    5,    RAY),
  776.     WAND("sleep",    "curved",    5,    RAY),
  777.     WAND("cold",    "short",    5,    RAY),
  778.     WAND("death",    "long",        1,    RAY),
  779.     WAND(NULL,    "oak",        0,    0),
  780.     WAND(NULL,    "ebony",    0,    0),
  781.     WAND(NULL,    "runed",    0,    0),
  782.  
  783. #define    RING(name,stone,spec)    { name, stone, NULL, 0, 0,\
  784.         RING_SYM, 0, 0, 1, spec, 0, 0 }
  785.  
  786.     RING("adornment",    "engagement",    0),
  787.     RING("teleportation",    "wooden",    0),
  788.     RING("regeneration",    "black onyx",    0),
  789.     RING("searching",    "topaz",    0),
  790.     RING("see invisible",    "pearl",    0),
  791.     RING("stealth",        "sapphire",    0),
  792.     RING("levitation",    "moonstone",    0),
  793.     RING("poison resistance", "agate",    0),
  794.     RING("aggravate monster", "tiger eye",    0),
  795.     RING("hunger",        "shining",    0),
  796.     RING("fire resistance",    "gold",        0),
  797.     RING("cold resistance",    "copper",    0),
  798.     RING("protection from shape changers", "diamond", 0),
  799.     RING("conflict",    "jade",        0),
  800.     RING("gain strength",    "ruby",        SPEC),
  801.     RING("increase damage",    "silver",    SPEC),
  802.     RING("protection",    "granite",    SPEC),
  803.     RING("warning",        "wire",        0),
  804.     RING("teleport control", "iron",    0),
  805.     RING(NULL,        "ivory",    0),
  806.     RING(NULL,        "blackened",    0),
  807.  
  808. /* gems ************************************************************/
  809. #define    GEM(name,color,prob,gval)    { name, color, NULL, 0, 1,\
  810.         GEM_SYM, prob, 0, 1, 0, 0, gval }
  811.     GEM("diamond", "blue", 1, 4000),
  812.     GEM("ruby", "red", 1, 3500),
  813.     GEM("sapphire", "blue", 1, 3000),
  814.     GEM("emerald", "green", 1, 2500),
  815.     GEM("turquoise", "green", 1, 2000),
  816.     GEM("aquamarine", "blue", 1, 1500),
  817.     GEM("tourmaline", "green", 1, 1000),
  818.     GEM("topaz", "yellow", 1, 900),
  819.     GEM("opal", "yellow", 1, 800),
  820.     GEM("garnet", "dark", 1, 700),
  821.     GEM("amethyst", "violet", 2, 650),
  822.     GEM("agate", "green", 2, 600),
  823.     GEM("onyx", "white", 2, 550),
  824.     GEM("jasper", "yellowish brown", 2, 500),
  825.     GEM("jade", "green", 2, 450),
  826.     GEM("worthless piece of blue glass", "blue", 20, 0),
  827.     GEM("worthless piece of red glass", "red", 20, 0),
  828.     GEM("worthless piece of yellow glass", "yellow", 20, 0),
  829.     GEM("worthless piece of green glass", "green", 20, 0),
  830.     { NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }
  831. };
  832.  
  833. #endif MSDOS
  834.  
  835. char obj_symbols[] = {
  836.     ILLOBJ_SYM, AMULET_SYM, FOOD_SYM, WEAPON_SYM, TOOL_SYM,
  837.     BALL_SYM, CHAIN_SYM, ROCK_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM,
  838.     WAND_SYM, RING_SYM, GEM_SYM, 0 };
  839. int bases[sizeof(obj_symbols)];
  840.