updated cryptid, now using new smods
							
								
								
									
										3650
									
								
								Cryptid/Cryptid.lua
									
									
									
									
									
								
							
							
						
						| 
						 | 
					@ -1,215 +0,0 @@
 | 
				
			||||||
local blank = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Blank",
 | 
					 | 
				
			||||||
	key = "blank",
 | 
					 | 
				
			||||||
	order = 75,
 | 
					 | 
				
			||||||
	pos = { x = 1, y = 0 },
 | 
					 | 
				
			||||||
	atlas = "blank",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local blank_sprite = {
 | 
					 | 
				
			||||||
	object_type = "Atlas",
 | 
					 | 
				
			||||||
	key = "blank",
 | 
					 | 
				
			||||||
	path = "atlasdeck.png",
 | 
					 | 
				
			||||||
	px = 71,
 | 
					 | 
				
			||||||
	py = 95,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local antimatter = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Antimatter",
 | 
					 | 
				
			||||||
	order = 76,
 | 
					 | 
				
			||||||
	key = "antimatter",
 | 
					 | 
				
			||||||
	config = {
 | 
					 | 
				
			||||||
		cry_antimatter = true,
 | 
					 | 
				
			||||||
		discards = 1, --Red Deck: 1
 | 
					 | 
				
			||||||
		hands = 1, --Blue Deck: 1
 | 
					 | 
				
			||||||
		dollars = 10, --Yellow Deck
 | 
					 | 
				
			||||||
		extra_hand_bonus = 2,
 | 
					 | 
				
			||||||
		extra_discard_bonus = 1, --Green Deck
 | 
					 | 
				
			||||||
		joker_slot = 1, --Black Deck: 1
 | 
					 | 
				
			||||||
		vouchers = {
 | 
					 | 
				
			||||||
			"v_crystal_ball",
 | 
					 | 
				
			||||||
			"v_telescope",
 | 
					 | 
				
			||||||
			"v_tarot_merchant",
 | 
					 | 
				
			||||||
			"v_planet_merchant",
 | 
					 | 
				
			||||||
			"v_overstock_norm",
 | 
					 | 
				
			||||||
			"v_overstock_plus",
 | 
					 | 
				
			||||||
		}, --Vouchers from all decks
 | 
					 | 
				
			||||||
		consumables = { "c_fool", "c_fool", "c_hex" }, --Consumables from all decks
 | 
					 | 
				
			||||||
		spectral_rate = 2, --Ghost Deck
 | 
					 | 
				
			||||||
		remove_faces = true, --Abandoned Deck
 | 
					 | 
				
			||||||
		hand_size = 3, --Painted Deck & Infinite deck
 | 
					 | 
				
			||||||
		randomize_rank_suit = true, --Erratic Deck
 | 
					 | 
				
			||||||
		cry_equilibrium = true, --Deck of Equilibrium
 | 
					 | 
				
			||||||
		cry_misprint_min = 1,
 | 
					 | 
				
			||||||
		cry_misprint_max = 10, --Misprint Deck
 | 
					 | 
				
			||||||
		cry_highlight_limit = 1e20, --Infinite Deck
 | 
					 | 
				
			||||||
		cry_wormhole = true,
 | 
					 | 
				
			||||||
		cry_negative_rate = 20, --Wormhole Deck
 | 
					 | 
				
			||||||
		cry_redeemed = true, --Redeemed Deck
 | 
					 | 
				
			||||||
		cry_crit_rate = 0.25, --Critical Deck
 | 
					 | 
				
			||||||
		cry_encoded = true, --Encoded Deck
 | 
					 | 
				
			||||||
		cry_legendary = true,
 | 
					 | 
				
			||||||
		cry_legendary_rate = 0.2, --Legendary Deck
 | 
					 | 
				
			||||||
		cry_spooky = true, --Spooky Deck
 | 
					 | 
				
			||||||
		cry_curse_rate = 0,
 | 
					 | 
				
			||||||
		-- Enhanced Decks
 | 
					 | 
				
			||||||
		cry_force_enhancement = "random",
 | 
					 | 
				
			||||||
		cry_force_edition = "random",
 | 
					 | 
				
			||||||
		cry_force_seal = "random",
 | 
					 | 
				
			||||||
		cry_boss_blocked = { "bl_goad", "bl_window", "bl_club", "bl_head" },
 | 
					 | 
				
			||||||
		cry_forced_draw_amount = 5,
 | 
					 | 
				
			||||||
		cry_common_value_quad = true,
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	pos = { x = 2, y = 0 },
 | 
					 | 
				
			||||||
	trigger_effect = function(self, args)
 | 
					 | 
				
			||||||
		if args.context == "final_scoring_step" then
 | 
					 | 
				
			||||||
			--Critical Deck
 | 
					 | 
				
			||||||
			local crit_poll = pseudorandom(pseudoseed("cry_critical"))
 | 
					 | 
				
			||||||
			crit_poll = crit_poll / (G.GAME.probabilities.normal or 1)
 | 
					 | 
				
			||||||
			if crit_poll < self.config.cry_crit_rate then
 | 
					 | 
				
			||||||
				args.mult = args.mult ^ 2
 | 
					 | 
				
			||||||
				update_hand_text({ delay = 0 }, { mult = args.mult, chips = args.chips })
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						play_sound("talisman_emult", 1)
 | 
					 | 
				
			||||||
						attention_text({
 | 
					 | 
				
			||||||
							scale = 1.4,
 | 
					 | 
				
			||||||
							text = localize("cry_critical_hit_ex"),
 | 
					 | 
				
			||||||
							hold = 4,
 | 
					 | 
				
			||||||
							align = "cm",
 | 
					 | 
				
			||||||
							offset = { x = 0, y = -1.7 },
 | 
					 | 
				
			||||||
							major = G.play,
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			delay(0.6)
 | 
					 | 
				
			||||||
			--Plasma Deck
 | 
					 | 
				
			||||||
			local tot = args.chips + args.mult
 | 
					 | 
				
			||||||
			args.chips = math.floor(tot / 2)
 | 
					 | 
				
			||||||
			args.mult = math.floor(tot / 2)
 | 
					 | 
				
			||||||
			update_hand_text({ delay = 0 }, { mult = args.mult, chips = args.chips })
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
				func = function()
 | 
					 | 
				
			||||||
					local text = localize("k_balanced")
 | 
					 | 
				
			||||||
					play_sound("gong", 0.94, 0.3)
 | 
					 | 
				
			||||||
					play_sound("gong", 0.94 * 1.5, 0.2)
 | 
					 | 
				
			||||||
					play_sound("tarot1", 1.5)
 | 
					 | 
				
			||||||
					ease_colour(G.C.UI_CHIPS, { 0.8, 0.45, 0.85, 1 })
 | 
					 | 
				
			||||||
					ease_colour(G.C.UI_MULT, { 0.8, 0.45, 0.85, 1 })
 | 
					 | 
				
			||||||
					attention_text({
 | 
					 | 
				
			||||||
						scale = 1.4,
 | 
					 | 
				
			||||||
						text = text,
 | 
					 | 
				
			||||||
						hold = 2,
 | 
					 | 
				
			||||||
						align = "cm",
 | 
					 | 
				
			||||||
						offset = { x = 0, y = -2.7 },
 | 
					 | 
				
			||||||
						major = G.play,
 | 
					 | 
				
			||||||
					})
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						trigger = "after",
 | 
					 | 
				
			||||||
						blockable = false,
 | 
					 | 
				
			||||||
						blocking = false,
 | 
					 | 
				
			||||||
						delay = 4.3,
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							ease_colour(G.C.UI_CHIPS, G.C.BLUE, 2)
 | 
					 | 
				
			||||||
							ease_colour(G.C.UI_MULT, G.C.RED, 2)
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						trigger = "after",
 | 
					 | 
				
			||||||
						blockable = false,
 | 
					 | 
				
			||||||
						blocking = false,
 | 
					 | 
				
			||||||
						no_delete = true,
 | 
					 | 
				
			||||||
						delay = 6.3,
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.C.UI_CHIPS[1], G.C.UI_CHIPS[2], G.C.UI_CHIPS[3], G.C.UI_CHIPS[4] =
 | 
					 | 
				
			||||||
								G.C.BLUE[1], G.C.BLUE[2], G.C.BLUE[3], G.C.BLUE[4]
 | 
					 | 
				
			||||||
							G.C.UI_MULT[1], G.C.UI_MULT[2], G.C.UI_MULT[3], G.C.UI_MULT[4] =
 | 
					 | 
				
			||||||
								G.C.RED[1], G.C.RED[2], G.C.RED[3], G.C.RED[4]
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					return true
 | 
					 | 
				
			||||||
				end,
 | 
					 | 
				
			||||||
			}))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			delay(0.6)
 | 
					 | 
				
			||||||
			return args.chips, args.mult
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--Glowing Deck & Legendary Deck
 | 
					 | 
				
			||||||
		if args.context == "eval" and G.GAME.last_blind and G.GAME.last_blind.boss then
 | 
					 | 
				
			||||||
			--Glowing Deck
 | 
					 | 
				
			||||||
			for i = 1, #G.jokers.cards do
 | 
					 | 
				
			||||||
				cry_with_deck_effects(G.jokers.cards[i], function(card)
 | 
					 | 
				
			||||||
					cry_misprintize(card, { min = 1.25, max = 1.25 }, nil, true)
 | 
					 | 
				
			||||||
				end)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			--Legendary Deck
 | 
					 | 
				
			||||||
			if G.jokers then
 | 
					 | 
				
			||||||
				if #G.jokers.cards < G.jokers.config.card_limit then
 | 
					 | 
				
			||||||
					local legendary_poll = pseudorandom(pseudoseed("cry_legendary"))
 | 
					 | 
				
			||||||
					legendary_poll = legendary_poll / (G.GAME.probabilities.normal or 1)
 | 
					 | 
				
			||||||
					if legendary_poll < self.config.cry_legendary_rate then
 | 
					 | 
				
			||||||
						local card = create_card("Joker", G.jokers, true, 4, nil, nil, nil, "")
 | 
					 | 
				
			||||||
						card:add_to_deck()
 | 
					 | 
				
			||||||
						card:start_materialize()
 | 
					 | 
				
			||||||
						G.jokers:emplace(card)
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					else
 | 
					 | 
				
			||||||
						card_eval_status_text(
 | 
					 | 
				
			||||||
							G.jokers,
 | 
					 | 
				
			||||||
							"jokers",
 | 
					 | 
				
			||||||
							nil,
 | 
					 | 
				
			||||||
							nil,
 | 
					 | 
				
			||||||
							nil,
 | 
					 | 
				
			||||||
							{ message = localize("k_nope_ex"), colour = G.C.RARITY[4] }
 | 
					 | 
				
			||||||
						)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
					card_eval_status_text(
 | 
					 | 
				
			||||||
						G.jokers,
 | 
					 | 
				
			||||||
						"jokers",
 | 
					 | 
				
			||||||
						nil,
 | 
					 | 
				
			||||||
						nil,
 | 
					 | 
				
			||||||
						nil,
 | 
					 | 
				
			||||||
						{ message = localize("k_no_room_ex"), colour = G.C.RARITY[4] }
 | 
					 | 
				
			||||||
					)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			--Anaglyph Deck
 | 
					 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
            			func = (function()
 | 
					 | 
				
			||||||
                			add_tag(Tag('tag_double'))
 | 
					 | 
				
			||||||
                			play_sound('generic1', 0.9 + math.random()*0.1, 0.8)
 | 
					 | 
				
			||||||
                			play_sound('holo1', 1.2 + math.random()*0.1, 0.4)
 | 
					 | 
				
			||||||
                			return true
 | 
					 | 
				
			||||||
            			end)
 | 
					 | 
				
			||||||
        		}))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	apply = function(self)
 | 
					 | 
				
			||||||
		--Checkered Deck
 | 
					 | 
				
			||||||
		G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
           		func = function()
 | 
					 | 
				
			||||||
                		for k, v in pairs(G.playing_cards) do
 | 
					 | 
				
			||||||
                    			if v.base.suit == 'Clubs' then 
 | 
					 | 
				
			||||||
                        			v:change_suit('Spades')
 | 
					 | 
				
			||||||
                    			end
 | 
					 | 
				
			||||||
                    			if v.base.suit == 'Diamonds' then 
 | 
					 | 
				
			||||||
			                	v:change_suit('Hearts')
 | 
					 | 
				
			||||||
                    			end
 | 
					 | 
				
			||||||
                		end
 | 
					 | 
				
			||||||
            		return true
 | 
					 | 
				
			||||||
            		end
 | 
					 | 
				
			||||||
        	}))
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	atlas = "blank",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
return {
 | 
					 | 
				
			||||||
	name = "Antimatter Deck",
 | 
					 | 
				
			||||||
	init = function() end,
 | 
					 | 
				
			||||||
	items = { blank_sprite, blank, antimatter },
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,486 +0,0 @@
 | 
				
			||||||
local atlasdeck = {
 | 
					 | 
				
			||||||
	object_type = "Atlas",
 | 
					 | 
				
			||||||
	key = "atlasdeck",
 | 
					 | 
				
			||||||
	path = "atlasdeck.png",
 | 
					 | 
				
			||||||
	px = 71,
 | 
					 | 
				
			||||||
	py = 95,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local atlasglowing = {
 | 
					 | 
				
			||||||
	object_type = "Atlas",
 | 
					 | 
				
			||||||
	key = "glowing",
 | 
					 | 
				
			||||||
	path = "b_cry_glowing.png",
 | 
					 | 
				
			||||||
	px = 71,
 | 
					 | 
				
			||||||
	py = 95,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local very_fair = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "Very Fair Deck",
 | 
					 | 
				
			||||||
	key = "very_fair",
 | 
					 | 
				
			||||||
	config = { hands = -2, discards = -2, cry_no_vouchers = true },
 | 
					 | 
				
			||||||
	pos = { x = 4, y = 0 },
 | 
					 | 
				
			||||||
	order = 1,
 | 
					 | 
				
			||||||
	--[[loc_vars = function(self, info_queue, center)
 | 
					 | 
				
			||||||
        return {vars = {center.effect.config.hands, center.effect.config.discards}}
 | 
					 | 
				
			||||||
    end,--]]
 | 
					 | 
				
			||||||
	--this doesn't work, will fix later
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
very_fair_quip = {}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local equilibrium = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Equilibrium",
 | 
					 | 
				
			||||||
	key = "equilibrium",
 | 
					 | 
				
			||||||
	order = 3,
 | 
					 | 
				
			||||||
	config = { vouchers = { "v_overstock_norm", "v_overstock_plus" }, cry_equilibrium = true },
 | 
					 | 
				
			||||||
	pos = { x = 0, y = 1 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local misprint = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Misprint",
 | 
					 | 
				
			||||||
	key = "misprint",
 | 
					 | 
				
			||||||
	order = 4,
 | 
					 | 
				
			||||||
	config = { cry_misprint_min = 0.1, cry_misprint_max = 10 },
 | 
					 | 
				
			||||||
	pos = { x = 4, y = 2 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local infinite = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Infinite",
 | 
					 | 
				
			||||||
	key = "infinite",
 | 
					 | 
				
			||||||
	order = 2,
 | 
					 | 
				
			||||||
	config = { cry_highlight_limit = 1e20, hand_size = 1 },
 | 
					 | 
				
			||||||
	pos = { x = 3, y = 0 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local conveyor = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Conveyor",
 | 
					 | 
				
			||||||
	key = "conveyor",
 | 
					 | 
				
			||||||
	order = 7,
 | 
					 | 
				
			||||||
	config = { cry_conveyor = true },
 | 
					 | 
				
			||||||
	pos = { x = 1, y = 1 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local CCD = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-CCD",
 | 
					 | 
				
			||||||
	key = "CCD",
 | 
					 | 
				
			||||||
	order = 5,
 | 
					 | 
				
			||||||
	config = { cry_ccd = true },
 | 
					 | 
				
			||||||
	pos = { x = 0, y = 0 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local wormhole = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Wormhole",
 | 
					 | 
				
			||||||
	key = "wormhole",
 | 
					 | 
				
			||||||
	order = 6,
 | 
					 | 
				
			||||||
	config = { cry_wormhole = true, cry_negative_rate = 20, joker_slot = -2 },
 | 
					 | 
				
			||||||
	pos = { x = 3, y = 4 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local redeemed = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Redeemed",
 | 
					 | 
				
			||||||
	key = "redeemed",
 | 
					 | 
				
			||||||
	order = 8,
 | 
					 | 
				
			||||||
	config = { cry_redeemed = true },
 | 
					 | 
				
			||||||
	pos = { x = 4, y = 4 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local legendary = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Legendary",
 | 
					 | 
				
			||||||
	key = "legendary",
 | 
					 | 
				
			||||||
	config = { cry_legendary = true, cry_legendary_rate = 0.2 },
 | 
					 | 
				
			||||||
	pos = { x = 0, y = 6 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
	order = 15,
 | 
					 | 
				
			||||||
	trigger_effect = function(self, args)
 | 
					 | 
				
			||||||
		if args.context == "eval" and G.GAME.last_blind and G.GAME.last_blind.boss then
 | 
					 | 
				
			||||||
			if G.jokers then
 | 
					 | 
				
			||||||
				if #G.jokers.cards < G.jokers.config.card_limit then
 | 
					 | 
				
			||||||
					local legendary_poll = pseudorandom(pseudoseed("cry_legendary"))
 | 
					 | 
				
			||||||
					legendary_poll = legendary_poll / (G.GAME.probabilities.normal or 1)
 | 
					 | 
				
			||||||
					if legendary_poll < self.config.cry_legendary_rate then
 | 
					 | 
				
			||||||
						local card = create_card("Joker", G.jokers, true, 4, nil, nil, nil, "")
 | 
					 | 
				
			||||||
						card:add_to_deck()
 | 
					 | 
				
			||||||
						card:start_materialize()
 | 
					 | 
				
			||||||
						G.jokers:emplace(card)
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					else
 | 
					 | 
				
			||||||
						card_eval_status_text(
 | 
					 | 
				
			||||||
							G.jokers,
 | 
					 | 
				
			||||||
							"jokers",
 | 
					 | 
				
			||||||
							nil,
 | 
					 | 
				
			||||||
							nil,
 | 
					 | 
				
			||||||
							nil,
 | 
					 | 
				
			||||||
							{ message = localize("k_nope_ex"), colour = G.C.RARITY[4] }
 | 
					 | 
				
			||||||
						)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
					card_eval_status_text(
 | 
					 | 
				
			||||||
						G.jokers,
 | 
					 | 
				
			||||||
						"jokers",
 | 
					 | 
				
			||||||
						nil,
 | 
					 | 
				
			||||||
						nil,
 | 
					 | 
				
			||||||
						nil,
 | 
					 | 
				
			||||||
						{ message = localize("k_no_room_ex"), colour = G.C.RARITY[4] }
 | 
					 | 
				
			||||||
					)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local critical = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Critical",
 | 
					 | 
				
			||||||
	key = "critical",
 | 
					 | 
				
			||||||
	order = 10,
 | 
					 | 
				
			||||||
	config = { cry_crit_rate = 0.25, cry_crit_miss_rate = 0.125 },
 | 
					 | 
				
			||||||
	pos = { x = 4, y = 5 },
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
	loc_vars = function(self, info_queue, center)
 | 
					 | 
				
			||||||
		return { vars = { G.GAME.probabilities.normal or 1 } }
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	trigger_effect = function(self, args)
 | 
					 | 
				
			||||||
		if args.context == "final_scoring_step" then
 | 
					 | 
				
			||||||
			local crit_poll = pseudorandom(pseudoseed("cry_critical"))
 | 
					 | 
				
			||||||
			crit_poll = crit_poll / (G.GAME.probabilities.normal or 1)
 | 
					 | 
				
			||||||
			if crit_poll < self.config.cry_crit_rate then
 | 
					 | 
				
			||||||
				args.mult = args.mult ^ 2
 | 
					 | 
				
			||||||
				update_hand_text({ delay = 0 }, { mult = args.mult, chips = args.chips })
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						play_sound("talisman_emult", 1)
 | 
					 | 
				
			||||||
						attention_text({
 | 
					 | 
				
			||||||
							scale = 1.4,
 | 
					 | 
				
			||||||
							text = localize("cry_critical_hit_ex"),
 | 
					 | 
				
			||||||
							hold = 2,
 | 
					 | 
				
			||||||
							align = "cm",
 | 
					 | 
				
			||||||
							offset = { x = 0, y = -2.7 },
 | 
					 | 
				
			||||||
							major = G.play,
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			elseif crit_poll < self.config.cry_crit_rate + self.config.cry_crit_miss_rate then
 | 
					 | 
				
			||||||
				args.mult = args.mult ^ 0.5
 | 
					 | 
				
			||||||
				update_hand_text({ delay = 0 }, { mult = args.mult, chips = args.chips })
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						play_sound("timpani", 1)
 | 
					 | 
				
			||||||
						attention_text({
 | 
					 | 
				
			||||||
							scale = 1.4,
 | 
					 | 
				
			||||||
							text = localize("cry_critical_miss_ex"),
 | 
					 | 
				
			||||||
							hold = 2,
 | 
					 | 
				
			||||||
							align = "cm",
 | 
					 | 
				
			||||||
							offset = { x = 0, y = -2.7 },
 | 
					 | 
				
			||||||
							major = G.play,
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			delay(0.6)
 | 
					 | 
				
			||||||
			return args.chips, args.mult
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local glowing = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Glowing",
 | 
					 | 
				
			||||||
	key = "glowing",
 | 
					 | 
				
			||||||
	config = { cry_glowing = true },
 | 
					 | 
				
			||||||
	pos = { x = 4, y = 2 },
 | 
					 | 
				
			||||||
	order = 9,
 | 
					 | 
				
			||||||
	loc_vars = function(self, info_queue, center)
 | 
					 | 
				
			||||||
		return { vars = { " " } }
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	atlas = "glowing",
 | 
					 | 
				
			||||||
	trigger_effect = function(self, args)
 | 
					 | 
				
			||||||
		if args.context == "eval" and G.GAME.last_blind and G.GAME.last_blind.boss then
 | 
					 | 
				
			||||||
			for i = 1, #G.jokers.cards do
 | 
					 | 
				
			||||||
				if not Card.no(G.jokers.cards[i], "immutable", true) then
 | 
					 | 
				
			||||||
					cry_with_deck_effects(G.jokers.cards[i], function(card)
 | 
					 | 
				
			||||||
						cry_misprintize(card, { min = 1.25, max = 1.25 }, nil, true)
 | 
					 | 
				
			||||||
					end)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local beta = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Beta",
 | 
					 | 
				
			||||||
	key = "beta",
 | 
					 | 
				
			||||||
	config = { cry_beta = true },
 | 
					 | 
				
			||||||
	pos = { x = 5, y = 5 },
 | 
					 | 
				
			||||||
	order = 13,
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local bountiful = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Bountiful",
 | 
					 | 
				
			||||||
	key = "bountiful",
 | 
					 | 
				
			||||||
	config = { cry_forced_draw_amount = 5 },
 | 
					 | 
				
			||||||
	pos = { x = 2, y = 6 },
 | 
					 | 
				
			||||||
	order = 14,
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local beige = {
 | 
					 | 
				
			||||||
	object_type = "Back",
 | 
					 | 
				
			||||||
	name = "cry-Beige",
 | 
					 | 
				
			||||||
	key = "beige",
 | 
					 | 
				
			||||||
	config = { cry_common_value_quad = true },
 | 
					 | 
				
			||||||
	pos = { x = 1, y = 6 },
 | 
					 | 
				
			||||||
	order = 15,
 | 
					 | 
				
			||||||
	atlas = "atlasdeck",
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
return {
 | 
					 | 
				
			||||||
	name = "Misc. Decks",
 | 
					 | 
				
			||||||
	init = function()
 | 
					 | 
				
			||||||
		local Backapply_to_runRef = Back.apply_to_run
 | 
					 | 
				
			||||||
		function Back.apply_to_run(self)
 | 
					 | 
				
			||||||
			Backapply_to_runRef(self)
 | 
					 | 
				
			||||||
			if self.effect.config.cry_no_vouchers then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_no_vouchers = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_equilibrium then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_equilibrium = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_conveyor then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_conveyor = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_misprint_min then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_misprint_min = (G.GAME.modifiers.cry_misprint_min or 1) * self.effect.config.cry_misprint_min
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_misprint_max = (G.GAME.modifiers.cry_misprint_max or 1) * self.effect.config.cry_misprint_max
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_highlight_limit then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_highlight_limit = self.effect.config.cry_highlight_limit
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_ccd then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_ccd = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_beta then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_beta = true
 | 
					 | 
				
			||||||
				G.GAME.pool_flags.beta_deck = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_legendary then
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						if G.jokers then
 | 
					 | 
				
			||||||
							local card = create_card("Joker", G.jokers, true, 4, nil, nil, nil, "")
 | 
					 | 
				
			||||||
							card:add_to_deck()
 | 
					 | 
				
			||||||
							card:start_materialize()
 | 
					 | 
				
			||||||
							G.jokers:emplace(card)
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_wormhole then
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						if G.jokers then
 | 
					 | 
				
			||||||
							local card =
 | 
					 | 
				
			||||||
								create_card("Joker", G.jokers, nil, "cry_exotic", nil, nil, nil, "cry_wormhole")
 | 
					 | 
				
			||||||
							card:add_to_deck()
 | 
					 | 
				
			||||||
							card:start_materialize()
 | 
					 | 
				
			||||||
							G.jokers:emplace(card)
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_negative_rate then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_negative_rate = self.effect.config.cry_negative_rate
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_redeemed then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_redeemed = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_forced_draw_amount then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_forced_draw_amount = self.effect.config.cry_forced_draw_amount
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_common_value_quad then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_common_value_quad = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--equilibrium deck patches
 | 
					 | 
				
			||||||
		local gcp = get_current_pool
 | 
					 | 
				
			||||||
		function get_current_pool(t, r, l, a, override_equilibrium_effect)
 | 
					 | 
				
			||||||
			if
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_equilibrium
 | 
					 | 
				
			||||||
				and not override_equilibrium_effect
 | 
					 | 
				
			||||||
				and (a == "sho" or t == "Voucher" or t == "Booster")
 | 
					 | 
				
			||||||
			then
 | 
					 | 
				
			||||||
				if
 | 
					 | 
				
			||||||
					t ~= "Enhanced"
 | 
					 | 
				
			||||||
					and t ~= "Edition"
 | 
					 | 
				
			||||||
					and t ~= "Back"
 | 
					 | 
				
			||||||
					and t ~= "Tag"
 | 
					 | 
				
			||||||
					and t ~= "Seal"
 | 
					 | 
				
			||||||
					and t ~= "Stake"
 | 
					 | 
				
			||||||
				then
 | 
					 | 
				
			||||||
					if true then	-- if not P_CRY_ITEMS then
 | 
					 | 
				
			||||||
						-- we're regenerating the pool every time because of banned keys but it's fine tbh
 | 
					 | 
				
			||||||
						P_CRY_ITEMS = {}
 | 
					 | 
				
			||||||
						local valid_pools = { "Joker", "Consumeables", "Voucher", "Booster" }
 | 
					 | 
				
			||||||
						for _, id in ipairs(valid_pools) do
 | 
					 | 
				
			||||||
							for k, v in pairs(G.P_CENTER_POOLS[id]) do
 | 
					 | 
				
			||||||
								if v.unlocked == true and not center_no(v, "doe", k) and not G.GAME.banned_keys[v.key] then
 | 
					 | 
				
			||||||
									P_CRY_ITEMS[#P_CRY_ITEMS + 1] = v.key
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
						--[[	this doesn't seem to be working
 | 
					 | 
				
			||||||
						for k, v in pairs(G.P_CARDS) do
 | 
					 | 
				
			||||||
							if v.unlocked == true and not center_no(v, "doe", k) then
 | 
					 | 
				
			||||||
								P_CRY_ITEMS[#P_CRY_ITEMS + 1] = v.key
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
						]]
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
					if #P_CRY_ITEMS <= 0 then P_CRY_ITEMS[#P_CRY_ITEMS + 1] = 'v_blank' end
 | 
					 | 
				
			||||||
					return P_CRY_ITEMS, "cry_equilibrium" .. G.GAME.round_resets.ante
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			return gcp(t, r, l, a)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local gp = get_pack
 | 
					 | 
				
			||||||
		function get_pack(k, t)
 | 
					 | 
				
			||||||
			if G.GAME.modifiers.cry_equilibrium then
 | 
					 | 
				
			||||||
				if not P_CRY_ITEMS then
 | 
					 | 
				
			||||||
					P_CRY_ITEMS = {}
 | 
					 | 
				
			||||||
					local valid_pools = { "Joker", "Consumeables", "Voucher", "Booster" }
 | 
					 | 
				
			||||||
					for _, id in ipairs(valid_pools) do
 | 
					 | 
				
			||||||
						for k, v in pairs(G.P_CENTER_POOLS[id]) do
 | 
					 | 
				
			||||||
							if not center_no(v, "doe", k) then
 | 
					 | 
				
			||||||
								P_CRY_ITEMS[#P_CRY_ITEMS + 1] = v.key
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
					for k, v in pairs(G.P_CARDS) do
 | 
					 | 
				
			||||||
						if not center_no(v, "doe", k) then
 | 
					 | 
				
			||||||
							P_CRY_ITEMS[#P_CRY_ITEMS + 1] = v.key
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				return G.P_CENTERS[pseudorandom_element(
 | 
					 | 
				
			||||||
					P_CRY_ITEMS,
 | 
					 | 
				
			||||||
					pseudoseed("cry_equipackbrium" .. G.GAME.round_resets.ante)
 | 
					 | 
				
			||||||
				)]
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			return gp(k, t)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--wormhole deck patches
 | 
					 | 
				
			||||||
		SMODS.Edition:take_ownership("negative", {
 | 
					 | 
				
			||||||
			get_weight = function(self)
 | 
					 | 
				
			||||||
				return self.weight * (G.GAME.modifiers.cry_negative_rate or 1)
 | 
					 | 
				
			||||||
			end,
 | 
					 | 
				
			||||||
		}, true)
 | 
					 | 
				
			||||||
		--redeemed deck patches
 | 
					 | 
				
			||||||
		local cr = Card.redeem
 | 
					 | 
				
			||||||
		function Card:redeem()
 | 
					 | 
				
			||||||
			cr(self)
 | 
					 | 
				
			||||||
			if G.GAME.modifiers.cry_redeemed then
 | 
					 | 
				
			||||||
				if
 | 
					 | 
				
			||||||
					#G.play.cards == 0
 | 
					 | 
				
			||||||
					and (not G.redeemed_vouchers_during_hand or #G.redeemed_vouchers_during_hand.cards == 0)
 | 
					 | 
				
			||||||
				then
 | 
					 | 
				
			||||||
					G.cry_redeemed_buffer = {}
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				for k, v in pairs(G.P_CENTER_POOLS["Voucher"]) do
 | 
					 | 
				
			||||||
					if v.requires and not G.GAME.used_vouchers[v] then
 | 
					 | 
				
			||||||
						for _, vv in pairs(v.requires) do
 | 
					 | 
				
			||||||
							if vv == self.config.center.key then
 | 
					 | 
				
			||||||
								--redeem extra voucher code based on Betmma's Vouchers
 | 
					 | 
				
			||||||
								local area
 | 
					 | 
				
			||||||
								if G.STATE == G.STATES.HAND_PLAYED then
 | 
					 | 
				
			||||||
									if not G.redeemed_vouchers_during_hand then
 | 
					 | 
				
			||||||
										G.redeemed_vouchers_during_hand = CardArea(
 | 
					 | 
				
			||||||
											G.play.T.x,
 | 
					 | 
				
			||||||
											G.play.T.y,
 | 
					 | 
				
			||||||
											G.play.T.w,
 | 
					 | 
				
			||||||
											G.play.T.h,
 | 
					 | 
				
			||||||
											{ type = "play", card_limit = 5 }
 | 
					 | 
				
			||||||
										)
 | 
					 | 
				
			||||||
									end
 | 
					 | 
				
			||||||
									area = G.redeemed_vouchers_during_hand
 | 
					 | 
				
			||||||
								else
 | 
					 | 
				
			||||||
									area = G.play
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
								if not G.cry_redeemed_buffer[v.key]
 | 
					 | 
				
			||||||
								and v.unlocked then
 | 
					 | 
				
			||||||
									local card = create_card("Voucher", area, nil, nil, nil, nil, v.key)
 | 
					 | 
				
			||||||
									G.cry_redeemed_buffer[v.key] = true
 | 
					 | 
				
			||||||
									card:start_materialize()
 | 
					 | 
				
			||||||
									area:emplace(card)
 | 
					 | 
				
			||||||
									card.cost = 0
 | 
					 | 
				
			||||||
									card.shop_voucher = false
 | 
					 | 
				
			||||||
									local current_round_voucher = G.GAME.current_round.voucher
 | 
					 | 
				
			||||||
									card:redeem()
 | 
					 | 
				
			||||||
									G.GAME.current_round.voucher = current_round_voucher
 | 
					 | 
				
			||||||
									G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
										trigger = "after",
 | 
					 | 
				
			||||||
										delay = 0,
 | 
					 | 
				
			||||||
										func = function()
 | 
					 | 
				
			||||||
											card:start_dissolve()
 | 
					 | 
				
			||||||
											return true
 | 
					 | 
				
			||||||
										end,
 | 
					 | 
				
			||||||
									}))
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--glowing deck patches
 | 
					 | 
				
			||||||
		local upd = Game.update
 | 
					 | 
				
			||||||
		cry_glowing_dt = 0
 | 
					 | 
				
			||||||
		function Game:update(dt)
 | 
					 | 
				
			||||||
			upd(self, dt)
 | 
					 | 
				
			||||||
			cry_glowing_dt = cry_glowing_dt + dt
 | 
					 | 
				
			||||||
			if G.P_CENTERS and G.P_CENTERS.b_cry_glowing and cry_glowing_dt > 0.1 then
 | 
					 | 
				
			||||||
				cry_glowing_dt = 0
 | 
					 | 
				
			||||||
				local obj = G.P_CENTERS.b_cry_glowing
 | 
					 | 
				
			||||||
				if obj.pos.x == 1 and obj.pos.y == 4 then
 | 
					 | 
				
			||||||
					obj.pos.x = 0
 | 
					 | 
				
			||||||
					obj.pos.y = 0
 | 
					 | 
				
			||||||
				elseif obj.pos.x < 4 then
 | 
					 | 
				
			||||||
					obj.pos.x = obj.pos.x + 1
 | 
					 | 
				
			||||||
				elseif obj.pos.y < 6 then
 | 
					 | 
				
			||||||
					obj.pos.x = 0
 | 
					 | 
				
			||||||
					obj.pos.y = obj.pos.y + 1
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			for k, v in pairs(G.I.CARD) do
 | 
					 | 
				
			||||||
				if v.children.back and v.children.back.atlas.name == "cry_glowing" then
 | 
					 | 
				
			||||||
					v.children.back:set_sprite_pos(G.P_CENTERS.b_cry_glowing.pos or G.P_CENTERS["b_red"].pos)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	items = {
 | 
					 | 
				
			||||||
		atlasdeck,
 | 
					 | 
				
			||||||
		very_fair,
 | 
					 | 
				
			||||||
		equilibrium,
 | 
					 | 
				
			||||||
		misprint,
 | 
					 | 
				
			||||||
		infinite,
 | 
					 | 
				
			||||||
		conveyor,
 | 
					 | 
				
			||||||
		CCD,
 | 
					 | 
				
			||||||
		wormhole,
 | 
					 | 
				
			||||||
		redeemed,
 | 
					 | 
				
			||||||
		legendary,
 | 
					 | 
				
			||||||
		critical,
 | 
					 | 
				
			||||||
		atlasglowing,
 | 
					 | 
				
			||||||
		glowing,
 | 
					 | 
				
			||||||
		beta,
 | 
					 | 
				
			||||||
		bountiful,
 | 
					 | 
				
			||||||
		beige,
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,484 +0,0 @@
 | 
				
			||||||
-- Enhanced has to be loaded near-last because of Jolly edition
 | 
					 | 
				
			||||||
-- Not localized for now - will be rewritten later
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local atlasenhanced = {
 | 
					 | 
				
			||||||
	object_type = "Atlas",
 | 
					 | 
				
			||||||
	key = "atlasenhanced",
 | 
					 | 
				
			||||||
	path = "atlasdeck.png",
 | 
					 | 
				
			||||||
	px = 71,
 | 
					 | 
				
			||||||
	py = 95,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
packs_to_add = { atlasenhanced }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local typed_decks = {
 | 
					 | 
				
			||||||
	--	{'mod_prefix',	'Type',			'Name of Deck',				'Name of Object',		'Object Key',		'Shader Name',		'Atlas',			'posX',	'posY',	'Flavour Text',           'Add Price Increase'},
 | 
					 | 
				
			||||||
	--	 eg. 'cry_' for	Edition,		Leave nil to construct								Usually matches		Leave nil to use	All three of these are used			Small subtext underneath  If true, editions
 | 
					 | 
				
			||||||
	--   Cryptid cards	Enhancement,	automatically from									name				object key as name	for custom deck backs				main text                 affect the price of
 | 
					 | 
				
			||||||
	--	 Leave empty	Seal,           object name											Used instead for	Should be nil for	Leave nil to use default                                      cards in shop
 | 
					 | 
				
			||||||
	--	 for vanilla	Sticker,															banned boss blind	non-shader objects	fallback
 | 
					 | 
				
			||||||
	--   				Suit                                   								on Suit decks
 | 
					 | 
				
			||||||
	--																						For stickers ONLY,
 | 
					 | 
				
			||||||
	--																						prefix must be included
 | 
					 | 
				
			||||||
	--																						if you use one
 | 
					 | 
				
			||||||
	--
 | 
					 | 
				
			||||||
	-- Vanilla
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "The Hierophant's Deck", "Bonus", "bonus", nil, "atlasenhanced", 3, 3, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "The Empress' Deck", "Mult", "mult", nil, "atlasenhanced", 2, 3, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "The Lovers' Deck", "Wild", "wild", nil, "atlasenhanced", 5, 3, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "Deck of Justice", "Glass", "glass", nil, "atlasenhanced", 4, 3, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "The Chariot's Deck", "Steel", "steel", nil, nil, 6, 1, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "Stoner's Deck", "Stone", "stone", nil, nil, 5, 0, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "The Devil's Deck", "Gold", "gold", nil, nil, 6, 0, "" },
 | 
					 | 
				
			||||||
	{ "", "Enhancement", "The Magician's Deck", "Lucky", "lucky", nil, nil, 4, 1, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "", "Edition", "Deck of Chips", "Foil", "foil", nil, nil, 0, 2, "" },
 | 
					 | 
				
			||||||
	{ "", "Edition", "Deck of Mult", "Holographic", "holo", nil, nil, 0, 0, "" },
 | 
					 | 
				
			||||||
	{ "", "Edition", "Deck of XMult", "Polychrome", "polychrome", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "", "Edition", nil, "Negative", "negative", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "", "Seal", "Talisman Deck", "Gold", "Gold", nil, nil, 1, 2, "" },
 | 
					 | 
				
			||||||
	{ "", "Seal", "Déja Vu Deck", "Red", "Red", nil, nil, 0, 0, "" },
 | 
					 | 
				
			||||||
	{ "", "Seal", "Trance Deck", "Blue", "Blue", nil, "atlasenhanced", 2, 2, "" },
 | 
					 | 
				
			||||||
	{ "", "Seal", "Medium Deck", "Purple", "Purple", nil, "atlasenhanced", 1, 2, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "", "Sticker", nil, "Eternal", "eternal", nil, "atlasenhanced", 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "", "Sticker", nil, "Perishable", "perishable", nil, "atlasenhanced", 0, 3, "" },
 | 
					 | 
				
			||||||
	{ "", "Sticker", nil, "Rental", "rental", nil, "atlasenhanced", 1, 3, "" },
 | 
					 | 
				
			||||||
	{ "", "Sticker", nil, "Pinned", "pinned", nil, "atlasenhanced", 0, 5, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "", "Suit", "Deck of the Stars", "Diamonds", "window", nil, "atlasenhanced", 2, 1, "" },
 | 
					 | 
				
			||||||
	{ "", "Suit", "Deck of the Sun", "Hearts", "head", nil, "atlasenhanced", 3, 1, "" },
 | 
					 | 
				
			||||||
	{ "", "Suit", "Deck of the World", "Spades", "goad", nil, "atlasenhanced", 4, 1, "" },
 | 
					 | 
				
			||||||
	{ "", "Suit", "Deck of the Moon", "Clubs", "club", nil, "atlasenhanced", 5, 1, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	-- Cryptid
 | 
					 | 
				
			||||||
	-- todo: work with mod config better here
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "cry", "Enhancement", "The Eclipse's Deck", "Echo", "echo", nil, "atlasenhanced", 1, 5, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Enhancement", "The Seraph's Deck", "Light", "light", nil, "cry_misc", 0, 3, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Fragile", "glass", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Golden", "gold", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Noisy", "noisy", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Astral", "astral", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Blurred", "blur", nil, nil, 0, 0, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Mosaic", "mosaic", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{ "cry", "Edition", nil, "Oversaturated", "oversat", nil, nil, 5, 2, "" },
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		"cry",
 | 
					 | 
				
			||||||
		"Edition",
 | 
					 | 
				
			||||||
		nil,
 | 
					 | 
				
			||||||
		"Glitched",
 | 
					 | 
				
			||||||
		"glitched",
 | 
					 | 
				
			||||||
		nil,
 | 
					 | 
				
			||||||
		nil,
 | 
					 | 
				
			||||||
		5,
 | 
					 | 
				
			||||||
		2,
 | 
					 | 
				
			||||||
		"Wait, isn't this just Misprint Deck?",
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "cry", "Seal", "Typhoon Deck", "Azure", "azure", nil, nil, 0, 2, "" },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	{ "cry", "Sticker", nil, "Banana", "banana", nil, "atlasenhanced", 5, 4, "" },
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if Cryptid.enabled["M Jokers"] then -- Crashes the game if M jokers are disabled if we don't add this separately
 | 
					 | 
				
			||||||
	table.insert(typed_decks, 31, { "cry", "Edition", "Meck", "Jolly", "m", nil, nil, 5, 2, "" })
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
for i = 1, #typed_decks do
 | 
					 | 
				
			||||||
	local deck = typed_decks[i]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local shader = nil
 | 
					 | 
				
			||||||
	if deck[6] then
 | 
					 | 
				
			||||||
		shader = deck[1] .. "_" .. deck[6]
 | 
					 | 
				
			||||||
		if deck.no_prefix then
 | 
					 | 
				
			||||||
			shader = deck[6]
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local deck_name = deck[3]
 | 
					 | 
				
			||||||
	if not deck_name then
 | 
					 | 
				
			||||||
		deck_name = deck[4] .. " Deck"
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local deck_internal_name = ""
 | 
					 | 
				
			||||||
	if deck[1] == "cry" then -- don't register eg. 'cry-cry-Typhoon Deck'
 | 
					 | 
				
			||||||
		deck_internal_name = "cry-" .. deck_name
 | 
					 | 
				
			||||||
	else -- eg. 'cry-jen-Blood Deck'
 | 
					 | 
				
			||||||
		deck_internal_name = "cry-" .. deck[1] .. "-" .. deck_name
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local deck_key = ""
 | 
					 | 
				
			||||||
	if deck[1] == "cry" then
 | 
					 | 
				
			||||||
		deck_key = "cry" .. (deck[5] or deck[4]) .. "_deck"
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		deck_key = "cry" .. deck[1] .. "-" .. (deck[5] or deck[4]) .. "_deck"
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local object_key = ""
 | 
					 | 
				
			||||||
	if deck[1] == "" or deck.no_prefix then -- vanilla doesn't have a prefix, don't add the _
 | 
					 | 
				
			||||||
		object_key = deck[5] or deck[4]
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		object_key = deck[1] .. "_" .. (deck[5] or deck[4])
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local suit_key = ""
 | 
					 | 
				
			||||||
	if deck[1] == "" or deck.no_prefix then
 | 
					 | 
				
			||||||
		suit_key = deck[4]
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		suit_key = deck[1] .. "_" .. deck[4]
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if deck[2] == "Edition" then
 | 
					 | 
				
			||||||
		local obj = {
 | 
					 | 
				
			||||||
			object_type = "Back",
 | 
					 | 
				
			||||||
			name = deck_internal_name,
 | 
					 | 
				
			||||||
			key = deck_key,
 | 
					 | 
				
			||||||
			config = { cry_force_edition = object_key, cry_force_edition_shader = shader },
 | 
					 | 
				
			||||||
			pos = { x = deck[8], y = deck[9] },
 | 
					 | 
				
			||||||
			loc_txt = {
 | 
					 | 
				
			||||||
				name = deck_name,
 | 
					 | 
				
			||||||
				text = {
 | 
					 | 
				
			||||||
					"All cards are {C:dark_edition,T:" .. object_key .. "}" .. deck[4] .. " Cards{}",
 | 
					 | 
				
			||||||
					"Cards cannot change editions",
 | 
					 | 
				
			||||||
					"{s:0.8,C:inactive}" .. deck[10],
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if deck[7] then
 | 
					 | 
				
			||||||
			obj.atlas = deck[7]
 | 
					 | 
				
			||||||
			if string.find(deck[7], "_") then
 | 
					 | 
				
			||||||
				obj.prefix_config = { atlas = false }
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if not deck[11] then
 | 
					 | 
				
			||||||
			obj.config.cry_no_edition_price = true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		packs_to_add[#packs_to_add + 1] = obj
 | 
					 | 
				
			||||||
	elseif deck[2] == "Enhancement" then
 | 
					 | 
				
			||||||
		local obj = {
 | 
					 | 
				
			||||||
			object_type = "Back",
 | 
					 | 
				
			||||||
			name = deck_internal_name,
 | 
					 | 
				
			||||||
			key = deck_key,
 | 
					 | 
				
			||||||
			config = { cry_force_enhancement = "m_" .. object_key },
 | 
					 | 
				
			||||||
			pos = { x = deck[8], y = deck[9] },
 | 
					 | 
				
			||||||
			loc_txt = {
 | 
					 | 
				
			||||||
				name = deck_name,
 | 
					 | 
				
			||||||
				text = {
 | 
					 | 
				
			||||||
					"All {C:attention}playing cards{}",
 | 
					 | 
				
			||||||
					"are {C:attention,T:m_" .. object_key .. "}" .. deck[4] .. " Cards{}",
 | 
					 | 
				
			||||||
					"Cards cannot change enhancements",
 | 
					 | 
				
			||||||
					"{s:0.8,C:inactive}" .. deck[10],
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if deck[7] then
 | 
					 | 
				
			||||||
			obj.atlas = deck[7]
 | 
					 | 
				
			||||||
			if string.find(deck[7], "_") then
 | 
					 | 
				
			||||||
				obj.prefix_config = { atlas = false }
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		packs_to_add[#packs_to_add + 1] = obj
 | 
					 | 
				
			||||||
	elseif deck[2] == "Seal" then
 | 
					 | 
				
			||||||
		local obj = {
 | 
					 | 
				
			||||||
			object_type = "Back",
 | 
					 | 
				
			||||||
			name = deck_internal_name,
 | 
					 | 
				
			||||||
			key = deck_key,
 | 
					 | 
				
			||||||
			config = { cry_force_seal = object_key },
 | 
					 | 
				
			||||||
			pos = { x = deck[8], y = deck[9] },
 | 
					 | 
				
			||||||
			loc_txt = {
 | 
					 | 
				
			||||||
				name = deck_name,
 | 
					 | 
				
			||||||
				text = {
 | 
					 | 
				
			||||||
					"All cards have a {C:dark_edition}" .. deck[4] .. " Seal{}",
 | 
					 | 
				
			||||||
					"Cards cannot change seals",
 | 
					 | 
				
			||||||
					"{s:0.8,C:inactive}" .. deck[10],
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if deck[7] then
 | 
					 | 
				
			||||||
			obj.atlas = deck[7]
 | 
					 | 
				
			||||||
			if string.find(deck[7], "_") then
 | 
					 | 
				
			||||||
				obj.prefix_config = { atlas = false }
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		packs_to_add[#packs_to_add + 1] = obj
 | 
					 | 
				
			||||||
	elseif deck[2] == "Sticker" then
 | 
					 | 
				
			||||||
		local obj = {
 | 
					 | 
				
			||||||
			object_type = "Back",
 | 
					 | 
				
			||||||
			name = deck_internal_name,
 | 
					 | 
				
			||||||
			key = deck_key,
 | 
					 | 
				
			||||||
			config = { cry_force_sticker = deck[5] }, -- stickers DON'T use object_key for SOME reason
 | 
					 | 
				
			||||||
			pos = { x = deck[8], y = deck[9] },
 | 
					 | 
				
			||||||
			loc_txt = {
 | 
					 | 
				
			||||||
				name = deck_name,
 | 
					 | 
				
			||||||
				text = {
 | 
					 | 
				
			||||||
					"All cards are {C:attention}" .. deck[4] .. "{}",
 | 
					 | 
				
			||||||
					"{s:0.8,C:inactive}" .. deck[10],
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if deck[7] then
 | 
					 | 
				
			||||||
			obj.atlas = deck[7]
 | 
					 | 
				
			||||||
			if string.find(deck[7], "_") then
 | 
					 | 
				
			||||||
				obj.prefix_config = { atlas = false }
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		packs_to_add[#packs_to_add + 1] = obj
 | 
					 | 
				
			||||||
	elseif deck[2] == "Suit" then
 | 
					 | 
				
			||||||
		local obj = {
 | 
					 | 
				
			||||||
			object_type = "Back",
 | 
					 | 
				
			||||||
			name = deck_internal_name,
 | 
					 | 
				
			||||||
			key = deck_key,
 | 
					 | 
				
			||||||
			config = { cry_force_suit = suit_key, cry_boss_blocked = deck[5] and { "bl_" .. object_key } },
 | 
					 | 
				
			||||||
			pos = { x = deck[8], y = deck[9] },
 | 
					 | 
				
			||||||
			loc_txt = {
 | 
					 | 
				
			||||||
				name = deck_name,
 | 
					 | 
				
			||||||
				text = {
 | 
					 | 
				
			||||||
					"All playing cards are {C:dark_edition}" .. deck[4] .. "{}",
 | 
					 | 
				
			||||||
					"and cannot change suits",
 | 
					 | 
				
			||||||
					deck[10] or "{s:0}",
 | 
					 | 
				
			||||||
					deck[5] and "{C:attention}The " .. string.upper(string.sub(deck[5], 1, 1)) .. string.sub(
 | 
					 | 
				
			||||||
						deck[5],
 | 
					 | 
				
			||||||
						2
 | 
					 | 
				
			||||||
					) .. "{} cannot appear", -- UGLY hack
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if deck[7] then
 | 
					 | 
				
			||||||
			obj.atlas = deck[7]
 | 
					 | 
				
			||||||
			if string.find(deck[7], "_") then
 | 
					 | 
				
			||||||
				obj.prefix_config = { atlas = false }
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		packs_to_add[#packs_to_add + 1] = obj
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
return {
 | 
					 | 
				
			||||||
	name = "Enhanced Decks",
 | 
					 | 
				
			||||||
	init = function()
 | 
					 | 
				
			||||||
		local Backapply_to_runRef = Back.apply_to_run
 | 
					 | 
				
			||||||
		function Back.apply_to_run(self)
 | 
					 | 
				
			||||||
			Backapply_to_runRef(self)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			if self.effect.config.cry_force_enhancement then
 | 
					 | 
				
			||||||
				if self.effect.config.cry_force_enhancement ~= "random" then
 | 
					 | 
				
			||||||
					G.GAME.modifiers.cry_force_enhancement = self.effect.config.cry_force_enhancement
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						for c = #G.playing_cards, 1, -1 do
 | 
					 | 
				
			||||||
							if self.effect.config.cry_force_enhancement == "random" then
 | 
					 | 
				
			||||||
								local enh = {}
 | 
					 | 
				
			||||||
								for i = 1, #G.P_CENTER_POOLS.Enhanced do
 | 
					 | 
				
			||||||
									enh[#enh + 1] = G.P_CENTER_POOLS.Enhanced[i]
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
								enh[#enh + 1] = "CCD"
 | 
					 | 
				
			||||||
								local random_enhancement = pseudorandom_element(enh, pseudoseed("cry_ant_enhancement"))
 | 
					 | 
				
			||||||
								if random_enhancement.key and G.P_CENTERS[random_enhancement.key] then
 | 
					 | 
				
			||||||
									G.playing_cards[c]:set_ability(G.P_CENTERS[random_enhancement.key])
 | 
					 | 
				
			||||||
								else
 | 
					 | 
				
			||||||
									G.playing_cards[c]:set_ability(get_random_consumable("cry_ant_ccd", nil, true))
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
							else
 | 
					 | 
				
			||||||
								G.playing_cards[c]:set_ability(G.P_CENTERS[self.effect.config.cry_force_enhancement])
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_force_edition then
 | 
					 | 
				
			||||||
				if self.effect.config.cry_force_edition ~= "random" then
 | 
					 | 
				
			||||||
					G.GAME.modifiers.cry_force_edition = self.effect.config.cry_force_edition
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
					G.GAME.modifiers.cry_force_random_edition = true
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				for k, v in pairs(G.P_TAGS) do
 | 
					 | 
				
			||||||
					if v.config and v.config.edition then
 | 
					 | 
				
			||||||
						G.GAME.banned_keys[k] = true
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						for c = #G.playing_cards, 1, -1 do
 | 
					 | 
				
			||||||
							local ed_table = {}
 | 
					 | 
				
			||||||
							if self.effect.config.cry_force_edition == "random" then
 | 
					 | 
				
			||||||
								local random_edition =
 | 
					 | 
				
			||||||
									pseudorandom_element(G.P_CENTER_POOLS.Edition, pseudoseed("cry_ant_edition"))
 | 
					 | 
				
			||||||
								while random_edition.key == "e_base" do
 | 
					 | 
				
			||||||
									random_edition =
 | 
					 | 
				
			||||||
										pseudorandom_element(G.P_CENTER_POOLS.Edition, pseudoseed("cry_ant_edition"))
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
								ed_table[random_edition.key:sub(3)] = true
 | 
					 | 
				
			||||||
								G.playing_cards[c]:set_edition(ed_table, true, true)
 | 
					 | 
				
			||||||
							else
 | 
					 | 
				
			||||||
								ed_table[self.effect.config.cry_force_edition] = true
 | 
					 | 
				
			||||||
								G.playing_cards[c]:set_edition(ed_table, true, true)
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_force_seal then
 | 
					 | 
				
			||||||
				if self.effect.config.cry_force_seal ~= "random" then
 | 
					 | 
				
			||||||
					G.GAME.modifiers.cry_force_seal = self.effect.config.cry_force_seal
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						for c = #G.playing_cards, 1, -1 do
 | 
					 | 
				
			||||||
							if self.effect.config.cry_force_seal == "random" then
 | 
					 | 
				
			||||||
								local random_seal =
 | 
					 | 
				
			||||||
									pseudorandom_element(G.P_CENTER_POOLS.Seal, pseudoseed("cry_ant_seal"))
 | 
					 | 
				
			||||||
								G.playing_cards[c]:set_seal(random_seal.key, true)
 | 
					 | 
				
			||||||
							else
 | 
					 | 
				
			||||||
								G.playing_cards[c]:set_seal(self.effect.config.cry_force_seal, true)
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_force_sticker then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_force_sticker = self.effect.config.cry_force_sticker
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						for c = #G.playing_cards, 1, -1 do
 | 
					 | 
				
			||||||
							G.playing_cards[c].config.center.eternal_compat = true
 | 
					 | 
				
			||||||
							G.playing_cards[c].config.center.perishable_compat = true
 | 
					 | 
				
			||||||
							if
 | 
					 | 
				
			||||||
								SMODS.Stickers[self.effect.config.cry_force_sticker]
 | 
					 | 
				
			||||||
								and SMODS.Stickers[self.effect.config.cry_force_sticker].apply
 | 
					 | 
				
			||||||
							then
 | 
					 | 
				
			||||||
								SMODS.Stickers[self.effect.config.cry_force_sticker]:apply(G.playing_cards[c], true)
 | 
					 | 
				
			||||||
							else
 | 
					 | 
				
			||||||
								G.playing_cards[c]["set_" .. self.effect.config.cry_force_sticker](
 | 
					 | 
				
			||||||
									G.playing_cards[c],
 | 
					 | 
				
			||||||
									true
 | 
					 | 
				
			||||||
								)
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_force_suit then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_force_suit = self.effect.config.cry_force_suit
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						for c = #G.playing_cards, 1, -1 do
 | 
					 | 
				
			||||||
							G.playing_cards[c]:change_suit(self.effect.config.cry_force_suit)
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_boss_blocked then
 | 
					 | 
				
			||||||
				for _, v in pairs(self.effect.config.cry_boss_blocked) do
 | 
					 | 
				
			||||||
					G.GAME.bosses_used[v] = 1e308
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if self.effect.config.cry_no_edition_price then
 | 
					 | 
				
			||||||
				G.GAME.modifiers.cry_no_edition_price = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local sa = Card.set_ability
 | 
					 | 
				
			||||||
		function Card:set_ability(center, y, z)
 | 
					 | 
				
			||||||
			--adding immutable to cards because
 | 
					 | 
				
			||||||
			-- A they are hardcoded and unaffected by misprintize but still have a description that changes because of it
 | 
					 | 
				
			||||||
			-- B so they ignore misprintize in order to keep vanilla descripton accurate (ex hack shouldn't be able to trigger more than once)
 | 
					 | 
				
			||||||
			-- C so Gemini doesn't say they are compatible when they are not
 | 
					 | 
				
			||||||
			-- D Invisible Joker
 | 
					 | 
				
			||||||
			
 | 
					 | 
				
			||||||
			if center.name == "Fortune Teller" 
 | 
					 | 
				
			||||||
			or center.name == "Shoot the Moon" 
 | 
					 | 
				
			||||||
			or center.name == "Riff-raff"
 | 
					 | 
				
			||||||
			or center.name == "Chaos the Clown"
 | 
					 | 
				
			||||||
			or center.name == "Dusk"
 | 
					 | 
				
			||||||
			or center.name == "Mime"
 | 
					 | 
				
			||||||
			or center.name == "Hack"
 | 
					 | 
				
			||||||
			or center.name == "Sock and Buskin"
 | 
					 | 
				
			||||||
			or center.name == "Invisible Joker"
 | 
					 | 
				
			||||||
			or center.name == "Swashbuckler"
 | 
					 | 
				
			||||||
			or center.name == "Smeared Joker"
 | 
					 | 
				
			||||||
			or center.name == "Certificate"
 | 
					 | 
				
			||||||
			or center.name == "Mr. Bones"
 | 
					 | 
				
			||||||
			or center.name == "Diet Cola"
 | 
					 | 
				
			||||||
			or center.name == "Luchador"
 | 
					 | 
				
			||||||
			or center.name == "Midas Mask"
 | 
					 | 
				
			||||||
			or center.name == "Shortcut"
 | 
					 | 
				
			||||||
			or center.name == "Seance"
 | 
					 | 
				
			||||||
			or center.name == "Superposition"
 | 
					 | 
				
			||||||
			or center.name == "Sixth Sense"
 | 
					 | 
				
			||||||
			or center.name == "DNA"
 | 
					 | 
				
			||||||
			or center.name == "Splash"
 | 
					 | 
				
			||||||
			or center.name == "Supernova"
 | 
					 | 
				
			||||||
			or center.name == "Pareidolia"
 | 
					 | 
				
			||||||
			or center.name == "Raised Fist"
 | 
					 | 
				
			||||||
			or center.name == "Marble Joker"
 | 
					 | 
				
			||||||
			or center.name == "Four Fingers"
 | 
					 | 
				
			||||||
			or center.name == "Joker Stencil"
 | 
					 | 
				
			||||||
			or center.name == "Showman"
 | 
					 | 
				
			||||||
			or center.name == "Blueprint"
 | 
					 | 
				
			||||||
			or center.name == "Oops! All 6s"
 | 
					 | 
				
			||||||
			or center.name == "Brainstorm"
 | 
					 | 
				
			||||||
			or center.name == "Cartomancer"
 | 
					 | 
				
			||||||
			or center.name == "Astronomer"
 | 
					 | 
				
			||||||
			or center.name == "Burnt Joker"
 | 
					 | 
				
			||||||
			or center.name == "Chicot"
 | 
					 | 
				
			||||||
			or center.name == "Perkeo"
 | 
					 | 
				
			||||||
			then 
 | 
					 | 
				
			||||||
				self.config.center.immutable = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			
 | 
					 | 
				
			||||||
			if center and center.set == "Enhanced" then
 | 
					 | 
				
			||||||
				return sa(
 | 
					 | 
				
			||||||
					self,
 | 
					 | 
				
			||||||
					(not self.no_forced_enhancement and G.GAME.modifiers.cry_force_enhancement) and G.P_CENTERS[G.GAME.modifiers.cry_force_enhancement]
 | 
					 | 
				
			||||||
						or center,
 | 
					 | 
				
			||||||
					y,
 | 
					 | 
				
			||||||
					z
 | 
					 | 
				
			||||||
				)
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				return sa(self, center, y, z)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local se = Card.set_edition
 | 
					 | 
				
			||||||
		function Card:set_edition(edition, y, z, force)
 | 
					 | 
				
			||||||
			if not force then
 | 
					 | 
				
			||||||
				return se(self, (not self.no_forced_edition and G.GAME.modifiers.cry_force_edition) and { [G.GAME.modifiers.cry_force_edition] = true } or edition, y, z)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			return se(self, edition, y, z)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local ss = Card.set_seal
 | 
					 | 
				
			||||||
		function Card:set_seal(seal, y, z)
 | 
					 | 
				
			||||||
			return ss(self, not self.no_forced_seal and G.GAME.modifiers.cry_force_seal or seal, y, z)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local cs = Card.change_suit
 | 
					 | 
				
			||||||
		function Card:change_suit(new_suit)
 | 
					 | 
				
			||||||
			return cs(self, not self.no_forced_suit and G.GAME.modifiers.cry_force_suit or new_suit)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local sc = Card.set_cost
 | 
					 | 
				
			||||||
		function Card:set_cost()
 | 
					 | 
				
			||||||
			if self.edition and G.GAME.modifiers.cry_no_edition_price then
 | 
					 | 
				
			||||||
				local m = cry_deep_copy(self.edition)
 | 
					 | 
				
			||||||
				self.edition = nil
 | 
					 | 
				
			||||||
				sc(self)
 | 
					 | 
				
			||||||
				self.edition = m
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				sc(self)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	order = 1000000,
 | 
					 | 
				
			||||||
	items = packs_to_add,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,3 +0,0 @@
 | 
				
			||||||
-- dummy file to add https option to mod menu
 | 
					 | 
				
			||||||
return { name = "HTTPS Module" }
 | 
					 | 
				
			||||||
-- someone should make a system for this, engineers are crying
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
-- Dummy file, only here to add the timer blinds toggle to the menu
 | 
					 | 
				
			||||||
--Jevonn was here [MMMMMMM]
 | 
					 | 
				
			||||||
return { name = "Timer Mechanics" }
 | 
					 | 
				
			||||||
--                   ^^^ M spotted
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
# Cryptid
 | 
					# Cryptid
 | 
				
			||||||
An unbalanced Balatro mod.
 | 
					An unbalanced Balatro mod.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Note: Cryptid requires [Steamodded **1.0.0-Alpha** (old calc)](https://github.com/Steamodded/smods/archive/refs/tags/old-calc.zip) and [Talisman](https://github.com/MathIsFun0/Talisman/releases/latest).
 | 
					Note: Cryptid requires [Steamodded **1.0.0-Alpha**](https://github.com/Steamopollys/Steamodded/archive/refs/heads/main.zip) and [Talisman](https://github.com/MathIsFun0/Talisman/releases/latest).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Cryptid currently adds:
 | 
					Cryptid currently adds:
 | 
				
			||||||

 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/1x/atlaseditiondeck.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 38 KiB  | 
| 
		 Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 71 KiB  | 
| 
		 Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 130 KiB  | 
| 
		 Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 105 KiB  | 
| 
		 Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 119 KiB  | 
| 
		 Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 126 KiB  | 
| 
		 Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 62 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/1x/cry_gameset.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/1x/old.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 64 KiB  | 
| 
		 Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/2x/atlaseditiondeck.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 46 KiB  | 
| 
		 Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 130 KiB  | 
| 
		 Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 226 KiB  | 
| 
		 Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 178 KiB  | 
| 
		 Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 208 KiB  | 
| 
		 Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 212 KiB  | 
| 
		 Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 141 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/2x/cry_gameset.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/2x/old.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 123 KiB  | 
| 
		 Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/sounds/music_madness.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/sounds/music_mainline.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										
											BIN
										
									
								
								Cryptid/assets/sounds/music_modest.ogg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -1,26 +1,11 @@
 | 
				
			||||||
return {
 | 
					return {
 | 
				
			||||||
	["More Stakes"] = true,
 | 
						["Cryptid"] = {
 | 
				
			||||||
	["M Jokers"] = true,
 | 
							["jimball_music"] = true,
 | 
				
			||||||
	["Misc."] = true,
 | 
							["code_music"] = true,
 | 
				
			||||||
	["Tags"] = true,
 | 
							["exotic_music"] = true,
 | 
				
			||||||
	["Challenges"] = true,
 | 
							["big_music"] = true,
 | 
				
			||||||
	["Spectrals"] = true,
 | 
							["alt_bg_music"] = true,
 | 
				
			||||||
	["Vouchers"] = true,
 | 
						},
 | 
				
			||||||
	["Timer Mechanics"] = true,
 | 
						["family_mode"] = false,
 | 
				
			||||||
	["Achievements"] = true,
 | 
						["experimental"] = false,
 | 
				
			||||||
	["Planets"] = true,
 | 
					 | 
				
			||||||
	["Cryptid"] = { ["jimball_music"] = true, ["code_music"] = true, ["exotic_music"] = true, ["big_music"] = true },
 | 
					 | 
				
			||||||
	["Epic Jokers"] = true,
 | 
					 | 
				
			||||||
	["Antimatter Deck"] = true,
 | 
					 | 
				
			||||||
	["Misc. Jokers"] = true,
 | 
					 | 
				
			||||||
	["Code Cards"] = true,
 | 
					 | 
				
			||||||
	["Misc. Decks"] = true,
 | 
					 | 
				
			||||||
	["Exotic Jokers"] = true,
 | 
					 | 
				
			||||||
	["Enhanced Decks"] = true,
 | 
					 | 
				
			||||||
	["Blinds"] = true,
 | 
					 | 
				
			||||||
	["HTTPS Module"] = false,
 | 
					 | 
				
			||||||
	["JokerDisplay"] = true,
 | 
					 | 
				
			||||||
	["PokerHands"] = true,
 | 
					 | 
				
			||||||
	["Spooky"] = true,
 | 
					 | 
				
			||||||
	["Menu"] = true,
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
require "love.system"
 | 
					require("love.system")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- mac/linux support?
 | 
					-- mac/linux support?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,9 +10,9 @@ package.cpath = script_dir .. "?.so;" .. package.cpath
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local index_os = love.system.getOS()
 | 
					local index_os = love.system.getOS()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if index_os == 'OS X' then
 | 
					if index_os == "OS X" then
 | 
				
			||||||
	loc_https = require("macos-https")
 | 
						loc_https = require("macos-https")
 | 
				
			||||||
elseif index_os == 'Linux' then
 | 
					elseif index_os == "Linux" then
 | 
				
			||||||
	loc_https = require("linux-https")
 | 
						loc_https = require("linux-https")
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	loc_https = require("https")
 | 
						loc_https = require("https")
 | 
				
			||||||
| 
						 | 
					@ -24,11 +24,13 @@ while true do
 | 
				
			||||||
	if (os.time() - last_update_time >= 60) or initial then
 | 
						if (os.time() - last_update_time >= 60) or initial then
 | 
				
			||||||
		initial = nil
 | 
							initial = nil
 | 
				
			||||||
		last_update_time = os.time()
 | 
							last_update_time = os.time()
 | 
				
			||||||
		local resp, txt = loc_https.request("https://discord.com/api/v10/invites/eUf9Ur6RyB?with_counts=true".."&v=" .. tostring(os.time()))
 | 
							local resp, txt = loc_https.request(
 | 
				
			||||||
 | 
								"https://discord.com/api/v10/invites/eUf9Ur6RyB?with_counts=true" .. "&v=" .. tostring(os.time())
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
		if resp == 200 then
 | 
							if resp == 200 then
 | 
				
			||||||
			love.thread.getChannel('member_count'):push(txt)
 | 
								love.thread.getChannel("member_count"):push(txt)
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			love.thread.getChannel('member_error'):push("Failed to get count: "..resp)
 | 
								love.thread.getChannel("member_error"):push("Failed to get count: " .. resp)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					@ -447,4 +447,4 @@ local achievement_objects = {
 | 
				
			||||||
	traffic_jam,
 | 
						traffic_jam,
 | 
				
			||||||
	perfectly_balanced,
 | 
						perfectly_balanced,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
return { name = "Achievements", init = function() end, items = achievement_objects }
 | 
					return { name = "Achievements", items = achievement_objects }
 | 
				
			||||||
| 
						 | 
					@ -1,70 +1,10 @@
 | 
				
			||||||
--extra blind functions for use by bosses
 | 
					 | 
				
			||||||
function Blind:cry_ante_base_mod(dt)
 | 
					 | 
				
			||||||
	if not self.disabled then
 | 
					 | 
				
			||||||
		local obj = self.config.blind
 | 
					 | 
				
			||||||
		if obj.cry_ante_base_mod and type(obj.cry_ante_base_mod) == "function" then
 | 
					 | 
				
			||||||
			return obj:cry_ante_base_mod(dt)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return 0
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
function Blind:cry_round_base_mod(dt)
 | 
					 | 
				
			||||||
	if not self.disabled then
 | 
					 | 
				
			||||||
		local obj = self.config.blind
 | 
					 | 
				
			||||||
		if obj.cry_round_base_mod and type(obj.cry_round_base_mod) == "function" then
 | 
					 | 
				
			||||||
			return obj:cry_round_base_mod(dt)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return 1
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
function Blind:cry_cap_score(score)
 | 
					 | 
				
			||||||
	if not self.disabled then
 | 
					 | 
				
			||||||
		local obj = self.config.blind
 | 
					 | 
				
			||||||
		if obj.cry_cap_score and type(obj.cry_cap_score) == "function" then
 | 
					 | 
				
			||||||
			return obj:cry_cap_score(score)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return score
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
function Blind:cry_after_play()
 | 
					 | 
				
			||||||
	if not self.disabled then
 | 
					 | 
				
			||||||
		local obj = self.config.blind
 | 
					 | 
				
			||||||
		if obj.cry_after_play and type(obj.cry_after_play) == "function" then
 | 
					 | 
				
			||||||
			return obj:cry_after_play()
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
function Blind:cry_before_play()
 | 
					 | 
				
			||||||
	if not self.disabled then
 | 
					 | 
				
			||||||
		local obj = self.config.blind
 | 
					 | 
				
			||||||
		if obj.cry_before_play and type(obj.cry_before_play) == "function" then
 | 
					 | 
				
			||||||
			return obj:cry_before_play()
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
function Blind:cry_calc_ante_gain()
 | 
					 | 
				
			||||||
	if G.GAME.modifiers.cry_spooky then --here is the best place to check when spooky should apply
 | 
					 | 
				
			||||||
		local card
 | 
					 | 
				
			||||||
		if pseudorandom(pseudoseed("cry_spooky_curse")) < G.GAME.modifiers.cry_curse_rate then
 | 
					 | 
				
			||||||
			card = create_card("Joker", G.jokers, nil, "cry_cursed", nil, nil, nil, "cry_spooky")
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			card = create_card("Joker", G.jokers, nil, "cry_candy", nil, nil, nil, "cry_spooky")
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		card:add_to_deck()
 | 
					 | 
				
			||||||
		card:start_materialize()
 | 
					 | 
				
			||||||
		G.jokers:emplace(card)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if not self.disabled then
 | 
					 | 
				
			||||||
		local obj = self.config.blind
 | 
					 | 
				
			||||||
		if obj.cry_calc_ante_gain and type(obj.cry_calc_ante_gain) == "function" then
 | 
					 | 
				
			||||||
			return obj:cry_calc_ante_gain()
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return 1
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local oldox = {
 | 
					local oldox = {
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	name = "cry-oldox",
 | 
						name = "cry-oldox",
 | 
				
			||||||
	key = "oldox",
 | 
						key = "oldox",
 | 
				
			||||||
	pos = { x = 0, y = 0 },
 | 
						pos = { x = 0, y = 0 },
 | 
				
			||||||
| 
						 | 
					@ -85,6 +25,11 @@ local oldox = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldhouse = {
 | 
					local oldhouse = {
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	name = "cry-oldhouse",
 | 
						name = "cry-oldhouse",
 | 
				
			||||||
	key = "oldhouse",
 | 
						key = "oldhouse",
 | 
				
			||||||
	pos = { x = 0, y = 2 },
 | 
						pos = { x = 0, y = 2 },
 | 
				
			||||||
| 
						 | 
					@ -107,6 +52,11 @@ local oldhouse = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldarm = {
 | 
					local oldarm = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldarm",
 | 
						name = "cry-oldarm",
 | 
				
			||||||
	key = "oldarm",
 | 
						key = "oldarm",
 | 
				
			||||||
| 
						 | 
					@ -130,6 +80,11 @@ local oldarm = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldfish = {
 | 
					local oldfish = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldfish",
 | 
						name = "cry-oldfish",
 | 
				
			||||||
	key = "oldfish",
 | 
						key = "oldfish",
 | 
				
			||||||
| 
						 | 
					@ -150,6 +105,11 @@ local oldfish = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldmanacle = {
 | 
					local oldmanacle = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldmanacle",
 | 
						name = "cry-oldmanacle",
 | 
				
			||||||
	key = "oldmanacle",
 | 
						key = "oldmanacle",
 | 
				
			||||||
| 
						 | 
					@ -170,6 +130,11 @@ local oldmanacle = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldserpent = {
 | 
					local oldserpent = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldserpent",
 | 
						name = "cry-oldserpent",
 | 
				
			||||||
	key = "oldserpent",
 | 
						key = "oldserpent",
 | 
				
			||||||
| 
						 | 
					@ -182,14 +147,19 @@ local oldserpent = {
 | 
				
			||||||
	order = 9,
 | 
						order = 9,
 | 
				
			||||||
	boss_colour = HEX("4f6367"),
 | 
						boss_colour = HEX("4f6367"),
 | 
				
			||||||
	modify_hand = function(self, cards, poker_hands, text, mult, hand_chips)
 | 
						modify_hand = function(self, cards, poker_hands, text, mult, hand_chips)
 | 
				
			||||||
		if to_big(G.GAME.hands[text].level) > to_big(1) then
 | 
							if G.GAME.hands[text].level > to_big(1) then
 | 
				
			||||||
			G.GAME.blind.triggered = true
 | 
								G.GAME.blind.triggered = true
 | 
				
			||||||
			return math.floor( mult / to_big(G.GAME.hands[text].level) ), hand_chips, true
 | 
								return math.floor(mult / G.GAME.hands[text].level), hand_chips, true
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		return mult, hand_chips, false
 | 
							return mult, hand_chips, false
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldpillar = {
 | 
					local oldpillar = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldpillar",
 | 
						name = "cry-oldpillar",
 | 
				
			||||||
	key = "oldpillar",
 | 
						key = "oldpillar",
 | 
				
			||||||
| 
						 | 
					@ -213,6 +183,11 @@ local oldpillar = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldflint = {
 | 
					local oldflint = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldflint",
 | 
						name = "cry-oldflint",
 | 
				
			||||||
	key = "oldflint",
 | 
						key = "oldflint",
 | 
				
			||||||
| 
						 | 
					@ -236,6 +211,11 @@ local oldflint = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local oldmark = {
 | 
					local oldmark = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-oldmark",
 | 
						name = "cry-oldmark",
 | 
				
			||||||
	key = "oldmark",
 | 
						key = "oldmark",
 | 
				
			||||||
| 
						 | 
					@ -259,6 +239,11 @@ local oldmark = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local tax = {
 | 
					local tax = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Tax",
 | 
						name = "cry-Tax",
 | 
				
			||||||
	key = "tax",
 | 
						key = "tax",
 | 
				
			||||||
| 
						 | 
					@ -271,11 +256,11 @@ local tax = {
 | 
				
			||||||
	order = 2,
 | 
						order = 2,
 | 
				
			||||||
	boss_colour = HEX("40ff40"),
 | 
						boss_colour = HEX("40ff40"),
 | 
				
			||||||
	loc_vars = function(self, info_queue, card)
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
		return { vars = { 0.4 * get_blind_amount(G.GAME.round_resets.ante)*2*G.GAME.starting_params.ante_scaling } }	-- no bignum?
 | 
							return { vars = { 0.4 * get_blind_amount(G.GAME.round_resets.ante) * 2 * G.GAME.starting_params.ante_scaling } } -- no bignum?
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						collection_loc_vars = function(self)
 | 
				
			||||||
 | 
							return { vars = { localize("cry_tax_placeholder") } }
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
        collection_loc_vars = function(self)
 | 
					 | 
				
			||||||
            return { vars = { localize("cry_tax_placeholder") }}
 | 
					 | 
				
			||||||
        end,
 | 
					 | 
				
			||||||
	cry_cap_score = function(self, score)
 | 
						cry_cap_score = function(self, score)
 | 
				
			||||||
		return math.floor(math.min(0.4 * G.GAME.blind.chips, score) + 0.5)
 | 
							return math.floor(math.min(0.4 * G.GAME.blind.chips, score) + 0.5)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
| 
						 | 
					@ -284,6 +269,11 @@ local tax = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local box = {
 | 
					local box = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-box",
 | 
						name = "cry-box",
 | 
				
			||||||
	key = "box",
 | 
						key = "box",
 | 
				
			||||||
| 
						 | 
					@ -303,6 +293,12 @@ local box = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local clock = {
 | 
					local clock = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
								"set_cry_timer",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Clock",
 | 
						name = "cry-Clock",
 | 
				
			||||||
	key = "clock",
 | 
						key = "clock",
 | 
				
			||||||
| 
						 | 
					@ -328,10 +324,19 @@ local clock = {
 | 
				
			||||||
		G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
 | 
							G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	cry_ante_base_mod = function(self, dt)
 | 
						cry_ante_base_mod = function(self, dt)
 | 
				
			||||||
		return 0.1 * dt / 3
 | 
							if G.SETTINGS.paused then
 | 
				
			||||||
 | 
								return 0
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return 0.1 * dt / 3
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local trick = {
 | 
					local trick = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Trick",
 | 
						name = "cry-Trick",
 | 
				
			||||||
	key = "trick",
 | 
						key = "trick",
 | 
				
			||||||
| 
						 | 
					@ -362,8 +367,12 @@ local trick = {
 | 
				
			||||||
        end--]]
 | 
					        end--]]
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
local joke = {
 | 
					local joke = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Joke",
 | 
						name = "cry-Joke",
 | 
				
			||||||
	key = "joke",
 | 
						key = "joke",
 | 
				
			||||||
| 
						 | 
					@ -376,11 +385,18 @@ local joke = {
 | 
				
			||||||
	order = 15,
 | 
						order = 15,
 | 
				
			||||||
	boss_colour = HEX("00ffaa"),
 | 
						boss_colour = HEX("00ffaa"),
 | 
				
			||||||
	loc_vars = function(self)
 | 
						loc_vars = function(self)
 | 
				
			||||||
		return { vars = { G.GAME.win_ante or 8, (G.GAME.win_ante and G.GAME.round_resets.ante) and math.floor(G.GAME.round_resets.ante + (G.GAME.win_ante - G.GAME.round_resets.ante % G.GAME.win_ante)) or 8 } }
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									G.GAME.win_ante or 8,
 | 
				
			||||||
 | 
									(G.GAME.win_ante and G.GAME.round_resets.ante) and math.floor(
 | 
				
			||||||
 | 
										G.GAME.round_resets.ante + (G.GAME.win_ante - G.GAME.round_resets.ante % G.GAME.win_ante)
 | 
				
			||||||
 | 
									) or 8,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						collection_loc_vars = function(self)
 | 
				
			||||||
 | 
							return { vars = { "8", localize("cry_joke_placeholder") } }
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
        collection_loc_vars = function(self)
 | 
					 | 
				
			||||||
            return { vars = { '8', localize('cry_joke_placeholder') }}
 | 
					 | 
				
			||||||
        end,
 | 
					 | 
				
			||||||
	cry_calc_ante_gain = function(self)
 | 
						cry_calc_ante_gain = function(self)
 | 
				
			||||||
		if to_big(G.GAME.chips) >= to_big(G.GAME.blind.chips) * 2 then
 | 
							if to_big(G.GAME.chips) >= to_big(G.GAME.blind.chips) * 2 then
 | 
				
			||||||
			if G.GAME.round_resets.ante == 1 then
 | 
								if G.GAME.round_resets.ante == 1 then
 | 
				
			||||||
| 
						 | 
					@ -392,6 +408,11 @@ local joke = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local hammer = {
 | 
					local hammer = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-hammer",
 | 
						name = "cry-hammer",
 | 
				
			||||||
	key = "hammer",
 | 
						key = "hammer",
 | 
				
			||||||
| 
						 | 
					@ -422,6 +443,11 @@ local hammer = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local magic = {
 | 
					local magic = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-magic",
 | 
						name = "cry-magic",
 | 
				
			||||||
	key = "magic",
 | 
						key = "magic",
 | 
				
			||||||
| 
						 | 
					@ -452,6 +478,11 @@ local magic = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local windmill = {
 | 
					local windmill = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-windmill",
 | 
						name = "cry-windmill",
 | 
				
			||||||
	key = "windmill",
 | 
						key = "windmill",
 | 
				
			||||||
| 
						 | 
					@ -471,6 +502,11 @@ local windmill = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local striker = {
 | 
					local striker = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-striker",
 | 
						name = "cry-striker",
 | 
				
			||||||
	key = "striker",
 | 
						key = "striker",
 | 
				
			||||||
| 
						 | 
					@ -490,6 +526,11 @@ local striker = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local shackle = {
 | 
					local shackle = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-shackle",
 | 
						name = "cry-shackle",
 | 
				
			||||||
	key = "shackle",
 | 
						key = "shackle",
 | 
				
			||||||
| 
						 | 
					@ -502,25 +543,24 @@ local shackle = {
 | 
				
			||||||
	order = 18,
 | 
						order = 18,
 | 
				
			||||||
	boss_colour = HEX("010466"),
 | 
						boss_colour = HEX("010466"),
 | 
				
			||||||
	in_pool = function()
 | 
						in_pool = function()
 | 
				
			||||||
		if G.GAME.modifiers.cry_force_edition and G.GAME.modifiers.cry_force_edition == "negative" then return false end
 | 
							if G.GAME.modifiers.cry_force_edition and G.GAME.modifiers.cry_force_edition == "negative" then
 | 
				
			||||||
		if not G.jokers then
 | 
					 | 
				
			||||||
			return false
 | 
								return false
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		for i, j in pairs(G.jokers.cards) do
 | 
							return #advanced_find_joker(nil, nil, "e_negative", nil, true) ~= 0
 | 
				
			||||||
			if j.edition and j.edition.negative == true then
 | 
					 | 
				
			||||||
				return true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		return false
 | 
					 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	recalc_debuff = function(self, card, from_blind)
 | 
						recalc_debuff = function(self, card, from_blind)
 | 
				
			||||||
		if (card.area == G.jokers) and not G.GAME.blind.disabled and card.edition and card.edition.negative == true then
 | 
							if (card.area == G.jokers) and not G.GAME.blind.disabled and safe_get(card, "edition", "negative") == true then
 | 
				
			||||||
			return true
 | 
								return true
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		return false
 | 
							return false
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local pin = {
 | 
					local pin = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-pin",
 | 
						name = "cry-pin",
 | 
				
			||||||
	key = "pin",
 | 
						key = "pin",
 | 
				
			||||||
| 
						 | 
					@ -532,49 +572,38 @@ local pin = {
 | 
				
			||||||
	atlas = "blinds",
 | 
						atlas = "blinds",
 | 
				
			||||||
	order = 17,
 | 
						order = 17,
 | 
				
			||||||
	boss_colour = HEX("452703"),
 | 
						boss_colour = HEX("452703"),
 | 
				
			||||||
 | 
						--Todo: whitelist candy jokers
 | 
				
			||||||
	in_pool = function()
 | 
						in_pool = function()
 | 
				
			||||||
		if not G.jokers then
 | 
							if not G.jokers or not G.jokers.cards then
 | 
				
			||||||
			return false
 | 
								return false
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		for i, j in pairs(G.jokers.cards) do
 | 
							return #advanced_find_joker(nil, { 1, 2, 3 }, nil, nil, true) < #G.jokers.cards
 | 
				
			||||||
			if
 | 
					 | 
				
			||||||
				not ((j.config.center.rarity == 1) or (j.config.center.rarity == 2) or (j.config.center.rarity == 3) or (j.config.center.rarity == 5))
 | 
					 | 
				
			||||||
			then
 | 
					 | 
				
			||||||
				return true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		return false
 | 
					 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	recalc_debuff = function(self, card, from_blind)
 | 
						recalc_debuff = function(self, card, from_blind)
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
			(card.area == G.jokers)
 | 
								(card.area == G.jokers)
 | 
				
			||||||
			and not G.GAME.blind.disabled
 | 
								and not G.GAME.blind.disabled
 | 
				
			||||||
			and (card.config.center.rarity ~= 3 and card.config.center.rarity ~= 2 and card.config.center.rarity ~= 1 and card.config.center.rarity ~= 5)
 | 
								and (
 | 
				
			||||||
 | 
									card.config.center.rarity ~= 3
 | 
				
			||||||
 | 
									and card.config.center.rarity ~= 2
 | 
				
			||||||
 | 
									and card.config.center.rarity ~= 1
 | 
				
			||||||
 | 
									and card.config.center.rarity ~= 5
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
		then
 | 
							then
 | 
				
			||||||
			return true
 | 
								return true
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		return false
 | 
							return false
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
--It seems Showdown blind order is seperate from normal blind collection order? convenient for me at least
 | 
					--It seems Showdown blind order is seperate from normal blind collection order? convenient for me at least
 | 
				
			||||||
--Nvm they changed it
 | 
					--Nvm they changed it
 | 
				
			||||||
 | 
					 | 
				
			||||||
local pinkbow = { --TODO: Add effect for this later. NOTE TO SELF: DO NOT FORGET!!!
 | 
					 | 
				
			||||||
	object_type = "Blind",
 | 
					 | 
				
			||||||
	name = "cry-pinkbow",
 | 
					 | 
				
			||||||
	key = "pinkbow",
 | 
					 | 
				
			||||||
	pos = { x = 0, y = 11 },
 | 
					 | 
				
			||||||
	dollars = 8,
 | 
					 | 
				
			||||||
	boss = {
 | 
					 | 
				
			||||||
		min = 3,
 | 
					 | 
				
			||||||
		max = 10,
 | 
					 | 
				
			||||||
		showdown = true,
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	atlas = "blinds",
 | 
					 | 
				
			||||||
	boss_colour = HEX("ff00cc"),
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local lavender_loop = {
 | 
					local lavender_loop = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
								"set_cry_timer",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Lavender Loop",
 | 
						name = "cry-Lavender Loop",
 | 
				
			||||||
	key = "lavender_loop",
 | 
						key = "lavender_loop",
 | 
				
			||||||
| 
						 | 
					@ -604,14 +633,23 @@ local lavender_loop = {
 | 
				
			||||||
			and G.GAME.cry_ach_conditions.patience_virtue_earnable ~= true
 | 
								and G.GAME.cry_ach_conditions.patience_virtue_earnable ~= true
 | 
				
			||||||
		then
 | 
							then
 | 
				
			||||||
			G.GAME.cry_ach_conditions.patience_virtue_timer = G.GAME.cry_ach_conditions.patience_virtue_timer
 | 
								G.GAME.cry_ach_conditions.patience_virtue_timer = G.GAME.cry_ach_conditions.patience_virtue_timer
 | 
				
			||||||
				- dt * (G.GAME.modifiers.cry_rush_hour_iii and 0.5 or 1)
 | 
									- dt * (G.GAME.modifiers.cry_rush_hour_iii and 0.5 or 1) * (G.SETTINGS.paused and 0 or 1)
 | 
				
			||||||
		elseif G.GAME.current_round.hands_played == 0 then
 | 
							elseif G.GAME.current_round.hands_played == 0 then
 | 
				
			||||||
			G.GAME.cry_ach_conditions.patience_virtue_earnable = true
 | 
								G.GAME.cry_ach_conditions.patience_virtue_earnable = true
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		return 1.25 ^ (dt / 1.5)
 | 
							if G.SETTINGS.paused then
 | 
				
			||||||
 | 
								return 1
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return 1.25 ^ (dt / 1.5)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local tornado = {
 | 
					local tornado = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-tornado",
 | 
						name = "cry-tornado",
 | 
				
			||||||
	key = "tornado",
 | 
						key = "tornado",
 | 
				
			||||||
| 
						 | 
					@ -627,26 +665,18 @@ local tornado = {
 | 
				
			||||||
	order = 94,
 | 
						order = 94,
 | 
				
			||||||
	boss_colour = HEX("3dd9ca"),
 | 
						boss_colour = HEX("3dd9ca"),
 | 
				
			||||||
	loc_vars = function(self)
 | 
						loc_vars = function(self)
 | 
				
			||||||
		return { vars = { "" .. ((G.GAME and G.GAME.probabilities.normal or 1) * 2), 3 } }
 | 
							return { vars = { "" .. ((safe_get(G.GAME, "probabilities", "normal") or 1) * 2), 3 } }
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	set_blind = function(self, reset, silent)
 | 
						set_blind = function(self, reset, silent)
 | 
				
			||||||
		if not reset then
 | 
							if not reset then
 | 
				
			||||||
			G.GAME.blind.tornado_guarantee = pseudorandom(pseudoseed("tornado"),1,G.GAME.round_resets.hands)
 | 
								G.GAME.blind.tornado_guarantee = pseudorandom(pseudoseed("tornado"), 1, G.GAME.round_resets.hands)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	in_pool = function()
 | 
						in_pool = function()
 | 
				
			||||||
		if not G.jokers then
 | 
							return #advanced_find_joker("Oops! All 6s", nil, nil, { "eternal" }, nil) == 0
 | 
				
			||||||
			return true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		for i, j in pairs(G.jokers.cards) do
 | 
					 | 
				
			||||||
			if j.ability.name == "Oops! All 6s" and j.ability.eternal == true then
 | 
					 | 
				
			||||||
				return false
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		return true
 | 
					 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	collection_loc_vars = function(self)
 | 
						collection_loc_vars = function(self)
 | 
				
			||||||
		return { vars = { "" .. ((G.GAME and G.GAME.probabilities.normal or 1) * 2), 3 } }
 | 
							return { vars = { "" .. ((safe_get(G.GAME, "probabilities", "normal") or 1) * 2), 3 } }
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	debuff_hand = function(self, cards, hand, handname, check)
 | 
						debuff_hand = function(self, cards, hand, handname, check)
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
| 
						 | 
					@ -655,7 +685,10 @@ local tornado = {
 | 
				
			||||||
			and not G.GAME.blind.disabled
 | 
								and not G.GAME.blind.disabled
 | 
				
			||||||
		then
 | 
							then
 | 
				
			||||||
			--check for guarantee
 | 
								--check for guarantee
 | 
				
			||||||
			if G.GAME.probabilities.normal <= 1 and G.GAME.current_round.hands_left+1 == G.GAME.blind.tornado_guarantee then
 | 
								if
 | 
				
			||||||
 | 
									G.GAME.probabilities.normal <= 1
 | 
				
			||||||
 | 
									and G.GAME.current_round.hands_left + 1 == G.GAME.blind.tornado_guarantee
 | 
				
			||||||
 | 
								then
 | 
				
			||||||
				return false
 | 
									return false
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -667,6 +700,11 @@ local tornado = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
--todo: disable get_local_debuff_text for this
 | 
					--todo: disable get_local_debuff_text for this
 | 
				
			||||||
local vermillion_virus = {
 | 
					local vermillion_virus = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Vermillion Virus",
 | 
						name = "cry-Vermillion Virus",
 | 
				
			||||||
	key = "vermillion_virus",
 | 
						key = "vermillion_virus",
 | 
				
			||||||
| 
						 | 
					@ -685,7 +723,14 @@ local vermillion_virus = {
 | 
				
			||||||
			local idx = pseudorandom(pseudoseed("cry_vermillion_virus"), 1, #G.jokers.cards)
 | 
								local idx = pseudorandom(pseudoseed("cry_vermillion_virus"), 1, #G.jokers.cards)
 | 
				
			||||||
			if G.jokers.cards[idx] then
 | 
								if G.jokers.cards[idx] then
 | 
				
			||||||
				if G.jokers.cards[idx].config.center.immune_to_vermillion then
 | 
									if G.jokers.cards[idx].config.center.immune_to_vermillion then
 | 
				
			||||||
					card_eval_status_text(G.jokers.cards[idx], 'extra', nil, nil, nil, {message = localize('k_nope_ex'), colour = G.C.JOKER_GREY})
 | 
										card_eval_status_text(
 | 
				
			||||||
 | 
											G.jokers.cards[idx],
 | 
				
			||||||
 | 
											"extra",
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											{ message = localize("k_nope_ex"), colour = G.C.JOKER_GREY }
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					_card = create_card("Joker", G.jokers, nil, nil, nil, nil, nil, "cry_vermillion_virus_gen")
 | 
										_card = create_card("Joker", G.jokers, nil, nil, nil, nil, nil, "cry_vermillion_virus_gen")
 | 
				
			||||||
					G.jokers.cards[idx]:remove_from_deck()
 | 
										G.jokers.cards[idx]:remove_from_deck()
 | 
				
			||||||
| 
						 | 
					@ -700,8 +745,12 @@ local vermillion_virus = {
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
local sapphire_stamp = {
 | 
					local sapphire_stamp = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Sapphire Stamp",
 | 
						name = "cry-Sapphire Stamp",
 | 
				
			||||||
	key = "sapphire_stamp",
 | 
						key = "sapphire_stamp",
 | 
				
			||||||
| 
						 | 
					@ -735,8 +784,12 @@ local sapphire_stamp = {
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
local obsidian_orb = {
 | 
					local obsidian_orb = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_blind",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Blind",
 | 
						object_type = "Blind",
 | 
				
			||||||
	name = "cry-Obsidian Orb",
 | 
						name = "cry-Obsidian Orb",
 | 
				
			||||||
	key = "obsidian_orb",
 | 
						key = "obsidian_orb",
 | 
				
			||||||
| 
						 | 
					@ -1023,7 +1076,7 @@ local obsidian_orb = {
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			if s.name == "The Arm" then
 | 
								if s.name == "The Arm" then
 | 
				
			||||||
				G.GAME.blind.triggered = false
 | 
									G.GAME.blind.triggered = false
 | 
				
			||||||
				if G.GAME.hands[handname].level > 1 then
 | 
									if to_big(G.GAME.hands[handname].level) > to_big(1) then
 | 
				
			||||||
					G.GAME.blind.triggered = true
 | 
										G.GAME.blind.triggered = true
 | 
				
			||||||
					if not check then
 | 
										if not check then
 | 
				
			||||||
						level_up_hand(G.GAME.blind.children.animatedSprite, handname, nil, -1)
 | 
											level_up_hand(G.GAME.blind.children.animatedSprite, handname, nil, -1)
 | 
				
			||||||
| 
						 | 
					@ -1227,28 +1280,40 @@ local obsidian_orb = {
 | 
				
			||||||
		return disp_text
 | 
							return disp_text
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					local trophy = {
 | 
				
			||||||
local blind_sprites = {
 | 
						dependencies = {
 | 
				
			||||||
	object_type = "Atlas",
 | 
							items = {
 | 
				
			||||||
	key = "blinds",
 | 
								"set_cry_blind",
 | 
				
			||||||
	atlas_table = "ANIMATION_ATLAS",
 | 
							},
 | 
				
			||||||
	path = "bl_cry.png",
 | 
						},
 | 
				
			||||||
	px = 34,
 | 
						mult = 1,
 | 
				
			||||||
	py = 34,
 | 
						object_type = "Blind",
 | 
				
			||||||
	frames = 21,
 | 
						name = "cry-Lemon Trophy",
 | 
				
			||||||
 | 
						key = "trophy",
 | 
				
			||||||
 | 
						pos = { x = 0, y = 17 },
 | 
				
			||||||
 | 
						dollars = 8,
 | 
				
			||||||
 | 
						boss = {
 | 
				
			||||||
 | 
							min = 3,
 | 
				
			||||||
 | 
							max = 10,
 | 
				
			||||||
 | 
							showdown = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						atlas = "blinds",
 | 
				
			||||||
 | 
						order = 95,
 | 
				
			||||||
 | 
						boss_colour = HEX("bbdb44"),
 | 
				
			||||||
 | 
						set_blind = function(self, reset, silent)
 | 
				
			||||||
 | 
							G.GAME.trophymod = true
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						defeat = function(self, silent)
 | 
				
			||||||
 | 
							if G.GAME.trophymod then
 | 
				
			||||||
 | 
								G.GAME.trophymod = nil
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						disable = function(self, silent)
 | 
				
			||||||
 | 
							if G.GAME.trophymod then
 | 
				
			||||||
 | 
								G.GAME.trophymod = nil
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local nostalgia_sprites = {
 | 
					 | 
				
			||||||
	object_type = "Atlas",
 | 
					 | 
				
			||||||
	key = "nostalgia",
 | 
					 | 
				
			||||||
	atlas_table = "ANIMATION_ATLAS",
 | 
					 | 
				
			||||||
	path = "bl_nostalgia.png",
 | 
					 | 
				
			||||||
	px = 34,
 | 
					 | 
				
			||||||
	py = 34,
 | 
					 | 
				
			||||||
	frames = 21,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--this list contains all of the blinds to be registered, if Blinds are enabled--
 | 
					 | 
				
			||||||
--to disable a blind, comment it out or remove it from this list--
 | 
					 | 
				
			||||||
local items_togo = {
 | 
					local items_togo = {
 | 
				
			||||||
	oldox,
 | 
						oldox,
 | 
				
			||||||
	oldhouse,
 | 
						oldhouse,
 | 
				
			||||||
| 
						 | 
					@ -1273,213 +1338,8 @@ local items_togo = {
 | 
				
			||||||
	tornado,
 | 
						tornado,
 | 
				
			||||||
	sapphire_stamp,
 | 
						sapphire_stamp,
 | 
				
			||||||
	obsidian_orb,
 | 
						obsidian_orb,
 | 
				
			||||||
	blind_sprites,
 | 
						clock,
 | 
				
			||||||
	nostalgia_sprites,
 | 
						lavender_loop,
 | 
				
			||||||
}
 | 
						trophy,
 | 
				
			||||||
 | 
					 | 
				
			||||||
if Cryptid.enabled["Timer Mechanics"] then
 | 
					 | 
				
			||||||
	table.insert(items_togo, clock)
 | 
					 | 
				
			||||||
	table.insert(items_togo, lavender_loop)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--Fix an issue with adding bosses mid-run
 | 
					 | 
				
			||||||
local gnb = get_new_boss
 | 
					 | 
				
			||||||
function get_new_boss()
 | 
					 | 
				
			||||||
	for k, v in pairs(G.P_BLINDS) do
 | 
					 | 
				
			||||||
		if not G.GAME.bosses_used[k] then
 | 
					 | 
				
			||||||
			G.GAME.bosses_used[k] = 0
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local bl = gnb()
 | 
					 | 
				
			||||||
	if G.GAME.modifiers.cry_beta and Cryptid.enabled["Blinds"] then
 | 
					 | 
				
			||||||
		local bl_key = string.sub(bl,4)
 | 
					 | 
				
			||||||
		local nostalgicblinds = {
 | 
					 | 
				
			||||||
			arm = true,
 | 
					 | 
				
			||||||
			fish = true,
 | 
					 | 
				
			||||||
			flint = true,
 | 
					 | 
				
			||||||
			house = true,
 | 
					 | 
				
			||||||
			manacle = true,
 | 
					 | 
				
			||||||
			mark = true,
 | 
					 | 
				
			||||||
			ox = true,
 | 
					 | 
				
			||||||
			pillar = true,
 | 
					 | 
				
			||||||
			serpent = true
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if nostalgicblinds[bl_key] then
 | 
					 | 
				
			||||||
			return "bl_cry_old"..bl_key
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return bl
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
return {
 | 
					 | 
				
			||||||
	name = "Blinds",
 | 
					 | 
				
			||||||
	init = function()
 | 
					 | 
				
			||||||
		--Clock Patches
 | 
					 | 
				
			||||||
		local upd = Game.update
 | 
					 | 
				
			||||||
		function Game:update(dt)
 | 
					 | 
				
			||||||
			upd(self, dt)
 | 
					 | 
				
			||||||
			local choices = { "Small", "Big", "Boss" }
 | 
					 | 
				
			||||||
			G.GAME.CRY_BLINDS = G.GAME.CRY_BLINDS or {}
 | 
					 | 
				
			||||||
			for _, c in pairs(choices) do
 | 
					 | 
				
			||||||
				if
 | 
					 | 
				
			||||||
					G.GAME
 | 
					 | 
				
			||||||
					and G.GAME.round_resets
 | 
					 | 
				
			||||||
					and G.GAME.round_resets.blind_choices
 | 
					 | 
				
			||||||
					and G.GAME.round_resets.blind_choices[c]
 | 
					 | 
				
			||||||
					and G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].cry_ante_base_mod
 | 
					 | 
				
			||||||
				then
 | 
					 | 
				
			||||||
					if
 | 
					 | 
				
			||||||
						G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult ~= 0
 | 
					 | 
				
			||||||
						and G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult_ante ~= G.GAME.round_resets.ante
 | 
					 | 
				
			||||||
					then
 | 
					 | 
				
			||||||
						if G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].name == "cry-Obsidian Orb" then
 | 
					 | 
				
			||||||
							for i = 1, #G.GAME.defeated_blinds do
 | 
					 | 
				
			||||||
								G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult = G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult
 | 
					 | 
				
			||||||
									* G.P_BLINDS[G.GAME.defeated_blinds[i]]
 | 
					 | 
				
			||||||
									/ 2
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
						else
 | 
					 | 
				
			||||||
							G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult = 0
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
						G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult_ante = G.GAME.round_resets.ante
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
					if
 | 
					 | 
				
			||||||
						G.GAME.round_resets.blind_states[c] ~= "Current"
 | 
					 | 
				
			||||||
						and G.GAME.round_resets.blind_states[c] ~= "Defeated"
 | 
					 | 
				
			||||||
					then
 | 
					 | 
				
			||||||
						G.GAME.CRY_BLINDS[c] = (
 | 
					 | 
				
			||||||
							G.GAME.CRY_BLINDS[c] or G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].mult
 | 
					 | 
				
			||||||
						)
 | 
					 | 
				
			||||||
							+ (
 | 
					 | 
				
			||||||
								G.P_BLINDS[G.GAME.round_resets.blind_choices[c]].cry_ante_base_mod
 | 
					 | 
				
			||||||
									and G.P_BLINDS[G.GAME.round_resets.blind_choices[c]]:cry_ante_base_mod(
 | 
					 | 
				
			||||||
										dt * (G.GAME.modifiers.cry_rush_hour_iii and 2 or 1)
 | 
					 | 
				
			||||||
									)
 | 
					 | 
				
			||||||
								or 0
 | 
					 | 
				
			||||||
							)
 | 
					 | 
				
			||||||
						--Update UI
 | 
					 | 
				
			||||||
						--todo: in blinds screen, too
 | 
					 | 
				
			||||||
						if G.blind_select_opts then
 | 
					 | 
				
			||||||
							local blind_UI =
 | 
					 | 
				
			||||||
								G.blind_select_opts[string.lower(c)].definition.nodes[1].nodes[1].nodes[1].nodes[1]
 | 
					 | 
				
			||||||
							local chip_text_node = blind_UI.nodes[1].nodes[3].nodes[1].nodes[2].nodes[2].nodes[3]
 | 
					 | 
				
			||||||
							if chip_text_node then
 | 
					 | 
				
			||||||
								chip_text_node.config.text = number_format(
 | 
					 | 
				
			||||||
									get_blind_amount(G.GAME.round_resets.blind_ante)
 | 
					 | 
				
			||||||
										* G.GAME.starting_params.ante_scaling
 | 
					 | 
				
			||||||
										* G.GAME.CRY_BLINDS[c]
 | 
					 | 
				
			||||||
								)
 | 
					 | 
				
			||||||
								chip_text_node.config.scale = score_number_scale(
 | 
					 | 
				
			||||||
									0.9,
 | 
					 | 
				
			||||||
									get_blind_amount(G.GAME.round_resets.blind_ante)
 | 
					 | 
				
			||||||
										* G.GAME.starting_params.ante_scaling
 | 
					 | 
				
			||||||
										* G.GAME.CRY_BLINDS[c]
 | 
					 | 
				
			||||||
								)
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
							G.blind_select_opts[string.lower(c)]:recalculate()
 | 
					 | 
				
			||||||
						end
 | 
					 | 
				
			||||||
					elseif
 | 
					 | 
				
			||||||
						G.GAME.round_resets.blind_states[c] ~= "Defeated"
 | 
					 | 
				
			||||||
						and not G.GAME.blind.disabled
 | 
					 | 
				
			||||||
						and to_big(G.GAME.chips) < to_big(G.GAME.blind.chips)
 | 
					 | 
				
			||||||
					then
 | 
					 | 
				
			||||||
						G.GAME.blind.chips = G.GAME.blind.chips
 | 
					 | 
				
			||||||
							+ G.GAME.blind:cry_ante_base_mod(dt * (G.GAME.modifiers.cry_rush_hour_iii and 2 or 1))
 | 
					 | 
				
			||||||
								* get_blind_amount(G.GAME.round_resets.ante)
 | 
					 | 
				
			||||||
								* G.GAME.starting_params.ante_scaling
 | 
					 | 
				
			||||||
						G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if
 | 
					 | 
				
			||||||
					G.GAME.round_resets.blind_states[c] == "Current"
 | 
					 | 
				
			||||||
					and G.GAME
 | 
					 | 
				
			||||||
					and G.GAME.blind
 | 
					 | 
				
			||||||
					and not G.GAME.blind.disabled
 | 
					 | 
				
			||||||
					and to_big(G.GAME.chips) < to_big(G.GAME.blind.chips)
 | 
					 | 
				
			||||||
				then
 | 
					 | 
				
			||||||
					G.GAME.blind.chips = G.GAME.blind.chips
 | 
					 | 
				
			||||||
						* G.GAME.blind:cry_round_base_mod(dt * (G.GAME.modifiers.cry_rush_hour_iii and 2 or 1))
 | 
					 | 
				
			||||||
					G.GAME.blind.chip_text = number_format(G.GAME.blind.chips)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--Trick Patches
 | 
					 | 
				
			||||||
		local gfep = G.FUNCS.evaluate_play
 | 
					 | 
				
			||||||
		function G.FUNCS.evaluate_play(e)
 | 
					 | 
				
			||||||
			gfep(e)
 | 
					 | 
				
			||||||
			G.GAME.blind:cry_after_play()
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--Sapphire Stamp Patches
 | 
					 | 
				
			||||||
		local pcfh = G.FUNCS.play_cards_from_highlighted
 | 
					 | 
				
			||||||
		function G.FUNCS.play_cards_from_highlighted(e)
 | 
					 | 
				
			||||||
			G.GAME.blind:cry_before_play()
 | 
					 | 
				
			||||||
			pcfh(e)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--Obsidian Orb Patches
 | 
					 | 
				
			||||||
		local dft = Blind.defeat
 | 
					 | 
				
			||||||
		function Blind:defeat(s)
 | 
					 | 
				
			||||||
			dft(self, s)
 | 
					 | 
				
			||||||
			local obj = self.config.blind
 | 
					 | 
				
			||||||
			if obj.boss and (obj.boss.no_orb or obj.boss.epic or obj.loc_vars) then
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if
 | 
					 | 
				
			||||||
				self.name ~= "cry-Obsidian Orb"
 | 
					 | 
				
			||||||
				and self.name ~= "The Sink"
 | 
					 | 
				
			||||||
				and (self.name ~= "cry-oldarm" or not G.GAME.defeated_blinds["bl_psychic"])
 | 
					 | 
				
			||||||
				and (self.name ~= "The Psychic" or not G.GAME.defeated_blinds["bl_cry_oldarm"])
 | 
					 | 
				
			||||||
				and (self.name ~= "The Eye" or not G.GAME.defeated_blinds["bl_mouth"])
 | 
					 | 
				
			||||||
				and (self.name ~= "The Mouth" or not G.GAME.defeated_blinds["bl_eye"])
 | 
					 | 
				
			||||||
				and (self.name ~= "cry-Lavender Loop" or not G.GAME.defeated_blinds["bl_cry_tax"])
 | 
					 | 
				
			||||||
				and (self.name ~= "cry-Tax" or not G.GAME.defeated_blinds["bl_cry_lavender_loop"])
 | 
					 | 
				
			||||||
				and (self.name ~= "The Needle" or not G.GAME.defeated_blinds["bl_cry_tax"])
 | 
					 | 
				
			||||||
				and (self.name ~= "cry-Tax" or not G.GAME.defeated_blinds["bl_needle"])
 | 
					 | 
				
			||||||
			then
 | 
					 | 
				
			||||||
				G.GAME.defeated_blinds[self.config.blind.key] = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local sr = Game.start_run
 | 
					 | 
				
			||||||
		function Game:start_run(args)
 | 
					 | 
				
			||||||
			sr(self, args)
 | 
					 | 
				
			||||||
			if G.P_BLINDS.bl_cry_clock then
 | 
					 | 
				
			||||||
				G.P_BLINDS.bl_cry_clock.mult = 0
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if not G.GAME.defeated_blinds then
 | 
					 | 
				
			||||||
				G.GAME.defeated_blinds = {}
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		--patch for multiple Clocks to tick separately and load separately
 | 
					 | 
				
			||||||
		local bsb = Blind.set_blind
 | 
					 | 
				
			||||||
		function Blind:set_blind(blind, y, z)
 | 
					 | 
				
			||||||
			local c = "Boss"
 | 
					 | 
				
			||||||
			if string.sub(G.GAME.subhash or "", -1) == "S" then
 | 
					 | 
				
			||||||
				c = "Small"
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if string.sub(G.GAME.subhash or "", -1) == "B" then
 | 
					 | 
				
			||||||
				c = "Big"
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if
 | 
					 | 
				
			||||||
				G.GAME.CRY_BLINDS
 | 
					 | 
				
			||||||
				and G.GAME.CRY_BLINDS[c]
 | 
					 | 
				
			||||||
				and not y
 | 
					 | 
				
			||||||
				and blind
 | 
					 | 
				
			||||||
				and blind.mult
 | 
					 | 
				
			||||||
				and blind.cry_ante_base_mod
 | 
					 | 
				
			||||||
			then
 | 
					 | 
				
			||||||
				blind.mult = G.GAME.CRY_BLINDS[c]
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			bsb(self, blind, y, z)
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		local rb = reset_blinds
 | 
					 | 
				
			||||||
		function reset_blinds()
 | 
					 | 
				
			||||||
			if G.GAME.round_resets.blind_states.Boss == "Defeated" then
 | 
					 | 
				
			||||||
				G.GAME.CRY_BLINDS = {}
 | 
					 | 
				
			||||||
				if G.P_BLINDS.bl_cry_clock then
 | 
					 | 
				
			||||||
					G.P_BLINDS.bl_cry_clock.mult = 0
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			rb()
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	items = items_togo,
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					return { name = "Blinds", items = items_togo }
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,7 @@ local ballin = {
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	jokers = {
 | 
						jokers = {
 | 
				
			||||||
		{ id = "j_cry_jimball", eternal = true },
 | 
							{ id = "j_cry_jimball", stickers = { "cry_absolute" } },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	deck = {
 | 
						deck = {
 | 
				
			||||||
		type = "Challenge Deck",
 | 
							type = "Challenge Deck",
 | 
				
			||||||
| 
						 | 
					@ -70,6 +70,7 @@ local ballin = {
 | 
				
			||||||
			{ id = "c_justice" },
 | 
								{ id = "c_justice" },
 | 
				
			||||||
			{ id = "c_devil" },
 | 
								{ id = "c_devil" },
 | 
				
			||||||
			{ id = "c_tower" },
 | 
								{ id = "c_tower" },
 | 
				
			||||||
 | 
								{ id = "c_cry_seraph" },
 | 
				
			||||||
			{ id = "c_familiar" },
 | 
								{ id = "c_familiar" },
 | 
				
			||||||
			{ id = "c_grim" },
 | 
								{ id = "c_grim" },
 | 
				
			||||||
			{ id = "c_incantation" },
 | 
								{ id = "c_incantation" },
 | 
				
			||||||
| 
						 | 
					@ -140,7 +141,7 @@ local rush_hour_iii = {
 | 
				
			||||||
		modifiers = {},
 | 
							modifiers = {},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	jokers = {
 | 
						jokers = {
 | 
				
			||||||
		{ id = "j_hit_the_road", eternal = true, edition = "negative" },
 | 
							{ id = "j_hit_the_road", stickers = { "cry_absolute" }, edition = "negative" },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	deck = {
 | 
						deck = {
 | 
				
			||||||
		type = "Challenge Deck",
 | 
							type = "Challenge Deck",
 | 
				
			||||||
| 
						 | 
					@ -227,7 +228,7 @@ local boss_rush = {
 | 
				
			||||||
		modifiers = {},
 | 
							modifiers = {},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	jokers = {
 | 
						jokers = {
 | 
				
			||||||
		{ id = "j_cry_apjoker", eternal = true },
 | 
							{ id = "j_cry_apjoker", stickers = { "cry_absolute" } },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	deck = {
 | 
						deck = {
 | 
				
			||||||
		type = "Challenge Deck",
 | 
							type = "Challenge Deck",
 | 
				
			||||||
| 
						 | 
					@ -285,10 +286,10 @@ local dagger_war = {
 | 
				
			||||||
		{ id = "j_cry_cryptidmoment", edition = "negative" },
 | 
							{ id = "j_cry_cryptidmoment", edition = "negative" },
 | 
				
			||||||
		{ id = "j_gift", edition = "negative" },
 | 
							{ id = "j_gift", edition = "negative" },
 | 
				
			||||||
		{ id = "j_gift", edition = "negative" },
 | 
							{ id = "j_gift", edition = "negative" },
 | 
				
			||||||
		{ id = "j_ceremonial", eternal = true },
 | 
							{ id = "j_ceremonial", stickers = { "cry_absolute" } },
 | 
				
			||||||
		{ id = "j_cry_unjust_dagger", eternal = true },
 | 
							{ id = "j_cry_unjust_dagger", stickers = { "cry_absolute" } },
 | 
				
			||||||
		{ id = "j_cry_monkey_dagger", eternal = true },
 | 
							{ id = "j_cry_monkey_dagger", stickers = { "cry_absolute" } },
 | 
				
			||||||
		{ id = "j_cry_pirate_dagger", eternal = true },
 | 
							{ id = "j_cry_pirate_dagger", stickers = { "cry_absolute" } },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	deck = {
 | 
						deck = {
 | 
				
			||||||
		type = "Challenge Deck",
 | 
							type = "Challenge Deck",
 | 
				
			||||||
| 
						 | 
					@ -301,7 +302,7 @@ local onlycard = {
 | 
				
			||||||
	rules = {
 | 
						rules = {
 | 
				
			||||||
		custom = {},
 | 
							custom = {},
 | 
				
			||||||
		modifiers = {
 | 
							modifiers = {
 | 
				
			||||||
			{id = 'dollars', value = 10},
 | 
								{ id = "dollars", value = 10 },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	restrictions = {
 | 
						restrictions = {
 | 
				
			||||||
| 
						 | 
					@ -309,7 +310,7 @@ local onlycard = {
 | 
				
			||||||
			{ id = "tag_charm" },
 | 
								{ id = "tag_charm" },
 | 
				
			||||||
			{ id = "tag_meteor" },
 | 
								{ id = "tag_meteor" },
 | 
				
			||||||
			{ id = "tag_buffoon" },
 | 
								{ id = "tag_buffoon" },
 | 
				
			||||||
			{ id = "tag_ethereal" }
 | 
								{ id = "tag_ethereal" },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		banned_cards = {
 | 
							banned_cards = {
 | 
				
			||||||
			{ id = "j_marble" },
 | 
								{ id = "j_marble" },
 | 
				
			||||||
| 
						 | 
					@ -319,29 +320,53 @@ local onlycard = {
 | 
				
			||||||
			{ id = "c_grim" },
 | 
								{ id = "c_grim" },
 | 
				
			||||||
			{ id = "c_incantation" },
 | 
								{ id = "c_incantation" },
 | 
				
			||||||
			{ id = "c_cryptid" },
 | 
								{ id = "c_cryptid" },
 | 
				
			||||||
			{id = 'p_celestial_normal_1', ids = {
 | 
								{
 | 
				
			||||||
                		'p_celestial_normal_1','p_celestial_normal_2',
 | 
									id = "p_celestial_normal_1",
 | 
				
			||||||
				'p_celestial_normal_3','p_celestial_normal_4',
 | 
									ids = {
 | 
				
			||||||
				'p_celestial_jumbo_1','p_celestial_jumbo_2',
 | 
										"p_celestial_normal_1",
 | 
				
			||||||
				'p_celestial_mega_1','p_celestial_mega_2',}
 | 
										"p_celestial_normal_2",
 | 
				
			||||||
        		},
 | 
										"p_celestial_normal_3",
 | 
				
			||||||
			{id = 'p_arcana_normal_1', ids = {
 | 
										"p_celestial_normal_4",
 | 
				
			||||||
                		'p_arcana_normal_1','p_arcana_normal_2',
 | 
										"p_celestial_jumbo_1",
 | 
				
			||||||
				'p_arcana_normal_3','p_arcana_normal_4',
 | 
										"p_celestial_jumbo_2",
 | 
				
			||||||
				'p_arcana_jumbo_1','p_arcana_jumbo_2',
 | 
										"p_celestial_mega_1",
 | 
				
			||||||
				'p_arcana_mega_1','p_arcana_mega_2',}
 | 
										"p_celestial_mega_2",
 | 
				
			||||||
        		},
 | 
									},
 | 
				
			||||||
			{id = 'p_spectral_normal_1', ids = {
 | 
								},
 | 
				
			||||||
                		'p_spectral_normal_1','p_spectral_normal_2',
 | 
								{
 | 
				
			||||||
				'p_spectral_jumbo_1','p_spectral_mega_1',}
 | 
									id = "p_arcana_normal_1",
 | 
				
			||||||
        		},
 | 
									ids = {
 | 
				
			||||||
			{id = 'p_buffoon_normal_1', ids = {
 | 
										"p_arcana_normal_1",
 | 
				
			||||||
                		'p_buffoon_normal_1','p_buffoon_normal_2',
 | 
										"p_arcana_normal_2",
 | 
				
			||||||
				'p_buffoon_jumbo_1','p_buffoon_mega_1',}
 | 
										"p_arcana_normal_3",
 | 
				
			||||||
        		},
 | 
										"p_arcana_normal_4",
 | 
				
			||||||
 | 
										"p_arcana_jumbo_1",
 | 
				
			||||||
 | 
										"p_arcana_jumbo_2",
 | 
				
			||||||
 | 
										"p_arcana_mega_1",
 | 
				
			||||||
 | 
										"p_arcana_mega_2",
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									id = "p_spectral_normal_1",
 | 
				
			||||||
 | 
									ids = {
 | 
				
			||||||
 | 
										"p_spectral_normal_1",
 | 
				
			||||||
 | 
										"p_spectral_normal_2",
 | 
				
			||||||
 | 
										"p_spectral_jumbo_1",
 | 
				
			||||||
 | 
										"p_spectral_mega_1",
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									id = "p_buffoon_normal_1",
 | 
				
			||||||
 | 
									ids = {
 | 
				
			||||||
 | 
										"p_buffoon_normal_1",
 | 
				
			||||||
 | 
										"p_buffoon_normal_2",
 | 
				
			||||||
 | 
										"p_buffoon_jumbo_1",
 | 
				
			||||||
 | 
										"p_buffoon_mega_1",
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		banned_other = {
 | 
							banned_other = {
 | 
				
			||||||
			{ id = 'bl_house', type = 'blind' },
 | 
								{ id = "bl_house", type = "blind" },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	jokers = {
 | 
						jokers = {
 | 
				
			||||||
| 
						 | 
					@ -350,7 +375,7 @@ local onlycard = {
 | 
				
			||||||
	deck = {
 | 
						deck = {
 | 
				
			||||||
		type = "Challenge Deck",
 | 
							type = "Challenge Deck",
 | 
				
			||||||
		cards = {
 | 
							cards = {
 | 
				
			||||||
			{ s = "C", r = "A", g='Blue' },
 | 
								{ s = "C", r = "A", g = "Blue" },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -367,8 +392,8 @@ local joker_poker = {
 | 
				
			||||||
			{ id = "cry_no_consumables" },
 | 
								{ id = "cry_no_consumables" },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		modifiers = {
 | 
							modifiers = {
 | 
				
			||||||
			{id = "consumable_slots", value = 0},
 | 
								{ id = "consumable_slots", value = 0 },
 | 
				
			||||||
			{id = "discards", value = 0}
 | 
								{ id = "discards", value = 0 },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	deck = {
 | 
						deck = {
 | 
				
			||||||
| 
						 | 
					@ -376,37 +401,37 @@ local joker_poker = {
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	restrictions = {
 | 
						restrictions = {
 | 
				
			||||||
		banned_cards = {
 | 
							banned_cards = {
 | 
				
			||||||
			{id = "j_banner"},
 | 
								{ id = "j_banner" },
 | 
				
			||||||
			{id = "j_8_ball"},
 | 
								{ id = "j_8_ball" },
 | 
				
			||||||
			{id = "j_chaos"},
 | 
								{ id = "j_chaos" },
 | 
				
			||||||
			{id = "j_delayed_grat"},
 | 
								{ id = "j_delayed_grat" },
 | 
				
			||||||
			{id = "j_sixth_sense"},
 | 
								{ id = "j_sixth_sense" },
 | 
				
			||||||
			{id = "j_faceless"},
 | 
								{ id = "j_faceless" },
 | 
				
			||||||
			{id = "j_superposition"},
 | 
								{ id = "j_superposition" },
 | 
				
			||||||
			{id = "j_red_card"},
 | 
								{ id = "j_red_card" },
 | 
				
			||||||
			{id = "j_seance"},
 | 
								{ id = "j_seance" },
 | 
				
			||||||
			{id = "j_vagabond"},
 | 
								{ id = "j_vagabond" },
 | 
				
			||||||
			{id = "j_mail"},
 | 
								{ id = "j_mail" },
 | 
				
			||||||
			{id = "j_hallucination"},
 | 
								{ id = "j_hallucination" },
 | 
				
			||||||
			{id = "j_fortune_teller"},
 | 
								{ id = "j_fortune_teller" },
 | 
				
			||||||
			{id = "j_drunkard"},
 | 
								{ id = "j_drunkard" },
 | 
				
			||||||
			{id = "j_trading"},
 | 
								{ id = "j_trading" },
 | 
				
			||||||
			{id = "j_flash"},
 | 
								{ id = "j_flash" },
 | 
				
			||||||
			{id = "j_castle"},
 | 
								{ id = "j_castle" },
 | 
				
			||||||
			{id = "j_merry_andy"},
 | 
								{ id = "j_merry_andy" },
 | 
				
			||||||
			{id = "j_hit_the_road"},
 | 
								{ id = "j_hit_the_road" },
 | 
				
			||||||
			{id = "j_satellite"},
 | 
								{ id = "j_satellite" },
 | 
				
			||||||
			{id = "j_cartomancer"},
 | 
								{ id = "j_cartomancer" },
 | 
				
			||||||
			{id = "j_astronomer"},
 | 
								{ id = "j_astronomer" },
 | 
				
			||||||
			{id = "j_burnt"},
 | 
								{ id = "j_burnt" },
 | 
				
			||||||
			{id = "j_yorick"},
 | 
								{ id = "j_yorick" },
 | 
				
			||||||
			{id = "j_perkeo"},
 | 
								{ id = "j_perkeo" },
 | 
				
			||||||
			{id = "j_constellation"}
 | 
								{ id = "j_constellation" },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		banned_other = {
 | 
							banned_other = {
 | 
				
			||||||
			{ id = 'bl_hook', type = 'blind' },
 | 
								{ id = "bl_hook", type = "blind" },
 | 
				
			||||||
			{ id = 'bl_arm', type = 'blind' },
 | 
								{ id = "bl_arm", type = "blind" },
 | 
				
			||||||
			{ id = 'bl_water', type = 'blind' },
 | 
								{ id = "bl_water", type = "blind" },
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -414,7 +439,7 @@ local gfcr = G.FUNCS.can_reroll
 | 
				
			||||||
function G.FUNCS.can_reroll(e)
 | 
					function G.FUNCS.can_reroll(e)
 | 
				
			||||||
	if G.GAME.modifiers.cry_no_rerolls then
 | 
						if G.GAME.modifiers.cry_no_rerolls then
 | 
				
			||||||
		e.config.colour = G.C.UI.BACKGROUND_INACTIVE
 | 
							e.config.colour = G.C.UI.BACKGROUND_INACTIVE
 | 
				
			||||||
        e.config.button = nil
 | 
							e.config.button = nil
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		return gfcr(e)
 | 
							return gfcr(e)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
| 
						 | 
					@ -429,7 +454,8 @@ end
 | 
				
			||||||
--Add banned cards when specific features/mods are enabled here
 | 
					--Add banned cards when specific features/mods are enabled here
 | 
				
			||||||
--TODO other mods
 | 
					--TODO other mods
 | 
				
			||||||
if Cryptid.enabled["Blinds"] then
 | 
					if Cryptid.enabled["Blinds"] then
 | 
				
			||||||
	joker_poker.restrictions.banned_other[#joker_poker.restrictions.banned_other + 1] = { id = 'bl_cry_oldmanacle', type = 'blind' }
 | 
						joker_poker.restrictions.banned_other[#joker_poker.restrictions.banned_other + 1] =
 | 
				
			||||||
 | 
							{ id = "bl_cry_oldmanacle", type = "blind" }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if Cryptid.enabled["Tags"] then
 | 
					if Cryptid.enabled["Tags"] then
 | 
				
			||||||
	onlycard.restrictions.banned_tags[#onlycard.restrictions.banned_tags + 1] = { id = "tag_cry_bundle" }
 | 
						onlycard.restrictions.banned_tags[#onlycard.restrictions.banned_tags + 1] = { id = "tag_cry_bundle" }
 | 
				
			||||||
| 
						 | 
					@ -443,8 +469,10 @@ if Cryptid.enabled["Tags"] then
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if Cryptid.enabled["Misc."] then
 | 
					if Cryptid.enabled["Misc."] then
 | 
				
			||||||
	ballin.restrictions.banned_cards[#ballin.restrictions.banned_cards + 1] = { id = "c_cry_eclipse" }
 | 
						ballin.restrictions.banned_cards[#ballin.restrictions.banned_cards + 1] = { id = "c_cry_eclipse" }
 | 
				
			||||||
	rng.restrictions.banned_cards[#rng.restrictions.banned_cards + 1] = {id = 'p_cry_meme_1', ids = {'p_cry_meme_1','p_cry_meme_two','p_cry_meme_three'}}
 | 
						rng.restrictions.banned_cards[#rng.restrictions.banned_cards + 1] =
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = {id = 'p_cry_meme_1', ids = {'p_cry_meme_1','p_cry_meme_two','p_cry_meme_three'}}
 | 
							{ id = "p_cry_meme_1", ids = { "p_cry_meme_1", "p_cry_meme_two", "p_cry_meme_three" } }
 | 
				
			||||||
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] =
 | 
				
			||||||
 | 
							{ id = "p_cry_meme_1", ids = { "p_cry_meme_1", "p_cry_meme_two", "p_cry_meme_three" } }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if Cryptid.enabled["Misc. Jokers"] then
 | 
					if Cryptid.enabled["Misc. Jokers"] then
 | 
				
			||||||
	rush_hour_ii.restrictions.banned_cards[#rush_hour_ii.restrictions.banned_cards + 1] = { id = "j_cry_pickle" }
 | 
						rush_hour_ii.restrictions.banned_cards[#rush_hour_ii.restrictions.banned_cards + 1] = { id = "j_cry_pickle" }
 | 
				
			||||||
| 
						 | 
					@ -473,7 +501,10 @@ if Cryptid.enabled["Code Cards"] then
 | 
				
			||||||
	ballin.restrictions.banned_cards[#ballin.restrictions.banned_cards + 1] = { id = "c_cry_class" }
 | 
						ballin.restrictions.banned_cards[#ballin.restrictions.banned_cards + 1] = { id = "c_cry_class" }
 | 
				
			||||||
	rng.restrictions.banned_cards[#rng.restrictions.banned_cards + 1] = { id = "c_cry_delete" }
 | 
						rng.restrictions.banned_cards[#rng.restrictions.banned_cards + 1] = { id = "c_cry_delete" }
 | 
				
			||||||
	onlycard.restrictions.banned_tags[#onlycard.restrictions.banned_tags + 1] = { id = "tag_cry_console" }
 | 
						onlycard.restrictions.banned_tags[#onlycard.restrictions.banned_tags + 1] = { id = "tag_cry_console" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = {id = 'p_cry_code_normal_1', ids = {'p_cry_code_normal_1','p_cry_code_normal_2','p_cry_code_jumbo_1','p_cry_code_mega_1',}}
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = {
 | 
				
			||||||
 | 
							id = "p_cry_code_normal_1",
 | 
				
			||||||
 | 
							ids = { "p_cry_code_normal_1", "p_cry_code_normal_2", "p_cry_code_jumbo_1", "p_cry_code_mega_1" },
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	joker_poker.restrictions.banned_cards[#joker_poker.restrictions.banned_cards + 1] = { id = "j_cry_cut" }
 | 
						joker_poker.restrictions.banned_cards[#joker_poker.restrictions.banned_cards + 1] = { id = "j_cry_cut" }
 | 
				
			||||||
	joker_poker.restrictions.banned_cards[#joker_poker.restrictions.banned_cards + 1] = { id = "j_cry_CodeJoker" }
 | 
						joker_poker.restrictions.banned_cards[#joker_poker.restrictions.banned_cards + 1] = { id = "j_cry_CodeJoker" }
 | 
				
			||||||
	joker_poker.restrictions.banned_cards[#joker_poker.restrictions.banned_cards + 1] = { id = "j_cry_copypaste" }
 | 
						joker_poker.restrictions.banned_cards[#joker_poker.restrictions.banned_cards + 1] = { id = "j_cry_copypaste" }
 | 
				
			||||||
| 
						 | 
					@ -482,8 +513,8 @@ if Cryptid.enabled["Code Cards"] then
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if Cryptid.enabled["Spectrals"] then
 | 
					if Cryptid.enabled["Spectrals"] then
 | 
				
			||||||
	sticker_sheet.restrictions.banned_cards[#sticker_sheet.restrictions.banned_cards + 1] = { id = "c_cry_lock" }
 | 
						sticker_sheet.restrictions.banned_cards[#sticker_sheet.restrictions.banned_cards + 1] = { id = "c_cry_lock" }
 | 
				
			||||||
	sticker_sheet_plus.restrictions.banned_cards[#sticker_sheet_plus.restrictions.banned_cards + 1] = { id = "c_cry_lock" }
 | 
						sticker_sheet_plus.restrictions.banned_cards[#sticker_sheet_plus.restrictions.banned_cards + 1] =
 | 
				
			||||||
	dagger_war.restrictions.banned_cards[#dagger_war.restrictions.banned_cards + 1] = { id = "c_cry_lock" }
 | 
							{ id = "c_cry_lock" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_cry_replica" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_cry_replica" }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if Cryptid.enabled["Vouchers"] then
 | 
					if Cryptid.enabled["Vouchers"] then
 | 
				
			||||||
| 
						 | 
					@ -494,7 +525,8 @@ if Cryptid.enabled["Vouchers"] then
 | 
				
			||||||
	rush_hour_iii.restrictions.banned_cards[#rush_hour_iii.restrictions.banned_cards + 1] = { id = "v_cry_tag_printer" }
 | 
						rush_hour_iii.restrictions.banned_cards[#rush_hour_iii.restrictions.banned_cards + 1] = { id = "v_cry_tag_printer" }
 | 
				
			||||||
	boss_rush.restrictions.banned_cards[#boss_rush.restrictions.banned_cards + 1] = { id = "v_cry_tag_printer" }
 | 
						boss_rush.restrictions.banned_cards[#boss_rush.restrictions.banned_cards + 1] = { id = "v_cry_tag_printer" }
 | 
				
			||||||
	rush_hour_ii.restrictions.banned_cards[#rush_hour_ii.restrictions.banned_cards + 1] = { id = "v_cry_clone_machine" }
 | 
						rush_hour_ii.restrictions.banned_cards[#rush_hour_ii.restrictions.banned_cards + 1] = { id = "v_cry_clone_machine" }
 | 
				
			||||||
	rush_hour_iii.restrictions.banned_cards[#rush_hour_iii.restrictions.banned_cards + 1] = { id = "v_cry_clone_machine" }
 | 
						rush_hour_iii.restrictions.banned_cards[#rush_hour_iii.restrictions.banned_cards + 1] =
 | 
				
			||||||
 | 
							{ id = "v_cry_clone_machine" }
 | 
				
			||||||
	boss_rush.restrictions.banned_cards[#boss_rush.restrictions.banned_cards + 1] = { id = "v_cry_clone_machine" }
 | 
						boss_rush.restrictions.banned_cards[#boss_rush.restrictions.banned_cards + 1] = { id = "v_cry_clone_machine" }
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
if (SMODS.Mods["jen"] or {}).can_load then
 | 
					if (SMODS.Mods["jen"] or {}).can_load then
 | 
				
			||||||
| 
						 | 
					@ -532,7 +564,8 @@ if (SMODS.Mods["jen"] or {}).can_load then
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_justice" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_justice" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_devil" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_devil" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_tower" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_tower" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_high_priestess" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] =
 | 
				
			||||||
 | 
							{ id = "c_jen_reverse_high_priestess" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_emperor" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_emperor" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_death" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_death" }
 | 
				
			||||||
	onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_star" }
 | 
						onlycard.restrictions.banned_cards[#onlycard.restrictions.banned_cards + 1] = { id = "c_jen_reverse_star" }
 | 
				
			||||||
| 
						 | 
					@ -573,4 +606,4 @@ for k, v in pairs(G.P_CENTERS) do
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return { name = "Challenges", init = function() end, items = challenges }
 | 
					return { name = "Challenges", items = challenges }
 | 
				
			||||||
							
								
								
									
										4971
									
								
								Cryptid/items/code.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										1013
									
								
								Cryptid/items/deck.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										444
									
								
								Cryptid/items/enhanced.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,444 @@
 | 
				
			||||||
 | 
					local atlasenhanced = {
 | 
				
			||||||
 | 
						object_type = "Atlas",
 | 
				
			||||||
 | 
						key = "atlasenhanced",
 | 
				
			||||||
 | 
						path = "atlasdeck.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local atlasedition = {
 | 
				
			||||||
 | 
						object_type = "Atlas",
 | 
				
			||||||
 | 
						key = "atlaseditiondeck",
 | 
				
			||||||
 | 
						path = "atlaseditiondeck.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Cryptid.edeck_sprites = {
 | 
				
			||||||
 | 
						edition = {
 | 
				
			||||||
 | 
							order = 1,
 | 
				
			||||||
 | 
							default = { atlas = "centers", pos = { x = 5, y = 2 } },
 | 
				
			||||||
 | 
							foil = { atlas = "cry_atlaseditiondeck", pos = { x = 0, y = 0 } },
 | 
				
			||||||
 | 
							holo = { atlas = "cry_atlaseditiondeck", pos = { x = 1, y = 0 } },
 | 
				
			||||||
 | 
							polychrome = { atlas = "cry_atlaseditiondeck", pos = { x = 2, y = 0 } },
 | 
				
			||||||
 | 
							negative = { atlas = "cry_atlaseditiondeck", pos = { x = 3, y = 0 } },
 | 
				
			||||||
 | 
							cry_mosaic = { atlas = "cry_atlaseditiondeck", pos = { x = 0, y = 1 } },
 | 
				
			||||||
 | 
							cry_oversat = { atlas = "cry_atlaseditiondeck", pos = { x = 1, y = 1 } },
 | 
				
			||||||
 | 
							cry_glass = { atlas = "cry_atlaseditiondeck", pos = { x = 2, y = 1 } },
 | 
				
			||||||
 | 
							cry_gold = { atlas = "cry_atlaseditiondeck", pos = { x = 3, y = 1 } },
 | 
				
			||||||
 | 
							cry_blur = { atlas = "cry_atlaseditiondeck", pos = { x = 0, y = 2 } },
 | 
				
			||||||
 | 
							cry_noisy = { atlas = "cry_atlaseditiondeck", pos = { x = 1, y = 2 } },
 | 
				
			||||||
 | 
							cry_astral = { atlas = "cry_atlaseditiondeck", pos = { x = 2, y = 2 } },
 | 
				
			||||||
 | 
							cry_m = { atlas = "cry_atlaseditiondeck", pos = { x = 3, y = 2 } },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						enhancement = {
 | 
				
			||||||
 | 
							order = 2,
 | 
				
			||||||
 | 
							default = { atlas = "centers", pos = { x = 5, y = 2 } },
 | 
				
			||||||
 | 
							m_bonus = { atlas = "cry_atlasenhanced", pos = { x = 3, y = 3 } },
 | 
				
			||||||
 | 
							m_mult = { atlas = "cry_atlasenhanced", pos = { x = 2, y = 3 } },
 | 
				
			||||||
 | 
							m_wild = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 3 } },
 | 
				
			||||||
 | 
							m_glass = { atlas = "cry_atlasenhanced", pos = { x = 4, y = 3 } },
 | 
				
			||||||
 | 
							m_steel = { atlas = "centers", pos = { x = 6, y = 1 } },
 | 
				
			||||||
 | 
							m_stone = { atlas = "centers", pos = { x = 5, y = 0 } },
 | 
				
			||||||
 | 
							m_gold = { atlas = "centers", pos = { x = 6, y = 0 } },
 | 
				
			||||||
 | 
							m_lucky = { atlas = "centers", pos = { x = 4, y = 1 } },
 | 
				
			||||||
 | 
							m_cry_echo = { atlas = "cry_atlasenhanced", pos = { x = 1, y = 5 } },
 | 
				
			||||||
 | 
							m_cry_light = { atlas = "cry_misc", pos = { x = 0, y = 3 } },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						sticker = {
 | 
				
			||||||
 | 
							order = 3,
 | 
				
			||||||
 | 
							default = { atlas = "centers", pos = { x = 5, y = 2 } },
 | 
				
			||||||
 | 
							eternal = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 2 } },
 | 
				
			||||||
 | 
							perishable = { atlas = "cry_atlasenhanced", pos = { x = 0, y = 3 } },
 | 
				
			||||||
 | 
							rental = { atlas = "cry_atlasenhanced", pos = { x = 1, y = 3 } },
 | 
				
			||||||
 | 
							pinned = { atlas = "cry_atlasenhanced", pos = { x = 0, y = 5 } },
 | 
				
			||||||
 | 
							banana = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 4 } },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						suit = {
 | 
				
			||||||
 | 
							order = 4,
 | 
				
			||||||
 | 
							default = { atlas = "centers", pos = { x = 5, y = 2 } },
 | 
				
			||||||
 | 
							Diamonds = { atlas = "cry_atlasenhanced", pos = { x = 2, y = 1 } },
 | 
				
			||||||
 | 
							Hearts = { atlas = "cry_atlasenhanced", pos = { x = 3, y = 1 } },
 | 
				
			||||||
 | 
							Spades = { atlas = "cry_atlasenhanced", pos = { x = 4, y = 1 } },
 | 
				
			||||||
 | 
							Clubs = { atlas = "cry_atlasenhanced", pos = { x = 5, y = 1 } },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						seal = {
 | 
				
			||||||
 | 
							order = 5,
 | 
				
			||||||
 | 
							default = { atlas = "centers", pos = { x = 5, y = 2 } },
 | 
				
			||||||
 | 
							Gold = { atlas = "centers", pos = { x = 1, y = 2 } },
 | 
				
			||||||
 | 
							Red = { atlas = "centers", pos = { x = 0, y = 0 } },
 | 
				
			||||||
 | 
							Blue = { atlas = "cry_atlasenhanced", pos = { x = 2, y = 2 } },
 | 
				
			||||||
 | 
							Purple = { atlas = "cry_atlasenhanced", pos = { x = 1, y = 2 } },
 | 
				
			||||||
 | 
							cry_azure = { atlas = "centers", pos = { x = 0, y = 2 } },
 | 
				
			||||||
 | 
							cry_green = { atlas = "cry_atlasenhanced", pos = { x = 3, y = 5 } },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cry_edeck_atlas_update = function(self)
 | 
				
			||||||
 | 
						local sprite = Cryptid.edeck_sprites[self.edeck_type]
 | 
				
			||||||
 | 
						if not sprite then
 | 
				
			||||||
 | 
							error(self.edeck_type)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local enh_info = { cry_get_enchanced_deck_info(self) }
 | 
				
			||||||
 | 
						sprite = sprite[enh_info[sprite.order]] or sprite.default
 | 
				
			||||||
 | 
						self.atlas, self.pos = sprite.atlas, sprite.pos
 | 
				
			||||||
 | 
						return sprite
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local e_deck = {
 | 
				
			||||||
 | 
						object_type = "Back",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_deck",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						name = "cry-Edition Deck",
 | 
				
			||||||
 | 
						key = "e_deck",
 | 
				
			||||||
 | 
						order = 17,
 | 
				
			||||||
 | 
						pos = { x = 5, y = 2 },
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local aaa = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							return { vars = { localize({ type = "name_text", set = "Edition", key = "e_" .. aaa }) } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						edeck_type = "edition",
 | 
				
			||||||
 | 
						config = {},
 | 
				
			||||||
 | 
						apply = function(self)
 | 
				
			||||||
 | 
							local aaa = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							G.GAME.modifiers.cry_force_edition = aaa
 | 
				
			||||||
 | 
							--Ban Edition tags (They will never redeem)
 | 
				
			||||||
 | 
							for k, v in pairs(G.P_TAGS) do
 | 
				
			||||||
 | 
								if v.config and v.config.edition then
 | 
				
			||||||
 | 
									G.GAME.banned_keys[k] = true
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									for c = #G.playing_cards, 1, -1 do
 | 
				
			||||||
 | 
										G.playing_cards[c]:set_edition(aaa, true, true)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local et_deck = {
 | 
				
			||||||
 | 
						object_type = "Back",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_deck",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						name = "cry-Enhancement Deck",
 | 
				
			||||||
 | 
						key = "et_deck",
 | 
				
			||||||
 | 
						order = 18,
 | 
				
			||||||
 | 
						pos = { x = 5, y = 2 },
 | 
				
			||||||
 | 
						edeck_type = "enhancement",
 | 
				
			||||||
 | 
						config = {},
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local _, bbb = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							return { vars = { localize({ type = "name_text", set = "Enhanced", key = bbb }) } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						apply = function(self)
 | 
				
			||||||
 | 
							local aaa, bbb = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							G.GAME.modifiers.cry_force_enhancement = bbb
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									for c = #G.playing_cards, 1, -1 do
 | 
				
			||||||
 | 
										G.playing_cards[c]:set_ability(G.P_CENTERS[bbb])
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						draw = cry_edeck_draw,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local sk_deck = {
 | 
				
			||||||
 | 
						object_type = "Back",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_deck",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						name = "cry-Sticker Deck",
 | 
				
			||||||
 | 
						key = "sk_deck",
 | 
				
			||||||
 | 
						order = 19,
 | 
				
			||||||
 | 
						pos = { x = 5, y = 2 },
 | 
				
			||||||
 | 
						edeck_type = "sticker",
 | 
				
			||||||
 | 
						config = {},
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local _, _, ccc = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							if ccc == "pinned" then
 | 
				
			||||||
 | 
								ccc = "pinned_left"
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return { vars = { localize({ type = "name_text", set = "Other", key = ccc }) } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						apply = function(self)
 | 
				
			||||||
 | 
							local aaa, bbb, ccc = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							G.GAME.modifiers.cry_force_sticker = ccc
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									for c = #G.playing_cards, 1, -1 do
 | 
				
			||||||
 | 
										G.playing_cards[c].config.center.eternal_compat = true
 | 
				
			||||||
 | 
										G.playing_cards[c].config.center.perishable_compat = true
 | 
				
			||||||
 | 
										if SMODS.Stickers[ccc] and SMODS.Stickers[ccc].apply then
 | 
				
			||||||
 | 
											SMODS.Stickers[ccc]:apply(G.playing_cards[c], true)
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											G.playing_cards[c]["set_" .. ccc](G.playing_cards[c], true)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local st_deck = {
 | 
				
			||||||
 | 
						object_type = "Back",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_deck",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						name = "cry-Suit Deck",
 | 
				
			||||||
 | 
						key = "st_deck",
 | 
				
			||||||
 | 
						config = {},
 | 
				
			||||||
 | 
						order = 20,
 | 
				
			||||||
 | 
						pos = { x = 5, y = 2 },
 | 
				
			||||||
 | 
						edeck_type = "suit",
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local _, _, _, ddd = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							return { vars = { localize(ddd, "suits_plural") } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						apply = function(self)
 | 
				
			||||||
 | 
							local aaa, bbb, ccc, ddd = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							if ddd == "Spades" then
 | 
				
			||||||
 | 
								G.GAME.bosses_used["bl_goad"] = 1e308
 | 
				
			||||||
 | 
							elseif ddd == "Hearts" then
 | 
				
			||||||
 | 
								G.GAME.bosses_used["bl_head"] = 1e308
 | 
				
			||||||
 | 
							elseif ddd == "Clubs" then
 | 
				
			||||||
 | 
								G.GAME.bosses_used["bl_club"] = 1e308
 | 
				
			||||||
 | 
							elseif ddd == "Diamonds" then
 | 
				
			||||||
 | 
								G.GAME.bosses_used["bl_window"] = 1e308
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							G.GAME.modifiers.cry_force_suit = ddd
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									for c = #G.playing_cards, 1, -1 do
 | 
				
			||||||
 | 
										G.playing_cards[c]:change_suit(ddd)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local sl_deck = {
 | 
				
			||||||
 | 
						object_type = "Back",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_deck",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						name = "cry-Seal Deck",
 | 
				
			||||||
 | 
						key = "sl_deck",
 | 
				
			||||||
 | 
						order = 21,
 | 
				
			||||||
 | 
						pos = { x = 5, y = 2 },
 | 
				
			||||||
 | 
						config = {},
 | 
				
			||||||
 | 
						edeck_type = "seal",
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local _, _, _, _, eee = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							return { vars = { localize({ type = "name_text", set = "Other", key = eee:lower() .. "_seal" }) } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						apply = function(self)
 | 
				
			||||||
 | 
							local aaa, bbb, ccc, ddd, eee = cry_get_enchanced_deck_info(self)
 | 
				
			||||||
 | 
							G.GAME.modifiers.cry_force_seal = eee
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									for c = #G.playing_cards, 1, -1 do
 | 
				
			||||||
 | 
										G.playing_cards[c]:set_seal(eee, true)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
						name = "Enhanced Decks",
 | 
				
			||||||
 | 
						init = function()
 | 
				
			||||||
 | 
							local sa = Card.set_ability
 | 
				
			||||||
 | 
							function Card:set_ability(center, y, z)
 | 
				
			||||||
 | 
								--adding immutable to cards because
 | 
				
			||||||
 | 
								-- A they are hardcoded and unaffected by misprintize but still have a description that changes because of it
 | 
				
			||||||
 | 
								-- B so they ignore misprintize in order to keep vanilla descripton accurate (ex hack shouldn't be able to trigger more than once)
 | 
				
			||||||
 | 
								-- C so Gemini doesn't say they are compatible when they are not
 | 
				
			||||||
 | 
								-- D Invisible Joker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if
 | 
				
			||||||
 | 
									center.name == "Fortune Teller"
 | 
				
			||||||
 | 
									or center.name == "Shoot the Moon"
 | 
				
			||||||
 | 
									or center.name == "Riff-raff"
 | 
				
			||||||
 | 
									or center.name == "Chaos the Clown"
 | 
				
			||||||
 | 
									or center.name == "Dusk"
 | 
				
			||||||
 | 
									or center.name == "Mime"
 | 
				
			||||||
 | 
									or center.name == "Hack"
 | 
				
			||||||
 | 
									or center.name == "Sock and Buskin"
 | 
				
			||||||
 | 
									or center.name == "Invisible Joker"
 | 
				
			||||||
 | 
									or center.name == "Swashbuckler"
 | 
				
			||||||
 | 
									or center.name == "Smeared Joker"
 | 
				
			||||||
 | 
									or center.name == "Certificate"
 | 
				
			||||||
 | 
									or center.name == "Mr. Bones"
 | 
				
			||||||
 | 
									or center.name == "Diet Cola"
 | 
				
			||||||
 | 
									or center.name == "Luchador"
 | 
				
			||||||
 | 
									or center.name == "Midas Mask"
 | 
				
			||||||
 | 
									or center.name == "Shortcut"
 | 
				
			||||||
 | 
									or center.name == "Seance"
 | 
				
			||||||
 | 
									or center.name == "Superposition"
 | 
				
			||||||
 | 
									or center.name == "Sixth Sense"
 | 
				
			||||||
 | 
									or center.name == "DNA"
 | 
				
			||||||
 | 
									or center.name == "Splash"
 | 
				
			||||||
 | 
									or center.name == "Supernova"
 | 
				
			||||||
 | 
									or center.name == "Pareidolia"
 | 
				
			||||||
 | 
									or center.name == "Raised Fist"
 | 
				
			||||||
 | 
									or center.name == "Marble Joker"
 | 
				
			||||||
 | 
									or center.name == "Four Fingers"
 | 
				
			||||||
 | 
									or center.name == "Joker Stencil"
 | 
				
			||||||
 | 
									or center.name == "Showman"
 | 
				
			||||||
 | 
									or center.name == "Blueprint"
 | 
				
			||||||
 | 
									or center.name == "Oops! All 6s"
 | 
				
			||||||
 | 
									or center.name == "Brainstorm"
 | 
				
			||||||
 | 
									or center.name == "Cartomancer"
 | 
				
			||||||
 | 
									or center.name == "Astronomer"
 | 
				
			||||||
 | 
									or center.name == "Burnt Joker"
 | 
				
			||||||
 | 
									or center.name == "Chicot"
 | 
				
			||||||
 | 
									or center.name == "Perkeo"
 | 
				
			||||||
 | 
								then
 | 
				
			||||||
 | 
									self.config.center.immutable = true
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if safe_get(center, "name") == "Default Base" then -- scuffed
 | 
				
			||||||
 | 
									return sa(
 | 
				
			||||||
 | 
										self,
 | 
				
			||||||
 | 
										(not self.no_forced_enhancement and G.GAME.modifiers.cry_force_enhancement)
 | 
				
			||||||
 | 
												and G.P_CENTERS[G.GAME.modifiers.cry_force_enhancement]
 | 
				
			||||||
 | 
											or center,
 | 
				
			||||||
 | 
										y,
 | 
				
			||||||
 | 
										z
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									return sa(self, center, y, z)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local se = Card.set_edition
 | 
				
			||||||
 | 
							function Card:set_edition(edition, y, z, force)
 | 
				
			||||||
 | 
								if not force then
 | 
				
			||||||
 | 
									return se(
 | 
				
			||||||
 | 
										self,
 | 
				
			||||||
 | 
										(not self.no_forced_edition and G.GAME.modifiers.cry_force_edition)
 | 
				
			||||||
 | 
												and { [G.GAME.modifiers.cry_force_edition] = true }
 | 
				
			||||||
 | 
											or edition,
 | 
				
			||||||
 | 
										y,
 | 
				
			||||||
 | 
										z
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								return se(self, edition, y, z)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local ss = Card.set_seal
 | 
				
			||||||
 | 
							function Card:set_seal(seal, y, z)
 | 
				
			||||||
 | 
								return ss(self, not self.no_forced_seal and G.GAME.modifiers.cry_force_seal or seal, y, z)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local cs = Card.change_suit
 | 
				
			||||||
 | 
							function Card:change_suit(new_suit)
 | 
				
			||||||
 | 
								return cs(self, not self.no_forced_suit and G.GAME.modifiers.cry_force_suit or new_suit)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local sc = Card.set_cost
 | 
				
			||||||
 | 
							function Card:set_cost()
 | 
				
			||||||
 | 
								if self.edition and G.GAME.modifiers.cry_no_edition_price then
 | 
				
			||||||
 | 
									local m = cry_deep_copy(self.edition)
 | 
				
			||||||
 | 
									self.edition = nil
 | 
				
			||||||
 | 
									sc(self)
 | 
				
			||||||
 | 
									self.edition = m
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									sc(self)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local ccl = Card.click
 | 
				
			||||||
 | 
							function Card:click()
 | 
				
			||||||
 | 
								ccl(self)
 | 
				
			||||||
 | 
								if
 | 
				
			||||||
 | 
									Galdur
 | 
				
			||||||
 | 
										and (self.edeck_select or (self.area == safe_get(Galdur, "run_setup", "selected_deck_area") and safe_get(
 | 
				
			||||||
 | 
											self,
 | 
				
			||||||
 | 
											"config",
 | 
				
			||||||
 | 
											"center",
 | 
				
			||||||
 | 
											"edeck_type"
 | 
				
			||||||
 | 
										)))
 | 
				
			||||||
 | 
									or (
 | 
				
			||||||
 | 
										safe_get(G.GAME, "viewed_back", "effect", "center", "edeck_type")
 | 
				
			||||||
 | 
										and (self.back == "viewed_back" or self.edeck_select)
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								then
 | 
				
			||||||
 | 
									if self.edeck_select then
 | 
				
			||||||
 | 
										G.PROFILES[G.SETTINGS.profile]["cry_edeck_" .. self.config.center.edeck_type] = self.edeck_select
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									cry_enhancement_config_UI(Galdur and self.config.center or G.GAME.viewed_back.effect.center)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							function cry_enhancement_config_UI(center)
 | 
				
			||||||
 | 
								G.SETTINGS.paused = true
 | 
				
			||||||
 | 
								G.your_collection = {}
 | 
				
			||||||
 | 
								G.your_collection[1] = CardArea(
 | 
				
			||||||
 | 
									G.ROOM.T.x + 0.2 * G.ROOM.T.w / 2,
 | 
				
			||||||
 | 
									G.ROOM.T.h,
 | 
				
			||||||
 | 
									5.3 * G.CARD_W,
 | 
				
			||||||
 | 
									1.03 * G.CARD_H,
 | 
				
			||||||
 | 
									{ card_limit = 5, type = "title", highlight_limit = 0, collection = true }
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
 | 
								local deck_tables = {
 | 
				
			||||||
 | 
									n = G.UIT.R,
 | 
				
			||||||
 | 
									config = { align = "cm", padding = 0, no_fill = true },
 | 
				
			||||||
 | 
									nodes = {
 | 
				
			||||||
 | 
										{ n = G.UIT.O, config = { object = G.your_collection[1] } },
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								local pool_table = {
 | 
				
			||||||
 | 
									edition = G.P_CENTER_POOLS.Edition,
 | 
				
			||||||
 | 
									enhancement = G.P_CENTER_POOLS.Enhanced,
 | 
				
			||||||
 | 
									sticker = SMODS.Stickers,
 | 
				
			||||||
 | 
									suit = SMODS.Suits,
 | 
				
			||||||
 | 
									seal = G.P_SEALS,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								local editions = {}
 | 
				
			||||||
 | 
								for _, v in pairs(pool_table[center.edeck_type]) do
 | 
				
			||||||
 | 
									if v.key ~= "e_base" and not v.no_edeck then
 | 
				
			||||||
 | 
										editions[#editions + 1] = (center.edeck_type == "edition" and v.key:sub(3)) or v.key
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								for i = 1, #editions do
 | 
				
			||||||
 | 
									local _center = cry_deep_copy(center)
 | 
				
			||||||
 | 
									_center.config["cry_force_" .. center.edeck_type] = editions[i]
 | 
				
			||||||
 | 
									cry_edeck_atlas_update(_center)
 | 
				
			||||||
 | 
									local card = create_generic_card(_center)
 | 
				
			||||||
 | 
									card.edeck_select = editions[i]
 | 
				
			||||||
 | 
									G.your_collection[1]:emplace(card)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								INIT_COLLECTION_CARD_ALERTS()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								local t = create_UIBox_generic_options({
 | 
				
			||||||
 | 
									--infotip = localize("cry_gameset_explanation"),
 | 
				
			||||||
 | 
									back_func = "setup_run",
 | 
				
			||||||
 | 
									snap_back = true,
 | 
				
			||||||
 | 
									contents = {
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = { align = "cm", minw = 2.5, padding = 0.1, r = 0.1, colour = G.C.BLACK, emboss = 0.05 },
 | 
				
			||||||
 | 
											nodes = { deck_tables },
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
								G.FUNCS.overlay_menu({
 | 
				
			||||||
 | 
									definition = t,
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						items = { e_deck, et_deck, sk_deck, st_deck, sl_deck, atlasenhanced, atlasedition },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -142,52 +142,51 @@
 | 
				
			||||||
--Treacherous Joker
 | 
					--Treacherous Joker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if JokerDisplay then
 | 
					if JokerDisplay then
 | 
				
			||||||
 | 
					 | 
				
			||||||
	--Side note: I Don't think retrigger type exp gives a correct value with Emult jokers, but ehhhhh ig I can live with that (It's good enough)
 | 
						--Side note: I Don't think retrigger type exp gives a correct value with Emult jokers, but ehhhhh ig I can live with that (It's good enough)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	--This is here so it shows up on the github symbol panel (easy to scroll to)
 | 
						--This is here so it shows up on the github symbol panel (easy to scroll to)
 | 
				
			||||||
	local page1 = {}
 | 
						local page1 = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        JokerDisplay.Definitions["j_cry_supercell"] = {
 | 
						JokerDisplay.Definitions["j_cry_supercell"] = {
 | 
				
			||||||
                text = {
 | 
							text = {
 | 
				
			||||||
                        { text = "+", colour = G.C.CHIPS },
 | 
								{ text = "+", colour = G.C.CHIPS },
 | 
				
			||||||
                        { ref_table = "card.ability.extra", ref_value = "stat1", colour = G.C.CHIPS, retrigger_type = "mult" },
 | 
								{ ref_table = "card.ability.extra", ref_value = "stat1", colour = G.C.CHIPS, retrigger_type = "mult" },
 | 
				
			||||||
                        { text = " +", colour = G.C.MULT },
 | 
								{ text = " +", colour = G.C.MULT },
 | 
				
			||||||
                        { ref_table = "card.ability.extra", ref_value = "stat1", colour = G.C.MULT, retrigger_type = "mult" },
 | 
								{ ref_table = "card.ability.extra", ref_value = "stat1", colour = G.C.MULT, retrigger_type = "mult" },
 | 
				
			||||||
                },
 | 
							},
 | 
				
			||||||
                extra = {
 | 
							extra = {
 | 
				
			||||||
                        {
 | 
								{
 | 
				
			||||||
                                {
 | 
									{
 | 
				
			||||||
                                        border_nodes = {
 | 
										border_nodes = {
 | 
				
			||||||
                                                { text = "X" },
 | 
											{ text = "X" },
 | 
				
			||||||
                                                { ref_table = "card.ability.extra", ref_value = "stat2", retrigger_type = "exp" },
 | 
											{ ref_table = "card.ability.extra", ref_value = "stat2", retrigger_type = "exp" },
 | 
				
			||||||
                                        },
 | 
										},
 | 
				
			||||||
                                        border_colour = G.C.CHIPS,
 | 
										border_colour = G.C.CHIPS,
 | 
				
			||||||
                                },
 | 
									},
 | 
				
			||||||
                                { text = " " },
 | 
									{ text = " " },
 | 
				
			||||||
                                {
 | 
									{
 | 
				
			||||||
                                        border_nodes = {
 | 
										border_nodes = {
 | 
				
			||||||
                                                { text = "X" },
 | 
											{ text = "X" },
 | 
				
			||||||
                                                { ref_table = "card.ability.extra", ref_value = "stat2", retrigger_type = "exp" },
 | 
											{ ref_table = "card.ability.extra", ref_value = "stat2", retrigger_type = "exp" },
 | 
				
			||||||
                                        },
 | 
										},
 | 
				
			||||||
                                },
 | 
									},
 | 
				
			||||||
                        },
 | 
								},
 | 
				
			||||||
                        {
 | 
								{
 | 
				
			||||||
                                { text = "+$", colour = G.C.GOLD },
 | 
									{ text = "+$", colour = G.C.GOLD },
 | 
				
			||||||
                                { ref_table = "card.ability.extra", ref_value = "money", colour = G.C.GOLD },
 | 
									{ ref_table = "card.ability.extra", ref_value = "money", colour = G.C.GOLD },
 | 
				
			||||||
                                {
 | 
									{
 | 
				
			||||||
                                        ref_table = "card.joker_display_values",
 | 
										ref_table = "card.joker_display_values",
 | 
				
			||||||
                                        ref_value = "localized_text",
 | 
										ref_value = "localized_text",
 | 
				
			||||||
                                        colour = G.C.UI.TEXT_INACTIVE,
 | 
										colour = G.C.UI.TEXT_INACTIVE,
 | 
				
			||||||
                                        scale = 0.3,
 | 
										scale = 0.3,
 | 
				
			||||||
                                },
 | 
									},
 | 
				
			||||||
                        },
 | 
								},
 | 
				
			||||||
                },
 | 
							},
 | 
				
			||||||
                calc_function = function(card)
 | 
							calc_function = function(card)
 | 
				
			||||||
                        card.joker_display_values.localized_text = "(" .. localize("k_round") .. ")"
 | 
								card.joker_display_values.localized_text = "(" .. localize("k_round") .. ")"
 | 
				
			||||||
                end,
 | 
							end,
 | 
				
			||||||
        }
 | 
						}
 | 
				
			||||||
        JokerDisplay.Definitions["j_cry_dropshot"] = {
 | 
						JokerDisplay.Definitions["j_cry_dropshot"] = {
 | 
				
			||||||
		text = {
 | 
							text = {
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				border_nodes = {
 | 
									border_nodes = {
 | 
				
			||||||
| 
						 | 
					@ -575,12 +574,15 @@ if JokerDisplay then
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	JokerDisplay.Definitions["j_cry_mprime"] = {
 | 
						JokerDisplay.Definitions["j_cry_mprime"] = {
 | 
				
			||||||
		mod_function = function(card, mod_joker)
 | 
							mod_function = function(card, mod_joker)
 | 
				
			||||||
			return { e_mult = (
 | 
								return {
 | 
				
			||||||
				card.ability.name == "Jolly Joker"
 | 
									e_mult = (
 | 
				
			||||||
				or card.edition and card.edition.key == "e_cry_m"
 | 
										card.ability.name == "Jolly Joker"
 | 
				
			||||||
				or card.ability.effect == "M Joker"
 | 
										or card.edition and card.edition.key == "e_cry_m"
 | 
				
			||||||
		 	) 
 | 
										or safe_get(card, "pools", "M")
 | 
				
			||||||
			and mod_joker.ability.extra.mult * JokerDisplay.calculate_joker_triggers(mod_joker) or nil }
 | 
									)
 | 
				
			||||||
 | 
											and mod_joker.ability.extra.mult * JokerDisplay.calculate_joker_triggers(mod_joker)
 | 
				
			||||||
 | 
										or nil,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	JokerDisplay.Definitions["j_cry_whip"] = {
 | 
						JokerDisplay.Definitions["j_cry_whip"] = {
 | 
				
			||||||
| 
						 | 
					@ -808,7 +810,7 @@ if JokerDisplay then
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		calc_function = function(card)
 | 
							calc_function = function(card)
 | 
				
			||||||
			local bonus = math.max(0, math.floor(0.01 * card.ability.extra.percent * (G.GAME.dollars or 1)))
 | 
								local bonus = math.max(0, math.floor(0.01 * card.ability.extra.percent * (G.GAME.dollars or 1)))
 | 
				
			||||||
			card.joker_display_values.dollars = bonus and bonus > 0 and bonus or 0
 | 
								card.joker_display_values.dollars = bonus and bonus > to_big(0) and bonus or 0
 | 
				
			||||||
			card.joker_display_values.localized_text = "(" .. localize("k_round") .. ")"
 | 
								card.joker_display_values.localized_text = "(" .. localize("k_round") .. ")"
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1416,8 +1418,11 @@ if JokerDisplay then
 | 
				
			||||||
			card.joker_display_values.localized_text = localize({ type = "name_text", set = "Edition", key = "e_foil" })
 | 
								card.joker_display_values.localized_text = localize({ type = "name_text", set = "Edition", key = "e_foil" })
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
		mod_function = function(card, mod_joker) --Foil Jokers
 | 
							mod_function = function(card, mod_joker) --Foil Jokers
 | 
				
			||||||
			return { chips = (card ~= mod_joker and card.edition and card.edition.foil == true) and 
 | 
								return {
 | 
				
			||||||
			mod_joker.ability.extra.chips * JokerDisplay.calculate_joker_triggers(mod_joker) or nil }
 | 
									chips = (card ~= mod_joker and card.edition and card.edition.foil == true)
 | 
				
			||||||
 | 
											and mod_joker.ability.extra.chips * JokerDisplay.calculate_joker_triggers(mod_joker)
 | 
				
			||||||
 | 
										or nil,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	JokerDisplay.Definitions["j_cry_exoplanet"] = {
 | 
						JokerDisplay.Definitions["j_cry_exoplanet"] = {
 | 
				
			||||||
| 
						 | 
					@ -1444,19 +1449,26 @@ if JokerDisplay then
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			for _, playing_card in ipairs(G.hand.cards) do --Holographic cards held in hand
 | 
								for _, playing_card in ipairs(G.hand.cards) do --Holographic cards held in hand
 | 
				
			||||||
                		if playing_hand or not playing_card.highlighted then
 | 
									if playing_hand or not playing_card.highlighted then
 | 
				
			||||||
                    			if not (playing_card.facing == 'back') and not playing_card.debuff 
 | 
										if
 | 
				
			||||||
					and playing_card.edition and playing_card.edition.holo == true then
 | 
											not (playing_card.facing == "back")
 | 
				
			||||||
                        			count = count + JokerDisplay.calculate_card_triggers(playing_card, nil, true)
 | 
											and not playing_card.debuff
 | 
				
			||||||
                    			end
 | 
											and playing_card.edition
 | 
				
			||||||
                		end
 | 
											and playing_card.edition.holo == true
 | 
				
			||||||
            		end
 | 
										then
 | 
				
			||||||
 | 
											count = count + JokerDisplay.calculate_card_triggers(playing_card, nil, true)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
			card.joker_display_values.mult = card.ability.extra.mult * count
 | 
								card.joker_display_values.mult = card.ability.extra.mult * count
 | 
				
			||||||
			card.joker_display_values.localized_text = localize({ type = "name_text", set = "Edition", key = "e_holo" })
 | 
								card.joker_display_values.localized_text = localize({ type = "name_text", set = "Edition", key = "e_holo" })
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
		mod_function = function(card, mod_joker)--Holographic Jokers
 | 
							mod_function = function(card, mod_joker) --Holographic Jokers
 | 
				
			||||||
			return { mult = (card ~= mod_joker and card.edition and card.edition.holo == true) and 
 | 
								return {
 | 
				
			||||||
			mod_joker.ability.extra.mult * JokerDisplay.calculate_joker_triggers(mod_joker) or nil }
 | 
									mult = (card ~= mod_joker and card.edition and card.edition.holo == true)
 | 
				
			||||||
 | 
											and mod_joker.ability.extra.mult * JokerDisplay.calculate_joker_triggers(mod_joker)
 | 
				
			||||||
 | 
										or nil,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	JokerDisplay.Definitions["j_cry_stardust"] = {
 | 
						JokerDisplay.Definitions["j_cry_stardust"] = {
 | 
				
			||||||
| 
						 | 
					@ -1486,20 +1498,27 @@ if JokerDisplay then
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			for _, playing_card in ipairs(G.hand.cards) do --Polychrome cards held in hand
 | 
								for _, playing_card in ipairs(G.hand.cards) do --Polychrome cards held in hand
 | 
				
			||||||
                		if playing_hand or not playing_card.highlighted then
 | 
									if playing_hand or not playing_card.highlighted then
 | 
				
			||||||
                    			if not (playing_card.facing == 'back') and not playing_card.debuff 
 | 
										if
 | 
				
			||||||
					and playing_card.edition and playing_card.edition.polychrome == true then
 | 
											not (playing_card.facing == "back")
 | 
				
			||||||
                        			count = count + JokerDisplay.calculate_card_triggers(playing_card, nil, true)
 | 
											and not playing_card.debuff
 | 
				
			||||||
                    			end
 | 
											and playing_card.edition
 | 
				
			||||||
                		end
 | 
											and playing_card.edition.polychrome == true
 | 
				
			||||||
            		end
 | 
										then
 | 
				
			||||||
 | 
											count = count + JokerDisplay.calculate_card_triggers(playing_card, nil, true)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
			card.joker_display_values.x_mult = card.ability.extra.xmult ^ count
 | 
								card.joker_display_values.x_mult = card.ability.extra.xmult ^ count
 | 
				
			||||||
			card.joker_display_values.localized_text =
 | 
								card.joker_display_values.localized_text =
 | 
				
			||||||
				localize({ type = "name_text", set = "Edition", key = "e_polychrome" })
 | 
									localize({ type = "name_text", set = "Edition", key = "e_polychrome" })
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
		mod_function = function(card, mod_joker) --Polychrome Jokers
 | 
							mod_function = function(card, mod_joker) --Polychrome Jokers
 | 
				
			||||||
			return { x_mult = (card ~= mod_joker and card.edition and card.edition.polychrome == true) and 
 | 
								return {
 | 
				
			||||||
			mod_joker.ability.extra.xmult ^ JokerDisplay.calculate_joker_triggers(mod_joker) or nil }
 | 
									x_mult = (card ~= mod_joker and card.edition and card.edition.polychrome == true)
 | 
				
			||||||
 | 
											and mod_joker.ability.extra.xmult ^ JokerDisplay.calculate_joker_triggers(mod_joker)
 | 
				
			||||||
 | 
										or nil,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	JokerDisplay.Definitions["j_cry_multjoker"] = {
 | 
						JokerDisplay.Definitions["j_cry_multjoker"] = {
 | 
				
			||||||
| 
						 | 
					@ -1544,7 +1563,7 @@ if JokerDisplay then
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		calc_function = function(card)
 | 
							calc_function = function(card)
 | 
				
			||||||
			local bonus = math.max(0, math.floor(0.01 * card.ability.extra.percent * (G.GAME.dollars or 0)))
 | 
								local bonus = math.max(0, math.floor(0.01 * card.ability.extra.percent * (G.GAME.dollars or 0)))
 | 
				
			||||||
			card.joker_display_values.dollars = bonus and bonus > 0 and bonus or 0
 | 
								card.joker_display_values.dollars = bonus and bonus > to_big(0) and bonus or 0
 | 
				
			||||||
			card.joker_display_values.localized_text = "(" .. localize("k_round") .. ")"
 | 
								card.joker_display_values.localized_text = "(" .. localize("k_round") .. ")"
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1819,7 +1838,7 @@ if JokerDisplay then
 | 
				
			||||||
			{ text = "(" },
 | 
								{ text = "(" },
 | 
				
			||||||
			{ ref_table = "card.ability", ref_value = "extra" },
 | 
								{ ref_table = "card.ability", ref_value = "extra" },
 | 
				
			||||||
			{ text = "/4)" },
 | 
								{ text = "/4)" },
 | 
				
			||||||
		}
 | 
							},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	JokerDisplay.Definitions["j_cry_facile"] = {
 | 
						JokerDisplay.Definitions["j_cry_facile"] = {
 | 
				
			||||||
		text = {
 | 
							text = {
 | 
				
			||||||
| 
						 | 
					@ -1849,9 +1868,14 @@ if JokerDisplay then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local hand_tmult_jd = {
 | 
						local hand_tmult_jd = {
 | 
				
			||||||
		text = {
 | 
							text = {
 | 
				
			||||||
                        { text = "+", colour = G.C.MULT },
 | 
								{ text = "+", colour = G.C.MULT },
 | 
				
			||||||
                        { ref_table = "card.joker_display_values", ref_value = "t_mult", colour = G.C.MULT, retrigger_type = "mult" },
 | 
								{
 | 
				
			||||||
                },
 | 
									ref_table = "card.joker_display_values",
 | 
				
			||||||
 | 
									ref_value = "t_mult",
 | 
				
			||||||
 | 
									colour = G.C.MULT,
 | 
				
			||||||
 | 
									retrigger_type = "mult",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		reminder_text = {
 | 
							reminder_text = {
 | 
				
			||||||
			{ text = "(" },
 | 
								{ text = "(" },
 | 
				
			||||||
			{ ref_table = "card.joker_display_values", ref_value = "localized_text", colour = G.C.ORANGE },
 | 
								{ ref_table = "card.joker_display_values", ref_value = "localized_text", colour = G.C.ORANGE },
 | 
				
			||||||
| 
						 | 
					@ -1869,9 +1893,14 @@ if JokerDisplay then
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	local hand_tchips_jd = {
 | 
						local hand_tchips_jd = {
 | 
				
			||||||
		text = {
 | 
							text = {
 | 
				
			||||||
                        { text = "+", colour = G.C.CHIPS },
 | 
								{ text = "+", colour = G.C.CHIPS },
 | 
				
			||||||
                        { ref_table = "card.joker_display_values", ref_value = "t_chips", colour = G.C.CHIPS, retrigger_type = "mult" },
 | 
								{
 | 
				
			||||||
                },
 | 
									ref_table = "card.joker_display_values",
 | 
				
			||||||
 | 
									ref_value = "t_chips",
 | 
				
			||||||
 | 
									colour = G.C.CHIPS,
 | 
				
			||||||
 | 
									retrigger_type = "mult",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		reminder_text = {
 | 
							reminder_text = {
 | 
				
			||||||
			{ text = "(" },
 | 
								{ text = "(" },
 | 
				
			||||||
			{ ref_table = "card.joker_display_values", ref_value = "localized_text", colour = G.C.ORANGE },
 | 
								{ ref_table = "card.joker_display_values", ref_value = "localized_text", colour = G.C.ORANGE },
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,9 @@
 | 
				
			||||||
local timantti = {
 | 
					local timantti = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-Timantti",
 | 
						name = "cry-Timantti",
 | 
				
			||||||
| 
						 | 
					@ -51,6 +56,7 @@ local timantti = {
 | 
				
			||||||
	calculate = function(self, card, context)
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
			G.GAME.used_vouchers.v_observatory
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
 | 
								and context.joker_main
 | 
				
			||||||
			and (
 | 
								and (
 | 
				
			||||||
				context.scoring_name == "High Card"
 | 
									context.scoring_name == "High Card"
 | 
				
			||||||
				or context.scoring_name == "Pair"
 | 
									or context.scoring_name == "Pair"
 | 
				
			||||||
| 
						 | 
					@ -66,6 +72,11 @@ local timantti = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local klubi = {
 | 
					local klubi = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-Klubi",
 | 
						name = "cry-Klubi",
 | 
				
			||||||
| 
						 | 
					@ -118,6 +129,7 @@ local klubi = {
 | 
				
			||||||
	calculate = function(self, card, context)
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
			G.GAME.used_vouchers.v_observatory
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
 | 
								and context.joker_main
 | 
				
			||||||
			and (
 | 
								and (
 | 
				
			||||||
				context.scoring_name == "Three of a Kind"
 | 
									context.scoring_name == "Three of a Kind"
 | 
				
			||||||
				or context.scoring_name == "Straight"
 | 
									or context.scoring_name == "Straight"
 | 
				
			||||||
| 
						 | 
					@ -133,6 +145,11 @@ local klubi = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local sydan = {
 | 
					local sydan = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-Sydan",
 | 
						name = "cry-Sydan",
 | 
				
			||||||
| 
						 | 
					@ -185,6 +202,7 @@ local sydan = {
 | 
				
			||||||
	calculate = function(self, card, context)
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
			G.GAME.used_vouchers.v_observatory
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
 | 
								and context.joker_main
 | 
				
			||||||
			and (
 | 
								and (
 | 
				
			||||||
				context.scoring_name == "Full House"
 | 
									context.scoring_name == "Full House"
 | 
				
			||||||
				or context.scoring_name == "Four of a Kind"
 | 
									or context.scoring_name == "Four of a Kind"
 | 
				
			||||||
| 
						 | 
					@ -200,6 +218,11 @@ local sydan = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local lapio = {
 | 
					local lapio = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-Lapio",
 | 
						name = "cry-Lapio",
 | 
				
			||||||
| 
						 | 
					@ -252,6 +275,7 @@ local lapio = {
 | 
				
			||||||
	calculate = function(self, card, context)
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
			G.GAME.used_vouchers.v_observatory
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
 | 
								and context.joker_main
 | 
				
			||||||
			and (
 | 
								and (
 | 
				
			||||||
				context.scoring_name == "Five of a Kind"
 | 
									context.scoring_name == "Five of a Kind"
 | 
				
			||||||
				or context.scoring_name == "Flush House"
 | 
									or context.scoring_name == "Flush House"
 | 
				
			||||||
| 
						 | 
					@ -267,73 +291,85 @@ local lapio = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local kaikki = {
 | 
					local kaikki = {
 | 
				
			||||||
    object_type = "Consumable",
 | 
						dependencies = {
 | 
				
			||||||
    set = "Planet",
 | 
							items = {
 | 
				
			||||||
    name = "cry-Kaikki",
 | 
								"set_cry_planet",
 | 
				
			||||||
    key = "Kaikki",
 | 
								"set_cry_poker_hand_stuff",
 | 
				
			||||||
    pos = { x = 3, y = 5 },
 | 
							},
 | 
				
			||||||
    config = { hand_types = { "cry_Bulwark", "cry_Clusterfuck", "cry_UltPair" }, softlock = true },
 | 
						},
 | 
				
			||||||
    cost = 4,
 | 
						object_type = "Consumable",
 | 
				
			||||||
    aurinko = true,
 | 
						set = "Planet",
 | 
				
			||||||
    atlas = "atlasnotjokers",
 | 
						name = "cry-Kaikki",
 | 
				
			||||||
    order = 12,
 | 
						key = "Kaikki",
 | 
				
			||||||
    can_use = function(self, card)
 | 
						pos = { x = 3, y = 5 },
 | 
				
			||||||
        return true
 | 
						config = { hand_types = { "cry_Bulwark", "cry_Clusterfuck", "cry_UltPair" }, softlock = true },
 | 
				
			||||||
    end,
 | 
						cost = 4,
 | 
				
			||||||
    loc_vars = function(self, info_queue, center)
 | 
						aurinko = true,
 | 
				
			||||||
        local levelone = G.GAME.hands["cry_Bulwark"].level or 1
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
        local leveltwo = G.GAME.hands["cry_Clusterfuck"].level or 1
 | 
						order = 12,
 | 
				
			||||||
        local levelthree = G.GAME.hands["cry_UltPair"].level or 1
 | 
						can_use = function(self, card)
 | 
				
			||||||
        local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
							return true
 | 
				
			||||||
        local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
 | 
						end,
 | 
				
			||||||
        local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
        if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
 | 
							local levelone = G.GAME.hands["cry_Bulwark"].level or 1
 | 
				
			||||||
            if levelone == 1 then
 | 
							local leveltwo = G.GAME.hands["cry_Clusterfuck"].level or 1
 | 
				
			||||||
                planetcolourone = G.C.UI.TEXT_DARK
 | 
							local levelthree = G.GAME.hands["cry_UltPair"].level or 1
 | 
				
			||||||
            end
 | 
							local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
				
			||||||
            if leveltwo == 1 then
 | 
							local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
 | 
				
			||||||
                planetcolourtwo = G.C.UI.TEXT_DARK
 | 
							local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
 | 
				
			||||||
            end
 | 
							if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
 | 
				
			||||||
            if levelthree == 1 then
 | 
								if levelone == 1 then
 | 
				
			||||||
                planetcolourthree = G.C.UI.TEXT_DARK
 | 
									planetcolourone = G.C.UI.TEXT_DARK
 | 
				
			||||||
            end
 | 
								end
 | 
				
			||||||
        end
 | 
								if leveltwo == 1 then
 | 
				
			||||||
        return {
 | 
									planetcolourtwo = G.C.UI.TEXT_DARK
 | 
				
			||||||
            vars = {
 | 
								end
 | 
				
			||||||
                localize("cry_hand_bulwark"),
 | 
								if levelthree == 1 then
 | 
				
			||||||
                localize("cry_hand_clusterfuck"),
 | 
									planetcolourthree = G.C.UI.TEXT_DARK
 | 
				
			||||||
                localize("cry_hand_ultpair"),
 | 
								end
 | 
				
			||||||
                G.GAME.hands["cry_Bulwark"].level,
 | 
							end
 | 
				
			||||||
                G.GAME.hands["cry_Clusterfuck"].level,
 | 
							return {
 | 
				
			||||||
                G.GAME.hands["cry_UltPair"].level,
 | 
								vars = {
 | 
				
			||||||
                colours = { planetcolourone, planetcolourtwo, planetcolourthree },
 | 
									localize("cry_Bulwark", "poker_hands"),
 | 
				
			||||||
            },
 | 
									localize("cry_Clusterfuck", "poker_hands"),
 | 
				
			||||||
        }
 | 
									localize("cry_UltPair", "poker_hands"),
 | 
				
			||||||
    end,
 | 
									G.GAME.hands["cry_Bulwark"].level,
 | 
				
			||||||
    use = function(self, card, area, copier)
 | 
									G.GAME.hands["cry_Clusterfuck"].level,
 | 
				
			||||||
        suit_level_up(self, card, area, copier)
 | 
									G.GAME.hands["cry_UltPair"].level,
 | 
				
			||||||
    end,
 | 
									colours = { planetcolourone, planetcolourtwo, planetcolourthree },
 | 
				
			||||||
    bulk_use = function(self, card, area, copier, number)
 | 
								},
 | 
				
			||||||
        suit_level_up(self, card, area, copier, number)
 | 
							}
 | 
				
			||||||
    end,
 | 
						end,
 | 
				
			||||||
    calculate = function(self, card, context)
 | 
						use = function(self, card, area, copier)
 | 
				
			||||||
        if
 | 
							suit_level_up(self, card, area, copier)
 | 
				
			||||||
            G.GAME.used_vouchers.v_observatory
 | 
						end,
 | 
				
			||||||
            and (
 | 
						bulk_use = function(self, card, area, copier, number)
 | 
				
			||||||
                context.scoring_name == "cry_Bulwark"
 | 
							suit_level_up(self, card, area, copier, number)
 | 
				
			||||||
                or context.scoring_name == "cry_Clusterfuck"
 | 
						end,
 | 
				
			||||||
                or context.scoring_name == "cry_UltPair"
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
            )
 | 
							if
 | 
				
			||||||
        then
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
            local value = G.P_CENTERS.v_observatory.config.extra
 | 
								and context.joker_main
 | 
				
			||||||
            return {
 | 
								and (
 | 
				
			||||||
                message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
 | 
									context.scoring_name == "cry_Bulwark"
 | 
				
			||||||
                Xmult_mod = value,
 | 
									or context.scoring_name == "cry_Clusterfuck"
 | 
				
			||||||
            }
 | 
									or context.scoring_name == "cry_UltPair"
 | 
				
			||||||
        end
 | 
								)
 | 
				
			||||||
    end,
 | 
							then
 | 
				
			||||||
 | 
								local value = G.P_CENTERS.v_observatory.config.extra
 | 
				
			||||||
 | 
								return {
 | 
				
			||||||
 | 
									message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
 | 
				
			||||||
 | 
									Xmult_mod = value,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local planetlua = {
 | 
					local planetlua = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-planetlua",
 | 
						name = "cry-planetlua",
 | 
				
			||||||
| 
						 | 
					@ -345,14 +381,23 @@ local planetlua = {
 | 
				
			||||||
	atlas = "atlasnotjokers",
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
	order = 1,
 | 
						order = 1,
 | 
				
			||||||
	loc_vars = function(self, info_queue, card)
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
		return { vars = { card and cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) or 1, card and card.ability.extra.odds or self.config.extra.odds} }
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									card and cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) or 1,
 | 
				
			||||||
 | 
									card and card.ability.extra.odds or self.config.extra.odds,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	can_use = function(self, card)
 | 
						can_use = function(self, card)
 | 
				
			||||||
		return true
 | 
							return true
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	use = function(self, card, area, copier)
 | 
						use = function(self, card, area, copier)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
		if pseudorandom("planetlua") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then --Code "borrowed" from black hole
 | 
							if
 | 
				
			||||||
 | 
								pseudorandom("planetlua")
 | 
				
			||||||
 | 
								< cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged)
 | 
				
			||||||
 | 
									/ card.ability.extra.odds
 | 
				
			||||||
 | 
							then --Code "borrowed" from black hole
 | 
				
			||||||
			update_hand_text(
 | 
								update_hand_text(
 | 
				
			||||||
				{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
									{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
				
			||||||
				{ handname = localize("k_all_hands"), chips = "...", mult = "...", level = "" }
 | 
									{ handname = localize("k_all_hands"), chips = "...", mult = "...", level = "" }
 | 
				
			||||||
| 
						 | 
					@ -448,54 +493,59 @@ local planetlua = {
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
		local quota = 0
 | 
							local quota = 0
 | 
				
			||||||
		if card.ability.cry_rigged then
 | 
							if card.ability.cry_rigged then
 | 
				
			||||||
				update_hand_text(
 | 
								update_hand_text(
 | 
				
			||||||
					{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
									{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
				
			||||||
					{ handname = localize("k_all_hands"), chips = "...", mult = "...", level = "" }
 | 
									{ handname = localize("k_all_hands"), chips = "...", mult = "...", level = "" }
 | 
				
			||||||
				)
 | 
								)
 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
								G.E_MANAGER:add_event(Event({
 | 
				
			||||||
					trigger = "after",
 | 
									trigger = "after",
 | 
				
			||||||
					delay = 0.2,
 | 
									delay = 0.2,
 | 
				
			||||||
					func = function()
 | 
									func = function()
 | 
				
			||||||
						play_sound("tarot1")
 | 
										play_sound("tarot1")
 | 
				
			||||||
						used_consumable:juice_up(0.8, 0.5)
 | 
										used_consumable:juice_up(0.8, 0.5)
 | 
				
			||||||
						G.TAROT_INTERRUPT_PULSE = true
 | 
										G.TAROT_INTERRUPT_PULSE = true
 | 
				
			||||||
						return true
 | 
										return true
 | 
				
			||||||
					end,
 | 
									end,
 | 
				
			||||||
				}))
 | 
								}))
 | 
				
			||||||
				update_hand_text({ delay = 0 }, { mult = "+", StatusText = true })
 | 
								update_hand_text({ delay = 0 }, { mult = "+", StatusText = true })
 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
								G.E_MANAGER:add_event(Event({
 | 
				
			||||||
					trigger = "after",
 | 
									trigger = "after",
 | 
				
			||||||
					delay = 0.9,
 | 
									delay = 0.9,
 | 
				
			||||||
					func = function()
 | 
									func = function()
 | 
				
			||||||
						play_sound("tarot1")
 | 
										play_sound("tarot1")
 | 
				
			||||||
						used_consumable:juice_up(0.8, 0.5)
 | 
										used_consumable:juice_up(0.8, 0.5)
 | 
				
			||||||
						return true
 | 
										return true
 | 
				
			||||||
					end,
 | 
									end,
 | 
				
			||||||
				}))
 | 
								}))
 | 
				
			||||||
				update_hand_text({ delay = 0 }, { chips = "+", StatusText = true })
 | 
								update_hand_text({ delay = 0 }, { chips = "+", StatusText = true })
 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
								G.E_MANAGER:add_event(Event({
 | 
				
			||||||
					trigger = "after",
 | 
									trigger = "after",
 | 
				
			||||||
					delay = 0.9,
 | 
									delay = 0.9,
 | 
				
			||||||
					func = function()
 | 
									func = function()
 | 
				
			||||||
						play_sound("tarot1")
 | 
										play_sound("tarot1")
 | 
				
			||||||
						used_consumable:juice_up(0.8, 0.5)
 | 
										used_consumable:juice_up(0.8, 0.5)
 | 
				
			||||||
						G.TAROT_INTERRUPT_PULSE = nil
 | 
										G.TAROT_INTERRUPT_PULSE = nil
 | 
				
			||||||
						return true
 | 
										return true
 | 
				
			||||||
					end,
 | 
									end,
 | 
				
			||||||
				}))
 | 
								}))
 | 
				
			||||||
				update_hand_text({ sound = "button", volume = 0.7, pitch = 0.9, delay = 0 }, { level = "+" .. number })
 | 
								update_hand_text({ sound = "button", volume = 0.7, pitch = 0.9, delay = 0 }, { level = "+" .. number })
 | 
				
			||||||
				delay(1.3)
 | 
								delay(1.3)
 | 
				
			||||||
				for k, v in pairs(G.GAME.hands) do
 | 
								for k, v in pairs(G.GAME.hands) do
 | 
				
			||||||
					level_up_hand(card, k, true, number)
 | 
									level_up_hand(card, k, true, number)
 | 
				
			||||||
				end
 | 
								end
 | 
				
			||||||
				update_hand_text(
 | 
								update_hand_text(
 | 
				
			||||||
					{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
									{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
				
			||||||
					{ mult = 0, chips = 0, handname = "", level = "" }
 | 
									{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
				)
 | 
								)
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			for i = 1, number do
 | 
								for i = 1, number do
 | 
				
			||||||
				quota = quota
 | 
									quota = quota
 | 
				
			||||||
					+ (pseudorandom("planetlua") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds and 1 or 0)
 | 
										+ (
 | 
				
			||||||
 | 
											pseudorandom("planetlua")
 | 
				
			||||||
 | 
													< cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds
 | 
				
			||||||
 | 
												and 1
 | 
				
			||||||
 | 
											or 0
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			if quota > 0 then
 | 
								if quota > 0 then
 | 
				
			||||||
				update_hand_text(
 | 
									update_hand_text(
 | 
				
			||||||
| 
						 | 
					@ -593,7 +643,12 @@ local planetlua = {
 | 
				
			||||||
	calculate = function(self, card, context) --Observatory effect: (G.GAME.probabilities.normal) in (odds) chance for (G.P_CENTERS.v_observatory.config.extra) Mult
 | 
						calculate = function(self, card, context) --Observatory effect: (G.GAME.probabilities.normal) in (odds) chance for (G.P_CENTERS.v_observatory.config.extra) Mult
 | 
				
			||||||
		if
 | 
							if
 | 
				
			||||||
			G.GAME.used_vouchers.v_observatory
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
			and (pseudorandom("nstar") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds)
 | 
								and context.joker_main
 | 
				
			||||||
 | 
								and (
 | 
				
			||||||
 | 
									pseudorandom("nstar")
 | 
				
			||||||
 | 
									< cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged)
 | 
				
			||||||
 | 
										/ card.ability.extra.odds
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
		then
 | 
							then
 | 
				
			||||||
			local value = G.P_CENTERS.v_observatory.config.extra
 | 
								local value = G.P_CENTERS.v_observatory.config.extra
 | 
				
			||||||
			return {
 | 
								return {
 | 
				
			||||||
| 
						 | 
					@ -604,6 +659,11 @@ local planetlua = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local nstar = {
 | 
					local nstar = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-nstar",
 | 
						name = "cry-nstar",
 | 
				
			||||||
| 
						 | 
					@ -630,15 +690,12 @@ local nstar = {
 | 
				
			||||||
		--Add +1 to amount of neutron stars used this run
 | 
							--Add +1 to amount of neutron stars used this run
 | 
				
			||||||
		G.GAME.neutronstarsusedinthisrun = G.GAME.neutronstarsusedinthisrun + 1
 | 
							G.GAME.neutronstarsusedinthisrun = G.GAME.neutronstarsusedinthisrun + 1
 | 
				
			||||||
		local neutronhand = neutronstarrandomhand() --Random poker hand
 | 
							local neutronhand = neutronstarrandomhand() --Random poker hand
 | 
				
			||||||
		update_hand_text(
 | 
							update_hand_text({ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, {
 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
								handname = localize(neutronhand, "poker_hands"),
 | 
				
			||||||
			{
 | 
								chips = G.GAME.hands[neutronhand].chips,
 | 
				
			||||||
				handname = localize(neutronhand, "poker_hands"),
 | 
								mult = G.GAME.hands[neutronhand].mult,
 | 
				
			||||||
				chips = G.GAME.hands[neutronhand].chips,
 | 
								level = G.GAME.hands[neutronhand].level,
 | 
				
			||||||
				mult = G.GAME.hands[neutronhand].mult,
 | 
							})
 | 
				
			||||||
				level = G.GAME.hands[neutronhand].level,
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
		--level up once for each neutron star used this run
 | 
							--level up once for each neutron star used this run
 | 
				
			||||||
		level_up_hand(used_consumable, neutronhand, nil, G.GAME.neutronstarsusedinthisrun)
 | 
							level_up_hand(used_consumable, neutronhand, nil, G.GAME.neutronstarsusedinthisrun)
 | 
				
			||||||
		update_hand_text(
 | 
							update_hand_text(
 | 
				
			||||||
| 
						 | 
					@ -658,15 +715,12 @@ local nstar = {
 | 
				
			||||||
			handstolv[neutronhand] = (handstolv[neutronhand] or 0) + G.GAME.neutronstarsusedinthisrun
 | 
								handstolv[neutronhand] = (handstolv[neutronhand] or 0) + G.GAME.neutronstarsusedinthisrun
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		for k, v in pairs(handstolv) do
 | 
							for k, v in pairs(handstolv) do
 | 
				
			||||||
			update_hand_text(
 | 
								update_hand_text({ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, {
 | 
				
			||||||
				{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
									handname = localize(k, "poker_hands"),
 | 
				
			||||||
				{
 | 
									chips = G.GAME.hands[k].chips,
 | 
				
			||||||
					handname = localize(k, "poker_hands"),
 | 
									mult = G.GAME.hands[k].mult,
 | 
				
			||||||
					chips = G.GAME.hands[k].chips,
 | 
									level = G.GAME.hands[k].level,
 | 
				
			||||||
					mult = G.GAME.hands[k].mult,
 | 
								})
 | 
				
			||||||
					level = G.GAME.hands[k].level,
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			)
 | 
					 | 
				
			||||||
			card_eval_status_text(
 | 
								card_eval_status_text(
 | 
				
			||||||
				used_consumable,
 | 
									used_consumable,
 | 
				
			||||||
				"extra",
 | 
									"extra",
 | 
				
			||||||
| 
						 | 
					@ -681,18 +735,16 @@ local nstar = {
 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
								{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
				
			||||||
			{ mult = 0, chips = 0, handname = "", level = "" }
 | 
								{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
		)
 | 
							)
 | 
				
			||||||
		G.E_MANAGER:add_event(
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
			Event({
 | 
								trigger = "after",
 | 
				
			||||||
				trigger = "after",
 | 
								func = function()
 | 
				
			||||||
				func = function()
 | 
									handstolv = nil
 | 
				
			||||||
					handstolv = nil
 | 
									return true
 | 
				
			||||||
					return true
 | 
								end,
 | 
				
			||||||
				end,
 | 
							}))
 | 
				
			||||||
			})
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	calculate = function(self, card, context) --Observatory effect: X0.1 mult for each neutron star used this run
 | 
						calculate = function(self, card, context) --Observatory effect: X0.1 mult for each neutron star used this run
 | 
				
			||||||
		if G.GAME.used_vouchers.v_observatory and G.GAME.neutronstarsusedinthisrun ~= nil then
 | 
							if G.GAME.used_vouchers.v_observatory and G.GAME.neutronstarsusedinthisrun ~= nil and context.joker_main then
 | 
				
			||||||
			return {
 | 
								return {
 | 
				
			||||||
				message = localize({
 | 
									message = localize({
 | 
				
			||||||
					type = "variable",
 | 
										type = "variable",
 | 
				
			||||||
| 
						 | 
					@ -703,8 +755,41 @@ local nstar = {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
 | 
						init = function(self)
 | 
				
			||||||
 | 
							function neutronstarrandomhand(ignore, seed, allowhidden)
 | 
				
			||||||
 | 
								--From JenLib's get_random_hand
 | 
				
			||||||
 | 
								local chosen_hand
 | 
				
			||||||
 | 
								ignore = ignore or {}
 | 
				
			||||||
 | 
								seed = seed or "randomhand"
 | 
				
			||||||
 | 
								if type(ignore) ~= "table" then
 | 
				
			||||||
 | 
									ignore = { ignore }
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								while true do
 | 
				
			||||||
 | 
									chosen_hand = pseudorandom_element(G.handlist, pseudoseed(seed))
 | 
				
			||||||
 | 
									if G.GAME.hands[chosen_hand].visible or allowhidden then
 | 
				
			||||||
 | 
										local safe = true
 | 
				
			||||||
 | 
										for _, v in pairs(ignore) do
 | 
				
			||||||
 | 
											if v == chosen_hand then
 | 
				
			||||||
 | 
												safe = false
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if safe then
 | 
				
			||||||
 | 
											break
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								return chosen_hand
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local sunplanet = {
 | 
					local sunplanet = {
 | 
				
			||||||
 | 
						--TODO: disable ascendant hands if this is disabled
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_planet",
 | 
				
			||||||
 | 
								"set_cry_poker_hand_stuff",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
	set = "Planet",
 | 
						set = "Planet",
 | 
				
			||||||
	name = "cry-sunplanet",
 | 
						name = "cry-sunplanet",
 | 
				
			||||||
| 
						 | 
					@ -722,81 +807,107 @@ local sunplanet = {
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	use = function(self, card, area, copier)
 | 
						use = function(self, card, area, copier)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
		local sunlevel = (G.GAME.sunnumber and G.GAME.sunnumber or 0)+1
 | 
							local sunlevel = (G.GAME.sunnumber and G.GAME.sunnumber or 0) + 1
 | 
				
			||||||
		delay(0.4)
 | 
							delay(0.4)
 | 
				
			||||||
		update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=localize('cry_asc_hands'),chips = '...', mult = '...', level=sunlevel})
 | 
							update_hand_text(
 | 
				
			||||||
 | 
								{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
				
			||||||
 | 
								{ handname = localize("cry_asc_hands"), chips = "...", mult = "...", level = sunlevel }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
		delay(1.0)
 | 
							delay(1.0)
 | 
				
			||||||
		G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2, func = function()
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
			play_sound('tarot1')
 | 
								trigger = "after",
 | 
				
			||||||
                	ease_colour(G.C.UI_CHIPS, copy_table(G.C.GOLD), 0.1)
 | 
								delay = 0.2,
 | 
				
			||||||
                	ease_colour(G.C.UI_MULT, copy_table(G.C.GOLD), 0.1)
 | 
								func = function()
 | 
				
			||||||
			cry_pulse_flame(0.01, sunlevel)
 | 
									play_sound("tarot1")
 | 
				
			||||||
			used_consumable:juice_up(0.8, 0.5)
 | 
									ease_colour(G.C.UI_CHIPS, copy_table(G.C.GOLD), 0.1)
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
									ease_colour(G.C.UI_MULT, copy_table(G.C.GOLD), 0.1)
 | 
				
			||||||
				trigger = 'after',
 | 
									cry_pulse_flame(0.01, sunlevel)
 | 
				
			||||||
				blockable = false,
 | 
									used_consumable:juice_up(0.8, 0.5)
 | 
				
			||||||
				blocking = false,
 | 
									G.E_MANAGER:add_event(Event({
 | 
				
			||||||
				delay =  1.2,
 | 
										trigger = "after",
 | 
				
			||||||
				func = (function() 
 | 
										blockable = false,
 | 
				
			||||||
					ease_colour(G.C.UI_CHIPS, G.C.BLUE, 1)
 | 
										blocking = false,
 | 
				
			||||||
					ease_colour(G.C.UI_MULT, G.C.RED, 1)
 | 
										delay = 1.2,
 | 
				
			||||||
 | 
										func = function()
 | 
				
			||||||
 | 
											ease_colour(G.C.UI_CHIPS, G.C.BLUE, 1)
 | 
				
			||||||
 | 
											ease_colour(G.C.UI_MULT, G.C.RED, 1)
 | 
				
			||||||
 | 
											return true
 | 
				
			||||||
 | 
										end,
 | 
				
			||||||
 | 
									}))
 | 
				
			||||||
				return true
 | 
									return true
 | 
				
			||||||
			end)
 | 
								end,
 | 
				
			||||||
			}))
 | 
							}))
 | 
				
			||||||
		return true end }))
 | 
							update_hand_text({ sound = "button", volume = 0.7, pitch = 0.9, delay = 0 }, { level = sunlevel + 1 })
 | 
				
			||||||
        	update_hand_text({sound = 'button', volume = 0.7, pitch = 0.9, delay = 0}, {level=sunlevel+1})
 | 
							delay(2.6)
 | 
				
			||||||
        	delay(2.6)
 | 
					 | 
				
			||||||
		G.GAME.sunnumber = G.GAME.sunnumber ~= nil and G.GAME.sunnumber + 1 or 1
 | 
							G.GAME.sunnumber = G.GAME.sunnumber ~= nil and G.GAME.sunnumber + 1 or 1
 | 
				
			||||||
        	update_hand_text({sound = 'button', volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
 | 
							update_hand_text(
 | 
				
			||||||
 | 
								{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
				
			||||||
 | 
								{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	bulk_use = function(self, card, area, copier, number)
 | 
						bulk_use = function(self, card, area, copier, number)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
		local sunlevel = (G.GAME.sunnumber and G.GAME.sunnumber or 0)+1
 | 
							local sunlevel = (G.GAME.sunnumber and G.GAME.sunnumber or 0) + 1
 | 
				
			||||||
		delay(0.4)
 | 
							delay(0.4)
 | 
				
			||||||
		update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {handname=localize('cry_asc_hands'),chips = '...', mult = '...', level=sunlevel})
 | 
							update_hand_text(
 | 
				
			||||||
 | 
								{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
				
			||||||
 | 
								{ handname = localize("cry_asc_hands"), chips = "...", mult = "...", level = sunlevel }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
		delay(1.0)
 | 
							delay(1.0)
 | 
				
			||||||
		G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2, func = function()
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
			play_sound('tarot1')
 | 
								trigger = "after",
 | 
				
			||||||
                	ease_colour(G.C.UI_CHIPS, copy_table(G.C.GOLD), 0.1)
 | 
								delay = 0.2,
 | 
				
			||||||
                	ease_colour(G.C.UI_MULT, copy_table(G.C.GOLD), 0.1)
 | 
								func = function()
 | 
				
			||||||
			cry_pulse_flame(0.01, (sunlevel-1)+number)
 | 
									play_sound("tarot1")
 | 
				
			||||||
			used_consumable:juice_up(0.8, 0.5)
 | 
									ease_colour(G.C.UI_CHIPS, copy_table(G.C.GOLD), 0.1)
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
									ease_colour(G.C.UI_MULT, copy_table(G.C.GOLD), 0.1)
 | 
				
			||||||
				trigger = 'after',
 | 
									cry_pulse_flame(0.01, (sunlevel - 1) + number)
 | 
				
			||||||
				blockable = false,
 | 
									used_consumable:juice_up(0.8, 0.5)
 | 
				
			||||||
				blocking = false,
 | 
									G.E_MANAGER:add_event(Event({
 | 
				
			||||||
				delay =  1.2,
 | 
										trigger = "after",
 | 
				
			||||||
				func = (function() 
 | 
										blockable = false,
 | 
				
			||||||
					ease_colour(G.C.UI_CHIPS, G.C.BLUE, 1)
 | 
										blocking = false,
 | 
				
			||||||
					ease_colour(G.C.UI_MULT, G.C.RED, 1)
 | 
										delay = 1.2,
 | 
				
			||||||
 | 
										func = function()
 | 
				
			||||||
 | 
											ease_colour(G.C.UI_CHIPS, G.C.BLUE, 1)
 | 
				
			||||||
 | 
											ease_colour(G.C.UI_MULT, G.C.RED, 1)
 | 
				
			||||||
 | 
											return true
 | 
				
			||||||
 | 
										end,
 | 
				
			||||||
 | 
									}))
 | 
				
			||||||
				return true
 | 
									return true
 | 
				
			||||||
			end)
 | 
								end,
 | 
				
			||||||
			}))
 | 
							}))
 | 
				
			||||||
		return true end }))
 | 
							update_hand_text({ sound = "button", volume = 0.7, pitch = 0.9, delay = 0 }, { level = sunlevel + number })
 | 
				
			||||||
        	update_hand_text({sound = 'button', volume = 0.7, pitch = 0.9, delay = 0}, {level=sunlevel+number})
 | 
							delay(2.6)
 | 
				
			||||||
        	delay(2.6)
 | 
					 | 
				
			||||||
		G.GAME.sunnumber = G.GAME.sunnumber ~= nil and G.GAME.sunnumber + number or number
 | 
							G.GAME.sunnumber = G.GAME.sunnumber ~= nil and G.GAME.sunnumber + number or number
 | 
				
			||||||
        	update_hand_text({sound = 'button', volume = 0.7, pitch = 1.1, delay = 0}, {mult = 0, chips = 0, handname = '', level = ''})
 | 
							update_hand_text(
 | 
				
			||||||
 | 
								{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
				
			||||||
 | 
								{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	calculate = function(self, card, context) --Observatory effect: X1.5 mult if hand is an ascended hand
 | 
						calculate = function(self, card, context) --Observatory effect: X1.5 mult if hand is an ascended hand
 | 
				
			||||||
		if G.GAME.used_vouchers.v_observatory and G.GAME.current_round.current_hand.cry_asc_num ~= 0 then
 | 
							if
 | 
				
			||||||
 | 
								G.GAME.used_vouchers.v_observatory
 | 
				
			||||||
 | 
								and G.GAME.current_round.current_hand.cry_asc_num ~= 0
 | 
				
			||||||
 | 
								and context.joker_main
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
			local value = G.P_CENTERS.v_observatory.config.extra
 | 
								local value = G.P_CENTERS.v_observatory.config.extra
 | 
				
			||||||
            		return {
 | 
								return {
 | 
				
			||||||
                		message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
 | 
									message = localize({ type = "variable", key = "a_xmult", vars = { value } }),
 | 
				
			||||||
                		Xmult_mod = value,
 | 
									Xmult_mod = value,
 | 
				
			||||||
            		}
 | 
								}
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	loc_vars = function(self, info_queue, center)
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
		local levelone = (G.GAME.sunnumber and G.GAME.sunnumber or 0)+1
 | 
							local levelone = (G.GAME.sunnumber and G.GAME.sunnumber or 0) + 1
 | 
				
			||||||
		local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
							local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
				
			||||||
		if levelone == 1 then
 | 
							if levelone == 1 then
 | 
				
			||||||
			planetcolourone = G.C.UI.TEXT_DARK
 | 
								planetcolourone = G.C.UI.TEXT_DARK
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			vars = {
 | 
								vars = {
 | 
				
			||||||
				(G.GAME.sunnumber and G.GAME.sunnumber or 0)+1,
 | 
									(G.GAME.sunnumber and G.GAME.sunnumber or 0) + 1,
 | 
				
			||||||
				((G.GAME.sunnumber and G.GAME.sunnumber or 0)/20) + 1.25,
 | 
									((G.GAME.sunnumber and G.GAME.sunnumber or 0) / 20) + 1.25,
 | 
				
			||||||
				colours = { planetcolourone },
 | 
									colours = { planetcolourone },
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -808,18 +919,158 @@ local sunplanet = {
 | 
				
			||||||
		return false
 | 
							return false
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					local abelt = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_poker_hand_stuff",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						set = "Planet",
 | 
				
			||||||
 | 
						key = "asteroidbelt",
 | 
				
			||||||
 | 
						config = { hand_type = "cry_Bulwark", softlock = true },
 | 
				
			||||||
 | 
						pos = { x = 1, y = 5 },
 | 
				
			||||||
 | 
						order = 2,
 | 
				
			||||||
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
 | 
						aurinko = true,
 | 
				
			||||||
 | 
						set_card_type_badge = function(self, card, badges)
 | 
				
			||||||
 | 
							badges[1] = create_badge(localize("k_planet_disc"), get_type_colour(self or card.config, card), nil, 1.2)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local levelone = G.GAME.hands["cry_Bulwark"].level or 1
 | 
				
			||||||
 | 
							local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
				
			||||||
 | 
							if levelone == 1 then
 | 
				
			||||||
 | 
								planetcolourone = G.C.UI.TEXT_DARK
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									localize("cry_hand_bulwark"),
 | 
				
			||||||
 | 
									G.GAME.hands["cry_Bulwark"].level,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_Bulwark"].l_mult,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_Bulwark"].l_chips,
 | 
				
			||||||
 | 
									colours = { planetcolourone },
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						generate_ui = 0,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local void = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_poker_hand_stuff",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						set = "Planet",
 | 
				
			||||||
 | 
						key = "void",
 | 
				
			||||||
 | 
						order = 3,
 | 
				
			||||||
 | 
						config = { hand_type = "cry_Clusterfuck", softlock = true },
 | 
				
			||||||
 | 
						pos = { x = 0, y = 5 },
 | 
				
			||||||
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
 | 
						aurinko = true,
 | 
				
			||||||
 | 
						set_card_type_badge = function(self, card, badges)
 | 
				
			||||||
 | 
							badges[1] = create_badge("", get_type_colour(self or card.config, card), nil, 1.2)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local levelone = G.GAME.hands["cry_Clusterfuck"].level or 1
 | 
				
			||||||
 | 
							local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
				
			||||||
 | 
							if levelone == 1 then
 | 
				
			||||||
 | 
								planetcolourone = G.C.UI.TEXT_DARK
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									localize("cry_Clusterfuck"),
 | 
				
			||||||
 | 
									G.GAME.hands["cry_Clusterfuck"].level,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_Clusterfuck"].l_mult,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_Clusterfuck"].l_chips,
 | 
				
			||||||
 | 
									colours = { planetcolourone },
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						generate_ui = 0,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local marsmoons = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_poker_hand_stuff",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						set = "Planet",
 | 
				
			||||||
 | 
						key = "marsmoons",
 | 
				
			||||||
 | 
						order = 4,
 | 
				
			||||||
 | 
						config = { hand_type = "cry_UltPair", softlock = true },
 | 
				
			||||||
 | 
						pos = { x = 2, y = 5 },
 | 
				
			||||||
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
 | 
						aurinko = true,
 | 
				
			||||||
 | 
						set_card_type_badge = function(self, card, badges)
 | 
				
			||||||
 | 
							badges[1] = create_badge(localize("k_planet_satellite"), get_type_colour(self or card.config, card), nil, 1.2)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local levelone = G.GAME.hands["cry_UltPair"].level or 1
 | 
				
			||||||
 | 
							local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
				
			||||||
 | 
							if levelone == 1 then
 | 
				
			||||||
 | 
								planetcolourone = G.C.UI.TEXT_DARK
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									localize("cry_UltPair"),
 | 
				
			||||||
 | 
									G.GAME.hands["cry_UltPair"].level,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_UltPair"].l_mult,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_UltPair"].l_chips,
 | 
				
			||||||
 | 
									colours = { planetcolourone },
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						generate_ui = 0,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local universe = {
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_poker_hand_stuff",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						set = "Planet",
 | 
				
			||||||
 | 
						key = "universe",
 | 
				
			||||||
 | 
						config = { hand_type = "cry_WholeDeck", softlock = true },
 | 
				
			||||||
 | 
						pos = { x = 4, y = 5 },
 | 
				
			||||||
 | 
						order = 5,
 | 
				
			||||||
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
 | 
						aurinko = true,
 | 
				
			||||||
 | 
						set_card_type_badge = function(self, card, badges)
 | 
				
			||||||
 | 
							badges[1] = create_badge(localize("k_planet_universe"), get_type_colour(self or card.config, card), nil, 1.2)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local levelone = G.GAME.hands["cry_WholeDeck"].level or 1
 | 
				
			||||||
 | 
							local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
 | 
				
			||||||
 | 
							if levelone == 1 then
 | 
				
			||||||
 | 
								planetcolourone = G.C.UI.TEXT_DARK
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									localize("cry_UltPair"),
 | 
				
			||||||
 | 
									G.GAME.hands["cry_WholeDeck"].level,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_WholeDeck"].l_mult,
 | 
				
			||||||
 | 
									G.GAME.hands["cry_WholeDeck"].l_chips,
 | 
				
			||||||
 | 
									colours = { planetcolourone },
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						generate_ui = 0,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
function suit_level_up(center, card, area, copier, number)
 | 
					function suit_level_up(center, card, area, copier, number)
 | 
				
			||||||
	local used_consumable = copier or card
 | 
						local used_consumable = copier or card
 | 
				
			||||||
 | 
						if not number then
 | 
				
			||||||
 | 
							number = 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
	for _, v in pairs(card.config.center.config.hand_types) do
 | 
						for _, v in pairs(card.config.center.config.hand_types) do
 | 
				
			||||||
		update_hand_text(
 | 
							update_hand_text({ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, {
 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
								handname = localize(v, "poker_hands"),
 | 
				
			||||||
			{
 | 
								chips = G.GAME.hands[v].chips,
 | 
				
			||||||
				handname = localize(v, "poker_hands"),
 | 
								mult = G.GAME.hands[v].mult,
 | 
				
			||||||
				chips = G.GAME.hands[v].chips,
 | 
								level = G.GAME.hands[v].level,
 | 
				
			||||||
				mult = G.GAME.hands[v].mult,
 | 
							})
 | 
				
			||||||
				level = G.GAME.hands[v].level,
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
		level_up_hand(used_consumable, v, nil, number)
 | 
							level_up_hand(used_consumable, v, nil, number)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
	update_hand_text(
 | 
						update_hand_text(
 | 
				
			||||||
| 
						 | 
					@ -827,34 +1078,6 @@ function suit_level_up(center, card, area, copier, number)
 | 
				
			||||||
		{ mult = 0, chips = 0, handname = "", level = "" }
 | 
							{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
function neutronstarrandomhand(ignore, seed, allowhidden)
 | 
					local planet_cards =
 | 
				
			||||||
	--From JenLib's get_random_hand
 | 
						{ planetlua, nstar, timantti, klubi, sydan, lapio, sunplanet, kaikki, abelt, void, marsmoons, universe }
 | 
				
			||||||
	local chosen_hand
 | 
					 | 
				
			||||||
	ignore = ignore or {}
 | 
					 | 
				
			||||||
	seed = seed or "randomhand"
 | 
					 | 
				
			||||||
	if type(ignore) ~= "table" then
 | 
					 | 
				
			||||||
		ignore = { ignore }
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	while true do
 | 
					 | 
				
			||||||
		chosen_hand = pseudorandom_element(G.handlist, pseudoseed(seed))
 | 
					 | 
				
			||||||
		if G.GAME.hands[chosen_hand].visible or allowhidden then
 | 
					 | 
				
			||||||
			local safe = true
 | 
					 | 
				
			||||||
			for _, v in pairs(ignore) do
 | 
					 | 
				
			||||||
				if v == chosen_hand then
 | 
					 | 
				
			||||||
					safe = false
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if safe then
 | 
					 | 
				
			||||||
				break
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return chosen_hand
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
local planet_cards = { planetlua, nstar, timantti, klubi, sydan, lapio, sunplanet }
 | 
					 | 
				
			||||||
if Cryptid.enabled["Misc."] then
 | 
					 | 
				
			||||||
	planet_cards[#planet_cards + 1] = kaikki
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if not (SMODS.Mods["jen"] or {}).can_load then
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
return { name = "Planets", init = function() end, items = planet_cards }
 | 
					return { name = "Planets", init = function() end, items = planet_cards }
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,4 @@
 | 
				
			||||||
if CardSleeves then
 | 
					if CardSleeves then
 | 
				
			||||||
	local atlasSleeves = SMODS.Atlas({
 | 
					 | 
				
			||||||
		object_type = "Atlas",
 | 
					 | 
				
			||||||
		key = "atlasSleeves",
 | 
					 | 
				
			||||||
		path = "atlasSleeves.png",
 | 
					 | 
				
			||||||
		px = 73,
 | 
					 | 
				
			||||||
		py = 95,
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	local encodedsleeve = CardSleeves.Sleeve({
 | 
						local encodedsleeve = CardSleeves.Sleeve({
 | 
				
			||||||
		key = "encoded_sleeve",
 | 
							key = "encoded_sleeve",
 | 
				
			||||||
		name = "Encoded Sleeve",
 | 
							name = "Encoded Sleeve",
 | 
				
			||||||
| 
						 | 
					@ -24,19 +16,25 @@ if CardSleeves then
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
								G.E_MANAGER:add_event(Event({
 | 
				
			||||||
				func = function()
 | 
									func = function()
 | 
				
			||||||
					if G.jokers then
 | 
										if G.jokers then
 | 
				
			||||||
							-- Adding a before spawning becuase jen banned copy_paste
 | 
											-- Adding a before spawning becuase jen banned copy_paste
 | 
				
			||||||
							if G.P_CENTERS["j_cry_CodeJoker"] and (G.GAME.banned_keys and not G.GAME.banned_keys["j_cry_CodeJoker"]) then  
 | 
											if
 | 
				
			||||||
								local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_cry_CodeJoker")
 | 
												G.P_CENTERS["j_cry_CodeJoker"]
 | 
				
			||||||
								card:add_to_deck()
 | 
												and (G.GAME.banned_keys and not G.GAME.banned_keys["j_cry_CodeJoker"])
 | 
				
			||||||
								card:start_materialize()
 | 
											then
 | 
				
			||||||
								G.jokers:emplace(card)
 | 
												local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_cry_CodeJoker")
 | 
				
			||||||
							end
 | 
												card:add_to_deck()
 | 
				
			||||||
							if G.P_CENTERS["j_cry_copypaste"] and (G.GAME.banned_keys and not G.GAME.banned_keys["j_cry_copypaste"]) then
 | 
												card:start_materialize()
 | 
				
			||||||
								local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_cry_copypaste")
 | 
												G.jokers:emplace(card)
 | 
				
			||||||
								card:add_to_deck()
 | 
											end
 | 
				
			||||||
								card:start_materialize()
 | 
											if
 | 
				
			||||||
								G.jokers:emplace(card)
 | 
												G.P_CENTERS["j_cry_copypaste"]
 | 
				
			||||||
							end
 | 
												and (G.GAME.banned_keys and not G.GAME.banned_keys["j_cry_copypaste"])
 | 
				
			||||||
 | 
											then
 | 
				
			||||||
 | 
												local card = create_card("Joker", G.jokers, nil, nil, nil, nil, "j_cry_copypaste")
 | 
				
			||||||
 | 
												card:add_to_deck()
 | 
				
			||||||
 | 
												card:start_materialize()
 | 
				
			||||||
 | 
												G.jokers:emplace(card)
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
						return true
 | 
											return true
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
				end,
 | 
									end,
 | 
				
			||||||
| 
						 | 
					@ -79,9 +77,11 @@ if CardSleeves then
 | 
				
			||||||
		unlocked = true,
 | 
							unlocked = true,
 | 
				
			||||||
		unlock_condition = { deck = "Misprint Deck", stake = 1 },
 | 
							unlock_condition = { deck = "Misprint Deck", stake = 1 },
 | 
				
			||||||
		apply = function(self)
 | 
							apply = function(self)
 | 
				
			||||||
			G.GAME.modifiers.cry_misprint_min = self.config.cry_misprint_min
 | 
								G.GAME.modifiers.cry_misprint_min = (G.GAME.modifiers.cry_misprint_min or 1) * self.config.cry_misprint_min
 | 
				
			||||||
			G.GAME.modifiers.cry_misprint_max = self.config.cry_misprint_max
 | 
								G.GAME.modifiers.cry_misprint_max = (G.GAME.modifiers.cry_misprint_max or 1) * self.config.cry_misprint_max
 | 
				
			||||||
			if self.get_current_deck_key() == "b_cry_antimatter" then G.GAME.modifiers.cry_misprint_min = 1 end
 | 
								if self.get_current_deck_key() == "b_cry_antimatter" then
 | 
				
			||||||
 | 
									G.GAME.modifiers.cry_misprint_min = 1
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -124,6 +124,7 @@ if CardSleeves then
 | 
				
			||||||
		name = "CCD Sleeve",
 | 
							name = "CCD Sleeve",
 | 
				
			||||||
		atlas = "atlasSleeves",
 | 
							atlas = "atlasSleeves",
 | 
				
			||||||
		pos = { x = 6, y = 0 },
 | 
							pos = { x = 6, y = 0 },
 | 
				
			||||||
 | 
							config = { cry_conveyor = true },
 | 
				
			||||||
		unlocked = true,
 | 
							unlocked = true,
 | 
				
			||||||
		unlock_condition = { deck = "CCD Deck", stake = 1 },
 | 
							unlock_condition = { deck = "CCD Deck", stake = 1 },
 | 
				
			||||||
		loc_vars = function(self)
 | 
							loc_vars = function(self)
 | 
				
			||||||
| 
						 | 
					@ -344,20 +345,22 @@ if CardSleeves then
 | 
				
			||||||
			G.GAME.modifiers.cry_forced_draw_amount = self.config.cry_forced_draw_amount
 | 
								G.GAME.modifiers.cry_forced_draw_amount = self.config.cry_forced_draw_amount
 | 
				
			||||||
		end,
 | 
							end,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	local sleeveitems = { atlasSleeves }
 | 
						local sleeveitems = {}
 | 
				
			||||||
	if CardSleeves and Cryptid.enabled["Misc. Decks"] then
 | 
						if CardSleeves then
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = encodedsleeve
 | 
							sleeveitems = {
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = equilibriumsleeve
 | 
								encodedsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = misprintsleeve
 | 
								equilibriumsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = infinitesleeve
 | 
								misprintsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = conveyorsleeve
 | 
								infinitesleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = CCDsleeve
 | 
								conveyorsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = wormholesleeve
 | 
								CCDsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = redeemedsleeve
 | 
								wormholesleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = criticalsleeve
 | 
								redeemedsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = legendarysleeve
 | 
								criticalsleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = spookysleeve
 | 
								legendarysleeve,
 | 
				
			||||||
		sleeveitems[#sleeveitems + 1] = bountifulsleeve
 | 
								spookysleeve,
 | 
				
			||||||
 | 
								bountifulsleeve,
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
return { name = "Sleeves", init = function() end, items = { sleeveitems } }
 | 
					return { name = "Sleeves", init = function() end, items = { sleeveitems } }
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,10 @@
 | 
				
			||||||
local white_hole = {
 | 
					local white_hole = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-White Hole",
 | 
						name = "cry-White Hole",
 | 
				
			||||||
	key = "white_hole",
 | 
						key = "white_hole",
 | 
				
			||||||
| 
						 | 
					@ -9,44 +14,44 @@ local white_hole = {
 | 
				
			||||||
	atlas = "atlasnotjokers",
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
	hidden = true, --default soul_rate of 0.3% in spectral packs is used
 | 
						hidden = true, --default soul_rate of 0.3% in spectral packs is used
 | 
				
			||||||
	soul_set = "Planet",
 | 
						soul_set = "Planet",
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							return { key = Card.get_gameset(card) == "modest" and "c_cry_white_hole" or "c_cry_white_hole2" }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
	can_use = function(self, card)
 | 
						can_use = function(self, card)
 | 
				
			||||||
		return true
 | 
							return true
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	use = function(self, card, area, copier)
 | 
						use = function(self, card, area, copier)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
 | 
							local modest = Card.get_gameset(used_consumable) == "modest"
 | 
				
			||||||
		--Get most played hand type (logic yoinked from Telescope)
 | 
							--Get most played hand type (logic yoinked from Telescope)
 | 
				
			||||||
		local _planet, _hand, _tally = nil, nil, -1
 | 
							local _hand, _tally = nil, -1
 | 
				
			||||||
		for k, v in ipairs(G.handlist) do
 | 
							for k, v in ipairs(G.handlist) do
 | 
				
			||||||
			if G.GAME.hands[v].visible and G.GAME.hands[v].played > _tally then
 | 
								if G.GAME.hands[v].visible and G.GAME.hands[v].played > _tally then
 | 
				
			||||||
				_hand = v
 | 
									_hand = v
 | 
				
			||||||
				_tally = G.GAME.hands[v].played
 | 
									_tally = G.GAME.hands[v].played
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		if _hand then
 | 
							local removed_levels = 0
 | 
				
			||||||
			for k, v in pairs(G.P_CENTER_POOLS.Planet) do
 | 
							for k, v in ipairs(G.handlist) do
 | 
				
			||||||
				if v.config.hand_type == _hand then
 | 
								if to_big(G.GAME.hands[v].level) > to_big(1) then
 | 
				
			||||||
					_planet = v.key
 | 
									local this_removed_levels = G.GAME.hands[v].level - 1
 | 
				
			||||||
 | 
									removed_levels = removed_levels + this_removed_levels
 | 
				
			||||||
 | 
									if v ~= _hand or not modest then
 | 
				
			||||||
 | 
										level_up_hand(used_consumable, v, true, -this_removed_levels)
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		local removed_levels = 0
 | 
							update_hand_text({ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, {
 | 
				
			||||||
		for k, v in ipairs(G.handlist) do
 | 
								handname = localize(_hand, "poker_hands"),
 | 
				
			||||||
			if G.GAME.hands[v].level > 1 then
 | 
								chips = G.GAME.hands[_hand].chips,
 | 
				
			||||||
				local this_removed_levels = G.GAME.hands[v].level - 1
 | 
								mult = G.GAME.hands[_hand].mult,
 | 
				
			||||||
				removed_levels = removed_levels + this_removed_levels
 | 
								level = G.GAME.hands[_hand].level,
 | 
				
			||||||
				level_up_hand(used_consumable, v, true, -this_removed_levels)
 | 
							})
 | 
				
			||||||
			end
 | 
							if modest then
 | 
				
			||||||
 | 
								level_up_hand(used_consumable, _hand, false, 4)
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								level_up_hand(used_consumable, _hand, false, 3 * removed_levels)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		update_hand_text(
 | 
					 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				handname = localize(_hand, "poker_hands"),
 | 
					 | 
				
			||||||
				chips = G.GAME.hands[_hand].chips,
 | 
					 | 
				
			||||||
				mult = G.GAME.hands[_hand].mult,
 | 
					 | 
				
			||||||
				level = G.GAME.hands[_hand].level,
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
		level_up_hand(used_consumable, _hand, false, 3 * removed_levels)
 | 
					 | 
				
			||||||
		update_hand_text(
 | 
							update_hand_text(
 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
								{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
				
			||||||
			{ mult = 0, chips = 0, handname = "", level = "" }
 | 
								{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
| 
						 | 
					@ -58,39 +63,36 @@ local white_hole = {
 | 
				
			||||||
	can_bulk_use = true,
 | 
						can_bulk_use = true,
 | 
				
			||||||
	bulk_use = function(self, card, area, copier, number)
 | 
						bulk_use = function(self, card, area, copier, number)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
 | 
							local modest = Card.get_gameset(used_consumable) == "modest"
 | 
				
			||||||
		--Get most played hand type (logic yoinked from Telescope)
 | 
							--Get most played hand type (logic yoinked from Telescope)
 | 
				
			||||||
		local _planet, _hand, _tally = nil, nil, -1
 | 
							local _hand, _tally = nil, -1
 | 
				
			||||||
		for k, v in ipairs(G.handlist) do
 | 
							for k, v in ipairs(G.handlist) do
 | 
				
			||||||
			if G.GAME.hands[v].visible and G.GAME.hands[v].played > _tally then
 | 
								if G.GAME.hands[v].visible and G.GAME.hands[v].played > _tally then
 | 
				
			||||||
				_hand = v
 | 
									_hand = v
 | 
				
			||||||
				_tally = G.GAME.hands[v].played
 | 
									_tally = G.GAME.hands[v].played
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		if _hand then
 | 
							local removed_levels = 0
 | 
				
			||||||
			for k, v in pairs(G.P_CENTER_POOLS.Planet) do
 | 
							for k, v in ipairs(G.handlist) do
 | 
				
			||||||
				if v.config.hand_type == _hand then
 | 
								if to_big(G.GAME.hands[v].level) > to_big(1) then
 | 
				
			||||||
					_planet = v.key
 | 
									local this_removed_levels = G.GAME.hands[v].level - 1
 | 
				
			||||||
 | 
									removed_levels = removed_levels + this_removed_levels
 | 
				
			||||||
 | 
									if v ~= _hand or not modest then
 | 
				
			||||||
 | 
										level_up_hand(used_consumable, v, true, -this_removed_levels)
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		local removed_levels = 0
 | 
							update_hand_text({ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, {
 | 
				
			||||||
		for k, v in ipairs(G.handlist) do
 | 
								handname = localize(_hand, "poker_hands"),
 | 
				
			||||||
			if G.GAME.hands[v].level > 1 then
 | 
								chips = G.GAME.hands[_hand].chips,
 | 
				
			||||||
				local this_removed_levels = G.GAME.hands[v].level - 1
 | 
								mult = G.GAME.hands[_hand].mult,
 | 
				
			||||||
				removed_levels = removed_levels + this_removed_levels
 | 
								level = G.GAME.hands[_hand].level,
 | 
				
			||||||
				level_up_hand(used_consumable, v, true, -this_removed_levels)
 | 
							})
 | 
				
			||||||
			end
 | 
							if modest then
 | 
				
			||||||
 | 
								level_up_hand(used_consumable, _hand, false, 4 * number)
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								level_up_hand(used_consumable, _hand, false, removed_levels * 3 ^ number)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		update_hand_text(
 | 
					 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 },
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				handname = localize(_hand, "poker_hands"),
 | 
					 | 
				
			||||||
				chips = G.GAME.hands[_hand].chips,
 | 
					 | 
				
			||||||
				mult = G.GAME.hands[_hand].mult,
 | 
					 | 
				
			||||||
				level = G.GAME.hands[_hand].level,
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
		level_up_hand(used_consumable, _hand, false, removed_levels * 3 ^ number)
 | 
					 | 
				
			||||||
		update_hand_text(
 | 
							update_hand_text(
 | 
				
			||||||
			{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
								{ sound = "button", volume = 0.7, pitch = 1.1, delay = 0 },
 | 
				
			||||||
			{ mult = 0, chips = 0, handname = "", level = "" }
 | 
								{ mult = 0, chips = 0, handname = "", level = "" }
 | 
				
			||||||
| 
						 | 
					@ -99,6 +101,11 @@ local white_hole = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local vacuum = {
 | 
					local vacuum = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Vacuum",
 | 
						name = "cry-Vacuum",
 | 
				
			||||||
	key = "vacuum",
 | 
						key = "vacuum",
 | 
				
			||||||
| 
						 | 
					@ -170,6 +177,11 @@ local vacuum = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local hammerspace = {
 | 
					local hammerspace = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Hammerspace",
 | 
						name = "cry-Hammerspace",
 | 
				
			||||||
	key = "hammerspace",
 | 
						key = "hammerspace",
 | 
				
			||||||
| 
						 | 
					@ -225,6 +237,11 @@ local hammerspace = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local lock = {
 | 
					local lock = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Lock",
 | 
						name = "cry-Lock",
 | 
				
			||||||
	key = "lock",
 | 
						key = "lock",
 | 
				
			||||||
| 
						 | 
					@ -272,6 +289,7 @@ local lock = {
 | 
				
			||||||
					CARD:flip()
 | 
										CARD:flip()
 | 
				
			||||||
					CARD.ability.perishable = nil
 | 
										CARD.ability.perishable = nil
 | 
				
			||||||
					CARD.pinned = nil
 | 
										CARD.pinned = nil
 | 
				
			||||||
 | 
										CARD.ability.pinned = nil
 | 
				
			||||||
					CARD:set_rental(nil)
 | 
										CARD:set_rental(nil)
 | 
				
			||||||
					if not CARD.sob then
 | 
										if not CARD.sob then
 | 
				
			||||||
						CARD:set_eternal(nil)
 | 
											CARD:set_eternal(nil)
 | 
				
			||||||
| 
						 | 
					@ -331,6 +349,11 @@ local lock = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local trade = {
 | 
					local trade = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Trade",
 | 
						name = "cry-Trade",
 | 
				
			||||||
	key = "trade",
 | 
						key = "trade",
 | 
				
			||||||
| 
						 | 
					@ -341,18 +364,11 @@ local trade = {
 | 
				
			||||||
	atlas = "atlasnotjokers",
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
	can_use = function(self, card)
 | 
						can_use = function(self, card)
 | 
				
			||||||
		local usable_count = 0
 | 
							local usable_count = 0
 | 
				
			||||||
		for _, v in pairs(G.GAME.used_vouchers) do
 | 
							for _, v in pairs(G.vouchers.cards) do
 | 
				
			||||||
			if v then
 | 
								if not v.ability.eternal then
 | 
				
			||||||
				usable_count = usable_count + 1
 | 
									usable_count = usable_count + 1
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		if G.GAME.voucher_sticker_index and G.GAME.voucher_sticker_index.eternal then
 | 
					 | 
				
			||||||
			for _, v in pairs(G.GAME.voucher_sticker_index.eternal) do
 | 
					 | 
				
			||||||
				if v then
 | 
					 | 
				
			||||||
					usable_count = usable_count - 1
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if usable_count > 0 then
 | 
							if usable_count > 0 then
 | 
				
			||||||
			return true
 | 
								return true
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
| 
						 | 
					@ -362,28 +378,24 @@ local trade = {
 | 
				
			||||||
	use = function(self, card, area, copier)
 | 
						use = function(self, card, area, copier)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
		local usable_vouchers = {}
 | 
							local usable_vouchers = {}
 | 
				
			||||||
		for k, _ in pairs(G.GAME.used_vouchers) do
 | 
							for k, v in ipairs(G.vouchers.cards) do
 | 
				
			||||||
			local can_use = true
 | 
								local can_use = true
 | 
				
			||||||
			for kk, __ in pairs(G.GAME.used_vouchers) do
 | 
								for kk, vv in ipairs(G.vouchers.cards) do
 | 
				
			||||||
				local v = G.P_CENTERS[kk]
 | 
									local center = G.P_CENTERS[vv.config.center.key]
 | 
				
			||||||
				if v.requires then
 | 
									if center.requires then
 | 
				
			||||||
					for _, vv in pairs(v.requires) do
 | 
										for _, vvv in pairs(center.requires) do
 | 
				
			||||||
						if vv == k then
 | 
											if vvv == v.config.center.key then
 | 
				
			||||||
							can_use = false
 | 
												can_use = false
 | 
				
			||||||
							break
 | 
												break
 | 
				
			||||||
						end
 | 
											end
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
				if
 | 
								end
 | 
				
			||||||
					G.GAME.voucher_sticker_index
 | 
								if v.ability.eternal then
 | 
				
			||||||
					and G.GAME.voucher_sticker_index.eternal
 | 
									can_use = false
 | 
				
			||||||
					and G.GAME.voucher_sticker_index.eternal[v.name]
 | 
					 | 
				
			||||||
				then
 | 
					 | 
				
			||||||
					can_use = false
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			if can_use then
 | 
								if can_use then
 | 
				
			||||||
				usable_vouchers[#usable_vouchers + 1] = k
 | 
									usable_vouchers[#usable_vouchers + 1] = v
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		local unredeemed_voucher = pseudorandom_element(usable_vouchers, pseudoseed("cry_trade"))
 | 
							local unredeemed_voucher = pseudorandom_element(usable_vouchers, pseudoseed("cry_trade"))
 | 
				
			||||||
| 
						 | 
					@ -398,36 +410,13 @@ local trade = {
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			area = G.play
 | 
								area = G.play
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		local card = create_card("Voucher", area, nil, nil, nil, nil, unredeemed_voucher)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if G.GAME.voucher_edition_index[card.ability.name] then
 | 
							local card = copy_card(unredeemed_voucher)
 | 
				
			||||||
			local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
 | 
							card.ability.extra = copy_table(unredeemed_voucher.ability.extra)
 | 
				
			||||||
			if edition then
 | 
							if card.facing == "back" then
 | 
				
			||||||
				card:set_edition(edition, true, true)
 | 
								card:flip()
 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
 | 
					 | 
				
			||||||
			card:set_eternal(true)
 | 
					 | 
				
			||||||
			card.ability.eternal = true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
 | 
					 | 
				
			||||||
			card:set_perishable(true)
 | 
					 | 
				
			||||||
			card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
 | 
					 | 
				
			||||||
			card.ability.perishable = true
 | 
					 | 
				
			||||||
			if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
 | 
					 | 
				
			||||||
				card.debuff = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if G.GAME.voucher_sticker_index.rental[card.ability.name] then
 | 
					 | 
				
			||||||
			card:set_rental(true)
 | 
					 | 
				
			||||||
			card.ability.rental = true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
 | 
					 | 
				
			||||||
			card.pinned = true
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if G.GAME.voucher_sticker_index.banana[card.ability.name] then
 | 
					 | 
				
			||||||
			card.ability.banana = true
 | 
					 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		card:start_materialize()
 | 
							card:start_materialize()
 | 
				
			||||||
		area:emplace(card)
 | 
							area:emplace(card)
 | 
				
			||||||
		card.cost = 0
 | 
							card.cost = 0
 | 
				
			||||||
| 
						 | 
					@ -440,6 +429,7 @@ local trade = {
 | 
				
			||||||
			delay = 0,
 | 
								delay = 0,
 | 
				
			||||||
			func = function()
 | 
								func = function()
 | 
				
			||||||
				card:start_dissolve()
 | 
									card:start_dissolve()
 | 
				
			||||||
 | 
									unredeemed_voucher:start_dissolve()
 | 
				
			||||||
				return true
 | 
									return true
 | 
				
			||||||
			end,
 | 
								end,
 | 
				
			||||||
		}))
 | 
							}))
 | 
				
			||||||
| 
						 | 
					@ -482,6 +472,11 @@ local trade = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local analog = {
 | 
					local analog = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Analog",
 | 
						name = "cry-Analog",
 | 
				
			||||||
	key = "analog",
 | 
						key = "analog",
 | 
				
			||||||
| 
						 | 
					@ -537,6 +532,11 @@ local analog = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local summoning = {
 | 
					local summoning = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Summoning",
 | 
						name = "cry-Summoning",
 | 
				
			||||||
	key = "summoning",
 | 
						key = "summoning",
 | 
				
			||||||
| 
						 | 
					@ -544,8 +544,19 @@ local summoning = {
 | 
				
			||||||
	cost = 4,
 | 
						cost = 4,
 | 
				
			||||||
	order = 5,
 | 
						order = 5,
 | 
				
			||||||
	atlas = "atlasnotjokers",
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									cry_card_enabled("set_cry_epic") == true and localize("k_cry_epic") or localize("k_rare"),
 | 
				
			||||||
 | 
									colours = { G.C.RARITY[cry_card_enabled("set_cry_epic") == true and "cry_epic" or 3] },
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
	can_use = function(self, card)
 | 
						can_use = function(self, card)
 | 
				
			||||||
		return #G.jokers.cards > 0
 | 
							return #G.jokers.cards > 0
 | 
				
			||||||
 | 
								and #G.jokers.cards <= G.jokers.config.card_limit
 | 
				
			||||||
 | 
								--Prevent use if slots are full and all jokers are eternal (would exceed limit)
 | 
				
			||||||
 | 
								and #advanced_find_joker(nil, nil, nil, { "eternal" }, true, "j") < G.jokers.config.card_limit
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	use = function(self, card, area, copier)
 | 
						use = function(self, card, area, copier)
 | 
				
			||||||
		local used_consumable = copier or card
 | 
							local used_consumable = copier or card
 | 
				
			||||||
| 
						 | 
					@ -556,6 +567,7 @@ local summoning = {
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		local chosen_joker = pseudorandom_element(G.jokers.cards, pseudoseed("cry_summoning"))
 | 
							local chosen_joker = pseudorandom_element(G.jokers.cards, pseudoseed("cry_summoning"))
 | 
				
			||||||
 | 
							local value = cry_card_enabled("set_cry_epic") == true and "cry_epic" or 0.99
 | 
				
			||||||
		local _first_dissolve = nil
 | 
							local _first_dissolve = nil
 | 
				
			||||||
		G.E_MANAGER:add_event(Event({
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
			trigger = "before",
 | 
								trigger = "before",
 | 
				
			||||||
| 
						 | 
					@ -575,7 +587,7 @@ local summoning = {
 | 
				
			||||||
			delay = 0.4,
 | 
								delay = 0.4,
 | 
				
			||||||
			func = function()
 | 
								func = function()
 | 
				
			||||||
				play_sound("timpani")
 | 
									play_sound("timpani")
 | 
				
			||||||
				local card = create_card("Joker", G.jokers, nil, "cry_epic", nil, nil, nil, "cry_summoning")
 | 
									local card = create_card("Joker", G.jokers, nil, value, nil, nil, nil, "cry_summoning")
 | 
				
			||||||
				card:add_to_deck()
 | 
									card:add_to_deck()
 | 
				
			||||||
				G.jokers:emplace(card)
 | 
									G.jokers:emplace(card)
 | 
				
			||||||
				card:juice_up(0.3, 0.5)
 | 
									card:juice_up(0.3, 0.5)
 | 
				
			||||||
| 
						 | 
					@ -587,6 +599,11 @@ local summoning = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local replica = {
 | 
					local replica = {
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Replica",
 | 
						name = "cry-Replica",
 | 
				
			||||||
	key = "replica",
 | 
						key = "replica",
 | 
				
			||||||
| 
						 | 
					@ -651,11 +668,18 @@ local replica = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local ritual = {
 | 
					local ritual = {
 | 
				
			||||||
	cry_credits = {
 | 
						cry_credits = {
 | 
				
			||||||
		idea = {"Mystic Misclick"},
 | 
							idea = { "Mystic Misclick" },
 | 
				
			||||||
		art = {"spire_winder"},
 | 
							art = { "spire_winder" },
 | 
				
			||||||
		code = {"spire_winder"}
 | 
							code = { "spire_winder" },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
								"e_cry_mosaic",
 | 
				
			||||||
 | 
								"e_cry_astral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Ritual",
 | 
						name = "cry-Ritual",
 | 
				
			||||||
	key = "ritual",
 | 
						key = "ritual",
 | 
				
			||||||
| 
						 | 
					@ -680,7 +704,9 @@ local ritual = {
 | 
				
			||||||
	pos = { x = 5, y = 1 },
 | 
						pos = { x = 5, y = 1 },
 | 
				
			||||||
	can_use = function(self, card)
 | 
						can_use = function(self, card)
 | 
				
			||||||
		--TODO: CCD card compat
 | 
							--TODO: CCD card compat
 | 
				
			||||||
		if #G.hand.highlighted > card.ability.max_highlighted then return false end
 | 
							if #G.hand.highlighted > card.ability.max_highlighted then
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
		for _, v in ipairs(G.hand.highlighted) do
 | 
							for _, v in ipairs(G.hand.highlighted) do
 | 
				
			||||||
			if v.edition then
 | 
								if v.edition then
 | 
				
			||||||
				return false
 | 
									return false
 | 
				
			||||||
| 
						 | 
					@ -693,52 +719,57 @@ local ritual = {
 | 
				
			||||||
		for i = 1, #G.hand.highlighted do
 | 
							for i = 1, #G.hand.highlighted do
 | 
				
			||||||
			local highlighted = G.hand.highlighted[i]
 | 
								local highlighted = G.hand.highlighted[i]
 | 
				
			||||||
			if highlighted ~= card then
 | 
								if highlighted ~= card then
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
									G.E_MANAGER:add_event(Event({
 | 
				
			||||||
				func = function()
 | 
										func = function()
 | 
				
			||||||
					play_sound("tarot1")
 | 
											play_sound("tarot1")
 | 
				
			||||||
					highlighted:juice_up(0.3, 0.5)
 | 
											highlighted:juice_up(0.3, 0.5)
 | 
				
			||||||
					return true
 | 
											return true
 | 
				
			||||||
				end,
 | 
										end,
 | 
				
			||||||
			}))
 | 
									}))
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
									G.E_MANAGER:add_event(Event({
 | 
				
			||||||
				trigger = "after",
 | 
										trigger = "after",
 | 
				
			||||||
				delay = 0.1,
 | 
										delay = 0.1,
 | 
				
			||||||
				func = function()
 | 
										func = function()
 | 
				
			||||||
					if highlighted then
 | 
											if highlighted then
 | 
				
			||||||
						local random_result = pseudorandom(pseudoseed("cry-Ritual"))
 | 
												local random_result = pseudorandom(pseudoseed("cry-Ritual"))
 | 
				
			||||||
						if random_result >= 5 / 6 then
 | 
												if random_result >= 5 / 6 then
 | 
				
			||||||
							highlighted:set_edition({cry_astral = true})
 | 
													highlighted:set_edition({ cry_astral = true })
 | 
				
			||||||
						else
 | 
					 | 
				
			||||||
							if random_result >= 1 / 2 then
 | 
					 | 
				
			||||||
								highlighted:set_edition({cry_mosaic = true})
 | 
					 | 
				
			||||||
							else
 | 
												else
 | 
				
			||||||
								highlighted:set_edition({negative = true})
 | 
													if random_result >= 1 / 2 then
 | 
				
			||||||
 | 
														highlighted:set_edition({ cry_mosaic = true })
 | 
				
			||||||
 | 
													else
 | 
				
			||||||
 | 
														highlighted:set_edition({ negative = true })
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
							end
 | 
												end
 | 
				
			||||||
						end
 | 
											end
 | 
				
			||||||
					end
 | 
											return true
 | 
				
			||||||
					return true
 | 
										end,
 | 
				
			||||||
				end,
 | 
									}))
 | 
				
			||||||
			}))
 | 
									delay(0.5)
 | 
				
			||||||
			delay(0.5)
 | 
									G.E_MANAGER:add_event(Event({
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
										trigger = "after",
 | 
				
			||||||
				trigger = "after",
 | 
										delay = 0.2,
 | 
				
			||||||
				delay = 0.2,
 | 
										func = function()
 | 
				
			||||||
				func = function()
 | 
											G.hand:unhighlight_all()
 | 
				
			||||||
					G.hand:unhighlight_all()
 | 
											return true
 | 
				
			||||||
					return true
 | 
										end,
 | 
				
			||||||
				end,
 | 
									}))
 | 
				
			||||||
			}))
 | 
					 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local adversary = {
 | 
					local adversary = {
 | 
				
			||||||
	cry_credits = {
 | 
						cry_credits = {
 | 
				
			||||||
		idea = {"y_not_tony"},
 | 
							idea = { "y_not_tony" },
 | 
				
			||||||
		art = {"Pyrocreep"},
 | 
							art = { "Pyrocreep" },
 | 
				
			||||||
		code = {"spire_winder"}
 | 
							code = { "spire_winder" },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Adversary",
 | 
						name = "cry-Adversary",
 | 
				
			||||||
	key = "adversary",
 | 
						key = "adversary",
 | 
				
			||||||
| 
						 | 
					@ -789,7 +820,9 @@ local adversary = {
 | 
				
			||||||
				delay = 0.15,
 | 
									delay = 0.15,
 | 
				
			||||||
				func = function()
 | 
									func = function()
 | 
				
			||||||
					CARD:flip()
 | 
										CARD:flip()
 | 
				
			||||||
					if not CARD.edition then CARD:set_edition({negative = true}) end
 | 
										if not CARD.edition then
 | 
				
			||||||
 | 
											CARD:set_edition({ negative = true })
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
					play_sound("card1", percent)
 | 
										play_sound("card1", percent)
 | 
				
			||||||
					CARD:juice_up(0.3, 0.3)
 | 
										CARD:juice_up(0.3, 0.3)
 | 
				
			||||||
					return true
 | 
										return true
 | 
				
			||||||
| 
						 | 
					@ -821,19 +854,24 @@ local adversary = {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local chambered = {
 | 
					local chambered = {
 | 
				
			||||||
	cry_credits = {
 | 
						cry_credits = {
 | 
				
			||||||
		idea = {"y_not_tony"},
 | 
							idea = { "y_not_tony" },
 | 
				
			||||||
		art = {"Pyrocreep"},
 | 
							art = { "Pyrocreep" },
 | 
				
			||||||
		code = {"spire_winder"}
 | 
							code = { "spire_winder" },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-Chambered",
 | 
						name = "cry-Chambered",
 | 
				
			||||||
	key = "chambered",
 | 
						key = "chambered",
 | 
				
			||||||
	pos = { x = 5, y = 0 },
 | 
						pos = { x = 5, y = 0 },
 | 
				
			||||||
	config = { extra = {num_copies = 3}},
 | 
						config = { extra = { num_copies = 3 } },
 | 
				
			||||||
	loc_vars = function(self, info_queue, card)
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
	  info_queue[#info_queue + 1] = { key = "e_negative_consumable", set = "Edition", config = { extra = 1 } }
 | 
							info_queue[#info_queue + 1] = { key = "e_negative_consumable", set = "Edition", config = { extra = 1 } }
 | 
				
			||||||
	  return { vars = { card.ability.extra.num_copies } }
 | 
							return { vars = { card.ability.extra.num_copies } }
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
	cost = 4,
 | 
						cost = 4,
 | 
				
			||||||
	order = 11,
 | 
						order = 11,
 | 
				
			||||||
| 
						 | 
					@ -858,35 +896,48 @@ local chambered = {
 | 
				
			||||||
				table.insert(filteredCons, item)
 | 
									table.insert(filteredCons, item)
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
		target = pseudorandom_element(filteredCons, pseudoseed('chambered'))
 | 
							target = pseudorandom_element(filteredCons, pseudoseed("chambered"))
 | 
				
			||||||
		for i=1,card.ability.extra.num_copies do
 | 
							for i = 1, card.ability.extra.num_copies do
 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
								G.E_MANAGER:add_event(Event({
 | 
				
			||||||
				func = function()
 | 
									func = function()
 | 
				
			||||||
					local card_copy = copy_card(target, nil)
 | 
										local card_copy = copy_card(target, nil)
 | 
				
			||||||
					if Incantation then
 | 
										if Incantation then
 | 
				
			||||||
						card_copy:setQty(1)
 | 
											card_copy:setQty(1)
 | 
				
			||||||
					end
 | 
										end
 | 
				
			||||||
					card_copy:set_edition({negative = true}, true)
 | 
										card_copy:set_edition({ negative = true }, true)
 | 
				
			||||||
					card_copy:add_to_deck()
 | 
										card_copy:add_to_deck()
 | 
				
			||||||
					G.consumeables:emplace(card_copy)
 | 
										G.consumeables:emplace(card_copy)
 | 
				
			||||||
					return true
 | 
										return true
 | 
				
			||||||
				end}))
 | 
									end,
 | 
				
			||||||
			card_eval_status_text(target, 'extra', nil, nil, nil, {message = localize('k_duplicated_ex'), colour = G.C.SECONDARY_SET.Spectral})
 | 
								}))
 | 
				
			||||||
 | 
								card_eval_status_text(
 | 
				
			||||||
 | 
									target,
 | 
				
			||||||
 | 
									"extra",
 | 
				
			||||||
 | 
									nil,
 | 
				
			||||||
 | 
									nil,
 | 
				
			||||||
 | 
									nil,
 | 
				
			||||||
 | 
									{ message = localize("k_duplicated_ex"), colour = G.C.SECONDARY_SET.Spectral }
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end,
 | 
						end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local conduit = {
 | 
					local conduit = {
 | 
				
			||||||
	cry_credits = {
 | 
						cry_credits = {
 | 
				
			||||||
		idea = {"Knockback1 (Oiiman)"},
 | 
							idea = { "Knockback1 (Oiiman)" },
 | 
				
			||||||
		art = {"Knockback1 (Oiiman)"},
 | 
							art = { "Knockback1 (Oiiman)" },
 | 
				
			||||||
		code = {"spire_winder"}
 | 
							code = { "spire_winder" },
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	object_type = "Consumable",
 | 
						object_type = "Consumable",
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"set_cry_spectral",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	set = "Spectral",
 | 
						set = "Spectral",
 | 
				
			||||||
	name = "cry-conduit",
 | 
						name = "cry-conduit",
 | 
				
			||||||
	key = "conduit",
 | 
						key = "conduit",
 | 
				
			||||||
	pos = { x = 6, y = 0 },
 | 
						pos = { x = 6, y = 0 },
 | 
				
			||||||
	config = { },
 | 
						config = {},
 | 
				
			||||||
	cost = 4,
 | 
						cost = 4,
 | 
				
			||||||
	order = 12,
 | 
						order = 12,
 | 
				
			||||||
	atlas = "atlasnotjokers",
 | 
						atlas = "atlasnotjokers",
 | 
				
			||||||
| 
						 | 
					@ -994,293 +1045,10 @@ local spectrals = {
 | 
				
			||||||
	adversary,
 | 
						adversary,
 | 
				
			||||||
	chambered,
 | 
						chambered,
 | 
				
			||||||
	conduit,
 | 
						conduit,
 | 
				
			||||||
 | 
						summoning,
 | 
				
			||||||
 | 
						ritual,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
if Cryptid.enabled["Epic Jokers"] then
 | 
					 | 
				
			||||||
	spectrals[#spectrals + 1] = summoning
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if Cryptid.enabled["Misc."] then
 | 
					 | 
				
			||||||
	spectrals[#spectrals + 1] = ritual
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
return {
 | 
					return {
 | 
				
			||||||
	name = "Spectrals",
 | 
						name = "Spectrals",
 | 
				
			||||||
	init = function()
 | 
					 | 
				
			||||||
		--Trade - undo redeeming vouchers
 | 
					 | 
				
			||||||
		function Card:unredeem()
 | 
					 | 
				
			||||||
			if self.ability.set == "Voucher" then
 | 
					 | 
				
			||||||
				stop_use()
 | 
					 | 
				
			||||||
				if not self.config.center.discovered then
 | 
					 | 
				
			||||||
					discover_card(self.config.center)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				self.states.hover.can = false
 | 
					 | 
				
			||||||
				if G.GAME.used_vouchers[self.config.center_key] then
 | 
					 | 
				
			||||||
					G.GAME.used_vouchers[self.config.center_key] = nil
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				G.GAME.cry_owned_vouchers[self.config.center_key] = nil
 | 
					 | 
				
			||||||
				local top_dynatext = nil
 | 
					 | 
				
			||||||
				local bot_dynatext = nil
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					trigger = "after",
 | 
					 | 
				
			||||||
					delay = 0.4,
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						top_dynatext = DynaText({
 | 
					 | 
				
			||||||
							string = localize({
 | 
					 | 
				
			||||||
								type = "name_text",
 | 
					 | 
				
			||||||
								set = self.config.center.set,
 | 
					 | 
				
			||||||
								key = self.config.center.key,
 | 
					 | 
				
			||||||
							}),
 | 
					 | 
				
			||||||
							colours = { G.C.RED },
 | 
					 | 
				
			||||||
							rotate = 1,
 | 
					 | 
				
			||||||
							shadow = true,
 | 
					 | 
				
			||||||
							bump = true,
 | 
					 | 
				
			||||||
							float = true,
 | 
					 | 
				
			||||||
							scale = 0.9,
 | 
					 | 
				
			||||||
							pop_in = 0.6 / G.SPEEDFACTOR,
 | 
					 | 
				
			||||||
							pop_in_rate = 1.5 * G.SPEEDFACTOR,
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						bot_dynatext = DynaText({
 | 
					 | 
				
			||||||
							string = localize("cry_unredeemed"),
 | 
					 | 
				
			||||||
							colours = { G.C.RED },
 | 
					 | 
				
			||||||
							rotate = 2,
 | 
					 | 
				
			||||||
							shadow = true,
 | 
					 | 
				
			||||||
							bump = true,
 | 
					 | 
				
			||||||
							float = true,
 | 
					 | 
				
			||||||
							scale = 0.9,
 | 
					 | 
				
			||||||
							pop_in = 1.4 / G.SPEEDFACTOR,
 | 
					 | 
				
			||||||
							pop_in_rate = 1.5 * G.SPEEDFACTOR,
 | 
					 | 
				
			||||||
							pitch_shift = 0.25,
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						self:juice_up(0.3, 0.5)
 | 
					 | 
				
			||||||
						play_sound("card1")
 | 
					 | 
				
			||||||
						play_sound("timpani")
 | 
					 | 
				
			||||||
						self.children.top_disp = UIBox({
 | 
					 | 
				
			||||||
							definition = {
 | 
					 | 
				
			||||||
								n = G.UIT.ROOT,
 | 
					 | 
				
			||||||
								config = { align = "tm", r = 0.15, colour = G.C.CLEAR, padding = 0.15 },
 | 
					 | 
				
			||||||
								nodes = {
 | 
					 | 
				
			||||||
									{ n = G.UIT.O, config = { object = top_dynatext } },
 | 
					 | 
				
			||||||
								},
 | 
					 | 
				
			||||||
							},
 | 
					 | 
				
			||||||
							config = { align = "tm", offset = { x = 0, y = 0 }, parent = self },
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						self.children.bot_disp = UIBox({
 | 
					 | 
				
			||||||
							definition = {
 | 
					 | 
				
			||||||
								n = G.UIT.ROOT,
 | 
					 | 
				
			||||||
								config = { align = "tm", r = 0.15, colour = G.C.CLEAR, padding = 0.15 },
 | 
					 | 
				
			||||||
								nodes = {
 | 
					 | 
				
			||||||
									{ n = G.UIT.O, config = { object = bot_dynatext } },
 | 
					 | 
				
			||||||
								},
 | 
					 | 
				
			||||||
							},
 | 
					 | 
				
			||||||
							config = { align = "bm", offset = { x = 0, y = 0 }, parent = self },
 | 
					 | 
				
			||||||
						})
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
				G.GAME.current_round.voucher = nil
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				self:unapply_to_run()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				delay(0.6)
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					trigger = "after",
 | 
					 | 
				
			||||||
					delay = 2.6,
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						top_dynatext:pop_out(4)
 | 
					 | 
				
			||||||
						bot_dynatext:pop_out(4)
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
					trigger = "after",
 | 
					 | 
				
			||||||
					delay = 0.5,
 | 
					 | 
				
			||||||
					func = function()
 | 
					 | 
				
			||||||
						self.children.top_disp:remove()
 | 
					 | 
				
			||||||
						self.children.top_disp = nil
 | 
					 | 
				
			||||||
						self.children.bot_disp:remove()
 | 
					 | 
				
			||||||
						self.children.bot_disp = nil
 | 
					 | 
				
			||||||
						return true
 | 
					 | 
				
			||||||
					end,
 | 
					 | 
				
			||||||
				}))
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		function Card:unapply_to_run(center)
 | 
					 | 
				
			||||||
			local center_table = {
 | 
					 | 
				
			||||||
				name = center and center.name or self and self.ability.name,
 | 
					 | 
				
			||||||
				extra = self and G.GAME.cry_voucher_centers[self.config.center_key].config.extra,
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			local obj = center or self.config.center
 | 
					 | 
				
			||||||
			if obj.unredeem and type(obj.unredeem) == "function" then
 | 
					 | 
				
			||||||
				obj:unredeem(self)
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			local is_debuffed = false
 | 
					 | 
				
			||||||
			if
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.perishable[center_table.name]
 | 
					 | 
				
			||||||
				and G.GAME.voucher_sticker_index.perishable[center_table.name] == 0
 | 
					 | 
				
			||||||
			then
 | 
					 | 
				
			||||||
				is_debuffed = true
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if G.GAME.voucher_sticker_index.eternal[center_table.name] then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.eternal[center_table.name] = nil
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if G.GAME.voucher_sticker_index.perishable[center_table.name] then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.perishable[center_table.name] = nil
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if G.GAME.voucher_sticker_index.rental[center_table.name] then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.rental[center_table.name] = nil
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if G.GAME.voucher_sticker_index.pinned[center_table.name] then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.pinned[center_table.name] = nil
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if G.GAME.voucher_sticker_index.banana[center_table.name] then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.banana[center_table.name] = nil
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			if is_debuffed == false then
 | 
					 | 
				
			||||||
				if center_table.name == "Overstock" or center_table.name == "Overstock Plus" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							change_shop_size(-center_table.extra)
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Tarot Merchant" or center_table.name == "Tarot Tycoon" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.tarot_rate = G.GAME.tarot_rate / center_table.extra
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Planet Merchant" or center_table.name == "Planet Tycoon" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.planet_rate = G.GAME.planet_rate / center_table.extra
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Hone" or center_table.name == "Glow Up" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.edition_rate = G.GAME.edition_rate / center_table.extra
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Magic Trick" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.playing_card_rate = 0
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Crystal Ball" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.consumeables.config.card_limit = G.consumeables.config.card_limit - center_table.extra
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Clearance Sale" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.discount_percent = 0
 | 
					 | 
				
			||||||
							for k, v in pairs(G.I.CARD) do
 | 
					 | 
				
			||||||
								if v.set_cost then
 | 
					 | 
				
			||||||
									v:set_cost()
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Liquidation" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.discount_percent = 25 -- no idea why the below returns nil, so it's hardcoded now
 | 
					 | 
				
			||||||
							-- G.GAME.discount_percent = G.P_CENTERS.v_clearance_sale.extra
 | 
					 | 
				
			||||||
							for k, v in pairs(G.I.CARD) do
 | 
					 | 
				
			||||||
								if v.set_cost then
 | 
					 | 
				
			||||||
									v:set_cost()
 | 
					 | 
				
			||||||
								end
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Reroll Surplus" or center_table.name == "Reroll Glut" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.round_resets.reroll_cost = G.GAME.round_resets.reroll_cost + self.ability.extra
 | 
					 | 
				
			||||||
							G.GAME.current_round.reroll_cost =
 | 
					 | 
				
			||||||
								math.max(0, G.GAME.current_round.reroll_cost + self.ability.extra)
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Seed Money" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							G.GAME.interest_cap = 25 --note: does not account for potential deck effects
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Money Tree" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							if G.GAME.used_vouchers.v_seed_money then
 | 
					 | 
				
			||||||
								G.GAME.interest_cap = 50
 | 
					 | 
				
			||||||
							else
 | 
					 | 
				
			||||||
								G.GAME.interest_cap = 25
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Grabber" or center_table.name == "Nacho Tong" then
 | 
					 | 
				
			||||||
					G.GAME.round_resets.hands = G.GAME.round_resets.hands - center_table.extra
 | 
					 | 
				
			||||||
					ease_hands_played(-center_table.extra)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Paint Brush" or center_table.name == "Palette" then
 | 
					 | 
				
			||||||
					G.hand:change_size(-center_table.extra)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Wasteful" or center_table.name == "Recyclomancy" then
 | 
					 | 
				
			||||||
					G.GAME.round_resets.discards = G.GAME.round_resets.discards - center_table.extra
 | 
					 | 
				
			||||||
					ease_discard(-center_table.extra)
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Antimatter" then
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = function()
 | 
					 | 
				
			||||||
							if G.jokers then
 | 
					 | 
				
			||||||
								G.jokers.config.card_limit = G.jokers.config.card_limit - center_table.extra
 | 
					 | 
				
			||||||
							end
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end,
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if center_table.name == "Hieroglyph" or center_table.name == "Petroglyph" then
 | 
					 | 
				
			||||||
					ease_ante(center_table.extra)
 | 
					 | 
				
			||||||
					G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante
 | 
					 | 
				
			||||||
					G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante + center_table.extra
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					if center_table.name == "Hieroglyph" then
 | 
					 | 
				
			||||||
						G.GAME.round_resets.hands = G.GAME.round_resets.hands + center_table.extra
 | 
					 | 
				
			||||||
						ease_hands_played(center_table.extra)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
					if center_table.name == "Petroglyph" then
 | 
					 | 
				
			||||||
						G.GAME.round_resets.discards = G.GAME.round_resets.discards + center_table.extra
 | 
					 | 
				
			||||||
						ease_discard(center_table.extra)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
	items = spectrals,
 | 
						items = spectrals,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,5 @@
 | 
				
			||||||
 | 
					--These don't use the gameset system currently.
 | 
				
			||||||
 | 
					--Will probably add when there's a way to view stakes in the Collection
 | 
				
			||||||
local pink = {
 | 
					local pink = {
 | 
				
			||||||
	object_type = "Stake",
 | 
						object_type = "Stake",
 | 
				
			||||||
	name = "cry-Pink Stake",
 | 
						name = "cry-Pink Stake",
 | 
				
			||||||
| 
						 | 
					@ -245,26 +247,6 @@ local twilight = {
 | 
				
			||||||
	order = 25,
 | 
						order = 25,
 | 
				
			||||||
	colour = G.C.CRY_TWILIGHT,
 | 
						colour = G.C.CRY_TWILIGHT,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local banana = {
 | 
					 | 
				
			||||||
	object_type = "Sticker",
 | 
					 | 
				
			||||||
	badge_colour = HEX("e8c500"),
 | 
					 | 
				
			||||||
	prefix_config = { key = false },
 | 
					 | 
				
			||||||
	key = "banana",
 | 
					 | 
				
			||||||
	atlas = "sticker",
 | 
					 | 
				
			||||||
	pos = { x = 5, y = 2 },
 | 
					 | 
				
			||||||
	should_apply = false,
 | 
					 | 
				
			||||||
	loc_vars = function(self, info_queue, card)
 | 
					 | 
				
			||||||
		if card.ability.consumeable then
 | 
					 | 
				
			||||||
			return { key = "cry_banana_consumeable", vars = { G.GAME.probabilities.normal or 1, 4 } }
 | 
					 | 
				
			||||||
		elseif card.ability.set == "Voucher" then
 | 
					 | 
				
			||||||
			return { key = "cry_banana_voucher", vars = { G.GAME.probabilities.normal or 1, 12 } }
 | 
					 | 
				
			||||||
		elseif card.ability.set == "Booster" then
 | 
					 | 
				
			||||||
			return { key = "cry_banana_booster" }
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			return { vars = { G.GAME.probabilities.normal or 1, 10 } }
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
local verdant = {
 | 
					local verdant = {
 | 
				
			||||||
	object_type = "Stake",
 | 
						object_type = "Stake",
 | 
				
			||||||
	name = "cry-Verdant Stake",
 | 
						name = "cry-Verdant Stake",
 | 
				
			||||||
| 
						 | 
					@ -363,8 +345,7 @@ local ascendant = {
 | 
				
			||||||
	order = 32,
 | 
						order = 32,
 | 
				
			||||||
	colour = G.C.CRY_ASCENDANT,
 | 
						colour = G.C.CRY_ASCENDANT,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
local stake_atlas = { object_type = "Atlas", key = "stake", 
 | 
					local stake_atlas = { object_type = "Atlas", key = "stake", path = "stake_cry.png", px = 29, py = 29 }
 | 
				
			||||||
path = "stake_cry.png", px = 29, py = 29 }
 | 
					 | 
				
			||||||
return {
 | 
					return {
 | 
				
			||||||
	name = "More Stakes",
 | 
						name = "More Stakes",
 | 
				
			||||||
	init = function(self)
 | 
						init = function(self)
 | 
				
			||||||
| 
						 | 
					@ -454,9 +435,7 @@ return {
 | 
				
			||||||
					end,
 | 
										end,
 | 
				
			||||||
				}))
 | 
									}))
 | 
				
			||||||
				delay(0.3)
 | 
									delay(0.3)
 | 
				
			||||||
				for i = 1, #G.jokers.cards do
 | 
									SMODS.calculate_context({ remove_playing_cards = true, removed = destroyed_cards })
 | 
				
			||||||
					G.jokers.cards[i]:calculate_joker({ remove_playing_cards = true, removed = destroyed_cards })
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end,
 | 
								end,
 | 
				
			||||||
		}, true)
 | 
							}, true)
 | 
				
			||||||
		SMODS.Consumable:take_ownership("familiar", {
 | 
							SMODS.Consumable:take_ownership("familiar", {
 | 
				
			||||||
| 
						 | 
					@ -500,9 +479,7 @@ return {
 | 
				
			||||||
					end,
 | 
										end,
 | 
				
			||||||
				}))
 | 
									}))
 | 
				
			||||||
				delay(0.3)
 | 
									delay(0.3)
 | 
				
			||||||
				for i = 1, #G.jokers.cards do
 | 
									SMODS.calculate_context({ remove_playing_cards = true, removed = destroyed_cards })
 | 
				
			||||||
					G.jokers.cards[i]:calculate_joker({ remove_playing_cards = true, removed = destroyed_cards })
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end,
 | 
								end,
 | 
				
			||||||
		}, true)
 | 
							}, true)
 | 
				
			||||||
		SMODS.Consumable:take_ownership("incantation", {
 | 
							SMODS.Consumable:take_ownership("incantation", {
 | 
				
			||||||
| 
						 | 
					@ -546,9 +523,7 @@ return {
 | 
				
			||||||
					end,
 | 
										end,
 | 
				
			||||||
				}))
 | 
									}))
 | 
				
			||||||
				delay(0.3)
 | 
									delay(0.3)
 | 
				
			||||||
				for i = 1, #G.jokers.cards do
 | 
									SMODS.calculate_context({ remove_playing_cards = true, removed = destroyed_cards })
 | 
				
			||||||
					G.jokers.cards[i]:calculate_joker({ remove_playing_cards = true, removed = destroyed_cards })
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end,
 | 
								end,
 | 
				
			||||||
		}, true)
 | 
							}, true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -602,6 +577,5 @@ return {
 | 
				
			||||||
		blossom,
 | 
							blossom,
 | 
				
			||||||
		azure,
 | 
							azure,
 | 
				
			||||||
		ascendant,
 | 
							ascendant,
 | 
				
			||||||
		banana,
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										193
									
								
								Cryptid/items/test.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,193 @@
 | 
				
			||||||
 | 
					local test = {
 | 
				
			||||||
 | 
						object_type = "Joker",
 | 
				
			||||||
 | 
						key = "test",
 | 
				
			||||||
 | 
						discovered = true,
 | 
				
			||||||
 | 
						gameset_config = {
 | 
				
			||||||
 | 
							modest = {
 | 
				
			||||||
 | 
								extra = { chips = 1 },
 | 
				
			||||||
 | 
								center = { rarity = 1, blueprint_compat = false, immutable = true, no_dbl = false },
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							mainline = { center = { rarity = 2, blueprint_compat = true, immutable = true, no_dbl = true } },
 | 
				
			||||||
 | 
							madness = { extra = { chips = 100 }, center = { rarity = 3 } },
 | 
				
			||||||
 | 
							cryptid_in_2025 = { extra = { chips = 1e308 }, center = { rarity = "cry_exotic" } },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						extra_gamesets = { "cryptid_in_2025" },
 | 
				
			||||||
 | 
						dependencies = {
 | 
				
			||||||
 | 
							items = {
 | 
				
			||||||
 | 
								"j_cry_happy",
 | 
				
			||||||
 | 
								"set_cry_m",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						config = { extra = { chips = 10 } },
 | 
				
			||||||
 | 
						pos = { x = 1, y = 0 },
 | 
				
			||||||
 | 
						rarity = 2,
 | 
				
			||||||
 | 
						order = 11,
 | 
				
			||||||
 | 
						cost = 1,
 | 
				
			||||||
 | 
						blueprint_compat = true,
 | 
				
			||||||
 | 
						atlas = "atlasone",
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							local gameset = Card.get_gameset(center)
 | 
				
			||||||
 | 
							if gameset == "disabled" then
 | 
				
			||||||
 | 
								gameset = "mainline"
 | 
				
			||||||
 | 
							end --still show description
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = { center.ability.extra.chips },
 | 
				
			||||||
 | 
								key = "j_cry_test_" .. gameset,
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
 | 
							local gameset = Card.get_gameset(card)
 | 
				
			||||||
 | 
							if context.cardarea == G.jokers and not context.before and not context.after then
 | 
				
			||||||
 | 
								return {
 | 
				
			||||||
 | 
									message = localize({ type = "variable", key = "a_chips", vars = { card.ability.extra.chips } }),
 | 
				
			||||||
 | 
									chip_mod = card.ability.extra.chips,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							elseif context.first_hand_drawn and gameset ~= "modest" then
 | 
				
			||||||
 | 
								ease_dollars(gameset ~= "mainline" and 44444 or 44)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						cry_credits = {
 | 
				
			||||||
 | 
							idea = {
 | 
				
			||||||
 | 
								"m",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							art = {
 | 
				
			||||||
 | 
								"m",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							code = {
 | 
				
			||||||
 | 
								"Jevonn",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local test2 = {
 | 
				
			||||||
 | 
						object_type = "Joker",
 | 
				
			||||||
 | 
						name = "ABC",
 | 
				
			||||||
 | 
						key = "abc",
 | 
				
			||||||
 | 
						loc_txt = {
 | 
				
			||||||
 | 
							name = "ABC",
 | 
				
			||||||
 | 
							text = {},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						pos = { x = 0, y = 0 },
 | 
				
			||||||
 | 
						cost = 1,
 | 
				
			||||||
 | 
						rarity = 1,
 | 
				
			||||||
 | 
						unlocked = true,
 | 
				
			||||||
 | 
						discovered = false,
 | 
				
			||||||
 | 
						blueprint_compat = true,
 | 
				
			||||||
 | 
						eternal_compat = true,
 | 
				
			||||||
 | 
						perishable_compat = true,
 | 
				
			||||||
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
 | 
							if context.retrigger_joker_check and not context.retrigger_joker then
 | 
				
			||||||
 | 
								if card.T.x + card.T.w / 2 > context.other_card.T.x + context.other_card.T.w / 2 then
 | 
				
			||||||
 | 
									return {
 | 
				
			||||||
 | 
										message = localize("k_again_ex"),
 | 
				
			||||||
 | 
										repetitions = 1,
 | 
				
			||||||
 | 
										card = card,
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							elseif context.other_joker and card ~= context.other_joker then
 | 
				
			||||||
 | 
								if card.T.x + card.T.w / 2 < context.other_joker.T.x + context.other_joker.T.w / 2 then
 | 
				
			||||||
 | 
									if not Talisman.config_file.disable_anims then
 | 
				
			||||||
 | 
										G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
											func = function()
 | 
				
			||||||
 | 
												context.other_joker:juice_up(0.5, 0.5)
 | 
				
			||||||
 | 
												return true
 | 
				
			||||||
 | 
											end,
 | 
				
			||||||
 | 
										}))
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return {
 | 
				
			||||||
 | 
										message = localize({ type = "variable", key = "a_xmult", vars = { 3 } }),
 | 
				
			||||||
 | 
										Xmult_mod = 3,
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local test3 = {
 | 
				
			||||||
 | 
						object_type = "Joker",
 | 
				
			||||||
 | 
						name = "cry-test3",
 | 
				
			||||||
 | 
						key = "test3",
 | 
				
			||||||
 | 
						pos = { x = 2, y = 1 },
 | 
				
			||||||
 | 
						rarity = 1,
 | 
				
			||||||
 | 
						cost = 2,
 | 
				
			||||||
 | 
						discovered = true,
 | 
				
			||||||
 | 
						atlas = "atlastwo",
 | 
				
			||||||
 | 
						loc_txt = {
 | 
				
			||||||
 | 
							name = "Loc var man B)",
 | 
				
			||||||
 | 
							text = {
 | 
				
			||||||
 | 
								"{C:attention}#1#",
 | 
				
			||||||
 | 
								"{C:green}#2#",
 | 
				
			||||||
 | 
								"{C:inactive}#3##4##5#",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							local a, b, c, d, e = cry_get_enchanced_deck_info()
 | 
				
			||||||
 | 
							return { vars = { a, b, c, d, e } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						cry_credits = {
 | 
				
			||||||
 | 
							idea = {
 | 
				
			||||||
 | 
								"Jevonn",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							art = {
 | 
				
			||||||
 | 
								"Jevonn",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							code = {
 | 
				
			||||||
 | 
								"Jevonn",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					local test4 = {
 | 
				
			||||||
 | 
						object_type = "Joker",
 | 
				
			||||||
 | 
						name = "skfjadfjk;ldsjfkerjiopghtwueihvefjhgrwjh",
 | 
				
			||||||
 | 
						key = "weuqyreuiyroiusdafgdbflhfiuowyqoiwufhjklfhioqhfh8393824774893fhjdhfkj",
 | 
				
			||||||
 | 
						pos = { x = 0, y = 0 },
 | 
				
			||||||
 | 
						rarity = 1,
 | 
				
			||||||
 | 
						cost = 404,
 | 
				
			||||||
 | 
						atlas = "atlasone",
 | 
				
			||||||
 | 
						config = { extra = { center = nil } },
 | 
				
			||||||
 | 
						loc_txt = {
 | 
				
			||||||
 | 
							name = "Allmighty Center Checker",
 | 
				
			||||||
 | 
							text = {
 | 
				
			||||||
 | 
								"{C:attention}#1#",
 | 
				
			||||||
 | 
								"{C:green}#2#",
 | 
				
			||||||
 | 
								"{C:inactive}1st joker slot btw",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								vars = {
 | 
				
			||||||
 | 
									(card.ability.blueprint_compat ~= nil and card.ability.blueprint_compat or "uh oh"),
 | 
				
			||||||
 | 
									card.ability.extra.center,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						update = function(self, card, front)
 | 
				
			||||||
 | 
							if G.STAGE == G.STAGES.RUN then
 | 
				
			||||||
 | 
								G.GAME.round_resets.discards = G.GAME.round_resets.discards + 1
 | 
				
			||||||
 | 
								other_joker = G.jokers.cards[1]
 | 
				
			||||||
 | 
								if other_joker then
 | 
				
			||||||
 | 
									if G.GAME.current_round.discards_used % 3 == 0 then
 | 
				
			||||||
 | 
										card.ability.extra.center = "blueprint_compat"
 | 
				
			||||||
 | 
										if other_joker and other_joker ~= card and other_joker.config.center.blueprint_compat then
 | 
				
			||||||
 | 
											card.ability.blueprint_compat = "yes"
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											card.ability.blueprint_compat = "nah"
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									elseif G.GAME.current_round.discards_used % 3 == 1 then
 | 
				
			||||||
 | 
										card.ability.extra.center = "immutable"
 | 
				
			||||||
 | 
										if other_joker and other_joker ~= card and (Card.no(other_joker, "immutable", true)) then
 | 
				
			||||||
 | 
											card.ability.blueprint_compat = "yes"
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											card.ability.blueprint_compat = "nah"
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										card.ability.extra.center = "no_dbl"
 | 
				
			||||||
 | 
										if other_joker and other_joker ~= card and (Card.no(other_joker, "no_dbl", true)) then
 | 
				
			||||||
 | 
											card.ability.blueprint_compat = "yes"
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											card.ability.blueprint_compat = "nah"
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					return { items = { test, test2, test3, test4 }, disabled = true }
 | 
				
			||||||
							
								
								
									
										166
									
								
								Cryptid/lib/ascended.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,166 @@
 | 
				
			||||||
 | 
					-- ascended.lua - Used for Ascended Hands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					G.FUNCS.cry_asc_UI_set = function(e)
 | 
				
			||||||
 | 
						if G.GAME.cry_exploit_override then
 | 
				
			||||||
 | 
							e.config.object.colours = { darken(G.C.SECONDARY_SET.Code, 0.2) }
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							e.config.object.colours = { G.C.GOLD }
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						e.config.object:update_text()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					-- this is a hook to make funny "x of a kind"/"flush x" display text
 | 
				
			||||||
 | 
					local pokerhandinforef = G.FUNCS.get_poker_hand_info
 | 
				
			||||||
 | 
					function G.FUNCS.get_poker_hand_info(_cards)
 | 
				
			||||||
 | 
						local text, loc_disp_text, poker_hands, scoring_hand, disp_text = pokerhandinforef(_cards)
 | 
				
			||||||
 | 
						if G.SETTINGS.language == "en-us" then
 | 
				
			||||||
 | 
							if #scoring_hand > 5 and (text == "Flush Five" or text == "Five of a Kind") then
 | 
				
			||||||
 | 
								local rank_array = {}
 | 
				
			||||||
 | 
								local county = 0
 | 
				
			||||||
 | 
								for i = 1, #scoring_hand do
 | 
				
			||||||
 | 
									local val = scoring_hand[i]:get_id()
 | 
				
			||||||
 | 
									rank_array[val] = (rank_array[val] or 0) + 1
 | 
				
			||||||
 | 
									if rank_array[val] > county then
 | 
				
			||||||
 | 
										county = rank_array[val]
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								local function create_num_chunk(int) -- maybe useful enough to not be local? but tbh this function is probably some common coding exercise
 | 
				
			||||||
 | 
									if int >= 1000 then
 | 
				
			||||||
 | 
										int = 999
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									local ones = {
 | 
				
			||||||
 | 
										["1"] = "One",
 | 
				
			||||||
 | 
										["2"] = "Two",
 | 
				
			||||||
 | 
										["3"] = "Three",
 | 
				
			||||||
 | 
										["4"] = "Four",
 | 
				
			||||||
 | 
										["5"] = "Five",
 | 
				
			||||||
 | 
										["6"] = "Six",
 | 
				
			||||||
 | 
										["7"] = "Seven",
 | 
				
			||||||
 | 
										["8"] = "Eight",
 | 
				
			||||||
 | 
										["9"] = "Nine",
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									local tens = {
 | 
				
			||||||
 | 
										["1"] = "Ten",
 | 
				
			||||||
 | 
										["2"] = "Twenty",
 | 
				
			||||||
 | 
										["3"] = "Thirty",
 | 
				
			||||||
 | 
										["4"] = "Forty",
 | 
				
			||||||
 | 
										["5"] = "Fifty",
 | 
				
			||||||
 | 
										["6"] = "Sixty",
 | 
				
			||||||
 | 
										["7"] = "Seventy",
 | 
				
			||||||
 | 
										["8"] = "Eighty",
 | 
				
			||||||
 | 
										["9"] = "Ninety",
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									local str_int = string.reverse(int .. "") -- ehhhh whatever
 | 
				
			||||||
 | 
									local str_ret = ""
 | 
				
			||||||
 | 
									for i = 1, string.len(str_int) do
 | 
				
			||||||
 | 
										local place = str_int:sub(i, i)
 | 
				
			||||||
 | 
										if place ~= "0" then
 | 
				
			||||||
 | 
											if i == 1 then
 | 
				
			||||||
 | 
												str_ret = ones[place]
 | 
				
			||||||
 | 
											elseif i == 2 then
 | 
				
			||||||
 | 
												if place == "1" and str_ret ~= "" then -- admittedly not my smartest moment, i dug myself into a hole here...
 | 
				
			||||||
 | 
													if str_ret == "One" then
 | 
				
			||||||
 | 
														str_ret = "Eleven"
 | 
				
			||||||
 | 
													elseif str_ret == "Two" then
 | 
				
			||||||
 | 
														str_ret = "Twelve"
 | 
				
			||||||
 | 
													elseif str_ret == "Three" then
 | 
				
			||||||
 | 
														str_ret = "Thirteen"
 | 
				
			||||||
 | 
													elseif str_ret == "Five" then
 | 
				
			||||||
 | 
														str_ret = "Fifteen"
 | 
				
			||||||
 | 
													elseif str_ret == "Eight" then
 | 
				
			||||||
 | 
														str_ret = "Eighteen"
 | 
				
			||||||
 | 
													else
 | 
				
			||||||
 | 
														str_ret = str_ret .. "teen"
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
												else
 | 
				
			||||||
 | 
													str_ret = tens[place] .. ((string.len(str_ret) > 0 and " " or "") .. str_ret)
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											elseif i == 3 then
 | 
				
			||||||
 | 
												str_ret = ones[place]
 | 
				
			||||||
 | 
													.. (" Hundred" .. ((string.len(str_ret) > 0 and " and " or "") .. str_ret))
 | 
				
			||||||
 | 
											end -- this line is wild
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return str_ret
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								-- text gets stupid small at 100+ anyway
 | 
				
			||||||
 | 
								loc_disp_text = (text == "Flush Five" and "Flush " or "")
 | 
				
			||||||
 | 
									.. (
 | 
				
			||||||
 | 
										(county < 1000 and create_num_chunk(county) or "Thousand")
 | 
				
			||||||
 | 
										.. (text == "Five of a Kind" and " of a Kind" or "")
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local hand_table = {
 | 
				
			||||||
 | 
							["High Card"] = G.GAME.used_vouchers.v_cry_hyperspacetether and 1 or nil,
 | 
				
			||||||
 | 
							["Pair"] = G.GAME.used_vouchers.v_cry_hyperspacetether and 2 or nil,
 | 
				
			||||||
 | 
							["Two Pair"] = 4,
 | 
				
			||||||
 | 
							["Three of a Kind"] = G.GAME.used_vouchers.v_cry_hyperspacetether and 3 or nil,
 | 
				
			||||||
 | 
							["Straight"] = next(SMODS.find_card("j_four_fingers")) and cry_get_gameset() ~= "modest" and 4 or 5,
 | 
				
			||||||
 | 
							["Flush"] = next(SMODS.find_card("j_four_fingers")) and cry_get_gameset() ~= "modest" and 4 or 5,
 | 
				
			||||||
 | 
							["Full House"] = 5,
 | 
				
			||||||
 | 
							["Four of a Kind"] = G.GAME.used_vouchers.v_cry_hyperspacetether and 4 or nil,
 | 
				
			||||||
 | 
							["Straight Flush"] = next(SMODS.find_card("j_four_fingers")) and cry_get_gameset() ~= "modest" and 4 or 5, --debatable
 | 
				
			||||||
 | 
							["cry_Bulwark"] = 5,
 | 
				
			||||||
 | 
							["Five of a Kind"] = 5,
 | 
				
			||||||
 | 
							["Flush House"] = 5,
 | 
				
			||||||
 | 
							["Flush Five"] = 5,
 | 
				
			||||||
 | 
							["cry_Clusterfuck"] = 8,
 | 
				
			||||||
 | 
							["cry_UltPair"] = 8,
 | 
				
			||||||
 | 
							["cry_WholeDeck"] = 52,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						-- this is where all the logic for asc hands is. currently it's very simple but if you want more complex logic, here's the place to do it
 | 
				
			||||||
 | 
						if hand_table[text] and cry_card_enabled("set_cry_poker_hand_stuff") == true then
 | 
				
			||||||
 | 
							G.GAME.current_round.current_hand.cry_asc_num = G.GAME.used_vouchers.v_cry_hyperspacetether
 | 
				
			||||||
 | 
									and #_cards - hand_table[text]
 | 
				
			||||||
 | 
								or #scoring_hand - hand_table[text]
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							G.GAME.current_round.current_hand.cry_asc_num = 0
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						G.GAME.current_round.current_hand.cry_asc_num = math.max(0, G.GAME.current_round.current_hand.cry_asc_num)
 | 
				
			||||||
 | 
						if G.GAME.cry_exploit_override then
 | 
				
			||||||
 | 
							G.GAME.current_round.current_hand.cry_asc_num = G.GAME.current_round.current_hand.cry_asc_num + 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						G.GAME.current_round.current_hand.cry_asc_num_text = (
 | 
				
			||||||
 | 
							G.GAME.current_round.current_hand.cry_asc_num and G.GAME.current_round.current_hand.cry_asc_num > 0
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
								and " (+" .. G.GAME.current_round.current_hand.cry_asc_num .. ")"
 | 
				
			||||||
 | 
							or ""
 | 
				
			||||||
 | 
						return text, loc_disp_text, poker_hands, scoring_hand, disp_text
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_ascend(num) -- edit this function at your leisure
 | 
				
			||||||
 | 
						if cry_card_enabled("set_cry_poker_hand_stuff") ~= true then
 | 
				
			||||||
 | 
							return num
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if cry_get_gameset() == "modest" then
 | 
				
			||||||
 | 
							-- x(1.1 + 0.05 per sol) base, each card gives + (0.1 + 0.05 per sol)
 | 
				
			||||||
 | 
							if not G.GAME.current_round.current_hand.cry_asc_num then
 | 
				
			||||||
 | 
								return num
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if G.GAME.current_round.current_hand.cry_asc_num <= 0 then
 | 
				
			||||||
 | 
								return num
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return math.max(
 | 
				
			||||||
 | 
								num,
 | 
				
			||||||
 | 
								num
 | 
				
			||||||
 | 
									* (
 | 
				
			||||||
 | 
										1
 | 
				
			||||||
 | 
										+ 0.1
 | 
				
			||||||
 | 
										+ (0.05 * (G.GAME.sunnumber or 0))
 | 
				
			||||||
 | 
										+ ((0.1 + (0.05 * (G.GAME.sunnumber or 0))) * (G.GAME.current_round.current_hand.cry_asc_num or 0))
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							return math.max(
 | 
				
			||||||
 | 
								num,
 | 
				
			||||||
 | 
								num * ((1.25 + (0.05 * (G.GAME.sunnumber or 0))) ^ G.GAME.current_round.current_hand.cry_asc_num or 0)
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_pulse_flame(duration, intensity) -- duration is in seconds, intensity is in idfk honestly, but it increases pretty quickly
 | 
				
			||||||
 | 
						G.cry_flame_override = G.cry_flame_override or {}
 | 
				
			||||||
 | 
						G.cry_flame_override["duration"] = duration or 0.01
 | 
				
			||||||
 | 
						G.cry_flame_override["intensity"] = intensity or 2
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										907
									
								
								Cryptid/lib/calculate.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,907 @@
 | 
				
			||||||
 | 
					-- calculate.lua: modifications specifically for card calculation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- deal with Rigged and Fragile when scoring a playing card
 | 
				
			||||||
 | 
					local ec = eval_card
 | 
				
			||||||
 | 
					function eval_card(card, context)
 | 
				
			||||||
 | 
						if card.will_shatter then
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						-- Store old probability for later reference
 | 
				
			||||||
 | 
						local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
						if card.ability.cry_rigged then
 | 
				
			||||||
 | 
							G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local ret, post = ec(card, context)
 | 
				
			||||||
 | 
						if card.ability.cry_rigged then
 | 
				
			||||||
 | 
							G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return ret, post
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--some functions to minimize the load on calculate_joker itself
 | 
				
			||||||
 | 
					function Card:cry_copy_ability()
 | 
				
			||||||
 | 
						local orig_ability = {}
 | 
				
			||||||
 | 
						if self.ability then
 | 
				
			||||||
 | 
							for i, j in pairs(self.ability) do
 | 
				
			||||||
 | 
								if (type(j) == "table") and is_number(j) then
 | 
				
			||||||
 | 
									orig_ability[i] = to_big(j)
 | 
				
			||||||
 | 
								elseif type(j) == "table" then
 | 
				
			||||||
 | 
									orig_ability[i] = {}
 | 
				
			||||||
 | 
									for i2, j2 in pairs(j) do
 | 
				
			||||||
 | 
										orig_ability[i][i2] = j2
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									orig_ability[i] = j
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return orig_ability
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					local cj = Card.calculate_joker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Card:cry_double_scale_calc(orig_ability, in_context_scaling)
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							self.ability.name ~= "cry-happyhouse"
 | 
				
			||||||
 | 
							and self.ability.name ~= "Acrobat"
 | 
				
			||||||
 | 
							and self.ability.name ~= "cry-sapling"
 | 
				
			||||||
 | 
							and self.ability.name ~= "cry-mstack"
 | 
				
			||||||
 | 
							and self.ability.name ~= "cry-notebook"
 | 
				
			||||||
 | 
							and self.ability.name ~= "Invisible Joker"
 | 
				
			||||||
 | 
							and self.ability.name ~= "cry-Old Invisible Joker"
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							local jkr = self
 | 
				
			||||||
 | 
							if jkr.ability and type(jkr.ability) == "table" then
 | 
				
			||||||
 | 
								if not G.GAME.cry_double_scale[jkr.sort_id] or not G.GAME.cry_double_scale[jkr.sort_id].ability then
 | 
				
			||||||
 | 
									if not G.GAME.cry_double_scale[jkr.sort_id] then
 | 
				
			||||||
 | 
										G.GAME.cry_double_scale[jkr.sort_id] = { ability = { double_scale = true } }
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									for k, v in pairs(jkr.ability) do
 | 
				
			||||||
 | 
										if type(jkr.ability[k]) ~= "table" then
 | 
				
			||||||
 | 
											G.GAME.cry_double_scale[jkr.sort_id].ability[k] = v
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											G.GAME.cry_double_scale[jkr.sort_id].ability[k] = {}
 | 
				
			||||||
 | 
											for _k, _v in pairs(jkr.ability[k]) do
 | 
				
			||||||
 | 
												G.GAME.cry_double_scale[jkr.sort_id].ability[k][_k] = _v
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if G.GAME.cry_double_scale[jkr.sort_id] and not G.GAME.cry_double_scale[jkr.sort_id].scaler then
 | 
				
			||||||
 | 
									local dbl_info = G.GAME.cry_double_scale[jkr.sort_id]
 | 
				
			||||||
 | 
									if jkr.ability.name == "cry-Number Blocks" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra", "money" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "money_mod" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra.money_mod
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "cry-Exponentia" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra", "Emult" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "Emult_mod" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra.Emult_mod
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "cry-Redeo" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra", "money_req" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "money_mod" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra.money_mod
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "cry-Chili Pepper" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra", "Xmult" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "Xmult_mod" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra.Xmult_mod
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "cry-Scalae" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra", "shadow_scale" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "shadow_scale_mod" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra.scale_mod
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "cry-mprime" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra", "mult" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "bonus" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra.bonus
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "Yorick" then
 | 
				
			||||||
 | 
										dbl_info.base = { "x_mult" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra", "xmult" } --not kidding
 | 
				
			||||||
 | 
										dbl_info.scaler_base = 1
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "Hologram" then
 | 
				
			||||||
 | 
										dbl_info.base = { "x_mult" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "Gift Card" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra_value" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "Throwback" then
 | 
				
			||||||
 | 
										dbl_info.base = { "x_mult" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.x_mult or 1
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if jkr.ability.name == "Egg" then
 | 
				
			||||||
 | 
										dbl_info.base = { "extra_value" }
 | 
				
			||||||
 | 
										dbl_info.scaler = { "extra" }
 | 
				
			||||||
 | 
										dbl_info.scaler_base = jkr.ability.extra
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									local default_modifiers = {
 | 
				
			||||||
 | 
										mult = 0,
 | 
				
			||||||
 | 
										h_mult = 0,
 | 
				
			||||||
 | 
										h_x_mult = 0,
 | 
				
			||||||
 | 
										h_dollars = 0,
 | 
				
			||||||
 | 
										p_dollars = 0,
 | 
				
			||||||
 | 
										t_mult = 0,
 | 
				
			||||||
 | 
										t_chips = 0,
 | 
				
			||||||
 | 
										x_mult = 1,
 | 
				
			||||||
 | 
										h_size = 0,
 | 
				
			||||||
 | 
										d_size = 0,
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									for k, v in pairs(jkr.ability) do
 | 
				
			||||||
 | 
										--extra_value is ignored because it can be scaled by Gift Card
 | 
				
			||||||
 | 
										if
 | 
				
			||||||
 | 
											k ~= "extra_value"
 | 
				
			||||||
 | 
											and dbl_info.ability[k] ~= v
 | 
				
			||||||
 | 
											and is_number(v)
 | 
				
			||||||
 | 
											and is_number(dbl_info.ability[k])
 | 
				
			||||||
 | 
										then
 | 
				
			||||||
 | 
											dbl_info.base = { k }
 | 
				
			||||||
 | 
											local predicted_mod = math.abs(to_number(to_big(v)) - to_number(to_big(dbl_info.ability[k])))
 | 
				
			||||||
 | 
											local best_key = { "" }
 | 
				
			||||||
 | 
											local best_coeff = 10 ^ 100
 | 
				
			||||||
 | 
											for l, u in pairs(jkr.ability) do
 | 
				
			||||||
 | 
												if not (default_modifiers[l] and default_modifiers[l] == u) then
 | 
				
			||||||
 | 
													if l ~= k and is_number(u) then
 | 
				
			||||||
 | 
														if
 | 
				
			||||||
 | 
															to_number(to_big(predicted_mod / u)) >= 0.999
 | 
				
			||||||
 | 
															and to_number(to_big(predicted_mod / u)) < to_number(to_big(best_coeff))
 | 
				
			||||||
 | 
														then
 | 
				
			||||||
 | 
															best_coeff = to_number(to_big(predicted_mod / u))
 | 
				
			||||||
 | 
															best_key = { l }
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
													if type(jkr.ability[l]) == "table" then
 | 
				
			||||||
 | 
														for _l, _u in pairs(jkr.ability[l]) do
 | 
				
			||||||
 | 
															if
 | 
				
			||||||
 | 
																is_number(_u)
 | 
				
			||||||
 | 
																and to_number(to_big(predicted_mod / _u)) >= 0.999
 | 
				
			||||||
 | 
																and to_number(to_big(predicted_mod / _u))
 | 
				
			||||||
 | 
																	< to_number(to_big(best_coeff))
 | 
				
			||||||
 | 
															then
 | 
				
			||||||
 | 
																best_coeff = to_number(to_big(predicted_mod / _u))
 | 
				
			||||||
 | 
																best_key = { l, _l }
 | 
				
			||||||
 | 
															end
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											dbl_info.scaler = best_key
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if
 | 
				
			||||||
 | 
											type(jkr.ability[k]) == "table"
 | 
				
			||||||
 | 
											and type(dbl_info.ability) == "table"
 | 
				
			||||||
 | 
											and type(dbl_info.ability[k]) == "table"
 | 
				
			||||||
 | 
										then
 | 
				
			||||||
 | 
											for _k, _v in pairs(jkr.ability[k]) do
 | 
				
			||||||
 | 
												if
 | 
				
			||||||
 | 
													dbl_info.ability[k][_k] ~= _v
 | 
				
			||||||
 | 
													and is_number(_v)
 | 
				
			||||||
 | 
													and is_number(dbl_info.ability[k][_k])
 | 
				
			||||||
 | 
												then
 | 
				
			||||||
 | 
													dbl_info.base = { k, _k }
 | 
				
			||||||
 | 
													local predicted_mod = math.abs(_v - dbl_info.ability[k][_k])
 | 
				
			||||||
 | 
													local best_key = { "" }
 | 
				
			||||||
 | 
													local best_coeff = 10 ^ 100
 | 
				
			||||||
 | 
													for l, u in pairs(jkr.ability) do
 | 
				
			||||||
 | 
														if is_number(u) and to_number(to_big(predicted_mod / u)) >= 0.999 then
 | 
				
			||||||
 | 
															if to_number(to_big(predicted_mod / u)) < to_number(to_big(best_coeff)) then
 | 
				
			||||||
 | 
																best_coeff = to_number(to_big(predicted_mod / u))
 | 
				
			||||||
 | 
																best_key = { l }
 | 
				
			||||||
 | 
															end
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
														if type(jkr.ability[l]) == "table" then
 | 
				
			||||||
 | 
															for _l, _u in pairs(jkr.ability[l]) do
 | 
				
			||||||
 | 
																if
 | 
				
			||||||
 | 
																	(l ~= k or _l ~= _k)
 | 
				
			||||||
 | 
																	and is_number(_u)
 | 
				
			||||||
 | 
																	and to_number(to_big(predicted_mod / _u)) >= 0.999
 | 
				
			||||||
 | 
																then
 | 
				
			||||||
 | 
																	if
 | 
				
			||||||
 | 
																		to_number(to_big(predicted_mod / _u))
 | 
				
			||||||
 | 
																		< to_number(to_big(best_coeff))
 | 
				
			||||||
 | 
																	then
 | 
				
			||||||
 | 
																		best_coeff = to_number(to_big(predicted_mod / _u))
 | 
				
			||||||
 | 
																		best_key = { l, _l }
 | 
				
			||||||
 | 
																	end
 | 
				
			||||||
 | 
																end
 | 
				
			||||||
 | 
															end
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
													dbl_info.scaler = best_key
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if dbl_info.scaler then
 | 
				
			||||||
 | 
										dbl_info.scaler_base = #dbl_info.scaler == 2
 | 
				
			||||||
 | 
												and orig_ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
											or orig_ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
										dbl_info.offset = 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local orig_scale_base = nil
 | 
				
			||||||
 | 
						local orig_scale_scale = nil
 | 
				
			||||||
 | 
						if G.GAME.cry_double_scale[self.sort_id] and G.GAME.cry_double_scale[self.sort_id].scaler then
 | 
				
			||||||
 | 
							local jkr = self
 | 
				
			||||||
 | 
							local dbl_info = G.GAME.cry_double_scale[self.sort_id]
 | 
				
			||||||
 | 
							if #dbl_info.base == 2 then
 | 
				
			||||||
 | 
								if
 | 
				
			||||||
 | 
									not (
 | 
				
			||||||
 | 
										type(jkr.ability) ~= "table"
 | 
				
			||||||
 | 
										or not orig_ability[dbl_info.base[1]]
 | 
				
			||||||
 | 
										or type(orig_ability[dbl_info.base[1]]) ~= "table"
 | 
				
			||||||
 | 
										or not orig_ability[dbl_info.base[1]][dbl_info.base[2]]
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								then
 | 
				
			||||||
 | 
									orig_scale_base = orig_ability[dbl_info.base[1]][dbl_info.base[2]]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								if jkr.ability[dbl_info.base[1]] then
 | 
				
			||||||
 | 
									orig_scale_base = orig_ability[dbl_info.base[1]]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
								if
 | 
				
			||||||
 | 
									not (not orig_ability[dbl_info.scaler[1]] or not orig_ability[dbl_info.scaler[1]][dbl_info.scaler[2]])
 | 
				
			||||||
 | 
								then
 | 
				
			||||||
 | 
									orig_scale_scale = orig_ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								if orig_ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
									orig_scale_scale = orig_ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if orig_scale_base and orig_scale_scale then
 | 
				
			||||||
 | 
							local new_scale_base = nil
 | 
				
			||||||
 | 
							local true_base = nil
 | 
				
			||||||
 | 
							local jkr = self
 | 
				
			||||||
 | 
							local dbl_info = G.GAME.cry_double_scale[self.sort_id]
 | 
				
			||||||
 | 
							if #dbl_info.base == 2 then
 | 
				
			||||||
 | 
								if
 | 
				
			||||||
 | 
									not (
 | 
				
			||||||
 | 
										type(jkr.ability) ~= "table"
 | 
				
			||||||
 | 
										or not jkr.ability[dbl_info.base[1]]
 | 
				
			||||||
 | 
										or type(jkr.ability[dbl_info.base[1]]) ~= "table"
 | 
				
			||||||
 | 
										or not jkr.ability[dbl_info.base[1]][dbl_info.base[2]]
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								then
 | 
				
			||||||
 | 
									new_scale_base = jkr.ability[dbl_info.base[1]][dbl_info.base[2]]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								if jkr.ability[dbl_info.base[1]] then
 | 
				
			||||||
 | 
									new_scale_base = jkr.ability[dbl_info.base[1]]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							true_base = dbl_info.scaler_base
 | 
				
			||||||
 | 
							if
 | 
				
			||||||
 | 
								new_scale_base and ((to_big(math.abs(new_scale_base - orig_scale_base)) > to_big(0)) or in_context_scaling)
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								for i = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
									local obj = G.jokers.cards[i].config.center
 | 
				
			||||||
 | 
									if obj.cry_scale_mod and type(obj.cry_scale_mod) == "function" then
 | 
				
			||||||
 | 
										local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
										if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
											G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										local o = obj:cry_scale_mod(
 | 
				
			||||||
 | 
											G.jokers.cards[i],
 | 
				
			||||||
 | 
											jkr,
 | 
				
			||||||
 | 
											orig_scale_scale,
 | 
				
			||||||
 | 
											true_base,
 | 
				
			||||||
 | 
											orig_scale_base,
 | 
				
			||||||
 | 
											new_scale_base
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
 | 
										if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
											G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if o then
 | 
				
			||||||
 | 
											if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
												if
 | 
				
			||||||
 | 
													not (
 | 
				
			||||||
 | 
														not jkr.ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
														or not jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
													)
 | 
				
			||||||
 | 
												then
 | 
				
			||||||
 | 
													jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]] = o
 | 
				
			||||||
 | 
													orig_scale_scale = o
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											else
 | 
				
			||||||
 | 
												if jkr.ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
													jkr.ability[dbl_info.scaler[1]] = o
 | 
				
			||||||
 | 
													orig_scale_scale = o
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											card_eval_status_text(
 | 
				
			||||||
 | 
												G.jokers.cards[i],
 | 
				
			||||||
 | 
												"extra",
 | 
				
			||||||
 | 
												nil,
 | 
				
			||||||
 | 
												nil,
 | 
				
			||||||
 | 
												nil,
 | 
				
			||||||
 | 
												{ message = localize("k_upgrade_ex") }
 | 
				
			||||||
 | 
											)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										local reps = {}
 | 
				
			||||||
 | 
										for i2 = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
											local _card = G.jokers.cards[i2]
 | 
				
			||||||
 | 
											local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
											if _card.ability.cry_rigged then
 | 
				
			||||||
 | 
												G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											local check =
 | 
				
			||||||
 | 
												cj(G.jokers.cards[i2], { retrigger_joker_check = true, other_card = G.jokers.cards[i] })
 | 
				
			||||||
 | 
											if _card.ability.cry_rigged then
 | 
				
			||||||
 | 
												G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											if type(check) == "table" then
 | 
				
			||||||
 | 
												reps[i2] = check and check.repetitions and check or 0
 | 
				
			||||||
 | 
											else
 | 
				
			||||||
 | 
												reps[i2] = 0
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											if
 | 
				
			||||||
 | 
												G.jokers.cards[i2] == G.jokers.cards[i]
 | 
				
			||||||
 | 
												and G.jokers.cards[i].edition
 | 
				
			||||||
 | 
												and G.jokers.cards[i].edition.retriggers
 | 
				
			||||||
 | 
											then
 | 
				
			||||||
 | 
												local old_repetitions = reps[i] ~= 0 and reps[i].repetitions or 0
 | 
				
			||||||
 | 
												local check = false --G.jokers.cards[i]:calculate_retriggers()
 | 
				
			||||||
 | 
												if check and check.repetitions then
 | 
				
			||||||
 | 
													check.repetitions = check.repetitions + old_repetitions
 | 
				
			||||||
 | 
													reps[i] = check
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										for i0, j in ipairs(reps) do
 | 
				
			||||||
 | 
											if (type(j) == "table") and j.repetitions and (j.repetitions > 0) then
 | 
				
			||||||
 | 
												for r = 1, j.repetitions do
 | 
				
			||||||
 | 
													card_eval_status_text(j.card, "jokers", nil, nil, nil, j)
 | 
				
			||||||
 | 
													local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
													if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
														G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
													local o = obj:cry_scale_mod(
 | 
				
			||||||
 | 
														G.jokers.cards[i],
 | 
				
			||||||
 | 
														jkr,
 | 
				
			||||||
 | 
														orig_scale_scale,
 | 
				
			||||||
 | 
														true_base,
 | 
				
			||||||
 | 
														orig_scale_base,
 | 
				
			||||||
 | 
														new_scale_base
 | 
				
			||||||
 | 
													)
 | 
				
			||||||
 | 
													if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
														G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
													if o then
 | 
				
			||||||
 | 
														if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
															if
 | 
				
			||||||
 | 
																not (
 | 
				
			||||||
 | 
																	not jkr.ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
																	or not jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
																)
 | 
				
			||||||
 | 
															then
 | 
				
			||||||
 | 
																jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]] = o
 | 
				
			||||||
 | 
																orig_scale_scale = o
 | 
				
			||||||
 | 
															end
 | 
				
			||||||
 | 
														else
 | 
				
			||||||
 | 
															if jkr.ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
																jkr.ability[dbl_info.scaler[1]] = o
 | 
				
			||||||
 | 
																orig_scale_scale = o
 | 
				
			||||||
 | 
															end
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
														card_eval_status_text(
 | 
				
			||||||
 | 
															G.jokers.cards[i],
 | 
				
			||||||
 | 
															"extra",
 | 
				
			||||||
 | 
															nil,
 | 
				
			||||||
 | 
															nil,
 | 
				
			||||||
 | 
															nil,
 | 
				
			||||||
 | 
															{ message = localize("k_upgrade_ex") }
 | 
				
			||||||
 | 
														)
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local smcc = SMODS.calculate_context
 | 
				
			||||||
 | 
					function SMODS.calculate_context(context, return_table)
 | 
				
			||||||
 | 
						for k, v in pairs(SMODS.Events) do
 | 
				
			||||||
 | 
							if G.GAME.events and G.GAME.events[k] then
 | 
				
			||||||
 | 
								context.pre_jokers = true
 | 
				
			||||||
 | 
								v:calculate(context)
 | 
				
			||||||
 | 
								context.pre_jokers = nil
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if context.using_consumeable then
 | 
				
			||||||
 | 
							local _card = context.consumeable
 | 
				
			||||||
 | 
							--calculate the joker effects
 | 
				
			||||||
 | 
							local eval, post = eval_card(_card, context)
 | 
				
			||||||
 | 
							local effects = { eval }
 | 
				
			||||||
 | 
							for _, v in ipairs(post) do
 | 
				
			||||||
 | 
								effects[#effects + 1] = v
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if context.other_joker then
 | 
				
			||||||
 | 
								for k, v in pairs(effects[1]) do
 | 
				
			||||||
 | 
									v.other_card = _card
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if effects[1].retriggers then
 | 
				
			||||||
 | 
								context.retrigger_joker = true
 | 
				
			||||||
 | 
								for rt = 1, #effects[1].retriggers do
 | 
				
			||||||
 | 
									context.retrigger_joker = effects[1].retriggers[rt].retrigger_card
 | 
				
			||||||
 | 
									local rt_eval, rt_post = eval_card(_card, context)
 | 
				
			||||||
 | 
									table.insert(effects, { effects[1].retriggers[rt] })
 | 
				
			||||||
 | 
									table.insert(effects, rt_eval)
 | 
				
			||||||
 | 
									for _, v in ipairs(rt_post) do
 | 
				
			||||||
 | 
										effects[#effects + 1] = v
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								context.retrigger_joker = false
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if return_table then
 | 
				
			||||||
 | 
								for _, v in ipairs(effects) do
 | 
				
			||||||
 | 
									if v.jokers and not v.jokers.card then
 | 
				
			||||||
 | 
										v.jokers.card = _card
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return_table[#return_table + 1] = v
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								SMODS.trigger_effects(effects, _card)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						smcc(context, return_table)
 | 
				
			||||||
 | 
						for k, v in pairs(SMODS.Events) do
 | 
				
			||||||
 | 
							if G.GAME.events and G.GAME.events[k] then
 | 
				
			||||||
 | 
								context.post_jokers = true
 | 
				
			||||||
 | 
								v:calculate(context)
 | 
				
			||||||
 | 
								context.post_jokers = nil
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Card:calculate_joker(context)
 | 
				
			||||||
 | 
						local active_side = self
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							next(find_joker("cry-Flip Side"))
 | 
				
			||||||
 | 
							and not context.dbl_side
 | 
				
			||||||
 | 
							and self.edition
 | 
				
			||||||
 | 
							and self.edition.cry_double_sided
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							self:init_dbl_side()
 | 
				
			||||||
 | 
							active_side = self.dbl_side
 | 
				
			||||||
 | 
							if context.callback then
 | 
				
			||||||
 | 
								local m = context.callback
 | 
				
			||||||
 | 
								context.callback = function(card, a, b)
 | 
				
			||||||
 | 
									m(self, a, b)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								context.dbl_side = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if active_side.will_shatter then
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
						if not G.GAME.cry_double_scale then
 | 
				
			||||||
 | 
							G.GAME.cry_double_scale = { double_scale = true } --doesn't really matter what's in here as long as there's something
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if active_side.ability.cry_rigged then
 | 
				
			||||||
 | 
							G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local orig_ability = active_side:cry_copy_ability()
 | 
				
			||||||
 | 
						local in_context_scaling = false
 | 
				
			||||||
 | 
						local callback = context.callback
 | 
				
			||||||
 | 
						if active_side.ability.cry_possessed then
 | 
				
			||||||
 | 
							if
 | 
				
			||||||
 | 
								not (
 | 
				
			||||||
 | 
									(context.individual and not context.repetition)
 | 
				
			||||||
 | 
									or context.joker_main
 | 
				
			||||||
 | 
									or (context.other_joker and not context.post_trigger)
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							context.callback = nil
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local ret, trig = cj(active_side, context)
 | 
				
			||||||
 | 
						if active_side.ability.cry_possessed and ret then
 | 
				
			||||||
 | 
							if ret.mult_mod then
 | 
				
			||||||
 | 
								ret.mult_mod = ret.mult_mod * -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if ret.Xmult_mod then
 | 
				
			||||||
 | 
								ret.Xmult_mod = ret.Xmult_mod ^ -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if ret.mult then
 | 
				
			||||||
 | 
								ret.mult = ret.mult * -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if ret.x_mult then
 | 
				
			||||||
 | 
								ret.x_mult = ret.x_mult ^ -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							ret.e_mult = nil
 | 
				
			||||||
 | 
							ret.ee_mult = nil
 | 
				
			||||||
 | 
							ret.eee_mult = nil
 | 
				
			||||||
 | 
							ret.hyper_mult = nil
 | 
				
			||||||
 | 
							ret.Emult_mod = nil
 | 
				
			||||||
 | 
							ret.EEmult_mod = nil
 | 
				
			||||||
 | 
							ret.EEEmult_mod = nil
 | 
				
			||||||
 | 
							ret.hypermult_mod = nil
 | 
				
			||||||
 | 
							if ret.chip_mod then
 | 
				
			||||||
 | 
								ret.chip_mod = ret.chip_mod * -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if ret.Xchip_mod then
 | 
				
			||||||
 | 
								ret.Xchip_mod = ret.Xchip_mod ^ -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if ret.chips then
 | 
				
			||||||
 | 
								ret.chips = ret.chips * -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if ret.x_chips then
 | 
				
			||||||
 | 
								ret.x_chips = ret.x_chips ^ -1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							ret.e_chips = nil
 | 
				
			||||||
 | 
							ret.ee_chips = nil
 | 
				
			||||||
 | 
							ret.eee_chips = nil
 | 
				
			||||||
 | 
							ret.hyper_chips = nil
 | 
				
			||||||
 | 
							ret.Echip_mod = nil
 | 
				
			||||||
 | 
							ret.EEchip_mod = nil
 | 
				
			||||||
 | 
							ret.EEEchip_mod = nil
 | 
				
			||||||
 | 
							ret.hyperchip_mod = nil
 | 
				
			||||||
 | 
							if ret.message then
 | 
				
			||||||
 | 
								-- TODO - this is a hacky way to do this, but it works for now
 | 
				
			||||||
 | 
								if type(ret.message) == "table" then
 | 
				
			||||||
 | 
									ret.message = ret.message[1]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if ret.message:sub(1, 1) == "+" then
 | 
				
			||||||
 | 
									ret.message = "-" .. ret.message:sub(2)
 | 
				
			||||||
 | 
								elseif ret.message:sub(1, 1) == "X" then
 | 
				
			||||||
 | 
									ret.message = "/" .. ret.message:sub(2)
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									ret.message = ret.message .. "?"
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							callback(context.blueprint_card or self, ret, context.retrigger_joker)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if not context.blueprint and (active_side.ability.set == "Joker") and not active_side.debuff then
 | 
				
			||||||
 | 
							if ret or trig then
 | 
				
			||||||
 | 
								in_context_scaling = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if active_side.ability.cry_rigged then
 | 
				
			||||||
 | 
							G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						active_side:cry_double_scale_calc(orig_ability, in_context_scaling)
 | 
				
			||||||
 | 
						return ret, trig
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function exponentia_scale_mod(self, orig_scale_scale, orig_scale_base, new_scale_base)
 | 
				
			||||||
 | 
						local jkr = self
 | 
				
			||||||
 | 
						local dbl_info = G.GAME.cry_double_scale[jkr.sort_id]
 | 
				
			||||||
 | 
						if jkr.ability and type(jkr.ability) == "table" then
 | 
				
			||||||
 | 
							if not G.GAME.cry_double_scale[jkr.sort_id] or not G.GAME.cry_double_scale[jkr.sort_id].ability then
 | 
				
			||||||
 | 
								if not G.GAME.cry_double_scale[jkr.sort_id] then
 | 
				
			||||||
 | 
									G.GAME.cry_double_scale[jkr.sort_id] = { ability = { double_scale = true } }
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								for k, v in pairs(jkr.ability) do
 | 
				
			||||||
 | 
									if type(jkr.ability[k]) ~= "table" then
 | 
				
			||||||
 | 
										G.GAME.cry_double_scale[jkr.sort_id].ability[k] = v
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										G.GAME.cry_double_scale[jkr.sort_id].ability[k] = {}
 | 
				
			||||||
 | 
										for _k, _v in pairs(jkr.ability[k]) do
 | 
				
			||||||
 | 
											G.GAME.cry_double_scale[jkr.sort_id].ability[k][_k] = _v
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if G.GAME.cry_double_scale[jkr.sort_id] and not G.GAME.cry_double_scale[jkr.sort_id].scaler then
 | 
				
			||||||
 | 
								dbl_info.base = { "extra", "Emult" }
 | 
				
			||||||
 | 
								dbl_info.scaler = { "extra", "Emult_mod" }
 | 
				
			||||||
 | 
								dbl_info.scaler_base = jkr.ability.extra.Emult_mod
 | 
				
			||||||
 | 
								dbl_info.offset = 1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local true_base = dbl_info.scaler_base
 | 
				
			||||||
 | 
						if true_base then
 | 
				
			||||||
 | 
							for i = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
								local obj = G.jokers.cards[i].config.center
 | 
				
			||||||
 | 
								if obj.cry_scale_mod and type(obj.cry_scale_mod) == "function" then
 | 
				
			||||||
 | 
									local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
									if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
										G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									local o = obj:cry_scale_mod(
 | 
				
			||||||
 | 
										G.jokers.cards[i],
 | 
				
			||||||
 | 
										jkr,
 | 
				
			||||||
 | 
										orig_scale_scale,
 | 
				
			||||||
 | 
										true_base,
 | 
				
			||||||
 | 
										orig_scale_base,
 | 
				
			||||||
 | 
										new_scale_base
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
									if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
										G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if o then
 | 
				
			||||||
 | 
										if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
											if
 | 
				
			||||||
 | 
												not (
 | 
				
			||||||
 | 
													not jkr.ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
													or not jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
												)
 | 
				
			||||||
 | 
											then
 | 
				
			||||||
 | 
												jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]] = o
 | 
				
			||||||
 | 
												orig_scale_scale = o
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											if jkr.ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
												jkr.ability[dbl_info.scaler[1]] = o
 | 
				
			||||||
 | 
												orig_scale_scale = o
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										card_eval_status_text(
 | 
				
			||||||
 | 
											G.jokers.cards[i],
 | 
				
			||||||
 | 
											"extra",
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											{ message = localize("k_upgrade_ex") }
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									local reps = {}
 | 
				
			||||||
 | 
									for i2 = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
										local _card = G.jokers.cards[i2]
 | 
				
			||||||
 | 
										local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
										if _card.ability.cry_rigged then
 | 
				
			||||||
 | 
											G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										local check =
 | 
				
			||||||
 | 
											cj(G.jokers.cards[i2], { retrigger_joker_check = true, other_card = G.jokers.cards[i] })
 | 
				
			||||||
 | 
										if _card.ability.cry_rigged then
 | 
				
			||||||
 | 
											G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if type(check) == "table" then
 | 
				
			||||||
 | 
											reps[i2] = check and check.repetitions and check or 0
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											reps[i2] = 0
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if
 | 
				
			||||||
 | 
											G.jokers.cards[i2] == G.jokers.cards[i]
 | 
				
			||||||
 | 
											and G.jokers.cards[i].edition
 | 
				
			||||||
 | 
											and G.jokers.cards[i].edition.retriggers
 | 
				
			||||||
 | 
										then
 | 
				
			||||||
 | 
											local old_repetitions = reps[i] ~= 0 and reps[i].repetitions or 0
 | 
				
			||||||
 | 
											local check = false --G.jokers.cards[i]:calculate_retriggers()
 | 
				
			||||||
 | 
											if check and check.repetitions then
 | 
				
			||||||
 | 
												check.repetitions = check.repetitions + old_repetitions
 | 
				
			||||||
 | 
												reps[i] = check
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									for i0, j in ipairs(reps) do
 | 
				
			||||||
 | 
										if (type(j) == "table") and j.repetitions and (j.repetitions > 0) then
 | 
				
			||||||
 | 
											for r = 1, j.repetitions do
 | 
				
			||||||
 | 
												card_eval_status_text(j.card, "jokers", nil, nil, nil, j)
 | 
				
			||||||
 | 
												local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
												if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
													G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
												local o = obj:cry_scale_mod(
 | 
				
			||||||
 | 
													G.jokers.cards[i],
 | 
				
			||||||
 | 
													jkr,
 | 
				
			||||||
 | 
													orig_scale_scale,
 | 
				
			||||||
 | 
													true_base,
 | 
				
			||||||
 | 
													orig_scale_base,
 | 
				
			||||||
 | 
													new_scale_base
 | 
				
			||||||
 | 
												)
 | 
				
			||||||
 | 
												if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
													G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
												if o then
 | 
				
			||||||
 | 
													if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
														if
 | 
				
			||||||
 | 
															not (
 | 
				
			||||||
 | 
																not jkr.ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
																or not jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
															)
 | 
				
			||||||
 | 
														then
 | 
				
			||||||
 | 
															jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]] = o
 | 
				
			||||||
 | 
															orig_scale_scale = o
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													else
 | 
				
			||||||
 | 
														if jkr.ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
															jkr.ability[dbl_info.scaler[1]] = o
 | 
				
			||||||
 | 
															orig_scale_scale = o
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
													card_eval_status_text(
 | 
				
			||||||
 | 
														G.jokers.cards[i],
 | 
				
			||||||
 | 
														"extra",
 | 
				
			||||||
 | 
														nil,
 | 
				
			||||||
 | 
														nil,
 | 
				
			||||||
 | 
														nil,
 | 
				
			||||||
 | 
														{ message = localize("k_upgrade_ex") }
 | 
				
			||||||
 | 
													)
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function compound_interest_scale_mod(self, orig_scale_scale, orig_scale_base, new_scale_base)
 | 
				
			||||||
 | 
						local jkr = self
 | 
				
			||||||
 | 
						local dbl_info = G.GAME.cry_double_scale[jkr.sort_id]
 | 
				
			||||||
 | 
						if jkr.ability and type(jkr.ability) == "table" then
 | 
				
			||||||
 | 
							if not G.GAME.cry_double_scale[jkr.sort_id] or not G.GAME.cry_double_scale[jkr.sort_id].ability then
 | 
				
			||||||
 | 
								if not G.GAME.cry_double_scale[jkr.sort_id] then
 | 
				
			||||||
 | 
									G.GAME.cry_double_scale[jkr.sort_id] = { ability = { double_scale = true } }
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								for k, v in pairs(jkr.ability) do
 | 
				
			||||||
 | 
									if type(jkr.ability[k]) ~= "table" then
 | 
				
			||||||
 | 
										G.GAME.cry_double_scale[jkr.sort_id].ability[k] = v
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										G.GAME.cry_double_scale[jkr.sort_id].ability[k] = {}
 | 
				
			||||||
 | 
										for _k, _v in pairs(jkr.ability[k]) do
 | 
				
			||||||
 | 
											G.GAME.cry_double_scale[jkr.sort_id].ability[k][_k] = _v
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if G.GAME.cry_double_scale[jkr.sort_id] and not G.GAME.cry_double_scale[jkr.sort_id].scaler then
 | 
				
			||||||
 | 
								dbl_info.base = { "extra", "percent" }
 | 
				
			||||||
 | 
								dbl_info.scaler = { "extra", "percent_mod" }
 | 
				
			||||||
 | 
								dbl_info.scaler_base = jkr.ability.extra.percent_mod
 | 
				
			||||||
 | 
								dbl_info.offset = 1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local true_base = dbl_info.scaler_base
 | 
				
			||||||
 | 
						if true_base then
 | 
				
			||||||
 | 
							for i = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
								local obj = G.jokers.cards[i].config.center
 | 
				
			||||||
 | 
								if obj.cry_scale_mod and type(obj.cry_scale_mod) == "function" then
 | 
				
			||||||
 | 
									local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
									if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
										G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									local o = obj:cry_scale_mod(
 | 
				
			||||||
 | 
										G.jokers.cards[i],
 | 
				
			||||||
 | 
										jkr,
 | 
				
			||||||
 | 
										orig_scale_scale,
 | 
				
			||||||
 | 
										true_base,
 | 
				
			||||||
 | 
										orig_scale_base,
 | 
				
			||||||
 | 
										new_scale_base
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
									if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
										G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if o then
 | 
				
			||||||
 | 
										if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
											if
 | 
				
			||||||
 | 
												not (
 | 
				
			||||||
 | 
													not jkr.ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
													or not jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
												)
 | 
				
			||||||
 | 
											then
 | 
				
			||||||
 | 
												jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]] = o
 | 
				
			||||||
 | 
												orig_scale_scale = o
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											if jkr.ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
												jkr.ability[dbl_info.scaler[1]] = o
 | 
				
			||||||
 | 
												orig_scale_scale = o
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										card_eval_status_text(
 | 
				
			||||||
 | 
											G.jokers.cards[i],
 | 
				
			||||||
 | 
											"extra",
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											nil,
 | 
				
			||||||
 | 
											{ message = localize("k_upgrade_ex") }
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									local reps = {}
 | 
				
			||||||
 | 
									for i2 = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
										local _card = G.jokers.cards[i2]
 | 
				
			||||||
 | 
										local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
										if _card.ability.cry_rigged then
 | 
				
			||||||
 | 
											G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										local check =
 | 
				
			||||||
 | 
											cj(G.jokers.cards[i2], { retrigger_joker_check = true, other_card = G.jokers.cards[i] })
 | 
				
			||||||
 | 
										if _card.ability.cry_rigged then
 | 
				
			||||||
 | 
											G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if type(check) == "table" then
 | 
				
			||||||
 | 
											reps[i2] = check and check.repetitions and check or 0
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											reps[i2] = 0
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if
 | 
				
			||||||
 | 
											G.jokers.cards[i2] == G.jokers.cards[i]
 | 
				
			||||||
 | 
											and G.jokers.cards[i].edition
 | 
				
			||||||
 | 
											and G.jokers.cards[i].edition.retriggers
 | 
				
			||||||
 | 
										then
 | 
				
			||||||
 | 
											local old_repetitions = reps[i] ~= 0 and reps[i].repetitions or 0
 | 
				
			||||||
 | 
											local check = false --G.jokers.cards[i]:calculate_retriggers()
 | 
				
			||||||
 | 
											if check and check.repetitions then
 | 
				
			||||||
 | 
												check.repetitions = check.repetitions + old_repetitions
 | 
				
			||||||
 | 
												reps[i] = check
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									for i0, j in ipairs(reps) do
 | 
				
			||||||
 | 
										if (type(j) == "table") and j.repetitions and (j.repetitions > 0) then
 | 
				
			||||||
 | 
											for r = 1, j.repetitions do
 | 
				
			||||||
 | 
												card_eval_status_text(j.card, "jokers", nil, nil, nil, j)
 | 
				
			||||||
 | 
												local ggpn = G.GAME.probabilities.normal
 | 
				
			||||||
 | 
												if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
													G.GAME.probabilities.normal = 1e9
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
												local o = obj:cry_scale_mod(
 | 
				
			||||||
 | 
													G.jokers.cards[i],
 | 
				
			||||||
 | 
													jkr,
 | 
				
			||||||
 | 
													orig_scale_scale,
 | 
				
			||||||
 | 
													true_base,
 | 
				
			||||||
 | 
													orig_scale_base,
 | 
				
			||||||
 | 
													new_scale_base
 | 
				
			||||||
 | 
												)
 | 
				
			||||||
 | 
												if G.jokers.cards[i].ability.cry_rigged then
 | 
				
			||||||
 | 
													G.GAME.probabilities.normal = ggpn
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
												if o then
 | 
				
			||||||
 | 
													if #dbl_info.scaler == 2 then
 | 
				
			||||||
 | 
														if
 | 
				
			||||||
 | 
															not (
 | 
				
			||||||
 | 
																not jkr.ability[dbl_info.scaler[1]]
 | 
				
			||||||
 | 
																or not jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]]
 | 
				
			||||||
 | 
															)
 | 
				
			||||||
 | 
														then
 | 
				
			||||||
 | 
															jkr.ability[dbl_info.scaler[1]][dbl_info.scaler[2]] = o
 | 
				
			||||||
 | 
															orig_scale_scale = o
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													else
 | 
				
			||||||
 | 
														if jkr.ability[dbl_info.scaler[1]] then
 | 
				
			||||||
 | 
															jkr.ability[dbl_info.scaler[1]] = o
 | 
				
			||||||
 | 
															orig_scale_scale = o
 | 
				
			||||||
 | 
														end
 | 
				
			||||||
 | 
													end
 | 
				
			||||||
 | 
													card_eval_status_text(
 | 
				
			||||||
 | 
														G.jokers.cards[i],
 | 
				
			||||||
 | 
														"extra",
 | 
				
			||||||
 | 
														nil,
 | 
				
			||||||
 | 
														nil,
 | 
				
			||||||
 | 
														nil,
 | 
				
			||||||
 | 
														{ message = localize("k_upgrade_ex") }
 | 
				
			||||||
 | 
													)
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										659
									
								
								Cryptid/lib/content.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,659 @@
 | 
				
			||||||
 | 
					-- content.lua - adds SMODS objects for content that should always be loaded
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SMODS.PokerHand({
 | 
				
			||||||
 | 
						key = "Bulwark",
 | 
				
			||||||
 | 
						visible = false,
 | 
				
			||||||
 | 
						chips = 100,
 | 
				
			||||||
 | 
						mult = 10,
 | 
				
			||||||
 | 
						l_chips = 50,
 | 
				
			||||||
 | 
						l_mult = 1,
 | 
				
			||||||
 | 
						example = {
 | 
				
			||||||
 | 
							{ "S_A", true, "m_stone" },
 | 
				
			||||||
 | 
							{ "S_A", true, "m_stone" },
 | 
				
			||||||
 | 
							{ "S_A", true, "m_stone" },
 | 
				
			||||||
 | 
							{ "S_A", true, "m_stone" },
 | 
				
			||||||
 | 
							{ "S_A", true, "m_stone" },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						evaluate = function(parts, hand)
 | 
				
			||||||
 | 
							if cry_card_enabled("set_cry_poker_hand_stuff") ~= true or cry_card_enabled("c_cry_asteroidbelt") ~= true then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local stones = {}
 | 
				
			||||||
 | 
							for i, card in ipairs(hand) do
 | 
				
			||||||
 | 
								if card.config.center_key == "m_stone" or (card.config.center.no_rank and card.config.center.no_suit) then
 | 
				
			||||||
 | 
									stones[#stones + 1] = card
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return #stones >= 5 and { stones } or {}
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.PokerHand({
 | 
				
			||||||
 | 
						key = "Clusterfuck",
 | 
				
			||||||
 | 
						visible = false,
 | 
				
			||||||
 | 
						chips = 200,
 | 
				
			||||||
 | 
						mult = 19,
 | 
				
			||||||
 | 
						l_chips = 40,
 | 
				
			||||||
 | 
						l_mult = 4,
 | 
				
			||||||
 | 
						example = {
 | 
				
			||||||
 | 
							{ "S_A", true },
 | 
				
			||||||
 | 
							{ "C_K", true },
 | 
				
			||||||
 | 
							{ "H_J", true },
 | 
				
			||||||
 | 
							{ "S_T", true },
 | 
				
			||||||
 | 
							{ "D_9", true },
 | 
				
			||||||
 | 
							{ "D_8", true },
 | 
				
			||||||
 | 
							{ "S_6", true },
 | 
				
			||||||
 | 
							{ "C_5", true },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						evaluate = function(parts, hand)
 | 
				
			||||||
 | 
							if cry_card_enabled("set_cry_poker_hand_stuff") ~= true or cry_card_enabled("c_cry_void") ~= true then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local other_hands = next(parts._flush) or next(parts._straight) or next(parts._all_pairs)
 | 
				
			||||||
 | 
							if #hand > 7 then
 | 
				
			||||||
 | 
								if not other_hands then
 | 
				
			||||||
 | 
									return { hand }
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.PokerHand({
 | 
				
			||||||
 | 
						key = "UltPair",
 | 
				
			||||||
 | 
						visible = false,
 | 
				
			||||||
 | 
						chips = 220,
 | 
				
			||||||
 | 
						mult = 22,
 | 
				
			||||||
 | 
						l_chips = 40,
 | 
				
			||||||
 | 
						l_mult = 4,
 | 
				
			||||||
 | 
						example = {
 | 
				
			||||||
 | 
							{ "S_A", true },
 | 
				
			||||||
 | 
							{ "S_A", true },
 | 
				
			||||||
 | 
							{ "S_T", true },
 | 
				
			||||||
 | 
							{ "S_T", true },
 | 
				
			||||||
 | 
							{ "H_K", true },
 | 
				
			||||||
 | 
							{ "H_K", true },
 | 
				
			||||||
 | 
							{ "H_7", true },
 | 
				
			||||||
 | 
							{ "H_7", true },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						evaluate = function(parts, hand)
 | 
				
			||||||
 | 
							if cry_card_enabled("set_cry_poker_hand_stuff") ~= true or cry_card_enabled("c_cry_marsmoons") ~= true then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local scoring_pairs = {}
 | 
				
			||||||
 | 
							local unique_suits = 0
 | 
				
			||||||
 | 
							for suit, _ in pairs(SMODS.Suits) do
 | 
				
			||||||
 | 
								local scoring_suit_pairs = {}
 | 
				
			||||||
 | 
								for i = 1, #parts._2 do
 | 
				
			||||||
 | 
									if parts._2[i][1]:is_suit(suit) and parts._2[i][2]:is_suit(suit) then
 | 
				
			||||||
 | 
										scoring_suit_pairs[#scoring_suit_pairs + 1] = i
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if #scoring_suit_pairs >= 2 then
 | 
				
			||||||
 | 
									unique_suits = unique_suits + 1
 | 
				
			||||||
 | 
									for i = 1, #scoring_suit_pairs do
 | 
				
			||||||
 | 
										scoring_pairs[scoring_suit_pairs[i]] = (scoring_pairs[scoring_suit_pairs[i]] or 0) + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if unique_suits < 2 then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local scored_cards = {}
 | 
				
			||||||
 | 
							local sc_max = 0
 | 
				
			||||||
 | 
							local sc_unique = 0
 | 
				
			||||||
 | 
							for i = 1, #parts._2 do
 | 
				
			||||||
 | 
								if scoring_pairs[i] then
 | 
				
			||||||
 | 
									if scoring_pairs[i] > 1 then
 | 
				
			||||||
 | 
										sc_unique = sc_unique + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									sc_max = math.max(sc_max, scoring_pairs[i])
 | 
				
			||||||
 | 
									scored_cards[#scored_cards + 1] = parts._2[i][1]
 | 
				
			||||||
 | 
									scored_cards[#scored_cards + 1] = parts._2[i][2]
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if sc_max == #scored_cards / 2 - 1 and sc_unique == 1 then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if #scored_cards >= 8 then
 | 
				
			||||||
 | 
								return { scored_cards }
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.PokerHand({
 | 
				
			||||||
 | 
						key = "WholeDeck",
 | 
				
			||||||
 | 
						visible = false,
 | 
				
			||||||
 | 
						chips = 525252525252525252525252525252,
 | 
				
			||||||
 | 
						mult = 52525252525252525252525252525,
 | 
				
			||||||
 | 
						l_chips = 52525252525252525252525252525,
 | 
				
			||||||
 | 
						l_mult = 5252525252525252525252525252,
 | 
				
			||||||
 | 
						example = {
 | 
				
			||||||
 | 
							{ "S_A", true },
 | 
				
			||||||
 | 
							{ "H_A", true },
 | 
				
			||||||
 | 
							{ "C_A", true },
 | 
				
			||||||
 | 
							{ "D_A", true },
 | 
				
			||||||
 | 
							{ "S_K", true },
 | 
				
			||||||
 | 
							{ "H_K", true },
 | 
				
			||||||
 | 
							{ "C_K", true },
 | 
				
			||||||
 | 
							{ "D_K", true },
 | 
				
			||||||
 | 
							{ "S_Q", true },
 | 
				
			||||||
 | 
							{ "H_Q", true },
 | 
				
			||||||
 | 
							{ "C_Q", true },
 | 
				
			||||||
 | 
							{ "D_Q", true },
 | 
				
			||||||
 | 
							{ "S_J", true },
 | 
				
			||||||
 | 
							{ "H_J", true },
 | 
				
			||||||
 | 
							{ "C_J", true },
 | 
				
			||||||
 | 
							{ "D_J", true },
 | 
				
			||||||
 | 
							{ "S_T", true },
 | 
				
			||||||
 | 
							{ "H_T", true },
 | 
				
			||||||
 | 
							{ "C_T", true },
 | 
				
			||||||
 | 
							{ "D_T", true },
 | 
				
			||||||
 | 
							{ "S_9", true },
 | 
				
			||||||
 | 
							{ "H_9", true },
 | 
				
			||||||
 | 
							{ "C_9", true },
 | 
				
			||||||
 | 
							{ "D_9", true },
 | 
				
			||||||
 | 
							{ "S_8", true },
 | 
				
			||||||
 | 
							{ "H_8", true },
 | 
				
			||||||
 | 
							{ "C_8", true },
 | 
				
			||||||
 | 
							{ "D_8", true },
 | 
				
			||||||
 | 
							{ "S_7", true },
 | 
				
			||||||
 | 
							{ "H_7", true },
 | 
				
			||||||
 | 
							{ "C_7", true },
 | 
				
			||||||
 | 
							{ "D_7", true },
 | 
				
			||||||
 | 
							{ "S_6", true },
 | 
				
			||||||
 | 
							{ "H_6", true },
 | 
				
			||||||
 | 
							{ "C_6", true },
 | 
				
			||||||
 | 
							{ "D_6", true },
 | 
				
			||||||
 | 
							{ "S_5", true },
 | 
				
			||||||
 | 
							{ "H_5", true },
 | 
				
			||||||
 | 
							{ "C_5", true },
 | 
				
			||||||
 | 
							{ "D_5", true },
 | 
				
			||||||
 | 
							{ "S_4", true },
 | 
				
			||||||
 | 
							{ "H_4", true },
 | 
				
			||||||
 | 
							{ "C_4", true },
 | 
				
			||||||
 | 
							{ "D_4", true },
 | 
				
			||||||
 | 
							{ "S_3", true },
 | 
				
			||||||
 | 
							{ "H_3", true },
 | 
				
			||||||
 | 
							{ "C_3", true },
 | 
				
			||||||
 | 
							{ "D_3", true },
 | 
				
			||||||
 | 
							{ "S_2", true },
 | 
				
			||||||
 | 
							{ "H_2", true },
 | 
				
			||||||
 | 
							{ "C_2", true },
 | 
				
			||||||
 | 
							{ "D_2", true },
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						evaluate = function(parts, hand)
 | 
				
			||||||
 | 
							if cry_card_enabled("set_cry_poker_hand_stuff") ~= true or cry_card_enabled("c_cry_universe") ~= true then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if #hand >= 52 then
 | 
				
			||||||
 | 
								local deck_booleans = {}
 | 
				
			||||||
 | 
								local scored_cards = {}
 | 
				
			||||||
 | 
								for i = 1, 52 do
 | 
				
			||||||
 | 
									table.insert(deck_booleans, false) -- i could write this out but nobody wants to see that
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								local wilds = {}
 | 
				
			||||||
 | 
								for i, card in ipairs(hand) do
 | 
				
			||||||
 | 
									if
 | 
				
			||||||
 | 
										(card.config.center_key ~= "m_wild" and not card.config.center.any_suit)
 | 
				
			||||||
 | 
										and (card.config.center_key ~= "m_stone" and not card.config.center.no_rank)
 | 
				
			||||||
 | 
									then -- i don't know if these are different... this could be completely redundant but redundant is better than broken
 | 
				
			||||||
 | 
										local rank = card:get_id()
 | 
				
			||||||
 | 
										local suit = card.base.suit
 | 
				
			||||||
 | 
										local suit_int = 0
 | 
				
			||||||
 | 
										suit_table = { "Spades", "Hearts", "Clubs", "Diamonds" }
 | 
				
			||||||
 | 
										for i = 1, 4 do
 | 
				
			||||||
 | 
											if suit == suit_table[i] then
 | 
				
			||||||
 | 
												suit_int = i
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if suit_int > 0 then -- check for custom rank here to prevent breakage?
 | 
				
			||||||
 | 
											deck_booleans[suit_int + ((rank - 2) * 4)] = true
 | 
				
			||||||
 | 
											table.insert(scored_cards, card)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									elseif card.config.center_key == "m_wild" or card.config.center.any_suit then
 | 
				
			||||||
 | 
										table.insert(wilds, card)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								for i, card in ipairs(wilds) do -- this 100% breaks with custom ranks
 | 
				
			||||||
 | 
									local rank = card:get_id()
 | 
				
			||||||
 | 
									for i = 1, 4 do
 | 
				
			||||||
 | 
										if not deck_booleans[i + ((rank - 2) * 4)] then
 | 
				
			||||||
 | 
											deck_booleans[i + ((rank - 2) * 4)] = true
 | 
				
			||||||
 | 
											break
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									table.insert(scored_cards, card)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								local entire_fucking_deck = true
 | 
				
			||||||
 | 
								for i = 1, #deck_booleans do
 | 
				
			||||||
 | 
									if deck_booleans[i] == false then
 | 
				
			||||||
 | 
										entire_fucking_deck = false
 | 
				
			||||||
 | 
										break
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if entire_fucking_deck == true then
 | 
				
			||||||
 | 
									return { scored_cards }
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Rarity({
 | 
				
			||||||
 | 
						key = "exotic",
 | 
				
			||||||
 | 
						loc_txt = {},
 | 
				
			||||||
 | 
						badge_colour = HEX("708b91"),
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SMODS.Rarity({
 | 
				
			||||||
 | 
						key = "epic",
 | 
				
			||||||
 | 
						loc_txt = {},
 | 
				
			||||||
 | 
						badge_colour = HEX("ef0098"),
 | 
				
			||||||
 | 
						default_weight = 0.003,
 | 
				
			||||||
 | 
						pools = { ["Joker"] = true },
 | 
				
			||||||
 | 
						get_weight = function(self, weight, object_type)
 | 
				
			||||||
 | 
							-- The game shouldn't try generating Epic Jokers when they are disabled
 | 
				
			||||||
 | 
							if Cryptid_config["Epic Jokers"] then
 | 
				
			||||||
 | 
								return 0.003
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return 0
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SMODS.Rarity({
 | 
				
			||||||
 | 
						key = "candy",
 | 
				
			||||||
 | 
						loc_txt = {},
 | 
				
			||||||
 | 
						badge_colour = HEX("e275e6"),
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SMODS.Rarity({
 | 
				
			||||||
 | 
						key = "cursed",
 | 
				
			||||||
 | 
						loc_txt = {},
 | 
				
			||||||
 | 
						badge_colour = HEX("474931"),
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Add Unique consumable set - used for unique consumables that aren't normally obtained (e.g. Potion)
 | 
				
			||||||
 | 
					SMODS.ConsumableType({
 | 
				
			||||||
 | 
						key = "Unique",
 | 
				
			||||||
 | 
						primary_colour = G.C.MONEY,
 | 
				
			||||||
 | 
						secondary_colour = G.C.MONEY,
 | 
				
			||||||
 | 
						collection_rows = { 4, 4 },
 | 
				
			||||||
 | 
						shop_rate = 0.0,
 | 
				
			||||||
 | 
						loc_txt = {},
 | 
				
			||||||
 | 
						default = "c_cry_potion",
 | 
				
			||||||
 | 
						can_stack = false,
 | 
				
			||||||
 | 
						can_divide = false,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					-- Pool used by Food Jokers
 | 
				
			||||||
 | 
					SMODS.ObjectType({
 | 
				
			||||||
 | 
						key = "Food",
 | 
				
			||||||
 | 
						default = "j_reserved_parking",
 | 
				
			||||||
 | 
						cards = {},
 | 
				
			||||||
 | 
						inject = function(self)
 | 
				
			||||||
 | 
							SMODS.ObjectType.inject(self)
 | 
				
			||||||
 | 
							-- insert base game food jokers
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_gros_michel)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_egg)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_ice_cream)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_cavendish)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_turtle_bean)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_diet_cola)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_popcorn)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_ramen)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_selzer)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.ObjectType({
 | 
				
			||||||
 | 
						object_type = "ObjectType",
 | 
				
			||||||
 | 
						key = "Meme",
 | 
				
			||||||
 | 
						default = "j_mr_bones",
 | 
				
			||||||
 | 
						cards = {},
 | 
				
			||||||
 | 
						inject = function(self)
 | 
				
			||||||
 | 
							SMODS.ObjectType.inject(self)
 | 
				
			||||||
 | 
							-- insert base game meme jokers
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_mr_bones)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_four_fingers) --loss reference
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_obelisk)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_jolly)
 | 
				
			||||||
 | 
							self:inject_card(G.P_CENTERS.j_space)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.ObjectType({
 | 
				
			||||||
 | 
						object_type = "ObjectType",
 | 
				
			||||||
 | 
						key = "Tier3",
 | 
				
			||||||
 | 
						default = "v_blank",
 | 
				
			||||||
 | 
						cards = {},
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.ObjectType({
 | 
				
			||||||
 | 
						object_type = "ObjectType",
 | 
				
			||||||
 | 
						key = "M",
 | 
				
			||||||
 | 
						default = "j_jolly",
 | 
				
			||||||
 | 
						cards = {},
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					--Stickers and modifiers used by Challenges+Stakes
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "sticker",
 | 
				
			||||||
 | 
						path = "sticker_cry.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
						inject = function(self)
 | 
				
			||||||
 | 
							local file_path = type(self.path) == "table"
 | 
				
			||||||
 | 
									and (self.path[G.SETTINGS.language] or self.path["default"] or self.path["en-us"])
 | 
				
			||||||
 | 
								or self.path
 | 
				
			||||||
 | 
							if file_path == "DEFAULT" then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							-- language specific sprites override fully defined sprites only if that language is set
 | 
				
			||||||
 | 
							if self.language and not (G.SETTINGS.language == self.language) then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if not self.language and self.obj_table[("%s_%s"):format(self.key, G.SETTINGS.language)] then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							self.full_path = (self.mod and self.mod.path or SMODS.path)
 | 
				
			||||||
 | 
								.. "assets/"
 | 
				
			||||||
 | 
								.. G.SETTINGS.GRAPHICS.texture_scaling
 | 
				
			||||||
 | 
								.. "x/"
 | 
				
			||||||
 | 
								.. file_path
 | 
				
			||||||
 | 
							local file_data =
 | 
				
			||||||
 | 
								assert(NFS.newFileData(self.full_path), ("Failed to collect file data for Atlas %s"):format(self.key))
 | 
				
			||||||
 | 
							self.image_data = assert(
 | 
				
			||||||
 | 
								love.image.newImageData(file_data),
 | 
				
			||||||
 | 
								("Failed to initialize image data for Atlas %s"):format(self.key)
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							self.image =
 | 
				
			||||||
 | 
								love.graphics.newImage(self.image_data, { mipmaps = true, dpiscale = G.SETTINGS.GRAPHICS.texture_scaling })
 | 
				
			||||||
 | 
							G[self.atlas_table][self.key_noloc or self.key] = self
 | 
				
			||||||
 | 
							G.shared_sticker_banana =
 | 
				
			||||||
 | 
								Sprite(0, 0, G.CARD_W, G.CARD_H, G[self.atlas_table][self.key_noloc or self.key], { x = 5, y = 2 })
 | 
				
			||||||
 | 
							G.shared_sticker_pinned =
 | 
				
			||||||
 | 
								Sprite(0, 0, G.CARD_W, G.CARD_H, G[self.atlas_table][self.key_noloc or self.key], { x = 5, y = 0 })
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "meow1",
 | 
				
			||||||
 | 
						path = "meow1.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "meow2",
 | 
				
			||||||
 | 
						path = "meow2.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "meow3",
 | 
				
			||||||
 | 
						path = "meow3.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "meow4",
 | 
				
			||||||
 | 
						path = "meow4.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_mosaic",
 | 
				
			||||||
 | 
						path = "e_mosaic.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_glitched",
 | 
				
			||||||
 | 
						path = "e_glitched.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_oversaturated",
 | 
				
			||||||
 | 
						path = "e_oversaturated.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_blur",
 | 
				
			||||||
 | 
						path = "e_blur.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_double_sided",
 | 
				
			||||||
 | 
						path = "e_double_sided.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_jolly",
 | 
				
			||||||
 | 
						path = "e_jolly.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_noisy",
 | 
				
			||||||
 | 
						path = "e_noisy.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_fragile",
 | 
				
			||||||
 | 
						path = "e_fragile.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "e_golden",
 | 
				
			||||||
 | 
						path = "e_golden.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "studiofromhelsinki",
 | 
				
			||||||
 | 
						path = "studiofromhelsinki.ogg",
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_jimball",
 | 
				
			||||||
 | 
						path = "music_jimball.ogg",
 | 
				
			||||||
 | 
						sync = false,
 | 
				
			||||||
 | 
						pitch = 1,
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return next(find_joker("cry-Jimball"))
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.jimball_music
 | 
				
			||||||
 | 
								-- Lowering priority for edition Jimballs later
 | 
				
			||||||
 | 
								and 7
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_code",
 | 
				
			||||||
 | 
						path = "music_code.ogg",
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return Cryptid_config.Cryptid
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.code_music
 | 
				
			||||||
 | 
								and (
 | 
				
			||||||
 | 
									(
 | 
				
			||||||
 | 
										G.pack_cards
 | 
				
			||||||
 | 
										and G.pack_cards.cards
 | 
				
			||||||
 | 
										and G.pack_cards.cards[1]
 | 
				
			||||||
 | 
										and G.pack_cards.cards[1].ability.set == "Code"
 | 
				
			||||||
 | 
									) or (G.GAME and G.GAME.USING_CODE)
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_big",
 | 
				
			||||||
 | 
						path = "music_big.ogg",
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return Cryptid_config.Cryptid
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.big_music
 | 
				
			||||||
 | 
								and to_big(G.GAME.round_scores["hand"].amt) > to_big(10) ^ 1000000
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_exotic",
 | 
				
			||||||
 | 
						path = "music_exotic.ogg",
 | 
				
			||||||
 | 
						volume = 0.4,
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return Cryptid_config.Cryptid
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.exotic_music
 | 
				
			||||||
 | 
								and #advanced_find_joker(nil, "cry_exotic", nil, nil, true) ~= 0
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_mainline",
 | 
				
			||||||
 | 
						path = "music_mainline.ogg",
 | 
				
			||||||
 | 
						volume = 0.7,
 | 
				
			||||||
 | 
						sync = {
 | 
				
			||||||
 | 
							cry_music_modest = true,
 | 
				
			||||||
 | 
							cry_music_madness = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						pitch = 1,
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return G.STAGE == G.STAGES.MAIN_MENU
 | 
				
			||||||
 | 
								and (G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "mainline" or G.selectedGameset and G.selectedGameset ~= "modest" and G.selectedGameset ~= "madness")
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.alt_bg_music
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_madness",
 | 
				
			||||||
 | 
						path = "music_madness.ogg",
 | 
				
			||||||
 | 
						volume = 0.7,
 | 
				
			||||||
 | 
						sync = {
 | 
				
			||||||
 | 
							cry_music_modest = true,
 | 
				
			||||||
 | 
							cry_music_mainline = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						pitch = 1,
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return G.STAGE == G.STAGES.MAIN_MENU
 | 
				
			||||||
 | 
								and (G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "madness" or G.selectedGameset == "madness")
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.alt_bg_music
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sound({
 | 
				
			||||||
 | 
						key = "music_modest",
 | 
				
			||||||
 | 
						path = "music_modest.ogg",
 | 
				
			||||||
 | 
						volume = 0.7,
 | 
				
			||||||
 | 
						sync = {
 | 
				
			||||||
 | 
							cry_music_mainline = true,
 | 
				
			||||||
 | 
							cry_music_madness = true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						pitch = 1,
 | 
				
			||||||
 | 
						select_music_track = function()
 | 
				
			||||||
 | 
							return G.STAGE == G.STAGES.MAIN_MENU
 | 
				
			||||||
 | 
								and (G.PROFILES[G.SETTINGS.profile].cry_gameset and G.PROFILES[G.SETTINGS.profile].cry_gameset == "modest" or G.selectedGameset == "modest")
 | 
				
			||||||
 | 
								and Cryptid_config.Cryptid.alt_bg_music
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "modicon",
 | 
				
			||||||
 | 
						path = "cry_icon.png",
 | 
				
			||||||
 | 
						px = 32,
 | 
				
			||||||
 | 
						py = 32,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "gameset",
 | 
				
			||||||
 | 
						path = "cry_gameset.png",
 | 
				
			||||||
 | 
						px = 29,
 | 
				
			||||||
 | 
						py = 29,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "placeholders",
 | 
				
			||||||
 | 
						path = "placeholders.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasepic",
 | 
				
			||||||
 | 
						path = "atlasepic.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasone",
 | 
				
			||||||
 | 
						path = "atlasone.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlastwo",
 | 
				
			||||||
 | 
						path = "atlastwo.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasthree",
 | 
				
			||||||
 | 
						path = "atlasthree.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasspooky",
 | 
				
			||||||
 | 
						path = "atlasspooky.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasexotic",
 | 
				
			||||||
 | 
						path = "atlasexotic.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasnotjokers", --this is easier to spell then consumables
 | 
				
			||||||
 | 
						path = "atlasnotjokers.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "tag_cry",
 | 
				
			||||||
 | 
						path = "tag_cry.png",
 | 
				
			||||||
 | 
						px = 34,
 | 
				
			||||||
 | 
						py = 34,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasdeck",
 | 
				
			||||||
 | 
						path = "atlasdeck.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "glowing",
 | 
				
			||||||
 | 
						path = "b_cry_glowing.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "effarcire",
 | 
				
			||||||
 | 
						path = "goofy.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "code",
 | 
				
			||||||
 | 
						path = "c_cry_code.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "pack",
 | 
				
			||||||
 | 
						path = "pack_cry.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.UndiscoveredSprite({
 | 
				
			||||||
 | 
						key = "Code",
 | 
				
			||||||
 | 
						atlas = "code",
 | 
				
			||||||
 | 
						path = "c_cry_code.png",
 | 
				
			||||||
 | 
						pos = { x = 2, y = 5 },
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.UndiscoveredSprite({
 | 
				
			||||||
 | 
						key = "Unique",
 | 
				
			||||||
 | 
						atlas = "code",
 | 
				
			||||||
 | 
						path = "c_cry_code.png",
 | 
				
			||||||
 | 
						pos = { x = 2, y = 5 },
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "blinds",
 | 
				
			||||||
 | 
						atlas_table = "ANIMATION_ATLAS",
 | 
				
			||||||
 | 
						path = "bl_cry.png",
 | 
				
			||||||
 | 
						px = 34,
 | 
				
			||||||
 | 
						py = 34,
 | 
				
			||||||
 | 
						frames = 21,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "nostalgia",
 | 
				
			||||||
 | 
						atlas_table = "ANIMATION_ATLAS",
 | 
				
			||||||
 | 
						path = "bl_nostalgia.png",
 | 
				
			||||||
 | 
						px = 34,
 | 
				
			||||||
 | 
						py = 34,
 | 
				
			||||||
 | 
						frames = 21,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					--Enchancements, seals, other misc things etc
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "cry_misc",
 | 
				
			||||||
 | 
						path = "cry_misc.png",
 | 
				
			||||||
 | 
						px = 71,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Atlas({
 | 
				
			||||||
 | 
						key = "atlasSleeves",
 | 
				
			||||||
 | 
						path = "atlasSleeves.png",
 | 
				
			||||||
 | 
						px = 73,
 | 
				
			||||||
 | 
						py = 95,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
							
								
								
									
										105
									
								
								Cryptid/lib/cross-mod.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,105 @@
 | 
				
			||||||
 | 
					-- cross-mod.lua - Used for compatibility and content with other mods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--For Double Scale/Scalae, modify Green Joker to use one variable
 | 
				
			||||||
 | 
					SMODS.Joker:take_ownership("green_joker", {
 | 
				
			||||||
 | 
						config = { extra = 1, mult = 0 },
 | 
				
			||||||
 | 
						name = "cry-Green Joker", --will prevent old calculation code from working
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							return { vars = { center.ability.extra, center.ability.extra, center.ability.mult } }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
 | 
							if
 | 
				
			||||||
 | 
								context.discard
 | 
				
			||||||
 | 
								and not context.blueprint
 | 
				
			||||||
 | 
								and context.other_card == context.full_hand[#context.full_hand]
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								local prev_mult = card.ability.mult
 | 
				
			||||||
 | 
								card.ability.mult = math.max(0, card.ability.mult - card.ability.extra)
 | 
				
			||||||
 | 
								if card.ability.mult ~= prev_mult then
 | 
				
			||||||
 | 
									return {
 | 
				
			||||||
 | 
										message = localize({
 | 
				
			||||||
 | 
											type = "variable",
 | 
				
			||||||
 | 
											key = "a_mult_minus",
 | 
				
			||||||
 | 
											vars = { card.ability.extra },
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										colour = G.C.RED,
 | 
				
			||||||
 | 
										card = card,
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if context.cardarea == G.jokers and context.before and not context.blueprint then
 | 
				
			||||||
 | 
								card.ability.mult = card.ability.mult + card.ability.extra
 | 
				
			||||||
 | 
								return {
 | 
				
			||||||
 | 
									card = card,
 | 
				
			||||||
 | 
									message = localize({ type = "variable", key = "a_mult", vars = { card.ability.extra } }),
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if context.joker_main then
 | 
				
			||||||
 | 
								return {
 | 
				
			||||||
 | 
									message = localize({ type = "variable", key = "a_mult", vars = { card.ability.mult } }),
 | 
				
			||||||
 | 
									mult_mod = card.ability.mult,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						loc_txt = {},
 | 
				
			||||||
 | 
					}, true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Top Gear from The World End with Jimbo has several conflicts with Cryptid items
 | 
				
			||||||
 | 
					--Namely, It overrides the edition that edition jokers spawn with, and doesn't work correctly with edition decks
 | 
				
			||||||
 | 
					--I'm taking ownership of this, overiding it, and making an implementaion that is compatible with Cryptid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Unrelated but kind of related side note: this prevents top gear from showing up in collection, not sure what's up with that
 | 
				
			||||||
 | 
					--Is it due to how TWEWJ is Coded? Is it an issue with Steamodded itself? Might be worth looking into, just sayin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (SMODS.Mods["TWEWY"] or {}).can_load then
 | 
				
			||||||
 | 
						SMODS.Joker:take_ownership("twewy_topGear", {
 | 
				
			||||||
 | 
							name = "Cry-topGear",
 | 
				
			||||||
 | 
							--Stop Top Gear's Old code from working by overriding these
 | 
				
			||||||
 | 
							add_to_deck = function(self, card, from_debuff) end,
 | 
				
			||||||
 | 
							remove_from_deck = function(self, card, from_debuff) end,
 | 
				
			||||||
 | 
							rarity = 3,
 | 
				
			||||||
 | 
							loc_txt = {
 | 
				
			||||||
 | 
								name = "Top Gear",
 | 
				
			||||||
 | 
								text = {
 | 
				
			||||||
 | 
									"All {C:blue}Common{C:attention} Jokers{}",
 | 
				
			||||||
 | 
									"are {C:dark_edition}Polychrome{}",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Make Ortalab's Locked jokers not show up on Deck of Equilibrium and Antimatter Deck
 | 
				
			||||||
 | 
					if (SMODS.Mods["ortalab"] or {}).can_load then
 | 
				
			||||||
 | 
						for i = 1, 150 do
 | 
				
			||||||
 | 
							print(i)
 | 
				
			||||||
 | 
							SMODS.Joker:take_ownership("ortalab_temp_" .. i, {
 | 
				
			||||||
 | 
								name = "Cry-skibidi",
 | 
				
			||||||
 | 
								no_doe = true,
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Requires Malverk Mod
 | 
				
			||||||
 | 
					if (SMODS.Mods["malverk"] or {}).can_load then
 | 
				
			||||||
 | 
						AltTexture({
 | 
				
			||||||
 | 
							key = "jolly_jokers",
 | 
				
			||||||
 | 
							set = "Joker",
 | 
				
			||||||
 | 
							path = "jolly.png",
 | 
				
			||||||
 | 
							loc_txt = {
 | 
				
			||||||
 | 
								name = "Jolly Jokers",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						TexturePack({ -- HD Texture Pack
 | 
				
			||||||
 | 
							key = "jolly_texture",
 | 
				
			||||||
 | 
							textures = {
 | 
				
			||||||
 | 
								"cry_jolly_jokers",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							loc_txt = {
 | 
				
			||||||
 | 
								name = "Jolly",
 | 
				
			||||||
 | 
								text = {
 | 
				
			||||||
 | 
									"Jolly Jokers",
 | 
				
			||||||
 | 
									"Art by B",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										12
									
								
								Cryptid/lib/d20.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					-- d20.lua - APIs for D20 content
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Currently this is very empty since D20 hasn't been fully implemented yet, but it should have a lot more later.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Will be moved to D20 file when that gets added
 | 
				
			||||||
 | 
					function roll_dice(seed, min, max, config)
 | 
				
			||||||
 | 
						local val
 | 
				
			||||||
 | 
						while not val or (config and config.ignore_value == val) do
 | 
				
			||||||
 | 
							val = pseudorandom(seed, min, max)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return val
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										44
									
								
								Cryptid/lib/event.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,44 @@
 | 
				
			||||||
 | 
					-- event.lua - Adds SMODS Event class
 | 
				
			||||||
 | 
					-- Used for Jokers like Chocolate Die
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SMODS.Events = {}
 | 
				
			||||||
 | 
					SMODS.Event = SMODS.GameObject:extend({
 | 
				
			||||||
 | 
						obj_table = SMODS.Events,
 | 
				
			||||||
 | 
						obj_buffer = {},
 | 
				
			||||||
 | 
						required_params = {
 | 
				
			||||||
 | 
							"key",
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						inject = function() end,
 | 
				
			||||||
 | 
						set = "Event",
 | 
				
			||||||
 | 
						class_prefix = "ev",
 | 
				
			||||||
 | 
						-- This should be called to start an event.
 | 
				
			||||||
 | 
						start = function(self)
 | 
				
			||||||
 | 
							G.GAME.events[self.key] = true
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						-- This should be called to finish an event.
 | 
				
			||||||
 | 
						finish = function(self)
 | 
				
			||||||
 | 
							G.GAME.events[self.key] = nil
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						-- Runs once before and after jokers, as well as a few special cases
 | 
				
			||||||
 | 
						calculate = function(self, context) end,
 | 
				
			||||||
 | 
						-- used for Chocolate Die tooltips, can maybe be repurposed later
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, center)
 | 
				
			||||||
 | 
							info_queue[#info_queue + 1] = { set = "Other", key = self.key }
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Calculate events on cash out
 | 
				
			||||||
 | 
					local gfco = G.FUNCS.cash_out
 | 
				
			||||||
 | 
					G.FUNCS.cash_out = function(e)
 | 
				
			||||||
 | 
						local ret = gfco(e)
 | 
				
			||||||
 | 
						SMODS.calculate_context({ cash_out = true })
 | 
				
			||||||
 | 
						return ret
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Calculate events on start of shop
 | 
				
			||||||
 | 
					local guis = G.UIDEF.shop
 | 
				
			||||||
 | 
					G.UIDEF.shop = function(e)
 | 
				
			||||||
 | 
						local ret = guis(e)
 | 
				
			||||||
 | 
						SMODS.calculate_context({ start_shop = true })
 | 
				
			||||||
 | 
						return ret
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										1810
									
								
								Cryptid/lib/gameset.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										28
									
								
								Cryptid/lib/https.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,28 @@
 | 
				
			||||||
 | 
					-- Update the Cryptid member count using HTTPS
 | 
				
			||||||
 | 
					function update_cry_member_count()
 | 
				
			||||||
 | 
						if Cryptid.enabled["HTTPS Module"] == true and Cryptid.mod_path then
 | 
				
			||||||
 | 
							if not GLOBAL_cry_member_update_thread then
 | 
				
			||||||
 | 
								-- start up the HTTPS thread if needed
 | 
				
			||||||
 | 
								local file_data = assert(NFS.newFileData(Cryptid.mod_path .. "https/thread.lua"))
 | 
				
			||||||
 | 
								GLOBAL_cry_member_update_thread = love.thread.newThread(file_data)
 | 
				
			||||||
 | 
								GLOBAL_cry_member_update_thread:start()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							local old = GLOBAL_cry_member_count or 5624
 | 
				
			||||||
 | 
							-- get the HTTPS thread's value for Cryptid members
 | 
				
			||||||
 | 
							local ret = love.thread.getChannel("member_count"):pop()
 | 
				
			||||||
 | 
							if ret then
 | 
				
			||||||
 | 
								GLOBAL_cry_member_count = string.match(ret, '"approximate_member_count"%s*:%s*(%d+)') -- string matching a json is odd but should be fine?
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if not GLOBAL_cry_member_count then
 | 
				
			||||||
 | 
								GLOBAL_cry_member_count = old
 | 
				
			||||||
 | 
								-- Something failed, print the error
 | 
				
			||||||
 | 
								local error = love.thread.getChannel("member_error"):pop()
 | 
				
			||||||
 | 
								if error then
 | 
				
			||||||
 | 
									sendDebugMessage(error)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							-- Use a fallback value if HTTPS is disabled (you all are awesome)
 | 
				
			||||||
 | 
							GLOBAL_cry_member_count = 20000
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										647
									
								
								Cryptid/lib/misc.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,647 @@
 | 
				
			||||||
 | 
					--Localization colors
 | 
				
			||||||
 | 
					local lc = loc_colour
 | 
				
			||||||
 | 
					function loc_colour(_c, _default)
 | 
				
			||||||
 | 
						if not G.ARGS.LOC_COLOURS then
 | 
				
			||||||
 | 
							lc()
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						G.ARGS.LOC_COLOURS.cry_code = G.C.SET.Code
 | 
				
			||||||
 | 
						G.ARGS.LOC_COLOURS.heart = G.C.SUITS.Hearts
 | 
				
			||||||
 | 
						G.ARGS.LOC_COLOURS.diamond = G.C.SUITS.Diamonds
 | 
				
			||||||
 | 
						G.ARGS.LOC_COLOURS.spade = G.C.SUITS.Spades
 | 
				
			||||||
 | 
						G.ARGS.LOC_COLOURS.club = G.C.SUITS.Clubs
 | 
				
			||||||
 | 
						for k, v in pairs(G.C) do
 | 
				
			||||||
 | 
							if string.len(k) > 4 and string.sub(k, 1, 4) == "CRY_" then
 | 
				
			||||||
 | 
								G.ARGS.LOC_COLOURS[string.lower(k)] = v
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return lc(_c, _default)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- More advanced version of find joker for things that need to find very specific things
 | 
				
			||||||
 | 
					function advanced_find_joker(name, rarity, edition, ability, non_debuff, area)
 | 
				
			||||||
 | 
						local jokers = {}
 | 
				
			||||||
 | 
						if not G.jokers or not G.jokers.cards then
 | 
				
			||||||
 | 
							return {}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local filter = 0
 | 
				
			||||||
 | 
						if name then
 | 
				
			||||||
 | 
							filter = filter + 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if edition then
 | 
				
			||||||
 | 
							filter = filter + 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if type(rarity) ~= "table" then
 | 
				
			||||||
 | 
							if type(rarity) == "string" then
 | 
				
			||||||
 | 
								rarity = { rarity }
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								rarity = nil
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if rarity then
 | 
				
			||||||
 | 
							filter = filter + 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if type(ability) ~= "table" then
 | 
				
			||||||
 | 
							if type(ability) == "string" then
 | 
				
			||||||
 | 
								ability = { ability }
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								ability = nil
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if ability then
 | 
				
			||||||
 | 
							filter = filter + 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						-- return nothing if function is called with no useful arguments
 | 
				
			||||||
 | 
						if filter == 0 then
 | 
				
			||||||
 | 
							return {}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if not area or area == "j" then
 | 
				
			||||||
 | 
							for k, v in pairs(G.jokers.cards) do
 | 
				
			||||||
 | 
								if v and type(v) == "table" and (non_debuff or not v.debuff) then
 | 
				
			||||||
 | 
									local check = 0
 | 
				
			||||||
 | 
									if name and v.ability.name == name then
 | 
				
			||||||
 | 
										check = check + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if
 | 
				
			||||||
 | 
										edition
 | 
				
			||||||
 | 
										and (v.edition and v.edition.key == edition) --[[ make this use safe_get later? if it's possible anyways]]
 | 
				
			||||||
 | 
									then
 | 
				
			||||||
 | 
										check = check + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if rarity then
 | 
				
			||||||
 | 
										--Passes as valid if rarity matches ANY of the values in the rarity table
 | 
				
			||||||
 | 
										for _, a in ipairs(rarity) do
 | 
				
			||||||
 | 
											if v.config.center.rarity == a then
 | 
				
			||||||
 | 
												check = check + 1
 | 
				
			||||||
 | 
												break
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if ability then
 | 
				
			||||||
 | 
										--Only passes if the joker has everything in the ability table
 | 
				
			||||||
 | 
										local abilitycheck = true
 | 
				
			||||||
 | 
										for _, b in ipairs(ability) do
 | 
				
			||||||
 | 
											if not v.ability[b] then
 | 
				
			||||||
 | 
												abilitycheck = false
 | 
				
			||||||
 | 
												break
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if abilitycheck then
 | 
				
			||||||
 | 
											check = check + 1
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if check == filter then
 | 
				
			||||||
 | 
										table.insert(jokers, v)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if not area or area == "c" then
 | 
				
			||||||
 | 
							for k, v in pairs(G.consumeables.cards) do
 | 
				
			||||||
 | 
								if v and type(v) == "table" and (non_debuff or not v.debuff) then
 | 
				
			||||||
 | 
									local check = 0
 | 
				
			||||||
 | 
									if name and v.ability.name == name then
 | 
				
			||||||
 | 
										check = check + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if
 | 
				
			||||||
 | 
										edition
 | 
				
			||||||
 | 
										and (v.edition and v.edition.key == edition) --[[ make this use safe_get later? if it's possible anyways]]
 | 
				
			||||||
 | 
									then
 | 
				
			||||||
 | 
										check = check + 1
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if ability then
 | 
				
			||||||
 | 
										--Only passes if the joker has everything in the ability table
 | 
				
			||||||
 | 
										local abilitycheck = true
 | 
				
			||||||
 | 
										for _, b in ipairs(ability) do
 | 
				
			||||||
 | 
											if not v.ability[b] then
 | 
				
			||||||
 | 
												abilitycheck = false
 | 
				
			||||||
 | 
												break
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if abilitycheck then
 | 
				
			||||||
 | 
											check = check + 1
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									--Consumables don't have a rarity, so this should ignore it in that case (untested lmfao)
 | 
				
			||||||
 | 
									if check == filter then
 | 
				
			||||||
 | 
										table.insert(jokers, v)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return jokers
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Midground sprites - used for Exotic Jokers and Gateway
 | 
				
			||||||
 | 
					-- don't really feel like explaining this deeply, it's based on code for The Soul and Legendary Jokers
 | 
				
			||||||
 | 
					local set_spritesref = Card.set_sprites
 | 
				
			||||||
 | 
					function Card:set_sprites(_center, _front)
 | 
				
			||||||
 | 
						set_spritesref(self, _center, _front)
 | 
				
			||||||
 | 
						if _center and _center.name == "cry-Gateway" then
 | 
				
			||||||
 | 
							self.children.floating_sprite = Sprite(
 | 
				
			||||||
 | 
								self.T.x,
 | 
				
			||||||
 | 
								self.T.y,
 | 
				
			||||||
 | 
								self.T.w,
 | 
				
			||||||
 | 
								self.T.h,
 | 
				
			||||||
 | 
								G.ASSET_ATLAS[_center.atlas or _center.set],
 | 
				
			||||||
 | 
								{ x = 2, y = 0 }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							self.children.floating_sprite.role.draw_major = self
 | 
				
			||||||
 | 
							self.children.floating_sprite.states.hover.can = false
 | 
				
			||||||
 | 
							self.children.floating_sprite.states.click.can = false
 | 
				
			||||||
 | 
							self.children.floating_sprite2 = Sprite(
 | 
				
			||||||
 | 
								self.T.x,
 | 
				
			||||||
 | 
								self.T.y,
 | 
				
			||||||
 | 
								self.T.w,
 | 
				
			||||||
 | 
								self.T.h,
 | 
				
			||||||
 | 
								G.ASSET_ATLAS[_center.atlas or _center.set],
 | 
				
			||||||
 | 
								{ x = 1, y = 0 }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							self.children.floating_sprite2.role.draw_major = self
 | 
				
			||||||
 | 
							self.children.floating_sprite2.states.hover.can = false
 | 
				
			||||||
 | 
							self.children.floating_sprite2.states.click.can = false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if _center and _center.soul_pos and _center.soul_pos.extra then
 | 
				
			||||||
 | 
							self.children.floating_sprite2 = Sprite(
 | 
				
			||||||
 | 
								self.T.x,
 | 
				
			||||||
 | 
								self.T.y,
 | 
				
			||||||
 | 
								self.T.w,
 | 
				
			||||||
 | 
								self.T.h,
 | 
				
			||||||
 | 
								G.ASSET_ATLAS[_center.atlas or _center.set],
 | 
				
			||||||
 | 
								_center.soul_pos.extra
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							self.children.floating_sprite2.role.draw_major = self
 | 
				
			||||||
 | 
							self.children.floating_sprite2.states.hover.can = false
 | 
				
			||||||
 | 
							self.children.floating_sprite2.states.click.can = false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function cry_edition_to_table(edition) -- look mom i figured it out (this does NOT need to be a function)
 | 
				
			||||||
 | 
						if edition then
 | 
				
			||||||
 | 
							return { [edition] = true }
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- simple plural s function for localisation
 | 
				
			||||||
 | 
					function cry_pls(str, vars)
 | 
				
			||||||
 | 
						if string.sub(str, 1, 1) == "p" or string.sub(str, 1, 1) == "s" or string.sub(str, 1, 1) == "y" then
 | 
				
			||||||
 | 
							num = vars[tonumber(string.sub(str, 2, -1))]
 | 
				
			||||||
 | 
							if num then
 | 
				
			||||||
 | 
								if math.abs(to_big(num) - 1) > to_big(0.001) then
 | 
				
			||||||
 | 
									return string.sub(str, 1, 1) == "y" and "ies" or "s"
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									return string.sub(str, 1, 1) == "y" and "y" or ""
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return false -- idk it doesn't really matter
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- generate a random edition (e.g. Antimatter Deck)
 | 
				
			||||||
 | 
					function cry_poll_random_edition()
 | 
				
			||||||
 | 
						local random_edition = pseudorandom_element(G.P_CENTER_POOLS.Edition, pseudoseed("cry_ant_edition"))
 | 
				
			||||||
 | 
						while random_edition.key == "e_base" do
 | 
				
			||||||
 | 
							random_edition = pseudorandom_element(G.P_CENTER_POOLS.Edition, pseudoseed("cry_ant_edition"))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						ed_table = { [random_edition.key:sub(3)] = true }
 | 
				
			||||||
 | 
						return ed_table
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- gets a random, valid consumeable (used for Hammerspace, CCD Deck, Blessing, etc.)
 | 
				
			||||||
 | 
					function get_random_consumable(seed, excluded_flags, banned_card, pool, no_undiscovered)
 | 
				
			||||||
 | 
						-- set up excluded flags - these are the kinds of consumables we DON'T want to have generating
 | 
				
			||||||
 | 
						excluded_flags = excluded_flags or { "hidden", "no_doe", "no_grc" }
 | 
				
			||||||
 | 
						local selection = "n/a"
 | 
				
			||||||
 | 
						local passes = 0
 | 
				
			||||||
 | 
						local tries = 500
 | 
				
			||||||
 | 
						while true do
 | 
				
			||||||
 | 
							tries = tries - 1
 | 
				
			||||||
 | 
							passes = 0
 | 
				
			||||||
 | 
							-- create a random consumable naively
 | 
				
			||||||
 | 
							local key = pseudorandom_element(pool or G.P_CENTER_POOLS.Consumeables, pseudoseed(seed or "grc")).key
 | 
				
			||||||
 | 
							selection = G.P_CENTERS[key]
 | 
				
			||||||
 | 
							-- check if it is valid
 | 
				
			||||||
 | 
							if selection.discovered or not no_undiscovered then
 | 
				
			||||||
 | 
								for k, v in pairs(excluded_flags) do
 | 
				
			||||||
 | 
									if not center_no(selection, v, key, true) then
 | 
				
			||||||
 | 
										--Makes the consumable invalid if it's a specific card unless it's set to
 | 
				
			||||||
 | 
										--I use this so cards don't create copies of themselves (eg potential inf Blessing chain, Hammerspace from Hammerspace...)
 | 
				
			||||||
 | 
										if not banned_card or (banned_card and banned_card ~= key) then
 | 
				
			||||||
 | 
											passes = passes + 1
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							-- use it if it's valid or we've run out of attempts
 | 
				
			||||||
 | 
							if passes >= #excluded_flags or tries <= 0 then
 | 
				
			||||||
 | 
								if tries <= 0 and no_undiscovered then
 | 
				
			||||||
 | 
									return G.P_CENTERS["c_strength"]
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									return selection
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- checks for Jolly Jokers or cards that are supposed to be treated as jolly jokers
 | 
				
			||||||
 | 
					function Card:is_jolly()
 | 
				
			||||||
 | 
						if self.ability.name == "Jolly Joker" then
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if self.edition and self.edition.key == "e_cry_m" then
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function cry_with_deck_effects(card, func)
 | 
				
			||||||
 | 
						if not card.added_to_deck then
 | 
				
			||||||
 | 
							return func(card)
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							card:remove_from_deck(true)
 | 
				
			||||||
 | 
							local ret = func(card)
 | 
				
			||||||
 | 
							card:add_to_deck(true)
 | 
				
			||||||
 | 
							return ret
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function cry_deep_copy(obj, seen)
 | 
				
			||||||
 | 
						if type(obj) ~= "table" then
 | 
				
			||||||
 | 
							return obj
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if seen and seen[obj] then
 | 
				
			||||||
 | 
							return seen[obj]
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local s = seen or {}
 | 
				
			||||||
 | 
						local res = setmetatable({}, getmetatable(obj))
 | 
				
			||||||
 | 
						s[obj] = res
 | 
				
			||||||
 | 
						for k, v in pairs(obj) do
 | 
				
			||||||
 | 
							res[cry_deep_copy(k, s)] = cry_deep_copy(v, s)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return res
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function SMODS.current_mod.reset_game_globals(run_start)
 | 
				
			||||||
 | 
						G.GAME.cry_ach_conditions = G.GAME.cry_ach_conditions or {}
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Used for m vouchers, perhaps this can have more applications in the future
 | 
				
			||||||
 | 
					function get_m_jokers()
 | 
				
			||||||
 | 
						local mcount = 0
 | 
				
			||||||
 | 
						if G.jokers then
 | 
				
			||||||
 | 
							for i = 1, #G.jokers.cards do
 | 
				
			||||||
 | 
								if safe_get(G.jokers.cards[i], "pools", "M") then
 | 
				
			||||||
 | 
									mcount = mcount + 1
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								if G.jokers.cards[i].ability.name == "cry-mprime" then
 | 
				
			||||||
 | 
									mcount = mcount + 1
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return mcount
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Check G.GAME as well as joker info for banned keys
 | 
				
			||||||
 | 
					function Card:no(m, no_no)
 | 
				
			||||||
 | 
						if no_no then
 | 
				
			||||||
 | 
							-- Infinifusion Compat
 | 
				
			||||||
 | 
							if self.infinifusion then
 | 
				
			||||||
 | 
								for i = 1, #self.infinifusion do
 | 
				
			||||||
 | 
									if
 | 
				
			||||||
 | 
										G.P_CENTERS[self.infinifusion[i].key][m]
 | 
				
			||||||
 | 
										or (G.GAME and G.GAME[m] and G.GAME[m][self.infinifusion[i].key])
 | 
				
			||||||
 | 
									then
 | 
				
			||||||
 | 
										return true
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if not self.config then
 | 
				
			||||||
 | 
								--assume this is from one component of infinifusion
 | 
				
			||||||
 | 
								return G.P_CENTERS[self.key][m] or (G.GAME and G.GAME[m] and G.GAME[m][self.key])
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return self.config.center[m] or (G.GAME and G.GAME[m] and G.GAME[m][self.config.center_key]) or false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return Card.no(self, "no_" .. m, true)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function center_no(center, m, key, no_no)
 | 
				
			||||||
 | 
						if no_no then
 | 
				
			||||||
 | 
							return center[m] or (G.GAME and G.GAME[m] and G.GAME[m][key]) or false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return center_no(center, "no_" .. m, key, true)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--todo: move to respective stake file
 | 
				
			||||||
 | 
					--[from pre-refactor] make this always active to prevent crashes
 | 
				
			||||||
 | 
					function cry_apply_ante_tax()
 | 
				
			||||||
 | 
						if G.GAME.modifiers.cry_ante_tax then
 | 
				
			||||||
 | 
							local tax = math.max(
 | 
				
			||||||
 | 
								0,
 | 
				
			||||||
 | 
								math.min(G.GAME.modifiers.cry_ante_tax_max, math.floor(G.GAME.modifiers.cry_ante_tax * G.GAME.dollars))
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							ease_dollars(-1 * tax)
 | 
				
			||||||
 | 
							return true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Changes main menu colors and stuff
 | 
				
			||||||
 | 
					--has to be modified with new enabling system
 | 
				
			||||||
 | 
					if true then --Cryptid.enabled["Menu"] then
 | 
				
			||||||
 | 
						local oldfunc = Game.main_menu
 | 
				
			||||||
 | 
						Game.main_menu = function(change_context)
 | 
				
			||||||
 | 
							local ret = oldfunc(change_context)
 | 
				
			||||||
 | 
							-- adds a Cryptid spectral to the main menu
 | 
				
			||||||
 | 
							local newcard = Card(
 | 
				
			||||||
 | 
								G.title_top.T.x,
 | 
				
			||||||
 | 
								G.title_top.T.y,
 | 
				
			||||||
 | 
								G.CARD_W,
 | 
				
			||||||
 | 
								G.CARD_H,
 | 
				
			||||||
 | 
								G.P_CARDS.empty,
 | 
				
			||||||
 | 
								G.P_CENTERS.c_cryptid,
 | 
				
			||||||
 | 
								{ bypass_discovery_center = true }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							-- recenter the title
 | 
				
			||||||
 | 
							G.title_top.T.w = G.title_top.T.w * 1.7675
 | 
				
			||||||
 | 
							G.title_top.T.x = G.title_top.T.x - 0.8
 | 
				
			||||||
 | 
							G.title_top:emplace(newcard)
 | 
				
			||||||
 | 
							-- make the card look the same way as the title screen Ace of Spades
 | 
				
			||||||
 | 
							newcard.T.w = newcard.T.w * 1.1 * 1.2
 | 
				
			||||||
 | 
							newcard.T.h = newcard.T.h * 1.1 * 1.2
 | 
				
			||||||
 | 
							newcard.no_ui = true
 | 
				
			||||||
 | 
							newcard.states.visible = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							-- make the title screen use different background colors
 | 
				
			||||||
 | 
							G.SPLASH_BACK:define_draw_steps({
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									shader = "splash",
 | 
				
			||||||
 | 
									send = {
 | 
				
			||||||
 | 
										{ name = "time", ref_table = G.TIMERS, ref_value = "REAL_SHADER" },
 | 
				
			||||||
 | 
										{ name = "vort_speed", val = 0.4 },
 | 
				
			||||||
 | 
										{ name = "colour_1", ref_table = G.C, ref_value = "CRY_EXOTIC" },
 | 
				
			||||||
 | 
										{ name = "colour_2", ref_table = G.C, ref_value = "DARK_EDITION" },
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								trigger = "after",
 | 
				
			||||||
 | 
								delay = 0,
 | 
				
			||||||
 | 
								blockable = false,
 | 
				
			||||||
 | 
								blocking = false,
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									if change_context == "splash" then
 | 
				
			||||||
 | 
										newcard.states.visible = true
 | 
				
			||||||
 | 
										newcard:start_materialize({ G.C.WHITE, G.C.WHITE }, true, 2.5)
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										newcard.states.visible = true
 | 
				
			||||||
 | 
										newcard:start_materialize({ G.C.WHITE, G.C.WHITE }, nil, 1.2)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return ret
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- just dumping this garbage here
 | 
				
			||||||
 | 
					-- this just ensures that extra voucher slots work as expected
 | 
				
			||||||
 | 
					function cry_bonusvouchermod(mod)
 | 
				
			||||||
 | 
						if not G.GAME.shop then
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						G.GAME.cry_bonusvouchercount = G.GAME.cry_bonusvouchercount + mod
 | 
				
			||||||
 | 
						if G.shop_jokers and G.shop_jokers.cards then
 | 
				
			||||||
 | 
							G.shop:recalculate()
 | 
				
			||||||
 | 
							if mod > 0 then -- not doing minus mod because it'd be janky and who really cares
 | 
				
			||||||
 | 
								for i = 1, G.GAME.cry_bonusvouchercount + 1 - #G.shop_vouchers.cards do
 | 
				
			||||||
 | 
									local curr_bonus = G.GAME.current_round.cry_bonusvouchers
 | 
				
			||||||
 | 
									curr_bonus[#curr_bonus + 1] = get_next_voucher_key()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									-- this could be a function but it's done like what... 3 times? it doesn't matter rn
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									local card = Card(
 | 
				
			||||||
 | 
										G.shop_vouchers.T.x + G.shop_vouchers.T.w / 2,
 | 
				
			||||||
 | 
										G.shop_vouchers.T.y,
 | 
				
			||||||
 | 
										G.CARD_W,
 | 
				
			||||||
 | 
										G.CARD_H,
 | 
				
			||||||
 | 
										G.P_CARDS.empty,
 | 
				
			||||||
 | 
										G.P_CENTERS[curr_bonus[#curr_bonus]],
 | 
				
			||||||
 | 
										{ bypass_discovery_center = true, bypass_discovery_ui = true }
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
									card.shop_cry_bonusvoucher = #curr_bonus
 | 
				
			||||||
 | 
									cry_misprintize(card)
 | 
				
			||||||
 | 
									if G.GAME.events.ev_cry_choco2 then
 | 
				
			||||||
 | 
										card.misprint_cost_fac = (card.misprint_cost_fac or 1) * 2
 | 
				
			||||||
 | 
										card:set_cost()
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									if
 | 
				
			||||||
 | 
										G.GAME.modifiers.cry_enable_flipped_in_shop
 | 
				
			||||||
 | 
										and pseudorandom("cry_flip_vouch" .. G.GAME.round_resets.ante) > 0.7
 | 
				
			||||||
 | 
									then
 | 
				
			||||||
 | 
										card.cry_flipped = true
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									create_shop_card_ui(card, "Voucher", G.shop_vouchers)
 | 
				
			||||||
 | 
									card:start_materialize()
 | 
				
			||||||
 | 
									if G.GAME.current_round.cry_voucher_edition then
 | 
				
			||||||
 | 
										card:set_edition(G.GAME.current_round.cry_voucher_edition, true, true)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									G.shop_vouchers.config.card_limit = G.shop_vouchers.config.card_limit + 1
 | 
				
			||||||
 | 
									G.shop_vouchers:emplace(card)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Cryptid.big_num_whitelist = {
 | 
				
			||||||
 | 
						j_ride_the_bus = true,
 | 
				
			||||||
 | 
						j_egg = true,
 | 
				
			||||||
 | 
						j_runner = true,
 | 
				
			||||||
 | 
						j_ice_cream = true,
 | 
				
			||||||
 | 
						j_constellation = true,
 | 
				
			||||||
 | 
						j_green_joker = true,
 | 
				
			||||||
 | 
						j_red_card = true,
 | 
				
			||||||
 | 
						j_madness = true,
 | 
				
			||||||
 | 
						j_square = true,
 | 
				
			||||||
 | 
						j_vampire = true,
 | 
				
			||||||
 | 
						j_hologram = true,
 | 
				
			||||||
 | 
						j_obelisk = true,
 | 
				
			||||||
 | 
						j_turtle_bean = true,
 | 
				
			||||||
 | 
						j_lucky_cat = true,
 | 
				
			||||||
 | 
						j_flash = true,
 | 
				
			||||||
 | 
						j_popcorn = true,
 | 
				
			||||||
 | 
						j_trousers = true,
 | 
				
			||||||
 | 
						j_ramen = true,
 | 
				
			||||||
 | 
						j_castle = true,
 | 
				
			||||||
 | 
						j_campfire = true,
 | 
				
			||||||
 | 
						j_throwback = true,
 | 
				
			||||||
 | 
						j_glass = true,
 | 
				
			||||||
 | 
						j_wee = true,
 | 
				
			||||||
 | 
						j_hit_the_road = true,
 | 
				
			||||||
 | 
						j_caino = true,
 | 
				
			||||||
 | 
						j_yorick = true,
 | 
				
			||||||
 | 
						-- Once all Cryptid Jokers get support for this, these can be removed
 | 
				
			||||||
 | 
						j_cry_dropshot = true,
 | 
				
			||||||
 | 
						j_cry_wee_fib = true,
 | 
				
			||||||
 | 
						j_cry_whip = true,
 | 
				
			||||||
 | 
						j_cry_pickle = true,
 | 
				
			||||||
 | 
						j_cry_chili_pepper = true,
 | 
				
			||||||
 | 
						j_cry_cursor = true,
 | 
				
			||||||
 | 
						j_cry_jimball = true,
 | 
				
			||||||
 | 
						j_cry_eternalflame = true,
 | 
				
			||||||
 | 
						j_cry_fspinner = true,
 | 
				
			||||||
 | 
						j_cry_krustytheclown = true,
 | 
				
			||||||
 | 
						j_cry_antennastoheaven = true,
 | 
				
			||||||
 | 
						j_cry_mondrian = true,
 | 
				
			||||||
 | 
						j_cry_spaceglobe = true,
 | 
				
			||||||
 | 
						j_cry_m = true,
 | 
				
			||||||
 | 
						j_cry_exponentia = true,
 | 
				
			||||||
 | 
						j_cry_crustulum = true,
 | 
				
			||||||
 | 
						j_cry_primus = true,
 | 
				
			||||||
 | 
						j_cry_stella_mortis = true,
 | 
				
			||||||
 | 
						j_cry_hugem = true,
 | 
				
			||||||
 | 
						j_cry_mprime = true,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function is_card_big(joker)
 | 
				
			||||||
 | 
						local center = joker.config and joker.config.center
 | 
				
			||||||
 | 
						if not center then
 | 
				
			||||||
 | 
							return false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return Cryptid.big_num_whitelist[center.key or "Nope!"] --[[or
 | 
				
			||||||
 | 
						       (center.mod and center.mod.id == "Cryptid" and not center.no_break_infinity) or center.break_infinity--]]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Utility function to check things without erroring
 | 
				
			||||||
 | 
					function safe_get(t, ...)
 | 
				
			||||||
 | 
						local current = t
 | 
				
			||||||
 | 
						for _, k in ipairs({ ... }) do
 | 
				
			||||||
 | 
							if current[k] == nil then
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							current = current[k]
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return current
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					--Functions used by boss blinds
 | 
				
			||||||
 | 
					function Blind:cry_ante_base_mod(dt)
 | 
				
			||||||
 | 
						if not self.disabled then
 | 
				
			||||||
 | 
							local obj = self.config.blind
 | 
				
			||||||
 | 
							if obj.cry_ante_base_mod and type(obj.cry_ante_base_mod) == "function" then
 | 
				
			||||||
 | 
								return obj:cry_ante_base_mod(dt)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return 0
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Blind:cry_round_base_mod(dt)
 | 
				
			||||||
 | 
						if not self.disabled then
 | 
				
			||||||
 | 
							local obj = self.config.blind
 | 
				
			||||||
 | 
							if obj.cry_round_base_mod and type(obj.cry_round_base_mod) == "function" then
 | 
				
			||||||
 | 
								return obj:cry_round_base_mod(dt)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return 1
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Blind:cry_cap_score(score)
 | 
				
			||||||
 | 
						if not self.disabled then
 | 
				
			||||||
 | 
							local obj = self.config.blind
 | 
				
			||||||
 | 
							if obj.cry_cap_score and type(obj.cry_cap_score) == "function" then
 | 
				
			||||||
 | 
								return obj:cry_cap_score(score)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return score
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Blind:cry_after_play()
 | 
				
			||||||
 | 
						if not self.disabled then
 | 
				
			||||||
 | 
							local obj = self.config.blind
 | 
				
			||||||
 | 
							if obj.cry_after_play and type(obj.cry_after_play) == "function" then
 | 
				
			||||||
 | 
								return obj:cry_after_play()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Blind:cry_before_play()
 | 
				
			||||||
 | 
						if not self.disabled then
 | 
				
			||||||
 | 
							local obj = self.config.blind
 | 
				
			||||||
 | 
							if obj.cry_before_play and type(obj.cry_before_play) == "function" then
 | 
				
			||||||
 | 
								return obj:cry_before_play()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Blind:cry_calc_ante_gain()
 | 
				
			||||||
 | 
						if G.GAME.modifiers.cry_spooky then --here is the best place to check when spooky should apply
 | 
				
			||||||
 | 
							local card
 | 
				
			||||||
 | 
							if pseudorandom(pseudoseed("cry_spooky_curse")) < G.GAME.modifiers.cry_curse_rate then
 | 
				
			||||||
 | 
								card = create_card("Joker", G.jokers, nil, "cry_cursed", nil, nil, nil, "cry_spooky")
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								card = create_card("Joker", G.jokers, nil, "cry_candy", nil, nil, nil, "cry_spooky")
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							card:add_to_deck()
 | 
				
			||||||
 | 
							card:start_materialize()
 | 
				
			||||||
 | 
							G.jokers:emplace(card)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if not self.disabled then
 | 
				
			||||||
 | 
							local obj = self.config.blind
 | 
				
			||||||
 | 
							if obj.cry_calc_ante_gain and type(obj.cry_calc_ante_gain) == "function" then
 | 
				
			||||||
 | 
								return obj:cry_calc_ante_gain()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return 1
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_get_enchanced_deck_info(deck)
 | 
				
			||||||
 | 
						--only accounts for vanilla stuff at the moment (WIP)
 | 
				
			||||||
 | 
						local edition, enhancement, sticker, suit, seal =
 | 
				
			||||||
 | 
							"e_" .. (safe_get(G.PROFILES, G.SETTINGS.profile, "cry_edeck_edition") or "foil"),
 | 
				
			||||||
 | 
							safe_get(G.PROFILES, G.SETTINGS.profile, "cry_edeck_enhancement") or "m_bonus",
 | 
				
			||||||
 | 
							safe_get(G.PROFILES, G.SETTINGS.profile, "cry_edeck_sticker") or "eternal",
 | 
				
			||||||
 | 
							safe_get(G.PROFILES, G.SETTINGS.profile, "cry_edeck_suit") or "Spades",
 | 
				
			||||||
 | 
							safe_get(G.PROFILES, G.SETTINGS.profile, "cry_edeck_seal") or "Gold"
 | 
				
			||||||
 | 
						-- Do Stuff
 | 
				
			||||||
 | 
						edition = (safe_get(G.P_CENTERS, edition) and edition or "e_foil"):sub(3)
 | 
				
			||||||
 | 
						enhancement = safe_get(G.P_CENTERS, enhancement) and enhancement or "m_bonus"
 | 
				
			||||||
 | 
						sticker = safe_get(SMODS.Stickers, sticker) and sticker or "eternal"
 | 
				
			||||||
 | 
						suit = safe_get(SMODS.Suits, suit) and suit or "Spades"
 | 
				
			||||||
 | 
						seal = safe_get(G.P_SEALS, seal) and seal or "Gold"
 | 
				
			||||||
 | 
						local ret = {
 | 
				
			||||||
 | 
							edition = edition,
 | 
				
			||||||
 | 
							enhancement = enhancement,
 | 
				
			||||||
 | 
							sticker = sticker,
 | 
				
			||||||
 | 
							suit = suit,
 | 
				
			||||||
 | 
							seal = seal,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for k, _ in pairs(ret) do
 | 
				
			||||||
 | 
							if G.GAME.modifiers["cry_force_" .. k] and not G.GAME.viewed_back then
 | 
				
			||||||
 | 
								ret[k] = G.GAME.modifiers["cry_force_" .. k]
 | 
				
			||||||
 | 
							elseif safe_get(deck, "config", "cry_force_" .. k) then
 | 
				
			||||||
 | 
								ret[k] = deck.config["cry_force_" .. k]
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return ret.edition, ret.enhancement, ret.sticker, ret.suit, ret.seal
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Cryptid.post_process(center)
 | 
				
			||||||
 | 
						if center.pools and center.pools.M then
 | 
				
			||||||
 | 
							local vc = center.calculate
 | 
				
			||||||
 | 
							center.calculate = function(self, card, context)
 | 
				
			||||||
 | 
								local ret, trig = vc(self, card, context)
 | 
				
			||||||
 | 
								if context.retrigger_joker_check and context.other_card == card then
 | 
				
			||||||
 | 
									local reps = get_m_retriggers(self, card, context)
 | 
				
			||||||
 | 
									if reps > 0 then
 | 
				
			||||||
 | 
										return {
 | 
				
			||||||
 | 
											message = localize("k_again_ex"),
 | 
				
			||||||
 | 
											repetitions = reps + (ret and ret.repetitions or 0),
 | 
				
			||||||
 | 
											card = card,
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								return ret, trig
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Wrapper G.FUNCS function to reset localization
 | 
				
			||||||
 | 
					-- For resetting localization on the fly for family friendly toggle
 | 
				
			||||||
 | 
					function reload_cryptid_localization()
 | 
				
			||||||
 | 
						SMODS.handle_loc_file(Cryptid.path)
 | 
				
			||||||
 | 
						return init_localization()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										205
									
								
								Cryptid/lib/misprintize.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,205 @@
 | 
				
			||||||
 | 
					-- misprintize.lua - functions for card value randomization
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--Redefine these here because they're always used
 | 
				
			||||||
 | 
					Cryptid.base_values = {}
 | 
				
			||||||
 | 
					function cry_misprintize_tbl(name, ref_tbl, ref_value, clear, override, stack, big)
 | 
				
			||||||
 | 
						if name and ref_tbl and ref_value then
 | 
				
			||||||
 | 
							tbl = cry_deep_copy(ref_tbl[ref_value])
 | 
				
			||||||
 | 
							for k, v in pairs(tbl) do
 | 
				
			||||||
 | 
								if (type(tbl[k]) ~= "table") or is_number(tbl[k]) then
 | 
				
			||||||
 | 
									if
 | 
				
			||||||
 | 
										is_number(tbl[k])
 | 
				
			||||||
 | 
										and not (k == "id")
 | 
				
			||||||
 | 
										and not (k == "colour")
 | 
				
			||||||
 | 
										and not (k == "suit_nominal")
 | 
				
			||||||
 | 
										and not (k == "base_nominal")
 | 
				
			||||||
 | 
										and not (k == "face_nominal")
 | 
				
			||||||
 | 
										and not (k == "qty")
 | 
				
			||||||
 | 
										and not (k == "x_mult" and v == 1 and not tbl.override_x_mult_check)
 | 
				
			||||||
 | 
										and not (k == "selected_d6_face")
 | 
				
			||||||
 | 
									then --Temp fix, even if I did clamp the number to values that wouldn't crash the game, the fact that it did get randomized means that there's a higher chance for 1 or 6 than other values
 | 
				
			||||||
 | 
										if not Cryptid.base_values[name] then
 | 
				
			||||||
 | 
											Cryptid.base_values[name] = {}
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										if not Cryptid.base_values[name][k] then
 | 
				
			||||||
 | 
											Cryptid.base_values[name][k] = tbl[k]
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
										tbl[k] = cry_sanity_check(
 | 
				
			||||||
 | 
											clear and Cryptid.base_values[name][k]
 | 
				
			||||||
 | 
												or cry_format(
 | 
				
			||||||
 | 
													(stack and tbl[k] or Cryptid.base_values[name][k])
 | 
				
			||||||
 | 
														* cry_log_random(
 | 
				
			||||||
 | 
															pseudoseed("cry_misprint" .. G.GAME.round_resets.ante),
 | 
				
			||||||
 | 
															override and override.min or G.GAME.modifiers.cry_misprint_min,
 | 
				
			||||||
 | 
															override and override.max or G.GAME.modifiers.cry_misprint_max
 | 
				
			||||||
 | 
														),
 | 
				
			||||||
 | 
													"%.2g"
 | 
				
			||||||
 | 
												),
 | 
				
			||||||
 | 
											big
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									for _k, _v in pairs(tbl[k]) do
 | 
				
			||||||
 | 
										if
 | 
				
			||||||
 | 
											is_number(tbl[k][_k])
 | 
				
			||||||
 | 
											and not (_k == "id")
 | 
				
			||||||
 | 
											and not (k == "perish_tally")
 | 
				
			||||||
 | 
											and not (k == "colour")
 | 
				
			||||||
 | 
											and not (_k == "suit_nominal")
 | 
				
			||||||
 | 
											and not (_k == "base_nominal")
 | 
				
			||||||
 | 
											and not (_k == "face_nominal")
 | 
				
			||||||
 | 
											and not (_k == "qty")
 | 
				
			||||||
 | 
											and not (k == "x_mult" and v == 1 and not tbl[k].override_x_mult_check)
 | 
				
			||||||
 | 
											and not (_k == "selected_d6_face")
 | 
				
			||||||
 | 
										then --Refer to above
 | 
				
			||||||
 | 
											if not Cryptid.base_values[name] then
 | 
				
			||||||
 | 
												Cryptid.base_values[name] = {}
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											if not Cryptid.base_values[name][k] then
 | 
				
			||||||
 | 
												Cryptid.base_values[name][k] = {}
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											if not Cryptid.base_values[name][k][_k] then
 | 
				
			||||||
 | 
												Cryptid.base_values[name][k][_k] = tbl[k][_k]
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											tbl[k][_k] = cry_sanity_check(
 | 
				
			||||||
 | 
												clear and Cryptid.base_values[name][k][_k]
 | 
				
			||||||
 | 
													or cry_format(
 | 
				
			||||||
 | 
														(stack and tbl[k][_k] or Cryptid.base_values[name][k][_k])
 | 
				
			||||||
 | 
															* cry_log_random(
 | 
				
			||||||
 | 
																pseudoseed("cry_misprint" .. G.GAME.round_resets.ante),
 | 
				
			||||||
 | 
																override and override.min or G.GAME.modifiers.cry_misprint_min,
 | 
				
			||||||
 | 
																override and override.max or G.GAME.modifiers.cry_misprint_max
 | 
				
			||||||
 | 
															),
 | 
				
			||||||
 | 
														"%.2g"
 | 
				
			||||||
 | 
													),
 | 
				
			||||||
 | 
												big
 | 
				
			||||||
 | 
											)
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							ref_tbl[ref_value] = tbl
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_misprintize_val(val, override, big)
 | 
				
			||||||
 | 
						if is_number(val) then
 | 
				
			||||||
 | 
							val = cry_sanity_check(
 | 
				
			||||||
 | 
								cry_format(
 | 
				
			||||||
 | 
									val
 | 
				
			||||||
 | 
										* cry_log_random(
 | 
				
			||||||
 | 
											pseudoseed("cry_misprint" .. G.GAME.round_resets.ante),
 | 
				
			||||||
 | 
											override and override.min or G.GAME.modifiers.cry_misprint_min,
 | 
				
			||||||
 | 
											override and override.max or G.GAME.modifiers.cry_misprint_max
 | 
				
			||||||
 | 
										),
 | 
				
			||||||
 | 
									"%.2g"
 | 
				
			||||||
 | 
								),
 | 
				
			||||||
 | 
								big
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return val
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_sanity_check(val, is_big)
 | 
				
			||||||
 | 
						if is_big then
 | 
				
			||||||
 | 
							if not val or type(val) == "number" and (val ~= val or val > 1e300 or val < -1e300) then
 | 
				
			||||||
 | 
								val = 1e300
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if type(val) == "table" then
 | 
				
			||||||
 | 
								return val
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if val > 1e100 or val < -1e100 then
 | 
				
			||||||
 | 
								return to_big(val)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if not val or type(val) == "number" and (val ~= val or val > 1e300 or val < -1e300) then
 | 
				
			||||||
 | 
							return 1e300
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return val
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_misprintize(card, override, force_reset, stack)
 | 
				
			||||||
 | 
						if Card.no(card, "immutable", true) then
 | 
				
			||||||
 | 
							force_reset = true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						--infinifusion compat
 | 
				
			||||||
 | 
						if card.infinifusion then
 | 
				
			||||||
 | 
							if card.config.center == card.infinifusion_center or card.config.center.key == "j_infus_fused" then
 | 
				
			||||||
 | 
								calculate_infinifusion(card, nil, function(i)
 | 
				
			||||||
 | 
									cry_misprintize(card, override, force_reset, stack)
 | 
				
			||||||
 | 
								end)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							(not force_reset or G.GAME.modifiers.cry_jkr_misprint_mod)
 | 
				
			||||||
 | 
								and (G.GAME.modifiers.cry_misprint_min or override or card.ability.set == "Joker")
 | 
				
			||||||
 | 
								and not stack
 | 
				
			||||||
 | 
							or not Card.no(card, "immutable", true)
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							if card.ability.name == "Ace Aequilibrium" then
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if G.GAME.modifiers.cry_jkr_misprint_mod and card.ability.set == "Joker" then
 | 
				
			||||||
 | 
								if not override then
 | 
				
			||||||
 | 
									override = {}
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								override.min = override.min or G.GAME.modifiers.cry_misprint_min or 1
 | 
				
			||||||
 | 
								override.max = override.max or G.GAME.modifiers.cry_misprint_max or 1
 | 
				
			||||||
 | 
								override.min = override.min * G.GAME.modifiers.cry_jkr_misprint_mod
 | 
				
			||||||
 | 
								override.max = override.max * G.GAME.modifiers.cry_jkr_misprint_mod
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if G.GAME.modifiers.cry_misprint_min or override and override.min then
 | 
				
			||||||
 | 
								cry_misprintize_tbl(card.config.center_key, card, "ability", nil, override, stack, is_card_big(card))
 | 
				
			||||||
 | 
								if card.base then
 | 
				
			||||||
 | 
									cry_misprintize_tbl(card.config.card_key, card, "base", nil, override, stack, is_card_big(card))
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if G.GAME.modifiers.cry_misprint_min then
 | 
				
			||||||
 | 
								--card.cost = cry_format(card.cost / cry_log_random(pseudoseed('cry_misprint'..G.GAME.round_resets.ante),override and override.min or G.GAME.modifiers.cry_misprint_min,override and override.max or G.GAME.modifiers.cry_misprint_max),"%.2f")
 | 
				
			||||||
 | 
								card.misprint_cost_fac = 1
 | 
				
			||||||
 | 
									/ cry_log_random(
 | 
				
			||||||
 | 
										pseudoseed("cry_misprint" .. G.GAME.round_resets.ante),
 | 
				
			||||||
 | 
										override and override.min or G.GAME.modifiers.cry_misprint_min,
 | 
				
			||||||
 | 
										override and override.max or G.GAME.modifiers.cry_misprint_max
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								card:set_cost()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							cry_misprintize_tbl(card.config.center_key, card, "ability", true, nil, nil, is_card_big(card))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if card.ability.consumeable then
 | 
				
			||||||
 | 
							for k, v in pairs(card.ability.consumeable) do
 | 
				
			||||||
 | 
								card.ability.consumeable[k] = cry_deep_copy(card.ability[k])
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_log_random(seed, min, max)
 | 
				
			||||||
 | 
						math.randomseed(seed)
 | 
				
			||||||
 | 
						local lmin = math.log(min, 2.718281828459045)
 | 
				
			||||||
 | 
						local lmax = math.log(max, 2.718281828459045)
 | 
				
			||||||
 | 
						local poll = math.random() * (lmax - lmin) + lmin
 | 
				
			||||||
 | 
						return math.exp(poll)
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function cry_format(number, str)
 | 
				
			||||||
 | 
						if math.abs(to_big(number)) >= to_big(1e300) then
 | 
				
			||||||
 | 
							return number
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return tonumber(str:format((Big and to_number(to_big(number)) or number)))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					--use ID to work with glitched/misprint
 | 
				
			||||||
 | 
					function Card:get_nominal(mod)
 | 
				
			||||||
 | 
						local mult = 1
 | 
				
			||||||
 | 
						local rank_mult = 1
 | 
				
			||||||
 | 
						if mod == "suit" then
 | 
				
			||||||
 | 
							mult = 1000000
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if self.ability.effect == "Stone Card" or (self.config.center.no_suit and self.config.center.no_rank) then
 | 
				
			||||||
 | 
							mult = -10000
 | 
				
			||||||
 | 
						elseif self.config.center.no_suit then
 | 
				
			||||||
 | 
							mult = 0
 | 
				
			||||||
 | 
						elseif self.config.center.no_rank then
 | 
				
			||||||
 | 
							rank_mult = 0
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return 10 * (self.base.id or 0.1) * rank_mult
 | 
				
			||||||
 | 
							+ self.base.suit_nominal * mult
 | 
				
			||||||
 | 
							+ (self.base.suit_nominal_original or 0) * 0.0001 * mult
 | 
				
			||||||
 | 
							+ 10 * self.base.face_nominal * rank_mult
 | 
				
			||||||
 | 
							+ 0.000001 * self.unique_val
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										890
									
								
								Cryptid/lib/modifiers.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,890 @@
 | 
				
			||||||
 | 
					-- Code to handle stickers, debuffs, etc.
 | 
				
			||||||
 | 
					-- Warning: this is a bit of a mess
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- moved unredeem and unapply functions outside of spectrals
 | 
				
			||||||
 | 
					function Card:unredeem()
 | 
				
			||||||
 | 
						if self.ability.set == "Voucher" then
 | 
				
			||||||
 | 
							stop_use()
 | 
				
			||||||
 | 
							if not self.config.center.discovered then
 | 
				
			||||||
 | 
								discover_card(self.config.center)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							self.states.hover.can = false
 | 
				
			||||||
 | 
							local top_dynatext = nil
 | 
				
			||||||
 | 
							local bot_dynatext = nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								trigger = "after",
 | 
				
			||||||
 | 
								delay = 0.4,
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									top_dynatext = DynaText({
 | 
				
			||||||
 | 
										string = localize({
 | 
				
			||||||
 | 
											type = "name_text",
 | 
				
			||||||
 | 
											set = self.config.center.set,
 | 
				
			||||||
 | 
											key = self.config.center.key,
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										colours = { G.C.RED },
 | 
				
			||||||
 | 
										rotate = 1,
 | 
				
			||||||
 | 
										shadow = true,
 | 
				
			||||||
 | 
										bump = true,
 | 
				
			||||||
 | 
										float = true,
 | 
				
			||||||
 | 
										scale = 0.9,
 | 
				
			||||||
 | 
										pop_in = 0.6 / G.SPEEDFACTOR,
 | 
				
			||||||
 | 
										pop_in_rate = 1.5 * G.SPEEDFACTOR,
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
 | 
									bot_dynatext = DynaText({
 | 
				
			||||||
 | 
										string = localize("cry_unredeemed"),
 | 
				
			||||||
 | 
										colours = { G.C.RED },
 | 
				
			||||||
 | 
										rotate = 2,
 | 
				
			||||||
 | 
										shadow = true,
 | 
				
			||||||
 | 
										bump = true,
 | 
				
			||||||
 | 
										float = true,
 | 
				
			||||||
 | 
										scale = 0.9,
 | 
				
			||||||
 | 
										pop_in = 1.4 / G.SPEEDFACTOR,
 | 
				
			||||||
 | 
										pop_in_rate = 1.5 * G.SPEEDFACTOR,
 | 
				
			||||||
 | 
										pitch_shift = 0.25,
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
 | 
									self:juice_up(0.3, 0.5)
 | 
				
			||||||
 | 
									play_sound("card1")
 | 
				
			||||||
 | 
									play_sound("timpani")
 | 
				
			||||||
 | 
									self.children.top_disp = UIBox({
 | 
				
			||||||
 | 
										definition = {
 | 
				
			||||||
 | 
											n = G.UIT.ROOT,
 | 
				
			||||||
 | 
											config = { align = "tm", r = 0.15, colour = G.C.CLEAR, padding = 0.15 },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{ n = G.UIT.O, config = { object = top_dynatext } },
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										config = { align = "tm", offset = { x = 0, y = 0 }, parent = self },
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
 | 
									self.children.bot_disp = UIBox({
 | 
				
			||||||
 | 
										definition = {
 | 
				
			||||||
 | 
											n = G.UIT.ROOT,
 | 
				
			||||||
 | 
											config = { align = "tm", r = 0.15, colour = G.C.CLEAR, padding = 0.15 },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{ n = G.UIT.O, config = { object = bot_dynatext } },
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										config = { align = "bm", offset = { x = 0, y = 0 }, parent = self },
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if not self.debuff then
 | 
				
			||||||
 | 
								self:unapply_to_run()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							delay(0.6)
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								trigger = "after",
 | 
				
			||||||
 | 
								delay = 2.6,
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									top_dynatext:pop_out(4)
 | 
				
			||||||
 | 
									bot_dynatext:pop_out(4)
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								trigger = "after",
 | 
				
			||||||
 | 
								delay = 0.5,
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									self.children.top_disp:remove()
 | 
				
			||||||
 | 
									self.children.top_disp = nil
 | 
				
			||||||
 | 
									self.children.bot_disp:remove()
 | 
				
			||||||
 | 
									self.children.bot_disp = nil
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
							func = function()
 | 
				
			||||||
 | 
								cry_update_used_vouchers()
 | 
				
			||||||
 | 
								return true
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						}))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Card:unapply_to_run(center)
 | 
				
			||||||
 | 
						local center_table = {
 | 
				
			||||||
 | 
							name = center and center.name or self and self.ability.name,
 | 
				
			||||||
 | 
							extra = self and self.ability.extra or center and center.config.extra,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						local obj = center or self.config.center
 | 
				
			||||||
 | 
						if obj.unredeem and type(obj.unredeem) == "function" then
 | 
				
			||||||
 | 
							obj:unredeem(self)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if center_table.name == "Overstock" or center_table.name == "Overstock Plus" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									change_shop_size(-center_table.extra)
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Tarot Merchant" or center_table.name == "Tarot Tycoon" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.tarot_rate = G.GAME.tarot_rate / center_table.extra
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Planet Merchant" or center_table.name == "Planet Tycoon" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.planet_rate = G.GAME.planet_rate / center_table.extra
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Hone" or center_table.name == "Glow Up" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.edition_rate = G.GAME.edition_rate / center_table.extra
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Magic Trick" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.playing_card_rate = 0
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Crystal Ball" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.consumeables.config.card_limit = G.consumeables.config.card_limit - center_table.extra
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Clearance Sale" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.discount_percent = 0
 | 
				
			||||||
 | 
									for k, v in pairs(G.I.CARD) do
 | 
				
			||||||
 | 
										if v.set_cost then
 | 
				
			||||||
 | 
											v:set_cost()
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Liquidation" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.discount_percent = 25 -- no idea why the below returns nil, so it's hardcoded now
 | 
				
			||||||
 | 
									-- G.GAME.discount_percent = G.P_CENTERS.v_clearance_sale.extra
 | 
				
			||||||
 | 
									for k, v in pairs(G.I.CARD) do
 | 
				
			||||||
 | 
										if v.set_cost then
 | 
				
			||||||
 | 
											v:set_cost()
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Reroll Surplus" or center_table.name == "Reroll Glut" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.round_resets.reroll_cost = G.GAME.round_resets.reroll_cost + self.ability.extra
 | 
				
			||||||
 | 
									G.GAME.current_round.reroll_cost = math.max(0, G.GAME.current_round.reroll_cost + self.ability.extra)
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Seed Money" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									G.GAME.interest_cap = 25 --note: does not account for potential deck effects
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Money Tree" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									if G.GAME.used_vouchers.v_seed_money then
 | 
				
			||||||
 | 
										G.GAME.interest_cap = 50
 | 
				
			||||||
 | 
									else
 | 
				
			||||||
 | 
										G.GAME.interest_cap = 25
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Grabber" or center_table.name == "Nacho Tong" then
 | 
				
			||||||
 | 
							G.GAME.round_resets.hands = G.GAME.round_resets.hands - center_table.extra
 | 
				
			||||||
 | 
							ease_hands_played(-center_table.extra)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Paint Brush" or center_table.name == "Palette" then
 | 
				
			||||||
 | 
							G.hand:change_size(-center_table.extra)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Wasteful" or center_table.name == "Recyclomancy" then
 | 
				
			||||||
 | 
							G.GAME.round_resets.discards = G.GAME.round_resets.discards - center_table.extra
 | 
				
			||||||
 | 
							ease_discard(-center_table.extra)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Antimatter" then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
								func = function()
 | 
				
			||||||
 | 
									if G.jokers then
 | 
				
			||||||
 | 
										G.jokers.config.card_limit = G.jokers.config.card_limit - center_table.extra
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end,
 | 
				
			||||||
 | 
							}))
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if center_table.name == "Hieroglyph" or center_table.name == "Petroglyph" then
 | 
				
			||||||
 | 
							ease_ante(center_table.extra)
 | 
				
			||||||
 | 
							G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante or G.GAME.round_resets.ante
 | 
				
			||||||
 | 
							G.GAME.round_resets.blind_ante = G.GAME.round_resets.blind_ante + center_table.extra
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if center_table.name == "Hieroglyph" then
 | 
				
			||||||
 | 
								G.GAME.round_resets.hands = G.GAME.round_resets.hands + center_table.extra
 | 
				
			||||||
 | 
								ease_hands_played(center_table.extra)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if center_table.name == "Petroglyph" then
 | 
				
			||||||
 | 
								G.GAME.round_resets.discards = G.GAME.round_resets.discards + center_table.extra
 | 
				
			||||||
 | 
								ease_discard(center_table.extra)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local setabilityref = Card.set_ability
 | 
				
			||||||
 | 
					function Card:set_ability(center, initial, delay_sprites)
 | 
				
			||||||
 | 
						setabilityref(self, center, initial, delay_sprites)
 | 
				
			||||||
 | 
						self.ignore_base_shader = self.ignore_base_shader or {}
 | 
				
			||||||
 | 
						self.ignore_shadow = self.ignore_shadow or {}
 | 
				
			||||||
 | 
						local function repeatcheck(comp, table)
 | 
				
			||||||
 | 
							for _, v in ipairs(table) do
 | 
				
			||||||
 | 
								if comp == v then
 | 
				
			||||||
 | 
									return true
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							return false
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local edition = nil
 | 
				
			||||||
 | 
						local sticker = nil
 | 
				
			||||||
 | 
						local random = nil
 | 
				
			||||||
 | 
						if safe_get(G, "GAME", "modifiers", "cry_force_edition") then
 | 
				
			||||||
 | 
							edition = G.GAME.modifiers.cry_force_edition
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if safe_get(G, "GAME", "modifiers", "cry_force_sticker") then
 | 
				
			||||||
 | 
							sticker = G.GAME.modifiers.cry_force_sticker
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if safe_get(G, "GAME", "modifiers", "cry_force_random_edition") then
 | 
				
			||||||
 | 
							random = true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							repeatcheck(self.ability.set, { "Joker", "Voucher", "Booster", "Base", "Enhanced" })
 | 
				
			||||||
 | 
							or self.ability.consumeable
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							if edition and not random then
 | 
				
			||||||
 | 
								self:set_edition({ [edition] = true }, true, true)
 | 
				
			||||||
 | 
							elseif random then
 | 
				
			||||||
 | 
								self:set_edition(cry_poll_random_edition(), true, true)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if sticker then
 | 
				
			||||||
 | 
								self.ability[sticker] = true
 | 
				
			||||||
 | 
								self:set_cost()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if self.ability.set == "Voucher" then
 | 
				
			||||||
 | 
							if self.ability.perishable and not self.ability.perish_tally then
 | 
				
			||||||
 | 
								self.ability.perish_tally = G.GAME.cry_voucher_perishable_rounds
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local updateref = Card.update
 | 
				
			||||||
 | 
					function Card:update(dt)
 | 
				
			||||||
 | 
						updateref(self, dt)
 | 
				
			||||||
 | 
						if self.ability.pinned then
 | 
				
			||||||
 | 
							self.pinned = true
 | 
				
			||||||
 | 
						end -- gluing these variables together
 | 
				
			||||||
 | 
						if self.pinned then
 | 
				
			||||||
 | 
							self.ability.pinned = true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local setdebuffref = Card.set_debuff
 | 
				
			||||||
 | 
					function Card:set_debuff(should_debuff)
 | 
				
			||||||
 | 
						local is_debuffed = self.debuff
 | 
				
			||||||
 | 
						setdebuffref(self, should_debuff)
 | 
				
			||||||
 | 
						if self.debuff == true and is_debuffed ~= self.debuff then
 | 
				
			||||||
 | 
							if self.ability.set == "Voucher" then
 | 
				
			||||||
 | 
								self:unapply_to_run()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local dissolveref = Card.start_dissolve
 | 
				
			||||||
 | 
					function Card:start_dissolve(dissolve_colours, silent, dissolve_time_fac, no_juice)
 | 
				
			||||||
 | 
						dissolveref(self, dissolve_colours, silent, dissolve_time_fac, no_juice)
 | 
				
			||||||
 | 
						G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
							func = function()
 | 
				
			||||||
 | 
								cry_update_used_vouchers()
 | 
				
			||||||
 | 
								return true
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
						}))
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function cry_update_used_vouchers()
 | 
				
			||||||
 | 
						if G and G.GAME and G.vouchers then
 | 
				
			||||||
 | 
							G.GAME.used_vouchers = {}
 | 
				
			||||||
 | 
							for i, v in ipairs(G.vouchers.cards) do
 | 
				
			||||||
 | 
								G.GAME.used_vouchers[v.config.center_key] = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- check if Director's Cut or Retcon offers a cheaper reroll price
 | 
				
			||||||
 | 
					function cry_cheapest_boss_reroll()
 | 
				
			||||||
 | 
						local cheapest = 1e300
 | 
				
			||||||
 | 
						local vouchers = {
 | 
				
			||||||
 | 
							SMODS.find_card("v_directors_cut"),
 | 
				
			||||||
 | 
							SMODS.find_card("v_retcon"),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, table in ipairs(vouchers) do
 | 
				
			||||||
 | 
							for i, v in ipairs(table) do
 | 
				
			||||||
 | 
								if v.ability.extra <= cheapest then
 | 
				
			||||||
 | 
									cheapest = v.ability.extra
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return cheapest
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- check for best interest cap. better than what's done with redeems/unredeems
 | 
				
			||||||
 | 
					-- unfortunately this still sucks
 | 
				
			||||||
 | 
					-- make seed money/other vouchers better at some point?
 | 
				
			||||||
 | 
					function cry_best_interest_cap()
 | 
				
			||||||
 | 
						local best = 25
 | 
				
			||||||
 | 
						local vouchers = {
 | 
				
			||||||
 | 
							SMODS.find_card("v_seed_money"),
 | 
				
			||||||
 | 
							SMODS.find_card("v_money_tree"),
 | 
				
			||||||
 | 
							SMODS.find_card("v_cry_money_beanstalk"),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, table in ipairs(vouchers) do
 | 
				
			||||||
 | 
							for i, v in ipairs(table) do
 | 
				
			||||||
 | 
								if v.ability.extra >= best then
 | 
				
			||||||
 | 
									best = v.ability.extra
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return best
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local evaluateroundref = G.FUNCS.evaluate_round
 | 
				
			||||||
 | 
					G.FUNCS.evaluate_round = function()
 | 
				
			||||||
 | 
						G.GAME.interest_cap = cry_best_interest_cap() -- blehhhhhh
 | 
				
			||||||
 | 
						evaluateroundref()
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function cry_get_next_voucher_edition() -- currently only for edition decks, can be modified if voucher editioning becomes more important
 | 
				
			||||||
 | 
						if G.GAME.modifiers.cry_force_edition then
 | 
				
			||||||
 | 
							return cry_edition_to_table(G.GAME.modifiers.cry_force_edition)
 | 
				
			||||||
 | 
						elseif G.GAME.modifiers.cry_force_random_edition then
 | 
				
			||||||
 | 
							return cry_poll_random_edition()
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					-- code to generate Stickers for Vouchers (and boosters), based on that for Jokers
 | 
				
			||||||
 | 
					function cry_get_next_voucher_stickers(booster)
 | 
				
			||||||
 | 
						local rate = 0.3
 | 
				
			||||||
 | 
						if booster then
 | 
				
			||||||
 | 
							rate = 0.2
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local suff = "v"
 | 
				
			||||||
 | 
						if booster then
 | 
				
			||||||
 | 
							suff = "b"
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						local odds = 1 - rate
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local ret = { eternal = false, perishable = false, rental = false, pinned = false, banana = false }
 | 
				
			||||||
 | 
						local checks = { eternal = {}, perishable = {}, rental = {}, pinned = {}, banana = {} }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						-- first order of business is making this shit not suck lmao
 | 
				
			||||||
 | 
						-- i did this when i didn't know what i was doing so it contains a lot of pointless checks and bloat
 | 
				
			||||||
 | 
						for k, v in pairs(checks) do
 | 
				
			||||||
 | 
							v["poll"] = pseudorandom("cry_" .. suff .. k .. G.GAME.round_resets.ante)
 | 
				
			||||||
 | 
							v["force"] = G.GAME.modifiers.cry_sticker_sheet_plus
 | 
				
			||||||
 | 
								or (G.GAME.modifiers.cry_force_sticker and G.GAME.modifiers.cry_force_sticker == k)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							G.GAME.modifiers.cry_any_stickers
 | 
				
			||||||
 | 
							or G.GAME.modifiers.cry_sticker_sheet_plus
 | 
				
			||||||
 | 
							or G.GAME.modifiers.cry_force_sticker
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							if (G.GAME.modifiers.enable_eternals_in_shop and checks.eternal.poll > odds) or checks.eternal.force then
 | 
				
			||||||
 | 
								ret.eternal = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if
 | 
				
			||||||
 | 
								(
 | 
				
			||||||
 | 
									G.GAME.modifiers.cry_eternal_perishable_compat
 | 
				
			||||||
 | 
									and (G.GAME.modifiers.enable_perishables_in_shop and checks.perishable.poll > odds)
 | 
				
			||||||
 | 
								) or checks.perishable.force
 | 
				
			||||||
 | 
							then -- still ehh? but way more understandable
 | 
				
			||||||
 | 
								ret.perishable = true
 | 
				
			||||||
 | 
							elseif
 | 
				
			||||||
 | 
								(
 | 
				
			||||||
 | 
									not G.GAME.modifiers.cry_eternal_perishable_compat
 | 
				
			||||||
 | 
									and (
 | 
				
			||||||
 | 
										G.GAME.modifiers.enable_perishables_in_shop
 | 
				
			||||||
 | 
										and checks.eternal.poll > odds - rate
 | 
				
			||||||
 | 
										and checks.eternal.poll <= odds
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
								) or checks.perishable.force
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								ret.perishable = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if (G.GAME.modifiers.enable_rentals_in_shop and checks.rental.poll > odds) or checks.rental.force then
 | 
				
			||||||
 | 
								ret.rental = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if (G.GAME.modifiers.enable_pinned_in_shop and checks.pinned.poll > odds) or checks.pinned.force then
 | 
				
			||||||
 | 
								ret.pinned = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if (G.GAME.modifiers.enable_banana_in_shop and checks.banana.poll > odds) or checks.banana.force then
 | 
				
			||||||
 | 
								ret.banana = true
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return ret
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Calculates Rental sticker for Consumables
 | 
				
			||||||
 | 
					function Card:cry_calculate_consumeable_rental()
 | 
				
			||||||
 | 
						if self.ability.rental then
 | 
				
			||||||
 | 
							ease_dollars(-G.GAME.cry_consumeable_rental_rate)
 | 
				
			||||||
 | 
							card_eval_status_text(self, "dollars", -G.GAME.cry_consumeable_rental_rate)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					-- Calculates Rental sticker for Vouchers
 | 
				
			||||||
 | 
					function Card:cry_calculate_voucher_rental()
 | 
				
			||||||
 | 
						if self.ability.rental then
 | 
				
			||||||
 | 
							ease_dollars(-G.GAME.cry_voucher_rental_rate)
 | 
				
			||||||
 | 
							card_eval_status_text(self, "dollars", -G.GAME.cry_voucher_rental_rate)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Calculates Perishable sticker for Consumables
 | 
				
			||||||
 | 
					function Card:cry_calculate_consumeable_perishable()
 | 
				
			||||||
 | 
						if not self.ability.perish_tally then
 | 
				
			||||||
 | 
							self.ability.perish_tally = 1
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if self.ability.perishable and self.ability.perish_tally > 0 then
 | 
				
			||||||
 | 
							self.ability.perish_tally = 0
 | 
				
			||||||
 | 
							card_eval_status_text(
 | 
				
			||||||
 | 
								self,
 | 
				
			||||||
 | 
								"extra",
 | 
				
			||||||
 | 
								nil,
 | 
				
			||||||
 | 
								nil,
 | 
				
			||||||
 | 
								nil,
 | 
				
			||||||
 | 
								{ message = localize("k_disabled_ex"), colour = G.C.FILTER, delay = 0.45 }
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
							self:set_debuff()
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					-- Calculates Perishable sticker for Vouchers
 | 
				
			||||||
 | 
					function Card:cry_calculate_voucher_perishable()
 | 
				
			||||||
 | 
						if self.ability.perishable and not self.ability.perish_tally then
 | 
				
			||||||
 | 
							self.ability.perish_tally = G.GAME.cry_voucher_perishable_rounds
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if self.ability.perishable and self.ability.perish_tally > 0 then
 | 
				
			||||||
 | 
							if self.ability.perish_tally == 1 then
 | 
				
			||||||
 | 
								self.ability.perish_tally = 0
 | 
				
			||||||
 | 
								card_eval_status_text(
 | 
				
			||||||
 | 
									self,
 | 
				
			||||||
 | 
									"extra",
 | 
				
			||||||
 | 
									nil,
 | 
				
			||||||
 | 
									nil,
 | 
				
			||||||
 | 
									nil,
 | 
				
			||||||
 | 
									{ message = localize("k_disabled_ex"), colour = G.C.FILTER, delay = 0.45 }
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
 | 
								self:set_debuff()
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								self.ability.perish_tally = self.ability.perish_tally - 1
 | 
				
			||||||
 | 
								card_eval_status_text(self, "extra", nil, nil, nil, {
 | 
				
			||||||
 | 
									message = localize({ type = "variable", key = "a_remaining", vars = { self.ability.perish_tally } }),
 | 
				
			||||||
 | 
									colour = G.C.FILTER,
 | 
				
			||||||
 | 
									delay = 0.45,
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function Card:set_perishable(_perishable)
 | 
				
			||||||
 | 
						self.ability.perishable = nil
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							(self.config.center.perishable_compat or G.GAME.modifiers.cry_any_stickers)
 | 
				
			||||||
 | 
							and (not self.ability.eternal or G.GAME.modifiers.cry_eternal_perishable_compat)
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							self.ability.perishable = true
 | 
				
			||||||
 | 
							self.ability.perish_tally = G.GAME.perishable_rounds or 5
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Card:set_eternal(_eternal)
 | 
				
			||||||
 | 
						self.ability.eternal = nil
 | 
				
			||||||
 | 
						if
 | 
				
			||||||
 | 
							(self.config.center.eternal_compat or G.GAME.modifiers.cry_any_stickers)
 | 
				
			||||||
 | 
							and (not self.ability.perishable or G.GAME.modifiers.cry_eternal_perishable_compat)
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							self.ability.eternal = _eternal
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Card:calculate_banana()
 | 
				
			||||||
 | 
						if not self.ability.extinct then
 | 
				
			||||||
 | 
							if self.ability.banana and (pseudorandom("banana") < G.GAME.probabilities.normal / 10) then
 | 
				
			||||||
 | 
								self.ability.extinct = true
 | 
				
			||||||
 | 
								G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
									func = function()
 | 
				
			||||||
 | 
										play_sound("tarot1")
 | 
				
			||||||
 | 
										self.T.r = -0.2
 | 
				
			||||||
 | 
										self:juice_up(0.3, 0.4)
 | 
				
			||||||
 | 
										self.states.drag.is = true
 | 
				
			||||||
 | 
										self.children.center.pinch.x = true
 | 
				
			||||||
 | 
										G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
											trigger = "after",
 | 
				
			||||||
 | 
											delay = 0.3,
 | 
				
			||||||
 | 
											blockable = false,
 | 
				
			||||||
 | 
											func = function()
 | 
				
			||||||
 | 
												if self.area then
 | 
				
			||||||
 | 
													self.area:remove_card(self)
 | 
				
			||||||
 | 
												end
 | 
				
			||||||
 | 
												self:remove()
 | 
				
			||||||
 | 
												self = nil
 | 
				
			||||||
 | 
												return true
 | 
				
			||||||
 | 
											end,
 | 
				
			||||||
 | 
										}))
 | 
				
			||||||
 | 
										return true
 | 
				
			||||||
 | 
									end,
 | 
				
			||||||
 | 
								}))
 | 
				
			||||||
 | 
								card_eval_status_text(self, "jokers", nil, nil, nil, { message = localize("k_extinct_ex"), delay = 0.1 })
 | 
				
			||||||
 | 
								return true
 | 
				
			||||||
 | 
							elseif self.ability.banana then
 | 
				
			||||||
 | 
								card_eval_status_text(self, "jokers", nil, nil, nil, { message = localize("k_safe_ex"), delay = 0.1 })
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						return false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Card:set_banana(_banana)
 | 
				
			||||||
 | 
						self.ability.banana = _banana
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					function Card:set_pinned(_pinned)
 | 
				
			||||||
 | 
						self.ability.pinned = _pinned
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SMODS.Sticker:take_ownership("perishable", {
 | 
				
			||||||
 | 
						atlas = "sticker",
 | 
				
			||||||
 | 
						pos = { x = 4, y = 4 },
 | 
				
			||||||
 | 
						prefix_config = { key = false },
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							if card.ability.consumeable then
 | 
				
			||||||
 | 
								return { key = "cry_perishable_consumeable" }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
								return {
 | 
				
			||||||
 | 
									key = "cry_perishable_voucher",
 | 
				
			||||||
 | 
									vars = {
 | 
				
			||||||
 | 
										G.GAME.cry_voucher_perishable_rounds or 1,
 | 
				
			||||||
 | 
										card.ability.perish_tally or G.GAME.cry_voucher_perishable_rounds,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							elseif card.ability.set == "Booster" then
 | 
				
			||||||
 | 
								return { key = "cry_perishable_booster" }
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return { vars = { G.GAME.perishable_rounds or 1, card.ability.perish_tally or G.GAME.perishable_rounds } }
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
 | 
							if context.end_of_round and context.main_eval then -- perishable is calculated seperately across G.playing_cards i believe
 | 
				
			||||||
 | 
								if card.ability.consumeable then
 | 
				
			||||||
 | 
									card:cry_calculate_consumeable_perishable()
 | 
				
			||||||
 | 
								elseif card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
									card:cry_calculate_voucher_perishable()
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									card:calculate_perishable()
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sticker:take_ownership("pinned", {
 | 
				
			||||||
 | 
						atlas = "sticker",
 | 
				
			||||||
 | 
						pos = { x = 5, y = 0 },
 | 
				
			||||||
 | 
						prefix_config = { key = false },
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							if card.ability.consumeable then
 | 
				
			||||||
 | 
								return { key = "cry_pinned_consumeable" }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
								return { key = "cry_pinned_voucher" }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Booster" then
 | 
				
			||||||
 | 
								return { key = "cry_pinned_booster" }
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return { key = "pinned_left" }
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sticker:take_ownership("eternal", {
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							if card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
								return { key = "cry_eternal_voucher" }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Booster" then
 | 
				
			||||||
 | 
								return { key = "cry_eternal_booster" }
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sticker:take_ownership("rental", {
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							if card.ability.consumeable then
 | 
				
			||||||
 | 
								return { key = "cry_rental_consumeable", vars = { G.GAME.cry_consumeable_rental_rate or 1 } }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
								return { key = "cry_rental_voucher", vars = { G.GAME.cry_voucher_rental_rate or 1 } }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Booster" then
 | 
				
			||||||
 | 
								return { key = "cry_rental_booster" }
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return { vars = { G.GAME.rental_rate or 1 } }
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
 | 
							if context.end_of_round and context.main_eval then
 | 
				
			||||||
 | 
								if card.ability.consumeable then
 | 
				
			||||||
 | 
									card:cry_calculate_consumeable_rental()
 | 
				
			||||||
 | 
								elseif card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
									card:cry_calculate_voucher_rental()
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									card:calculate_rental()
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
							if context.playing_card_end_of_round then
 | 
				
			||||||
 | 
								card:calculate_rental()
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					SMODS.Sticker({
 | 
				
			||||||
 | 
						badge_colour = HEX("e8c500"),
 | 
				
			||||||
 | 
						prefix_config = { key = false },
 | 
				
			||||||
 | 
						key = "banana",
 | 
				
			||||||
 | 
						atlas = "sticker",
 | 
				
			||||||
 | 
						pos = { x = 5, y = 2 },
 | 
				
			||||||
 | 
						should_apply = false,
 | 
				
			||||||
 | 
						loc_vars = function(self, info_queue, card)
 | 
				
			||||||
 | 
							if card.ability.consumeable then
 | 
				
			||||||
 | 
								return { key = "cry_banana_consumeable", vars = { G.GAME.probabilities.normal or 1, 4 } }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
								return { key = "cry_banana_voucher", vars = { G.GAME.probabilities.normal or 1, 12 } }
 | 
				
			||||||
 | 
							elseif card.ability.set == "Booster" then
 | 
				
			||||||
 | 
								return { key = "cry_banana_booster" }
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								return { vars = { G.GAME.probabilities.normal or 1, 10 } }
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						calculate = function(self, card, context)
 | 
				
			||||||
 | 
							if
 | 
				
			||||||
 | 
								context.end_of_round
 | 
				
			||||||
 | 
								and not context.repetition
 | 
				
			||||||
 | 
								and not context.playing_card_end_of_round
 | 
				
			||||||
 | 
								and not context.individual
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								if card.ability.set == "Voucher" then
 | 
				
			||||||
 | 
									if pseudorandom("byebyevoucher") < G.GAME.probabilities.normal / G.GAME.cry_voucher_banana_odds then
 | 
				
			||||||
 | 
										local area
 | 
				
			||||||
 | 
										if G.STATE == G.STATES.HAND_PLAYED then
 | 
				
			||||||
 | 
											if not G.redeemed_vouchers_during_hand then
 | 
				
			||||||
 | 
												G.redeemed_vouchers_during_hand = CardArea(
 | 
				
			||||||
 | 
													G.play.T.x,
 | 
				
			||||||
 | 
													G.play.T.y,
 | 
				
			||||||
 | 
													G.play.T.w,
 | 
				
			||||||
 | 
													G.play.T.h,
 | 
				
			||||||
 | 
													{ type = "play", card_limit = 5 }
 | 
				
			||||||
 | 
												)
 | 
				
			||||||
 | 
											end
 | 
				
			||||||
 | 
											area = G.redeemed_vouchers_during_hand
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											area = G.play
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										local _card = copy_card(card)
 | 
				
			||||||
 | 
										_card.ability.extra = copy_table(card.ability.extra)
 | 
				
			||||||
 | 
										if _card.facing == "back" then
 | 
				
			||||||
 | 
											_card:flip()
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										_card:start_materialize()
 | 
				
			||||||
 | 
										area:emplace(_card)
 | 
				
			||||||
 | 
										_card.cost = 0
 | 
				
			||||||
 | 
										_card.shop_voucher = false
 | 
				
			||||||
 | 
										_card:unredeem()
 | 
				
			||||||
 | 
										G.E_MANAGER:add_event(Event({
 | 
				
			||||||
 | 
											trigger = "after",
 | 
				
			||||||
 | 
											delay = 0,
 | 
				
			||||||
 | 
											func = function()
 | 
				
			||||||
 | 
												_card:start_dissolve()
 | 
				
			||||||
 | 
												card:start_dissolve()
 | 
				
			||||||
 | 
												return true
 | 
				
			||||||
 | 
											end,
 | 
				
			||||||
 | 
										}))
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					-- temp crappy overwrite for voucher ui until smods does stuff
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function G.UIDEF.used_vouchers()
 | 
				
			||||||
 | 
						local silent = false
 | 
				
			||||||
 | 
						local keys_used = {}
 | 
				
			||||||
 | 
						local area_count = 0
 | 
				
			||||||
 | 
						local voucher_areas = {}
 | 
				
			||||||
 | 
						local voucher_tables = {}
 | 
				
			||||||
 | 
						local voucher_table_rows = {}
 | 
				
			||||||
 | 
						table.sort(G.vouchers.cards, function(a, b)
 | 
				
			||||||
 | 
							return a.config.center.order < b.config.center.order
 | 
				
			||||||
 | 
						end)
 | 
				
			||||||
 | 
						for k, v in ipairs(G.vouchers.cards) do
 | 
				
			||||||
 | 
							local key = k
 | 
				
			||||||
 | 
							keys_used[key] = keys_used[key] or {}
 | 
				
			||||||
 | 
							keys_used[key][#keys_used[key] + 1] = v
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						for k, v in ipairs(keys_used) do
 | 
				
			||||||
 | 
							if next(v) then
 | 
				
			||||||
 | 
								area_count = area_count + 1
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						for k, v in ipairs(keys_used) do
 | 
				
			||||||
 | 
							if next(v) then
 | 
				
			||||||
 | 
								if #voucher_areas == 18 or #voucher_areas == 36 or #voucher_areas == 54 then
 | 
				
			||||||
 | 
									table.insert(
 | 
				
			||||||
 | 
										voucher_table_rows,
 | 
				
			||||||
 | 
										{ n = G.UIT.R, config = { align = "cm", padding = 0, no_fill = true }, nodes = voucher_tables }
 | 
				
			||||||
 | 
									)
 | 
				
			||||||
 | 
									voucher_tables = {}
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								voucher_areas[#voucher_areas + 1] = CardArea(
 | 
				
			||||||
 | 
									G.ROOM.T.x + 0.2 * G.ROOM.T.w / 2,
 | 
				
			||||||
 | 
									G.ROOM.T.h,
 | 
				
			||||||
 | 
									(#v == 1 and 0.5 or 1.33) * G.CARD_W,
 | 
				
			||||||
 | 
									(area_count >= 10 and 0.75 or 1.07) * G.CARD_H,
 | 
				
			||||||
 | 
									{ card_limit = 2, type = "voucher", highlight_limit = 0 }
 | 
				
			||||||
 | 
								)
 | 
				
			||||||
 | 
								for kk, vv in ipairs(v) do
 | 
				
			||||||
 | 
									local card = copy_card(vv)
 | 
				
			||||||
 | 
									card.ability.extra = copy_table(vv.ability.extra)
 | 
				
			||||||
 | 
									if card.facing == "back" then
 | 
				
			||||||
 | 
										card:flip()
 | 
				
			||||||
 | 
									end
 | 
				
			||||||
 | 
									card:start_materialize(nil, silent)
 | 
				
			||||||
 | 
									silent = true
 | 
				
			||||||
 | 
									voucher_areas[#voucher_areas]:emplace(card)
 | 
				
			||||||
 | 
								end
 | 
				
			||||||
 | 
								table.insert(voucher_tables, {
 | 
				
			||||||
 | 
									n = G.UIT.C,
 | 
				
			||||||
 | 
									config = { align = "cm", padding = 0, no_fill = true },
 | 
				
			||||||
 | 
									nodes = {
 | 
				
			||||||
 | 
										{ n = G.UIT.O, config = { object = voucher_areas[#voucher_areas] } },
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						table.insert(
 | 
				
			||||||
 | 
							voucher_table_rows,
 | 
				
			||||||
 | 
							{ n = G.UIT.R, config = { align = "cm", padding = 0, no_fill = true }, nodes = voucher_tables }
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local t = silent
 | 
				
			||||||
 | 
								and {
 | 
				
			||||||
 | 
									n = G.UIT.ROOT,
 | 
				
			||||||
 | 
									config = { align = "cm", colour = G.C.CLEAR },
 | 
				
			||||||
 | 
									nodes = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										-- tarot/planet acclimator sliders
 | 
				
			||||||
 | 
										next(SMODS.find_card("v_cry_tacclimator"))
 | 
				
			||||||
 | 
												and {
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm" },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														create_slider({
 | 
				
			||||||
 | 
															label = localize("b_tarot_rate"),
 | 
				
			||||||
 | 
															label_scale = 0.4,
 | 
				
			||||||
 | 
															text_scale = 0.3,
 | 
				
			||||||
 | 
															w = 4,
 | 
				
			||||||
 | 
															h = 0.4,
 | 
				
			||||||
 | 
															ref_table = G.GAME.cry_percrate,
 | 
				
			||||||
 | 
															ref_value = "tarot",
 | 
				
			||||||
 | 
															colour = G.C.SECONDARY_SET.Tarot,
 | 
				
			||||||
 | 
															min = 0,
 | 
				
			||||||
 | 
															max = 100,
 | 
				
			||||||
 | 
														}),
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											or nil,
 | 
				
			||||||
 | 
										next(SMODS.find_card("v_cry_pacclimator")) and {
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = { align = "cm" },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												create_slider({
 | 
				
			||||||
 | 
													label = localize("b_planet_rate"),
 | 
				
			||||||
 | 
													label_scale = 0.4,
 | 
				
			||||||
 | 
													text_scale = 0.3,
 | 
				
			||||||
 | 
													w = 4,
 | 
				
			||||||
 | 
													h = 0.4,
 | 
				
			||||||
 | 
													ref_table = G.GAME.cry_percrate,
 | 
				
			||||||
 | 
													ref_value = "planet",
 | 
				
			||||||
 | 
													colour = G.C.SECONDARY_SET.Planet,
 | 
				
			||||||
 | 
													min = 0,
 | 
				
			||||||
 | 
													max = 100,
 | 
				
			||||||
 | 
												}),
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										} or nil,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = { align = "cm" },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.O,
 | 
				
			||||||
 | 
													config = {
 | 
				
			||||||
 | 
														object = DynaText({
 | 
				
			||||||
 | 
															string = { localize("ph_vouchers_redeemed") },
 | 
				
			||||||
 | 
															colours = { G.C.UI.TEXT_LIGHT },
 | 
				
			||||||
 | 
															bump = true,
 | 
				
			||||||
 | 
															scale = 0.6,
 | 
				
			||||||
 | 
														}),
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{ n = G.UIT.R, config = { align = "cm", minh = 0.5 }, nodes = {} },
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = { align = "cm", colour = G.C.BLACK, r = 1, padding = 0.15, emboss = 0.05 },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{ n = G.UIT.R, config = { align = "cm" }, nodes = voucher_table_rows },
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							or {
 | 
				
			||||||
 | 
								n = G.UIT.ROOT,
 | 
				
			||||||
 | 
								config = { align = "cm", colour = G.C.CLEAR },
 | 
				
			||||||
 | 
								nodes = {
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										n = G.UIT.O,
 | 
				
			||||||
 | 
										config = {
 | 
				
			||||||
 | 
											object = DynaText({
 | 
				
			||||||
 | 
												string = { localize("ph_no_vouchers") },
 | 
				
			||||||
 | 
												colours = { G.C.UI.TEXT_LIGHT },
 | 
				
			||||||
 | 
												bump = true,
 | 
				
			||||||
 | 
												scale = 0.6,
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						return t
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										230
									
								
								Cryptid/lib/notifications.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,230 @@
 | 
				
			||||||
 | 
					-- notifications.lua - Adds notification system for Cryptid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function create_cryptid_notif_overlay(key)
 | 
				
			||||||
 | 
						if not G.SETTINGS.cryptid_notifs then -- I want this to be across profiles
 | 
				
			||||||
 | 
							G.SETTINGS.cryptid_notifs = {}
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						if not G.SETTINGS.cryptid_notifs[key] then
 | 
				
			||||||
 | 
							G.E_MANAGER:add_event(
 | 
				
			||||||
 | 
								Event({
 | 
				
			||||||
 | 
									trigger = "immediate",
 | 
				
			||||||
 | 
									no_delete = true,
 | 
				
			||||||
 | 
									func = function()
 | 
				
			||||||
 | 
										if not G.OVERLAY_MENU then
 | 
				
			||||||
 | 
											G.SETTINGS.paused = true
 | 
				
			||||||
 | 
											G.FUNCS.overlay_menu({
 | 
				
			||||||
 | 
												definition = create_UIBox_cryptid_notif(key),
 | 
				
			||||||
 | 
											})
 | 
				
			||||||
 | 
											play_sound("foil1", 0.7, 0.3)
 | 
				
			||||||
 | 
											play_sound("gong", 1.4, 0.15)
 | 
				
			||||||
 | 
											G.SETTINGS.cryptid_notifs[key] = true
 | 
				
			||||||
 | 
											G:save_settings()
 | 
				
			||||||
 | 
											return true
 | 
				
			||||||
 | 
										end
 | 
				
			||||||
 | 
									end,
 | 
				
			||||||
 | 
								}),
 | 
				
			||||||
 | 
								"unlock"
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function create_UIBox_cryptid_notif(key)
 | 
				
			||||||
 | 
						local t = create_UIBox_generic_options({
 | 
				
			||||||
 | 
							padding = 0,
 | 
				
			||||||
 | 
							back_label = localize("b_continue"),
 | 
				
			||||||
 | 
							no_pip = true,
 | 
				
			||||||
 | 
							snap_back = true,
 | 
				
			||||||
 | 
							back_func = "continue_unlock",
 | 
				
			||||||
 | 
							minw = 4.5,
 | 
				
			||||||
 | 
							contents = {
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									n = G.UIT.R,
 | 
				
			||||||
 | 
									config = { align = "cm", padding = 0 },
 | 
				
			||||||
 | 
									nodes = {
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = { align = "cm", padding = 0.1 },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm", padding = 0.1 },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.R,
 | 
				
			||||||
 | 
															config = { align = "cm", padding = 0 },
 | 
				
			||||||
 | 
															nodes = {
 | 
				
			||||||
 | 
																{
 | 
				
			||||||
 | 
																	n = G.UIT.O,
 | 
				
			||||||
 | 
																	config = {
 | 
				
			||||||
 | 
																		object = DynaText({
 | 
				
			||||||
 | 
																			string = { localize("cry_notif_" .. key .. "_1") },
 | 
				
			||||||
 | 
																			colours = { G.C.BLUE },
 | 
				
			||||||
 | 
																			shadow = true,
 | 
				
			||||||
 | 
																			rotate = true,
 | 
				
			||||||
 | 
																			bump = true,
 | 
				
			||||||
 | 
																			pop_in = 0.3,
 | 
				
			||||||
 | 
																			pop_in_rate = 2,
 | 
				
			||||||
 | 
																			scale = 1.2,
 | 
				
			||||||
 | 
																		}),
 | 
				
			||||||
 | 
																	},
 | 
				
			||||||
 | 
																},
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.R,
 | 
				
			||||||
 | 
															config = { align = "cm", padding = 0 },
 | 
				
			||||||
 | 
															nodes = {
 | 
				
			||||||
 | 
																{
 | 
				
			||||||
 | 
																	n = G.UIT.O,
 | 
				
			||||||
 | 
																	config = {
 | 
				
			||||||
 | 
																		object = DynaText({
 | 
				
			||||||
 | 
																			string = { localize("cry_notif_" .. key .. "_2") },
 | 
				
			||||||
 | 
																			colours = { G.C.RED },
 | 
				
			||||||
 | 
																			shadow = true,
 | 
				
			||||||
 | 
																			rotate = true,
 | 
				
			||||||
 | 
																			bump = true,
 | 
				
			||||||
 | 
																			pop_in = 0.6,
 | 
				
			||||||
 | 
																			pop_in_rate = 2,
 | 
				
			||||||
 | 
																			scale = 0.8,
 | 
				
			||||||
 | 
																		}),
 | 
				
			||||||
 | 
																	},
 | 
				
			||||||
 | 
																},
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm", padding = 0.2 },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.R,
 | 
				
			||||||
 | 
															config = {
 | 
				
			||||||
 | 
																align = "cm",
 | 
				
			||||||
 | 
																padding = 0.05,
 | 
				
			||||||
 | 
																emboss = 0.05,
 | 
				
			||||||
 | 
																colour = G.C.WHITE,
 | 
				
			||||||
 | 
																r = 0.1,
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
															nodes = {
 | 
				
			||||||
 | 
																Cryptid.notifications[key].nodes(),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										Cryptid.notifications[key].cta and {
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = {
 | 
				
			||||||
 | 
												id = "overlay_menu_back_button",
 | 
				
			||||||
 | 
												align = "cm",
 | 
				
			||||||
 | 
												minw = 2.5,
 | 
				
			||||||
 | 
												padding = 0.1,
 | 
				
			||||||
 | 
												r = 0.1,
 | 
				
			||||||
 | 
												hover = true,
 | 
				
			||||||
 | 
												colour = G.C.BLUE,
 | 
				
			||||||
 | 
												button = "notif_" .. key,
 | 
				
			||||||
 | 
												shadow = true,
 | 
				
			||||||
 | 
												focus_args = { nav = "wide", button = "b" },
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm", padding = 0, no_fill = true },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.T,
 | 
				
			||||||
 | 
															config = {
 | 
				
			||||||
 | 
																text = localize(Cryptid.notifications[key].cta.label),
 | 
				
			||||||
 | 
																scale = 0.5,
 | 
				
			||||||
 | 
																colour = G.C.UI.TEXT_LIGHT,
 | 
				
			||||||
 | 
																shadow = true,
 | 
				
			||||||
 | 
																func = "set_button_pip",
 | 
				
			||||||
 | 
																focus_args = { button = "b" },
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										} or nil,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
						return t
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- I couldn't figure out how to fully use localization for this, so this implementation is pretty scuffed
 | 
				
			||||||
 | 
					Cryptid.notifications = {
 | 
				
			||||||
 | 
						jimball = {
 | 
				
			||||||
 | 
							nodes = function()
 | 
				
			||||||
 | 
								return {
 | 
				
			||||||
 | 
									n = G.UIT.R,
 | 
				
			||||||
 | 
									config = {
 | 
				
			||||||
 | 
										align = "cm",
 | 
				
			||||||
 | 
										colour = empty and G.C.CLEAR or G.C.UI.BACKGROUND_WHITE,
 | 
				
			||||||
 | 
										r = 0.1,
 | 
				
			||||||
 | 
										padding = 0.04,
 | 
				
			||||||
 | 
										minw = 2,
 | 
				
			||||||
 | 
										minh = 0.8,
 | 
				
			||||||
 | 
										emboss = not empty and 0.05 or nil,
 | 
				
			||||||
 | 
										filler = true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									nodes = {
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											n = G.UIT.R,
 | 
				
			||||||
 | 
											config = { align = "cm", padding = 0.03 },
 | 
				
			||||||
 | 
											nodes = {
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm", padding = 0 },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.T,
 | 
				
			||||||
 | 
															config = {
 | 
				
			||||||
 | 
																text = localize("cry_notif_jimball_d1"),
 | 
				
			||||||
 | 
																scale = 0.5,
 | 
				
			||||||
 | 
																colour = G.C.BLACK,
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm", padding = 0 },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.T,
 | 
				
			||||||
 | 
															config = {
 | 
				
			||||||
 | 
																text = localize("cry_notif_jimball_d2"),
 | 
				
			||||||
 | 
																scale = 0.5,
 | 
				
			||||||
 | 
																colour = G.C.BLACK,
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													n = G.UIT.R,
 | 
				
			||||||
 | 
													config = { align = "cm", padding = 0 },
 | 
				
			||||||
 | 
													nodes = {
 | 
				
			||||||
 | 
														{
 | 
				
			||||||
 | 
															n = G.UIT.T,
 | 
				
			||||||
 | 
															config = {
 | 
				
			||||||
 | 
																text = localize("cry_notif_jimball_d3"),
 | 
				
			||||||
 | 
																scale = 0.5,
 | 
				
			||||||
 | 
																colour = G.C.BLACK,
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														},
 | 
				
			||||||
 | 
													},
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							end,
 | 
				
			||||||
 | 
							cta = {
 | 
				
			||||||
 | 
								label = "k_disable_music",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										1301
									
								
								Cryptid/lib/overrides.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										4257
									
								
								Cryptid/localization/vi.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -1,786 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Make the splash screen more jolly
 | 
					 | 
				
			||||||
# Requires "Custom Main Menu" config to be enabled
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_joker'])"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if Cryptid.enabled["Menu"] then
 | 
					 | 
				
			||||||
	if Cryptid.enabled["M Jokers"] then
 | 
					 | 
				
			||||||
 		local mcard = {}
 | 
					 | 
				
			||||||
			for k, _ in pairs(Cryptid.M_jokers) do
 | 
					 | 
				
			||||||
				if G.P_CENTERS[k] then
 | 
					 | 
				
			||||||
					mcard[#mcard + 1] = k
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
 		local option = math.random(#mcard)
 | 
					 | 
				
			||||||
   		local chosenoption = mcard[option]
 | 
					 | 
				
			||||||
       		if chosenoption == "j_cry_biggestm" or chosenoption == "j_cry_reverse" then --These don't render properly; replace these with loopy instead
 | 
					 | 
				
			||||||
			SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_cry_loopy'],{bypass_discovery_center = true, bypass_discovery_ui = true})
 | 
					 | 
				
			||||||
   		else
 | 
					 | 
				
			||||||
     			SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS[chosenoption],{bypass_discovery_center = true, bypass_discovery_ui = true})
 | 
					 | 
				
			||||||
     		end
 | 
					 | 
				
			||||||
  	else
 | 
					 | 
				
			||||||
   		SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_jolly'],{bypass_discovery_center = true, bypass_discovery_ui = true})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Make cards in splash screen CCD cards
 | 
					 | 
				
			||||||
# Requires "Custom Main Menu" config to be enabled
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "if math.random() > 0.8 then card.sprite_facing = 'back'; card.facing = 'back' end"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if Cryptid.enabled["Menu"] then card:set_ability(get_random_consumable('cry_splash',{"no_grc"},nil,nil,true), true, nil) end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Show Glitched Edition to confirm Cryptid is Active
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "replace_card.states.visible = false"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = "replace_card:set_edition(G.P_CENTERS.e_cry_glitched and 'e_cry_glitched' or 'e_negative',true,true)"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Patch related crash
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if not initial then G.GAME.blind:debuff_card(self) end"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if not initial and G.GAME and G.GAME.blind then G.GAME.blind:debuff_card(self) end"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Draw midground layer
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.config.center.soul_pos and (self.config.center.discovered or self.bypass_discovery_center) then"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.config.center.soul_pos and self.config.center.soul_pos.extra and (self.config.center.discovered or self.bypass_discovery_center) then
 | 
					 | 
				
			||||||
    local scale_mod = 0.07-- + 0.02*math.cos(1.8*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
 | 
					 | 
				
			||||||
    local rotate_mod = 0--0.05*math.cos(1.219*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
 | 
					 | 
				
			||||||
    self.children.floating_sprite2:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod, rotate_mod,nil, 0.1--[[ + 0.03*math.cos(1.8*G.TIMERS.REAL)--]],nil, 0.6)
 | 
					 | 
				
			||||||
    self.children.floating_sprite2:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod) 
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''if not v.custom_draw and k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if not v.custom_draw and k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k ~= 'floating_sprite2' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Custom variables in info queue
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, hide_desc, main_start, main_end)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = "if _c.specific_vars then specific_vars = _c.specific_vars end"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Fix not all cards returning to hand on big hands
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "{card_limit = 500, type = 'discard'})"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "{card_limit = 1e308, type = 'discard'})"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# When hand size exceeds deck size, space the cards as if the hand size was equal to the deck size
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "cardarea.lua"
 | 
					 | 
				
			||||||
pattern = "function CardArea:align_cards()"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
    if self.config.type == 'hand' then
 | 
					 | 
				
			||||||
        self.config.temp_limit = math.min(self.config.card_limit, #G.playing_cards)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Crash fix
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = "if not G.SAVED_GAME.VERSION or G.SAVED_GAME.VERSION < '0.9.2' then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if not G.SAVED_GAME or not G.SAVED_GAME.VERSION or G.SAVED_GAME.VERSION < '0.9.2' then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Register banned bosses for rush hour
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "set_profile_progress()"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
for i = 1, #G.CHALLENGES do
 | 
					 | 
				
			||||||
    if (G.CHALLENGES[i].id == 'c_cry_rush_hour' or G.CHALLENGES[i].id == 'c_cry_rush_hour_ii' or G.CHALLENGES[i].id == 'c_cry_rush_hour_iii') and #G.CHALLENGES[i].restrictions.banned_other == 0 then
 | 
					 | 
				
			||||||
        for k, v in pairs(G.P_BLINDS) do
 | 
					 | 
				
			||||||
            if k ~= "bl_cry_clock" and k ~= "bl_cry_lavender_loop" and v.boss then
 | 
					 | 
				
			||||||
                G.CHALLENGES[i].restrictions.banned_other[#G.CHALLENGES[i].restrictions.banned_other+1] = {id = k, type = 'blind'}
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Apply booster pack edition and stickers to contents - by Jen Walter
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "card.T.x = self.T.x"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
local edi = self.edition or {}
 | 
					 | 
				
			||||||
if edi.type and not self.ability.name:find('Standard') then
 | 
					 | 
				
			||||||
	if card.ability.name ~= "cry-meteor"
 | 
					 | 
				
			||||||
 	and card.ability.name ~= "cry-exoplanet"
 | 
					 | 
				
			||||||
  	and card.ability.name ~= "cry-stardust" then
 | 
					 | 
				
			||||||
		card:set_edition({[edi.type] = true})
 | 
					 | 
				
			||||||
  	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self.ability.eternal then
 | 
					 | 
				
			||||||
	card.ability.eternal = self.ability.eternal
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self.ability.perishable then
 | 
					 | 
				
			||||||
	card.ability.perishable = self.ability.perishable
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self.ability.rental then
 | 
					 | 
				
			||||||
	card.ability.rental = self.ability.rental
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self.pinned then
 | 
					 | 
				
			||||||
	card.pinned = self.pinned
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self.ability.banana then
 | 
					 | 
				
			||||||
	card.ability.banana = self.ability.banana
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# catch edition code in standard pack to avoid reapplying edition (HORRIBLE)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''local edition \= poll_edition\('standard_edition'\.\.G.GAME\.round_resets\.ante, edition_rate, true\)\n\s+card\:set_edition\(edition\)'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
local edi = self.edition or {}
 | 
					 | 
				
			||||||
if edi.type and not (G.GAME.modifiers.cry_force_edition and G.GAME.modifiers.cry_force_edition ~= 'random') then
 | 
					 | 
				
			||||||
	card:set_edition({[edi.type] = true})
 | 
					 | 
				
			||||||
elseif not G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	local edition = poll_edition('standard_edition'..G.GAME.round_resets.ante, edition_rate, true)
 | 
					 | 
				
			||||||
	card:set_edition(edition)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Edition + sticker forcing on vouchers (editions are just funny cost increases)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "G.shop_vouchers:emplace(card)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.current_round.cry_voucher_edition then
 | 
					 | 
				
			||||||
	card:set_edition(G.GAME.current_round.cry_voucher_edition, true, true)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.current_round.cry_voucher_stickers then
 | 
					 | 
				
			||||||
	if G.GAME.current_round.cry_voucher_stickers.eternal == true then		-- this is dumb but i'm not sure how to call functions from a string
 | 
					 | 
				
			||||||
		card:set_eternal(true)
 | 
					 | 
				
			||||||
		card.ability.eternal = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.current_round.cry_voucher_stickers.perishable == true then
 | 
					 | 
				
			||||||
		card.ability.perishable = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.current_round.cry_voucher_stickers.rental == true then
 | 
					 | 
				
			||||||
		card:set_rental(true)
 | 
					 | 
				
			||||||
		card.ability.rental = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.current_round.cry_voucher_stickers.pinned == true then
 | 
					 | 
				
			||||||
		card.pinned = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.current_round.cry_voucher_stickers.banana == true then
 | 
					 | 
				
			||||||
		card.ability.banana = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# don't forget voucher tags
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = "G.shop_vouchers:emplace(card)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	card:set_edition(nil, true)
 | 
					 | 
				
			||||||
elseif G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	local edition = cry_poll_random_edition()
 | 
					 | 
				
			||||||
	card:set_edition(edition, true)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_sticker == 'eternal' or G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	card:set_eternal(true)
 | 
					 | 
				
			||||||
	card.ability.eternal = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_sticker == 'perishable' or G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	card:set_perishable(true)
 | 
					 | 
				
			||||||
	card.ability.perishable = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_sticker == 'rental' or G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	card:set_rental(true)
 | 
					 | 
				
			||||||
	card.ability.rental = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_sticker == 'pinned' or G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	card.pinned = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_sticker == 'banana' or G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	card.ability.banana = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	for k, v in pairs(SMODS.Stickers) do
 | 
					 | 
				
			||||||
		if v.apply and not v.no_sticker_sheet then v:apply(card, true) end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# show owned vouchers
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "if G.GAME.used_vouchers[v.key] then"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
    if not G.GAME.cry_owned_vouchers[v.key] then
 | 
					 | 
				
			||||||
        G.GAME.cry_owned_vouchers[v.key] = G.GAME.used_vouchers[v.key]
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.cry_owned_vouchers[v.key] then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# show in voucher menu
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "voucher_areas[#voucher_areas]:emplace(card)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if not G.GAME.voucher_edition_index then G.GAME.voucher_edition_index = {} end
 | 
					 | 
				
			||||||
if G.GAME.voucher_edition_index[card.ability.name] then		-- i just made it a function so i can look at it less
 | 
					 | 
				
			||||||
	local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
 | 
					 | 
				
			||||||
	if edition then
 | 
					 | 
				
			||||||
		card:set_edition(edition, true, true)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
 | 
					 | 
				
			||||||
	card:set_eternal(true)
 | 
					 | 
				
			||||||
	card.ability.eternal = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
 | 
					 | 
				
			||||||
	card:set_perishable(true)
 | 
					 | 
				
			||||||
	card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
 | 
					 | 
				
			||||||
	card.ability.perishable = true
 | 
					 | 
				
			||||||
	if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
 | 
					 | 
				
			||||||
		card.debuff = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.voucher_sticker_index.rental[card.ability.name] then
 | 
					 | 
				
			||||||
	card:set_rental(true)
 | 
					 | 
				
			||||||
	card.ability.rental = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
 | 
					 | 
				
			||||||
	card.pinned = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.voucher_sticker_index.banana[card.ability.name] then
 | 
					 | 
				
			||||||
	card.ability.banana = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
card.ability.extra = G.GAME.cry_voucher_centers[card.config.center_key].config.extra
 | 
					 | 
				
			||||||
if card.ability.extra_disp then card.ability.extra_disp = G.GAME.cry_voucher_centers[card.config.center_key].config.extra_disp end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# sticker tagging
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if center_table.name == 'Overstock' or center_table.name == 'Overstock Plus' then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if not G.GAME.voucher_edition_index then G.GAME.voucher_edition_index = {} end
 | 
					 | 
				
			||||||
if self and self.edition then
 | 
					 | 
				
			||||||
	G.GAME.voucher_edition_index[center_table.name] = self.edition.type
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if not G.GAME.voucher_sticker_index then G.GAME.voucher_sticker_index = {eternal = {}, perishable = {}, rental = {}, pinned = {}, banana = {}} end
 | 
					 | 
				
			||||||
if self and self.ability and self.ability.eternal and self.ability.eternal == true then
 | 
					 | 
				
			||||||
 	G.GAME.voucher_sticker_index.eternal[center_table.name] = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self and self.ability and self.ability.perishable and self.ability.perishable == true then
 | 
					 | 
				
			||||||
 	G.GAME.voucher_sticker_index.perishable[center_table.name] = G.GAME.cry_voucher_perishable_rounds
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self and self.ability and self.ability.rental and self.ability.rental == true then
 | 
					 | 
				
			||||||
 	G.GAME.voucher_sticker_index.rental[center_table.name] = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self and self.pinned and self.pinned == true then
 | 
					 | 
				
			||||||
 	G.GAME.voucher_sticker_index.pinned[center_table.name] = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if self and self.ability and self.ability.banana and self.ability.banana == true then
 | 
					 | 
				
			||||||
 	G.GAME.voucher_sticker_index.banana[center_table.name] = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# apply end of round stuff
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "if G.GAME.round_resets.ante == G.GAME.win_ante and G.GAME.blind:get_type() == 'Boss' then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.voucher_sticker_index then
 | 
					 | 
				
			||||||
	if G.GAME.voucher_sticker_index.perishable then
 | 
					 | 
				
			||||||
		for k, v in pairs(G.GAME.voucher_sticker_index.perishable) do
 | 
					 | 
				
			||||||
			if v > 1 then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.perishable[k] = v - 1
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
			if v == 1 then
 | 
					 | 
				
			||||||
				G.GAME.voucher_sticker_index.perishable[k] = v - 1	
 | 
					 | 
				
			||||||
				for kk, vv in pairs(G.P_CENTERS) do
 | 
					 | 
				
			||||||
					if k == vv.name then
 | 
					 | 
				
			||||||
						cry_debuff_voucher(kk)
 | 
					 | 
				
			||||||
						G.GAME.used_vouchers.vv = nil
 | 
					 | 
				
			||||||
						G.GAME.used_vouchers[kk] = nil
 | 
					 | 
				
			||||||
						break
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.voucher_sticker_index.rental then
 | 
					 | 
				
			||||||
		local cumulative_rental = 0
 | 
					 | 
				
			||||||
		for k, v in pairs(G.GAME.voucher_sticker_index.rental) do
 | 
					 | 
				
			||||||
			cumulative_rental = cumulative_rental + G.GAME.cry_voucher_rental_rate
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if cumulative_rental > 0 then
 | 
					 | 
				
			||||||
			G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
				trigger = 'immediate',
 | 
					 | 
				
			||||||
				blocking = false,
 | 
					 | 
				
			||||||
				blockable = false,
 | 
					 | 
				
			||||||
				func = (function()
 | 
					 | 
				
			||||||
					ease_dollars(-cumulative_rental)
 | 
					 | 
				
			||||||
				return true
 | 
					 | 
				
			||||||
			end)}))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.voucher_sticker_index.banana then		-- i'm pretty sure unredeem breaks if spectrals are disabled? unsure though
 | 
					 | 
				
			||||||
		local voucher_queue = {}
 | 
					 | 
				
			||||||
		local current_round_voucher=G.GAME.current_round.voucher
 | 
					 | 
				
			||||||
		for k, v in pairs(G.GAME.voucher_sticker_index.banana) do
 | 
					 | 
				
			||||||
			if (pseudorandom('byebyevoucher') < G.GAME.probabilities.normal/G.GAME.cry_voucher_banana_odds) then
 | 
					 | 
				
			||||||
				area = G.play
 | 
					 | 
				
			||||||
				local unredeemed_voucher = ''
 | 
					 | 
				
			||||||
				for kk, vv in pairs(G.P_CENTERS) do
 | 
					 | 
				
			||||||
					if k == vv.name then
 | 
					 | 
				
			||||||
						unredeemed_voucher = kk
 | 
					 | 
				
			||||||
						break
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			        local card = create_card('Voucher', area, nil, nil, nil, nil, unredeemed_voucher)
 | 
					 | 
				
			||||||
				if G.GAME.voucher_edition_index[card.ability.name] then		-- i made this bullshit a function
 | 
					 | 
				
			||||||
					local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
 | 
					 | 
				
			||||||
					if edition then
 | 
					 | 
				
			||||||
						card:set_edition(edition, true, true)
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
 | 
					 | 
				
			||||||
	    				card:set_eternal(true)
 | 
					 | 
				
			||||||
	    				card.ability.eternal = true
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
 | 
					 | 
				
			||||||
	    				card:set_perishable(true)
 | 
					 | 
				
			||||||
	    				card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
 | 
					 | 
				
			||||||
	    				card.ability.perishable = true
 | 
					 | 
				
			||||||
	    				if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
 | 
					 | 
				
			||||||
						card.debuff = true
 | 
					 | 
				
			||||||
					end
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if G.GAME.voucher_sticker_index.rental[card.ability.name] then
 | 
					 | 
				
			||||||
	   				card:set_rental(true)
 | 
					 | 
				
			||||||
	  				card.ability.rental = true
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
 | 
					 | 
				
			||||||
					card.pinned = true
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
				if G.GAME.voucher_sticker_index.banana[card.ability.name] then
 | 
					 | 
				
			||||||
					card.ability.banana = true
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
        			card:start_materialize()
 | 
					 | 
				
			||||||
        			area:emplace(card)
 | 
					 | 
				
			||||||
        			card.cost=0
 | 
					 | 
				
			||||||
        			card.shop_voucher=false
 | 
					 | 
				
			||||||
				voucher_queue[#voucher_queue+1] = card
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		for k, v in pairs(voucher_queue) do
 | 
					 | 
				
			||||||
			v:unredeem()
 | 
					 | 
				
			||||||
        		G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
				trigger = 'after',
 | 
					 | 
				
			||||||
				delay =  0,
 | 
					 | 
				
			||||||
				func = function() 
 | 
					 | 
				
			||||||
					v:start_dissolve()
 | 
					 | 
				
			||||||
				return true
 | 
					 | 
				
			||||||
			end}))
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		G.GAME.current_round.voucher=current_round_voucher
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Affect booster packs
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "G.shop_booster:emplace(card)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	card:set_edition(nil, true, true)
 | 
					 | 
				
			||||||
elseif G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	local edition = cry_poll_random_edition()
 | 
					 | 
				
			||||||
	card:set_edition(edition, true, true)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local eternal_perishable_poll = pseudorandom('cry_bpet'..(key_append or '')..G.GAME.round_resets.ante)
 | 
					 | 
				
			||||||
if (G.GAME.modifiers.cry_force_sticker == 'eternal') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.enable_eternals_in_shop and eternal_perishable_poll > 0.8)) then	
 | 
					 | 
				
			||||||
	card:set_eternal(true)
 | 
					 | 
				
			||||||
	card.ability.eternal = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.enable_perishables_in_shop and G.GAME.modifiers.cry_any_stickers then	-- i don't feel like messing with this, whatever
 | 
					 | 
				
			||||||
	if not G.GAME.modifiers.cry_eternal_perishable_compat and ((eternal_perishable_poll > 0.6) and (eternal_perishable_poll <= 0.8)) then
 | 
					 | 
				
			||||||
		card:set_perishable(true)
 | 
					 | 
				
			||||||
		card.ability.perishable = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.modifiers.cry_eternal_perishable_compat and pseudorandom('cry_bpper'..(key_append or '')..G.GAME.round_resets.ante) > 0.8 then
 | 
					 | 
				
			||||||
		card:set_perishable(true)
 | 
					 | 
				
			||||||
		card.ability.perishable = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if (G.GAME.modifiers.cry_force_sticker == 'perishable') or (G.GAME.modifiers.cry_sticker_sheet_plus) then
 | 
					 | 
				
			||||||
	card:set_perishable(true)
 | 
					 | 
				
			||||||
	card.ability.perishable = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if (G.GAME.modifiers.cry_force_sticker == 'rental') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.enable_rentals_in_shop and pseudorandom('cry_bpssjr'..(key_append or '')..G.GAME.round_resets.ante) > 0.8)) then	-- i should really just make this a function? so messy
 | 
					 | 
				
			||||||
	card.ability.rental = true	-- do not set_rental here to prevent cost from decreasing
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if (G.GAME.modifiers.cry_force_sticker == 'pinned') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.cry_enable_pinned_in_shop and pseudorandom('cry_bppin'..(key_append or '')..G.GAME.round_resets.ante) > 0.8)) then
 | 
					 | 
				
			||||||
	card.pinned = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_sticker == 'banana' or G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	card.ability.banana = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if not G.GAME.modifiers.cry_eternal_perishable_compat and G.GAME.modifiers.enable_banana and G.GAME.modifiers.cry_any_stickers and (pseudorandom('cry_bpbanana'..(key_append or '')..G.GAME.round_resets.ante) > 0.8) and (eternal_perishable_poll <= 0.8) then
 | 
					 | 
				
			||||||
	card.ability.banana = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_eternal_perishable_compat and G.GAME.modifiers.enable_banana and G.GAME.modifiers.cry_any_stickers and (pseudorandom('cry_bpbanana'..(key_append or '')..G.GAME.round_resets.ante) > 0.8) then
 | 
					 | 
				
			||||||
	card.ability.banana = true
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_sticker_sheet_plus then
 | 
					 | 
				
			||||||
	for k, v in pairs(SMODS.Stickers) do
 | 
					 | 
				
			||||||
		if v.apply and not v.no_sticker_sheet then v:apply(card, true) end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# world's first actually good multi-patch
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = "card:start_materialize()"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	card:set_edition(nil, true, true)
 | 
					 | 
				
			||||||
elseif G.GAME.modifiers.cry_force_random_edition then
 | 
					 | 
				
			||||||
	local edition = cry_poll_random_edition()
 | 
					 | 
				
			||||||
	card:set_edition(edition, true, true)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Prevent Jokers from spitting empty messages
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "text = extra.message or text"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = "if not text or text == '' then return end"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Add default pool value for Consumeables
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = 'else _pool[#_pool + 1] = "j_joker"'
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''elseif _type == 'Consumeables' then _pool[#_pool + 1] = "c_ceres"'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# make the cat tag meow (can probably do this without injecting?)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = '''play_sound('tarot2', math.random()*0.1 + 0.55, 0.09)'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if self.key == 'tag_cry_cat' then
 | 
					 | 
				
			||||||
local rand = math.random(4)
 | 
					 | 
				
			||||||
play_sound('cry_meow'..rand, 1.26, 0.25)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# hi it's me toneblock and i'm being stupid again! (Game:update inject)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''if G.FILE_HANDLER and G.FILE_HANDLER and G.FILE_HANDLER.update_queued and ('''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if not GLOBAL_cry_member_count_delay then GLOBAL_cry_member_count_delay = 0 end
 | 
					 | 
				
			||||||
if (GLOBAL_cry_member_count_delay > 5) or not GLOBAL_cry_member_count then	-- it doesn't need to update this frequently? but it also doesn't need to be higher tbh...
 | 
					 | 
				
			||||||
	if update_cry_member_count then update_cry_member_count() end	-- i honestly hate nil checks like this, wish there was a shorthand
 | 
					 | 
				
			||||||
	GLOBAL_cry_member_count_delay = 0
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	GLOBAL_cry_member_count_delay = GLOBAL_cry_member_count_delay + dt
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# call update_cry_member_count() whenever the collection is opened to ensure it updates properly on title collection if it can (better than running it on loc_vars)
 | 
					 | 
				
			||||||
# it's not computationally intense at all, so whatever
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = '''G.FUNCS.your_collection = function(e)'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if update_cry_member_count then update_cry_member_count() end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# notice if https is disabled (by default)
 | 
					 | 
				
			||||||
# also does some other things since this is patching in the same spot
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "if _c.set == 'Other' then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if _c.name == 'cry-membershipcard' or _c.name == 'cry-membershipcardtwo' then
 | 
					 | 
				
			||||||
	if not Cryptid.enabled["HTTPS Module"] then
 | 
					 | 
				
			||||||
		if G.localization.descriptions.Other.cry_https_disabled then 
 | 
					 | 
				
			||||||
			main_end = {}
 | 
					 | 
				
			||||||
			localize{type = 'other', key = 'cry_https_disabled', nodes = main_end, vars = {}}
 | 
					 | 
				
			||||||
			main_end = main_end[1]
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if _c.name == 'cry-translucent Joker' then 
 | 
					 | 
				
			||||||
	if G.jokers and G.jokers.cards then
 | 
					 | 
				
			||||||
                for k, v in ipairs(G.jokers.cards) do
 | 
					 | 
				
			||||||
                    if (v.edition and v.edition.negative) and (G.localization.descriptions.Other.remove_negative)then 
 | 
					 | 
				
			||||||
                        main_end = {}
 | 
					 | 
				
			||||||
                        localize{type = 'other', key = 'remove_negative', nodes = main_end, vars = {}}
 | 
					 | 
				
			||||||
                        main_end = main_end[1]
 | 
					 | 
				
			||||||
                        break
 | 
					 | 
				
			||||||
                    end
 | 
					 | 
				
			||||||
                end
 | 
					 | 
				
			||||||
        end 
 | 
					 | 
				
			||||||
end 
 | 
					 | 
				
			||||||
if _c.name == 'cry-blurred Joker' then
 | 
					 | 
				
			||||||
	if (SMODS.Mods["sdm0sstuff"] or {}).can_load then
 | 
					 | 
				
			||||||
		if G.localization.descriptions.Other.blurred_sdm0 then 
 | 
					 | 
				
			||||||
			main_end = {}
 | 
					 | 
				
			||||||
			localize{type = 'other', key = 'blurred_sdm0', nodes = main_end, vars = {}}
 | 
					 | 
				
			||||||
			main_end = main_end[1]
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# hand size forgiveness if playing negative or antimatter deck (someone please fix)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "function Game:update_draw_to_hand(dt)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.selected_back and (G.GAME.selected_back.name == 'cry--Negative Deck' or G.GAME.selected_back.name == 'cry-Antimatter') and G.hand.config.card_limit <= 0 then	-- 'cry--Negative Deck'... sure
 | 
					 | 
				
			||||||
	G.hand.config.card_limit = 1
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# don't draw old perishable texture
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''if self.ability.perishable then'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if self.ability.perishable and not layer then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# init Cryptid global through lovely
 | 
					 | 
				
			||||||
# so other mods can add things to memepack pool
 | 
					 | 
				
			||||||
# and define some stub functions so that the game does not immediately crash when talisman isn't loaded
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "main.lua"
 | 
					 | 
				
			||||||
pattern = '''function love.load()'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
Cryptid = {}
 | 
					 | 
				
			||||||
Cryptid.enabled = {}
 | 
					 | 
				
			||||||
Cryptid.memepack = {}
 | 
					 | 
				
			||||||
Cryptid.aliases = {}
 | 
					 | 
				
			||||||
Cryptid.food = {}
 | 
					 | 
				
			||||||
Cryptid.M_jokers = {} 
 | 
					 | 
				
			||||||
Cryptid.Megavouchers = {}
 | 
					 | 
				
			||||||
function cry_format(...)
 | 
					 | 
				
			||||||
    return ... 
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Adds cry_creating_card event
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''
 | 
					 | 
				
			||||||
    check_for_unlock({type = 'have_edition'})
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
for i = 1, #G.jokers.cards do
 | 
					 | 
				
			||||||
    G.jokers.cards[i]:calculate_joker({cry_creating_card = true, card = card})
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Adds cry_debuff_immune card modifier
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = 'if self.ability and self.ability.perma_debuff then self.debuff = true end'
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.cry_debuff_immune then
 | 
					 | 
				
			||||||
	self.debuff = false
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Removes cry_debuff_immune at the end of the round
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = 'for i = 1, #G.jokers.cards do'
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
for i = 1, #G.playing_cards do
 | 
					 | 
				
			||||||
	local CARD = G.playing_cards[i]
 | 
					 | 
				
			||||||
    CARD.cry_debuff_immune = false
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Joker Sell List
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = 'self:calculate_joker{selling_self = true}'
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.config.center.set == 'Joker' then
 | 
					 | 
				
			||||||
	if G.GAME.jokers_sold then
 | 
					 | 
				
			||||||
		local contained = false
 | 
					 | 
				
			||||||
		for i = 1, #G.GAME.jokers_sold do
 | 
					 | 
				
			||||||
			if self.config.center.key == G.GAME.jokers_sold[i] then contained = true end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		if not contained then table.insert(G.GAME.jokers_sold, self.config.center.key) end
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		G.GAME.jokers_sold = {self.config.center.key}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# fix crashing from the source
 | 
					 | 
				
			||||||
# well, not from the real source, but close enough
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = '''update_hand_text({sound = 'button', volume = 0.7, pitch = 0.8, delay = 0.3}, {'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if (not self.ability.orbital_hand) or (not G.GAME.hands[self.ability.orbital_hand]) then 
 | 
					 | 
				
			||||||
	local _poker_hands = {}
 | 
					 | 
				
			||||||
	for k, v in pairs(G.GAME.hands) do
 | 
					 | 
				
			||||||
		if v.visible then _poker_hands[#_poker_hands+1] = k end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	self.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed('orbital'))
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# add check for unlock with winning hand
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''check_for_unlock({type = 'win'})'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
check_for_unlock({type = 'cry_win_with_hand', hand = G.GAME.last_hand_played})
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# (scuffed) remove filler from rare tag pool
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''if v.yes_pool_flag and not G.GAME.pool_flags[v.yes_pool_flag] then add = nil end'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if v.key == 'j_cry_filler' and _append == 'rta' then add = nil end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,38 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Cryptid Achievements
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Check to earn some achievements on startup
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''check_for_unlock({type = 'blind_discoveries'})'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if change_context ~= "splash" then 
 | 
					 | 
				
			||||||
    if not (G.ACHIEVEMENTS and G.ACHIEVEMENTS['ach_cry_used_crash'] and G.ACHIEVEMENTS['ach_cry_used_crash'].earned) then check_for_unlock({type = 'ach_cry_used_crash'}) end
 | 
					 | 
				
			||||||
    if not (G.ACHIEVEMENTS and G.ACHIEVEMENTS['ach_cry_traffic_jam'] and G.ACHIEVEMENTS['ach_cry_traffic_jam'].earned) then check_for_unlock({type = 'win_challenge_startup'}) end
 | 
					 | 
				
			||||||
    if not (G.ACHIEVEMENTS and G.ACHIEVEMENTS['ach_cry_perfectly_balanced'] and G.ACHIEVEMENTS['ach_cry_perfectly_balanced'].earned) then check_for_unlock({type = 'win_stake_startup'}) end
 | 
					 | 
				
			||||||
end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Cryptid the Cryptid check
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''new_cards[#new_cards+1] = _card'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if _card.config.center.key == "c_cryptid" then check_for_unlock({type = "cryptid_the_cryptid"}) end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# WHAT HAVE YOU DONE check
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''local sliced_card = G.jokers.cards[my_pos+1]'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''if sliced_card.config.center.rarity == "cry_exotic" then check_for_unlock({type = "what_have_you_done"}) end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,9 @@ G.GAME.hands[text].played_this_round = G.GAME.hands[text].played_this_round + 1
 | 
				
			||||||
'''
 | 
					'''
 | 
				
			||||||
position = "before"
 | 
					position = "before"
 | 
				
			||||||
payload = '''
 | 
					payload = '''
 | 
				
			||||||
if G.GAME.current_round.current_hand.cry_asc_num > 0 then G.GAME.cry_asc_played = G.GAME.cry_asc_played and G.GAME.cry_asc_played+1 or 1 end
 | 
					if G.GAME.current_round.current_hand.cry_asc_num > (G.GAME.cry_exploit_override and 1 or 0) then
 | 
				
			||||||
 | 
						G.GAME.cry_asc_played = G.GAME.cry_asc_played and G.GAME.cry_asc_played+1 or 1
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
'''
 | 
					'''
 | 
				
			||||||
match_indent = true
 | 
					match_indent = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,53 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# The Tax effect
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "func = (function()  update_hand_text({delay = 0, immediate = true}, {mult = 0, chips = 0, chip_total = math.floor(hand_chips*mult), level = '', handname = ''});play_sound('button', 0.9, 0.6);return true end)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "func = (function()  update_hand_text({delay = 0, immediate = true}, {mult = 0, chips = 0, chip_total = G.GAME.blind.cry_cap_score and G.GAME.blind:cry_cap_score(math.floor(hand_chips*mult)) or math.floor(hand_chips*mult), level = '', handname = ''});play_sound('button', 0.9, 0.6);return true end)"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "ease_to = G.GAME.chips + math.floor(hand_chips*mult),"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "ease_to = G.GAME.chips + (G.GAME.blind.cry_cap_score and G.GAME.blind:cry_cap_score(math.floor(hand_chips*mult)) or math.floor(hand_chips*mult)),"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Bunco (Magenta Dagger) and Cryptid (The Tax) compat
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = 'functions/state_events.lua'
 | 
					 | 
				
			||||||
pattern = "ease_to = G.GAME.chips + math.floor(hand_chips * mult) * (e and e.antiscore and -1 or 1),"
 | 
					 | 
				
			||||||
position = 'at'
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
payload = '''ease_to = G.GAME.chips + (G.GAME.blind.cry_cap_score and G.GAME.blind:cry_cap_score(math.floor(hand_chips*mult)) or math.floor(hand_chips*mult)) * (e and e.antiscore and -1 or 1),'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Fix a crash related to undebuffing Jokers at end of round
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if not G.P_CENTERS['e_'..(self.edition.type)].discovered then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if self.edition.type and G.P_CENTERS['e_'..(self.edition.type)] and not G.P_CENTERS['e_'..(self.edition.type)].discovered then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Blocks hands with more than 5 cards with Psychic
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "blind.lua"
 | 
					 | 
				
			||||||
pattern = "if self.debuff.h_size_ge and #cards < self.debuff.h_size_ge then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
	if self.name == "The Psychic" and #cards > 5 then
 | 
					 | 
				
			||||||
		self.triggered = true
 | 
					 | 
				
			||||||
     		return true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,57 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# This is sacrilegious
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "self.GAME.starting_deck_size = #G.playing_cards"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_ccd then
 | 
					 | 
				
			||||||
    for k, v in pairs(G.playing_cards) do
 | 
					 | 
				
			||||||
        v:set_ability(get_random_consumable('cry_ccd',{"no_doe", "no_grc"}, nil, nil, true), true, nil)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Aura use conditions
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if G.hand and (#G.hand.highlighted == 1) and G.hand.highlighted[1] and (not G.hand.highlighted[1].edition) then return true end"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.area ~= G.hand then
 | 
					 | 
				
			||||||
    return G.hand and (#G.hand.highlighted == 1) and G.hand.highlighted[1] and (not G.hand.highlighted[1].edition)
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
    local idx = 1
 | 
					 | 
				
			||||||
    if G.hand.highlighted[1] == self then
 | 
					 | 
				
			||||||
        local idx = 2
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    return (#G.hand.highlighted == 2) and (not G.hand.highlighted[idx].edition)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Prevent counting CCD consumables for pack uses
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = "if area == G.consumeables then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if area == G.consumeables or area == G.hand then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Fix bugs from removing CCD
 | 
					 | 
				
			||||||
# This really shouldn't be in the card drawing code, but it doesn't really matter since that's where it crashes anyway lol
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if not self.config.center.discovered and (self.ability.consumeable or self.config.center.unlocked) and not self.config.center.demo and not self.bypass_discovery_center then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = "if self.ability.set == 'Enhanced' then self.ability.consumeable = nil end"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,108 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# what in ze fuck am i cooking
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = '''tag_sprite.states.collide.can = true'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.key == 'tag_cry_cat' then tag_sprite.states.click.can = true; tag_sprite.states.drag.can = true end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# m
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = '''tag_sprite.stop_hover = function(_self) _self.hovering = false; Node.stop_hover(_self); _self.hover_tilt = 0 end'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
tag_sprite.click = function(_self)
 | 
					 | 
				
			||||||
        if self.key == 'tag_cry_cat' and self.HUD_tag then
 | 
					 | 
				
			||||||
		for i = 1, #G.GAME.tags do
 | 
					 | 
				
			||||||
			local other_cat = G.GAME.tags[i]
 | 
					 | 
				
			||||||
			if other_cat.key == 'tag_cry_cat' then
 | 
					 | 
				
			||||||
				if not self.ability.level then self.ability.level = 1 end
 | 
					 | 
				
			||||||
				if not other_cat.ability.level then other_cat.ability.level = 1 end	-- setting ability just doesn't seem to be working... so you get this
 | 
					 | 
				
			||||||
				if (self.ability.level == other_cat.ability.level) and (other_cat ~= self) and not cry_too_fast_kitty then
 | 
					 | 
				
			||||||
					cry_too_fast_kitty = true
 | 
					 | 
				
			||||||
					local perc = (other_cat.ability.level + 1)/10
 | 
					 | 
				
			||||||
					if perc > 1 then perc = 1 end
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						delay = 0.0,
 | 
					 | 
				
			||||||
						trigger = 'immediate',
 | 
					 | 
				
			||||||
						func = (function()
 | 
					 | 
				
			||||||
							attention_text({
 | 
					 | 
				
			||||||
								text = ""..other_cat.ability.level,
 | 
					 | 
				
			||||||
								colour = G.C.WHITE,
 | 
					 | 
				
			||||||
								scale = 1, 
 | 
					 | 
				
			||||||
								hold = 0.3/G.SETTINGS.GAMESPEED,
 | 
					 | 
				
			||||||
								cover = other_cat.HUD_tag,
 | 
					 | 
				
			||||||
								cover_colour = G.C.DARK_EDITION,
 | 
					 | 
				
			||||||
								align = 'cm',
 | 
					 | 
				
			||||||
							})
 | 
					 | 
				
			||||||
							play_sound('generic1', 0.8 + perc/2, 0.6)
 | 
					 | 
				
			||||||
							play_sound('multhit1', 0.9 + perc/2, 0.4)
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end)
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						delay = 0.0,
 | 
					 | 
				
			||||||
						trigger = 'immediate',
 | 
					 | 
				
			||||||
						func = (function()
 | 
					 | 
				
			||||||
							attention_text({
 | 
					 | 
				
			||||||
								text = "-",
 | 
					 | 
				
			||||||
								colour = G.C.WHITE,
 | 
					 | 
				
			||||||
								scale = 1, 
 | 
					 | 
				
			||||||
								hold = 0.3/G.SETTINGS.GAMESPEED,
 | 
					 | 
				
			||||||
								cover = self.HUD_tag,
 | 
					 | 
				
			||||||
								cover_colour = G.C.RED,
 | 
					 | 
				
			||||||
								align = 'cm',
 | 
					 | 
				
			||||||
							})
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end)
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						func = (function()
 | 
					 | 
				
			||||||
							self.HUD_tag.states.visible = false
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end)
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({		-- i have no idea what this does but i'm not messing with it
 | 
					 | 
				
			||||||
						func = func
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					
 | 
					 | 
				
			||||||
					other_cat.ability.level = other_cat.ability.level + 1
 | 
					 | 
				
			||||||
					
 | 
					 | 
				
			||||||
					G.E_MANAGER:add_event(Event({
 | 
					 | 
				
			||||||
						trigger = 'after',
 | 
					 | 
				
			||||||
						delay = 0.7,
 | 
					 | 
				
			||||||
						func = (function()
 | 
					 | 
				
			||||||
							self:remove()
 | 
					 | 
				
			||||||
							cry_too_fast_kitty = nil
 | 
					 | 
				
			||||||
							return true
 | 
					 | 
				
			||||||
						end)
 | 
					 | 
				
			||||||
					}))
 | 
					 | 
				
			||||||
					break
 | 
					 | 
				
			||||||
				end
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# copied from rework patch
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = '''elseif name_to_check == 'Economy Tag' then loc_vars = {self.config.max}'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
elseif name_to_check == "cry-Cat Tag" then loc_vars = {self.ability.level or 1}
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,31 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Rush Hour - remove tags
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "if type == 'Small' then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if type == 'Small' and not G.GAME.modifiers.cry_no_tags then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Rush Hour - remove tags
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "elseif type == 'Big' then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "elseif type == 'Big' and not G.GAME.modifiers.cry_no_tags then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Rush Hour - remove tags
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "elseif not run_info then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "elseif type == 'Boss' and not run_info then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,308 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Code UI disables hold R shortcut
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "engine/controller.lua"
 | 
					 | 
				
			||||||
pattern = 'if key == "r" and not G.SETTINGS.paused then'
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = 'if key == "r" and not G.SETTINGS.paused and not (G.GAME and G.GAME.USING_CODE) then'
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Payload - cash out UI
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "elseif config.name == 'interest' then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
elseif config.name == 'interest_payload' then
 | 
					 | 
				
			||||||
table.insert(left_text, {n=G.UIT.T, config={text = num_dollars, scale = 0.8*scale, colour = G.C.SECONDARY_SET.Code, shadow = true, juice = true}})
 | 
					 | 
				
			||||||
table.insert(left_text,{n=G.UIT.O, config={object = DynaText({string = {" "..localize{type = 'variable', key = 'interest', vars = {G.GAME.interest_amount*config.payload, 5, G.GAME.interest_amount*config.payload*G.GAME.interest_cap/5}}}, colours = {G.C.SECONDARY_SET.Code}, shadow = true, pop_in = 0, scale = 0.4*scale, silent = true})}})
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Payload - cash out
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "if G.GAME.dollars >= 5 and not G.GAME.modifiers.no_interest then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.dollars >= 5 and not G.GAME.modifiers.no_interest and G.GAME.cry_payload then
 | 
					 | 
				
			||||||
    add_round_eval_row({bonus = true, payload = G.GAME.cry_payload, name='interest_payload', pitch = pitch, dollars = G.GAME.interest_amount*G.GAME.cry_payload*math.min(math.floor(G.GAME.dollars/5), G.GAME.interest_cap/5)})
 | 
					 | 
				
			||||||
    pitch = pitch + 0.06
 | 
					 | 
				
			||||||
    if not G.GAME.seeded and not G.GAME.challenge then
 | 
					 | 
				
			||||||
        if G.GAME.interest_amount*math.min(math.floor(G.GAME.dollars/5), G.GAME.interest_cap/5) == G.GAME.interest_amount*G.GAME.interest_cap/5 then 
 | 
					 | 
				
			||||||
            G.PROFILES[G.SETTINGS.profile].career_stats.c_round_interest_cap_streak = G.PROFILES[G.SETTINGS.profile].career_stats.c_round_interest_cap_streak + 1
 | 
					 | 
				
			||||||
        else
 | 
					 | 
				
			||||||
            G.PROFILES[G.SETTINGS.profile].career_stats.c_round_interest_cap_streak = 0
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    check_for_unlock({type = 'interest_streak'})
 | 
					 | 
				
			||||||
    dollars = dollars + G.GAME.interest_amount*G.GAME.cry_payload*math.min(math.floor(G.GAME.dollars/5), G.GAME.interest_cap/5)
 | 
					 | 
				
			||||||
    G.GAME.cry_payload = nil
 | 
					 | 
				
			||||||
elseif G.GAME.dollars >= 5 and not G.GAME.modifiers.no_interest then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Revert - fix a crash
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = "if area and area.cards[1] then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if area and area.cards and area.cards[1] then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Crash - use glitched shader
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "G.SHADERS['CRT']:send('glitch_intensity', 0)--0.1*G.SETTINGS.GRAPHICS.crt/100 + (G.screenwipe_amt) + 1)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "G.SHADERS['CRT']:send('glitch_intensity', glitched_intensity or 0)"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Semicolon - don't lose
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''G.RESET_JIGGLES = true'''
 | 
					 | 
				
			||||||
position = 'after'
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.current_round.semicolon then
 | 
					 | 
				
			||||||
    game_over = false
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Semicolon - end screen text
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''localize\('ph_mr_bones'\)..' '\}, colours = \{G.C.FILTER'''
 | 
					 | 
				
			||||||
position = 'at'
 | 
					 | 
				
			||||||
# match_indent = true
 | 
					 | 
				
			||||||
line_prepend = ''
 | 
					 | 
				
			||||||
payload = '''(G.GAME.current_round.semicolon and ";" or localize('ph_mr_bones'))..' '}, colours = {(G.GAME.current_round.semicolon and G.C.SET.Code or G.C.FILTER)'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Semicolon - polished UI
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''{n=G.UIT.T, config={text = localize('b_cash_out')..": ", scale = 1, colour = G.C.UI.TEXT_LIGHT, shadow = true}},'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''{n=G.UIT.T, config={text = G.GAME.current_round.semicolon and localize('k_end_blind') or (localize('b_cash_out')..": "), scale = 1, colour = G.C.UI.TEXT_LIGHT, shadow = true}},'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Semicolon - polished UI
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''{n=G.UIT.T, config={text = localize('$')..config.dollars, scale = 1.2*scale, colour = G.C.WHITE, shadow = true, juice = true}}'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''{n=G.UIT.T, config={text = not G.GAME.current_round.semicolon and localize('$')..config.dollars or ';', scale = 1.2*scale, colour = G.C.WHITE, shadow = true, juice = true}}'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Semicolon - polished UI
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''{n=G.UIT.R, config={id = 'cash_out_button', align = "cm", padding = 0.1, minw = 7, r = 0.15, colour = G.C.ORANGE, shadow = true, hover = true, one_press = true, button = 'cash_out', focus_args = {snap_to = true}}, nodes={'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''{n=G.UIT.R, config={id = 'cash_out_button', align = "cm", padding = 0.1, minw = 7, r = 0.15, colour = G.GAME.current_round.semicolon and G.C.SET.Code or G.C.ORANGE, shadow = true, hover = true, one_press = true, button = 'cash_out', focus_args = {snap_to = true}}, nodes={'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Semicolon - reset value at start of round
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "G.GAME.blind:set_blind(G.GAME.round_resets.blind)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
G.GAME.current_round.semicolon = false
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Delete - placeholder booster, in the case that all are deleted
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''return center\nend\n\nfunction get_current_pool\(_type, _rarity, _legendary, _append\)'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if not center then center = G.P_CENTERS['p_buffoon_normal_1'] end '''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Run - don't clear shop
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''if self.shop then self.shop:remove(); self.shop = nil end'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if self.shop and not G.GAME.USING_CODE then self.shop:remove(); self.shop = nil end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''ease_background_colour_blind(G.STATES.SHOP)'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if not G.GAME.USING_RUN then ease_background_colour_blind(G.STATES.SHOP) end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''if self.STATE == self.STATES.SELECTING_HAND then'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.USING_RUN then
 | 
					 | 
				
			||||||
	if not (self.STATE == self.STATES.STANDARD_PACK or self.STATE == self.STATES.BUFFOON_PACK or self.STATE == self.STATES.PLANET_PACK or self.STATE == self.STATES.TAROT_PACK or self.STATE == self.STATES.SPECTRAL_PACK or self.STATE == self.STATES.SMODS_BOOSTER_OPENED) then -- do you are have stupid
 | 
					 | 
				
			||||||
		self.STATE = self.STATES.SHOP
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if G.GAME.blind then G.GAME.blind:change_colour() end	-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 | 
					 | 
				
			||||||
	if G.load_cry_runarea then
 | 
					 | 
				
			||||||
		G.cry_runarea = CardArea(
 | 
					 | 
				
			||||||
			G.discard.T.x,
 | 
					 | 
				
			||||||
			G.discard.T.y,
 | 
					 | 
				
			||||||
			G.discard.T.w,
 | 
					 | 
				
			||||||
			G.discard.T.h,
 | 
					 | 
				
			||||||
			{ type = "discard", card_limit = 1e100 }
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
		G.cry_runarea:load(G.load_cry_runarea)
 | 
					 | 
				
			||||||
		G.load_cry_runarea = nil
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Run - handle packs (this is incredibly invasive)
 | 
					 | 
				
			||||||
# we can't do "draw from run to hand" because modded packs presumably don't get ovewritten like that
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''for i=1, hand_space do --draw cards from deckL'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if not G.GAME.USING_RUN then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# the inconsistency hurts
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = '''G.FUNCS.draw_from_hand_to_deck()'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if not G.GAME.USING_RUN then
 | 
					 | 
				
			||||||
	G.FUNCS.draw_from_hand_to_deck()
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	G.FUNCS.draw_from_hand_to_run()
 | 
					 | 
				
			||||||
end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''end\n\s+G\.FUNCS\.discard_cards_from_highlighted \= function\(e, hook\)'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	for i = 1, #G.cry_runarea.cards do
 | 
					 | 
				
			||||||
		draw_card(G.cry_runarea,G.hand, i*100/#G.cry_runarea.cards,'up', true)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
G.FUNCS.draw_from_hand_to_run = function(e)	-- might as well just slap this here
 | 
					 | 
				
			||||||
	local hand_count = #G.hand.cards
 | 
					 | 
				
			||||||
	for i=1, hand_count do --draw cards from deck
 | 
					 | 
				
			||||||
		draw_card(G.hand, G.cry_runarea, i*100/hand_count,'down', nil, nil,  0.08)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''G.shop.alignment.offset.y = -5.3'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if not G.shop then return true end
 | 
					 | 
				
			||||||
G.shop.alignment.offset.y = -5.3'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increase highlight limit for consumables
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "{card_limit = self.GAME.starting_params.consumable_slots, type = 'joker', highlight_limit = 1})"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "{card_limit = self.GAME.starting_params.consumable_slots, type = 'joker', highlight_limit = 1e100})"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increase highlight limit for jokers
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "{card_limit = self.GAME.starting_params.joker_slots, type = 'joker', highlight_limit = 1})"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "{card_limit = self.GAME.starting_params.joker_slots, type = 'joker', highlight_limit = 1e100})"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Satellite Uplink
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''card = create_card("Planet", G.pack_cards, nil, nil, true, true, nil, 'pl1')'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.used_vouchers.v_cry_satellite_uplink and pseudorandom('cry_satellite_uplink') > 0.8 then
 | 
					 | 
				
			||||||
    card = create_card("Code", G.pack_cards, nil, nil, true, true, nil, 'pl2')
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
    card = create_card("Planet", G.pack_cards, nil, nil, true, true, nil, 'pl1')
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Exploit - reset variables
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''function end_round()'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
G.GAME.cry_exploit_override = nil
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Rework Tag - UI
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = '''elseif name_to_check == 'Economy Tag' then loc_vars = {self.config.max}'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
elseif name_to_check == "cry-Rework Tag" then loc_vars = {
 | 
					 | 
				
			||||||
            self.ability and self.ability.rework_edition and localize{type = "name_text", set = "Edition", key = self.ability.rework_edition} or "["..string.lower(localize("k_edition")).."]",
 | 
					 | 
				
			||||||
            self.ability and self.ability.rework_key and localize{type = "name_text", set = "Joker", key = self.ability.rework_key} or "["..string.lower(localize("k_joker")).."]",
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Double Tag makes exact copy of rework tag
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = 'add_tag(Tag(_context.tag.key))'
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
	local tag = Tag(_context.tag.key)
 | 
					 | 
				
			||||||
	if _context.tag.key == "tag_cry_rework" then
 | 
					 | 
				
			||||||
		tag.ability.rework_edition = _context.tag.ability.rework_edition
 | 
					 | 
				
			||||||
		tag.ability.rework_key = _context.tag.ability.rework_key
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	add_tag(tag)
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,29 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Don't sort cards
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "cardarea.lua"
 | 
					 | 
				
			||||||
pattern = "table.sort(self.cards, function (a, b) return a.T.x + a.T.w/2 - 100*(a.pinned and a.sort_id or 0) < b.T.x + b.T.w/2 - 100*(b.pinned and b.sort_id or 0) end)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if not G.GAME.modifiers.cry_conveyor then table.sort(self.cards, function (a, b) return a.T.x + a.T.w/2 - 100*(a.pinned and a.sort_id or 0) < b.T.x + b.T.w/2 - 100*(b.pinned and b.sort_id or 0) end) end"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Start of round effects
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "G.GAME.blind:set_blind(G.GAME.round_resets.blind)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_conveyor and #G.jokers.cards>0 then
 | 
					 | 
				
			||||||
    local duplicated_joker = copy_card(G.jokers.cards[#G.jokers.cards])
 | 
					 | 
				
			||||||
    duplicated_joker:add_to_deck()
 | 
					 | 
				
			||||||
    G.jokers:emplace(duplicated_joker)
 | 
					 | 
				
			||||||
    G.jokers.cards[1]:start_dissolve()
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,27 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Joker Lock
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "elseif v.enhancement_gate then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
elseif v.source_gate then
 | 
					 | 
				
			||||||
    if v.source_gate ~= _append then
 | 
					 | 
				
			||||||
        add = nil 
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        add = true
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
elseif v.joker_gate then
 | 
					 | 
				
			||||||
    add = nil
 | 
					 | 
				
			||||||
    for kk, vv in pairs(G.jokers.cards) do
 | 
					 | 
				
			||||||
        if vv.ability.name == v.joker_gate then
 | 
					 | 
				
			||||||
            add = true
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end 
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,74 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Show edition on Edition Decks
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "self.children.back:draw(overlay)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
local currentBack = self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back
 | 
					 | 
				
			||||||
if currentBack.effect.config.cry_force_edition and not currentBack.effect.config.cry_antimatter then
 | 
					 | 
				
			||||||
	if currentBack.effect.config.cry_force_edition_shader then
 | 
					 | 
				
			||||||
		self.children.back:draw_shader(currentBack.effect.config.cry_force_edition_shader , nil, self.ARGS.send_to_shader, true)
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		self.children.back:draw_shader(currentBack.effect.config.cry_force_edition , nil, self.ARGS.send_to_shader, true)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if currentBack.effect.config.cry_force_seal and not currentBack.effect.config.hide_seal and not currentBack.effect.config.cry_antimatter then
 | 
					 | 
				
			||||||
    G.shared_seals[currentBack.effect.config.cry_force_seal]:draw_shader('dissolve', nil, nil, true, self.children.center)
 | 
					 | 
				
			||||||
    if currentBack.effect.config.cry_force_seal == 'Gold' then G.shared_seals[currentBack.effect.config.cry_force_seal]:draw_shader('voucher', nil, self.ARGS.send_to_shader, true, self.children.center) end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if currentBack.effect.config.cry_force_sticker and not currentBack.effect.config.cry_antimatter then
 | 
					 | 
				
			||||||
    for k, v in pairs(SMODS.Stickers) do
 | 
					 | 
				
			||||||
        if currentBack.effect.config.cry_force_sticker == v.key then
 | 
					 | 
				
			||||||
            if v and v.draw and type(v.draw) == 'function' then
 | 
					 | 
				
			||||||
                v:draw(self)
 | 
					 | 
				
			||||||
            else
 | 
					 | 
				
			||||||
                G.shared_stickers[v.key].role.draw_major = self
 | 
					 | 
				
			||||||
                G.shared_stickers[v.key]:draw_shader('dissolve', nil, nil, true, self.children.center)
 | 
					 | 
				
			||||||
                G.shared_stickers[v.key]:draw_shader('voucher', nil, self.ARGS.send_to_shader, true, self.children.center)
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if currentBack.effect.config.cry_antimatter or currentBack.effect.config.cry_force_edition == 'negative' then
 | 
					 | 
				
			||||||
    self.children.back:draw_shader('negative', nil, self.ARGS.send_to_shader, true)
 | 
					 | 
				
			||||||
    self.children.center:draw_shader('negative_shine', nil, self.ARGS.send_to_shader, true)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Antimatter Deck
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "self.children.back:draw_shader('dissolve')"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
local currentBack = self.params.viewed_back and G.GAME.viewed_back or G.GAME.selected_back
 | 
					 | 
				
			||||||
if currentBack and currentBack.effect.config.cry_antimatter or currentBack.effect.config.cry_force_edition == 'negative' then
 | 
					 | 
				
			||||||
    self.children.back:draw_shader('negative', nil, self.ARGS.send_to_shader)
 | 
					 | 
				
			||||||
    self.children.center:draw_shader('negative_shine', nil, self.ARGS.send_to_shader)
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
    self.children.back:draw_shader('dissolve')
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Created cards match suits of suit deck
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "card.playing_card = G.playing_card"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_suit then card:change_suit(G.GAME.modifiers.cry_force_suit) end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_enhancement then card:set_ability(G.P_CENTERS[G.GAME.modifiers.cry_force_enhancement]) end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_edition then card:set_edition({[G.GAME.modifiers.cry_force_edition]=true},true,true) end
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_force_seal then card:set_seal(G.GAME.modifiers.cry_force_seal) end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,30 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# non-pack scaling in pack slots
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "G.shop_booster.T.y, G.CARD_W*1.27, G.CARD_H*1.27, G.P_CARDS.empty, G.P_CENTERS[G.GAME.current_round.used_packs[i]], {bypass_discovery_center = true, bypass_discovery_ui = true})"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "G.shop_booster.T.y, G.CARD_W*(G.P_CENTERS[G.GAME.current_round.used_packs[i]].set == 'Booster' and 1.27 or 1), G.CARD_H*(G.P_CENTERS[G.GAME.current_round.used_packs[i]].set == 'Booster' and 1.27 or 1), G.P_CARDS.empty, G.P_CENTERS[G.GAME.current_round.used_packs[i]], {bypass_discovery_center = true, bypass_discovery_ui = true})"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# scaling issues when reclaiming Overstock
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "G.GAME.shop.joker_max*1.02*G.CARD_W,"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "math.min(G.GAME.shop.joker_max,4)*1.02*G.CARD_W,"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "G.shop_jokers.T.w = G.GAME.shop.joker_max*1.01*G.CARD_W"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "G.shop_jokers.T.w = math.min(G.GAME.shop.joker_max,4)*1.02*G.CARD_W"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,26 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# putting this here since lovely crashes with a file that has no uncommented patches
 | 
					 | 
				
			||||||
# note to self get rid of this file later
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "bbbbb"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "aaaaa"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Patch get_current_pool to predict for ERROR desc
 | 
					 | 
				
			||||||
# There's also a consumable rarity patch I should do but don't feel like overriding SMODS right now
 | 
					 | 
				
			||||||
## Note this breaks one of the regexs for SMODS.Rarity
 | 
					 | 
				
			||||||
# [[patches]]
 | 
					 | 
				
			||||||
# [patches.pattern]
 | 
					 | 
				
			||||||
# target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
# pattern = "local rarity = _rarity or pseudorandom('rarity'..G.GAME.round_resets.ante..(_append or ''))"
 | 
					 | 
				
			||||||
# position = "at"
 | 
					 | 
				
			||||||
# payload = "local rarity = _rarity or pseudorandom(_G[gcparea == 'ERROR' and 'predict_pseudoseed' or 'pseudoseed']('rarity'..G.GAME.round_resets.ante..(_append or '')))"
 | 
					 | 
				
			||||||
# match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,116 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increment Exponentia on Joker XMult
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "card_eval_status_text(_card, 'jokers', nil, percent, nil, effects.jokers)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if effects.jokers.Xmult_mod and effects.jokers.Xmult_mod ~= 1 and next(find_joker("cry-Exponentia")) then
 | 
					 | 
				
			||||||
    for _, v in pairs(find_joker("cry-Exponentia")) do
 | 
					 | 
				
			||||||
        local old = v.ability.extra.Emult
 | 
					 | 
				
			||||||
        v.ability.extra.Emult = v.ability.extra.Emult + v.ability.extra.Emult_mod
 | 
					 | 
				
			||||||
        card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_powmult',vars={number_format(to_big(v.ability.extra.Emult))}}})
 | 
					 | 
				
			||||||
        exponentia_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increment Exponentia on Joker-on-Joker XMult
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "if extras.mult or extras.hand_chips then card_eval_status_text(v, 'jokers', nil, percent, nil, effect) end"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if effect.Xmult_mod and effect.Xmult_mod ~= 1 and next(find_joker("cry-Exponentia")) then
 | 
					 | 
				
			||||||
    for _, v in pairs(find_joker("cry-Exponentia")) do
 | 
					 | 
				
			||||||
        local old = v.ability.extra.Emult
 | 
					 | 
				
			||||||
        v.ability.extra.Emult = v.ability.extra.Emult + v.ability.extra.Emult_mod
 | 
					 | 
				
			||||||
        card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_powmult',vars={number_format(to_big(v.ability.extra.Emult))}}})
 | 
					 | 
				
			||||||
        exponentia_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increment Exponentia on Misc XMult
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "if extras.mult or extras.hand_chips then card_eval_status_text(v, 'jokers', nil, percent, nil, effect) end"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if effects.Xmult_mod and next(find_joker("cry-Exponentia")) then
 | 
					 | 
				
			||||||
    for _, v in pairs(find_joker("cry-Exponentia")) do
 | 
					 | 
				
			||||||
        local old = v.ability.extra.Emult
 | 
					 | 
				
			||||||
        v.ability.extra.Emult = v.ability.extra.Emult + v.ability.extra.Emult_mod
 | 
					 | 
				
			||||||
        card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_powmult',vars={number_format(to_big(v.ability.extra.Emult))}}})
 | 
					 | 
				
			||||||
        exponentia_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increment Exponentia on Enhancement XMult
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "card_eval_status_text(scoring_hand[i], 'x_mult', effects[ii].x_mult, percent)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if next(find_joker("cry-Exponentia")) then
 | 
					 | 
				
			||||||
    for _, v in pairs(find_joker("cry-Exponentia")) do
 | 
					 | 
				
			||||||
        local old = v.ability.extra.Emult
 | 
					 | 
				
			||||||
        v.ability.extra.Emult = v.ability.extra.Emult + v.ability.extra.Emult_mod
 | 
					 | 
				
			||||||
        card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_powmult',vars={number_format(to_big(v.ability.extra.Emult))}}})
 | 
					 | 
				
			||||||
        exponentia_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increment Exponentia on Held-in-Hand XMult
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "card_eval_status_text(G.hand.cards[i], 'x_mult', effects[ii].x_mult, percent)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if next(find_joker("cry-Exponentia")) then
 | 
					 | 
				
			||||||
    for _, v in pairs(find_joker("cry-Exponentia")) do
 | 
					 | 
				
			||||||
        local old = v.ability.extra.Emult
 | 
					 | 
				
			||||||
        v.ability.extra.Emult = v.ability.extra.Emult + v.ability.extra.Emult_mod
 | 
					 | 
				
			||||||
        card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_powmult',vars={number_format(to_big(v.ability.extra.Emult))}}})
 | 
					 | 
				
			||||||
        exponentia_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Increment Exponentia on Edition XMult
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "edition = true})"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if (effects and effects[ii] and effects[ii].edition and effects[ii].edition.x_mult_mod or edition_effects and edition_effects.jokers and edition_effects.jokers.x_mult_mod) and next(find_joker("cry-Exponentia")) then
 | 
					 | 
				
			||||||
    for _, v in pairs(find_joker("cry-Exponentia")) do
 | 
					 | 
				
			||||||
        local old = v.ability.extra.Emult
 | 
					 | 
				
			||||||
        v.ability.extra.Emult = v.ability.extra.Emult + v.ability.extra.Emult_mod
 | 
					 | 
				
			||||||
        card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize{type='variable',key='a_powmult',vars={number_format(to_big(v.ability.extra.Emult))}}})
 | 
					 | 
				
			||||||
        exponentia_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,28 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# 3-layer drawing for Gateway
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.config.center.soul_pos and (self.config.center.discovered or self.bypass_discovery_center) then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'cry-Gateway' and (self.config.center.discovered or self.bypass_discovery_center) then
 | 
					 | 
				
			||||||
    local scale_mod2 = 0.07-- + 0.02*math.cos(1.8*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
 | 
					 | 
				
			||||||
    local rotate_mod2 = 0--0.05*math.cos(1.219*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
 | 
					 | 
				
			||||||
    self.children.floating_sprite2:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod2, rotate_mod2,nil, 0.1--[[ + 0.03*math.cos(1.8*G.TIMERS.REAL)--]],nil, 0.6)
 | 
					 | 
				
			||||||
    self.children.floating_sprite2:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod2, rotate_mod2) 
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    local scale_mod = 0.05 + 0.05*math.sin(1.8*G.TIMERS.REAL) + 0.07*math.sin((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
 | 
					 | 
				
			||||||
    local rotate_mod = 0.1*math.sin(1.219*G.TIMERS.REAL) + 0.07*math.sin((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    self.children.floating_sprite.role.draw_major = self
 | 
					 | 
				
			||||||
    self.children.floating_sprite:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod, rotate_mod,nil, 0.1 + 0.03*math.sin(1.8*G.TIMERS.REAL),nil, 0.6)
 | 
					 | 
				
			||||||
    self.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,462 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Shine on Oversaturated to make it more noticable
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = 'card.lua'
 | 
					 | 
				
			||||||
pattern = "if (self.edition and self.edition.negative) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then"
 | 
					 | 
				
			||||||
position = 'at'
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
payload = "if (self.edition and (self.edition.negative or self.edition.cry_oversat)) or (self.ability.name == 'Antimatter' and (self.config.center.discovered or self.bypass_discovery_center)) then"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Detect if edition comes from copy_card
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = 'functions/common_events.lua'
 | 
					 | 
				
			||||||
pattern = '''new_card:set_edition(other.edition or {}, nil, true)'''
 | 
					 | 
				
			||||||
position = 'before'
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
new_card.from_copy = true
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Used to check for Monster from copy_card and update values
 | 
					 | 
				
			||||||
# more or less the same patch above but this also applies if strip_edition is true
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = 'functions/common_events.lua'
 | 
					 | 
				
			||||||
pattern = "if not strip_edition then"
 | 
					 | 
				
			||||||
position = 'before'
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
new_card.checkmonster = true
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Joker BigNum value support
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Campfire' and G.GAME.blind.boss and not (G.GAME.blind.config and G.GAME.blind.config.bonus) and self.ability.x_mult > 1 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Campfire' and G.GAME.blind.boss and not (G.GAME.blind.config and G.GAME.blind.config.bonus) and to_big(self.ability.x_mult) > to_big(1) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Hit the Road' and self.ability.x_mult > 1 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Hit the Road' and to_big(self.ability.x_mult) > to_big(1) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.x_mult > 1 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if to_big(self.ability.x_mult) > to_big(1) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name ~= 'Seeing Double' and self.ability.x_mult > 1 and (self.ability.type == '' or next(context.poker_hands[self.ability.type])) then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name ~= 'Seeing Double' and to_big(self.ability.x_mult) > to_big(1) and (self.ability.type == '' or next(context.poker_hands[self.ability.type])) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Caino' and self.ability.caino_xmult > 1 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Caino' and to_big(self.ability.caino_xmult) > to_big(1) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.t_mult > 0 and next(context.poker_hands[self.ability.type]) then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if to_big(self.ability.t_mult) > to_big(0) and next(context.poker_hands[self.ability.type]) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.t_chips > 0 and next(context.poker_hands[self.ability.type]) then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if to_big(self.ability.t_chips) > to_big(0) and next(context.poker_hands[self.ability.type]) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Ceremonial Dagger' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Ceremonial Dagger' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Castle' and (self.ability.extra.chips > 0) then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Castle' and (to_big(self.ability.extra.chips) > to_big(0)) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Swashbuckler' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Swashbuckler' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Spare Trousers' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Spare Trousers' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Ride the Bus' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Ride the Bus' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Flash Card' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Flash Card' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Popcorn' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Popcorn' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Green Joker' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Green Joker' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Red Card' and self.ability.mult > 0 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'Red Card' and to_big(self.ability.mult) > to_big(0) then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/misc_functions.lua"
 | 
					 | 
				
			||||||
pattern = "function localize(args, misc_cat)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if args and args.vars then
 | 
					 | 
				
			||||||
    local reset = {}
 | 
					 | 
				
			||||||
    for i, j in pairs(args.vars) do
 | 
					 | 
				
			||||||
        if type(j) == 'table' then
 | 
					 | 
				
			||||||
            if (j.new and type(j.new) == "function") and ((j.m and j.e) or (j.array and j.sign and (type(j.array) == "table"))) then 
 | 
					 | 
				
			||||||
                reset[i] = number_format(j)
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    for i, j in pairs(reset) do
 | 
					 | 
				
			||||||
        args.vars[i] = j
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Compat UI for Old Blueprint and Gemini
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# I deleted the patches --Jevonn (test)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# calculate wheel fail (for Wheel of Hope)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Ectoplasm' or self.ability.name == 'Hex' or pseudorandom('wheel_of_fortune') < G.GAME.probabilities.normal/self.ability.extra then"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.name == 'The Wheel of Fortune' then self.cry_wheel_success = true end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = false
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# unscoring context (for Green Seal)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = "for i=1, #G.hand.cards do"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if scoring_hand then
 | 
					 | 
				
			||||||
    local unscoring_hand = {}
 | 
					 | 
				
			||||||
    for i = 1, #G.play.cards do
 | 
					 | 
				
			||||||
        local is_scoring = false
 | 
					 | 
				
			||||||
        for j = 1, #scoring_hand do
 | 
					 | 
				
			||||||
            if G.play.cards[i] == scoring_hand[j] then
 | 
					 | 
				
			||||||
                is_scoring = true
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
        if not is_scoring then
 | 
					 | 
				
			||||||
            unscoring_hand[#unscoring_hand+1] = G.play.cards[i]
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
    for i = 1, #unscoring_hand do
 | 
					 | 
				
			||||||
        unscoring_hand[i]:calculate_seal{unscoring = true}
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# no "Again!" text if a card will shatter
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''if reps[j] ~= 1 then'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if reps[j] ~= 1 and (not scoring_hand or not scoring_hand[i] or not scoring_hand[i].will_shatter) then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# properly remove destroyed playing cards from deck
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''if destroyed then'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if scoring_hand[i].will_shatter then destroyed = true end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# sfx fixes with destroyed playing cards from fragile edition
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''if cards_destroyed[i].ability.name == 'Glass Card' then'''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if cards_destroyed[i].will_shatter then return true end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# fix random crashes
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''local edition_effects = eval_card(_card, {cardarea = G.jokers, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, edition = true})'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''if not edition_effects then edition_effects = {} end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# m
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''if self.ability.consumeable or self.ability.set == 'Joker' or (self.area and self.area == G.pack_cards) then'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''if true then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Energia - detect blind skips from tag
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = '''add_tag(_tag.config.ref_table)'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''add_tag(_tag.config.ref_table, true)'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Energia - don't add tags from save load
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''add_tag(_tag)'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''add_tag(_tag, nil, true)'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Beta Deck - merge slots
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''self.consumeables = CardArea('''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''if not G.GAME.modifiers.cry_beta then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''self.discard = CardArea('''
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''else
 | 
					 | 
				
			||||||
self.jokers = CardArea(
 | 
					 | 
				
			||||||
    0, 0,
 | 
					 | 
				
			||||||
    CAI.joker_W+CAI.consumeable_W,
 | 
					 | 
				
			||||||
    CAI.joker_H, 
 | 
					 | 
				
			||||||
    {card_limit = self.GAME.starting_params.joker_slots+self.GAME.starting_params.consumable_slots-1, type = 'joker', highlight_limit = 1e100})
 | 
					 | 
				
			||||||
self.consumeables = self.jokers
 | 
					 | 
				
			||||||
end'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''G.consumeables.T.y = 0'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''G.jokers.T.x = G.hand.T.x - 0.1
 | 
					 | 
				
			||||||
G.jokers.T.y = 0'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Make Perkeo only copy consumables
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''if G.consumeables.cards[1] then'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''local eligibleJokers = {}
 | 
					 | 
				
			||||||
for i = 1, #G.consumeables.cards do
 | 
					 | 
				
			||||||
    if G.consumeables.cards[i].ability.consumeable then
 | 
					 | 
				
			||||||
        eligibleJokers[#eligibleJokers + 1] = G.consumeables.cards[i]
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if #eligibleJokers > 0 then'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''local card = copy_card(pseudorandom_element(G.consumeables.cards, pseudoseed('perkeo')), nil)'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''local card = copy_card(pseudorandom_element(eligibleJokers, pseudoseed('perkeo')), nil)'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# More Beta Deck fixes
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''for i=1, #G.jokers.cards + #G.consumeables.cards do'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
local numcards = #G.jokers.cards + #G.consumeables.cards
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_beta then numcards = #G.jokers.cards end
 | 
					 | 
				
			||||||
for i=1, numcards do'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Poker Hand display can have enhancements
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = '''local card = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.P_CARDS[v[1]], G.P_CENTERS.c_base)'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''local card = Card(0,0, 0.5*G.CARD_W, 0.5*G.CARD_H, G.P_CARDS[v[1]], G.P_CENTERS[v[3] or 'c_base'])'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Adds G.GAME.modifiers.cry_forced_draw_amount
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = 'local hand_space = e or math.min(#G.deck.cards, G.hand.config.card_limit - #G.hand.cards)'
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_forced_draw_amount and (G.GAME.current_round.hands_played > 0 or G.GAME.current_round.discards_used > 0) then
 | 
					 | 
				
			||||||
	hand_space = math.min(#G.deck.cards, G.GAME.modifiers.cry_forced_draw_amount)
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# adds oldbp blueprint corruption
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = 'if _pool_size == 0 then'
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.oldbpfactor and G.GAME.oldbpfactor >= 2 then
 | 
					 | 
				
			||||||
	if _type == 'Joker' and (_rarity == nil or type(_rarity) ~= "string") and not _legendary and not (G.GAME.used_jokers["j_blueprint"] and not next(find_joker("Showman"))) then
 | 
					 | 
				
			||||||
		for i = 1, math.floor(G.GAME.oldbpfactor - 1) do
 | 
					 | 
				
			||||||
			_pool[#_pool + 1] = "j_blueprint"
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# end of shop decrement
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = 'G.SHOP_SIGN.alignment.offset.y = -15'
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.oldbpfactor then G.GAME.oldbpfactor = math.max(G.GAME.oldbpfactor - G.GAME.oldbpfactor/8, 1) end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Make Loopy reset here so it retriggers everything before resetting regardless of position
 | 
					 | 
				
			||||||
# Makes Old Blueprint self-destruct after triggering other end of round effects
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					 | 
				
			||||||
pattern = '''if G.GAME.round_resets.temp_reroll_cost then G.GAME.round_resets.temp_reroll_cost = nil; calculate_reroll_cost(true) end'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
for _, v in pairs(find_joker("cry-loopy")) do
 | 
					 | 
				
			||||||
	if v.ability.extra.retrigger ~= 0 then 
 | 
					 | 
				
			||||||
		v.ability.extra.retrigger = 0
 | 
					 | 
				
			||||||
		card_eval_status_text(v, 'extra', nil, nil, nil, {message = localize("k_reset"), colour = G.C.GREEN})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
for i = 1, #G.jokers.cards do
 | 
					 | 
				
			||||||
	G.jokers.cards[i]:calculate_joker({end_of_round2 = true})
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,519 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Randomize poker hands after RNG is set up
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "self.GAME.pseudorandom.hashed_seed = pseudohash(self.GAME.pseudorandom.seed)"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_misprint_min and not args.savetext then
 | 
					 | 
				
			||||||
    for k, v in pairs(G.GAME.hands) do
 | 
					 | 
				
			||||||
        v.chips = to_big(cry_format(v.chips * cry_log_random(pseudoseed('cry_misprint'),G.GAME.modifiers.cry_misprint_min,G.GAME.modifiers.cry_misprint_max),"%.2g"))
 | 
					 | 
				
			||||||
        v.mult = to_big(cry_format(v.mult * cry_log_random(pseudoseed('cry_misprint'),G.GAME.modifiers.cry_misprint_min,G.GAME.modifiers.cry_misprint_max),"%.2g"))
 | 
					 | 
				
			||||||
        v.l_chips = cry_format(v.l_chips * cry_log_random(pseudoseed('cry_misprint'),G.GAME.modifiers.cry_misprint_min,G.GAME.modifiers.cry_misprint_max),"%.2g")
 | 
					 | 
				
			||||||
        v.l_mult = cry_format(v.l_mult * cry_log_random(pseudoseed('cry_misprint'),G.GAME.modifiers.cry_misprint_min,G.GAME.modifiers.cry_misprint_max),"%.2g")
 | 
					 | 
				
			||||||
        v.s_chips = v.chips
 | 
					 | 
				
			||||||
        v.s_mult = v.mult
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Packs
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "create_shop_card_ui(card, 'Booster', G.shop_booster)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
cry_misprintize(card)
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Prevent pack softlocks
 | 
					 | 
				
			||||||
# Off by One Error effect
 | 
					 | 
				
			||||||
# Booster Tag effect 
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "G.GAME.pack_choices = self.config.center.config.choose or 1"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
G.GAME.pack_choices = ((self.ability.choose and self.ability.extra) and math.min(math.floor(self.ability.extra), self.ability.choose)) or 1
 | 
					 | 
				
			||||||
if G.GAME.modifiers.cry_misprint_min then
 | 
					 | 
				
			||||||
    G.GAME.pack_size = self.ability.extra
 | 
					 | 
				
			||||||
    if G.GAME.pack_size < 1 then G.GAME.pack_size = 1 end
 | 
					 | 
				
			||||||
    self.ability.extra = G.GAME.pack_size
 | 
					 | 
				
			||||||
    G.GAME.pack_choices = math.min(math.floor(G.GAME.pack_size), self.ability.choose)
 | 
					 | 
				
			||||||
    --G.GAME.pack_choices = math.min(math.floor(G.GAME.pack_size),cry_format(G.GAME.pack_choices * cry_log_random(pseudoseed('cry_misprint_p'..G.GAME.round_resets.ante),G.GAME.modifiers.cry_misprint_min,G.GAME.modifiers.cry_misprint_max),"%.2f"))
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.cry_oboe then
 | 
					 | 
				
			||||||
    self.ability.extra = self.ability.extra + G.GAME.cry_oboe
 | 
					 | 
				
			||||||
    G.GAME.pack_choices = G.GAME.pack_choices + G.GAME.cry_oboe
 | 
					 | 
				
			||||||
    G.GAME.cry_oboe = nil
 | 
					 | 
				
			||||||
    G.GAME.pack_size = self.ability.extra
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if G.GAME.boostertag then
 | 
					 | 
				
			||||||
    self.ability.extra = self.ability.extra * 2
 | 
					 | 
				
			||||||
    G.GAME.pack_choices = G.GAME.pack_choices * 2
 | 
					 | 
				
			||||||
    G.GAME.boostertag = nil
 | 
					 | 
				
			||||||
    G.GAME.pack_size = self.ability.extra
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name:find('Arcana') then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if self.ability.extra < 1 then self.ability.extra = 1 end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Vouchers
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "create_shop_card_ui(card, 'Voucher', G.shop_vouchers)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
cry_misprintize(card)
 | 
					 | 
				
			||||||
if G.GAME.events.ev_cry_choco2 then
 | 
					 | 
				
			||||||
    card.misprint_cost_fac = (card.misprint_cost_fac or 1) * 2
 | 
					 | 
				
			||||||
    card:set_cost()
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "tag.lua"
 | 
					 | 
				
			||||||
pattern = "create_shop_card_ui(card, 'Voucher', G.shop_vouchers)"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
cry_misprintize(card)
 | 
					 | 
				
			||||||
if G.GAME.events.ev_cry_choco2 then
 | 
					 | 
				
			||||||
    card.misprint_cost_fac = (card.misprint_cost_fac or 1) * 2
 | 
					 | 
				
			||||||
    card:set_cost()
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Fractional Ante Bugs
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "G.GAME.round_resets.ante = G.GAME.round_resets.ante + mod"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = "G.GAME.round_resets.ante = Big and (to_number(math.floor(to_big(G.GAME.round_resets.ante)))) or math.floor(G.GAME.round_resets.ante)"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# UI Bugs
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "_size*G.CARD_W,"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "math.max(1,math.min(_size,5))*G.CARD_W,"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "_size*G.CARD_W*1.1,"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "math.max(1,math.min(_size,5))*G.CARD_W*1.1,"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "_size*G.CARD_W*1.1 + 0.5,"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "math.max(1,math.min(_size,5))*G.CARD_W*1.1 + 0.5,"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = "{card_limit = _size, type = 'consumeable', highlight_limit = 1}"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "{card_limit = math.max(1,_size), type = 'consumeable', highlight_limit = 1}"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Death and a CCD Patch
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.consumeable.mod_num >= #G.hand.highlighted and #G.hand.highlighted >= (self.ability.consumeable.min_highlighted or 1) then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if (self.ability.consumeable.mod_num - ((G.GAME.modifiers.cry_consumable_reduce and (self.ability.name ~= 'Death')) and (self.ability.consumeable.mod_num > 1) and 1 or 0)) >= #G.hand.highlighted + (self.area == G.hand and -1 or 0) and #G.hand.highlighted + (self.area == G.hand and -1 or 0) >= 1 then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# mod_num has no limit
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "self.ability.consumeable.mod_num = math.min(5, self.ability.consumeable.max_highlighted)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "self.ability.consumeable.mod_num = self.ability.consumeable.max_highlighted"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Infinite Deck
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "cardarea.lua"
 | 
					 | 
				
			||||||
pattern = "self.config.highlighted_limit = config.highlight_limit or 5"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "self.config.highlighted_limit = config.highlight_limit or G.GAME.modifiers.cry_highlight_limit or 5"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = "if #G.hand.highlighted <= 0 or G.GAME.blind.block_play or #G.hand.highlighted > 5 then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "if #G.hand.highlighted <= (G.GAME.blind and G.GAME.blind.name == 'cry-Sapphire Stamp' and not G.GAME.blind.disabled and 1 or 0) or G.GAME.blind.block_play then"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Hieroglyph
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "ease_ante(-center_table.extra)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = "ease_ante(math.floor(-center_table.extra))"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Get Cryptid to display and work with card selections
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "elseif _c.name == 'Cryptid' then loc_vars = {_c.config.extra}"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''elseif _c.name == 'Cryptid' then loc_vars = {_c.config.extra, _c.config.max_highlighted}
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = 'local _card = copy_card(G.hand.highlighted[1], nil, nil, G.playing_card)'
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
for q = 1, #G.hand.highlighted do
 | 
					 | 
				
			||||||
local _card = copy_card(G.hand.highlighted[q], nil, nil, G.playing_card)
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "new_cards[#new_cards+1] = _card"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = "end"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Get seal spectrals to display and work with card selections
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''
 | 
					 | 
				
			||||||
(?<indent>[\t ]*)elseif _c\.set == 'Spectral' then '''
 | 
					 | 
				
			||||||
position = 'after'
 | 
					 | 
				
			||||||
# match_indent = true
 | 
					 | 
				
			||||||
line_prepend = '$indent    '
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if _c.name == 'Talisman' or _c.name == 'Medium' or _c.name == 'Trance' or _c.name == 'Deja Vu' then 
 | 
					 | 
				
			||||||
    loc_vars = {_c.config.max_highlighted}
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = 'local conv_card = G.hand.highlighted[1]'
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
for q = 1, #G.hand.highlighted do
 | 
					 | 
				
			||||||
local conv_card = G.hand.highlighted[q]
 | 
					 | 
				
			||||||
G.E_MANAGER:add_event(Event({func = function()
 | 
					 | 
				
			||||||
    play_sound('tarot1')
 | 
					 | 
				
			||||||
    used_tarot:juice_up(0.3, 0.5)
 | 
					 | 
				
			||||||
    return true end }))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
G.E_MANAGER:add_event(Event({trigger = 'after',delay = 0.1,func = function()
 | 
					 | 
				
			||||||
    conv_card:set_seal(self.ability.extra, nil, true)
 | 
					 | 
				
			||||||
    return true end }))
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
delay(0.5)
 | 
					 | 
				
			||||||
G.E_MANAGER:add_event(Event({trigger = 'after', delay = 0.2,func = function() G.hand:unhighlight_all(); return true end }))
 | 
					 | 
				
			||||||
end--[[
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.ability.name == 'Aura' then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = "--]]"
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Fractional pricing
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "self.cost = math.max(1, math.floor((self.base_cost + self.extra_cost + 0.5)*(100-G.GAME.discount_percent)/100))"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
    if self.ability.set == 'Joker' then 
 | 
					 | 
				
			||||||
        self.cost = cry_format(self.cost * G.GAME.cry_shop_joker_price_modifier,'%.2f') end
 | 
					 | 
				
			||||||
    if self.misprint_cost_fac then 
 | 
					 | 
				
			||||||
        self.cost = cry_format(self.cost * self.misprint_cost_fac,'%.2f') 
 | 
					 | 
				
			||||||
    if not G.GAME.modifiers.cry_misprint_min then self.cost = math.floor(self.cost) end end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# welcome to hell, enjoy your stay (initialise center copy)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = "self.GAME.selected_back_key = selected_back"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
G.GAME.cry_voucher_centers = {}
 | 
					 | 
				
			||||||
for k, v in pairs(G.P_CENTERS) do
 | 
					 | 
				
			||||||
	if v.set == 'Voucher' then
 | 
					 | 
				
			||||||
		G.GAME.cry_voucher_centers[k] = {config = {}}
 | 
					 | 
				
			||||||
		G.GAME.cry_voucher_centers[k].config = copy_table(v.config)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# when voucher is redeemed, save ability to center copy
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if self.shop_voucher then G.GAME.current_round.voucher = nil end"
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
G.GAME.cry_voucher_centers[self.config.center_key].config.extra = self.ability.extra
 | 
					 | 
				
			||||||
if self.ability.extra_disp then G.GAME.cry_voucher_centers[self.config.center_key].config.extra_disp = self.ability.extra_disp end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# extra override
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "extra = center and center.config.extra or self and self.ability.extra"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
extra = self and G.GAME.cry_voucher_centers[self.config.center_key].config.extra or center and center.config.extra
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# the d in disp stands for disparity (match internal values to display values)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "if center_table.name == 'Overstock' or center_table.name == 'Overstock Plus' then"
 | 
					 | 
				
			||||||
position = "before"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if not center_table.extra then center_table.extra = center and center.config.extra end	-- catch
 | 
					 | 
				
			||||||
if self and self.ability and self.ability.extra_disp then
 | 
					 | 
				
			||||||
	local up = false
 | 
					 | 
				
			||||||
	if center_table.name == 'Tarot Tycoon' or center_table.name == 'Planet Tycoon' then
 | 
					 | 
				
			||||||
		up = true
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local og_extra = 9.6/4
 | 
					 | 
				
			||||||
	local og_disp = 2
 | 
					 | 
				
			||||||
	if up == true then
 | 
					 | 
				
			||||||
		og_extra = 32/4
 | 
					 | 
				
			||||||
		og_disp = 4
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	local misprint_diff = self.ability.extra_disp / og_disp
 | 
					 | 
				
			||||||
	G.GAME.cry_voucher_centers[self.config.center_key].config.extra = og_extra*misprint_diff
 | 
					 | 
				
			||||||
	center_table.extra = og_extra*misprint_diff
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# I LOVE HARDCODING
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "G.hand:change_size(1)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
G.hand:change_size(center_table.extra)
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# YOU LOVE HARDCODING
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = "change_shop_size(1)"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
change_shop_size(center_table.extra)
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# WE ALL LOVE HARDCODING
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''if center_table\.name \=\= 'Antimatter' then\n\s+G\.E_MANAGER\:add_event\(Event\(\{func = function\(\)\n\s+if G\.jokers then \n\s+G\.jokers\.config\.card_limit \= G\.jokers\.config\.card_limit \+ 1\n\s+end\n\s+return true end \}\)\)\n\s+end'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
    if center_table.name == 'Antimatter' then
 | 
					 | 
				
			||||||
        G.E_MANAGER:add_event(Event({func = function()
 | 
					 | 
				
			||||||
            if G.jokers then 
 | 
					 | 
				
			||||||
                G.jokers.config.card_limit = G.jokers.config.card_limit + center_table.extra
 | 
					 | 
				
			||||||
            end
 | 
					 | 
				
			||||||
            return true end }))
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# AAAA
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''if center_table\.name \=\= 'Crystal Ball' then\n\s+G\.E_MANAGER:add_event\(Event\(\{func \= function\(\)\n\s+G\.consumeables\.config\.card_limit \= G.consumeables\.config\.card_limit \+ 1\n\s+return true end }\)\)\n\s+end'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
    if center_table.name == 'Crystal Ball' then
 | 
					 | 
				
			||||||
        G.E_MANAGER:add_event(Event({func = function()
 | 
					 | 
				
			||||||
            G.consumeables.config.card_limit = G.consumeables.config.card_limit + center_table.extra
 | 
					 | 
				
			||||||
            return true end }))
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# anyway how's your day going?
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''elseif _c.name == "Clearance Sale" or _c.name == "Liquidation" then loc_vars = {_c.config.extra}'''
 | 
					 | 
				
			||||||
position = "after"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
elseif _c.name == "Crystal Ball" or _c.name == "Omen Globe" then loc_vars = {_c.config.extra}
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# doing pretty good myself
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''if _c.name == "Overstock" or _c.name == 'Overstock Plus' then'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if _c.name == "Overstock" or _c.name == "Overstock Plus" then loc_vars = {_c.config.extra}
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# spent the whole day reviving misprinted vouchers
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = '''elseif _c.name == "Blank" or _c.name == "Antimatter" then'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
elseif _c.name == "Blank" or _c.name == "Antimatter" then loc_vars = {_c.config.extra}
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# tbf, more like half
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.regex]
 | 
					 | 
				
			||||||
target = "card.lua"
 | 
					 | 
				
			||||||
pattern = '''message = localize\{type = 'variable', key = 'a_xmult', vars = \{G.P_CENTERS.v_observatory.config.extra}},\n\s+Xmult_mod = G.P_CENTERS.v_observatory.config.extra'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
                    message = localize{type = 'variable', key = 'a_xmult', vars = {G.GAME.cry_voucher_centers['v_observatory'].config.extra}},
 | 
					 | 
				
			||||||
                    Xmult_mod = G.GAME.cry_voucher_centers['v_observatory'].config.extra
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# but whatever, not like i was doing anything anyway
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/UI_definitions.lua"
 | 
					 | 
				
			||||||
pattern = '''UIBox_button({label = {localize('b_reroll_boss'), localize('$')..'10'}, button = "reroll_boss", func = 'reroll_boss_button'}) or nil'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
UIBox_button({label = {localize('b_reroll_boss'), localize('$')..cry_cheapest_boss_reroll()}, button = "reroll_boss", func = 'reroll_boss_button'}) or nil
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# worth it in the end ig, it was bugging me
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = '''if ((G.GAME.dollars-G.GAME.bankrupt_at) - 10 >= 0) and'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if ((to_big(G.GAME.dollars)-to_big(G.GAME.bankrupt_at)) - to_big(cry_cheapest_boss_reroll()) >= to_big(0)) and
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# see you around
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/button_callbacks.lua"
 | 
					 | 
				
			||||||
pattern = '''if not G.from_boss_tag then ease_dollars(-10) end'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
if not G.from_boss_tag then ease_dollars(-cry_cheapest_boss_reroll()) end
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# hi i'm back and i'm fixing this thing that breaks sometimes for no reason (it really shouldn't)
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''v_overstock_norm =  {order = 1,     discovered = false, unlocked = true , available = true, cost = 10, name = "Overstock", pos = {x=0,y=0}, set = "Voucher", config = {}},'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
v_overstock_norm =  {order = 1,     discovered = false, unlocked = true , available = true, cost = 10, name = "Overstock", pos = {x=0,y=0}, set = "Voucher", config = {extra = 1}},
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''v_crystal_ball=     {order = 9,    discovered = false, unlocked = true , available = true, cost = 10, name = "Crystal Ball", pos = {x=2,y=2}, set = "Voucher", config = {extra = 3}},'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
v_crystal_ball=     {order = 9,    discovered = false, unlocked = true , available = true, cost = 10, name = "Crystal Ball", pos = {x=2,y=2}, set = "Voucher", config = {extra = 1}},
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''v_overstock_plus=   {order = 2,     discovered = false, unlocked = false, available = true, cost = 10, name = "Overstock Plus", pos = {x=0,y=1}, set = "Voucher", config = {}, requires = {'v_overstock_norm'},unlock_condition = {type = 'c_shop_dollars_spent', extra = 2500}},'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
v_overstock_plus=   {order = 2,     discovered = false, unlocked = false, available = true, cost = 10, name = "Overstock Plus", pos = {x=0,y=1}, set = "Voucher", config = {extra = 1}, requires = {'v_overstock_norm'},unlock_condition = {type = 'c_shop_dollars_spent', extra = 2500}},
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "game.lua"
 | 
					 | 
				
			||||||
pattern = '''v_antimatter=       {order = 24,    discovered = false, unlocked = false, available = true, cost = 10, name = "Antimatter", pos = {x=7,y=1}, set = "Voucher", config = {extra = 15}, requires = {'v_blank'},unlock_condition = {type = 'blank_redeems', extra = 10}},'''
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
v_antimatter=       {order = 24,    discovered = false, unlocked = false, available = true, cost = 10, name = "Antimatter", pos = {x=7,y=1}, set = "Voucher", config = {extra = 1}, requires = {'v_blank'},unlock_condition = {type = 'blank_redeems', extra = 10}},
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,27 +0,0 @@
 | 
				
			||||||
[manifest]
 | 
					 | 
				
			||||||
version = "1.0.0"
 | 
					 | 
				
			||||||
dump_lua = true
 | 
					 | 
				
			||||||
priority = -1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Lapio softlock mechanic
 | 
					 | 
				
			||||||
[[patches]]
 | 
					 | 
				
			||||||
[patches.pattern]
 | 
					 | 
				
			||||||
target = "functions/common_events.lua"
 | 
					 | 
				
			||||||
pattern = "if (not v.config.softlock or G.GAME.hands[v.config.hand_type].played > 0) then"
 | 
					 | 
				
			||||||
position = "at"
 | 
					 | 
				
			||||||
payload = '''
 | 
					 | 
				
			||||||
local softlocked = true
 | 
					 | 
				
			||||||
if not v.config.softlock then
 | 
					 | 
				
			||||||
    softlocked = false
 | 
					 | 
				
			||||||
elseif v.config.hand_type then
 | 
					 | 
				
			||||||
    softlocked = G.GAME.hands[v.config.hand_type].played == 0
 | 
					 | 
				
			||||||
elseif v.config.hand_types then
 | 
					 | 
				
			||||||
    for _, h in pairs(v.config.hand_types) do
 | 
					 | 
				
			||||||
        if G.GAME.hands[h].played > 0 then
 | 
					 | 
				
			||||||
            softlocked = false
 | 
					 | 
				
			||||||
        end
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
if not softlocked then
 | 
					 | 
				
			||||||
'''
 | 
					 | 
				
			||||||
match_indent = true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@ function cry_prob(owned, den, rigged)
 | 
				
			||||||
	if rigged then
 | 
						if rigged then
 | 
				
			||||||
		return den
 | 
							return den
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		return prob*owned
 | 
							if owned then return prob*owned else return prob end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
'''
 | 
					'''
 | 
				
			||||||
| 
						 | 
					@ -76,14 +76,26 @@ elseif _c.effect == 'Glass Card' then loc_vars = {cfg.Xmult, cfg.cry_prob and cr
 | 
				
			||||||
match_indent = true
 | 
					match_indent = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# wow this is a fat line
 | 
					# wow this is a fat line
 | 
				
			||||||
 | 
					# Yellow Stake - Glass can't destroy Eternals
 | 
				
			||||||
 | 
					# Glass Stake - Any card can shatter
 | 
				
			||||||
[[patches]]
 | 
					[[patches]]
 | 
				
			||||||
[patches.pattern]
 | 
					[patches.pattern]
 | 
				
			||||||
target = "functions/state_events.lua"
 | 
					target = "functions/state_events.lua"
 | 
				
			||||||
pattern = '''if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and not scoring_hand[i].debuff and pseudorandom('glass') < G.GAME.probabilities.normal/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then'''
 | 
					pattern = '''if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and not scoring_hand[i].debuff and pseudorandom('glass') < G.GAME.probabilities.normal/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then'''
 | 
				
			||||||
position = "at"
 | 
					position = "at"
 | 
				
			||||||
payload = '''
 | 
					payload = '''
 | 
				
			||||||
if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and not scoring_hand[i].debuff and pseudorandom('glass') < cry_prob(scoring_hand[i].ability.cry_prob, scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra, scoring_hand[i].ability.cry_rigged)/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then
 | 
					if (SMODS.has_enhancement(scoring_hand[i], 'm_glass')
 | 
				
			||||||
'''
 | 
					   and not scoring_hand[i].debuff
 | 
				
			||||||
 | 
					   and pseudorandom('glass') < cry_prob(
 | 
				
			||||||
 | 
					        scoring_hand[i].ability.cry_prob,
 | 
				
			||||||
 | 
					        scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra,
 | 
				
			||||||
 | 
					        scoring_hand[i].ability.cry_rigged
 | 
				
			||||||
 | 
					      ) / (scoring_hand[i].ability.name == 'Glass Card'
 | 
				
			||||||
 | 
					           and scoring_hand[i].ability.extra
 | 
				
			||||||
 | 
					           or G.P_CENTERS.m_glass.config.extra)
 | 
				
			||||||
 | 
					   or (G.GAME.modifiers.cry_shatter_rate
 | 
				
			||||||
 | 
					       and pseudorandom('cry_shatter') < 1 / G.GAME.modifiers.cry_shatter_rate))
 | 
				
			||||||
 | 
					   and not scoring_hand[i].ability.eternal then'''
 | 
				
			||||||
match_indent = true
 | 
					match_indent = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# wheeeeeeeeeeel
 | 
					# wheeeeeeeeeeel
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||