diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..65180e4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "Lua.diagnostics.globals": [ + "Jen", + "Jane" + ] +} \ No newline at end of file diff --git a/assets/1x/Void.png b/assets/1x/Void.png new file mode 100644 index 0000000..9ad6d1d Binary files /dev/null and b/assets/1x/Void.png differ diff --git a/assets/2x/Void.png b/assets/2x/Void.png new file mode 100644 index 0000000..b1d040c Binary files /dev/null and b/assets/2x/Void.png differ diff --git a/assets/sounds/void.ogg b/assets/sounds/void.ogg new file mode 100644 index 0000000..4bbbd57 Binary files /dev/null and b/assets/sounds/void.ogg differ diff --git a/localization/en-us.lua b/localization/en-us.lua index 408f987..4ee100a 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -1,7 +1,7 @@ return { descriptions = { Joker = { - j_Roland_Escapey = { + j_Roland_escapey = { name = "Escapey", text = { "Destroy {C:attention}tags{} and {C:attention}non-selected", @@ -33,6 +33,15 @@ return { }, } }, + Spectral = { + c_Roland_void = { + name = "Void", + text = { + "{C:red}Destroys {C:attention}all {}owned", + "{C:attention}playing cards", + } + } + } }, misc = { challenge_names = { diff --git a/manifest.json b/manifest.json index fea5c43..1456592 100644 --- a/manifest.json +++ b/manifest.json @@ -1,15 +1,15 @@ { - "priority": 0, + "priority": -2, "id": "Roland", "name": "Roland", "prefix": "Roland", "author": ["Emik"], - "version": "0.1.1", + "version": "1.0.0", "badge_colour": "8BE9FD", "main_file": "src/main.lua", "badge_text_colour": "44475A", "display_name": "Roland (Emik)", - "description": "Adds the most important joker, as well as a handful of challenges.", + "description": "Adds the most important joker, a wild spectral, and a small handful of challenges.", "provides": [], "conflicts": [], "dependencies": [ diff --git a/refs/BalatroBakery b/refs/BalatroBakery new file mode 120000 index 0000000..6eb6c90 --- /dev/null +++ b/refs/BalatroBakery @@ -0,0 +1 @@ +../../BalatroBakery/src/ \ No newline at end of file diff --git a/refs/Cryptid b/refs/Cryptid new file mode 120000 index 0000000..3a564cd --- /dev/null +++ b/refs/Cryptid @@ -0,0 +1 @@ +../../Cryptid/ \ No newline at end of file diff --git a/refs/Talisman b/refs/Talisman new file mode 120000 index 0000000..82b90f1 --- /dev/null +++ b/refs/Talisman @@ -0,0 +1 @@ +../../Talisman/ \ No newline at end of file diff --git a/refs/dump b/refs/dump new file mode 120000 index 0000000..59af519 --- /dev/null +++ b/refs/dump @@ -0,0 +1 @@ +../../lovely/dump/ \ No newline at end of file diff --git a/refs/lsp_def b/refs/lsp_def new file mode 120000 index 0000000..e1a2049 --- /dev/null +++ b/refs/lsp_def @@ -0,0 +1 @@ +../../smods/lsp_def/ \ No newline at end of file diff --git a/src/challenge.lua b/src/challenge.lua index 905da35..e1f573c 100644 --- a/src/challenge.lua +++ b/src/challenge.lua @@ -7,20 +7,23 @@ SMODS.Challenge { restrictions = jokerful } -if Jen then +if Jen or Jane then + local deck = Jen and "b_jen_nitro" or "b_jane_nitro" + local card = Jen and "j_jen_saint" or "b_jane_nitro" + SMODS.Challenge { key = "Ascension", - deck = {type = "b_jen_nitro"}, + deck = {type = deck}, rules = {custom = {{id = "Roland_Saint"}, {id = "Roland_Accelerated"}}}, - jokers = {{id = "j_jen_saint", eternal = true}}, + jokers = {{id = card, eternal = true}}, } SMODS.Challenge { key = "Soaring", - deck = {type = "b_jen_nitro"}, + deck = {type = deck}, sleeve = "sleeve_cry_equilibrium_sleeve", rules = {custom = {{id = "Roland_Saint"}, {id = "Roland_Accelerated"}}}, - jokers = {{id = "j_jen_saint", eternal = true}}, + jokers = {{id = card, eternal = true}}, } SMODS.Challenge { diff --git a/src/joker.lua b/src/joker.lua index fd0add9..0ceef63 100644 --- a/src/joker.lua +++ b/src/joker.lua @@ -1,4 +1,12 @@ ----@diagnostic disable: missing-parameter +local function can_use() + return not ((G.play and #G.play.cards > 0 or + G.CONTROLLER.locked or + (G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and + G.STATE ~= G.STATES.HAND_PLAYED and + G.STATE ~= G.STATES.DRAW_TO_HAND and + G.STATE ~= G.STATES.PLAY_TAROT) +end + local function common_hand() return (G.GAME or {}).current_round and F.reduce( G.GAME.hands, @@ -24,23 +32,21 @@ local function is_mergeable_with(it) end SMODS.Atlas { - key = "Escapey", - path = "Escapey.png", px = 71, - py = 95 + py = 95, + key = "escapey", + path = "escapey.png", } SMODS.Joker { - key = "Escapey", - atlas = "Escapey", + key = "escapey", + atlas = "escapey", pos = {x = 0, y = 0}, sinis = {x = 2, y = 0}, soul_pos = {x = 1, y = 0}, config = {extra = {level_up_by = 1}}, cost = 8, rarity = 3, - unlocked = true, - discovered = true, eternal_compat = true, perishable_compat = true, blueprint_compat = false, @@ -65,7 +71,7 @@ SMODS.Joker { }} end, Bakery_can_use = function(_, card) - return not card.debuff and ( + return not card.debuff and can_use() and ( #G.GAME.tags ~= 0 or F.any(G.consumeables.cards, destructible) or F.any(F.filter(G.jokers.cards, is_mergeable_with(card))) @@ -129,14 +135,13 @@ SMODS.Joker { end if hand == "all" or hand == "allhands" or hand == "all_hands" then - update(localize("k_all_hands"), "...", "...", "", notify) + update(localize("k_all_hands"), "...", "...", "") elseif G.GAME.hands[hand or "NO_HAND_SPECIFIED"] then update( localize(hand, "poker_hands"), G.GAME.hands[hand].chips, G.GAME.hands[hand].mult, - G.GAME.hands[hand].level, - notify + G.GAME.hands[hand].level ) end diff --git a/src/main.lua b/src/main.lua index a015fef..2ed4b57 100644 --- a/src/main.lua +++ b/src/main.lua @@ -1,10 +1,11 @@ assert(SMODS.load_file("src/LuaFunctional/functional.lua"))() assert(SMODS.load_file("src/challenge.lua"))() +assert(SMODS.load_file("src/spectral.lua"))() assert(SMODS.load_file("src/joker.lua"))() SMODS.Atlas { - path = "Icon.png", - key = "modicon", px = 256, py = 256, + key = "modicon", + path = "icon.png", } diff --git a/src/spectral.lua b/src/spectral.lua new file mode 100644 index 0000000..ffbb7f6 --- /dev/null +++ b/src/spectral.lua @@ -0,0 +1,55 @@ +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 + (G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and + G.STATE ~= G.STATES.HAND_PLAYED and + G.STATE ~= G.STATES.DRAW_TO_HAND and + G.STATE ~= G.STATES.PLAY_TAROT) +end + +SMODS.Atlas { + px = 71, + py = 95, + key = "void", + path = "void.png" +} + +SMODS.Consumable { + key = "void", + set = "Spectral", + pos = {x = 0, y = 0}, + cost = 6, + atlas = "void", + can_use = function(_, _) + return #G.playing_cards > 1 and can_use() + end, + use = function(_, _, _, _) + local function calculate_joker(v) + v:calculate_joker({remove_playing_cards = true, removed = G.playing_cards}) + end + + local function destroy(v) + if v.area then + v.area:remove_card(v) + end + + v.rhm = false + v:start_dissolve() + end + + play_sound("Roland_void", 1, 0.7) + + G.E_MANAGER:add_event(Event({ + delay = 0.27, + timer = 'REAL', + trigger = 'after', + func = function() + F.foreach(G.playing_cards, destroy) + F.foreach(G.jokers.cards, calculate_joker) + return true + end + })) + end +} \ No newline at end of file