27 lines
		
	
	
		
			925 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
		
		
			
		
	
	
			27 lines
		
	
	
		
			925 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
|  | local Ability = {} | ||
|  | local GetGameplayTag = require("GamePlay.Utils").GetGameplayTag | ||
|  | local AbilitySystemBlueprintLibrary = import("AbilitySystemBlueprintLibrary") | ||
|  | 
 | ||
|  | function Ability:K2_ActivateAbilityFromEvent(_) | ||
|  |     local RoleUtils = require("GamePlay.Utils.RoleUtils") | ||
|  | 
 | ||
|  |     local owner = self:GetOwningActorFromActorInfo() | ||
|  |     local asc = AbilitySystemBlueprintLibrary.GetAbilitySystemComponent(owner) | ||
|  | 
 | ||
|  |     local increase_handle = asc:MakeOutgoingSpec( | ||
|  |         self.DefaultEffectConfig, 1, asc:MakeEffectContext() | ||
|  |     ) | ||
|  |     AbilitySystemBlueprintLibrary.AssignTagSetByCallerMagnitude( | ||
|  |         increase_handle, GetGameplayTag("Change.Role.MoveSpeed"), self.SpeedIncrease | ||
|  |     ) | ||
|  |     asc:BP_ApplyGameplayEffectSpecToSelf(increase_handle) | ||
|  | 
 | ||
|  |     RoleUtils.ChangeHunger(owner, -100) | ||
|  | end | ||
|  | 
 | ||
|  | 
 | ||
|  | -- function Ability:K2_OnEndAbility(bWasCancelled) | ||
|  | --     print(bWasCancelled, "Ability:K2_OnEndAbility") | ||
|  | -- end | ||
|  | 
 | ||
|  | return Class(nil, nil, Ability) |