This commit is contained in:
CortexCore
2023-12-03 17:35:43 +08:00
parent ba342d6627
commit ba9f4eda80
702 changed files with 162078 additions and 21050 deletions

View File

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