diff --git a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset index 0dd24e5c..7ef7061c 100644 --- a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset +++ b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6065036467869db48ba82a74683865211bec52bf097df53242e119578a4cfd05 -size 818746 +oid sha256:196a2282e82285bd5c43d69aae50dc601226dd9cc5efd1b7814b706c6b922aed +size 814841 diff --git a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/BP_Haesol.uasset b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/BP_Haesol.uasset index 3eb61fe8..4d7967f6 100644 --- a/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/BP_Haesol.uasset +++ b/hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/BP_Haesol.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c678612f2498f50d8013a3c07cd9546687b6e7efcb1080f61375fc04ea89996 -size 1961137 +oid sha256:6d3b570e88adbc7b1a94f640dfbbad399a12f05d1fc94a36b0a564a2949f9574 +size 1962851 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Shop_HUD/BP_ShopHUDWidget.uasset b/hwanyoung2/Content/Hwanyoung/UI/Shop_HUD/BP_ShopHUDWidget.uasset new file mode 100644 index 00000000..1db9640e --- /dev/null +++ b/hwanyoung2/Content/Hwanyoung/UI/Shop_HUD/BP_ShopHUDWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f73adf0dfbc4de768cd998562562902137e12517b643e93d25fb1980a19cd66c +size 341387 diff --git a/hwanyoung2/Content/Hwanyoung/UI/Shop_HUD/BP_ShopItemSlot.uasset b/hwanyoung2/Content/Hwanyoung/UI/Shop_HUD/BP_ShopItemSlot.uasset new file mode 100644 index 00000000..0391c624 --- /dev/null +++ b/hwanyoung2/Content/Hwanyoung/UI/Shop_HUD/BP_ShopItemSlot.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73f76e255e87affcce953559529133bd4e35c1cd676accfb7e6826ba4ff057bb +size 120389 diff --git a/hwanyoung2/Content/IdaFaber/Meshes/Boy/SKEL_UE5_M.uasset b/hwanyoung2/Content/IdaFaber/Meshes/Boy/SKEL_UE5_M.uasset index 42fc52b9..14900556 100644 --- a/hwanyoung2/Content/IdaFaber/Meshes/Boy/SKEL_UE5_M.uasset +++ b/hwanyoung2/Content/IdaFaber/Meshes/Boy/SKEL_UE5_M.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c38a4cccfd641cb72f804c796198763ee708563d52187acea6476256b43464e -size 204927 +oid sha256:bb8be79ef01cf0115c5ba4d9335903d027f616a0ba6c2d8ee7e5fe9da581e224 +size 205243 diff --git a/hwanyoung2/Content/KTP_Effect/Particles/Bottom/Bottom01-04.uasset b/hwanyoung2/Content/KTP_Effect/Particles/Bottom/Bottom01-04.uasset index f17f7ded..5dd0fc2e 100644 --- a/hwanyoung2/Content/KTP_Effect/Particles/Bottom/Bottom01-04.uasset +++ b/hwanyoung2/Content/KTP_Effect/Particles/Bottom/Bottom01-04.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c747953382353b46333722122e7b1a92601629482d8405cbfd323d4450dc75a2 -size 5911510 +oid sha256:68c3808fb2a91be4d9496349289dd5013c2b8ac6087b2a5cc65cea3e508fbd2a +size 3538793 diff --git a/hwanyoung2/Intermediate/Build/SourceFileCache.bin b/hwanyoung2/Intermediate/Build/SourceFileCache.bin index ed52f6f5..206bf341 100644 Binary files a/hwanyoung2/Intermediate/Build/SourceFileCache.bin and b/hwanyoung2/Intermediate/Build/SourceFileCache.bin differ diff --git a/hwanyoung2/Intermediate/ReimportCache/3688439234.bin b/hwanyoung2/Intermediate/ReimportCache/3688439234.bin index 4a048347..47317651 100644 Binary files a/hwanyoung2/Intermediate/ReimportCache/3688439234.bin and b/hwanyoung2/Intermediate/ReimportCache/3688439234.bin differ diff --git a/hwanyoung2/Source/hwanyoung2/HYInteractableActor.h b/hwanyoung2/Source/hwanyoung2/HYInteractableActor.h index 6add37fb..abbf2a07 100644 --- a/hwanyoung2/Source/hwanyoung2/HYInteractableActor.h +++ b/hwanyoung2/Source/hwanyoung2/HYInteractableActor.h @@ -31,7 +31,7 @@ public: FText Action; UFUNCTION(BlueprintCallable, Category = "Pickup") - FText GetInteractText() const; + virtual FText GetInteractText() const; protected: // Called when the game starts or when spawned diff --git a/hwanyoung2/Source/hwanyoung2/HYShopAOE.cpp b/hwanyoung2/Source/hwanyoung2/HYShopAOE.cpp new file mode 100644 index 00000000..e6618736 --- /dev/null +++ b/hwanyoung2/Source/hwanyoung2/HYShopAOE.cpp @@ -0,0 +1,88 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "HYShopAOE.h" +#include "HYGameStateBase.h" +#include "Engine/DataTable.h" + +// Sets default values +AHYShopAOE::AHYShopAOE() +{ + // 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 AHYShopAOE::BeginPlay() +{ + Super::BeginPlay(); + +} + +// Called every frame +void AHYShopAOE::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + +bool AHYShopAOE::RandomizeTradableItemSets(int CurrentHonbaekAmount) +{ + AHYGameStateBase* GameState = Cast(GetWorld()->GetGameState()); + + if(GameState == nullptr) + { + return false; + } + + UDataTable* ItemDataTable = GameState->GetItemDatabase(); + + if (ItemDataTable == nullptr) + { + return false; + } + + TArray ItemData; + ItemDataTable->GetAllRows("", ItemData); + + if (ItemData.Num() == 0) + { + return false; + } + + TArray FilteredItemData = ItemData.FilterByPredicate([CurrentHonbaekAmount](const FInventoryItem* ItemDataRow) + { + return ItemDataRow->ItemValue <= CurrentHonbaekAmount; + }); + + int maxLoopNum = FMath::Min(5, FilteredItemData.Num()); + + for (int i = 0; i < maxLoopNum; ++i) + { + int RandomIdx = FMath::RandRange(0, FilteredItemData.Num() - 1); + + FinalItemSets.Add(*FilteredItemData[RandomIdx]); + FilteredItemData.RemoveAt(RandomIdx); + } + + if (FinalItemSets.Num() == maxLoopNum) + { + return true; + } + + return false; +} + +void AHYShopAOE::GetTradableItemSets(TMap& Item) +{ + TArray TempItems = FinalItemSets.Array(); + + for (FInventoryItem TempItem : TempItems) + { + int Amount = FMath::RandRange(0, 100); + + Item.Add({ TempItem, Amount }); + } + + return; +} \ No newline at end of file diff --git a/hwanyoung2/Source/hwanyoung2/HYShopAOE.h b/hwanyoung2/Source/hwanyoung2/HYShopAOE.h new file mode 100644 index 00000000..f7a76f86 --- /dev/null +++ b/hwanyoung2/Source/hwanyoung2/HYShopAOE.h @@ -0,0 +1,39 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "InventoryItem.h" +#include "HYShopAOE.generated.h" + +UCLASS() +class HWANYOUNG2_API AHYShopAOE : public AActor +{ + GENERATED_BODY() + +public: + // Sets default values for this actor's properties + AHYShopAOE(); + +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void Tick(float DeltaTime) override; + + // Called When Begin Overlapped Event. + UFUNCTION(BlueprintCallable) + virtual bool RandomizeTradableItemSets(int CurrentHonbaekAmount); + + // @param Item is NPC Actor's Array. + // Make random amount of the tradable items set. + UFUNCTION(BlueprintCallable) + void GetTradableItemSets(TMap& Item); + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Data") + TSet FinalItemSets; +}; \ No newline at end of file diff --git a/hwanyoung2/Source/hwanyoung2/HYShopNPCActor.cpp b/hwanyoung2/Source/hwanyoung2/HYShopNPCActor.cpp new file mode 100644 index 00000000..afe1da76 --- /dev/null +++ b/hwanyoung2/Source/hwanyoung2/HYShopNPCActor.cpp @@ -0,0 +1,8 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "HYShopNPCActor.h" + +void AHYShopNPCActor::Interact_Implementation(APlayerController* Controller) +{ + +} \ No newline at end of file diff --git a/hwanyoung2/Source/hwanyoung2/HYShopNPCActor.h b/hwanyoung2/Source/hwanyoung2/HYShopNPCActor.h new file mode 100644 index 00000000..2865b006 --- /dev/null +++ b/hwanyoung2/Source/hwanyoung2/HYShopNPCActor.h @@ -0,0 +1,24 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "HYInteractableActor.h" +#include "InventoryItem.h" +#include "HYShopNPCActor.generated.h" + +/** + * + */ +UCLASS() +class HWANYOUNG2_API AHYShopNPCActor : public AHYInteractableActor +{ + GENERATED_BODY() + + virtual void Interact_Implementation(APlayerController* Controller); + +public: + UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) + TMap TradableItems; + +};