- floatified handle_se06 (both variants)

This commit is contained in:
Christoph Oelckers 2022-09-11 21:01:38 +02:00
parent 228db5839a
commit 3898e2fa4c
2 changed files with 15 additions and 15 deletions

View file

@ -3162,18 +3162,18 @@ void handle_se06_d(DDukeActor* actor)
{
actor->temp_data[4]--;
if (actor->temp_data[4] >= (k - (k >> 3)))
actor->add_int_xvel(-(k >> 5));
actor->vel.X -= (k >> 5) / 16.;
if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3)))
actor->vel.X = 0;
if (actor->temp_data[4] < (k >> 1))
actor->add_int_xvel( (k >> 5));
actor->vel.X += (k >> 5) / 16.;
if (actor->temp_data[4] < ((k >> 1) - (k >> 3)))
{
actor->temp_data[4] = 0;
actor->set_int_xvel(k);
actor->vel.X = k / 16.;
}
}
else actor->set_int_xvel(k);
else actor->vel.X = k / 16.;
DukeStatIterator it(STAT_EFFECTOR);
while (auto act2 = it.Next())
@ -3183,9 +3183,9 @@ void handle_se06_d(DDukeActor* actor)
act2->vel.X = actor->vel.X;
//if( actor->temp_data[4] == 1 )
{
if (act2->temp_data[5] == 0)
act2->temp_data[5] = dist(act2, actor);
int x = Sgn(dist(act2, actor) - act2->temp_data[5]);
if (act2->temp_pos.X == 0)
act2->temp_pos.X = (act2->spr.pos - actor->spr.pos).LengthSquared();
int x = Sgn((act2->spr.pos - actor->spr.pos).LengthSquared() - act2->temp_pos.X);
if (act2->spr.extra)
x = -x;
actor->vel.X += x / 16.;

View file

@ -3137,15 +3137,15 @@ void handle_se06_r(DDukeActor *actor)
{
actor->temp_data[4]--;
if (actor->temp_data[4] >= (k - (k >> 3)))
actor->add_int_xvel(-(k >> 5));
actor->vel.X -= (k >> 5) / 16.;
if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3)))
actor->vel.X = 0;
if (actor->temp_data[4] < (k >> 1))
actor->add_int_xvel( (k >> 5));
actor->vel.X += (k >> 5) / 16.;
if (actor->temp_data[4] < ((k >> 1) - (k >> 3)))
{
actor->temp_data[4] = 0;
actor->set_int_xvel(k);
actor->vel.X = k / 16.;
if ((!isRRRA() || lastlevel) && hulkspawn)
{
hulkspawn--;
@ -3157,7 +3157,7 @@ void handle_se06_r(DDukeActor *actor)
}
if (!hulkspawn)
{
ns = EGS(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->sector()->int_ceilingz() + 119428, 3677, -8, 16, 16, 0, 0, 0, actor, 5);
ns = CreateActor(actor->sector(), DVector3(actor->spr.pos.XY(), actor->sector()->ceilingz + 466.5), 3677, -8, 16, 16, 0, 0, 0, actor, 5);
if (ns)
{
ns->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
@ -3180,7 +3180,7 @@ void handle_se06_r(DDukeActor *actor)
}
else
{
actor->set_int_xvel(k);
actor->vel.X = k / 16.;
DukeSectIterator it(actor->sector());
while (auto a2 = it.Next())
{
@ -3223,9 +3223,9 @@ void handle_se06_r(DDukeActor *actor)
act2->vel.X = actor->vel.X;
//if( actor->temp_data[4] == 1 )
{
if (act2->temp_data[5] == 0)
act2->temp_data[5] = dist(act2, actor);
int x = Sgn(dist(act2, actor) - act2->temp_data[5]);
if (act2->temp_pos.X == 0)
act2->temp_pos.X = (act2->spr.pos - actor->spr.pos).LengthSquared();
int x = Sgn((act2->spr.pos - actor->spr.pos).LengthSquared() - act2->temp_pos.X);
if (act2->spr.extra) x = -x;
actor->vel.X += x / 16.;
}