diff --git a/source/core/namedef_custom.h b/source/core/namedef_custom.h index 1a14842ae3..d309ad9a77 100644 --- a/source/core/namedef_custom.h +++ b/source/core/namedef_custom.h @@ -31,3 +31,4 @@ xx(floating_floordist) xx(floating_ceilingdist) xx(landmovefactor) xx(watermovefactor) +xx(gravityfactor) \ No newline at end of file diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index fb251ca8f5..e13f612640 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -49,9 +49,6 @@ This file is a combination of code from the following sources: BEGIN_DUKE_NS -double adjustfall(DDukeActor* actor, double c); - - //--------------------------------------------------------------------------- // // this is the implementation of DDukeActor::Tick. It is native so that @@ -3775,14 +3772,9 @@ void makeitfall(DDukeActor* actor) grav = 0; else { - if( ceilingspace(actor->sector()) || actor->sector()->lotag == ST_2_UNDERWATER) - grav = gs.gravity/6; - else grav = gs.gravity; - } - - if (isRRRA()) - { - grav = adjustfall(actor, grav); // this accesses sprite indices and cannot be in shared code. Should be done better. (todo: turn into actor flags) + if (ceilingspace(actor->sector()) || actor->sector()->lotag == ST_2_UNDERWATER) + grav = gs.gravity / 6; + else grav = gs.gravity * actor->FloatVar(NAME_gravityfactor); } if ((actor->spr.statnum == STAT_ACTOR || actor->spr.statnum == STAT_PLAYER || actor->spr.statnum == STAT_ZOMBIEACTOR || actor->spr.statnum == STAT_STANDABLE)) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 6fe9df51c2..85c0f3c518 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -546,7 +546,7 @@ void handle_se06_r(DDukeActor *actor) } if (!hulkspawn) { - ns = CreateActor(actor->sector(), DVector3(actor->spr.pos.XY(), actor->sector()->ceilingz + 466.5), RTILE_UFOLIGHT, -8, DVector2(0.25, 0.25), nullAngle, 0., 0., actor, 5); + ns = CreateActor(actor->sector(), DVector3(actor->spr.pos.XY(), actor->sector()->ceilingz + 466.5), RedneckUfoLightClass, -8, DVector2(0.25, 0.25), nullAngle, 0., 0., actor, 5); if (ns) { ns->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT; @@ -572,7 +572,7 @@ void handle_se06_r(DDukeActor *actor) DukeSectIterator it(actor->sector()); while (auto a2 = it.Next()) { - if (a2->spr.picnum == RTILE_UFOBEAM && ufospawn && ++ufocnt == 64) + if (a2->GetClass() == RedneckUfoBeamClass && ufospawn && ++ufocnt == 64) { ufocnt = 0; ufospawn--; diff --git a/source/games/duke/src/classnames.h b/source/games/duke/src/classnames.h index 2f6b20129f..b35d60edb1 100644 --- a/source/games/duke/src/classnames.h +++ b/source/games/duke/src/classnames.h @@ -81,6 +81,8 @@ xx(RedneckUfo2) xx(RedneckUfo3) xx(RedneckUfo4) xx(RedneckUfoRRRA) +xx(RedneckUfoBeam) +xx(RedneckUfoLight) xx(DukeShotgunShot) xx(DukeChaingunShot) xx(DukeGrowSpark) diff --git a/wadsrc/static/zscript/games/duke/actors/redneckenemies.zs b/wadsrc/static/zscript/games/duke/actors/redneckenemies.zs index 7a31beef4a..2e5ca896f8 100644 --- a/wadsrc/static/zscript/games/duke/actors/redneckenemies.zs +++ b/wadsrc/static/zscript/games/duke/actors/redneckenemies.zs @@ -8,6 +8,7 @@ class RedneckBikerBV2 : DukeActor +KILLCOUNT; +LOOKALLAROUND; watermovefactor 0.5; + gravityfactor 0.125; } override void Initialize() { @@ -25,6 +26,7 @@ class RedneckBikerB : DukeActor +KILLCOUNT; +LOOKALLAROUND; watermovefactor 0.5; + gravityfactor 0.25; } override void Initialize() { @@ -74,6 +76,7 @@ class RedneckCheerleaderB : DukeActor +KILLCOUNT; +LOOKALLAROUND; watermovefactor 0.5; + gravityfactor 0.25; } override void Initialize() { diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index 458ef73097..fa484fe93c 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -124,6 +124,7 @@ class DukeActor : CoreActor native floating_ceilingdist 66; landmovefactor 1; watermovefactor 1; + gravityfactor 1; } enum EStatnums { @@ -258,6 +259,7 @@ class DukeActor : CoreActor native meta double floating_ceilingdist; meta double landmovefactor; meta double watermovefactor; + meta double gravityfactor; property prefix: none; property gutsoffset: gutsoffset;