MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / CreatureAnimation

Function CreatureAnimation

TombEngine/Game/control/box.cpp:1373–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1371}
1372
1373bool CreatureAnimation(short itemNumber, short headingAngle, short tiltAngle)
1374{
1375 auto& item = g_Level.Items[itemNumber];
1376 if (!item.IsCreature())
1377 return false;
1378
1379 auto& creature = *GetCreatureInfo(&item);
1380
1381 SpawnCreatureGunEffect(item, creature.MuzzleFlash[0]);
1382 SpawnCreatureGunEffect(item, creature.MuzzleFlash[1]);
1383
1384 auto prevPos = item.Pose.Position;
1385
1386 AnimateItem(item);
1387 ProcessSectorFlags(&item);
1388 CreatureHealth(&item);
1389
1390 if (item.Status == ITEM_DEACTIVATED)
1391 {
1392 CreatureDie(itemNumber, false);
1393 return false;
1394 }
1395
1396 return CreaturePathfind(&item, prevPos, headingAngle, tiltAngle);
1397}
1398
1399void CreatureHealth(ItemInfo* item)
1400{

Callers 15

SpearGuardianControlFunction · 0.85
SmallSpiderControlFunction · 0.85
BigSpiderControlFunction · 0.85
BarracudaControlFunction · 0.85
SilencerControlFunction · 0.85
MonkControlFunction · 0.85
WorkerMachineGunControlFunction · 0.85
SkidooManControlFunction · 0.85
SharkControlFunction · 0.85
KnifeThrowerControlFunction · 0.85
BirdMonsterControlFunction · 0.85
WorkerShotgunControlFunction · 0.85

Calls 8

GetCreatureInfoFunction · 0.85
SpawnCreatureGunEffectFunction · 0.85
AnimateItemFunction · 0.85
ProcessSectorFlagsFunction · 0.85
CreatureHealthFunction · 0.85
CreatureDieFunction · 0.85
CreaturePathfindFunction · 0.85
IsCreatureMethod · 0.80

Tested by

no test coverage detected