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

Function ResyncQuests

Source/quests.cpp:613–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613void ResyncQuests()
614{
615#ifndef SPAWN
616 int i, tren, x, y;
617
618 if (setlevel && setlvlnum == quests[QTYPE_PW]._qslvl && quests[QTYPE_PW]._qactive != 1 && leveltype == quests[QTYPE_PW]._qlvltype) {
619
620 if (quests[QTYPE_PW]._qactive == 3)
621 LoadPalette("Levels\\L3Data\\L3pwater.pal");
622 else
623 LoadPalette("Levels\\L3Data\\L3pfoul.pal");
624
625 for (i = 0; i <= 32; i++)
626 palette_update_quest_palette(i);
627 }
628
629 if (QuestStatus(QTYPE_BOL)) {
630 if (quests[QTYPE_BOL]._qvar1 == 1)
631 ObjChangeMapResync(
632 setpc_w + setpc_x - 2,
633 setpc_h + setpc_y - 2,
634 setpc_w + setpc_x + 1,
635 setpc_h + setpc_y + 1);
636 if (quests[QTYPE_BOL]._qvar1 == 2) {
637 ObjChangeMapResync(
638 setpc_w + setpc_x - 2,
639 setpc_h + setpc_y - 2,
640 setpc_w + setpc_x + 1,
641 setpc_h + setpc_y + 1);
642 ObjChangeMapResync(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 2, (setpc_h >> 1) + setpc_y - 2);
643 for (i = 0; i < nobjects; i++)
644 SyncObjectAnim(objectactive[i]);
645 tren = TransVal;
646 TransVal = 9;
647 DRLG_MRectTrans(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 4, setpc_y + (setpc_h >> 1));
648 TransVal = tren;
649 }
650 if (quests[QTYPE_BOL]._qvar1 == 3) {
651 x = setpc_x;
652 y = setpc_y;
653 ObjChangeMapResync(x, y, x + setpc_w + 1, y + setpc_h + 1);
654 for (i = 0; i < nobjects; i++)
655 SyncObjectAnim(objectactive[i]);
656 tren = TransVal;
657 TransVal = 9;
658 DRLG_MRectTrans(setpc_x, setpc_y, (setpc_w >> 1) + setpc_x + 4, setpc_y + (setpc_h >> 1));
659 TransVal = tren;
660 }
661 }
662 if (currlevel == quests[QTYPE_BLKM]._qlevel) {
663 if (quests[QTYPE_BLKM]._qactive == 1 && !quests[QTYPE_BLKM]._qvar1) {
664 SpawnQuestItem(IDI_FUNGALTM, 0, 0, 5, 1);
665 quests[QTYPE_BLKM]._qvar1 = QS_TOMESPAWNED;
666 } else {
667 if (quests[QTYPE_BLKM]._qactive == 2) {
668 if (quests[QTYPE_BLKM]._qvar1 >= QS_MUSHGIVEN) {
669 Qtalklist[TOWN_WITCH]._qblkm = -1;
670 Qtalklist[TOWN_HEALER]._qblkm = QUEST_MUSH3;

Callers 3

LoadGameFunction · 0.85
LoadLevelFunction · 0.85
LoadGameLevelFunction · 0.85

Calls 8

LoadPaletteFunction · 0.85
QuestStatusFunction · 0.85
ObjChangeMapResyncFunction · 0.85
SyncObjectAnimFunction · 0.85
DRLG_MRectTransFunction · 0.85
SpawnQuestItemFunction · 0.85
InitVPTriggersFunction · 0.85

Tested by

no test coverage detected