Compare commits
No commits in common. "main" and "1.0.0" have entirely different histories.
171
.editorconfig
|
|
@ -1,171 +0,0 @@
|
||||||
|
|
||||||
# see https://github.com/CppCXY/EmmyLuaCodeStyle
|
|
||||||
[*.lua]
|
|
||||||
# [basic]
|
|
||||||
|
|
||||||
# optional space/tab
|
|
||||||
indent_style = space
|
|
||||||
# if indent_style is space, this is valid
|
|
||||||
indent_size = 4
|
|
||||||
# if indent_style is tab, this is valid
|
|
||||||
tab_width = 4
|
|
||||||
# none/single/double
|
|
||||||
quote_style = double
|
|
||||||
|
|
||||||
continuation_indent = 4
|
|
||||||
## extend option
|
|
||||||
# continuation_indent.before_block = 4
|
|
||||||
# continuation_indent.in_expr = 4
|
|
||||||
# continuation_indent.in_table = 4
|
|
||||||
|
|
||||||
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
|
|
||||||
# this option decides when to chopdown the code
|
|
||||||
max_line_length = 120
|
|
||||||
|
|
||||||
# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
|
|
||||||
# in neovim the value 'auto' is not a valid option, please use 'unset'
|
|
||||||
end_of_line = lf
|
|
||||||
|
|
||||||
# none/ comma / semicolon / only_kv_colon
|
|
||||||
table_separator_style = none
|
|
||||||
|
|
||||||
#optional keep/never/always/smart
|
|
||||||
trailing_table_separator = smart
|
|
||||||
|
|
||||||
# keep/remove/remove_table_only/remove_string_only
|
|
||||||
call_arg_parentheses = keep
|
|
||||||
|
|
||||||
detect_end_of_line = false
|
|
||||||
|
|
||||||
# this will check text end with new line
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
# [space]
|
|
||||||
space_around_table_field_list = false
|
|
||||||
|
|
||||||
space_before_attribute = false
|
|
||||||
|
|
||||||
space_before_function_open_parenthesis = false
|
|
||||||
|
|
||||||
space_before_function_call_open_parenthesis = false
|
|
||||||
|
|
||||||
space_before_closure_open_parenthesis = false
|
|
||||||
|
|
||||||
# optional always/only_string/only_table/none
|
|
||||||
# or true/false
|
|
||||||
space_before_function_call_single_arg = always
|
|
||||||
## extend option
|
|
||||||
## always/keep/none
|
|
||||||
# space_before_function_call_single_arg.table = always
|
|
||||||
## always/keep/none
|
|
||||||
# space_before_function_call_single_arg.string = always
|
|
||||||
|
|
||||||
space_before_open_square_bracket = false
|
|
||||||
|
|
||||||
space_inside_function_call_parentheses = false
|
|
||||||
|
|
||||||
space_inside_function_param_list_parentheses = false
|
|
||||||
|
|
||||||
space_inside_square_brackets = false
|
|
||||||
|
|
||||||
# like t[#t+1] = 1
|
|
||||||
space_around_table_append_operator = false
|
|
||||||
|
|
||||||
ignore_spaces_inside_function_call = false
|
|
||||||
|
|
||||||
# detail number or 'keep'
|
|
||||||
space_before_inline_comment = 1
|
|
||||||
|
|
||||||
# convert '---' to '--- ' or '--' to '-- '
|
|
||||||
space_after_comment_dash = false
|
|
||||||
|
|
||||||
# [operator space]
|
|
||||||
space_around_math_operator = true
|
|
||||||
# space_around_math_operator.exponent = false
|
|
||||||
|
|
||||||
space_after_comma = true
|
|
||||||
|
|
||||||
space_after_comma_in_for_statement = true
|
|
||||||
|
|
||||||
# true/false or none/always/no_space_asym
|
|
||||||
space_around_concat_operator = true
|
|
||||||
|
|
||||||
space_around_logical_operator = true
|
|
||||||
|
|
||||||
# true/false or none/always/no_space_asym
|
|
||||||
space_around_assign_operator = true
|
|
||||||
|
|
||||||
# [align]
|
|
||||||
|
|
||||||
align_call_args = false
|
|
||||||
|
|
||||||
align_function_params = true
|
|
||||||
|
|
||||||
# true/false or always
|
|
||||||
align_continuous_assign_statement = true
|
|
||||||
|
|
||||||
align_continuous_rect_table_field = true
|
|
||||||
|
|
||||||
align_continuous_line_space = 2
|
|
||||||
|
|
||||||
align_if_branch = false
|
|
||||||
|
|
||||||
# option none / always / contain_curly/
|
|
||||||
align_array_table = true
|
|
||||||
|
|
||||||
align_continuous_similar_call_args = false
|
|
||||||
|
|
||||||
align_continuous_inline_comment = true
|
|
||||||
# option none / always / only_call_stmt
|
|
||||||
align_chain_expr = none
|
|
||||||
|
|
||||||
# [indent]
|
|
||||||
|
|
||||||
never_indent_before_if_condition = false
|
|
||||||
|
|
||||||
never_indent_comment_on_if_branch = false
|
|
||||||
|
|
||||||
keep_indents_on_empty_lines = false
|
|
||||||
|
|
||||||
allow_non_indented_comments = false
|
|
||||||
# [line space]
|
|
||||||
|
|
||||||
# The following configuration supports four expressions
|
|
||||||
# keep
|
|
||||||
# fixed(n)
|
|
||||||
# min(n)
|
|
||||||
# max(n)
|
|
||||||
# for eg. min(2)
|
|
||||||
|
|
||||||
line_space_after_if_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_do_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_while_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_repeat_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_for_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_local_or_assign_statement = max(2)
|
|
||||||
|
|
||||||
line_space_after_function_statement = fixed(2)
|
|
||||||
|
|
||||||
line_space_after_expression_statement = max(2)
|
|
||||||
|
|
||||||
line_space_after_comment = fixed(1)
|
|
||||||
|
|
||||||
line_space_around_block = fixed(1)
|
|
||||||
# [line break]
|
|
||||||
break_all_list_when_line_exceed = false
|
|
||||||
|
|
||||||
auto_collapse_lines = false
|
|
||||||
|
|
||||||
break_before_braces = false
|
|
||||||
|
|
||||||
# [preference]
|
|
||||||
ignore_space_after_colon = false
|
|
||||||
|
|
||||||
remove_call_expression_list_finish_comma = true
|
|
||||||
# keep / always / same_line / replace_with_newline / never
|
|
||||||
end_statement_with_semicolon = replace_with_newline
|
|
||||||
4
.gitmodules
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
[submodule "src/LuaFunctional"]
|
[submodule "src/LuaFunctional"]
|
||||||
path = src/LuaFunctional
|
path = "src/LuaFunctional"
|
||||||
url = https://github.com/BakersDozenBagels/LuaFunctional.git
|
url = "https://github.com/BakersDozenBagels/LuaFunctional.git"
|
||||||
|
|
|
||||||
6
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"Lua.diagnostics.globals": [
|
||||||
|
"Jen",
|
||||||
|
"Jane"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
assets/1x/Escapey.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
assets/1x/Escapey.png.kra
Normal file
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
BIN
assets/2x/Escapey.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
assets/2x/Escapey.png.kra
Normal file
BIN
assets/2x/Icon.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
assets/2x/Void.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
|
@ -1 +0,0 @@
|
||||||
for /F %%x in ('dir /B/D 1x') do magick 1x\%%x -scale 200%% 2x\%%x
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
for file in 1x/*.png; do
|
|
||||||
filename=$(basename "$file")
|
|
||||||
output_file="2x/${filename}"
|
|
||||||
magick "$file" -filter point -resize 200% "$output_file"
|
|
||||||
done
|
|
||||||
|
|
@ -1,20 +1,10 @@
|
||||||
return {
|
return {
|
||||||
descriptions = {
|
descriptions = {
|
||||||
Blind = {
|
|
||||||
bl_Roland_improbable = {
|
|
||||||
name = "The Improbable",
|
|
||||||
text = {"{C:attention}All probabilities", "cannot happen"},
|
|
||||||
},
|
|
||||||
bl_Roland_nimble = {
|
|
||||||
name = "The Nimble",
|
|
||||||
text = {"The first {C:attention}5 cards", "drawn are {C:attention}played"},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Joker = {
|
Joker = {
|
||||||
j_Roland_escapey = {
|
j_Roland_escapey = {
|
||||||
name = "Escapey",
|
name = "Escapey",
|
||||||
text = {
|
text = {
|
||||||
"Destroy {C:attention}tags{} or {C:attention}non-selected",
|
"Destroy {C:attention}tags{} and {C:attention}non-selected",
|
||||||
"{C:attention}consumables{} on use. Level up",
|
"{C:attention}consumables{} on use. Level up",
|
||||||
"the {C:planet}most played hand{} by {C:planet}#1#{}",
|
"the {C:planet}most played hand{} by {C:planet}#1#{}",
|
||||||
"for each destroyed object",
|
"for each destroyed object",
|
||||||
|
|
@ -23,51 +13,48 @@ return {
|
||||||
"#3#{C:inactive,s:0.75,E:1}#4#{C:red,s:1.5,E:1}#5#",
|
"#3#{C:inactive,s:0.75,E:1}#4#{C:red,s:1.5,E:1}#5#",
|
||||||
"#6#{C:blue,E:1}#7#{}#8#{C:inactive,s:0.75,E:1}#9#{C:red,s:1.5,E:1}#10#",
|
"#6#{C:blue,E:1}#7#{}#8#{C:inactive,s:0.75,E:1}#9#{C:red,s:1.5,E:1}#10#",
|
||||||
},
|
},
|
||||||
merge = {"Since no objects apply, fuse", "with other ", " jokers"},
|
merge = {"Since no objects apply, merge", "with other ", " jokers"},
|
||||||
quotes = {
|
quotes = {
|
||||||
marble = {{"there is no escape..."}},
|
marble = {{"there is no escape..."}},
|
||||||
normal = {
|
normal = {
|
||||||
{"I can't wait to", "work with you!"},
|
{"I can't wait to", "work with you!"},
|
||||||
{"Did you need something", "from me?"},
|
{"Did you need something", "from me?"},
|
||||||
{"Oh! I'm just so", "happy to see you!"},
|
{"Oh! I'm just so", "happy to see you!"},
|
||||||
{"Can I talk about something irrelevant?", "I promise it won't be long."},
|
{"Can I talk about something irrelevant?", "I promise it won't be long."},
|
||||||
{"Can you introduce me to your friends?", "Assuming you have friends of course!"},
|
{"Can you introduce me to your friends?", "Assuming you have friends of course!"},
|
||||||
},
|
},
|
||||||
scared = {
|
scared = {
|
||||||
{"What am I", "going to do?!"},
|
{"What am I", "going to do?!"},
|
||||||
{"I'm not scared,", "you are!"},
|
{"I'm not scared,", "you are!"},
|
||||||
{"Tell me when", "this is over..."},
|
{"Tell me when", "this is over..."},
|
||||||
{"I can't keep", "looking at this!"},
|
{"I can't keep", "looking at this!"},
|
||||||
{"Let me go hide in", "this corner... Okay?"},
|
{"Let me go hide in", "this corner... Okay?"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
Spectral = {
|
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 = {
|
c_Roland_void = {
|
||||||
name = "Void",
|
name = "Void",
|
||||||
text = {
|
text = {
|
||||||
"{C:red}Destroys {X:red,C:white}all{} owned",
|
"{C:red}Destroys {C:attention}all {}owned",
|
||||||
"playing cards {}for",
|
"{C:attention}playing cards",
|
||||||
"{C:attention}#1# {C:dark_edition}Negative {C:spectral}Cryptids",
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
misc = {
|
misc = {
|
||||||
challenge_names = {
|
challenge_names = {
|
||||||
|
c_Roland_Soaring = "Soaring",
|
||||||
c_Roland_Jokerful = "Jokerful",
|
c_Roland_Jokerful = "Jokerful",
|
||||||
|
c_Roland_Ascension = "Ascension",
|
||||||
|
c_Roland_Balanced_Jokers = "Balanced Jokers",
|
||||||
},
|
},
|
||||||
v_text = {
|
v_text = {
|
||||||
|
ch_c_Roland_Accelerated = {"Start with {C:blue}Accelerated Deck"},
|
||||||
|
ch_c_Roland_Saint = {"Start with an {C:attention}Eternal {C:legendary}Saint"},
|
||||||
ch_c_Roland_Jokerful = {"Only the {C:common}default Joker{} can appear in shops"},
|
ch_c_Roland_Jokerful = {"Only the {C:common}default Joker{} can appear in shops"},
|
||||||
},
|
ch_c_Roland_Balanced_Jokers = {"All Cryptid and Jen's jokers {C:attention}cannot appear"},
|
||||||
},
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,18 @@
|
||||||
"id": "Roland",
|
"id": "Roland",
|
||||||
"name": "Roland",
|
"name": "Roland",
|
||||||
"prefix": "Roland",
|
"prefix": "Roland",
|
||||||
"author": [
|
"author": ["Emik"],
|
||||||
"Emik"
|
"version": "1.0.0",
|
||||||
],
|
|
||||||
"version": "1.4.5",
|
|
||||||
"badge_colour": "8BE9FD",
|
"badge_colour": "8BE9FD",
|
||||||
"main_file": "src/main.lua",
|
"main_file": "src/main.lua",
|
||||||
"badge_text_colour": "44475A",
|
"badge_text_colour": "44475A",
|
||||||
"display_name": "Roland (Emik)",
|
"display_name": "Roland (Emik)",
|
||||||
"description": "Adds several disconnected funny ideas I had in my head that I couldn't resist implementing in the game.",
|
"description": "Adds the most important joker, a wild spectral, and a small handful of challenges.",
|
||||||
"provides": [],
|
"provides": [],
|
||||||
"conflicts": [],
|
"conflicts": [],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"Steamodded (>=1.*)",
|
"Steamodded (>=1.*)",
|
||||||
"Lovely (>=0.6)",
|
"Lovely (>=0.6)",
|
||||||
"Bakery (>=1.3.2~*)"
|
"Bakery (>=1.3.2~*)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 4f3eae046476664b720a96f91b0e04f388709bbb
|
|
||||||
111
src/blind.lua
|
|
@ -1,111 +0,0 @@
|
||||||
SMODS.Atlas {
|
|
||||||
px = 34,
|
|
||||||
py = 34,
|
|
||||||
frames = 21,
|
|
||||||
key = "blind",
|
|
||||||
path = "blind.png",
|
|
||||||
atlas_table = "ANIMATION_ATLAS",
|
|
||||||
}
|
|
||||||
|
|
||||||
local function disable_improbable()
|
|
||||||
G.GAME.improbable = nil
|
|
||||||
local orig = (getmetatable(G.GAME.probabilities) or {}).orig
|
|
||||||
|
|
||||||
if orig then
|
|
||||||
G.GAME.probabilities = orig
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if cry_prob then
|
|
||||||
local orig_prob = cry_prob
|
|
||||||
|
|
||||||
---@diagnostic disable-next-line: lowercase-global
|
|
||||||
cry_prob = function(owned, den, rigged)
|
|
||||||
return G.GAME.improbable and 0 or orig_prob(owned, den, rigged)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local orig_update = Game.update
|
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
function Game:update(dt)
|
|
||||||
orig_update(self, dt)
|
|
||||||
local orig = G.GAME.probabilities
|
|
||||||
|
|
||||||
if not G.GAME.improbable or getmetatable(orig) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local normal = orig.normal
|
|
||||||
|
|
||||||
local mt = {
|
|
||||||
orig = orig,
|
|
||||||
__index = function(_, k)
|
|
||||||
return k == "normal" and 0 or orig[k]
|
|
||||||
end,
|
|
||||||
__newindex = function(_, k, v)
|
|
||||||
orig[k] = (k == "normal" and v == 0) and normal or v
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
local proxy = {}
|
|
||||||
setmetatable(proxy, mt)
|
|
||||||
G.GAME.probabilities = proxy
|
|
||||||
end
|
|
||||||
|
|
||||||
SMODS.Blind {
|
|
||||||
key = "improbable",
|
|
||||||
boss = {min = 2, max = 10},
|
|
||||||
boss_colour = HEX("009966"),
|
|
||||||
atlas = "blind",
|
|
||||||
pos = {x = 0, y = 0},
|
|
||||||
mult = 2,
|
|
||||||
dollars = 5,
|
|
||||||
defeat = disable_improbable,
|
|
||||||
disable = disable_improbable,
|
|
||||||
set_blind = function(_)
|
|
||||||
G.GAME.improbable = true
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
SMODS.Blind {
|
|
||||||
key = "nimble",
|
|
||||||
boss = {min = 1, max = 10},
|
|
||||||
boss_colour = HEX("0291fb"),
|
|
||||||
atlas = "blind",
|
|
||||||
pos = {x = 0, y = 1},
|
|
||||||
mult = 2,
|
|
||||||
dollars = 5,
|
|
||||||
defeat = function(self)
|
|
||||||
self.disabled = false
|
|
||||||
end,
|
|
||||||
disable = function(self)
|
|
||||||
self.disabled = true
|
|
||||||
end,
|
|
||||||
drawn_to_hand = function(self)
|
|
||||||
local function force_hand()
|
|
||||||
for i, v in ipairs(G.hand.cards) do
|
|
||||||
if i > 5 then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
|
|
||||||
G.hand:add_to_highlighted(v, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
G.FUNCS.play_cards_from_highlighted(nil)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
if not self.disabled then
|
|
||||||
self.disabled = true
|
|
||||||
G.E_MANAGER:add_event(Event({
|
|
||||||
delay = 1,
|
|
||||||
trigger = "after",
|
|
||||||
func = force_hand,
|
|
||||||
}))
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
set_blind = function(self)
|
|
||||||
self.disabled = false
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +1,54 @@
|
||||||
local jokerful = {banned_cards = {}}
|
local jokerful = {banned_cards = {}}
|
||||||
|
local balanced_jokers = {banned_cards = {}}
|
||||||
|
|
||||||
SMODS.Challenge {
|
SMODS.Challenge {
|
||||||
key = "Jokerful",
|
key = "Jokerful",
|
||||||
rules = {custom = {{id = "Roland_Jokerful"}}},
|
rules = {custom = {{id = "Roland_Jokerful"}}},
|
||||||
restrictions = jokerful,
|
restrictions = jokerful
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 = deck},
|
||||||
|
rules = {custom = {{id = "Roland_Saint"}, {id = "Roland_Accelerated"}}},
|
||||||
|
jokers = {{id = card, eternal = true}},
|
||||||
|
}
|
||||||
|
|
||||||
|
SMODS.Challenge {
|
||||||
|
key = "Soaring",
|
||||||
|
deck = {type = deck},
|
||||||
|
sleeve = "sleeve_cry_equilibrium_sleeve",
|
||||||
|
rules = {custom = {{id = "Roland_Saint"}, {id = "Roland_Accelerated"}}},
|
||||||
|
jokers = {{id = card, eternal = true}},
|
||||||
|
}
|
||||||
|
|
||||||
|
SMODS.Challenge {
|
||||||
|
key = "Balanced_Jokers",
|
||||||
|
rules = {custom = {{id = "Roland_Balanced_Jokers"}}},
|
||||||
|
restrictions = balanced_jokers
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
G.E_MANAGER:add_event(Event {
|
G.E_MANAGER:add_event(Event {
|
||||||
trigger = "immediate",
|
trigger = "immediate",
|
||||||
func = function()
|
func = function()
|
||||||
F.foreach(
|
jokerful.banned_cards = F.map(
|
||||||
F.filter(
|
F.filter(
|
||||||
G.P_CENTERS,
|
G.P_CENTERS,
|
||||||
function(v) return v.set == "Joker" end
|
function (v) return v.set == "Joker" end
|
||||||
),
|
),
|
||||||
function(v) table.insert(jokerful.banned_cards, {id = v.key}) end
|
function (v) return { id = v.key } end
|
||||||
|
)
|
||||||
|
|
||||||
|
balanced_jokers.banned_cards = F.filter(
|
||||||
|
jokerful.banned_cards,
|
||||||
|
function (v) return v.id:sub(1, 6) == "j_cry_" or v.id:sub(1, 6) == "j_jen_" end
|
||||||
)
|
)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end,
|
end
|
||||||
})
|
})
|
||||||
|
|
|
||||||
140
src/joker.lua
|
|
@ -1,7 +1,7 @@
|
||||||
local function can_use()
|
local function can_use()
|
||||||
return not ((G.play and #G.play.cards > 0 or
|
return not ((G.play and #G.play.cards > 0 or
|
||||||
G.CONTROLLER.locked or
|
G.CONTROLLER.locked or
|
||||||
(G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and
|
(G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and
|
||||||
G.STATE ~= G.STATES.HAND_PLAYED and
|
G.STATE ~= G.STATES.HAND_PLAYED and
|
||||||
G.STATE ~= G.STATES.DRAW_TO_HAND and
|
G.STATE ~= G.STATES.DRAW_TO_HAND and
|
||||||
G.STATE ~= G.STATES.PLAY_TAROT)
|
G.STATE ~= G.STATES.PLAY_TAROT)
|
||||||
|
|
@ -11,7 +11,7 @@ local function common_hand()
|
||||||
return (G.GAME or {}).current_round and F.reduce(
|
return (G.GAME or {}).current_round and F.reduce(
|
||||||
G.GAME.hands,
|
G.GAME.hands,
|
||||||
{name = "High Card", order = -1 / 0, played = 0},
|
{name = "High Card", order = -1 / 0, played = 0},
|
||||||
function(a, v, k)
|
function (a, v, k)
|
||||||
return (a.played < v.played or (a.played == v.played) and (a.order > v.order)) and
|
return (a.played < v.played or (a.played == v.played) and (a.order > v.order)) and
|
||||||
{name = k, order = v.order, played = v.played} or a
|
{name = k, order = v.order, played = v.played} or a
|
||||||
end,
|
end,
|
||||||
|
|
@ -24,9 +24,9 @@ local function destructible(card)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_mergeable_with(it)
|
local function is_mergeable_with(it)
|
||||||
return function(card)
|
return function (card)
|
||||||
return it.rank ~= card.rank and
|
return it.rank ~= card.rank and
|
||||||
card.label == "j_Roland_escapey" and not
|
card.label == 'j_Roland_Escapey' and not
|
||||||
(card.ability or {}).eternal
|
(card.ability or {}).eternal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -51,43 +51,25 @@ SMODS.Joker {
|
||||||
perishable_compat = true,
|
perishable_compat = true,
|
||||||
blueprint_compat = false,
|
blueprint_compat = false,
|
||||||
loc_vars = function(_, _, card)
|
loc_vars = function(_, _, card)
|
||||||
local loc_self = G.localization.descriptions.Joker.j_Roland_escapey
|
local loc_self = G.localization.descriptions.Joker.j_Roland_Escapey
|
||||||
|
|
||||||
---@diagnostic disable-next-line: undefined-global
|
|
||||||
local sinister = (Jen or {}).sinister or G.escapey_sinister
|
|
||||||
local quotes = loc_self.quotes
|
local quotes = loc_self.quotes
|
||||||
|
local merge = G.jokers and F.count(F.filter(G.jokers.cards, is_mergeable_with(card))) > 1 and loc_self.merge or {}
|
||||||
|
local normal = (merge[1] or (Jen or Jane or {}).sinister) and {} or quotes.normal[math.random(#quotes.normal)]
|
||||||
|
local scared = (merge[1] or not (Jen or Jane or {}).sinister) and {} or quotes.normal[math.random(#quotes.normal)]
|
||||||
|
|
||||||
local merge = G.jokers
|
return {vars = {
|
||||||
and F.count(F.filter(G.jokers.cards, is_mergeable_with(card))) > 0
|
card.ability.extra.level_up_by,
|
||||||
and loc_self.merge or {}
|
localize(common_hand(), "poker_hands"),
|
||||||
|
merge[1] or "",
|
||||||
local normal = (merge[1] or sinister) and {} or
|
normal[1] or "",
|
||||||
pseudorandom_element(quotes.normal, pseudoseed("EscapeyQuotes")) or {}
|
scared[1] or "",
|
||||||
|
merge[2] or "",
|
||||||
local scared = (merge[1] or not sinister) and {} or
|
merge[3] and loc_self.name or "",
|
||||||
pseudorandom_element(quotes.scared, pseudoseed("EscapeyQuotes")) or {}
|
merge[3] or "",
|
||||||
|
normal[2] or "",
|
||||||
return {
|
scared[2] or "",
|
||||||
vars = {
|
}}
|
||||||
card.ability.extra.level_up_by,
|
|
||||||
localize(common_hand(), "poker_hands"),
|
|
||||||
merge[1] or "",
|
|
||||||
normal[1] or "",
|
|
||||||
scared[1] or "",
|
|
||||||
merge[2] or "",
|
|
||||||
merge[3] and loc_self.name or "",
|
|
||||||
merge[3] or "",
|
|
||||||
normal[2] or "",
|
|
||||||
scared[2] or "",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
calculate = function(_, _, context)
|
|
||||||
if type(G.escapey_debugger) == "function" then
|
|
||||||
G.escapey_debugger(F.reduce(context, "", function(acc, _, next) return acc .. ", " .. next end, pairs):sub(2))
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
---@param card Card
|
|
||||||
Bakery_can_use = function(_, card)
|
Bakery_can_use = function(_, card)
|
||||||
return not card.debuff and can_use() and (
|
return not card.debuff and can_use() and (
|
||||||
#G.GAME.tags ~= 0 or
|
#G.GAME.tags ~= 0 or
|
||||||
|
|
@ -95,40 +77,27 @@ SMODS.Joker {
|
||||||
F.any(F.filter(G.jokers.cards, is_mergeable_with(card)))
|
F.any(F.filter(G.jokers.cards, is_mergeable_with(card)))
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
---@param card Card
|
|
||||||
Bakery_use_button_text = function(_, card)
|
Bakery_use_button_text = function(_, card)
|
||||||
if card.debuff then
|
return card.debuff and "DEBUFFED" or
|
||||||
return "DEBUFFED"
|
((#G.GAME.tags == 0 and not
|
||||||
end
|
F.any(G.consumeables.cards, destructible) and
|
||||||
|
F.any(F.filter(G.jokers.cards, is_mergeable_with(card)))) and "MERGE" or "ESCAPE")
|
||||||
return #G.GAME.tags == 0 and F.count(G.consumeables.cards, destructible) == 0 and
|
|
||||||
F.any(F.filter(G.jokers.cards, is_mergeable_with(card))) and "FUSE" or "ESCAPE"
|
|
||||||
end,
|
end,
|
||||||
---@param card Card
|
|
||||||
Bakery_use_joker = function(_, card)
|
Bakery_use_joker = function(_, card)
|
||||||
if card.debuff then
|
local hand, object_count = common_hand(), F.count(F.filter(G.consumeables.cards, destructible)) + #G.GAME.tags
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local consumables = F.filter(G.consumeables.cards, destructible)
|
|
||||||
local consumable_count = F.count(consumables)
|
|
||||||
local object_count = consumable_count + #G.GAME.tags
|
|
||||||
|
|
||||||
if object_count == 0 then
|
if object_count == 0 then
|
||||||
local level_sum, sell_sum = 0, 0
|
local sum = 0
|
||||||
|
|
||||||
F.foreach(
|
F.foreach(
|
||||||
F.filter(G.jokers.cards, is_mergeable_with(card)),
|
F.filter(G.jokers.cards, is_mergeable_with(card)),
|
||||||
function(v)
|
function (v)
|
||||||
level_sum = level_sum + v.ability.extra.level_up_by * (v.getEvalQty and v:getEvalQty() or 1)
|
sum = sum + v.ability.extra.level_up_by
|
||||||
sell_sum = sell_sum + v.sell_cost * (v.getEvalQty and v:getEvalQty() or 1)
|
|
||||||
v:start_dissolve({HEX("57ecab")}, nil, 1.6)
|
v:start_dissolve({HEX("57ecab")}, nil, 1.6)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
card.ability.extra.level_up_by = card.ability.extra.level_up_by + level_sum
|
card.ability.extra.level_up_by = card.ability.extra.level_up_by + sum
|
||||||
card.sell_cost = card.sell_cost + sell_sum
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function update(name, chip, mul, lv, notif, snd, vol, pit, de)
|
local function update(name, chip, mul, lv, notif, snd, vol, pit, de)
|
||||||
|
|
@ -136,26 +105,26 @@ SMODS.Joker {
|
||||||
sound = type(snd) == "string" and snd or type(snd) == "nil" and "button",
|
sound = type(snd) == "string" and snd or type(snd) == "nil" and "button",
|
||||||
volume = vol or 0.7,
|
volume = vol or 0.7,
|
||||||
pitch = pit or 0.8,
|
pitch = pit or 0.8,
|
||||||
delay = de or 0.3,
|
delay = de or 0.3
|
||||||
}, {
|
}, {
|
||||||
handname = name or "????",
|
handname = name or "????",
|
||||||
chips = chip or "?",
|
chips = chip or "?",
|
||||||
level = lv or "?",
|
level = lv or "?",
|
||||||
mult = mul or "?",
|
mult = mul or "?",
|
||||||
StatusText = notif,
|
StatusText = notif
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function fast_delete(v)
|
local function fast_nope(v)
|
||||||
return function()
|
return function ()
|
||||||
attention_text({
|
attention_text({
|
||||||
scale = 0.7,
|
text = "NOPE",
|
||||||
align = "cm",
|
|
||||||
text = "ESC",
|
|
||||||
cover = v.HUD_tag,
|
|
||||||
colour = G.C.WHITE,
|
colour = G.C.WHITE,
|
||||||
cover_colour = G.C.BLACK,
|
scale = 0.7,
|
||||||
hold = 0.3 / G.SETTINGS.GAMESPEED,
|
hold = 0.3 / G.SETTINGS.GAMESPEED,
|
||||||
|
cover = v.HUD_tag,
|
||||||
|
cover_colour = G.C.BLACK,
|
||||||
|
align = "cm",
|
||||||
})
|
})
|
||||||
|
|
||||||
play_sound("cancel", 1.66, 0.5)
|
play_sound("cancel", 1.66, 0.5)
|
||||||
|
|
@ -165,8 +134,6 @@ SMODS.Joker {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local hand = common_hand()
|
|
||||||
|
|
||||||
if hand == "all" or hand == "allhands" or hand == "all_hands" then
|
if hand == "all" or hand == "allhands" or hand == "all_hands" then
|
||||||
update(localize("k_all_hands"), "...", "...", "")
|
update(localize("k_all_hands"), "...", "...", "")
|
||||||
elseif G.GAME.hands[hand or "NO_HAND_SPECIFIED"] then
|
elseif G.GAME.hands[hand or "NO_HAND_SPECIFIED"] then
|
||||||
|
|
@ -178,24 +145,19 @@ SMODS.Joker {
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if consumable_count == 0 then
|
F.foreach(
|
||||||
local trigger = #G.GAME.tags >= 30 and "immediate" or "before"
|
F.filter(G.consumeables.cards, destructible),
|
||||||
local delay = #G.GAME.tags >= 30 and 0 or 1 / #G.GAME.tags
|
function (v)
|
||||||
|
v:start_dissolve({HEX("57ecab")}, nil, 1.6)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
F.foreach(
|
F.foreach(
|
||||||
G.GAME.tags,
|
G.GAME.tags,
|
||||||
function(v)
|
function (v)
|
||||||
G.E_MANAGER:add_event(Event {trigger = trigger, blocking = #G.GAME.tags < 30, delay = delay, func = fast_delete(v)})
|
G.E_MANAGER:add_event(Event({trigger = "immediate", func = fast_nope(v)}))
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
else
|
|
||||||
F.foreach(
|
|
||||||
consumables,
|
|
||||||
function(v)
|
|
||||||
v:start_dissolve({HEX("57ecab")}, nil, 1.6)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
level_up_hand(card, hand, nil, object_count * card.ability.extra.level_up_by)
|
level_up_hand(card, hand, nil, object_count * card.ability.extra.level_up_by)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
F = assert(SMODS.load_file("src/LuaFunctional/functional.lua"))()
|
assert(SMODS.load_file("src/LuaFunctional/functional.lua"))()
|
||||||
assert(SMODS.load_file("src/challenge.lua"))()
|
assert(SMODS.load_file("src/challenge.lua"))()
|
||||||
assert(SMODS.load_file("src/spectral.lua"))()
|
assert(SMODS.load_file("src/spectral.lua"))()
|
||||||
assert(SMODS.load_file("src/blind.lua"))()
|
|
||||||
assert(SMODS.load_file("src/joker.lua"))()
|
assert(SMODS.load_file("src/joker.lua"))()
|
||||||
|
|
||||||
SMODS.Atlas {
|
SMODS.Atlas {
|
||||||
|
|
@ -10,5 +9,3 @@ SMODS.Atlas {
|
||||||
key = "modicon",
|
key = "modicon",
|
||||||
path = "icon.png",
|
path = "icon.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
SMODS.Joker:take_ownership("joker", {cost = 1}, true)
|
|
||||||
|
|
|
||||||
127
src/spectral.lua
|
|
@ -1,80 +1,33 @@
|
||||||
|
SMODS.Sound({key = 'void', path = 'void.ogg'})
|
||||||
|
|
||||||
local function can_use()
|
local function can_use()
|
||||||
return not ((G.play and #G.play.cards > 0 or
|
return not ((G.play and #G.play.cards > 0 or
|
||||||
G.CONTROLLER.locked or
|
G.CONTROLLER.locked or
|
||||||
(G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and
|
(G.GAME.STOP_USE and G.GAME.STOP_USE > 0)) and
|
||||||
G.STATE ~= G.STATES.HAND_PLAYED and
|
G.STATE ~= G.STATES.HAND_PLAYED and
|
||||||
G.STATE ~= G.STATES.DRAW_TO_HAND and
|
G.STATE ~= G.STATES.DRAW_TO_HAND and
|
||||||
G.STATE ~= G.STATES.PLAY_TAROT)
|
G.STATE ~= G.STATES.PLAY_TAROT)
|
||||||
end
|
end
|
||||||
|
|
||||||
SMODS.Sound({key = "void", path = "void.ogg"})
|
|
||||||
|
|
||||||
SMODS.Atlas {
|
SMODS.Atlas {
|
||||||
px = 71,
|
px = 71,
|
||||||
py = 95,
|
py = 95,
|
||||||
key = "afterimage",
|
key = "void",
|
||||||
path = "afterimage.png",
|
path = "void.png"
|
||||||
}
|
|
||||||
|
|
||||||
SMODS.Atlas {
|
|
||||||
px = 71,
|
|
||||||
py = 95,
|
|
||||||
key = "void",
|
|
||||||
path = "void.png",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SMODS.Consumable {
|
SMODS.Consumable {
|
||||||
key = "afterimage",
|
key = "void",
|
||||||
set = "Spectral",
|
set = "Spectral",
|
||||||
pos = {x = 0, y = 0},
|
pos = {x = 0, y = 0},
|
||||||
cost = 6,
|
cost = 6,
|
||||||
atlas = "afterimage",
|
atlas = "void",
|
||||||
config = {extra = {amount = 1, hand = -1}},
|
can_use = function(_, _)
|
||||||
loc_vars = function(_, _, card)
|
return #G.playing_cards > 1 and can_use()
|
||||||
return {vars = {card.ability.extra.amount, card.ability.extra.hand}}
|
end,
|
||||||
end,
|
use = function(_, _, _, _)
|
||||||
can_use = function(_, card)
|
local function calculate_joker(v)
|
||||||
return can_use() and card.ability.extra.amount == #Bakery_API.get_highlighted()
|
v:calculate_joker({remove_playing_cards = true, removed = G.playing_cards})
|
||||||
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",
|
|
||||||
pos = {x = 0, y = 0},
|
|
||||||
cost = 6,
|
|
||||||
atlas = "void",
|
|
||||||
config = {extra = {amount = 2}},
|
|
||||||
loc_vars = function(_, _, card)
|
|
||||||
return {vars = {card.ability.extra.amount}}
|
|
||||||
end,
|
|
||||||
can_use = function(_, _)
|
|
||||||
return #G.playing_cards > 1 and can_use()
|
|
||||||
end,
|
|
||||||
use = function(_, card, _, _)
|
|
||||||
local function destructible(v)
|
|
||||||
return not v.ability or not (v.ability.eternal or v.ability.cry_absolute)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function destroy(v)
|
local function destroy(v)
|
||||||
|
|
@ -86,43 +39,17 @@ SMODS.Consumable {
|
||||||
v:start_dissolve()
|
v:start_dissolve()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function void()
|
|
||||||
local cards = F.filter(G.playing_cards, destructible)
|
|
||||||
|
|
||||||
local function calculate_joker(v)
|
|
||||||
v:calculate_joker({remove_playing_cards = true, removed = cards})
|
|
||||||
end
|
|
||||||
|
|
||||||
F.foreach(cards, destroy)
|
|
||||||
F.foreach(G.jokers.cards, calculate_joker)
|
|
||||||
|
|
||||||
for _ = 1, card.ability.extra.amount do
|
|
||||||
local cryptid = create_card(
|
|
||||||
nil,
|
|
||||||
G.consumeables,
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
"c_cryptid",
|
|
||||||
"void"
|
|
||||||
)
|
|
||||||
|
|
||||||
cryptid:set_edition({negative = true}, true)
|
|
||||||
cryptid:add_to_deck()
|
|
||||||
G.consumeables:emplace(cryptid)
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
play_sound("Roland_void", 1, 0.7)
|
play_sound("Roland_void", 1, 0.7)
|
||||||
|
|
||||||
G.E_MANAGER:add_event(Event({
|
G.E_MANAGER:add_event(Event({
|
||||||
delay = 0.27,
|
delay = 0.27,
|
||||||
timer = "REAL",
|
timer = 'REAL',
|
||||||
trigger = "after",
|
trigger = 'after',
|
||||||
func = void,
|
func = function()
|
||||||
|
F.foreach(G.playing_cards, destroy)
|
||||||
|
F.foreach(G.jokers.cards, calculate_joker)
|
||||||
|
return true
|
||||||
|
end
|
||||||
}))
|
}))
|
||||||
end,
|
end
|
||||||
}
|
}
|
||||||