Skip to content

Commit 732ff07

Browse files
author
lord-ruby
committed
fix return value stuff
1 parent 60901c9 commit 732ff07

File tree

4 files changed

+109
-59
lines changed

4 files changed

+109
-59
lines changed

Cryptlib/forcetrigger.lua

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,7 @@ function Spectrallib.get_forcetrigger_results(card, context)
209209
if card.ability.name == "Gros Michel" then
210210
G.E_MANAGER:add_event(Event({
211211
func = function()
212-
play_sound("tarot1")
213-
card.T.r = -0.2
214-
card:juice_up(0.3, 0.4)
215-
card.states.drag.is = true
216-
card.children.center.pinch.x = true
217-
G.E_MANAGER:add_event(Event({
218-
trigger = "after",
219-
delay = 0.3,
220-
blockable = false,
221-
func = function()
222-
G.jokers:remove_card(card)
223-
card:remove()
224-
card = nil
225-
return true
226-
end,
227-
}))
212+
SMODS.destroy_cards(card, nil, nil, true)
228213
return true
229214
end,
230215
}))
@@ -300,22 +285,7 @@ function Spectrallib.get_forcetrigger_results(card, context)
300285
trigger = "after",
301286
delay = 0.4,
302287
func = function()
303-
play_sound("tarot1")
304-
card.T.r = -0.2
305-
card:juice_up(0.3, 0.4)
306-
card.states.drag.is = true
307-
card.children.center.pinch.x = true
308-
G.E_MANAGER:add_event(Event({
309-
trigger = "after",
310-
delay = 0.3,
311-
blockable = false,
312-
func = function()
313-
G.jokers:remove_card(card)
314-
card:remove()
315-
card = nil
316-
return true
317-
end,
318-
}))
288+
SMODS.destroy_cards(card, nil, nil, true)
319289
return true
320290
end,
321291
}))
@@ -390,22 +360,7 @@ function Spectrallib.get_forcetrigger_results(card, context)
390360
trigger = "after",
391361
delay = 0.4,
392362
func = function()
393-
play_sound("tarot1")
394-
card.T.r = -0.2
395-
card:juice_up(0.3, 0.4)
396-
card.states.drag.is = true
397-
card.children.center.pinch.x = true
398-
G.E_MANAGER:add_event(Event({
399-
trigger = "after",
400-
delay = 0.3,
401-
blockable = false,
402-
func = function()
403-
G.jokers:remove_card(card)
404-
card:remove()
405-
card = nil
406-
return true
407-
end,
408-
}))
363+
SMODS.destroy_cards(card, nil, nil, true)
409364
return true
410365
end,
411366
}))

Cryptlib/talisman.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ end
184184

185185
for _, v in ipairs{ "cry_broken_swap", "cry_partial_swap" } do
186186
table.insert(SMODS.scoring_parameter_keys, v)
187-
end
187+
end

Entropy/return_values.lua

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ for _, v in ipairs({'eq_mult', 'Eqmult_mod', 'eq_chips', 'Eqchips_mod', 'xlog_ch
22
table.insert(SMODS.scoring_parameter_keys or SMODS.calculation_keys or {}, v)
33
end
44
for _, v in ipairs({'asc', 'asc_mod', 'plus_asc', 'plusasc_mod', 'exp_asc', 'exp_asc_mod', 'x_asc',
5-
'hyper_asc', 'hyper_asc_mod', 'hyperasc', 'hyperasc_mod'}) do
5+
'hyper_asc', 'hyper_asc_mod', 'hyperasc', 'hyperasc_mod'}) do
66
table.insert(SMODS.other_calculation_keys or SMODS.calculation_keys or {}, v)
77
end
88

