5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "HitscanWeaponComponent.generated.h"
13UCLASS(ClassGroup=(
Custom), meta=(BlueprintSpawnableComponent))
14class WEAPONSYSTEM_API UHitscanWeaponComponent :
public UActorComponent
19 UHitscanWeaponComponent();
21 virtual FHitResult ServerShoot(const
float Accuracy, const FVector& MuzzleLocation, const
float GunRange, const FVector& BulletSpread, const FVector& TraceLocation, const FRotator& TraceRotation);
22 virtual
bool ServerShoot_Validate();
24 virtual
void SetMuzzle(USceneComponent* Muzzle){MuzzlePoint = Muzzle;};
26 bool GetIsTraceToClose(
const FVector& MuzzleLocation,
const FVector& HitLocation,
const FRotator& TraceRotation)
const;
28 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Weapon|Hit Scan|Debugging")
29 bool bDebuggingMode = false;
30 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon|
Hit Scan|Debugging")
31 float DrawDebugTime = 2.0f;
32 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon|
Hit Scan|Debugging")
33 float DrawDebugColorDarkMultiplier = 0.1f;
34 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon|
Hit Scan|Debugging")
35 float DrawDebugColorLightMultiplier = 2.0f;
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon|
Hit Scan|Debugging")
37 float DrawDebugPointSize = 16.0f;
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon|
Hit Scan|Debugging")
39 FLinearColor MainTraceColor = FLinearColor(0.9f, 0.1f, 0.1f);
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon|
Hit Scan|Debugging")
41 FLinearColor BlindFireTraceColor = FLinearColor(0.1f, 0.9f, 0.1f);
43 UPROPERTY(EditAnywhere, Category = "Weapon|
Hit Scan|Trace")
44 bool bTraceComplex = false;
45 UPROPERTY(EditAnywhere, Category = "Weapon|
Hit Scan|Trace")
46 bool bReturnPhysicalMaterial = false;
47 UPROPERTY(EditAnywhere, Category = "Weapon|
Hit Scan|Trace")
48 float TraceDistanceTooClose = 0.075f;
51 virtual
void BeginPlay() override;
53 virtual
bool LineTrace(const
float GunRange, const FVector& BulletSpread, const FVector& TraceLocation, const FRotator& TraceRotation, FHitResult&
Hit, FVector& ShotDirection, const FLinearColor& Color = FLinearColor::Green, const FVector& CustomLineEnd = FVector::ZeroVector) const;
54 virtual FHitResult BlindFireWeaponTrace(const
float GunRange, const FVector& BulletSpread, const FVector& TraceLocation,
55 const FRotator& TraceRotation, const
float Accuracy, const AActor* ActorToIgnore =
nullptr);
57 virtual
float CalculateDistanceDamage(const
FWeaponStats_T& WeaponStats, const
float Distance) const;
60 void LogDebugMessage(const FString& Message, const
bool bError = false) const;
63 const USceneComponent* MuzzlePoint =
nullptr;
66 const AActor* TraceActorToIgnore =
nullptr;
68 TArray<AActor*> ActorsToIgnore;
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
DECLARE_LOG_CATEGORY_EXTERN(LogWeaponHitScan, Display, All)
Represents statistics for a weapon.
Definition WeaponStructs.h:622