Biorifle sludge now properly follows wall, ceiling and floor movement.

Redeemer shockwaves properly respect actor mass and the DONTTHRUST flag.
All weapons and projectiles have had their knockback adjusted.
This commit is contained in:
Marisa the Magician 2018-06-09 22:53:39 +02:00
commit c5a79e45e3
11 changed files with 73 additions and 5 deletions

View file

@ -46,11 +46,12 @@ This mod requires GZDoom 3.4.0 or later.
## In progress
- General polishing and bugfixing
- Make biorifle sludge follow ceiling and wall movement (this might be hard)
- Add some more effects
- Additional particle effects on explosions
- Smoke on spent casings [DONE]
- View-space particles for weapon fire [WIP]
- Done: Enforcer, Biorifle
- Remaining: Shock Rifle, Pulsegun, Minigun, Flak Cannon, Rocket Launcher, Sniper rifle, Chainsaw
- Visual recoil affecting aim (time to recycle SM's A_Swing once again)
- Additional model optimization and cleanup
- Trim out unused animations (this one is going to be very time-consuming)
@ -72,7 +73,6 @@ This mod requires GZDoom 3.4.0 or later.
- Sometimes the slave enforcer has its psprite "lower" slightly while the main
enforcer is reloading. No idea what causes this (Could be bobbing-related)
- Sludge doesn't react to ceiling and wall movement
- Pulse gun beams behave oddly when the player is moving or looking up and
down. This might just be a rendering interpolation glitch, as usual
- Translocator allows telefragging of other players in coop.

View file

@ -118,6 +118,10 @@ Class BioHitbox : Actor
}
SetOrigin(target.pos-(0,0,height*0.5),true);
}
override bool CanCollideWith( Actor other, bool passive )
{
return !target.bNoGravity; // don't "intercept" while flying (doesn't seem to work, but at least I tried)
}
}
Class BioLight : DynamicLight
@ -179,6 +183,9 @@ Class BioGel : Actor
int deadtimer, dttimer;
Line atline;
int atside;
int atpart;
secplane atplane;
double atz;
int rollvel, pitchvel, yawvel;
Vector3 normal;
@ -218,6 +225,30 @@ Class BioGel : Actor
yawvel *= 0.98;
}
}
if ( deadtimer > -2 )
{
if ( atline ) // attempt to follow the movement of the line
{
if ( atpart == 1 )
{
if ( atline.flags&Line.ML_DONTPEGTOP ) SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(1)),true);
else SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside?0:1].sector.GetPlaneTexZ(1)),true);
}
else if ( atpart == -1 )
{
if ( atline.flags&Line.ML_DONTPEGBOTTOM ) SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(0)),true);
else SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside?0:1].sector.GetPlaneTexZ(0)),true);
}
else if ( atline.flags&Line.ML_DONTPEGBOTTOM ) SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(0)),true);
else SetOrigin(Vec2OffsetZ(0,0,atz+atline.sidedef[atside].sector.GetPlaneTexZ(1)),true);
if ( (pos.z > ceilingz) || (pos.z < floorz) ) deadtimer = min(deadtimer,0);
}
else if ( atplane ) // attempt to follow the movement of the plane
{
SetOrigin(Vec2OffsetZ(0,0,atz+cursector.GetPlaneTexZ(atpart)),true);
if ( ceilingz-floorz <= 2 ) deadtimer = min(deadtimer,0);
}
}
if ( !InStateSequence(CurState,FindState("XDeath")) && ((!bNOGRAVITY && !Random[GES](0,2)) || !Random[GES](0,10)) )
{
int numpt = Min(20,Scale.x*2)+Random[GES](-1,1);
@ -266,6 +297,23 @@ Class BioGel : Actor
Vector3 orig = (BlockingLine.v1.p.x,BlockingLine.v1.p.y,0);
Vector3 onwall = pos-(normal dot (pos-orig))*normal;
SetOrigin(onwall+normal*0.5,false);
// attempt to guess line part (upper/mid/lower)
if ( !atline.sidedef[1] ) atpart = 0; // mid
else if ( atline.sidedef[atside?0:1].sector.ceilingplane.ZAtPoint(pos.xy) < pos.z ) atpart = 1; // upper
else if ( atline.sidedef[atside?0:1].sector.floorplane.ZAtPoint(pos.xy) > pos.z ) atpart = -1; // lower
else atpart = 0;
if ( atpart == 1 )
{
if ( atline.flags&Line.ML_DONTPEGTOP ) atz = pos.z-atline.sidedef[atside].sector.GetPlaneTexZ(1);
else atz = pos.z-atline.sidedef[atside?0:1].sector.GetPlaneTexZ(1);
}
else if ( atpart == -1 )
{
if ( atline.flags&Line.ML_DONTPEGBOTTOM ) atz = pos.z-atline.sidedef[atside].sector.GetPlaneTexZ(0);
else atz = pos.z-atline.sidedef[atside?0:1].sector.GetPlaneTexZ(0);
}
else if ( atline.flags&Line.ML_DONTPEGBOTTOM ) atz = pos.z-atline.sidedef[atside].sector.GetPlaneTexZ(0);
else atz = pos.z-atline.sidedef[atside].sector.GetPlaneTexZ(1);
angle = atan2(normal.y,normal.x);
pitch = 0;
roll = 180; // otherwise it slides upwards (UT changes roll like this too)
@ -274,20 +322,26 @@ Class BioGel : Actor
}
else if ( pos.z <= floorz+4 )
{
atplane = cursector.floorplane;
atpart = 0;
normal = cursector.floorplane.Normal;
pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);
SetOrigin((pos.x,pos.y,floorz)+normal*0.5,false);
atz = pos.z-cursector.GetPlaneTexZ(0);
hittype = HIT_FLOOR;
}
else if ( pos.z >= ceilingz-8 )
{
atplane = cursector.ceilingplane;
atpart = 1;
normal = cursector.ceilingplane.Normal;
pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);
SetOrigin((pos.x,pos.y,ceilingz)+normal*0.5,false);
atz = pos.z-cursector.GetPlaneTexZ(1);
if ( waterlevel > 0 ) hittype = HIT_FLOOR;
else if ( normal dot (0,0,-1) > 0.7 )
hittype = HIT_CEILING;
@ -327,7 +381,7 @@ Class BioGel : Actor
if ( invoker.b ) invoker.b.Destroy();
let s = Spawn("BioXLight",pos);
s.args[3] *= Scale.x;
invoker.deadtimer = -1;
invoker.deadtimer = -2;
if ( invoker.atline ) invoker.atline.RemoteActivate(target,invoker.atside,SPAC_Impact,pos);
A_Explode(Random[GES](20,40)*Scale.x,Min(150,Scale.x*25));
A_PlaySound("ges/explode",CHAN_VOICE);
@ -361,6 +415,7 @@ Class BioGel : Actor
Height 3;
Scale 2;
Speed 18;
ProjectileKickback 220;
PROJECTILE;
-NOGRAVITY;
+SKYEXPLODE;

