36 lines
1005 B
C++
36 lines
1005 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "SkillEffect_Heal.h"
|
|
|
|
#include "Chaos/Deformable/MuscleActivationConstraints.h"
|
|
#include "ProjectFish/PawnWithSkill.h"
|
|
#include "ProjectFish/Skill/Skill.h"
|
|
|
|
void USkillEffect_Heal::Execute(const FSkillContext& context)
|
|
{
|
|
Super::Execute(context);
|
|
TArray<UObject*> targets = context.SkillManager->GetTargetsBySelector(context.OwnerSkill, effectData.SkillSelecter);
|
|
for (auto target: targets)
|
|
{
|
|
if (!target->GetClass()->IsChildOf(APawnWithSkill::StaticClass()))
|
|
{
|
|
UE_LOG(LogTemp, Error, TEXT("skill %s apply target is not a pawn"), *(OwnerSkill->GetSkillName()));
|
|
}
|
|
else
|
|
{
|
|
//我方恢复耐力
|
|
if (target == OwnerSkill->GetOwner())
|
|
{
|
|
Cast<APawnWithSkill>(target)->ApplyyEndurance(effectData.EffectValue, OwnerSkill);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
FString USkillEffect_Heal::GetSkillEffectDes()
|
|
{
|
|
return FString::Printf(TEXT("对我方耐力造成 %d点恢复"), (int32)(effectData.EffectValue));
|
|
}
|