Compare commits

..

No commits in common. "acc57e2874bc1ae51f4468229412c14c7cd76d61" and "7f84d384b94577f91fae2a7c2d1e2d440c415c78" have entirely different histories.

60 changed files with 191 additions and 2552 deletions

View File

@ -2,7 +2,7 @@
"BuildId": "37670630",
"Modules":
{
"ProjectFish": "UnrealEditor-ProjectFish.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll"
"ProjectFish": "UnrealEditor-ProjectFish-0001.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0001.dll"
}
}

View File

@ -95,7 +95,6 @@ ManualIPAddress=
[CoreRedirects]
+ClassRedirects=(OldName="/Script/ProjectFish.Skill_Pull",NewName="/Script/ProjectFish.SkillEffect_Damage")
+ClassRedirects=(OldName="/Script/ProjectFish.SkillEffect_Pull",NewName="/Script/ProjectFish.SkillEffect_Damage")
+ClassRedirects=(OldName="/Script/ProjectFish.PlayerInventorySubsystem",NewName="/Script/ProjectFish.FishingRodConfigSubsystem")
[/Script/Engine.CollisionProfile]
-Profiles=(Name="NoCollision",CollisionEnabled=NoCollision,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="No collision",bCanModify=False)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARasovog_002Easm_002Fl_003AC_0021_003FUsers_003F99714_003FAppData_003FLocal_003FTemp_003FSandboxFiles_003FMiqowul_003FRasovog_002Easm/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATuniqep_002Easm_002Fl_003AC_0021_003FUsers_003F99714_003FAppData_003FLocal_003FTemp_003FSandboxFiles_003FKasafil_003FTuniqep_002Easm/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003AEditor_002Fd_003AUnrealEd_002Fd_003APrivate_002Fd_003AKismet2_002Ff_003AKismetDebugUtilities_002Ecpp/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AAssetRegistry_002Ff_003AAssetData_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003AEditor_002Fd_003APropertyEditor_002Fd_003APublic_002Ff_003APropertyCustomizationHelpers_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AUObject_002Ff_003AUObjectBaseUtility_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
@ -10,17 +8,4 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACore_002Fd_003APublic_002Fd_003ADelegates_002Ff_003ADelegate_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACore_002Fd_003APublic_002Fd_003AMath_002Ff_003AUnrealMathUtility_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACore_002Fd_003APublic_002Fd_003AMisc_002Ff_003AGuid_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACore_002Fd_003APublic_002Fd_003AMisc_002Ff_003AMTAccessDetector_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACore_002Fd_003APublic_002Fd_003ATasks_002Ff_003ATaskPrivate_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APrivate_002Fd_003AUObject_002Ff_003AClass_002Ecpp/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APrivate_002Fd_003AUObject_002Ff_003AGarbageCollection_002Ecpp/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APrivate_002Fd_003AUObject_002Ff_003AUObjectArray_002Ecpp/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AUObject_002Ff_003AObjectHandle_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AUObject_002Ff_003AObjectPtr_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AUObject_002Ff_003AUnrealType_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AUObject_002Ff_003AUObjectArray_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACoreUObject_002Fd_003APublic_002Fd_003AUObject_002Ff_003AUObjectBase_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003APrivate_002Ff_003AUnrealEngine_002Ecpp/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ASlate_002Fd_003APrivate_002Fd_003AFramework_002Fd_003AApplication_002Ff_003ASlateApplication_002Ecpp/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ASlate_002Fd_003APublic_002Fd_003AFramework_002Fd_003AApplication_002Ff_003ASlateApplication_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ASlate_002Fd_003APublic_002Fd_003AWidgets_002Fd_003ALayout_002Ff_003ASBorder_002Eh/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=72263A5F_002DD5F9_002D3915_002D8DA0_002DCD45C38A70E5_002Fdl_003ASource_003AF_0021_003FEpic_003FUE_005F5_002E5_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003ACore_002Fd_003APublic_002Fd_003AMisc_002Ff_003AMTAccessDetector_002Eh/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

View File

