summaryrefslogtreecommitdiff
path: root/scripts/entities/items/HealingConsumable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/entities/items/HealingConsumable.cs')
-rw-r--r--scripts/entities/items/HealingConsumable.cs28
1 files changed, 0 insertions, 28 deletions
diff --git a/scripts/entities/items/HealingConsumable.cs b/scripts/entities/items/HealingConsumable.cs
deleted file mode 100644
index 2104693..0000000
--- a/scripts/entities/items/HealingConsumable.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Godot;
-
-public partial class HealingConsumable : ConsumableItem
-{
- private HealingConsumableDefinition definition;
- public float HealingPercentage { get; private set; }
- public HealingConsumable(Vector2I initialPosition, MapData map, HealingConsumableDefinition definition) : base(initialPosition, map, definition)
- {
- this.definition = definition;
- HealingPercentage = definition.healingPercentage;
- }
-
- public override bool Activate(ItemAction action)
- {
- Player consumer = (Player) action.ThisActor;
- int intendedAmount = (int)(HealingPercentage / 100 * consumer.MaxHp);
- int recovered = consumer.Heal(intendedAmount);
-
- // Se não tinha o que curar, a ativação falhou.
- if (recovered == 0) {
- MessageLogData.Instance.AddMessage("Você já está saudável.");
- return false;
- }
- MessageLogData.Instance.AddMessage($"Você consome {DisplayName} e recupera {recovered} de HP");
- ConsumedBy(consumer);
- return true;
- }
-} \ No newline at end of file