# can_remove_overtuned_traits
is_phototrophic = {
    OR = {
        has_trait = trait_plantoid_phototrophic
        has_trait = trait_plantoid_radiotrophic
        has_trait = trait_advanced_phototrophic
        has_trait = trait_advanced_radiotrophic
        has_trait = trait_harvested_radiotrophic
        has_trait = trait_lithoid_radiotrophic
        # V_Traits
        inline_script = {
            script = merger_of_rules/toggled_code
            code = "
                has_v_phototrophic_trait = yes
			"
            toggle = @has_v_traits_mod
        }
    }
}

has_phototrophic_energy_upkeep = {
    OR = {
        has_trait = trait_plantoid_phototrophic
        has_trait = trait_advanced_radiotrophic
        # Vanilla
        AND = {
            OR = {
                has_trait = trait_plantoid_radiotrophic
                has_trait = trait_advanced_radiotrophic
                has_trait = trait_harvested_radiotrophic
                has_trait = trait_lithoid_radiotrophic
            }
            planet = { merg_is_nuked = no }
        }
        # V_TRAITS
        inline_script = {
            script = merger_of_rules/toggled_code
            code = "
                has_v_phototrophic_trait = yes
                AND = {
                    OR = {
                        has_trait = trait_plantoid_radiotrophic
                        has_trait = trait_advanced_radiotrophic
                        has_trait = trait_harvested_radiotrophic
                        has_trait = trait_lithoid_radiotrophic
                    }
                    NOT = { planet = { merg_is_nuked = yes } }
                }
			"
            toggle = @has_v_traits_mod
        }
    }
}

has_budding_trait = {
    OR = {
        has_trait = trait_plantoid_budding
        has_trait = trait_lithoid_budding
        has_trait = trait_advanced_budding
        # V_Traits
        inline_script = {
            script = merger_of_rules/toggled_code
            code = "
                has_trait_v_strobilation = yes
			"
            toggle = @has_v_traits_mod
        }
        # Wula Fallen Empire
        inline_script = {
            script = merger_of_rules/toggled_code
            code = "
                has_trait = trait_wula_tietie
			"
            toggle = @wula_compatch_var
        }
    }
}

has_food_upkeep = {
    species = {
        # Can't check is_robotic_species as it will break hybrids like KANSEN.
        OR= {
            is_archetype = BIOLOGICAL
            # Aquatic Portraits mod
            is_archetype = JAYPEES_AQUATIC
            is_archetype = JAYPEES_BRAIN
            is_archetype = JAYPEES_CRAB
            is_archetype = JAYPEES_DOLPHIN
            is_archetype = JAYPEES_DUMBO
            is_archetype = JAYPEES_ELESQUID
            is_archetype = JAYPEES_FISH
            is_archetype = JAYPEES_HAIRTENTACLE
            is_archetype = JAYPEES_SEAL
            is_archetype = JAYPEES_SQUID
            is_archetype = JAYPEES_TURTLEHORSE
            # AshArms Aquarius history
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_archetype = Dolls
				"
                toggle = @asharm_mod
            }
            # Assault Lily
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_archetype = LILY
    			"
                toggle = @change_planet_size_bullet_num
            }
            # Azur Lane Stellaris DLC
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_KANSEN_species = yes
				"
                toggle = @azl_mod
            }
            # Empire of Eeveelution
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_archetype = POKEMON
				"
                toggle = @s7_EOE_cost
            }
            # Expanded Traits, Civics, Pops, and More
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_archetype = HUMANOID
                    is_archetype = MAMMALIAN
                    is_archetype = REPTILIAN
                    is_archetype = AVIAN
                    is_archetype = ARTHROPOID
                    is_archetype = MOLUSCOID
                    is_archetype = FUNGOID
                    is_archetype = PLANTOID
                    is_archetype = NECROID
                    is_archetype = half_species
                    is_archetype = half_species_special
                    is_archetype = half_aberration
                    is_archetype = half_perfect
                    is_archetype = half_amalgamated
				"
                toggle = @expops_compatch_var
            }
            # KDC Story Pack
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
					is_archetype = NANITES_CROP
				"
                toggle = @gray_t1_tech_days
            }
            # Nyto Species Events Pack
            is_archetype = NYTO
            # SW:UnknownWorld Shipgirls Story
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_archetype = STARSHIPGIRLS
				"
                toggle = @swuss_mod
            }
            # Voyage to Eternity
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    KZ_VOY_has_food_upkeep = yes
				"
                toggle = @vte_mod
            }
            # Warship Girls R And MIST Species
            inline_script = {
                script = merger_of_rules/toggled_code
                code = "
                    is_archetype = SHENHAI
                    is_archetype = UNITED_FLEET
                    is_archetype = WARSHIPGIRL
				"
                toggle = @wsg_mod
            }
        }
    }
    NOT = { has_trait = trait_voidling }
}