@ -6,8 +6,6 @@
#include "EngineUtils.h"
#include "ProjectFish/Definations.h"
#include "ProjectFish/PawnWithSkill.h"
#include "ProjectFish/DataAsset/BagConfigAsset.h"
#include "ProjectFish/Subsystem/FishingRodConfigSubsystem.h"
// Sets default values for this component's properties
@ -73,14 +71,8 @@ void UFishingRodComponent::BeginPlay()
});
}
//更新鱼竿槽位配置
UWorld* World = GetWorld();
UGameInstance* GameInstance = World->GetGameInstance();
if (IsValid( GameInstance->GetSubsystem<UFishingRodConfigSubsystem>()->GetFishingRodInventory()))
FishRodData.BagConfig = GameInstance->GetSubsystem<UFishingRodConfigSubsystem>()->GetFishingRodInventory();
// ...
Super::BeginPlay();
}

View File

@ -28,19 +28,7 @@ bool UBagConfigAsset::RemoveSkill(int32 SkillIndex)
return true;
}
void UBagConfigAsset::RemoveSkillAsset(class USkillAsset* SkillAsset)
{
for (int32 i = 0; i < PlacedSkills.Num(); i++)
{
if (PlacedSkills[i].SkillAsset == SkillAsset)
{
PlacedSkills.RemoveAt(i);
break;
}
}
}
bool UBagConfigAsset::CanPlaceSkill(USkillAsset* SkillObject, int32 PositionX, int32 PositionY, bool IgnoreSelf ) const
bool UBagConfigAsset::CanPlaceSkill(USkillAsset* SkillObject, int32 PositionX, int32 PositionY) const
{
if (!SkillObject || !BagShapeAsset)
{
@ -52,7 +40,7 @@ bool UBagConfigAsset::CanPlaceSkill(USkillAsset* SkillObject, int32 PositionX, i
return false;
}
if (CheckSkillOverlap(SkillObject, PositionX, PositionY, IgnoreSelf))
if (CheckSkillOverlap(SkillObject, PositionX, PositionY))
{
return false;
}
@ -77,7 +65,7 @@ void UBagConfigAsset::ClearAllSkills()
PlacedSkills.Empty();
}
bool UBagConfigAsset::CheckSkillOverlap(USkillAsset* SkillObject, int32 PositionX, int32 PositionY, bool IgnoreSelf ) const
bool UBagConfigAsset::CheckSkillOverlap(USkillAsset* SkillObject, int32 PositionX, int32 PositionY) const
{
if (!SkillObject)
{
@ -92,15 +80,13 @@ bool UBagConfigAsset::CheckSkillOverlap(USkillAsset* SkillObject, int32 Position
{
continue;
}
// 检查矩形重叠
if (!(PositionX >= ExistingSkill.PositionX + GetSkillSizeValue(ExistingSkill.SkillAsset->SkillSize).X ||
PositionX + GetSkillSizeValue(SkillObject->SkillSize).X <= ExistingSkill.PositionX ||
PositionY >= ExistingSkill.PositionY + GetSkillSizeValue(ExistingSkill.SkillAsset->SkillSize).Y ||
PositionY + GetSkillSizeValue(SkillObject->SkillSize).Y <= ExistingSkill.PositionY))
{
if (IgnoreSelf && ExistingSkill.SkillAsset == SkillObject)
continue;
else
return true; // 有重叠
}
}

View File

@ -79,12 +79,10 @@ public:
// 移除技能
UFUNCTION(BlueprintCallable, Category = "BagConfig")
bool RemoveSkill(int32 SkillIndex);
UFUNCTION(BlueprintCallable, Category = "BagConfig")
void RemoveSkillAsset(class USkillAsset* SkillAsset);
// 检查技能是否可以放置在指定位置
UFUNCTION(BlueprintCallable, Category = "BagConfig")
bool CanPlaceSkill(USkillAsset* SkillObject, int32 PositionX, int32 PositionY, bool IgnoreSelf = false) const;
bool CanPlaceSkill(USkillAsset* SkillObject, int32 PositionX, int32 PositionY) const;
// 获取指定位置的技能索引
UFUNCTION(BlueprintCallable, Category = "BagConfig")
@ -100,7 +98,7 @@ public:
private:
// 检查技能之间是否有重叠
bool CheckSkillOverlap(USkillAsset* SkillObject, int32 PositionX, int32 PositionY, bool IgnoreSelf = false) const;
bool CheckSkillOverlap(USkillAsset* SkillObject, int32 PositionX, int32 PositionY) const;
// 检查技能是否在背包形状范围内
bool IsSkillWithinBagShape(USkillAsset* SkillObject, int32 PositionX, int32 PositionY) const;

View File

@ -10,12 +10,6 @@ USkillAsset::USkillAsset()
SkillID = FGuid::NewGuid();
}
FIntPoint USkillAsset::GetSkillSize()
{
return GetSkillSizeValue(SkillSize);
}
#if WITH_EDITOR
void USkillAsset::PostInitProperties()
{

View File

@ -18,8 +18,7 @@ class PROJECTFISH_API USkillAsset : public UDataAsset
GENERATED_BODY()
public:
USkillAsset();
UFUNCTION(BlueprintPure)
FIntPoint GetSkillSize();
#if WITH_EDITOR
virtual void PostInitProperties() override;
#endif
@ -29,9 +28,6 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ToolTip = "技能名称"))
FText SkillName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ToolTip = "技能描述"))
FText SkillDescription;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ToolTip = "技能分类Tag"))
TArray<ESkillType> SkillTypes;

