mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- floatified PlayerBubble
This commit is contained in:
parent
a63527c892
commit
caf6dacbb5
2 changed files with 6 additions and 7 deletions
|
@ -148,6 +148,7 @@ using BloodStatIterator = TStatIterator<DBloodActor>;
|
||||||
using BloodSectIterator = TSectIterator<DBloodActor>;
|
using BloodSectIterator = TSectIterator<DBloodActor>;
|
||||||
using BloodSpriteIterator = TSpriteIterator<DBloodActor>;
|
using BloodSpriteIterator = TSpriteIterator<DBloodActor>;
|
||||||
|
|
||||||
|
[[deprecated]]
|
||||||
inline void GetActorExtents(DBloodActor* actor, int* top, int* bottom)
|
inline void GetActorExtents(DBloodActor* actor, int* top, int* bottom)
|
||||||
{
|
{
|
||||||
double t, b;
|
double t, b;
|
||||||
|
|
|
@ -338,16 +338,14 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10
|
||||||
PLAYER* pPlayer = &gPlayer[actor->spr.type - kDudePlayer1];
|
PLAYER* pPlayer = &gPlayer[actor->spr.type - kDudePlayer1];
|
||||||
if (!pPlayer->bubbleTime)
|
if (!pPlayer->bubbleTime)
|
||||||
return;
|
return;
|
||||||
int top, bottom;
|
double top, bottom;
|
||||||
GetActorExtents(actor, &top, &bottom);
|
GetActorExtents(actor, &top, &bottom);
|
||||||
for (int i = 0; i < (pPlayer->bubbleTime >> 6); i++)
|
for (int i = 0; i < (pPlayer->bubbleTime >> 6); i++)
|
||||||
{
|
{
|
||||||
int nDist = (actor->spr.xrepeat * (tileWidth(actor->spr.picnum) / 2)) >> 2;
|
double nDist = (actor->spr.xrepeat * tileWidth(actor->spr.picnum)) * (REPEAT_SCALE / 2);
|
||||||
int nAngle = Random(2048);
|
DVector2 pos = actor->spr.pos.XY() + actor->spr.angle.ToVector() * nDist;
|
||||||
int x = actor->int_pos().X + MulScale(nDist, Cos(nAngle), 30);
|
double z = bottom - RandomD(bottom - top, 8);
|
||||||
int y = actor->int_pos().Y + MulScale(nDist, Sin(nAngle), 30);
|
auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), DVector3(pos, z), 0);
|
||||||
int z = bottom - Random(bottom - top);
|
|
||||||
auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), x, y, z, 0);
|
|
||||||
if (pFX)
|
if (pFX)
|
||||||
{
|
{
|
||||||
pFX->vel.X = actor->vel.X + Random2F(0x1aaaa);
|
pFX->vel.X = actor->vel.X + Random2F(0x1aaaa);
|
||||||
|
|
Loading…
Reference in a new issue