Implemented Overload Modules UI
This commit is contained in:
parent
56df964103
commit
8b90325502
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:599c54946bc53ff3d3ee06fc5c1e8322aa69d8a54380df1e8a63a41c5aefed46
|
||||
size 22249
|
||||
oid sha256:9fccd918d154abe44f38ff143101e53cd24b3e942af805172cf6ffe84b7e7cb3
|
||||
size 109934
|
||||
|
BIN
EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/WBP_OM_ScreenWidget.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/CombatGadgets/OverloadModule/WBP_OM_ScreenWidget.uasset
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:35b4a02d71c80d38b36dd3e41dcc099477704b99bd7e2785129503a80a20e67e
|
||||
size 106253
|
||||
oid sha256:04bfe587aa943c22a21e10962ddfb29aa185a165a9b1862aebbb012c532e5b8f
|
||||
size 108254
|
||||
|
BIN
EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
Binary file not shown.
@ -3,7 +3,6 @@
|
||||
|
||||
#include "OverloadModule.h"
|
||||
|
||||
#include "BehaviorTree/BTCompositeNode.h"
|
||||
#include "Components/SphereComponent.h"
|
||||
#include "GameFramework/Character.h"
|
||||
|
||||
@ -21,6 +20,7 @@ void AOverloadModule::Tick(float DeltaSeconds)
|
||||
{
|
||||
Super::Tick(DeltaSeconds);
|
||||
|
||||
if (GadgetCantBeUsed()) return;
|
||||
CheckForPotentialHackTarget();
|
||||
}
|
||||
|
||||
@ -67,7 +67,10 @@ void AOverloadModule::Activate()
|
||||
|
||||
void AOverloadModule::FinishedUsing()
|
||||
{
|
||||
IsValid(ClosestEnemy) ? DisplayHackingSuccess() : DisplayHackingFailure();
|
||||
SpawnExplosiveOnActor(ClosestEnemy);
|
||||
Super::FinishedUsing();
|
||||
PlayRechargingAnim(CooldownTime);
|
||||
}
|
||||
|
||||
void AOverloadModule::ExplodeClosestAliveEnemy()
|
||||
@ -90,17 +93,16 @@ void AOverloadModule::ExplodeClosestAliveEnemy()
|
||||
|
||||
if (EnemiesInRadius.IsEmpty())
|
||||
{
|
||||
DisplayFailedToFindTarget();
|
||||
ClosestEnemy = nullptr;
|
||||
SphereCollision->DestroyComponent();
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the closest Enemy in radius
|
||||
AActor* ClosestEnemy = EnemiesInRadius[0];
|
||||
ClosestEnemy = EnemiesInRadius[0];
|
||||
float Dist = FVector::Distance(PlayerChar->GetActorLocation(), ClosestEnemy->GetActorLocation());
|
||||
if (EnemiesInRadius.Num() < 2)
|
||||
{
|
||||
SpawnExplosiveOnActor(ClosestEnemy);
|
||||
SphereCollision->DestroyComponent();
|
||||
return;
|
||||
}
|
||||
@ -115,13 +117,13 @@ void AOverloadModule::ExplodeClosestAliveEnemy()
|
||||
}
|
||||
}
|
||||
|
||||
SpawnExplosiveOnActor(ClosestEnemy);
|
||||
SphereCollision->DestroyComponent();
|
||||
|
||||
}
|
||||
|
||||
void AOverloadModule::SpawnExplosiveOnActor(AActor* ActortoExplode)
|
||||
{
|
||||
if (!IsValid(ActortoExplode)) return;
|
||||
FActorSpawnParameters SpawnParams;
|
||||
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||
GetWorld()->SpawnActor<AActor>(Explosive, ActortoExplode->GetActorLocation(), ActortoExplode->GetActorRotation(), SpawnParams);
|
||||
|
@ -22,6 +22,8 @@ class ENDLESSVENDETTA_API AOverloadModule : public ACombatGadget
|
||||
|
||||
AActor* PotentialHackTarget;
|
||||
|
||||
AActor* ClosestEnemy;
|
||||
|
||||
// An Array of previously hacked enemies, stops player from hacking the same Dead Enemy
|
||||
TArray<uint32> HackedEnemies;
|
||||
|
||||
@ -60,8 +62,14 @@ protected:
|
||||
void DisplayFoundPotentialTarget();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
|
||||
void DisplayFailedToFindTarget();
|
||||
void PlayHackingAnim(float Loadingtime);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
|
||||
void PlayHackingAnim(float Loadingtime);
|
||||
void DisplayHackingFailure();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
|
||||
void DisplayHackingSuccess();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
|
||||
void PlayRechargingAnim(float RechargingTime);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user