engraving pristine text field not properly filled
level creation was not populating the pristine text field of engraving appropriately
This commit is contained in:
@@ -1515,6 +1515,8 @@ Fire and Frost Brand can be invoked for expert level fireball or cone of cold
|
|||||||
wielding Trollsbane grants hungerless regeneration
|
wielding Trollsbane grants hungerless regeneration
|
||||||
hitting with Ogresmasher gives a higher chance of knockback
|
hitting with Ogresmasher gives a higher chance of knockback
|
||||||
Snickersnee can hit at a distance once per turn for free
|
Snickersnee can hit at a distance once per turn for free
|
||||||
|
the engraving pristine text field was not being appropriately populated during
|
||||||
|
level creation
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||||
|
|||||||
+2
-2
@@ -975,7 +975,7 @@ extern char *build_english_list(char *) NONNULLARG1;
|
|||||||
|
|
||||||
/* ### engrave.c ### */
|
/* ### engrave.c ### */
|
||||||
|
|
||||||
extern char *random_engraving(char *) NONNULLARG1;
|
extern char *random_engraving(char *, char *) NONNULLARG12;
|
||||||
extern void wipeout_text(char *, int, unsigned) NONNULLARG1;
|
extern void wipeout_text(char *, int, unsigned) NONNULLARG1;
|
||||||
extern boolean can_reach_floor(boolean);
|
extern boolean can_reach_floor(boolean);
|
||||||
extern void cant_reach_floor(coordxy, coordxy, boolean, boolean);
|
extern void cant_reach_floor(coordxy, coordxy, boolean, boolean);
|
||||||
@@ -984,7 +984,7 @@ extern struct engr *sengr_at(const char *, coordxy, coordxy, boolean) NONNULLARG
|
|||||||
extern void u_wipe_engr(int);
|
extern void u_wipe_engr(int);
|
||||||
extern void wipe_engr_at(coordxy, coordxy, xint16, boolean);
|
extern void wipe_engr_at(coordxy, coordxy, xint16, boolean);
|
||||||
extern void read_engr_at(coordxy, coordxy);
|
extern void read_engr_at(coordxy, coordxy);
|
||||||
extern void make_engr_at(coordxy, coordxy, const char *, long, int) NONNULLARG3;
|
extern void make_engr_at(coordxy, coordxy, const char *, const char *, long, int) NONNULLARG3;
|
||||||
extern void del_engr_at(coordxy, coordxy);
|
extern void del_engr_at(coordxy, coordxy);
|
||||||
extern int freehand(void);
|
extern int freehand(void);
|
||||||
extern int doengrave(void);
|
extern int doengrave(void);
|
||||||
|
|||||||
+18
-7
@@ -48,15 +48,16 @@ staticfn int engrave(void);
|
|||||||
staticfn const char *blengr(void);
|
staticfn const char *blengr(void);
|
||||||
|
|
||||||
char *
|
char *
|
||||||
random_engraving(char *outbuf)
|
random_engraving(char *outbuf, char *pristine_copy)
|
||||||
{
|
{
|
||||||
const char *rumor;
|
const char *rumor;
|
||||||
|
|
||||||
/* a random engraving may come from the "rumors" file,
|
/* a random engraving may come from the "rumors" file,
|
||||||
or from the "engrave" file (formerly in an array here) */
|
or from the "engrave" file (formerly in an array here) */
|
||||||
if (!rn2(4) || !(rumor = getrumor(0, outbuf, TRUE)) || !*rumor)
|
if (!rn2(4) || !(rumor = getrumor(0, pristine_copy, TRUE)) || !*rumor)
|
||||||
(void) get_rnd_text(ENGRAVEFILE, outbuf, rn2, MD_PAD_RUMORS);
|
(void) get_rnd_text(ENGRAVEFILE, pristine_copy, rn2, MD_PAD_RUMORS);
|
||||||
|
|
||||||
|
Strcpy(outbuf, pristine_copy);
|
||||||
wipeout_text(outbuf, (int) (strlen(outbuf) / 4), 0);
|
wipeout_text(outbuf, (int) (strlen(outbuf) / 4), 0);
|
||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
@@ -391,13 +392,21 @@ void
|
|||||||
make_engr_at(
|
make_engr_at(
|
||||||
coordxy x, coordxy y,
|
coordxy x, coordxy y,
|
||||||
const char *s,
|
const char *s,
|
||||||
|
const char *pristine_s,
|
||||||
long e_time,
|
long e_time,
|
||||||
int e_type)
|
int e_type)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct engr *ep;
|
struct engr *ep;
|
||||||
unsigned smem = Strlen(s) + 1;
|
unsigned smem = Strlen(s) + 1;
|
||||||
|
boolean havepristine = FALSE;
|
||||||
|
|
||||||
|
if (pristine_s != NULL) {
|
||||||
|
unsigned prmem = Strlen(pristine_s) + 1;
|
||||||
|
if (prmem > smem)
|
||||||
|
smem = prmem;
|
||||||
|
havepristine = TRUE;
|
||||||
|
}
|
||||||
if ((ep = engr_at(x, y)) != 0)
|
if ((ep = engr_at(x, y)) != 0)
|
||||||
del_engr(ep);
|
del_engr(ep);
|
||||||
|
|
||||||
@@ -412,6 +421,8 @@ make_engr_at(
|
|||||||
ep->engr_txt[pristine_text] = ep->engr_txt[remembered_text] + smem;
|
ep->engr_txt[pristine_text] = ep->engr_txt[remembered_text] + smem;
|
||||||
for(i = 0; i < text_states; ++i)
|
for(i = 0; i < text_states; ++i)
|
||||||
Strcpy(ep->engr_txt[i], s);
|
Strcpy(ep->engr_txt[i], s);
|
||||||
|
if (havepristine)
|
||||||
|
Strcpy(ep->engr_txt[pristine_text], pristine_s);
|
||||||
if (!strcmp(s, "Elbereth")) {
|
if (!strcmp(s, "Elbereth")) {
|
||||||
/* engraving "Elbereth": if done when making a level, it creates
|
/* engraving "Elbereth": if done when making a level, it creates
|
||||||
an old-style Elbereth that deters monsters when any objects are
|
an old-style Elbereth that deters monsters when any objects are
|
||||||
@@ -591,7 +602,7 @@ doengrave_sfx_item_WAN(struct _doengrave_ctx *de)
|
|||||||
if (de->oep) {
|
if (de->oep) {
|
||||||
if (!Blind) {
|
if (!Blind) {
|
||||||
de->type = (xint16) 0; /* random */
|
de->type = (xint16) 0; /* random */
|
||||||
(void) random_engraving(de->buf);
|
(void) random_engraving(de->buf, de->ebuf);
|
||||||
} else {
|
} else {
|
||||||
/* keep the same type so that feels don't
|
/* keep the same type so that feels don't
|
||||||
change and only the text is altered,
|
change and only the text is altered,
|
||||||
@@ -1036,7 +1047,7 @@ doengrave(void)
|
|||||||
if (*de->buf) {
|
if (*de->buf) {
|
||||||
struct engr *tmp_ep;
|
struct engr *tmp_ep;
|
||||||
|
|
||||||
make_engr_at(u.ux, u.uy, de->buf, svm.moves, de->type);
|
make_engr_at(u.ux, u.uy, de->buf, de->ebuf, svm.moves, de->type);
|
||||||
tmp_ep = engr_at(u.ux, u.uy);
|
tmp_ep = engr_at(u.ux, u.uy);
|
||||||
if (!Blind) {
|
if (!Blind) {
|
||||||
if (tmp_ep != 0) {
|
if (tmp_ep != 0) {
|
||||||
@@ -1422,7 +1433,7 @@ engrave(void)
|
|||||||
|
|
||||||
(void) strncat(buf, svc.context.engraving.nextc,
|
(void) strncat(buf, svc.context.engraving.nextc,
|
||||||
min(space_left, endc - svc.context.engraving.nextc));
|
min(space_left, endc - svc.context.engraving.nextc));
|
||||||
make_engr_at(u.ux, u.uy, buf, svm.moves - gm.multi,
|
make_engr_at(u.ux, u.uy, buf, NULL, svm.moves - gm.multi,
|
||||||
svc.context.engraving.type);
|
svc.context.engraving.type);
|
||||||
oep = engr_at(u.ux, u.uy);
|
oep = engr_at(u.ux, u.uy);
|
||||||
if (oep) {
|
if (oep) {
|
||||||
@@ -1662,7 +1673,7 @@ make_grave(coordxy x, coordxy y, const char *str)
|
|||||||
del_engr_at(x, y);
|
del_engr_at(x, y);
|
||||||
if (!str)
|
if (!str)
|
||||||
str = get_rnd_text(EPITAPHFILE, buf, rn2, MD_PAD_RUMORS);
|
str = get_rnd_text(EPITAPHFILE, buf, rn2, MD_PAD_RUMORS);
|
||||||
make_engr_at(x, y, str, 0L, HEADSTONE);
|
make_engr_at(x, y, str, NULL, 0L, HEADSTONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -763,7 +763,7 @@ makeniche(int trap_type)
|
|||||||
ttmp->once = 1;
|
ttmp->once = 1;
|
||||||
if (trap_engravings[trap_type]) {
|
if (trap_engravings[trap_type]) {
|
||||||
make_engr_at(xx, yy - dy,
|
make_engr_at(xx, yy - dy,
|
||||||
trap_engravings[trap_type], 0L,
|
trap_engravings[trap_type], NULL, 0L,
|
||||||
DUST);
|
DUST);
|
||||||
wipe_engr_at(xx, yy - dy, 5,
|
wipe_engr_at(xx, yy - dy, 5,
|
||||||
FALSE); /* age it a little */
|
FALSE); /* age it a little */
|
||||||
@@ -1136,8 +1136,8 @@ fill_ordinary_room(
|
|||||||
|
|
||||||
/* maybe make some graffiti */
|
/* maybe make some graffiti */
|
||||||
if (!rn2(27 + 3 * abs(depth(&u.uz)))) {
|
if (!rn2(27 + 3 * abs(depth(&u.uz)))) {
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ], pristinebuf[BUFSZ];
|
||||||
const char *mesg = random_engraving(buf);
|
const char *mesg = random_engraving(buf, pristinebuf);
|
||||||
|
|
||||||
if (mesg) {
|
if (mesg) {
|
||||||
do {
|
do {
|
||||||
@@ -1146,7 +1146,7 @@ fill_ordinary_room(
|
|||||||
y = pos.y;
|
y = pos.y;
|
||||||
} while (levl[x][y].typ != ROOM && !rn2(40));
|
} while (levl[x][y].typ != ROOM && !rn2(40));
|
||||||
if (levl[x][y].typ == ROOM)
|
if (levl[x][y].typ == ROOM)
|
||||||
make_engr_at(x, y, mesg, 0L, MARK);
|
make_engr_at(x, y, mesg, pristinebuf, 0L, MARK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -755,7 +755,7 @@ stock_room(int shp_indx, struct mkroom *sroom)
|
|||||||
else if (inside_shop(sx, sy - 1))
|
else if (inside_shop(sx, sy - 1))
|
||||||
n++;
|
n++;
|
||||||
Sprintf(buf, "Closed for inventory");
|
Sprintf(buf, "Closed for inventory");
|
||||||
make_engr_at(m, n, buf, 0L, DUST);
|
make_engr_at(m, n, buf, NULL, 0L, DUST);
|
||||||
if (levl[m][n].typ != CORR && levl[m][n].typ != ROOM)
|
if (levl[m][n].typ != CORR && levl[m][n].typ != ROOM)
|
||||||
levl[m][n].typ = (Is_special(&u.uz)
|
levl[m][n].typ = (Is_special(&u.uz)
|
||||||
|| *in_rooms(m, n, 0)) ? ROOM : CORR;
|
|| *in_rooms(m, n, 0)) ? ROOM : CORR;
|
||||||
|
|||||||
+1
-1
@@ -3912,7 +3912,7 @@ lspo_engraving(lua_State *L)
|
|||||||
ecoord = SP_COORD_PACK(x, y);
|
ecoord = SP_COORD_PACK(x, y);
|
||||||
|
|
||||||
get_location_coord(&x, &y, DRY, gc.coder->croom, ecoord);
|
get_location_coord(&x, &y, DRY, gc.coder->croom, ecoord);
|
||||||
make_engr_at(x, y, txt, 0L, etyp);
|
make_engr_at(x, y, txt, NULL, 0L, etyp);
|
||||||
Free(txt);
|
Free(txt);
|
||||||
ep = engr_at(x, y);
|
ep = engr_at(x, y);
|
||||||
if (ep) {
|
if (ep) {
|
||||||
|
|||||||
@@ -3628,7 +3628,7 @@ zap_map(
|
|||||||
ttmp = t_at(x, y); /* refresh in case trap was altered or is gone */
|
ttmp = t_at(x, y); /* refresh in case trap was altered or is gone */
|
||||||
|
|
||||||
if (u.dz > 0) { /* zapping down */
|
if (u.dz > 0) { /* zapping down */
|
||||||
char ebuf[BUFSZ];
|
char ebuf[BUFSZ], pristinebuf[BUFSZ], *etxt;
|
||||||
struct engr *e = engr_at(x, y);
|
struct engr *e = engr_at(x, y);
|
||||||
|
|
||||||
/* subset of engraving effects; none sets `disclose' */
|
/* subset of engraving effects; none sets `disclose' */
|
||||||
@@ -3637,7 +3637,8 @@ zap_map(
|
|||||||
case WAN_POLYMORPH:
|
case WAN_POLYMORPH:
|
||||||
case SPE_POLYMORPH:
|
case SPE_POLYMORPH:
|
||||||
del_engr(e);
|
del_engr(e);
|
||||||
make_engr_at(x, y, random_engraving(ebuf), svm.moves, 0);
|
etxt = random_engraving(ebuf, pristinebuf);
|
||||||
|
make_engr_at(x, y, etxt, pristinebuf, svm.moves, 0);
|
||||||
break;
|
break;
|
||||||
case WAN_CANCELLATION:
|
case WAN_CANCELLATION:
|
||||||
case SPE_CANCELLATION:
|
case SPE_CANCELLATION:
|
||||||
|
|||||||
Reference in New Issue
Block a user