#include <BTD_LowHealth.h>
◆ UBTD_LowHealth()
| UBTD_LowHealth::UBTD_LowHealth |
( |
| ) |
|
9{
10 NodeName = TEXT("Check Low Health");
11}
◆ CalculateRawConditionValue()
| bool UBTD_LowHealth::CalculateRawConditionValue |
( |
UBehaviorTreeComponent & | OwnerComp, |
|
|
uint8 * | NodeMemory ) const |
|
overrideprotectedvirtual |
37{
38 if(OwnerComp.GetAIOwner() == nullptr || OwnerComp.GetAIOwner()->GetPawn() == nullptr){return false;}
39 const ICharacterBaseInterface* BaseCharacter = Cast<ICharacterBaseInterface>(OwnerComp.GetAIOwner()->GetPawn());
40 if(BaseCharacter != nullptr)
41 {
43 float MaxHealth = 0.0f;
45 if(bSuccess)
46 {
48 {
49 const float HealthPercent = (
Health / MaxHealth) * 100.0f;
51 }
53 }
54 }
55 return false;
56}
Definition Health.Build.cs:6
Definition CustomCharacter.h:19
virtual bool GetCharacterHealth(float &Health, float &MaxHealth) const =0
bool bUseHealthPercent
Definition BTD_LowHealth.h:33
float LowHealthPercent
Definition BTD_LowHealth.h:35
float LowHealthAmount
Definition BTD_LowHealth.h:31
◆ GetStaticDescription()
| FString UBTD_LowHealth::GetStaticDescription |
( |
| ) |
const |
|
overrideprotectedvirtual |
14{
15 FString Description;
16 Description += FString::Printf(TEXT("\nTrigger when Health is Below: "));
18 {
19 const FString Percent = "%";
20 Description += FString::Printf(TEXT(
"\n%2.f %s"),
LowHealthPercent, *Percent);
21 }
22 else
23 {
25 }
26 return Description;
27}
◆ bUseHealthPercent
| bool UBTD_LowHealth::bUseHealthPercent = true |
|
protected |
◆ LowHealthAmount
| float UBTD_LowHealth::LowHealthAmount = 20.0f |
|
protected |
◆ LowHealthPercent
| float UBTD_LowHealth::LowHealthPercent = 20.0f |
|
protected |
The documentation for this class was generated from the following files:
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/AIToolKit/Source/AIToolKit/Public/Behavior/Decotators/BTD_LowHealth.h
- T:/Unreal/Unreal Projects/SpaceAdventure52/SpaceAdventure/Plugins/AIToolKit/Source/AIToolKit/Private/Behavior/Decotators/BTD_LowHealth.cpp