Further improvments to the Demo system

Alot of these did not work when they were made but seem to work now.
This commit is contained in:
Forrest Keller 2017-10-28 18:39:01 -05:00
parent d4403a970b
commit 235e02cbb0
11 changed files with 13 additions and 987 deletions

View File

@ -37,27 +37,6 @@ simulated function Inventory CreateInventory(class<Inventory> NewInventoryItemCl
return Super.CreateInventory(class'ExtWeap_Pistol_Dual9mm', bDoNotActivate);
}
Switch(Wep.Class.Name)
{
Case 'KFWeap_GrenadeLauncher_M79':
Wep.WeaponProjectiles[0] = class'ExtProj_HighExplosive_M79';
break;
Case 'KFWeap_RocketLauncher_RPG7':
Wep.WeaponProjectiles[0] = class'ExtProj_Rocket_RPG7';
break;
Case 'KFWeap_AssaultRifle_M16M203':
Wep.WeaponProjectiles[1] = class'ExtProj_HighExplosive_M16M203';
break;
Case 'KFWeap_Thrown_C4':
Wep.WeaponProjectiles[0] = class'ExtProj_Thrown_C4';
break;
Case 'KFWeap_RocketLauncher_Seeker6':
Wep.WeaponProjectiles[0] = class'ExtProj_Rocket_Seeker6';
break;
default:
break;
}
return Wep;
}

View File

@ -49,10 +49,6 @@ var transient color HUDPerkColor;
var byte FixedData;
var int RepPlayTime,RepKills,RepEXP;
// Perk related
var bool bNukeIsOn,bConcussiveIsOn,bForScienceOn,bHasSciEMP;
var float NukeTimeMult;
// Custom character stuff.
var array<FCustomCharEntry> CustomCharList;
var repnotify FMyCustomChar CustomCharacter;
@ -78,8 +74,6 @@ replication
RespawnCounter,AdminType,ECurrentPerk,ECurrentPerkLevel,ECurrentPerkPrestige,RepKills,RepEXP,RepLevelProgress,bIsDev,NameTag,FixedData,bHiddenUser,CustomCharacter,HasSupplier;
if (bNetInitial || bInitialPT)
RepPlayTime;
if ( true )
bNukeIsOn, bConcussiveIsOn, NukeTimeMult;
}
simulated function PostBeginPlay()

View File

