Projectile physics hotfix from Demolitionist.

This commit is contained in:
Marisa the Magician 2022-11-11 21:07:13 +01:00
commit 9e43bf8b8b
11 changed files with 57 additions and 7 deletions

View file

@ -54,6 +54,7 @@ Class BioSpark : Actor
+DONTSPLASH;
-BOUNCEAUTOOFF;
+BOUNCEAUTOOFFFLOORONLY;
+NOFRICTION;
BounceType "Doom";
BounceFactor 0.5;
WallBounceFactor 0.5;
@ -195,6 +196,16 @@ Class BioGel : Actor
if ( (victim is 'BioHitbox') && ((victim.target == master) || (victim.target.master == master)) ) return 1;
return -1;
}
override void FallAndSink( double grav, double oldfloorz )
{
if ( bNOGRAVITY || (waterlevel < 1) )
{
Super.FallAndSink(grav,oldfloorz);
return;
}
vel *= .99;
if ( pos.z > floorz ) vel.z += grav*.01; // floats in water
}
override void Tick()
{
Super.Tick();
@ -206,7 +217,6 @@ Class BioGel : Actor
pitch += yawvel;
if ( waterlevel > 0 )
{
vel.xy *= 0.98;
rollvel *= 0.98;
pitchvel *= 0.98;
yawvel *= 0.98;
@ -580,6 +590,7 @@ Class BioGel : Actor
+NODAMAGETHRUST;
+HITTRACER;
+INTERPOLATEANGLES;
+NOFRICTION;
}
States
{

View file

@ -105,6 +105,8 @@ Class RocketExplLight : PaletteLight
Class UTRocket : Actor
{
Mixin UTMissileFix;
Vector3 InitialDir, Acceleration;
int ticcnt;
Default

View file

@ -116,6 +116,8 @@ Class Splasher : Actor
Class UTCasing : Actor
{
Mixin UTMissileFix;
int deadtimer, numbounces;
double pitchvel, anglevel;
double heat;

View file

@ -189,6 +189,8 @@ Class FlakAccumulator : Thinker
Class FlakChunk : Actor
{
Mixin UTMissileFix;
ChunkTrail trail;
double rollvel, pitchvel, yawvel;
double lifetime, lifespeed;
@ -236,7 +238,6 @@ Class FlakChunk : Actor
if ( isFrozen() ) return;
if ( waterlevel > 0 )
{
vel.xy *= 0.98;
rollvel *= 0.98;
pitchvel *= 0.98;
yawvel *= 0.98;
@ -483,6 +484,8 @@ Class SlugLight : PaletteLight
Class FlakSlug : Actor
{
Mixin UTMissileFix;
Default
{
Obituary "$O_FLAKCANNON";
@ -504,11 +507,6 @@ Class FlakSlug : Actor
Super.PostBeginPlay();
vel.z += 3;
}
override void Tick()
{
Super.Tick();
if ( waterlevel > 0 ) vel.xy *= 0.98;
}
action void A_FlakExplode()
{
bForceXYBillboard = true;

View file

@ -56,6 +56,7 @@ Class PulseSpark : Actor
+DONTSPLASH;
+CANBOUNCEWATER;
-BOUNCEAUTOOFF;
+NOFRICTION;
BounceType "Doom";
BounceFactor 1.0;
WallBounceFactor 1.0;
@ -174,6 +175,7 @@ Class PulseBall : Actor
+EXPLODEONWATER;
+SKYEXPLODE;
+FORCEXYBILLBOARD;
+NOFRICTION;
Scale 0.19;
Speed 22;
Radius 2;

View file

@ -70,6 +70,7 @@ Class Razor2 : Actor
+CANBOUNCEWATER;
+NODAMAGETHRUST;
+DONTBOUNCEONSHOOTABLES;
+NOFRICTION;
}
override void PostBeginPlay()
{

View file

@ -219,6 +219,7 @@ Class ShockSpark : Actor
+DONTSPLASH;
+CANBOUNCEWATER;
-BOUNCEAUTOOFF;
+NOFRICTION;
BounceType "Doom";
BounceFactor 1.0;
WallBounceFactor 1.0;
@ -290,6 +291,7 @@ Class ShockBeam : Actor
+FORCERADIUSDMG;
+NODAMAGETHRUST;
+NOTELEPORT;
+NOFRICTION;
}
override void PostBeginPlay()
{
@ -451,6 +453,7 @@ Class SuperShockSpark : Actor
+DONTSPLASH;
+CANBOUNCEWATER;
-BOUNCEAUTOOFF;
+NOFRICTION;
BounceType "Doom";
BounceFactor 1.0;
WallBounceFactor 1.0;
@ -900,6 +903,7 @@ Class ShockBall : Actor
+EXPLODEONWATER;
+FORCERADIUSDMG;
+NODAMAGETHRUST;
+NOFRICTION;
}
States
{
@ -996,6 +1000,7 @@ Class SuperShockBall : Actor
+EXPLODEONWATER;
+FORCERADIUSDMG;
+NODAMAGETHRUST;
+NOFRICTION;
}
States
{

View file

@ -120,6 +120,8 @@ Class TranslocatorGlow : Actor
Class TranslocatorModule : Actor
{
Mixin UTMissileFix;
Actor b;
bool alreadyhit;

View file

@ -15,6 +15,25 @@ const firstbloodmsg_id = -1401;
const spreemsg_id = -1402;
const multimsg_id = -1403;
// backported from DEMOLITIONIST, needed to fix the broken water physics of some projectiles
Mixin Class UTMissileFix
{
Default
{
+NOFRICTION;
}
override void FallAndSink( double grav, double oldfloorz )
{
if ( bNOGRAVITY || (waterlevel < 1) )
{
Super.FallAndSink(grav,oldfloorz);
return;
}
vel *= .99;
if ( pos.z > floorz ) vel.z -= grav*.01;
}
}
Class UTPlayer : DoomPlayer
{
bool doprintnoammo;
@ -2149,6 +2168,7 @@ Class UTSpark : Actor
+THRUACTORS;
+NOTELEPORT;
+DONTSPLASH;
+NOFRICTION;
BounceType "Doom";
BounceFactor 0.4;
Gravity 0.2;
@ -2209,6 +2229,8 @@ Class UTViewSpark : UTSpark
Class UTChip : Actor
{
Mixin UTMissileFix;
int deadtimer;
double rollvel, anglevel, pitchvel;

View file

@ -60,6 +60,8 @@ Class UTBlood : Actor
// single drop of blod
Class UTBloodDrop : Actor
{
Mixin UTMissileFix;
Default
{
Scale 0.24;
@ -450,6 +452,8 @@ Class UTPlayerGibber : UTGibber
// Chunks
Class UTGib : Actor
{
Mixin UTMissileFix;
double rollvel, anglevel, pitchvel;
Default

View file

@ -280,6 +280,7 @@ Class WarShell : Actor
+FORCERADIUSDMG;
+EXPLODEONWATER;
+INTERPOLATEANGLES;
+NOFRICTION;
}
override void PostBeginPlay()
{