- floatified BuildLavaLimb

This commit is contained in:
Christoph Oelckers 2022-09-10 21:21:44 +02:00
parent 58c2af168f
commit dd152f6406
5 changed files with 16 additions and 10 deletions

View file

@ -166,7 +166,7 @@ void DoRegenerates();
// lavadude
void BuildLava(DExhumedActor* nSprite, const DVector3& pos, sectortype* pSector, DAngle nAngle, int nChannel);
DExhumedActor* BuildLavaLimb(DExhumedActor* nSprite, int edx, int ebx);
DExhumedActor* BuildLavaLimb(DExhumedActor* nSprite, int edx, double ebx);
void FuncLavaLimb(int, int, int, int);
void FuncLava(int, int, int, int);

View file

@ -123,6 +123,7 @@ int RandomLong();
int RandomSize(int nSize);
DAngle RandomAngle9();
DAngle RandomAngle();
double RandomFloat(double range);
// record

View file

@ -37,11 +37,11 @@ static actionSeq LavadudeSeq[] = {
{42, 1}
};
DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, int ebx)
DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, double height)
{
auto pLimbActor = insertActor(pActor->sector(), 118);
pLimbActor->spr.pos = pActor->spr.pos.plusZ((-RandomLong() % ebx) * zmaptoworld);
pLimbActor->spr.pos = pActor->spr.pos.plusZ(-RandomFloat(height));
pLimbActor->spr.cstat = 0;
pLimbActor->spr.shade = -127;
pLimbActor->spr.pal = 1;
@ -205,7 +205,7 @@ void AILavaDude::Damage(RunListEvent* ev)
}
}
BuildLavaLimb(pActor, totalmoves, 64000);
BuildLavaLimb(pActor, totalmoves, 250);
}
}
@ -371,7 +371,7 @@ void AILavaDude::Tick(RunListEvent* ev)
{
if (nFlag & 0x40)
{
auto pLimbSprite = BuildLavaLimb(pActor, pActor->nFrame, 64000);
auto pLimbSprite = BuildLavaLimb(pActor, pActor->nFrame, 250);
D3PlayFX(StaticSound[kSound26], pLimbSprite);
}
@ -382,7 +382,7 @@ void AILavaDude::Tick(RunListEvent* ev)
int ecx = 0;
do
{
BuildLavaLimb(pActor, ecx, 64000);
BuildLavaLimb(pActor, ecx, 250);
ecx++;
} while (ecx < 20);
runlist_ChangeChannel(pActor->nCount, 1);
@ -394,7 +394,7 @@ void AILavaDude::Tick(RunListEvent* ev)
do
{
BuildLavaLimb(pActor, ecx, 256);
BuildLavaLimb(pActor, ecx, 1);
ecx++;
} while (ecx < 30);

View file

@ -349,7 +349,7 @@ int DestroyTailPart()
for (int i = 0; i < 5; i++)
{
int nHeight = GetActorHeight(pActor);
double nHeight = GetActorHeightF(pActor);
BuildLavaLimb(pActor, i, nHeight);
}
@ -945,7 +945,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
if (QueenHead.nIndex2 < 10) {
for (int i = (10 - QueenHead.nIndex2) * 2; i > 0; i--)
{
BuildLavaLimb(pActor, i, GetActorHeight(pActor));
BuildLavaLimb(pActor, i, GetActorHeightF(pActor));
}
}
}
@ -963,7 +963,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
for (i = 0; i < 20; i++)
{
BuildLavaLimb(pActor, i, GetActorHeight(pActor));
BuildLavaLimb(pActor, i, GetActorHeightF(pActor));
}
runlist_SubRunRec(pActor->spr.intowner);

View file

@ -79,6 +79,11 @@ int RandomLong()
return randLong;
}
double RandomFloat(double range)
{
return RandomWord() * range / 0xffff;
}
int RandomSize(int nSize)
{
int randSize = 0;