Drop item
This commit is contained in:
@@ -5,7 +5,7 @@ using Godot;
|
||||
using System;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Weapon : Node3D, IInventoryItem, IEquipable
|
||||
public partial class Weapon : Node3D, IInventoryItem, IEquipableItem
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
@@ -13,6 +13,9 @@ public partial class Weapon : Node3D, IInventoryItem, IEquipable
|
||||
|
||||
public InventoryItemStats Info => WeaponStats;
|
||||
|
||||
[Signal]
|
||||
public delegate void EquippedItemEventHandler(Weapon equippedWeapon);
|
||||
|
||||
[Export]
|
||||
public WeaponStats WeaponStats { get; set; } = new WeaponStats();
|
||||
|
||||
@@ -28,6 +31,16 @@ public partial class Weapon : Node3D, IInventoryItem, IEquipable
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
public void Equip()
|
||||
{
|
||||
EmitSignal(SignalName.EquippedItem, this);
|
||||
}
|
||||
|
||||
public void Unequip()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Throw()
|
||||
{
|
||||
GameRepo.PlayerData.Inventory.Remove(this);
|
||||
|
||||
Reference in New Issue
Block a user