summaryrefslogtreecommitdiff
path: root/scripts/Entities/Items/HealingConsumable.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-10-24 21:25:15 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-10-24 21:25:15 -0300
commit639cd8cef403e9e66bf31e7888e786effac2b292 (patch)
treea1b3872a91ad599a71629d0d62c72125138c5c14 /scripts/Entities/Items/HealingConsumable.cs
parent52c32a24044aa574c9e7bf7aa4e2499349cc36b2 (diff)
refactor: Sistema de itens reescrito
Em tese, este novo sistema é mais fácil de serializar. Descanse em paz pergaminhos, eu não quero reimplementá-los neste novo sistema.
Diffstat (limited to 'scripts/Entities/Items/HealingConsumable.cs')
-rw-r--r--scripts/Entities/Items/HealingConsumable.cs30
1 files changed, 0 insertions, 30 deletions
diff --git a/scripts/Entities/Items/HealingConsumable.cs b/scripts/Entities/Items/HealingConsumable.cs
deleted file mode 100644
index 85377d3..0000000
--- a/scripts/Entities/Items/HealingConsumable.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Godot;
-using TheLegendOfGustav.Entities.Actors;
-using TheLegendOfGustav.Utils;
-using TheLegendOfGustav.Entities.Actions;
-using TheLegendOfGustav.Map;
-
-namespace TheLegendOfGustav.Entities.Items;
-
-public partial class HealingConsumable(Vector2I initialPosition, MapData map, HealingConsumableDefinition definition) : ConsumableItem(initialPosition, map, definition)
-{
- private HealingConsumableDefinition definition = definition;
- public float HealingPercentage { get; private set; } = definition.healingPercentage;
-
- public override bool Activate(ItemAction action)
- {
- Player consumer = action.Player;
- 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