1 | /* |
1 | /* |
2 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
3 | |
3 | |
|
|
4 | Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | Copyright (C) 1992 Frank Tore Johansen |
6 | Copyright (C) 1992 Frank Tore Johansen |
6 | |
7 | |
7 | This program is free software; you can redistribute it and/or modify |
8 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | it under the terms of the GNU General Public License as published by |
… | |
… | |
58 | break; |
59 | break; |
59 | } |
60 | } |
60 | } |
61 | } |
61 | |
62 | |
62 | ch = describe_item (&at->clone, NULL); |
63 | ch = describe_item (&at->clone, NULL); |
63 | #ifndef WIN32 |
|
|
64 | printf ("%-16s|%6lld|%4d|%3d|%s|%s|%s\n", &at->clone.name, (long long) at->clone.stats.exp, |
64 | printf ("%-16s|%6lld|%4d|%3d|%s|%s|%s\n", &at->clone.name, (long long) at->clone.stats.exp, |
65 | at->clone.stats.hp, at->clone.stats.ac, ch, &at->name, gen_name); |
65 | at->clone.stats.hp, at->clone.stats.ac, ch, &at->name, gen_name); |
66 | #else |
|
|
67 | printf ("%-16s|%6I64d|%4d|%3d|%s|%s|%s\n", &at->clone.name, (long long) at->clone.stats.exp, |
|
|
68 | at->clone.stats.hp, at->clone.stats.ac, ch, &at->name, gen_name); |
|
|
69 | #endif |
|
|
70 | } |
66 | } |
71 | } |
67 | } |
72 | |
68 | |
73 | /* |
69 | /* |
74 | * As dump_abilities(), but with an alternative way of output. |
70 | * As dump_abilities(), but with an alternative way of output. |
… | |
… | |
89 | printf |
85 | printf |
90 | ("---------------------------------------------------------------------------------------------------------------------------------------------------\n"); |
86 | ("---------------------------------------------------------------------------------------------------------------------------------------------------\n"); |
91 | for (at = first_archetype; at != NULL; at = at->next) |
87 | for (at = first_archetype; at != NULL; at = at->next) |
92 | { |
88 | { |
93 | op = arch_to_object (at); |
89 | op = arch_to_object (at); |
|
|
90 | |
94 | if (QUERY_FLAG (op, FLAG_MONSTER)) |
91 | if (QUERY_FLAG (op, FLAG_MONSTER)) |
95 | { |
92 | { |
96 | bitstostring ((long) op->attacktype, NROFATTACKS, attbuf); |
93 | bitstostring ((long) op->attacktype, NROFATTACKS, attbuf); |
97 | printf ("%-15s|%5d|%3d|%4d|%4d|%s|", &op->arch->name, op->stats.maxhp, op->stats.dam, op->stats.ac, op->stats.wc, attbuf); |
94 | printf ("%-15s|%5d|%3d|%4d|%4d|%s|", &op->arch->name, op->stats.maxhp, op->stats.dam, op->stats.ac, op->stats.wc, attbuf); |
98 | for (i = 0; i < NROFATTACKS; i++) |
95 | for (i = 0; i < NROFATTACKS; i++) |
99 | printf ("%4d", op->resist[i]); |
96 | printf ("%4d", op->resist[i]); |
100 | printf ("|%8lld|%9d|\n", (long long) op->stats.exp, new_exp (op)); |
97 | printf ("|%8lld|%9d|\n", (long long) op->stats.exp, new_exp (op)); |
101 | } |
98 | } |
102 | free_object (op); |
99 | |
|
|
100 | op->destroy (); |
103 | } |
101 | } |
104 | } |
102 | } |
105 | |
103 | |
106 | /* |
104 | /* |
107 | * Writes <num> ones and zeros to the given string based on the |
105 | * Writes <num> ones and zeros to the given string based on the |
… | |
… | |
121 | if (i && (i % 3) == 0) |
119 | if (i && (i % 3) == 0) |
122 | { |
120 | { |
123 | str[i + j] = ' '; |
121 | str[i + j] = ' '; |
124 | j++; |
122 | j++; |
125 | } |
123 | } |
|
|
124 | |
126 | if (bits & 1) |
125 | if (bits & 1) |
127 | str[i + j] = '1'; |
126 | str[i + j] = '1'; |
128 | else |
127 | else |
129 | str[i + j] = '0'; |
128 | str[i + j] = '0'; |
|
|
129 | |
130 | bits >>= 1; |
130 | bits >>= 1; |
131 | } |
131 | } |
|
|
132 | |
132 | str[i + j] = '\0'; |
133 | str[i + j] = '\0'; |
133 | return; |
|
|
134 | } |
134 | } |