MCPcopy Index your code
hub / github.com/NetHack/NetHack / poly_steed

Function poly_steed

src/steed.c:851–873  ·  view source on GitHub ↗

steed has taken on a new shape */

Source from the content-addressed store, hash-verified

849
850/* steed has taken on a new shape */
851void
852poly_steed(
853 struct monst *steed,
854 struct permonst *oldshape)
855{
856 if (!can_saddle(steed) || !can_ride(steed)) {
857 /* can't get here; newcham() -> mon_break_armor() -> m_lose_armor()
858 removes saddle and/or forces hero to dismount, if applicable,
859 before newcham() calls us */
860 dismount_steed(DISMOUNT_FELL);
861 } else {
862 char buf[BUFSZ];
863
864 Strcpy(buf, x_monnam(steed, ARTICLE_YOUR, (char *) 0,
865 SUPPRESS_SADDLE, FALSE));
866 if (oldshape != steed->data)
867 (void) strsubst(buf, "your ", "your new ");
868 You("adjust yourself in the saddle on %s.", buf);
869
870 /* riding blocks stealth unless hero+steed fly */
871 steed_vs_stealth();
872 }
873}
874
875/* decide whether hero's steed is able to move;
876 doesn't check for holding traps--those affect the hero directly */

Callers 1

newchamFunction · 0.85

Calls 6

can_saddleFunction · 0.85
can_rideFunction · 0.85
dismount_steedFunction · 0.85
strsubstFunction · 0.85
YouFunction · 0.85
steed_vs_stealthFunction · 0.85

Tested by

no test coverage detected