lmfao
This commit is contained in:
parent
eeaf691a1a
commit
cf526110b3
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_DragDropCraftOperation.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_DragDropCraftOperation.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Interactables/ItemDataTable.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Interactables/ItemDataTable.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CookingHUDWidget.uasset
(Stored with Git LFS)
Normal file
BIN
hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CookingHUDWidget.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingHUDWidget.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingHUDWidget.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingItemSlot.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/UI/Crafting_HUD/BP_CraftingItemSlot.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/Images/HUD_cooking.uasset
(Stored with Git LFS)
Normal file
BIN
hwanyoung2/Content/Hwanyoung/UI/Images/HUD_cooking.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/Images/HUD_crafting.uasset
(Stored with Git LFS)
Normal file
BIN
hwanyoung2/Content/Hwanyoung/UI/Images/HUD_crafting.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
hwanyoung2/Content/NewPreviewMeshCollection.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/NewPreviewMeshCollection.uasset
(Stored with Git LFS)
Binary file not shown.
@ -18,7 +18,18 @@ public:
|
||||
|
||||
//unique ID of item that is being used to create the item
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FName ComponentID;
|
||||
FName ItemAID;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FName ItemBID;
|
||||
|
||||
//unique ID of item that is being used to create the item
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FName ItemCID;
|
||||
|
||||
//unique ID of item that is being used to create the item
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FName ItemDID;
|
||||
|
||||
//unique ID of the item that gets created
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
@ -28,12 +39,20 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bDestroyItemA;
|
||||
|
||||
//
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bDestroyItemB;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bDestroyItemC;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bDestroyItemD;
|
||||
|
||||
bool operator==(const FCraftingInfo& OtherItem) const {
|
||||
return ComponentID == OtherItem.ComponentID;
|
||||
return ItemAID == OtherItem.ItemAID
|
||||
&& ItemBID == OtherItem.ItemBID
|
||||
&& ItemCID == OtherItem.ItemCID
|
||||
&& ItemDID == OtherItem.ItemDID;
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,13 +39,18 @@ bool AHYPlayerCharacController::AddItemToInventoryByID(FName ID)
|
||||
return false;
|
||||
}
|
||||
|
||||
void AHYPlayerCharacController::CraftItem(FInventoryItem ItemA, FInventoryItem ItemB)
|
||||
void AHYPlayerCharacController::CraftItem(FInventoryItem ItemA, FInventoryItem ItemB, FInventoryItem ItemC, FInventoryItem ItemD)
|
||||
{
|
||||
for (auto Pair : ItemB.CraftCombinations) {
|
||||
if (Pair.ComponentID == ItemA.ItemID) {
|
||||
if (Pair.bDestroyItemA) Inventory.RemoveSingle(ItemA);
|
||||
if (Pair.bDestroyItemB) Inventory.RemoveSingle(ItemB);
|
||||
AddItemToInventoryByID(Pair.ProductID);
|
||||
for (auto Combination : ItemB.CraftCombinations) {
|
||||
if (Combination.ItemAID == ItemA.ItemID
|
||||
&& Combination.ItemBID == ItemB.ItemID
|
||||
&& Combination.ItemCID == ItemC.ItemID
|
||||
&& Combination.ItemDID == ItemD.ItemID) {
|
||||
if (Combination.bDestroyItemA) Inventory.RemoveSingle(ItemA);
|
||||
if (Combination.bDestroyItemB) Inventory.RemoveSingle(ItemB);
|
||||
if (Combination.bDestroyItemC) Inventory.RemoveSingle(ItemC);
|
||||
if (Combination.bDestroyItemD) Inventory.RemoveSingle(ItemD);
|
||||
AddItemToInventoryByID(Combination.ProductID);
|
||||
ReloadCraftUI();
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
bool AddItemToInventoryByID(FName ID);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Utils")
|
||||
void CraftItem(FInventoryItem ItemA, FInventoryItem ItemB);
|
||||
void CraftItem(FInventoryItem ItemA, FInventoryItem ItemB, FInventoryItem ItemC, FInventoryItem ItemD);
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
||||
class AHYInteractableActor* CurrentInteractable;
|
||||
|
Loading…
Reference in New Issue
Block a user