Upload from upload_mods.ps1
This commit is contained in:
18
Scripts/ItemAction/ItemActionUseMedRebirth.cs
Normal file
18
Scripts/ItemAction/ItemActionUseMedRebirth.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
public class ItemActionUseMedRebirth : ItemActionEat
|
||||
{
|
||||
public override void ExecuteAction(ItemActionData _actionData, bool _bReleased)
|
||||
{
|
||||
EntityAlive holdingEntity = _actionData.invData.holdingEntity;
|
||||
|
||||
float healingAmount = holdingEntity.Buffs.GetCustomVar("medicalRegHealthAmount");
|
||||
|
||||
if (healingAmount <= 10)
|
||||
{
|
||||
base.ExecuteAction(_actionData, _bReleased);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.ShowTooltip(holdingEntity as EntityPlayerLocal, Localization.Get("ttNotDoneHealing"), string.Empty, "ui_denied", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user