|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T z
Length: 2114 (0x842)
Types: TextFile
Names: »zones.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Abermud/zones.c«
/*
* Zone based name generator
*/
#include "kernel.h"
#ifdef RCSID
static char RCS[] =
"$Header: zones.c,v 1.1 89/03/13 09:38:04 rsalz Exp $";
#endif /* RCSID */
findzone(x, str)
char *str;
int x;
{
int a, b;
int c;
x = -x;
if (x <= 0) {
strcpy(str, "TCHAN");
return 0;
}
for (a = 0, b = 0; a < x; b++) {
strcpy(str, zoname[b].z_name);
c = a;
a = zoname[b].z_loc;
}
return x - c;
}
exits()
{
int a;
int b;
char st[64];
int v;
if (isdark()) {
bprintf("It is dark.....\n");
return;
}
bprintf("Obvious exits are\n");
for (a = 0, b = 0; a < 6; a++) {
if (getexit(ploc(mynum), a) >= 0)
continue;
if (plev(mynum) < 10)
bprintf("%s : %s\n", dirns[a],
sdesc(getexit(ploc(mynum), a)));
else {
v = findzone(getexit(ploc(mynum), a), st);
bprintf("%s : %-45s : %s%d\n",
dirns[a], sdesc(getexit(ploc(mynum), a)), st, v);
}
b = 1;
}
if (b == 0)
bprintf("None....\n");
}
roomnum(str, offstr)
char *str;
char *offstr;
{
int a, b, c;
int d;
char w[64];
for (b = 0, a = 0; a < numzon; b = zoname[++a].z_loc) {
strcpy(w, zoname[a].z_name);
if (EQ(lowercase(w), str)) {
c = zoname[a-1].z_loc;
sscanf(offstr, "%ld", &d);
if (EMPTY(offstr))
d = 1;
sprintf(wd_there, "%s", str);
sprintf(wd_th2, "%s", offstr);
lowercase(wd_there);
lowercase(wd_th2);
if (d <= 0)
return 0;
return -(c + d);
}
}
return 0;
}
showname(loc)
int loc;
{
char a[64];
int b;
b = findzone(loc, a);
bprintf("%s%d", a, b);
if (plev(mynum) > 9999)
bprintf("[ %d ]", loc);
sprintf(wd_there, "%s", a);
sprintf(wd_th2, "%d", b);
lowercase(wd_there);
lowercase(wd_th2);
bprintf("\n");
}
loccom()
{
int a;
if (plev(mynum) < 10) {
bprintf("Oh go away, thats for wizards\n");
return;
}
bprintf("\nKnown Location Nodes Are\n\n");
a = 0;
do {
bprintf("%-20s", zoname[a].z_name);
if (a % 4 == 3)
bprintf("\n");
} while (zoname[a++].z_loc != 99999);
bprintf("\n");
}