Merge remote-tracking branch 'origin/master'

This commit is contained in:
TjgL 2025-04-13 17:45:17 +02:00
commit 54f45ad961
7 changed files with 32 additions and 10 deletions

BIN
Content/Legumix/Spawner/CurveEnemyInWave.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Legumix/Spawner/CurveMaxEnemyInstantiate.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Legumix/Spawner/LVL_TestSpawn.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Spawner/WB_DebugWaveWidget.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -74,14 +74,14 @@ bool ALMSpawnPosition::IsPlayerVisible() const
void ALMSpawnPosition::StarCooldown()
{
IsOnCooldow = true;
UE_LOG(LogTemp, Warning, TEXT("Spawner Cooldown"));
//UE_LOG(LogTemp, Warning, TEXT("Spawner Cooldown"));
GetWorld()->GetTimerManager().SetTimer(ProcessCooldown, this, &ALMSpawnPosition::EndCooldown, TimerCooldown, false);
}
void ALMSpawnPosition::EndCooldown()
{
IsOnCooldow = false;
UE_LOG(LogTemp, Warning, TEXT("Spawner End Cooldown"));
//UE_LOG(LogTemp, Warning, TEXT("Spawner End Cooldown"));
}

View File

@ -18,7 +18,6 @@ ALMWaveManager::ALMWaveManager()
void ALMWaveManager::BeginPlay()
{
Super::BeginPlay();
StartWave();
SpawnPositionsList.Empty(); // Nettoie la liste avant de remplir
@ -30,6 +29,8 @@ void ALMWaveManager::BeginPlay()
SpawnPositionsList.Add(SpawnPos);
}
}
StartWave();
}
void ALMWaveManager::SpawnEnemy(ALMSpawnPosition* spawnPosition)
@ -114,9 +115,12 @@ void ALMWaveManager::GetRandomDataWaveRow()
CurrentWaveName = WaveName.ToString();
FLMWaveStructure* InfoWaveRow = WaveDatePreset->FindRow<FLMWaveStructure>(WaveName, "");
//Set le nombre d'ennemis dans la wave en fonction de la Row, de la courbe et du nombre de vague passée
EnemyNumberInWave = FMath::CeilToInt((InfoWaveRow->EnemyCount)* CurveForScalingEnemyInWave->GetFloatValue(WaveNumber));
EnemyNumberInWave = InfoWaveRow->EnemyCount;
MaxEnemyInstantiate = InfoWaveRow->MaxEnemyCount;
//Set le nombre d'ennemis max spawnés en fonction de la Row, de la courbe, et du nombre de vague passée
MaxEnemyInstantiate = FMath::CeilToInt((InfoWaveRow->MaxEnemyCount) * CurveForScalingMaxEnemyInstantiate->GetFloatValue(WaveNumber));
AllEnemyType.Empty();
for (const FLMEnemyRatio& EnemyRatio : InfoWaveRow->WaveComposition)
@ -175,18 +179,18 @@ void ALMWaveManager::Tick(float DeltaTime)
{
//lauch break time
// Lance un breaktime avant de relancer une wave
UE_LOG(LogTemp, Warning, TEXT("Start a new wave"));
OnCooldown = true;
GetWorld()->GetTimerManager().SetTimer(BreakTimer, this, &ALMWaveManager::StartWave, BreakTime, false);
}
}
}
void ALMWaveManager::StartWave()
{
UE_LOG(LogTemp, Warning, TEXT("Start a new wave"));
GetRandomDataWaveRow();
EnemySpawned = 0;
OnCooldown = false;
WaveNumber++;
}

View File

@ -35,7 +35,7 @@ public:
int MaxEnemyInstantiate; // Nombre d'ennemis max spawnés
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
float BreakTime; // Nombre d'ennemis dans la wave
float BreakTime;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
UDataTable* WaveDatePreset;
@ -48,6 +48,15 @@ public:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix")
TArray<int> EnemiesPerType;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Legumix")
int WaveNumber = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category="Legumix")
UCurveFloat* CurveForScalingEnemyInWave; // Nombre d'ennemis max spawnés
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category="Legumix")
UCurveFloat* CurveForScalingMaxEnemyInstantiate; // Nombre d'ennemis max spawnés
protected:
// Called when the game starts or when spawned