@ -1,154 +0,0 @@
class ExtProj_DynamiteGrenade extends KFProj_DynamiteGrenade;
simulated protected function PrepareExplosionTemplate()
{
local ExtPlayerReplicationInfo MyPRI;
Super.PrepareExplosionTemplate();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
{
ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate();
ExplosionTemplate.Damage = default.ExplosionTemplate.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier();
ExplosionTemplate.DamageRadius = default.ExplosionTemplate.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier();
ExplosionTemplate.DamageFalloffExponent = default.ExplosionTemplate.DamageFalloffExponent;
}
else if( MyPRI.bConcussiveIsOn )
{
ExplosionTemplate.ExplosionEffects = AltExploEffects;
ExplosionTemplate.ExplosionSound = class'KFPerk_Demolitionist'.static.GetConcussiveExplosionSound();
}
}
}
simulated protected function SetExplosionActorClass()
{
local ExtPlayerReplicationInfo MyPRI;
Super(KFProjectile).SetExplosionActorClass();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
ExplosionActorClass = class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass();
}
}
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local vector NudgedHitLocation, ExplosionDirection;
local Pawn P;
local ExtPlayerReplicationInfo MyPRI;
if( bHasDisintegrated )
{
return;
}
if (!bHasExploded)
{
// On local player or server, we cache off our time dilation setting here
if( WorldInfo.NetMode == NM_ListenServer || WorldInfo.NetMode == NM_DedicatedServer || InstigatorController != None )
{
bWasTimeDilated = WorldInfo.TimeDilation < 1.f;
}
// Stop ambient sounds when this projectile explodes
if( bStopAmbientSoundOnExplode )
{
StopAmbientSound();
}
if (ExplosionTemplate != None)
{
StopSimulating();
// using a hit location slightly away from the impact point is nice for certain things
NudgedHitLocation = HitLocation + (HitNormal * 32.f);
SetExplosionActorClass();
if( ExplosionActorClass == class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass() )
{
P = Pawn(HitActor);
if( P != none )
{
NudgedHitLocation = P.Location - vect(0,0,1) * P.GetCollisionHeight();
}
}
ExplosionActor = Spawn(ExplosionActorClass, self,, NudgedHitLocation, rotator(HitNormal));
if (ExplosionActor != None)
{
ExplosionActor.Instigator = Instigator;
ExplosionActor.InstigatorController = InstigatorController;
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
{
HitLocation = Location;
}
if( IsZero(HitNormal) )
{
HitNormal = vect(0,0,1);
}
// these are needed for the decal tracing later in GameExplosionActor.Explode()
ExplosionTemplate.HitLocation = HitLocation;// NudgedHitLocation
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;
ExplosionActor.SetBase(HitActor);
}
// directional?
if (ExplosionTemplate.bDirectionalExplosion)
{
ExplosionDirection = GetExplosionDirection(HitNormal);
//DrawDebugLine(ExplosionActor.Location, ExplosionActor.Location+ExplosionDirection*64, 255, 255, 0, TRUE);
}
// @todo: make this function responsible for setting explosion instance parameters, and take instance parameters
// out of GearExplosion (e.g. Attachee)
PrepareExplosionActor(ExplosionActor);
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none && KFExplosionActorLingering(ExplosionActor) != None )
{
KFExplosionActorLingering(ExplosionActor).MaxTime *= MyPRI.NukeTimeMult;
KFExplosionActorLingering(ExplosionActor).LifeSpan *= MyPRI.NukeTimeMult;
}
ExplosionActor.Explode(ExplosionTemplate, ExplosionDirection); // go bewm
}
// done with it
if (!bPendingDelete && !bDeleteMe)
{
// defer destruction so any replication of explosion stuff can happen if necessary
DeferredDestroy(PostExplosionLifetime);
}
}
bHasExploded = true;
}
}
defaultproperties
{
}

View File

@ -1,154 +0,0 @@
class ExtProj_HighExplosive_M16M203 extends KFProj_HighExplosive_M16M203;
simulated protected function PrepareExplosionTemplate()
{
local ExtPlayerReplicationInfo MyPRI;
Super.PrepareExplosionTemplate();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
{
ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate();
ExplosionTemplate.Damage = default.ExplosionTemplate.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier();
ExplosionTemplate.DamageRadius = default.ExplosionTemplate.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier();
ExplosionTemplate.DamageFalloffExponent = default.ExplosionTemplate.DamageFalloffExponent;
}
else if( MyPRI.bConcussiveIsOn )
{
ExplosionTemplate.ExplosionEffects = AltExploEffects;
ExplosionTemplate.ExplosionSound = class'KFPerk_Demolitionist'.static.GetConcussiveExplosionSound();
}
}
}
simulated protected function SetExplosionActorClass()
{
local ExtPlayerReplicationInfo MyPRI;
Super(KFProjectile).SetExplosionActorClass();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
ExplosionActorClass = class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass();
}
}
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local vector NudgedHitLocation, ExplosionDirection;
local Pawn P;
local ExtPlayerReplicationInfo MyPRI;
if( bHasDisintegrated )
{
return;
}
if (!bHasExploded)
{
// On local player or server, we cache off our time dilation setting here
if( WorldInfo.NetMode == NM_ListenServer || WorldInfo.NetMode == NM_DedicatedServer || InstigatorController != None )
{
bWasTimeDilated = WorldInfo.TimeDilation < 1.f;
}
// Stop ambient sounds when this projectile explodes
if( bStopAmbientSoundOnExplode )
{
StopAmbientSound();
}
if (ExplosionTemplate != None)
{
StopSimulating();
// using a hit location slightly away from the impact point is nice for certain things
NudgedHitLocation = HitLocation + (HitNormal * 32.f);
SetExplosionActorClass();
if( ExplosionActorClass == class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass() )
{
P = Pawn(HitActor);
if( P != none )
{
NudgedHitLocation = P.Location - vect(0,0,1) * P.GetCollisionHeight();
}
}
ExplosionActor = Spawn(ExplosionActorClass, self,, NudgedHitLocation, rotator(HitNormal));
if (ExplosionActor != None)
{
ExplosionActor.Instigator = Instigator;
ExplosionActor.InstigatorController = InstigatorController;
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
{
HitLocation = Location;
}
if( IsZero(HitNormal) )
{
HitNormal = vect(0,0,1);
}
// these are needed for the decal tracing later in GameExplosionActor.Explode()
ExplosionTemplate.HitLocation = HitLocation;// NudgedHitLocation
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;
ExplosionActor.SetBase(HitActor);
}
// directional?
if (ExplosionTemplate.bDirectionalExplosion)
{
ExplosionDirection = GetExplosionDirection(HitNormal);
//DrawDebugLine(ExplosionActor.Location, ExplosionActor.Location+ExplosionDirection*64, 255, 255, 0, TRUE);
}
// @todo: make this function responsible for setting explosion instance parameters, and take instance parameters
// out of GearExplosion (e.g. Attachee)
PrepareExplosionActor(ExplosionActor);
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none && KFExplosionActorLingering(ExplosionActor) != None )
{
KFExplosionActorLingering(ExplosionActor).MaxTime *= MyPRI.NukeTimeMult;
KFExplosionActorLingering(ExplosionActor).LifeSpan *= MyPRI.NukeTimeMult;
}
ExplosionActor.Explode(ExplosionTemplate, ExplosionDirection); // go bewm
}
// done with it
if (!bPendingDelete && !bDeleteMe)
{
// defer destruction so any replication of explosion stuff can happen if necessary
DeferredDestroy(PostExplosionLifetime);
}
}
bHasExploded = true;
}
}
defaultproperties
{
}

View File

@ -1,154 +0,0 @@
class ExtProj_HighExplosive_M79 extends KFProj_HighExplosive_M79;
simulated protected function PrepareExplosionTemplate()
{
local ExtPlayerReplicationInfo MyPRI;
Super.PrepareExplosionTemplate();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
{
ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate();
ExplosionTemplate.Damage = default.ExplosionTemplate.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier();
ExplosionTemplate.DamageRadius = default.ExplosionTemplate.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier();
ExplosionTemplate.DamageFalloffExponent = default.ExplosionTemplate.DamageFalloffExponent;
}
else if( MyPRI.bConcussiveIsOn )
{
ExplosionTemplate.ExplosionEffects = AltExploEffects;
ExplosionTemplate.ExplosionSound = class'KFPerk_Demolitionist'.static.GetConcussiveExplosionSound();
}
}
}
simulated protected function SetExplosionActorClass()
{
local ExtPlayerReplicationInfo MyPRI;
Super(KFProjectile).SetExplosionActorClass();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
ExplosionActorClass = class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass();
}
}
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local vector NudgedHitLocation, ExplosionDirection;
local Pawn P;
local ExtPlayerReplicationInfo MyPRI;
if( bHasDisintegrated )
{
return;
}
if (!bHasExploded)
{
// On local player or server, we cache off our time dilation setting here
if( WorldInfo.NetMode == NM_ListenServer || WorldInfo.NetMode == NM_DedicatedServer || InstigatorController != None )
{
bWasTimeDilated = WorldInfo.TimeDilation < 1.f;
}
// Stop ambient sounds when this projectile explodes
if( bStopAmbientSoundOnExplode )
{
StopAmbientSound();
}
if (ExplosionTemplate != None)
{
StopSimulating();
// using a hit location slightly away from the impact point is nice for certain things
NudgedHitLocation = HitLocation + (HitNormal * 32.f);
SetExplosionActorClass();
if( ExplosionActorClass == class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass() )
{
P = Pawn(HitActor);
if( P != none )
{
NudgedHitLocation = P.Location - vect(0,0,1) * P.GetCollisionHeight();
}
}
ExplosionActor = Spawn(ExplosionActorClass, self,, NudgedHitLocation, rotator(HitNormal));
if (ExplosionActor != None)
{
ExplosionActor.Instigator = Instigator;
ExplosionActor.InstigatorController = InstigatorController;
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
{
HitLocation = Location;
}
if( IsZero(HitNormal) )
{
HitNormal = vect(0,0,1);
}
// these are needed for the decal tracing later in GameExplosionActor.Explode()
ExplosionTemplate.HitLocation = HitLocation;// NudgedHitLocation
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;
ExplosionActor.SetBase(HitActor);
}
// directional?
if (ExplosionTemplate.bDirectionalExplosion)
{
ExplosionDirection = GetExplosionDirection(HitNormal);
//DrawDebugLine(ExplosionActor.Location, ExplosionActor.Location+ExplosionDirection*64, 255, 255, 0, TRUE);
}
// @todo: make this function responsible for setting explosion instance parameters, and take instance parameters
// out of GearExplosion (e.g. Attachee)
PrepareExplosionActor(ExplosionActor);
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none && KFExplosionActorLingering(ExplosionActor) != None )
{
KFExplosionActorLingering(ExplosionActor).MaxTime *= MyPRI.NukeTimeMult;
KFExplosionActorLingering(ExplosionActor).LifeSpan *= MyPRI.NukeTimeMult;
}
ExplosionActor.Explode(ExplosionTemplate, ExplosionDirection); // go bewm
}
// done with it
if (!bPendingDelete && !bDeleteMe)
{
// defer destruction so any replication of explosion stuff can happen if necessary
DeferredDestroy(PostExplosionLifetime);
}
}
bHasExploded = true;
}
}
defaultproperties
{
}

