| 763 | } |
| 764 | |
| 765 | void |
| 766 | newgame(void) |
| 767 | { |
| 768 | int i; |
| 769 | |
| 770 | /* make sure welcome messages are given before noticing monsters */ |
| 771 | notice_mon_off(); |
| 772 | disp.botlx = TRUE; |
| 773 | svc.context.ident = 2; /* id 1 is reserved for gy.youmonst */ |
| 774 | svc.context.warnlevel = 1; |
| 775 | svc.context.next_attrib_check = 600L; /* arbitrary first setting */ |
| 776 | svc.context.tribute.enabled = TRUE; /* turn on 3.6 tributes */ |
| 777 | svc.context.tribute.tributesz = sizeof(struct tribute_info); |
| 778 | get_nhuuid(); |
| 779 | |
| 780 | for (i = LOW_PM; i < NUMMONS; i++) |
| 781 | svm.mvitals[i].mvflags = mons[i].geno & G_NOCORPSE; |
| 782 | |
| 783 | init_objects(); /* must be before u_init() */ |
| 784 | |
| 785 | flags.pantheon = -1; /* role_init() will reset this */ |
| 786 | role_init(); /* must be before init_dungeons(), u_init(), |
| 787 | * and init_artifacts() */ |
| 788 | |
| 789 | init_dungeons(); /* must be before u_init() to avoid rndmonst() |
| 790 | * creating odd monsters for any tins and eggs |
| 791 | * in hero's initial inventory */ |
| 792 | init_artifacts(); /* before u_init() in case $WIZKIT specifies |
| 793 | * any artifacts */ |
| 794 | u_init_misc(); |
| 795 | |
| 796 | l_nhcore_init(); /* create a Lua state that lasts until end of game */ |
| 797 | reset_glyphmap(gm_newgame); |
| 798 | #ifndef NO_SIGNAL |
| 799 | (void) signal(SIGINT, (SIG_RET_TYPE) done1); |
| 800 | #endif |
| 801 | #ifdef NEWS |
| 802 | if (iflags.news) |
| 803 | display_file(NEWS, FALSE); |
| 804 | #endif |
| 805 | /* quest_init(); -- Now part of role_init() */ |
| 806 | |
| 807 | mklev(); |
| 808 | u_on_upstairs(); |
| 809 | vision_reset(); /* set up internals for level (after mklev) */ |
| 810 | check_special_room(FALSE); |
| 811 | |
| 812 | if (MON_AT(u.ux, u.uy)) |
| 813 | mnexto(m_at(u.ux, u.uy), RLOC_NOMSG); |
| 814 | (void) makedog(); |
| 815 | |
| 816 | u_init_inventory_attrs(); |
| 817 | docrt(); |
| 818 | flush_screen(1); |
| 819 | bot(); |
| 820 | while (u.uroleplay.reroll && reroll_menu()) { |
| 821 | u_init_inventory_attrs(); |
| 822 | bot(); |
no test coverage detected