Compare commits
No commits in common. "e8cacbe1c7c553a0ae9573d8c1b7df9df19de7f9" and "83e44925bfda91057c8d89b5d01d9f0406f31fac" have entirely different histories.
e8cacbe1c7
...
83e44925bf
BIN
hwanyoung2/Content/Hwanyoung/Character/NPC/BP_NPCBase.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/NPC/BP_NPCBase.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/BP_Haesol.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/BP_Haesol.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_AutoPickUpSoul.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_AutoPickUpSoul.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/Player_HUD/WG_PlayerHUD.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/UI/Player_HUD/WG_PlayerHUD.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/D/H8/BNSHQ8HCXZSA1A5SPKL6PA.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/D/H8/BNSHQ8HCXZSA1A5SPKL6PA.uasset
(Stored with Git LFS)
Binary file not shown.
@ -1,44 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "HYAutomaticPickUp.h"
|
|
||||||
#include "HYPlayerCharacController.h"
|
|
||||||
|
|
||||||
// Sets default values
|
|
||||||
AHYAutomaticPickUp::AHYAutomaticPickUp()
|
|
||||||
{
|
|
||||||
// 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;
|
|
||||||
PickupMesh = CreateDefaultSubobject<UStaticMeshComponent>("PickupMesh");
|
|
||||||
RootComponent = Cast<USceneComponent>(PickupMesh);
|
|
||||||
|
|
||||||
ItemID = FName("No ID");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void AHYAutomaticPickUp::Collect_Implementation(APlayerController* Controller)
|
|
||||||
{
|
|
||||||
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(Controller);
|
|
||||||
if (IController->AddItemToInventoryByID(ItemID))
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
FName AHYAutomaticPickUp::GetItemID()
|
|
||||||
{
|
|
||||||
return ItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
|
||||||
void AHYAutomaticPickUp::BeginPlay()
|
|
||||||
{
|
|
||||||
Super::BeginPlay();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called every frame
|
|
||||||
void AHYAutomaticPickUp::Tick(float DeltaTime)
|
|
||||||
{
|
|
||||||
Super::Tick(DeltaTime);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "GameFramework/Actor.h"
|
|
||||||
#include "HYAutomaticPickUp.generated.h"
|
|
||||||
|
|
||||||
UCLASS()
|
|
||||||
class HWANYOUNG2_API AHYAutomaticPickUp : public AActor
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Sets default values for this actor's properties
|
|
||||||
AHYAutomaticPickUp();
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintNativeEvent)
|
|
||||||
void Collect(APlayerController* Controller);
|
|
||||||
virtual void Collect_Implementation(APlayerController* Controller);
|
|
||||||
|
|
||||||
FName GetItemID();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Called when the game starts or when spawned
|
|
||||||
virtual void BeginPlay() override;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
|
||||||
UStaticMeshComponent* PickupMesh;
|
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
FName ItemID;
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Called every frame
|
|
||||||
virtual void Tick(float DeltaTime) override;
|
|
||||||
|
|
||||||
};
|
|
@ -1,18 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "HYMoneyAutoPickUp.h"
|
|
||||||
#include "HYPlayerCharacController.h"
|
|
||||||
|
|
||||||
AHYMoneyAutoPickUp::AHYMoneyAutoPickUp()
|
|
||||||
{
|
|
||||||
Super::ItemID = FName("Lost soul");
|
|
||||||
Value = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AHYMoneyAutoPickUp::Collect_Implementation(APlayerController* Controller)
|
|
||||||
{
|
|
||||||
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(Controller);
|
|
||||||
IController->Currency += Value;
|
|
||||||
Destroy();
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "HYAutomaticPickUp.h"
|
|
||||||
#include "HYMoneyAutoPickUp.generated.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UCLASS()
|
|
||||||
class HWANYOUNG2_API AHYMoneyAutoPickUp : public AHYAutomaticPickUp
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
AHYMoneyAutoPickUp();
|
|
||||||
|
|
||||||
void Collect_Implementation(APlayerController* Controller) override;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
int32 Value;
|
|
||||||
|
|
||||||
};
|
|
@ -43,9 +43,6 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int32 InventoryWeightLimit;
|
int32 InventoryWeightLimit;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
int32 Currency;
|
|
||||||
|
|
||||||
//interacts with the Interactable objects
|
//interacts with the Interactable objects
|
||||||
UFUNCTION(BlueprintCallable, Category = "Utils")
|
UFUNCTION(BlueprintCallable, Category = "Utils")
|
||||||
void Interact();
|
void Interact();
|
||||||
|
@ -7,6 +7,5 @@ FInventoryItem::FInventoryItem()
|
|||||||
{
|
{
|
||||||
this->ItemName = FText::FromString("No Name");
|
this->ItemName = FText::FromString("No Name");
|
||||||
this->ItemWeight = 1;
|
this->ItemWeight = 1;
|
||||||
this->ItemValue = 1;
|
|
||||||
this->ItemDescription = FText::FromString("No Description");
|
this->ItemDescription = FText::FromString("No Description");
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,6 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int32 ItemWeight;
|
int32 ItemWeight;
|
||||||
|
|
||||||
//value of the item
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
int32 ItemValue;
|
|
||||||
|
|
||||||
//is the item only available through drops?
|
//is the item only available through drops?
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
bool OnlyDropped;
|
bool OnlyDropped;
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include "EnhancedInputSubsystems.h"
|
#include "EnhancedInputSubsystems.h"
|
||||||
#include "HYInteractableActor.h"
|
#include "HYInteractableActor.h"
|
||||||
#include "InventoryItem.h"
|
#include "InventoryItem.h"
|
||||||
#include "HYAutomaticPickUp.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -98,29 +97,12 @@ void Ahwanyoung2Character::CheckForInteractables()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ahwanyoung2Character::CollectAutoPickups()
|
|
||||||
{
|
|
||||||
// Stores all the overlapping actors in an array
|
|
||||||
TArray<AActor*> CollectedActors;
|
|
||||||
CollectionSphere->GetOverlappingActors(CollectedActors);
|
|
||||||
|
|
||||||
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(GetController());
|
|
||||||
|
|
||||||
for (int32 indCollect = 0; indCollect < CollectedActors.Num(); ++indCollect) {
|
|
||||||
AHYAutomaticPickUp* const Pickup = Cast<AHYAutomaticPickUp>(CollectedActors[indCollect]);
|
|
||||||
if (Pickup && !Pickup->IsPendingKill()) {
|
|
||||||
Pickup->Collect(IController);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Ahwanyoung2Character::Tick(float DeltaTime)
|
void Ahwanyoung2Character::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
CheckForInteractables();
|
CheckForInteractables();
|
||||||
CollectAutoPickups();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@ -219,10 +201,6 @@ void Ahwanyoung2Character::Initialize()
|
|||||||
|
|
||||||
// Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character)
|
// Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character)
|
||||||
// are set in the derived blueprint asset named ThirdPersonCharacter (to avoid direct content references in C++)
|
// are set in the derived blueprint asset named ThirdPersonCharacter (to avoid direct content references in C++)
|
||||||
|
|
||||||
CollectionSphere = CreateDefaultSubobject<USphereComponent>(TEXT("CollectionSphere"));
|
|
||||||
CollectionSphere->SetupAttachment(RootComponent);
|
|
||||||
CollectionSphere->SetSphereRadius(200.f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "InputAction.h"
|
#include "InputAction.h"
|
||||||
#include "hwanyoung2.h"
|
#include "hwanyoung2.h"
|
||||||
#include "Components/SphereComponent.h"
|
|
||||||
#include "hwanyoung2Character.generated.h"
|
#include "hwanyoung2Character.generated.h"
|
||||||
|
|
||||||
|
|
||||||
@ -104,8 +103,6 @@ protected:
|
|||||||
/** Called for checking for the closest Interactable in sight and in range*/
|
/** Called for checking for the closest Interactable in sight and in range*/
|
||||||
void CheckForInteractables();
|
void CheckForInteractables();
|
||||||
|
|
||||||
/** Called for collecting automatic pick-upable interactables*/
|
|
||||||
void CollectAutoPickups();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// APawn interface
|
// APawn interface
|
||||||
|
Loading…
x
Reference in New Issue
Block a user