View File

@ -1,154 +0,0 @@
class ExtProj_Rocket_RPG7 extends KFProj_Rocket_RPG7;
simulated protected function PrepareExplosionTemplate()
{
local ExtPlayerReplicationInfo MyPRI;
Super.PrepareExplosionTemplate();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
{
ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate();
ExplosionTemplate.Damage = default.ExplosionTemplate.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier();
ExplosionTemplate.DamageRadius = default.ExplosionTemplate.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier();
ExplosionTemplate.DamageFalloffExponent = default.ExplosionTemplate.DamageFalloffExponent;
}
else if( MyPRI.bConcussiveIsOn )
{
ExplosionTemplate.ExplosionEffects = AltExploEffects;
ExplosionTemplate.ExplosionSound = class'KFPerk_Demolitionist'.static.GetConcussiveExplosionSound();
}
}
}
simulated protected function SetExplosionActorClass()
{
local ExtPlayerReplicationInfo MyPRI;
Super(KFProjectile).SetExplosionActorClass();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
ExplosionActorClass = class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass();
}
}
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local vector NudgedHitLocation, ExplosionDirection;
local Pawn P;
local ExtPlayerReplicationInfo MyPRI;
if( bHasDisintegrated )
{
return;
}
if (!bHasExploded)
{
// On local player or server, we cache off our time dilation setting here
if( WorldInfo.NetMode == NM_ListenServer || WorldInfo.NetMode == NM_DedicatedServer || InstigatorController != None )
{
bWasTimeDilated = WorldInfo.TimeDilation < 1.f;
}
// Stop ambient sounds when this projectile explodes
if( bStopAmbientSoundOnExplode )
{
StopAmbientSound();
}
if (ExplosionTemplate != None)
{
StopSimulating();
// using a hit location slightly away from the impact point is nice for certain things
NudgedHitLocation = HitLocation + (HitNormal * 32.f);
SetExplosionActorClass();
if( ExplosionActorClass == class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass() )
{
P = Pawn(HitActor);
if( P != none )
{
NudgedHitLocation = P.Location - vect(0,0,1) * P.GetCollisionHeight();
}
}
ExplosionActor = Spawn(ExplosionActorClass, self,, NudgedHitLocation, rotator(HitNormal));
if (ExplosionActor != None)
{
ExplosionActor.Instigator = Instigator;
ExplosionActor.InstigatorController = InstigatorController;
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
{
HitLocation = Location;
}
if( IsZero(HitNormal) )
{
HitNormal = vect(0,0,1);
}
// these are needed for the decal tracing later in GameExplosionActor.Explode()
ExplosionTemplate.HitLocation = HitLocation;// NudgedHitLocation
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;
ExplosionActor.SetBase(HitActor);
}
// directional?
if (ExplosionTemplate.bDirectionalExplosion)
{
ExplosionDirection = GetExplosionDirection(HitNormal);
//DrawDebugLine(ExplosionActor.Location, ExplosionActor.Location+ExplosionDirection*64, 255, 255, 0, TRUE);
}
// @todo: make this function responsible for setting explosion instance parameters, and take instance parameters
// out of GearExplosion (e.g. Attachee)
PrepareExplosionActor(ExplosionActor);
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none && KFExplosionActorLingering(ExplosionActor) != None )
{
KFExplosionActorLingering(ExplosionActor).MaxTime *= MyPRI.NukeTimeMult;
KFExplosionActorLingering(ExplosionActor).LifeSpan *= MyPRI.NukeTimeMult;
}
ExplosionActor.Explode(ExplosionTemplate, ExplosionDirection); // go bewm
}
// done with it
if (!bPendingDelete && !bDeleteMe)
{
// defer destruction so any replication of explosion stuff can happen if necessary
DeferredDestroy(PostExplosionLifetime);
}
}
bHasExploded = true;
}
}
defaultproperties
{
}

