pkgsrc/games/ularn/patches/patch-ax
agc dc08309f80 Initial import of ularn-6.12.92 into the packages collection.
Provided in PR 12072 by Ben Collver (collver@linuxfreemail.com).

Ularn is a fantasy games in which your child has contracted a strange dis-
ease, and none of your home remedies seem to have any effect.  You set
out to find a remedy in a limited amount of time, and to collect gold
along the way of course!

Ularn is based on larn, and adds the concept of character classes.
2001-04-27 15:27:30 +00:00

198 lines
4.1 KiB
Text

$NetBSD: patch-ax,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $
--- scores.c.orig Fri Jun 19 13:55:34 1992
+++ scores.c Sat Jan 13 21:55:18 2001
@@ -33,6 +33,7 @@
* diedsub(x)
* Subroutine to print out a line showing player when he is killed
*/
+#include <unistd.h>
#include "header.h"
#include "monst.h"
#include "itm.h"
@@ -109,7 +110,7 @@
*
* returns -1 if unable to read in the scoreboard, returns 0 if all is OK
*/
-readboard()
+int readboard(void)
{
FILE *fp;
@@ -142,7 +143,7 @@
*
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
*/
-writeboard()
+int writeboard(void)
{
FILE *fp;
@@ -175,7 +176,7 @@
*
* returns -1 if unable to write the scoreboard, returns 0 if all is OK
*/
-makeboard()
+int makeboard(void)
{
int i;
@@ -200,7 +201,7 @@
* scoreboard. This function also sets outstanding_taxes to the value in
* the winners scoreboard.
*/
-hashewon()
+int hashewon(void)
{
int i;
@@ -263,7 +264,7 @@
*
* Returns the number of players on scoreboard that were shown
*/
-winshou()
+int winshou(void)
{
struct wscofmt *p;
int i, j, count;
@@ -312,7 +313,7 @@
* Enter with 0 to list the scores, enter with 1 to list inventories too
* Returns the number of players on scoreboard that were shown
*/
-shou(x)
+int shou(x)
int x;
{
int i, j, n;
@@ -385,7 +386,7 @@
*/
static char esb[] = "The scoreboard is empty.\n";
-showscores()
+void showscores(void)
{
int i, j;
@@ -408,7 +409,7 @@
*
* Returns nothing of value
*/
-showallscores()
+void showallscores(void)
{
int i, j;
@@ -419,9 +420,9 @@
c[WEAR] = c[WIELD] = c[SHIELD] = -1;
for (i = 0; i < MAXPOTION; i++)
- potionname[i][0] = ' ';
+ potionknown[i] = 1;
for (i = 0; i < MAXSCROLL; i++)
- scrollname[i][0] = ' ';
+ scrollknown[i] = 1;
i = winshou();
j = shou(1);
@@ -439,7 +440,7 @@
*
* Returns 0 if no sorting done, else returns 1
*/
-sortboard()
+int sortboard(void)
{
int i, j, pos;
long jdat;
@@ -480,7 +481,7 @@
* died() reason # in whyded, and TRUE/FALSE in winner if a winner
* ex. newscore(1000, "player 1", 32, 0);
*/
-newscore(score, whoo, whyded, winner)
+void newscore(score, whoo, whyded, winner)
long score;
int winner, whyded;
char *whoo;
@@ -544,7 +545,7 @@
* slot in scoreboard in i, and the tax bill in taxes.
* Returns nothing of value
*/
-new1sub(score, i, whoo, taxes)
+void new1sub(score, i, whoo, taxes)
long score, taxes;
int i;
char *whoo;
@@ -576,7 +577,7 @@
* died() reason # in whyded, and slot in scoreboard in i.
* Returns nothing of value
*/
-new2sub(score, i, whoo, whyded)
+void new2sub(score, i, whoo, whyded)
long score;
int i, whyded;
char *whoo;
@@ -649,7 +650,7 @@
static int scorerror;
-died(x)
+void died(x)
int x;
{
int f, win;
@@ -710,7 +711,7 @@
/* now enter the player at the end of the scoreboard */
newscore(c[GOLD] + c[BANKACCOUNT], logname, x, win);
- clear();
+ ularn_clear();
lflush();
diedsub(x); /* print out the score line */
@@ -743,7 +744,7 @@
* diedsub(x)
* int x;
*/
-diedsub(x)
+void diedsub(x)
int x;
{
char ch, *mod, *cls;
@@ -753,7 +754,7 @@
puts("---------------------------------------------------------------");
puts(" U L A R N S C O R E S");
puts("---------------------------------------------------------------");
- printf("Score: %ld Diff: %d ", c[GOLD], c[HARDGAME]);
+ printf("Score: %ld Diff: %ld ", c[GOLD], c[HARDGAME]);
printf("Level: %s Char: %s\n", cls, char_class);
printf("\t%s", logname);
if (wizard)
@@ -788,7 +789,7 @@
fflush(stdout);
}
-showscore3(index)
+void showscore3(index)
int index;
{
switch (iven[index]) {
@@ -820,9 +821,9 @@
default:
printf("\n%c) %s", index + 'a' , objectname[iven[index]]);
if (ivenarg[index] > 0)
- printf(" + %d", (long)ivenarg[index]);
+ printf(" + %ld", (long)ivenarg[index]);
else if (ivenarg[index] < 0)
- printf(" %d", (long)ivenarg[index]);
+ printf(" %ld", (long)ivenarg[index]);
break;
}
if (c[WIELD] == index)
@@ -832,7 +833,7 @@
fflush(stdout);
}
-showscore1(idx, str2)
+void showscore1(idx, str2)
int idx;
char *str2[];
{