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

Function ShivaHit

TombEngine/Objects/TR3/Entity/Shiva.cpp:531–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529 }
530
531 void ShivaHit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex)
532 {
533 if (pos.has_value())
534 {
535 // If immune, ricochet without damage.
536 if (target.ItemFlags[1] != 0)
537 {
538 SoundEffect(SFX_TR4_WEAPON_RICOCHET, &target.Pose);
539 TriggerRicochetSpark(*pos, source.Pose.Orientation.y, false);
540 return;
541 }
542
543 // If guarded, ricochet without damage.
544 if (target.Animation.ActiveState == SHIVA_STATE_WALK_FORWARD_GUARDING ||
545 target.Animation.ActiveState == SHIVA_STATE_GUARD_IDLE)
546 {
547 SoundEffect(SFX_TR4_BADDY_SWORD_RICOCHET, &target.Pose);
548 TriggerRicochetSpark(*pos, source.Pose.Orientation.y, false);
549 return;
550 }
551 }
552
553 DefaultItemHit(target, source, pos, damage, isExplosive, jointIndex);
554 }
555}

Callers

nothing calls this directly

Calls 4

SoundEffectFunction · 0.85
DefaultItemHitFunction · 0.85
TriggerRicochetSparkFunction · 0.50
has_valueMethod · 0.45

Tested by

no test coverage detected