Space Plunder
Loading...
Searching...
No Matches
HealthData.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Data/BaseData.h"
7#include "HealthData.generated.h"
8
9DECLARE_LOG_CATEGORY_EXTERN(LogHealthSystem, Display, All);
10
11static int32 DebugHealthStats = 0;
12
13
14
15UENUM(Blueprintable, BlueprintType)
16enum class EPhysicalBodyStrength : uint8
17{
18 Strong,
19 Mid,
20 Weak,
22};
23
24USTRUCT(BlueprintType)
26{
27 GENERATED_BODY()
28
29 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Health")
31 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Health")
32 TArray<FName> Bones;
33 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Health")
34 float BodyPartHealth = 100.0f;
35 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Health")
36 bool bInjured = false;
37
38 bool operator==(const FBodyPart& Other) const
39 {
40 return BodyPartName == Other.BodyPartName;
41 }
42
44 {
45
46 }
47 FBodyPart(const EBodyPartName Name, const TArray<FName>& IncludedBones, const float Health, const bool Injured)
48 {
49 BodyPartName = Name;
50 Bones = IncludedBones;
51 BodyPartHealth = Health;
52 bInjured = Injured;
53 }
54};
55
56
57//@todo a struct to send all Health data to a HUD
58// USTRUCT(BlueprintType)
59// struct FHealthDebugData
60// {
61// GENERATED_BODY()
62//
63// float Health;
64// float MaxHealth;
65// bool bHasShield;
66// float ShieldHealth;
67// float MaxShieldHealth;
68//
69// bool bIsKnockedOut;
70// float KnockOutHealth;
71// float KnockOutMaxHealth;
72//
73//
74//
75// };
76//
EBodyPartName
Definition BaseData.h:133
static int32 DebugHealthStats
Definition HealthData.h:11
DECLARE_LOG_CATEGORY_EXTERN(LogHealthSystem, Display, All)
EPhysicalBodyStrength
Definition HealthData.h:17
Definition Health.Build.cs:6
Definition HealthData.h:26
FBodyPart(const EBodyPartName Name, const TArray< FName > &IncludedBones, const float Health, const bool Injured)
Definition HealthData.h:47
FBodyPart()
Definition HealthData.h:43
EBodyPartName BodyPartName
Definition HealthData.h:30