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

Function handle_wizard_command

crawl-ref/source/wizard.cc:271–376  ·  view source on GitHub ↗

Prompt for and perform a wizard-mode command. If we are not already in wizard mode, prompt first.

Source from the content-addressed store, hash-verified

269/// Prompt for and perform a wizard-mode command. If we are not already
270// in wizard mode, prompt first.
271void handle_wizard_command()
272{
273 int wiz_command;
274
275 // WIZ_NEVER gives protection for those who have wiz compiles,
276 // and don't want to risk their characters. Also, and hackishly,
277 // it's used to prevent access for non-authorised users to wizard
278 // builds in dgamelaunch builds unless the game is started with the
279 // -wizard flag.
280 if (Options.wiz_mode == WIZ_NEVER)
281 return;
282
283 if (you.suppress_wizard)
284 {
285 mprf(MSGCH_WARN, "Re-activating wizard mode.");
286 you.wizard = true;
287 you.suppress_wizard = false;
288#ifdef USE_TILE_LOCAL
289 tiles.layout_statcol();
290#endif
291 redraw_screen();
292 update_screen();
293 if (crawl_state.cmd_repeat_start)
294 {
295 crawl_state.cancel_cmd_repeat("Can't repeat re-activating wizard "
296 "mode.");
297 }
298 return;
299 }
300 else if (!you.wizard)
301 {
302 mprf(MSGCH_WARN, "WARNING: ABOUT TO ENTER WIZARD MODE!");
303
304#ifndef SCORE_WIZARD_CHARACTERS
305 if (!you.explore)
306 mprf(MSGCH_WARN, "If you continue, your game will not be scored!");
307#endif
308
309 if (!confirm_prompt("wiz", "Do you really want to enter wizard mode?"))
310 {
311 canned_msg(MSG_OK);
312 return;
313 }
314
315 take_note(Note(NOTE_MESSAGE, 0, 0, "Entered wizard mode."));
316
317#ifndef SCORE_WIZARD_CHARACTERS
318 if (!you.explore)
319 _log_wizmode_entrance();
320#endif
321
322 you.wizard = true;
323 save_game(false);
324#ifdef USE_TILE_LOCAL
325 tiles.layout_statcol();
326#endif
327 redraw_screen();
328 update_screen();

Callers 3

process_commandFunction · 0.85
enter_explore_modeFunction · 0.85
process_commandMethod · 0.85

Calls 15

mprfFunction · 0.85
redraw_screenFunction · 0.85
confirm_promptFunction · 0.85
canned_msgFunction · 0.85
take_noteFunction · 0.85
NoteClass · 0.85
_log_wizmode_entranceFunction · 0.85
save_gameFunction · 0.85
getchmFunction · 0.85
toupper_safeFunction · 0.85
_do_wizard_commandFunction · 0.85
layout_statcolMethod · 0.80

Tested by

no test coverage detected