Drop item

This commit is contained in:
2024-09-22 14:00:52 -07:00
parent 01477b9a0e
commit 490f0d17d2
25 changed files with 401 additions and 257 deletions

View File

@@ -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);
}