Unify guards yelling

This commit is contained in:
Pasi Kallinen
2015-04-27 21:31:25 +03:00
parent f0699b76d9
commit 0903df974f
3 changed files with 18 additions and 15 deletions
+1
View File
@@ -1373,6 +1373,7 @@ E void FDECL(mon_regen, (struct monst *,BOOLEAN_P));
E int FDECL(dochugw, (struct monst *)); E int FDECL(dochugw, (struct monst *));
E boolean FDECL(onscary, (int,int,struct monst *)); E boolean FDECL(onscary, (int,int,struct monst *));
E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P)); E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P));
E void FDECL(mon_yells, (struct monst *, const char *));
E int FDECL(dochug, (struct monst *)); E int FDECL(dochug, (struct monst *));
E int FDECL(m_move, (struct monst *,int)); E int FDECL(m_move, (struct monst *,int));
E void FDECL(dissolve_bars, (int,int)); E void FDECL(dissolve_bars, (int,int));
+3 -11
View File
@@ -1201,11 +1201,7 @@ dumb:
if (is_watch(mtmp->data) && if (is_watch(mtmp->data) &&
couldsee(mtmp->mx, mtmp->my) && couldsee(mtmp->mx, mtmp->my) &&
mtmp->mpeaceful) { mtmp->mpeaceful) {
if (canspotmon(mtmp)) mon_yells(mtmp, "Halt, thief! You're under arrest!");
pline("%s yells:", Amonnam(mtmp));
else
You_hear("someone yell:");
verbalize("Halt, thief! You're under arrest!");
(void) angry_guards(FALSE); (void) angry_guards(FALSE);
break; break;
} }
@@ -1219,15 +1215,11 @@ dumb:
if (DEADMONSTER(mtmp)) continue; if (DEADMONSTER(mtmp)) continue;
if (is_watch(mtmp->data) && if (is_watch(mtmp->data) &&
mtmp->mpeaceful && couldsee(mtmp->mx, mtmp->my)) { mtmp->mpeaceful && couldsee(mtmp->mx, mtmp->my)) {
if (canspotmon(mtmp))
pline("%s yells:", Amonnam(mtmp));
else
You_hear("someone yell:");
if(levl[x][y].looted & D_WARNED) { if(levl[x][y].looted & D_WARNED) {
verbalize("Halt, vandal! You're under arrest!"); mon_yells(mtmp, "Halt, vandal! You're under arrest!");
(void) angry_guards(FALSE); (void) angry_guards(FALSE);
} else { } else {
verbalize("Hey, stop damaging that door!"); mon_yells(mtmp, "Hey, stop damaging that door!");
levl[x][y].looted |= D_WARNED; levl[x][y].looted |= D_WARNED;
} }
break; break;
+14 -4
View File
@@ -50,6 +50,18 @@ boolean for_unlocking; /* true => credit card ok, false => not ok */
return m_carrying(mon, SKELETON_KEY) || m_carrying(mon, LOCK_PICK); return m_carrying(mon, SKELETON_KEY) || m_carrying(mon, LOCK_PICK);
} }
void
mon_yells(mon, shout)
struct monst *mon;
const char *shout;
{
if (canspotmon(mon))
pline("%s yells:", Amonnam(mon));
else
You_hear("someone yell:");
verbalize(shout);
}
STATIC_OVL void STATIC_OVL void
watch_on_duty(mtmp) watch_on_duty(mtmp)
register struct monst *mtmp; register struct monst *mtmp;
@@ -63,13 +75,11 @@ register struct monst *mtmp;
(levl[x][y].doormask & D_LOCKED)) { (levl[x][y].doormask & D_LOCKED)) {
if(couldsee(mtmp->mx, mtmp->my)) { if(couldsee(mtmp->mx, mtmp->my)) {
pline("%s yells:", Amonnam(mtmp));
if(levl[x][y].looted & D_WARNED) { if(levl[x][y].looted & D_WARNED) {
verbalize("Halt, thief! You're under arrest!"); mon_yells(mtmp, "Halt, thief! You're under arrest!");
(void) angry_guards(!!Deaf); (void) angry_guards(!!Deaf);
} else { } else {
verbalize("Hey, stop picking that lock!"); mon_yells(mtmp, "Hey, stop picking that lock!");
levl[x][y].looted |= D_WARNED; levl[x][y].looted |= D_WARNED;
} }
stop_occupation(); stop_occupation();