A camera may contain a picture-painting demon

Original patch by Leon Arnott
This commit is contained in:
Pasi Kallinen
2015-04-13 18:54:20 +03:00
parent eba5bf7d5e
commit 6209d458f9
4 changed files with 21 additions and 0 deletions

View File

@@ -1665,6 +1665,21 @@ xchar x, y; /* object location (ox, oy may not be right) */
return 1;
}
void
release_camera_demon(obj, x,y)
struct obj *obj;
xchar x,y;
{
struct monst *mtmp;
if (!rn2(3) && (mtmp = makemon(&mons[rn2(3) ? PM_HOMUNCULUS : PM_IMP],x,y, NO_MM_FLAGS)) != 0) {
if (canspotmon(mtmp))
pline("%s is released!", Hallucination ?
An(rndmonnam(NULL)) : "The picture-painting demon");
mtmp->mpeaceful = !obj->cursed;
set_malign(mtmp);
}
}
/*
* Unconditionally break an object. Assumes all resistance checks
* and break messages have been delivered prior to getting here.
@@ -1707,6 +1722,9 @@ boolean from_invent;
}
/* monster breathing isn't handled... [yet?] */
break;
case EXPENSIVE_CAMERA:
release_camera_demon(obj, x,y);
break;
case EGG:
/* breaking your own eggs is bad luck */
if (hero_caused && obj->spe && obj->corpsenm >= LOW_PM)

View File

@@ -741,6 +741,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
case EXPENSIVE_CAMERA:
You("succeed in destroying %s. Congratulations!",
ysimple_name(obj));
release_camera_demon(obj, u.ux, u.uy);
useup(obj);
return(TRUE);
/*NOTREACHED*/