diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-14 10:41:08 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-14 10:41:08 -0300 |
| commit | 1e17a31e3eeed8ccf76982534002513cee6593f1 (patch) | |
| tree | 74d8e4fbf706b1008edcd699b0ba7af2d6bb34ea /scripts/Entities/Items/GrimoireConsumable.cs | |
| parent | 5958d9c071915ab71aea5a5c08d79e88024f6c58 (diff) | |
Magicas
Diffstat (limited to 'scripts/Entities/Items/GrimoireConsumable.cs')
| -rw-r--r-- | scripts/Entities/Items/GrimoireConsumable.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/Entities/Items/GrimoireConsumable.cs b/scripts/Entities/Items/GrimoireConsumable.cs new file mode 100644 index 0000000..e5157a7 --- /dev/null +++ b/scripts/Entities/Items/GrimoireConsumable.cs @@ -0,0 +1,22 @@ +using Godot; +using TheLegendOfGustav.Entities.Actions; +using TheLegendOfGustav.Entities.Actors; +using TheLegendOfGustav.Magic; +using TheLegendOfGustav.Map; + +namespace TheLegendOfGustav.Entities.Items; + +public partial class GrimoireConsumable(Vector2I initialPosition, MapData map, GrimoireConsumableDefinition definition) : ConsumableItem(initialPosition, map, definition) +{ + private SpellResource spell = definition.Spell; + + public override bool Activate(ItemAction action) + { + Player consumer = action.Player; + + consumer.SpellBook.LearnSpell(spell); + + ConsumedBy(consumer); + return true; + } +}
\ No newline at end of file |
