Enable HITOWNER on bounce for grenades (small hack was required), flak shrapnel, ripper blades.

Enable HITOWNER on biosludge after colliding with a surface. Not needed, but just done for the sake of it.
Enable HITOWNER on guided redeemer missiles after they're far away from the shooter.
This commit is contained in:
Marisa the Magician 2018-08-17 21:09:18 +02:00
commit 0c8a16807f
6 changed files with 14 additions and 1 deletions

View file

@ -303,6 +303,7 @@ Class BioGel : Actor
// align self to what surface was hit, currently does not support 3d floors + slopes properly
virtual void AlignSelf()
{
bHITOWNER = true;
A_NoGravity();
A_Stop();
if ( bAMBUSH )

View file

@ -192,6 +192,7 @@ Class UTGrenade : UTRocket
Default
{
DamageType 'GrenadeDeath';
Damage 1; // needs to be nonzero for self-hit to work (might send a PR to fix this later)
-NOGRAVITY;
+USEBOUNCESTATE;
-BOUNCEAUTOOFF;
@ -229,6 +230,7 @@ Class UTGrenade : UTRocket
rollvel = FRandom[Eightball](-16,16);
pitchvel = FRandom[Eightball](-16,16);
anglevel = FRandom[Eightball](-16,16);
bHITOWNER = true;
}
Goto Spawn;
Death:

View file

@ -209,6 +209,7 @@ Class FlakChunk : Actor
}
action void A_HandleBounce()
{
bHITOWNER = true;
A_SprayDecal("WallCrack",-8);
int numpt = Random[Flak](2,3);
if ( frame < 10 )
@ -399,6 +400,7 @@ Class FlakSlug : Actor
for ( int i=0; i<6; i++ )
{
p = Spawn("FlakChunk",pos);
p.bHITOWNER = true;
a = FRandom[Flak](0,360);
s = FRandom[Flak](0,0.2);
Vector3 dir = (x+y*cos(a)*s+z*sin(a)*s).unit();

View file

@ -136,6 +136,7 @@ Class Razor2 : Actor
Bounce:
RAZB A 0
{
bHITOWNER = true;
Vector3 dir = vel.unit();
A_SetAngle(atan2(dir.y,dir.x));
A_SetPitch(asin(-dir.z));

View file

@ -933,7 +933,7 @@ Class UTMainHandler : StaticEventHandler
while ( bi.Next() )
{
Actor a = bi.Thing;
if ( !a || !a.bSHOOTABLE || !Source.CheckSight(a,0xf) || (a == Source) )
if ( !a || !a.bSHOOTABLE || !Source.CheckSight(a,0xf) || (a == Source) || (Source.Distance3D(a) > ExplosionRadius) )
continue;
Vector3 midpoint = a.Vec3Offset(0,0,a.height*0.5);
a.vel += Level.Vec3Diff(Source.pos,midpoint).unit()*(MomentumTransfer/(Thinker.TICRATE*a.mass));

View file

@ -357,15 +357,22 @@ Class GuidedWarShell : WarShell
{
double lagangle, lagpitch, lagroll, lagangle2, lagpitch2, lagroll2,
guideangle, guidepitch, guideroll;
bool justleft;
override void PostBeginPlay()
{
Super.PostBeginPlay();
if ( target && target.player ) target.player.camera = self;
justleft = true;
}
override void Tick()
{
Actor.Tick();
if ( justleft && (Distance3D(target) > (2*max(target.radius,target.height))) )
{
justleft = false;
bHITOWNER = true;
}
if ( globalfreeze || level.frozen ) return;
if ( !bMISSILE ) return;
if ( !target || !target.player || (target.Health <= 0) )