Bazaar new minigame which replaces old minigame

This commit is contained in:
2026-08-23 15:44:18 +02:00
parent 4c1f6eab70
commit 5cc22eccf7
16 changed files with 102 additions and 62 deletions

View File

@@ -3,23 +3,9 @@
#include "BazarSettingsDataAsset.h"
void UBazarSettingsDataAsset::GetModifiersFromEmotionData(const FBazarDialogueEmotionData& InData, int32& OutAnger,
int32& OutFear, int32& OutSadness)
void UBazarSettingsDataAsset::PostLoad()
{
for (const FBazarEmotionModifier& Mod : InData.EmotionModifiers)
{
switch (Mod.Emotion)
{
case EBazarNpcEmotion::Anger:
OutAnger = FMath::RandRange(Mod.ValueMin, Mod.ValueMax);
break;
case EBazarNpcEmotion::Fear:
OutFear = FMath::RandRange(Mod.ValueMin, Mod.ValueMax);
break;
case EBazarNpcEmotion::Sadness:
OutSadness = FMath::RandRange(Mod.ValueMin, Mod.ValueMax);
break;
default: ;
}
}
Super::PostLoad();
}

View File

@@ -9,10 +9,11 @@
UENUM(BlueprintType)
enum class EBazarNpcEmotion: uint8
{
None,
Anger,
Fear,
Sadness,
Trust,
Excitement,
Comfort,
Pride,
Curiosity,
MAX UMETA(Hidden)
};
@@ -41,10 +42,38 @@ struct FBazarDialogueEmotionData
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<FBazarEmotionModifier> EmotionModifiers;
UPROPERTY(BlueprintReadOnly, VisibleAnywhere)
FString EmotionsData;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FText DialogueText;
};
USTRUCT(BlueprintType)
struct FBazaarHaggleCardData
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText CardName;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FText CardDescription;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 TrustModifier;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 ExcitementModifier;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 ComfortModifier;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 PrideModifier;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 CuriosityModifier;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (UIMin = "0", ClampMin = "0", UIMax = "20", ClampMax = "20"))
int32 CardDifficulty;
};
/**
*
*/
@@ -53,9 +82,19 @@ class PROJECTELERI_API UBazarSettingsDataAsset : public UDataAsset
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar|Tresholds")
int32 HappyThreshold = 50;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar|Tresholds")
int32 EmotionLowerThreshold = 65;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar|Tresholds")
int32 EmotionUpperThreshold = 80;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar")
TArray<FBazarDialogueEmotionData> AvailableDialogueEmotionData;
UFUNCTION(BlueprintPure, Category = "Eleri|Bazaar")
static void GetModifiersFromEmotionData(const FBazarDialogueEmotionData& InData, int32& OutAnger, int32& OutFear, int32& OutSadness);
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Eleri|Bazaar")
TArray<FBazaarHaggleCardData> HaggleCards;
virtual void PostLoad() override;
};

View File

@@ -99,11 +99,8 @@ void UDialogueComponent::TriggerDialogue(USpeechDataAsset* DialogueAssetPath, co
bDialogueSelectOpen = false;
}
if (!DialogueWidget)
{
DialogueWidget = Cast<UDialogueWidget>(EleriPlayerController->ToggleDialogueWindow(true));
DialogueWidget->AssignDialogueComponent(this);
}
DialogueWidget = Cast<UDialogueWidget>(EleriPlayerController->ToggleDialogueWindow(true));
DialogueWidget->AssignDialogueComponent(this);
CurrentLineIndex = 0;
CurrentActiveDialogue = DialogueAssetPath;

View File

@@ -127,8 +127,9 @@ public:
FSoftClassPath DecorationActorClassPath;
/** Base cost of the item that's used to form buying and selling prices */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info", AssetRegistrySearchable, meta = (AssetBundles = "Inventory, Book"))
// Base cost of the item that's used to form buying and selling prices
// EDIT IT THE CSV
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Info", AssetRegistrySearchable, meta = (AssetBundles = "Inventory, Book"))
int32 BaseCost;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Info", AssetRegistrySearchable, meta = (AssetBundles = "Inventory, Book"))
@@ -188,8 +189,9 @@ public:
int32 ProfessionLevelNeeded;
/** The item element describes what type of crystal goes into creating
a potion of the same element type*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
a potion of the same element type
EDIT IN CSV*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
Element ItemElement;
/** The chemical alignment of item, coresponds to a clock */
@@ -199,8 +201,10 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Craftable")
EChemicalAlignment ChemicalAlignment;
/** What are the main properties of the ingredient/potion */
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
/** What are the main properties of the ingredient/potion
* EDIT IN CSV
*/
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
TArray<FPropertyStrength> Properties;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
@@ -210,8 +214,10 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
TArray<FPropertyStrength> Defects;
/*Item effectiveness is it's ability to effect the body in various ways, 1 being least effective and 4 most effective*/
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
/*Item effectiveness is it's ability to effect the body in various ways, 1 being least effective and 4 most effective
* EDIT IN CSV
*/
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Craftable", AssetRegistrySearchable, meta = (AssetBundles = "Book"))
int32 Effectiveness;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Craftable", meta = (ClampMin = 1.f, ClampMax = 2.f, UIMin = 1.f, UIMax = 2.f, Delta = 0.01f))