artifact tracking again

Redo the recent artifact creation stuff by replacing several nearly
identical routines with one more general one.  Also adds a tracking
bit for one or two more creation methods.  That changed artiexist[]
from an array of structs holding 8 or less bits to one holding 9, so
bump EDITLEVEL in case the total size changed.
This commit is contained in:
PatR
2022-03-12 17:25:54 -08:00
parent 294365f707
commit 77dc522a62
14 changed files with 128 additions and 177 deletions

View File

@@ -4838,7 +4838,7 @@ readobjnam(char *bp, struct obj *no_wish)
d.name = novelname;
}
d.otmp = oname(d.otmp, d.name, ONAME_NO_FLAGS);
d.otmp = oname(d.otmp, d.name, ONAME_WISH);
/* name==aname => wished for artifact (otmp->oartifact => got it) */
if (d.otmp->oartifact || d.name == aname) {
d.otmp->quan = 1L;
@@ -4850,7 +4850,7 @@ readobjnam(char *bp, struct obj *no_wish)
/* and make them pay; charge them for the wish anyway! */
if ((is_quest_artifact(d.otmp)
|| (d.otmp->oartifact && rn2(nartifact_exist()) > 1)) && !wizard) {
artifact_exists(d.otmp, safe_oname(d.otmp), FALSE, FALSE);
artifact_exists(d.otmp, safe_oname(d.otmp), FALSE, ONAME_NO_FLAGS);
obfree(d.otmp, (struct obj *) 0);
d.otmp = (struct obj *) &cg.zeroobj;
pline("For a moment, you feel %s in your %s, but it disappears!",