Drop item
This commit is contained in:
@@ -3,16 +3,16 @@ using Chickensoft.Introspection;
|
||||
using GameJamDungeon;
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Accessory : Node3D, IInventoryItem, IEquipable
|
||||
public partial class Accessory : Node3D, IEquipableItem, IThrowableItem
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Dependency] public IGameRepo GameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
[Dependency] public IGameEventDepot GameEventDepot => this.DependOn<IGameEventDepot>();
|
||||
|
||||
public InventoryItemStats Info => AccessoryStats;
|
||||
|
||||
[Export]
|
||||
@@ -30,12 +30,17 @@ public partial class Accessory : Node3D, IInventoryItem, IEquipable
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
public void Throw()
|
||||
public void Equip()
|
||||
{
|
||||
GameRepo.PlayerData.Inventory.Remove(this);
|
||||
GameEventDepot.OnEquippedAccessory(this);
|
||||
}
|
||||
|
||||
public void Drop()
|
||||
public void Unequip()
|
||||
{
|
||||
GameEventDepot.OnUnequippedAccessory();
|
||||
}
|
||||
|
||||
public void Throw()
|
||||
{
|
||||
GameRepo.PlayerData.Inventory.Remove(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user