Port additional ricochet effect from tomb4

This commit is contained in:
Lwmte 2025-01-02 11:15:04 +01:00
parent 06ee8fa4b8
commit 7f071b5ec5

View file

@ -5,6 +5,7 @@
#include <array>
#include "Game/control/control.h"
#include "Game/effects/effects.h"
#include "Game/Setup.h"
#include "Math/Math.h"
#include "Math/Random.h"
@ -100,6 +101,43 @@ namespace TEN::Effects::Spark
s.destinationColor = Vector4::Zero;
s.active = true;
}
auto& sptr = *GetFreeParticle();
sptr = {};
sptr.on = true;
sptr.sR = colorStart.x * 0.33f * UCHAR_MAX;
sptr.sG = colorStart.y * 0.33f * UCHAR_MAX;
sptr.sB = colorStart.z * 0.33f * UCHAR_MAX;
sptr.dR = 0;
sptr.dG = 0;
sptr.dB = 0;
sptr.colFadeSpeed = 4;
sptr.fadeToBlack = 0;
sptr.life = 4;
sptr.sLife = 4;
sptr.blendMode = BlendMode::Additive;
sptr.x = pos.x;
sptr.y = pos.y;
sptr.z = pos.z;
sptr.xVel = 0;
sptr.yVel = 0;
sptr.zVel = 0;
sptr.flags = 26;
sptr.rotAng = GenerateAngle(0, 4095);
if (TestProbability(1 / 2.0f))
sptr.rotAdd = 64 - GenerateAngle(0, 63);
else
sptr.rotAdd = GenerateAngle(0, 63) + 64;
sptr.scalar = 3;
sptr.spriteIndex = Objects[ID_DEFAULT_SPRITES].meshIndex + 12;
sptr.size = GenerateInt(6, 12);
sptr.sSize = sptr.size;
sptr.dSize = 1;
sptr.maxYvel = 0;
sptr.gravity = 0;
}
void TriggerFrictionSpark(const GameVector& pos, const EulerAngles& angle, float length, int count)