Skip to content

Commit d5a2972

Browse files
authored
Merge pull request #771 from SpectralPack/temp
sync changes with branch
2 parents 99df47a + fb32857 commit d5a2972

36 files changed

+4816
-3081
lines changed

Cryptid.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"priority": 114,
1010
"badge_colour": "708b91",
1111
"badge_text_colour": "FFFFFF",
12-
"version": "0.5.11",
12+
"version": "0.5.12~dev",
1313
"dependencies": [
1414
"Steamodded (>=1.0.0~BETA-0711a)"
1515
],

Cryptid.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ function SMODS.injectItems(...)
187187
end
188188
end
189189
end
190+
if G.PROFILES[G.SETTINGS.profile].all_unlocked then
191+
G.PROFILES[G.SETTINGS.profile].cry_none = (Cryptid.enabled("set_cry_poker_hand_stuff") == true)
192+
end
190193
G.P_CENTERS.j_stencil.immutable = true
191194
G.P_CENTERS.j_four_fingers.immutable = true
192195
G.P_CENTERS.j_mime.immutable = true

items/blind.lua

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -743,22 +743,24 @@ local greed = {
743743
}
744744
end,
745745
set_blind = function(self, reset, silent)
746-
if to_big(G.GAME.dollars) < to_big(5000) then
747-
G.GAME.blind.chips = -- go my equations
748-
((get_blind_amount(G.GAME.round_resets.ante) * G.GAME.starting_params.ante_scaling) + (math.floor(
749-
G.GAME.dollars / 5
750-
) * (get_blind_amount(G.GAME.round_resets.ante) * 0.25)))
751-
else
752-
G.GAME.blind.chips = -- set cap at $5000
753-
(
754-
(get_blind_amount(G.GAME.round_resets.ante) * G.GAME.starting_params.ante_scaling)
755-
+ (
756-
math.floor(5000 / 5) -- 1000 extra increments
757-
* (get_blind_amount(G.GAME.round_resets.ante) * 0.25)
746+
if to_big(G.GAME.dollars) > to_big(0) then
747+
if to_big(G.GAME.dollars) < to_big(5000) then
748+
G.GAME.blind.chips = -- go my equations
749+
((get_blind_amount(G.GAME.round_resets.ante) * G.GAME.starting_params.ante_scaling) + (math.floor(
750+
G.GAME.dollars / 5
751+
) * (get_blind_amount(G.GAME.round_resets.ante) * 0.25)))
752+
else
753+
G.GAME.blind.chips = -- set cap at $5000
754+
(
755+
(get_blind_amount(G.GAME.round_resets.ante) * G.GAME.starting_params.ante_scaling)
756+
+ (
757+
math.floor(5000 / 5) -- 1000 extra increments
758+
* (get_blind_amount(G.GAME.round_resets.ante) * 0.25)
759+
)
758760
)
759-
)
761+
end
762+
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
760763
end
761-
G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
762764
end,
763765
disable = function(self, silent)
764766
G.GAME.blind.chips = get_blind_amount(G.GAME.round_resets.ante) * G.GAME.starting_params.ante_scaling
@@ -1049,7 +1051,7 @@ local tornado = {
10491051
order = 94,
10501052
boss_colour = HEX("3dd9ca"),
10511053
loc_vars = function(self)
1052-
return { vars = { "" .. ((Cryptid.safe_get(G.GAME, "probabilities", "normal") or 1) * 2), 3 } }
1054+
return { vars = { SMODS.get_probability_vars(self, 2, 3, "Turquoise Tornado") } }
10531055
end,
10541056
set_blind = function(self, reset, silent)
10551057
if not reset then
@@ -1060,12 +1062,12 @@ local tornado = {
10601062
return #Cryptid.advanced_find_joker("Oops! All 6s", nil, nil, { "eternal" }, nil) == 0
10611063
end,
10621064
collection_loc_vars = function(self)
1063-
return { vars = { "" .. ((Cryptid.safe_get(G.GAME, "probabilities", "normal") or 1) * 2), 3 } }
1065+
return { vars = { SMODS.get_probability_vars(self, 2, 3, "Turquoise Tornado") } }
10641066
end,
10651067
debuff_hand = function(self, cards, hand, handname, check)
10661068
if
10671069
not check
1068-
and (pseudorandom(pseudoseed("tornado")) < ((G.GAME.probabilities.normal * 2) / 3))
1070+
and SMODS.pseudorandom_probability(self, "tornado", 2, 3, "Turquoise Tornado")
10691071
and not G.GAME.blind.disabled
10701072
then
10711073
--check for guarantee
@@ -1546,7 +1548,7 @@ local obsidian_orb = {
15461548
if area == G.hand then
15471549
if
15481550
s.name == "The Wheel"
1549-
and pseudorandom(pseudoseed("ObsidianOrb")) < G.GAME.probabilities.normal / 7
1551+
and SMODS.pseudorandom_probability(self, "ObsidianOrb", 1, 7, "Obsidian Orb")
15501552
then
15511553
return true
15521554
end

items/code.lua

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,6 +3387,15 @@ local variable = {
33873387
local c = SMODS.Ranks[card.base.value] or {}
33883388
if c.hidden or c.noe_doe or c.no_collection or c.no_variable or c.no_code then
33893389
card.debuff = true
3390+
else
3391+
G.E_MANAGER:add_event(Event({
3392+
trigger = "after",
3393+
blocking = false,
3394+
func = function()
3395+
card.debuff = false
3396+
return true
3397+
end,
3398+
}))
33903399
end
33913400
end
33923401
return emplace_ref(self, card, ...)
@@ -4469,7 +4478,7 @@ local semicolon = {
44694478
"HexaCryonic",
44704479
},
44714480
code = {
4472-
"Math",
4481+
"WilsontheWolf",
44734482
},
44744483
},
44754484
dependencies = {
@@ -4982,16 +4991,21 @@ local cut = {
49824991
codecard_to_destroy.getting_sliced = true
49834992
card.ability.extra.Xmult =
49844993
lenient_bignum(to_big(card.ability.extra.Xmult) + card.ability.extra.Xmult_mod)
4994+
local msg = SMODS.scale_card(card, {
4995+
ref_table = card.ability.extra,
4996+
ref_value = "Xmult",
4997+
scalar_value = "Xmult_mod",
4998+
})
49854999
G.E_MANAGER:add_event(Event({
49865000
func = function()
49875001
(context.blueprint_card or card):juice_up(0.8, 0.8)
49885002
codecard_to_destroy:start_dissolve({ G.C.RED }, nil, 1.6)
49895003
return true
49905004
end,
49915005
}))
4992-
if not (context.blueprint_card or self).getting_sliced then
5006+
if not (context.blueprint_card or self).getting_sliced and (not msg or type(msg) == "string") then
49935007
card_eval_status_text((context.blueprint_card or card), "extra", nil, nil, nil, {
4994-
message = localize({
5008+
message = msg or localize({
49955009
type = "variable",
49965010
key = "a_xmult",
49975011
vars = { number_format(to_big(card.ability.extra.Xmult)) },
@@ -5016,14 +5030,19 @@ local cut = {
50165030
end
50175031
if context.forcetrigger then
50185032
card.ability.extra.Xmult = lenient_bignum(to_big(card.ability.extra.Xmult) + card.ability.extra.Xmult_mod)
5033+
local msg = SMODS.scale_card(card, {
5034+
ref_table = card.ability.extra,
5035+
ref_value = "Xmult",
5036+
scalar_value = "Xmult_mod",
5037+
})
50195038
return {
5020-
message = localize({
5039+
message = not msg and localize({
50215040
type = "variable",
50225041
key = "a_xmult",
50235042
vars = {
50245043
number_format(card.ability.extra.Xmult),
50255044
},
5026-
}),
5045+
}) or (type(msg) == "string" and msg) or nil,
50275046
Xmult_mod = card.ability.extra.Xmult,
50285047
colour = G.C.MULT,
50295048
}

items/deck.lua

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ local legendary = {
357357
pos = { x = 0, y = 6 },
358358
atlas = "atlasdeck",
359359
order = 15,
360+
loc_vars = function(self, info_queue, center)
361+
return { vars = { SMODS.get_probability_vars(self, 1, self.config.cry_legendary_rate, "Legendary Deck") } }
362+
end,
360363
calculate = function(self, back, context)
361364
if context.context == "eval" and Cryptid.safe_get(G.GAME, "last_blind", "boss") then
362365
SMODS.Events["ev_cry_choco10"]:finish()
@@ -394,18 +397,21 @@ local critical = {
394397
name = "cry-Critical",
395398
key = "critical",
396399
order = 10,
397-
config = { cry_crit_rate = 0.25, cry_crit_miss_rate = 0.125 },
400+
config = { cry_crit_rate = 4, cry_crit_miss_rate = 8 },
398401
pos = { x = 4, y = 5 },
399402
atlas = "atlasdeck",
400403
loc_vars = function(self, info_queue, center)
401-
return { vars = { G.GAME.probabilities.normal or 1 } }
404+
local _, aaa = SMODS.get_probability_vars(self, 1, self.config.cry_crit_miss_rate, "Critical Deck")
405+
return { vars = { SMODS.get_probability_vars(self, 1, self.config.cry_crit_rate, "Critical Deck"), aaa } }
402406
end,
403407
calculate = function(self, card, context)
404408
if context.final_scoring_step then
409+
local aaa =
410+
SMODS.pseudorandom_probability(self, "cry_critical", 1, self.config.cry_crit_rate, "Critical Deck")
411+
local bbb =
412+
SMODS.pseudorandom_probability(self, "cry_critical", 1, self.config.cry_crit_miss_rate, "Critical Deck")
405413
local check
406-
local crit_poll = pseudorandom(pseudoseed("cry_critical"))
407-
crit_poll = crit_poll / (G.GAME.probabilities.normal or 1)
408-
if crit_poll < self.config.cry_crit_rate then
414+
if aaa then
409415
check = 2
410416
G.E_MANAGER:add_event(Event({
411417
func = function()
@@ -421,7 +427,7 @@ local critical = {
421427
return true
422428
end,
423429
}))
424-
elseif crit_poll < self.config.cry_crit_rate + self.config.cry_crit_miss_rate then
430+
elseif bbb then
425431
check = 0.5
426432
G.E_MANAGER:add_event(Event({
427433
func = function()
@@ -880,8 +886,6 @@ local antimatter = {
880886

881887
function Cryptid.antimatter_trigger_final_scoring(self, context, skip)
882888
if context.context == "final_scoring_step" then
883-
local crit_poll = pseudorandom(pseudoseed("cry_critical"))
884-
crit_poll = crit_poll / (G.GAME.probabilities.normal or 1)
885889
--Critical Deck
886890
if
887891
(
@@ -891,7 +895,15 @@ local antimatter = {
891895
~= 0
892896
or skip
893897
then
894-
if crit_poll < self.config.cry_crit_rate then
898+
if
899+
SMODS.pseudorandom_probability(
900+
self,
901+
"cry_critical",
902+
1,
903+
self.config.cry_crit_rate,
904+
"Antimatter Deck"
905+
)
906+
then
895907
context.mult = context.mult ^ 2
896908
update_hand_text({ delay = 0 }, { mult = context.mult, chips = context.chips })
897909
G.E_MANAGER:add_event(Event({
@@ -1004,9 +1016,15 @@ local antimatter = {
10041016
or skip
10051017
then
10061018
if #G.jokers.cards < G.jokers.config.card_limit then
1007-
local legendary_poll = pseudorandom(pseudoseed("cry_legendary"))
1008-
legendary_poll = legendary_poll / (G.GAME.probabilities.normal or 1)
1009-
if legendary_poll < self.config.cry_legendary_rate then
1019+
if
1020+
SMODS.pseudorandom_probability(
1021+
self,
1022+
"cry_legendary",
1023+
1,
1024+
self.config.cry_legendary_rate,
1025+
"Antimatter Deck"
1026+
)
1027+
then
10101028
local card = create_card("Joker", G.jokers, true, 4, nil, nil, nil, "")
10111029
card:add_to_deck()
10121030
card:start_materialize()

0 commit comments

Comments
 (0)