Prompt for and perform a wizard-mode command. If we are not already in wizard mode, prompt first.
| 269 | /// Prompt for and perform a wizard-mode command. If we are not already |
| 270 | // in wizard mode, prompt first. |
| 271 | void 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(); |
no test coverage detected