pull request #1092 - monster blindness
Pull request from entrez: a monster can become permanently blind via camera flash but being hit by vapors from thrown potion of blindness would set a blindness countdown timer and blindness would be cured when that expired. Closes #1092
This commit is contained in:
@@ -248,6 +248,8 @@ struct monst {
|
|||||||
#define engulfing_u(mon) (u.uswallow && (u.ustuck == (mon)))
|
#define engulfing_u(mon) (u.uswallow && (u.ustuck == (mon)))
|
||||||
#define helpless(mon) ((mon)->msleeping || !(mon)->mcanmove)
|
#define helpless(mon) ((mon)->msleeping || !(mon)->mcanmove)
|
||||||
|
|
||||||
|
#define mon_perma_blind(mon) (!mon->mcansee && !mon->mblinded)
|
||||||
|
|
||||||
#define mon_offmap(mon) (((mon)->mstate & (MON_DETACH|MON_MIGRATING|MON_LIMBO|MON_OFFMAP)) != 0)
|
#define mon_offmap(mon) (((mon)->mstate & (MON_DETACH|MON_MIGRATING|MON_LIMBO|MON_OFFMAP)) != 0)
|
||||||
|
|
||||||
/* Get the maximum difficulty monsters that can currently be generated,
|
/* Get the maximum difficulty monsters that can currently be generated,
|
||||||
|
|||||||
@@ -226,6 +226,10 @@ can_blnd(
|
|||||||
if (!haseyes(mdef->data))
|
if (!haseyes(mdef->data))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* if monster has been permanently blinded, the deed is already done */
|
||||||
|
if (!is_you && mon_perma_blind(mdef))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* /corvus oculum corvi non eruit/
|
/* /corvus oculum corvi non eruit/
|
||||||
a saying expressed in Latin rather than a zoological observation:
|
a saying expressed in Latin rather than a zoological observation:
|
||||||
"a crow will not pluck out the eye of another crow"
|
"a crow will not pluck out the eye of another crow"
|
||||||
|
|||||||
+1
-1
@@ -1786,7 +1786,7 @@ potionhit(struct monst *mon, struct obj *obj, int how)
|
|||||||
mon_adjust_speed(mon, 1, obj);
|
mon_adjust_speed(mon, 1, obj);
|
||||||
break;
|
break;
|
||||||
case POT_BLINDNESS:
|
case POT_BLINDNESS:
|
||||||
if (haseyes(mon->data)) {
|
if (haseyes(mon->data) && !mon_perma_blind(mon)) {
|
||||||
int btmp = 64 + rn2(32)
|
int btmp = 64 + rn2(32)
|
||||||
+ rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
|
+ rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user