View File

@ -1,154 +0,0 @@
class ExtProj_Rocket_Seeker6 extends KFProj_Rocket_Seeker6;
simulated protected function PrepareExplosionTemplate()
{
local ExtPlayerReplicationInfo MyPRI;
Super.PrepareExplosionTemplate();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
{
ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate();
ExplosionTemplate.Damage = default.ExplosionTemplate.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier();
ExplosionTemplate.DamageRadius = default.ExplosionTemplate.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier();
ExplosionTemplate.DamageFalloffExponent = default.ExplosionTemplate.DamageFalloffExponent;
}
else if( MyPRI.bConcussiveIsOn )
{
ExplosionTemplate.ExplosionEffects = AltExploEffects;
ExplosionTemplate.ExplosionSound = class'KFPerk_Demolitionist'.static.GetConcussiveExplosionSound();
}
}
}
simulated protected function SetExplosionActorClass()
{
local ExtPlayerReplicationInfo MyPRI;
Super(KFProjectile).SetExplosionActorClass();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
ExplosionActorClass = class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass();
}
}
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local vector NudgedHitLocation, ExplosionDirection;
local Pawn P;
local ExtPlayerReplicationInfo MyPRI;
if( bHasDisintegrated )
{
return;
}
if (!bHasExploded)
{
// On local player or server, we cache off our time dilation setting here
if( WorldInfo.NetMode == NM_ListenServer || WorldInfo.NetMode == NM_DedicatedServer || InstigatorController != None )
{
bWasTimeDilated = WorldInfo.TimeDilation < 1.f;
}
// Stop ambient sounds when this projectile explodes
if( bStopAmbientSoundOnExplode )
{
StopAmbientSound();
}
if (ExplosionTemplate != None)
{
StopSimulating();
// using a hit location slightly away from the impact point is nice for certain things
NudgedHitLocation = HitLocation + (HitNormal * 32.f);
SetExplosionActorClass();
if( ExplosionActorClass == class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass() )
{
P = Pawn(HitActor);
if( P != none )
{
NudgedHitLocation = P.Location - vect(0,0,1) * P.GetCollisionHeight();
}
}
ExplosionActor = Spawn(ExplosionActorClass, self,, NudgedHitLocation, rotator(HitNormal));
if (ExplosionActor != None)
{
ExplosionActor.Instigator = Instigator;
ExplosionActor.InstigatorController = InstigatorController;
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
{
HitLocation = Location;
}
if( IsZero(HitNormal) )
{
HitNormal = vect(0,0,1);
}
// these are needed for the decal tracing later in GameExplosionActor.Explode()
ExplosionTemplate.HitLocation = HitLocation;// NudgedHitLocation
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;
ExplosionActor.SetBase(HitActor);
}
// directional?
if (ExplosionTemplate.bDirectionalExplosion)
{
ExplosionDirection = GetExplosionDirection(HitNormal);
//DrawDebugLine(ExplosionActor.Location, ExplosionActor.Location+ExplosionDirection*64, 255, 255, 0, TRUE);
}
// @todo: make this function responsible for setting explosion instance parameters, and take instance parameters
// out of GearExplosion (e.g. Attachee)
PrepareExplosionActor(ExplosionActor);
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none && KFExplosionActorLingering(ExplosionActor) != None )
{
KFExplosionActorLingering(ExplosionActor).MaxTime *= MyPRI.NukeTimeMult;
KFExplosionActorLingering(ExplosionActor).LifeSpan *= MyPRI.NukeTimeMult;
}
ExplosionActor.Explode(ExplosionTemplate, ExplosionDirection); // go bewm
}
// done with it
if (!bPendingDelete && !bDeleteMe)
{
// defer destruction so any replication of explosion stuff can happen if necessary
DeferredDestroy(PostExplosionLifetime);
}
}
bHasExploded = true;
}
}
defaultproperties
{
}

