MCPcopy Create free account
hub / github.com/crawl/crawl / tutorial_msg

Function tutorial_msg

crawl-ref/source/hints.cc:2847–2873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2845}
2846
2847void tutorial_msg(const char *key, bool end)
2848{
2849 string text = getHintString(key);
2850 if (text.empty())
2851 return mprf(MSGCH_ERROR, "Error, no message for '%s'.", key);
2852
2853 _replace_static_tags(text);
2854 text = untag_tiles_console(text);
2855
2856 // n.b. leaving the dungeon counts as "winning" here (and pops up the
2857 // tutorial summary)
2858 if (end)
2859 screen_end_game(text, you.hp <= 0 ? game_exit::death : game_exit::win);
2860
2861 // "\n" to preserve indented parts, the rest is unwrapped, or split into
2862 // paragraphs by "\n\n", split_string() will ignore the empty line.
2863 for (const string &chunk : split_string("\n", text, false))
2864 mprf(MSGCH_TUTORIAL, "%s", chunk.c_str());
2865
2866 // tutorial_msg can get called in an vault epilogue during --builddb,
2867 // which can lead to a crash on tiles builds in runrest::stop as
2868 // there is no `tiles`. This seemed like the best place to fix this.
2869 #ifdef USE_TILE_LOCAL
2870 if (!crawl_state.tiles_disabled)
2871 #endif
2872 stop_running();
2873}

Callers 2

crawl_tutorial_msgFunction · 0.85
tutorial_death_messageFunction · 0.85

Calls 8

getHintStringFunction · 0.85
mprfFunction · 0.85
_replace_static_tagsFunction · 0.85
untag_tiles_consoleFunction · 0.85
screen_end_gameFunction · 0.85
split_stringFunction · 0.85
stop_runningFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected