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;
};