diff --git a/assets/1x/afterimage.png b/assets/1x/afterimage.png new file mode 100644 index 0000000..672d932 Binary files /dev/null and b/assets/1x/afterimage.png differ diff --git a/assets/2x/afterimage.png b/assets/2x/afterimage.png new file mode 100644 index 0000000..0125577 Binary files /dev/null and b/assets/2x/afterimage.png differ diff --git a/localization/en-us.lua b/localization/en-us.lua index c06f480..39fd1c5 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -44,6 +44,14 @@ return { }, }, Spectral = { + c_Roland_afterimage = { + name = "Afterimage", + text = { + "Add {C:dark_edition}Negative {}to {C:attention}#1#", + "selected card in hand", + "{C:red}#2#{} hand size", + }, + }, c_Roland_void = { name = "Void", text = { diff --git a/manifest.json b/manifest.json index 0d9f9a5..6010945 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "author": [ "Emik" ], - "version": "1.3.2", + "version": "1.4.0", "badge_colour": "8BE9FD", "main_file": "src/main.lua", "badge_text_colour": "44475A", diff --git a/src/spectral.lua b/src/spectral.lua index d02541e..1a81b6e 100644 --- a/src/spectral.lua +++ b/src/spectral.lua @@ -1,5 +1,3 @@ -SMODS.Sound({key = "void", path = "void.ogg"}) - local function can_use() return not ((G.play and #G.play.cards > 0 or G.CONTROLLER.locked or @@ -9,6 +7,15 @@ local function can_use() G.STATE ~= G.STATES.PLAY_TAROT) end +SMODS.Sound({key = "void", path = "void.ogg"}) + +SMODS.Atlas { + px = 71, + py = 95, + key = "afterimage", + path = "afterimage.png", +} + SMODS.Atlas { px = 71, py = 95, @@ -16,6 +23,42 @@ SMODS.Atlas { path = "void.png", } +SMODS.Consumable { + key = "afterimage", + set = "Spectral", + pos = {x = 0, y = 0}, + cost = 6, + atlas = "afterimage", + config = {extra = {amount = 1, hand = -1}}, + loc_vars = function(_, _, card) + return {vars = {card.ability.extra.amount, card.ability.extra.hand}} + end, + can_use = function(_, card) + return can_use() and card.ability.extra.amount == #Bakery_API.get_highlighted() + end, + use = function(_, card, _, _) + for _, v in ipairs(Bakery_API.get_highlighted()) do + G.E_MANAGER:add_event(Event { + delay = 0.1, + func = function() + v:set_edition({negative = true}) + v:juice_up(0.5, 0.5) + return true + end, + }) + end + + G.E_MANAGER:add_event(Event { + delay = 0.1, + func = function() + G.hand:change_size(card.ability.extra.hand) + Bakery_API.unhighlight_all() + return true + end, + }) + end, +} + SMODS.Consumable { key = "void", set = "Spectral",