zedtest #1
| @ -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) | ||||||
| { | { | ||||||
|  | |||||||
| @ -202,6 +202,7 @@ simulated function DoShakeEffect() | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | 
 | ||||||
| simulated function HurtRadius(float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation) | simulated function HurtRadius(float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation) | ||||||
| { | { | ||||||
|     local actor Victims; |     local actor Victims; | ||||||
| @ -211,17 +212,28 @@ simulated function HurtRadius(float DamageAmount, float DamageRadius, class<Dama | |||||||
|     local float UsedDamageAmount; |     local float UsedDamageAmount; | ||||||
|     local KFHumanPawn humanPawn; |     local KFHumanPawn humanPawn; | ||||||
|     local class<NiceVeterancyTypes> niceVet; |     local class<NiceVeterancyTypes> niceVet; | ||||||
|  | 
 | ||||||
|     if (bHurtEntry || Health <= 0 || HeadHealth <= 0 || bIsStunned) |     if (bHurtEntry || Health <= 0 || HeadHealth <= 0 || bIsStunned) | ||||||
|        return; |        return; | ||||||
|     bHurtEntry = true; |     bHurtEntry = true; | ||||||
|  | 
 | ||||||
|     InitMomentum = Momentum; |     InitMomentum = Momentum; | ||||||
|     if (screamStartTime > 0 && currScreamTiming == 0) |     if (screamStartTime > 0 && currScreamTiming == 0) | ||||||
|        MakeNewScreamBall(); |        MakeNewScreamBall(); | ||||||
|     foreach VisibleCollidingActors(class 'Actor', Victims, DamageRadius, HitLocation){ | 
 | ||||||
|  |     // was VisibleCollidingActors
 | ||||||
|  |     foreach CollidingActors(class'Actor', Victims, DamageRadius, HitLocation) | ||||||
|  |     { | ||||||
|  |         // some optimizations
 | ||||||
|  |         // https://wiki.beyondunreal.com/Legacy:Code_Optimization#Optimize_iterator_use
 | ||||||
|  |         if (Victims.bStatic || Victims.Physics == PHYS_None || !FastTrace(Victims.Location, Location) ) | ||||||
|  |             continue; // skip this actor
 | ||||||
|  | 
 | ||||||
|         Momentum = InitMomentum; |         Momentum = InitMomentum; | ||||||
|         // don't let blast damage affect fluid - VisibleCollisingActors doesn't really work for them - jag
 |         // don't let blast damage affect fluid - VisibleCollisingActors doesn't really work for them - jag
 | ||||||
|         // Or Karma actors in this case. Self inflicted Death due to flying chairs is uncool for a zombie of your stature.
 |         // Or Karma actors in this case. Self inflicted Death due to flying chairs is uncool for a zombie of your stature.
 | ||||||
|        if((Victims != self) && !Victims.IsA('FluidSurfaceInfo') && !Victims.IsA('KFMonster') && !Victims.IsA('ExtendedZCollision')){ |         if ((Victims != self) && !Victims.IsA('FluidSurfaceInfo') && !Victims.IsA('KFMonster') && !Victims.IsA('ExtendedZCollision')) | ||||||
|  |         { | ||||||
|             dir = Victims.Location - HitLocation; |             dir = Victims.Location - HitLocation; | ||||||
|             dist = FMax(1,VSize(dir)); |             dist = FMax(1,VSize(dir)); | ||||||
|             dir = dir/dist; |             dir = dir/dist; | ||||||
| @ -229,7 +241,8 @@ simulated function HurtRadius(float DamageAmount, float DamageRadius, class<Dama | |||||||
|             humanPawn = KFHumanPawn(Victims); |             humanPawn = KFHumanPawn(Victims); | ||||||
|             if (humanPawn == none)    // If it aint human, don't pull the vortex crap on it.
 |             if (humanPawn == none)    // If it aint human, don't pull the vortex crap on it.
 | ||||||
|                 Momentum = 0; |                 Momentum = 0; | ||||||
|            else{                               // Also don't do it if we're sharpshooter with a right skill
 |             else | ||||||
|  |             {   // Also don't do it if we're sharpshooter with a right skill
 | ||||||
|                 niceVet = class'NiceVeterancyTypes'.static.GetVeterancy(humanPawn.PlayerReplicationInfo); |                 niceVet = class'NiceVeterancyTypes'.static.GetVeterancy(humanPawn.PlayerReplicationInfo); | ||||||
|                 if (niceVet != none && !niceVet.static.CanBePulled(KFPlayerReplicationInfo(humanPawn.PlayerReplicationInfo))) |                 if (niceVet != none && !niceVet.static.CanBePulled(KFPlayerReplicationInfo(humanPawn.PlayerReplicationInfo))) | ||||||
|                     Momentum = 0; |                     Momentum = 0; | ||||||
| @ -246,8 +259,10 @@ simulated function HurtRadius(float DamageAmount, float DamageRadius, class<Dama | |||||||
|                 Vehicle(Victims).DriverRadiusDamage(UsedDamageAmount, DamageRadius, Instigator.Controller, DamageType, Momentum, HitLocation); |                 Vehicle(Victims).DriverRadiusDamage(UsedDamageAmount, DamageRadius, Instigator.Controller, DamageType, Momentum, HitLocation); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     bHurtEntry = false; |     bHurtEntry = false; | ||||||
| } | } | ||||||
|  | 
 | ||||||
| // When siren loses her head she's got nothin' Kill her.
 | // When siren loses her head she's got nothin' Kill her.
 | ||||||
| function RemoveHead(){ | function RemoveHead(){ | ||||||
|     Super.RemoveHead(); |     Super.RemoveHead(); | ||||||
|  | |||||||
| @ -214,7 +214,7 @@ function RemoveHead() | |||||||
| } | } | ||||||
| simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) | simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) | ||||||
| { | { | ||||||
|     Super.PlayDying(DamageType,HitLoc); |     Super(NiceMonster).PlayDying(DamageType,HitLoc); | ||||||
|     if(bUnlit) |     if(bUnlit) | ||||||
|        bUnlit=!bUnlit; |        bUnlit=!bUnlit; | ||||||
|     LocalKFHumanPawn = none; |     LocalKFHumanPawn = none; | ||||||
|  | |||||||
| @ -266,7 +266,7 @@ function Died(Controller Killer, class<DamageType> damageType, vector HitLocatio | |||||||
| } | } | ||||||
| simulated event PlayDying(class<DamageType> DamageType, vector HitLoc) | simulated event PlayDying(class<DamageType> DamageType, vector HitLoc) | ||||||
| { | { | ||||||
|     super.PlayDying(DamageType, HitLoc); |     super(NiceMonster).PlayDying(DamageType, HitLoc); | ||||||
|     if ( DecapitationSparks != none ) |     if ( DecapitationSparks != none ) | ||||||
|        DecapitationSparks.Destroy();        AmbientSound = none; |        DecapitationSparks.Destroy();        AmbientSound = none; | ||||||
| } | } | ||||||
|  | |||||||
| @ -2039,14 +2039,26 @@ function bool MeleeDamageTarget(int hitDamage, Vector pushDir){ | |||||||
|     } |     } | ||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
| state ZombieDying { | 
 | ||||||
|  | 
 | ||||||
|  | state ZombieDying | ||||||
|  | { | ||||||
|    ignores AnimEnd, Trigger, Bump, HitWall, HeadVolumeChange, |    ignores AnimEnd, Trigger, Bump, HitWall, HeadVolumeChange, | ||||||
|        PhysicsVolumeChange, Falling, BreathTimer, Died, RangedAttack; |        PhysicsVolumeChange, Falling, BreathTimer, Died, RangedAttack; | ||||||
|  | 
 | ||||||
|  |    // #1 disable zed collisions on death
 | ||||||
|  |    simulated function BeginState() | ||||||
|  |    { | ||||||
|  |       super.BeginState(); | ||||||
|  |       DisableCollisions(); | ||||||
|  |    } | ||||||
|  | 
 | ||||||
|     simulated function Landed(vector HitNormal){ |     simulated function Landed(vector HitNormal){ | ||||||
|        SetCollision(false, false, false); |        SetCollision(false, false, false); | ||||||
|        if(!bDestroyNextTick) |        if(!bDestroyNextTick) | ||||||
|            Disable('Tick'); |            Disable('Tick'); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     simulated function TakeDamageClient(int damage, |     simulated function TakeDamageClient(int damage, | ||||||
|                                        Pawn InstigatedBy, |                                        Pawn InstigatedBy, | ||||||
|                                        Vector hitLocation, |                                        Vector hitLocation, | ||||||
| @ -2095,6 +2107,29 @@ state ZombieDying { | |||||||
|        } |        } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // #2 disable zed collisions on death
 | ||||||
|  | simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) | ||||||
|  | { | ||||||
|  |    super.PlayDying(DamageType, HitLoc); | ||||||
|  |    DisableCollisions(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | // disables all collisions
 | ||||||
|  | simulated function DisableCollisions() | ||||||
|  | { | ||||||
|  |    bBlockActors = false; | ||||||
|  |    bBlockPlayers = false; | ||||||
|  |    bBlockProjectiles = false; | ||||||
|  |    bProjTarget = false; | ||||||
|  |    bBlockZeroExtentTraces = false; | ||||||
|  |    bBlockNonZeroExtentTraces = false; | ||||||
|  |    bBlockHitPointTraces = false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| defaultproperties | defaultproperties | ||||||
| { | { | ||||||
|     stunDurationMultiplier=0.5 |     stunDurationMultiplier=0.5 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user