View File

@ -1,154 +0,0 @@
class ExtProj_Thrown_C4 extends KFProj_Thrown_C4;
simulated protected function PrepareExplosionTemplate()
{
local ExtPlayerReplicationInfo MyPRI;
Super.PrepareExplosionTemplate();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
{
ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate();
ExplosionTemplate.Damage = default.ExplosionTemplate.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier();
ExplosionTemplate.DamageRadius = default.ExplosionTemplate.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier();
ExplosionTemplate.DamageFalloffExponent = default.ExplosionTemplate.DamageFalloffExponent;
}
else if( MyPRI.bConcussiveIsOn )
{
ExplosionTemplate.ExplosionEffects = AltExploEffects;
ExplosionTemplate.ExplosionSound = class'KFPerk_Demolitionist'.static.GetConcussiveExplosionSound();
}
}
}
simulated protected function SetExplosionActorClass()
{
local ExtPlayerReplicationInfo MyPRI;
Super(KFProjectile).SetExplosionActorClass();
if(Instigator == None)
return;
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none )
{
if( bWasTimeDilated && MyPRI.bNukeIsOn && class'KFPerk_Demolitionist'.static.ProjectileShouldNuke( self ) )
ExplosionActorClass = class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass();
}
}
simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor HitActor)
{
local vector NudgedHitLocation, ExplosionDirection;
local Pawn P;
local ExtPlayerReplicationInfo MyPRI;
if( bHasDisintegrated )
{
return;
}
if (!bHasExploded)
{
// On local player or server, we cache off our time dilation setting here
if( WorldInfo.NetMode == NM_ListenServer || WorldInfo.NetMode == NM_DedicatedServer || InstigatorController != None )
{
bWasTimeDilated = WorldInfo.TimeDilation < 1.f;
}
// Stop ambient sounds when this projectile explodes
if( bStopAmbientSoundOnExplode )
{
StopAmbientSound();
}
if (ExplosionTemplate != None)
{
StopSimulating();
// using a hit location slightly away from the impact point is nice for certain things
NudgedHitLocation = HitLocation + (HitNormal * 32.f);
SetExplosionActorClass();
if( ExplosionActorClass == class'KFPerk_Demolitionist'.static.GetNukeExplosionActorClass() )
{
P = Pawn(HitActor);
if( P != none )
{
NudgedHitLocation = P.Location - vect(0,0,1) * P.GetCollisionHeight();
}
}
ExplosionActor = Spawn(ExplosionActorClass, self,, NudgedHitLocation, rotator(HitNormal));
if (ExplosionActor != None)
{
ExplosionActor.Instigator = Instigator;
ExplosionActor.InstigatorController = InstigatorController;
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
{
HitLocation = Location;
}
if( IsZero(HitNormal) )
{
HitNormal = vect(0,0,1);
}
// these are needed for the decal tracing later in GameExplosionActor.Explode()
ExplosionTemplate.HitLocation = HitLocation;// NudgedHitLocation
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;
ExplosionActor.SetBase(HitActor);
}
// directional?
if (ExplosionTemplate.bDirectionalExplosion)
{
ExplosionDirection = GetExplosionDirection(HitNormal);
//DrawDebugLine(ExplosionActor.Location, ExplosionActor.Location+ExplosionDirection*64, 255, 255, 0, TRUE);
}
// @todo: make this function responsible for setting explosion instance parameters, and take instance parameters
// out of GearExplosion (e.g. Attachee)
PrepareExplosionActor(ExplosionActor);
MyPRI = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if( MyPRI != none && KFExplosionActorLingering(ExplosionActor) != None )
{
KFExplosionActorLingering(ExplosionActor).MaxTime *= MyPRI.NukeTimeMult;
KFExplosionActorLingering(ExplosionActor).LifeSpan *= MyPRI.NukeTimeMult;
}
ExplosionActor.Explode(ExplosionTemplate, ExplosionDirection); // go bewm
}
// done with it
if (!bPendingDelete && !bDeleteMe)
{
// defer destruction so any replication of explosion stuff can happen if necessary
DeferredDestroy(PostExplosionLifetime);
}
}
bHasExploded = true;
}
}
defaultproperties
{
}

View File

@ -1,11 +0,0 @@
class ExtWeapDef_Grenade_Demo extends KFWeapDef_Grenade_Demo;
static function string GetItemLocalization(string KeyName)
{
return class'KFWeapDef_Grenade_Demo'.Static.GetItemLocalization(KeyName);
}
DefaultProperties
{
WeaponClassPath="ServerExt.ExtProj_DynamiteGrenade"
}

View File

@ -21,26 +21,18 @@ simulated function bool GetUsingTactialReload( KFWeapon KFW )
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.85 : false);
}
simulated function bool IsConcussiveForceActive()
{
return Modifiers[7] > 1.5;
}
simulated function float ApplyEffect( name Type, float Value, float Progress )
{
local ExtPlayerReplicationInfo MyPRI;
local KFPlayerReplicationInfo MyPRI;
local float DefValue;
MyPRI = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
DefValue = Super.ApplyEffect(Type, Value, Progress);
MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
switch( Type )
{
case 'KnockDown':
if( MyPRI != none )
MyPRI.bConcussiveIsOn = IsConcussiveForceActive();
break;
}
if( MyPRI != None && Type == 'KnockDown' )
MyPRI.bConcussiveActive = Modifiers[7] > 1.5;
return Super.ApplyEffect(Type, Value, Progress);
return DefValue;
}
function OnWaveEnded()
@ -100,11 +92,11 @@ defaultproperties
PrimaryMelee=class'KFWeap_Knife_Demolitionist'
PrimaryWeapon=class'KFWeap_GrenadeLauncher_HX25'
PerkGrenade=class'ExtProj_DynamiteGrenade'
PerkGrenade=class'KFProj_DynamiteGrenade'
PrimaryWeaponDef=class'KFWeapDef_HX25'
KnifeWeaponDef=class'KFWeapDef_Knife_Demo'
GrenadeWeaponDef=class'ExtWeapDef_Grenade_Demo'
GrenadeWeaponDef=class'KFWeapDef_Grenade_Demo'
AutoBuyLoadOutPath=(class'KFWeapDef_HX25', class'KFWeapDef_M79', class'KFWeapDef_M16M203', class'KFWeapDef_RPG7')

View File

@ -31,12 +31,10 @@ static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_Trait
local ExtPlayerReplicationInfo MyPRI;
MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo);
if( MyPRI == None )
if( MyPRI == None || Ext_PerkDemolition(Perk) == None )
return;
MyPRI.bNukeIsOn = true;
MyPRI.NukeTimeMult = 1.0 + (((float(Level) - 1.f) * 2.f) / 100.f);
MyPRI.bNukeActive = true;
Ext_PerkDemolition(Perk).NukeDamageMult = 1.0 + (((float(Level) - 1.f) * 5.f) / 100.f);
}
@ -45,12 +43,10 @@ static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_Tra
local ExtPlayerReplicationInfo MyPRI;
MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo);
if( MyPRI == None )
if( MyPRI == None || Ext_PerkDemolition(Perk) == None )
return;
MyPRI.bNukeIsOn = false;
MyPRI.NukeTimeMult = 1.0;
MyPRI.bNukeActive = false;
Ext_PerkDemolition(Perk).NukeDamageMult = 1.0;
}