blaster/Source/Blaster/Components/BuffComponent.h

38 lines
813 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "BuffComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BLASTER_API UBuffComponent : public UActorComponent
{
GENERATED_BODY()
public:
UBuffComponent();
friend class ABlasterCharacter;
void Heal(float HealAmount, float HealingTime);
protected:
virtual void BeginPlay() override;
void HealRampUp(float DeltaTime);
private:
UPROPERTY()
class ABlasterCharacter* Character;
bool bHealing = false;
float HealingRate = 0;
float AmountToHeal = 0.f;
public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
};