Implemented Ring Module UI

This commit is contained in:
Rafal Swierczek 2023-10-08 20:11:07 +01:00
parent 2a9e30108d
commit 9be0b373cf
10 changed files with 83 additions and 14 deletions

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3ce42b2de8dc042e66a21fbb40c537d3d9b77bf9aba08bad33b7fa9de1b684a7
size 39014

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b2a5cc7e22ed47e7380506b6873eb520643402f4f229340f00de2bac9e53e58
size 108531

Binary file not shown.

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:77cadba64fcbb3018eab09695343339696bd1a1fbcfb39ee13aca7d57c7b4bab
oid sha256:253bd27498f52b503e5f65dbcad3810691d5d96581785cd5926f369155cef907
size 108254

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6606ee0e9ddf200d7b115f4bece31c3d00626e6eca88de44c836d32074510c65
oid sha256:4d30ed0b3dca3879d9dd3b4c282293f326fc8a3b237e554c97025497362ac08c
size 53268

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "PhoneRinging.h"
// Sets default values
APhoneRinging::APhoneRinging()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void APhoneRinging::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void APhoneRinging::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PhoneRinging.generated.h"
UCLASS()
class ENDLESSVENDETTA_API APhoneRinging : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
APhoneRinging();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};

View File

@ -90,10 +90,13 @@ bool ARingModule::SpawnRingingPhoneForAllNearbyEnemies()
return false;
}
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
for (AActor* Enemy : EnemiesInRadius)
{
//Dont Forget to spawn in phone ringing
UE_LOG(LogTemp, Warning, TEXT("%s's phone is ringing!!!"), *Enemy->GetName());
AActor* SpawnedPhone = GetWorld()->SpawnActor<AActor>(PhoneRingingClass, Enemy->GetActorLocation(), Enemy->GetActorRotation(), SpawnParams);
SpawnedPhone->AttachToComponent(Enemy->GetRootComponent(), AttachmentRules);
}
return true;
}

View File

@ -3,6 +3,7 @@
#pragma once
#include "CoreMinimal.h"
#include "PhoneRinging.h"
#include "EndlessVendetta/GadgetSystem/ReconGadget.h"
#include "Camera/CameraComponent.h"
#include "RingModule.generated.h"
@ -38,31 +39,34 @@ class ENDLESSVENDETTA_API ARingModule : public AReconGadget
bool SpawnRingingPhoneForAllNearbyEnemies();
protected:
UPROPERTY(EditDefaultsOnly, Category = "Overload Module")
UPROPERTY(EditDefaultsOnly, Category = "Ring Module")
float AreaOfEffectInMeters = 20;
UPROPERTY(EditDefaultsOnly, Category = "Overload Module")
UPROPERTY(EditDefaultsOnly, Category = "Ring Module")
float DeadBodyCheckDistance = 250;
UPROPERTY(EditDefaultsOnly, Category = "Ring Module")
TSubclassOf<APhoneRinging> PhoneRingingClass;
// --------------- Display Functions ---------------
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void DisplayAlreadyHacked();
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void DisplayNeedADeadEnemy();
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void DisplayFoundPotentialTarget();
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void PlayHackingAnim(float Loadingtime);
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void DisplayHackingFailure();
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void DisplayHackingSuccess();
UFUNCTION(BlueprintImplementableEvent, Category = "Overload Module")
UFUNCTION(BlueprintImplementableEvent, Category = "Ring Module")
void PlayRechargingAnim(float RechargingTime);
};