From 7e7afb4dce485a184266ede2d96fbdf7a460ae69 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Mon, 2 Sep 2024 12:29:35 +0200 Subject: [PATCH] feat: add REST and LONG_REST card --- .../equipment/permanents/long_rest.lua | 20 +++++++++++++++++++ assets/scripts/equipment/permanents/rest.lua | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 assets/scripts/equipment/permanents/long_rest.lua create mode 100644 assets/scripts/equipment/permanents/rest.lua diff --git a/assets/scripts/equipment/permanents/long_rest.lua b/assets/scripts/equipment/permanents/long_rest.lua new file mode 100644 index 0000000..3b59985 --- /dev/null +++ b/assets/scripts/equipment/permanents/long_rest.lua @@ -0,0 +1,20 @@ +register_card("LONG_REST", { + name = l("cards.LONG_REST.name", "Long Rest"), + description = l("cards.REST.description", "Heal for 4 (+1 per level)."), + state = function(ctx) + return string.format(l("cards.REST.state", "Take a short rest. Heal for %s."), highlight(4 + ctx.level)) + end, + tags = { "HEAL" }, + max_level = 2, + color = COLOR_GREEN, + need_target = false, + does_exhaust = true, + point_cost = 3, + price = 300, + callbacks = { + on_cast = function(ctx) + heal(ctx.caster, ctx.caster, 4 + ctx.level) + return nil + end + }, +}) diff --git a/assets/scripts/equipment/permanents/rest.lua b/assets/scripts/equipment/permanents/rest.lua new file mode 100644 index 0000000..54973d8 --- /dev/null +++ b/assets/scripts/equipment/permanents/rest.lua @@ -0,0 +1,19 @@ +register_card("REST", { + name = l("cards.REST.name", "Short Rest"), + description = l("cards.REST.description", "Heal for 1 (+1 per level)."), + state = function(ctx) + return string.format(l("cards.REST.state", "Take a short rest. Heal for %s."), highlight(1 + ctx.level)) + end, + tags = { "HEAL" }, + max_level = 3, + color = COLOR_GREEN, + need_target = false, + point_cost = 1, + price = 120, + callbacks = { + on_cast = function(ctx) + heal(ctx.caster, ctx.caster, 1 + ctx.level) + return nil + end + }, +})