Guest User

NetHack artifact sacrifice patch v1.1 (3.6.6 rebase)

a guest
Jun 9th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 19.66 KB | None | 0 0
  1. diff --git c/include/extern.h w/include/extern.h
  2. index a1b32f7..b6be6f5 100644
  3. --- c/include/extern.h
  4. +++ w/include/extern.h
  5. @@ -61,8 +61,8 @@ E void FDECL(restore_artifacts, (int));
  6.  E const char *FDECL(artiname, (int));
  7.  E struct obj *FDECL(mk_artifact, (struct obj *, ALIGNTYP_P));
  8.  E const char *FDECL(artifact_name, (const char *, short *));
  9. -E boolean FDECL(exist_artifact, (int, const char *));
  10. -E void FDECL(artifact_exists, (struct obj *, const char *, BOOLEAN_P));
  11. +E int FDECL(exist_artifact, (int, const char *));
  12. +E void FDECL(artifact_exists, (struct obj *, const char *, int));
  13.  E int NDECL(nartifact_exist);
  14.  E boolean FDECL(arti_immune, (struct obj *, int));
  15.  E boolean FDECL(spec_ability, (struct obj *, unsigned long));
  16. @@ -431,7 +431,7 @@ E void FDECL(new_oname, (struct obj *, int));
  17.  E void FDECL(free_oname, (struct obj *));
  18.  E const char *FDECL(safe_oname, (struct obj *));
  19.  E struct monst *FDECL(christen_monst, (struct monst *, const char *));
  20. -E struct obj *FDECL(oname, (struct obj *, const char *));
  21. +E struct obj *FDECL(oname, (struct obj *, const char *, int));
  22.  E boolean FDECL(objtyp_is_callable, (int));
  23.  E int NDECL(docallcmd);
  24.  E void FDECL(docall, (struct obj *));
  25. diff --git c/include/hack.h w/include/hack.h
  26. index b0e44dd..c0e8cd5 100644
  27. --- c/include/hack.h
  28. +++ w/include/hack.h
  29. @@ -443,6 +443,26 @@ enum bodypart_types {
  30.  #define CHAIN_IN_MON (u.uswallow && uchain && uchain->where == OBJ_FREE)
  31.  #define NODIAG(monnum) ((monnum) == PM_GRID_BUG)
  32.  
  33. +/* Flags to track artifact generation */
  34. +enum artifact_background {
  35. +    ARTIFROM_GONE = -1,
  36. +    ARTIFROM_NONE = 0,
  37. +    ARTIFROM_FOUND,
  38. +    ARTIFROM_NAMED,
  39. +    ARTIFROM_BONES,
  40. +    ARTIFROM_GIFTED_CHAOTIC,
  41. +    ARTIFROM_GIFTED_NEUTRAL,
  42. +    ARTIFROM_GIFTED_LAWFUL,
  43. +    ARTIFROM_WISHED,
  44. +};
  45. +#define ARTIFROM_GIFTED(alignment) ((alignment == A_NONE) ? ARTIFROM_NONE \
  46. +                                    : ARTIFROM_GIFTED_NEUTRAL + sgn(alignment))
  47. +#define ARTIFROM_IS_GIFTED(bg) ((bg) == ARTIFROM_GIFTED_CHAOTIC \
  48. +                                || (bg) == ARTIFROM_GIFTED_NEUTRAL \
  49. +                                || (bg) == ARTIFROM_GIFTED_LAWFUL)
  50. +#define ARTIFROM_GIFTED_BY(bg) (ARTIFROM_IS_GIFTED(bg) \
  51. +                                ? (bg) - ARTIFROM_GIFTED_NEUTRAL : A_NONE)
  52. +
  53.  /* Flags to control menus */
  54.  #define MENUTYPELEN sizeof("traditional ")
  55.  #define MENU_TRADITIONAL 0
  56. diff --git c/src/artifact.c w/src/artifact.c
  57. index 03573fe..5da805d 100644
  58. --- c/src/artifact.c
  59. +++ w/src/artifact.c
  60. @@ -44,8 +44,10 @@ STATIC_DCL int FDECL(count_surround_traps, (int, int));
  61.  /* coordinate effects from spec_dbon() with messages in artifact_hit() */
  62.  STATIC_OVL int spec_dbon_applies = 0;
  63.  
  64. -/* flags including which artifacts have already been created */
  65. -static boolean artiexist[1 + NROFARTIFACTS + 1];
  66. +/* flags including which artifacts have already been created
  67. + * used to be boolean, now is an enum; but declared as schar
  68. + * to hopefully preserve savefile compatibility as much as possible */
  69. +static schar artiexist[1 + NROFARTIFACTS + 1];
  70.  /* and a discovery list for them (no dummy first entry here) */
  71.  STATIC_OVL xchar artidisco[NROFARTIFACTS];
  72.  
  73. @@ -195,11 +197,9 @@ aligntyp alignment; /* target alignment, or A_NONE */
  74.          if (by_align)
  75.              otmp = mksobj((int) a->otyp, TRUE, FALSE);
  76.  
  77. -        if (otmp) {
  78. -            otmp = oname(otmp, a->name);
  79. -            otmp->oartifact = m;
  80. -            artiexist[m] = TRUE;
  81. -        }
  82. +        if (otmp)
  83. +            otmp = oname(otmp, a->name, by_align ? ARTIFROM_GIFTED(alignment)
  84. +                                                 : ARTIFROM_FOUND);
  85.      } else {
  86.          /* nothing appropriate could be found; return original object */
  87.          if (by_align)
  88. @@ -239,26 +239,26 @@ short *otyp;
  89.      return (char *) 0;
  90.  }
  91.  
  92. -boolean
  93. +int
  94.  exist_artifact(otyp, name)
  95.  int otyp;
  96.  const char *name;
  97.  {
  98.      register const struct artifact *a;
  99. -    boolean *arex;
  100. +    schar *arex;
  101.  
  102.      if (otyp && *name)
  103.          for (a = artilist + 1, arex = artiexist + 1; a->otyp; a++, arex++)
  104.              if ((int) a->otyp == otyp && !strcmp(a->name, name))
  105. -                return *arex;
  106. -    return FALSE;
  107. +                return (int) *arex;
  108. +    return ARTIFROM_NONE;
  109.  }
  110.  
  111.  void
  112.  artifact_exists(otmp, name, mod)
  113.  struct obj *otmp;
  114.  const char *name;
  115. -boolean mod;
  116. +int mod;
  117.  {
  118.      register const struct artifact *a;
  119.  
  120. @@ -266,7 +266,7 @@ boolean mod;
  121.          for (a = artilist + 1; a->otyp; a++)
  122.              if (a->otyp == otmp->otyp && !strcmp(a->name, name)) {
  123.                  register int m = (int) (a - artilist);
  124. -                otmp->oartifact = (char) (mod ? m : 0);
  125. +                otmp->oartifact = (char) (mod > 0 ? m : 0);
  126.                  otmp->age = 0;
  127.                  if (otmp->otyp == RIN_INCREASE_DAMAGE)
  128.                      otmp->spe = 0;
  129. @@ -283,7 +283,7 @@ nartifact_exist()
  130.      int n = SIZE(artiexist);
  131.  
  132.      while (n > 1)
  133. -        if (artiexist[--n])
  134. +        if (artiexist[--n] > 0)
  135.              a++;
  136.  
  137.      return a;
  138. diff --git c/src/bones.c w/src/bones.c
  139. index da0de0f..887e97a 100644
  140. --- c/src/bones.c
  141. +++ w/src/bones.c
  142. @@ -80,7 +80,7 @@ boolean restore;
  143.                      if (has_oname(otmp))
  144.                          free_oname(otmp);
  145.                  } else {
  146. -                    artifact_exists(otmp, safe_oname(otmp), TRUE);
  147. +                    artifact_exists(otmp, safe_oname(otmp), ARTIFROM_BONES);
  148.                  }
  149.              } else if (has_oname(otmp)) {
  150.                  sanitize_name(ONAME(otmp));
  151. diff --git c/src/do_name.c w/src/do_name.c
  152. index f1d8d5b..a6530a2 100644
  153. --- c/src/do_name.c
  154. +++ w/src/do_name.c
  155. @@ -1195,8 +1195,6 @@ do_mname()
  156.          (void) christen_monst(mtmp, buf);
  157.  }
  158.  
  159. -STATIC_VAR int via_naming = 0;
  160. -
  161.  /*
  162.   * This routine used to change the address of 'obj' so be unsafe if not
  163.   * used with extreme care.  Applying a name to an object no longer
  164. @@ -1274,15 +1272,14 @@ register struct obj *obj;
  165.             a valid artifact name */
  166.          u.uconduct.literate++;
  167.      }
  168. -    ++via_naming; /* This ought to be an argument rather than a static... */
  169. -    obj = oname(obj, buf);
  170. -    --via_naming; /* ...but oname() is used in a lot of places, so defer. */
  171. +    obj = oname(obj, buf, ARTIFROM_NAMED);
  172.  }
  173.  
  174.  struct obj *
  175. -oname(obj, name)
  176. +oname(obj, name, how)
  177.  struct obj *obj;
  178.  const char *name;
  179. +int how;
  180.  {
  181.      int lth;
  182.      char buf[PL_PSIZ];
  183. @@ -1304,8 +1301,8 @@ const char *name;
  184.      if (lth)
  185.          Strcpy(ONAME(obj), name);
  186.  
  187. -    if (lth)
  188. -        artifact_exists(obj, name, TRUE);
  189. +    if (lth && how > 0)
  190. +        artifact_exists(obj, name, how);
  191.      if (obj->oartifact) {
  192.          /* can't dual-wield with artifact as secondary weapon */
  193.          if (obj == uswapwep)
  194. @@ -1316,7 +1313,7 @@ const char *name;
  195.          /* if obj is owned by a shop, increase your bill */
  196.          if (obj->unpaid)
  197.              alter_cost(obj, 0L);
  198. -        if (via_naming) {
  199. +        if (how == ARTIFROM_NAMED) {
  200.              /* violate illiteracy conduct since successfully wrote arti-name */
  201.              u.uconduct.literate++;
  202.          }
  203. diff --git c/src/eat.c w/src/eat.c
  204. index 5e2aa1a..6262f8d 100644
  205. --- c/src/eat.c
  206. +++ w/src/eat.c
  207. @@ -58,8 +58,6 @@ char msgbuf[BUFSZ];
  208.      ((otyp) == LEMBAS_WAFER || (otyp) == CRAM_RATION)
  209.  
  210.  STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 };
  211. -STATIC_OVL NEARDATA const char offerfodder[] = { FOOD_CLASS, AMULET_CLASS,
  212. -                                                 0 };
  213.  
  214.  /* Gold must come first for getobj(). */
  215.  STATIC_OVL NEARDATA const char allobj[] = {
  216. @@ -3145,6 +3143,7 @@ int corpsecheck; /* 0, no check, 1, corpses, 2, tinnable corpses */
  217.          if (corpsecheck
  218.                  ? (otmp->otyp == CORPSE
  219.                     && (corpsecheck == 1 || tinnable(otmp)))
  220. +                  || (offering && otmp->oartifact)
  221.                  : feeding ? (otmp->oclass != COIN_CLASS && is_edible(otmp))
  222.                            : otmp->oclass == FOOD_CLASS) {
  223.              char qsfx[QBUFSZ];
  224. @@ -3177,9 +3176,10 @@ int corpsecheck; /* 0, no check, 1, corpses, 2, tinnable corpses */
  225.      /* We cannot use ALL_CLASSES since that causes getobj() to skip its
  226.       * "ugly checks" and we need to check for inedible items.
  227.       */
  228. -    otmp = getobj(feeding ? allobj : offering ? offerfodder : comestibles,
  229. +    otmp = getobj(feeding || offering ? allobj : comestibles,
  230.                    verb);
  231. -    if (corpsecheck && otmp && !(offering && otmp->oclass == AMULET_CLASS))
  232. +    if (corpsecheck && otmp && !(offering && (otmp->oclass == AMULET_CLASS
  233. +                                              || otmp->oartifact)))
  234.          if (otmp->otyp != CORPSE || (corpsecheck == 2 && !tinnable(otmp))) {
  235.              You_cant("%s that!", verb);
  236.              return (struct obj *) 0;
  237. diff --git c/src/fountain.c w/src/fountain.c
  238. index 57e9145..036514e 100644
  239. --- c/src/fountain.c
  240. +++ w/src/fountain.c
  241. @@ -388,7 +388,7 @@ register struct obj *obj;
  242.              pline(
  243.                "From the murky depths, a hand reaches up to bless the sword.");
  244.              pline("As the hand retreats, the fountain disappears!");
  245. -            obj = oname(obj, artiname(ART_EXCALIBUR));
  246. +            obj = oname(obj, artiname(ART_EXCALIBUR), ARTIFROM_FOUND);
  247.              discover_artifact(ART_EXCALIBUR);
  248.              bless(obj);
  249.              obj->oeroded = obj->oeroded2 = 0;
  250. diff --git c/src/invent.c w/src/invent.c
  251. index 7e7e3b2..b026144 100644
  252. --- c/src/invent.c
  253. +++ w/src/invent.c
  254. @@ -731,7 +731,7 @@ struct obj **potmp, **pobj;
  255.          else if (!Is_pudding(otmp))
  256.              otmp->owt += obj->owt;
  257.          if (!has_oname(otmp) && has_oname(obj))
  258. -            otmp = *potmp = oname(otmp, ONAME(obj));
  259. +            otmp = *potmp = oname(otmp, ONAME(obj), ARTIFROM_NONE);
  260.          obj_extract_self(obj);
  261.  
  262.          /* really should merge the timeouts */
  263. @@ -1533,7 +1533,7 @@ register const char *let, *word;
  264.               || (!strcmp(word, "eat") && !is_edible(otmp))
  265.               || (!strcmp(word, "sacrifice")
  266.                   && (otyp != CORPSE && otyp != AMULET_OF_YENDOR
  267. -                     && otyp != FAKE_AMULET_OF_YENDOR))
  268. +                     && otyp != FAKE_AMULET_OF_YENDOR && !otmp->oartifact))
  269.               || (!strcmp(word, "write with")
  270.                   && (otmp->oclass == TOOL_CLASS
  271.                       && otyp != MAGIC_MARKER && otyp != TOWEL))
  272. diff --git c/src/mail.c w/src/mail.c
  273. index 064b69b..386b4d9 100644
  274. --- c/src/mail.c
  275. +++ w/src/mail.c
  276. @@ -409,7 +409,7 @@ struct mail_info *info;
  277.          struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE);
  278.  
  279.          if (info->object_nam)
  280. -            obj = oname(obj, info->object_nam);
  281. +            obj = oname(obj, info->object_nam, ARTIFROM_NONE);
  282.          if (info->response_cmd)
  283.              new_omailcmd(obj, info->response_cmd);
  284.  
  285. diff --git c/src/makemon.c w/src/makemon.c
  286. index 3145ad6..e504b46 100644
  287. --- c/src/makemon.c
  288. +++ w/src/makemon.c
  289. @@ -331,7 +331,8 @@ register struct monst *mtmp;
  290.              /* maybe make it special */
  291.              if (!rn2(20) || is_lord(ptr))
  292.                  otmp = oname(otmp,
  293. -                             artiname(rn2(2) ? ART_DEMONBANE : ART_SUNSWORD));
  294. +                             artiname(rn2(2) ? ART_DEMONBANE : ART_SUNSWORD),
  295. +                             ARTIFROM_FOUND);
  296.              bless(otmp);
  297.              otmp->oerodeproof = TRUE;
  298.              otmp->spe = rn2(4);
  299. diff --git c/src/mkobj.c w/src/mkobj.c
  300. index 17265ff..a10f71d 100644
  301. --- c/src/mkobj.c
  302. +++ w/src/mkobj.c
  303. @@ -385,7 +385,7 @@ struct obj *obj2, *obj1;
  304.      if (!obj2->oextra)
  305.          obj2->oextra = newoextra();
  306.      if (has_oname(obj1))
  307. -        oname(obj2, ONAME(obj1));
  308. +        oname(obj2, ONAME(obj1), ARTIFROM_NONE);
  309.      if (has_omonst(obj1)) {
  310.          if (!OMONST(obj2))
  311.              newomonst(obj2);
  312. @@ -1100,7 +1100,7 @@ boolean artif;
  313.          break;
  314.      case SPE_NOVEL:
  315.          otmp->novelidx = -1; /* "none of the above"; will be changed */
  316. -        otmp = oname(otmp, noveltitle(&otmp->novelidx));
  317. +        otmp = oname(otmp, noveltitle(&otmp->novelidx), ARTIFROM_NONE);
  318.          break;
  319.      }
  320.  
  321. @@ -1697,7 +1697,7 @@ const char *nm;
  322.  
  323.      otmp = mkcorpstat(objtype, (struct monst *) 0, ptr, x, y, corpstatflags);
  324.      if (nm)
  325. -        otmp = oname(otmp, nm);
  326. +        otmp = oname(otmp, nm, ARTIFROM_NONE);
  327.      return otmp;
  328.  }
  329.  
  330. diff --git c/src/mon.c w/src/mon.c
  331. index 4f0a13d..81a206c 100644
  332. --- c/src/mon.c
  333. +++ w/src/mon.c
  334. @@ -468,7 +468,7 @@ unsigned corpseflags;
  335.          bypass_obj(obj);
  336.  
  337.      if (has_mname(mtmp))
  338. -        obj = oname(obj, MNAME(mtmp));
  339. +        obj = oname(obj, MNAME(mtmp), ARTIFROM_NONE);
  340.  
  341.      /*  Avoid "It was hidden under a green mold corpse!"
  342.       *  during Blind combat. An unseen monster referred to as "it"
  343. @@ -2235,7 +2235,7 @@ struct monst *mdef;
  344.             item-conferred attributes */
  345.          otmp = mkcorpstat(STATUE, mdef, mdef->data, x, y, CORPSTAT_NONE);
  346.          if (has_mname(mdef))
  347. -            otmp = oname(otmp, MNAME(mdef));
  348. +            otmp = oname(otmp, MNAME(mdef), ARTIFROM_NONE);
  349.          while ((obj = oldminvent) != 0) {
  350.              oldminvent = obj->nobj;
  351.              obj->nobj = 0; /* avoid merged-> obfree-> dealloc_obj-> panic */
  352. diff --git c/src/objnam.c w/src/objnam.c
  353. index 7205bb4..e649f3f 100644
  354. --- c/src/objnam.c
  355. +++ w/src/objnam.c
  356. @@ -4077,7 +4077,7 @@ struct obj *no_wish;
  357.                  name = novelname;
  358.          }
  359.  
  360. -        otmp = oname(otmp, name);
  361. +        otmp = oname(otmp, name, ARTIFROM_WISHED);
  362.          /* name==aname => wished for artifact (otmp->oartifact => got it) */
  363.          if (otmp->oartifact || name == aname) {
  364.              otmp->quan = 1L;
  365. @@ -4089,7 +4089,7 @@ struct obj *no_wish;
  366.      /* and make them pay; charge them for the wish anyway! */
  367.      if ((is_quest_artifact(otmp)
  368.           || (otmp->oartifact && rn2(nartifact_exist()) > 1)) && !wizard) {
  369. -        artifact_exists(otmp, safe_oname(otmp), FALSE);
  370. +        artifact_exists(otmp, safe_oname(otmp), ARTIFROM_NONE);
  371.          obfree(otmp, (struct obj *) 0);
  372.          otmp = (struct obj *) &zeroobj;
  373.          pline("For a moment, you feel %s in your %s, but it disappears!",
  374. diff --git c/src/pickup.c w/src/pickup.c
  375. index 76f35aa..9720428 100644
  376. --- c/src/pickup.c
  377. +++ w/src/pickup.c
  378. @@ -2437,7 +2437,7 @@ boolean makecat, givemsg;
  379.                 now rather than from when this special corpse got created */
  380.              deadcat->age = monstermoves;
  381.              set_corpsenm(deadcat, PM_HOUSECAT);
  382. -            deadcat = oname(deadcat, sc);
  383. +            deadcat = oname(deadcat, sc, ARTIFROM_NONE);
  384.          }
  385.          if (givemsg)
  386.              pline_The("%s inside the box is dead!",
  387. diff --git c/src/pray.c w/src/pray.c
  388. index 79369fc..e1992cf 100644
  389. --- c/src/pray.c
  390. +++ w/src/pray.c
  391. @@ -841,7 +841,7 @@ gcrownu()
  392.          } else if (obj && obj->otyp == LONG_SWORD && !obj->oartifact) {
  393.              if (!Blind)
  394.                  Your("sword shines brightly for a moment.");
  395. -            obj = oname(obj, artiname(ART_EXCALIBUR));
  396. +            obj = oname(obj, artiname(ART_EXCALIBUR), ARTIFROM_GIFTED_LAWFUL);
  397.              if (obj && obj->oartifact == ART_EXCALIBUR)
  398.                  u.ugifts++;
  399.          }
  400. @@ -858,7 +858,7 @@ gcrownu()
  401.              obj->dknown = TRUE;
  402.          } else if (!already_exists) {
  403.              obj = mksobj(LONG_SWORD, FALSE, FALSE);
  404. -            obj = oname(obj, artiname(ART_VORPAL_BLADE));
  405. +            obj = oname(obj, artiname(ART_VORPAL_BLADE), ARTIFROM_GIFTED_NEUTRAL);
  406.              obj->spe = 1;
  407.              at_your_feet("A sword");
  408.              dropy(obj);
  409. @@ -880,7 +880,7 @@ gcrownu()
  410.              obj->dknown = TRUE;
  411.          } else if (!already_exists) {
  412.              obj = mksobj(RUNESWORD, FALSE, FALSE);
  413. -            obj = oname(obj, artiname(ART_STORMBRINGER));
  414. +            obj = oname(obj, artiname(ART_STORMBRINGER), ARTIFROM_GIFTED_CHAOTIC);
  415.              obj->spe = 1;
  416.              at_your_feet(An(swordbuf));
  417.              dropy(obj);
  418. @@ -1316,6 +1316,8 @@ register struct obj *otmp;
  419.      else
  420.          Your("sacrifice is consumed in a %s!",
  421.               u.ualign.type == A_LAWFUL ? "flash of light" : "burst of flame");
  422. +    if (otmp->oartifact)
  423. +        artifact_exists(otmp, safe_oname(otmp), ARTIFROM_GONE);
  424.      if (carried(otmp))
  425.          useup(otmp);
  426.      else
  427. @@ -1343,6 +1345,12 @@ dosacrifice()
  428.      otmp = floorfood("sacrifice", 1);
  429.      if (!otmp)
  430.          return 0;
  431. +    if (otmp->owornmask & (W_ARMOR | W_SADDLE))
  432. +      {
  433. +        You_cant("sacrifice %s you're wearing.", something);
  434. +        return 0;
  435. +      }
  436. +
  437.      /*
  438.       * Was based on nutritional value and aging behavior (< 50 moves).
  439.       * Sacrificing a food ration got you max luck instantly, making the
  440. @@ -1588,6 +1596,65 @@ dosacrifice()
  441.          }
  442.      } /* fake Amulet */
  443.  
  444. +    if (otmp->oartifact) {
  445. +        char buf[BUFSZ];
  446. +        /* just in case */
  447. +        if (objects[otmp->otyp].oc_unique && !u.uevent.invoked)
  448. +          {
  449. +            You("decide against that.");
  450. +            return 0;
  451. +          }
  452. +        sprintf(buf, "Are you sure you want to sacrifice your %s?",
  453. +                xname(otmp));
  454. +        if (yn(buf) != 'y')
  455. +            return 0;
  456. +
  457. +        int multiplier;
  458. +        int background = exist_artifact(otmp->otyp, safe_oname(otmp));
  459. +        switch (background) {
  460. +        case ARTIFROM_BONES:
  461. +            /* used condition */
  462. +            multiplier = 3;
  463. +            break;
  464. +        case ARTIFROM_NAMED:
  465. +            /* barely even an artifact */
  466. +            multiplier = 1;
  467. +            break;
  468. +        case ARTIFROM_GIFTED_CHAOTIC:
  469. +        case ARTIFROM_GIFTED_NEUTRAL:
  470. +        case ARTIFROM_GIFTED_LAWFUL:
  471. +            /* no regifts! */
  472. +            multiplier = 0;
  473. +            break;
  474. +        case ARTIFROM_WISHED:
  475. +        case ARTIFROM_FOUND:
  476. +        default:
  477. +            multiplier = 5;
  478. +            break;
  479. +        }
  480. +        value = arti_cost(otmp) * multiplier / 500;
  481. +
  482. +        if (ARTIFROM_IS_GIFTED(background))
  483. +            {
  484. +              boolean very_rude = (background == ARTIFROM_GIFTED(altaralign));
  485. +            if ((very_rude || !rn2(4)))
  486. +              {
  487. +                You("have not used %s gift wisely...",
  488. +                    s_suffix(align_gname(ARTIFROM_GIFTED_BY(background))));
  489. +                (void) adjattrib(A_WIS, -rnd(3), 1);
  490. +                exercise(A_WIS, FALSE);
  491. +                if (very_rude) value = -1;
  492. +              }
  493. +            else
  494. +                You_feel(Hallucination ? "in violation of a no-return policy."
  495. +                                       : "like a lowly pawnbroker.");
  496. +            }
  497. +
  498. +        /* artifacts are not 'proper' sacrifices so no converting etc. */
  499. +        if (altaralign != u.ualign.type && value > 0)
  500. +            value = 0;
  501. +    }
  502. +
  503.      if (value == 0) {
  504.          pline1(nothing_happens);
  505.          return 1;
  506. diff --git c/src/sp_lev.c w/src/sp_lev.c
  507. index 2c5628f..4e4973a 100644
  508. --- c/src/sp_lev.c
  509. +++ w/src/sp_lev.c
  510. @@ -1905,7 +1905,7 @@ struct mkroom *croom;
  511.      /* set_corpsenm() took care of egg hatch and corpse timers */
  512.  
  513.      if (named)
  514. -        otmp = oname(otmp, o->name.str);
  515. +        otmp = oname(otmp, o->name.str, ARTIFROM_FOUND);
  516.  
  517.      if (o->eroded) {
  518.          if (o->eroded < 0) {
  519. diff --git c/src/topten.c w/src/topten.c
  520. index 7515c35..02e2bfd 100644
  521. --- c/src/topten.c
  522. +++ w/src/topten.c
  523. @@ -1233,7 +1233,7 @@ struct obj *otmp;
  524.          return (struct obj *) 0;
  525.  
  526.      set_corpsenm(otmp, classmon(tt->plrole, (tt->plgend[0] == 'F')));
  527. -    otmp = oname(otmp, tt->name);
  528. +    otmp = oname(otmp, tt->name, ARTIFROM_NONE);
  529.  
  530.      return otmp;
  531.  }
Add Comment
Please, Sign In to add comment