Drop item
This commit is contained in:
@@ -5,7 +5,7 @@ using Godot;
|
||||
using System;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class ThrowableItem : Node3D, IInventoryItem
|
||||
public partial class ThrowableItem : Node3D, IThrowableItem
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
@@ -32,16 +32,13 @@ public partial class ThrowableItem : Node3D, IInventoryItem
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
public void Throw(ThrowableItemStats throwableItemStats)
|
||||
public void Throw()
|
||||
{
|
||||
var throwableScene = GD.Load<PackedScene>("res://src/items/thrown/ThrownGeometricDice.tscn");
|
||||
var throwableScene = GD.Load<PackedScene>("res://src/items/thrown/ThrownItem.tscn");
|
||||
var throwable = throwableScene.Instantiate<ThrownItem>();
|
||||
throwable.ThrownItemStats = ThrowableItemInfo;
|
||||
Game.AddChild(throwable);
|
||||
throwable.Throw(throwableItemStats);
|
||||
}
|
||||
|
||||
public void Drop()
|
||||
{
|
||||
throwable.Throw();
|
||||
GameRepo.PlayerData.Inventory.Remove(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user