324f062cc7
Added ammo base functionality for using the ammo item in game
76 lines
2.0 KiB
C++
76 lines
2.0 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/Object.h"
|
|
#include "BaseItem.generated.h"
|
|
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS(Abstract, BlueprintType, Blueprintable, EditInlineNew, DefaultToInstanced)
|
|
class THE_TWILIGHT_ABYSS_API UBaseItem : public UObject
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UBaseItem();
|
|
|
|
virtual class UWorld* GetWorld() const { return World; };
|
|
|
|
UPROPERTY(Transient)
|
|
class UWorld* World;
|
|
|
|
//The text that will be displayed for using the item (Equip, Eat)
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
|
FText ItemUseAction;
|
|
|
|
//The actual mesh of the item
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
|
class UStaticMesh* ItemMesh;
|
|
|
|
//The picture of the item icon
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
|
class UTexture2D* ItemIcon;
|
|
|
|
//The name of the item
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
|
FText ItemDisplayName;
|
|
|
|
//The description of the item
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
|
FText ItemDescription;
|
|
|
|
//The cost of the item
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Item")
|
|
int ItemCostPrice;
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Item")
|
|
bool isHealingItem;
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Item")
|
|
bool isDamageBuffItem;
|
|
|
|
UPROPERTY(EditAnywhere, Category = "Item")
|
|
bool isAmmoItemType;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item")
|
|
int32 StackCount = 1;
|
|
|
|
//reference to the UInventoryComponent script
|
|
UPROPERTY(EditAnywhere, Category = "Item")
|
|
class UInventoryComponent* StoredItems;
|
|
|
|
//The buy class to purchase the item
|
|
virtual void Buy(class ATempCharacter* PurchaseItem) PURE_VIRTUAL(UBaseItem); // WILL SET THIS UP LATER
|
|
|
|
//The use Item class to use the item in the player Inventory
|
|
virtual void Use(class ATempCharacter* Character);
|
|
|
|
//This is the same as the use item class but its in BP instead
|
|
UFUNCTION(BlueprintImplementableEvent)
|
|
void OnUse(class ATempCharacter* Character);
|
|
};
|