displacer beast as food

Make eating a displacer beast corpse or a tin of displacer beast
meat confer temporary Displacement lasting 6d6 turns.
This commit is contained in:
PatR
2020-05-04 09:50:11 -07:00
parent 88461e1923
commit 16562b2892
5 changed files with 21 additions and 9 deletions
+1
View File
@@ -489,6 +489,7 @@ E int NDECL(take_off);
#endif #endif
E const char *FDECL(fingers_or_gloves, (BOOLEAN_P)); E const char *FDECL(fingers_or_gloves, (BOOLEAN_P));
E void FDECL(off_msg, (struct obj *)); E void FDECL(off_msg, (struct obj *));
E void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
E void FDECL(set_wear, (struct obj *)); E void FDECL(set_wear, (struct obj *));
E boolean FDECL(donning, (struct obj *)); E boolean FDECL(donning, (struct obj *));
E boolean FDECL(doffing, (struct obj *)); E boolean FDECL(doffing, (struct obj *));
+3 -2
View File
@@ -180,8 +180,9 @@
#define Invisible (Invis && !See_invisible) #define Invisible (Invis && !See_invisible)
/* Note: invisibility also hides inventory and steed */ /* Note: invisibility also hides inventory and steed */
#define EDisplaced u.uprops[DISPLACED].extrinsic #define HDisplaced u.uprops[DISPLACED].intrinsic /* timed from corpse */
#define Displaced EDisplaced #define EDisplaced u.uprops[DISPLACED].extrinsic /* worn cloak */
#define Displaced (HDisplaced || EDisplaced)
#define HStealth u.uprops[STEALTH].intrinsic #define HStealth u.uprops[STEALTH].intrinsic
#define EStealth u.uprops[STEALTH].extrinsic #define EStealth u.uprops[STEALTH].extrinsic
+8 -7
View File
@@ -22,7 +22,6 @@ static NEARDATA const long takeoff_order[] = {
static void FDECL(on_msg, (struct obj *)); static void FDECL(on_msg, (struct obj *));
static void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P)); static void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P));
static void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
static int NDECL(Armor_on); static int NDECL(Armor_on);
/* int NDECL(Boots_on); -- moved to extern.h */ /* int NDECL(Boots_on); -- moved to extern.h */
static int NDECL(Cloak_on); static int NDECL(Cloak_on);
@@ -114,10 +113,11 @@ boolean on;
} }
} }
/* putting on or taking off an item which confers displacement; /* putting on or taking off an item which confers displacement, or gaining
or losing timed displacement after eating a displacer beast corpse or tin;
give feedback and discover it iff displacement state is changing *and* give feedback and discover it iff displacement state is changing *and*
hero is able to see self (or sense monsters) */ hero is able to see self (or sense monsters); for timed, 'obj' is Null
static and this is only called for the message */
void void
toggle_displacement(obj, oldprop, on) toggle_displacement(obj, oldprop, on)
struct obj *obj; struct obj *obj;
@@ -128,8 +128,8 @@ boolean on;
return; return;
if (!oldprop /* extrinsic displacement from something else */ if (!oldprop /* extrinsic displacement from something else */
&& !(u.uprops[DISPLACED].intrinsic) /* (theoretical) */ && !(u.uprops[DISPLACED].intrinsic) /* timed, from eating */
&& !(u.uprops[DISPLACED].blocked) /* (also theoretical) */ && !(u.uprops[DISPLACED].blocked) /* (theoretical) */
/* we don't use canseeself() here because it augments vision /* we don't use canseeself() here because it augments vision
with touch, which isn't appropriate for deciding whether with touch, which isn't appropriate for deciding whether
we'll notice that monsters have trouble spotting the hero */ we'll notice that monsters have trouble spotting the hero */
@@ -142,7 +142,8 @@ boolean on;
|| (Unblind_telepat || (Unblind_telepat
|| (Blind_telepat && Blind) || (Blind_telepat && Blind)
|| Detect_monsters))) { || Detect_monsters))) {
makeknown(obj->otyp); if (obj)
makeknown(obj->otyp);
You_feel("that monsters%s have difficulty pinpointing your location.", You_feel("that monsters%s have difficulty pinpointing your location.",
on ? "" : " no longer"); on ? "" : " no longer");
+5
View File
@@ -1075,6 +1075,11 @@ int pm;
polyself(0); polyself(0);
} }
break; break;
case PM_DISPLACER_BEAST:
if (!Displaced) /* give a message (before setting the timeout) */
toggle_displacement((struct obj *) 0, 0L, TRUE);
incr_itimeout(&HDisplaced, d(6, 6));
break;
case PM_DISENCHANTER: case PM_DISENCHANTER:
/* picks an intrinsic at random and removes it; there's /* picks an intrinsic at random and removes it; there's
no feedback if hero already lacks the chosen ability */ no feedback if hero already lacks the chosen ability */
+4
View File
@@ -681,6 +681,10 @@ nh_timeout()
spoteffects(TRUE); spoteffects(TRUE);
} }
break; break;
case DISPLACED:
if (!Displaced) /* give a message */
toggle_displacement((struct obj *) 0, 0L, FALSE);
break;
case WARN_OF_MON: case WARN_OF_MON:
/* timed Warn_of_mon is via #wizintrinsic only */ /* timed Warn_of_mon is via #wizintrinsic only */
if (!Warn_of_mon) { if (!Warn_of_mon) {