husk annoyance fixes

This commit is contained in:
Shtoyan 2022-01-19 16:30:47 +04:00
parent 4f708c52e0
commit f2b65b61ad

View File

@ -125,18 +125,28 @@ function float GetStunDurationMult(Pawn instigatedBy, Vector hitLocation, Vector
return 0.5 * stunDurationMultiplier; return 0.5 * stunDurationMultiplier;
} }
function SpawnTwoShots(){ function SpawnTwoShots()
{
local vector X, Y, Z, FireStart; local vector X, Y, Z, FireStart;
local rotator FireRotation; local rotator FireRotation;
local KFMonsterController KFMonstControl; local KFMonsterController KFMonstControl;
if(controller != none && KFDoorMover(controller.Target) != none){
controller.Target.TakeDamage(22,Self,Location,vect(0,0,0),Class'DamTypeVomit'); // can NOT shoot if brainless, dying, falling, being moved by other husks
if (Controller == none || IsInState('ZombieDying') || IsInState('GettingOutOfTheWayOfShot') || Physics == PHYS_Falling)
return;
if (KFDoorMover(controller.Target) != none)
{
controller.Target.TakeDamage(22, Self, Location, vect(0, 0, 0), class'DamTypeVomit');
return; return;
} }
GetAxes(Rotation, X, Y, Z); GetAxes(Rotation, X, Y, Z);
FireStart = GetBoneCoords('Barrel').Origin; FireStart = GetBoneCoords('Barrel').Origin;
if(!SavedFireProperties.bInitialized){
SavedFireProperties.AmmoClass = Class'SkaarjAmmo'; if (!SavedFireProperties.bInitialized)
{
SavedFireProperties.AmmoClass = class'SkaarjAmmo';
SavedFireProperties.ProjectileClass = HuskFireProjClass; SavedFireProperties.ProjectileClass = HuskFireProjClass;
SavedFireProperties.WarnTargetPct = 1; SavedFireProperties.WarnTargetPct = 1;
SavedFireProperties.MaxRange = 65535; SavedFireProperties.MaxRange = 65535;
@ -146,17 +156,29 @@ function SpawnTwoShots(){
SavedFireProperties.bInstantHit = false; SavedFireProperties.bInstantHit = false;
SavedFireProperties.bInitialized = true; SavedFireProperties.bInitialized = true;
} }
// Turn off extra collision before spawning vomit, otherwise spawn fails // Turn off extra collision before spawning vomit, otherwise spawn fails
ToggleAuxCollision(false); ToggleAuxCollision(false);
if(controller != none)
FireRotation = controller.AdjustAim(SavedFireProperties, FireStart, 600); FireRotation = controller.AdjustAim(SavedFireProperties, FireStart, 600);
foreach DynamicActors(class'KFMonsterController', KFMonstControl) foreach DynamicActors(class'KFMonsterController', KFMonstControl)
if(KFMonstControl != controller && PointDistToLine(KFMonstControl.Pawn.Location, vector(FireRotation), FireStart) < 75) {
// ignore zeds that the husk can't see, Joabyy
if (KFMonstControl == none || KFMonstControl == controller || !LineOfSightTo(KFMonstControl))
continue;
if (PointDistToLine(KFMonstControl.Pawn.Location, vector(FireRotation), FireStart) < 75)
KFMonstControl.GetOutOfTheWayOfShot(vector(FireRotation), FireStart); KFMonstControl.GetOutOfTheWayOfShot(vector(FireRotation), FireStart);
Spawn(HuskFireProjClass,,, FireStart, FireRotation); }
// added projectile owner...
Spawn(HuskFireProjClass, self, , FireStart, FireRotation);
// Turn extra collision back on // Turn extra collision back on
ToggleAuxCollision(true); ToggleAuxCollision(true);
} }
// Get the closest point along a line to another point // Get the closest point along a line to another point
simulated function float PointDistToLine(vector Point, vector Line, vector Origin, optional out vector OutClosestPoint) simulated function float PointDistToLine(vector Point, vector Line, vector Origin, optional out vector OutClosestPoint)
{ {