Monsters can blind you with a camera

This commit is contained in:
Pasi Kallinen
2022-08-22 13:32:12 +03:00
parent 25fc7ea2f5
commit 4a84fb5b9d
2 changed files with 28 additions and 0 deletions

View File

@@ -1015,6 +1015,7 @@ expose fuzz tester to wizard-mode as #debugfuzzer extended command
monsters which cannot move due to boulders or walls try to escape monsters which cannot move due to boulders or walls try to escape
intelligent monsters see and remember when others trigger traps intelligent monsters see and remember when others trigger traps
random figurines are of harder monsters random figurines are of harder monsters
monsters can blind you with a camera
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -1150,6 +1150,7 @@ rnd_defensive_item(struct monst* mtmp)
#define MUSE_WAN_TELEPORTATION 15 #define MUSE_WAN_TELEPORTATION 15
#define MUSE_POT_SLEEPING 16 #define MUSE_POT_SLEEPING 16
#define MUSE_SCR_EARTH 17 #define MUSE_SCR_EARTH 17
#define MUSE_CAMERA 18
/*#define MUSE_WAN_UNDEAD_TURNING 20*/ /* also a defensive item so don't /*#define MUSE_WAN_UNDEAD_TURNING 20*/ /* also a defensive item so don't
* redefine; nonconsecutive value is ok */ * redefine; nonconsecutive value is ok */
@@ -1402,6 +1403,14 @@ find_offensive(struct monst* mtmp)
g.m.offensive = obj; g.m.offensive = obj;
g.m.has_offense = MUSE_SCR_EARTH; g.m.has_offense = MUSE_SCR_EARTH;
} }
nomore(MUSE_CAMERA);
if (obj->otyp == EXPENSIVE_CAMERA
&& (!Blind || hates_light(g.youmonst.data))
&& dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <= 2
&& obj->spe > 0 && !rn2(6)) {
g.m.offensive = obj;
g.m.has_offense = MUSE_CAMERA;
}
#if 0 #if 0
nomore(MUSE_SCR_FIRE); nomore(MUSE_SCR_FIRE);
if (obj->otyp == SCR_FIRE && resists_fire(mtmp) if (obj->otyp == SCR_FIRE && resists_fire(mtmp)
@@ -1708,6 +1717,22 @@ use_offensive(struct monst* mtmp)
return (DEADMONSTER(mtmp)) ? 1 : 2; return (DEADMONSTER(mtmp)) ? 1 : 2;
} /* case MUSE_SCR_EARTH */ } /* case MUSE_SCR_EARTH */
case MUSE_CAMERA: {
if (Hallucination)
verbalize("Say cheese!");
else
pline("%s takes a picture of you with %s!",
Monnam(mtmp), an(xname(otmp)));
g.m_using = TRUE;
if (!Blind) {
You("are blinded by the flash of light!");
make_blinded(Blinded + (long) rnd(1 + 50), FALSE);
}
lightdamage(otmp, TRUE, 5);
g.m_using = FALSE;
otmp->spe--;
return 1;
} /* case MUSE_CAMERA */
#if 0 #if 0
case MUSE_SCR_FIRE: { case MUSE_SCR_FIRE: {
boolean vis = cansee(mtmp->mx, mtmp->my); boolean vis = cansee(mtmp->mx, mtmp->my);
@@ -2482,6 +2507,8 @@ searches_for_item(struct monst* mon, struct obj* obj)
if (Is_container(obj) && !(Is_mbag(obj) && obj->cursed) if (Is_container(obj) && !(Is_mbag(obj) && obj->cursed)
&& !obj->olocked) && !obj->olocked)
return TRUE; return TRUE;
if (typ == EXPENSIVE_CAMERA)
return (obj->spe > 0);
break; break;
case FOOD_CLASS: case FOOD_CLASS:
if (typ == CORPSE) if (typ == CORPSE)