1
This commit is contained in:
@@ -6,6 +6,7 @@ using BITFALL.Entities.Inventory;
|
||||
using BITFALL.Player.Inventory;
|
||||
using BITKit;
|
||||
using BITKit.Entities;
|
||||
using BITKit.UX;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITFALL.Items
|
||||
@@ -37,12 +38,19 @@ namespace BITFALL.Items
|
||||
[Inject] private IHealth _health;
|
||||
|
||||
[Inject(true)] private IKnockdown _knockdown;
|
||||
|
||||
[Inject(true)] private IUXPopup _popup;
|
||||
public override bool TryUse(IBasicItem item)
|
||||
{
|
||||
if(_health.IsAlive is false) return false;
|
||||
if (_health.HealthPoint == _health.MaxHealthPoint) return false;
|
||||
if (_health.HealthPoint >= _health.MaxHealthPoint)
|
||||
{
|
||||
_popup?.Popup("<color=yellow>生命值已满</color>");
|
||||
return false;
|
||||
}
|
||||
if (_knockdown is not null && _knockdown.IsKnockdown)
|
||||
{
|
||||
_popup?.Popup("<color=yellow>你被击倒了</color>");
|
||||
return false;
|
||||
}
|
||||
return base.TryUse(item);
|
||||
|
Reference in New Issue
Block a user