Throwable item rework, increase health on timer timeout, add boss 1 model
This commit is contained in:
@@ -9,6 +9,9 @@ public partial class ConsumableItem : Node3D, IUsableItem
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Signal]
|
||||
public delegate void RaiseStatRequestEventHandler(ConsumableItemStats consumableItemStats);
|
||||
|
||||
[Dependency] public IGame Game => this.DependOn<IGame>();
|
||||
[Dependency] public IGameRepo GameRepo => this.DependOn<IGameRepo>();
|
||||
[Dependency] public IGameEventDepot GameEventDepot => this.DependOn<IGameEventDepot>();
|
||||
@@ -26,17 +29,15 @@ public partial class ConsumableItem : Node3D, IUsableItem
|
||||
|
||||
public void Use()
|
||||
{
|
||||
GameEventDepot.OnHealingItemConsumed(ConsumableItemInfo);
|
||||
}
|
||||
if (ConsumableItemInfo.RaiseHPAmount > 0)
|
||||
Game.RaiseHP(ConsumableItemInfo.RaiseHPAmount);
|
||||
if (ConsumableItemInfo.RaiseVTAmount > 0)
|
||||
Game.RaiseVT(ConsumableItemInfo.RaiseVTAmount);
|
||||
|
||||
public void Throw()
|
||||
{
|
||||
var throwableScene = GD.Load<PackedScene>("res://src/items/thrown/ThrownItem.tscn");
|
||||
var throwable = throwableScene.Instantiate<ThrownItem>();
|
||||
throwable.ThrownItemStats = ConsumableItemInfo;
|
||||
Game.AddChild(throwable);
|
||||
throwable.Throw();
|
||||
GameRepo.PlayerData.Inventory.Remove(this);
|
||||
if (ConsumableItemInfo.HealHPAmount > 0)
|
||||
Game.HealHP(ConsumableItemInfo.HealHPAmount);
|
||||
if (ConsumableItemInfo.HealVTAmount > 0)
|
||||
Game.HealVT(ConsumableItemInfo.HealVTAmount);
|
||||
}
|
||||
|
||||
public void OnReady()
|
||||
|
||||
@@ -5,15 +5,9 @@ namespace GameJamDungeon;
|
||||
[GlobalClass]
|
||||
public partial class ConsumableItemStats : InventoryItemStats
|
||||
{
|
||||
[Export]
|
||||
public int HealHPAmount { get; set; } = 0;
|
||||
|
||||
[Export]
|
||||
public int RaiseHPAmount { get; set; } = 0;
|
||||
|
||||
[Export]
|
||||
public int HealVTAmount { get; set; } = 0;
|
||||
|
||||
[Export]
|
||||
public int RaiseVTAmount { get; set; } = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user