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

Function FireUPVHarpoon

TombEngine/Objects/TR3/Vehicles/upv.cpp:237–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 }
236
237 static void FireUPVHarpoon(ItemInfo* UPVItem, ItemInfo* laraItem)
238 {
239 auto& upv = *GetUPVInfo(UPVItem);
240
241 auto harpoonPose = Pose(GetJointPosition(UPVItem, UPV_JOINT_TURBINE, Vector3i((upv.HarpoonLeft ? 22 : -22), 24, 230)));
242 if (!FireHarpoon(*laraItem, harpoonPose))
243 return;
244
245 auto soundID = (upv.Flags & UPV_FLAG_SURFACE) ? SFX_TR4_HARPOON_FIRE_DRY : SFX_TR4_HARPOON_FIRE_UNDERWATER;
246 SoundEffect(soundID, &harpoonPose, SoundEnvironment::Always);
247
248 upv.HarpoonLeft = !upv.HarpoonLeft;
249 }
250
251 static void TriggerUPVMist(long x, long y, long z, long velocity, short angle)
252 {

Callers 1

UPVControlFunction · 0.85

Calls 6

GetUPVInfoFunction · 0.85
GetJointPositionFunction · 0.85
FireHarpoonFunction · 0.85
SoundEffectFunction · 0.85
PoseClass · 0.50
Vector3iClass · 0.50

Tested by

no test coverage detected