1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_info_c = |
|
|
4 | * "$Id: info.C,v 1.4 2006/09/10 16:00:23 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | #include <global.h> |
24 | #include <global.h> |
31 | |
25 | |
32 | /* |
26 | /* |
… | |
… | |
64 | break; |
58 | break; |
65 | } |
59 | } |
66 | } |
60 | } |
67 | |
61 | |
68 | ch = describe_item (&at->clone, NULL); |
62 | ch = describe_item (&at->clone, NULL); |
69 | #ifndef WIN32 |
|
|
70 | printf ("%-16s|%6lld|%4d|%3d|%s|%s|%s\n", &at->clone.name, (long long) at->clone.stats.exp, |
63 | printf ("%-16s|%6lld|%4d|%3d|%s|%s|%s\n", &at->clone.name, (long long) at->clone.stats.exp, |
71 | at->clone.stats.hp, at->clone.stats.ac, ch, &at->name, gen_name); |
64 | at->clone.stats.hp, at->clone.stats.ac, ch, &at->name, gen_name); |
72 | #else |
|
|
73 | printf ("%-16s|%6I64d|%4d|%3d|%s|%s|%s\n", &at->clone.name, (long long) at->clone.stats.exp, |
|
|
74 | at->clone.stats.hp, at->clone.stats.ac, ch, &at->name, gen_name); |
|
|
75 | #endif |
|
|
76 | } |
65 | } |
77 | } |
66 | } |
78 | |
67 | |
79 | /* |
68 | /* |
80 | * As dump_abilities(), but with an alternative way of output. |
69 | * As dump_abilities(), but with an alternative way of output. |
… | |
… | |
95 | printf |
84 | printf |
96 | ("---------------------------------------------------------------------------------------------------------------------------------------------------\n"); |
85 | ("---------------------------------------------------------------------------------------------------------------------------------------------------\n"); |
97 | for (at = first_archetype; at != NULL; at = at->next) |
86 | for (at = first_archetype; at != NULL; at = at->next) |
98 | { |
87 | { |
99 | op = arch_to_object (at); |
88 | op = arch_to_object (at); |
|
|
89 | |
100 | if (QUERY_FLAG (op, FLAG_MONSTER)) |
90 | if (QUERY_FLAG (op, FLAG_MONSTER)) |
101 | { |
91 | { |
102 | bitstostring ((long) op->attacktype, NROFATTACKS, attbuf); |
92 | bitstostring ((long) op->attacktype, NROFATTACKS, attbuf); |
103 | printf ("%-15s|%5d|%3d|%4d|%4d|%s|", &op->arch->name, op->stats.maxhp, op->stats.dam, op->stats.ac, op->stats.wc, attbuf); |
93 | printf ("%-15s|%5d|%3d|%4d|%4d|%s|", &op->arch->name, op->stats.maxhp, op->stats.dam, op->stats.ac, op->stats.wc, attbuf); |
104 | for (i = 0; i < NROFATTACKS; i++) |
94 | for (i = 0; i < NROFATTACKS; i++) |
105 | printf ("%4d", op->resist[i]); |
95 | printf ("%4d", op->resist[i]); |
106 | printf ("|%8lld|%9d|\n", (long long) op->stats.exp, new_exp (op)); |
96 | printf ("|%8lld|%9d|\n", (long long) op->stats.exp, new_exp (op)); |
107 | } |
97 | } |
108 | free_object (op); |
98 | |
|
|
99 | op->destroy (); |
109 | } |
100 | } |
110 | } |
101 | } |
111 | |
102 | |
112 | /* |
103 | /* |
113 | * Writes <num> ones and zeros to the given string based on the |
104 | * Writes <num> ones and zeros to the given string based on the |
… | |
… | |
127 | if (i && (i % 3) == 0) |
118 | if (i && (i % 3) == 0) |
128 | { |
119 | { |
129 | str[i + j] = ' '; |
120 | str[i + j] = ' '; |
130 | j++; |
121 | j++; |
131 | } |
122 | } |
|
|
123 | |
132 | if (bits & 1) |
124 | if (bits & 1) |
133 | str[i + j] = '1'; |
125 | str[i + j] = '1'; |
134 | else |
126 | else |
135 | str[i + j] = '0'; |
127 | str[i + j] = '0'; |
|
|
128 | |
136 | bits >>= 1; |
129 | bits >>= 1; |
137 | } |
130 | } |
|
|
131 | |
138 | str[i + j] = '\0'; |
132 | str[i + j] = '\0'; |
139 | return; |
|
|
140 | } |
133 | } |