summaryrefslogtreecommitdiff
path: root/games/ularn/patches/patch-au
blob: 4fcdd392d1ab14eb07a9f31be409ee4f6fd9ac14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
$NetBSD: patch-au,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $

--- player.c.orig	Fri Jun 19 13:55:34 1992
+++ player.c	Sat Jan 13 21:54:50 2001
@@ -20,6 +20,7 @@
  *				to quit
  */
 
+#include <stdlib.h>
 #include "header.h"
 #include "player.h"
 #include "monst.h"
@@ -36,7 +37,7 @@
  *	uses the skill[] array to find level boundarys
  *	uses c[EXPERIENCE]  c[LEVEL]
  */
-raiselevel ()
+void raiselevel (void)
 {
 	if (c[LEVEL] < MAXPLEVEL) 
 		raiseexperience((long)(skill[c[LEVEL]]-c[EXPERIENCE]));
@@ -50,7 +51,7 @@
  *
  *	subroutine to lower the players character level by one
  */
-loselevel ()
+void loselevel (void)
 {
 	if (c[LEVEL] > 1) 
 		loseexperience((long)(c[EXPERIENCE] - skill[c[LEVEL]-1] + 1));
@@ -64,7 +65,7 @@
  *
  *	subroutine to increase experience points
  */
-raiseexperience (x)
+void raiseexperience (x)
 long x;
 {
 	int i,tmp;
@@ -115,9 +116,9 @@
 				for (i=0; i<SPNUM; i++)	
 					spelknow[i]=1;
 				for (i=0; i<MAXSCROLL; i++)
-					scrollname[i][0]=' ';
+					scrollknown[i]=1;
 				for (i=0; i<MAXPOTION; i++)
-					potionname[i][0]=' ';
+					potionknown[i]=1;
 			}
 			break;
 		}
@@ -132,7 +133,7 @@
  *
  *	subroutine to lose experience points
  */
-loseexperience (x)
+void loseexperience (x)
 long x;
 {
 	int i,tmp;
@@ -167,7 +168,7 @@
  *	subroutine to remove hit points from the player
  *	warning -- will kill player if hp goes to zero
  */
-losehp (x)
+void losehp (x)
 int x;
 {
 	if ((c[HP] -= x) <= 0) {
@@ -178,7 +179,7 @@
 	}
 }
 
-losemhp (x)
+void losemhp (x)
 int x;
 {
 	c[HP] -= x;		
@@ -198,14 +199,14 @@
  *
  *	subroutine to gain maximum hit points
  */
-raisehp (x)
+void raisehp (x)
 int x;
 {
 	if ((c[HP] += x) > c[HPMAX]) 
 		c[HP] = c[HPMAX];
 }
 
-raisemhp (x)
+void raisemhp (x)
 int x;
 {
 	c[HPMAX] += x;	
@@ -221,14 +222,14 @@
  *
  *	subroutine to gain maximum spells
  */
-raisespells (x)
+void raisespells (x)
 int x;
 {
 	if ((c[SPELLS] += x) > c[SPELLMAX])	
 		c[SPELLS] = c[SPELLMAX];
 }
 
-raisemspells (x)
+void raisemspells (x)
 int x;
 {
 	c[SPELLMAX]+=x; 
@@ -244,14 +245,14 @@
  *
  *	subroutine to lose maximum spells
  */
-losespells (x)
+void losespells (x)
 int x;
 {
 	if ((c[SPELLS] -= x) < 0) 
 		c[SPELLS]=0;
 }
 
-losemspells (x)
+void losemspells (x)
 int x;
 {
 	if ((c[SPELLMAX] -= x) < 0) 
@@ -266,7 +267,7 @@
  *
  *	function to be sure player is not in a wall
  */
-positionplayer ()
+void positionplayer ()
 {
 	int try;
 	try = 2;
@@ -286,7 +287,7 @@
 /*
  *	recalc()	function to recalculate the armor class of the player
  */
-recalc ()
+void recalc ()
 {
 	int i,j,k;
 
@@ -417,7 +418,7 @@
  *
  *	subroutine to ask if the player really wants to quit
  */
-quit ()
+void quit (void)
 {
 	int i;
 
@@ -427,7 +428,7 @@
 	while (1) {
 		i=getcharacter();
 		if (i == 'y')	{ 
-			clear();
+			ularn_clear();
 			lflush();
 			died(300); 
 			return; 
@@ -440,7 +441,7 @@
 		if (i == 's') {
 			lprcat(" save");
 			lflush();
-			clear();
+			ularn_clear();
 			lprcat("Saving . . ."); 
 			lflush();
 			savegame(savefilename); 
@@ -466,7 +467,7 @@
 /*
  *	function to ask --more-- then the user must enter a space
  */
-more()
+void more(void)
 {
 	char c;
 
@@ -481,7 +482,7 @@
  *	function to put something in the players inventory
  *	returns 0 if success, 1 if a failure
  */
-take (itm, arg)
+int take (itm, arg)
 int itm, arg;
 {
 	int i;
@@ -576,7 +577,7 @@
  *
  *	k is index into iven list of object to drop
  */
-drop_object (k)
+int drop_object (k)
 int k;
 {
 	int itm, pitflag=0;
@@ -628,7 +629,7 @@
 /*
  *	function to enchant armor player is currently wearing
  */
-enchantarmor ()
+void enchantarmor (void)
 {
 	int tmp;
 
@@ -677,7 +678,7 @@
 /*
  *	function to enchant a weapon presently being wielded
  */
-enchweapon ()
+void enchweapon (void)
 {
 	int tmp;
 
@@ -716,7 +717,7 @@
  *	routine to tell if player can carry one more thing
  *	returns 1 if pockets are full, else 0
  */
-pocketfull ()
+int pocketfull (void)
 {
 	int i,limit; 
 	if ((limit = 15+(c[LEVEL]>>1)) > IVENSIZE)
@@ -730,7 +731,7 @@
 /*
  *	function to return 1 if a monster is next to the player else returns 0
  */
-nearbymonst ()
+int nearbymonst (void)
 {
 	int tmp,tmp2;
 
@@ -745,7 +746,7 @@
  *	function to steal an item from the players pockets
  *	returns 1 if steals something else returns 0
  */
-stealsomething (x,y)
+int stealsomething (x,y)
 int x,y;
 {
 	int i,n=100;
@@ -775,7 +776,7 @@
 /*
  *	function to return 1 is player carrys nothing else return 0
  */
-emptyhanded ()
+int emptyhanded (void)
 {
 	int i;
 
@@ -789,7 +790,7 @@
 /*
  *	function to create a gem on a square near the player
  */
-creategem ()
+void creategem (void)
 {
 	int i,j;
 
@@ -818,7 +819,7 @@
  *	function to change character levels as needed when dropping an object
  *	that affects these characteristics
  */
-adjustcvalues (itm, arg)
+void adjustcvalues (itm, arg)
 int itm, arg;
 {
 	int flag,i;
@@ -902,7 +903,7 @@
  *	function to read a string from token input "string"
  *	returns a pointer to the string
  */
-gettokstr (str)
+void gettokstr (str)
 char *str;
 {
 	int i,j;
@@ -929,14 +930,14 @@
  *	returns 1 if entered correctly, 0 if not
  */
 
-getpassword ()
+int getpassword (void)
 {
 	char gpwbuf[BUFSIZ];
 
 	scbr();
 	lprcat("\nEnter Password: "); 
 	lflush();
-	gets(gpwbuf);
+	fgets(gpwbuf, BUFSIZ, stdin);
 	if (strcmp(gpwbuf,password) != 0) {	
 		lprcat("\nSorry\n");
 		lflush();
@@ -949,7 +950,7 @@
  *	subroutine to get a yes or no response from the user
  *	returns y or n
  */
-getyn ()
+int getyn (void)
 {
 	int i;
 
@@ -965,7 +966,7 @@
  *	function to calculate the pack weight of the player
  *	returns the number of pounds the player is carrying
  */
-packweight ()
+int packweight (void)
 {
 	int i,j,k;