added test city, added embarrassment loss resolver and sleep for energy loss
This commit is contained in:
@@ -10,12 +10,15 @@
|
||||
#include "LossPresentationConfig.h"
|
||||
#include "MovieSceneSequencePlaybackSettings.h"
|
||||
#include "NakedDesireGameInstance.h"
|
||||
#include "TimeOfDaySubsystem.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "GameFramework/PlayerStart.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "NakedDesire/Clothing/ClothingItemInstance.h"
|
||||
#include "NakedDesire/Interactables/ItemPickup.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
#include "NakedDesire/Stats/StatsManager.h"
|
||||
#include "NakedDesire/SaveGame/GlobalSaveGameData.h"
|
||||
#include "NakedDesire/SaveGame/SaveSubsystem.h"
|
||||
|
||||
@@ -58,15 +61,21 @@ void USessionLossResolver::ResolveLoss(ESessionLossCause Cause)
|
||||
|
||||
case ESessionLossCause::EmbarrassmentMax:
|
||||
// Fade to apartment with no extra cost — no time skip, money, or rep hit.
|
||||
LoseAllWorldClothing();
|
||||
break;
|
||||
|
||||
case ESessionLossCause::EnergyZero:
|
||||
// Forced sleep cycle: everything left outside the apartment is guaranteed lost.
|
||||
LoseAllWorldClothing();
|
||||
if (UTimeOfDaySubsystem* Time = GetWorld()->GetSubsystem<UTimeOfDaySubsystem>())
|
||||
{
|
||||
Time->Sleep();
|
||||
}
|
||||
ResolveSleepLoss();
|
||||
break;
|
||||
|
||||
case ESessionLossCause::PoliceCapture:
|
||||
{
|
||||
LoseAllWorldClothing();
|
||||
UGlobalSaveGameData* Save = GetSave();
|
||||
if (Save && Save->Money >= PoliceCaptureMoneyPenalty)
|
||||
{
|
||||
@@ -246,6 +255,15 @@ void USessionLossResolver::TeleportPlayerHome()
|
||||
Movement->StopMovementImmediately();
|
||||
}
|
||||
}
|
||||
|
||||
// A new day starts at home: clear embarrassment and refill energy / stamina (§4.4).
|
||||
if (const ANakedDesireCharacter* Character = Cast<ANakedDesireCharacter>(PlayerPawn))
|
||||
{
|
||||
if (UStatsManager* Stats = Character->StatsManager)
|
||||
{
|
||||
Stats->ResetStats();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void USessionLossResolver::Autosave() const
|
||||
|
||||
Reference in New Issue
Block a user