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

Function handle_tip

src/hack.c:1851–1881  ·  view source on GitHub ↗

maybe show a helpful gameplay tip? returns True if tip gets shown */

Source from the content-addressed store, hash-verified

1849
1850/* maybe show a helpful gameplay tip? returns True if tip gets shown */
1851boolean
1852handle_tip(int tip)
1853{
1854 if (!flags.tips)
1855 return FALSE;
1856
1857 if (tip >= 0 && tip < NUM_TIPS && !(svc.context.tips & (1 << tip))) {
1858 svc.context.tips |= (1 << tip);
1859 /* the "Tip:" prefix is a hint to use of OPTIONS=!tips to suppress */
1860 switch (tip) {
1861 case TIP_ENHANCE:
1862 pline("(Tip: use the #enhance command to advance them.)");
1863 break;
1864 case TIP_SWIM:
1865 pline("(Tip: use '%s' prefix to step in if you really want to.)",
1866 visctrl(cmd_from_func(do_reqmenu)));
1867 break;
1868 case TIP_UNTRAP_MON:
1869 pline("(Tip: perhaps #untrap would help?)");
1870 break;
1871 case TIP_GETPOS:
1872 l_nhcore_call(NHCORE_GETPOS_TIP);
1873 break;
1874 default:
1875 impossible("Unknown tip in handle_tip(%i)", tip);
1876 break;
1877 }
1878 return TRUE;
1879 }
1880 return FALSE;
1881}
1882
1883/* Is it dangerous for hero to move to x,y due to water or lava? */
1884staticfn boolean

Callers 4

give_may_advance_msgFunction · 0.85
swim_move_dangerFunction · 0.85
domove_swap_with_petFunction · 0.85
getposFunction · 0.85

Calls 5

visctrlFunction · 0.85
cmd_from_funcFunction · 0.85
l_nhcore_callFunction · 0.85
plineFunction · 0.70
impossibleFunction · 0.70

Tested by

no test coverage detected