You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.8 KiB
66 lines
1.8 KiB
2 years ago
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include "CoreMinimal.h"
|
||
|
#include "Ability.h"
|
||
2 years ago
|
#include "Explosion.h"
|
||
2 years ago
|
#include "Components/SphereComponent.h"
|
||
|
#include "GameFramework/Actor.h"
|
||
|
#include "GameFramework/ProjectileMovementComponent.h"
|
||
2 years ago
|
#include "Projectile.generated.h"
|
||
2 years ago
|
|
||
|
UCLASS()
|
||
2 years ago
|
class TURNBASEDTUTORIAL_API AProjectile : public AActor {
|
||
2 years ago
|
GENERATED_BODY()
|
||
|
|
||
|
public:
|
||
2 years ago
|
AProjectile();
|
||
2 years ago
|
|
||
2 years ago
|
void Initialize(const UAbility *Ability,
|
||
|
uint8 playerIndex,
|
||
|
float PathLength);
|
||
2 years ago
|
|
||
|
void Shoot(FVector From, FVector To) const;
|
||
|
|
||
|
protected:
|
||
2 years ago
|
virtual void NotifyActorBeginOverlap(AActor *OtherActor) override;
|
||
2 years ago
|
|
||
2 years ago
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||
2 years ago
|
TSubclassOf<AExplosion> ExplosionSubclass;
|
||
2 years ago
|
|
||
2 years ago
|
// virtual void NotifyHit(UPrimitiveComponent *MyComp,
|
||
|
// AActor *Other,
|
||
|
// UPrimitiveComponent *OtherComp,
|
||
|
// bool bSelfMoved,
|
||
|
// FVector HitLocation,
|
||
|
// FVector HitNormal,
|
||
|
// FVector NormalImpulse,
|
||
|
// const FHitResult &Hit) override;
|
||
2 years ago
|
|
||
2 years ago
|
UPROPERTY(Replicated)
|
||
|
float Damage;
|
||
|
|
||
|
UPROPERTY(Replicated)
|
||
2 years ago
|
int8 PlayerIndex = -1;
|
||
|
|
||
2 years ago
|
UPROPERTY(Replicated)
|
||
|
float SplashRadius;
|
||
|
|
||
2 years ago
|
// UPROPERTY(EditAnywhere, Replicated)
|
||
2 years ago
|
// USphereComponent *CollisionComponent;
|
||
|
|
||
2 years ago
|
UPROPERTY(EditAnywhere, Replicated)
|
||
2 years ago
|
UStaticMeshComponent *ProjectileMeshComponent;
|
||
|
|
||
2 years ago
|
UPROPERTY(VisibleAnywhere, Replicated)
|
||
2 years ago
|
UProjectileMovementComponent *ProjectileMovementComponent;
|
||
2 years ago
|
|
||
2 years ago
|
virtual void BeginPlay() override;
|
||
2 years ago
|
|
||
|
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
||
|
|
||
|
UFUNCTION(Server, Reliable)
|
||
|
void Explode() const;
|
||
2 years ago
|
};
|