- floatified remaining parts of shootflamethrowerflame.

This commit is contained in:
Christoph Oelckers 2022-09-13 23:25:31 +02:00
parent 9d8685096d
commit ef7a6f8c8d

View file

@ -158,7 +158,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
DDukeActor* spawned = nullptr; DDukeActor* spawned = nullptr;
if (p < 0) if (p < 0)
{ {
int x; double x;
int j = findplayer(actor, &x); int j = findplayer(actor, &x);
sang = VecToAngle(ps[j].opos.XY() - spos.XY()); sang = VecToAngle(ps[j].opos.XY() - spos.XY());
@ -170,9 +170,9 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
else if (actor->spr.picnum == BOSS3) else if (actor->spr.picnum == BOSS3)
spos.Z -= 32; spos.Z -= 32;
double l = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length(); double dist = (ps[j].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Length();
if (l != 0) if (dist != 0)
zvel = ((ps[j].opos.Z - spos.Z) * vel) / l; zvel = (((ps[j].opos.Z - spos.Z) * vel) / dist);
if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0) if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0)
sang = actor->spr.angle + mapangle((krand() & 31) - 16); sang = actor->spr.angle + mapangle((krand() & 31) - 16);
@ -182,12 +182,12 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
} }
else else
{ {
zvel = -MulScale(ps[p].horizon.sum().asq16(), 81, 16) * zinttoworld; zvel = -ps[p].horizon.sum().asbuildf() * (81./256.);
// WTF??? // WTF???
DAngle myang = (DAngle90 - (DAngle180 - fabs(fabs(VecToAngle(spos.XY() - ps[p].pos.XY()) - sang) - DAngle180))); DAngle myang = DAngle90 - (DAngle180 - abs(abs(VecToAngle(spos.XY() - ps[p].pos.XY()) - sang) - DAngle180));
if (ps[p].GetActor()->vel.X != 0) if (ps[p].GetActor()->vel.X != 0)
vel = (int)((myang.Buildang() * 0.001953125f * ps[p].GetActor()->int_xvel()) + 400); vel = ((myang / DAngle90) * ps[p].GetActor()->vel.X) + 25;
if (actor->sector()->lotag == 2 && (krand() % 5) == 0) if (actor->sector()->lotag == 2 && (krand() % 5) == 0)
spawned = spawn(actor, WATERBUBBLE); spawned = spawn(actor, WATERBUBBLE);
} }
@ -196,8 +196,8 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
{ {
spawned = spawn(actor, FLAMETHROWERFLAME); spawned = spawn(actor, FLAMETHROWERFLAME);
if (!spawned) return; if (!spawned) return;
spawned->set_int_xvel(vel * worldtoint); spawned->vel.X = vel;
spawned->set_int_zvel(zvel * 256); spawned->vel.Z = zvel;
} }
spawned->spr.pos = spos + (sang + mapangle(112)).ToVector() * 7; spawned->spr.pos = spos + (sang + mapangle(112)).ToVector() * 7;