- simple replacements in sector and spawn code

This commit is contained in:
Christoph Oelckers 2022-09-13 19:56:37 +02:00
parent 1c05d80e53
commit dfd098d719
4 changed files with 14 additions and 14 deletions

View file

@ -2061,8 +2061,8 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
CreateActor(targ->sector(), targ->spr.pos.plusZ(-8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5); CreateActor(targ->sector(), targ->spr.pos.plusZ(-8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->int_zvel() >> 2), targ, 5);
break; break;
case BOWLINGBALL: case BOWLINGBALL:
proj->set_int_xvel((targ->int_xvel() >> 1) + (targ->int_xvel() >> 2)); proj->vel.X = targ->vel.X * 0.75;
proj->add_int_ang(-(krand() & 16)); if (krand() & 16) proj->spr.angle -= DAngle22_5 / 8;
S_PlayActorSound(355, targ); S_PlayActorSound(355, targ);
break; break;

View file

@ -406,7 +406,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
act->temp_data[0] = krand() & 1; act->temp_data[0] = krand() & 1;
act->spr.pos.Z = 3 + ps[snum].pos.Z + ps[snum].pyoff - (ps[snum].horizon.sum().asbuildf() * (1/16.)) + (!isshell ? 3 : 0); act->spr.pos.Z = 3 + ps[snum].pos.Z + ps[snum].pyoff - (ps[snum].horizon.sum().asbuildf() * (1/16.)) + (!isshell ? 3 : 0);
act->set_int_zvel(-(krand() & 255)); act->vel.Z = -krandf(1);
} }
else else
{ {
@ -422,12 +422,12 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
{ {
// to the right, with feeling // to the right, with feeling
act->spr.angle = ang + DAngle90; act->spr.angle = ang + DAngle90;
act->set_int_xvel(30); act->vel.X = 1.875;
} }
else else
{ {
act->spr.angle = ang - DAngle90; act->spr.angle = ang - DAngle90;
act->set_int_xvel(20); act->vel.X = 1.25;
} }
act->spr.xrepeat = act->spr.yrepeat = isRR() && isshell? 2 : 4; act->spr.xrepeat = act->spr.yrepeat = isRR() && isshell? 2 : 4;
@ -500,7 +500,7 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor)
} }
else actor->spr.pos.Z -= 13; else actor->spr.pos.Z -= 13;
actor->spr.angle = VecToAngle(ps[connecthead].pos.XY() - actor->spr.pos.XY()); actor->spr.angle = VecToAngle(ps[connecthead].pos.XY() - actor->spr.pos.XY());
actor->set_int_xvel(48 - (krand() & 31)); actor->vel.X = 3 - krandf(2);
ssp(actor, CLIPMASK0); ssp(actor, CLIPMASK0);
} }
else if (!actj) else if (!actj)

View file

@ -203,8 +203,8 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (actj) if (actj)
act->spr.angle = actj->spr.angle; act->spr.angle = actj->spr.angle;
act->spr.pos.Z -= gs.playerheight; act->spr.pos.Z -= gs.playerheight;
act->set_int_zvel(256 - (krand() & 511)); act->vel.Z = 1 - krandf(2);
act->set_int_xvel(64 - (krand() & 127)); act->vel.X = 4 - krandf(8);
ChangeActorStat(act, 4); ChangeActorStat(act, 4);
break; break;
case NATURALLIGHTNING: case NATURALLIGHTNING:
@ -1107,7 +1107,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.angle = actj->spr.angle; act->spr.angle = actj->spr.angle;
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.xrepeat = act->spr.yrepeat = 1; act->spr.xrepeat = act->spr.yrepeat = 1;
act->set_int_xvel(-8); act->vel.X = -0.5;
ssp(act, CLIPMASK0); ssp(act, CLIPMASK0);
} }
[[fallthrough]]; [[fallthrough]];
@ -1162,7 +1162,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.pal = 0; act->spr.pal = 0;
act->SetOwner(act); act->SetOwner(act);
ChangeActorStat(act, STAT_STANDABLE); ChangeActorStat(act, STAT_STANDABLE);
act->set_int_xvel(8); act->vel.X = 0.5;
ssp(act, CLIPMASK0); ssp(act, CLIPMASK0);
break; break;

View file

@ -285,8 +285,8 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (actj) if (actj)
act->spr.angle = actj->spr.angle; act->spr.angle = actj->spr.angle;
act->spr.pos.Z -= gs.playerheight; act->spr.pos.Z -= gs.playerheight;
act->set_int_zvel(256 - (krand() & 511)); act->vel.Z = 1 - krandf(2);
act->set_int_xvel(64 - (krand() & 127)); act->vel.X = 4 - krandf(8);
ChangeActorStat(act, 4); ChangeActorStat(act, 4);
break; break;
case TRANSPORTERSTAR: case TRANSPORTERSTAR:
@ -1358,7 +1358,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.angle = actj->spr.angle; act->spr.angle = actj->spr.angle;
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.xrepeat = act->spr.yrepeat = 1; act->spr.xrepeat = act->spr.yrepeat = 1;
act->set_int_xvel(-8); act->vel.X = -0.5;
ssp(act, CLIPMASK0); ssp(act, CLIPMASK0);
} }
[[fallthrough]]; [[fallthrough]];
@ -1400,7 +1400,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.pal = 0; act->spr.pal = 0;
act->SetOwner(act); act->SetOwner(act);
ChangeActorStat(act, STAT_STANDABLE); ChangeActorStat(act, STAT_STANDABLE);
act->set_int_xvel(8); act->vel.X = 0.5;
ssp(act, CLIPMASK0); ssp(act, CLIPMASK0);
break; break;