diff --git a/KFGame/Classes/KFGFxWidget_VoiceComms.uc b/KFGame/Classes/KFGFxWidget_VoiceComms.uc index 3541801..a4bc584 100644 --- a/KFGame/Classes/KFGFxWidget_VoiceComms.uc +++ b/KFGame/Classes/KFGFxWidget_VoiceComms.uc @@ -220,6 +220,11 @@ function UpdateUICursorPosition(float newX, float newY, bool bMouseInput) ActionScriptVoid("setNormalizedMousePosition"); } +function SetToggleFriendlyButtonActive(bool IsActive) +{ + ActionScriptVoid("toggleFriendlyActive"); +} + DefaultProperties { ControllerDampening=2.5f diff --git a/KFGame/Classes/KFPerk_Demolitionist.uc b/KFGame/Classes/KFPerk_Demolitionist.uc index 437b445..a118197 100644 --- a/KFGame/Classes/KFPerk_Demolitionist.uc +++ b/KFGame/Classes/KFPerk_Demolitionist.uc @@ -403,6 +403,31 @@ static function PrepareExplosive( Pawn ProjOwner, KFProjectile Proj, optional fl } } +static function GameExplosion PrepareDroneExplosion(KFPawn Turret, optional float AuxRadiusMod = 1.0f, optional float AuxDmgMod = 1.0f ) +{ + local KFPlayerReplicationInfo InstigatorPRI; + local GameExplosion ExplosionTemplate; + + ExplosionTemplate = None; + + if (Turret.WorldInfo.TimeDilation < 1.f) + { + InstigatorPRI = KFPlayerReplicationInfo( Turret.Instigator.PlayerReplicationInfo ); + if( InstigatorPRI != none ) + { + if( InstigatorPRI.bNukeActive ) + { + ExplosionTemplate = class'KFPerk_Demolitionist'.static.GetNukeExplosionTemplate(); + ExplosionTemplate.Damage = ExplosionTemplate.default.Damage * class'KFPerk_Demolitionist'.static.GetNukeDamageModifier() * AuxDmgMod; + ExplosionTemplate.DamageRadius = ExplosionTemplate.default.DamageRadius * class'KFPerk_Demolitionist'.static.GetNukeRadiusModifier() * AuxRadiusMod; + ExplosionTemplate.DamageFalloffExponent = ExplosionTemplate.default.DamageFalloffExponent; + } + } + } + + return ExplosionTemplate; +} + simulated function float GetAoERadiusModifier() { local float RadiusModifier; diff --git a/KFGame/Classes/KFPlayerController.uc b/KFGame/Classes/KFPlayerController.uc index 0dda3d2..c2c5be6 100644 --- a/KFGame/Classes/KFPlayerController.uc +++ b/KFGame/Classes/KFPlayerController.uc @@ -12179,7 +12179,6 @@ simulated function ClearShotgunJumpFlag() exec function ToggleFriendlyUI() { bFriendlyUIEnabled = !bFriendlyUIEnabled; - `Log("Toggle Friendly UI " $bFriendlyUIEnabled); } defaultproperties diff --git a/KFGame/Classes/KFPlayerInput.uc b/KFGame/Classes/KFPlayerInput.uc index 24990ac..19ec0cb 100644 --- a/KFGame/Classes/KFPlayerInput.uc +++ b/KFGame/Classes/KFPlayerInput.uc @@ -2978,6 +2978,16 @@ exec function ToggleFriendlyUIFromHUD() if( MyGFxHUD != none && MyGFxHUD.VoiceCommsWidget != none && MyGFxHUD.VoiceCommsWidget.bActive ) { Outer.ToggleFriendlyUI(); + + MyGFxHUD.VoiceCommsWidget.SetToggleFriendlyButtonActive(true); + } +} + +exec function ReleaseToggleFriendlyUIFromHUD() +{ + if( MyGFxHUD != none && MyGFxHUD.VoiceCommsWidget != none && MyGFxHUD.VoiceCommsWidget.bActive ) + { + MyGFxHUD.VoiceCommsWidget.SetToggleFriendlyButtonActive(false); } } diff --git a/KFGameContent/Classes/KFDT_Ballistic_Shotgun_S12.uc b/KFGameContent/Classes/KFDT_Ballistic_Shotgun_S12.uc index 55b6794..37fbbe1 100644 --- a/KFGameContent/Classes/KFDT_Ballistic_Shotgun_S12.uc +++ b/KFGameContent/Classes/KFDT_Ballistic_Shotgun_S12.uc @@ -44,7 +44,7 @@ defaultproperties //KDeathUpKick=120 //KDeathVel=10 - StumblePower=5 + StumblePower=10 GunHitPower=0 ModifierPerkList(0)=class'KFPerk_Support' diff --git a/KFGameContent/Classes/KFPawn_HRG_Warthog.uc b/KFGameContent/Classes/KFPawn_HRG_Warthog.uc index ecb2d41..86b541d 100644 --- a/KFGameContent/Classes/KFPawn_HRG_Warthog.uc +++ b/KFGameContent/Classes/KFPawn_HRG_Warthog.uc @@ -632,10 +632,6 @@ simulated state Combat SetTurretState(ETS_Empty); } } - else - { - TurretWeapon.StopFire(0); - } } } } @@ -752,7 +748,7 @@ simulated state Detonate ExploActor.Instigator = Instigator; ExploActor.bIgnoreInstigator = true; - ExploActor.Explode(ExplosionTemplate); + ExploActor.Explode(PrepareExplosionTemplate()); } Destroy(); @@ -1191,6 +1187,34 @@ simulated function ClearFlashCount(Weapon InWeapon) bForceNetUpdate=true; } +// Special case as this is not a projectile +simulated function GameExplosion PrepareExplosionTemplate() +{ + local KFPawn PawnInstigator; + local KFPerk Perk; + local GameExplosion NewTemplate; + + + PawnInstigator = KFPawn(Instigator); + if (PawnInstigator != None) + { + NewTemplate = class'KFPerk_Demolitionist'.static.PrepareDroneExplosion(self); + + if (NewTemplate == None) + { + NewTemplate = default.ExplosionTemplate; + } + + Perk = PawnInstigator.GetPerk(); + if (Perk != None) + { + NewTemplate.DamageRadius *= Perk.GetAoERadiusModifier(); + } + } + + return NewTemplate; +} + defaultproperties { bCollideComplex=TRUE diff --git a/KFGameContent/Classes/KFProj_HighExplosive_HRG_Warthog.uc b/KFGameContent/Classes/KFProj_HighExplosive_HRG_Warthog.uc index bb89aaf..f075cd2 100644 --- a/KFGameContent/Classes/KFProj_HighExplosive_HRG_Warthog.uc +++ b/KFGameContent/Classes/KFProj_HighExplosive_HRG_Warthog.uc @@ -381,7 +381,7 @@ defaultproperties // explosion Begin Object Class=KFGameExplosion Name=ExploTemplate0 - Damage=35 + Damage=50 DamageRadius=200 DamageFalloffExponent=1 DamageDelay=0.f diff --git a/KFGameContent/Classes/KFWeap_AutoTurret.uc b/KFGameContent/Classes/KFWeap_AutoTurret.uc index eb5e89a..e6c3b7b 100644 --- a/KFGameContent/Classes/KFWeap_AutoTurret.uc +++ b/KFGameContent/Classes/KFWeap_AutoTurret.uc @@ -444,6 +444,7 @@ simulated function PrepareAndDetonate() Detonate(); } + CurrentFireMode = DETONATE_FIREMODE; IncrementFlashCount(); if( bInSprintState ) diff --git a/KFGameContent/Classes/KFWeap_AutoTurretWeapon.uc b/KFGameContent/Classes/KFWeap_AutoTurretWeapon.uc index 78afe4d..5016451 100644 --- a/KFGameContent/Classes/KFWeap_AutoTurretWeapon.uc +++ b/KFGameContent/Classes/KFWeap_AutoTurretWeapon.uc @@ -464,7 +464,7 @@ defaultproperties WeaponFireSnd(DEFAULT_FIREMODE)=(DefaultCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shot_LP_3P', FirstPersonCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shot_LP_1P') WeaponFireLoopEndSnd(DEFAULT_FIREMODE)=(DefaultCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shot_EndLP_3P', FirstPersonCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shot_EndLP_1P') - WeaponFireSnd(ALTFIRE_FIREMODE)=(DefaultCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shoot_3P', FirstPersonCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shoot_3P') + WeaponFireSnd(ALTFIRE_FIREMODE)=(DefaultCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shoot_3P', FirstPersonCue=AkEvent'WW_WEP_Autoturret.Play_WEP_AutoTurret_Shoot_1P') SingleFireSoundIndex=ALTFIRE_FIREMODE bLoopingFireSnd(DEFAULT_FIREMODE)=true diff --git a/KFGameContent/Classes/KFWeap_HRG_Warthog.uc b/KFGameContent/Classes/KFWeap_HRG_Warthog.uc index 0b9954a..042e2cf 100644 --- a/KFGameContent/Classes/KFWeap_HRG_Warthog.uc +++ b/KFGameContent/Classes/KFWeap_HRG_Warthog.uc @@ -448,6 +448,7 @@ simulated function PrepareAndDetonate() Detonate(); } + CurrentFireMode = DETONATE_FIREMODE; IncrementFlashCount(); if( bInSprintState ) diff --git a/KFGameContent/Classes/KFWeap_HRG_WarthogWeapon.uc b/KFGameContent/Classes/KFWeap_HRG_WarthogWeapon.uc index 53a3f2b..aeb1c31 100644 --- a/KFGameContent/Classes/KFWeap_HRG_WarthogWeapon.uc +++ b/KFGameContent/Classes/KFWeap_HRG_WarthogWeapon.uc @@ -19,7 +19,7 @@ var float CurrentDistanceProjectile; var float DistanceParabolicLaunch; -var transient float LastTimeFireSeconds; +var transient float FireLookAheadSeconds; simulated event PreBeginPlay() { @@ -122,13 +122,16 @@ simulated function KFProjectile SpawnProjectile( class KFProjClass if( SpawnedProjectile != none && !SpawnedProjectile.bDeleteMe ) { - if (CurrentTarget != none) + if (CurrentTarget != none) // This is used for regular shooting { //TargetLocation = CurrentTarget.Mesh.GetBoneLocation('Spine1'); TargetLocation = CurrentTarget.Location; TargetLocation.Z += CurrentTarget.GetCollisionHeight() * 0.5f; // Add an offset on the location, so it matches correctly + + // Apply look ahead + TargetLocation += CurrentTarget.Velocity * FireLookAheadSeconds; } - else if (CurrentDistanceProjectile > 0.f) + else if (CurrentDistanceProjectile > 0.f) // This is used for the explosion when drone dies { TargetLocation = RealStartLoc + AimDir * CurrentDistanceProjectile; TargetLocation.Z -= InstigatorDrone.DeployHeight; // We target more or less the ground @@ -213,14 +216,14 @@ simulated function IncrementFlashCount() simulated function Fire() { + if (IsInState('WeaponFiring')) + { + return; + } + if (HasAmmo(DEFAULT_FIREMODE)) { - //if (WorldInfo.TimeSeconds - LastTimeFireSeconds > GetFireInterval(DEFAULT_FIREMODE)) - //{ - LastTimeFireSeconds = WorldInfo.TimeSeconds; - - SendToFiringState(DEFAULT_FIREMODE); - //} + SendToFiringState(DEFAULT_FIREMODE); } } @@ -488,5 +491,5 @@ defaultproperties DistanceParabolicLaunch=150.f //cm - LastTimeFireSeconds=0.f + FireLookAheadSeconds=0.2f } \ No newline at end of file diff --git a/KFGameContent/Classes/KFWeap_Minigun.uc b/KFGameContent/Classes/KFWeap_Minigun.uc index 602f3d4..5f7dcbe 100644 --- a/KFGameContent/Classes/KFWeap_Minigun.uc +++ b/KFGameContent/Classes/KFWeap_Minigun.uc @@ -258,7 +258,7 @@ defaultproperties FireInterval(DEFAULT_FIREMODE)=+0.05 // 1200 RPM Spread(DEFAULT_FIREMODE)=0.0085 PenetrationPower(DEFAULT_FIREMODE)=2.0 - InstantHitDamage(DEFAULT_FIREMODE)=35.0 //32.0 //25 + InstantHitDamage(DEFAULT_FIREMODE)=38.0 //32.0 //25 FireOffset=(X=30,Y=4.5,Z=-5) // ALT_FIREMODE diff --git a/KFGameContent/Classes/KFWeap_Shotgun_S12.uc b/KFGameContent/Classes/KFWeap_Shotgun_S12.uc index 2dcf124..645b575 100644 --- a/KFGameContent/Classes/KFWeap_Shotgun_S12.uc +++ b/KFGameContent/Classes/KFWeap_Shotgun_S12.uc @@ -17,6 +17,7 @@ const SecondaryFireIronAnim = 'Shoot_Secondary_Iron'; const SecondaryReloadAnim = 'Reload_Secondary'; const SecondaryReloadEliteAnim = 'Reload_Secondary_Elite'; +var transient KFMuzzleFlash SecondaryMuzzleFlash; var() KFMuzzleFlash SecondaryMuzzleFlashTemplate; // Used on the server to keep track of grenades @@ -124,11 +125,6 @@ simulated function ConsumeAmmo( byte FireModeNum ) } } -simulated function bool HasAnyAmmo() -{ - return HasSpareAmmo() || HasAmmo(DEFAULT_FIREMODE) || SpareAmmoCount[1] > 0 || HasAmmo(ALTFIRE_FIREMODE); -} - /** Make sure user can't fire infinitely if they cheat to get infinite ammo locally. */ simulated event bool HasAmmo( byte FireModeNum, optional int Amount=1 ) { @@ -250,22 +246,23 @@ simulated state FiringSecondaryState extends WeaponSingleFiring */ simulated function CauseMuzzleFlash(byte FireModeNum) { - local bool AutoShellEject; - if(FireModeNum == ALTFIRE_FIREMODE) { - if (MuzzleFlash == None) + if (SecondaryMuzzleFlash == None) { - AttachSecondaryMuzzleFlash(); + AttachMuzzleFlash(); } - AutoShellEject = MuzzleFlash.bAutoActivateShellEject; + if (SecondaryMuzzleFlash != none) + { + SecondaryMuzzleFlash.CauseMuzzleFlash(FireModeNum); + } - MuzzleFlash.bAutoActivateShellEject = false; - - Super.CauseMuzzleFlash(FireModeNum); - - MuzzleFlash.bAutoActivateShellEject = AutoShellEject; + if (SecondaryMuzzleFlash.bAutoActivateShellEject) + { + SecondaryMuzzleFlash.CauseShellEject(); + SetShellEjectsToForeground(); + } } else { @@ -273,14 +270,16 @@ simulated function CauseMuzzleFlash(byte FireModeNum) } } -simulated function AttachSecondaryMuzzleFlash() +simulated function AttachMuzzleFlash() { + super.AttachMuzzleFlash(); + if ( MySkelMesh != none ) { - if (MuzzleFlashTemplate != None) + if (SecondaryMuzzleFlashTemplate != None) { - MuzzleFlash = new(self) Class'KFMuzzleFlash'(SecondaryMuzzleFlashTemplate); - MuzzleFlash.AttachMuzzleFlash(MySkelMesh, 'MuzzleFlashAlt'); + SecondaryMuzzleFlash = new(self) Class'KFMuzzleFlash'(SecondaryMuzzleFlashTemplate); + SecondaryMuzzleFlash.AttachMuzzleFlash(MySkelMesh, 'MuzzleFlashAlt'); } } } @@ -627,11 +626,11 @@ defaultproperties FiringStatesArray(DEFAULT_FIREMODE)=WeaponSingleFiring WeaponFireTypes(DEFAULT_FIREMODE)=EWFT_Projectile WeaponProjectiles(DEFAULT_FIREMODE)=class'KFProj_Bullet_Pellet' - InstantHitDamage(DEFAULT_FIREMODE)=24.0 //25 //20 + InstantHitDamage(DEFAULT_FIREMODE)=28.0 //25 //20 InstantHitDamageTypes(DEFAULT_FIREMODE)=class'KFDT_Ballistic_Shotgun_S12' PenetrationPower(DEFAULT_FIREMODE)=2.0 FireInterval(DEFAULT_FIREMODE)=0.2 // 300 RPM - Spread(DEFAULT_FIREMODE)=0.08 + Spread(DEFAULT_FIREMODE)=0.12 FireOffset=(X=30,Y=5,Z=-4) NumPellets(DEFAULT_FIREMODE)=7