Throw item
This commit is contained in:
@@ -13,6 +13,8 @@ public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvid
|
||||
public IPlayer Player { get; }
|
||||
|
||||
public void DropItem(IInventoryItem item);
|
||||
|
||||
public void ThrowItem(IInventoryItem item);
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
@@ -143,6 +145,15 @@ public partial class Game : Node3D, IGame
|
||||
dropped.Drop();
|
||||
}
|
||||
|
||||
public void ThrowItem(IInventoryItem item)
|
||||
{
|
||||
var thrownScene = GD.Load<PackedScene>("res://src/items/thrown/ThrownItem.tscn");
|
||||
var thrown = thrownScene.Instantiate<ThrownItem>();
|
||||
thrown.ThrownItemStats = item.Info;
|
||||
AddChild(thrown);
|
||||
thrown.Throw();
|
||||
}
|
||||
|
||||
private void OnEnemyDefeated(Vector3 vector, EnemyStatResource resource)
|
||||
{
|
||||
var restorativeScene = GD.Load<PackedScene>("res://src/items/restorative/Restorative.tscn");
|
||||
|
||||
Reference in New Issue
Block a user