blaster/Source/Blaster/Pickups/HealthPickup.cpp

25 lines
484 B
C++
Raw Normal View History

2022-05-22 21:48:23 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "HealthPickup.h"
#include "Blaster/Character/BlasterCharacter.h"
2022-05-22 22:16:27 +00:00
#include "Blaster/Components/BuffComponent.h"
2022-05-22 21:48:23 +00:00
AHealthPickup::AHealthPickup()
{
bReplicates = true;
}
2022-05-23 21:45:28 +00:00
void AHealthPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
2022-05-22 21:48:23 +00:00
{
2022-05-23 21:45:28 +00:00
Super::OnOverlap(BlasterCharacter);
2022-05-22 21:48:23 +00:00
2022-05-23 21:45:28 +00:00
if (UBuffComponent* Buff = BlasterCharacter->GetBuff())
2022-05-22 21:48:23 +00:00
{
2022-05-23 21:45:28 +00:00
Buff->Heal(HealAmount, HealingTime);
2022-05-22 21:48:23 +00:00
}
Destroy();
}