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

Function SethProjectileAttack

TombEngine/Objects/TR4/Entity/tr4_setha.cpp:639–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637 }
638
639 void SethProjectileAttack(const Pose& pose, int roomNumber, int flags)
640 {
641 short fxNumber = CreateNewEffect(roomNumber);
642 if (fxNumber == -1)
643 return;
644
645 auto& fx = EffectList[fxNumber];
646
647 fx.pos.Position.x = pose.Position.x;
648 fx.pos.Position.y = pose.Position.y - Random::GenerateInt(-32, 32);
649 fx.pos.Position.z = pose.Position.z;
650
651 fx.pos.Orientation.x = pose.Orientation.x;
652 fx.pos.Orientation.y = pose.Orientation.y;
653 fx.pos.Orientation.z = 0;
654 fx.roomNumber = roomNumber;
655 fx.counter = (GetRandomControl() * 2) - ANGLE(180.0f); // TODO: This isn't an angle. Run tests on what it actually does.
656 fx.flag1 = flags;
657 fx.objectNumber = ID_ENERGY_BUBBLES;
658 fx.speed = Random::GenerateInt(0, 32) - ((flags == 1) ? 64 : 0) + 96;
659 fx.frameNumber = Objects[ID_ENERGY_BUBBLES].meshIndex + flags;
660 }
661}

Callers 1

SethAttackFunction · 0.85

Calls 4

CreateNewEffectFunction · 0.85
GenerateIntFunction · 0.85
GetRandomControlFunction · 0.85
ANGLEFunction · 0.85

Tested by

no test coverage detected