This commit is contained in:
koritsa
2026-05-17 22:44:49 +03:00
commit 0d90a0b02a
9071 changed files with 44364 additions and 0 deletions
@@ -0,0 +1,70 @@
// © 2025 Naked People Team. All Rights Reserved.
#include "NakedDesireGameMode.h"
#include "Kismet/GameplayStatics.h"
#include "NakedDesire/Clothing/ClothingItemData.h"
#include "UObject/ConstructorHelpers.h"
#include "NakedDesire/Interactables/Wardrobe.h"
#include "NakedDesire/MissionBuilder/MissionsConfig.h"
#include "NakedDesire/MissionBuilder/MissionsManager.h"
#include "NakedDesire/Player/NakedDesireCharacter.h"
void ANakedDesireGameMode::RestartGame()
{
UGameplayStatics::OpenLevel(this, "City");
}
AWardrobe* ANakedDesireGameMode::GetWardrobe() const
{
return Wardrobe;
}
void ANakedDesireGameMode::BuyItem(UClothingItemData* ClothingItem)
{
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
if (!Player)
{
return;
}
if (Player->Money < ClothingItem->Info->BasePrice)
{
return;
}
Player->Money -= ClothingItem->Info->BasePrice;
Wardrobe->ClothingItems.Add(ClothingItem);
}
void ANakedDesireGameMode::OnHourChanged(int32 Hour)
{
if (Hour == 4)
{
DaysPassed++;
RefreshDailyMissions();
}
}
void ANakedDesireGameMode::BeginPlay()
{
Super::BeginPlay();
if (AActor* FoundActor = UGameplayStatics::GetActorOfClass(GetWorld(), AWardrobe::StaticClass()))
{
if (AWardrobe* WardrobeActor = Cast<AWardrobe>(FoundActor))
{
Wardrobe = WardrobeActor;
}
}
}
void ANakedDesireGameMode::RefreshDailyMissions()
{
ANakedDesireCharacter* Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
if (!Player)
{
return;
}
Player->MissionsManager->RefreshDailyMissions(MissionsConfig->DailyMissions[DaysPassed].Missions);
}