Updated all Classes to have new Interface Function
This commit is contained in:
parent
dec1d761bf
commit
a9eb6e3eea
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:754ba6fc86e8d96dbe2fade3d515f45b10eefd1e3c7ac9115658daa2b251622e
|
oid sha256:4b77951badd74210f53986b352ed4a4f92520b0ac247bea02c8fe39c6fba0f98
|
||||||
size 76327
|
size 78642
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:1b199cbe84b6c49806f9646990c9c60ff7199214add19091ea0d7a47896daf53
|
oid sha256:10ebd683496c3f12941f3983445288dce63f61464dea90cf666d51f7faf23919
|
||||||
size 64350
|
size 64526
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:53e04069ebf540b1eabcc5f7443809ad8ce7220ad0c86c39bca7befee2fc4ac6
|
||||||
|
size 21759
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:609efdd8d33b3e588fab3798c966b543cb353408d1aa6d8f78e1e50aed3e8c1c
|
oid sha256:e1a60c21cb9af1f0efba0eed08d7f08e957185d81139c861473115ec2b2b578d
|
||||||
size 298511
|
size 301542
|
||||||
|
@ -266,6 +266,11 @@ void ABountyDirector::Interact()
|
|||||||
PC_Display->LoadOS();
|
PC_Display->LoadOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ABountyDirector::InteractPrompt()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void ABountyDirector::DestroyBountyDirectorPCWidget()
|
void ABountyDirector::DestroyBountyDirectorPCWidget()
|
||||||
{
|
{
|
||||||
if (IsValid(PC_DisplayWidget)) PC_DisplayWidget->RemoveFromParent();
|
if (IsValid(PC_DisplayWidget)) PC_DisplayWidget->RemoveFromParent();
|
||||||
|
@ -54,6 +54,8 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor, public IInteractionIn
|
|||||||
// Opens up Bounty Director PC Interface
|
// Opens up Bounty Director PC Interface
|
||||||
void Interact() override;
|
void Interact() override;
|
||||||
|
|
||||||
|
// Prompts player to interact
|
||||||
|
void InteractPrompt() override;
|
||||||
protected:
|
protected:
|
||||||
int Favours = 20;
|
int Favours = 20;
|
||||||
|
|
||||||
|
@ -69,6 +69,24 @@ void AEndlessVendettaCharacter::BeginPlay()
|
|||||||
void AEndlessVendettaCharacter::Tick(float DeltaTime)
|
void AEndlessVendettaCharacter::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
|
WeaponPickUpSystem();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AEndlessVendettaCharacter::WeaponPickUpSystem()
|
||||||
|
{
|
||||||
|
FHitResult OutHit;
|
||||||
|
FCollisionQueryParams QueryParams = FCollisionQueryParams::DefaultQueryParam;
|
||||||
|
QueryParams.AddIgnoredActor(this);
|
||||||
|
FVector LT_Start = FirstPersonCameraComponent->GetComponentLocation();
|
||||||
|
FVector LT_End = LT_Start + (FirstPersonCameraComponent->GetForwardVector() * InteractionRange);
|
||||||
|
if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return;
|
||||||
|
|
||||||
|
AActor* HitActor = OutHit.GetActor();
|
||||||
|
UE_LOG(LogTemp, Warning, TEXT("Hit actor: %s"), *HitActor->GetName());
|
||||||
|
IInteractionInterface* InteractableActor = Cast<IInteractionInterface>(HitActor);
|
||||||
|
if (InteractableActor) InteractableActor->InteractPrompt();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////// Input
|
//////////////////////////////////////////////////////////////////////////// Input
|
||||||
@ -124,6 +142,7 @@ void AEndlessVendettaCharacter::Interact()
|
|||||||
if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return;
|
if (!GetWorld()->LineTraceSingleByChannel(OutHit, LT_Start, LT_End, ECC_Camera, QueryParams)) return;
|
||||||
|
|
||||||
AActor* HitActor = OutHit.GetActor();
|
AActor* HitActor = OutHit.GetActor();
|
||||||
|
UE_LOG(LogTemp, Warning, TEXT("Hit actor: %s"), *HitActor->GetName());
|
||||||
IInteractionInterface* InteractableActor = Cast<IInteractionInterface>(HitActor);
|
IInteractionInterface* InteractableActor = Cast<IInteractionInterface>(HitActor);
|
||||||
if (InteractableActor) InteractableActor->Interact();
|
if (InteractableActor) InteractableActor->Interact();
|
||||||
}
|
}
|
||||||
@ -151,6 +170,7 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve
|
|||||||
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
|
return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AEndlessVendettaCharacter::ToggleRecon()
|
void AEndlessVendettaCharacter::ToggleRecon()
|
||||||
{
|
{
|
||||||
if (IsValid(PrimaryWeapon)) EquipPrimary();
|
if (IsValid(PrimaryWeapon)) EquipPrimary();
|
||||||
|
@ -173,4 +173,6 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Damage Control")
|
UFUNCTION(BlueprintCallable, Category = "Damage Control")
|
||||||
virtual float TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) override;
|
virtual float TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) override;
|
||||||
|
|
||||||
|
void WeaponPickUpSystem();
|
||||||
};
|
};
|
||||||
|
@ -23,4 +23,7 @@ class ENDLESSVENDETTA_API IInteractionInterface
|
|||||||
// Add interface functions to this class. This is the class that will be inherited to implement this interface.
|
// Add interface functions to this class. This is the class that will be inherited to implement this interface.
|
||||||
public:
|
public:
|
||||||
virtual void Interact(){}
|
virtual void Interact(){}
|
||||||
|
|
||||||
|
|
||||||
|
virtual void InteractPrompt() {}
|
||||||
};
|
};
|
||||||
|
@ -230,4 +230,17 @@ void ABaseWeaponClass::WeaponReload()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ABaseWeaponClass::Interact()
|
||||||
|
{
|
||||||
|
GLog->Log("Interact Called");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ABaseWeaponClass::InteractPrompt()
|
||||||
|
{
|
||||||
|
WeaponStatsPopUp();
|
||||||
|
UE_LOG(LogTemp, Warning, TEXT("InteractPrompt setup"))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
#include "WeaponItemClass.h"
|
#include "WeaponItemClass.h"
|
||||||
#include "Components/ArrowComponent.h"
|
#include "Components/ArrowComponent.h"
|
||||||
#include "Kismet/KismetMathLibrary.h"
|
#include "Kismet/KismetMathLibrary.h"
|
||||||
|
#include "EndlessVendetta/InteractionInterface.h"
|
||||||
#include "BaseWeaponClass.generated.h"
|
#include "BaseWeaponClass.generated.h"
|
||||||
|
|
||||||
class AEndlessVendettaCharacter;
|
class AEndlessVendettaCharacter;
|
||||||
class UCapsuleComponent;
|
class UCapsuleComponent;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class ENDLESSVENDETTA_API ABaseWeaponClass : public AActor
|
class ENDLESSVENDETTA_API ABaseWeaponClass : public AActor, public IInteractionInterface
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
@ -156,6 +157,12 @@ public:
|
|||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
int bulletCountShoot; //Gets how many bullets shot per
|
int bulletCountShoot; //Gets how many bullets shot per
|
||||||
|
|
||||||
|
void Interact() override;
|
||||||
|
|
||||||
|
void InteractPrompt() override;
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void WeaponStatsPopUp();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UArrowComponent* GunStartArrow;
|
UArrowComponent* GunStartArrow;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user