Files
ProjectEleri/Source/ProjectEleri/Items/ItemContainer.h

277 lines
7.4 KiB
C
Raw Normal View History

2026-07-11 10:43:52 +02:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "PaperSprite.h"
#include "Engine/DataTable.h"
#include "ItemContainer.generated.h"
UENUM(BlueprintType)
enum class Geography : uint8 {
Central,
South,
East,
North,
West
};
UENUM(BlueprintType)
enum class Category : uint8 {
Seed,
Item,
Potion,
Tea,
Plant,
Key,
Food,
Decoration,
Other,
Special,
MAX UMETA(Hidden)
};
UENUM(BlueprintType)
enum class ItemProperty : uint8 {
Heal,
Poison,
Cleanse,
Curse,
Enhance
};
UENUM(BlueprintType)
enum class EChemicalAlignment : uint8
{
None,
};
UENUM(BlueprintType)
enum class Element : uint8 {
Light,
Dark,
Fire,
Water,
Air,
Earth
};
UENUM(BlueprintType)
enum class BaseType : uint8 {
Ground,
Pot,
Wine,
Tree
};
USTRUCT(BlueprintType)
struct FItemDatabaseRow : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Heal;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Poison;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Cleanse;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Curse;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Enhance;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString Element;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 Cost;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float Effectiveness;
};
USTRUCT(BlueprintType)
struct FSeedStage {
GENERATED_USTRUCT_BODY()
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TSoftObjectPtr<UStaticMesh> Mesh;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TSoftObjectPtr<UPaperSprite> Sprite;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
float SpriteScale;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
FVector MeshOffset;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
FVector MeshScale;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
int32 ChangeOnDay;
FSeedStage()
{
Mesh = nullptr;
MeshOffset = FVector::ZeroVector;
MeshScale = FVector::OneVector;
ChangeOnDay = 0;
SpriteScale = 1.f;
}
};
USTRUCT(BlueprintType)
struct FItemBase {
GENERATED_USTRUCT_BODY()
/** ID of the item, generated by hand, usually Name + number */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
FName ItemID;
/** Default name of the item */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
FName ItemName;
/** Profession level needed to harvest the plant in case of an ingredient
and profession level needed to have a chance of HQ potion in the case of potions*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ingredient")
int32 ProfessionLevelNeeded;
/** Description of the item that's in the inventory view nad quick overview */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info", meta = (MultiLine = true))
FName ItemDescription;
/** Description levels unlocked by leveling the ingredient or potion level,
since all of them have 2-3 levels there should only ever be that amount
of items in the array*/
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Ingredient", meta = (MultiLine = true))
TArray<FName> ItemDescriptionLevels;
/** What part of the world grants faster growth and higher chance to harvest an HQ ingredient */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
Geography ItemGeography;
/** Category the item belongs to */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
Category ItemCategory;
/** The item element describes what type of crystal goes into creating
a potion of the same element type*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
Element ItemElement;
/** The chemical alignment of item, coresponds to a clock */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
TArray<int32> ChemicalAlignments;
/** What are the main properties of the ingredient/potion */
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Ingredient")
TArray<ItemProperty> Properties;
/** What defects does a certain ingredient have */
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Ingredient")
TArray<ItemProperty> Defects;
/** What base will the seed spawn when planting initiates */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
BaseType TypeOfBase;
/** Icon of the item */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
UTexture2D* ItemImage;
/** Sprite of the item */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
UPaperSprite* ItemSprite;
/** Does the item stack or only one can be present at a time (all seeds should stack) */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
bool Stackable = true;
/** Mesh that the item / potion have, ignored for seeds */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
UStaticMesh* ItemMesh;
/** Base cost of the item that's used to form buying and selling prices */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info")
int32 BaseCost;
/** Effectivness of the potion or ingredient that determines how strong the crafted potion is */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ingredient")
int32 Effectiveness;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ingredient")
int32 DefectStrength;
/** Does a potion have a fixed recipe? */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Potion")
bool HasRecipe;
/** Array of item ids that are required to craft the potion if it has a fixed recipe */
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Potion")
TArray<FName> RecipeItemsID;
/** Does this ingredient have a seed? Ignored in potions */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
bool IsSeed;
/** What is the base cost of the seed for this ingredient, ignored in potions */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
int32 SeedCost;
/** Grow time for a seed, if the seed is a tree or wine this is the growth for them */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
int32 GrowTimeSelf;
/** Only used on seeds that have wines or trees, after GrowTimeSelf has been reached
this is the amount of days that it takes for the plant to grow it's produce*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
int32 GrowTimeProduct;
/** Stages of a plant, set a mesh for certain days */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
TArray<FSeedStage> SeedStages;
/** In case of wine or tree this mesh will be used to display the produce that has beed grown
every GrowTimeProduct days*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
UStaticMesh* ProduceGrownMesh;
/** In case of wine or tree this mesh will be used to display the produce that has beed grown
every GrowTimeProduct days*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Seed")
UPaperSprite* ProduceGrownSprite;
/** What is the prefered temperature in alchemy that the ingredient releases it's
properties in the most effective way*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ingredient")
int32 PreferedTemperature;
};
/**
*
*/
UCLASS()
class PROJECTELERI_API UItemContainer : public UDataAsset
{
GENERATED_BODY()
public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TArray<FItemBase> AllItems;
};