mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 19:21:44 +00:00
- floatified fxFlameLick
This commit is contained in:
parent
d349eabcbc
commit
24f4e1894c
1 changed files with 10 additions and 11 deletions
|
@ -39,22 +39,21 @@ BEGIN_BLD_NS
|
||||||
void fxFlameLick(DBloodActor* actor, sectortype*) // 0
|
void fxFlameLick(DBloodActor* actor, sectortype*) // 0
|
||||||
{
|
{
|
||||||
if (!actor) return;
|
if (!actor) return;
|
||||||
int top, bottom;
|
double top, bottom;
|
||||||
GetActorExtents(actor, &top, &bottom);
|
GetActorExtents(actor, &top, &bottom);
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 3;
|
double nDist = (actor->spr.xrepeat * tileWidth(actor->spr.picnum)) * (REPEAT_SCALE / 4);
|
||||||
int nAngle = Random(2048);
|
DAngle nAngle = RandomAngle();
|
||||||
int dx = MulScale(nDist, Cos(nAngle), 30);
|
DVector2 dv = nAngle.ToVector() * nDist;
|
||||||
int dy = MulScale(nDist, Sin(nAngle), 30);
|
DVector2 pos = actor->spr.pos.XY() + dv;
|
||||||
int x = actor->int_pos().X + dx;
|
double z = bottom - RandomD(bottom - top, 8);
|
||||||
int y = actor->int_pos().Y + dy;
|
|
||||||
int z = bottom - Random(bottom - top);
|
auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), DVector3(pos, z), 0);
|
||||||
auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), x, y, z, 0);
|
|
||||||
if (pFX)
|
if (pFX)
|
||||||
{
|
{
|
||||||
pFX->vel.X = actor->vel.X + Random2F(-dx);
|
pFX->vel.X = actor->vel.X + Random2F(-int(16 * dv.X));
|
||||||
pFX->vel.Y = actor->vel.Y + Random2F(-dy);
|
pFX->vel.Y = actor->vel.Y + Random2F(-int(16 * dv.Y));
|
||||||
pFX->vel.Z = actor->vel.Z - Random2F(0x1aaaa);
|
pFX->vel.Z = actor->vel.Z - Random2F(0x1aaaa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue