diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset index f2c7b766..aa29977b 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:754ba6fc86e8d96dbe2fade3d515f45b10eefd1e3c7ac9115658daa2b251622e -size 76327 +oid sha256:4b77951badd74210f53986b352ed4a4f92520b0ac247bea02c8fe39c6fba0f98 +size 78642 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset index 5f03829f..6101521e 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_AmmoCount.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b199cbe84b6c49806f9646990c9c60ff7199214add19091ea0d7a47896daf53 -size 64350 +oid sha256:10ebd683496c3f12941f3983445288dce63f61464dea90cf666d51f7faf23919 +size 64526 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_WeaponStatsPrompt.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_WeaponStatsPrompt.uasset new file mode 100644 index 00000000..b3297971 --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/WBP_WeaponStatsPrompt.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53e04069ebf540b1eabcc5f7443809ad8ce7220ad0c86c39bca7befee2fc4ac6 +size 21759 diff --git a/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap b/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap index 36f15ee5..1be569be 100644 --- a/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap +++ b/EndlessVendetta/Content/LevelPrototyping/Scenes/TutorialHit.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:609efdd8d33b3e588fab3798c966b543cb353408d1aa6d8f78e1e50aed3e8c1c -size 298511 +oid sha256:e1a60c21cb9af1f0efba0eed08d7f08e957185d81139c861473115ec2b2b578d +size 301542 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp index 56ed2056..7d884ef8 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.cpp @@ -266,6 +266,11 @@ void ABountyDirector::Interact() PC_Display->LoadOS(); } +void ABountyDirector::InteractPrompt() +{ + +} + void ABountyDirector::DestroyBountyDirectorPCWidget() { if (IsValid(PC_DisplayWidget)) PC_DisplayWidget->RemoveFromParent(); diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h index 5c3a9719..b8ac9a66 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/BountyDirector.h @@ -54,6 +54,8 @@ class ENDLESSVENDETTA_API ABountyDirector : public AActor, public IInteractionIn // Opens up Bounty Director PC Interface void Interact() override; + // Prompts player to interact + void InteractPrompt() override; protected: int Favours = 20; diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index bca0966d..f8deed82 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -69,6 +69,24 @@ void AEndlessVendettaCharacter::BeginPlay() void AEndlessVendettaCharacter::Tick(float 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(HitActor); + if (InteractableActor) InteractableActor->InteractPrompt(); } //////////////////////////////////////////////////////////////////////////// Input @@ -124,6 +142,7 @@ void AEndlessVendettaCharacter::Interact() 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(HitActor); if (InteractableActor) InteractableActor->Interact(); } @@ -151,6 +170,7 @@ float AEndlessVendettaCharacter::TakeDamage(const float DamageAmount, FDamageEve return Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser); } + void AEndlessVendettaCharacter::ToggleRecon() { if (IsValid(PrimaryWeapon)) EquipPrimary(); diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index ece80c9f..fd54fc40 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -173,4 +173,6 @@ public: UFUNCTION(BlueprintCallable, Category = "Damage Control") virtual float TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) override; + + void WeaponPickUpSystem(); }; diff --git a/EndlessVendetta/Source/EndlessVendetta/InteractionInterface.h b/EndlessVendetta/Source/EndlessVendetta/InteractionInterface.h index 29746fab..f266b10b 100644 --- a/EndlessVendetta/Source/EndlessVendetta/InteractionInterface.h +++ b/EndlessVendetta/Source/EndlessVendetta/InteractionInterface.h @@ -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. public: virtual void Interact(){} + + + virtual void InteractPrompt() {} }; diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 6db24720..ba95f360 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -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")) +} + + + diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index 72ad7ed4..7d82343a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -6,13 +6,14 @@ #include "WeaponItemClass.h" #include "Components/ArrowComponent.h" #include "Kismet/KismetMathLibrary.h" +#include "EndlessVendetta/InteractionInterface.h" #include "BaseWeaponClass.generated.h" class AEndlessVendettaCharacter; class UCapsuleComponent; UCLASS() -class ENDLESSVENDETTA_API ABaseWeaponClass : public AActor +class ENDLESSVENDETTA_API ABaseWeaponClass : public AActor, public IInteractionInterface { GENERATED_BODY() @@ -156,6 +157,12 @@ public: UPROPERTY(EditAnywhere) int bulletCountShoot; //Gets how many bullets shot per + void Interact() override; + + void InteractPrompt() override; + + UFUNCTION(BlueprintImplementableEvent) + void WeaponStatsPopUp(); protected: UArrowComponent* GunStartArrow;