presidents-brigade/Source/PresidentsBrigade/PlayerPawn.h
2022-11-12 14:33:50 -08:00

86 lines
1.8 KiB
C++
Executable File

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "BasePawn.h"
#include "PlayerPawn.generated.h"
class UCameraComponent;
/**
*
*/
UCLASS()
class PRESIDENTSBRIGADE_API APlayerPawn : public ABasePawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
APlayerPawn(const FObjectInitializer &object_initializer);
virtual void Tick(float delta_time) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
protected:
virtual void destroy_self() override;
UPROPERTY(EditAnywhere, Category="Player")
UCameraComponent* main_camera;
/**
* Time in seconds before respawn.
*/
UPROPERTY(EditAnywhere, Category = "Player")
float respawn_s;
/**
* Multiplier to apply to current speed while boosting. Applies to max speed and accleration.
*/
UPROPERTY(EditAnywhere, Category = "Movement")
float boost_multiplier;
/**
* Time in seconds before auto resetting boost.
*/
UPROPERTY(EditAnywhere, Category = "Movement")
float reset_threshold_s;
/**
* Time in seconds before allowed to boost again.
*/
UPROPERTY(EditAnywhere, Category = "Movement")
float cooldown_threshold_s;
private:
void boost();
void reset_boost();
void respawn();
/**
* Default max speed. Cached when boost is called.
*/
float default_max_speed;
/**
* Default max acceleration. Cached when boost is called.
*/
float default_max_accel;
/**
* Time waited for boost reset.
*/
float reset_wait_s;
/**
* Time waited for cooldown.
*/
float cooldown_wait_s;
/**
* Time waiting for respawn.
*/
float respawn_wait_s;
};