diff --git a/lovely/weights.toml b/lovely/weights.toml index c2c113a72..f13fc47c7 100644 --- a/lovely/weights.toml +++ b/lovely/weights.toml @@ -77,6 +77,7 @@ self.b_undiscovered = {name = 'Undiscovered', debuff_text = 'Defeat this blind t ''' payload = ''' for key, blind in pairs(self.P_BLINDS) do + blind.set = 'Blind' if blind.boss and blind.boss.max then blind.boss.max = nil if blind.boss.showdown then diff --git a/src/game_object.lua b/src/game_object.lua index 9f7242eb4..7b36690d8 100644 --- a/src/game_object.lua +++ b/src/game_object.lua @@ -1282,6 +1282,14 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj. desc_nodes[#desc_nodes + 1] = res.main_end end desc_nodes.background_colour = res.background_colour + end, + has_attribute = function(self, attribute) + if not SMODS.Attributes[attribute] or not self.attributes then return false end + if self.attributes[attribute] then return true end + for _, att in ipairs(SMODS.Attributes[attribute].alias or {}) do + if self.attributes[att] then return true end + end + return false end } @@ -1838,6 +1846,22 @@ SMODS.UndiscoveredCompat = { end G.P_BLINDS[self.key] = self if self.modifies_draw then SMODS.Blinds.modifies_draw[self.key] = true end + if self.attributes then + for _, attribute in ipairs(self.attributes) do + if SMODS.Attributes[attribute] then + self.attributes[attribute] = true + SMODS.Attributes[attribute].keys = SMODS.merge_lists({SMODS.Attributes[attribute].keys or {}, {self.key}}) + end + end + end + end, + has_attribute = function(self, attribute) + if not SMODS.Attributes[attribute] or not self.attributes then return false end + if self.attributes[attribute] then return true end + for _, att in ipairs(SMODS.Attributes[attribute].alias or {}) do + if self.attributes[att] then return true end + end + return false end } SMODS.Blind:take_ownership('eye', { @@ -1898,6 +1922,14 @@ SMODS.UndiscoveredCompat = { self.badge_to_key[self.key:lower() .. '_seal'] = self.key SMODS.insert_pool(G.P_CENTER_POOLS[self.set], self) self.rng_buffer[#self.rng_buffer + 1] = self.key + if self.attributes then + for _, attribute in ipairs(self.attributes) do + if SMODS.Attributes[attribute] then + self.attributes[attribute] = true + SMODS.Attributes[attribute].keys = SMODS.merge_lists({SMODS.Attributes[attribute].keys or {}, {self.key}}) + end + end + end end, process_loc_text = function(self) SMODS.process_loc_text(G.localization.descriptions.Other, self.key:lower() .. '_seal', self.loc_txt) @@ -1951,6 +1983,14 @@ SMODS.UndiscoveredCompat = { create_fake_card = function(self) return { ability = { seal = copy_table(self.config) }, fake_card = self.key } end, + has_attribute = function(self, attribute) + if not SMODS.Attributes[attribute] or not self.attributes then return false end + if self.attributes[attribute] then return true end + for _, att in ipairs(SMODS.Attributes[attribute].alias or {}) do + if self.attributes[att] then return true end + end + return false + end } for _,v in ipairs { 'Purple', 'Gold', 'Blue', 'Red' } do SMODS.Seal:take_ownership(v, { badge_colour = G.C[v:upper()], pos = G.shared_seals[v].sprite_pos, generate_ui = SMODS.Seal.generate_ui }) @@ -3050,6 +3090,14 @@ SMODS.UndiscoveredCompat = { inject = function(self) G.P_TAGS[self.key] = self SMODS.insert_pool(G.P_CENTER_POOLS[self.set], self) + if self.attributes then + for _, attribute in ipairs(self.attributes) do + if SMODS.Attributes[attribute] then + self.attributes[attribute] = true + SMODS.Attributes[attribute].keys = SMODS.merge_lists({SMODS.Attributes[attribute].keys or {}, {self.key}}) + end + end + end end, generate_ui = function(self, info_queue, card, desc_nodes, specific_vars, full_UI_table) if not card then @@ -3098,6 +3146,14 @@ SMODS.UndiscoveredCompat = { desc_nodes[#desc_nodes + 1] = res.main_end end desc_nodes.background_colour = res.background_colour + end, + has_attribute = function(self, attribute) + if not SMODS.Attributes[attribute] or not self.attributes then return false end + if self.attributes[attribute] then return true end + for _, att in ipairs(SMODS.Attributes[attribute].alias or {}) do + if self.attributes[att] then return true end + end + return false end } diff --git a/src/game_objects/attributes.lua b/src/game_objects/attributes.lua index d4621e94c..5b38a2374 100644 --- a/src/game_objects/attributes.lua +++ b/src/game_objects/attributes.lua @@ -55,12 +55,15 @@ function SMODS.populate_attributes() end function Card:has_attribute(attribute) - if not SMODS.Attributes[attribute] or not self.config.center.attributes then return false end - if self.config.center.attributes[attribute] then return true end - for _, att in ipairs(SMODS.Attributes[attribute].alias or {}) do - if self.config.center.attributes[att] then return true end - end - return false + return self.config.center:has_attribute(attribute) +end + +function Blind:has_attribute(attribute) + return self.config.center:has_attribute(attribute) +end + +function Tag:has_attribute(attribute) + return self.config.center:has_attribute(attribute) end SMODS.Attribute({ @@ -72,7 +75,11 @@ SMODS.Attribute({ 'j_fibonacci', 'j_abstract', 'j_gros_michel', 'j_even_steven', 'j_scholar', 'j_supernova', 'j_ride_the_bus', 'j_green_joker', 'j_red_card', 'j_erosion', 'j_fortune_teller', 'j_flash', 'j_popcorn', 'j_trousers', 'j_walkie_talkie', 'j_smiley', - 'j_swashbuckler', 'j_onyx_agate', 'j_shoot_the_moon', 'j_bootstraps' + 'j_swashbuckler', 'j_onyx_agate', 'j_shoot_the_moon', 'j_bootstraps', + + 'm_mult', 'm_lucky', + + 'e_holo' } }) @@ -83,7 +90,11 @@ SMODS.Attribute({ 'j_banner', 'j_scary_face', 'j_odd_todd', 'j_scholar', 'j_runner', 'j_ice_cream', 'j_blue_joker', 'j_hiker', 'j_square', 'j_stone', 'j_bull', 'j_walkie_talkie', 'j_castle', 'j_arrowhead', 'j_wee', - 'j_stuntman' + 'j_stuntman', + + 'm_bonus', 'm_stone', + + 'e_foil' } }) @@ -96,7 +107,13 @@ SMODS.Attribute({ 'j_ancient', 'j_ramen', 'j_campfire', 'j_acrobat', 'j_throwback', 'j_bloodstone', 'j_glass', 'j_flower_pot', 'j_idol', 'j_seeing_double', 'j_hit_the_road', 'j_duo', 'j_trio', 'j_family', 'j_order', 'j_tribe', - 'j_drivers_license', 'j_caino', 'j_triboulet', 'j_yorick' + 'j_drivers_license', 'j_caino', 'j_triboulet', 'j_yorick', + + 'm_glass', 'm_steel', + + 'v_observatory', + + 'e_polychrome' } }) @@ -131,7 +148,9 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'retrigger', keys = { - 'j_mime', 'j_dusk', 'j_hack', 'j_selzer', 'j_sock_and_buskin', 'j_hanging_chad' + 'j_mime', 'j_dusk', 'j_hack', 'j_selzer', 'j_sock_and_buskin', 'j_hanging_chad', + + 'Red' -- seal } }) @@ -152,7 +171,14 @@ SMODS.Attribute({ keys = { 'j_marble', 'j_8_ball', 'j_dna', 'j_sixth_sense', 'j_superposition', 'j_seance', 'j_riff_raff', 'j_vagabond', 'j_hallucination', 'j_diet_cola', - 'j_certificate', 'j_invisible', 'j_cartomancer', 'j_perkeo' + 'j_certificate', 'j_invisible', 'j_cartomancer', 'j_perkeo', + + 'c_fool', 'c_high_priestess', 'c_emperor', 'c_judgement', + 'c_familiar', 'c_grim', 'c_incantation', 'c_wraith', 'c_ankh','c_cryptid', + + 'tag_uncommon', 'tag_rare', 'tag_double', 'tag_top_up', + + 'Blue', 'Purple' -- seal } }) @@ -162,34 +188,56 @@ SMODS.Attribute({ 'j_greedy_joker', 'j_lusty_joker', 'j_wrathful_joker', 'j_gluttenous_joker', 'j_smeared', 'j_castle', 'j_ancient', 'j_seeing_double', 'j_blackboard', 'j_flower_pot', 'j_idol', 'j_rough_gem', 'j_bloodstone', 'j_arrowhead', 'j_onyx_agate', + + 'c_star', 'c_moon', 'c_sun', 'c_world', 'c_sigil', + + 'm_wild', + + 'bl_club', 'bl_goad', 'bl_head', 'bl_window' } }) SMODS.Attribute({ key = 'diamonds', keys = { - 'j_greedy_joker', 'j_smeared', 'j_rough_gem' + 'j_greedy_joker', 'j_smeared', 'j_rough_gem', + + 'c_star', + + 'bl_window' } }) SMODS.Attribute({ key = 'hearts', keys = { - 'j_lusty_joker', 'j_smeared', 'j_bloodstone' + 'j_lusty_joker', 'j_smeared', 'j_bloodstone', + + 'c_sun', + + 'bl_head' } }) SMODS.Attribute({ key = 'spades', keys = { - 'j_wrathful_joker', 'j_smeared', 'j_arrowhead', 'j_blackboard' + 'j_wrathful_joker', 'j_smeared', 'j_arrowhead', 'j_blackboard', + + 'c_world', + + 'bl_goad' } }) SMODS.Attribute({ key = 'clubs', keys = { - 'j_gluttenous_joker', 'j_smeared', 'j_onyx_agate', 'j_seeing_double', 'j_blackboard' + 'j_gluttenous_joker', 'j_smeared', 'j_onyx_agate', 'j_seeing_double', 'j_blackboard', + + 'c_moon', + + 'bl_club' } }) @@ -201,7 +249,14 @@ SMODS.Attribute({ 'j_four_fingers', 'j_supernova', 'j_runner', 'j_superposition', 'j_todo_list', 'j_seance', 'j_shortcut', 'j_obelisk', 'j_trousers', 'j_duo', 'j_trio', 'j_family', 'j_order', 'j_tribe', - 'j_burnt', 'j_card_sharp', 'j_space' + 'j_burnt', 'j_card_sharp', 'j_space', + + 'c_mercury', 'c_venus', 'c_earth', 'c_mars', 'c_jupiter', 'c_saturn', + 'c_uranus', 'c_neptune', 'c_pluto', 'c_planet_x', 'c_ceres', 'c_eris', + + 'v_telescope', 'v_observatory', + + 'bl_ox', 'bl_mouth', 'bl_eye' } }) @@ -211,98 +266,126 @@ SMODS.Attribute({ 'j_8_ball', 'j_raised_fist', 'j_fibonacci', 'j_hack', 'j_even_steven', 'j_odd_todd', 'j_scholar', 'j_sixth_sense', 'j_superposition', 'j_cloud_9', 'j_mail', 'j_walkie_talkie', 'j_wee', 'j_idol', 'j_hit_the_road', 'j_baron', - 'j_shoot_the_moon', 'j_triboulet' + 'j_shoot_the_moon', 'j_triboulet', + + 'c_strength', 'c_familiar', 'c_grim', 'c_incantation', 'c_ouija' } }) SMODS.Attribute({ key = 'ace', keys = { - 'j_fibonacci', 'j_odd_todd', 'j_scholar', 'j_superposition' + 'j_fibonacci', 'j_odd_todd', 'j_scholar', 'j_superposition', + + 'c_grim' } }) SMODS.Attribute({ key = 'two', keys = { - 'j_fibonacci', 'j_hack', 'j_even_steven', 'j_wee' + 'j_fibonacci', 'j_hack', 'j_even_steven', 'j_wee', + + 'c_incantation' } }) SMODS.Attribute({ key = 'three', keys = { - 'j_fibonacci', 'j_hack', 'j_odd_todd' + 'j_fibonacci', 'j_hack', 'j_odd_todd', + + 'c_incantation' } }) SMODS.Attribute({ key = 'four', keys = { - 'j_hack', 'j_even_steven', 'j_walkie_talkie' + 'j_hack', 'j_even_steven', 'j_walkie_talkie', + + 'c_incantation' } }) SMODS.Attribute({ key = 'five', keys = { - 'j_fibonacci', 'j_hack', 'j_odd_todd' + 'j_fibonacci', 'j_hack', 'j_odd_todd', + + 'c_incantation' } }) SMODS.Attribute({ key = 'six', keys = { - 'j_even_steven', 'j_sixth_sense' + 'j_even_steven', 'j_sixth_sense', + + 'c_incantation' } }) SMODS.Attribute({ key = 'seven', keys = { - 'j_odd_todd' + 'j_odd_todd', + + 'c_incantation' } }) SMODS.Attribute({ key = 'eight', keys = { - 'j_8_ball', 'j_even_steven', 'j_fibonacci' + 'j_8_ball', 'j_even_steven', 'j_fibonacci', + + 'c_incantation' } }) SMODS.Attribute({ key = 'nine', keys = { - 'j_odd_todd', 'j_cloud_9' + 'j_odd_todd', 'j_cloud_9', + + 'c_incantation' } }) SMODS.Attribute({ key = 'ten', keys = { - 'j_even_steven', 'j_walkie_talkie' + 'j_even_steven', 'j_walkie_talkie', + + 'c_incantation' } }) SMODS.Attribute({ key = 'jack', keys = { - 'j_hit_the_road' + 'j_hit_the_road', + + 'c_familiar' } }) SMODS.Attribute({ key = 'queen', keys = { - 'j_shoot_the_moon', 'j_triboulet' + 'j_shoot_the_moon', 'j_triboulet', + + 'c_familiar' } }) SMODS.Attribute({ key = 'king', keys = { - 'j_baron', 'j_triboulet' + 'j_baron', 'j_triboulet', + + 'c_familiar' } }) @@ -311,7 +394,11 @@ SMODS.Attribute({ keys = { 'j_scary_face', 'j_pareidolia', 'j_business', 'j_ride_the_bus', 'j_faceless', 'j_midas_mask', 'j_photograph', 'j_reserved_parking', - 'j_smiley', 'j_sock_and_buskin', 'j_caino' + 'j_smiley', 'j_sock_and_buskin', 'j_caino', + + 'c_familiar', + + 'bl_mark', 'bl_plant' } }) @@ -333,7 +420,10 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'space', keys = { - 'j_supernova', 'j_space', 'j_constellation', 'j_rocket', 'j_satellite', 'j_astronomer' + 'j_supernova', 'j_space', 'j_constellation', 'j_rocket', 'j_satellite', 'j_astronomer', + + 'c_mercury', 'c_venus', 'c_earth', 'c_mars', 'c_jupiter', 'c_saturn', + 'c_uranus', 'c_neptune', 'c_pluto', 'c_planet_x', 'c_ceres', 'c_eris' } }) @@ -342,7 +432,15 @@ SMODS.Attribute({ keys = { 'j_banner', 'j_mystic_summit', 'j_delayed_grat', 'j_burglar', 'j_faceless', 'j_green_joker', 'j_mail', 'j_drunkard', 'j_trading', 'j_ramen', 'j_castle', - 'j_merry_andy', 'j_hit_the_road', 'j_burnt', 'j_yorick' + 'j_merry_andy', 'j_hit_the_road', 'j_burnt', 'j_yorick', + + 'v_wasteful', 'v_recyclomancy', 'v_petroglyph', + + 'tag_garbage', + + 'bl_hook', 'bl_water', + + 'Purple' -- seal } }) @@ -352,7 +450,26 @@ SMODS.Attribute({ 'j_credit_card', 'j_chaos', 'j_delayed_grat', 'j_business', 'j_egg', 'j_faceless', 'j_todo_list', 'j_cloud_9', 'j_rocket', 'j_gift', 'j_reserved_parking', 'j_mail', 'j_to_the_moon', 'j_golden', - 'j_trading', 'j_ticket', 'j_rough_gem', 'j_matador', 'j_satellite' + 'j_trading', 'j_ticket', 'j_rough_gem', 'j_matador', 'j_satellite', 'j_astronomer', + + 'c_hermit', 'c_temperance', 'c_immolate', + + 'v_clearance_sale', 'v_liquidation', 'v_reroll_surplus', 'v_reroll_glut', 'v_seed_money', 'v_money_tree', + + 'm_gold', 'm_lucky', + + 'tag_investment', 'tag_handy', 'tag_garbage', 'tag_coupon', 'tag_d_six', 'tag_skip', 'tag_economy', + + 'Gold' -- seal + } +}) + +SMODS.Attribute({ + key = 'lose_economy', + keys = { + 'c_wraith', + + 'bl_ox', 'bl_tooth' } }) @@ -361,6 +478,12 @@ SMODS.Attribute({ keys = { 'j_8_ball', 'j_gros_michel', 'j_business', 'j_space', 'j_cavendish', 'j_hallucination', 'j_reserved_parking', 'j_bloodstone', + + 'c_wheel_of_fortune', + + 'm_glass', 'm_lucky', + + 'bl_wheel' } }) @@ -374,37 +497,137 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'tarot', keys = { - 'j_8_ball', 'j_superposition', 'j_vagabond', 'j_hallucination', 'j_fortune_teller', 'j_cartomancer' + 'j_8_ball', 'j_superposition', 'j_vagabond', 'j_hallucination', 'j_fortune_teller', 'j_cartomancer', + + 'c_fool', 'c_emperor', + + 'v_tarot_merchant', 'v_tarot_tycoon', + + 'p_arcana_normal_1', 'p_arcana_normal_2', 'p_arcana_normal_3', 'p_arcana_normal_4', + 'p_arcana_jumbo_1', 'p_arcana_jumbo_2', 'p_arcana_mega_1', 'p_arcana_mega_2', + + 'Purple' -- seal } }) SMODS.Attribute({ key = 'planet', keys = { - 'j_astronomer', 'j_constellation', 'j_satellite' + 'j_astronomer', 'j_constellation', 'j_satellite', + + 'c_fool', 'c_high_priestess', + + 'v_telescope', 'v_observatory', 'v_planet_merchant', 'v_planet_tycoon', + + 'p_celestial_normal_1', 'p_celestial_normal_2', 'p_celestial_normal_3', 'p_celestial_normal_4', + 'p_celestial_jumbo_1', 'p_celestial_jumbo_2', 'p_celestial_mega_1', 'p_celestial_mega_2', + + 'Blue' -- seal } }) SMODS.Attribute({ key = 'spectral', keys = { - 'j_sixth_sense', 'j_seance' + 'j_sixth_sense', 'j_seance', + + 'v_omen_globe', + + 'p_spectral_normal_1', 'p_spectral_normal_2', 'p_spectral_jumbo_1', 'p_spectral_mega_1' + } +}) + +SMODS.Attribute({ + key = 'consumable', + alias = {'consumeable'}, + keys = { + 'j_perkeo', 'j_astronomer', 'j_constellation', 'j_satellite', 'j_8_ball', 'j_superposition', + 'j_vagabond', 'j_gift', 'j_hallucination', 'j_fortune_teller', 'j_cartomancer', 'j_sixth_sense', 'j_seance', + + 'c_fool', 'c_high_priestess', 'c_emperor', + + 'v_tarot_merchant', 'v_tarot_tycoon', 'v_planet_merchant', 'v_planet_tycoon', + + 'p_arcana_normal_1', 'p_arcana_normal_2', 'p_arcana_normal_3', 'p_arcana_normal_4', + 'p_arcana_jumbo_1', 'p_arcana_jumbo_2', 'p_arcana_mega_1', 'p_arcana_mega_2', + 'p_celestial_normal_1', 'p_celestial_normal_2', 'p_celestial_normal_3', 'p_celestial_normal_4', + 'p_celestial_jumbo_1', 'p_celestial_jumbo_2', 'p_celestial_mega_1', 'p_celestial_mega_2', + 'p_spectral_normal_1', 'p_spectral_normal_2', 'p_spectral_jumbo_1', 'p_spectral_mega_1', + + 'Blue', 'Purple' -- seal + } +}) + +SMODS.Attribute({ + key = 'consumable_slot', + alias = {'consumeable_slot'}, + keys = { + 'v_crystal_ball', + + 'e_negative' + } +}) + +SMODS.Attribute({ + key = 'playing_card', + keys = { + 'j_marble', 'j_dna', 'j_certificate', + + 'c_familiar', 'c_grim', 'c_incantation', 'c_cryptid', + + 'v_magic_trick', 'v_illusion', + + 'p_standard_normal_1', 'p_standard_normal_2', 'p_standard_normal_3', 'p_standard_normal_4', + 'p_standard_jumbo_1', 'p_standard_jumbo_2', 'p_standard_mega_1', 'p_standard_mega_2' } }) SMODS.Attribute({ key = 'joker', - keys = { "j_abstract", "j_riff_raff", "j_swashbuckler", 'j_invisible' } + keys = { + "j_abstract", "j_riff_raff", "j_baseball", "j_swashbuckler", 'j_invisible', 'j_gift', + + 'c_wheel_of_fortune', 'c_temperance', 'c_judgement', 'c_wraith', 'c_ectoplasm', 'c_ankh', 'c_hex', + + 'p_buffoon_normal_1', 'p_buffoon_normal_2', 'p_buffoon_jumbo_1', 'p_buffoon_mega_1', + + 'tag_uncommon', 'tag_rare', 'tag_negative', 'tag_foil', 'tag_holo', 'tag_polychrome', 'tag_top_up', + + 'bl_final_heart' + } }) SMODS.Attribute({ key = 'joker_slot', - keys = { "j_stencil" } + keys = { + "j_stencil", + + 'v_antimatter', + + 'e_negative' + } +}) + +SMODS.Attribute({ + key = 'rarity', + keys = { + 'j_riff_raff', 'j_baseball', + + 'c_wraith', + + 'tag_uncommon', 'tag_rare', 'tag_top_up' + } }) SMODS.Attribute({ key = 'destroy_card', - keys = { "j_ceremonial", "j_madness", "j_trading" } + keys = { + "j_ceremonial", "j_madness", "j_trading", + + 'c_hanged_man', 'c_familiar', 'c_grim', 'c_incantation', 'c_immolate', 'c_ankh', 'c_hex', + + 'm_glass' + } }) SMODS.Attribute({ @@ -418,7 +641,15 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'hands', - keys = { "j_loyalty_card", "j_burglar", "j_troubadour", "j_dusk", "j_acrobat", "j_dna", "j_vagabond" } + keys = { + "j_loyalty_card", "j_burglar", "j_troubadour", "j_dusk", "j_acrobat", "j_dna", "j_vagabond", + + 'v_grabber', 'v_nacho_tong', 'v_hieroglyph', + + 'tag_handy', + + 'bl_needle' + } }) SMODS.Attribute({ @@ -428,12 +659,24 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'enhancements', - keys = { "j_ticket", "j_marble", "j_steel_joker", "j_vampire", "j_midas_mask", "j_stone", "j_lucky_cat", "j_glass", "j_drivers_license" } + keys = { + "j_ticket", "j_marble", "j_steel_joker", "j_vampire", "j_midas_mask", "j_stone", "j_lucky_cat", "j_glass", "j_drivers_license", + + 'c_magician', 'c_empress', 'c_heirophant', 'c_lovers', 'c_chariot', 'c_justice', 'c_devil', 'c_tower', + 'c_familiar', 'c_grim', 'c_incantation', + + 'v_illusion' + } }) SMODS.Attribute({ key = 'modify_card', - keys = { "j_pareidolia", "j_hiker", "j_vampire", "j_midas_mask" } + keys = { + "j_pareidolia", "j_hiker", "j_vampire", "j_midas_mask", + + 'c_magician', 'c_empress', 'c_heirophant', 'c_lovers', 'c_chariot', 'c_justice', 'c_strength', 'c_death', 'c_devil', 'c_tower', + 'c_star', 'c_moon', 'c_sun', 'c_world', 'c_talisman', 'c_aura', 'c_sigil', 'c_ouija', 'c_deja_vu', 'c_trance', 'c_medium' + } }) SMODS.Attribute({ @@ -443,36 +686,79 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'seals', - keys = { "j_certificate" } + keys = { + "j_certificate", + + 'c_talisman', 'c_deja_vu', 'c_trance', 'c_medium', + + 'v_illusion' -- lol + } }) SMODS.Attribute({ - key = 'editions' + key = 'editions', + keys = { + 'c_wheel_of_fortune', 'c_aura', 'c_ectoplasm', 'c_hex', + + 'v_hone', 'v_glow_up', 'v_illusion', + + 'tag_negative', 'tag_foil', 'tag_holo', 'tag_polychrome' + } }) SMODS.Attribute({ key = 'tag', - keys = { 'j_diet_cola' } + keys = { + 'j_diet_cola', + + 'tag_double' + } }) SMODS.Attribute({ key = 'skip', - keys = { 'j_throwback' } + keys = { + 'j_throwback', + + 'tag_skip' + } }) SMODS.Attribute({ key = 'hand_size', - keys = { "j_juggler", "j_turtle_bean", "j_troubadour", "j_merry_andy", "j_stuntman" } + keys = { + "j_juggler", "j_turtle_bean", "j_troubadour", "j_merry_andy", "j_stuntman", + + 'c_ouija', 'c_ectoplasm', + + 'v_paint_brush', 'v_palette', + + 'tag_juggle', + + 'bl_manacle' + } }) SMODS.Attribute({ key = 'reroll', - keys = { "j_chaos", "j_flash" } + keys = { + "j_chaos", "j_flash", + + 'v_reroll_surplus', 'v_reroll_glut', + + 'tag_d_six' + } }) SMODS.Attribute({ key = 'sell_value', - keys = { "j_egg", "j_swashbuckler", "j_ceremonial", "j_gift" } + keys = { + "j_egg", "j_swashbuckler", "j_ceremonial", "j_gift", + + 'c_temperance', + + 'v_clearance_sale', 'v_liquidation' + } }) SMODS.Attribute({ @@ -483,14 +769,20 @@ SMODS.Attribute({ SMODS.Attribute({ key = 'on_sell', keys = { - 'j_luchador', 'j_diet_cola', 'j_invisible' + 'j_luchador', 'j_diet_cola', 'j_invisible', + + 'bl_final_leaf' } }) SMODS.Attribute({ key = 'boss_blind', keys = { - 'j_rocket', 'j_luchador', 'j_campfire', 'j_matador', 'j_chicot' + 'j_rocket', 'j_luchador', 'j_campfire', 'j_matador', 'j_chicot', + + 'v_directors_cut', 'v_retcon', + + 'tag_investment', 'tag_boss' } }) @@ -499,4 +791,72 @@ SMODS.Attribute({ keys = { 'j_hiker' } +}) + +SMODS.Attribute({ + key = 'debuff', + keys = { 'bl_club', 'bl_goad', 'bl_plant', 'bl_head', 'bl_final_leaf', 'bl_window', 'bl_pillar', 'bl_final_heart' } +}) + +SMODS.Attribute({ + key = 'face_down', + keys = { 'bl_fish', 'bl_house', 'bl_mark', 'bl_wheel', 'bl_final_acorn' } +}) + +SMODS.Attribute({ + key = 'large_blind', + keys = { 'bl_wall', 'bl_final_vessel' } +}) + +SMODS.Attribute({ + key = 'position', + keys = { + 'j_blueprint', 'j_ceremonial', 'j_brainstorm', 'j_hanging_chad', 'j_photograph', + + 'c_death' + } +}) + +SMODS.Attribute({ + key = 'shop', + keys = { + 'j_astronomer', 'j_chaos', 'j_flash', + + 'v_overstock_norm', 'v_overstock_plus', 'v_clearance_sale', 'v_liquidation', 'v_reroll_surplus', 'v_reroll_glut', + 'v_tarot_merchant', 'v_tarot_tycoon', 'v_planet_merchant', 'v_planet_tycoon', 'v_magic_trick', 'v_illusion', + + 'tag_uncommon', 'tag_rare', 'tag_negative', 'tag_foil', 'tag_holo', 'tag_polychrome', 'tag_voucher', 'tag_coupon', 'tag_d_six' + } +}) + +SMODS.Attribute({ + key = 'booster', + keys = { + 'j_red_card', 'j_hallucination', 'j_astronomer', + + 'v_omen_globe', 'v_telescope', + + 'tag_standard', 'tag_charm', 'tag_meteor', 'tag_buffoon', 'tag_ethereal' + } +}) + +SMODS.Attribute({ + key = 'hand_level', + keys = { + 'j_space', 'j_burnt', + + 'c_mercury', 'c_venus', 'c_earth', 'c_mars', 'c_jupiter', 'c_saturn', + 'c_uranus', 'c_neptune', 'c_pluto', 'c_planet_x', 'c_ceres', 'c_eris', + + 'tag_orbital', + + 'bl_arm' + } +}) + +SMODS.Attribute({ + key = 'ante', + keys = { + 'v_hieroglyph', 'v_petroglyph' + } }) \ No newline at end of file diff --git a/src/utils/weights.lua b/src/utils/weights.lua index 47f51b614..cbd114166 100644 --- a/src/utils/weights.lua +++ b/src/utils/weights.lua @@ -10,13 +10,17 @@ function SMODS.poll_object(args) -- Prepare pool local pool = args.pool or {} - local types = args.attributes or args.types or {args.type} + if args.type then args.types = {args.type} end + if args.types then args.type = args.types[1] end + local types = args.attributes or args.types -- Populate pool local types_used = {} if not args.pool then pool, types_used = SMODS.create_poll_pool(types, args) + -- pool is naturally empty, should only happen for pool types that allow nil to be returned + if #pool == 0 then return nil end end if args.filter then pool = args.filter(pool) end @@ -210,7 +214,9 @@ end local function SMODS_WEIGHTS_poll_rarity(pool, args) local rarity_poll = pseudorandom(pseudoseed((args.seed or 'smods_cull_rarity')..'_cull' )) -- Generate the poll value + if not SMODS.ObjectTypes[args.type or 'Joker'] then return end local available_rarities = copy_table(SMODS.ObjectTypes[args.type or 'Joker'].rarities) -- Table containing a list of rarities and their rates + if not available_rarities then return end local vanilla_rarities = {["Common"] = 1, ["Uncommon"] = 2, ["Rare"] = 3, ["Legendary"] = 4} local final_rarities = {} @@ -282,8 +288,12 @@ function SMODS.create_poll_pool(labels, args) end return false end - + + local sets = {} for _, label in ipairs(labels) do + if not SMODS.Attributes[label] then + sets[#sets+1] = label + end labels_used[label] = true local temp_pool = {} local join_func = (args.attributes and not args.union) and SMODS.intersect_lists or join_lists @@ -313,10 +323,25 @@ function SMODS.create_poll_pool(labels, args) local temp = pool_exists(final_pool) and final_pool and join_func({final_pool, temp_pool}) or temp_pool final_pool = (args.closest_match and not pool_exists(temp)) and final_pool or temp end + + if args.type == false then + args.types = nil + elseif not args.types then + args.types = {} + if #sets == 0 then + args.types = {'Joker'} + else + for _,v in ipairs(sets) do + args.types[#args.types+1] = v + end + end + end if args.attributes and not args.rarity and args.rarity ~= false then args.rarity = SMODS_WEIGHTS_poll_rarity(final_pool, args) final_pool = SMODS.cull_pool(final_pool, args) + elseif args.types then + final_pool = SMODS.cull_pool(final_pool, args) end local ret_pool = {} @@ -326,7 +351,27 @@ function SMODS.create_poll_pool(labels, args) table.insert(ret_pool, pool[k]) end - if not pool_exists then ret_pool = {{key = 'j_joker', type = 'Joker'}} end + if not pool_exists then + local set = args.types and args.types[1] or 'Joker' + local default + if SMODS.ObjectTypes[set] and SMODS.ObjectTypes[set].default and G.P_CENTERS[SMODS.ObjectTypes[set].default] then default = SMODS.ObjectTypes[set].default + elseif set == 'Tarot' or set == 'Tarot_Planet' then default = "c_strength" + elseif set == 'Planet' then default = "c_pluto" + elseif set == 'Spectral' then default = "c_incantation" + elseif set == 'Voucher' then default = "v_blank" + elseif set == 'Tag' then default = "tag_handy" + elseif set == 'Edition' then default = nil + -- the following 3 are subjective choices i made, they can be changed later if needed + elseif set == 'Enhanced' then default = "c_base" + elseif set == 'Seal' then default = nil + elseif set == 'Blind' then default = "bl_hook" + else default = 'j_joker' end + if default then + ret_pool = {{key = default, type = set}} + else + ret_pool = {} + end + end return ret_pool, labels_used end @@ -441,6 +486,12 @@ function SMODS.cull_pool(pool, args) local _rarity = args.rarity and args.rarity ~= true and args.rarity + if args.types then + for i, v in ipairs(args.types) do + args.types[v] = true + end + end + for _, key in ipairs(pool) do local add = nil local v = G.P_CENTERS[key] @@ -450,7 +501,7 @@ function SMODS.cull_pool(pool, args) if not (G.GAME.used_jokers[v.key] and not pool_opts.allow_duplicates and not SMODS.showman(v.key) and not args.allow_duplicates) and (v.unlocked ~= false or (v.rarity == 4 and args.allow_legendaries)) and (not _rarity or _rarity == v.rarity) then if v.enhancement_gate then add = nil - for kk, vv in pairs(G.playing_cards) do + for kk, vv in pairs(G.playing_cards or {}) do if SMODS.has_enhancement(vv, v.enhancement_gate) then add = true end @@ -460,6 +511,7 @@ function SMODS.cull_pool(pool, args) end end + if args.types and (not args.types[v.set] and not (args.types['Consumeables'] and SMODS.ConsumableTypes[v.set])) then add = nil end if v.no_pool_flag and G.GAME.pool_flags[v.no_pool_flag] then add = nil end if v.yes_pool_flag and not G.GAME.pool_flags[v.yes_pool_flag] then add = nil end @@ -470,6 +522,24 @@ function SMODS.cull_pool(pool, args) else final_pool[#final_pool + 1] = 'UNAVAILABLE' end + else + for set, _p in pairs(SMODS.game_table_from_type) do + v = G[_p][key] + if v then + add = true + break + end + end + + if v then + if args.types and not args.types[v.set] then add = nil end + + if add and not G.GAME.banned_keys[v.key] then + final_pool[#final_pool + 1] = v.key + else + final_pool[#final_pool + 1] = 'UNAVAILABLE' + end + end end end