Refactor
This commit is contained in:
parent
eb022c894d
commit
f023e909ad
3 changed files with 5 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"id": "Roland",
|
||||
"name": "Roland",
|
||||
"prefix": "Roland",
|
||||
"version": "2.9.45",
|
||||
"version": "2.9.46",
|
||||
"badge_colour": "8BE9FD",
|
||||
"display_name": "Roland",
|
||||
"main_file": "src/main.lua",
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ function SMODS.current_mod:calculate(context)
|
|||
|
||||
local normal = orig.normal
|
||||
|
||||
local mt = {
|
||||
G.GAME.probabilities = setmetatable({}, {
|
||||
orig = orig,
|
||||
__index = function(_, k)
|
||||
return k == "normal" and 0 or orig[k]
|
||||
|
|
@ -412,11 +412,7 @@ function SMODS.current_mod:calculate(context)
|
|||
__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
|
||||
|
||||
blind {
|
||||
|
|
|
|||
|
|
@ -345,12 +345,10 @@ q {
|
|||
|
||||
local orig = Bakery_API.no_money_decks
|
||||
|
||||
Bakery_API.no_money_decks = setmetatable(orig, {
|
||||
Bakery_API.no_money_decks = setmetatable({}, {
|
||||
orig = orig,
|
||||
__index = function(_, k)
|
||||
return (G.GAME or {}).challenge == "c_Roland_Yard_Sale" and
|
||||
not yard_sale or
|
||||
(getmetatable(orig) or orig)[k]
|
||||
return (G.GAME or {}).challenge == "c_Roland_Yard_Sale" and not yard_sale or orig[k]
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue