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

Function SetMapMonsters

Source/monster.cpp:1024–1062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022}
1023
1024void SetMapMonsters(BYTE *pMap, int startx, int starty)
1025{
1026 WORD rw, rh;
1027 WORD *lm;
1028 int i, j;
1029 int mtype;
1030
1031 AddMonsterType(MT_GOLEM, 2);
1032 AddMonster(1, 0, 0, 0, FALSE);
1033 AddMonster(1, 0, 0, 0, FALSE);
1034 AddMonster(1, 0, 0, 0, FALSE);
1035 AddMonster(1, 0, 0, 0, FALSE);
1036 if (setlevel && setlvlnum == SL_VILEBETRAYER) {
1037 AddMonsterType(UniqMonst[UMT_LAZURUS].mtype, 4);
1038 AddMonsterType(UniqMonst[UMT_RED_VEX].mtype, 4);
1039 AddMonsterType(UniqMonst[UMT_BLACKJADE].mtype, 4);
1040 PlaceUniqueMonst(UMT_LAZURUS, 0, 0);
1041 PlaceUniqueMonst(UMT_RED_VEX, 0, 0);
1042 PlaceUniqueMonst(UMT_BLACKJADE, 0, 0);
1043 }
1044 lm = (WORD *)pMap;
1045 rw = SDL_SwapLE16(*lm);
1046 lm++;
1047 rh = SDL_SwapLE16(*lm);
1048 lm += (rw * rh + 1);
1049 rw = rw << 1;
1050 rh = rh << 1;
1051 lm += rw * rh;
1052
1053 for (j = 0; j < rh; j++) {
1054 for (i = 0; i < rw; i++) {
1055 if (*lm) {
1056 mtype = AddMonsterType(MonstConvTbl[SDL_SwapLE16(*lm) - 1], 2);
1057 PlaceMonster(nummonsters++, mtype, i + startx + 16, j + starty + 16);
1058 }
1059 lm++;
1060 }
1061 }
1062}
1063#endif
1064
1065void DeleteMonster(int i)

Callers 5

LoadL1DungeonFunction · 0.85
PlaceQuestMonstersFunction · 0.85
LoadDiabMonstsFunction · 0.85
LoadL2DungeonFunction · 0.85
LoadL3DungeonFunction · 0.85

Calls 4

AddMonsterTypeFunction · 0.85
AddMonsterFunction · 0.85
PlaceUniqueMonstFunction · 0.85
PlaceMonsterFunction · 0.85

Tested by

no test coverage detected