… | |
… | |
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" |
… | |
… | |
319 | |
313 | |
320 | enc += op->stats.luck; |
314 | enc += op->stats.luck; |
321 | |
315 | |
322 | /* Do spell paths now */ |
316 | /* Do spell paths now */ |
323 | for (i = 1; i < NRSPELLPATHS; i++) |
317 | for (i = 1; i < NRSPELLPATHS; i++) |
324 | { |
|
|
325 | if (op->path_attuned & (1 << i)) |
318 | if (op->path_attuned & (1 << i)) |
326 | enc++; |
319 | enc++; |
327 | else if (op->path_denied & (1 << i)) |
320 | else if (op->path_denied & (1 << i)) |
328 | enc -= 2; |
321 | enc -= 2; |
329 | else if (op->path_repelled & (1 << i)) |
322 | else if (op->path_repelled & (1 << i)) |
330 | enc--; |
323 | enc--; |
331 | } |
|
|
332 | |
324 | |
333 | if (op->flag [FLAG_LIFESAVE ]) enc += 5; |
325 | if (op->flag [FLAG_LIFESAVE ]) enc += 5; |
334 | if (op->flag [FLAG_REFL_SPELL ]) enc += 3; |
326 | if (op->flag [FLAG_REFL_SPELL ]) enc += 3; |
335 | if (op->flag [FLAG_REFL_MISSILE]) enc += 2; |
327 | if (op->flag [FLAG_REFL_MISSILE]) enc += 2; |
336 | if (op->flag [FLAG_XRAYS ]) enc += 2; |
328 | if (op->flag [FLAG_XRAYS ]) enc += 2; |
… | |
… | |
438 | return levelnumbers_10[i / 10]; |
430 | return levelnumbers_10[i / 10]; |
439 | |
431 | |
440 | strcpy (buf, numbers_10[i / 10]); |
432 | strcpy (buf, numbers_10[i / 10]); |
441 | strcat (buf, levelnumbers[i % 10]); |
433 | strcat (buf, levelnumbers[i % 10]); |
442 | return buf; |
434 | return buf; |
443 | } |
|
|
444 | |
|
|
445 | /* |
|
|
446 | * get_number(integer) returns the text-representation of the given number |
|
|
447 | * in a static buffer. The buffer might be overwritten at the next |
|
|
448 | * call to get_number(). |
|
|
449 | * It is currently only used by the query_name() function. |
|
|
450 | */ |
|
|
451 | static const char * |
|
|
452 | get_number (int i) |
|
|
453 | { |
|
|
454 | if (i <= 20) |
|
|
455 | return numbers[i]; |
|
|
456 | else |
|
|
457 | { |
|
|
458 | static char buf[MAX_BUF]; |
|
|
459 | |
|
|
460 | sprintf (buf, "%d", i); |
|
|
461 | return buf; |
|
|
462 | } |
|
|
463 | } |
435 | } |
464 | |
436 | |
465 | /* |
437 | /* |
466 | * Returns pointer to static buffer containing ring's or amulet's |
438 | * Returns pointer to static buffer containing ring's or amulet's |
467 | * abilities |
439 | * abilities |
… | |
… | |
814 | /* Note that the resolution this provides for players really isn't |
786 | /* Note that the resolution this provides for players really isn't |
815 | * very good. Any player with a speed greater than .67 will |
787 | * very good. Any player with a speed greater than .67 will |
816 | * fall into the 'lightning fast movement' category. |
788 | * fall into the 'lightning fast movement' category. |
817 | */ |
789 | */ |
818 | if (op->has_active_speed ()) |
790 | if (op->has_active_speed ()) |
819 | switch ((int) ((FABS (op->speed)) * 15)) |
791 | switch ((int)((fabs (op->speed)) * 15.)) |
820 | { |
792 | { |
821 | case 0: |
793 | case 0: |
822 | buf << "(very slow movement)"; |
794 | buf << "(very slow movement)"; |
823 | break; |
795 | break; |
824 | case 1: |
796 | case 1: |