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

Function M_SpawnSkel

Source/monster.cpp:5313–5338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5311}
5312
5313int M_SpawnSkel(int x, int y, int dir)
5314{
5315 int i, j, skeltypes, skel;
5316
5317 j = 0;
5318 for (i = 0; i < nummtypes; i++) {
5319 if (IsSkel(Monsters[i].mtype))
5320 j++;
5321 }
5322
5323 if (j) {
5324 skeltypes = random_(136, j);
5325 j = 0;
5326 for (i = 0; i < nummtypes && j <= skeltypes; i++) {
5327 if (IsSkel(Monsters[i].mtype))
5328 j++;
5329 }
5330 skel = AddMonster(x, y, dir, i - 1, TRUE);
5331 if (skel != -1)
5332 M_StartSpStand(skel, dir);
5333
5334 return skel;
5335 }
5336
5337 return -1;
5338}
5339
5340void ActivateSpawn(int i, int x, int y, int dir)
5341{

Callers 1

MAI_SkelKingFunction · 0.85

Calls 4

IsSkelFunction · 0.85
random_Function · 0.85
AddMonsterFunction · 0.85
M_StartSpStandFunction · 0.85

Tested by

no test coverage detected