Compare commits
No commits in common. "25f8adc0a89a027c2543d419f10c6e980f23a105" and "59c715af325d126454b7646147a938772c46ebcd" have entirely different histories.
25f8adc0a8
...
59c715af32
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -17,8 +17,7 @@ enum class ESkillEffectType: uint8
|
||||
Charge UMETA(DisplayName = "充能", ToolTip = "使技能的冷却进度加快"),
|
||||
ModifySpeed UMETA(DisplayName = "速度修改", ToolTip = "使技能冷却进度倍率进展 持续指定时间"),
|
||||
SkillEnduranceRestore UMETA(DisplayName = "技能耐久度恢复", ToolTip = "使技能耐久度恢复"),
|
||||
EnhanceFishRod UMETA(DisplayName = "增强鱼竿", ToolTip = "使鱼竿上海增加"),
|
||||
EnhanceSkill UMETA(DisplayName = "增强技能", ToolTip = "增强指定的技能数值")
|
||||
EnHanceFishRod UMETA(DisplayName = "增强鱼竿", ToolTip = "使鱼竿上海增加"),
|
||||
};
|
||||
|
||||
//技能对象类型
|
||||
@ -135,7 +134,7 @@ struct FSkillData: public FTableRowBase
|
||||
int32 Endurance;
|
||||
|
||||
//被动技能属性
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ToolTip = "被动技能触发器,没有配置的话为光环类技能默认进行触发", AllowedClasses = "SkillTrigger", EditConditionHides, EditCondition = "!bActiveSkill"))
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ToolTip = "技能CD速度", AllowedClasses = "SkillTrigger", EditConditionHides, EditCondition = "!bActiveSkill"))
|
||||
TSubclassOf<class USkillTrigger> SkillTrigger;
|
||||
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "SkillEffects/SkillEffect_Charge.h"
|
||||
#include "SkillEffects/SkillEffect_Damage.h"
|
||||
#include "SkillEffects/SkillEffect_EnhanceFishRod.h"
|
||||
#include "SkillEffects/SkillEffect_EnhanceSkill.h"
|
||||
#include "SkillEffects/SkillEffect_Heal.h"
|
||||
#include "SkillEffects/SkillEffect_ModifyCD.h"
|
||||
#include "SkillEffects/SkillEffect_ModifySpeed.h"
|
||||
@ -44,12 +43,9 @@ void USkill::InitSkill(APawnWithSkill* owner, USkillManager* skillManager, FSkil
|
||||
case ESkillEffectType::SkillEnduranceRestore:
|
||||
skillEffect = NewObject<USkillEffect>(this, USkillEffect_SER::StaticClass());
|
||||
break;
|
||||
case ESkillEffectType::EnhanceFishRod:
|
||||
case ESkillEffectType::EnHanceFishRod:
|
||||
skillEffect = NewObject<USkillEffect>(this, USkillEffect_EnhanceFishRod::StaticClass());
|
||||
break;
|
||||
case ESkillEffectType::EnhanceSkill:
|
||||
skillEffect = NewObject<USkillEffect>(this, USkillEffect_EnhanceSkill::StaticClass());
|
||||
break;
|
||||
default:
|
||||
const UEnum* EnumPtr = StaticEnum<ESkillEffectType>();
|
||||
UE_LOG(LogTemp, Error, TEXT("没有配置 %s类型的Skill Effect"), *EnumPtr->GetNameStringByValue(static_cast<int64>(effectData.EffectType)))
|
||||
@ -67,9 +63,10 @@ void USkill::InitSkillTrigger()
|
||||
{
|
||||
if (!SkillData.bActiveSkill)
|
||||
{
|
||||
if (SkillData.SkillTrigger)
|
||||
{
|
||||
|
||||
USkillTrigger* SkillTrigger = NewObject<USkillTrigger>(this, SkillData.SkillTrigger);
|
||||
if (SkillTrigger)
|
||||
{
|
||||
FSkillContext context;
|
||||
context.OwnerSkill = this;
|
||||
context.SkillManager = SkillManager;
|
||||
|
@ -28,11 +28,6 @@ public:
|
||||
class APawnWithSkill* GetOwner();
|
||||
|
||||
FSkillData& GetSkillData();
|
||||
TArray<USkillEffect*> GetAllSkillEffects()
|
||||
{
|
||||
return SkillEffects;
|
||||
}
|
||||
|
||||
FIntPoint GetBagPos();
|
||||
void SetSkillData( FSkillData SkillData);
|
||||
UFUNCTION(BlueprintCallable)
|
||||
|
@ -23,10 +23,7 @@ public:
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
virtual FString GetSkillEffectDes();
|
||||
FSkillEffectData& GetEffectData()
|
||||
{
|
||||
return effectData;
|
||||
}
|
||||
|
||||
private:
|
||||
void GetEffectTargetsByTargetType(const FSkillContext& context, TArray<UObject*>& result);
|
||||
protected:
|
||||
|
@ -9,26 +9,12 @@
|
||||
void USkillEffect_EnhanceFishRod::Execute(const FSkillContext& context)
|
||||
{
|
||||
Super::Execute(context);
|
||||
TArray<UObject*> targets = GetApplyTargets(context);
|
||||
for (auto target: targets)
|
||||
{
|
||||
if (!target->GetClass()->IsChildOf(APawnWithSkill::StaticClass()))
|
||||
{
|
||||
UE_LOG(LogTemp, Error, TEXT("skill %s apply target is not a pawn with fish rod"), *(OwnerSkill->GetSkillName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
//修改技能的冷却时间
|
||||
APawnWithSkill* OwnerPawn = Cast<APawnWithSkill>(target);
|
||||
APawnWithSkill* OwnerPawn = context.OwnerSkill->GetOwner();
|
||||
if (OwnerPawn->GetComponentByClass(UFishingRodComponent::StaticClass()) != NULL)
|
||||
{
|
||||
UFishingRodComponent* rod = Cast<UFishingRodComponent>(OwnerPawn->GetComponentByClass(UFishingRodComponent::StaticClass()));
|
||||
rod->AddFishRodDamage( (int32)(effectData.EffectValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "SkillEffect_EnhanceSkill.h"
|
||||
#include "ProjectFish/Skill/Skill.h"
|
||||
|
||||
void USkillEffect_EnhanceSkill::Execute(const FSkillContext& context)
|
||||
{
|
||||
Super::Execute(context);
|
||||
TArray<UObject*> targets = GetApplyTargets(context);
|
||||
for (auto target: targets)
|
||||
{
|
||||
if (!target->GetClass()->IsChildOf(USkill::StaticClass()))
|
||||
{
|
||||
UE_LOG(LogTemp, Error, TEXT("skill %s apply target is not a skill"), *(OwnerSkill->GetSkillName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
//修改技能的冷却时间
|
||||
USkill* targetSkill = Cast<USkill>(target);
|
||||
for (auto skilleffect: targetSkill->GetAllSkillEffects())
|
||||
{
|
||||
skilleffect->GetEffectData().EffectValue +=(int32)(effectData.EffectValue)*(skilleffect->GetEffectData().EffectValue/FMath::Abs(skilleffect->GetEffectData().EffectValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FString USkillEffect_EnhanceSkill::GetSkillEffectDes()
|
||||
{
|
||||
return FString::Printf(TEXT("增强目标技能 %d点"), (int32)(effectData.EffectValue));
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ProjectFish/Skill/SkillEffect.h"
|
||||
#include "SkillEffect_EnhanceSkill.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class PROJECTFISH_API USkillEffect_EnhanceSkill : public USkillEffect
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
void Execute(const FSkillContext& context) override;
|
||||
FString GetSkillEffectDes() override;
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user