| 1285 | } |
| 1286 | |
| 1287 | void Baddy2Hit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex) |
| 1288 | { |
| 1289 | const auto& player = *GetLaraInfo(&source); |
| 1290 | const auto& object = Objects[target.ObjectNumber]; |
| 1291 | |
| 1292 | if (pos.has_value()) |
| 1293 | { |
| 1294 | if (target.Animation.ActiveState == BADDY_STATE_DODGE && |
| 1295 | (player.Control.Weapon.GunType == LaraWeaponType::Pistol || |
| 1296 | player.Control.Weapon.GunType == LaraWeaponType::Shotgun || |
| 1297 | player.Control.Weapon.GunType == LaraWeaponType::Uzi || |
| 1298 | player.Control.Weapon.GunType == LaraWeaponType::HK || |
| 1299 | player.Control.Weapon.GunType == LaraWeaponType::Revolver)) |
| 1300 | { |
| 1301 | // Baddy2 bullet deflection with sword. |
| 1302 | SoundEffect(SFX_TR4_BADDY_SWORD_RICOCHET, &target.Pose); |
| 1303 | TriggerRicochetSpark(*pos, source.Pose.Orientation.y, false); |
| 1304 | return; |
| 1305 | } |
| 1306 | else if (object.hitEffect == HitEffect::Blood) |
| 1307 | { |
| 1308 | DoBloodSplat(pos->x, pos->y, pos->z, Random::GenerateInt(4, 8), source.Pose.Orientation.y, pos->RoomNumber); |
| 1309 | } |
| 1310 | } |
| 1311 | |
| 1312 | DoItemHit(&target, damage, isExplosive); |
| 1313 | } |
| 1314 | } |
nothing calls this directly
no test coverage detected