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

Function TestTriggers

TombEngine/Game/control/trigger.cpp:424–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void TestTriggers(int x, int y, int z, FloorInfo* floor, Activator activator, bool heavy, int heavyFlags)
425{
426 if (g_GameFlow->CurrentFreezeMode != FreezeMode::None)
427 return;
428
429 bool switchOff = false;
430 bool flipAvailable = false;
431 int flip = NO_VALUE;
432 int newEffect = NO_VALUE;
433 int keyResult = 0;
434 int spotCamIndex = 0;
435
436 auto data = GetTriggerIndex(floor, x, y, z);
437
438 if (!data)
439 return;
440
441 // Don't process legacy triggers if triggerer flag was used in editor and trigger triggerer wasn't activated or used.
442 if (floor->Flags.MarkTriggerer && !floor->Flags.MarkTriggererActive)
443 return;
444
445 short triggerType = (*(data++) >> 8) & TRIGGER_BITS;
446 short flags = *(data++);
447 short timer = (char)(flags & TIMER_BITS);
448
449 if (Camera.type != CameraType::Heavy)
450 RefreshCamera(triggerType, data);
451
452 short value = 0;
453
454 if (heavy)
455 {
456 switch (triggerType)
457 {
458 case TRIGGER_TYPES::HEAVY:
459 case TRIGGER_TYPES::HEAVYANTITRIGGER:
460 break;
461
462 case TRIGGER_TYPES::HEAVYSWITCH:
463 if (!heavyFlags)
464 return;
465
466 if (heavyFlags >= 0)
467 {
468 flags &= CODE_BITS;
469 if (flags != heavyFlags)
470 return;
471 }
472 else
473 {
474 flags |= CODE_BITS;
475 flags += heavyFlags;
476 }
477 break;
478
479 default:
480 // Enemies can only activate heavy triggers
481 return;

Callers 15

ControlBartoliFunction · 0.85
SkidooControlFunction · 0.85
SpeedboatControlFunction · 0.85
ControlElectricCleanerFunction · 0.85
QuadBikeControlFunction · 0.85
UPVControlFunction · 0.85
RubberBoatControlFunction · 0.85
KayakControlFunction · 0.85
MinecartControlFunction · 0.85
DoppelgangerControlFunction · 0.85
GiantMutantControlFunction · 0.85

Calls 15

GetTriggerIndexFunction · 0.85
RefreshCameraFunction · 0.85
SwitchTriggerFunction · 0.85
GetPointCollisionFunction · 0.85
KeyTriggerFunction · 0.85
PickupTriggerFunction · 0.85
AntitriggerFunction · 0.85
TriggerFunction · 0.85
TestLockedCameraFunction · 0.85
InitializeSpotCamFunction · 0.85
PlaySoundTrackFunction · 0.85
PlaySecretTrackFunction · 0.85

Tested by

no test coverage detected