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

Function InitObjects

Source/objects.cpp:743–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743void InitObjects()
744{
745 int sp_id;
746 BYTE *mem;
747
748 ClrAllObjects();
749 if (currlevel == 16) {
750 AddDiabObjs();
751 } else {
752 InitObjFlag = TRUE;
753 GetRndSeed();
754 if (currlevel == 9 && gbMaxPlayers == 1)
755 AddSlainHero();
756 if (currlevel == quests[QTYPE_BLKM]._qlevel && quests[QTYPE_BLKM]._qactive == 1)
757 AddMushPatch();
758 if (currlevel == 4)
759 AddStoryBooks();
760 if (currlevel == 8)
761 AddStoryBooks();
762 if (currlevel == 12)
763 AddStoryBooks();
764 if (leveltype == DTYPE_CATHEDRAL) {
765 if (QuestStatus(QTYPE_BUTCH))
766 AddTortures();
767 if (QuestStatus(QTYPE_PW))
768 AddCandles();
769 if (QuestStatus(QTYPE_BOL))
770 AddObject(OBJ_SIGNCHEST, 2 * setpc_x + 26, 2 * setpc_y + 19);
771 InitRndLocBigObj(10, 15, OBJ_SARC);
772 AddL1Objs(0, 0, MAXDUNX, MAXDUNY);
773 InitRndBarrels();
774 }
775 if (leveltype == DTYPE_CATACOMBS) {
776 if (QuestStatus(QTYPE_INFRA))
777 InitRndLocObj5x5(1, 1, OBJ_STAND);
778 if (QuestStatus(QTYPE_BONE))
779 InitRndLocObj5x5(1, 1, OBJ_BOOK2R);
780 AddL2Objs(0, 0, MAXDUNX, MAXDUNY);
781 AddL2Torches();
782 if (QuestStatus(QTYPE_BLIND)) {
783 if (plr[myplr]._pClass == PC_WARRIOR) {
784 sp_id = QUEST_BLINDING;
785 } else if (plr[myplr]._pClass == PC_ROGUE) {
786 sp_id = QUEST_RBLINDING;
787 } else if (plr[myplr]._pClass == PC_SORCERER) {
788 sp_id = QUEST_MBLINDING;
789 }
790 quests[QTYPE_BLIND]._qmsg = sp_id;
791 AddBookLever(0, 0, MAXDUNX, MAXDUNY, setpc_x, setpc_y, setpc_w + setpc_x + 1, setpc_h + setpc_y + 1, sp_id);
792 mem = LoadFileInMem("Levels\\L2Data\\Blind2.DUN", NULL);
793 LoadMapObjs(mem, 2 * setpc_x, 2 * setpc_y);
794 mem_free_dbg(mem);
795 }
796 if (QuestStatus(QTYPE_BLOOD)) {
797 if (plr[myplr]._pClass == PC_WARRIOR) {
798 sp_id = QUEST_BLOODY;
799 } else if (plr[myplr]._pClass == PC_ROGUE) {
800 sp_id = QUEST_RBLOODY;

Callers 1

LoadGameLevelFunction · 0.85

Calls 15

ClrAllObjectsFunction · 0.85
AddDiabObjsFunction · 0.85
GetRndSeedFunction · 0.85
AddSlainHeroFunction · 0.85
AddMushPatchFunction · 0.85
AddStoryBooksFunction · 0.85
QuestStatusFunction · 0.85
AddTorturesFunction · 0.85
AddCandlesFunction · 0.85
AddObjectFunction · 0.85
InitRndLocBigObjFunction · 0.85
AddL1ObjsFunction · 0.85

Tested by

no test coverage detected