29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using Godot;
|
|
using Movementtests.systems;
|
|
|
|
[Tool, GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png")]
|
|
public partial class Inventory : Control
|
|
{
|
|
public PlayerController? Player { get; set; }
|
|
|
|
private AbilitySelection _startedFlyingSelection;
|
|
private AbilitySelection _whileFlyingSelection;
|
|
private AbilitySelection _stoppedFlyingSelection;
|
|
public override void _Ready()
|
|
{
|
|
_startedFlyingSelection = GetNode<AbilitySelection>("%StartedFlying");
|
|
_whileFlyingSelection = GetNode<AbilitySelection>("%WhileFlying");
|
|
_stoppedFlyingSelection = GetNode<AbilitySelection>("%StoppedFlying");
|
|
|
|
_startedFlyingSelection.AbilityAdded += AddAbilityForEvent;
|
|
_whileFlyingSelection.AbilityAdded += AddAbilityForEvent;
|
|
_stoppedFlyingSelection.AbilityAdded += AddAbilityForEvent;
|
|
}
|
|
|
|
public void AddAbilityForEvent(WeaponSystem.WeaponEvent forEvent, string abilityName)
|
|
{
|
|
if (Player is null) return;
|
|
Player.GrantWeaponExplosionAbilityForEvent(forEvent, abilityName);
|
|
}
|
|
}
|