… | |
… | |
63 | {KW_body_foot , "You can put it on your foot" , "It goes on a human's foot"}, |
63 | {KW_body_foot , "You can put it on your foot" , "It goes on a human's foot"}, |
64 | {KW_body_hand , "You can put it on your hand" , "It goes on a human's hand"}, |
64 | {KW_body_hand , "You can put it on your hand" , "It goes on a human's hand"}, |
65 | {KW_body_wrist , "You can wear it around your wrist" , "It goes around a human's wrist"}, |
65 | {KW_body_wrist , "You can wear it around your wrist" , "It goes around a human's wrist"}, |
66 | {KW_body_waist , "You can wear it around your waist" , "It goes around a human's waist"}, |
66 | {KW_body_waist , "You can wear it around your waist" , "It goes around a human's waist"}, |
67 | /*{"body_dragon_torso", "your body", "a dragon's body"} */ |
67 | /*{"body_dragon_torso", "your body", "a dragon's body"} */ |
68 | }; |
|
|
69 | |
|
|
70 | static char numbers[21][20] = { |
|
|
71 | "no", "", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", |
|
|
72 | "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", |
|
|
73 | "eighteen", "nineteen", "twenty" |
|
|
74 | }; |
68 | }; |
75 | |
69 | |
76 | static char numbers_10[10][20] = { |
70 | static char numbers_10[10][20] = { |
77 | "zero", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", |
71 | "zero", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", |
78 | "eighty", "ninety" |
72 | "eighty", "ninety" |
… | |
… | |
207 | {BUILDER, "item builder", "item builders", 0, 0}, |
201 | {BUILDER, "item builder", "item builders", 0, 0}, |
208 | {MATERIAL, "building material", "building materials", 0, 0}, |
202 | {MATERIAL, "building material", "building materials", 0, 0}, |
209 | {ITEM_TRANSFORMER, "item_transformer", "item_transformers", 0, 0}, |
203 | {ITEM_TRANSFORMER, "item_transformer", "item_transformers", 0, 0}, |
210 | }; |
204 | }; |
211 | |
205 | |
212 | const int item_types_size = sizeof (item_types) / sizeof (*item_types); |
206 | static const int item_types_size = sizeof (item_types) / sizeof (*item_types); |
213 | |
207 | |
214 | materialtype_t *materialt; |
208 | materialtype_t *materialt; |
215 | |
209 | |
216 | /* |
210 | /* |
217 | materialtype material[NROFMATERIALS] = { |
211 | materialtype material[NROFMATERIALS] = { |
… | |
… | |
390 | buf.printf (newline ? "%s %d\n" : "(%s %+d)", resist_plus[i], op->resist[i]); |
384 | buf.printf (newline ? "%s %d\n" : "(%s %+d)", resist_plus[i], op->resist[i]); |
391 | |
385 | |
392 | return buf; |
386 | return buf; |
393 | } |
387 | } |
394 | |
388 | |
395 | |
|
|
396 | /* |
389 | /* |
397 | * query_weight(object) returns a character pointer to a static buffer |
390 | * query_weight(object) returns a character pointer to a static buffer |
398 | * containing the text-representation of the weight of the given object. |
391 | * containing the text-representation of the weight of the given object. |
399 | * The buffer will be overwritten by the next call to query_weight(). |
392 | * The buffer will be overwritten by the next call to query_weight(). |
400 | * |
393 | * |
… | |
… | |
439 | return levelnumbers_10[i / 10]; |
432 | return levelnumbers_10[i / 10]; |
440 | |
433 | |
441 | strcpy (buf, numbers_10[i / 10]); |
434 | strcpy (buf, numbers_10[i / 10]); |
442 | strcat (buf, levelnumbers[i % 10]); |
435 | strcat (buf, levelnumbers[i % 10]); |
443 | return buf; |
436 | return buf; |
444 | } |
|
|
445 | |
|
|
446 | /* |
|
|
447 | * get_number(integer) returns the text-representation of the given number |
|
|
448 | * in a static buffer. The buffer might be overwritten at the next |
|
|
449 | * call to get_number(). |
|
|
450 | * It is currently only used by the query_name() function. |
|
|
451 | */ |
|
|
452 | const char * |
|
|
453 | get_number (int i) |
|
|
454 | { |
|
|
455 | if (i <= 20) |
|
|
456 | return numbers[i]; |
|
|
457 | else |
|
|
458 | { |
|
|
459 | static char buf[MAX_BUF]; |
|
|
460 | |
|
|
461 | sprintf (buf, "%d", i); |
|
|
462 | return buf; |
|
|
463 | } |
|
|
464 | } |
437 | } |
465 | |
438 | |
466 | /* |
439 | /* |
467 | * Returns pointer to static buffer containing ring's or amulet's |
440 | * Returns pointer to static buffer containing ring's or amulet's |
468 | * abilities |
441 | * abilities |
… | |
… | |
474 | */ |
447 | */ |
475 | |
448 | |
476 | /* Aug 95 modified this slightly so that Skill tools don't have magic bonus |
449 | /* Aug 95 modified this slightly so that Skill tools don't have magic bonus |
477 | * from stats.sp - b.t. |
450 | * from stats.sp - b.t. |
478 | */ |
451 | */ |
479 | const char * |
452 | static const char * |
480 | ring_desc (const object *op) |
453 | ring_desc (const object *op) |
481 | { |
454 | { |
482 | static dynbuf_text buf; buf.clear (); |
455 | static dynbuf_text buf; buf.clear (); |
483 | int attr, val, len; |
456 | int attr, val, len; |
484 | |
457 | |
… | |
… | |
637 | |
610 | |
638 | buf << query_short_name (op); |
611 | buf << query_short_name (op); |
639 | |
612 | |
640 | if (QUERY_FLAG (op, FLAG_INV_LOCKED)) |
613 | if (QUERY_FLAG (op, FLAG_INV_LOCKED)) |
641 | buf << " *"; |
614 | buf << " *"; |
642 | if (op->type == CONTAINER && ((op->env && op->env->container == op) || (!op->env && QUERY_FLAG (op, FLAG_APPLIED)))) |
615 | if (op->is_open_container ()) |
643 | buf << " (open)"; |
616 | buf << " (open)"; |
644 | |
617 | |
645 | if (QUERY_FLAG (op, FLAG_KNOWN_CURSED)) |
618 | if (QUERY_FLAG (op, FLAG_KNOWN_CURSED)) |
646 | { |
619 | { |
647 | if (QUERY_FLAG (op, FLAG_DAMNED)) |
620 | if (QUERY_FLAG (op, FLAG_DAMNED)) |