home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume12
/
mdg
/
part05
/
speak.c
< prev
Wrap
C/C++ Source or Header
|
1991-03-04
|
1KB
|
71 lines
/*
MDG Multiuser Dungeon Game -- speak.c message handler
MDG is Copyright 1990 John C. Gonnerman
This program is subject to the general MDG
copyright statement (see enclosed file, Copyright).
*/
static char *sccsvers = "@(#) speak.c\t(1.1)\tcreated 12/25/90";
#include <string.h>
#include "setup.h"
#include "struct.h"
#include "spells.h"
extern struct player_seg *pseg;
extern struct map_seg *mseg;
speak(indx, text)
int indx;
char *text;
{
int i, all;
char buf[35];
all = 0;
if(text[0] == '\0')
return;
if(text[0] == '!') {
all = 1;
text++;
}
for(i = 0; i < MAX_PLAYERS; i++)
if(all || pseg->p[i].loc.sector == pseg->p[indx].loc.sector) {
sprintf(buf, "%c> ", (char)(indx + '1'));
strcat(buf, text);
dmsg_add(i, buf);
}
}
whisper(indx, to_indx, text)
int indx, to_indx;
char *text;
{
int i;
char buf[35];
if(text[0] == '\0')
return;
if(to_indx < 0 || to_indx >= MAX_PLAYERS)
return;
if(pseg->p[to_indx].loc.sector >= 0
&& pseg->p[to_indx].playernum >= 0) {
sprintf(buf, "%c} ", (char)(indx + '1'));
strcat(buf, text);
dmsg_add(to_indx, buf);
}
}
/* end of file. */