| 139 | } |
| 140 | |
| 141 | const void FireHeavyGuardRaygun(ItemInfo& item, bool isRight, bool noLaser) |
| 142 | { |
| 143 | static constexpr auto raygunSmokeLife = 16.0f; |
| 144 | static constexpr auto raygunBurnPrimaryColor = Vector3(0.2f, 0.4f, 1.0f); |
| 145 | static constexpr auto raygunBurnSecondaryColor = Vector3(0.2f, 0.3f, 0.8f); |
| 146 | |
| 147 | const auto& creature = *GetCreatureInfo(&item); |
| 148 | |
| 149 | auto origin = GetJointPosition(&item, HeavyGuardHandJoints[isRight], HeavyGuardRaygunLaserOffsets[isRight]).ToVector3(); |
| 150 | auto target = GetJointPosition( |
| 151 | &item, |
| 152 | HeavyGuardHandJoints[isRight], |
| 153 | Vector3i(HeavyGuardRaygunLaserOffsets[isRight] + Vector3(0, BLOCK(4), 0))).ToVector3(); |
| 154 | |
| 155 | auto orient = Geometry::GetOrientToPoint(origin, target); |
| 156 | |
| 157 | if (noLaser) |
| 158 | { |
| 159 | SpawnRaygunSmoke(origin, orient, abs(item.ItemFlags[isRight])); |
| 160 | return; |
| 161 | } |
| 162 | |
| 163 | SpawnHelicalLaser(origin, target); |
| 164 | |
| 165 | item.ItemFlags[isRight] = raygunSmokeLife; |
| 166 | SpawnRaygunSmoke(origin, orient, raygunSmokeLife); |
| 167 | SpawnRaygunSmoke(origin, orient, raygunSmokeLife); |
| 168 | SpawnRaygunSmoke(origin, orient, raygunSmokeLife); |
| 169 | |
| 170 | auto origin2 = GameVector(origin, item.RoomNumber); |
| 171 | auto target2 = GameVector(target); |
| 172 | auto hitPos = Vector3i::Zero; |
| 173 | |
| 174 | if (ObjectOnLOS2(&origin2, &target2, &hitPos, nullptr, ID_LARA) == creature.Enemy->Index) |
| 175 | { |
| 176 | if (LaraItem->HitPoints <= HEAVY_GUARD_RAYGUN_PLAYER_BURN_HEALTH) |
| 177 | { |
| 178 | ItemCustomBurn(LaraItem, raygunBurnPrimaryColor, raygunBurnSecondaryColor, 1 * FPS); |
| 179 | DoDamage(LaraItem, INT_MAX); |
| 180 | } |
| 181 | else |
| 182 | { |
| 183 | DoDamage(LaraItem, HEAVY_GUARD_RAYGUN_DAMAGE); |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | void InitializeHeavyGuard(short itemNumber) |
| 189 | { |
no test coverage detected