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

Function M_FallenFear

Source/monster.cpp:4985–5022  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4983}
4984
4985void M_FallenFear(int x, int y)
4986{
4987 int i, mi, rundist, aitype;
4988
4989 for (i = 0; i < nummonsters; i++) {
4990 rundist = 0;
4991 mi = monstactive[i];
4992
4993 switch (monster[mi].MType->mtype) {
4994 case MT_RFALLSP:
4995 case MT_RFALLSD:
4996 rundist = 7;
4997 break;
4998 case MT_DFALLSP:
4999 case MT_DFALLSD:
5000 rundist = 5;
5001 break;
5002 case MT_YFALLSP:
5003 case MT_YFALLSD:
5004 rundist = 3;
5005 break;
5006 case MT_BFALLSP:
5007 case MT_BFALLSD:
5008 rundist = 2;
5009 break;
5010 }
5011 aitype = monster[mi]._mAi;
5012 if (aitype == AI_FALLEN
5013 && rundist
5014 && abs(x - monster[mi]._mx) < 5
5015 && abs(y - monster[mi]._my) < 5
5016 && monster[mi]._mhitpoints >> 6 > 0) {
5017 monster[mi]._mgoal = MGOAL_RETREAT;
5018 monster[mi]._mgoalvar1 = rundist;
5019 monster[mi]._mdir = GetDirection(x, y, monster[i]._mx, monster[i]._my);
5020 }
5021 }
5022}
5023
5024void PrintMonstHistory(int mt)
5025{

Callers 2

MonstStartKillFunction · 0.85
M2MStartKillFunction · 0.85

Calls 1

GetDirectionFunction · 0.85

Tested by

no test coverage detected