Optimize SMODS.get_enhancements patch
This commit is contained in:
parent
dd71145698
commit
2bd613b458
2 changed files with 10 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
"author": [
|
"author": [
|
||||||
"Emik"
|
"Emik"
|
||||||
],
|
],
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"badge_colour": "8BE9FD",
|
"badge_colour": "8BE9FD",
|
||||||
"main_file": "src/main.lua",
|
"main_file": "src/main.lua",
|
||||||
"badge_text_colour": "44475A",
|
"badge_text_colour": "44475A",
|
||||||
|
|
|
||||||
|
|
@ -585,6 +585,12 @@ joker {
|
||||||
local suit = (G.GAME.current_round.Roland_suitable or {}).suit or "Spades"
|
local suit = (G.GAME.current_round.Roland_suitable or {}).suit or "Spades"
|
||||||
return {vars = {localize(suit, "suits_plural"), colours = {G.C.SUITS[suit]}}}
|
return {vars = {localize(suit, "suits_plural"), colours = {G.C.SUITS[suit]}}}
|
||||||
end,
|
end,
|
||||||
|
add_to_deck = function()
|
||||||
|
G.GAME.modifiers.Roland_suitable = (G.GAME.modifiers.Roland_suitable or 0) + 1
|
||||||
|
end,
|
||||||
|
remove_from_deck = function()
|
||||||
|
G.GAME.modifiers.Roland_suitable = (G.GAME.modifiers.Roland_suitable or 0) - 1
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
function SMODS.current_mod.reset_game_globals()
|
function SMODS.current_mod.reset_game_globals()
|
||||||
|
|
@ -606,8 +612,9 @@ end
|
||||||
local orig_get_enhancements = SMODS.get_enhancements
|
local orig_get_enhancements = SMODS.get_enhancements
|
||||||
|
|
||||||
function SMODS.get_enhancements(card, ...)
|
function SMODS.get_enhancements(card, ...)
|
||||||
if not next(SMODS.find_card "j_Roland_suitable") or
|
if (G.GAME.modifiers.Roland_suitable or 0) <= 0 or
|
||||||
card.base.suit ~= G.GAME.current_round.Roland_suitable.suit then
|
card.base.suit ~= G.GAME.current_round.Roland_suitable.suit or
|
||||||
|
(card.area ~= G.hand and card.area ~= G.play) then
|
||||||
return orig_get_enhancements(card, ...)
|
return orig_get_enhancements(card, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue