From acafc375d2af931b2c64dce2fed7b2885f9ac270 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Sun, 14 Apr 2024 20:01:09 +0100 Subject: [PATCH] Implemented Entering Apartment Through Vent Functionality --- .../BP_ConstructionWorker.uasset | 4 +-- .../DT_ConstructionWorker.uasset | 3 ++ .../Item_ScrewDriver.uasset | 3 ++ .../AI/ConstructionWorker/M_ScrewPic.uasset | 3 ++ .../ConstructionWorker/M_ScrewPic_Rot.uasset | 3 ++ .../AI/ConstructionWorker/ScrewDriverPic.png | 3 ++ .../ConstructionWorker/ScrewDriverPic.uasset | 3 ++ .../BountySpecificActors/BP_Vent.uasset | 4 +-- .../Content/Levels/OpenWorldRework.umap | 4 +-- .../Architecture/Floor_400x400.uasset | 4 +-- .../Blueprints/Blueprint_CeilingLight.uasset | 4 +-- .../BountySystem/Misc/ConstructionVent.cpp | 36 +++++++++++-------- .../BountySystem/Misc/ConstructionVent.h | 10 +++--- .../Source/EndlessVendetta/EVGameInstance.h | 3 ++ 14 files changed, 58 insertions(+), 29 deletions(-) create mode 100644 EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/DT_ConstructionWorker.uasset create mode 100644 EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/Item_ScrewDriver.uasset create mode 100644 EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic.uasset create mode 100644 EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic_Rot.uasset create mode 100644 EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.png create mode 100644 EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.uasset diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/BP_ConstructionWorker.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/BP_ConstructionWorker.uasset index 29493e4e..4ee05edf 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/BP_ConstructionWorker.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/BP_ConstructionWorker.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cb0a97f1dd101c47bcf0507886ef4490543549181f2c8bb287089ad768a7518 -size 34179 +oid sha256:123098c81e710146723e193f367e1a4e2da65cacca48bf37d97c40e85bcf9dca +size 35424 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/DT_ConstructionWorker.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/DT_ConstructionWorker.uasset new file mode 100644 index 00000000..8c4705f2 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/DT_ConstructionWorker.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1601f030eac7b4dceecb08b62ff7657c5170e30c0879afe48307f6aa1519ec9e +size 17402 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/Item_ScrewDriver.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/Item_ScrewDriver.uasset new file mode 100644 index 00000000..56172f2e --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/Item_ScrewDriver.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b27ccf307df7d6fef1bd34db07da0003c4a5424121e11e8b91910c7425f7d442 +size 7098 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic.uasset new file mode 100644 index 00000000..53c74df9 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e38300c6512a232b970625eec2799582e0dca66ffae69a05623a67d7872cf7b1 +size 8699 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic_Rot.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic_Rot.uasset new file mode 100644 index 00000000..6fe3334c --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/M_ScrewPic_Rot.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef1ecef5f6326bc0c8c747e0e3a2a8356056369b1c75fc5bcea4bff07d35b7f2 +size 8738 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.png b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.png new file mode 100644 index 00000000..57bb02a5 --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37515d0226554420c68425676c703df35d5eed9409b3758298380e0bceb6a9b8 +size 19304 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.uasset new file mode 100644 index 00000000..ad4048fc --- /dev/null +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/AI/ConstructionWorker/ScrewDriverPic.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4638bdf36e17f74585821a9658d68cbe8e0f1c54fbaddc7c88278bce38299af +size 37950 diff --git a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Vent.uasset b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Vent.uasset index 154f75ce..9046e76d 100644 --- a/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Vent.uasset +++ b/EndlessVendetta/Content/BountySystem/ApartmentBounty/BountySpecificActors/BP_Vent.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce69e2ea1ad759c5405fb0414aebf0bdcafdbe0420328736cedba27b41528521 -size 27320 +oid sha256:14cb75883d3e5bf3ca40441a9794c0e14a662b30170a45cadbb3d63a3271b83b +size 36526 diff --git a/EndlessVendetta/Content/Levels/OpenWorldRework.umap b/EndlessVendetta/Content/Levels/OpenWorldRework.umap index c6541e31..f5fb6d2d 100644 --- a/EndlessVendetta/Content/Levels/OpenWorldRework.umap +++ b/EndlessVendetta/Content/Levels/OpenWorldRework.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba1cd4efcaef5498d769e1db299d043470a1e6fa9bbe2b54927ed2962d4361dd -size 41739957 +oid sha256:abff5f3419d080ed1bf2fe3f817bd0d67983bd472e364dc44c671829b3f736df +size 41740404 diff --git a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34afc..2742a07b 100644 --- a/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:e0e0908ff9980a57002c17fb3417626e28b912de5551869aa5531db7c01ac1a2 +size 14831 diff --git a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index dccaf6f8..c5c3b84e 100644 --- a/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c17d86a025ad188c350143ccafa0a0fd7905a3d667b212510999d38fe0045f92 -size 43745 +oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 +size 158206 diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.cpp b/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.cpp index bf2d8155..74142dc6 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.cpp @@ -3,6 +3,9 @@ #include "ConstructionVent.h" +#include "EndlessVendetta/EndlessVendettaCharacter.h" +#include "Kismet/GameplayStatics.h" + // Sets default values AConstructionVent::AConstructionVent() { @@ -11,22 +14,27 @@ AConstructionVent::AConstructionVent() } -// Called when the game starts or when spawned -void AConstructionVent::BeginPlay() -{ - Super::BeginPlay(); - -} - void AConstructionVent::Interact() { - UE_LOG(LogTemp, Warning, TEXT("Interacting with VENT...sus")); + APawn* PlayerPawn = GetWorld()->GetFirstPlayerController()->GetPawn(); + UInventoryComponent* PlayersInventory = Cast(PlayerPawn->GetComponentByClass(UInventoryComponent::StaticClass())); + if (PlayersInventory->HasItemByItemID(6971)) + { + Cast(GetGameInstance())->EnteredApartmentThroughVent = true; + for (auto Item : PlayersInventory->GetAllItems()) + { + if (Cast(Item.Key)->ItemID == 6971) + { + PlayersInventory->RemoveItem(Item.Key); + break; + } + } + EnterApartmentThroughVent(); + } + else + { + FailToEnterVent(); + } } -// Called every frame -void AConstructionVent::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); - -} diff --git a/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.h b/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.h index c8a241c2..ea03a5f0 100644 --- a/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.h +++ b/EndlessVendetta/Source/EndlessVendetta/BountySystem/Misc/ConstructionVent.h @@ -17,13 +17,13 @@ public: AConstructionVent(); protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; - void Interact() override; + UFUNCTION(BlueprintImplementableEvent) + void EnterApartmentThroughVent(); + public: - // Called every frame - virtual void Tick(float DeltaTime) override; + UFUNCTION(BlueprintImplementableEvent) + void FailToEnterVent(); }; diff --git a/EndlessVendetta/Source/EndlessVendetta/EVGameInstance.h b/EndlessVendetta/Source/EndlessVendetta/EVGameInstance.h index e85c443b..109bf04a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EVGameInstance.h +++ b/EndlessVendetta/Source/EndlessVendetta/EVGameInstance.h @@ -46,6 +46,9 @@ public: UFUNCTION(BlueprintCallable, Category = "DialogueFlags") bool HasDialogueFlag(EDialogueFlag Flag) const; + UPROPERTY(BlueprintReadOnly) + bool EnteredApartmentThroughVent = false; + protected: virtual void OnStart() override;