| 507 | } |
| 508 | |
| 509 | void PunaHit(ItemInfo& target, ItemInfo& source, std::optional<GameVector> pos, int damage, bool isExplosive, int jointIndex) |
| 510 | { |
| 511 | if (target.TestFlags((int)BossItemFlags::Object, (short)BossFlagValue::Shield) && |
| 512 | target.TestFlagField((int)BossItemFlags::ShieldIsEnabled, 1)) |
| 513 | { |
| 514 | auto color = Vector4( |
| 515 | 0.0f, |
| 516 | Random::GenerateFloat(0.0f, 0.5f), |
| 517 | Random::GenerateFloat(0.0f, 0.5f), |
| 518 | Random::GenerateFloat(0.5f, 0.8f)); |
| 519 | |
| 520 | if (pos.has_value() && !isExplosive) |
| 521 | { |
| 522 | SpawnShieldAndRichochetSparks(target, pos->ToVector3(), color); |
| 523 | } |
| 524 | else if (isExplosive) |
| 525 | { |
| 526 | SpawnShield(target, color); |
| 527 | } |
| 528 | } |
| 529 | else |
| 530 | { |
| 531 | if (target.HitStatus) |
| 532 | SoundEffect(SFX_TR3_PUNA_BOSS_TAKE_HIT, &target.Pose); |
| 533 | |
| 534 | if (pos.has_value()) |
| 535 | DoBloodSplat(pos->x, pos->y, pos->z, 5, source.Pose.Orientation.y, pos->RoomNumber); |
| 536 | |
| 537 | DoItemHit(&target, damage, isExplosive, false); |
| 538 | } |
| 539 | } |
| 540 | } |
nothing calls this directly
no test coverage detected