@@ -1671,6 +1671,155 @@ local formidiulosus = {
16711671 code = { " Foegro" },
16721672 },
16731673}
1674+ local caeruleum = {
1675+ dependencies = {
1676+ items = {
1677+ " c_cry_gateway" ,
1678+ " set_cry_exotic" ,
1679+ },
1680+ },
1681+ object_type = " Joker" ,
1682+ name = " cry-Caeruleum" ,
1683+ key = " caeruleum" ,
1684+ config = {
1685+ immutable = {
1686+ max_op = 3 ,
1687+ }
1688+ },
1689+
1690+ init = function (self )
1691+ -- this is probably not a very good way of doing this but uh it's how i did it
1692+ local ccj = Card .calculate_joker
1693+ function Card :calculate_joker (context , ...)
1694+ local ret = ccj (self , context , ... )
1695+
1696+ local left_joker = nil
1697+ local right_joker = nil
1698+
1699+ if # SMODS .find_card (" j_cry_caeruleum" ) >= 1 then
1700+ -- find caeruleum, call its function if it exists
1701+ for i = 1 , # G .jokers .cards do
1702+ if G .jokers .cards [i ] == self then
1703+ left_joker = G .jokers .cards [i - 1 ]
1704+ right_joker = G .jokers .cards [i + 1 ]
1705+ end
1706+ end
1707+
1708+ -- with supercell, 2 copies will only give ^15 instead of ^30 due to the ^2 from the first one being overridden
1709+ -- fixing this would be very hard
1710+ if left_joker and left_joker .config .center .key == " j_cry_caeruleum" then
1711+ ret = Cryptid .caeruleum_mod_chips (ret , left_joker )
1712+ end
1713+
1714+ if right_joker and right_joker .config .center .key == " j_cry_caeruleum" then
1715+ ret = Cryptid .caeruleum_mod_chips (ret , right_joker )
1716+ end
1717+ end
1718+
1719+ return ret
1720+ end
1721+ end ,
1722+
1723+ pos = { x = 3 , y = 6 },
1724+ rarity = " cry_exotic" ,
1725+ order = 519 ,
1726+ cost = 50 ,
1727+ blueprint_compat = false ,
1728+ demicoloncompat = false ,
1729+ atlas = " atlasexotic" ,
1730+ soul_pos = { x = 5 , y = 6 , extra = { x = 4 , y = 6 } },
1731+ loc_vars = function (self , info_queue , center )
1732+ return {
1733+ vars = {},
1734+ }
1735+ end ,
1736+ calculate = function (self , card , context )
1737+ end ,
1738+ cry_credits = {
1739+ idea = { " HexaCryonic" },
1740+ art = { " Tatteredlurker" },
1741+ code = { " InvalidOS" },
1742+ },
1743+ }
1744+
1745+ local chipsOperators = {
1746+ {
1747+ keys = {
1748+ " eq_chips" ,
1749+ " Eqchips_mod" ,
1750+ " EQchips_mod" ,
1751+ -- TARGET: add =chips modifiers (or succession if you're silly)
1752+ },
1753+ operation = 0 ,
1754+ },
1755+ {
1756+ keys = {
1757+ " chips" ,
1758+ " h_chips" ,
1759+ " chip_mod"
1760+ },
1761+ operation = 1 ,
1762+ },
1763+ {
1764+ keys = {
1765+ " xchips" ,
1766+ " x_chips" ,
1767+ " Xchip_mod"
1768+ },
1769+ operation = 2 ,
1770+ },
1771+ }
1772+
1773+ local chipsReturnOperators = {
1774+ " chips" ,
1775+ " xchips" ,
1776+ " echips" ,
1777+ }
1778+
1779+ local chipsMessageKeys = {
1780+ " a_chips" ,
1781+ " a_xchips" ,
1782+ " a_powchips" ,
1783+ }
1784+
1785+ function Cryptid .caeruleum_mod_chips (effect , caeruleum )
1786+ if not SMODS .Calculation_Controls .chips or not effect or not next (effect ) then return end
1787+
1788+ local new_effect = SMODS .shallow_copy (effect )
1789+
1790+ -- recursively go down extra tables
1791+ if effect .extra then new_effect .extra = Cryptid .caeruleum_mod_chips (effect .extra ) end
1792+
1793+ for _ , op in ipairs (chipsOperators ) do
1794+ for _ , key in pairs (op .keys ) do
1795+ if effect [key ] then
1796+ new_effect [key ] = nil
1797+ local op2 = math.max (1 , math.min (op .operation + 1 , 3 ))
1798+ new_effect [chipsReturnOperators [op2 ]] = effect [key ]
1799+
1800+ if key :sub (- 4 ) == " _mod" then new_effect .remove_default_message = true end
1801+
1802+ new_effect = SMODS .merge_effects {
1803+ new_effect ,
1804+ {
1805+ message = localize ({
1806+ type = " variable" ,
1807+ key = chipsMessageKeys [op2 ],
1808+ vars = {
1809+ number_format (effect [key ]),
1810+ },
1811+ }),
1812+ card = caeruleum ,
1813+ focus = caeruleum
1814+ }
1815+ }
1816+ end
1817+ end
1818+ end
1819+
1820+ return new_effect
1821+ end
1822+
16741823local items = {
16751824 gateway ,
16761825 iterum ,
@@ -1694,6 +1843,7 @@ local items = {
16941843 -- rescribere, [NEEDS REFACTOR]
16951844 duplicare ,
16961845 formidiulosus , -- see tenebris
1846+ caeruleum ,
16971847}
16981848return {
16991849 name = " Exotic Jokers" ,
0 commit comments