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

Function M_GetKnockback

Source/monster.cpp:1474–1496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1472}
1473
1474void M_GetKnockback(int i)
1475{
1476 int d = (monster[i]._mdir - 4) & 7;
1477 if (DirOK(i, d)) {
1478 M_ClearSquares(i);
1479 monster[i]._moldx += offset_x[d];
1480 monster[i]._moldy += offset_y[d];
1481 NewMonsterAnim(i, &monster[i].MType->Anims[MA_GOTHIT], monster[i]._mdir);
1482 monster[i]._mmode = MM_GOTHIT;
1483 monster[i]._mxoff = 0;
1484 monster[i]._myoff = 0;
1485 monster[i]._mx = monster[i]._moldx;
1486 monster[i]._my = monster[i]._moldy;
1487 monster[i]._mfutx = monster[i]._mx;
1488 monster[i]._mfuty = monster[i]._my;
1489 // BUGFIX useless assignment
1490 monster[i]._moldx = monster[i]._mx;
1491 monster[i]._moldy = monster[i]._my;
1492 M_CheckEFlag(i);
1493 M_ClearSquares(i);
1494 dMonster[monster[i]._mx][monster[i]._my] = i + 1;
1495 }
1496}
1497
1498void M_StartHit(int i, int pnum, int dam)
1499{

Callers 3

On_KNOCKBACKFunction · 0.85
MonsterMHitFunction · 0.85
player.cppFile · 0.85

Calls 4

DirOKFunction · 0.85
M_ClearSquaresFunction · 0.85
NewMonsterAnimFunction · 0.85
M_CheckEFlagFunction · 0.85

Tested by

no test coverage detected