Differentiate between monster anger from attacks and from other causes
setmangry() and wakeup() were being used for multiple purposes. Add an extra parameter to track which. This fixes several minor bugs (e.g. whether monsters with no eyes were angered by (useless) gaze attacks against them previously depended on the state of a UI option, and the Minetown guards would be annoyed if you used a cursed scroll of tame monster on a shopkeeper). It's also a prerequisite for the Elbereth changes I'm working on.
This commit is contained in:
@@ -156,7 +156,7 @@ xchar x, y;
|
||||
int i, j;
|
||||
|
||||
/* anger target even if wild miss will occur */
|
||||
setmangry(mon);
|
||||
setmangry(mon, TRUE);
|
||||
|
||||
if (Levitation && !rn2(3) && verysmall(mon->data)
|
||||
&& !is_flyer(mon->data)) {
|
||||
@@ -298,7 +298,7 @@ register struct obj *gold;
|
||||
|
||||
if (!likes_gold(mtmp->data) && !mtmp->isshk && !mtmp->ispriest
|
||||
&& !mtmp->isgd && !is_mercenary(mtmp->data)) {
|
||||
wakeup(mtmp);
|
||||
wakeup(mtmp, TRUE);
|
||||
} else if (!mtmp->mcanmove) {
|
||||
/* too light to do real damage */
|
||||
if (canseemon(mtmp)) {
|
||||
@@ -312,7 +312,7 @@ register struct obj *gold;
|
||||
mtmp->msleeping = 0;
|
||||
finish_meating(mtmp);
|
||||
if (!mtmp->isgd && !rn2(4)) /* not always pleasing */
|
||||
setmangry(mtmp);
|
||||
setmangry(mtmp, TRUE);
|
||||
/* greedy monsters catch gold */
|
||||
if (cansee(mtmp->mx, mtmp->my))
|
||||
pline("%s catches the gold.", Monnam(mtmp));
|
||||
|
||||
Reference in New Issue
Block a user