Files
BusyRabbit/Content/Lua/GamePlay/Ability/Common/Recover.lua

26 lines
884 B
Lua
Raw Normal View History

2025-07-09 01:08:35 +08:00
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)