View file

@ -110,6 +110,7 @@ Class UTRocket : Actor
Radius 2;
Height 2;
Speed 18;
ProjectileKickback 400;
PROJECTILE;
+SKYEXPLODE;
+EXPLODEONWATER;

View file

@ -385,6 +385,7 @@ Class Enforcer : UTWeapon replaces Pistol
Weapon.AmmoType2 "MiniAmmo";
Weapon.AmmoUse2 1;
Weapon.AmmoGive 30;
Weapon.Kickback 180;
Enforcer.ClipCount 20;
Enforcer.SlaveClipCount 20;
}

View file

@ -363,6 +363,7 @@ Class FlakSlug : Actor
Radius 2;
Height 2;
Speed 40;
ProjectileKickback 320;
PROJECTILE;
-NOGRAVITY;
+SKYEXPLODE;

View file

@ -205,6 +205,7 @@ Class Minigun : UTWeapon
Weapon.AmmoType2 "MiniAmmo";
Weapon.AmmoUse2 1;
Weapon.AmmoGive 50;
Weapon.Kickback 180;
}
States
{

View file

@ -186,6 +186,7 @@ Class Razor2Alt : Razor2
DamageFunction Random[Ripper](40,60);
DamageType 'RipperAltDealth';
BounceType "None";
ProjectileKickback 350;
-CANBOUNCEWATER;
+EXPLODEONWATER;
}

View file

@ -32,7 +32,7 @@ Class ShockBeamTracer : LineTracer
}
else if ( (Results.HitType == TRACE_HitWall) && (Results.Tier == TIER_Middle) )
{
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&Line.ML_BlockHitscan) )
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) )
return TRACE_Stop;
return TRACE_Skip;
}
@ -260,6 +260,7 @@ Class ShockBeam : Actor
Radius 0.1;
Height 0;
Scale 0.4;
ProjectileKickback 250;
+NOGRAVITY;
+NOCLIP;
+DONTSPLASH;
@ -781,6 +782,10 @@ Class ShockHitbox : Actor
}
SetOrigin(target.pos-(0,0,height*0.5),true);
}
override bool CanCollideWith( Actor other, bool passive )
{
return ((other is 'ShockBeam') || (other is 'SuperShockBeam'));
}
}
Class ShockBall : Actor
@ -827,6 +832,7 @@ Class ShockBall : Actor
Height 2;
Scale 0.4;
Speed 20;
ProjectileKickback 250;
PROJECTILE;
+FORCEXYBILLBOARD;
+SKYEXPLODE;

View file

@ -138,6 +138,7 @@ Class SniperRifle : UTWeapon
Weapon.AmmoType2 "RifleAmmo";
Weapon.AmmoUse2 1;
Weapon.AmmoGive 8;
Weapon.Kickback 250;
}
States
{

View file

@ -252,6 +252,7 @@ Class UTWeapon : Weapon
Weapon.BobSpeed 1.5;
Weapon.BobRangeX 0.2;
Weapon.BobRangeY 0.4;
Weapon.YAdjust 0;
+WEAPON.NOALERT;
}
}

View file

@ -68,7 +68,7 @@ Class ShockWave : Actor
double moscale = max(0,1100-0.22*dist);
if ( (dist > olddmgradius) || (dir dot a.vel < 0) )
{
a.vel += dir*(moscale/a.mass+20);
if ( !a.bDONTTHRUST ) a.vel += dir*((moscale+20)/a.mass);
a.DamageMobj(self,target,moscale,'RedeemerDeath',DMG_THRUSTLESS);
}
}