Starting an inventory manager
This commit is contained in:
@@ -28,6 +28,7 @@ using Movementtests.player_controller.Scripts;
|
||||
using Movementtests.scenes.player_controller.scripts;
|
||||
using Movementtests.tools;
|
||||
using Movementtests.forge.abilities;
|
||||
using Movementtests.managers;
|
||||
using Movementtests.tools.calculators;
|
||||
using RustyOptions;
|
||||
using Node = Godot.Node;
|
||||
@@ -715,6 +716,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_parryStandard.StateEntered += OnStandardParryStarted;
|
||||
_parryDash.StateEntered += OnDashParryStarted;
|
||||
|
||||
// Inventory Management
|
||||
InventoryManager.Instance.WeaponEventInventoryChanged += OnWeaponEventInventoryChanged;
|
||||
|
||||
// Forge events
|
||||
var weaponLeftToken = WeaponSystem.Events.Subscribe(WeaponSystem.WeaponStartedFlyingEventTag, OnWeaponLeft);
|
||||
var weaponLandedToken = WeaponSystem.Events.Subscribe(WeaponSystem.WeaponStoppedFlyingEventTag, OnWeaponLanded);
|
||||
@@ -747,9 +751,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
out var failures);
|
||||
}
|
||||
|
||||
public void GrantWeaponExplosionAbilityForEvent(WeaponSystem.WeaponEvent forEvent, string abilityName)
|
||||
public void OnWeaponEventInventoryChanged(WeaponEventInventoryChangedData data)
|
||||
{
|
||||
WeaponSystem.GrantNewAbilityForEvent(forEvent, WeaponExplosionBehavior);
|
||||
WeaponSystem.GrantNewAbilityForEvent(data.ForEvent, WeaponExplosionBehavior);
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user