Removed sprintf() usage
Now conpiles properly on linux again
This commit is contained in:
parent
0c288f0594
commit
81c033d7dc
|
@ -1,2 +1,3 @@
|
||||||
nexus
|
nexus
|
||||||
*.o
|
*.o
|
||||||
|
*.swp
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -4,7 +4,7 @@
|
||||||
CFLAGS=-fdiagnostics-color=always -g -Wall -Werror -Wno-format-truncation -Wno-unused-but-set-variable
|
CFLAGS=-fdiagnostics-color=always -g -Wall -Werror -Wno-format-truncation -Wno-unused-but-set-variable
|
||||||
|
|
||||||
nexus: ai.o astar.o attack.o data.o flag.o god.o io.o lf.o map.o move.o nexus.o objects.o save.o shops.o spell.o text.o vault.o ai.h attack.h data.h defs.h flag.h god.h io.h lf.h map.h move.h nexus.h objects.h save.h shops.h spell.h text.h vault.h
|
nexus: ai.o astar.o attack.o data.o flag.o god.o io.o lf.o map.o move.o nexus.o objects.o save.o shops.o spell.o text.o vault.o ai.h attack.h data.h defs.h flag.h god.h io.h lf.h map.h move.h nexus.h objects.h save.h shops.h spell.h text.h vault.h
|
||||||
gcc $(CFLAGS) -o nexus ai.o astar.o attack.o data.o flag.o god.o io.o lf.o map.o move.o nexus.o objects.o save.o shops.o spell.o text.o vault.o -lncurses -lsqlite3
|
gcc $(CFLAGS) -o nexus ai.o astar.o attack.o data.o flag.o god.o io.o lf.o map.o move.o nexus.o objects.o save.o shops.o spell.o text.o vault.o -lm -lncurses -lsqlite3
|
||||||
|
|
||||||
ai.o: ai.c ai.h attack.h astar.h data.h defs.h flag.h god.h io.h lf.h map.h move.h ai.h objects.h save.h shops.h spell.h text.h vault.h
|
ai.o: ai.c ai.h attack.h astar.h data.h defs.h flag.h god.h io.h lf.h map.h move.h ai.h objects.h save.h shops.h spell.h text.h vault.h
|
||||||
gcc $(CFLAGS) -c -o ai.o ai.c
|
gcc $(CFLAGS) -c -o ai.o ai.c
|
||||||
|
|
316
io.c
316
io.c
|
@ -1,3 +1,4 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
@ -555,7 +556,7 @@ void animsky(cell_t *src, char ch, int colour) {
|
||||||
|
|
||||||
char askchar(char *prompt, char *validchars, char *def, int showchars, int maycancel) {
|
char askchar(char *prompt, char *validchars, char *def, int showchars, int maycancel) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
char msghistbuf[BUFLEN];
|
char msghistbuf[BIGBUFLEN];
|
||||||
char *p;
|
char *p;
|
||||||
char temp[2];
|
char temp[2];
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -747,7 +748,7 @@ cell_t *real_askcoords(char *prompt, char *subprompt, int targettype, lifeform_t
|
||||||
while (!finished) {
|
while (!finished) {
|
||||||
int dir;
|
int dir;
|
||||||
char ch;
|
char ch;
|
||||||
char groundbuf[BUFLEN],fullbuf[BUFLEN];
|
char groundbuf[BUFLEN],fullbuf[BIGBUFLEN];
|
||||||
int valid = B_TRUE;
|
int valid = B_TRUE;
|
||||||
|
|
||||||
drawstatus();
|
drawstatus();
|
||||||
|
@ -1159,7 +1160,7 @@ cell_t *real_askcoords(char *prompt, char *subprompt, int targettype, lifeform_t
|
||||||
|
|
||||||
wclear(msgwin);
|
wclear(msgwin);
|
||||||
if (subprompt) {
|
if (subprompt) {
|
||||||
char fullline[BUFLEN];
|
char fullline[BIGBUFLEN];
|
||||||
wmove(msgwin, 0, 0);
|
wmove(msgwin, 0, 0);
|
||||||
sprintf(fullline, "%s%s", subprompt, fullbuf);
|
sprintf(fullline, "%s%s", subprompt, fullbuf);
|
||||||
textwithcol(msgwin, fullline);
|
textwithcol(msgwin, fullline);
|
||||||
|
@ -2664,7 +2665,7 @@ int announceflagloss(lifeform_t *lf, flag_t *f) {
|
||||||
msg("^%cYour %s vanishes!", getlfcol(lf, CC_BAD), f->text);
|
msg("^%cYour %s vanishes!", getlfcol(lf, CC_BAD), f->text);
|
||||||
donesomething = B_TRUE;
|
donesomething = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
char text[BUFLEN];
|
char text[BIGBUFLEN];
|
||||||
sprintf(text,"%s%s %s vanishes!", lfname, getpossessive(lfname), f->text);
|
sprintf(text,"%s%s %s vanishes!", lfname, getpossessive(lfname), f->text);
|
||||||
capitalise(text);
|
capitalise(text);
|
||||||
msg("^%c%s", getlfcol(lf, CC_BAD), text);
|
msg("^%c%s", getlfcol(lf, CC_BAD), text);
|
||||||
|
@ -3495,7 +3496,7 @@ object_t *doaskobject(obpile_t *op, char *prompt, char *noobtext, int *count, in
|
||||||
int defcount = 0;
|
int defcount = 0;
|
||||||
object_t *mylist[MAXPILEOBS+1];
|
object_t *mylist[MAXPILEOBS+1];
|
||||||
char myletters[MAXPILEOBS+1];
|
char myletters[MAXPILEOBS+1];
|
||||||
char msghistbuf[BUFLEN],numstring[BUFLEN],fullprompt[BUFLEN];
|
char msghistbuf[BIGBUFLEN],numstring[BUFLEN],fullprompt[BUFLEN];
|
||||||
char obname[BUFLEN];
|
char obname[BUFLEN];
|
||||||
int firstob = 0;
|
int firstob = 0;
|
||||||
int nextpage = -1;
|
int nextpage = -1;
|
||||||
|
@ -3785,7 +3786,7 @@ int askobjectmulti(obpile_t *op, char *prompt, condset_t *cs, int includenothing
|
||||||
int selected[MAXPILEOBS+1];
|
int selected[MAXPILEOBS+1];
|
||||||
int selcount[MAXPILEOBS+1];
|
int selcount[MAXPILEOBS+1];
|
||||||
char myletters[MAXPILEOBS+1];
|
char myletters[MAXPILEOBS+1];
|
||||||
char msghistbuf[BUFLEN],numstring[BUFLEN];
|
char msghistbuf[BIGBUFLEN],numstring[BUFLEN];
|
||||||
char pbuf[BUFLEN];
|
char pbuf[BUFLEN];
|
||||||
char altprompt[BUFLEN];
|
char altprompt[BUFLEN];
|
||||||
int firstob = 0;
|
int firstob = 0;
|
||||||
|
@ -4607,9 +4608,9 @@ void docommslf(lifeform_t *lf, char ch, lifeform_t *lf2, cell_t *targc) {
|
||||||
killflagsofid(lf->flags, F_TARGETLF);
|
killflagsofid(lf->flags, F_TARGETLF);
|
||||||
aiattack(lf, lf2, DEF_AIFOLLOWTIME);
|
aiattack(lf, lf2, DEF_AIFOLLOWTIME);
|
||||||
} else {
|
} else {
|
||||||
char saybuf[BUFLEN];
|
char saybuf[BIGBUFLEN];
|
||||||
getlfnamea(lf2, lfname2);
|
getlfnamea(lf2, lfname2);
|
||||||
sprintf(saybuf, "I can't see %s!", lfname2);
|
snprintf(saybuf, BIGBUFLEN, "I can't see %s!", lfname2);
|
||||||
say(lf, saybuf, SV_TALK);
|
say(lf, saybuf, SV_TALK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4648,7 +4649,7 @@ void docommslf(lifeform_t *lf, char ch, lifeform_t *lf2, cell_t *targc) {
|
||||||
char why[BUFLEN];
|
char why[BUFLEN];
|
||||||
getobname(oo, ooname, oo->amt);
|
getobname(oo, ooname, oo->amt);
|
||||||
if (getoboffermod(oo,lf, why) > 0) {
|
if (getoboffermod(oo,lf, why) > 0) {
|
||||||
sprintf(buf, "%s (%s)", ooname, why);
|
snprintf(buf, BUFLEN, "%s (%s)", ooname, why);
|
||||||
addchoice(&prompt, oo->letter, buf, NULL, oo, NULL);
|
addchoice(&prompt, oo->letter, buf, NULL, oo, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5385,30 +5386,30 @@ void docomms_areadangers(char *who, flagpile_t *fp, lifeform_t *lf) {
|
||||||
if (showit) {
|
if (showit) {
|
||||||
char lfname[BUFLEN];
|
char lfname[BUFLEN];
|
||||||
char *p;
|
char *p;
|
||||||
char text[BUFLEN];
|
char text[BIGBUFLEN];
|
||||||
real_getlfnamea(c->lf, lfname, NULL, B_SHOWALL, B_REALRACE);
|
real_getlfnamea(c->lf, lfname, NULL, B_SHOWALL, B_REALRACE);
|
||||||
if (lfhasflag(c->lf, F_NAME)) {
|
if (lfhasflag(c->lf, F_NAME)) {
|
||||||
switch(rnd(1,2)) {
|
switch(rnd(1,2)) {
|
||||||
case 1:
|
case 1:
|
||||||
sprintf(text, "\"%s is living nearby...\"", lfname);
|
snprintf(text, BIGBUFLEN, "\"%s is living nearby...\"", lfname);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(text, "\"%s dwells nearby...\"", lfname);
|
snprintf(text, BIGBUFLEN, "\"%s dwells nearby...\"", lfname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch(rnd(1,4)) {
|
switch(rnd(1,4)) {
|
||||||
case 1:
|
case 1:
|
||||||
sprintf(text, "\"There is %s living nearby...\"", lfname);
|
snprintf(text, BIGBUFLEN, "\"There is %s living nearby...\"", lfname);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(text, "\"%s dwells nearby...\"", lfname);
|
snprintf(text, BIGBUFLEN, "\"%s dwells nearby...\"", lfname);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sprintf(text, "\"%s has made its lair here...\"", lfname);
|
snprintf(text, BIGBUFLEN, "\"%s has made its lair here...\"", lfname);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
sprintf(text, "\"I spotted %s nearby...\"", lfname);
|
snprintf(text, BIGBUFLEN, "\"I spotted %s nearby...\"", lfname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5908,7 +5909,7 @@ void lfstatheading(char *headstr, int offset) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *makedesc_god(lifeform_t *god, char *retbuf) {
|
char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
char thisline[BUFLEN];
|
char thisline[BIGBUFLEN];
|
||||||
char godname[BUFLEN];
|
char godname[BUFLEN];
|
||||||
flag_t *f, *retflag[MAXCANDIDATES];
|
flag_t *f, *retflag[MAXCANDIDATES];
|
||||||
int nretflags,i;
|
int nretflags,i;
|
||||||
|
@ -5919,7 +5920,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
strcpy(retbuf, "");
|
strcpy(retbuf, "");
|
||||||
|
|
||||||
// title
|
// title
|
||||||
sprintf(thisline, "%s likes ", godname);
|
snprintf(thisline, BIGBUFLEN, "%s likes ", godname);
|
||||||
getflags(god->flags, retflag, &nretflags, F_GODLIKES, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_GODLIKES, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
f = retflag[i];
|
f = retflag[i];
|
||||||
|
@ -5936,7 +5937,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
strcat(thisline, ".\n\n");
|
strcat(thisline, ".\n\n");
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
|
|
||||||
sprintf(thisline, "%s dislikes ", godname);
|
snprintf(thisline, BIGBUFLEN, "%s dislikes ", godname);
|
||||||
getflags(god->flags, retflag, &nretflags, F_GODDISLIKES, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_GODDISLIKES, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
f = retflag[i];
|
f = retflag[i];
|
||||||
|
@ -5954,7 +5955,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
|
|
||||||
if (hasflag(god->flags, F_GODBATTLE)) {
|
if (hasflag(god->flags, F_GODBATTLE)) {
|
||||||
sprintf(thisline, "During battle, %s will respond to prayers by ", godname);
|
snprintf(thisline, BIGBUFLEN, "During battle, %s will respond to prayers by ", godname);
|
||||||
getflags(god->flags, retflag, &nretflags, F_GODBATTLE, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_GODBATTLE, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
f = retflag[i];
|
f = retflag[i];
|
||||||
|
@ -5969,13 +5970,13 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(thisline, "During battle, %s will not respond to prayers", godname);
|
snprintf(thisline, BIGBUFLEN, "During battle, %s will not respond to prayers", godname);
|
||||||
}
|
}
|
||||||
strcat(thisline, ".\n\n");
|
strcat(thisline, ".\n\n");
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
|
|
||||||
if (hasflag(god->flags, F_GODNOBATTLE)) {
|
if (hasflag(god->flags, F_GODNOBATTLE)) {
|
||||||
sprintf(thisline, "Outside of battle, %s will respond to prayers by ", godname);
|
snprintf(thisline, BIGBUFLEN, "Outside of battle, %s will respond to prayers by ", godname);
|
||||||
getflags(god->flags, retflag, &nretflags, F_GODNOBATTLE, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_GODNOBATTLE, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
f = retflag[i];
|
f = retflag[i];
|
||||||
|
@ -5990,7 +5991,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(thisline, "Outside of battle, %s will not respond to prayers", godname);
|
snprintf(thisline, BIGBUFLEN, "Outside of battle, %s will not respond to prayers", godname);
|
||||||
}
|
}
|
||||||
strcat(thisline, ".\n\n");
|
strcat(thisline, ".\n\n");
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
|
@ -5999,7 +6000,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
// note: we manually handle SACRIFICEOBWITHFLAG
|
// note: we manually handle SACRIFICEOBWITHFLAG
|
||||||
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_SACRIFICEOBCLASS, F_SACRIFICEOBBLESSED, F_SACRIFICEOBWITHFLAG,F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_SACRIFICEOBCLASS, F_SACRIFICEOBBLESSED, F_SACRIFICEOBWITHFLAG,F_NONE);
|
||||||
if (nretflags == 0) {
|
if (nretflags == 0) {
|
||||||
sprintf(thisline, "%s does not accept sacrifices.\n", godname);
|
snprintf(thisline, BIGBUFLEN, "%s does not accept sacrifices.\n", godname);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
|
@ -6013,13 +6014,13 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
} else {
|
} else {
|
||||||
sprintf(name, "all %s", oc->name);
|
sprintf(name, "all %s", oc->name);
|
||||||
}
|
}
|
||||||
sprintf(thisline, "%s accepts the sacrifice of %s.\n",godname, name);
|
snprintf(thisline, BIGBUFLEN, "%s accepts the sacrifice of %s.\n",godname, name);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOB, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
sprintf(thisline, "%s accepts the sacrifice of:\n", godname);
|
snprintf(thisline, BIGBUFLEN, "%s accepts the sacrifice of:\n", godname);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6029,7 +6030,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
ot = findot(retflag[i]->val[0]);
|
ot = findot(retflag[i]->val[0]);
|
||||||
text = strdup(ot->name);
|
text = strdup(ot->name);
|
||||||
makeplural(&text);
|
makeplural(&text);
|
||||||
sprintf(thisline, "- %s", text);
|
snprintf(thisline, BIGBUFLEN, "- %s", text);
|
||||||
free(text);
|
free(text);
|
||||||
if ((god->race->id == R_GODPURITY) && (retflag[i]->val[0] == OT_CORPSE)){
|
if ((god->race->id == R_GODPURITY) && (retflag[i]->val[0] == OT_CORPSE)){
|
||||||
strcat(thisline, " of evil creatures");
|
strcat(thisline, " of evil creatures");
|
||||||
|
@ -6039,25 +6040,25 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
} else {
|
} else {
|
||||||
raceclass_t *rc;
|
raceclass_t *rc;
|
||||||
rc = findraceclass(retflag[i]->val[1]);
|
rc = findraceclass(retflag[i]->val[1]);
|
||||||
sprintf(thisline, "- %s corpses\n", rc->name);
|
snprintf(thisline, BIGBUFLEN, "- %s corpses\n", rc->name);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOBBLESSED, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOBBLESSED, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
sprintf(thisline, "%s accepts the sacrifice of:\n", godname);
|
snprintf(thisline, BIGBUFLEN, "%s accepts the sacrifice of:\n", godname);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
switch (retflag[i]->val[0]) {
|
switch (retflag[i]->val[0]) {
|
||||||
case B_BLESSED:
|
case B_BLESSED:
|
||||||
sprintf(thisline, "- known blessed objects\n");
|
snprintf(thisline, BIGBUFLEN, "- known blessed objects\n");
|
||||||
break;
|
break;
|
||||||
case B_CURSED:
|
case B_CURSED:
|
||||||
sprintf(thisline, "- known cursed objects\n");
|
snprintf(thisline, BIGBUFLEN, "- known cursed objects\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sprintf(thisline, "- known uncursed objects\n");
|
snprintf(thisline, BIGBUFLEN, "- known uncursed objects\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
|
@ -6065,19 +6066,19 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOBWITHFLAG, F_NONE);
|
getflags(god->flags, retflag, &nretflags, F_SACRIFICEOBWITHFLAG, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
sprintf(thisline, "%s accepts the sacrifice of:\n", godname);
|
snprintf(thisline, BIGBUFLEN, "%s accepts the sacrifice of:\n", godname);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
strcpy(thisline, "");
|
strcpy(thisline, "");
|
||||||
switch (retflag[i]->val[0]) {
|
switch (retflag[i]->val[0]) {
|
||||||
case F_BATTLESPOILS:
|
case F_BATTLESPOILS:
|
||||||
sprintf(thisline, "- untouched battle spoils\n");
|
snprintf(thisline, BIGBUFLEN, "- untouched battle spoils\n");
|
||||||
break;
|
break;
|
||||||
case F_FLAMMABLE:
|
case F_FLAMMABLE:
|
||||||
sprintf(thisline, "- flammable objects\n");
|
snprintf(thisline, BIGBUFLEN, "- flammable objects\n");
|
||||||
break;
|
break;
|
||||||
case F_GEM:
|
case F_GEM:
|
||||||
sprintf(thisline, "- gems\n");
|
snprintf(thisline, BIGBUFLEN, "- gems\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -6087,7 +6088,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasflag(god->flags, F_SACRIFICEOBMAGIC)) {
|
if (hasflag(god->flags, F_SACRIFICEOBMAGIC)) {
|
||||||
sprintf(thisline, "%s accepts the sacrifice of all magical objects.\n",godname);
|
snprintf(thisline, BIGBUFLEN, "%s accepts the sacrifice of all magical objects.\n",godname);
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6096,7 +6097,7 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *makedesc_job(job_t *j, char *retbuf) {
|
char *makedesc_job(job_t *j, char *retbuf) {
|
||||||
char thisline[BUFLEN];
|
char thisline[BIGBUFLEN];
|
||||||
skill_t *sk;
|
skill_t *sk;
|
||||||
enum ATTRIB a;
|
enum ATTRIB a;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -6124,19 +6125,19 @@ char *makedesc_job(job_t *j, char *retbuf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count == 3) {
|
if (count == 3) {
|
||||||
sprintf(thisline, "Alignment:Any");
|
snprintf(thisline, BIGBUFLEN, "Alignment:Any");
|
||||||
} else {
|
} else {
|
||||||
sprintf(thisline, "Alignment:%s", choices);
|
snprintf(thisline, BIGBUFLEN, "Alignment:%s", choices);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char *p;
|
char *p;
|
||||||
p = strdup(getalignmentname(f->val[0]));
|
p = strdup(getalignmentname(f->val[0]));
|
||||||
capitalise(p);
|
capitalise(p);
|
||||||
sprintf(thisline, "Alignment:%s",p);
|
snprintf(thisline, BIGBUFLEN, "Alignment:%s",p);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(thisline, "Alignment:Any");
|
snprintf(thisline, BIGBUFLEN, "Alignment:Any");
|
||||||
}
|
}
|
||||||
strcat(thisline, " ");
|
strcat(thisline, " ");
|
||||||
|
|
||||||
|
@ -6145,13 +6146,13 @@ char *makedesc_job(job_t *j, char *retbuf) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
f = hasflagval(j->flags, F_JOBATTRMOD, a, NA, NA, NULL);
|
f = hasflagval(j->flags, F_JOBATTRMOD, a, NA, NA, NULL);
|
||||||
if (f && (f->val[1] != 0)) {
|
if (f && (f->val[1] != 0)) {
|
||||||
char buf2[BUFLEN];
|
char buf2[BIGBUFLEN];
|
||||||
if (f->val[1] > 0) {
|
if (f->val[1] > 0) {
|
||||||
sprintf(buf, "^%d+%d^n", C_GREEN, f->val[1]);
|
sprintf(buf, "^%d+%d^n", C_GREEN, f->val[1]);
|
||||||
} else if (f->val[1] < 0) {
|
} else if (f->val[1] < 0) {
|
||||||
sprintf(buf, "^%d%d^n", C_RED, f->val[1]);
|
sprintf(buf, "^%d%d^n", C_RED, f->val[1]);
|
||||||
}
|
}
|
||||||
sprintf(buf2, "%s:%s ", getattrabbrev(a), buf);
|
snprintf(buf2, BIGBUFLEN, "%s:%s ", getattrabbrev(a), buf);
|
||||||
strcat(thisline, buf2);
|
strcat(thisline, buf2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6419,7 +6420,7 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
char sizebuf[BUFLEN];
|
char sizebuf[BUFLEN];
|
||||||
sprintf(sizebuf, "%s", getsizetext(twohandf->val[0] + 1));
|
sprintf(sizebuf, "%s", getsizetext(twohandf->val[0] + 1));
|
||||||
capitalise(sizebuf);
|
capitalise(sizebuf);
|
||||||
sprintf(buf2, "@%s creatures can weild it in one hand.\n", sizebuf);
|
snprintf(buf2, BUFLEN, "@%s creatures can weild it in one hand.\n", sizebuf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6527,11 +6528,11 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
char sizebuf[BUFLEN];
|
char sizebuf[BUFLEN];
|
||||||
sprintf(sizebuf, "%s", getsizetext(twohandf->val[0] + 1));
|
sprintf(sizebuf, "%s", getsizetext(twohandf->val[0] + 1));
|
||||||
capitalise(sizebuf);
|
capitalise(sizebuf);
|
||||||
sprintf(buf2, "@%s creatures can weild it in one hand.\n", sizebuf);
|
snprintf(buf2, BUFLEN, "@%s creatures can weild it in one hand.\n", sizebuf);
|
||||||
strcat(buf, buf2 );
|
strcat(buf, buf2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buf2, "@It has a base Damage Rating of %d",dr);
|
snprintf(buf2, BUFLEN, "@It has a base Damage Rating of %d",dr);
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
|
|
||||||
strncat(retbuf, buf, HUGEBUFLEN);
|
strncat(retbuf, buf, HUGEBUFLEN);
|
||||||
|
@ -7226,11 +7227,11 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
amt = adjustarmourpenalty(player, f->val[1]);
|
amt = adjustarmourpenalty(player, f->val[1]);
|
||||||
amt2 = adjustarmourpenalty(player, f->val[2]);
|
amt2 = adjustarmourpenalty(player, f->val[2]);
|
||||||
if (amt > 0) {
|
if (amt > 0) {
|
||||||
sprintf(buf2, "^B%s lowers your accuracy by %d. (Armour skill penalty)^n\n", buf, getaccuracymodnum(amt));
|
snprintf(buf2, BUFLEN, "^B%s lowers your accuracy by %d. (Armour skill penalty)^n\n", buf, getaccuracymodnum(amt));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
if (amt2 > 0) {
|
if (amt2 > 0) {
|
||||||
sprintf(buf2, "^B%s lowers your evasion by %d. (Armour skill penalty)^n\n", buf, amt2);
|
snprintf(buf2, BUFLEN, "^B%s lowers your evasion by %d. (Armour skill penalty)^n\n", buf, amt2);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -7238,169 +7239,169 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
amt = adjustshieldpenalty(player, f->val[1]);
|
amt = adjustshieldpenalty(player, f->val[1]);
|
||||||
amt2 = adjustshieldpenalty(player, f->val[2]);
|
amt2 = adjustshieldpenalty(player, f->val[2]);
|
||||||
if (amt > 0) {
|
if (amt > 0) {
|
||||||
sprintf(buf2, "^B%s lowers your attack accuracy by %d. (Shields skill too low)^n\n", buf, getaccuracymodnum(amt));
|
snprintf(buf2, BUFLEN, "^B%s lowers your attack accuracy by %d. (Shields skill too low)^n\n", buf, getaccuracymodnum(amt));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
if (amt2 > 0) {
|
if (amt2 > 0) {
|
||||||
sprintf(buf2, "^B%s lowers your evasion by %d. (Shields skill penalty)^n\n", buf, amt2);
|
snprintf(buf2, BUFLEN, "^B%s lowers your evasion by %d. (Shields skill penalty)^n\n", buf, amt2);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_ANONYMOUS:
|
case F_ANONYMOUS:
|
||||||
sprintf(buf2, "%s obscures your identity.\n", buf);
|
snprintf(buf2, BUFLEN, "%s obscures your identity.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_ARBOOST:
|
case F_ARBOOST:
|
||||||
sprintf(buf2, "%s %s your Armour Rating.\n", buf, (f->val[0] >= 0) ? "increases" : "decreases");
|
snprintf(buf2, BUFLEN, "%s %s your Armour Rating.\n", buf, (f->val[0] >= 0) ? "increases" : "decreases");
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_ATTRMOD:
|
case F_ATTRMOD:
|
||||||
sprintf(buf2, "%s %s your %s.\n", buf, (f->val[2] > 0) ? "increases" : "decreases", getattrname(f->val[1]));
|
snprintf(buf2, BUFLEN, "%s %s your %s.\n", buf, (f->val[2] > 0) ? "increases" : "decreases", getattrname(f->val[1]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_ATTRSET:
|
case F_ATTRSET:
|
||||||
sprintf(buf2, "%s modifies your %s.\n", buf, getattrname(f->val[1]));
|
snprintf(buf2, BUFLEN, "%s modifies your %s.\n", buf, getattrname(f->val[1]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_AWARENESS:
|
case F_AWARENESS:
|
||||||
sprintf(buf2, "%s grants you heightened awareness.\n", buf);
|
snprintf(buf2, BUFLEN, "%s grants you heightened awareness.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_BLIND:
|
case F_BLIND:
|
||||||
sprintf(buf2, "%s prevents you from seeing anything.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents you from seeing anything.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_BREATHWATER:
|
case F_BREATHWATER:
|
||||||
sprintf(buf2, "%s allows you to breath normally while underwater.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to breath normally while underwater.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_CONTROL:
|
case F_CONTROL:
|
||||||
sprintf(buf2, "%s lets you control teleportation and polymorphic effects.\n", buf);
|
snprintf(buf2, BUFLEN, "%s lets you control teleportation and polymorphic effects.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_CONSUMESOULS:
|
case F_CONSUMESOULS:
|
||||||
sprintf(buf2, "%s allows you to consume the souls of nearby dead.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to consume the souls of nearby dead.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DEAF:
|
case F_DEAF:
|
||||||
sprintf(buf2, "%s prevents you from hearing anything.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents you from hearing anything.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DETECTLIFE:
|
case F_DETECTLIFE:
|
||||||
sprintf(buf2, "%s lets you detect nearby lifeforms.\n", buf);
|
snprintf(buf2, BUFLEN, "%s lets you detect nearby lifeforms.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DETECTOBS:
|
case F_DETECTOBS:
|
||||||
sprintf(buf2, "%s lets you detect nearby objects.\n", buf);
|
snprintf(buf2, BUFLEN, "%s lets you detect nearby objects.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DETECTMAGIC:
|
case F_DETECTMAGIC:
|
||||||
sprintf(buf2, "%s will detect magical enchantments on objects.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will detect magical enchantments on objects.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DETECTMETAL:
|
case F_DETECTMETAL:
|
||||||
sprintf(buf2, "%s will detect nearby metal.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will detect nearby metal.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DODGES:
|
case F_DODGES:
|
||||||
sprintf(buf2, "%s lets you use remaining stamina to dodge fatal attacks.\n", buf);
|
snprintf(buf2, BUFLEN, "%s lets you use remaining stamina to dodge fatal attacks.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_ENHANCESEARCH:
|
case F_ENHANCESEARCH:
|
||||||
sprintf(buf2, "%s enhances your searching ability.\n", buf);
|
snprintf(buf2, BUFLEN, "%s enhances your searching ability.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_ENHANCESMELL:
|
case F_ENHANCESMELL:
|
||||||
sprintf(buf2, "%s enhances your sense of smell.\n", buf);
|
snprintf(buf2, BUFLEN, "%s enhances your sense of smell.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DISEASEIMMUNE:
|
case F_DISEASEIMMUNE:
|
||||||
sprintf(buf2, "%s makes you immune to disease.\n", buf);
|
snprintf(buf2, BUFLEN, "%s makes you immune to disease.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DTIMMUNE:
|
case F_DTIMMUNE:
|
||||||
sprintf(buf2, "%s makes you immune to %s.\n", buf, getdamnamenoun(f->val[1]));
|
snprintf(buf2, BUFLEN, "%s makes you immune to %s.\n", buf, getdamnamenoun(f->val[1]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DTRESIST:
|
case F_DTRESIST:
|
||||||
sprintf(buf2, "%s makes you resistant to %s.\n", buf, getdamnamenoun(f->val[1]));
|
snprintf(buf2, BUFLEN, "%s makes you resistant to %s.\n", buf, getdamnamenoun(f->val[1]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DTVULN:
|
case F_DTVULN:
|
||||||
sprintf(buf2, "%s renders you vulnerable to %s.\n", buf, getdamnamenoun(f->val[1]));
|
snprintf(buf2, BUFLEN, "%s renders you vulnerable to %s.\n", buf, getdamnamenoun(f->val[1]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_DRUNK:
|
case F_DRUNK:
|
||||||
sprintf(buf2, "%s makes you tipsy.\n", buf);
|
snprintf(buf2, BUFLEN, "%s makes you tipsy.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_EXTRAINFO:
|
case F_EXTRAINFO:
|
||||||
sprintf(buf2, "%s provides enhanced knowledge to you.\n", buf);
|
snprintf(buf2, BUFLEN, "%s provides enhanced knowledge to you.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_EXTRADAM:
|
case F_EXTRADAM:
|
||||||
sprintf(buf2, "%s will cause you to deal additional %s damage on each attack.\n", buf,
|
snprintf(buf2, BUFLEN, "%s will cause you to deal additional %s damage on each attack.\n", buf,
|
||||||
getdamname(f->val[0]));
|
getdamname(f->val[0]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_WOUNDING:
|
case F_WOUNDING:
|
||||||
sprintf(buf2, "%s will grant +%d extra damage on all attacks.\n", buf, f->val[0]);
|
snprintf(buf2, BUFLEN, "%s will grant +%d extra damage on all attacks.\n", buf, f->val[0]);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_EXTRALUCK:
|
case F_EXTRALUCK:
|
||||||
sprintf(buf2, "%s will give you a bonus to all skill checks.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will give you a bonus to all skill checks.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_EXTRAMP:
|
case F_EXTRAMP:
|
||||||
sprintf(buf2, "%s will increase your mana pool by %d%%.\n", buf, f->val[0]);
|
snprintf(buf2, BUFLEN, "%s will increase your mana pool by %d%%.\n", buf, f->val[0]);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FEARLESS:
|
case F_FEARLESS:
|
||||||
sprintf(buf2, "%s will reder you fearless.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will reder you fearless.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FASTACT:
|
case F_FASTACT:
|
||||||
sprintf(buf2, "%s will speed up your actions.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will speed up your actions.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FASTMETAB:
|
case F_FASTMETAB:
|
||||||
sprintf(buf2, "%s will increase your metabolic rate.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will increase your metabolic rate.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FASTMOVE:
|
case F_FASTMOVE:
|
||||||
sprintf(buf2, "%s will speed up your movement.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will speed up your movement.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FLYING:
|
case F_FLYING:
|
||||||
sprintf(buf2, "%s will allow you to fly.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will allow you to fly.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FREEZINGTOUCH:
|
case F_FREEZINGTOUCH:
|
||||||
sprintf(buf2, "%s will cause objects you touch to turn to ice.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will cause objects you touch to turn to ice.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_FROZEN:
|
case F_FROZEN:
|
||||||
sprintf(buf2, "%s turns you to ice.\n", buf);
|
snprintf(buf2, BUFLEN, "%s turns you to ice.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_GRAVBOOSTED:
|
case F_GRAVBOOSTED:
|
||||||
sprintf(buf2, "%s increases gravity around you.\n", buf);
|
snprintf(buf2, BUFLEN, "%s increases gravity around you.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_GRAVLESSENED:
|
case F_GRAVLESSENED:
|
||||||
sprintf(buf2, "%s decreases gravity around you.\n", buf);
|
snprintf(buf2, BUFLEN, "%s decreases gravity around you.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_HOTFEET:
|
case F_HOTFEET:
|
||||||
sprintf(buf2, "%s causes your feet to constantly burn.\n", buf);
|
snprintf(buf2, BUFLEN, "%s causes your feet to constantly burn.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_INVISIBLE:
|
case F_INVISIBLE:
|
||||||
sprintf(buf2, "%s renders you invisible to normal sight.\n", buf);
|
snprintf(buf2, BUFLEN, "%s renders you invisible to normal sight.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_INVULNERABLE:
|
case F_INVULNERABLE:
|
||||||
sprintf(buf2, "%s protects you from all physical harm.\n", buf);
|
snprintf(buf2, BUFLEN, "%s protects you from all physical harm.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_CANWILL:
|
case F_CANWILL:
|
||||||
|
@ -7409,14 +7410,14 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
char sname[BUFLEN];
|
char sname[BUFLEN];
|
||||||
strcpy(sname, ot->name);
|
strcpy(sname, ot->name);
|
||||||
capitalise(sname);
|
capitalise(sname);
|
||||||
sprintf(buf2, "%s allows you to %s '%s' at will.\n", buf,
|
snprintf(buf2, BUFLEN, "%s allows you to %s '%s' at will.\n", buf,
|
||||||
(ot->obclass->id == OC_SPELL) ? "cast" : "use the ability",
|
(ot->obclass->id == OC_SPELL) ? "cast" : "use the ability",
|
||||||
sname);
|
sname);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_CAFFEINATED:
|
case F_CAFFEINATED:
|
||||||
sprintf(buf2, "%s acts as a stimulant.\n", buf);
|
snprintf(buf2, BUFLEN, "%s acts as a stimulant.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_CANCAST:
|
case F_CANCAST:
|
||||||
|
@ -7425,106 +7426,106 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
char sname[BUFLEN];
|
char sname[BUFLEN];
|
||||||
strcpy(sname, ot->name);
|
strcpy(sname, ot->name);
|
||||||
capitalise(sname);
|
capitalise(sname);
|
||||||
sprintf(buf2, "%s allows you to cast '%s'.\n", buf, sname);
|
snprintf(buf2, BUFLEN, "%s allows you to cast '%s'.\n", buf, sname);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_DAYBOOST:
|
case F_DAYBOOST:
|
||||||
if (f->val[0] > 0) {
|
if (f->val[0] > 0) {
|
||||||
sprintf(buf2, "%s grants a +%d accuracy bonus during daytime.\n", buf,getaccuracymodnum(f->val[0]));
|
snprintf(buf2, BUFLEN, "%s grants a +%d accuracy bonus during daytime.\n", buf,getaccuracymodnum(f->val[0]));
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf2, "%s imposes a -%d accuracy penalty during daytime.\n", buf, getaccuracymodnum(abs(f->val[0])));
|
snprintf(buf2, BUFLEN, "%s imposes a -%d accuracy penalty during daytime.\n", buf, getaccuracymodnum(abs(f->val[0])));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_DETECTAURAS:
|
case F_DETECTAURAS:
|
||||||
sprintf(buf2, "%s allows you to detect blessings or curses.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to detect blessings or curses.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_HOLYAURA:
|
case F_HOLYAURA:
|
||||||
sprintf(buf2, "%s surrounds you with a holy aura.\n", buf);
|
snprintf(buf2, BUFLEN, "%s surrounds you with a holy aura.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_LEARNBOOST:
|
case F_LEARNBOOST:
|
||||||
sprintf(buf2, "%s grants a bonus to earned experience points.\n", buf);
|
snprintf(buf2, BUFLEN, "%s grants a bonus to earned experience points.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_LEVITATING:
|
case F_LEVITATING:
|
||||||
sprintf(buf2, "%s causes you to levitate.\n", buf);
|
snprintf(buf2, BUFLEN, "%s causes you to levitate.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_MAGICBOOST:
|
case F_MAGICBOOST:
|
||||||
sprintf(buf2, "%s boosts the power of your spells by %d.\n", buf, f->val[1]);
|
snprintf(buf2, BUFLEN, "%s boosts the power of your spells by %d.\n", buf, f->val[1]);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_MINDSHIELD:
|
case F_MINDSHIELD:
|
||||||
sprintf(buf2, "%s protects you from psionic attacks.\n", buf);
|
snprintf(buf2, BUFLEN, "%s protects you from psionic attacks.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_MISCASTCHANCE:
|
case F_MISCASTCHANCE:
|
||||||
sprintf(buf2, "%s causes your spells to become unreliable.\n", buf);
|
snprintf(buf2, BUFLEN, "%s causes your spells to become unreliable.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_MEDITATES:
|
case F_MEDITATES:
|
||||||
sprintf(buf2, "%s allows you to retain awareness while resting.", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to retain awareness while resting.", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_MAGSHIELD:
|
case F_MAGSHIELD:
|
||||||
sprintf(buf2, "%s surrounds you with a magnetic shield.\n", buf);
|
snprintf(buf2, BUFLEN, "%s surrounds you with a magnetic shield.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_MUTABLE:
|
case F_MUTABLE:
|
||||||
sprintf(buf2, "%s allows your body to mutate.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows your body to mutate.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_NAUSEATED:
|
case F_NAUSEATED:
|
||||||
sprintf(buf2, "%s causes you to feel nauseated.\n", buf);
|
snprintf(buf2, BUFLEN, "%s causes you to feel nauseated.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_NIGHTBOOST:
|
case F_NIGHTBOOST:
|
||||||
if (f->val[0] > 0) {
|
if (f->val[0] > 0) {
|
||||||
sprintf(buf2, "%s grants a +%d accuracy bonus at night.\n", buf,getaccuracymodnum(f->val[0]));
|
snprintf(buf2, BUFLEN, "%s grants a +%d accuracy bonus at night.\n", buf,getaccuracymodnum(f->val[0]));
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf2, "%s imposes a -%d accuracy penalty at night.\n", buf, getaccuracymodnum(abs(f->val[0])));
|
snprintf(buf2, BUFLEN, "%s imposes a -%d accuracy penalty at night.\n", buf, getaccuracymodnum(abs(f->val[0])));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_NONCORPOREAL:
|
case F_NONCORPOREAL:
|
||||||
sprintf(buf2, "%s makes you non-corporeal.\n", buf);
|
snprintf(buf2, BUFLEN, "%s makes you non-corporeal.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_PAIN:
|
case F_PAIN:
|
||||||
sprintf(buf2, "%s causes you intense pain.\n", buf);
|
snprintf(buf2, BUFLEN, "%s causes you intense pain.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_PARALYZED:
|
case F_PARALYZED:
|
||||||
sprintf(buf2, "%s paralyzes you.\n", buf);
|
snprintf(buf2, BUFLEN, "%s paralyzes you.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_PHOTOMEM:
|
case F_PHOTOMEM:
|
||||||
sprintf(buf2, "%s prevents you from forgetting your surroundings.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents you from forgetting your surroundings.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_POLYIMMUNE:
|
case F_POLYIMMUNE:
|
||||||
sprintf(buf2, "%s prevents you from being polymorphed.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents you from being polymorphed.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SIXTHSENSE:
|
case F_SIXTHSENSE:
|
||||||
sprintf(buf2, "%s warns you about nearby enemies.\n", buf);
|
snprintf(buf2, BUFLEN, "%s warns you about nearby enemies.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_STABILITY:
|
case F_STABILITY:
|
||||||
sprintf(buf2, "%s prevents you from slipping over.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents you from slipping over.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_STAMBOOST:
|
case F_STAMBOOST:
|
||||||
sprintf(buf2, "%s boosts your stamina by %d.\n", buf, f->val[1]);
|
snprintf(buf2, BUFLEN, "%s boosts your stamina by %d.\n", buf, f->val[1]);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_STENCH:
|
case F_STENCH:
|
||||||
sprintf(buf2, "%s makes you smell bad.\n", buf);
|
snprintf(buf2, BUFLEN, "%s makes you smell bad.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_PRODUCESLIGHT:
|
case F_PRODUCESLIGHT:
|
||||||
sprintf(buf2, "%s produces light out to %d metre%s.\n", buf,
|
snprintf(buf2, BUFLEN, "%s produces light out to %d metre%s.\n", buf,
|
||||||
f->val[1], (f->val[1] == 1) ? "" : "s");
|
f->val[1], (f->val[1] == 1) ? "" : "s");
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
|
@ -7532,21 +7533,21 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
loctext = strdup(f->text);
|
loctext = strdup(f->text);
|
||||||
p = readuntil(dicetext, loctext, '^');
|
p = readuntil(dicetext, loctext, '^');
|
||||||
readuntil(retalname, p, '^');
|
readuntil(retalname, p, '^');
|
||||||
sprintf(buf2, "%s protects you with %s.\n", buf, retalname);
|
snprintf(buf2, BUFLEN, "%s protects you with %s.\n", buf, retalname);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
free(loctext);
|
free(loctext);
|
||||||
break;
|
break;
|
||||||
case F_PROTALIGN:
|
case F_PROTALIGN:
|
||||||
sprintf(buf2, "%s repels attacks from %s aligned creatures.\n", buf,
|
snprintf(buf2, BUFLEN, "%s repels attacks from %s aligned creatures.\n", buf,
|
||||||
getalignmentname(f->val[1]));
|
getalignmentname(f->val[1]));
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_RAGE:
|
case F_RAGE:
|
||||||
sprintf(buf2, "%s makes you enraged.\n", buf);
|
snprintf(buf2, BUFLEN, "%s makes you enraged.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_REFLECTION:
|
case F_REFLECTION:
|
||||||
sprintf(buf2, "%s reflects all projectiles back to their source.\n", buf);
|
snprintf(buf2, BUFLEN, "%s reflects all projectiles back to their source.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_REGENERATES:
|
case F_REGENERATES:
|
||||||
|
@ -7559,73 +7560,73 @@ char *makedesc_ob(object_t *o, char *retbuf) {
|
||||||
} else { // >= 4
|
} else { // >= 4
|
||||||
strcpy(buf3, "extremely quickly");
|
strcpy(buf3, "extremely quickly");
|
||||||
}
|
}
|
||||||
sprintf(buf2, "%s allows you to regenerate health%s.\n", buf,buf3);
|
snprintf(buf2, BUFLEN, "%s allows you to regenerate health%s.\n", buf,buf3);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_RESISTMAG:
|
case F_RESISTMAG:
|
||||||
sprintf(buf2, "%s grants you %s immunity to magic.\n", buf,
|
snprintf(buf2, BUFLEN, "%s grants you %s immunity to magic.\n", buf,
|
||||||
(f->val[0] >= 10) ? "strong" : "minor");
|
(f->val[0] >= 10) ? "strong" : "minor");
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_RISEASGHOST:
|
case F_RISEASGHOST:
|
||||||
sprintf(buf2, "%s cause you to rise as a ghost after death.\n", buf);
|
snprintf(buf2, BUFLEN, "%s cause you to rise as a ghost after death.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SEEINVIS:
|
case F_SEEINVIS:
|
||||||
sprintf(buf2, "%s allows you to see invisible things.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to see invisible things.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SEEINDARK:
|
case F_SEEINDARK:
|
||||||
sprintf(buf2, "%s allows you to see in the dark.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to see in the dark.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SHADOWED:
|
case F_SHADOWED:
|
||||||
sprintf(buf2, "%s prevents distant creatures from seeing you.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents distant creatures from seeing you.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SILENCED:
|
case F_SILENCED:
|
||||||
sprintf(buf2, "%s prevents you from making sounds.\n", buf);
|
snprintf(buf2, BUFLEN, "%s prevents you from making sounds.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SILENTMOVE:
|
case F_SILENTMOVE:
|
||||||
sprintf(buf2, "%s allows you to move silently.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to move silently.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SLOWACT:
|
case F_SLOWACT:
|
||||||
sprintf(buf2, "%s will slow down your actions.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will slow down your actions.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SLOWMETAB:
|
case F_SLOWMETAB:
|
||||||
sprintf(buf2, "%s will decrease your metabolic rate.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will decrease your metabolic rate.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SLOWMOVE:
|
case F_SLOWMOVE:
|
||||||
sprintf(buf2, "%s will slow down your movement.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will slow down your movement.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_SPIDERCLIMB:
|
case F_SPIDERCLIMB:
|
||||||
sprintf(buf2, "%s allows you to adhere to walls.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to adhere to walls.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_TREMORSENSE:
|
case F_TREMORSENSE:
|
||||||
sprintf(buf2, "%s allows you to 'see' by sensing vibrations around you.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to 'see' by sensing vibrations around you.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_TRUESTRIKE:
|
case F_TRUESTRIKE:
|
||||||
sprintf(buf2, "%s makes your attacks automatically hit.\n", buf);
|
snprintf(buf2, BUFLEN, "%s makes your attacks automatically hit.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_WINDSHIELD:
|
case F_WINDSHIELD:
|
||||||
sprintf(buf2, "%s will surround you with a cyclonic shield.\n", buf);
|
snprintf(buf2, BUFLEN, "%s will surround you with a cyclonic shield.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_VISRANGEMOD:
|
case F_VISRANGEMOD:
|
||||||
sprintf(buf2, "%s %s your vision range by %d metre%s.\n", buf, (f->val[1] > 0) ? "increases" : "decreases",
|
snprintf(buf2, BUFLEN, "%s %s your vision range by %d metre%s.\n", buf, (f->val[1] > 0) ? "increases" : "decreases",
|
||||||
abs(f->val[1]), (abs(f->val[1]) == 1) ? "" : "s" );
|
abs(f->val[1]), (abs(f->val[1]) == 1) ? "" : "s" );
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
case F_XRAYVIS:
|
case F_XRAYVIS:
|
||||||
sprintf(buf2, "%s allows you to see through walls.\n", buf);
|
snprintf(buf2, BUFLEN, "%s allows you to see through walls.\n", buf);
|
||||||
strncat(retbuf, buf2, HUGEBUFLEN);
|
strncat(retbuf, buf2, HUGEBUFLEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -8027,10 +8028,10 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
||||||
if (basedamagetype(n) != n) continue;
|
if (basedamagetype(n) != n) continue;
|
||||||
if (isimmuneto(r->flags, n, B_FALSE)) {
|
if (isimmuneto(r->flags, n, B_FALSE)) {
|
||||||
if (first) {
|
if (first) {
|
||||||
sprintf(buf2, "Immune to: %s", getdamname(n));
|
snprintf(buf2, BUFLEN, "Immune to: %s", getdamname(n));
|
||||||
first = B_FALSE;
|
first = B_FALSE;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf2, ", %s", getdamname(n));
|
snprintf(buf2, BUFLEN, ", %s", getdamname(n));
|
||||||
}
|
}
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
}
|
}
|
||||||
|
@ -8051,10 +8052,10 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
||||||
if (basedamagetype(n) != n) continue;
|
if (basedamagetype(n) != n) continue;
|
||||||
if (isresistantto(r->flags, n, B_FALSE)) {
|
if (isresistantto(r->flags, n, B_FALSE)) {
|
||||||
if (first) {
|
if (first) {
|
||||||
sprintf(buf2, "Resistant to: %s", getdamname(n));
|
snprintf(buf2, BUFLEN, "Resistant to: %s", getdamname(n));
|
||||||
first = B_FALSE;
|
first = B_FALSE;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf2, ", %s", getdamname(n));
|
snprintf(buf2, BUFLEN, ", %s", getdamname(n));
|
||||||
}
|
}
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
}
|
}
|
||||||
|
@ -8182,10 +8183,10 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
||||||
if (basedamagetype(n) != n) continue;
|
if (basedamagetype(n) != n) continue;
|
||||||
if (isvulnto(r->flags, n, B_FALSE)) {
|
if (isvulnto(r->flags, n, B_FALSE)) {
|
||||||
if (first) {
|
if (first) {
|
||||||
sprintf(buf2, "Vulnerable to: %s", getdamname(n));
|
snprintf(buf2, BUFLEN, "Vulnerable to: %s", getdamname(n));
|
||||||
first = B_FALSE;
|
first = B_FALSE;
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf2, ", %s", getdamname(n));
|
snprintf(buf2, BUFLEN, ", %s", getdamname(n));
|
||||||
}
|
}
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
}
|
}
|
||||||
|
@ -8240,8 +8241,9 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
||||||
case F_VEGETARIAN: if (lorelev >= PR_ADEPT) sprintf(buf, "Will not eat meat."); break;
|
case F_VEGETARIAN: if (lorelev >= PR_ADEPT) sprintf(buf, "Will not eat meat."); break;
|
||||||
case F_VISRANGEMOD:
|
case F_VISRANGEMOD:
|
||||||
if (lorelev >= PR_BEGINNER) {
|
if (lorelev >= PR_BEGINNER) {
|
||||||
if (f->val[0] < 0) sprintf(buf, "Reduced vision range (%d)", f->val[0]); break;
|
if (f->val[0] < 0) sprintf(buf, "Reduced vision range (%d)", f->val[0]);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case F_PARTVEGETARIAN: if (lorelev >= PR_ADEPT) sprintf(buf, "Will only eat meat when hungry."); break;
|
case F_PARTVEGETARIAN: if (lorelev >= PR_ADEPT) sprintf(buf, "Will only eat meat when hungry."); break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -8272,7 +8274,7 @@ char *makedesc_race(enum RACE rid, char *retbuf, int showextra, int forplayersel
|
||||||
objecttype_t *ot;
|
objecttype_t *ot;
|
||||||
ot = findot(f->val[0]);
|
ot = findot(f->val[0]);
|
||||||
if (ot) {
|
if (ot) {
|
||||||
sprintf(buf2, "Its blood can be bottled to create %s %s.",
|
snprintf(buf2, BUFLEN, "Its blood can be bottled to create %s %s.",
|
||||||
needan(ot->name) ? "an" : "a",
|
needan(ot->name) ? "an" : "a",
|
||||||
ot->name);
|
ot->name);
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
|
@ -8412,7 +8414,7 @@ char *makedesc_spell(objecttype_t *ot, char *retbuf) {
|
||||||
}
|
}
|
||||||
assert(strlen(schoollist));
|
assert(strlen(schoollist));
|
||||||
|
|
||||||
sprintf(buf, "It is a level %d %s spell.\n",f->val[0], schoollist);
|
snprintf(buf, BUFLEN, "It is a level %d %s spell.\n",f->val[0], schoollist);
|
||||||
strncat(retbuf, buf, BUFLEN);
|
strncat(retbuf, buf, BUFLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8493,7 +8495,7 @@ char *makedesc_spell(objecttype_t *ot, char *retbuf) {
|
||||||
}
|
}
|
||||||
if (minrange != 0) {
|
if (minrange != 0) {
|
||||||
char buf2[BUFLEN];
|
char buf2[BUFLEN];
|
||||||
sprintf(buf2, " (minimum %d)", minrange);
|
snprintf(buf2, BUFLEN, " (minimum %d)", minrange);
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
}
|
}
|
||||||
strcat(buf, ".\n");
|
strcat(buf, ".\n");
|
||||||
|
@ -9048,7 +9050,7 @@ void doenter(lifeform_t *lf) {
|
||||||
if (enterob) {
|
if (enterob) {
|
||||||
char ch,obname[BUFLEN],buf[BUFLEN];
|
char ch,obname[BUFLEN],buf[BUFLEN];
|
||||||
getobname(enterob,obname, 1);
|
getobname(enterob,obname, 1);
|
||||||
sprintf(buf, "Enter %s?", obname);
|
snprintf(buf, BUFLEN, "Enter %s?", obname);
|
||||||
ch = askchar(buf, "yn","n", B_TRUE, B_FALSE);
|
ch = askchar(buf, "yn","n", B_TRUE, B_FALSE);
|
||||||
if (ch == 'y') {
|
if (ch == 'y') {
|
||||||
shop(lf, enterob);
|
shop(lf, enterob);
|
||||||
|
@ -10247,7 +10249,7 @@ void dumpcols(void) {
|
||||||
|
|
||||||
void dumpskills(void) {
|
void dumpskills(void) {
|
||||||
skill_t *sk;
|
skill_t *sk;
|
||||||
char buf[BUFLEN],thisline[BUFLEN];
|
char buf[BUFLEN],thisline[BIGBUFLEN];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
// max skillname length: 21 (sorcery:translocation)
|
// max skillname length: 21 (sorcery:translocation)
|
||||||
// use blocks of 26
|
// use blocks of 26
|
||||||
|
@ -10274,7 +10276,7 @@ void dumpskills(void) {
|
||||||
case 5: strcpy(lev, "Exp"); break;
|
case 5: strcpy(lev, "Exp"); break;
|
||||||
case 6: strcpy(lev, "Mst"); break;
|
case 6: strcpy(lev, "Mst"); break;
|
||||||
}
|
}
|
||||||
sprintf(buf, "%21s:%3s ",sk->name, lev);
|
snprintf(buf, BUFLEN, "%21s:%3s ",sk->name, lev);
|
||||||
strcat(thisline, buf);
|
strcat(thisline, buf);
|
||||||
if (count == 3) {
|
if (count == 3) {
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -12353,7 +12355,7 @@ void showlfarmour(lifeform_t *lf) {
|
||||||
sprintf(rhs, "(using two-handed weapon)");
|
sprintf(rhs, "(using two-handed weapon)");
|
||||||
} else {
|
} else {
|
||||||
getobname(o, obname, o->amt);
|
getobname(o, obname, o->amt);
|
||||||
sprintf(rhs, "%c - %s",o->letter, obname);
|
snprintf(rhs, BUFLEN, "%c - %s",o->letter, obname);
|
||||||
|
|
||||||
if (outerob && (outerob != o)) {
|
if (outerob && (outerob != o)) {
|
||||||
char outerobname[BUFLEN];
|
char outerobname[BUFLEN];
|
||||||
|
@ -13536,7 +13538,7 @@ void showlfstats(lifeform_t *lf, int showall) {
|
||||||
count = 0;
|
count = 0;
|
||||||
for (dounknown = 0; dounknown <= 1; dounknown++) {
|
for (dounknown = 0; dounknown <= 1; dounknown++) {
|
||||||
for (sk = firstskill ; sk ; sk = sk->next) {
|
for (sk = firstskill ; sk ; sk = sk->next) {
|
||||||
char thisline[BUFLEN];
|
char thisline[BIGBUFLEN];
|
||||||
int printed = B_FALSE;
|
int printed = B_FALSE;
|
||||||
|
|
||||||
slev = getskill(lf, sk->id);
|
slev = getskill(lf, sk->id);
|
||||||
|
@ -13549,7 +13551,7 @@ void showlfstats(lifeform_t *lf, int showall) {
|
||||||
basecolour = 'h';
|
basecolour = 'h';
|
||||||
}
|
}
|
||||||
// known skill
|
// known skill
|
||||||
sprintf(thisline, "^%c%-21s^%c[^%d", basecolour, sk->name, basecolour,
|
snprintf(thisline, BIGBUFLEN, "^%c%-21s^%c[^%d", basecolour, sk->name, basecolour,
|
||||||
getskilllevelcolour(slev));
|
getskilllevelcolour(slev));
|
||||||
max = getmaxskilllevel(player, sk->id);
|
max = getmaxskilllevel(player, sk->id);
|
||||||
for (i = PR_NOVICE; i <= PR_MASTER; i++) {
|
for (i = PR_NOVICE; i <= PR_MASTER; i++) {
|
||||||
|
@ -13858,14 +13860,14 @@ void showlfstats(lifeform_t *lf, int showall) {
|
||||||
objecttype_t *sp;
|
objecttype_t *sp;
|
||||||
sp = findot(f->val[0]);
|
sp = findot(f->val[0]);
|
||||||
if (sp) {
|
if (sp) {
|
||||||
char thisline[BUFLEN];
|
char thisline[BIGBUFLEN];
|
||||||
char desc[BUFLEN];
|
char desc[BUFLEN];
|
||||||
if (nfound == 0) {
|
if (nfound == 0) {
|
||||||
effectline(&stopnow, &count, offset, &nextoffset, headinglines, mainwin, &y, &x, 0, "%s %s the following spells active:", you(lf),
|
effectline(&stopnow, &count, offset, &nextoffset, headinglines, mainwin, &y, &x, 0, "%s %s the following spells active:", you(lf),
|
||||||
isplayer(lf) ? "have" : "has");
|
isplayer(lf) ? "have" : "has");
|
||||||
|
|
||||||
}
|
}
|
||||||
sprintf(thisline, " - %s %s (consuming %d MP", sp->name, roman(f->val[2]), f->val[1]);
|
snprintf(thisline, BIGBUFLEN, " - %s %s (consuming %d MP", sp->name, roman(f->val[2]), f->val[1]);
|
||||||
getspelldesc(f->val[0], f->val[2], desc);
|
getspelldesc(f->val[0], f->val[2], desc);
|
||||||
if (strlen(desc)) {
|
if (strlen(desc)) {
|
||||||
strcat(thisline, ", ");
|
strcat(thisline, ", ");
|
||||||
|
|
145
lf.c
145
lf.c
|
@ -1,3 +1,4 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -3060,18 +3061,18 @@ int continuerepairing(lifeform_t *lf, flag_t *repairflag) {
|
||||||
limit(&(f->val[0]), NA, f->val[1]);
|
limit(&(f->val[0]), NA, f->val[1]);
|
||||||
if (f->val[0] == f->val[1]) {
|
if (f->val[0] == f->val[1]) {
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
char obname[BUFLEN],withbuf[BUFLEN];
|
char obname[BUFLEN],withbuf[BIGBUFLEN];
|
||||||
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
||||||
if (helpob) sprintf(withbuf, " (with %s)", helpobname);
|
if (helpob) snprintf(withbuf, BIGBUFLEN, " (with %s)", helpobname);
|
||||||
else strcpy(withbuf, "");
|
else strcpy(withbuf, "");
|
||||||
|
|
||||||
msg("You finish repairing your %s%s.", noprefix(obname), withbuf);
|
msg("You finish repairing your %s%s.", noprefix(obname), withbuf);
|
||||||
} else if (cansee(player, lf)) {
|
} else if (cansee(player, lf)) {
|
||||||
char obname[BUFLEN],withbuf[BUFLEN];
|
char obname[BUFLEN],withbuf[BIGBUFLEN];
|
||||||
char lfname[BUFLEN];
|
char lfname[BUFLEN];
|
||||||
getlfname(lf, lfname);
|
getlfname(lf, lfname);
|
||||||
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
||||||
if (helpob) sprintf(withbuf, " with %s", helpobname);
|
if (helpob) snprintf(withbuf, BIGBUFLEN, " with %s", helpobname);
|
||||||
else strcpy(withbuf, "");
|
else strcpy(withbuf, "");
|
||||||
msg("%s finishes repairing %s%s.", lfname, obname, withbuf);
|
msg("%s finishes repairing %s%s.", lfname, obname, withbuf);
|
||||||
}
|
}
|
||||||
|
@ -3081,9 +3082,9 @@ int continuerepairing(lifeform_t *lf, flag_t *repairflag) {
|
||||||
killflag(repairflag);
|
killflag(repairflag);
|
||||||
} else {
|
} else {
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
char obname[BUFLEN],withbuf[BUFLEN];
|
char obname[BUFLEN],withbuf[BIGBUFLEN];
|
||||||
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
||||||
if (helpob) sprintf(withbuf, " (with %s)", helpobname);
|
if (helpob) snprintf(withbuf, BIGBUFLEN, " (with %s)", helpobname);
|
||||||
else strcpy(withbuf, "");
|
else strcpy(withbuf, "");
|
||||||
|
|
||||||
msg("You continue repairing your %s%s.", noprefix(obname), withbuf);
|
msg("You continue repairing your %s%s.", noprefix(obname), withbuf);
|
||||||
|
@ -3092,7 +3093,7 @@ int continuerepairing(lifeform_t *lf, flag_t *repairflag) {
|
||||||
char lfname[BUFLEN];
|
char lfname[BUFLEN];
|
||||||
getlfname(lf, lfname);
|
getlfname(lf, lfname);
|
||||||
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
real_getobname(o, obname, o->amt, B_PREMODS, B_NOCONDITION, B_BLINDADJUST, B_BLESSINGS, B_NOUSED, B_NOSHOWALL);
|
||||||
if (helpob) sprintf(withbuf, " with %s", helpobname);
|
if (helpob) snprintf(withbuf, BUFLEN, " with %s", helpobname);
|
||||||
else strcpy(withbuf, "");
|
else strcpy(withbuf, "");
|
||||||
msg("%s continue repairing %s%s.", lfname, obname, withbuf);
|
msg("%s continue repairing %s%s.", lfname, obname, withbuf);
|
||||||
}
|
}
|
||||||
|
@ -3619,7 +3620,7 @@ int die(lifeform_t *lf) {
|
||||||
// killed by a vampire = vampire.
|
// killed by a vampire = vampire.
|
||||||
if (killer) {
|
if (killer) {
|
||||||
switch (killer->race->id) {
|
switch (killer->race->id) {
|
||||||
case R_VAMPIRE: sprintf(reanimateas, "vampire"); break;
|
case R_VAMPIRE: snprintf(reanimateas, BUFLEN, "vampire"); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3631,9 +3632,9 @@ int die(lifeform_t *lf) {
|
||||||
getflags(lf->flags, retflag, &nretflags, F_POISONED, F_NONE);
|
getflags(lf->flags, retflag, &nretflags, F_POISONED, F_NONE);
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
if (retflag[i]->val[2] == R_VAMPIRE) {
|
if (retflag[i]->val[2] == R_VAMPIRE) {
|
||||||
sprintf(reanimateas, "vampire");
|
snprintf(reanimateas, BUFLEN, "vampire");
|
||||||
} else if (retflag[i]->val[2] == lf->race->baseid) {
|
} else if (retflag[i]->val[2] == lf->race->baseid) {
|
||||||
sprintf(reanimateas, "ghoul");
|
snprintf(reanimateas, BUFLEN, "ghoul");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3643,10 +3644,10 @@ int die(lifeform_t *lf) {
|
||||||
if (onein(3)) {
|
if (onein(3)) {
|
||||||
switch (rnd(1,2)) {
|
switch (rnd(1,2)) {
|
||||||
case 1:
|
case 1:
|
||||||
sprintf(reanimateas, "zombie");
|
snprintf(reanimateas, BUFLEN, "zombie");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sprintf(reanimateas, "skeleton");
|
snprintf(reanimateas, BUFLEN, "skeleton");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3702,7 +3703,7 @@ int die(lifeform_t *lf) {
|
||||||
char *nth;
|
char *nth;
|
||||||
f = incflag(lf->flags, F_NUMDEATHS, 1, NA, NA);
|
f = incflag(lf->flags, F_NUMDEATHS, 1, NA, NA);
|
||||||
nth = getnthtext(f->val[0]);
|
nth = getnthtext(f->val[0]);
|
||||||
sprintf(buf, "I will grant you %s %s chance, mortal... use it wisely.",
|
snprintf(buf, BUFLEN, "I will grant you %s %s chance, mortal... use it wisely.",
|
||||||
needan(nth) ? "an" : "a", nth); more();
|
needan(nth) ? "an" : "a", nth); more();
|
||||||
godsay(god->race->id, B_TRUE, buf); more();
|
godsay(god->race->id, B_TRUE, buf); more();
|
||||||
lf->hp = lf->maxhp;
|
lf->hp = lf->maxhp;
|
||||||
|
@ -4044,7 +4045,7 @@ int die(lifeform_t *lf) {
|
||||||
// replace 'splash of blood' with 'splash of xat blood'
|
// replace 'splash of blood' with 'splash of xat blood'
|
||||||
if (strends(locbname, " of blood")) {
|
if (strends(locbname, " of blood")) {
|
||||||
char replacewith[BUFLEN];
|
char replacewith[BUFLEN];
|
||||||
sprintf(replacewith, " of %s blood",lf->race->name);
|
snprintf(replacewith, BUFLEN, " of %s blood",lf->race->name);
|
||||||
strrep(&locbname, " of blood", replacewith, NULL);
|
strrep(&locbname, " of blood", replacewith, NULL);
|
||||||
}
|
}
|
||||||
// amount of time blood will appear for depends
|
// amount of time blood will appear for depends
|
||||||
|
@ -4334,7 +4335,7 @@ int die(lifeform_t *lf) {
|
||||||
if (hasjob(lf, J_GOD)) {
|
if (hasjob(lf, J_GOD)) {
|
||||||
char ch;
|
char ch;
|
||||||
char ques[BUFLEN];
|
char ques[BUFLEN];
|
||||||
sprintf(ques, "Bones file dump = %s. Override?", dobonesfile ? "true" : "false");
|
snprintf(ques, BUFLEN, "Bones file dump = %s. Override?", dobonesfile ? "true" : "false");
|
||||||
ch = askchar(ques, "yn", "n", B_TRUE, B_FALSE);
|
ch = askchar(ques, "yn", "n", B_TRUE, B_FALSE);
|
||||||
if (ch == 'y') {
|
if (ch == 'y') {
|
||||||
ch = askchar("Dump bones file?", "yn", "n", B_TRUE, B_FALSE);
|
ch = askchar("Dump bones file?", "yn", "n", B_TRUE, B_FALSE);
|
||||||
|
@ -4374,7 +4375,7 @@ void dumplf(void) {
|
||||||
}
|
}
|
||||||
for (lf = startmap->lf ; lf ; lf = lf->next) {
|
for (lf = startmap->lf ; lf ; lf = lf->next) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf," timespent=%3d id %d race %s, redraws last turn=%d",lf->timespent, lf->id, lf->race->name,
|
snprintf(buf, BUFLEN," timespent=%3d id %d race %s, redraws last turn=%d",lf->timespent, lf->id, lf->race->name,
|
||||||
lf->redraws);
|
lf->redraws);
|
||||||
if (cansee(player, lf)) {
|
if (cansee(player, lf)) {
|
||||||
strcat(buf, "(seen by player)");
|
strcat(buf, "(seen by player)");
|
||||||
|
@ -4538,7 +4539,7 @@ int genalignmentlist(flagpile_t *fp, char *buf) {
|
||||||
if (!strchr(localposs, candidate)) { // not already in list?
|
if (!strchr(localposs, candidate)) { // not already in list?
|
||||||
char letter[2];
|
char letter[2];
|
||||||
// this one is okay.
|
// this one is okay.
|
||||||
sprintf(letter, "%c", candidate);
|
snprintf(letter, 1, "%c", candidate);
|
||||||
strcat(localposs, letter);
|
strcat(localposs, letter);
|
||||||
nposs++;
|
nposs++;
|
||||||
}
|
}
|
||||||
|
@ -4695,7 +4696,7 @@ int digcell(lifeform_t *lf, cell_t *c, object_t *o, int dismantle) {
|
||||||
char digoid[BUFLEN];
|
char digoid[BUFLEN];
|
||||||
// start digging!
|
// start digging!
|
||||||
if (o && !dismantle) {
|
if (o && !dismantle) {
|
||||||
sprintf(digoid, "%ld",o->id);
|
snprintf(digoid, BUFLEN, "%ld",o->id);
|
||||||
} else {
|
} else {
|
||||||
strcpy(digoid,"");
|
strcpy(digoid,"");
|
||||||
}
|
}
|
||||||
|
@ -5153,7 +5154,7 @@ int eat(lifeform_t *lf, object_t *o) {
|
||||||
if (!hasflag(o->flags, F_PREPARED) && !lfhasflag(lf, F_CANEATRAW)) {
|
if (!hasflag(o->flags, F_PREPARED) && !lfhasflag(lf, F_CANEATRAW)) {
|
||||||
if (!lfhasflag(lf, F_EATING) && getskill(lf, SK_COOKING)) {
|
if (!lfhasflag(lf, F_EATING) && getskill(lf, SK_COOKING)) {
|
||||||
more();
|
more();
|
||||||
sprintf(ques,"Really eat %s raw?",obname);
|
snprintf(ques, BUFLEN,"Really eat %s raw?",obname);
|
||||||
ch = askchar(ques,"yn","y", B_TRUE, B_FALSE);
|
ch = askchar(ques,"yn","y", B_TRUE, B_FALSE);
|
||||||
if (ch != 'y') {
|
if (ch != 'y') {
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
|
@ -5169,7 +5170,7 @@ int eat(lifeform_t *lf, object_t *o) {
|
||||||
if (corpserace->id == lf->race->baseid) {
|
if (corpserace->id == lf->race->baseid) {
|
||||||
if (getattrbracket(getattr(lf, A_WIS), A_WIS, NULL) >= AT_AVERAGE) {
|
if (getattrbracket(getattr(lf, A_WIS), A_WIS, NULL) >= AT_AVERAGE) {
|
||||||
more();
|
more();
|
||||||
sprintf(ques,"Really eat your own race?");
|
snprintf(ques, BUFLEN,"Really eat your own race?");
|
||||||
ch = askchar(ques,"yn","y", B_TRUE, B_FALSE);
|
ch = askchar(ques,"yn","y", B_TRUE, B_FALSE);
|
||||||
if (ch != 'y') {
|
if (ch != 'y') {
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
|
@ -5221,11 +5222,11 @@ int eat(lifeform_t *lf, object_t *o) {
|
||||||
if (turnstoeat <= 1) {
|
if (turnstoeat <= 1) {
|
||||||
char taste[BUFLEN];
|
char taste[BUFLEN];
|
||||||
if (rawmeat) {
|
if (rawmeat) {
|
||||||
sprintf(taste, "The raw meat tastes disgusting!");
|
snprintf(taste, BUFLEN, "The raw meat tastes disgusting!");
|
||||||
} else if (hasflagval(o->flags, F_CORPSEOF, R_CHICKEN, NA, NA, NULL)) {
|
} else if (hasflagval(o->flags, F_CORPSEOF, R_CHICKEN, NA, NA, NULL)) {
|
||||||
sprintf(taste, "Tastes like chicken!");
|
snprintf(taste, BUFLEN, "Tastes like chicken!");
|
||||||
} else if (f && (f->val[1] >= 20)) {
|
} else if (f && (f->val[1] >= 20)) {
|
||||||
sprintf(taste, "Yum!");
|
snprintf(taste, BUFLEN, "Yum!");
|
||||||
} else {
|
} else {
|
||||||
strcpy(taste, "");
|
strcpy(taste, "");
|
||||||
}
|
}
|
||||||
|
@ -5552,7 +5553,7 @@ int eat(lifeform_t *lf, object_t *o) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
// die.
|
// die.
|
||||||
lf->hp = 0;
|
lf->hp = 0;
|
||||||
sprintf(buf, "eating %s", obname);
|
snprintf(buf, BUFLEN, "eating %s", obname);
|
||||||
setlastdam(lf, buf);
|
setlastdam(lf, buf);
|
||||||
stopeating = B_TRUE;
|
stopeating = B_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -5778,10 +5779,10 @@ void enhanceskills(lifeform_t *lf) {
|
||||||
|
|
||||||
for (i = 0; i < nposs; i++) {
|
for (i = 0; i < nposs; i++) {
|
||||||
char this[2];
|
char this[2];
|
||||||
sprintf(this, "%c", getattrletter(poss[i]));
|
snprintf(this, 1, "%c", getattrletter(poss[i]));
|
||||||
if (isalpha(this[0])) {
|
if (isalpha(this[0])) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
sprintf(ques, "Increase your %s", getattrname(poss[i]));
|
snprintf(ques, BUFLEN, "Increase your %s", getattrname(poss[i]));
|
||||||
} else if (i == (nposs-1)) {
|
} else if (i == (nposs-1)) {
|
||||||
strcat(ques, " or ");
|
strcat(ques, " or ");
|
||||||
strcat(ques, getattrname(poss[i]));
|
strcat(ques, getattrname(poss[i]));
|
||||||
|
@ -6187,7 +6188,7 @@ void enhanceskills(lifeform_t *lf) {
|
||||||
limit(&nleft, 1, NA);
|
limit(&nleft, 1, NA);
|
||||||
|
|
||||||
// get all possible spells to learn, from the given school
|
// get all possible spells to learn, from the given school
|
||||||
sprintf(qbuf, "Learn which new spell (maxmp=%d):", getmaxmp(player));
|
snprintf(qbuf, BUFLEN, "Learn which new spell (maxmp=%d):", getmaxmp(player));
|
||||||
makespellchoicelist(&prompt, player, qbuf, "Describe which spell:", f->val[1], B_TRUE, B_FALSE, B_FALSE, player->maxmp);
|
makespellchoicelist(&prompt, player, qbuf, "Describe which spell:", f->val[1], B_TRUE, B_FALSE, B_FALSE, player->maxmp);
|
||||||
// find highest possible level, and mark all choices as invalid.
|
// find highest possible level, and mark all choices as invalid.
|
||||||
for (i = 0; i < prompt.nchoices; i++) {
|
for (i = 0; i < prompt.nchoices; i++) {
|
||||||
|
@ -6281,7 +6282,7 @@ void enhanceskills(lifeform_t *lf) {
|
||||||
slev = getskill(lf, SK_SS_ALLOMANCY);
|
slev = getskill(lf, SK_SS_ALLOMANCY);
|
||||||
if (pctchance(slev*20)) {
|
if (pctchance(slev*20)) {
|
||||||
char qbuf[BUFLEN];
|
char qbuf[BUFLEN];
|
||||||
sprintf(qbuf, "Learn which allomantic ability (maxmp=%d):", getmaxmp(player));
|
snprintf(qbuf, BUFLEN, "Learn which allomantic ability (maxmp=%d):", getmaxmp(player));
|
||||||
// construct list of castable mental spells
|
// construct list of castable mental spells
|
||||||
makespellchoicelist(&prompt, lf, qbuf, "Describe which allomantic ability:", SS_ALLOMANCY, B_TRUE, B_FALSE, B_FALSE, player->maxmp);
|
makespellchoicelist(&prompt, lf, qbuf, "Describe which allomantic ability:", SS_ALLOMANCY, B_TRUE, B_FALSE, B_FALSE, player->maxmp);
|
||||||
if (prompt.nchoices > 0) {
|
if (prompt.nchoices > 0) {
|
||||||
|
@ -6305,7 +6306,7 @@ void enhanceskills(lifeform_t *lf) {
|
||||||
if (pctchance(slev*20)) {
|
if (pctchance(slev*20)) {
|
||||||
char qbuf[BUFLEN];
|
char qbuf[BUFLEN];
|
||||||
int pickfrom;
|
int pickfrom;
|
||||||
sprintf(qbuf, "Learn which psionic power (maxmp=%d):", getmaxmp(player));
|
snprintf(qbuf, BUFLEN, "Learn which psionic power (maxmp=%d):", getmaxmp(player));
|
||||||
// construct list of castable mental spells
|
// construct list of castable mental spells
|
||||||
makespellchoicelist(&prompt, lf, qbuf, "Describe which psionic power:", SS_MENTAL, B_TRUE, B_FALSE, B_FALSE, player->maxmp);
|
makespellchoicelist(&prompt, lf, qbuf, "Describe which psionic power:", SS_MENTAL, B_TRUE, B_FALSE, B_FALSE, player->maxmp);
|
||||||
|
|
||||||
|
@ -6810,7 +6811,7 @@ race_t *findracebyname(char *name, condset_t *cs) {
|
||||||
|
|
||||||
// ...then partial matches start of words in name
|
// ...then partial matches start of words in name
|
||||||
// ie. "ant" should match "soldier ant" before matching "giant"
|
// ie. "ant" should match "soldier ant" before matching "giant"
|
||||||
sprintf(searchfor, " %s",name);
|
snprintf(searchfor, BUFLEN, " %s",name);
|
||||||
for (r = firstrace; r ; r = r->next) {
|
for (r = firstrace; r ; r = r->next) {
|
||||||
if (strstr(r->name, searchfor) && racemeets(r->id, cs)) {
|
if (strstr(r->name, searchfor) && racemeets(r->id, cs)) {
|
||||||
return r;
|
return r;
|
||||||
|
@ -10544,7 +10545,7 @@ char *getmoveverbother(lifeform_t *lf, char *buf) {
|
||||||
}
|
}
|
||||||
f = lfhasflag(lf, F_WALKVERB);
|
f = lfhasflag(lf, F_WALKVERB);
|
||||||
if (f) {
|
if (f) {
|
||||||
sprintf(buf, "%ss", f->text);
|
snprintf(buf, BUFLEN, "%ss", f->text);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
strcpy(buf, "walks");
|
strcpy(buf, "walks");
|
||||||
|
@ -12482,7 +12483,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
||||||
int pow;
|
int pow;
|
||||||
char pwbuf[BUFLEN];
|
char pwbuf[BUFLEN];
|
||||||
pow = MINOF((gettr(lf)/2), getspellmaxpower(o->type->id));
|
pow = MINOF((gettr(lf)/2), getspellmaxpower(o->type->id));
|
||||||
sprintf(pwbuf, "pw:%d;", pow);
|
snprintf(pwbuf, BUFLEN, "pw:%d;", pow);
|
||||||
addtempflag(lf->flags, F_CANCAST, o->type->id, NA, NA, pwbuf, FROMJOB);
|
addtempflag(lf->flags, F_CANCAST, o->type->id, NA, NA, pwbuf, FROMJOB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13145,7 +13146,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
|
||||||
f2 = hasflag(poss[i]->flags, F_DAM);
|
f2 = hasflag(poss[i]->flags, F_DAM);
|
||||||
dt = f2->val[0];
|
dt = f2->val[0];
|
||||||
dam = f2->val[1];
|
dam = f2->val[1];
|
||||||
sprintf(thisdesc, "%s (Damage: %d %s, Accuracy: %s)", poss[i]->name,
|
snprintf(thisdesc, BUFLEN, "%s (Damage: %d %s, Accuracy: %s)", poss[i]->name,
|
||||||
dam, getdamname(dt), getaccuracyname(acc));
|
dam, getdamname(dt), getaccuracyname(acc));
|
||||||
|
|
||||||
// don't allow this if the player is vulnerable to it!
|
// don't allow this if the player is vulnerable to it!
|
||||||
|
@ -13358,7 +13359,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
|
||||||
if (real_getrandomob(mapcell, buf, targmap->depth + depthmod, NA, getrarityval(text), B_TRUE, &cs)) {
|
if (real_getrandomob(mapcell, buf, targmap->depth + depthmod, NA, getrarityval(text), B_TRUE, &cs)) {
|
||||||
char buf3[BUFLEN];
|
char buf3[BUFLEN];
|
||||||
if (db) snprintf(buf2, BUFLEN, "finished startobwepsk successfuly.");
|
if (db) snprintf(buf2, BUFLEN, "finished startobwepsk successfuly.");
|
||||||
sprintf(buf3, "%s%s%s",text,strlen(text) ? " " : "",buf);
|
snprintf(buf3, BUFLEN, "%s%s%s",text,strlen(text) ? " " : "",buf);
|
||||||
o = addob(op, buf3);
|
o = addob(op, buf3);
|
||||||
} else {
|
} else {
|
||||||
if (db) snprintf(buf2, BUFLEN, "finished startobwepsk, failed.");
|
if (db) snprintf(buf2, BUFLEN, "finished startobwepsk, failed.");
|
||||||
|
@ -14149,7 +14150,7 @@ int injure(lifeform_t *lf, enum BODYPART where, enum DAMTYPE damtype, enum INJUR
|
||||||
case IJ_HANDBLEED: desc = strdup("hand is bleeding^attacking will cause damage"); break;
|
case IJ_HANDBLEED: desc = strdup("hand is bleeding^attacking will cause damage"); break;
|
||||||
case IJ_TENDONCUT: desc = strdup("right flexor tendon is cut^cannot weild weapons"); break;
|
case IJ_TENDONCUT: desc = strdup("right flexor tendon is cut^cannot weild weapons"); break;
|
||||||
case IJ_FINGERMISSING:
|
case IJ_FINGERMISSING:
|
||||||
sprintf(buf, "%s is severed^cannot wear rings on this hand", getbodypartname(lf, bp2));
|
snprintf(buf, BUFLEN, "%s is severed^cannot wear rings on this hand", getbodypartname(lf, bp2));
|
||||||
desc = strdup(buf);
|
desc = strdup(buf);
|
||||||
break;
|
break;
|
||||||
case IJ_EYELIDSCRAPED: desc = strdup("eyelid is scraped^accuracy penalty"); break;
|
case IJ_EYELIDSCRAPED: desc = strdup("eyelid is scraped^accuracy penalty"); break;
|
||||||
|
@ -14161,7 +14162,7 @@ int injure(lifeform_t *lf, enum BODYPART where, enum DAMTYPE damtype, enum INJUR
|
||||||
case IJ_WINGBLEED: desc = strdup("wings are bleeding^flying causes damage"); break;
|
case IJ_WINGBLEED: desc = strdup("wings are bleeding^flying causes damage"); break;
|
||||||
case IJ_LUNGCOLLAPSED: desc = strdup("lungs have collapsed^lose all stamina points"); break;
|
case IJ_LUNGCOLLAPSED: desc = strdup("lungs have collapsed^lose all stamina points"); break;
|
||||||
case IJ_HANDMISSING:
|
case IJ_HANDMISSING:
|
||||||
sprintf(buf, "%s is destroyed^cannot use this hand", getbodypartname(lf, bp2));
|
snprintf(buf, BUFLEN, "%s is destroyed^cannot use this hand", getbodypartname(lf, bp2));
|
||||||
desc = strdup(buf);
|
desc = strdup(buf);
|
||||||
break;
|
break;
|
||||||
case IJ_EARSRINGING: desc = strdup("ears are ringing^cannot hear sounds"); break;
|
case IJ_EARSRINGING: desc = strdup("ears are ringing^cannot hear sounds"); break;
|
||||||
|
@ -15996,7 +15997,7 @@ void addskillabil(enum SKILL id, enum SKILLLEVEL lev, enum OBTYPE abilid, int ti
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
ot = findot(abilid);
|
ot = findot(abilid);
|
||||||
assert(ot);
|
assert(ot);
|
||||||
sprintf(buf, "^gYou gain the '%s' ability.^n", ot->name);
|
snprintf(buf, BUFLEN, "^gYou gain the '%s' ability.^n", ot->name);
|
||||||
addskilldesc(sk->id, lev, buf, B_FALSE);
|
addskilldesc(sk->id, lev, buf, B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17266,7 +17267,7 @@ void autospells(lifeform_t *lf, int howmany) {
|
||||||
char pwbuf[BUFLEN];
|
char pwbuf[BUFLEN];
|
||||||
sel = rnd(0,nposs-1);
|
sel = rnd(0,nposs-1);
|
||||||
spellid = poss[sel];
|
spellid = poss[sel];
|
||||||
sprintf(pwbuf, "pw:%d;",powerposs[sel]);
|
snprintf(pwbuf, BUFLEN, "pw:%d;",powerposs[sel]);
|
||||||
//addflag(lf->flags, F_CANCAST, sel, NA, NA, pwbuf);
|
//addflag(lf->flags, F_CANCAST, sel, NA, NA, pwbuf);
|
||||||
addflag(lf->flags, F_CANCAST, spellid, NA, NA, pwbuf);
|
addflag(lf->flags, F_CANCAST, spellid, NA, NA, pwbuf);
|
||||||
// remove this one...
|
// remove this one...
|
||||||
|
@ -18261,23 +18262,23 @@ void losehpeffects(lifeform_t *lf, int dam, enum DAMTYPE damtype, lifeform_t *fr
|
||||||
// special cases
|
// special cases
|
||||||
if (lf->race->id == R_FUNGUSDREAM) {
|
if (lf->race->id == R_FUNGUSDREAM) {
|
||||||
char buf2[BUFLEN];
|
char buf2[BUFLEN];
|
||||||
sprintf(buf, "^w%s releases a cloud of purple spores!", lfname);
|
snprintf(buf, BUFLEN, "^w%s releases a cloud of purple spores!", lfname);
|
||||||
sprintf(buf2, "^wSomething releases a cloud of purple spores!");
|
snprintf(buf2, BUFLEN, "^wSomething releases a cloud of purple spores!");
|
||||||
spellcloud(lf->cell, 1, DT_COMPASS, UNI_SHADELIGHT, C_MAGENTA, OT_S_SLEEP, 8, B_TRUE, buf, buf2, B_FALSE, NULL, B_NOCENTRE);
|
spellcloud(lf->cell, 1, DT_COMPASS, UNI_SHADELIGHT, C_MAGENTA, OT_S_SLEEP, 8, B_TRUE, buf, buf2, B_FALSE, NULL, B_NOCENTRE);
|
||||||
} else if (lf->race->id == R_FUNGUSPETRIFY) {
|
} else if (lf->race->id == R_FUNGUSPETRIFY) {
|
||||||
char buf2[BUFLEN];
|
char buf2[BUFLEN];
|
||||||
sprintf(buf, "^w%s releases a cloud of grey spores!", lfname);
|
snprintf(buf, BUFLEN, "^w%s releases a cloud of grey spores!", lfname);
|
||||||
sprintf(buf2, "^wSomething releases a cloud of grey spores!");
|
snprintf(buf2, BUFLEN, "^wSomething releases a cloud of grey spores!");
|
||||||
spellcloud(lf->cell, 1, DT_COMPASS, UNI_SHADELIGHT, C_GREY, OT_S_PETRIFY, 5, B_TRUE, buf, buf2, B_FALSE, NULL, B_NOCENTRE);
|
spellcloud(lf->cell, 1, DT_COMPASS, UNI_SHADELIGHT, C_GREY, OT_S_PETRIFY, 5, B_TRUE, buf, buf2, B_FALSE, NULL, B_NOCENTRE);
|
||||||
} else if (lf->race->id == R_FUNGUSRAGE) {
|
} else if (lf->race->id == R_FUNGUSRAGE) {
|
||||||
char buf2[BUFLEN];
|
char buf2[BUFLEN];
|
||||||
sprintf(buf, "^w%s releases a cloud of red spores!", lfname);
|
snprintf(buf, BUFLEN, "^w%s releases a cloud of red spores!", lfname);
|
||||||
sprintf(buf2, "^wSomething releases a cloud of red spores!");
|
snprintf(buf2, BUFLEN, "^wSomething releases a cloud of red spores!");
|
||||||
spellcloud(lf->cell, 1, DT_COMPASS, UNI_SHADELIGHT, C_RED, OT_A_RAGE, 8, B_TRUE, buf, buf2, B_FALSE, NULL, B_NOCENTRE);
|
spellcloud(lf->cell, 1, DT_COMPASS, UNI_SHADELIGHT, C_RED, OT_A_RAGE, 8, B_TRUE, buf, buf2, B_FALSE, NULL, B_NOCENTRE);
|
||||||
} else if ((lf->race->id == R_UNYON) && ((damtype == DT_SLASH) || (damtype == DT_CHOP))) {
|
} else if ((lf->race->id == R_UNYON) && ((damtype == DT_SLASH) || (damtype == DT_CHOP))) {
|
||||||
char buf2[BUFLEN];
|
char buf2[BUFLEN];
|
||||||
sprintf(buf, "^w%s releases a cloud of fumes!", lfname);
|
snprintf(buf, BUFLEN, "^w%s releases a cloud of fumes!", lfname);
|
||||||
sprintf(buf2, "^wSomething releases a cloud of fumes!");
|
snprintf(buf2, BUFLEN, "^wSomething releases a cloud of fumes!");
|
||||||
spellcloud(lf->cell, 2, DT_ORTH, UNI_SHADELIGHT, C_GREY, OT_S_BLINDNESS, 8, B_TRUE, buf, buf2, B_TRUE, NULL, B_NOCENTRE);
|
spellcloud(lf->cell, 2, DT_ORTH, UNI_SHADELIGHT, C_GREY, OT_S_BLINDNESS, 8, B_TRUE, buf, buf2, B_TRUE, NULL, B_NOCENTRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18668,7 +18669,7 @@ void makecommslist(prompt_t *p, lifeform_t *lf, int multiple) {
|
||||||
if (godstone) {
|
if (godstone) {
|
||||||
char buf[BUFLEN],obname[BUFLEN];
|
char buf[BUFLEN],obname[BUFLEN];
|
||||||
getobname(godstone, obname, 1);
|
getobname(godstone, obname, 1);
|
||||||
sprintf(buf, "(offer %s)", obname);
|
snprintf(buf, BUFLEN, "(offer %s)", obname);
|
||||||
if (!haschoice(p, 'o')) addchoice(p, 'o', buf, NULL, NULL, NULL);
|
if (!haschoice(p, 'o')) addchoice(p, 'o', buf, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -18868,7 +18869,7 @@ void mayusespellschool(flagpile_t *fp, enum SPELLSCHOOL ss, enum FLAG how, int o
|
||||||
if (!hasflagval(fp, how, ot->id, NA, NA, NULL)) {
|
if (!hasflagval(fp, how, ot->id, NA, NA, NULL)) {
|
||||||
char text[BUFLEN];
|
char text[BUFLEN];
|
||||||
if (overridepower) {
|
if (overridepower) {
|
||||||
sprintf(text, "pw:%d;",overridepower);
|
snprintf(text, BUFLEN, "pw:%d;",overridepower);
|
||||||
} else {
|
} else {
|
||||||
strcpy(text, "");
|
strcpy(text, "");
|
||||||
}
|
}
|
||||||
|
@ -19565,13 +19566,13 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nclass, int volume,
|
||||||
// "you hear [a muffled xxx]"
|
// "you hear [a muffled xxx]"
|
||||||
p = strstartswitha(text, prefix);
|
p = strstartswitha(text, prefix);
|
||||||
if (p) {
|
if (p) {
|
||||||
sprintf(localtext, "%smuffled %s", prefix, p);
|
snprintf(localtext, BUFLEN, "%smuffled %s", prefix, p);
|
||||||
} else {
|
} else {
|
||||||
// "you hear [xxx]"
|
// "you hear [xxx]"
|
||||||
// becomes:
|
// becomes:
|
||||||
// "you hear muffled [xxx]"
|
// "you hear muffled [xxx]"
|
||||||
//
|
//
|
||||||
sprintf(localtext, "muffled %s", text);
|
snprintf(localtext, BUFLEN, "muffled %s", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -19951,7 +19952,7 @@ int pickup(lifeform_t *lf, object_t *what, int howmany, int fromground, int want
|
||||||
for (i = 0 ; i < nretgods; i++) {
|
for (i = 0 ; i < nretgods; i++) {
|
||||||
if (lfhasflagval(retgod[i], F_GODPOISON, B_FALSE, NA, NA, NULL)) {
|
if (lfhasflagval(retgod[i], F_GODPOISON, B_FALSE, NA, NA, NULL)) {
|
||||||
char warnbuf[BUFLEN];
|
char warnbuf[BUFLEN];
|
||||||
sprintf(warnbuf, "I hope you're not planning on using %s...", (o->amt == 1) ? "that" : "those");
|
snprintf(warnbuf, BUFLEN, "I hope you're not planning on using %s...", (o->amt == 1) ? "that" : "those");
|
||||||
godsay(retgod[i]->race->id, B_TRUE, warnbuf);
|
godsay(retgod[i]->race->id, B_TRUE, warnbuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -20070,7 +20071,7 @@ int poison(lifeform_t *lf, int howlong, enum POISONTYPE ptype, int power, char *
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char ftext[BUFLEN];
|
char ftext[BUFLEN];
|
||||||
sprintf(ftext, "%d^%s", power, fromwhat);
|
snprintf(ftext, BUFLEN, "%d^%s", power, fromwhat);
|
||||||
ii = addflag(lf->flags, F_INCUBATING, ptype, pt->incubationtime, howlong, ftext);
|
ii = addflag(lf->flags, F_INCUBATING, ptype, pt->incubationtime, howlong, ftext);
|
||||||
ii->obfrom = srcrace ? srcrace->id : NA;
|
ii->obfrom = srcrace ? srcrace->id : NA;
|
||||||
if (getskill(lf, SK_FIRSTAID) >= PR_BEGINNER) {
|
if (getskill(lf, SK_FIRSTAID) >= PR_BEGINNER) {
|
||||||
|
@ -20853,7 +20854,7 @@ int startclimbing(lifeform_t *lf) {
|
||||||
// ability (which you need the skill to get).
|
// ability (which you need the skill to get).
|
||||||
if (pit && isplayer(lf)) {
|
if (pit && isplayer(lf)) {
|
||||||
char ques[BUFLEN], ch;
|
char ques[BUFLEN], ch;
|
||||||
sprintf(ques, "Climb down %s?",pitname);
|
snprintf(ques, BUFLEN, "Climb down %s?",pitname);
|
||||||
|
|
||||||
ch = askchar(ques, "yn","n", B_TRUE, B_FALSE);
|
ch = askchar(ques, "yn","n", B_TRUE, B_FALSE);
|
||||||
if (ch != 'y') {
|
if (ch != 'y') {
|
||||||
|
@ -22042,7 +22043,7 @@ void setrace(lifeform_t *lf, enum RACE rid, int frompolymorph) {
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
msg("^%cYou have gained control of your lycanthropy.", getlfcol(lf, CC_GOOD));
|
msg("^%cYou have gained control of your lycanthropy.", getlfcol(lf, CC_GOOD));
|
||||||
}
|
}
|
||||||
sprintf(cwtext, "pw:1;race:%s;", lf->race->name);
|
snprintf(cwtext, BUFLEN, "pw:1;race:%s;", lf->race->name);
|
||||||
addtempflag(lf->flags, F_CANWILL, OT_S_SHAPESHIFT, NA, NA, cwtext, FROMLYCANTHROPY);
|
addtempflag(lf->flags, F_CANWILL, OT_S_SHAPESHIFT, NA, NA, cwtext, FROMLYCANTHROPY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23157,7 +23158,7 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(dbtag, "[lfid %d (%s) %s check] ",lf->id, lf->race->name, getskillcheckname(ct));
|
snprintf(dbtag, BUFLEN, "[lfid %d (%s) %s check] ",lf->id, lf->race->name, getskillcheckname(ct));
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// debugging for new skillcheck code
|
// debugging for new skillcheck code
|
||||||
|
@ -23277,9 +23278,9 @@ int slipon(lifeform_t *lf, object_t *o) {
|
||||||
char onwhat[BUFLEN];
|
char onwhat[BUFLEN];
|
||||||
char damstring[BUFLEN];
|
char damstring[BUFLEN];
|
||||||
if (o) {
|
if (o) {
|
||||||
sprintf(onwhat, "%s", obname);
|
snprintf(onwhat, BUFLEN, "%s", obname);
|
||||||
} else {
|
} else {
|
||||||
sprintf(onwhat, "the %s", lf->cell->type->name);
|
snprintf(onwhat, BUFLEN, "the %s", lf->cell->type->name);
|
||||||
}
|
}
|
||||||
msg("%s slip%s on %s and fall%s to the ground.",lfname, isplayer(lf) ? "" : "s", onwhat,
|
msg("%s slip%s on %s and fall%s to the ground.",lfname, isplayer(lf) ? "" : "s", onwhat,
|
||||||
isplayer(lf) ? "" : "s");
|
isplayer(lf) ? "" : "s");
|
||||||
|
@ -23417,13 +23418,13 @@ int statdrain(lifeform_t *lf, enum ATTRIB attr, int amt, enum CHECKTYPE sctype,
|
||||||
if (fromlf) {
|
if (fromlf) {
|
||||||
char lfname[BUFLEN];
|
char lfname[BUFLEN];
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%s-drained",getattrname(attr));
|
snprintf(buf, BUFLEN, "%s-drained",getattrname(attr));
|
||||||
setkillverb(lf, buf);
|
setkillverb(lf, buf);
|
||||||
real_getlfnamea(fromlf, lfname, NULL, B_TRUE, B_TRUE);
|
real_getlfnamea(fromlf, lfname, NULL, B_TRUE, B_TRUE);
|
||||||
setlastdam(lf, lfname);
|
setlastdam(lf, lfname);
|
||||||
} else {
|
} else {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%s drain",getattrname(attr));
|
snprintf(buf, BUFLEN, "%s drain",getattrname(attr));
|
||||||
setkillverb(lf, "Killed");
|
setkillverb(lf, "Killed");
|
||||||
setlastdam(lf, buf);
|
setlastdam(lf, buf);
|
||||||
}
|
}
|
||||||
|
@ -24383,7 +24384,7 @@ void startlfturn(lifeform_t *lf) {
|
||||||
if ((e == E_AVOIDOB) && rdata) {
|
if ((e == E_AVOIDOB) && rdata) {
|
||||||
getobname(avoidob, fromx, avoidob->amt);
|
getobname(avoidob, fromx, avoidob->amt);
|
||||||
} else {
|
} else {
|
||||||
sprintf(fromx, "danger");
|
snprintf(fromx, BUFLEN, "danger");
|
||||||
}
|
}
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
msg("You reflexively dodge away from %s!", fromx);
|
msg("You reflexively dodge away from %s!", fromx);
|
||||||
|
@ -24408,7 +24409,7 @@ void startlfturn(lifeform_t *lf) {
|
||||||
for (a = 0; a < MAXATTS; a++) {
|
for (a = 0; a < MAXATTS; a++) {
|
||||||
if ((lf->baseatt[a] > 0) && (getattr(lf, a) <= 0)) {
|
if ((lf->baseatt[a] > 0) && (getattr(lf, a) <= 0)) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%s drain",getattrname(a));
|
snprintf(buf, BUFLEN, "%s drain",getattrname(a));
|
||||||
setkillverb(lf, "Killed");
|
setkillverb(lf, "Killed");
|
||||||
setlastdam(lf, buf);
|
setlastdam(lf, buf);
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
|
@ -24492,7 +24493,7 @@ void startlfturn(lifeform_t *lf) {
|
||||||
char *p;
|
char *p;
|
||||||
char lfname[BUFLEN],lfnameposs[BUFLEN];
|
char lfname[BUFLEN],lfnameposs[BUFLEN];
|
||||||
getlfname(lf, lfname);
|
getlfname(lf, lfname);
|
||||||
sprintf(lfnameposs, "%s%s",lfname, getpossessive(lfname));
|
snprintf(lfnameposs, BUFLEN, "%s%s",lfname, getpossessive(lfname));
|
||||||
|
|
||||||
p = strdup(pt->damverb);
|
p = strdup(pt->damverb);
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
|
@ -24507,7 +24508,7 @@ void startlfturn(lifeform_t *lf) {
|
||||||
strrep(&p, "YOUR", lfnameposs, NULL);
|
strrep(&p, "YOUR", lfnameposs, NULL);
|
||||||
if (asleep) {
|
if (asleep) {
|
||||||
char replacetext[BUFLEN];
|
char replacetext[BUFLEN];
|
||||||
sprintf(replacetext, "%s wakes and", lfname);
|
snprintf(replacetext, BUFLEN, "%s wakes and", lfname);
|
||||||
strrep(&p, "YOU", replacetext, NULL);
|
strrep(&p, "YOU", replacetext, NULL);
|
||||||
} else {
|
} else {
|
||||||
strrep(&p, "YOU", lfname, NULL);
|
strrep(&p, "YOU", lfname, NULL);
|
||||||
|
@ -24838,7 +24839,7 @@ void startlfturn(lifeform_t *lf) {
|
||||||
limit(&dam, 1, NA);
|
limit(&dam, 1, NA);
|
||||||
|
|
||||||
getobnametruebase(o, obname, o->amt);
|
getobnametruebase(o, obname, o->amt);
|
||||||
sprintf(damstring, "light from %s", obname);
|
snprintf(damstring, BUFLEN, "light from %s", obname);
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
msg("Your head explodes in pain at the light from %s!", obname);
|
msg("Your head explodes in pain at the light from %s!", obname);
|
||||||
}
|
}
|
||||||
|
@ -24899,7 +24900,7 @@ void startlfturn(lifeform_t *lf) {
|
||||||
case DT_WATER:
|
case DT_WATER:
|
||||||
if ((bp == BP_FEET) && isplayer(lf) && hasbp(lf, bp)) {
|
if ((bp == BP_FEET) && isplayer(lf) && hasbp(lf, bp)) {
|
||||||
char warntext[BUFLEN];
|
char warntext[BUFLEN];
|
||||||
sprintf(warntext,"Your %s get wet.", getbodypartname(lf, bp));
|
snprintf(warntext, BUFLEN,"Your %s get wet.", getbodypartname(lf, bp));
|
||||||
// only announce this if you've had a turn
|
// only announce this if you've had a turn
|
||||||
// without your feet wet.
|
// without your feet wet.
|
||||||
real_warnabout(warntext, 2, B_FALSE);
|
real_warnabout(warntext, 2, B_FALSE);
|
||||||
|
@ -25876,19 +25877,19 @@ int tradeknowledge(lifeform_t *lf) {
|
||||||
// fromplayer^toplayer
|
// fromplayer^toplayer
|
||||||
gettradeinfoname(fromplayer, fromplayertype, fromplayertext);
|
gettradeinfoname(fromplayer, fromplayertype, fromplayertext);
|
||||||
gettradeinfoname(toplayer, toplayertype, toplayertext);
|
gettradeinfoname(toplayer, toplayertype, toplayertext);
|
||||||
sprintf(tradetext, "%s^%s",fromplayertext,toplayertext);
|
snprintf(tradetext, BUFLEN, "%s^%s",fromplayertext,toplayertext);
|
||||||
|
|
||||||
sayphrase(lf, SP_TRADEINFO_ACCEPT, SV_TALK, NA, tradetext, player);
|
sayphrase(lf, SP_TRADEINFO_ACCEPT, SV_TALK, NA, tradetext, player);
|
||||||
more();
|
more();
|
||||||
// confirm.
|
// confirm.
|
||||||
sprintf(buf, "Learn %s from %s", toplayertext, lfname);
|
snprintf(buf, BUFLEN, "Learn %s from %s", toplayertext, lfname);
|
||||||
ch = askchar(buf, "yn","y", B_TRUE, B_FALSE);
|
ch = askchar(buf, "yn","y", B_TRUE, B_FALSE);
|
||||||
if (ch == 'y') {
|
if (ch == 'y') {
|
||||||
// lf learns skill
|
// lf learns skill
|
||||||
if (fromplayertype == TI_SKILL) {
|
if (fromplayertype == TI_SKILL) {
|
||||||
giveskill(lf, fromplayer);
|
giveskill(lf, fromplayer);
|
||||||
} else { // ie. spell
|
} else { // ie. spell
|
||||||
sprintf(buf, "pw:%d;", getspellpower(lf, fromplayer));
|
snprintf(buf, BUFLEN, "pw:%d;", getspellpower(lf, fromplayer));
|
||||||
addflag(lf->flags, F_CANCAST, fromplayer, NA, NA, buf);
|
addflag(lf->flags, F_CANCAST, fromplayer, NA, NA, buf);
|
||||||
}
|
}
|
||||||
// player learns skill
|
// player learns skill
|
||||||
|
@ -26108,7 +26109,7 @@ int real_touch(lifeform_t *lf, object_t *o, int onpurpose) {
|
||||||
msg("^%cThe %s%s %s burns %s!", getlfcol(lf, CC_BAD),
|
msg("^%cThe %s%s %s burns %s!", getlfcol(lf, CC_BAD),
|
||||||
obname, getpossessive(obname), o->material->name);
|
obname, getpossessive(obname), o->material->name);
|
||||||
}
|
}
|
||||||
sprintf(buf, "the touch of %s", o->material->name);
|
snprintf(buf, BUFLEN, "the touch of %s", o->material->name);
|
||||||
losehp(lf, f->val[2], DT_DIRECT, NULL, buf);
|
losehp(lf, f->val[2], DT_DIRECT, NULL, buf);
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -26173,7 +26174,7 @@ int real_touch(lifeform_t *lf, object_t *o, int onpurpose) {
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
if (equipped) {
|
if (equipped) {
|
||||||
char burnbuf[BUFLEN];
|
char burnbuf[BUFLEN];
|
||||||
sprintf(burnbuf, "%s burns you!", obname);
|
snprintf(burnbuf, BUFLEN, "%s burns you!", obname);
|
||||||
capitalise(burnbuf);
|
capitalise(burnbuf);
|
||||||
msg("^b%s",burnbuf);
|
msg("^b%s",burnbuf);
|
||||||
} else {
|
} else {
|
||||||
|
@ -26520,7 +26521,7 @@ int usestairs(lifeform_t *lf, object_t *o, int onpurpose, int climb) {
|
||||||
if (key) {
|
if (key) {
|
||||||
char ques[BUFLEN],obname[BUFLEN],ch;
|
char ques[BUFLEN],obname[BUFLEN],ch;
|
||||||
getobname(key, obname, 1);
|
getobname(key, obname, 1);
|
||||||
sprintf(ques,"Use your %s to open it?", noprefix(obname));
|
snprintf(ques, BUFLEN,"Use your %s to open it?", noprefix(obname));
|
||||||
ch = askchar(ques,"yn","n", B_TRUE, B_FALSE);
|
ch = askchar(ques,"yn","n", B_TRUE, B_FALSE);
|
||||||
if (ch == 'y') {
|
if (ch == 'y') {
|
||||||
operate(lf, key, lf->cell);
|
operate(lf, key, lf->cell);
|
||||||
|
@ -27844,7 +27845,7 @@ int wear(lifeform_t *lf, object_t *o) {
|
||||||
}
|
}
|
||||||
if (protect) {
|
if (protect) {
|
||||||
char ques[BUFLEN],ch;
|
char ques[BUFLEN],ch;
|
||||||
sprintf(ques,"Still put on %s?",obname);
|
snprintf(ques, BUFLEN,"Still put on %s?",obname);
|
||||||
ch = askchar(ques,"yn","n", B_TRUE, B_FALSE);
|
ch = askchar(ques,"yn","n", B_TRUE, B_FALSE);
|
||||||
if (ch != 'y') {
|
if (ch != 'y') {
|
||||||
msg("Cancelled.");
|
msg("Cancelled.");
|
||||||
|
|
2
map.c
2
map.c
|
@ -4819,7 +4819,7 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex
|
||||||
snprintf(buf, BUFLEN, "%s (id #%d)",buf2, map->id);
|
snprintf(buf, BUFLEN, "%s (id #%d)",buf2, map->id);
|
||||||
map->name = strdup(buf);
|
map->name = strdup(buf);
|
||||||
|
|
||||||
sprintf(dbbuf, "%s -about to check outline",dbtag);
|
snprintf(dbbuf, BUFLEN, "%s -about to check outline",dbtag);
|
||||||
dblog(dbbuf);
|
dblog(dbbuf);
|
||||||
|
|
||||||
// get a list of what things are here based on the region's outline
|
// get a list of what things are here based on the region's outline
|
||||||
|
|
8
move.c
8
move.c
|
@ -2251,7 +2251,7 @@ int opendoor(lifeform_t *lf, object_t *o) {
|
||||||
msg("%s bursts open!",obname);
|
msg("%s bursts open!",obname);
|
||||||
} else {
|
} else {
|
||||||
char noisebuf[BUFLEN];
|
char noisebuf[BUFLEN];
|
||||||
sprintf(noisebuf, "%s bursting open!", obname);
|
snprintf(noisebuf, BUFLEN, "%s bursting open!", obname);
|
||||||
noise(doorcell, NULL, NC_OTHER, SV_CAR, noisebuf, NULL);
|
noise(doorcell, NULL, NC_OTHER, SV_CAR, noisebuf, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2268,7 +2268,7 @@ int opendoor(lifeform_t *lf, object_t *o) {
|
||||||
msg("%s opens.",obname);
|
msg("%s opens.",obname);
|
||||||
} else {
|
} else {
|
||||||
char noisebuf[BUFLEN];
|
char noisebuf[BUFLEN];
|
||||||
sprintf(noisebuf, "%s opening.", obname);
|
snprintf(noisebuf, BUFLEN, "%s opening.", obname);
|
||||||
noise(doorcell, NULL, NC_OTHER, SV_TALK, noisebuf, NULL);
|
noise(doorcell, NULL, NC_OTHER, SV_TALK, noisebuf, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3127,7 +3127,7 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) {
|
||||||
if (cansee(l, lf)) {
|
if (cansee(l, lf)) {
|
||||||
char dirbuf[BUFLEN];
|
char dirbuf[BUFLEN];
|
||||||
// update text field
|
// update text field
|
||||||
sprintf(dirbuf, "%d", dir);
|
snprintf(dirbuf, BUFLEN, "%d", dir);
|
||||||
changeflagtext(tf, dirbuf);
|
changeflagtext(tf, dirbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3468,7 +3468,7 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) {
|
||||||
} else {
|
} else {
|
||||||
strcpy(obname, "something");
|
strcpy(obname, "something");
|
||||||
}
|
}
|
||||||
sprintf(text, "There is %s in your way.",obname);
|
snprintf(text, BUFLEN, "There is %s in your way.",obname);
|
||||||
msg("There is %s in your way.",obname);
|
msg("There is %s in your way.",obname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
nexus.c
32
nexus.c
|
@ -323,9 +323,9 @@ int main(int argc, char **argv) {
|
||||||
if (!hasflag(j->flags, F_NOPLAYER)) {
|
if (!hasflag(j->flags, F_NOPLAYER)) {
|
||||||
// letter isn't used
|
// letter isn't used
|
||||||
if (j->id == J_GOD) {
|
if (j->id == J_GOD) {
|
||||||
sprintf(buf, "%-20s(%s)", "Diety", "for debugging");
|
snprintf(buf, BUFLEN, "%-20s(%s)", "Diety", "for debugging");
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%-20s(%s)", j->name, getjobcatname(j->category));
|
snprintf(buf, BUFLEN, "%-20s(%s)", j->name, getjobcatname(j->category));
|
||||||
}
|
}
|
||||||
addchoice(&prompt, '-', buf, NULL, j, longdesc);
|
addchoice(&prompt, '-', buf, NULL, j, longdesc);
|
||||||
}
|
}
|
||||||
|
@ -616,11 +616,11 @@ int main(int argc, char **argv) {
|
||||||
textwithcol(mainwin, "Your starting spells are:\n");
|
textwithcol(mainwin, "Your starting spells are:\n");
|
||||||
first = B_FALSE;
|
first = B_FALSE;
|
||||||
}
|
}
|
||||||
sprintf(buf, " - %-20s (%s", sp->name, getschoolname(getspellschoolknown(player, sp->id)) );
|
snprintf(buf, BUFLEN, " - %-20s (%s", sp->name, getschoolname(getspellschoolknown(player, sp->id)) );
|
||||||
if (order[n] == FROMRACE) {
|
if (order[n] == FROMRACE) {
|
||||||
char rname[BUFLEN];
|
char rname[BUFLEN];
|
||||||
strcat(buf, ", ^g");
|
strcat(buf, ", ^g");
|
||||||
sprintf(rname, "%s", player->race->name);
|
snprintf(rname, BUFLEN, "%s", player->race->name);
|
||||||
capitalise(rname);
|
capitalise(rname);
|
||||||
strcat(buf, rname);
|
strcat(buf, rname);
|
||||||
strcat(buf, " perk^n");
|
strcat(buf, " perk^n");
|
||||||
|
@ -668,12 +668,12 @@ int main(int argc, char **argv) {
|
||||||
textwithcol(mainwin, "Your unique starting abilities are:\n");
|
textwithcol(mainwin, "Your unique starting abilities are:\n");
|
||||||
first = B_FALSE;
|
first = B_FALSE;
|
||||||
}
|
}
|
||||||
sprintf(buf, " - %-20s", sp->name);
|
snprintf(buf, BUFLEN, " - %-20s", sp->name);
|
||||||
if (order[n] == FROMRACE) {
|
if (order[n] == FROMRACE) {
|
||||||
char rname[BUFLEN];
|
char rname[BUFLEN];
|
||||||
strcat(buf, " (^g");
|
strcat(buf, " (^g");
|
||||||
|
|
||||||
sprintf(rname, "%s", player->race->name);
|
snprintf(rname, BUFLEN, "%s", player->race->name);
|
||||||
capitalise(rname);
|
capitalise(rname);
|
||||||
strcat(buf, rname);
|
strcat(buf, rname);
|
||||||
|
|
||||||
|
@ -1297,7 +1297,7 @@ void donextturn(map_t *map) {
|
||||||
char ques[BUFLEN],obname[BUFLEN];
|
char ques[BUFLEN],obname[BUFLEN];
|
||||||
char ch;
|
char ch;
|
||||||
getobname(o, obname, 1);
|
getobname(o, obname, 1);
|
||||||
sprintf(ques, "%s has gone bad - stop eating?", obname);
|
snprintf(ques, BUFLEN, "%s has gone bad - stop eating?", obname);
|
||||||
ch = askchar(ques, "yn", "y", B_TRUE, B_FALSE);
|
ch = askchar(ques, "yn", "y", B_TRUE, B_FALSE);
|
||||||
if (ch == 'y') {
|
if (ch == 'y') {
|
||||||
killflag(f);
|
killflag(f);
|
||||||
|
@ -1605,8 +1605,8 @@ char getpctletter(float num, float max) {
|
||||||
int init(void) {
|
int init(void) {
|
||||||
int i;
|
int i;
|
||||||
// random numbers
|
// random numbers
|
||||||
//srand(time(NULL));
|
srand(time(NULL));
|
||||||
sranddev();
|
//sranddev();
|
||||||
|
|
||||||
// preset conditions
|
// preset conditions
|
||||||
initcondv(&ccwalkable, CC_WALKABLE, B_TRUE, NA,
|
initcondv(&ccwalkable, CC_WALKABLE, B_TRUE, NA,
|
||||||
|
@ -2403,19 +2403,19 @@ void timeeffectsworld(map_t *map, int updategametime) {
|
||||||
if (h == 6) {
|
if (h == 6) {
|
||||||
char text[BUFLEN];
|
char text[BUFLEN];
|
||||||
switch (rnd(1,4)) {
|
switch (rnd(1,4)) {
|
||||||
case 1: sprintf(text, "The hour of Glorana's Peace is here."); break;
|
case 1: snprintf(text, BUFLEN, "The hour of Glorana's Peace is here."); break;
|
||||||
case 2: sprintf(text, "Mortal, rejoice in the hour of Glorana's Peace!"); break;
|
case 2: snprintf(text, BUFLEN, "Mortal, rejoice in the hour of Glorana's Peace!"); break;
|
||||||
case 3: sprintf(text, "Now is the time of Glorana's Peace."); break;
|
case 3: snprintf(text, BUFLEN, "Now is the time of Glorana's Peace."); break;
|
||||||
case 4: sprintf(text, "Be healed my child - Glorana's Peace is upon you."); break;
|
case 4: snprintf(text, BUFLEN, "Be healed my child - Glorana's Peace is upon you."); break;
|
||||||
}
|
}
|
||||||
godsay(R_GODLIFE, B_TRUE, text);
|
godsay(R_GODLIFE, B_TRUE, text);
|
||||||
more();
|
more();
|
||||||
} else if (h == 7) {
|
} else if (h == 7) {
|
||||||
char text[BUFLEN];
|
char text[BUFLEN];
|
||||||
switch (rnd(1,3)) {
|
switch (rnd(1,3)) {
|
||||||
case 1: sprintf(text, "Glorana's Peace has come to an end for today."); break;
|
case 1: snprintf(text, BUFLEN, "Glorana's Peace has come to an end for today."); break;
|
||||||
case 2: sprintf(text, "...and so ends Glorana's Peace."); break;
|
case 2: snprintf(text, BUFLEN, "...and so ends Glorana's Peace."); break;
|
||||||
case 3: sprintf(text, "I declare Glorana's Peace ended."); break;
|
case 3: snprintf(text, BUFLEN, "I declare Glorana's Peace ended."); break;
|
||||||
}
|
}
|
||||||
godsay(R_GODLIFE, B_TRUE, text);
|
godsay(R_GODLIFE, B_TRUE, text);
|
||||||
more();
|
more();
|
||||||
|
|
68
objects.c
68
objects.c
|
@ -751,7 +751,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
||||||
// now replace the end of the string.
|
// now replace the end of the string.
|
||||||
// initially we'll have (eg) 'splash of xxx blood'
|
// initially we'll have (eg) 'splash of xxx blood'
|
||||||
// change it to 'splash of blood'
|
// change it to 'splash of blood'
|
||||||
sprintf(replacefrom, "%s blood", r->name);
|
snprintf(replacefrom, BUFLEN, "%s blood", r->name);
|
||||||
|
|
||||||
pp = strstr(p, replacefrom);
|
pp = strstr(p, replacefrom);
|
||||||
assert(pp);
|
assert(pp);
|
||||||
|
@ -985,7 +985,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
||||||
char *p2;
|
char *p2;
|
||||||
objecttype_t *pot;
|
objecttype_t *pot;
|
||||||
p2 = p + strlen("fountain of ");
|
p2 = p + strlen("fountain of ");
|
||||||
sprintf(potname, "potion of %s", p2);
|
snprintf(potname, BUFLEN, "potion of %s", p2);
|
||||||
pot = findotn(potname);
|
pot = findotn(potname);
|
||||||
wantfountaintype = pot->id;
|
wantfountaintype = pot->id;
|
||||||
ot = findot(OT_FOUNTAIN);
|
ot = findot(OT_FOUNTAIN);
|
||||||
|
@ -1825,7 +1825,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
||||||
|
|
||||||
if (ammotype && (ammoamt > 0)) {
|
if (ammotype && (ammoamt > 0)) {
|
||||||
char ammostring[BUFLEN];
|
char ammostring[BUFLEN];
|
||||||
sprintf(ammostring, "%d %s",ammoamt,ammotype->name);
|
snprintf(ammostring, BUFLEN, "%d %s",ammoamt,ammotype->name);
|
||||||
addob(o->contents, ammostring);
|
addob(o->contents, ammostring);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3162,7 +3162,7 @@ void brightflash(cell_t *centre, int range, lifeform_t *immunelf) {
|
||||||
cell_t *c;
|
cell_t *c;
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
|
|
||||||
sprintf(buf, "You see an intense flash of light!");
|
snprintf(buf, BUFLEN, "You see an intense flash of light!");
|
||||||
animradial(centre, range, '}', DT_ORTH, C_WHITE, buf, buf);
|
animradial(centre, range, '}', DT_ORTH, C_WHITE, buf, buf);
|
||||||
|
|
||||||
// blind monsters
|
// blind monsters
|
||||||
|
@ -4430,14 +4430,14 @@ void gencontainercontents(object_t *o) {
|
||||||
case CC_CORPSE:
|
case CC_CORPSE:
|
||||||
r = getrandomraceofsize(getobsize(o));
|
r = getrandomraceofsize(getobsize(o));
|
||||||
if (r) {
|
if (r) {
|
||||||
sprintf(buf, "%s corpse", r->name);
|
snprintf(buf, BUFLEN, "%s corpse", r->name);
|
||||||
addflag(o->flags, F_STARTOB, 100, NA, NA, buf);
|
addflag(o->flags, F_STARTOB, 100, NA, NA, buf);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CC_CONDIMENTS:
|
case CC_CONDIMENTS:
|
||||||
switch (rnd(1,2)) {
|
switch (rnd(1,2)) {
|
||||||
default: case 1: sprintf(buf, "pinch of salt"); break;
|
default: case 1: snprintf(buf, BUFLEN, "pinch of salt"); break;
|
||||||
case 2: sprintf(buf, "lump of sugar"); break;
|
case 2: snprintf(buf, BUFLEN, "lump of sugar"); break;
|
||||||
}
|
}
|
||||||
addflag(o->flags, F_STARTOB, 100, 10, 20, buf);
|
addflag(o->flags, F_STARTOB, 100, 10, 20, buf);
|
||||||
break;
|
break;
|
||||||
|
@ -4711,7 +4711,7 @@ int getbreakob(object_t *o, char **breakobname, int *nbreakobs) {
|
||||||
for (i = 0; i < *nbreakobs; i++) {
|
for (i = 0; i < *nbreakobs; i++) {
|
||||||
if (nobs[i] > 0) {
|
if (nobs[i] > 0) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%d %s", nobs[i], breakob[i]->name);
|
snprintf(buf, BUFLEN, "%d %s", nobs[i], breakob[i]->name);
|
||||||
breakobname[i] = strdup(buf);
|
breakobname[i] = strdup(buf);
|
||||||
} else {
|
} else {
|
||||||
breakobname[i] = NULL;
|
breakobname[i] = NULL;
|
||||||
|
@ -5931,7 +5931,7 @@ char *getobdesc(object_t *o, char *buf) {
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf, BUFLEN, "%s", o->type->desc);
|
snprintf(buf, BUFLEN, "%s", o->type->desc);
|
||||||
}
|
}
|
||||||
} else if (o->type->id == OC_SCROLL) {
|
} else if (o->type->obclass->id == OC_SCROLL) {
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
f = hasflag(o->flags, F_LINKSPELL);
|
f = hasflag(o->flags, F_LINKSPELL);
|
||||||
if (f) {
|
if (f) {
|
||||||
|
@ -6295,16 +6295,16 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan
|
||||||
f = hasflag(o->flags, F_LINKGOD);
|
f = hasflag(o->flags, F_LINKGOD);
|
||||||
if (f) god = findgod(f->val[0]);
|
if (f) god = findgod(f->val[0]);
|
||||||
if (god) {
|
if (god) {
|
||||||
sprintf(basename, "temple of %s", god->race->name);
|
snprintf(basename, BUFLEN, "temple of %s", god->race->name);
|
||||||
} else {
|
} else {
|
||||||
sprintf(basename, "abandoned temple");
|
snprintf(basename, BUFLEN, "abandoned temple");
|
||||||
}
|
}
|
||||||
} else if ((o->type->id == OT_BLOODSPLASH) || (o->type->id == OT_BLOODPOOL)) {
|
} else if ((o->type->id == OT_BLOODSPLASH) || (o->type->id == OT_BLOODPOOL)) {
|
||||||
race_t *brace = NULL;
|
race_t *brace = NULL;
|
||||||
enum SKILLLEVEL lorelev = PR_INEPT;
|
enum SKILLLEVEL lorelev = PR_INEPT;
|
||||||
char *p,xblood[BUFLEN];
|
char *p,xblood[BUFLEN];
|
||||||
if (countflagsofid(o->flags, F_LINKRACE) > 1) {
|
if (countflagsofid(o->flags, F_LINKRACE) > 1) {
|
||||||
sprintf(xblood, "mixed blood");
|
snprintf(xblood, BUFLEN, "mixed blood");
|
||||||
} else {
|
} else {
|
||||||
// you might recognise the type of blood
|
// you might recognise the type of blood
|
||||||
f = hasflag(o->flags, F_LINKRACE);
|
f = hasflag(o->flags, F_LINKRACE);
|
||||||
|
@ -6313,9 +6313,9 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan
|
||||||
if (brace) lorelev = getlorelevel(player, brace->raceclass->id);
|
if (brace) lorelev = getlorelevel(player, brace->raceclass->id);
|
||||||
}
|
}
|
||||||
if (brace && (lorelev >= PR_BEGINNER)) {
|
if (brace && (lorelev >= PR_BEGINNER)) {
|
||||||
sprintf(xblood, "%s blood", brace->name);
|
snprintf(xblood, BUFLEN, "%s blood", brace->name);
|
||||||
} else {
|
} else {
|
||||||
sprintf(xblood, "unidentifiable blood");
|
snprintf(xblood, BUFLEN, "unidentifiable blood");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p = strdup(o->type->name);
|
p = strdup(o->type->name);
|
||||||
|
@ -6355,7 +6355,7 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan
|
||||||
// check F_NAME field
|
// check F_NAME field
|
||||||
f = hasflag(o->flags, F_NAME);
|
f = hasflag(o->flags, F_NAME);
|
||||||
if (f) {
|
if (f) {
|
||||||
sprintf(basename, "%s%s grimoire", f->text, getpossessive(f->text));
|
snprintf(basename, BUFLEN, "%s%s grimoire", f->text, getpossessive(f->text));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
f = hasflag(o->flags, F_MANUALOF);
|
f = hasflag(o->flags, F_MANUALOF);
|
||||||
|
@ -6544,7 +6544,7 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan
|
||||||
}
|
}
|
||||||
if (strlen(sizetext)) {
|
if (strlen(sizetext)) {
|
||||||
char newname[BUFLEN];
|
char newname[BUFLEN];
|
||||||
sprintf(newname, "%s %s", sizetext, basename);
|
snprintf(newname, BUFLEN, "%s %s", sizetext, basename);
|
||||||
strcpy(basename, newname);
|
strcpy(basename, newname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7240,7 +7240,7 @@ objecttype_t *real_getrandomob(cell_t *cell, char *buf, int forcedepth, int forc
|
||||||
}
|
}
|
||||||
assert(nposs > 0);
|
assert(nposs > 0);
|
||||||
selot = poss[rnd(0,nposs-1)];
|
selot = poss[rnd(0,nposs-1)];
|
||||||
sprintf(buf, "%s", selot->name);
|
snprintf(buf, BUFLEN, "%s", selot->name);
|
||||||
return selot;
|
return selot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10679,7 +10679,7 @@ int obsfallthrough(cell_t *c, object_t *pit) {
|
||||||
|
|
||||||
if (belowcell) {
|
if (belowcell) {
|
||||||
char oid[BUFLENSMALL];
|
char oid[BUFLENSMALL];
|
||||||
sprintf(oid, "%ld",pit->id);
|
snprintf(oid, BUFLEN, "%ld",pit->id);
|
||||||
//uphole = findmapobwithflagval(belowcell->map, F_MAPLINK, NA, NA, NA, oid);
|
//uphole = findmapobwithflagval(belowcell->map, F_MAPLINK, NA, NA, NA, oid);
|
||||||
uphole = hasobwithflagval(belowcell->obpile, F_MAPLINK, NA, NA, NA, oid);
|
uphole = hasobwithflagval(belowcell->obpile, F_MAPLINK, NA, NA, NA, oid);
|
||||||
if (!uphole) {
|
if (!uphole) {
|
||||||
|
@ -11080,10 +11080,10 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
|
||||||
if (o->pile->owner) {
|
if (o->pile->owner) {
|
||||||
char ownername[BUFLEN];
|
char ownername[BUFLEN];
|
||||||
getlfname(o->pile->owner,ownername);
|
getlfname(o->pile->owner,ownername);
|
||||||
sprintf(theob, "%s%s %s",ownername,getpossessive(ownername),
|
snprintf(theob, BUFLEN, "%s%s %s",ownername,getpossessive(ownername),
|
||||||
noprefix(obname));
|
noprefix(obname));
|
||||||
} else {
|
} else {
|
||||||
sprintf(theob, "the %s", noprefix(obname));
|
snprintf(theob, BUFLEN, "the %s", noprefix(obname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11590,7 +11590,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
|
||||||
cell_t *c;
|
cell_t *c;
|
||||||
char wname[BUFLEN];
|
char wname[BUFLEN];
|
||||||
r = poss[rnd(0,nposs-1)];
|
r = poss[rnd(0,nposs-1)];
|
||||||
sprintf(wname, "%s warrior", r->name);
|
snprintf(wname, BUFLEN, "%s warrior", r->name);
|
||||||
|
|
||||||
c = real_getrandomadjcell(lf->cell, &ccwalkable, B_ALLOWEXPAND, LOF_WALLSTOP, NULL, lf);
|
c = real_getrandomadjcell(lf->cell, &ccwalkable, B_ALLOWEXPAND, LOF_WALLSTOP, NULL, lf);
|
||||||
if (c) {
|
if (c) {
|
||||||
|
@ -12033,7 +12033,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
|
||||||
msg("You play a few notes on your panpipes.");
|
msg("You play a few notes on your panpipes.");
|
||||||
} else {
|
} else {
|
||||||
char nbuf[BUFLEN];
|
char nbuf[BUFLEN];
|
||||||
sprintf(nbuf, "plays a tune on %ss panpipes.", it(lf));
|
snprintf(nbuf, BUFLEN, "plays a tune on %ss panpipes.", it(lf));
|
||||||
noise(lf->cell, lf, NC_OTHER, SV_SHOUT, "the sound of panpipes.", nbuf);
|
noise(lf->cell, lf, NC_OTHER, SV_SHOUT, "the sound of panpipes.", nbuf);
|
||||||
}
|
}
|
||||||
} else if (o->type->id == OT_PEACEPIPES) {
|
} else if (o->type->id == OT_PEACEPIPES) {
|
||||||
|
@ -12042,7 +12042,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
|
||||||
msg("You play an enchanting melody on your panpipes!");
|
msg("You play an enchanting melody on your panpipes!");
|
||||||
} else {
|
} else {
|
||||||
char nbuf[BUFLEN];
|
char nbuf[BUFLEN];
|
||||||
sprintf(nbuf, "plays a calming melody on %ss panpipes.", it(lf));
|
snprintf(nbuf, BUFLEN, "plays a calming melody on %ss panpipes.", it(lf));
|
||||||
noise(lf->cell, lf, NC_OTHER, SV_SHOUT, "an eerily calming melody.", nbuf);
|
noise(lf->cell, lf, NC_OTHER, SV_SHOUT, "an eerily calming melody.", nbuf);
|
||||||
}
|
}
|
||||||
for (l = lf->cell->map->lf ; l ; l = l->next) {
|
for (l = lf->cell->map->lf ; l ; l = l->next) {
|
||||||
|
@ -13224,7 +13224,7 @@ void potioneffects(lifeform_t *lf, enum OBTYPE oid, object_t *o, enum BLESSTYPE
|
||||||
break;
|
break;
|
||||||
case OT_POT_GROWTH:
|
case OT_POT_GROWTH:
|
||||||
i = getlfsize(lf);
|
i = getlfsize(lf);
|
||||||
sprintf(origstats, "%d,%d", lf->att[A_STR], lf->maxhp);
|
snprintf(origstats, BUFLEN, "%d,%d", lf->att[A_STR], lf->maxhp);
|
||||||
if (iscursed(o)) {
|
if (iscursed(o)) {
|
||||||
dospelleffects(lf, OT_S_SIZEDOWN, 1, lf, NULL, lf->cell, B_UNCURSED, seen, B_TRUE, NULL);
|
dospelleffects(lf, OT_S_SIZEDOWN, 1, lf, NULL, lf->cell, B_UNCURSED, seen, B_TRUE, NULL);
|
||||||
} else {
|
} else {
|
||||||
|
@ -14151,7 +14151,7 @@ int readsomething(lifeform_t *lf, object_t *o) {
|
||||||
char *longdesc;
|
char *longdesc;
|
||||||
char shortdesc[BUFLEN];
|
char shortdesc[BUFLEN];
|
||||||
longdesc = malloc(HUGEBUFLEN * sizeof(char));
|
longdesc = malloc(HUGEBUFLEN * sizeof(char));
|
||||||
sprintf(shortdesc, "%s (Lv %d)", oo->type->name, getspelllevel(oo->type->id));
|
snprintf(shortdesc, BUFLEN, "%s (Lv %d)", oo->type->name, getspelllevel(oo->type->id));
|
||||||
if (getspellpower(lf, oo->type->id) <= 0) { // not possible to cast?
|
if (getspellpower(lf, oo->type->id) <= 0) { // not possible to cast?
|
||||||
strcat(shortdesc, " [TOO HARD]");
|
strcat(shortdesc, " [TOO HARD]");
|
||||||
}
|
}
|
||||||
|
@ -15603,7 +15603,7 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
|
||||||
int radius;
|
int radius;
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
// make everyone invisible
|
// make everyone invisible
|
||||||
sprintf(buf, "%s dispers%s into twinkling light!", obname, (amt == 1) ? "es" : "e" );
|
snprintf(buf, BUFLEN, "%s dispers%s into twinkling light!", obname, (amt == 1) ? "es" : "e" );
|
||||||
|
|
||||||
if (haslos(player, srcloc)) {
|
if (haslos(player, srcloc)) {
|
||||||
if (!isknown(o)) makeknown(o->type->id);
|
if (!isknown(o)) makeknown(o->type->id);
|
||||||
|
@ -15616,7 +15616,7 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
|
||||||
int radius;
|
int radius;
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
// make smoke
|
// make smoke
|
||||||
sprintf(buf, "%s dispers%s into a wispy mist!", obname, (amt == 1) ? "es" : "e" );
|
snprintf(buf, BUFLEN, "%s dispers%s into a wispy mist!", obname, (amt == 1) ? "es" : "e" );
|
||||||
|
|
||||||
if (haslos(player, srcloc)) {
|
if (haslos(player, srcloc)) {
|
||||||
if (!isknown(o)) makeknown(o->type->id);
|
if (!isknown(o)) makeknown(o->type->id);
|
||||||
|
@ -15802,7 +15802,7 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
|
||||||
if (firearm) {
|
if (firearm) {
|
||||||
char faname[BUFLEN];
|
char faname[BUFLEN];
|
||||||
getobname(firearm, faname, 1);
|
getobname(firearm, faname, 1);
|
||||||
sprintf(fatext," (from %s)",faname);
|
snprintf(fatext, BUFLEN," (from %s)",faname);
|
||||||
} else {
|
} else {
|
||||||
strcpy(fatext,"");
|
strcpy(fatext,"");
|
||||||
}
|
}
|
||||||
|
@ -15870,7 +15870,7 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
|
||||||
if (thrower != target) {
|
if (thrower != target) {
|
||||||
int dist;
|
int dist;
|
||||||
dist = getcelldist(srcloc, where);
|
dist = getcelldist(srcloc, where);
|
||||||
sprintf(attackname, "%s", obname);
|
snprintf(attackname, BUFLEN, "%s", obname);
|
||||||
difficulty = 60 + (speed*10);
|
difficulty = 60 + (speed*10);
|
||||||
// harder the closer the projectile was shot from.
|
// harder the closer the projectile was shot from.
|
||||||
if (dist <= 1) {
|
if (dist <= 1) {
|
||||||
|
@ -16049,9 +16049,9 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp
|
||||||
char buf2[BUFLEN];
|
char buf2[BUFLEN];
|
||||||
char verb[BUFLEN];
|
char verb[BUFLEN];
|
||||||
if (willtangle) {
|
if (willtangle) {
|
||||||
sprintf(verb, "wrap%s around", (amt == 1) ? "s" : "");
|
snprintf(verb, BUFLEN, "wrap%s around", (amt == 1) ? "s" : "");
|
||||||
} else {
|
} else {
|
||||||
sprintf(verb, "hit%s", (amt == 1) ? "s" : "");
|
snprintf(verb, BUFLEN, "hit%s", (amt == 1) ? "s" : "");
|
||||||
}
|
}
|
||||||
snprintf(buf2, BUFLEN, "%s %s %s.",obname, verb, targetname);
|
snprintf(buf2, BUFLEN, "%s %s %s.",obname, verb, targetname);
|
||||||
if (lfhasflag(player, F_EXTRAINFO)) {
|
if (lfhasflag(player, F_EXTRAINFO)) {
|
||||||
|
@ -16849,10 +16849,10 @@ void timeeffectsob(object_t *o) {
|
||||||
char cname[BUFLEN];
|
char cname[BUFLEN];
|
||||||
getlfname(creator, cname);
|
getlfname(creator, cname);
|
||||||
// ie. "the djinn's whirlwind"
|
// ie. "the djinn's whirlwind"
|
||||||
sprintf(damstring, "%s%s %s", cname, getpossessive(cname), noprefix(obname));
|
snprintf(damstring, BUFLEN, "%s%s %s", cname, getpossessive(cname), noprefix(obname));
|
||||||
} else {
|
} else {
|
||||||
// ie. "a whirlwind"
|
// ie. "a whirlwind"
|
||||||
sprintf(damstring, "%s", obname);
|
snprintf(damstring, BUFLEN, "%s", obname);
|
||||||
}
|
}
|
||||||
losehp(lf, roll(f->text), DT_PROJECTILE, creator, damstring);
|
losehp(lf, roll(f->text), DT_PROJECTILE, creator, damstring);
|
||||||
// lfs then get knocked away (and might take further damage from hitting something)
|
// lfs then get knocked away (and might take further damage from hitting something)
|
||||||
|
@ -17789,7 +17789,7 @@ int unjam(lifeform_t *lf, object_t *o) {
|
||||||
} else {
|
} else {
|
||||||
if (isdoor(o, NULL)) {
|
if (isdoor(o, NULL)) {
|
||||||
char noisebuf[BUFLEN];
|
char noisebuf[BUFLEN];
|
||||||
sprintf(noisebuf, "%s jiggling against its hinges.", obname);
|
snprintf(noisebuf, BUFLEN, "%s jiggling against its hinges.", obname);
|
||||||
noise(c, NULL, NC_OTHER, SV_SHOUT, noisebuf, NULL);
|
noise(c, NULL, NC_OTHER, SV_SHOUT, noisebuf, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
save.c
3
save.c
|
@ -1,3 +1,4 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -398,7 +399,7 @@ map_t *loadmap(FILE *f) {
|
||||||
|
|
||||||
// cell info
|
// cell info
|
||||||
fscanf(f, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
|
fscanf(f, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
|
||||||
&roomid, &celltypeid, &c->known, &c->knowntime, &c->knownglyph.ch, &c->knownglyph.colour, &c->visited, &c->locked, &temphab, &c->isroomwall, &c->temperature);
|
&roomid, &celltypeid,(int *) &c->known, &c->knowntime, &c->knownglyph.ch, &c->knownglyph.colour, &c->visited, &c->locked, &temphab, &c->isroomwall, &c->temperature);
|
||||||
c->habitat = findhabitat(temphab);
|
c->habitat = findhabitat(temphab);
|
||||||
|
|
||||||
c->room = findroom(m, roomid);
|
c->room = findroom(m, roomid);
|
||||||
|
|
38
shops.c
38
shops.c
|
@ -494,7 +494,7 @@ enum SHOPRETURN shopdonate(lifeform_t *lf, object_t *vm, int starty, char *topte
|
||||||
// confirm count for gold
|
// confirm count for gold
|
||||||
if (o->type->obclass->id == OC_MONEY) {
|
if (o->type->obclass->id == OC_MONEY) {
|
||||||
char answer[BUFLEN],buf[BUFLEN];
|
char answer[BUFLEN],buf[BUFLEN];
|
||||||
sprintf(buf, "How much money will you donate (you have $%d)?", o->amt);
|
snprintf(buf, BUFLEN, "How much money will you donate (you have $%d)?", o->amt);
|
||||||
askstring(buf, '?', answer, BUFLEN, NULL);
|
askstring(buf, '?', answer, BUFLEN, NULL);
|
||||||
count = atoi(answer);
|
count = atoi(answer);
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
|
@ -671,7 +671,7 @@ enum SHOPRETURN shopbless(lifeform_t *lf, object_t *vm, int starty, char *toptex
|
||||||
}
|
}
|
||||||
|
|
||||||
// ask which object
|
// ask which object
|
||||||
sprintf(buf, "Bless which object (you have $%d)?", countmoney(lf->pack));
|
snprintf(buf, BUFLEN, "Bless which object (you have $%d)?", countmoney(lf->pack));
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
for (o = player->pack->first ; o ; o = o->next) {
|
for (o = player->pack->first ; o ; o = o->next) {
|
||||||
int ok = B_FALSE;
|
int ok = B_FALSE;
|
||||||
|
@ -683,7 +683,7 @@ enum SHOPRETURN shopbless(lifeform_t *lf, object_t *vm, int starty, char *toptex
|
||||||
if (ok) {
|
if (ok) {
|
||||||
char costbuf[BUFLEN];
|
char costbuf[BUFLEN];
|
||||||
getobname(o, buf, o->amt);
|
getobname(o, buf, o->amt);
|
||||||
sprintf(costbuf, "%-60s($%d)", buf, getshopblessprice(o, vm));
|
snprintf(costbuf, BUFLEN, "%-60s($%d)", buf, getshopblessprice(o, vm));
|
||||||
addchoice(&prompt, o->letter, costbuf, costbuf, o, NULL);
|
addchoice(&prompt, o->letter, costbuf, costbuf, o, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ enum SHOPRETURN shopbless(lifeform_t *lf, object_t *vm, int starty, char *toptex
|
||||||
if (skillcheck(player, SC_SPEECH, 100, 0)) {
|
if (skillcheck(player, SC_SPEECH, 100, 0)) {
|
||||||
char goldbuf[BUFLEN];
|
char goldbuf[BUFLEN];
|
||||||
msg("\"...so I will return your payment.\""); more();
|
msg("\"...so I will return your payment.\""); more();
|
||||||
sprintf(goldbuf, "%d gold dollars", cost);
|
snprintf(goldbuf, BUFLEN, "%d gold dollars", cost);
|
||||||
addob(player->pack, goldbuf);
|
addob(player->pack, goldbuf);
|
||||||
} else {
|
} else {
|
||||||
msg("\"Unfortunately, we do not offer refunds.\""); more();
|
msg("\"Unfortunately, we do not offer refunds.\""); more();
|
||||||
|
@ -751,7 +751,7 @@ enum SHOPRETURN shopid(lifeform_t *lf, object_t *vm, int starty, char *toptext,
|
||||||
getflags(vm->flags, sellflag, &nsellflags, F_SHOPACCEPTSFLAG, F_NONE);
|
getflags(vm->flags, sellflag, &nsellflags, F_SHOPACCEPTSFLAG, F_NONE);
|
||||||
|
|
||||||
// ask what to sell
|
// ask what to sell
|
||||||
sprintf(buf, "What would you like to inspect (you have $%d)?", countmoney(lf->pack));
|
snprintf(buf, BUFLEN, "What would you like to inspect (you have $%d)?", countmoney(lf->pack));
|
||||||
|
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
prompt.maycancel = B_TRUE;
|
prompt.maycancel = B_TRUE;
|
||||||
|
@ -769,7 +769,7 @@ enum SHOPRETURN shopid(lifeform_t *lf, object_t *vm, int starty, char *toptext,
|
||||||
if (ok) {
|
if (ok) {
|
||||||
char costbuf[BUFLEN];
|
char costbuf[BUFLEN];
|
||||||
getobname(o, buf, o->amt);
|
getobname(o, buf, o->amt);
|
||||||
sprintf(costbuf, "%-60s($%d)", buf, cost);
|
snprintf(costbuf, BUFLEN, "%-60s($%d)", buf, cost);
|
||||||
addchoice(&prompt, o->letter, costbuf, costbuf, o, NULL);
|
addchoice(&prompt, o->letter, costbuf, costbuf, o, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -960,7 +960,7 @@ enum SHOPRETURN shoppurchase(lifeform_t *lf, object_t *vm, int starty, char *top
|
||||||
enum SKILLLEVEL slev;
|
enum SKILLLEVEL slev;
|
||||||
slev = getskill(lf, SK_SPEECH);
|
slev = getskill(lf, SK_SPEECH);
|
||||||
// determine payment method
|
// determine payment method
|
||||||
sprintf(ques, "How will you pay for %s ($%d)?", obname, value);
|
snprintf(ques, BUFLEN, "How will you pay for %s ($%d)?", obname, value);
|
||||||
initprompt(&prompt, ques);
|
initprompt(&prompt, ques);
|
||||||
for (oo = player->pack->first ; oo ; oo = oo->next) {
|
for (oo = player->pack->first ; oo ; oo = oo->next) {
|
||||||
if ((oo->type->id == OT_GOLD) || (oo->type->id == OT_CREDITCARD) || hasflag(oo->flags, F_GEM)) {
|
if ((oo->type->id == OT_GOLD) || (oo->type->id == OT_CREDITCARD) || hasflag(oo->flags, F_GEM)) {
|
||||||
|
@ -982,7 +982,7 @@ enum SHOPRETURN shoppurchase(lifeform_t *lf, object_t *vm, int starty, char *top
|
||||||
thisval = applyshoppricemod(getobvalue(oo), player, vm, SA_SELL);
|
thisval = applyshoppricemod(getobvalue(oo), player, vm, SA_SELL);
|
||||||
if (thisval >= value) {
|
if (thisval >= value) {
|
||||||
valid = B_TRUE;
|
valid = B_TRUE;
|
||||||
sprintf(fullname, "%s (worth $%d)", moneyname, thisval);
|
snprintf(fullname, BUFLEN, "%s (worth $%d)", moneyname, thisval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1066,7 +1066,7 @@ enum SHOPRETURN shoppurchase(lifeform_t *lf, object_t *vm, int starty, char *top
|
||||||
if (change > 0) {
|
if (change > 0) {
|
||||||
char changebuf[BUFLEN];
|
char changebuf[BUFLEN];
|
||||||
|
|
||||||
sprintf(changebuf, "%d gold dollars", change);
|
snprintf(changebuf, BUFLEN, "%d gold dollars", change);
|
||||||
addob(player->pack, changebuf);
|
addob(player->pack, changebuf);
|
||||||
msg("You receive $%d change.", change); more();
|
msg("You receive $%d change.", change); more();
|
||||||
}
|
}
|
||||||
|
@ -1158,7 +1158,7 @@ enum SHOPRETURN shoprepair(lifeform_t *lf, object_t *vm, int starty, char *topte
|
||||||
|
|
||||||
|
|
||||||
// get list of objects to repair
|
// get list of objects to repair
|
||||||
sprintf(buf, "Repair which object (you have $%d)?", countmoney(lf->pack));
|
snprintf(buf, BUFLEN, "Repair which object (you have $%d)?", countmoney(lf->pack));
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
for (o = player->pack->first ; o ; o = o->next) {
|
for (o = player->pack->first ; o ; o = o->next) {
|
||||||
if (isarmour(o) && isdamaged(o)) {
|
if (isarmour(o) && isdamaged(o)) {
|
||||||
|
@ -1170,7 +1170,7 @@ enum SHOPRETURN shoprepair(lifeform_t *lf, object_t *vm, int starty, char *topte
|
||||||
thiscost = applyshoppricemod((f->val[1] - f->val[0]) * hpcost, lf, vm, SA_BUY);
|
thiscost = applyshoppricemod((f->val[1] - f->val[0]) * hpcost, lf, vm, SA_BUY);
|
||||||
// add to prompt
|
// add to prompt
|
||||||
getobname(o, obname, o->amt);
|
getobname(o, obname, o->amt);
|
||||||
sprintf(desc, "%s ($%d)", obname,thiscost);
|
snprintf(desc, BUFLEN, "%s ($%d)", obname,thiscost);
|
||||||
addchoice(&prompt, o->letter, desc, desc, o, NULL);
|
addchoice(&prompt, o->letter, desc, desc, o, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1240,13 +1240,13 @@ enum SHOPRETURN shopresize(lifeform_t *lf, object_t *vm, int starty, char *topte
|
||||||
}
|
}
|
||||||
|
|
||||||
// ask which object
|
// ask which object
|
||||||
sprintf(buf, "Resize which object (you have $%d)?", countmoney(lf->pack));
|
snprintf(buf, BUFLEN, "Resize which object (you have $%d)?", countmoney(lf->pack));
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
for (o = player->pack->first ; o ; o = o->next) {
|
for (o = player->pack->first ; o ; o = o->next) {
|
||||||
if (hasflag(o->flags, F_MULTISIZE) && !armourfits(player, o, NULL)) {
|
if (hasflag(o->flags, F_MULTISIZE) && !armourfits(player, o, NULL)) {
|
||||||
char costbuf[BUFLEN];
|
char costbuf[BUFLEN];
|
||||||
getobname(o, buf, o->amt);
|
getobname(o, buf, o->amt);
|
||||||
sprintf(costbuf, "%-60s($%d)", buf, resizecost);
|
snprintf(costbuf, BUFLEN, "%-60s($%d)", buf, resizecost);
|
||||||
addchoice(&prompt, o->letter, costbuf, costbuf, o, NULL);
|
addchoice(&prompt, o->letter, costbuf, costbuf, o, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1294,12 +1294,12 @@ enum SHOPRETURN shoprest(lifeform_t *lf, object_t *vm, int starty, char *toptext
|
||||||
}
|
}
|
||||||
|
|
||||||
// how many hours?
|
// how many hours?
|
||||||
sprintf(buf, "How many hours will you pay for (you have $%d)?", countmoney(lf->pack));
|
snprintf(buf, BUFLEN, "How many hours will you pay for (you have $%d)?", countmoney(lf->pack));
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
for (i = 1; i <= 9; i++) {
|
for (i = 1; i <= 9; i++) {
|
||||||
int thiscost;
|
int thiscost;
|
||||||
thiscost = cost * i;
|
thiscost = cost * i;
|
||||||
sprintf(buf, "%d hour%s ($%d)", i, (i == 1) ? "" : "s", thiscost);
|
snprintf(buf, BUFLEN, "%d hour%s ($%d)", i, (i == 1) ? "" : "s", thiscost);
|
||||||
addchoice(&prompt, '0' + i, buf, buf, NULL, NULL);
|
addchoice(&prompt, '0' + i, buf, buf, NULL, NULL);
|
||||||
}
|
}
|
||||||
addchoice(&prompt, '-', "Cancel", NULL, NULL, NULL);
|
addchoice(&prompt, '-', "Cancel", NULL, NULL, NULL);
|
||||||
|
@ -1313,7 +1313,7 @@ enum SHOPRETURN shoprest(lifeform_t *lf, object_t *vm, int starty, char *toptext
|
||||||
givemoney(lf, NULL, cost);
|
givemoney(lf, NULL, cost);
|
||||||
|
|
||||||
// mark that we are resting in a hotel
|
// mark that we are resting in a hotel
|
||||||
sprintf(obid, "%ld", vm->id);
|
snprintf(obid, BUFLEN, "%ld", vm->id);
|
||||||
addflag(lf->flags, F_RESTINGINMOTEL, amt*60, 0, NA, obid);
|
addflag(lf->flags, F_RESTINGINMOTEL, amt*60, 0, NA, obid);
|
||||||
addflag(lf->flags, F_RESTUNTILBETTER, B_TRUE, NA, NA, NULL);
|
addflag(lf->flags, F_RESTUNTILBETTER, B_TRUE, NA, NA, NULL);
|
||||||
breakaitargets(lf, B_FALSE);
|
breakaitargets(lf, B_FALSE);
|
||||||
|
@ -1344,7 +1344,7 @@ enum SHOPRETURN shopsell(lifeform_t *lf, object_t *vm, int starty, char *toptext
|
||||||
getflags(vm->flags, sellflag, &nsellflags, F_SHOPACCEPTSFLAG, F_NONE);
|
getflags(vm->flags, sellflag, &nsellflags, F_SHOPACCEPTSFLAG, F_NONE);
|
||||||
|
|
||||||
// ask what to sell
|
// ask what to sell
|
||||||
sprintf(buf, "What will you sell (you have $%d)?", countmoney(lf->pack));
|
snprintf(buf, BUFLEN, "What will you sell (you have $%d)?", countmoney(lf->pack));
|
||||||
|
|
||||||
o = doaskobject(player->pack, buf, NULL, &count, B_TRUE, B_FALSE, B_FALSE, '\0', vm, SA_SELL, NULL, B_FALSE);
|
o = doaskobject(player->pack, buf, NULL, &count, B_TRUE, B_FALSE, B_FALSE, '\0', vm, SA_SELL, NULL, B_FALSE);
|
||||||
if (!o) {
|
if (!o) {
|
||||||
|
@ -1388,7 +1388,7 @@ enum SHOPRETURN shopsell(lifeform_t *lf, object_t *vm, int starty, char *toptext
|
||||||
|
|
||||||
// confirm
|
// confirm
|
||||||
getobname(o, obname, count);
|
getobname(o, obname, count);
|
||||||
sprintf(buf, "Sell %s for $%d?", obname, sellprice);
|
snprintf(buf, BUFLEN, "Sell %s for $%d?", obname, sellprice);
|
||||||
ch = askchar(buf, "yn","n", B_TRUE, B_FALSE);
|
ch = askchar(buf, "yn","n", B_TRUE, B_FALSE);
|
||||||
if (ch == 'y') {
|
if (ch == 'y') {
|
||||||
// move object to the shop
|
// move object to the shop
|
||||||
|
@ -1401,7 +1401,7 @@ enum SHOPRETURN shopsell(lifeform_t *lf, object_t *vm, int starty, char *toptext
|
||||||
newob->letter = let;
|
newob->letter = let;
|
||||||
(*nsold)++;
|
(*nsold)++;
|
||||||
// give money to player
|
// give money to player
|
||||||
sprintf(paymentbuf, "%d gold dollars", sellprice);
|
snprintf(paymentbuf, BUFLEN, "%d gold dollars", sellprice);
|
||||||
addob(player->pack, paymentbuf);
|
addob(player->pack, paymentbuf);
|
||||||
|
|
||||||
practice(player, SK_SPEECH, 1);
|
practice(player, SK_SPEECH, 1);
|
||||||
|
|
117
spell.c
117
spell.c
|
@ -1,3 +1,4 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -218,7 +219,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
char *p;
|
char *p;
|
||||||
p = strdup(tempot->name);
|
p = strdup(tempot->name);
|
||||||
makeplural(&p);
|
makeplural(&p);
|
||||||
sprintf(ptext, "How many %s will you build (max %d)", p, npossible);
|
snprintf(ptext, BUFLEN, "How many %s will you build (max %d)", p, npossible);
|
||||||
free(p);
|
free(p);
|
||||||
askstring(ptext, '?', buf, BUFLEN, "1");
|
askstring(ptext, '?', buf, BUFLEN, "1");
|
||||||
numtobuild = atoi(buf);
|
numtobuild = atoi(buf);
|
||||||
|
@ -251,7 +252,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%d original %s", numtobuild, tempot->name);
|
snprintf(buf, BUFLEN, "%d original %s", numtobuild, tempot->name);
|
||||||
o = addob(user->pack, buf);
|
o = addob(user->pack, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +423,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
|
|
||||||
// how can we check the stairs?
|
// how can we check the stairs?
|
||||||
getobname(stairs, obname, 1);
|
getobname(stairs, obname, 1);
|
||||||
sprintf(buf, "How will you check %s", obname);
|
snprintf(buf, BUFLEN, "How will you check %s", obname);
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
if (lfhasflag(user, F_DETECTLIFE)) {
|
if (lfhasflag(user, F_DETECTLIFE)) {
|
||||||
addchoice(&prompt, 'd', "Detect lifeforms", NULL, NULL, NULL);
|
addchoice(&prompt, 'd', "Detect lifeforms", NULL, NULL, NULL);
|
||||||
|
@ -927,7 +928,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
char yn;
|
char yn;
|
||||||
char ques[BUFLEN];
|
char ques[BUFLEN];
|
||||||
getobname(o, obname, o->amt);
|
getobname(o, obname, o->amt);
|
||||||
sprintf(ques, "There %s %s here. Cook it?", OB1(o,"is","are"),obname);
|
snprintf(ques, BUFLEN, "There %s %s here. Cook it?", OB1(o,"is","are"),obname);
|
||||||
yn = askchar(ques, "yn","n", B_TRUE, B_FALSE);
|
yn = askchar(ques, "yn","n", B_TRUE, B_FALSE);
|
||||||
if (yn == 'y') {
|
if (yn == 'y') {
|
||||||
corpse = o;
|
corpse = o;
|
||||||
|
@ -1160,7 +1161,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
} else {
|
} else {
|
||||||
objecttype_t *ot;
|
objecttype_t *ot;
|
||||||
ot = findot(trapflag->val[0]);
|
ot = findot(trapflag->val[0]);
|
||||||
sprintf(buf, "%s %s", needan(ot->name) ? "an" : "a", ot->name);
|
snprintf(buf, BUFLEN, "%s %s", needan(ot->name) ? "an" : "a", ot->name);
|
||||||
// ie. trapped object
|
// ie. trapped object
|
||||||
killflag(trapflag);
|
killflag(trapflag);
|
||||||
}
|
}
|
||||||
|
@ -1359,7 +1360,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
removeob(o, 1);
|
removeob(o, 1);
|
||||||
if (numnew && newot) {
|
if (numnew && newot) {
|
||||||
char newobname[BUFLEN];
|
char newobname[BUFLEN];
|
||||||
sprintf(newobname, "%d %s", numnew, newot->name);
|
snprintf(newobname, BUFLEN, "%d %s", numnew, newot->name);
|
||||||
addob(c->obpile, newobname);
|
addob(c->obpile, newobname);
|
||||||
}
|
}
|
||||||
taketime(user, getactspeed(user)*2);
|
taketime(user, getactspeed(user)*2);
|
||||||
|
@ -1615,7 +1616,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(shtext, "%ld", selshield->id);
|
snprintf(shtext, BUFLEN, "%ld", selshield->id);
|
||||||
addflag(user->flags, F_FULLSHIELD, NA, NA, NA, shtext);
|
addflag(user->flags, F_FULLSHIELD, NA, NA, NA, shtext);
|
||||||
taketime(user, getactspeed(user));
|
taketime(user, getactspeed(user));
|
||||||
} else if (abilid == OT_A_GRAB) {
|
} else if (abilid == OT_A_GRAB) {
|
||||||
|
@ -1951,7 +1952,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
if (pct >= cutoff) {
|
if (pct >= cutoff) {
|
||||||
char buf[BUFLEN],desc[BUFLEN];
|
char buf[BUFLEN],desc[BUFLEN];
|
||||||
getobname(o, buf, o->amt);
|
getobname(o, buf, o->amt);
|
||||||
sprintf(desc, "%s",buf);
|
snprintf(desc, BUFLEN, "%s",buf);
|
||||||
// we can repair this object
|
// we can repair this object
|
||||||
addchoice(&prompt, o->letter, desc, desc, o, NULL);
|
addchoice(&prompt, o->letter, desc, desc, o, NULL);
|
||||||
}
|
}
|
||||||
|
@ -1975,7 +1976,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
o = (object_t *)prompt.choice[n].data;
|
o = (object_t *)prompt.choice[n].data;
|
||||||
if (o) {
|
if (o) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%ld", o->id);
|
snprintf(buf, BUFLEN, "%ld", o->id);
|
||||||
addflag(user->flags, F_REPAIRING, NA, NA, NA, buf);
|
addflag(user->flags, F_REPAIRING, NA, NA, NA, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1995,7 +1996,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
|
|
||||||
if (o) {
|
if (o) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
sprintf(buf, "%ld", o->id);
|
snprintf(buf, BUFLEN, "%ld", o->id);
|
||||||
addflag(user->flags, F_REPAIRING, NA, NA, NA, buf);
|
addflag(user->flags, F_REPAIRING, NA, NA, NA, buf);
|
||||||
getobname(o, buf, o->amt);
|
getobname(o, buf, o->amt);
|
||||||
if (isplayer(user)) {
|
if (isplayer(user)) {
|
||||||
|
@ -2071,7 +2072,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
|
|
||||||
|
|
||||||
// ask what size we want.
|
// ask what size we want.
|
||||||
sprintf(buf, "Resize %s to what size?", obname);
|
snprintf(buf, BUFLEN, "Resize %s to what size?", obname);
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
for (i = SZ_MEDIUM; i <= SZ_LARGE; i++) {
|
for (i = SZ_MEDIUM; i <= SZ_LARGE; i++) {
|
||||||
if (i != origsize) {
|
if (i != origsize) {
|
||||||
|
@ -2235,7 +2236,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
damamt = getstrdammod(user);
|
damamt = getstrdammod(user);
|
||||||
if (damamt > 0) {
|
if (damamt > 0) {
|
||||||
char damstr[BUFLEN];
|
char damstr[BUFLEN];
|
||||||
sprintf(damstr, "%s%s shield bash", username, getpossessive(username));
|
snprintf(damstr, BUFLEN, "%s%s shield bash", username, getpossessive(username));
|
||||||
losehp(target, damamt, DT_BASH, user, damstr);
|
losehp(target, damamt, DT_BASH, user, damstr);
|
||||||
}
|
}
|
||||||
if (!isdead(target)) {
|
if (!isdead(target)) {
|
||||||
|
@ -2438,7 +2439,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
difficulty = 100 + (getspelllevel(f->val[0])*10);
|
difficulty = 100 + (getspelllevel(f->val[0])*10);
|
||||||
mod = getspellskill(user, f->val[0]) * 10;
|
mod = getspellskill(user, f->val[0]) * 10;
|
||||||
//pct = getskillcheckchance(user, SC_LEARNMAGIC, difficulty, mod);
|
//pct = getskillcheckchance(user, SC_LEARNMAGIC, difficulty, mod);
|
||||||
sprintf(buf2, "%s (%d%% success chance)", buf, difficulty-mod);
|
snprintf(buf2, BUFLEN, "%s (%d%% success chance)", buf, difficulty-mod);
|
||||||
addchoice(&prompt, o->letter, buf2, NULL, f, NULL);
|
addchoice(&prompt, o->letter, buf2, NULL, f, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3320,12 +3321,12 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getobname(wep, obname, 1);
|
getobname(wep, obname, 1);
|
||||||
sprintf(buf, "Deal what kind of damage with your %s?", noprefix(obname));
|
snprintf(buf, BUFLEN, "Deal what kind of damage with your %s?", noprefix(obname));
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
|
|
||||||
for (i = 0; i < nretflags; i++) {
|
for (i = 0; i < nretflags; i++) {
|
||||||
f = retflag[i];
|
f = retflag[i];
|
||||||
sprintf(buf, "%s, DR %d", getdamname(f->val[0]), f->val[1]);
|
snprintf(buf, BUFLEN, "%s, DR %d", getdamname(f->val[0]), f->val[1]);
|
||||||
if (strlen(f->text)) {
|
if (strlen(f->text)) {
|
||||||
strcat(buf, "(");
|
strcat(buf, "(");
|
||||||
strcat(buf, f->text);
|
strcat(buf, f->text);
|
||||||
|
@ -3569,7 +3570,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
getobname(o, obname, 1);
|
getobname(o, obname, 1);
|
||||||
|
|
||||||
// ask what size we want.
|
// ask what size we want.
|
||||||
sprintf(buf, "Destroy which object to enahnce %s?", obname);
|
snprintf(buf, BUFLEN, "Destroy which object to enahnce %s?", obname);
|
||||||
initprompt(&prompt, buf);
|
initprompt(&prompt, buf);
|
||||||
for (o2 = user->pack->first ; o2 ; o2 = o2->next) {
|
for (o2 = user->pack->first ; o2 ; o2 = o2->next) {
|
||||||
if ((o2 != o) && (o2->type->id == o->type->id)) {
|
if ((o2 != o) && (o2->type->id == o->type->id)) {
|
||||||
|
@ -3865,7 +3866,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
if (wep) {
|
if (wep) {
|
||||||
char buf[BUFLEN],wepname[BUFLEN];
|
char buf[BUFLEN],wepname[BUFLEN];
|
||||||
getobname(wep, buf, 1);
|
getobname(wep, buf, 1);
|
||||||
sprintf(wepname, "%s", noprefix(buf));
|
snprintf(wepname, BUFLEN, "%s", noprefix(buf));
|
||||||
if (isplayer(user)) {
|
if (isplayer(user)) {
|
||||||
msg("You swing your %s in a wide arc!", wepname);
|
msg("You swing your %s in a wide arc!", wepname);
|
||||||
} else if (cansee(player, user)) {
|
} else if (cansee(player, user)) {
|
||||||
|
@ -4079,7 +4080,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
dam = getstamina(user);
|
dam = getstamina(user);
|
||||||
|
|
||||||
setstamina(user, 0);
|
setstamina(user, 0);
|
||||||
sprintf(damstr, "%s%s invocation of the iron fist",username,getpossessive(username));
|
snprintf(damstr, BUFLEN, "%s%s invocation of the iron fist",username,getpossessive(username));
|
||||||
losehp(target, dam, DT_DIRECT, user, damstr);
|
losehp(target, dam, DT_DIRECT, user, damstr);
|
||||||
|
|
||||||
if (dir != D_NONE) {
|
if (dir != D_NONE) {
|
||||||
|
@ -4571,11 +4572,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (newob) {
|
if (newob) {
|
||||||
newob->amt += (int)obvalue;
|
newob->amt += (int)obvalue;
|
||||||
} else {
|
} else {
|
||||||
sprintf(obtocreate, "%d gold dollars", (int)obvalue);
|
snprintf(obtocreate, BUFLEN, "%d gold dollars", (int)obvalue);
|
||||||
newob = addob(op, obtocreate);
|
newob = addob(op, obtocreate);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(obtocreate, "%d gold dollars", (int)obvalue);
|
snprintf(obtocreate, BUFLEN, "%d gold dollars", (int)obvalue);
|
||||||
newob = addob(op, obtocreate);
|
newob = addob(op, obtocreate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4961,7 +4962,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (caster) {
|
if (caster) {
|
||||||
char cname[BUFLEN];
|
char cname[BUFLEN];
|
||||||
real_getlfnamea(caster, cname, NULL, B_SHOWALL, B_REALRACE);
|
real_getlfnamea(caster, cname, NULL, B_SHOWALL, B_REALRACE);
|
||||||
sprintf(damstr, "%s%s blight spell.", cname, getpossessive(cname));
|
snprintf(damstr, BUFLEN, "%s%s blight spell.", cname, getpossessive(cname));
|
||||||
} else {
|
} else {
|
||||||
strcpy(damstr, "a blight spell.");
|
strcpy(damstr, "a blight spell.");
|
||||||
}
|
}
|
||||||
|
@ -5151,7 +5152,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(killertext, "%s%s hotfoot spell", castername, getpossessive(castername));
|
snprintf(killertext, BUFLEN, "%s%s hotfoot spell", castername, getpossessive(castername));
|
||||||
addflag(target->flags, F_HOTFEET, 1, DT_FIRE, NA, killertext);
|
addflag(target->flags, F_HOTFEET, 1, DT_FIRE, NA, killertext);
|
||||||
if (isplayer(target) || cansee(player, target)) {
|
if (isplayer(target) || cansee(player, target)) {
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
|
@ -5223,11 +5224,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
char obname[BUFLEN];
|
char obname[BUFLEN];
|
||||||
|
|
||||||
if (spellid == OT_S_COLDSNAP) {
|
if (spellid == OT_S_COLDSNAP) {
|
||||||
sprintf(obname, "unnatural coldness");
|
snprintf(obname, BUFLEN, "unnatural coldness");
|
||||||
tempmod = -30;
|
tempmod = -30;
|
||||||
radius = power+1;
|
radius = power+1;
|
||||||
} else {
|
} else {
|
||||||
sprintf(obname, "unnatural heat");
|
snprintf(obname, BUFLEN, "unnatural heat");
|
||||||
tempmod = 30;
|
tempmod = 30;
|
||||||
radius = power-1;
|
radius = power-1;
|
||||||
}
|
}
|
||||||
|
@ -5761,7 +5762,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
char attackname[BUFLEN];
|
char attackname[BUFLEN];
|
||||||
getlfname(target, lfname);
|
getlfname(target, lfname);
|
||||||
dam = rnd(1,4);
|
dam = rnd(1,4);
|
||||||
sprintf(attackname, "a bolt of chi energy");
|
snprintf(attackname, BUFLEN, "a bolt of chi energy");
|
||||||
// target takes magical damage
|
// target takes magical damage
|
||||||
// always hit
|
// always hit
|
||||||
if (check_for_block(caster, target, dam, DT_EXPLOSIVE, 999, attackname, B_RANGED)) {
|
if (check_for_block(caster, target, dam, DT_EXPLOSIVE, 999, attackname, B_RANGED)) {
|
||||||
|
@ -5836,7 +5837,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
range = 1 + (power / 5);
|
range = 1 + (power / 5);
|
||||||
|
|
||||||
// announce
|
// announce
|
||||||
sprintf(buf, "%s emit%s a blast of icy cold!",castername,isplayer(caster) ? "" : "s");
|
snprintf(buf, BUFLEN, "%s emit%s a blast of icy cold!",castername,isplayer(caster) ? "" : "s");
|
||||||
animradial(caster->cell, range, '}', C_GREY, DT_ORTH, buf, "Something emits a blast of icy cold!");
|
animradial(caster->cell, range, '}', C_GREY, DT_ORTH, buf, "Something emits a blast of icy cold!");
|
||||||
|
|
||||||
if (isplayer(caster) || cansee(player, caster)) {
|
if (isplayer(caster) || cansee(player, caster)) {
|
||||||
|
@ -6371,9 +6372,9 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
// announce
|
// announce
|
||||||
if (caster && (targcell == caster->cell)) {
|
if (caster && (targcell == caster->cell)) {
|
||||||
sprintf(buf, "%s radiate%s a field of decay!",castername,isplayer(caster) ? "" : "s");
|
snprintf(buf, BUFLEN, "%s radiate%s a field of decay!",castername,isplayer(caster) ? "" : "s");
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "A field of decay radiates outwards!");
|
snprintf(buf, BUFLEN, "A field of decay radiates outwards!");
|
||||||
}
|
}
|
||||||
animradial(targcell, range, '}', C_INDIGO, DT_ORTH, buf, "Something radiates a field of decay!");
|
animradial(targcell, range, '}', C_INDIGO, DT_ORTH, buf, "Something radiates a field of decay!");
|
||||||
|
|
||||||
|
@ -6391,7 +6392,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (caster) {
|
if (caster) {
|
||||||
char cname[BUFLEN];
|
char cname[BUFLEN];
|
||||||
real_getlfnamea(caster, cname, NULL, B_SHOWALL, B_REALRACE);
|
real_getlfnamea(caster, cname, NULL, B_SHOWALL, B_REALRACE);
|
||||||
sprintf(damstr, "%s%s field of decay spell.", cname, getpossessive(cname));
|
snprintf(damstr, BUFLEN, "%s%s field of decay spell.", cname, getpossessive(cname));
|
||||||
} else {
|
} else {
|
||||||
strcpy(damstr, "a field of decay spell.");
|
strcpy(damstr, "a field of decay spell.");
|
||||||
}
|
}
|
||||||
|
@ -7144,7 +7145,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (caster && !targcell) targcell = caster->cell;
|
if (caster && !targcell) targcell = caster->cell;
|
||||||
range = 2 + (power / 4);
|
range = 2 + (power / 4);
|
||||||
|
|
||||||
sprintf(buf, "%s emit%s a radial blast of energy!",castername,isplayer(caster) ? "" : "s");
|
snprintf(buf, BUFLEN, "%s emit%s a radial blast of energy!",castername,isplayer(caster) ? "" : "s");
|
||||||
animradial(targcell, range, '}', C_CYAN, DT_COMPASS, buf, "Something emits a radial blast of energy!");
|
animradial(targcell, range, '}', C_CYAN, DT_COMPASS, buf, "Something emits a radial blast of energy!");
|
||||||
|
|
||||||
if (isplayer(caster) || haslos(player, targcell)) {
|
if (isplayer(caster) || haslos(player, targcell)) {
|
||||||
|
@ -7300,7 +7301,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
int gpower;
|
int gpower;
|
||||||
gpower = 2 + (power / 2);
|
gpower = 2 + (power / 2);
|
||||||
limit(&gpower, 1, NA);
|
limit(&gpower, 1, NA);
|
||||||
sprintf(buf, "^g*WARD%d*^n", gpower);
|
snprintf(buf, BUFLEN, "^g*WARD%d*^n", gpower);
|
||||||
writetextonground(caster, caster->cell, buf, power*5);
|
writetextonground(caster, caster->cell, buf, power*5);
|
||||||
} else if (spellid == OT_S_FLOATINGDISC) {
|
} else if (spellid == OT_S_FLOATINGDISC) {
|
||||||
lifeform_t *newlf;
|
lifeform_t *newlf;
|
||||||
|
@ -7389,13 +7390,13 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
radius = power/3;
|
radius = power/3;
|
||||||
limit(&radius, 1, NA);
|
limit(&radius, 1, NA);
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
sprintf(buf, "You unleash a mighty shockwave!");
|
snprintf(buf, BUFLEN, "You unleash a mighty shockwave!");
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
animradial(target->cell, radius, '}', C_RED, DT_COMPASS, buf, buf);
|
animradial(target->cell, radius, '}', C_RED, DT_COMPASS, buf, buf);
|
||||||
} else if (cansee(player, target)) {
|
} else if (cansee(player, target)) {
|
||||||
char tname[BUFLEN];
|
char tname[BUFLEN];
|
||||||
getlfname(target, tname);
|
getlfname(target, tname);
|
||||||
sprintf(buf, "%s unleashes a mighty shockwave!", tname);
|
snprintf(buf, BUFLEN, "%s unleashes a mighty shockwave!", tname);
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
animradial(target->cell, radius, '}', C_RED, DT_COMPASS, buf, buf);
|
animradial(target->cell, radius, '}', C_RED, DT_COMPASS, buf, buf);
|
||||||
}
|
}
|
||||||
|
@ -7620,9 +7621,9 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
range = 1 + (power / 5);
|
range = 1 + (power / 5);
|
||||||
|
|
||||||
// announce
|
// announce
|
||||||
sprintf(buf, "%s emit%s a %sblast of fire!",castername,isplayer(caster) ? "" : "s",
|
snprintf(buf, BUFLEN, "%s emit%s a %sblast of fire!",castername,isplayer(caster) ? "" : "s",
|
||||||
(power >= 5) ? "huge " : "");
|
(power >= 5) ? "huge " : "");
|
||||||
sprintf(buf2, "Something emit%s a %sblast of fire!",isplayer(caster) ? "" : "s",
|
snprintf(buf2, BUFLEN, "Something emit%s a %sblast of fire!",isplayer(caster) ? "" : "s",
|
||||||
(power >= 5) ? "huge " : "");
|
(power >= 5) ? "huge " : "");
|
||||||
|
|
||||||
animradial(caster->cell, range, '}', C_RED, DT_ORTH, buf, buf2);
|
animradial(caster->cell, range, '}', C_RED, DT_ORTH, buf, buf2);
|
||||||
|
@ -7968,7 +7969,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (gettr(c->lf) <= power) {
|
if (gettr(c->lf) <= power) {
|
||||||
char buf[BUFLEN];
|
char buf[BUFLEN];
|
||||||
// instadeath
|
// instadeath
|
||||||
sprintf(buf, "being sucked into %s", castername);
|
snprintf(buf, BUFLEN, "being sucked into %s", castername);
|
||||||
losehp(c->lf, c->lf->maxhp, DT_DIRECT, target, buf);
|
losehp(c->lf, c->lf->maxhp, DT_DIRECT, target, buf);
|
||||||
if (isplayer(c->lf)) {
|
if (isplayer(c->lf)) {
|
||||||
msg("^%cYour essence is sucked into %s!", getlfcol(c->lf, CC_VBAD), castername);
|
msg("^%cYour essence is sucked into %s!", getlfcol(c->lf, CC_VBAD), castername);
|
||||||
|
@ -8762,9 +8763,9 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
getlfname(target, lfname);
|
getlfname(target, lfname);
|
||||||
dam = rolldie(power, 4);
|
dam = rolldie(power, 4);
|
||||||
if (power == 1) {
|
if (power == 1) {
|
||||||
sprintf(attackname, "a spike of mana");
|
snprintf(attackname, BUFLEN, "a spike of mana");
|
||||||
} else {
|
} else {
|
||||||
sprintf(attackname, "%s spikes of mana", numbuf);
|
snprintf(attackname, BUFLEN, "%s spikes of mana", numbuf);
|
||||||
}
|
}
|
||||||
// target takes magical damage
|
// target takes magical damage
|
||||||
// always hit
|
// always hit
|
||||||
|
@ -9052,9 +9053,9 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
} else if (seen) {
|
} else if (seen) {
|
||||||
char copytext[BUFLEN];
|
char copytext[BUFLEN];
|
||||||
if (ndone == 1) {
|
if (ndone == 1) {
|
||||||
sprintf(copytext, "A duplicate");
|
snprintf(copytext, BUFLEN, "A duplicate");
|
||||||
} else {
|
} else {
|
||||||
sprintf(copytext, "%d duplicates", ndone);
|
snprintf(copytext, BUFLEN, "%d duplicates", ndone);
|
||||||
}
|
}
|
||||||
msg("%s of %s appear%s!", copytext, castername, (ndone == 1) ? "s" : "");
|
msg("%s of %s appear%s!", copytext, castername, (ndone == 1) ? "s" : "");
|
||||||
}
|
}
|
||||||
|
@ -9463,7 +9464,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(oidbuf, "%ld", targob->id);
|
snprintf(oidbuf, BUFLEN, "%ld", targob->id);
|
||||||
f = addflag(caster->flags, F_THROWING, B_TRUE, NA, NA, oidbuf);
|
f = addflag(caster->flags, F_THROWING, B_TRUE, NA, NA, oidbuf);
|
||||||
if (!validatespellcell(caster, &targcell, TT_MONSTER, spellid, power, frompot)) return B_TRUE;
|
if (!validatespellcell(caster, &targcell, TT_MONSTER, spellid, power, frompot)) return B_TRUE;
|
||||||
killflagsofid(caster->flags, F_THROWING);
|
killflagsofid(caster->flags, F_THROWING);
|
||||||
|
@ -9980,7 +9981,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (caster && !targcell) targcell = caster->cell;
|
if (caster && !targcell) targcell = caster->cell;
|
||||||
range = 3;
|
range = 3;
|
||||||
|
|
||||||
sprintf(buf, "%s emit%s a blast of psionic power!",castername,isplayer(caster) ? "" : "s");
|
snprintf(buf, BUFLEN, "%s emit%s a blast of psionic power!",castername,isplayer(caster) ? "" : "s");
|
||||||
animradial(targcell, range, '}', C_CYAN, DT_COMPASS, buf, "Something emits a radial blast of psionic power!");
|
animradial(targcell, range, '}', C_CYAN, DT_COMPASS, buf, "Something emits a radial blast of psionic power!");
|
||||||
|
|
||||||
if (isplayer(caster) || haslos(player, targcell)) {
|
if (isplayer(caster) || haslos(player, targcell)) {
|
||||||
|
@ -10616,7 +10617,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
char ptext[BUFLEN];
|
char ptext[BUFLEN];
|
||||||
char distbuf[BUFLEN],dirbuf[BUFLEN];
|
char distbuf[BUFLEN],dirbuf[BUFLEN];
|
||||||
getdisttext(caster->cell, c, distbuf, NULL, dirbuf);
|
getdisttext(caster->cell, c, distbuf, NULL, dirbuf);
|
||||||
sprintf(ptext, "%s: %s (%s to the %s)", mapname, obname, distbuf, dirbuf);
|
snprintf(ptext, BUFLEN, "%s: %s (%s to the %s)", mapname, obname, distbuf, dirbuf);
|
||||||
addchoice(&prompt, ch++, ptext, NULL, o, NULL);
|
addchoice(&prompt, ch++, ptext, NULL, o, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10634,7 +10635,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
real_getlfnamea(c->lf, lfname, NULL, B_SHOWALL, B_REALRACE);
|
real_getlfnamea(c->lf, lfname, NULL, B_SHOWALL, B_REALRACE);
|
||||||
getdisttext(caster->cell, c, distbuf, NULL, dirbuf);
|
getdisttext(caster->cell, c, distbuf, NULL, dirbuf);
|
||||||
sprintf(ptext, "%s: %s (%s to the %s, held by %s)",
|
snprintf(ptext, BUFLEN, "%s: %s (%s to the %s, held by %s)",
|
||||||
mapname, obname, distbuf, dirbuf, lfname);
|
mapname, obname, distbuf, dirbuf, lfname);
|
||||||
|
|
||||||
addchoice(&prompt, ch++, ptext, NULL, o, NULL);
|
addchoice(&prompt, ch++, ptext, NULL, o, NULL);
|
||||||
|
@ -12099,7 +12100,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!reverting) {
|
if (!reverting) {
|
||||||
int newstr;
|
int newstr;
|
||||||
sprintf(origstats, "%d,%d", target->att[A_STR], target->maxhp);
|
snprintf(origstats, BUFLEN, "%d,%d", target->att[A_STR], target->maxhp);
|
||||||
|
|
||||||
// affect str / hp
|
// affect str / hp
|
||||||
newstr = target->att[A_STR] + 50;
|
newstr = target->att[A_STR] + 50;
|
||||||
|
@ -12286,7 +12287,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
anim(caster->cell, targcell, '^', C_WHITE);
|
anim(caster->cell, targcell, '^', C_WHITE);
|
||||||
|
|
||||||
sprintf(buf, "A huge snowball explodes! ");
|
snprintf(buf, BUFLEN, "A huge snowball explodes! ");
|
||||||
animradial(targcell, 1, '}', C_WHITE, DT_ORTH, buf, buf);
|
animradial(targcell, 1, '}', C_WHITE, DT_ORTH, buf, buf);
|
||||||
|
|
||||||
redrawpause();
|
redrawpause();
|
||||||
|
@ -12463,7 +12464,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
|
|
||||||
// link caster to target
|
// link caster to target
|
||||||
sprintf(buf, "%s%s soul link spell", castername, getpossessive(castername));
|
snprintf(buf, BUFLEN, "%s%s soul link spell", castername, getpossessive(castername));
|
||||||
addflag(target->flags, F_SOULLINK, targ2->id, NA, NA, buf);
|
addflag(target->flags, F_SOULLINK, targ2->id, NA, NA, buf);
|
||||||
addflag(targ2->flags, F_SOULLINK, target->id, NA, NA, buf);
|
addflag(targ2->flags, F_SOULLINK, target->id, NA, NA, buf);
|
||||||
|
|
||||||
|
@ -12609,7 +12610,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (f) { // should always be true
|
if (f) { // should always be true
|
||||||
char dambuf[BUFLEN];
|
char dambuf[BUFLEN];
|
||||||
free(f->text);
|
free(f->text);
|
||||||
sprintf(dambuf, "%dd4", power*3);
|
snprintf(dambuf, BUFLEN, "%dd4", power*3);
|
||||||
f->text = strdup(dambuf);
|
f->text = strdup(dambuf);
|
||||||
}
|
}
|
||||||
real_fireat(caster, o, 1, targcell, 6, NULL, B_FALSE, OT_S_SPIKEVOLLEY, NULL);
|
real_fireat(caster, o, 1, targcell, 6, NULL, B_FALSE, OT_S_SPIKEVOLLEY, NULL);
|
||||||
|
@ -12917,8 +12918,8 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (isplayer(caster) && !targcell) {
|
if (isplayer(caster) && !targcell) {
|
||||||
char buf[BUFLEN],buf2[BUFLEN];
|
char buf[BUFLEN],buf2[BUFLEN];
|
||||||
sprintf(buf, "Throw %s where?", obname);
|
snprintf(buf, BUFLEN, "Throw %s where?", obname);
|
||||||
sprintf(buf2, "Superheat->%s->", obname);
|
snprintf(buf2, BUFLEN, "Superheat->%s->", obname);
|
||||||
targcell = askcoords(buf, buf2,TT_MONSTER, caster, getmaxthrowrange(caster, targob), LOF_NEED, B_TRUE);
|
targcell = askcoords(buf, buf2,TT_MONSTER, caster, getmaxthrowrange(caster, targob), LOF_NEED, B_TRUE);
|
||||||
}
|
}
|
||||||
if (!targcell) {
|
if (!targcell) {
|
||||||
|
@ -13195,7 +13196,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
// TODO: start trail from the object
|
// TODO: start trail from the object
|
||||||
snprintf(buf2, BUFLEN, "Telekinesis->%s->",obname);
|
snprintf(buf2, BUFLEN, "Telekinesis->%s->",obname);
|
||||||
|
|
||||||
sprintf(oidbuf, "%ld", targob->id);
|
snprintf(oidbuf, BUFLEN, "%ld", targob->id);
|
||||||
addflag(caster->flags, F_THROWING, B_TRUE, NA, NA, oidbuf);
|
addflag(caster->flags, F_THROWING, B_TRUE, NA, NA, oidbuf);
|
||||||
targcell = askcoords(buf, buf2,TT_MONSTER | TT_PLAYER, caster, UNLIMITED, LOF_DONTNEED, B_FALSE);
|
targcell = askcoords(buf, buf2,TT_MONSTER | TT_PLAYER, caster, UNLIMITED, LOF_DONTNEED, B_FALSE);
|
||||||
killflagsofid(caster->flags, F_THROWING);
|
killflagsofid(caster->flags, F_THROWING);
|
||||||
|
@ -13558,11 +13559,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
char firename[BUFLEN];
|
char firename[BUFLEN];
|
||||||
|
|
||||||
if (power < 5) {
|
if (power < 5) {
|
||||||
sprintf(firename, "small fire");
|
snprintf(firename, BUFLEN, "small fire");
|
||||||
} else if (power < 8) {
|
} else if (power < 8) {
|
||||||
sprintf(firename, "medium fire");
|
snprintf(firename, BUFLEN, "medium fire");
|
||||||
} else {
|
} else {
|
||||||
sprintf(firename, "large fire");
|
snprintf(firename, BUFLEN, "large fire");
|
||||||
}
|
}
|
||||||
|
|
||||||
// get vert distance
|
// get vert distance
|
||||||
|
@ -13904,7 +13905,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
isplayer(targcell->lf) ? "" : "s");
|
isplayer(targcell->lf) ? "" : "s");
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(dambuf, "%s%s warp wood spell", castername, getpossessive(castername));
|
snprintf(dambuf, BUFLEN, "%s%s warp wood spell", castername, getpossessive(castername));
|
||||||
losehp(targcell->lf, dam, DT_DIRECT, caster, dambuf);
|
losehp(targcell->lf, dam, DT_DIRECT, caster, dambuf);
|
||||||
if (haslos(player, targcell)) {
|
if (haslos(player, targcell)) {
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
|
@ -14109,7 +14110,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
f = addtempflag(caster->flags, F_WINDSHIELD, power, NA, NA, NULL, FROMSPELL);
|
f = addtempflag(caster->flags, F_WINDSHIELD, power, NA, NA, NULL, FROMSPELL);
|
||||||
f->obfrom = spellid;
|
f->obfrom = spellid;
|
||||||
|
|
||||||
sprintf(retaltext, "1d%d^whirling debris", power);
|
snprintf(retaltext, BUFLEN, "1d%d^whirling debris", power);
|
||||||
f = addtempflag(target->flags, F_RETALIATE, DT_BASH, NA, NA, retaltext, FROMSPELL);
|
f = addtempflag(target->flags, F_RETALIATE, DT_BASH, NA, NA, retaltext, FROMSPELL);
|
||||||
f->obfrom = spellid;
|
f->obfrom = spellid;
|
||||||
} else if (spellid == OT_S_WISHLIMITED) {
|
} else if (spellid == OT_S_WISHLIMITED) {
|
||||||
|
@ -15692,13 +15693,13 @@ int spellresisted(lifeform_t *target, lifeform_t *caster, int spellid, int power
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
strcpy(text, "You shrug off a mental attack.");
|
strcpy(text, "You shrug off a mental attack.");
|
||||||
} else {
|
} else {
|
||||||
sprintf(text, "%s shrugs off %s mental attack.", buf, isplayer(caster) ? "your" : "a");
|
snprintf(text, BUFLEN, "%s shrugs off %s mental attack.", buf, isplayer(caster) ? "your" : "a");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
strcpy(text, "You resist the effects of a spell.");
|
strcpy(text, "You resist the effects of a spell.");
|
||||||
} else {
|
} else {
|
||||||
sprintf(text, "%s resists %s spell.", buf, isplayer(caster) ? "your" : "a");
|
snprintf(text, BUFLEN, "%s resists %s spell.", buf, isplayer(caster) ? "your" : "a");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
text.c
1
text.c
|
@ -1,3 +1,4 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
Loading…
Reference in New Issue