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

Function M_DoHeal

Source/monster.cpp:2352–2377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2350}
2351
2352int M_DoHeal(int i)
2353{
2354 MonsterStruct *Monst;
2355
2356 if ((DWORD)i >= MAXMONSTERS)
2357 app_fatal("M_DoHeal: Invalid monster %d", i);
2358 Monst = monster + i;
2359 if (monster[i]._mFlags & MFLAG_NOHEAL) {
2360 Monst->_mFlags &= ~MFLAG_ALLOW_SPECIAL;
2361 Monst->_mmode = MM_SATTACK;
2362 return FALSE;
2363 }
2364
2365 if (Monst->_mAnimFrame == 1) {
2366 Monst->_mFlags &= ~MFLAG_LOCK_ANIMATION;
2367 Monst->_mFlags |= MFLAG_ALLOW_SPECIAL;
2368 if (Monst->_mVar1 + Monst->_mhitpoints < Monst->_mmaxhp) {
2369 Monst->_mhitpoints = Monst->_mVar1 + Monst->_mhitpoints;
2370 } else {
2371 Monst->_mhitpoints = Monst->_mmaxhp;
2372 Monst->_mFlags &= ~MFLAG_ALLOW_SPECIAL;
2373 Monst->_mmode = MM_SATTACK;
2374 }
2375 }
2376 return FALSE;
2377}
2378
2379int M_DoTalk(int i)
2380{

Callers 1

ProcessMonstersFunction · 0.85

Calls 1

app_fatalFunction · 0.85

Tested by

no test coverage detected