diff --git a/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset b/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset index b227979b..659e6cc8 100644 --- a/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset +++ b/EndlessVendetta/Content/Gadgets/GM_GadgetManager.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5aba529a9880bd712825883152d7ea40ba2c5e309dbd8d783942cdcb1e1879bf +oid sha256:101873288135db576b1a0060f9872880d1b4aaa7eca4c80cb4aa05925c67e275 size 22674 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/BP_RingingPhone.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/BP_RingingPhone.uasset new file mode 100644 index 00000000..7cb176c8 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/BP_RingingPhone.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ce42b2de8dc042e66a21fbb40c537d3d9b77bf9aba08bad33b7fa9de1b684a7 +size 39014 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset new file mode 100644 index 00000000..09120a7b --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/RG_RingModule.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b2a5cc7e22ed47e7380506b6873eb520643402f4f229340f00de2bac9e53e58 +size 108531 diff --git a/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/WBP_RM_ScreenWidget.uasset b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/WBP_RM_ScreenWidget.uasset new file mode 100644 index 00000000..747ddfc3 --- /dev/null +++ b/EndlessVendetta/Content/Gadgets/ReconGadgets/RingModule/WBP_RM_ScreenWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffd72773986cdacf62029cebebc6b25f8a581d0270358c303b8a968c6bfd23da +size 254397 diff --git a/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap b/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap index 91a8ae16..a43859c1 100644 --- a/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap +++ b/EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:77cadba64fcbb3018eab09695343339696bd1a1fbcfb39ee13aca7d57c7b4bab +oid sha256:253bd27498f52b503e5f65dbcad3810691d5d96581785cd5926f369155cef907 size 108254 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index fd1980eb..2d4167b3 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6606ee0e9ddf200d7b115f4bece31c3d00626e6eca88de44c836d32074510c65 +oid sha256:4d30ed0b3dca3879d9dd3b4c282293f326fc8a3b237e554c97025497362ac08c size 53268 diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.cpp new file mode 100644 index 00000000..c3117259 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.cpp @@ -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); + +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.h new file mode 100644 index 00000000..dd9f8cdc --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/PhoneRinging.h @@ -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; + +}; diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp index 941a7be1..d282dd8a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.cpp @@ -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(PhoneRingingClass, Enemy->GetActorLocation(), Enemy->GetActorRotation(), SpawnParams); + SpawnedPhone->AttachToComponent(Enemy->GetRootComponent(), AttachmentRules); } return true; } diff --git a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h index 70b53f1d..68dfb294 100644 --- a/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h +++ b/EndlessVendetta/Source/EndlessVendetta/GadgetSystem/GadgetClasses/Recon/RingModule/RingModule.h @@ -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 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); };