@@ -137,8 +137,8 @@ function SMODS.calculate_individual_effect(effect, scored_card, key, amount, fro
137137
G.GAME.current_round.current_hand.cry_asc_num_text = (to_big(G.GAME.asc_power_hand) < to_big(0) and " (" or " (+") .. (text) .. ")"
138138
end
139139
card_eval_status_text = function() end
140-
scie(effect, scored_card, "Xmult_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
141-
scie(effect, scored_card, "Xchip_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
140+
SMODS.Scoring_Parameters.mult:modify(mult * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
141+
SMODS.Scoring_Parameters.chips:modify(hand_chips * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
142142
card_eval_status_text = e
143143
if not Spectrallib.should_skip_animations() then
144144
Spectrallib.card_eval_status_text_eq(scored_card or effect.card or effect.focus, 'mult', amount, percent, nil, nil, "X"..amount.." Asc", Spectrallib.get_asc_colour(amount), "entr_e_solar", 0.6)
@@ -167,8 +167,8 @@ function SMODS.calculate_individual_effect(effect, scored_card, key, amount, fro
167167
G.GAME.current_round.current_hand.cry_asc_num_text = (to_big(G.GAME.asc_power_hand) < to_big(0) and " (" or " (+") .. (text) .. ")"
168168
end
169169
card_eval_status_text = function() end
170-
scie(effect, scored_card, "Xmult_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
171-
scie(effect, scored_card, "Xchip_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
170+
SMODS.Scoring_Parameters.mult:modify(mult * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
171+
SMODS.Scoring_Parameters.chips:modify(hand_chips * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
172172
card_eval_status_text = e
173173
if not Spectrallib.should_skip_animations() then
174174
Spectrallib.card_eval_status_text_eq(scored_card or effect.card or effect.focus, 'mult', amount, percent, nil, nil, (to_big(amount) < to_big(0) and "" or "+")..amount.." Asc", Spectrallib.get_asc_colour(amount), "entr_e_solar", 0.6)
@@ -197,8 +197,8 @@ function SMODS.calculate_individual_effect(effect, scored_card, key, amount, fro
197197
G.GAME.current_round.current_hand.cry_asc_num_text = (to_big(G.GAME.asc_power_hand) < to_big(0) and " (" or " (+") .. (text) .. ")"
198198
end
199199
card_eval_status_text = function() end
200-
scie(effect, scored_card, "Xmult_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
201-
scie(effect, scored_card, "Xchip_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
200+
SMODS.Scoring_Parameters.mult:modify(mult * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
201+
SMODS.Scoring_Parameters.chips:modify(hand_chips * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
202202
card_eval_status_text = e
203203
if not Spectrallib.should_skip_animations() then
204204
Spectrallib.card_eval_status_text_eq(scored_card or effect.card or effect.focus, 'mult', amount, percent, nil, nil, "^"..amount.." Asc", Spectrallib.get_asc_colour(amount), "entr_e_solar", 0.6)
@@ -227,8 +227,8 @@ function SMODS.calculate_individual_effect(effect, scored_card, key, amount, fro
227227
G.GAME.current_round.current_hand.cry_asc_num_text = (to_big(G.GAME.asc_power_hand) < to_big(0) and " (" or " (+") .. (text) .. ")"
228228
end
229229
card_eval_status_text = function() end
230-
scie(effect, scored_card, "Xmult_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
231-
scie(effect, scored_card, "Xchip_mod", Cryptid.ascend(1, G.GAME.asc_power_hand - orig), false)
230+
SMODS.Scoring_Parameters.mult:modify(mult * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
231+
SMODS.Scoring_Parameters.chips:modify(hand_chips * (Cryptid.ascend(1, G.GAME.asc_power_hand - orig) - 1))
232232
card_eval_status_text = e
233233
if not Spectrallib.should_skip_animations() then
234234
Spectrallib.card_eval_status_text_eq(scored_card or effect.card or effect.focus, 'mult', amount, percent, nil, nil, Spectrallib.format_arrow_mulkt(amount[1], amount[2]).." Asc", Spectrallib.get_asc_colour(amount), "entr_e_solar", 0.6)
@@ -262,3 +262,37 @@ G.FUNCS.play_cards_from_highlighted = function(e)
262262
G.GAME.asc_power_hand = 0
263263
return play_ref(e)
264264
end
265+
266+
267+
function Card:get_entr_xlog_chips()
268+
return self.ability.entr_perma_xlog_chips
269+
end
270+
271+
function Card:get_entr_h_xlog_chips()
272+
return self.ability.entr_perma_h_xlog_chips
273+
end
274+
275+
--these currently only return a single value, but exist in case other effects get added that would need to be returned here
276+
function Card:get_entr_plus_asc()
277+
return self.ability.entr_perma_plus_asc
278+
end
279+
280+
function Card:get_entr_h_plus_asc()
281+
return self.ability.entr_perma_h_plus_asc
282+
end
283+
284+
function Card:get_entr_asc()
285+
return self.ability.entr_perma_asc + 1
286+
end
287+
288+
function Card:get_entr_h_asc()
289+
return self.ability.entr_perma_h_asc + 1
290+
end
291+
292+
function Card:get_entr_exp_asc()
293+
return self.ability.entr_perma_exp_asc + 1
294+
end
295+
296+
function Card:get_entr_h_exp_asc()
297+
return self.ability.entr_perma_h_exp_asc + 1
298+
end

lovely/ccd.toml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ target = "card.lua"
218218
pattern = "perma_h_dollars = self.ability and self.ability.perma_h_dollars or 0,"
219219
position = "after"
220220
payload = """
221+
entr_perma_xlog_chips = self.ability and self.ability.entr_perma_xlog_chips or 0,
222+
entr_perma_h_xlog_chips = self.ability and self.ability.entr_perma_h_xlog_chips or 0,
221223
entr_perma_plus_asc = self.ability and self.ability.entr_perma_plus_asc or 0,
222224
entr_perma_h_plus_asc = self.ability and self.ability.entr_perma_h_plus_asc or 0,
223225
entr_perma_asc = self.ability and self.ability.entr_perma_asc or 0,
@@ -250,6 +252,7 @@ target = "card.lua"
250252
pattern = "perma_h_dollars = self.ability and self.ability.perma_h_dollars or 0,"
251253
position = "after"
252254
payload = """
255+
entr_perma_xlog_chips = self.ability and self.ability.entr_perma_xlog_chips or 0,
253256
entr_perma_plus_asc = self.ability and self.ability.entr_perma_plus_asc or 0,
254257
entr_perma_h_plus_asc = self.ability and self.ability.entr_perma_h_plus_asc or 0,
255258
entr_perma_asc = self.ability and self.ability.entr_perma_asc or 0,
@@ -265,6 +268,8 @@ target = "card.lua"
265268
pattern = "bonus_x_chips = self.ability.perma_x_chips ~= 0 and (self.ability.perma_x_chips + 1) or nil,"
266269
position = "after"
267270
payload = """
271+
entr_perma_xlog_chips = self.ability.entr_perma_xlog_chips ~= 0 and self.ability.entr_perma_xlog_chips or nil,
272+
entr_perma_h_xlog_chips = self.ability.entr_perma_h_xlog_chips ~= 0 and self.ability.entr_perma_h_xlog_chips or nil,
268273
entr_perma_plus_asc = self.ability.entr_perma_plus_asc ~= 0 and self.ability.entr_perma_plus_asc or nil,
269274
entr_perma_h_plus_asc = self.ability.entr_perma_h_plus_asc ~= 0 and self.ability.entr_perma_h_plus_asc or nil,
270275
entr_perma_asc = self.ability.entr_perma_asc ~= 0 and (self.ability.entr_perma_asc + 1) or nil,
@@ -286,6 +291,12 @@ if specific_vars and specific_vars.bonus_repetitions then
286291
'''
287292
position = "after"
288293
payload = '''
294+
if specific_vars and specific_vars.entr_perma_xlog_chips then
295+
localize{ type = "other", key = "entr_perma_xlog_chips", nodes = desc_nodes, vars = {(specific_vars.entr_perma_xlog_chips)}}
296+
end
297+
if specific_vars and specific_vars.entr_perma_h_xlog_chips then
298+
localize{ type = "other", key = "entr_perma_h_xlog_chips", nodes = desc_nodes, vars = {(specific_vars.entr_perma_h_xlog_chips)}}
299+
end
289300
if specific_vars and specific_vars.entr_perma_plus_asc then
290301
localize{ type = "other", key = "entr_perma_plus_asc", nodes = desc_nodes, vars = {SMODS.signed(specific_vars.entr_perma_plus_asc)}}
291302
end
@@ -312,4 +323,54 @@ if specific_vars and specific_vars.suit_bonus then
312323
}}}
313324
end
314325
'''
315-
match_indent = true
326+
match_indent = true
327+
328+
[[patches]]
329+
[patches.pattern]
330+
target = "functions/common_events.lua"
331+
pattern = """ -- TARGET: main scoring on played cards"""
332+
position = "before"
333+
payload = '''
334+
local xlog_chips = card:get_entr_xlog_chips()
335+
if xlog_chips ~= 0 then
336+
ret.playing_card.xlog_chips = xlog_chips
337+
end
338+
local entr_plus_asc = card:get_entr_plus_asc()
339+
if entr_plus_asc ~= 0 then
340+
ret.playing_card.plus_asc = entr_plus_asc
341+
end
342+
local entr_asc = card:get_entr_asc()
343+
if entr_asc ~= 1 and entr_asc > 0 then
344+
ret.playing_card.asc = entr_asc
345+
end
346+
local entr_exp_asc = card:get_entr_exp_asc()
347+
if entr_exp_asc ~= 1 then
348+
ret.playing_card.exp_asc = entr_exp_asc
349+
end
350+
'''
351+
match_indent = true
352+
353+
[[patches]]
354+
[patches.pattern]
355+
target = "functions/common_events.lua"
356+
pattern = """ -- TARGET: main scoring on held cards"""
357+
position = "before"
358+
payload = '''
359+
local xlog_chips = card:get_entr_h_xlog_chips()
360+
if xlog_chips ~= 0 then
361+
ret.playing_card.xlog_chips = xlog_chips
362+
end
363+
local entr_plus_asc = card:get_entr_h_plus_asc()
364+
if entr_plus_asc ~= 0 then
365+
ret.playing_card.plus_asc = entr_plus_asc
366+
end
367+
local entr_asc = card:get_entr_h_asc()
368+
if entr_asc ~= 1 and entr_asc > 0 then
369+
ret.playing_card.asc = entr_asc
370+
end
371+
local entr_exp_asc = card:get_entr_h_exp_asc()
372+
if entr_exp_asc ~= 1 then
373+
ret.playing_card.exp_asc = entr_exp_asc
374+
end
375+
'''
376+
match_indent = true

0 commit comments

Comments
 (0)