View File

@ -107,12 +107,6 @@ protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputAction* FishingAction;
/*** Invenroty ***/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Inventory, meta = (AllowPrivateAccess = "true", ToolTip = "玩家背包携带的技能"))
class UBagConfigAsset* DefaultPlayerBag;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Inventory, meta = (AllowPrivateAccess = "true", ToolTip = "鱼竿装备槽形状"))
class UBagShapeAsset* FishingRodShape;
private:

View File

@ -115,16 +115,11 @@ void USkill::InitSkillTrigger()
bool USkill::SkillTickAble()
{
//剩余次数无限制 或者 剩余次数大于0次并且拥有者没有被韧性眩晕
return (RemainingEndurance == -1 || RemainingEndurance >= 0 )
//剩余次数无限制或者拥有者没有被韧性眩晕
return (RemainingEndurance >0 || RemainingEndurance == -1 )
&& Owner->CurrentTenacity > 0 && SkillData->triggerType == ESkillTriggerType::ActiveSkill;
}
bool USkill::SkillExecuteAble()
{
return (RemainingEndurance == -1 || RemainingEndurance > 0 ) && RemainingTime <= 0;
}
FIntPoint USkill::GetSkillSize()
{
return GetSkillSizeValue(SkillData->SkillSize);
@ -133,25 +128,21 @@ FIntPoint USkill::GetSkillSize()
void USkill::TickSkill(float deltaTime)
{
if (SkillTickAble())
{
RemainingTime -= deltaTime * SkillData->Speed;
RemainingTime = FMath::Max(RemainingTime, 0);
}
if (SkillExecuteAble() )
if (RemainingTime <= 0 )
{
ExecuteSkill();
}
// if (RemainingEndurance == 0)
// {
// FSkillContext context;
// context.OwnerSkill = this;
// context.SkillManager = SkillManager;
// for (auto Effect: SkillEffects)
// {
// Effect->EffectEnded(context);
// }
// }
if (RemainingEndurance == 0)
{
FSkillContext context;
context.OwnerSkill = this;
context.SkillManager = SkillManager;
for (auto Effect: SkillEffects)
{
Effect->EffectEnded(context);
}
}
}
void USkill::ExecuteSkill()

View File

@ -53,9 +53,6 @@ public:
UFUNCTION(BlueprintPure)
bool SkillTickAble();
UFUNCTION(BlueprintPure)
bool SkillExecuteAble();
UFUNCTION(BlueprintPure)
FIntPoint GetSkillSize();

View File

@ -45,10 +45,133 @@ void USkillEffect::Cancel(const FSkillContext& context)
{
}
// void USkillEffect::EffectEnded(const FSkillContext& context)
// {
// }
void USkillEffect::EffectEnded(const FSkillContext& context)
{
}
// TArray<UObject*> USkillEffect::GetApplyTargets(const FSkillContext& context)
// {
// TArray<UObject*> result;
// switch (effectData.SkillSelecter.SelecterType)
// {
// case EEffectTargetType::Target:
// {
// //目标是敌人
// result.Add(context.SkillManager->GetEnemyPawn(OwnerSkill->GetOwner()));
// break;;
// }
// case EEffectTargetType::Self:
// {
// //目标是敌人
// result.Add(OwnerSkill->GetOwner());
// break;;
// }
// case EEffectTargetType::TargetSkill:
// {
// TArray<USkill*> Skills = context.SkillManager->GetSkillsByOwner(context.SkillManager->GetEnemyPawn(OwnerSkill->GetOwner()));
// if (effectData.SkillSelecter.bAll)
// {
// result.Append(Skills);
// }
// else
// {
// int TargetNum = FMath::Min(effectData.SkillSelecter.MaxEffectTargetNum, Skills.Num());
// for (int i = 0; i < TargetNum; i++)
// {
// int randomIndex = FMath::RandRange(0, Skills.Num() - 1);
// result.Add(Skills[randomIndex]);
// Skills.RemoveAt(randomIndex);
// }
// }
// break;;
// }
// case EEffectTargetType::SelfSkill:
// {
// TArray<USkill*> Skills = context.SkillManager->GetSkillsByOwner(OwnerSkill->GetOwner());
// if (effectData.SkillSelecter.bAll)
// {
// result.Append(Skills);
// }
// else
// {
// int TargetNum = FMath::Min(effectData.SkillSelecter.MaxEffectTargetNum, Skills.Num());
// for (int i = 0; i < TargetNum; i++)
// {
// int randomIndex = FMath::RandRange(0, Skills.Num() - 1);
// result.Add(Skills[randomIndex]);
// Skills.RemoveAt(randomIndex);
// }
// }
// break;;
// }
// case EEffectTargetType::AroundSkill:
// {
// TArray<USkill*> aroundSkills = context.SkillManager->GetSkillsAround(context.OwnerSkill);
// for (auto skill: aroundSkills)
// {
// result.Add(skill);
// }
// break;
// }
// case EEffectTargetType::SelfSkillType:
// {
// //筛选指定类型的技能
// TArray<USkill*> Skills = context.SkillManager->GetSkillsByOwner(OwnerSkill->GetOwner());
// for (int i = Skills.Num() - 1; i >= 0; i--)
// {
// if (!Skills[i]->GetSkillData()->SkillTypes.Contains(effectData.SkillSelecter.SkillType))
// {
// Skills.RemoveAt(i);
// }
// }
//
// if (effectData.SkillSelecter.bAll)
// {
// result.Append(Skills);
// }
// else
// {
// int TargetNum = FMath::Min(effectData.SkillSelecter.MaxEffectTargetNum, Skills.Num());
// for (int i = 0; i < TargetNum; i++)
// {
// int randomIndex = FMath::RandRange(0, Skills.Num() - 1);
// result.Add(Skills[randomIndex]);
// Skills.RemoveAt(randomIndex);
// }
// }
// break;
// }
// case EEffectTargetType::TargetSkillType:
// {
// //筛选指定类型的技能
// TArray<USkill*> Skills = context.SkillManager->GetSkillsByOwner(context.SkillManager->GetEnemyPawn(OwnerSkill->GetOwner()));
// for (int i = Skills.Num() - 1; i >= 0; i--)
// {
// if (!Skills[i]->GetSkillData()->SkillTypes.Contains(effectData.SkillSelecter.SkillType))
// {
// Skills.RemoveAt(i);
// }
// }
//
// if (effectData.SkillSelecter.bAll)
// {
// result.Append(Skills);
// }
// else
// {
// int TargetNum = FMath::Min(effectData.SkillSelecter.MaxEffectTargetNum, Skills.Num());
// for (int i = 0; i < TargetNum; i++)
// {
// int randomIndex = FMath::RandRange(0, Skills.Num() - 1);
// result.Add(Skills[randomIndex]);
// Skills.RemoveAt(randomIndex);
// }
// }
// break;
// }
// }
// return result;
// }
FString USkillEffect::GetSkillEffectDes()
{

View File

@ -20,7 +20,7 @@ public:
void InitSkillEffect(class USkill* skill, FSkillEffectData data);
virtual void Execute(const FSkillContext& context) ;
virtual void Cancel(const FSkillContext& context) ;
//virtual void EffectEnded(const FSkillContext& context);
virtual void EffectEnded(const FSkillContext& context);
//TArray<UObject*> GetApplyTargets(const FSkillContext& context);
UFUNCTION(BlueprintPure)

View File

@ -24,24 +24,24 @@ void USkillEffect_DamageReduce::Execute(const FSkillContext& context)
}
}
// void USkillEffect_DamageReduce::EffectEnded(const FSkillContext& context)
// {
// Super::EffectEnded(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
// {
// //恢复目标护盾值
// APawnWithSkill* OwnerPawn = Cast<APawnWithSkill>(target);
// OwnerPawn->SetDamageReduce(0);
// }
// }
// }
void USkillEffect_DamageReduce::EffectEnded(const FSkillContext& context)
{
Super::EffectEnded(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
{
//恢复目标护盾值
APawnWithSkill* OwnerPawn = Cast<APawnWithSkill>(target);
OwnerPawn->SetDamageReduce(0);
}
}
}
FString USkillEffect_DamageReduce::GetSkillEffectDes()
{

View File

@ -15,6 +15,6 @@ class PROJECTFISH_API USkillEffect_DamageReduce : public USkillEffect
GENERATED_BODY()
public:
void Execute(const FSkillContext& context) override;
//void EffectEnded(const FSkillContext& context) override;
void EffectEnded(const FSkillContext& context) override;
FString GetSkillEffectDes() override;
};

