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

Function DefaultItemHit

TombEngine/Game/items.cpp:1030–1057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1028}
1029
1030void DefaultItemHit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex)
1031{
1032 const auto& object = Objects[target.ObjectNumber];
1033
1034 if (object.hitEffect != HitEffect::None && pos.has_value())
1035 {
1036 switch (object.hitEffect)
1037 {
1038 case HitEffect::Blood:
1039 DoBloodSplat(pos->x, pos->y, pos->z, Random::GenerateInt(4, 8), target.Pose.Orientation.y, target.RoomNumber);
1040 break;
1041
1042 case HitEffect::Richochet:
1043 TriggerRicochetSpark(pos.value(), source.Pose.Orientation.y);
1044 break;
1045
1046 case HitEffect::Smoke:
1047 TriggerShatterSmoke(pos.value().x, pos.value().y, pos.value().z);
1048 break;
1049
1050 case HitEffect::NonExplosive:
1051 DoBloodSplat(pos->x, pos->y, pos->z, Random::GenerateInt(4, 8), target.Pose.Orientation.y, target.RoomNumber);
1052 break;
1053 }
1054 }
1055
1056 DoItemHit(&target, damage, isExplosive);
1057}
1058
1059void SyncItemAnimation(ItemInfo& item0, const ItemInfo& item1)
1060{

Callers 4

SpearGuardianHitFunction · 0.85
SwordGuardianHitFunction · 0.85
HitTwinAutoGunFunction · 0.85
ShivaHitFunction · 0.85

Calls 7

DoBloodSplatFunction · 0.85
GenerateIntFunction · 0.85
TriggerShatterSmokeFunction · 0.85
DoItemHitFunction · 0.85
TriggerRicochetSparkFunction · 0.50
has_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected