From dfd098d719209936e499c83c2bc7b65ee7b573d0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Sep 2022 19:56:37 +0200 Subject: [PATCH] - simple replacements in sector and spawn code --- source/games/duke/src/sectors_r.cpp | 4 ++-- source/games/duke/src/spawn.cpp | 8 ++++---- source/games/duke/src/spawn_d.cpp | 8 ++++---- source/games/duke/src/spawn_r.cpp | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index ea9fe949e..e00b9277c 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -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); break; case BOWLINGBALL: - proj->set_int_xvel((targ->int_xvel() >> 1) + (targ->int_xvel() >> 2)); - proj->add_int_ang(-(krand() & 16)); + proj->vel.X = targ->vel.X * 0.75; + if (krand() & 16) proj->spr.angle -= DAngle22_5 / 8; S_PlayActorSound(355, targ); break; diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index d474658d3..4dd9e5ef9 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -406,7 +406,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell) 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->set_int_zvel(-(krand() & 255)); + act->vel.Z = -krandf(1); } else { @@ -422,12 +422,12 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell) { // to the right, with feeling act->spr.angle = ang + DAngle90; - act->set_int_xvel(30); + act->vel.X = 1.875; } else { 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; @@ -500,7 +500,7 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor) } else actor->spr.pos.Z -= 13; 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); } else if (!actj) diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 825668f5a..cec659aa6 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -203,8 +203,8 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (actj) act->spr.angle = actj->spr.angle; act->spr.pos.Z -= gs.playerheight; - act->set_int_zvel(256 - (krand() & 511)); - act->set_int_xvel(64 - (krand() & 127)); + act->vel.Z = 1 - krandf(2); + act->vel.X = 4 - krandf(8); ChangeActorStat(act, 4); break; case NATURALLIGHTNING: @@ -1107,7 +1107,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* act->spr.angle = actj->spr.angle; act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; act->spr.xrepeat = act->spr.yrepeat = 1; - act->set_int_xvel(-8); + act->vel.X = -0.5; ssp(act, CLIPMASK0); } [[fallthrough]]; @@ -1162,7 +1162,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* act->spr.pal = 0; act->SetOwner(act); ChangeActorStat(act, STAT_STANDABLE); - act->set_int_xvel(8); + act->vel.X = 0.5; ssp(act, CLIPMASK0); break; diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index c82c35701..6bffda2b1 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -285,8 +285,8 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (actj) act->spr.angle = actj->spr.angle; act->spr.pos.Z -= gs.playerheight; - act->set_int_zvel(256 - (krand() & 511)); - act->set_int_xvel(64 - (krand() & 127)); + act->vel.Z = 1 - krandf(2); + act->vel.X = 4 - krandf(8); ChangeActorStat(act, 4); break; case TRANSPORTERSTAR: @@ -1358,7 +1358,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.angle = actj->spr.angle; act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; act->spr.xrepeat = act->spr.yrepeat = 1; - act->set_int_xvel(-8); + act->vel.X = -0.5; ssp(act, CLIPMASK0); } [[fallthrough]]; @@ -1400,7 +1400,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.pal = 0; act->SetOwner(act); ChangeActorStat(act, STAT_STANDABLE); - act->set_int_xvel(8); + act->vel.X = 0.5; ssp(act, CLIPMASK0); break;