Skip to content

Commit 7873b01

Browse files
Observatory fix
- Fixed Observatory not working with most planets
1 parent 18e318b commit 7873b01

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

items/planet.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ local abelt = {
4545
},
4646
}
4747
end,
48+
calculate = function(self, card, context)
49+
if context.cry_observatory and context.scoring_name == card.ability.consumeable.hand_type then
50+
local value = context.cry_observatory.ability.extra
51+
if Overflow then
52+
value = value ^ to_big(card:getQty())
53+
end
54+
return { xmult = value }
55+
end
56+
end,
4857
generate_ui = 0,
4958
demicoloncompat = true,
5059
force_use = function(self, card, area)
@@ -98,6 +107,15 @@ local void = {
98107
},
99108
}
100109
end,
110+
calculate = function(self, card, context)
111+
if context.cry_observatory and context.scoring_name == card.ability.consumeable.hand_type then
112+
local value = context.cry_observatory.ability.extra
113+
if Overflow then
114+
value = value ^ to_big(card:getQty())
115+
end
116+
return { xmult = value }
117+
end
118+
end,
101119
generate_ui = 0,
102120
demicoloncompat = true,
103121
force_use = function(self, card, area)
@@ -156,6 +174,15 @@ local marsmoons = {
156174
},
157175
}
158176
end,
177+
calculate = function(self, card, context)
178+
if context.cry_observatory and context.scoring_name == card.ability.consumeable.hand_type then
179+
local value = context.cry_observatory.ability.extra
180+
if Overflow then
181+
value = value ^ to_big(card:getQty())
182+
end
183+
return { xmult = value }
184+
end
185+
end,
159186
generate_ui = 0,
160187
demicoloncompat = true,
161188
force_use = function(self, card, area)
@@ -218,6 +245,15 @@ local nibiru = {
218245
},
219246
}
220247
end,
248+
calculate = function(self, card, context)
249+
if context.cry_observatory and context.scoring_name == card.ability.consumeable.hand_type then
250+
local value = context.cry_observatory.ability.extra
251+
if Overflow then
252+
value = value ^ to_big(card:getQty())
253+
end
254+
return { xmult = value }
255+
end
256+
end,
221257
generate_ui = 0,
222258
demicoloncompat = true,
223259
force_use = function(self, card, area)

lib/content.lua

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,3 +890,30 @@ SMODS.Scoring_Calculation({
890890
end
891891
end,
892892
})
893+
-- There's probably a better way to fix observatory on these than this
894+
for k, v in pairs({
895+
"mercury",
896+
"venus",
897+
"earth",
898+
"mars",
899+
"jupiter",
900+
"saturn",
901+
"uranus",
902+
"neptune",
903+
"pluto",
904+
"planet_x",
905+
"ceres",
906+
"eris",
907+
}) do
908+
SMODS.Consumable:take_ownership(v, {
909+
calculate = function(self, card, context)
910+
if context.cry_observatory and context.scoring_name == card.ability.consumeable.hand_type then
911+
local value = context.cry_observatory.ability.extra
912+
if Overflow then
913+
value = value ^ to_big(card:getQty())
914+
end
915+
return { xmult = value }
916+
end
917+
end,
918+
}, true)
919+
end

0 commit comments

Comments
 (0)