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

Function encumber_msg

src/pickup.c:1977–2020  ·  view source on GitHub ↗

* prints a message if encumbrance changed since the last check */

Source from the content-addressed store, hash-verified

1975 * prints a message if encumbrance changed since the last check
1976 */
1977void
1978encumber_msg(void)
1979{
1980 int newcap = near_capacity();
1981
1982 if (go.oldcap < newcap) {
1983 switch (newcap) {
1984 case 1:
1985 Your("movements are slowed slightly because of your load.");
1986 break;
1987 case 2:
1988 You("rebalance your load. Movement is difficult.");
1989 break;
1990 case 3:
1991 You("%s under your heavy load. Movement is very hard.",
1992 stagger(gy.youmonst.data, "stagger"));
1993 break;
1994 default:
1995 You("%s move a handspan with this load!",
1996 newcap == 4 ? "can barely" : "can't even");
1997 break;
1998 }
1999 disp.botl = TRUE;
2000 } else if (go.oldcap > newcap) {
2001 switch (newcap) {
2002 case 0:
2003 Your("movements are now unencumbered.");
2004 break;
2005 case 1:
2006 Your("movements are only slowed slightly by your load.");
2007 break;
2008 case 2:
2009 You("rebalance your load. Movement is still difficult.");
2010 break;
2011 case 3:
2012 You("%s under your load. Movement is still very hard.",
2013 stagger(gy.youmonst.data, "stagger"));
2014 break;
2015 }
2016 disp.botl = TRUE;
2017 }
2018
2019 go.oldcap = newcap;
2020}
2021
2022/* Is there a container at x,y. Optional: return count of containers at x,y */
2023int

Callers 15

chweponFunction · 0.85
moveloop_preambleFunction · 0.85
allmain.cFile · 0.85
stealFunction · 0.85
stealamuletFunction · 0.85
maybe_absorb_itemFunction · 0.85
Gloves_offFunction · 0.85
dismount_steedFunction · 0.85
ballreleaseFunction · 0.85
dropzFunction · 0.85
set_wounded_legsFunction · 0.85
heal_legsFunction · 0.85

Calls 4

near_capacityFunction · 0.85
YourFunction · 0.85
YouFunction · 0.85
staggerFunction · 0.85

Tested by

no test coverage detected