| @ -0,0 +1,20 @@ | ||||
| #include "BlueprintLibrary/BusyAscLibrary.h" | ||||
|  | ||||
| #include "GameplayEffectTypes.h" | ||||
| #include "Gas/BusyGameAbility.h" | ||||
|  | ||||
| UBusyAbilityDataAssetBase* UBusyAscLibrary::GetAbilityDataAssetByEffect(const FGameplayEffectSpec& Spec) | ||||
| { | ||||
| 	const FGameplayEffectContextHandle& Context = Spec.GetEffectContext(); | ||||
| 	if (const UBusyGameAbility* Ability =  Cast<const UBusyGameAbility>(Context.GetAbility())) | ||||
| 	{ | ||||
| 		return Ability->GetData(); | ||||
| 	} | ||||
| 	return nullptr; | ||||
| } | ||||
|  | ||||
| AActor* UBusyAscLibrary::GetEffectInstigator(const FGameplayEffectSpec& Spec) | ||||
| { | ||||
| 	return Spec.GetEffectContext().GetInstigator(); | ||||
| 	 | ||||
| } | ||||
| @ -0,0 +1 @@ | ||||
| #include "BlueprintLibrary/BusyCombatLibrary.h" | ||||
| @ -21,7 +21,7 @@ bool UBusyGameAbility::GetAbilityEffectSpecHandle(const FName& EffectName, const | ||||
|  | ||||
| 	// 2. 创建并设置GameplayEffect上下文 | ||||
| 	FGameplayEffectContextHandle EffectContextHandle = Asc->MakeEffectContext(); | ||||
| 	 | ||||
|  | ||||
| 	// 3. 将当前对象设置为效果来源 | ||||
| 	EffectContextHandle.AddSourceObject(this); | ||||
| 	 | ||||
| @ -31,3 +31,13 @@ bool UBusyGameAbility::GetAbilityEffectSpecHandle(const FName& EffectName, const | ||||
| 	return Handle.IsValid(); | ||||
| } | ||||
|  | ||||
| void UBusyGameAbility::PostInitProperties() | ||||
| { | ||||
| 	Super::PostInitProperties(); | ||||
| 	if (SoftDataAsset) | ||||
| 	{ | ||||
| 		Data = SoftDataAsset.LoadSynchronous(); | ||||
| 		Data->TargetAbility = this; | ||||
| 	} | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -6,7 +6,7 @@ | ||||
| #include "SpineSkeletonAnimationComponent.h" | ||||
| #include "Gas/BusyGameAbility.h" | ||||
| #include "Level/Actor/Components/BusyPawnMovement.h" | ||||
| #include "Tables/BusyPawnConfig.h" | ||||
| #include "Data/BusyPawnConfig.h" | ||||
|  | ||||
| DEFINE_LOG_CATEGORY(LogBusyPawn) | ||||
|  | ||||
|  | ||||
| @ -1,8 +1,6 @@ | ||||
| #include "Level/Actor/BusyPlayerRole.h" | ||||
| #include "Camera/CameraComponent.h" | ||||
| #include "BusyGameplayLibrary.h" | ||||
| #include "Animation/AnimAttributes.h" | ||||
| #include "Tables/BusyPawnConfig.h" | ||||
| #include "Data/BusyPawnConfig.h" | ||||
| #include "GameFramework/SpringArmComponent.h" | ||||
|  | ||||
|  | ||||
|  | ||||
							
								
								
									
										18
									
								
								Source/BusyRabbit/Public/BlueprintLibrary/BusyAscLibrary.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Source/BusyRabbit/Public/BlueprintLibrary/BusyAscLibrary.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,18 @@ | ||||
| #pragma once | ||||
| #include "Kismet/BlueprintFunctionLibrary.h" | ||||
| #include "BusyAscLibrary.generated.h" | ||||
|  | ||||
| struct FGameplayEffectSpec; | ||||
| class UBusyAbilityDataAssetBase; | ||||
|  | ||||
| UCLASS() | ||||
| class UBusyAscLibrary : public UBlueprintFunctionLibrary | ||||
| { | ||||
| 	GENERATED_BODY() | ||||
| public: | ||||
| 	UFUNCTION(BlueprintCallable) | ||||
| 	static UBusyAbilityDataAssetBase* GetAbilityDataAssetByEffect(const FGameplayEffectSpec& Spec); | ||||
|  | ||||
| 	UFUNCTION(BlueprintCallable) | ||||
| 	static AActor* GetEffectInstigator(const FGameplayEffectSpec& Spec); | ||||
| }; | ||||
| @ -0,0 +1,7 @@ | ||||
| #pragma once | ||||
|  | ||||
| class BusyCombatLibrary | ||||
| { | ||||
| public: | ||||
| 	 | ||||
| }; | ||||
| @ -0,0 +1,23 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include "BusyAbilityDataAssetBase.generated.h" | ||||
|  | ||||
|  | ||||
| class UBusyGameAbility; | ||||
|  | ||||
| UCLASS(BlueprintType) | ||||
| class UBusyAbilityDataAssetBase : public UDataAsset | ||||
| { | ||||
|     GENERATED_BODY() | ||||
| public: | ||||
|     UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="技能ID") | ||||
|     FName AbilityID; | ||||
|  | ||||
|     UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="技能名称") | ||||
|     FText AbilityName; | ||||
|  | ||||
|     UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="备注") | ||||
|     FString AbilityDesc; | ||||
|  | ||||
|     TWeakObjectPtr<UBusyGameAbility> TargetAbility; | ||||
| }; | ||||
| @ -0,0 +1,72 @@ | ||||
| #pragma once | ||||
| #include "GameplayTagContainer.h" | ||||
| #include "Data/Ability/BusyAbilityDataAssetBase.h" | ||||
| #include "FoxAbilityDataAsset.generated.h" | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 狐狸大招技能配置 | ||||
|  */ | ||||
| UCLASS(BlueprintType) | ||||
| class UFoxUltimateDataAsset : public UBusyAbilityDataAssetBase | ||||
| { | ||||
| 	GENERATED_BODY() | ||||
| public: | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="一阶消耗", Category="技能消耗") | ||||
| 	float FirstStageCost = 5.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="二阶消耗", Category="技能消耗") | ||||
| 	float SecondStageCost = 8.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="三阶消耗", Category="技能消耗") | ||||
| 	float LastStageCost = 12.f; | ||||
|  | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="一阶伤害系数", Category="伤害系数") | ||||
| 	float FirstStageDamageFactor = 5.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="二阶伤害系数", Category="伤害系数") | ||||
| 	float SecondStageDamageFactor = 8.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="三阶伤害系数", Category="伤害系数") | ||||
| 	float LastStageDamageFactor = 12.f; | ||||
|  | ||||
| 	 | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="一阶速度系数", Category="速度系数") | ||||
| 	float FirstStageSpeedFactor = 5.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="二阶速度系数", Category="速度系数") | ||||
| 	float SecondStageSpeedFactor = 8.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="三阶一段速度系数", Category="速度系数") | ||||
| 	float LastStageNormalSpeedFactor = 12.f; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="三阶二段速度系数", Category="速度系数") | ||||
| 	float LastStageSprintSpeedFactor = 12.f; | ||||
|  | ||||
| 	 | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="可释放二阶标签", Category="技能标签") | ||||
| 	FGameplayTag SecondStageRecastTag; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="可释放三阶标签", Category="技能标签") | ||||
| 	FGameplayTag LastStageRecastTag; | ||||
|  | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="一阶标签", Category="技能标签") | ||||
| 	FGameplayTag FirstStageTag; | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="二阶标签", Category="技能标签") | ||||
| 	FGameplayTag SecondStageTag; | ||||
| 	 | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="三阶标签", Category="技能标签") | ||||
| 	FGameplayTag LastStageTag; | ||||
|  | ||||
|  | ||||
|  | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="可重新释放时长") | ||||
| 	float RecastWindow = 6.f; | ||||
| 	 | ||||
| 	UPROPERTY(EditAnywhere, BlueprintReadOnly, DisplayName="冷却时间") | ||||
| 	float CooldownTime = 15.f; | ||||
| 	 | ||||
| }; | ||||
| @ -1,5 +1,6 @@ | ||||
| #pragma once | ||||
| #include "slua.h" | ||||
| #include "Data/Ability/BusyAbilityDataAssetBase.h" | ||||
| #include "Abilities/GameplayAbility.h" | ||||
| #include "BusyGameAbility.generated.h" | ||||
|  | ||||
| @ -19,12 +20,25 @@ public: | ||||
| public: | ||||
| 	UFUNCTION(BlueprintCallable) | ||||
| 	bool GetAbilityEffectSpecHandle(const FName& EffectName, const UAbilitySystemComponent* Asc, const int32 Level, FGameplayEffectSpecHandle& Handle)const; | ||||
| 	 | ||||
|  | ||||
|  | ||||
| public: | ||||
| 	virtual void PostInitProperties()override; | ||||
| 	UBusyAbilityDataAssetBase* GetData()const { return Data; } | ||||
|  | ||||
| public: | ||||
| 	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) | ||||
| 	FString LuaFilePath; | ||||
|  | ||||
| 	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) | ||||
| 	TSoftObjectPtr<UBusyAbilityDataAssetBase> SoftDataAsset; | ||||
|  | ||||
| 	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, DisplayName="技能效果") | ||||
| 	TMap<FName, TSubclassOf<UGameplayEffect>> AbilityEffects; | ||||
|  | ||||
|  | ||||
| protected: | ||||
| 	UPROPERTY() | ||||
| 	UBusyAbilityDataAssetBase* Data; | ||||
|  | ||||
| }; | ||||
|  | ||||
							
								
								
									
										21
									
								
								Source/BusyRabbit/Public/Gas/BusyMagnitudeCalculation.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Source/BusyRabbit/Public/Gas/BusyMagnitudeCalculation.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| #pragma once | ||||
| #include "LuaOverriderInterface.h" | ||||
| #include "GameplayModMagnitudeCalculation.h" | ||||
| #include "BusyMagnitudeCalculation.generated.h" | ||||
|  | ||||
| UCLASS() | ||||
| class UBusyMagnitudeCalculation : public UGameplayModMagnitudeCalculation, public ILuaOverriderInterface | ||||
| { | ||||
| 	GENERATED_BODY() | ||||
| public: | ||||
| 	virtual FString GetLuaFilePath_Implementation(); | ||||
| 	 | ||||
| protected: | ||||
| 	UPROPERTY(EditDefaultsOnly) | ||||
| 	FString LuaFilePath; | ||||
| }; | ||||
|  | ||||
| inline FString UBusyMagnitudeCalculation::GetLuaFilePath_Implementation() | ||||
| { | ||||
| 	return LuaFilePath; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user