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

Function PreSpawnSkeleton

Source/monster.cpp:5407–5433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5405}
5406
5407int PreSpawnSkeleton()
5408{
5409 int i, j, skeltypes, skel;
5410
5411 j = 0;
5412
5413 for (i = 0; i < nummtypes; i++) {
5414 if (IsSkel(Monsters[i].mtype))
5415 j++;
5416 }
5417
5418 if (j) {
5419 skeltypes = random_(136, j);
5420 j = 0;
5421 for (i = 0; i < nummtypes && j <= skeltypes; i++) {
5422 if (IsSkel(Monsters[i].mtype))
5423 j++;
5424 }
5425 skel = AddMonster(0, 0, 0, i - 1, FALSE);
5426 if (skel != -1)
5427 M_StartStand(skel, 0);
5428
5429 return skel;
5430 }
5431
5432 return -1;
5433}
5434
5435void TalktoMonster(int i)
5436{

Callers 3

AddSarcFunction · 0.85
AddBarrelFunction · 0.85
Theme_SkelRoomFunction · 0.85

Calls 4

IsSkelFunction · 0.85
random_Function · 0.85
AddMonsterFunction · 0.85
M_StartStandFunction · 0.85

Tested by

no test coverage detected