@@ -1245,6 +1245,16 @@ SMODS.calculate_individual_effect = function(effect, scored_card, key, amount, f
12451245 })
12461246 return true
12471247 end
1248+ if (key == ' xscore' or key == ' h_xscore' or key == ' x_score' or key == ' h_x_score' ) and amount ~= 1 then
1249+ if effect .card and effect .card ~= scored_card then juice_card (effect .card ) end
1250+ SMODS .mod_score ({ mult = amount , card = effect .message_card or effect .juice_card or scored_card or effect .card or effect .focus , effect = effect , from_edition = from_edition })
1251+ return true
1252+ end
1253+ if (key == ' score' or key == ' h_score' ) and amount ~= 0 then
1254+ if effect .card and effect .card ~= scored_card then juice_card (effect .card ) end
1255+ SMODS .mod_score ({ add = amount , card = effect .message_card or effect .juice_card or scored_card or effect .card or effect .focus , effect = effect , from_edition = from_edition })
1256+ return true
1257+ end
12481258
12491259 if key == ' message' and not SMODS .no_resolve then
12501260 if effect .card and effect .card ~= scored_card then juice_card (effect .card ) end
@@ -1466,6 +1476,8 @@ SMODS.scoring_parameter_keys = {
14661476}
14671477SMODS .other_calculation_keys = {
14681478 ' p_dollars' , ' dollars' , ' h_dollars' ,
1479+ ' score' , ' h_score' ,
1480+ ' xscore' , ' x_score' , ' h_x_score' , ' h_xscore' ,
14691481 ' swap' , ' balance' ,
14701482 ' saved' , ' effect' , ' remove' ,
14711483 ' debuff' , ' prevent_debuff' , ' debuff_text' ,
@@ -3126,6 +3138,18 @@ function SMODS.localize_perma_bonuses(specific_vars, desc_nodes)
31263138 if specific_vars and specific_vars .bonus_h_dollars then
31273139 localize {type = ' other' , key = ' card_extra_h_dollars' , nodes = desc_nodes , vars = {SMODS .signed_dollars (specific_vars .bonus_h_dollars )}}
31283140 end
3141+ if specific_vars and specific_vars .perma_score then
3142+ localize {type = ' other' , key = ' card_extra_score' , nodes = desc_nodes , vars = {SMODS .signed (specific_vars .perma_score )}}
3143+ end
3144+ if specific_vars and specific_vars .perma_h_score then
3145+ localize {type = ' other' , key = ' card_extra_h_score' , nodes = desc_nodes , vars = {SMODS .signed (specific_vars .perma_h_score )}}
3146+ end
3147+ if specific_vars and specific_vars .perma_x_score then
3148+ localize {type = ' other' , key = ' card_extra_x_score' , nodes = desc_nodes , vars = {(specific_vars .perma_x_score )}}
3149+ end
3150+ if specific_vars and specific_vars .perma_h_x_score then
3151+ localize {type = ' other' , key = ' card_extra_h_x_score' , nodes = desc_nodes , vars = {(specific_vars .perma_h_x_score )}}
3152+ end
31293153 if specific_vars and specific_vars .bonus_repetitions then
31303154 localize {type = ' other' , key = ' card_extra_repetitions' , nodes = desc_nodes , vars = {specific_vars .bonus_repetitions , localize (specific_vars .bonus_repetitions > 1 and ' b_retrigger_plural' or ' b_retrigger_single' )}}
31313155 end
@@ -3578,4 +3602,47 @@ function SMODS.get_badge_text_colour(key)
35783602 for k , v in pairs (SMODS .Seals ) do
35793603 if k :lower ().. ' _seal' == key and v .text_colour then return v .text_colour end
35803604 end
3605+ end
3606+ -- function to modify score: normally accepts add and mult argument and additionally card argument
3607+ SMODS .mod_score = function (score_mod )
3608+ score_mod = score_mod or {}
3609+ local score_fx = {}
3610+ local score_cal = score_mod .set or G .GAME .chips
3611+ local old = G .GAME .chips
3612+ G .SCORE_DISPLAY_QUEUE = G .SCORE_DISPLAY_QUEUE or {}
3613+ -- TARGET: higher priority score operation
3614+ if score_mod .mult then
3615+ local absoluted = math.abs (score_mod .mult )
3616+ score_cal = score_cal * score_mod .mult
3617+ table.insert (G .SCORE_DISPLAY_QUEUE , old )
3618+ score_fx [# score_fx + 1 ] = {key = score_mod .mult < 0 and " a_xscore_minus" or " a_xscore" , value = absoluted , sound = " xscore" , message_key = " xscore_message" }
3619+ end
3620+ if score_mod .add and score_mod .add ~= 0 then
3621+ local absoluted = math.abs (score_mod .add )
3622+ score_cal = score_cal + score_mod .add
3623+ table.insert (G .SCORE_DISPLAY_QUEUE , old )
3624+ score_fx [# score_fx + 1 ] = { key = " a_score" , value = score_mod .add , sound = " gong" , message_key = ' score_message' }
3625+ end
3626+ -- TARGET: lower priority score operation
3627+ G .GAME .chips = score_cal
3628+
3629+ if not (score_mod .effect and score_mod .effect .remove_default_message ) and score_mod .card then
3630+ for _ ,v in ipairs (score_fx ) do
3631+ if score_mod .from_edition then
3632+ card_eval_status_text (score_mod .card , ' jokers' , nil , percent , nil , {message = localize {type = ' variable' , key = v .key , vars = {v .value }}, update_score = true , colour = G .C .EDITION , edition = true , sound = v .sound , volume = 0.5 })
3633+ elseif score_mod .effect and score_mod .effect [v .message_key ] then
3634+ score_mod .effect [v .message_key ].update_score = true
3635+ card_eval_status_text (score_mod .card , ' extra' , v .value , percent , nil , score_mod .effect [v .message_key ])
3636+ else
3637+ card_eval_status_text (score_mod .card , ' jokers' , nil , percent , nil , {message = localize {type = ' variable' ,key = v .key ,vars = {v .value }}, update_score = true , volume = 0.5 , sound_override = v .sound , colour = G .C .PURPLE })
3638+ end
3639+ end
3640+ -- this check is in case some skip animation mods is there, may be removed in the future
3641+ if G .CARD_EVAL_TRIGGERED then
3642+ G .SCORE_DISPLAY_QUEUE = nil
3643+ end
3644+ elseif score_mod .effect then
3645+ score_mod .effect .update_score = true
3646+ end
3647+ delay (0.2 )
35813648end
0 commit comments