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

Function CreateNewEffect

TombEngine/Game/items.cpp:534–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534short CreateNewEffect(short roomNumber)
535{
536 short fxNumber = NextFxFree;
537
538 if (NextFxFree != NO_VALUE)
539 {
540 auto* fx = &EffectList[NextFxFree];
541
542 // HACK: Overcome a self-referencing deadlock by checking if nextFx points to the same index.
543 if (fxNumber == fx->nextFx)
544 return NO_VALUE;
545
546 NextFxFree = fx->nextFx;
547
548 auto* room = &g_Level.Rooms[roomNumber];
549
550 fx->roomNumber = roomNumber;
551 fx->nextFx = room->fxNumber;
552 fx->nextActive = NextFxActive;
553
554 NextFxActive = fxNumber;
555 room->fxNumber = fxNumber;
556
557 fx->speed = 0;
558 fx->color = Vector4::One;
559 fx->fallspeed = 0;
560 fx->frameNumber = 0;
561 fx->counter = 0;
562 fx->flag1 = 0;
563 fx->flag2 = 0;
564 fx->DisableInterpolation = true;
565 }
566
567 return fxNumber;
568}
569
570void InitializeFXArray()
571{

Callers 15

ThrowKnifeFunction · 0.85
TriggerTonyEffectFunction · 0.85
RomanStatueHitEffectFunction · 0.85
RomanStatueAttackFunction · 0.85
HydraBubblesAttackFunction · 0.85
DoImpStoneAttackFunction · 0.85
TriggerHarpyMissileFunction · 0.85
SethProjectileAttackFunction · 0.85
TriggerDemigodMissileFunction · 0.85
TriggerRiseEffectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected