1
0
This commit is contained in:
GenZmeY 2023-05-25 23:42:10 +03:00
parent d0b2d125ff
commit 3c1ea26aca
13 changed files with 108 additions and 41 deletions

View File

@ -220,6 +220,11 @@ function UpdateUICursorPosition(float newX, float newY, bool bMouseInput)
ActionScriptVoid("setNormalizedMousePosition"); ActionScriptVoid("setNormalizedMousePosition");
} }
function SetToggleFriendlyButtonActive(bool IsActive)
{
ActionScriptVoid("toggleFriendlyActive");
}
DefaultProperties DefaultProperties
{ {
ControllerDampening=2.5f ControllerDampening=2.5f

View File

@ -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() simulated function float GetAoERadiusModifier()
{ {
local float RadiusModifier; local float RadiusModifier;

View File

@ -12179,7 +12179,6 @@ simulated function ClearShotgunJumpFlag()
exec function ToggleFriendlyUI() exec function ToggleFriendlyUI()
{ {
bFriendlyUIEnabled = !bFriendlyUIEnabled; bFriendlyUIEnabled = !bFriendlyUIEnabled;
`Log("Toggle Friendly UI " $bFriendlyUIEnabled);
} }
defaultproperties defaultproperties

View File

@ -2978,6 +2978,16 @@ exec function ToggleFriendlyUIFromHUD()
if( MyGFxHUD != none && MyGFxHUD.VoiceCommsWidget != none && MyGFxHUD.VoiceCommsWidget.bActive ) if( MyGFxHUD != none && MyGFxHUD.VoiceCommsWidget != none && MyGFxHUD.VoiceCommsWidget.bActive )
{ {
Outer.ToggleFriendlyUI(); Outer.ToggleFriendlyUI();
MyGFxHUD.VoiceCommsWidget.SetToggleFriendlyButtonActive(true);
}
}
exec function ReleaseToggleFriendlyUIFromHUD()
{
if( MyGFxHUD != none && MyGFxHUD.VoiceCommsWidget != none && MyGFxHUD.VoiceCommsWidget.bActive )
{
MyGFxHUD.VoiceCommsWidget.SetToggleFriendlyButtonActive(false);
} }
} }

View File

@ -44,7 +44,7 @@ defaultproperties
//KDeathUpKick=120 //KDeathUpKick=120
//KDeathVel=10 //KDeathVel=10
StumblePower=5 StumblePower=10
GunHitPower=0 GunHitPower=0
ModifierPerkList(0)=class'KFPerk_Support' ModifierPerkList(0)=class'KFPerk_Support'

View File

@ -632,10 +632,6 @@ simulated state Combat
SetTurretState(ETS_Empty); SetTurretState(ETS_Empty);
} }
} }
else
{
TurretWeapon.StopFire(0);
}
} }
} }
} }
@ -752,7 +748,7 @@ simulated state Detonate
ExploActor.Instigator = Instigator; ExploActor.Instigator = Instigator;
ExploActor.bIgnoreInstigator = true; ExploActor.bIgnoreInstigator = true;
ExploActor.Explode(ExplosionTemplate); ExploActor.Explode(PrepareExplosionTemplate());
} }
Destroy(); Destroy();
@ -1191,6 +1187,34 @@ simulated function ClearFlashCount(Weapon InWeapon)
bForceNetUpdate=true; 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 defaultproperties
{ {
bCollideComplex=TRUE bCollideComplex=TRUE

View File

@ -381,7 +381,7 @@ defaultproperties
// explosion // explosion
Begin Object Class=KFGameExplosion Name=ExploTemplate0 Begin Object Class=KFGameExplosion Name=ExploTemplate0
Damage=35 Damage=50
DamageRadius=200 DamageRadius=200
DamageFalloffExponent=1 DamageFalloffExponent=1
DamageDelay=0.f DamageDelay=0.f

View File

@ -444,6 +444,7 @@ simulated function PrepareAndDetonate()
Detonate(); Detonate();
} }
CurrentFireMode = DETONATE_FIREMODE;
IncrementFlashCount(); IncrementFlashCount();
if( bInSprintState ) if( bInSprintState )

View File

@ -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') 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') 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 SingleFireSoundIndex=ALTFIRE_FIREMODE
bLoopingFireSnd(DEFAULT_FIREMODE)=true bLoopingFireSnd(DEFAULT_FIREMODE)=true

View File

@ -448,6 +448,7 @@ simulated function PrepareAndDetonate()
Detonate(); Detonate();
} }
CurrentFireMode = DETONATE_FIREMODE;
IncrementFlashCount(); IncrementFlashCount();
if( bInSprintState ) if( bInSprintState )

View File

@ -19,7 +19,7 @@ var float CurrentDistanceProjectile;
var float DistanceParabolicLaunch; var float DistanceParabolicLaunch;
var transient float LastTimeFireSeconds; var transient float FireLookAheadSeconds;
simulated event PreBeginPlay() simulated event PreBeginPlay()
{ {
@ -122,13 +122,16 @@ simulated function KFProjectile SpawnProjectile( class<KFProjectile> KFProjClass
if( SpawnedProjectile != none && !SpawnedProjectile.bDeleteMe ) if( SpawnedProjectile != none && !SpawnedProjectile.bDeleteMe )
{ {
if (CurrentTarget != none) if (CurrentTarget != none) // This is used for regular shooting
{ {
//TargetLocation = CurrentTarget.Mesh.GetBoneLocation('Spine1'); //TargetLocation = CurrentTarget.Mesh.GetBoneLocation('Spine1');
TargetLocation = CurrentTarget.Location; TargetLocation = CurrentTarget.Location;
TargetLocation.Z += CurrentTarget.GetCollisionHeight() * 0.5f; // Add an offset on the location, so it matches correctly 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 = RealStartLoc + AimDir * CurrentDistanceProjectile;
TargetLocation.Z -= InstigatorDrone.DeployHeight; // We target more or less the ground TargetLocation.Z -= InstigatorDrone.DeployHeight; // We target more or less the ground
@ -213,14 +216,14 @@ simulated function IncrementFlashCount()
simulated function Fire() simulated function Fire()
{ {
if (IsInState('WeaponFiring'))
{
return;
}
if (HasAmmo(DEFAULT_FIREMODE)) if (HasAmmo(DEFAULT_FIREMODE))
{ {
//if (WorldInfo.TimeSeconds - LastTimeFireSeconds > GetFireInterval(DEFAULT_FIREMODE)) SendToFiringState(DEFAULT_FIREMODE);
//{
LastTimeFireSeconds = WorldInfo.TimeSeconds;
SendToFiringState(DEFAULT_FIREMODE);
//}
} }
} }
@ -488,5 +491,5 @@ defaultproperties
DistanceParabolicLaunch=150.f //cm DistanceParabolicLaunch=150.f //cm
LastTimeFireSeconds=0.f FireLookAheadSeconds=0.2f
} }

View File

@ -258,7 +258,7 @@ defaultproperties
FireInterval(DEFAULT_FIREMODE)=+0.05 // 1200 RPM FireInterval(DEFAULT_FIREMODE)=+0.05 // 1200 RPM
Spread(DEFAULT_FIREMODE)=0.0085 Spread(DEFAULT_FIREMODE)=0.0085
PenetrationPower(DEFAULT_FIREMODE)=2.0 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) FireOffset=(X=30,Y=4.5,Z=-5)
// ALT_FIREMODE // ALT_FIREMODE

View File

@ -17,6 +17,7 @@ const SecondaryFireIronAnim = 'Shoot_Secondary_Iron';
const SecondaryReloadAnim = 'Reload_Secondary'; const SecondaryReloadAnim = 'Reload_Secondary';
const SecondaryReloadEliteAnim = 'Reload_Secondary_Elite'; const SecondaryReloadEliteAnim = 'Reload_Secondary_Elite';
var transient KFMuzzleFlash SecondaryMuzzleFlash;
var() KFMuzzleFlash SecondaryMuzzleFlashTemplate; var() KFMuzzleFlash SecondaryMuzzleFlashTemplate;
// Used on the server to keep track of grenades // 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. */ /** 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 ) simulated event bool HasAmmo( byte FireModeNum, optional int Amount=1 )
{ {
@ -250,22 +246,23 @@ simulated state FiringSecondaryState extends WeaponSingleFiring
*/ */
simulated function CauseMuzzleFlash(byte FireModeNum) simulated function CauseMuzzleFlash(byte FireModeNum)
{ {
local bool AutoShellEject;
if(FireModeNum == ALTFIRE_FIREMODE) if(FireModeNum == ALTFIRE_FIREMODE)
{ {
if (MuzzleFlash == None) if (SecondaryMuzzleFlash == None)
{ {
AttachSecondaryMuzzleFlash(); AttachMuzzleFlash();
} }
AutoShellEject = MuzzleFlash.bAutoActivateShellEject; if (SecondaryMuzzleFlash != none)
{
SecondaryMuzzleFlash.CauseMuzzleFlash(FireModeNum);
}
MuzzleFlash.bAutoActivateShellEject = false; if (SecondaryMuzzleFlash.bAutoActivateShellEject)
{
Super.CauseMuzzleFlash(FireModeNum); SecondaryMuzzleFlash.CauseShellEject();
SetShellEjectsToForeground();
MuzzleFlash.bAutoActivateShellEject = AutoShellEject; }
} }
else else
{ {
@ -273,14 +270,16 @@ simulated function CauseMuzzleFlash(byte FireModeNum)
} }
} }
simulated function AttachSecondaryMuzzleFlash() simulated function AttachMuzzleFlash()
{ {
super.AttachMuzzleFlash();
if ( MySkelMesh != none ) if ( MySkelMesh != none )
{ {
if (MuzzleFlashTemplate != None) if (SecondaryMuzzleFlashTemplate != None)
{ {
MuzzleFlash = new(self) Class'KFMuzzleFlash'(SecondaryMuzzleFlashTemplate); SecondaryMuzzleFlash = new(self) Class'KFMuzzleFlash'(SecondaryMuzzleFlashTemplate);
MuzzleFlash.AttachMuzzleFlash(MySkelMesh, 'MuzzleFlashAlt'); SecondaryMuzzleFlash.AttachMuzzleFlash(MySkelMesh, 'MuzzleFlashAlt');
} }
} }
} }
@ -627,11 +626,11 @@ defaultproperties
FiringStatesArray(DEFAULT_FIREMODE)=WeaponSingleFiring FiringStatesArray(DEFAULT_FIREMODE)=WeaponSingleFiring
WeaponFireTypes(DEFAULT_FIREMODE)=EWFT_Projectile WeaponFireTypes(DEFAULT_FIREMODE)=EWFT_Projectile
WeaponProjectiles(DEFAULT_FIREMODE)=class'KFProj_Bullet_Pellet' 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' InstantHitDamageTypes(DEFAULT_FIREMODE)=class'KFDT_Ballistic_Shotgun_S12'
PenetrationPower(DEFAULT_FIREMODE)=2.0 PenetrationPower(DEFAULT_FIREMODE)=2.0
FireInterval(DEFAULT_FIREMODE)=0.2 // 300 RPM FireInterval(DEFAULT_FIREMODE)=0.2 // 300 RPM
Spread(DEFAULT_FIREMODE)=0.08 Spread(DEFAULT_FIREMODE)=0.12
FireOffset=(X=30,Y=5,Z=-4) FireOffset=(X=30,Y=5,Z=-4)
NumPellets(DEFAULT_FIREMODE)=7 NumPellets(DEFAULT_FIREMODE)=7