| 506 | } |
| 507 | |
| 508 | static void _setup_generic(const newgame_def& ng, |
| 509 | bool normal_dungeon_setup /*for catch2-tests*/) |
| 510 | { |
| 511 | // this seems non-ideal, but messages are not being displayed at this point |
| 512 | // so if a force_more_message triggers, the more will just show on a blank |
| 513 | // screen. TODO: it's not clear to me why the more can show up without |
| 514 | // the message that triggered it. |
| 515 | unwind_bool no_more(crawl_state.show_more_prompt, false); |
| 516 | |
| 517 | rng::reset(); // initialize rng from Options.seed |
| 518 | _init_player(); |
| 519 | you.game_seed = crawl_state.seed; |
| 520 | you.deterministic_levelgen = |
| 521 | Options.pregen_dungeon != level_gen_type::classic; |
| 522 | |
| 523 | #if TAG_MAJOR_VERSION == 34 |
| 524 | // Avoid the remove_dead_shops() Gozag fixup in new games: see |
| 525 | // ShoppingList::item_type_identified(). |
| 526 | you.props[REMOVED_DEAD_SHOPS_KEY] = true; |
| 527 | #endif |
| 528 | |
| 529 | // Needs to happen before we give the player items, so that item specs |
| 530 | // in job descriptions can be parsed safely. |
| 531 | initialise_item_sets(); |
| 532 | |
| 533 | // Needs to happen before we give the player items, so that it's safe to |
| 534 | // check whether those items need to be removed from their shopping list. |
| 535 | shopping_list.refresh(); |
| 536 | |
| 537 | you.your_name = ng.name; |
| 538 | you.species = ng.species; |
| 539 | you.char_class = ng.job; |
| 540 | |
| 541 | you.chr_class_name = get_job_name(you.char_class); |
| 542 | |
| 543 | species_stat_init(you.species); // must be down here {dlb} |
| 544 | |
| 545 | // Before we get into the inventory init, set light radius based |
| 546 | // on species vision. |
| 547 | update_vision_range(); |
| 548 | |
| 549 | job_stat_init(you.char_class); |
| 550 | |
| 551 | _unfocus_stats(); |
| 552 | |
| 553 | give_basic_mutations(you.species); |
| 554 | |
| 555 | // This function depends on stats and mutations being finalised. |
| 556 | give_items_skills(ng); |
| 557 | |
| 558 | roll_demonspawn_mutations(); |
| 559 | if (you.has_mutation(MUT_MULTILIVED)) |
| 560 | you.lives = 1; |
| 561 | |
| 562 | if (crawl_state.game_is_sprint()) |
| 563 | _give_bonus_items(); |
| 564 | |
| 565 | // Give tutorial skills etc |
no test coverage detected