comparison srogue/rgdata.c @ 36:2128c7dc8a40

Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
author elwin
date Thu, 25 Nov 2010 12:21:41 +0000
parents
children
comparison
equal deleted inserted replaced
35:05018c63a721 36:2128c7dc8a40
1 /*
2 * Super-Rogue
3 * Copyright (C) 1984 Robert D. Kindelberger
4 * All rights reserved.
5 *
6 * See the file LICENSE.TXT for full copyright and licensing information.
7 */
8
9 #include "global.c"
10
11 main(argc,argv)
12 char **argv;
13 int argc;
14 {
15 char *ptr;
16 int i, j, k;
17 struct magic_item *mi;
18 struct init_weps *wp;
19 struct init_armor *ar;
20 struct monster *mo;
21 FILE *fo;
22
23 /*
24 * write to desired output file
25 */
26 if (argc > 1) {
27 fo = fopen(argv[1], "w");
28 if (fo == NULL) {
29 printf("%s: %s not writable\n",argv[0],argv[1]);
30 exit(1);
31 }
32 }
33 else
34 fo = stdout;
35
36 /*
37 * print total chances for armor, weapons, food, scrolls, etc
38 */
39 fprintf(fo," \n\n\n\n\n\n");
40 fprintf(fo,"\t ITEM GENERAL INFO\n\n\n");
41 fprintf(fo,"NAME\t\tCHANCE\t\tWEIGHT\n\n");
42 for (mi = &things[0]; mi < &things[NUMTHINGS]; mi++) {
43 fprintf(fo,"%s\t\t",mi->mi_name);
44 i = mi->mi_prob / 10;
45 j = mi->mi_prob % 10;
46 fprintf(fo,"%2d.%1d %%\t\t",i,j);
47 i = mi->mi_wght / 10;
48 j = mi->mi_wght % 10;
49 if (i == 0 && j == 0)
50 fprintf(fo,"%3s\n","*");
51 else
52 fprintf(fo,"%3d.%1d lbs\n",i,j);
53 }
54 fprintf(fo,"\n\n\n\n\n\n\nNOTES - * means that weight depends on which one of that item type\n");
55 fprintf(fo," - All items weigh 20%% more when cursed\n");
56
57 /*
58 * print stuff about potions
59 */
60 fprintf(fo," \n\n\n\n\n\n");
61 fprintf(fo,"\t\t POTION INFO\n\n\n");
62 fprintf(fo,"NAME\t\t\t\tCHANCE\t\tWORTH\n\n");
63 for (mi = &p_magic[0]; mi < &p_magic[MAXPOTIONS]; mi++) {
64 fprintf(fo,"%s\t",mi->mi_name);
65 k = strlen(mi->mi_name);
66 if (k < 8)
67 ptr = "\t\t\t";
68 else if (k >= 16)
69 ptr = "\t";
70 else
71 ptr = "\t\t";
72 fprintf(fo,"%s", ptr);
73 i = mi->mi_prob / 10;
74 j = mi->mi_prob % 10;
75 fprintf(fo,"%2d.%1d %%\t\t",i,j);
76 fprintf(fo,"%3d\n",mi->mi_worth);
77 }
78 fprintf(fo,"\n\n\n\n\nNOTE - All potions weigh 0.5 lbs\n");
79
80
81 /*
82 * print stuff about scrolls
83 */
84 fprintf(fo," \n\n\n\n\n\n");
85 fprintf(fo,"\t\t SCROLL INFO\n\n\n");
86 fprintf(fo,"NAME\t\t\t\tCHANCE\t\tWORTH\n\n");
87 for (mi = &s_magic[0]; mi < &s_magic[MAXSCROLLS]; mi++) {
88 fprintf(fo,"%s\t",mi->mi_name);
89 k = strlen(mi->mi_name);
90 if (k < 8)
91 ptr = "\t\t\t";
92 else if (k >= 16)
93 ptr = "\t";
94 else
95 ptr = "\t\t";
96 fprintf(fo,"%s", ptr);
97 i = mi->mi_prob / 10;
98 j = mi->mi_prob % 10;
99 fprintf(fo,"%2d.%1d %%\t\t",i,j);
100 fprintf(fo,"%3d\n",mi->mi_worth);
101 }
102 fprintf(fo,"\n\n\n\n\nNOTE - All scrolls weigh 3.0 lbs\n");
103
104
105 /*
106 * print stuff about rings
107 */
108 fprintf(fo," \n\n\n\n\n\n");
109 fprintf(fo,"\t\t RING INFO\n\n\n");
110 fprintf(fo,"NAME\t\t\t\tCHANCE\t\tWORTH\n\n");
111 for (mi = &r_magic[0]; mi < &r_magic[MAXRINGS]; mi++) {
112 fprintf(fo,"%s\t",mi->mi_name);
113 k = strlen(mi->mi_name);
114 if (k < 8)
115 ptr = "\t\t\t";
116 else if (k >= 16)
117 ptr = "\t";
118 else
119 ptr = "\t\t";
120 fprintf(fo,"%s", ptr);
121 i = mi->mi_prob / 10;
122 j = mi->mi_prob % 10;
123 fprintf(fo,"%2d.%1d %%\t\t",i,j);
124 fprintf(fo,"%3d\n",mi->mi_worth);
125 }
126 fprintf(fo,"\n\n\n\n\nNOTE - All rings weigh 0.5 lbs\n");
127
128
129 /*
130 * print stuff about sticks
131 */
132 fprintf(fo," \n\n\n\n\n\n");
133 fprintf(fo,"\t\t STAFF/WAND INFO\n\n\n");
134 fprintf(fo,"NAME\t\t\t\tCHANCE\t\tWORTH\n\n");
135 for (mi = &ws_magic[0]; mi < &ws_magic[MAXSTICKS]; mi++) {
136 fprintf(fo,"%s\t",mi->mi_name);
137 k = strlen(mi->mi_name);
138 if (k < 8)
139 ptr = "\t\t\t";
140 else if (k >= 16)
141 ptr = "\t";
142 else
143 ptr = "\t\t";
144 fprintf(fo,"%s", ptr);
145 i = mi->mi_prob / 10;
146 j = mi->mi_prob % 10;
147 fprintf(fo,"%2d.%1d %%\t\t",i,j);
148 fprintf(fo,"%3d\n",mi->mi_worth);
149 }
150 fprintf(fo,"\n\n\n\n\nNOTES - All wands weigh 6.0 lbs\n");
151 fprintf(fo," - All staffs weigh 10.0 lbs\n");
152 fprintf(fo," - Wands contain from 4 to 8 charges\n");
153 fprintf(fo," - Staffs contain from 5 to 12 charges\n");
154 fprintf(fo," - Sticks of light have an additional 7 to 15 charges\n");
155
156
157 /*
158 * print armor info
159 */
160 fprintf(fo," \n\n\n\n\n\n");
161 fprintf(fo,"\t\t\t\tARMOR INFO\n\n\n");
162 fprintf(fo,"NAME\t\t\t\tAC\tCHANCE\t\tWORTH\t\tWEIGHT\n\n");
163 for (ar = &armors[0]; ar < &armors[MAXARMORS]; ar++) {
164 fprintf(fo,"%s\t",ar->a_name);
165 k = strlen(ar->a_name);
166 if (k < 8)
167 ptr = "\t\t\t";
168 else if (k >= 16)
169 ptr = "\t";
170 else
171 ptr = "\t\t";
172 fprintf(fo,"%s", ptr);
173 fprintf(fo,"%2d\t",ar->a_class);
174 fprintf(fo,"%2d %%\t\t",ar->a_prob);
175 fprintf(fo,"%3d\t\t",ar->a_worth);
176 fprintf(fo,"%2d lbs\n",ar->a_wght / 10);
177 }
178 fprintf(fo,"\n\n\n\n\nNOTE - All armor becomes 50%% lighter when blessed\n");
179
180
181 /*
182 * print stuff about weapons
183 */
184 fprintf(fo," \n\n\n\n\n\n");
185 fprintf(fo,"\t\t\t\t\tWEAPON INFO\n\n\n");
186 fprintf(fo,
187 "NAME\t\t\tHIT DAMAGE\tHURL DAMAGE\tWORTH\t\tWEIGHT\n\n");
188 for (wp = &weaps[0]; wp < &weaps[MAXWEAPONS]; wp++) {
189 fprintf(fo,"%s\t",wp->w_name);
190 k = strlen(wp->w_name);
191 if (k < 8)
192 ptr = "\t\t";
193 else if (k >= 16)
194 ptr = "";
195 else
196 ptr = "\t";
197 fprintf(fo,"%s", ptr);
198 ptr = wp->w_dam;
199 i = *ptr - '0';
200 j = 0;
201 ptr += 2;
202 while (*ptr != NULL) {
203 j = j * 10 + (*ptr - '0');
204 ++ptr;
205 }
206 j *= i;
207 fprintf(fo," %d to %d\t",i,j);
208 ptr = wp->w_hrl;
209 i = *ptr - '0';
210 j = 0;
211 ptr += 2;
212 while (*ptr != NULL) {
213 j = j * 10 + (*ptr - '0');
214 ++ptr;
215 }
216 j *= i;
217 fprintf(fo," %d to %d\t",i,j);
218 fprintf(fo,"%4d\t\t",wp->w_worth);
219 i = wp->w_wght / 10;
220 j = wp->w_wght % 10;
221 fprintf(fo,"%2d.%1d lbs\n",i,j);
222 }
223 fprintf(fo,"\n\n\n\n\nNOTE - All weapons become 50%% lighter when blessed\n");
224
225
226 /*
227 * print stuff about the monsters
228 */
229 }