2022-05-04 17:17:25 +00:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
#include "GameFramework/Actor.h"
|
2022-05-05 12:15:25 +00:00
|
|
|
#include "Particles/ParticleSystemComponent.h"
|
2022-05-04 17:17:25 +00:00
|
|
|
#include "Projectile.generated.h"
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
class BLASTER_API AProjectile : public AActor
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
AProjectile();
|
|
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void BeginPlay() override;
|
2022-05-20 16:12:50 +00:00
|
|
|
void StartDestroyTimer();
|
|
|
|
void DestroyTimerFinished();
|
|
|
|
void SpawnTrailSystem();
|
|
|
|
void ExplodeDamage();
|
2022-05-05 13:02:47 +00:00
|
|
|
|
|
|
|
UFUNCTION()
|
|
|
|
virtual void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
|
|
|
|
virtual void Destroyed() override;
|
2022-05-07 11:03:19 +00:00
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
float Damage = 20.f;
|
2022-05-04 17:17:25 +00:00
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
2022-05-18 17:20:18 +00:00
|
|
|
class UParticleSystem* ImpactParticles;
|
2022-05-05 10:59:50 +00:00
|
|
|
|
2022-05-18 17:20:18 +00:00
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
class USoundCue* ImpactSound;
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
class UBoxComponent* CollisionBox;
|
|
|
|
|
2022-05-05 10:59:50 +00:00
|
|
|
UPROPERTY(VisibleAnywhere)
|
|
|
|
class UProjectileMovementComponent* ProjectileMovementComponent;
|
2022-05-20 16:12:50 +00:00
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
class UNiagaraSystem* TrailSystem;
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
class UNiagaraComponent* TrailSystemComponent;
|
|
|
|
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
|
|
|
UStaticMeshComponent* ProjectileMesh;
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
float DamageInnerRadius = 200.f;
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
float DamageOuterRadius = 500.f;
|
2022-05-19 09:10:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2022-05-05 12:15:25 +00:00
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
class UParticleSystem* Tracer;
|
|
|
|
|
2022-05-09 15:16:41 +00:00
|
|
|
UPROPERTY()
|
2022-05-05 12:15:25 +00:00
|
|
|
class UParticleSystemComponent* TracerComponent;
|
2022-05-20 16:12:50 +00:00
|
|
|
|
|
|
|
FTimerHandle DestroyTimer;
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
float DestroyTime = 3.f;
|
2022-05-04 17:17:25 +00:00
|
|
|
};
|