Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git i/include/extern.h w/include/extern.h
- index b6f4825..bd69e6a 100644
- --- i/include/extern.h
- +++ w/include/extern.h
- @@ -137,6 +137,7 @@ E void NDECL(drag_down);
- /* ### bones.c ### */
- +E boolean FDECL(no_bones_level, (d_level *));
- E void FDECL(sanitize_name, (char *));
- E void FDECL(drop_upon_death, (struct monst *, struct obj *, int, int));
- E boolean NDECL(can_make_bones);
- @@ -713,6 +714,7 @@ E void FDECL(engr_stats, (const char *, char *, long *, long *));
- E void FDECL(del_engr, (struct engr *));
- E void FDECL(rloc_engr, (struct engr *));
- E void FDECL(make_grave, (int, int, const char *));
- +E void FDECL(engrave_on_upstairs, (struct obj *, BOOLEAN_P));
- /* ### exper.c ### */
- diff --git i/src/bones.c w/src/bones.c
- index 33f5f2c..c8a9afb 100644
- --- i/src/bones.c
- +++ w/src/bones.c
- @@ -11,12 +11,11 @@ extern char bones[]; /* from files.c */
- extern long bytes_counted;
- #endif
- -STATIC_DCL boolean FDECL(no_bones_level, (d_level *));
- STATIC_DCL void FDECL(goodfruit, (int));
- STATIC_DCL void FDECL(resetobjs, (struct obj *, BOOLEAN_P));
- STATIC_DCL boolean FDECL(fixuporacle, (struct monst *));
- -STATIC_OVL boolean
- +boolean
- no_bones_level(lev)
- d_level *lev;
- {
- diff --git i/src/end.c w/src/end.c
- index d0b51df..868c7af 100644
- --- i/src/end.c
- +++ w/src/end.c
- @@ -1068,6 +1068,27 @@ int how;
- killer.format = 0;
- return;
- }
- + /* not intended to be a comprehensive check */
- + if (how < GENOCIDED && flags.bones
- + && ledger_no(&u.uz) > 0 && !no_bones_level(&u.uz))
- + {
- + /* Logically some kinds of death should destroy your inventory, too,
- + * but currently even disintegration preserves your stuff in bones.
- + * So, we assume you do have a pack. */
- + struct obj *otmp;
- + for (otmp = invent; otmp; otmp = otmp->nobj)
- + if (otmp->otyp == SCR_EPITAPH && otmp->blessed)
- + {
- + if (!rn2(2))
- + {
- + pline("%s in your pack unfurls and begins to glow...",
- + The(cxname_singular(otmp)));
- + engrave_on_upstairs(otmp, TRUE);
- + useup(otmp);
- + }
- + break;
- + }
- + }
- really_done(how);
- }
- diff --git i/src/engrave.c w/src/engrave.c
- index 48dc2bd..59eda37 100644
- --- i/src/engrave.c
- +++ w/src/engrave.c
- @@ -1286,4 +1286,151 @@ const char *str;
- return;
- }
- +void
- +engrave_on_upstairs(sobj, dead)
- +struct obj *sobj;
- +boolean dead;
- +{
- + char buf[BUFSZ];
- + int lth;
- + int x, y;
- + branch *br;
- + int dist;
- + struct trap *trap;
- + struct dest_area *entr;
- + int tries;
- + int tryx, tryy;
- + boolean blessed = sobj && sobj->blessed;
- + boolean cursed = sobj && sobj->cursed;
- +
- + if (In_endgame(&u.uz))
- + {
- + pline("This close to victory, "
- + "you decide against leaving notes to others.");
- + /* cannot leave bones anyway! */
- + return;
- + }
- + if (dead)
- + pline("From beyond the grave, "
- + "you are allowed to leave one last message to your successors.");
- + else
- + You("may leave a message to your successors.");
- + getlin("What do you want to convey?", buf);
- + mungspaces(buf);
- + lth = strlen(buf);
- + if (lth == 0 || lth == 1 && buf[0] == ' ' || index(buf, '\033'))
- + {
- + pline1(Never_mind);
- + return;
- + }
- + if (!blessed)
- + {
- + int wipe = cursed ? lth / 4 : lth / 16;
- + if (wipe == 0) wipe = cursed ? !rn2(4) : !rn2(16);
- + wipeout_text(buf, wipe, 0);
- + }
- +
- + x = y = 0;
- + br = Is_branchlev(&u.uz);
- + if (br && on_level(&u.uz, &br->end2))
- + switch (br->type) {
- + case BR_STAIR:
- + case BR_NO_END1:
- + x = sstairs.sx;
- + y = sstairs.sy;
- + break;
- + case BR_PORTAL:
- + for (trap = ftrap; trap; trap = trap->ntrap)
- + if (trap->ttyp == MAGIC_PORTAL)
- + {
- + x = trap->tx;
- + y = trap->ty;
- + break;
- + }
- + break;
- + case BR_NO_END2:
- + /* We're in a branch with no exit!
- + * Only the planes normally do this,
- + * and we checked for them above...
- + * Let's try something anyway. */
- + entr = builds_up(&u.uz) ? &dndest : &updest;
- + for (tries = 0; tries < 100; tries++)
- + {
- + tryx = entr->lx ? rn1((entr->hx - entr->lx) + 1, entr->lx)
- + : rnd(COLNO - 1);
- + tryy = entr->lx ? rn1((entr->hy - entr->ly) + 1, entr->ly)
- + : rn2(ROWNO);
- + if (!bad_location(tryx, tryy, entr->nlx, entr->nly,
- + entr->nhx, entr->nhy))
- + {
- + x = tryx;
- + y = tryy;
- + break;
- + }
- + }
- + break;
- + }
- + else if (u.uz.dnum == 0 && u.uz.dlevel == 1)
- + {
- + /* special case: the stair to the surface */
- + x = sstairs.sx;
- + y = sstairs.sy;
- + }
- + else if (builds_up(&u.uz))
- + {
- + /* We're assuming that existing stairs are the primary exit.
- + * It can be argued that in the wizard's tower
- + * the scroll should engrave on the downladder,
- + * but the bones contain the entire level and the 'successor'
- + * will most likely encounter the outside part first. */
- + if (xdnstair)
- + {
- + x = xdnstair;
- + y = ydnstair;
- + }
- + else
- + {
- + x = xdnladder;
- + y = ydnladder;
- + }
- + }
- + else
- + {
- + if (xupstair)
- + {
- + x = xupstair;
- + y = yupstair;
- + }
- + else
- + {
- + x = xupladder;
- + y = yupladder;
- + }
- + }
- +
- + if (!x || !*buf)
- + {
- + /* something went wrong or the message was erased */
- + Your("message went unheeded...");
- + return;
- + }
- + make_engr_at(x, y, buf, moves,
- + blessed ? BURN : cursed ? ENGR_BLOOD : MARK);
- + if (dead)
- + {
- + /* give some feedback */
- + pline("Hopefully the others will be forewarned now.");
- + return;
- + }
- + dist = distu(x, y);
- + if (!dist && !Blind && !u.uswallow)
- + pline("A message appears below you!");
- + else if (cansee(x, y))
- + You_see("a message appear on the %s nearby.",
- + dfeature_at(x, y, buf) ? buf : surface(x, y));
- + else if (!Deaf)
- + You_hear("a %sscribing noise.", dist > 25 ? "faint " : "");
- + return;
- +}
- +
- /*engrave.c*/
- diff --git i/src/mklev.c w/src/mklev.c
- index 5f6afff..96ef22f 100644
- --- i/src/mklev.c
- +++ w/src/mklev.c
- @@ -1645,6 +1645,9 @@ struct mkroom *croom;
- /* Leave a bell, in case we accidentally buried someone alive */
- if (dobell)
- (void) mksobj_at(BELL, m.x, m.y, TRUE, FALSE);
- + /* Some graves have extra epitaphs */
- + else if (!rn2(9))
- + (void) mksobj_at(SCR_EPITAPH, m.x, m.y, TRUE, FALSE);
- return;
- }
- diff --git i/src/objects.c w/src/objects.c
- index 3a8db8d..efe4085 100644
- --- i/src/objects.c
- +++ w/src/objects.c
- @@ -834,7 +834,8 @@ SCROLL("enchant weapon", "DAIYEN FOOELS", 1, 80, 60),
- SCROLL("create monster", "LEP GEX VEN ZEA", 1, 45, 200),
- SCROLL("taming", "PRIRUTSENIE", 1, 15, 200),
- SCROLL("genocide", "ELBIB YLOH", 1, 15, 300),
- -SCROLL("light", "VERR YED HORRE", 1, 90, 50),
- +SCROLL("light", "VERR YED HORRE", 1, 70, 50),
- +SCROLL("epitaph", "REQUIESCAT IN PACE", 1, 20, 50),
- SCROLL("teleportation", "VENZAR BORGAVVE", 1, 55, 100),
- SCROLL("gold detection", "THARR", 1, 33, 100),
- SCROLL("food detection", "YUM YUM", 1, 25, 100),
- diff --git i/src/read.c w/src/read.c
- index 02cb79b..397ea85 100644
- --- i/src/read.c
- +++ w/src/read.c
- @@ -1454,6 +1454,29 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
- TRUE);
- }
- break;
- + case SCR_EPITAPH:
- + if (confused)
- + {
- + if (levl[u.ux][u.uy].typ != GRAVE)
- + make_grave(u.ux, u.uy, (char *) 0);
- + if (levl[u.ux][u.uy].typ == GRAVE)
- + {
- + You("spend a minute dwelling on the fate "
- + "of those who went before you.");
- + newsym(u.ux, u.uy);
- + }
- + else
- + pline("This is hardly the proper time " /* or place */
- + "to reminisce about the dead.");
- + }
- + else
- + {
- + known = 1;
- + if (!already_known) /* "was" is intentional */
- + pline("This was a scroll of epitaph.");
- + engrave_on_upstairs(sobj, FALSE);
- + }
- + break;
- case SCR_TELEPORTATION:
- if (confused || scursed) {
- level_tele();
Add Comment
Please, Sign In to add comment