MCPcopy Create free account
hub / github.com/diasurgical/devilution / InitQuests

Function InitQuests

Source/quests.cpp:53–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51int QuestGroup4[2] = { QTYPE_VEIL, QTYPE_WARLRD };
52
53void InitQuests()
54{
55 int i, initiatedQuests;
56 DWORD z;
57
58 if (gbMaxPlayers == 1) {
59 for (i = 0; i < MAXQUESTS; i++) {
60 quests[i]._qactive = 0;
61 }
62 } else {
63 for (i = 0; i < MAXQUESTS; i++) {
64 if (!(questlist[i]._qflags & 1)) {
65 quests[i]._qactive = 0;
66 }
67 }
68 }
69
70 questlog = FALSE;
71 PentSpn2Frame = 1;
72 WaterDone = 0;
73 initiatedQuests = 0;
74
75 for (z = 0; z < MAXQUESTS; z++) {
76 if (gbMaxPlayers <= 1 || questlist[z]._qflags & 1) {
77 quests[z]._qtype = questlist[z]._qdtype;
78 if (gbMaxPlayers > 1) {
79 quests[z]._qlevel = questlist[z]._qdmultlvl;
80 if (!delta_quest_inited(initiatedQuests)) {
81 quests[z]._qactive = 1;
82 quests[z]._qvar1 = 0;
83 quests[z]._qlog = 0;
84 }
85 initiatedQuests++;
86 } else {
87 quests[z]._qactive = 1;
88 quests[z]._qlevel = questlist[z]._qdlvl;
89 quests[z]._qvar1 = 0;
90 quests[z]._qlog = 0;
91 }
92
93 quests[z]._qslvl = questlist[z]._qslvl;
94 quests[z]._qtx = 0;
95 quests[z]._qty = 0;
96 quests[z]._qidx = z;
97 quests[z]._qlvltype = questlist[z]._qlvlt;
98 quests[z]._qvar2 = 0;
99 quests[z]._qmsg = questlist[z]._qdmsg;
100 }
101 }
102
103 if (gbMaxPlayers == 1) {
104 SetRndSeed(glSeedTbl[15]);
105 if (random_(0, 2))
106 quests[QTYPE_PW]._qactive = 0;
107 else
108 quests[QTYPE_KING]._qactive = 0;
109
110 quests[QuestGroup1[random_(0, sizeof(QuestGroup1) / sizeof(int))]]._qactive = 0;

Callers 1

StartGameFunction · 0.85

Calls 3

delta_quest_initedFunction · 0.85
SetRndSeedFunction · 0.85
random_Function · 0.85

Tested by

no test coverage detected