blaster/Source/Blaster/GameMode/BlasterGameMode.h

56 lines
1.4 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blaster/PlayerState/BlasterPlayerState.h"
#include "GameFramework/GameMode.h"
#include "BlasterGameMode.generated.h"
namespace MatchState
{
extern BLASTER_API const FName Cooldown; // Match duration has been reached. Display winner and begin cooldown timer
}
/**
*
*/
UCLASS()
class BLASTER_API ABlasterGameMode : public AGameMode
{
GENERATED_BODY()
public:
ABlasterGameMode();
virtual void Tick(float DeltaTime) override;
virtual void PlayerEliminated(class ABlasterCharacter* EliminatedCharacter, class ABlasterPlayerController* VictimController,
class ABlasterPlayerController* AttackerController);
virtual void RequestRespawn(ACharacter* EliminatedCharacter, AController* EliminatedController);
void PlayerLeftGame(ABlasterPlayerState* PlayerLeaving);
virtual float CalculateDamage(AController* Attacker, AController* Victim, float BaseDamage);
UPROPERTY(EditDefaultsOnly)
float WarmupTime = 10.f;
UPROPERTY(EditDefaultsOnly)
float MatchTime = 120.f;
UPROPERTY(EditDefaultsOnly)
float CooldownTime = 10.f;
float LevelStartingTime = 0.f;
bool bTeamsMatch = false;
protected:
virtual void BeginPlay() override;
virtual void OnMatchStateSet() override;
private:
float CountdownTime = 0.f;
public:
FORCEINLINE float GetCountdownTime() const { return CountdownTime; }
};