Fix embarrassment gain/decay not tied to NPC observation state

This commit is contained in:
2026-05-18 22:47:33 +03:00
parent a04b892fe9
commit 2c78e1660e
4 changed files with 66 additions and 7 deletions
+16 -1
View File
@@ -24,7 +24,22 @@ void UStatsManager::TickComponent(float DeltaTime, enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
DecreaseEnergy(0.9f);
DecreaseEmbarrassment(1.0f);
if (ObserverCount > 0)
{
// TODO (#05): replace 0.0f with ClothingManager->GetEffectiveCoverage() when that lands.
constexpr float CoverageWeight = 0.0f;
IncreaseEmbarrassment(EmbarrassmentGainRate * (1.0f - CoverageWeight) * DeltaTime);
}
else
{
DecreaseEmbarrassment(EmbarrassmentDecayRate * DeltaTime);
}
}
void UStatsManager::SetObserved(const bool bObserved, const float CoverageWeight)
{
ObserverCount = FMath::Max(0, bObserved ? ObserverCount + 1 : ObserverCount - 1);
}
void UStatsManager::IncreaseEmbarrassment(const float Amount)