View File

@ -36,11 +36,11 @@ void USkillEffect_ModifySpeed::Execute(const FSkillContext& context)
}
}
// void USkillEffect_ModifySpeed::EffectEnded(const FSkillContext& context)
// {
// Super::EffectEnded(context);
// //GetWorld()->GetTimerManager().ClearTimer(TimerHandle);
// }
void USkillEffect_ModifySpeed::EffectEnded(const FSkillContext& context)
{
Super::EffectEnded(context);
//GetWorld()->GetTimerManager().ClearTimer(TimerHandle);
}
FString USkillEffect_ModifySpeed::GetSkillEffectDes()
{

View File

@ -17,7 +17,7 @@ class PROJECTFISH_API USkillEffect_ModifySpeed : public USkillEffect
GENERATED_BODY()
public:
void Execute(const FSkillContext& context) override;
//void EffectEnded(const FSkillContext& context) override;
void EffectEnded(const FSkillContext& context) override;
FString GetSkillEffectDes() override;
private:
FTimerHandle TimerHandle;

View File

@ -53,8 +53,6 @@ void USkillManager::AddPawn(class APawnWithSkill* Pawn, FIntPoint BagSize)
void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn, TArray<USkill*>& SkillObjects,
TArray<FIntPoint>& BagPositions)
{
if (IsValid(Bag))
{
FIntPoint BagSize = *PawnInfo.Find(Pawn);
TMap<FIntPoint, int32>* states = PawnBagState.Find(Pawn);
for (auto PlacedSkill: Bag->PlacedSkills)
@ -73,7 +71,8 @@ void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn,
}
}
}
}
}
void USkillManager::OnAllSkillAdded()

