Skip to content

Commit 192f3a5

Browse files
authored
custom observatory stuff
1 parent 4f3a4b2 commit 192f3a5

File tree

1 file changed

+83
-64
lines changed

1 file changed

+83
-64
lines changed

items/planet.lua

Lines changed: 83 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,17 @@ local universe = {
261261
badges[1] = create_badge(localize("k_planet_universe"), get_type_colour(self or card.config, card), nil, 1.2)
262262
end,
263263
loc_vars = function(self, info_queue, center)
264+
if Cryptid.safe_get(G, "GAME", "used_vouchers", "v_observatory") then
265+
-- won't show up for some fucking reason
266+
--[[info_queue[#info_queue + 1] = {
267+
key = "o_cry_universe",
268+
set = "Other",
269+
specific_vars = {
270+
G.P_CENTERS.v_observatory.config.extra,
271+
localize("cry_WholeDeck"),
272+
}
273+
}]]
274+
end
264275
return {
265276
vars = {
266277
localize("cry_WholeDeck"),
@@ -277,6 +288,30 @@ local universe = {
277288
}
278289
end,
279290
generate_ui = 0,
291+
292+
-- give emult instead of xmult
293+
calculate = function(self, card, context)
294+
if context.cry_observatory and card.ability.consumeable.hand_type == context.scoring_name then
295+
local value = context.cry_observatory.ability.extra
296+
297+
-- because it's ((n^a)^a)^a
298+
if Overflow then
299+
value = value ^ to_big(card:getQty())
300+
end
301+
302+
return {
303+
message = localize({
304+
type = "variable",
305+
key = "a_powmult",
306+
vars = {
307+
number_format(context.cry_observatory.ability.extra),
308+
},
309+
}),
310+
Emult_mod = lenient_bignum(context.cry_observatory.ability.extra),
311+
colour = G.C.DARK_EDITION,
312+
}
313+
end
314+
end,
280315
demicoloncompat = true,
281316
force_use = function(self, card, area)
282317
card:use_consumeable(area)
@@ -635,9 +670,9 @@ local planetlua = {
635670
end
636671
end
637672
end,
638-
calculate = function(self, card, context) --Observatory effect: Variable XMult
639-
if G.GAME.used_vouchers.v_observatory and context.joker_main then
640-
pseudorandom("cry_googol_play")
673+
calculate = function(self, card, context)
674+
if context.cry_observatory then
675+
-- pseudorandom("cry_googol_play")
641676
local aaa = pseudorandom("mstar")
642677
local limit = Card.get_gameset(card) == "modest" and 2 or 1e100
643678
local formula = aaa + (0.07 * (aaa ^ 5 / (1 - aaa ^ 2)))
@@ -653,8 +688,7 @@ local planetlua = {
653688
end
654689
]]
655690
return {
656-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
657-
Xmult_mod = value,
691+
xmult = value,
658692
}
659693
end
660694
end,
@@ -760,8 +794,8 @@ local nstar = {
760794
end,
761795
}))
762796
end,
763-
calculate = function(self, card, context) --Observatory effect: X0.1 mult for each neutron star used this run
764-
if G.GAME.used_vouchers.v_observatory and G.GAME.neutronstarsusedinthisrun > 0 and context.joker_main then
797+
calculate = function(self, card, context)
798+
if context.cry_observatory and G.GAME.neutronstarsusedinthisrun > 0 then
765799
local value = G.GAME.neutronstarsusedinthisrun
766800
if Overflow then
767801
value = value ^ to_big(card:getQty())
@@ -989,22 +1023,18 @@ local ruutu = {
9891023
end,
9901024
calculate = function(self, card, context)
9911025
if
992-
G.GAME.used_vouchers.v_observatory
993-
and context.joker_main
1026+
context.cry_observatory
9941027
and (
9951028
context.scoring_name == "High Card"
9961029
or context.scoring_name == "Pair"
9971030
or context.scoring_name == "Two Pair"
9981031
)
9991032
then
1000-
local value = G.P_CENTERS.v_observatory.config.extra
1033+
local value = context.cry_observatory.ability.extra
10011034
if Overflow then
10021035
value = value ^ to_big(card:getQty())
10031036
end
1004-
return {
1005-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
1006-
Xmult_mod = value,
1007-
}
1037+
return { xmult = value }
10081038
end
10091039
end,
10101040
demicoloncompat = true,
@@ -1078,22 +1108,18 @@ local risti = {
10781108
end,
10791109
calculate = function(self, card, context)
10801110
if
1081-
G.GAME.used_vouchers.v_observatory
1082-
and context.joker_main
1111+
context.cry_observatory
10831112
and (
10841113
context.scoring_name == "Three of a Kind"
10851114
or context.scoring_name == "Straight"
10861115
or context.scoring_name == "Flush"
10871116
)
10881117
then
1089-
local value = G.P_CENTERS.v_observatory.config.extra
1118+
local value = context.cry_observatory.ability.extra
10901119
if Overflow then
10911120
value = value ^ to_big(card:getQty())
10921121
end
1093-
return {
1094-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
1095-
Xmult_mod = value,
1096-
}
1122+
return { xmult = value }
10971123
end
10981124
end,
10991125
demicoloncompat = true,
@@ -1167,22 +1193,18 @@ local hertta = {
11671193
end,
11681194
calculate = function(self, card, context)
11691195
if
1170-
G.GAME.used_vouchers.v_observatory
1171-
and context.joker_main
1196+
context.cry_observatory
11721197
and (
11731198
context.scoring_name == "Full House"
11741199
or context.scoring_name == "Four of a Kind"
11751200
or context.scoring_name == "Straight Flush"
11761201
)
11771202
then
1178-
local value = G.P_CENTERS.v_observatory.config.extra
1203+
local value = context.cry_observatory.ability.extra
11791204
if Overflow then
11801205
value = value ^ to_big(card:getQty())
11811206
end
1182-
return {
1183-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
1184-
Xmult_mod = value,
1185-
}
1207+
return { xmult = value }
11861208
end
11871209
end,
11881210
demicoloncompat = true,
@@ -1256,22 +1278,18 @@ local pata = {
12561278
end,
12571279
calculate = function(self, card, context)
12581280
if
1259-
G.GAME.used_vouchers.v_observatory
1260-
and context.joker_main
1281+
context.cry_observatory
12611282
and (
12621283
context.scoring_name == "Five of a Kind"
12631284
or context.scoring_name == "Flush House"
12641285
or context.scoring_name == "Flush Five"
12651286
)
12661287
then
1267-
local value = G.P_CENTERS.v_observatory.config.extra
1288+
local value = context.cry_observatory.ability.extra
12681289
if Overflow then
12691290
value = value ^ to_big(card:getQty())
12701291
end
1271-
return {
1272-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
1273-
Xmult_mod = value,
1274-
}
1292+
return { xmult = value }
12751293
end
12761294
end,
12771295
demicoloncompat = true,
@@ -1353,29 +1371,26 @@ local kaikki = {
13531371
end,
13541372
calculate = function(self, card, context)
13551373
if
1356-
G.GAME.used_vouchers.v_observatory
1357-
and context.joker_main
1374+
context.cry_observatory
13581375
and (
13591376
context.scoring_name == "cry_Bulwark"
13601377
or context.scoring_name == "cry_Clusterfuck"
13611378
or context.scoring_name == "cry_UltPair"
13621379
)
13631380
then
1364-
local value = G.P_CENTERS.v_observatory.config.extra
1381+
local value = context.cry_observatory.ability.extra
13651382
if Overflow then
13661383
value = value ^ to_big(card:getQty())
13671384
end
1368-
return {
1369-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
1370-
Xmult_mod = value,
1371-
}
1385+
return { xmult = value }
13721386
end
13731387
end,
13741388
demicoloncompat = true,
13751389
force_use = function(self, card, area)
13761390
card:use_consumeable(area)
13771391
end,
13781392
}
1393+
13791394
-- Perkele
13801395
-- Upgrades None, TEFD, and Ascended Hands
13811396
local perkele = {
@@ -1468,13 +1483,13 @@ local perkele = {
14681483
observatory_power = Cryptid.funny_log(2, super_entropic_local_variable_that_stores_the_amount_of_suns + 1)
14691484
end
14701485
info_queue[#info_queue + 1] = {
1471-
key = "o_sunplanet",
1486+
key = "o_perkele",
14721487
set = "Other",
14731488
specific_vars = {
14741489
observatory_power,
1475-
--G.P_CENTERS.v_observatory.config.extra,
1476-
--localize("cry_None", "poker_hands"),
1477-
--localize("cry_WholeDeck", "poker_hands"),
1490+
G.P_CENTERS.v_observatory.config.extra,
1491+
localize("cry_None", "poker_hands"),
1492+
localize("cry_WholeDeck", "poker_hands"),
14781493
}
14791494
}
14801495
end
@@ -1499,20 +1514,28 @@ local perkele = {
14991514
Cryptid.suit_level_up(card, copier, number, card.config.center.config.level_types)
15001515
end,
15011516
calculate = function(self, card, context)
1502-
-- see lib/ascended.lua for ascension power effect
1503-
if
1504-
G.GAME.used_vouchers.v_observatory
1505-
and context.joker_main
1506-
and (
1507-
context.scoring_name == "cry_None"
1508-
or context.scoring_name == "cry_WholeDeck"
1509-
)
1510-
then
1511-
local value = G.P_CENTERS.v_observatory.config.extra
1517+
if context.cry_observatory then
1518+
local value = context.cry_observatory.ability.extra
15121519
if Overflow then
15131520
value = value ^ to_big(card:getQty())
15141521
end
1515-
return { xmult = value }
1522+
1523+
if context.scoring_name == "cry_None" then
1524+
return { xmult = value }
1525+
1526+
elseif context.scoring_name == "cry_WholeDeck" then
1527+
return {
1528+
message = localize({
1529+
type = "variable",
1530+
key = "a_powmult",
1531+
vars = {
1532+
number_format(context.cry_observatory.ability.extra),
1533+
},
1534+
}),
1535+
Emult_mod = lenient_bignum(context.cry_observatory.ability.extra),
1536+
colour = G.C.DARK_EDITION,
1537+
}
1538+
end
15161539
end
15171540
end,
15181541
demicoloncompat = true,
@@ -1631,22 +1654,18 @@ local voxel = {
16311654
end,
16321655
calculate = function(self, card, context)
16331656
if
1634-
G.GAME.used_vouchers.v_observatory
1635-
and context.joker_main
1657+
context.cry_observatory
16361658
and (
16371659
context.scoring_name == "cry_Declare0"
16381660
or context.scoring_name == "cry_Declare1"
16391661
or context.scoring_name == "cry_Declare2"
16401662
)
16411663
then
1642-
local value = G.P_CENTERS.v_observatory.config.extra
1664+
local value = context.cry_observatory.ability.extra
16431665
if Overflow then
16441666
value = value ^ to_big(card:getQty())
16451667
end
1646-
return {
1647-
message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
1648-
Xmult_mod = value,
1649-
}
1668+
return { xmult = value }
16501669
end
16511670
end,
16521671
demicoloncompat = true,

0 commit comments

Comments
 (0)