初始化提交
This commit is contained in:
26
Content/Lua/GamePlay/Ability/Common/Recover.lua
Normal file
26
Content/Lua/GamePlay/Ability/Common/Recover.lua
Normal file
@ -0,0 +1,26 @@
|
||||
local Ability = {}
|
||||
local GetGameplayTag = require("GamePlay.Utils").GetGameplayTag
|
||||
local BlueprintGameplayTagLibrary = import("BlueprintGameplayTagLibrary")
|
||||
local AbilitySystemBlueprintLibrary = import("AbilitySystemBlueprintLibrary")
|
||||
|
||||
function Ability:K2_ActivateAbilityFromEvent(EventData)
|
||||
|
||||
local tag = EventData.tag
|
||||
local value = EventData.EventMagnitude
|
||||
local asc = AbilitySystemBlueprintLibrary.GetAbilitySystemComponent(self.target)
|
||||
|
||||
if tag == "Recover.Role.Health" then
|
||||
local spec_handle = asc:MakeOutgoingSpec(
|
||||
self.AbilityEffectConfigs:Get("Role"), 1, asc:MakeEffectContext()
|
||||
)
|
||||
AbilitySystemBlueprintLibrary.AssignTagSetByCallerMagnitude(
|
||||
spec_handle, GetGameplayTag("Change.Role.Health"), value
|
||||
)
|
||||
asc:BP_ApplyGameplayEffectSpecToSelf(spec_handle)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
return Class(nil, nil, Ability)
|
||||
Reference in New Issue
Block a user