From 7f15ae8a3aeed7f187ace5f6e3f06cfbd331f56c Mon Sep 17 00:00:00 2001 From: jose21crisis Date: Thu, 9 Feb 2017 16:19:10 -0400 Subject: [PATCH 1/3] Enemies now use full auto like they should Suspects now prefer burst, then auto, then single SWAT now prefer burst, then single, then auto --- Source/Game/SwatGame/Classes/AI/SwatAI.uc | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Source/Game/SwatGame/Classes/AI/SwatAI.uc b/Source/Game/SwatGame/Classes/AI/SwatAI.uc index 6b087bb1..3ee695fa 100644 --- a/Source/Game/SwatGame/Classes/AI/SwatAI.uc +++ b/Source/Game/SwatGame/Classes/AI/SwatAI.uc @@ -2035,14 +2035,36 @@ function FireMode GetDefaultAIFireModeForWeapon(FiredWeapon Weapon) { assert(Weapon != None); - if (Weapon.HasFireMode(FireMode_Single) || Weapon.HasFireMode(FireMode_SingleTaser)) - { - return FireMode_Single; + if(Weapon.Owner.IsA('SwatEnemy')) { + // the thing holding me is a suspect + if (Weapon.HasFireMode(FireMode_Burst)) + { + return FireMode_Burst; + } + else if (Weapon.HasFireMode(FireMode_Auto)) + { + return FireMode_Auto; + } + if (Weapon.HasFireMode(FireMode_Single) || Weapon.HasFireMode(FireMode_SingleTaser)) + { + return FireMode_Single; + } + else + { + // sanity check! + assert(Weapon.HasFireMode(FireMode_DoubleTaser)); + + return FireMode_DoubleTaser; + } } - if (Weapon.HasFireMode(FireMode_Burst)) + else if (Weapon.HasFireMode(FireMode_Burst)) { return FireMode_Burst; } + else if (Weapon.HasFireMode(FireMode_Single) || Weapon.HasFireMode(FireMode_SingleTaser)) + { + return FireMode_Single; + } else if (Weapon.HasFireMode(FireMode_Auto)) { return FireMode_Auto; From c06a1b0165df06a19ab837aa2817f0de4cf4ab6a Mon Sep 17 00:00:00 2001 From: jose21crisis Date: Thu, 9 Feb 2017 16:20:53 -0400 Subject: [PATCH 2/3] Suspects are considered threats when aiming Suspects are now considered threats when they aim their weapon around, at an specific point or at a target, even if the target is not a pawn. Might need some tweaks. --- Source/Game/SwatAICommon/Classes/Actions/AimAroundAction.uc | 6 +++++- .../Game/SwatAICommon/Classes/Actions/AimAtPointAction.uc | 4 ++++ .../Game/SwatAICommon/Classes/Actions/AimAtTargetAction.uc | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Game/SwatAICommon/Classes/Actions/AimAroundAction.uc b/Source/Game/SwatAICommon/Classes/Actions/AimAroundAction.uc index aebca11b..4106cdc2 100644 --- a/Source/Game/SwatAICommon/Classes/Actions/AimAroundAction.uc +++ b/Source/Game/SwatAICommon/Classes/Actions/AimAroundAction.uc @@ -118,7 +118,7 @@ function initAction(AI_Resource r, AI_Goal goal) if (bAimWeapon) { - CurrentUpperBodyAnimBehavior = kUBAB_AimWeapon; + CurrentUpperBodyAnimBehavior = kUBAB_AimWeapon; } else { @@ -670,6 +670,10 @@ latent function AimAtBestPoint() { ISwatAI(m_pawn).AimAtActor(CurrentAimPoint); SetCurrentUpperBodyAnimBehavior(); + if (m_Pawn.IsA('SwatEnemy') && !ISwatEnemy(m_Pawn).IsAThreat()) + { + ISwatEnemy(m_Pawn).BecomeAThreat(); + } // Hold this aim for the timed duration, or until our aim point is too // close to us. diff --git a/Source/Game/SwatAICommon/Classes/Actions/AimAtPointAction.uc b/Source/Game/SwatAICommon/Classes/Actions/AimAtPointAction.uc index f39b2fe7..40e042ce 100644 --- a/Source/Game/SwatAICommon/Classes/Actions/AimAtPointAction.uc +++ b/Source/Game/SwatAICommon/Classes/Actions/AimAtPointAction.uc @@ -45,6 +45,10 @@ latent function AimAtDesiredPoint() while (ISwatAI(m_pawn).AnimCanAimAtDesiredPoint(Point)) { LatentAimAtPoint(Point); + if (m_Pawn.IsA('SwatEnemy') && !ISwatEnemy(m_Pawn).IsAThreat()) + { + ISwatEnemy(m_Pawn).BecomeAThreat(); + } yield(); } diff --git a/Source/Game/SwatAICommon/Classes/Actions/AimAtTargetAction.uc b/Source/Game/SwatAICommon/Classes/Actions/AimAtTargetAction.uc index 6e77de17..1735ab1d 100644 --- a/Source/Game/SwatAICommon/Classes/Actions/AimAtTargetAction.uc +++ b/Source/Game/SwatAICommon/Classes/Actions/AimAtTargetAction.uc @@ -62,6 +62,10 @@ latent function AimAtTarget() while (!bOnlyWhenCanHitTarget || (m_Pawn.CanHit(Target) && ((MinDistanceToTargetToAim == 0.0) || (VSize(Target.Location - m_Pawn.Location) < MinDistanceToTargetToAim)))) { LatentAimAtActor(Target); + if (m_Pawn.IsA('SwatEnemy') && !ISwatEnemy(m_Pawn).IsAThreat()) + { + ISwatEnemy(m_Pawn).BecomeAThreat(); + } yield(); } } From 57a46070479152065db0d288c01a6c04c9e323a2 Mon Sep 17 00:00:00 2001 From: jose21crisis Date: Thu, 9 Feb 2017 16:22:48 -0400 Subject: [PATCH 3/3] More unused voices Suspects now do a speech when they see downed suspects --- .../Game/SwatAICommon/Classes/Actions/EnemyCommanderAction.uc | 4 ++++ .../SwatAICommon/Classes/Actions/EnemySpeechManagerAction.uc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Source/Game/SwatAICommon/Classes/Actions/EnemyCommanderAction.uc b/Source/Game/SwatAICommon/Classes/Actions/EnemyCommanderAction.uc index 23811490..560480b0 100644 --- a/Source/Game/SwatAICommon/Classes/Actions/EnemyCommanderAction.uc +++ b/Source/Game/SwatAICommon/Classes/Actions/EnemyCommanderAction.uc @@ -517,10 +517,14 @@ function NotifyNearbyEnemyKilled(Pawn NearbyEnemy, Pawn Officer) if (Officer != None) { ChangeMorale(- GetNearbyEnemyKilledMoraleModification(), "Nearby Enemy " $ NearbyEnemy.Name $ " Killed By " $ Officer.Name); + // do some speech + ISwatEnemy(m_Pawn).GetEnemySpeechManagerAction().TriggerDownedSuspectSpeech(); } else { ChangeMorale(- GetNearbyEnemyKilledMoraleModification(), "Nearby Enemy " $ NearbyEnemy.Name $ " Killed By an inanimate object"); + // do some speech + ISwatEnemy(m_Pawn).GetEnemySpeechManagerAction().TriggerDownedSuspectSpeech(); } } diff --git a/Source/Game/SwatAICommon/Classes/Actions/EnemySpeechManagerAction.uc b/Source/Game/SwatAICommon/Classes/Actions/EnemySpeechManagerAction.uc index ba7c69cb..ce155d3f 100644 --- a/Source/Game/SwatAICommon/Classes/Actions/EnemySpeechManagerAction.uc +++ b/Source/Game/SwatAICommon/Classes/Actions/EnemySpeechManagerAction.uc @@ -65,6 +65,10 @@ function TriggerDownedOfficerSpeech() TriggerSpeech('ReactedDownOfficer'); } +function TriggerDownedSuspectSpeech() +{ + TriggerSpeech('ReactedDownSuspect'); +} /////////////////////////////////////////////////////////////////////////////// defaultproperties {