| 109 | } |
| 110 | |
| 111 | void CollideTrain(short itemNumber, ItemInfo* playerItem, CollisionInfo* coll) |
| 112 | { |
| 113 | auto& item = g_Level.Items[itemNumber]; |
| 114 | auto& player = GetLaraInfo(*playerItem); |
| 115 | |
| 116 | if (!TestBoundsCollide(&item, playerItem, coll->Setup.Radius)) |
| 117 | return; |
| 118 | |
| 119 | if (!HandleItemSphereCollision(item, *playerItem)) |
| 120 | return; |
| 121 | |
| 122 | if (item.ItemFlags[1] < item.ItemFlags[0]) |
| 123 | { |
| 124 | ObjectCollision(itemNumber, playerItem, coll); |
| 125 | return; |
| 126 | } |
| 127 | |
| 128 | SoundEffect(SFX_TR4_LARA_GENERAL_DEATH, &playerItem->Pose, SoundEnvironment::Always); |
| 129 | SoundEffect(SFX_TR4_LARA_HIGH_FALL_DEATH, &playerItem->Pose, SoundEnvironment::Always); |
| 130 | |
| 131 | SetAnimation(playerItem, ID_LARA_EXTRA_ANIMS, LEA_TRAIN_DEATH_START); |
| 132 | playerItem->Animation.IsAirborne = false; |
| 133 | playerItem->Animation.Velocity.y = 0.0f; |
| 134 | playerItem->Animation.Velocity.z = 0.0f; |
| 135 | playerItem->Pose.Orientation.y = item.Pose.Orientation.y; |
| 136 | |
| 137 | DoDamage(playerItem, INT_MAX); |
| 138 | |
| 139 | AnimateItem(playerItem); |
| 140 | |
| 141 | player.ExtraAnim = 1; |
| 142 | player.Control.HandStatus = HandStatus::Busy; |
| 143 | player.Control.Weapon.GunType = LaraWeaponType::None; |
| 144 | player.HitDirection = NO_VALUE; |
| 145 | player.Status.Air = NO_VALUE; |
| 146 | |
| 147 | item.ItemFlags[1] = 160; |
| 148 | |
| 149 | float sinY = phd_sin(item.Pose.Orientation.y); |
| 150 | float cosY = phd_cos(item.Pose.Orientation.y); |
| 151 | |
| 152 | long x = playerItem->Pose.Position.x + CLICK(1) * sinY; |
| 153 | long z = playerItem->Pose.Position.z + CLICK(1) * cosY; |
| 154 | |
| 155 | DoLotsOfBlood(x, playerItem->Pose.Position.y - CLICK(2), z, BLOCK(1), item.Pose.Orientation.y, playerItem->RoomNumber, 15); |
| 156 | } |
| 157 | } |
nothing calls this directly
no test coverage detected