pkgsrc/games/ularn/patches/patch-ag
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

259 lines
5.8 KiB
Text

$NetBSD: patch-ag,v 1.1.1.1 2001/04/27 15:27:31 agc Exp $
--- display.c.orig Fri Jun 19 13:55:30 1992
+++ display.c Sat Jan 13 21:53:21 2001
@@ -1,4 +1,5 @@
/* display.c */
+#include <stdlib.h>
#include "header.h"
#include "player.h"
#include "itm.h"
@@ -8,7 +9,7 @@
static int minx,maxx,miny,maxy,k,m;
static char always=0;
char bot1f=0, bot2f=0, bot3f=0;
-static char mimicmonst=MIMIC;
+static int mimicmonst=MIMIC;
#define botsub(idx,x,y,str) \
if (c[(idx)] != cbak[(idx)]) { \
@@ -17,7 +18,7 @@
lprintf(str,c[(idx)]); \
}
-bottomdo()
+void bottomdo(void)
{
if (bot1f) {
bot3f=bot1f=bot2f=0;
@@ -35,12 +36,12 @@
}
/* update only the gold number on the bottomline, called from ogold() */
-bottomgold() { botsub(GOLD,72,19,"%-8d"); }
+void bottomgold(void) { botsub(GOLD,72,19,"%-8d"); }
/* update number of spells called from regen() */
-bot_spellx() { botsub(SPELLS,9,18,"%2d"); }
+void bot_spellx(void) { botsub(SPELLS,9,18,"%2d"); }
-bot_linex()
+void bot_linex(void)
{
int i;
char buf[12];
@@ -65,7 +66,7 @@
/* c[HP], c[HPMAX], c[STRENGTH]+c[STREXTRA], */
/* c[INTELLIGENCE]); */
- sprintf(buf, "%d (%d)", c[HP], c[HPMAX]);
+ sprintf(buf, "%ld (%ld)", c[HP], c[HPMAX]);
/* 12345 111122 222222 3 */
/* 678901 345678 0 */
lprintf("HP: %11s STR=%-2d INT=%-2d ",
@@ -147,7 +148,7 @@
special routine to update hp and level fields on bottom lines
called in monster.c hitplayer() and spattack()
*/
-bot_hpx()
+void bot_hpx(void)
{
if (c[EXPERIENCE] != cbak[EXPERIENCE]) {
recalc();
@@ -164,26 +165,26 @@
int typ;
char *string;
} bot_data[] = {
- STEALTH, "stealth",
- UNDEADPRO, "undead pro",
- SPIRITPRO, "spirit pro",
- CHARMCOUNT, "Charm",
- TIMESTOP, "Time Stop",
- HOLDMONST, "Hold Monst",
- GIANTSTR, "Giant Str",
- FIRERESISTANCE,"Fire Resit",
- DEXCOUNT, "Dexterity",
- STRCOUNT, "Strength",
- SCAREMONST, "Scare",
- HASTESELF, "Haste Self",
- CANCELLATION, "Cancel",
- INVISIBILITY, "Invisible",
- ALTPRO, "Protect 3",
- PROTECTIONTIME, "Protect 2",
- WTW, "Wall-Walk"
+ { STEALTH, "stealth" },
+ { UNDEADPRO, "undead pro" },
+ { SPIRITPRO, "spirit pro" },
+ { CHARMCOUNT, "Charm" },
+ { TIMESTOP, "Time Stop" },
+ { HOLDMONST, "Hold Monst" },
+ { GIANTSTR, "Giant Str" },
+ { FIRERESISTANCE, "Fire Resit" },
+ { DEXCOUNT, "Dexterity" },
+ { STRCOUNT, "Strength" },
+ { SCAREMONST, "Scare" },
+ { HASTESELF, "Haste Self" },
+ { CANCELLATION, "Cancel" },
+ { INVISIBILITY, "Invisible" },
+ { ALTPRO, "Protect 3" },
+ { PROTECTIONTIME, "Protect 2" },
+ { WTW, "Wall-Walk" },
};
-botside()
+void botside(void)
{
int i,idx;
@@ -208,7 +209,7 @@
always=0;
}
-bothp()
+void bothp(void)
{
char buf[12];
@@ -216,7 +217,7 @@
return;
cbak[HP]=c[HP];
cbak[HPMAX]=c[HPMAX];
- sprintf(buf, "%d (%d)", c[HP], c[HPMAX]);
+ sprintf(buf, "%ld (%ld)", c[HP], c[HPMAX]);
cursor(5, 19);
lprintf("%11s", buf);
}
@@ -230,7 +231,7 @@
d_xmax=MAXX,
d_ymin=0,
d_ymax=MAXY; /* for limited screen drawing */
-draws(xmin,xmax,ymin,ymax)
+void draws(xmin,xmax,ymin,ymax)
int xmin,xmax,ymin,ymax;
{
int i,idx;
@@ -272,14 +273,14 @@
**
** redraw the whole screen as the player knows it
*/
-drawscreen()
+void drawscreen(void)
{
int i,j,k;
int lastx,lasty; /* used to optimize the object printing */
if (d_xmin==0 && d_xmax==MAXX && d_ymin==0 && d_ymax==MAXY) {
d_flag=1;
- clear(); /* clear the screen */
+ ularn_clear(); /* clear the screen */
}
else {
d_flag=0;
@@ -293,7 +294,8 @@
if (know[j][i]==0)
screen[j][i] = objnamelist[0];
else {
- if (k=mitem[j][i].mon) {
+ k = mitem[j][i].mon;
+ if (k) {
if (k==MIMIC) {
if (gtime % 10 == 0)
while((mimicmonst = rnd(MAXMONST))==INVISIBLESTALKER);
@@ -382,7 +384,7 @@
**
** subroutine to display a cell location on the screen
*/
-showcell(x,y)
+void showcell(x,y)
int x,y;
{
int i,j,k,m;
@@ -459,7 +461,7 @@
** these coordinated are not shown
** used in godirect() in monster.c for missile weapons display
*/
-show1cell(x,y)
+void show1cell(x,y)
int x,y;
{
if (c[BLINDCOUNT])
@@ -504,7 +506,7 @@
** subroutine to show where the player is on the screen
** cursor values start from 1 up
*/
-showplayer()
+void showplayer(void)
{
cursor(playerx+1,playery+1);
oldx=playerx;
@@ -524,7 +526,7 @@
char diroffx[] = { 0, 0, 1, 0, -1, 1, -1, 1, -1 };
char diroffy[] = { 0, 1, 0, -1, 0, -1, -1, 1, 1 };
-moveplayer(dir)
+int moveplayer(dir)
int dir; /* from = present room # direction = [1-north]
[2-east] [3-south] [4-west] [5-northeast]
[6-northwest] [7-southeast] [8-southwest]
@@ -589,7 +591,7 @@
*/
static int lincount,count;
-seemagic(arg)
+void seemagic(arg)
int arg;
{
int i,number;
@@ -620,7 +622,7 @@
}
else {
resetscroll();
- clear();
+ ularn_clear();
}
lprcat("The magic spells you have discovered thus far:\n\n");
@@ -647,9 +649,9 @@
lprcat("\nThe magic scrolls you have found to date are:\n\n");
count=0;
for (i=0; i<MAXSCROLL; i++)
- if (scrollname[i][0])
- if (scrollname[i][1]!=' ') {
- lprintf("%-26s",&scrollname[i][1]);
+ if (scrollknown[i])
+ if (scrollname[i][0]!=' ') {
+ lprintf("%-26s",scrollname[i]);
seepage();
}
@@ -662,9 +664,9 @@
lprcat("\nThe magic potions you have found to date are:\n\n");
count=0;
for (i=0; i<MAXPOTION; i++)
- if (potionname[i][0])
- if (potionname[i][1]!=' ') {
- lprintf("%-26s",&potionname[i][1]);
+ if (potionknown[i])
+ if (potionname[i][0]!=' ') {
+ lprintf("%-26s",potionname[i]);
seepage();
}
@@ -677,7 +679,7 @@
/*
* subroutine to paginate the seemagic function
*/
-seepage()
+void seepage(void)
{
if (++count==3) {
lincount++;
@@ -686,7 +688,7 @@
if (lincount>17) {
lincount=0;
more();
- clear();
+ ularn_clear();
}
}
}