View File

@ -1,17 +0,0 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "FishingRodConfigSubsystem.h"
#include "ProjectFish/DataAsset/BagConfigAsset.h"
void UFishingRodConfigSubsystem::CreatePlayerInventory(class UBagShapeAsset* bagShape)
{
inventoryConfig = NewObject<UBagConfigAsset>(this);
inventoryConfig->BagShapeAsset = bagShape;
}
UBagConfigAsset* UFishingRodConfigSubsystem::GetFishingRodInventory()
{
return this->inventoryConfig;
}

View File

@ -1,26 +0,0 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "FishingRodConfigSubsystem.generated.h"
/**
*
*/
UCLASS()
class PROJECTFISH_API UFishingRodConfigSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "PlayerInventorySubsystem")
void CreatePlayerInventory(class UBagShapeAsset* bagShape);
UFUNCTION(BlueprintPure, Category = "PlayerInventorySubsystem")
UBagConfigAsset* GetFishingRodInventory();
private:
UPROPERTY()
class UBagConfigAsset* inventoryConfig = nullptr;
};

View File

@ -15,7 +15,6 @@ void SBagConfigGridWidget::Construct(const FArguments& InArgs)
PreviewSkill = nullptr;
PreviewX = -1;
PreviewY = -1;
HoveredSkillIndex = -1;
ChildSlot
[
@ -51,76 +50,9 @@ FReply SBagConfigGridWidget::OnMouseButtonDown(const FGeometry& MyGeometry, cons
FReply SBagConfigGridWidget::OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
if (BagConfig.IsValid())
{
FVector2D LocalPosition = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition());
FVector2D GridCell = GetGridCellFromPosition(LocalPosition);
int32 GridX = FMath::FloorToInt(GridCell.X);
int32 GridY = FMath::FloorToInt(GridCell.Y);
if (IsValidGridPosition(GridX, GridY))
{
USkillAsset* HoveredSkill = GetSkillAtPosition(GridX, GridY);
if (HoveredSkill)
{
int32 NewHoveredIndex = BagConfig->GetSkillAtPosition(GridX, GridY);
if (NewHoveredIndex != HoveredSkillIndex)
{
HoveredSkillIndex = NewHoveredIndex;
HoveredSkillTooltip = CreateSkillTooltip(HoveredSkill);
if (HoveredSkillTooltip.IsValid())
{
FSlateApplication::Get().PushMenu(
AsShared(),
FWidgetPath(),
HoveredSkillTooltip.ToSharedRef(),
MouseEvent.GetScreenSpacePosition(),
FPopupTransitionEffect::None
);
}
}
return FReply::Handled();
}
}
// 清除悬停状态
if (HoveredSkillIndex != -1)
{
HoveredSkillIndex = -1;
if (HoveredSkillTooltip.IsValid())
{
FSlateApplication::Get().DismissAllMenus();
HoveredSkillTooltip.Reset();
}
}
}
return FReply::Unhandled();
}
void SBagConfigGridWidget::OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
SCompoundWidget::OnMouseEnter(MyGeometry, MouseEvent);
}
void SBagConfigGridWidget::OnMouseLeave(const FPointerEvent& MouseEvent)
{
// 清除悬停状态
if (HoveredSkillIndex != -1)
{
HoveredSkillIndex = -1;
if (HoveredSkillTooltip.IsValid())
{
FSlateApplication::Get().DismissAllMenus();
HoveredSkillTooltip.Reset();
}
}
SCompoundWidget::OnMouseLeave(MouseEvent);
}
int32 SBagConfigGridWidget::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId,
const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
@ -300,52 +232,3 @@ FLinearColor SBagConfigGridWidget::GetCellColor(int32 X, int32 Y) const
// 空闲格子为浅灰色
return FLinearColor(0.7f, 0.7f, 0.7f, 1.0f);
}
USkillAsset* SBagConfigGridWidget::GetSkillAtPosition(int32 X, int32 Y) const
{
if (!BagConfig.IsValid())
{
return nullptr;
}
int32 SkillIndex = BagConfig->GetSkillAtPosition(X, Y);
if (SkillIndex >= 0 && SkillIndex < BagConfig->PlacedSkills.Num())
{
return BagConfig->PlacedSkills[SkillIndex].SkillAsset;
}
return nullptr;
}
TSharedRef<SWidget> SBagConfigGridWidget::CreateSkillTooltip(USkillAsset* SkillAsset) const
{
if (!SkillAsset)
{
return SNullWidget::NullWidget;
}
return SNew(SBorder)
.BorderImage(FCoreStyle::Get().GetBrush("ToolTip.Background"))
.Padding(FMargin(8.0f))
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
[
SNew(STextBlock)
.Text(SkillAsset->SkillName)
.Font(FCoreStyle::GetDefaultFontStyle("Bold", 12))
.ColorAndOpacity(FLinearColor::White)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(0, 4, 0, 0)
[
SNew(STextBlock)
.Text(SkillAsset->SkillDescription)
.Font(FCoreStyle::GetDefaultFontStyle("Regular", 10))
.ColorAndOpacity(FLinearColor(0.9f, 0.9f, 0.9f, 1.0f))
.WrapTextAt(250.0f)
]
];
}

View File

@ -35,8 +35,6 @@ protected:
// Slate重写函数
virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual FReply OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual void OnMouseLeave(const FPointerEvent& MouseEvent) override;
virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect,
FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
@ -54,10 +52,6 @@ private:
int32 PreviewX;
int32 PreviewY;
// 悬停状态
TSharedPtr<SWidget> HoveredSkillTooltip;
int32 HoveredSkillIndex;
// UI参数
static const float CellSize;
static const float CellSpacing;
@ -67,8 +61,6 @@ private:
FVector2D GetGridCellFromPosition(const FVector2D& Position) const;
bool IsValidGridPosition(int32 X, int32 Y) const;
FLinearColor GetCellColor(int32 X, int32 Y) const;
USkillAsset* GetSkillAtPosition(int32 X, int32 Y) const;
TSharedRef<SWidget> CreateSkillTooltip(USkillAsset* SkillAsset) const;
};

File diff suppressed because it is too large Load Diff