blaster/Source/Blaster/Pickups/ShieldPickup.cpp

20 lines
457 B
C++
Raw Normal View History

2022-05-23 10:35:20 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "ShieldPickup.h"
#include "Blaster/Character/BlasterCharacter.h"
#include "Blaster/Components/BuffComponent.h"
2022-05-23 21:45:28 +00:00
void AShieldPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
2022-05-23 10:35:20 +00:00
{
2022-05-23 21:45:28 +00:00
Super::OnOverlap(BlasterCharacter);
2022-05-23 10:35:20 +00:00
2022-05-23 21:45:28 +00:00
if (UBuffComponent* Buff = BlasterCharacter->GetBuff())
2022-05-23 10:35:20 +00:00
{
2022-05-23 21:45:28 +00:00
Buff->ReplenishShield(ShieldReplenishAmount, ShieldReplenishTime);
2022-05-23 10:35:20 +00:00
}
Destroy();
}