talking artifact inconsistency

To get the Magic Mirror of Merlin to speak, you could apply it in
any direction (or wield it).  To get the Master Key of Thievery to
speak, you had to apply it toward an adjacent doorway or down while
on a container (or wield it).  Make the key behave like the mirror.
This commit is contained in:
PatR
2023-03-18 21:47:34 -07:00
parent 73f1dd2aee
commit 0e761c3e30
4 changed files with 11 additions and 8 deletions

View File

@@ -92,7 +92,7 @@ extern boolean artifact_hit(struct monst *, struct monst *, struct obj *,
int *, int);
extern int doinvoke(void);
extern boolean finesse_ahriman(struct obj *);
extern void arti_speak(struct obj *);
extern int arti_speak(struct obj *);
extern boolean artifact_light(struct obj *);
extern long spec_m2(struct obj *);
extern boolean artifact_has_invprop(struct obj *, uchar);

View File

@@ -4181,8 +4181,9 @@ doapply(void)
pline("Sorry, I don't know how to use that.");
return ECMD_FAIL;
}
if ((res & ECMD_TIME) && obj && obj->oartifact)
arti_speak(obj);
if (obj && obj->oartifact) {
res |= arti_speak(obj); /* sets ECMD_TIME bit if artifact speaks */
}
return res;
}

View File

@@ -1986,16 +1986,16 @@ artifact_light(struct obj *obj)
}
/* KMH -- Talking artifacts are finally implemented */
void
int
arti_speak(struct obj *obj)
{
register const struct artifact *oart = get_artifact(obj);
const struct artifact *oart = get_artifact(obj);
const char *line;
char buf[BUFSZ];
/* Is this a speaking artifact? */
if (!oart || !(oart->spfx & SPFX_SPEAK))
return;
return ECMD_OK; /* nothing happened */
line = getrumor(bcsign(obj), buf, TRUE);
if (!*line)
@@ -2003,7 +2003,7 @@ arti_speak(struct obj *obj)
pline("%s:", Tobjnam(obj, "whisper"));
SetVoice((struct monst *) 0, 0, 80, voice_talking_artifact);
verbalize1(line);
return;
return ECMD_TIME;
}
boolean

View File

@@ -230,7 +230,9 @@ ready_weapon(struct obj *wep)
}
/* KMH -- Talking artifacts are finally implemented */
arti_speak(wep);
if (wep && wep->oartifact) {
res |= arti_speak(wep); /* sets ECMD_TIME bit if artifact speaks */
}
if (artifact_light(wep) && !wep->lamplit) {
begin_burn(wep, FALSE);